Jenkinsfile: throttle concurrent builds - #1782
Merged
val-ms merged 1 commit intoAug 12, 2026
Merged
Conversation
Jenkinsfile-defined job properties are unavailable when Jenkins queues the first build of a newly discovered multibranch job. Use the runtime throttle step around agent allocation so first builds also observe the global clamav category. Refs: jenkinsci/throttle-concurrent-builds-plugin#448
val-ms
force-pushed
the
throttle-concurrent-builds-first-run
branch
from
July 29, 2026 16:19
191b6f1 to
b5903f6
Compare
Contributor
Author
|
Updated after Jenkins rejected an |
rsundriyal
self-requested a review
August 12, 2026 18:34
rsundriyal
approved these changes
Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This replaces #1780 with runtime throttling that also covers the first build of a newly discovered multibranch job.
A Jenkinsfile-defined
throttleJobPropertyis not present when Jenkins queues the first run of a new branch or pull-request job. Consequently, that first run can bypass the global category limit, as described in jenkinsci/throttle-concurrent-builds-plugin#448.Use the plugin's runtime
throttle()step instead. The pipeline now has no top-level agent. A parent sequential stage namedClamAV pipelineentersthrottle(['clamav'])before allocating the existingdefaultagent, then runs the existing Generate Tarball, Build, and Tests stages within that agent and throttle scope.This structure holds one category slot for the complete orchestration run, preserves the existing internal Tests parallelism, and prevents first runs from acquiring an executor while another ClamAV orchestration run is active.
Validation:
git diff --checkJenkinsfileagent none, then stage-levelagentandoptions { throttle(...) }agentis declared on theTestsstage containingparallelthrottleJobPropertyis absentThe replacement PR intentionally uses a new head branch so Jenkins creates a new multibranch PR job and exercises first-run throttling.