Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-34448] Fixed offlineCause race condition
  • Loading branch information
pjanouse committed Apr 27, 2016
1 parent 8a19e8a commit 822cec6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/slaves/SlaveComputer.java
Expand Up @@ -249,7 +249,7 @@ public Object call() throws Exception {
try {
for (ComputerListener cl : ComputerListener.all())
cl.preLaunch(SlaveComputer.this, taskListener);

offlineCause = null;
launcher.launch(SlaveComputer.this, taskListener);
} catch (AbortException e) {
taskListener.error(e.getMessage());
Expand All @@ -266,7 +266,7 @@ public Object call() throws Exception {
throw e;
}
} finally {
if (channel==null) {
if (channel==null && offlineCause == null) {
offlineCause = new OfflineCause.LaunchFailed();
for (ComputerListener cl : ComputerListener.all())
cl.onLaunchFailure(SlaveComputer.this, taskListener);
Expand Down

0 comments on commit 822cec6

Please sign in to comment.