Skip to content
Permalink
Browse files

[FIXED JENKINS-16833] Use a CopyOnWriteArraySet for inProgress to avo…

…id blocking UI.
  • Loading branch information
jglick authored and kohsuke committed Feb 15, 2013
1 parent f3a2ae3 commit 2efa70955299ff7bb5d5bc9a5d12c218f922ab03
Showing with 6 additions and 3 deletions.
  1. +3 −0 changelog.html
  2. +3 −3 core/src/main/java/hudson/model/ResourceController.java
@@ -68,6 +68,9 @@
<li class=bug>
maven-failsafe-plugin tests not recognized anymore
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-16696">issue 16696</a>)
<li class=bug>
UI waiting on a queue lock to display cause of queue blockage.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-16833">issue 16833</a>)
<li class=rfe>
JNLP slave installers can now work transparently with secured Jenkins.
(SECURITY-54 / despite the ticket marker, this is not a security vulnerability)
@@ -26,10 +26,10 @@
import hudson.util.AdaptedIterator;

import java.util.Set;
import java.util.HashSet;
import java.util.Collection;
import java.util.AbstractCollection;
import java.util.Iterator;
import java.util.concurrent.CopyOnWriteArraySet;

/**
* Controls mutual exclusion of {@link ResourceList}.
@@ -39,7 +39,7 @@
/**
* {@link ResourceList}s that are used by activities that are in progress.
*/
private final Set<ResourceActivity> inProgress = new HashSet<ResourceActivity>();
private final Set<ResourceActivity> inProgress = new CopyOnWriteArraySet<ResourceActivity>();

/**
* View of {@link #inProgress} that exposes its {@link ResourceList}.
@@ -125,7 +125,7 @@ public synchronized Resource getMissingResource(ResourceList resources) {
* the given activity, or null if it's not blocked (and thus the
* given activity can be executed immediately.)
*/
public synchronized ResourceActivity getBlockingActivity(ResourceActivity activity) {
public ResourceActivity getBlockingActivity(ResourceActivity activity) {
ResourceList res = activity.getResourceList();
for (ResourceActivity a : inProgress)
if(res.isCollidingWith(a.getResourceList()))

0 comments on commit 2efa709

Please sign in to comment.
You can’t perform that action at this time.