Skip to content

Commit

Permalink
prefer any node with non-zero executors
Browse files Browse the repository at this point in the history
If we have any node that is designated to run some stuff, it probably meets the expectation better to run the task there, as opposed to use a node without any executors configured.
  • Loading branch information
kohsuke committed Mar 25, 2013
1 parent 27b5719 commit 7e1806b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/model/Queue.java
Expand Up @@ -1059,9 +1059,9 @@ public String hash(Node node) {
});
Jenkins h = Jenkins.getInstance();
// Even if master is configured with zero executors, we may need to run a flyweight task like MatrixProject on it.
hash.add(h, Math.max(h.getNumExecutors(), 1) * 100);
hash.add(h, Math.max(h.getNumExecutors()*100, 1));
for (Node n : h.getNodes())
hash.add(n, Math.max(n.getNumExecutors(), 1) * 100);
hash.add(n, Math.max(n.getNumExecutors()*100, 1));

Label lbl = p.getAssignedLabel();
for (Node n : hash.list(p.task.getFullDisplayName())) {
Expand Down

0 comments on commit 7e1806b

Please sign in to comment.