-
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
Clearing a defered task instance in deferred state does not clear its next_method #19612
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! |
Your added code makes sense. Feel free to start a pull request for this. |
We can close this now then right? |
I believe this can be closed, as the according code change was made via #23929 |
Thanks for catching this |
Can we reopen this? I just tested the fix in astronomer image 2.3.3-2 and clearing a deferred task will still mark the task as success immediately without executing. The other case of marking the task as failed first then clearing the task does re-execute the task. |
After adding this code, In my env, this problem is disappear. of course, I do not use |
Should probably do it in a new issue instead with fresh reproduction steps. |
Apache Airflow version
2.2.1
Operating System
Ubuntu 16.04
Versions of Apache Airflow Providers
No response
Deployment
Other
Deployment details
No response
What happened
When I mark a defferd task to Failed-State then clear it or clear a defferd task which in Defferd-State, this task is marked success immediately.
I check the task instance table, this task's next_method is not null when I clear this task.This cause task's execute function is replaced by next_method function.
What you expected to happen
When I clear a defferd task, I want to re-judge it's trigger condition, re-execute the execute function.
How to reproduce
Sensor
Trigger
Both operations above will cause this task is marked as success instead of re-execute the execute function.
Anything else
Similar issue:
#18146
#19120
I try to add this code in models/taskinstance.py clear_task_instances function
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: