fix: failure to commit leads to inconsistencies between workflow and database#302
Draft
fix: failure to commit leads to inconsistencies between workflow and database#302
Conversation
…database When a µTask worker fails to commit its current state to the database, it was sometimes not stopping the execution of its resolution. This leads to inconsistencies, as the step was currently RUNNING, but database state indicates TODO. In that way, if the worker crashes, then the new worker will restart with wrong information, inducing workflow issues. Signed-off-by: Romain Beuque <556072+rbeuque74@users.noreply.github.com>
Collaborator
|
CDS Report test#1183.0 ✘
|
rbeuque74
commented
Nov 30, 2021
| step.PreRun(s, res.Values, resolutionStateSetter(res, preRunModifiedSteps), executedSteps) | ||
| commit(dbp, res, nil) | ||
| if err := commit(dbp, res, nil); err != nil { | ||
| return 0, err |
Member
Author
There was a problem hiding this comment.
Problem in my current implementation is that exiting the runAvailableSteps here, will close the main loop, while some step might still be running.
Not sure how we should handle this.
Signed-off-by: Romain Beuque <556072+rbeuque74@users.noreply.github.com>
Collaborator
|
CDS Report package#1184.0 ✘
|
wI2L
reviewed
Nov 30, 2021
| go resolve(dbp, res, t, sm, e.wg, debugLogger) | ||
| } else { | ||
| resolve(dbp, res, t, sm, e.wg, debugLogger) | ||
| err = resolve(dbp, res, t, sm, e.wg, debugLogger) |
Contributor
There was a problem hiding this comment.
Might be replaced with return resolve(...), nil, since there is nothing to do after the if statement, which spares the declaration of err above.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Bug Fix
What is the current behavior? (You can also link to an open issue here)
When a µTask worker fails to commit its current state to the database,
it was sometimes not stopping the execution of its resolution. This
leads to inconsistencies, as the step was currently RUNNING, but
database state indicates TODO. In that way, if the worker crashes, then
the new worker will restart with wrong information, inducing workflow
issues.
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
No
Other information: