Skip to content
Closed
Changes from 2 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
30 changes: 13 additions & 17 deletions src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,16 @@ private void finish(@Nonnull Result r, @CheckForNull Throwable t) {
setResult(r);
completed = Boolean.TRUE;
duration = Math.max(0, System.currentTimeMillis() - getStartTimeInMillis());

Copy link
Owner

Choose a reason for hiding this comment

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

could revert

}
Executor executor = getExecutor();
if (executor != null) {
AsynchronousExecution asynchronousExecution = executor.getAsynchronousExecution();
if (asynchronousExecution != null) {
asynchronousExecution.completed(null);
}
} else {
LOGGER.log(Level.SEVERE, "Build tried to complete when in fact already done.");
}
try {
LOGGER.log(Level.INFO, "{0} completed: {1}", new Object[]{toString(), getResult()});
Expand Down Expand Up @@ -1121,23 +1131,9 @@ public void save() throws IOException {
isAtomic = hint.isAtomicWrite();
}

boolean completeAsynchronousExecution = false;
try {
synchronized (this) {
completeAsynchronousExecution = Boolean.TRUE.equals(completed);
PipelineIOUtils.writeByXStream(this, loc, XSTREAM2, isAtomic);
SaveableListener.fireOnChange(this, file);
}
} finally {
if (completeAsynchronousExecution) {
Executor executor = getExecutor();
if (executor != null) {
AsynchronousExecution asynchronousExecution = executor.getAsynchronousExecution();
if (asynchronousExecution != null) {
asynchronousExecution.completed(null);
}
}
}
synchronized (this) {
PipelineIOUtils.writeByXStream(this, loc, XSTREAM2, isAtomic);
SaveableListener.fireOnChange(this, file);
}
}
}