-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
Airflow standalone command does not exit gracefully #19260
Comments
OK looks like it may have something to do with problems shutting down the scheduler. I had no tasks running but still it hangs here:
Logs attached. |
There is a bug in CPython (fixed in March 2022 but not yet released) that makes async.io handle SIGTERM improperly by using async unsafe functions and hanging the triggerer receive SIGPIPE while handling SIGTERN/SIGINT and deadlocking itself. Until the bug is handled we should rather rely on standard handling of the signals rather than adding our own signal handlers. Seems that even if our signal handler just run exit(0) - it caused a race condition that led to the hanging. More details: * https://bugs.python.org/issue39622 * python/cpython#83803 Fixes: apache#19260
There is a bug in CPython (fixed in March 2022 but not yet released) that makes async.io handle SIGTERM improperly by using async unsafe functions and hanging the triggerer receive SIGPIPE while handling SIGTERN/SIGINT and deadlocking itself. Until the bug is handled we should rather rely on standard handling of the signals rather than adding our own signal handlers. Seems that even if our signal handler just run exit(0) - it caused a race condition that led to the hanging. More details: * https://bugs.python.org/issue39622 * python/cpython#83803 Fixes: #19260
There is a bug in CPython (fixed in March 2022 but not yet released) that makes async.io handle SIGTERM improperly by using async unsafe functions and hanging the triggerer receive SIGPIPE while handling SIGTERN/SIGINT and deadlocking itself. Until the bug is handled we should rather rely on standard handling of the signals rather than adding our own signal handlers. Seems that even if our signal handler just run exit(0) - it caused a race condition that led to the hanging. More details: * https://bugs.python.org/issue39622 * python/cpython#83803 Fixes: #19260 (cherry picked from commit 6bdbed6)
There is a bug in CPython (fixed in March 2022 but not yet released) that makes async.io handle SIGTERM improperly by using async unsafe functions and hanging the triggerer receive SIGPIPE while handling SIGTERN/SIGINT and deadlocking itself. Until the bug is handled we should rather rely on standard handling of the signals rather than adding our own signal handlers. Seems that even if our signal handler just run exit(0) - it caused a race condition that led to the hanging. More details: * https://bugs.python.org/issue39622 * python/cpython#83803 Fixes: #19260 (cherry picked from commit 6bdbed6)
Seems that the fix was not effective and broke Triggerer job killing: #23274 (comment) Reverting it, until we find a better fix (or wait fo python to fix it). |
I think there is a PR opened - or maybe just merged about it. |
I am not sure what has changed - but I cannot reproduce it any more @dstandish - if you can't as well, I propose to close it. |
@potiuk I can still reproduce it with Airflow 2.5.2. Standalone hangs after Ctrl+C. |
Yes woudl be nice if somoene diagnoses and fixes it. Maybe you @SergiyKolesnikov ? |
I have looked at the running processes after hitting Ctrl-C. The webserver and scheduler processes were killed successfully, but the airflow triggerer process was still running. After I manually killed the triggerer process with I have also tested Airflow v2.6.2 and with this version Ctrl-C terminates the standalone command normally without any problems. |
So I guess we should close that one. |
I have this issue on 2.6.3. FWIW. |
So I heartily encourage you to post a new issue with all the details. commenting on a closed issue does not move a needle. And likely your issue @DannyLee12 is similar but not necessarily the same. Posting an issue with clear reproduction steps and logs showing the problem is the best way you can help those who would look at it to reproduce and maybe fix it. On the other hand, commenting on a closed issuse that apparently have been closed without providing all those details does not help anyone in diagnosing and fixing the issue. I heartily encourage you to open a new issue and provide as much details and reproducible steps as you can. |
Apache Airflow version
2.2.0 (latest released)
Operating System
macOS
Versions of Apache Airflow Providers
No response
Deployment
Virtualenv installation
Deployment details
No response
What happened
run
airflow standalone
enter
ctrl+c
hangs here:
What you expected to happen
No response
How to reproduce
No response
Anything else
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: