cicd runtime_error ai_generated true

org.jenkinsci.plugins.workflow.steps.FlowInterruptedException:流水线在 60 分钟后超时

org.jenkinsci.plugins.workflow.steps.FlowInterruptedException: The pipeline timed out after 60 minutes

ID: cicd/jenkins-pipeline-timeout

其他格式: JSON · Markdown 中文 · English
90%修复率
88%置信度
1证据数
2023-08-10首次发现

版本兼容性

版本状态引入弃用备注
Jenkins 2.346+ active
Pipeline: Declarative 1.8.5+ active
Pipeline: Groovy 2.9+ active

根因分析

Jenkins 流水线阶段或整个流水线超过了配置的超时限制,导致构建被中止。

English

A Jenkins pipeline stage or the entire pipeline exceeded the configured timeout limit, causing the build to be aborted.

generic

官方文档

https://www.jenkins.io/doc/book/pipeline/syntax/#options

解决方案

  1. Increase the timeout in the Jenkinsfile by modifying the `options` block: `options { timeout(time: 120, unit: 'MINUTES') }` for the entire pipeline, or add `timeout(time: 30, unit: 'MINUTES')` to a specific stage.
  2. Optimize the pipeline to reduce execution time by parallelizing stages with `parallel` directive: `stage('Build and Test') { parallel { stage('Build') { ... } stage('Test') { ... } } }`

无效尝试

常见但无效的做法:

  1. Removing the timeout option entirely from the Jenkinsfile 30% 失败

    Without a timeout, the pipeline can run indefinitely, consuming resources and potentially blocking the executor queue.

  2. Setting the timeout to a very high value (e.g., 9999 minutes) to avoid the error 50% 失败

    This masks the underlying issue (e.g., a stuck step or resource contention) and can lead to resource exhaustion.