提交 353ebe6b 编写于 作者: J Jesse Glick

[JENKINS-16845] Hotfix to at least allow the job to be loaded.

Root cause seems to be broken serial form of FingerprintAction, probably caused by lazy loading.
上级 e172407b
......@@ -58,6 +58,9 @@ Upcoming changes</a>
<li class=bug>
JUnit result archiver should only fail builds if there are really no results - i.e. also no skipped tests.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-7970">issue 7970</a>)
<li class='major bug'>
<code>NullPointerException</code> related to lazy loading when loading some builds using fingerprinting.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-16845">issue 16845</a>)
<li class=rfe>
Better display of parameters in queue items.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-17454">issue 17454</a>)
......
......@@ -294,7 +294,7 @@ public class Fingerprinter extends Recorder implements Serializable, DependencyD
*/
public static final class FingerprintAction implements RunAction {
private final AbstractBuild build;
private AbstractBuild build;
private static final Random rand = new Random();
......@@ -343,6 +343,11 @@ public class Fingerprinter extends Recorder implements Serializable, DependencyD
}
public void onLoad() {
if (build.getParent() == null) {
logger.warning("JENKINS-16845: broken FingerprintAction record");
build = null;
return;
}
// share data structure with nearby builds, but to keep lazy loading efficient,
// don't go back the history forever.
if (rand.nextInt(2)!=0) {
......@@ -430,6 +435,11 @@ public class Fingerprinter extends Recorder implements Serializable, DependencyD
public Map<AbstractProject,Integer> getDependencies(boolean includeMissing) {
Map<AbstractProject,Integer> r = new HashMap<AbstractProject,Integer>();
if (build == null) {
// Broken, do not do anything.
return r;
}
for (Fingerprint fp : getFingerprints().values()) {
BuildPtr bp = fp.getOriginal();
if(bp==null) continue; // outside Hudson
......
......@@ -30,7 +30,9 @@ THE SOFTWARE.
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<l:layout>
<st:include it="${it.build}" page="sidepanel.jelly" />
<j:if test="${it.build != null}">
<st:include it="${it.build}" page="sidepanel.jelly"/>
</j:if> <!-- else broken -->
<l:main-panel>
<h1>
<img src="${imagesURL}/48x48/fingerprint.png" alt="" height="48" width="48"/>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册