You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/09/02 17:08:54 UTC

[GitHub] [airflow] WulkanHefajstos edited a comment on issue #13322: Backfill crashes with "KeyError: TaskInstanceKey" when task has retries

WulkanHefajstos edited a comment on issue #13322:
URL: https://github.com/apache/airflow/issues/13322#issuecomment-911883759


   Hey Guys!
   
   I'm facing similar issue but with `DebugExecutor` (__Airflow 2.1.0__).
   
   I've found two cases when `BackfillJob` fails with the ` KeyError: TaskInstanceKey(....` in `_update_counters` method.
   
   The first one is described in #17305 and the second one occurs when I run tests for tasks that've already been executed with any other executor (hence they already have increased try number in DB).
   
   `DebugExecutor` doesn't execute TI method [check_and_change_state_before_execution](https://github.com/apache/airflow/blob/430976caad5970b718e3dbf5899d4fc879c0ac89/airflow/models/taskinstance.py#L1219) and therefore it doesn't increase `try_number`.
   
   I didn't have much time to investigate it so i might be completely wrong but i think that it works now only thanks to `max(1, self.try_number - 1)` in  `TaskInstanceKey.reduced` property (key and reduced key are always equal to 1) and it breakes every time initial try number is different than 0 (or it's modified when handling reschedule state).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org