Skip to content

Commit

Permalink
[FIXED JENKINS-21622] Release workspace leases (and avoid @2) even if…
Browse files Browse the repository at this point in the history
… post-build actions throw LinkageError.
  • Loading branch information
jglick committed Apr 14, 2014
1 parent 0faa7b7 commit decf902
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -58,6 +58,9 @@
<li class=bug>
More efficient deletion of old builds (specified by date).
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-22607">issue 22607</a>)
<li class=bug>
Linkage errors in notifiers could leak workspace leases.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-21622">issue 21622</a>)
<li class=bug>
Fix a bug which only showed the first detail part for radio buttons.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-22583">issue 22583</a>)
Expand Down
18 changes: 12 additions & 6 deletions core/src/main/java/hudson/model/AbstractBuild.java
Expand Up @@ -712,17 +712,23 @@ protected final boolean performAllBuildSteps(BuildListener listener, Iterable<?
r = false;
}
} catch (Exception e) {
String msg = "Publisher " + bs.getClass().getName() + " aborted due to exception";
e.printStackTrace(listener.error(msg));
LOGGER.log(WARNING, msg, e);
if (phase) {
setResult(Result.FAILURE);
}
reportError(bs, e, listener, phase);
} catch (LinkageError e) {
reportError(bs, e, listener, phase);
}
}
return r;
}

private void reportError(BuildStep bs, Throwable e, BuildListener listener, boolean phase) {
String msg = "Publisher " + bs.getClass().getName() + " aborted due to exception";
e.printStackTrace(listener.error(msg));
LOGGER.log(WARNING, msg, e);
if (phase) {
setResult(Result.FAILURE);
}
}

/**
* Calls a build step.
*/
Expand Down

0 comments on commit decf902

Please sign in to comment.