Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-59743

A pipeline job hitting the timeout ending up hanging

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Labels:
      None
    • Environment:
      Jenkins 2.164.3
      java 1.8.0_192
      OS - Red hat 7
      workflow-basic-steps : 2.18
    • Similar Issues:

      Description

      For a pipeline script of

      pipeline {
          agent none 
          options { 
              timestamps() 
              buildDiscarder(logRotator(numToKeepStr: '30', artifactNumToKeepStr: '30'))
              timeout(time: 5, unit: 'HOURS')
              ansiColor('xterm')
          }
          stages {
              stage('Pre-Build') {
      		....
      <truncated>
      

      When the timeout is reached, we see the job hang and not killed.

      The job is way past its 5 hour timeout.

      12:08:55  [2019-10-10 19:08:55] [INFO] Running verify succeeded in 27s
      16:54:40  Cancelling nested steps due to timeout
      16:55:40  Body did not finish within grace period; terminating with extreme prejudice
      

      Relevant OSS code - https://github.com/jenkinsci/workflow-basic-steps-plugin/blob/3ecc7bbd91182e330a23a9e661ae1cdfa2d2b55e/src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java#L152

        Attachments

          Activity

          Hide
          bitwiseman Liam Newman added a comment -

          We'll need to see your full Jenkinsfile, but if you have a try-catch make sure you handle InterruptedException to bubble it out.

          Show
          bitwiseman Liam Newman added a comment - We'll need to see your full Jenkinsfile, but if you have a try-catch make sure you handle InterruptedException to bubble it out.

            People

            • Assignee:
              Unassigned
              Reporter:
              croydondias Croydon Dias
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: