Does anybody have an idea how to limit concurrent builds with a declarative pipeline set up in a multibranch job across branches?
Anytime we set an agent for a stage, a new executor will be allocated. This leads to deadlocks e.g. when you have builds triggered concurrently for as many branches as you have executors. Not setting an agent leads to the stage chosing an executor randomly, which isn't acceptable as certain stages need to run on certain agents...
The classic approaches don't work:
- Throttle Concurrent Builds Plugin doesn't work with multibranch
- Setting
properties([disableConcurrentBuilds()])just limits concurrency per branch - the
lockstep needsagent nonein the pipeline root to prevent allocating executors, but this hinders our globalpostblock to execute suff as it needs an agent and apparently one cannot set an agent for the post block