You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// WorkflowRun.onLoad will not fireResumed if the execution was already complete when loaded,
265
-
// and CpsFlowExecution should not then complete until afterStepExecutionsResumed, so this is defensive.
266
-
return;
267
-
}
268
-
FlowExecutionListlist = FlowExecutionList.get();
269
-
FlowExecutionOwnerowner = e.getOwner();
270
-
if (!list.runningTasks.contains(owner)) {
271
-
LOGGER.log(Level.WARNING, "Resuming {0}, which is missing from FlowExecutionList ({1}), so registering it now.", newObject[] {owner, list.runningTasks.getView()});
// WorkflowRun.onLoad will not fireResumed if the execution was already complete when loaded,
271
+
// and CpsFlowExecution should not then complete until afterStepExecutionsResumed, so this is defensive.
272
+
return;
284
273
}
274
+
FlowExecutionListlist = FlowExecutionList.get();
275
+
FlowExecutionOwnerowner = e.getOwner();
276
+
if (!list.runningTasks.contains(owner)) {
277
+
LOGGER.log(Level.WARNING, "Resuming {0}, which is missing from FlowExecutionList ({1}), so registering it now.", newObject[] {owner, list.runningTasks.getView()});
@@ -294,7 +291,90 @@ public void onFailure(@NonNull Throwable t) {
294
291
e.afterStepExecutionsResumed();
295
292
}
296
293
297
-
}, Timer.get());// We always hold RunMap and WorkflowRun locks here, so we resume steps on a different thread to avoid potential deadlocks. See JENKINS-67351.
294
+
}, MoreExecutors.directExecutor());
298
295
}
299
296
}
297
+
298
+
/** Calls {@link StepExecution#onResume} for each step in a running build.
299
+
* Does so in parallel, but always completing enclosing blocks before the enclosed step.
300
+
* A simplified version of https://stackoverflow.com/a/67449067/12916, since this should be a tree not a general DAG.
301
+
*/
302
+
privatestaticfinalclassParallelResumer {
303
+
304
+
privatefinalRunnableonCompletion;
305
+
/** Step nodes mapped to the step execution. Entries removed when they are ready to be resumed. */
0 commit comments