-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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 triggerer thread crash in daemon mode #34931
Conversation
Change the order of operations so that async child thread is created after forking when entering daemon context. This makes sure that the thread stays alive in the internal loop.
Also as explained in #34816 (comment), I'm willing to follow up with another contribution where all other commands are refactored to use the same pattern for daemon mode (and maybe reuse the same code?) but it needs a longer thought so I think it deserves a separate PR. |
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.
Interesting! I believe this would fix the issue.
Could you fix the static checks? https://github.com/apache/airflow/blob/main/STATIC_CODE_CHECKS.rst
@hussein-awala done |
* Fixes #34816 Change the order of operations so that async child thread is created after forking when entering daemon context. This makes sure that the thread stays alive in the internal loop. --------- Co-authored-by: daniel.dylag <[email protected]> (cherry picked from commit 9c1e8c2)
* Fixes #34816 Change the order of operations so that async child thread is created after forking when entering daemon context. This makes sure that the thread stays alive in the internal loop. --------- Co-authored-by: daniel.dylag <[email protected]> (cherry picked from commit 9c1e8c2)
Fixes #34816
Change the order of operations so that async child thread is created after forking when entering daemon context. This makes sure that the thread stays alive in the internal loop - forking causes stopping all child threads.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in newsfragments.