Skip to content

ci: serialize Jenkinsfile runs via lockable-resource#147

Merged
blehnen merged 1 commit into
masterfrom
chore/jenkins-single-build
May 20, 2026
Merged

ci: serialize Jenkinsfile runs via lockable-resource#147
blehnen merged 1 commit into
masterfrom
chore/jenkins-single-build

Conversation

@blehnen
Copy link
Copy Markdown
Owner

@blehnen blehnen commented May 19, 2026

Why

Jenkins agent pool gets overloaded when multiple PRs run concurrently. Each Jenkinsfile run launches 14 parallel integration-test stages, so two concurrent runs demand 28 executor slots. The recent triple-PR situation (#143 + #145 + #146) tipped the pool.

What this PR does

Adds a single lock(resource: 'dotnetworkqueue-ci') to the Jenkinsfile's options block. Uses the Lockable Resources plugin (already present in standard Jenkins installs). Effect: only ONE Jenkinsfile run executes anywhere in the repo at a time; second/third/etc. queue.

Tradeoff

Serial queuing makes wall-clock time grow linearly with queue depth. With ~50-min builds, three queued PRs take ~2.5h end-to-end vs ~50min parallel. If that's too slow in practice, the follow-up upgrade is the "Throttle Concurrent Builds" plugin with Max Total Concurrent Builds = 2 (lets 2 PRs run in parallel, third waits).

Test plan

  • Jenkins green on this PR
  • After merge: observe that subsequent PRs queue rather than run in parallel
  • If serialization is too slow, escalate to Throttle plugin (separate PR)

Note

The PR itself ironically triggers one more concurrent build on top of the current queue (#143, #145). After merge, the throttle takes effect for all future runs.

🤖 Generated with Claude Code

…time)

Jenkins agent pool gets saturated when multiple PRs (or PR + master merge)
run concurrently — each Jenkinsfile run launches 14 parallel stages, so
two concurrent runs demand 28 executor slots. Add a global lock using the
Lockable Resources plugin so only one pipeline run executes at a time
across the whole repo (master + every PR branch).

Tradeoff: queued runs wait their turn. With ~50-min build duration, 3
queued PRs serialize to ~2.5h wall-clock. If that's too slow, upgrade to
the "Throttle Concurrent Builds" plugin with Max=2 instead (PR-level
parallelism with a ceiling).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

Warning

Rate limit exceeded

@blehnen has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 11 minutes and 50 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4b93ffe3-a4cb-4817-85c3-ed785b0f050d

📥 Commits

Reviewing files that changed from the base of the PR and between 1eec4af and de60f74.

📒 Files selected for processing (1)
  • Jenkinsfile

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@blehnen blehnen merged commit ad4f560 into master May 20, 2026
2 of 3 checks passed
@blehnen blehnen deleted the chore/jenkins-single-build branch May 20, 2026 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant