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


The following commit(s) were added to refs/heads/jenkins-cleanup-trusted-main 
by this push:
     new 4fdf7f3a8e [CI] Use Pipeline retry to handle node interruptions
4fdf7f3a8e is described below

commit 4fdf7f3a8ee97d7edadef3b79e3df09a63941817
Author: Tianqi Chen <[email protected]>
AuthorDate: Thu Oct 15 14:28:48 2026 +0000

    [CI] Use Pipeline retry to handle node interruptions
---
 ci/jenkins/generated/common.groovy | 31 +++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 10 deletions(-)

diff --git a/ci/jenkins/generated/common.groovy 
b/ci/jenkins/generated/common.groovy
index 67b900bb96..84e394c35c 100644
--- a/ci/jenkins/generated/common.groovy
+++ b/ci/jenkins/generated/common.groovy
@@ -310,18 +310,29 @@ def with_node(options, body) {
       }
     }
   }
-  try {
+  if (!options.retry_instance) {
     run(options.instance)
-  } catch (Throwable ex) {
-    // Jenkins also uses FlowInterruptedException for agent loss and timeouts.
-    // Actual interruptions (user cancellation or a milestone) must not retry.
-    if (ex instanceof 
org.jenkinsci.plugins.workflow.steps.FlowInterruptedException) {
-      if (ex.isActualInterruption()) throw ex
-    } else if (ex instanceof InterruptedException) {
-      throw ex
+    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) }
     }
-    if (!options.retry_instance) throw ex
-    retry_latest(ex) { run(options.retry_instance) }
   }
 }
 

Reply via email to