Skip to content
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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1660,7 +1660,17 @@ public static void suspendAll() {
CpsFlowExecution cpsExec = (CpsFlowExecution) execution;
try {
cpsExec.checkAndAbortNonresumableBuild();

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);
}
}
Comment on lines +1663 to +1673
Copy link
Member Author

@jglick jglick Oct 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or perhaps just

Suggested change
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

not already do just this?

LOGGER.log(Level.FINE, "waiting to suspend {0}", execution);
// Like waitForSuspension but with a timeout:
if (cpsExec.programPromise != null) {
Expand Down
Loading