kbohra opened a new pull request, #62973:
URL: https://github.com/apache/airflow/pull/62973

   Fix TriggerDagRunOperator to correctly honour retry eligibility when a 
triggered DAG finishes in a failed or timed-out state while the operator is 
waiting for completion.
   
   closes: #62970
   
   Was generative AI tooling used to co-author this PR?
   [x] Yes (please specify the tool below)
   Cursor (tab completion)
   
   ### What this PR changes
   Route both failure paths in _handle_trigger_dag_run() through the existing 
_handle_current_task_failed() helper instead of hard-coding 
TaskInstanceState.FAILED.
   _handle_current_task_failed() already checks ti.should_retry and returns 
UP_FOR_RETRY when retries remain, or FAILED when they are exhausted — so this 
single change covers both the DagRunAlreadyExists conflict path and the 
wait_for_completion polling path.
   Why
   With wait_for_completion=True and retries=N, the operator was silently 
ignoring the retry configuration whenever the triggered DAG reached a failed 
state. The task would transition straight to FAILED regardless of remaining 
retries. The same hard-coded pattern affected the DagRunAlreadyExists path as 
well.
   
   ### Unit Tests
   Added test_handle_trigger_dag_run_wait_for_completion_failed_state_retries 
which simulates a triggered DAG returning FAILED while the parent task instance 
still has should_retry=True, and asserts the outcome is UP_FOR_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