Skip to content

fix: Make BecauseResourcesTimeout fatal to fix freestyle lock timeout on Jenkins 2.532+#1027

Merged
mPokornyETM merged 2 commits intomasterfrom
fix/1026-freestyle-timeout-jenkins-2.532
Apr 27, 2026
Merged

fix: Make BecauseResourcesTimeout fatal to fix freestyle lock timeout on Jenkins 2.532+#1027
mPokornyETM merged 2 commits intomasterfrom
fix/1026-freestyle-timeout-jenkins-2.532

Conversation

@mPokornyETM
Copy link
Copy Markdown
Contributor

Summary

Jenkins 2.532 (core PR jenkinsci/jenkins#11173) changed Queue.maintain() to create a new BlockedItem instead of updating the existing one when canRun() returns a CauseOfBlockage. This caused the manual Queue.cancel() in checkFreestyleTimeout() to be immediately undone, so the freestyle lock timeout never actually removed the queue item.

Fix

  • Override isFatal() returning true on BecauseResourcesTimeout, so the queue itself handles the cancellation via the new mechanism.
  • Bump Jenkins baseline from 2.528 to 2.541 (the next LTS line that includes the isFatal() API from core PR #11173).
  • Update BOM to 6364.v16b_76a_4023c7 (latest for bom-2.541.x).

The existing manual Queue.cancel() call in checkFreestyleTimeout is kept as belt-and-suspenders.

Fixes #1026

… on Jenkins 2.532+

Jenkins 2.532 (core PR #11173) changed Queue.maintain() to create a new
BlockedItem instead of updating the existing one when canRun() returns a
CauseOfBlockage. This caused the manual Queue.cancel() in
checkFreestyleTimeout() to be immediately undone.

Override isFatal() returning true on BecauseResourcesTimeout so the queue
itself handles the cancellation. Also bump Jenkins baseline to 2.541 (the
next LTS line that includes the isFatal() API) and update BOM accordingly.

Fixes #1026
@mPokornyETM mPokornyETM requested a review from a team as a code owner April 26, 2026 20:06
@github-actions github-actions Bot added bug dependencies Dependeny updates java Pull requests that update Java code labels Apr 26, 2026
@mPokornyETM
Copy link
Copy Markdown
Contributor Author

@MarkEWaite I hope this helps.

@mPokornyETM mPokornyETM added the merge-in-1-day-without-review Auto-approve countdown label Apr 26, 2026
Copy link
Copy Markdown
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I confirmed that it passes the tests in the plugin BOM.

@mPokornyETM mPokornyETM merged commit 3805482 into master Apr 27, 2026
21 checks passed
@mPokornyETM mPokornyETM deleted the fix/1026-freestyle-timeout-jenkins-2.532 branch April 27, 2026 05:20
@mPokornyETM
Copy link
Copy Markdown
Contributor Author

@MarkEWaite thx for rising the issue and you fast response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug dependencies Dependeny updates java Pull requests that update Java code merge-in-1-day-without-review Auto-approve countdown

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Newly added FreeStyleTimeoutTest fails on Jenkins 2.532 and newer

2 participants