Skip to content

Ticket #1843 - Fix stapler request double completion#1905

Open
pauljohnston2009 wants to merge 1 commit into
jenkinsci:masterfrom
pauljohnston2009:ticket-1843-prevent-duplicate-commit
Open

Ticket #1843 - Fix stapler request double completion#1905
pauljohnston2009 wants to merge 1 commit into
jenkinsci:masterfrom
pauljohnston2009:ticket-1843-prevent-duplicate-commit

Conversation

@pauljohnston2009

@pauljohnston2009 pauljohnston2009 commented Jun 4, 2026

Copy link
Copy Markdown

Resolves #1843

Fix issue with status pngs throwing java.lang.IllegalStateException: COMMITTED

Stapler calls getDynamic, and will keep calling getDynamic on each part of the url, eventualy it hits the end of the parts of the url and thinks the response has not been handled. Stapler sees it as 'not handled' and so eventually trys to complete the response itself, resulting in the double commit error.

Instead we can use doDynamic which means we will fill out the response in all cases, and stapler does not call the rest of the chain https://github.com/jenkinsci/stapler/blob/master/docs/reference.adoc "The doDynamic action method is the final consumer of the request.".

Testing done

Manually tested on our jenkins server, logs are no longer spamming the exception on every statsu.png request.

Submitter checklist

  • [X ] Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • [ X] Ensure that the pull request title represents the desired changelog entry
  • [ X] Please describe what you did
  • [ X] Link to relevant issues in GitHub or Jira
  • [ X] Link to relevant pull requests, esp. upstream and downstream changes
  • [ X] Ensure you have provided tests that demonstrate the feature works or the issue is fixed

@pauljohnston2009 pauljohnston2009 requested a review from a team as a code owner June 4, 2026 06:06
@github-actions github-actions Bot added the tests This PR adds/removes/updates test cases label Jun 4, 2026
Fix issue with status pngs throwing java.lang.IllegalStateException: COMMITTED

Stapler calls getDynamic, and will keep calling getDynamic on each part of the url, eventualy it hits the end of the parts of the url and thingks the response has not been handled
Stapler sees it as 'not handled' and so eventually trys to complete the response itself, resulting in the double commit error

Instead we can use doDynamic which means we will fill out the response in all cases, and stapler does not call the rest of the chain
https://github.com/jenkinsci/stapler/blob/master/docs/reference.adoc "The doDynamic action method is the final consumer of the request."
@pauljohnston2009 pauljohnston2009 force-pushed the ticket-1843-prevent-duplicate-commit branch from 9735105 to aa07105 Compare June 4, 2026 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests This PR adds/removes/updates test cases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

java.lang.IllegalStateException: COMMITTED when querying build status through gitlab plugin

1 participant