hkc-8010 commented on code in PR #69821:
URL: https://github.com/apache/airflow/pull/69821#discussion_r3714573030
##########
airflow-core/src/airflow/models/trigger.py:
##########
@@ -604,10 +626,22 @@ def _submit_callback_if_necessary() -> None:
def _push_xcoms_if_necessary() -> None:
"""Pushes XComs to the database if they are provided."""
- if event.xcoms:
+ if event.xcoms and callback_type != TaskInstanceState.UP_FOR_RETRY:
for key, value in event.xcoms.items():
task_instance.xcom_push(key=key, value=value)
+ # Send the callback before handle_failure (mirrors the scheduler
executor-event ordering):
+ # the callback request should reflect the retry/terminal decision derived
above.
Review Comment:
You're right, that comment was stale from the earlier handle_failure
version. I updated it to match the current flow here: we send the callback
before mutating state so it reflects the derived retry vs terminal decision,
then the code either archives the try and sets UP_FOR_RETRY or applies the
terminal state directly.
--
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]