Skip to content

Commit 5ea6281

Browse files
author
Carroll Chiou
authored
[JENKINS-55287] update exception warning for failure to load flow node (#589)
* update exception warning for failure to load flow node * check durability first * update error message
1 parent f82abbe commit 5ea6281

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/main/java/org/jenkinsci/plugins/workflow/cps/CpsFlowExecution.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,14 @@ protected synchronized void initializeStorage() throws IOException {
676676
h.setForDeserialize(storage.getNode(entry.getValue()));
677677
heads.put(h.getId(), h);
678678
} else {
679-
throw new IOException("Tried to load head FlowNodes for execution "+this.owner+" but FlowNode was not found in storage for head id:FlowNodeId "+entry.getKey()+":"+entry.getValue());
679+
FlowDurabilityHint durabilitySetting = getDurabilityHint();
680+
if (durabilitySetting != FlowDurabilityHint.MAX_SURVIVABILITY) {
681+
throw new AbortException("Cannot resume build because FlowNode " + entry.getValue() + " for FlowHead " + entry.getKey() + " could not be loaded. " +
682+
"This is expected to happen when using the " + durabilitySetting + " durability setting and Jenkins is not shut down cleanly. " +
683+
"Consider investigating to understand if Jenkins was not shut down cleanly or switching to the MAX_SURVIVABILITY durability setting which should prevent this issue in most cases.");
684+
} else {
685+
throw new AbortException("Cannot resume build because FlowNode " + entry.getValue() + " for FlowHead " + entry.getKey() + " could not be loaded.");
686+
}
680687
}
681688
}
682689
headsSerial = null;

0 commit comments

Comments
 (0)