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

            hrmpw Patrick Wolf created issue -
            hrmpw Patrick Wolf made changes -
            Field Original Value New Value
            Assignee CloudBees Inc. [ cloudbees ]
            rsandell rsandell made changes -
            Assignee CloudBees Inc. [ cloudbees ] rsandell [ rsandell ]
            rsandell rsandell made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            rsandell rsandell made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            rsandell rsandell made changes -
            Remote Link This issue links to "PR 34 (Web Link)" [ 15322 ]
            rsandell rsandell made changes -
            Component/s workflow-basic-steps-plugin [ 21712 ]
            jglick Jesse Glick made changes -
            Component/s pipeline [ 21692 ]
            jglick Jesse Glick made changes -
            Assignee rsandell [ rsandell ] Jesse Glick [ jglick ]
            jglick Jesse Glick made changes -
            Status In Review [ 10005 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "workflow-basic-steps PR 35 (Web Link)" [ 15391 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "workflow-cps PR 103 (Web Link)" [ 15392 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "workflow-step-api PR 20 (Web Link)" [ 15393 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "workflow-job PR 36 (Web Link)" [ 15394 ]
            recampbell Ryan Campbell made changes -
            Link This issue is duplicated by JENKINS-41774 [ JENKINS-41774 ]
            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/job/WorkflowRun.java
            src/test/java/org/jenkinsci/plugins/workflow/job/WorkflowRunTest.java
            http://jenkins-ci.org/commit/workflow-job-plugin/0eeee8d0d482f08149530a337a5500b760abd9dc
            Log:
            JENKINS-41276 Make sure a FlowInterruptedException coming from a build abort is properly initialized with causes.

            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/job/WorkflowRun.java src/test/java/org/jenkinsci/plugins/workflow/job/WorkflowRunTest.java http://jenkins-ci.org/commit/workflow-job-plugin/0eeee8d0d482f08149530a337a5500b760abd9dc Log: JENKINS-41276 Make sure a FlowInterruptedException coming from a build abort is properly initialized with causes.
            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/job/WorkflowRun.java
            src/test/java/org/jenkinsci/plugins/workflow/job/WorkflowRunTest.java
            http://jenkins-ci.org/commit/workflow-job-plugin/00d7e14f4613fa45d2280c246808ee477b74515e
            Log:
            JENKINS-41276 Merging #36 incl. workflow-step-api 2.9

            Compare: https://github.com/jenkinsci/workflow-job-plugin/compare/139ac7e5da1e...00d7e14f4613

            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/job/WorkflowRun.java src/test/java/org/jenkinsci/plugins/workflow/job/WorkflowRunTest.java http://jenkins-ci.org/commit/workflow-job-plugin/00d7e14f4613fa45d2280c246808ee477b74515e Log: JENKINS-41276 Merging #36 incl. workflow-step-api 2.9 Compare: https://github.com/jenkinsci/workflow-job-plugin/compare/139ac7e5da1e...00d7e14f4613
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            .gitignore
            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/fe87fea108a8d3f8608f15c2253090a0099cd1d4
            Log:
            JENKINS-41276 Do not retry if user aborted the build

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: .gitignore 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/fe87fea108a8d3f8608f15c2253090a0099cd1d4 Log: JENKINS-41276 Do not retry if user aborted the build
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            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/3c2bba96d5ac14eb47dbbd326a6739f023e5003e
            Log:
            JENKINS-41276 Fixed some review comments

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: 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/3c2bba96d5ac14eb47dbbd326a6739f023e5003e Log: JENKINS-41276 Fixed some review comments
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            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/3c9dfec7b287d6f8b6b17febf9d069e9571b7468
            Log:
            JENKINS-41276 Reverting back to check the InterruptedBuilAction

            Because the FlowInterruptedAction didn't contain any causes.
            Added an extra check in the test to make sure the build is actually
            aborted and doesn't continue to run after the retry.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: 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/3c9dfec7b287d6f8b6b17febf9d069e9571b7468 Log: JENKINS-41276 Reverting back to check the InterruptedBuilAction Because the FlowInterruptedAction didn't contain any causes. Added an extra check in the test to make sure the build is actually aborted and doesn't continue to run after the retry.
            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.
            jglick Jesse Glick made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            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.
            bkmeneguello Bruno Meneguello made changes -
            Attachment Jenkinsfile [ 40245 ]
            bkmeneguello Bruno Meneguello made changes -
            Attachment console [ 40246 ]
            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
            timja Tim Jacomb made changes -
            Resolution Fixed [ 1 ]
            Status Resolved [ 5 ] Reopened [ 4 ]
            timja Tim Jacomb made changes -
            Status Reopened [ 4 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-44379 [ JENKINS-44379 ]
            abayer Andrew Bayer made changes -
            Link This issue is duplicated by JENKINS-37128 [ JENKINS-37128 ]
            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:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: