From e5d40af207bcdc439133041647dd3b667bb9b6a5 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 8 Apr 2021 19:41:40 -0400 Subject: [PATCH] [CI] Don't retry steps after a build has been aborted or timed out (#96600) (#96650) Co-authored-by: Brian Seeders --- vars/retryable.groovy | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vars/retryable.groovy b/vars/retryable.groovy index ed84a00ece49d..bfd021ddd8167 100644 --- a/vars/retryable.groovy +++ b/vars/retryable.groovy @@ -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