Skip to content
Permalink
Browse files
[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.(cherry picked from commit 353ebe6)

Conflicts:
	changelog.html
  • Loading branch information
jglick authored and vjuranek committed Apr 14, 2013
1 parent 1b10bcb commit 6d13d4cc424c05a3c0dff080fb978e8f18455392
Showing with 14 additions and 2 deletions.
  1. +11 −1 core/src/main/java/hudson/tasks/Fingerprinter.java
  2. +3 −1 core/src/main/resources/hudson/tasks/Fingerprinter/FingerprintAction/index.jelly
@@ -294,7 +294,7 @@ public boolean isApplicable(Class<? extends AbstractProject> jobType) {
*/
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 AbstractBuild getBuild() {
}

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 @@ protected void compact(FingerprintAction a) {
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"/>

0 comments on commit 6d13d4c

Please sign in to comment.