-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major
-
Component/s: throttle-concurrent-builds-plugin
-
None
-
Environment:Jenkins 2.89
Throttle Concurrent Builds Plug-in 2.0.1
It seems not to work to throttle stage{} or steps{} blocksĀ in a declarative Jenkinsfile.
When throttle is used outside of a steps block I get an syntax error.
When I use throttle inside a steps block it doesn't have any effect.
I have a throttle category named build configured to run max. 4 jobs per Node, max. total concurrentĀ builds is 0.
It works when I'm using throttle() in the scripted syntax.
With the following job the throttling category has no effect:
Ā
pipeline {
agent any
stages {
stage("sleep") {
steps {
throttle(["build"]) {
sh 'echo sleeping; sleep 120;'
}
}
}
}
}
Ā
When using a node inside throttle, throttling works but the declarative syntax requires a label parameterĀ for node().
That has the disadvantages:
- It's not possible to run the step on any node and throttle it, except you tag all jenkins machines with the same label.
- a new node uses a different workspace
- an executor is consumed for the node block, if it's throttled the executor will be only waiting for being allowed to run
steps {
throttle(["build"]) {
node(label: "master") {
sh 'echo sleeping; sleep 120;'
}
}
}
Ā
Ā
(I also couldn't find any documentation about how to use it in declarative syntax)
Ā