首页 > 解决方案 > 超时计数器继续,即使流程在 Jenkins 中暂停

问题描述

我将超时时间设置为特定阶段。如下图所示:

stage('Stage 1') {
  options { timeout(time: 3, unit: 'MINUTES') }
  steps {
    echo "Stage 1"
    sleep 20
   }
 }

当我在执行“阶段 1”期间暂停 Jenkins 构建时。它将暂停执行,但超时计数器继续。因此,在暂停状态期间超时超过。

它会在 3 分钟后向我显示以下错误,当我恢复构建时,构建状态为ABORETED

Pausing
Cancelling nested steps due to timeout
Body did not finish within grace period; terminating with extreme prejudice

问题:

当我暂停 Jenkins 构建时,它将暂停执行以及超时计数器,直到我不恢复构建。你能帮我解决这个问题吗?

先感谢您

标签: jenkins-pipeline

解决方案


推荐阅读