Issue Type: New Feature New Feature
Assignee: Jesse Glick
Components: workflow-plugin
Created: 17/Dec/14 4:23 PM
Description:

Would be useful to have a step which lets you throttle how many ExecutorStepExecution instances from this flow run (or job?) are permitted to run concurrently, even if there are enough free executors in the system. For example:

def branches = [:];
for (int i = 0; i < 100; i++) {
  branches["part${i}"] = {
    node {
      if (i % 5 == 0) {
        runSomethingQuiteSlow();
      } else {
        runSomethingQuick();
      }
    }
  };
}
throttleNodes(10) {
    parallel branches;
}

This would ensure that at most ten slaves are running stuff for your job at any given time. This is better than just creating ten branches, because if a slave finishes one of the quick branches it can proceed to pick up and run another branch while some other slaves remain busy with slow branches.

The step need do nothing more than register a QueueTaskDispatcher active during its body which counts running Queue.Task instances associated with this Run (or Job) and rejects attempts to schedule more than a specified limit.

Project: Jenkins
Priority: Minor Minor
Reporter: Jesse Glick
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to