Skip to content

Conversation

@gbhat618
Copy link
Contributor

@gbhat618 gbhat618 commented Feb 21, 2025

When a pipeline fails with SynchronousResumeNotSupportedException, identifying the exact cause is difficult, even though the step name can be found in flowNodeStore.xml. This PR improves the error message by including the step function name, making debugging easier.

This is especially helpful when:

  • The pipeline uses shared libraries, and a failure occurs inside library steps.
  • The pipeline is long, with many steps or parallel executions.

Additionally, this PR suggests using the retry step in exception message, helping developers handle this exception correctly.

Testing done

  • Ensured the english is correct - grammar and punctuations.

  • Exception message is correctly printed

    pipeline logs
    2.199 [p #1] Started
    2.365 [p #1] [Pipeline] Start of Pipeline
    2.420 [p #1] [Pipeline] simulatedSleep
    2.420 [p #1] Simulated sleep step started
    2.420 [p #1] Going to sleep for 20 seconds
    0.237 [p #1] Resuming build at Mon Feb 24 19:03:57 IST 2025 after Jenkins restart
    0.287 [p #1] Ready to run at Mon Feb 24 19:03:57 IST 2025
    0.287 [p #1] [Pipeline] End of Pipeline
    0.334 [p #1] Also:   org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 4c2524fc-7fd1-4054-b82d-026b2c0a39b5
    0.334 [p #1] org.jenkinsci.plugins.workflow.steps.SynchronousResumeNotSupportedException: The Pipeline step `simulatedSleep` cannot be resumed after a controller restart. In Scripted syntax, you may wrap its containing `node` block within `retry(conditions: [nonresumable()], count: 2) {...}`, or, in Declarative syntax, use the `retries` option to an `agent` directive to allow the stage to be retried.
    0.334 [p #1] 	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.onResume(SynchronousNonBlockingStepExecution.java:78)
    0.334 [p #1] 	at org.jenkinsci.plugins.workflow.flow.FlowExecutionList$ParallelResumer.lambda$run$6(FlowExecutionList.java:426)
    0.334 [p #1] 	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
    0.334 [p #1] 	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
    0.334 [p #1] 	at jenkins.util.ErrorLoggingExecutorService.lambda$wrap$0(ErrorLoggingExecutorService.java:51)
    0.334 [p #1] 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
    0.334 [p #1] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    0.334 [p #1] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    0.335 [p #1] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    0.335 [p #1] 	at java.base/java.lang.Thread.run(Thread.java:840)
    0.335 [p #1] Finished: FAILURE
    
  • Automated test in: jenkinsci/workflow-support-plugin#306 due to workflow-step-api-plugin is already dependency in workflow-support-plugin (see comment)

Submitter checklist

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

@gbhat618
Copy link
Contributor Author

testing and getStepDisplayFunctionName implementation is in jenkinsci/workflow-support-plugin#306

gbhat618 and others added 3 commits February 24, 2025 14:45
…ResumeNotSupportedException.java


fix javadoc

Co-authored-by: Vincent Latombe <vincent@latombe.net>
@gbhat618 gbhat618 marked this pull request as ready for review February 24, 2025 12:26
@gbhat618 gbhat618 requested a review from a team as a code owner February 24, 2025 12:26
gbhat618 and others added 5 commits February 24, 2025 18:22
…onUtil.java

Co-authored-by: Jesse Glick <jglick@cloudbees.com>
…ResumeNotSupportedException.java

Co-authored-by: Jesse Glick <jglick@cloudbees.com>
…ResumeNotSupportedException.java

Co-authored-by: Jesse Glick <jglick@cloudbees.com>
…ResumeNotSupportedException.java

Co-authored-by: Jesse Glick <jglick@cloudbees.com>
@jglick jglick merged commit 6e45cba into jenkinsci:master Feb 24, 2025
17 checks passed
@gbhat618 gbhat618 deleted the import-SynchronousResumeNotSupportedException-message branch February 25, 2025 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants