-
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
Airflow 2.7.1 can not start Scheduler & trigger #34816
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval. |
Some questions regarding your report:
|
|
airflow triggerer --capacity 5 --log-file ./logs/triggerer/triggerer.log --pid ./triggerer.pid --daemon ____ |( )_______ / /________ __ --> any log on console, not show log in file |
Sorry I can not understand you last comment completely.
|
Hi, wget https://raw.githubusercontent.com/apache/airflow/constraints-2.7.1/constraints-3.10.txt then:
airflow triggerer --daemon, it's NOT OK: |
I think if run triggerer on daemon, it not start gunicorn (i show gunicorn start on log file). if i run without daemon, i show starting gunicorn on console. |
The same issue with 2.7.2,
|
I tested a couple of versions and can confirm it, the regression took place between 2.6.2 and 2.6.3 - in 2.6.3 (and later), after starting triggerer with -D option, |
maybe can fix it or wait new version of airflow? |
I think I isolated the code change that caused the problem - the problem starts to appear after this commit: d6cc9e4#diff-9cea7921268261a177e82c16fd5111f8d3252e3ca0267bdfb397c379c5d70857R353-R355 When I comment out these lines, the triggerer starts and the demon thread continues to run successfully. @ThuanDoHung for now I'm trying to triage the bug, don't know how to fix it yet |
After debugging I think I understand the problem fully. Here is what happens when we run triggerer in daemon mode on current main.
Before the change #32092 it wasn't a problem because apparently a thread in stopped state runs fine unless someone verifies its state (which is inconsistent). My proposal to fix it:
@jens-scheffler-bosch I'm willing to work on it |
Wow. Cool analysis. Respect. This is not an easy catch! Thanks for investing the time locating the root! Yes, with this explanaition it all makes much sense. Happy to see a contribution! |
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 contrary to the original issue description and I don't see any problem with the scheduler in daemon mode. But maybe it was a communication issue. |
Very cool analysis indeed. It all makes perfect sense. Thanks for both - analysis and the fix! |
* 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]>
* 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)
HI, on 2.7.3 i show scheduler was fixed but triggerer was not fixed. i can not start trigger on daemon, log of triggerer same 2.7.2. |
Can you please open a new issue about it with logs showing what's going on. We are not going to re-open that onte as it is already part of the relesed fix. Thanks in advance. |
Do you have solution for this error @ThuanDoHung ? |
The issue is still reproducible in Airflow 2.9.2 with AWS MWAA |
And this comment is still valid. Absolutely nothing changed since
|
So if you really want the problme solved @mvoitko rather than just complaining you have the same (possibly) issue that has been closed. I strongly recommend to follow that above advice |
Apache Airflow version
2.7.1
What happened
After upgrade from 2.6.0 to 2.7.1 (try pip uninstall apache-airflow, and clear dir airflow - remove airflow.cfg), I can start scheduler & trigger with daemon.
I try start with command, it can start, but logout console it killed.
I try: airflow scheduler or airflow triggerer :done but kill when logout console
airflow scheduler --daemon && airflow triggerer --daemon: fail, can not start scheduler & triggerer (2.6.0 run ok). but start deamon with webserver & celery worker is fine
Help me
What you think should happen instead
No response
How to reproduce
Operating System
ubuntu server 22.04.3 LTS
Versions of Apache Airflow Providers
No response
Deployment
Virtualenv installation
Deployment details
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: