Skip to content
Permalink
Browse files

[FIXED JENKINS-7291] Permit flyweight tasks to run on master even whe…

…n it has zero configured executors.
  • Loading branch information
jglick committed Mar 19, 2013
1 parent 845bf37 commit 7e74ab6a6479ec1ee7564663d080f276996930c5
Showing with 11 additions and 2 deletions.
  1. +11 −2 core/src/main/java/hudson/model/Queue.java
@@ -1058,14 +1058,23 @@ public String hash(Node node) {
}
});
Jenkins h = Jenkins.getInstance();
hash.add(h, h.getNumExecutors()*100);
hash.add(h, (h.getNumExecutors() + /* JENKINS-7291 */1) * 100);
for (Node n : h.getNodes())
hash.add(n,n.getNumExecutors()*100);

Label lbl = p.getAssignedLabel();
for (Node n : hash.list(p.task.getFullDisplayName())) {
Computer c = n.toComputer();
if (c==null || c.isOffline()) continue;
if (c == null) {
if (n instanceof Jenkins) { // JENKINS-7291
c = ((Jenkins) n).createComputer();
} else {
continue;
}
}
if (c.isOffline()) {
continue;
}
if (lbl!=null && !lbl.contains(n)) continue;
if (n.canTake(p) != null) continue;
c.startFlyWeightTask(new WorkUnitContext(p).createWorkUnit(p.task));

1 comment on commit 7e74ab6

@ndeloof

This comment has been minimized.

Copy link
Contributor

@ndeloof ndeloof commented on 7e74ab6 Mar 20, 2013

I'd prefer a comment explaining how this +1 hack fixes the issue that an inlined comment with bug ID

Please sign in to comment.