Skip to content

Commit

Permalink
[CI] Don't retry steps after a build has been aborted or timed out (e…
Browse files Browse the repository at this point in the history
…lastic#96600) (elastic#96650)

Co-authored-by: Brian Seeders <[email protected]>
  • Loading branch information
kibanamachine and brianseeders authored Apr 8, 2021
1 parent a24e517 commit e5d40af
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vars/retryable.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ def call(label, Closure closure) {

try {
closure()
} catch (ex) {
} catch (org.jenkinsci.plugins.workflow.steps.FlowInterruptedException ex) {
// If the build was aborted, don't retry the step
throw ex
} catch (Exception ex) {
if (haveReachedMaxRetries()) {
print "Couldn't retry '${label}', have already reached the max number of retries for this build."
throw ex
Expand Down

0 comments on commit e5d40af

Please sign in to comment.