workflow-basic-steps: retry does not abort when input or milestone try to abort build

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      The 'retry' step was updated in 2.4 to handle exceptions correctly when a user aborts a build.

      However, when an 'input' step is included within the 'retry' block, clicking 'Abort' on the input prompt does not abort the build; the input prompt reappears, per the number of retries set.

      node('linux') {
          stage('one') {
              sleep 5
          }
      
          stage('two') {
              retry(3) {
                  input 'proceed?'
      
                  sleep 5
              }
          }
      }
      

      This issue also occurs when a milestone step from a subsequent/newer build (user OKs the input for the pipeline to proceed) causes a FlowInterruptedException. The retry still catches this, and re-prompts the input:

      node('linux') {
          stage('one') {
              sleep 5
          }
          milestone()
      
          stage('two') {
              retry(3) {
                  input 'proceed?'
      
                  sleep 30
              }
          }
          milestone()
      
          stage('three') {
              sleep 5
          }
          milestone()
      }
      

      Here's the relevant console log of build #8, which is waiting for input, when the input on build #9 is OKed:

      [Pipeline] input
      proceed?
      Proceed or Abort
      Superseded by PIPELINE_retry-abort-test#9
      [Pipeline] }
      ERROR: Execution failed
      org.jenkinsci.plugins.workflow.steps.FlowInterruptedException
      	at org.jenkinsci.plugins.workflow.support.steps.input.InputStepExecution.doAbort(InputStepExecution.java:225)
      	at org.jenkinsci.plugins.workflow.support.steps.input.InputStepExecution$1$1.run(InputStepExecution.java:97)
      	at hudson.security.ACL.impersonate(ACL.java:243)
      	at org.jenkinsci.plugins.workflow.support.steps.input.InputStepExecution$1.run(InputStepExecution.java:95)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Retrying
      [Pipeline] {
      [Pipeline] input
      proceed?
      Proceed or Abort
      Click here to forcibly terminate running steps
      

            Assignee:
            Andrew Bayer
            Reporter:
            Scott Russell
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: