-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Revert fix for on_failure_callback when task receives a SIGTERM #30165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
23aa472 to
aa03627
Compare
eejbyfeldt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert sounds like the right choice to me.
I think it could be nice to add the test cases from: #30146 to prevent similarly bad changes being introduced in the future. But maybe that is better done in a followup PR.
aa03627 to
5f066f2
Compare
From the comment on exception handling when a task is killed externally we do not handle callback thus the above fix was made in error. Here's the comment on code: for case when task is marked as success/failed externally or dagrun timed out and task is marked as skipped current behavior doesn't hit the callbacks https://github.com/apache/airflow/blob/b65dbaaf3f21ea5396da121bbfa7f895d0ab8516/airflow/models/taskinstance.py#L1468-L1470
5f066f2 to
ced9f99
Compare
Feel free to make the PR once this is merged. Also we can add a comment on the signal handler itself to say that we don't handle callbacks when tasks are marked failed externally |
Good idea. I think that's the super-easy (though temporary) fix. |
Co-authored-by: Emil Ejbyfeldt <eejbyfeldt@liveintent.com>
* Revert fix for on_failure_callback when task receives a SIGTERM From the comment on exception handling when a task is killed externally we do not handle callback thus the above fix was made in error. Here's the comment on code: for case when task is marked as success/failed externally or dagrun timed out and task is marked as skipped current behavior doesn't hit the callbacks https://github.com/apache/airflow/blob/b65dbaaf3f21ea5396da121bbfa7f895d0ab8516/airflow/models/taskinstance.py#L1468-L1470 * Update tests/models/test_taskinstance.py Co-authored-by: Emil Ejbyfeldt <eejbyfeldt@liveintent.com> --------- Co-authored-by: Emil Ejbyfeldt <eejbyfeldt@liveintent.com> (cherry picked from commit 869c1e3)
* Revert fix for on_failure_callback when task receives a SIGTERM From the comment on exception handling when a task is killed externally we do not handle callback thus the above fix was made in error. Here's the comment on code: for case when task is marked as success/failed externally or dagrun timed out and task is marked as skipped current behavior doesn't hit the callbacks https://github.com/apache/airflow/blob/b65dbaaf3f21ea5396da121bbfa7f895d0ab8516/airflow/models/taskinstance.py#L1468-L1470 * Update tests/models/test_taskinstance.py Co-authored-by: Emil Ejbyfeldt <eejbyfeldt@liveintent.com> --------- Co-authored-by: Emil Ejbyfeldt <eejbyfeldt@liveintent.com> (cherry picked from commit 869c1e3)
From the comment on exception handling when a task is killed externally we do not handle callback thus
the above fix was made in error. Here's the comment on code:
for case when task is marked as success/failed externally
or dagrun timed out and task is marked as skipped
current behavior doesn't hit the callbacks
airflow/airflow/models/taskinstance.py
Lines 1468 to 1470 in b65dbaa
closes: #30146