Skip to content
Permalink
Browse files

[FIXED JENKINS-16831] Use Queue.getApproximateItemsQuickly to avoid l…

…ocks from UI.
  • Loading branch information
jglick authored and kohsuke committed Feb 15, 2013
1 parent 2efa709 commit d4230ffc67bf24860965d0557aa2bce9ef3fdeb2
Showing with 10 additions and 5 deletions.
  1. +3 −1 changelog.html
  2. +7 −4 core/src/main/java/hudson/widgets/BuildHistoryWidget.java
@@ -55,7 +55,9 @@
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=>
<li class=bug>
Lock contention issue in build history view.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-16831">issue 16831</a>)
<li class=bug>
Fixed the HTTP request thread saturation problem with Winstone.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-16474">issue 16474</a>)
@@ -27,8 +27,7 @@
import hudson.model.Queue.Item;
import hudson.model.Queue.Task;

import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

/**
@@ -60,8 +59,12 @@ public Item getQueuedItem() {
* Returns the queue item if the owner is scheduled for execution in the queue, in REVERSE ORDER
*/
public List<Item> getQueuedItems() {
List<Item> list = new ArrayList<Item>(Jenkins.getInstance().getQueue().getItems(owner));
Collections.reverse(list);
LinkedList<Item> list = new LinkedList<Item>();
for (Item item : Jenkins.getInstance().getQueue().getApproximateItemsQuickly()) {
if (item.task == owner) {
list.push(item);
}
}
return list;
}
}

0 comments on commit d4230ff

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