[JIRA] (JENKINS-61034) retry step is ignored when a timeout happens a timeout

433 views
Skip to first unread message

kuisathaverat@gmail.com (JIRA)

unread,
Feb 10, 2020, 9:16:02 AM2/10/20
to jenkinsc...@googlegroups.com
Ivan Fernandez Calvo created an issue
 
Jenkins / Bug JENKINS-61034
retry step is ignored when a timeout happens a timeout
Issue Type: Bug Bug
Assignee: Unassigned
Components: workflow-basic-steps-plugin
Created: 2020-02-10 14:15
Environment: Jenkins core 2.219
workflow-basic-steps-plugin 2.19
Priority: Minor Minor
Reporter: Ivan Fernandez Calvo

After upgrade to the latest version of the Jenkins core and workflow-basic-steps-plugin, we have detected that the behavior of the retry + timeout steps changes, the following code before the change was retied 3 times, now the job is aborted in the first timeout so the retry is ignored.

```
pipeline {
agent any
stages {
stage('Test timeout') {
steps {
retry(3){
timeout(time: 10, unit: 'SECONDS')

{ sleep 30 }

}
}
}
}
}
```

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

kuisathaverat@gmail.com (JIRA)

unread,
Feb 10, 2020, 9:17:02 AM2/10/20
to jenkinsc...@googlegroups.com
Ivan Fernandez Calvo updated an issue
After upgrade to the latest version of the Jenkins core and workflow-basic-steps-plugin, we have detected that the behavior of the retry + timeout steps changes, the following code before the change was retied 3 times, now the job is aborted in the first timeout so the retry is ignored.

``` {code}
pipeline {
   agent any
   stages {
      stage('Test timeout') {
         steps {
            retry(3){
                timeout(time: 10, unit: 'SECONDS'){
                    sleep 30
                }
            }
         }
      }
   }
}
``` {code}

kuisathaverat@gmail.com (JIRA)

unread,
Feb 10, 2020, 9:20:04 AM2/10/20
to jenkinsc...@googlegroups.com

kuisathaverat@gmail.com (JIRA)

unread,
Feb 10, 2020, 9:37:02 AM2/10/20
to jenkinsc...@googlegroups.com

I was looking for a workaround and I found that catchError does not catch the Abort launched by timeout too, I think that it is the same bug.

pipeline {
   agent any
   stages {
      stage('Hello') {
         steps {
            retry(3){
                catchError(stageResult: 'FAILURE', catchInterruptions: true,) {
                    timeout(time: 10, unit: 'SECONDS'){
                        sleep 30
                    }
                }
            }
         }
      }
   }
}

kuisathaverat@gmail.com (JIRA)

unread,
Feb 10, 2020, 9:38:04 AM2/10/20
to jenkinsc...@googlegroups.com
I was looking for a workaround and I found that catchError does not catch the Abort launched by timeout too, I think that it is the same bug.

{code}
pipeline {
   agent any
   stages {
      stage('
Hello Test timeout ') {

         steps {
            retry(3){
                catchError(stageResult: 'FAILURE', catchInterruptions: true,) {
                    timeout(time: 10, unit: 'SECONDS'){
                     sleep 30
                    }
                }
            }
         }
      }
   }
}
{code}

kuisathaverat@gmail.com (JIRA)

unread,
Feb 10, 2020, 9:39:02 AM2/10/20
to jenkinsc...@googlegroups.com
The ugly workaround is to use a try-catch

{code}
pipeline {
   agent any

   stages {
      stage('Hello') {
         steps {
            retry(3){
                script {
                    try {

                     timeout(time: 10, unit: 'SECONDS'){
                     sleep 30
                     }
                    } catch(err){
                     error("retry this please")
                    }
                }
            }
         }
      }
   }
}

{code}

kuisathaverat@gmail.com (JIRA)

unread,
Feb 10, 2020, 9:39:02 AM2/10/20
to jenkinsc...@googlegroups.com

The ugly workaround is to use a try-catch

pipeline {
agent any

stages {
stage('Hello') {
steps {
retry(3){
script {
try {
timeout(time: 10, unit: 'SECONDS')

{ sleep 30 }

} catch(err)

{ error("retry this please") }

}
}
}
}
}
}

Reply all
Reply to author
Forward
0 new messages