-
New Feature
-
Resolution: Fixed
-
Minor
-
None
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.
- is related to
-
JENKINS-31801 Pipeline Support in Throttle Concurrent Builds
- Resolved
- relates to
-
JENKINS-44085 have a simple way to limit the number of parallel branches that run concurrently
- Open