提交 a57b52ec 编写于 作者: J Jesse Glick 提交者: Oleg Nenashev

[FIXED JENKINS-39454] Do not consider pendings when deciding whether a...

[FIXED JENKINS-39454] Do not consider pendings when deciding whether a schedule result should be new or existing, as we have already taken a snapshot of actions. (#2609)
上级 58e1228c
......@@ -389,6 +389,9 @@ public class Executor extends Thread implements ModelObject {
}
if (executable instanceof Actionable) {
if (LOGGER.isLoggable(Level.FINER)) {
LOGGER.log(FINER, "when running {0} from {1} we are copying {2} actions whereas the item currently has {3}", new Object[] {executable, workUnit.context.item, workUnit.context.actions, workUnit.context.item.getAllActions()});
}
for (Action action: workUnit.context.actions) {
((Actionable) executable).addAction(action);
}
......
......@@ -612,6 +612,9 @@ public class Queue extends ResourceController implements Saveable {
for (Item item : duplicatesInQueue) {
for (FoldableAction a : Util.filter(actions, FoldableAction.class)) {
a.foldIntoExisting(item, p, actions);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, "after folding {0}, {1} includes {2}", new Object[] {a, item, item.getAllActions()});
}
}
}
......@@ -1049,7 +1052,13 @@ public class Queue extends ResourceController implements Saveable {
List<Item> result = new ArrayList<Item>();
result.addAll(blockedProjects.getAll(t));
result.addAll(buildables.getAll(t));
result.addAll(pendings.getAll(t));
// Do not include pendings—we have already finalized WorkUnitContext.actions.
if (LOGGER.isLoggable(Level.FINE)) {
List<BuildableItem> thePendings = pendings.getAll(t);
if (!thePendings.isEmpty()) {
LOGGER.log(Level.FINE, "ignoring {0} during scheduleInternal", thePendings);
}
}
for (Item item : waitingList) {
if (item.task.equals(t)) {
result.add(item);
......@@ -1414,7 +1423,7 @@ public class Queue extends ResourceController implements Saveable {
p.task.getFullDisplayName());
p.isPending = false;
pendings.remove(p);
makeBuildable(p);
makeBuildable(p); // TODO whatever this is for, the return value is being ignored, so this does nothing at all
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册