-
Notifications
You must be signed in to change notification settings - Fork 98
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
[JENKINS-49707] retry
without conditions should handle node removal
#254
Merged
jglick
merged 6 commits into
jenkinsci:master
from
jglick:retry-unconditionally-JENKINS-49707
Jul 22, 2022
Merged
[JENKINS-49707] retry
without conditions should handle node removal
#254
jglick
merged 6 commits into
jenkinsci:master
from
jglick:retry-unconditionally-JENKINS-49707
Jul 22, 2022
Conversation
This file contains 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
12 tasks
jglick
commented
Jul 22, 2022
@@ -287,7 +287,11 @@ public static final class QueueTaskCancelled extends CauseOfInterruption { | |||
continue; | |||
} | |||
listener.getLogger().println("Agent " + node.getNodeName() + " was deleted; cancelling node body"); | |||
body.cancel(new RemovedNodeCause()); | |||
if (Util.isOverridden(BodyExecution.class, body.getClass(), "cancel", Throwable.class)) { | |||
body.cancel(new FlowInterruptedException(Result.ABORTED, false, new RemovedNodeCause())); |
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.
Passing false
here is the key aspect of the fix. It means that this was not some user clicking the red × on the build, and so retry
should process it by default (even without use of conditions: [agent()]
).
dwnusbaum
approved these changes
Jul 22, 2022
car-roll
approved these changes
Jul 22, 2022
jetersen
approved these changes
Jul 22, 2022
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.
Downstream of jenkinsci/workflow-step-api-plugin#124, and jenkinsci/workflow-cps-plugin#570 to be effective.
jenkins-infra/helpdesk#3031 (comment) noted earlier in #180 (comment). If you have
and the agent is removed, the block was surprisingly not retried. This is because
actualInterruption
defaults to true for compatibility in jenkinsci/workflow-step-api-plugin#51 andBodyExecution.cancel(CauseOfInterruption...)
does not override that.