Skip to content
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

Fix on_failure_callback when task receives a SIGTERM #29743

Merged

Conversation

ephraimbuddy
Copy link
Contributor

This fixes on_failure_callback when task receives a SIGTERM by raising a different exception in the handler and catching the exception during task execution so we can directly run the failure callback

closes: #25297

This fixes on_failure_callback when task receives a SIGTERM by
raising a different exception in the handler and catching the
exception during task execution so we can directly run the failure
callback
ephraimbuddy and others added 2 commits February 24, 2023 17:48
Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com>
airflow/models/taskinstance.py Outdated Show resolved Hide resolved
airflow/models/taskinstance.py Outdated Show resolved Hide resolved
Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com>
@jedcunningham jedcunningham merged commit 671b88e into apache:main Feb 24, 2023
@jedcunningham jedcunningham deleted the fix-task-on-failure-callbak-sigterm branch February 24, 2023 23:08
@jedcunningham jedcunningham added this to the Airflow 2.5.2 milestone Feb 24, 2023
@pierrejeambrun pierrejeambrun added the type:bug-fix Changelog: Bug Fixes label Feb 27, 2023
pierrejeambrun pushed a commit that referenced this pull request Mar 7, 2023
This fixes on_failure_callback when task receives a SIGTERM by
raising a different exception in the handler and catching the
exception during task execution so we can directly run the failure
callback.

(cherry picked from commit 671b88e)
pierrejeambrun pushed a commit that referenced this pull request Mar 8, 2023
This fixes on_failure_callback when task receives a SIGTERM by
raising a different exception in the handler and catching the
exception during task execution so we can directly run the failure
callback.

(cherry picked from commit 671b88e)
eejbyfeldt added a commit to eejbyfeldt/airflow that referenced this pull request Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

on_failure_callback is not called when task is terminated externally
5 participants