Skip to content

Commit

Permalink
[JENKINS-30084] more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
varmenise committed Oct 2, 2015
1 parent e1c197c commit fced6f9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions core/src/main/java/hudson/model/Queue.java
Expand Up @@ -1534,20 +1534,22 @@ public void maintain() {
if (!isBlockedByShutdown(p.task)) {

Runnable runnable = buildOnTemporaryNode(p);
//this is to solve JENKINS-30084: the task has to be buildable to force
//the provisioning of nodes
//if the execution gets here, it means the task could not be scheduled since the node
//the task is supposed to run on is offline

if(runnable!=null){
return runnable;
}

//this is to solve JENKINS-30084: the task has to be buildable to force the provisioning of nodes.
//if the execution gets here, it means the task could not be scheduled since the node
//the task is supposed to run on is offline or not available.
return new Runnable() {
@Override public void run() {
//the flyweighttask enters the buildables queue and will ask Jenkins to provision a node
p.enter(Queue.this);
}
};
}
// if the execution gets here, it means the task is blocked by shutdown.
// if the execution gets here, it means the task is blocked by shutdown and null is returned.
return null;
} else { // regular heavyweight task
return new Runnable() {
Expand Down

0 comments on commit fced6f9

Please sign in to comment.