Skip to content

Commit 8005c68

Browse files
authored
Merge pull request #256 from jglick/ParallelResumer-ready
`FlowExecutionList.ParallelResumer` should wait until Jenkins startup is complete
2 parents 4596ea5 + 597ffe7 commit 8005c68

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecutionList.java

+9
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,15 @@ private static final class ParallelResumer {
338338
}
339339

340340
synchronized void run() {
341+
if (Jenkins.get().isTerminating()) {
342+
LOGGER.fine("Skipping step resumption during shutdown");
343+
return;
344+
}
345+
if (Jenkins.get().getInitLevel() != InitMilestone.COMPLETED || Jenkins.get().isQuietingDown()) {
346+
LOGGER.fine("Waiting to resume step until Jenkins completes startup and is not in quiet mode");
347+
Timer.get().schedule(this::run, 100, TimeUnit.MILLISECONDS);
348+
return;
349+
}
341350
LOGGER.fine(() -> "Checking status with nodes=" + nodes + " enclosing=" + enclosing + " processing=" + processing);
342351
if (nodes.isEmpty()) {
343352
if (processing.isEmpty()) {

0 commit comments

Comments
 (0)