Skip to content

Jenkins Pipeline Timeout Handling for Queue Wait Time #740

@Zhenye-Na

Description

@Zhenye-Na

What feature do you want to see added?

Problem Description

When using lockable resources in Jenkins pipelines with a timeout set, there is a potential issue with pipelines timing out due to the queue wait time. Specifically:

  • There is a single lockable resource, e.g., LOCK_0.
  • Two pipelines, PIPELINE_A and PIPELINE_B, are competing to acquire LOCK_0.
  • Both pipelines have a timeout set to 12 hours.
  • PIPELINE_A acquires LOCK_0 and runs for 10 hours.
  • After PIPELINE_A finishes, PIPELINE_B starts, but it has been waiting in the queue for 10 hours.
  • PIPELINE_B needs more than 2 hours to complete, which exceeds the remaining timeout.

The issue here is that PIPELINE_B times out due to the queue wait time, even though its actual execution time would have been within the timeout period.

Proposed Solutions

  1. Is there a way to exclude the queue wait time from the timeout calculation?
  2. Are there any existing workarounds to handle this scenario?
  3. If not, could this be considered as a feature request?

Thanks!

Upstream changes

No response

Are you interested in contributing this feature?

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions