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
Gru tasks cleanup #2011
Gru tasks cleanup #2011
Conversation
…ases in the future
Looks good so far. |
By eyeball this looks fine. I'm gonna do a build with it and deploy it on Fedora staging so I can verify that it does address the specific case that was going wrong there (I expect it will). |
$self->_fail_gru($gru_id => $err); | ||
} | ||
elsif ($state eq 'active') { | ||
$self->_delete_gru($gru_id) if $self->finish(defined $buffer ? $buffer : 'Job successfully executed'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case you were wondering why this is a separate case from the finished state. Here we avoid a possible race condition where a task calls $job->retry()
and the retried job gets picked up by a worker fast enough to be in the active state before reaching this line of code. Due to the built-in versioning of Minion jobs the $self->finish
call here would fail, preventing the Gru task from getting deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, testing this race condition is hard, and something i'm still thinking about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it is worth adding this as a comment in the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea.
Codecov Report
@@ Coverage Diff @@
## master #2011 +/- ##
=========================================
- Coverage 89.17% 89.1% -0.08%
=========================================
Files 153 153
Lines 10358 10364 +6
=========================================
- Hits 9237 9235 -2
- Misses 1121 1129 +8
Continue to review full report at Codecov.
|
Confirmed this seems to fix the issue observed in Fedora just fine; I updated to a build with this patch applied, wiped an ISO, re-scheduled the tests for that ISO on two flavors, and the tests for both flavors correctly waited for the download before commencing (but then did commence once it was done :>). Thanks, @kraih . |
@AdamWill Thanks, i will merge the patch later today then if there are no objections. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since @AdamWill already tested it I didn't run any local tests. From looking at the code I'd say it can be merged.
This should be the correct solution for #2008. It's ready for merging, but i might still add a few more test cases.
Progress: https://progress.opensuse.org/issues/48554