-
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-2865] Call success_callback before updating task state #4082
Conversation
In cases where the success callback takes variable time, it's possible for it to interrupted by the heartbeat process. This is because the heartbeat process looks for tasks that are no longer in the "running" state but are still executing and reaps them. This commit reverses the order of callback invocation and state updating so that the "SUCCESS" state for the task isn't committed to the database until after the success callback has finished.
Codecov Report
@@ Coverage Diff @@
## master #4082 +/- ##
==========================================
+ Coverage 77.91% 77.91% +<.01%
==========================================
Files 199 199
Lines 15958 15957 -1
==========================================
Hits 12433 12433
+ Misses 3525 3524 -1
Continue to review full report at Codecov.
|
@ashb or @Fokko hey y'all, I don't want to be pushy or anything, I just want to know what the right way is to get feedback on a PR; I've had this one open for about 10 days and because there's no comments on it I wonder if I've done something wrong to make it de-prioritized? Should I have been making noise in a mailing list somewhere or something like that? Thanks, ~Ethan |
@evizitei No, nothing you've done wrong - it's a lack of time on the part of the (volunteer-based) committers. (We all only work on Airflow in spare moments or when we convince our employers to lets us carve out some time. :( |
Thanks for the detailed description, it made this much much easier to review and reason about :D |
Sure, I understand, just wanted to make sure I hadn't accidentally kicked myself into a process black hole :) Thanks for accepting my change, this will make the next version of airflow a valuable upgrade for us |
In cases where the success callback takes variable time, it's possible for it to interrupted by the heartbeat process. This is because the heartbeat process looks for tasks that are no longer in the "running" state but are still executing and reaps them. This commit reverses the order of callback invocation and state updating so that the "SUCCESS" state for the task isn't committed to the database until after the success callback has finished.
…he#4082) In cases where the success callback takes variable time, it's possible for it to interrupted by the heartbeat process. This is because the heartbeat process looks for tasks that are no longer in the "running" state but are still executing and reaps them. This commit reverses the order of callback invocation and state updating so that the "SUCCESS" state for the task isn't committed to the database until after the success callback has finished.
…he#4082) In cases where the success callback takes variable time, it's possible for it to interrupted by the heartbeat process. This is because the heartbeat process looks for tasks that are no longer in the "running" state but are still executing and reaps them. This commit reverses the order of callback invocation and state updating so that the "SUCCESS" state for the task isn't committed to the database until after the success callback has finished.
…he#4082) In cases where the success callback takes variable time, it's possible for it to interrupted by the heartbeat process. This is because the heartbeat process looks for tasks that are no longer in the "running" state but are still executing and reaps them. This commit reverses the order of callback invocation and state updating so that the "SUCCESS" state for the task isn't committed to the database until after the success callback has finished.
…he#4082) In cases where the success callback takes variable time, it's possible for it to interrupted by the heartbeat process. This is because the heartbeat process looks for tasks that are no longer in the "running" state but are still executing and reaps them. This commit reverses the order of callback invocation and state updating so that the "SUCCESS" state for the task isn't committed to the database until after the success callback has finished.
…he#4082) In cases where the success callback takes variable time, it's possible for it to interrupted by the heartbeat process. This is because the heartbeat process looks for tasks that are no longer in the "running" state but are still executing and reaps them. This commit reverses the order of callback invocation and state updating so that the "SUCCESS" state for the task isn't committed to the database until after the success callback has finished.
In cases where the success callback takes variable time, it's possible for it to interrupted by the heartbeat process. This is because the heartbeat process looks for tasks that are no longer in the "running" state but are still executing and reaps them. This commit reverses the order of callback invocation and state updating so that the "SUCCESS" state for the task isn't committed to the database until after the success callback has finished.
…he#4082) In cases where the success callback takes variable time, it's possible for it to interrupted by the heartbeat process. This is because the heartbeat process looks for tasks that are no longer in the "running" state but are still executing and reaps them. This commit reverses the order of callback invocation and state updating so that the "SUCCESS" state for the task isn't committed to the database until after the success callback has finished.
This race condition bites us rather often in our success callbacks, hoping to get this included in an upcoming release.
Jira
Description
In cases where the success callback takes variable
time, it's possible for it to interrupted by the heartbeat process.
This is because the heartbeat process looks for tasks that are no
longer in the "running" state but are still executing and reaps them.
This commit reverses the order of callback invocation and state
updating so that the "SUCCESS" state for the task isn't committed
to the database until after the success callback has finished.
Tests
TaskInstanceTest.test_success_callbak_no_race_condition
Commits
Documentation
Code Quality
flake8