diff --git a/core/src/main/java/hudson/model/Executor.java b/core/src/main/java/hudson/model/Executor.java index 03b146908c1d..d30ecf5da889 100644 --- a/core/src/main/java/hudson/model/Executor.java +++ b/core/src/main/java/hudson/model/Executor.java @@ -389,6 +389,9 @@ public SubTask call() throws Exception { } 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); } diff --git a/core/src/main/java/hudson/model/Queue.java b/core/src/main/java/hudson/model/Queue.java index 28e24f8f2e99..bbc227604e89 100644 --- a/core/src/main/java/hudson/model/Queue.java +++ b/core/src/main/java/hudson/model/Queue.java @@ -612,6 +612,9 @@ public WaitingItem schedule(Task p, int quietPeriod, List actions) { 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 @@ private List liveGetItems(Task t) { List result = new ArrayList(); 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 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 void maintain() { 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 } }