You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by tq...@apache.org on 2026/10/15 15:46:33 UTC
(tvm) 07/11: [CI] Use Pipeline retry to handle node interruptions
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 510d552c21a04d2fdfabb1f3e2f126afad2d36f6
Author: Tianqi Chen <tq...@users.noreply.github.com>
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 3bcf454f23..5188bbd294 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) }
}
}