Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-41276

Abort doesn't work with Retry

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When using a retry wrapper in Pipeline you cannot abort during the retry, the abort is treated as any other failiure.

        Attachments

        1. console
          1 kB
        2. Jenkinsfile
          0.2 kB

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            pom.xml
            src/main/java/org/jenkinsci/plugins/workflow/steps/RetryStepExecution.java
            src/test/java/org/jenkinsci/plugins/workflow/steps/RetryStepTest.java
            http://jenkins-ci.org/commit/workflow-basic-steps-plugin/422295a5dbac5192e0320d916fb37838e3c24c87
            Log:
            [FIXED JENKINS-41276] Do not continue to retry when the failure is a user interruption.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/org/jenkinsci/plugins/workflow/steps/RetryStepExecution.java src/test/java/org/jenkinsci/plugins/workflow/steps/RetryStepTest.java http://jenkins-ci.org/commit/workflow-basic-steps-plugin/422295a5dbac5192e0320d916fb37838e3c24c87 Log: [FIXED JENKINS-41276] Do not continue to retry when the failure is a user interruption.
            Hide
            jglick Jesse Glick added a comment -

            Possibly should be extended to handle aborts coming from timeout, or perhaps any cause.

            Show
            jglick Jesse Glick added a comment - Possibly should be extended to handle aborts coming from timeout , or perhaps any cause.
            Hide
            bkmeneguello Bruno Meneguello added a comment -

            Still now working.
            Pipeline: Basic Steps 2.6
            sample: Jenkinsfileoutput: console

            Show
            bkmeneguello Bruno Meneguello added a comment - Still now working. Pipeline: Basic Steps 2.6 sample:  Jenkinsfile output:  console
            Hide
            timja Tim Jacomb added a comment - - edited

            I'm also having the same issue as Bruno...

            Apologies my issue looks different I'm catching the exception which interferes

            Show
            timja Tim Jacomb added a comment - - edited I'm also having the same issue as Bruno... Apologies my issue looks different I'm catching the exception which interferes
            Hide
            b_dean Ben Dean added a comment -

            Just ran into this and I imagine my scenario is similar to what Bruno Meneguello and Tim Jacomb were getting.

            If you have an exception thrown in a finally block it'll win out instead of the FlowInterruptedException

            retry(5) {
                try {
                    sh "do_something_slow"
                } finally {
                    echo "Cleaning up"
            
                    // Do something that raises an exception
                    def x = 1/0
                }
            }
            

            You'll end up losing the abort exception and retrying again even though you aborted. Same thing with timeouts.

            Show
            b_dean Ben Dean added a comment - Just ran into this and I imagine my scenario is similar to what  Bruno Meneguello and Tim Jacomb were getting. If you have an exception thrown in a finally block it'll win out instead of the FlowInterruptedException retry(5) { try { sh "do_something_slow" } finally { echo "Cleaning up" // Do something that raises an exception def x = 1/0 } } You'll end up losing the abort exception and retrying again even though you aborted. Same thing with timeouts.

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                hrmpw Patrick Wolf
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: