This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch jenkins-cleanup-trusted-main
in repository https://gitbox.apache.org/repos/asf/tvm.git

commit bdad0572192a08bb555ce6b2373ba975df8902dc
Author: Tianqi Chen <[email protected]>
AuthorDate: Thu Oct 15 14:49:33 2026 +0000

    [CI] Preserve the original newest-build node retry policy
---
 ci/jenkins/generated/common.groovy | 30 +++++++-----------------------
 1 file changed, 7 insertions(+), 23 deletions(-)

diff --git a/ci/jenkins/generated/common.groovy 
b/ci/jenkins/generated/common.groovy
index 5188bbd294..89e6aa93ab 100644
--- a/ci/jenkins/generated/common.groovy
+++ b/ci/jenkins/generated/common.groovy
@@ -294,7 +294,7 @@ def run_on_node(label, name, folder, image, variables, 
body) {
 // name marks skipped stages; folder isolates executor workspaces; variables 
is optional.
 // Skip before allocation/setup. Each attempt checks out sources, then times 
the body.
 // Keep docker_init explicit in the body. Omit retry_instance for a single 
attempt;
-// otherwise failures retry only for the newest build, with cancellation 
propagated.
+// otherwise failures, including interruptions, retry only for the newest 
build.
 def with_node(options, body) {
   if (skip_ci) {
     Utils.markStageSkippedForConditional(options.name)
@@ -310,29 +310,13 @@ def with_node(options, body) {
       }
     }
   }
-  if (!options.retry_instance) {
+  try {
     run(options.instance)
-    return
-  }
-  def failure = null
-  // The Pipeline retry step distinguishes actual cancellation from retryable
-  // agent loss/timeouts without calling restricted exception methods in 
Groovy.
-  retry(2) {
-    if (failure == null) {
-      try {
-        run(options.instance)
-      } catch (Throwable ex) {
-        failure = ex
-        throw ex
-      }
-    } else {
-      // Plain thread interruption must also propagate before another 
allocation.
-      if (failure instanceof InterruptedException &&
-          !(failure instanceof 
org.jenkinsci.plugins.workflow.steps.FlowInterruptedException)) {
-        throw failure
-      }
-      retry_latest(failure) { run(options.retry_instance) }
-    }
+  } catch (Throwable ex) {
+    if (!options.retry_instance) throw ex
+    // Preserve the original newest-build retry policy, including 
interruptions.
+    // Failures from the single on-demand attempt propagate without another 
retry.
+    retry_latest(ex) { run(options.retry_instance) }
   }
 }
 

Reply via email to