-
Notifications
You must be signed in to change notification settings - Fork 195
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
Save build.xml
during CpsFlowExecution.suspendAll
#923
base: master
Are you sure you want to change the base?
Conversation
Did not in fact fix the problem. |
The immediate problem was #925, but even with that addressed, there seem to be random problems finding stored |
if (cpsExec.owner != null) { | ||
try { | ||
Queue.Executable exec = cpsExec.owner.getExecutable(); | ||
if (exec instanceof Saveable) { | ||
LOGGER.fine(() -> "saving " + exec); | ||
((Saveable) exec).save(); | ||
} | ||
} catch (IOException x) { | ||
LOGGER.log(Level.WARNING, "failed to save " + cpsExec, x); | ||
} | ||
} |
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.
or perhaps just
if (cpsExec.owner != null) { | |
try { | |
Queue.Executable exec = cpsExec.owner.getExecutable(); | |
if (exec instanceof Saveable) { | |
LOGGER.fine(() -> "saving " + exec); | |
((Saveable) exec).save(); | |
} | |
} catch (IOException x) { | |
LOGGER.log(Level.WARNING, "failed to save " + cpsExec, x); | |
} | |
} | |
cpsExec.saveOwner(); |
though OTOH does
workflow-cps-plugin/plugin/src/main/java/org/jenkinsci/plugins/workflow/cps/CpsFlowExecution.java
Line 1675 in dc9d3ae
cpsExec.checkpoint(true); |
I suspect this will fix a hard-to-reproduce bug in
FlowHead
deserialization. I have not managed to reproduce an error yet in a functional test, but I have found thatbuild.xml
including its list of heads is only getting saved rather incidentally from the asynchronous mode ofnotifyListeners
, even thoughFlowNode
s have gotten saved earlier andprogram.dat
has been saved. If I insert some artificial delays intonotifyNewHead
and run a restart test involvingparallel
, sometimesbuild.xml
is out of date after Jenkins shuts down, causing weird effects like the iota being off after restart, or block start nodes being omitted from the graph.