Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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 7e74ab6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions core/src/main/java/hudson/model/Queue.java
Expand Up @@ -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));
Expand Down

1 comment on commit 7e74ab6

@ndeloof
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.