uranusjr commented on code in PR #66767:
URL: https://github.com/apache/airflow/pull/66767#discussion_r3489557331


##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -3530,12 +3530,22 @@ def _purge_task_instances_without_heartbeats(
             # Backfill dag_version_id for legacy tasks (Pydantic requires 
uuid.UUID).
             if not _ensure_ti_has_dag_version_id(ti, session, self.log):
                 continue
+            # ``_purge_task_instances_without_heartbeats`` doesn't load 
``ti.task``, so
+            # ``ti.is_eligible_to_retry()`` takes a fallback branch that 
misclassifies
+            # tasks declared with ``retries=0`` as retry-eligible. Decide 
directly from
+            # ``max_tries`` and ``try_number`` to match the "task loaded" 
branch instead.

Review Comment:
   Also the rewritten logic handles `RESTARTING` differently. Another issue we 
can avoid by piggybacking `is_eligible_to_retry`.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to