Resume Pipeline builds asynchronously #368
Merged
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.
Allows
WorkflowRuns to load in a background thread without blocking Jenkins startup. (StepExecution.onResumewas already called in the background.) This could be beneficial when restarting a controller running a large number of builds; for example, in Kubernetes a startup probe might otherwise time out if the server does not indicate it is up and running earlier.Note that this makes the clause in docs for
isResumptionCompleteworkflow-api-plugin/src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecutionList.java
Line 198 in 0c73153
StepExecution.onResumedbeing called that really matters. The subtlest case was added in jenkinsci/workflow-durable-task-step-plugin#323 but there one of three things can happen: all builds resume, then the agent comes online; the agent comes online, then the build using it resumes; or, at worst, the build using an agent resumes, then the agent comes online (so the listener does nothing), then some unrelated builds resume, in which case we may need to wait up to 5m forcheckto be called. Even that could I think happen without the change in this PR, in case an agent comes online during Jenkins startup (likely possible for outbound agents, or inbound TCP agents in direct mode); or even if the agent comes online after startup, sinceisResumptionCompletejust checks that builds have been loaded, not that an individual step’sonResumehas been called, which will happen later.