提交 d4230ffc 编写于 作者: J Jesse Glick 提交者: Kohsuke Kawaguchi

[FIXED JENKINS-16831] Use Queue.getApproximateItemsQuickly to avoid locks from UI.

上级 2efa7095
......@@ -55,7 +55,9 @@ Upcoming changes</a>
<!-- 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 jenkins.model.Jenkins;
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 class BuildHistoryWidget<T> extends HistoryWidget<Task,T> {
* 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;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册