Skip to content
This repository has been archived by the owner. It is now read-only.
Browse files
[JENKINS-26761] Try using a PersistedList rather than a LinkedList fo…
…r new WorkflowRun.checkouts.

(Existing build records will continue to use LinkedList.) Possible advantages:
· If the bug was caused by an unreported failure to serialize/deserialize an SCM instance,
  this would create a polite “old data” record instead.
  (CopyOnWriteArrayList would also work, via RobustCollectionConverter.)
· The backing store is CopyOnWriteList, solving a hypothetical ConcurrentModificationException.
· Additions from onCheckout should be saved to disk immediately, rather than waiting for some other save trigger.
  • Loading branch information
jglick committed Jul 28, 2015
1 parent f3fd075 commit ad9b6caf0428b9c85601ef9d349ca2691b7055be
Showing with 3 additions and 3 deletions.
  1. +3 −3 job/src/main/java/org/jenkinsci/plugins/workflow/job/
@@ -51,6 +51,7 @@
import hudson.scm.SCM;
import hudson.scm.SCMRevisionState;
import hudson.util.NullStream;
import hudson.util.PersistedList;
@@ -62,7 +63,6 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Future;
@@ -130,7 +130,7 @@ public final class WorkflowRun extends Run<WorkflowJob,WorkflowRun> implements Q
public WorkflowRun(WorkflowJob job) throws IOException {
firstTime = true;
checkouts = new LinkedList<SCMCheckout>();
checkouts = new PersistedList<SCMCheckout>(this);
//System.err.printf("created %s @%h%n", this, this);

@@ -531,7 +531,7 @@ public boolean hasntStartedYet() {
if (listener != null) {
listener.error("JENKINS-26761: list of SCM checkouts in " + this + " was lost; polling will be broken");
checkouts = new LinkedList<SCMCheckout>();
checkouts = new PersistedList<SCMCheckout>(this);
// Could, but might pollute diagnosis, and (worse) might clobber real data if there is >1 WorkflowRun with the same ID.
return checkouts;

0 comments on commit ad9b6ca

Please sign in to comment.