Skip to content

Commit

Permalink
Merge pull request #2 from jglick/AsynchronousExecution-deadlock-JENK…
Browse files Browse the repository at this point in the history
…INS-34450

[JENKINS-34450] Work around deadlock in core
  • Loading branch information
jglick committed Apr 26, 2016
2 parents b1505f8 + 26bc9d7 commit 5e95677
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
Expand Up @@ -226,13 +226,18 @@ private AsynchronousExecution sleep() {
if (forShutdown) {
return;
}
try {
execution.interrupt(getExecutor().abortResult());
} catch (Exception x) {
LOGGER.log(Level.WARNING, null, x);
}
getExecutor().recordCauseOfInterruption(WorkflowRun.this, listener);
printLater("term", "Click here to forcibly terminate running steps");
Timer.get().submit(new Runnable() {
@Override public void run() {
Executor executor = getExecutor();
try {
execution.interrupt(executor.abortResult());
} catch (Exception x) {
LOGGER.log(Level.WARNING, null, x);
}
executor.recordCauseOfInterruption(WorkflowRun.this, listener);
printLater("term", "Click here to forcibly terminate running steps");
}
});
}
@Override public boolean blocksRestart() {
return execution.blocksRestart();
Expand Down

0 comments on commit 5e95677

Please sign in to comment.