We encountered this problem in a dramatic fashion last night in a branch of a multibranch pipeline job whose pipelines did NOT set disableConcurrentBuilds() option, in a jenkins cluster containing:
- 1 Controller (Zero Executors)
- 2 Build Agents (2 Executors Each)
A single branch job using `pollSCM('H/5 * * * *')` trigger entered a feedback look where every 5 minutes it was triggered (for the same revision) even though there were no SCM changes.
Reading Daniel Beck's comment, I see that the pollSCM mechanism didn't see that this specific revision was built because these builds were waiting for an executor for long periods of time, so the SCM polling triggers would keep happening even if there were no changes.
The executor stall can be considered the "root cause", and we can attempt to fix this with infrastrucutre, however, it would be nice to have a way to prevent pollSCM triggers from "running amok" in this way.
Yes, we could disableConcurrentBuilds() in all branch job pipelines, but pushing such a change to all branches is very cumbersome. It would be nice to be able to specify this in JobDSL. But as I discuss Here multibranch pipelines do not appear to support disabling Concurrent builds via jobDSL. As I describe, rate limiting is not appropriate here, since it requires the jobDSL to know something about build time. We want a simple "build serialization" that is provided by disableConcurrentBuilds in pipeline, without requiring every Jenkinsfile to specify it.