DAG in queued when it has Deferrable #51875
Unanswered
dinjazelena98
asked this question in
General
Replies: 2 comments 3 replies
-
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. |
Beta Was this translation helpful? Give feedback.
0 replies
-
This looks more like a discussion - hopefully someone will be able to help |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Apache Airflow version
3.0.2
If "Other Airflow 2 version" selected, which one?
No response
What happened?
Hi, i have an Airflow Operator which uses self.defer() to call an Deferrable Trigger. Inside that deferrable trigger we are just waiting for event to happen. Once event happens it yields TriggerEvent back to the worker and executing "method_name" from self.defer() method. Here i want to trigger next DAG which needs that event, and go back to deferring. Now next DAG lasts for much longer, and i want to have possible concurrent runs.
But when ever next DAG is triggered, my initial DAG goes to status "queued". I absolutely cant figure out why.
First i tried something like above. But it seems that after calling TriggerDagRunOperator, actual task gets done and anything after it never gets executed. So initially my idea was to have an single DAG that is always either triggering the DAG or waiting for event to happen. But after using TriggerDagRunOperator, nothing gets executed after it, and DAG is considered success.
Then to mitigate problem above, i tried to just make this DAG run as schedule="@continuous", so after every time it gets event, trigger the DAG with that event, and then based on schedule to create a new run. But then once the the DAG that was waiting for event, triggers the next DAG with TriggerDagRunOperator, DAG is marked green, and by schedule creates a new instance of the DAG, but it gets to queued for the runtime of the DAG that triggered.
I tested this without having deferrable task, and it works good, i have initial DAG that always triggers next one and does not have any dependency on it.
Why does it get queued? Or why is DAG automatically finished after calling TriggerDagRun inside method of Operator.
What you think should happen instead?
Once the DAG that has deferrable triggers the next DAG, it should be retriggered because of @continuous schedule. But it goes to queued for the runtime of the DAG that it has triggered.
How to reproduce
Have a DAG with self.defer() trigger and make it trigger some other DAG in method_name that is triggered once we move back to worker from triggerer
Operating System
Ubuntu
Versions of Apache Airflow Providers
No response
Deployment
Astronomer
Deployment details
No response
Anything else?
No response
Are you willing to submit PR?
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions