From 70d1039b51693aa1d2e73be306c5c013e3444e99 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Thu, 10 Mar 2011 18:38:59 -0800 Subject: [PATCH] regression fix. ConcurrentArrayList doesn't support iterator-based removal --- core/src/main/java/hudson/slaves/NodeProvisioner.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/hudson/slaves/NodeProvisioner.java b/core/src/main/java/hudson/slaves/NodeProvisioner.java index dec35a0cfe..26f111be19 100644 --- a/core/src/main/java/hudson/slaves/NodeProvisioner.java +++ b/core/src/main/java/hudson/slaves/NodeProvisioner.java @@ -85,7 +85,7 @@ public class NodeProvisioner { */ private final Label label; - private List pendingLaunches = new CopyOnWriteArrayList(); + private List pendingLaunches = new ArrayList(); /** * Exponential moving average of the "planned capacity" over time, which is the number of @@ -109,7 +109,7 @@ public class NodeProvisioner { * Can be empty but never null * @since 1.401 */ - public List getPendingLaunches() { + public synchronized List getPendingLaunches() { return new ArrayList(pendingLaunches); } @@ -117,7 +117,7 @@ public class NodeProvisioner { * Periodically invoked to keep track of the load. * Launches additional nodes if necessary. */ - private void update() { + private synchronized void update() { Hudson hudson = Hudson.getInstance(); // clean up the cancelled launch activity, then count the # of executors that we are about to bring up. -- GitLab