kaxil commented on code in PR #45294:
URL: https://github.com/apache/airflow/pull/45294#discussion_r1923130647
##########
task_sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -535,10 +556,16 @@ def run(ti: RuntimeTaskInstance, log: Logger):
state=TerminalTIState.FAILED,
end_date=datetime.now(tz=timezone.utc),
)
+ get_listener_manager().hook.on_task_instance_failed(
+ previous_state=TaskInstanceState.RUNNING, task_instance=ti
+ )
# TODO: Run task failure callbacks here
except BaseException:
log.exception("Task failed with exception")
# TODO: Run task failure callbacks here
+ get_listener_manager().hook.on_task_instance_failed(
+ previous_state=TaskInstanceState.RUNNING, task_instance=ti
+ )
Review Comment:
Should we move all the calls to `finalize` and we can change sig of finalize
to `state, log` etc?
That might be a better design than putting this on all `except` blocks.
--
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]