db_store: rebuild from own context when a shared build's owner is cancelled#216
Open
mtelvers wants to merge 1 commit into
Open
db_store: rebuild from own context when a shared build's owner is cancelled#216mtelvers wants to merge 1 commit into
mtelvers wants to merge 1 commit into
Conversation
…celled When two jobs de-duplicate onto one build, the copy step reads the first caller's build context. If that caller is cancelled and its context deleted while another job is still sharing the build, the copy fails with ENOENT and the surviving job fails too, even though it was not cancelled. Flag the build when its context-owning caller is cancelled; a surviving user then rebuilds from its own context instead of failing. The flag is per build record, so ownership cascades: each cancelled owner hands off to a surviving joiner. Only happens on cancellation, so no cost on the normal path. Tests: a survivor completes when the owner is cancelled mid-copy; both jobs cancelled in turn (staggered); and a three-job cascade where the owner and the new owner are both cancelled and the third still completes. Mock_store now removes the in-progress directory when the build function raises, as the real stores do.
9438513 to
ce43907
Compare
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.
When two jobs de-duplicate onto one build, the copy step reads the first
caller's build context. If that caller is cancelled and its context deleted
while another job is still sharing the build, the copy fails with ENOENT and
the surviving job fails too, even though it was not cancelled.
This fix flags the build when its context-owning caller is cancelled; a
surviving user then rebuilds from its own context instead of failing. It only
happens on that cancellation, so there is no cost on the normal path.
Two tests are added: a survivor completing after the owner is cancelled
mid-copy, and both jobs being cancelled in turn. Mock_store now removes the
in-progress directory when the build function raises, as the real stores do.