Fix busy loop when "Cancel build on update" is enabled#688
Open
eagletmt wants to merge 1 commit intojenkinsci:masterfrom
Open
Fix busy loop when "Cancel build on update" is enabled#688eagletmt wants to merge 1 commit intojenkinsci:masterfrom
eagletmt wants to merge 1 commit intojenkinsci:masterfrom
Conversation
ghprb enters busy loop with the following steps.
1. Update pull-request X and start a build X
2. Update pull-request Y in the same repository and start a build Y
- Build Y goes to the build queue since build X is currently running
3. Update pull-request X and start a build X'
- GhprbCancelBuildsOnUpdate#cancelCurrentBuilds() is called
- Check if queuedItem is cancellable, but it turns out impossible
because prId is different
- project.getQueueItem() is called repeatedly but it doesn't return
null until build X finishes and build Y starts.
- At the same time, build X' doesn't go to the build queue because
it's blocked by GhprbCancelBuildsOnUpdate#onScheduleBuild()
ghprb should use Queue#getItems API to find cancellable builds in the
build queue.
Author
|
@samrocketman Could you have a look? |
samrocketman
approved these changes
Oct 2, 2018
Member
samrocketman
left a comment
There was a problem hiding this comment.
The code looks good. Have you had a chance to test this @eagletmt ?
Contributor
|
@eagletmt this looks like an important fix, though we need your contribution to actually test this. How can this be tested? Were you able to confirm that your patch works? |
Contributor
|
@eagletmt @samrocketman How can we proceed here? :) |
Contributor
|
I have tested this manually locally and the new code works. Though I was not able to reproduce a real bug, this looks to me like an optimization which is just improving the current code. @eagletmt is this observation correct? |
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.
ghprb enters busy loop with the following steps.
because prId is different
null until build X finishes and build Y starts.
it's blocked by GhprbCancelBuildsOnUpdate#onScheduleBuild()
ghprb should use Queue#getItems API to find cancellable builds in the
build queue.