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

pipeline timeout doesn't kill the job

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Minor Minor
    • None
    • Jenkins ver. 2.33

      On this pipeline

      node {
          
          timeout(time: 30, unit: 'SECONDS') {
              environment = 'staging'
              stage 'Retrieving repositories'
              parallel getDBUri: {
                  // Obtain pipeline and DB_URI using a script in the pipeline
                  dir('pipelineRepo') {
                      git ...
                      pipeline = load 'pipeline.groovy'
                      sh 'pwd'
                      withCredentials([
                          [
                              $class: 'StringBinding', 
                              credentialsId: 'herokuToken', 
                              variable: 'token'
                          ]
                      ]) {
                          env.PG_URI = pipeline.herokuVariable( 'novus-'+environment, 'DB_URI', env.token )
                      }
                  }
              }, getScript: {
                  // Obtain script to execute and install dependencies
                  dir('scriptRepo') {
                      git ..
                      withCredentials([
                          [
                              $class: 'StringBinding', 
                              credentialsId: 'NpmToken', 
                              variable: 'NPM_TOKEN'
                          ]
                      ]) {
                          sh 'echo "//registry.npmjs.org/:_authToken='+env.NPM_TOKEN+'" > ~/.npmrc'
                          sh 'npm install --production && npm prune --production'
                          sh 'unlink ~/.npmrc'
                      }
                  }
              },
              failFast: true
          }
      

      The timeout is honoured but not executed correctly

      [Pipeline] [getDBUri] }
      Cancelling nested steps due to timeout
      [getScript] Sending interrupt signal to process
      [getScript] Sending interrupt signal to process
      Body did not finish within grace period; terminating with extreme prejudice
      [Pipeline] // parallel
      [Pipeline] }
      [Pipeline] [getScript] }
      [Pipeline] // timeout
      [Pipeline] }
      [Pipeline] // node
      Aborted by admin
      [Pipeline] [getScript] }
      Click here to forcibly terminate running steps
      Terminating withCredentials
      Click here to forcibly kill entire build
      Hard kill!
      Finished: ABORTED
      

      Neither the manual aborting worked at the beginning I had to use "Click here to forcibly kill entire build", the timeout option should have an option to kill the build in the worst case

            Unassigned Unassigned
            maury91 Maurizio Carboni
            Votes:
            24 Vote for this issue
            Watchers:
            31 Start watching this issue

              Created:
              Updated:
              Resolved: