Replies: 5 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.
-
|
Sorry about the presentation of my DAG code. I couldn't figure out how to post it as an entire code block |
Beta Was this translation helpful? Give feedback.
-
|
I think you are doing something that is somewhat not necessarily supported from Airflow point of view (hence converting it to a discussion). Making it an airflow issue is quite too much. I think rather than posting a code you should rather explain what your loigical intentions are. From what I uderstand you want to clear task from a failure callback - and this has absolutely no guarantees of succeedding, I think - this looks a bit as an abuse of the mechanism - and there are various reasons why it might not work from within the callback - calllback s (I think) is not really foreseen for cases where you would like to clear task that has just failed. That sounds what you try to do. You have retry mechanisms foreseen for retrying failed tasks and coupled with cluster_policies it sounds like much better way of what you are trying to achieve. I think (but without of your logical explanation what you try to achieve) it is my guess. |
Beta Was this translation helpful? Give feedback.
-
|
Hello @nicklip , Any news about this issue? Is there a way you did to clear up tasks anyway? |
Beta Was this translation helpful? Give feedback.
-
|
hello, @nicklip: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Apache Airflow version
2.5.2
What happened
The callback function called the
clear_task_instancesfunction and it failed to clear the task that was passed to itWhat you think should happen instead
clear_task_instancesshould have cleared the task passed to it but was unable to. Instead the state of that task was set to 'failed' in thetask_instancetable in the database and never cleared or restarted.How to reproduce
Run the following DAG and see that
failing_taskonly fails and never gets cleared or restarted / retried.Look at the XCOM list and you will see that the task object itself was in
runningstate before theclear_task_instancescall andrestartingstate after the call. However, when monitoring thetask_instancetable in the database while running this task, the task's state only goes fromrunningtofailedand never actually gets set torestarting. In version 2.3.1, running this code works as expected and the task state in thetask_instancetable goes fromrunningtofailedtonull, successfully clearing it.Operating System
Debian GNU/Linux 11 (bullseye)
Versions of Apache Airflow Providers
No response
Deployment
Docker-Compose
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