diff --git a/core/src/main/java/hudson/slaves/NodeProvisioner.java b/core/src/main/java/hudson/slaves/NodeProvisioner.java index dec35a0cfec5cf3b04acb7ab1cdca8c5a5349c9c..26f111be19cda2d27c5407dd5f85f6c5057810d6 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.