[JIRA] (JENKINS-40839) pipeline timeout doesn't kill the job

1,252 views
Skip to first unread message

maury91@gmail.com (JIRA)

unread,
Jan 5, 2017, 9:39:05 AM1/5/17
to jenkinsc...@googlegroups.com
Maurizio Carboni created an issue
 
Jenkins / Bug JENKINS-40839
pipeline timeout doesn't kill the job
Issue Type: Bug Bug
Assignee: Unassigned
Components: pipeline
Created: 2017/Jan/05 2:38 PM
Environment: Jenkins ver. 2.33
Priority: Minor Minor
Reporter: Maurizio Carboni

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

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

sascha.schuenemann@googlemail.com (JIRA)

unread,
Jan 13, 2017, 6:07:01 PM1/13/17
to jenkinsc...@googlegroups.com
Sascha Schuenemann commented on Bug JENKINS-40839
 
Re: pipeline timeout doesn't kill the job

I might have encountered the same issue on Jenkins ver. 2.35

In our case we have an outer timeout across a pipeline job using docker:

imeout(30) {
node('foo') {
def WORKSPACE = pwd()

dir('src')

{ deleteDir() unstash 'source' }

stage('Prepare Docker environment') {
docker.image('bar').pull()
def buildImg = docker.build(bar', "$

{WORKSPACE}

/src")

buildImg.inside {
timeout(1) {
stage('Start services')

{ sh "foo bar'" }

sleep 3m
}
}
}
}
}

We have hit the outer 30min timeout just after building the image but before starting the container.
But jenkins failed to kill the build and hangs at:

Successfully built 9b6a1a125fb8
[Pipeline] dockerFingerprintFrom
[Pipeline] sh
[PF-PEP-gerrit_4] Running shell script
+ docker inspect -f . bar
.


Cancelling nested steps due to timeout

Body did not finish within grace period; terminating with extreme prejudice

sascha.schuenemann@googlemail.com (JIRA)

unread,
Jan 13, 2017, 6:08:01 PM1/13/17
to jenkinsc...@googlegroups.com
Sascha Schuenemann edited a comment on Bug JENKINS-40839
I might have encountered the same issue on Jenkins ver. 2.35

In our case we have an outer timeout across a pipeline job using docker:

imeout timeout (30) {

sascha.schuenemann@googlemail.com (JIRA)

unread,
Jan 13, 2017, 6:09:04 PM1/13/17
to jenkinsc...@googlegroups.com
Sascha Schuenemann edited a comment on Bug JENKINS-40839
I might have encountered the same issue on Jenkins ver. 2.35

In our case we have an outer timeout across a pipeline job using docker:


{ quote code:java }
timeout(30) {

node('foo') {
    def WORKSPACE = pwd()

    dir('src') {
        deleteDir()
        unstash 'source'
    }

    stage('Prepare Docker environment') {
        docker.image('bar').pull()
        def buildImg = docker.build(bar', "${WORKSPACE}/src")

        buildImg.inside {
            timeout(1) {
                stage('Start services') {
                    sh "foo bar'"
                }
                sleep 3m
            }
       }
   }
}
}

{ quote code }


We have hit the outer 30min timeout just after building the image but before starting the container.
But jenkins failed to kill the build and hangs at:

Successfully built 9b6a1a125fb8
[Pipeline] dockerFingerprintFrom
[Pipeline] sh
[PF-PEP-gerrit_4] Running shell script
+ docker inspect -f . bar
.
Cancelling nested steps due to timeout
Body did not finish within grace period; terminating with extreme prejudice

sascha.schuenemann@googlemail.com (JIRA)

unread,
Jan 13, 2017, 6:09:04 PM1/13/17
to jenkinsc...@googlegroups.com
Sascha Schuenemann edited a comment on Bug JENKINS-40839
I might have encountered the same issue on Jenkins ver. 2.35

In our case we have an outer timeout across a pipeline job using docker:

{quote} timeout(30) {

node('foo') {
    def WORKSPACE = pwd()

    dir('src') {
        deleteDir()
        unstash 'source'
    }

    stage('Prepare Docker environment') {
        docker.image('bar').pull()
        def buildImg = docker.build(bar', "${WORKSPACE}/src")

        buildImg.inside {
            timeout(1) {
                stage('Start services') {
                    sh "foo bar'"
                }
                sleep 3m
            }
       }
   }
}
}
{quote}

We have hit the outer 30min timeout just after building the image but before starting the container.
But jenkins failed to kill the build and hangs at:

Successfully built 9b6a1a125fb8
[Pipeline] dockerFingerprintFrom
[Pipeline] sh
[PF-PEP-gerrit_4] Running shell script
+ docker inspect -f . bar
.
Cancelling nested steps due to timeout
Body did not finish within grace period; terminating with extreme prejudice

jglick@cloudbees.com (JIRA)

unread,
Feb 16, 2017, 1:10:01 PM2/16/17
to jenkinsc...@googlegroups.com

Need to have a minimal reproducible test case, and need to know precise plugin versions (Jenkins core version is barely relevant). Each such case reported may be a completely unrelated bug.

laurent.panhelleux@biomerieux.com (JIRA)

unread,
Mar 8, 2017, 8:27:02 AM3/8/17
to jenkinsc...@googlegroups.com

Sometimes the timeout expired but the job don't stop. We have to stop it manually.

Jenkins ver. 2.49

About 6 hours before the issue:

  • Installation of a plugin about amazon tools wihout restart
  • Reload configuration from disk
  • Restart of Jenkins service on the server (Linux)

The job was aborting about ten hours after timeout expiration

Extract of the pipeline script

stage 'Promotion'
def mustDeploy = true
try {
    timeout(time:1, unit:'HOURS') {
        input(id: 'userInput', message: 'Deploy?')
    }
} catch(err) {
    // timeout reached or input false
    echo 'Time out reached or user aborted'
    mustDeploy = false
}

Console output:
[Pipeline] // node
[Pipeline] stage (Promotion)
Using the ‘stage’ step without a block argument is deprecated
Entering stage Promotion
Proceeding
[Pipeline] timeout
Timeout set to expire in 1 h 0 mn
[Pipeline] {
[Pipeline] input
Deploy?
Proceed or Abort


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

Aborted by johndoe


Click here to forcibly terminate running steps

Terminating timeout


Click here to forcibly kill entire build
Hard kill!
Finished: ABORTED

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

laurent.panhelleux@biomerieux.com (JIRA)

unread,
Mar 8, 2017, 8:28:01 AM3/8/17
to jenkinsc...@googlegroups.com
Laurent PANPAN edited a comment on Bug JENKINS-40839
Sometimes the timeout expired but the job don't stop. We have to stop it manually.

[Jenkins ver. 2.49|https://jenkins.io/]


About 6 hours before the issue:
* Installation of a plugin about amazon tools wihout restart

* Reload configuration from disk
* Restart of Jenkins service on the server (Linux)


The job was aborting about ten hours after timeout expiration

Extract of the pipeline script
{code:java}

stage 'Promotion'
def mustDeploy = true
try {
    timeout(time:1, unit:'HOURS') {
        input(id: 'userInput', message: 'Deploy?')
    }
} catch(err) {
    // timeout reached or input false
    echo 'Time out reached or user aborted'
    mustDeploy = false
}{code}
Console output:
{code:java}
[Pipeline] // node
[Pipeline] stage (Promotion)
Using the ‘stage’ step without a block argument is deprecated
Entering stage Promotion
Proceeding
[Pipeline] timeout
Timeout set to expire in 1 h 0 mn
[Pipeline]
\
{

[Pipeline] input
Deploy?
Proceed or Abort
Cancelling nested steps due to timeout
Body did not finish within grace period; terminating with extreme prejudice
Aborted by johndoe
Click here to forcibly terminate running steps
Terminating timeout
Click here to forcibly kill entire build
Hard kill!
Finished: ABORTED {code}

laurent.panhelleux@biomerieux.com (JIRA)

unread,
Mar 8, 2017, 8:40:02 AM3/8/17
to jenkinsc...@googlegroups.com
Laurent PANPAN edited a comment on Bug JENKINS-40839
Sometimes the timeout expired but the job don't stop. We have to stop it manually.

[Jenkins ver. 2.49|https://jenkins.io/]

About 6 hours before the issue:
* Installation of a plugin about amazon tools wihout restart

* Reload configuration from disk
* Restart of Jenkins service on the server (Linux)

The job was aborting aborted about ten hours after timeout expiration

laurent.panhelleux@biomerieux.com (JIRA)

unread,
Mar 8, 2017, 8:55:02 AM3/8/17
to jenkinsc...@googlegroups.com
Laurent PANPAN edited a comment on Bug JENKINS-40839
Sometimes the timeout expired but the job don't stop. We have to stop it manually.

[Jenkins ver. 2.49|https://jenkins.io/]

Pipeline plugin ver 2.4

About 6 hours before the issue:
* Installation of a plugin about amazon tools wihout restart

* Reload configuration from disk
* Restart of Jenkins service on the server (Linux)

The job was aborted about ten hours after timeout expiration

jglick@cloudbees.com (JIRA)

unread,
Mar 8, 2017, 12:13:02 PM3/8/17
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Mar 8, 2017, 12:15:02 PM3/8/17
to jenkinsc...@googlegroups.com
Jesse Glick edited a comment on Bug JENKINS-40839
[~laurent_panpan] see JENKINS-36235  or JENKINS-38380 .

andrew.bayer@gmail.com (JIRA)

unread,
Feb 23, 2018, 4:58:05 PM2/23/18
to jenkinsc...@googlegroups.com
Andrew Bayer updated an issue
 
Change By: Andrew Bayer
Component/s: workflow-basic-steps-plugin
Component/s: pipeline

zach.welz@gtri.gatech.edu (JIRA)

unread,
Mar 13, 2018, 2:37:02 PM3/13/18
to jenkinsc...@googlegroups.com
Zach Welz commented on Bug JENKINS-40839
 
Re: pipeline timeout doesn't kill the job

I am also having this issue.

Jenkins Version: WinSW 2.1.2.0

Below is simplified reproduction of issue; program.exe runs indefinitely.

stage('Run'){
   node{
      dir("${project_home}"){
         try{
            timeout(time: 5, unit: 'SECONDS'){
               bat "program.exe"
             } 
         } catch(hudson.AbortException err){
            echo Do something
         }
      }
   }
}

 Resulting error (simplified)

[Pipeline] stage
[Pipeline] { (Run)
[Pipeline] node
[Pipeline] {
[Pipeline] echo
[Pipeline] dir
[Pipeline] {
[Pipeline] timeout
[Pipeline] {
[Pipeline] echo
[Pipeline] bat
[C:/project_home] Running batch script
C:\project_home>program.exe  
<Program output>
Cancelling nested steps due to timeout
Sending interrupt signal to process
After 10s process did not stop
[Pipeline] }
[Pipeline] // timeout
[Pipeline] }
[Pipeline] // dir
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // stage
[Pipeline] End of Pipeline
Timeout has been exceeded
Finished: ABORTED

Not sure if this is an error on my part or the same issue as above. 

zach.welz@gtri.gatech.edu (JIRA)

unread,
Mar 13, 2018, 2:38:04 PM3/13/18
to jenkinsc...@googlegroups.com
Zach Welz edited a comment on Bug JENKINS-40839
I am also having this issue.

Jenkins Version: WinSW 2.1.2.0

Below is simplified reproduction of issue; _program.exe_ runs indefinitely.
{code:java}

stage('Run'){
   node{
      dir("${project_home}"){
         try{
            timeout(time: 5, unit: 'SECONDS'){
               bat "program.exe"
             }
         } catch(hudson.AbortException err){
            echo Do something
         }
      }
   }
}{code}
 Resulting error (simplified)
{code:java}
echo
[Pipeline]
dir
echo
[Pipeline]
bat
{code}

Not sure if this is an error on my part or the same issue as above. 

mstewart@riotgames.com (JIRA)

unread,
Apr 18, 2018, 1:07:02 AM4/18/18
to jenkinsc...@googlegroups.com

Here's my minimal repro for this:

```

node ('somelabel) {

  timeout (30) {

     timetstamps {

        withEnv(someEnvArray) {

              sleep 15

        }

     }

  }

}
```

While the sleep is running, put Jenkins in shutdown.  Then cancel shutdown.  The job will trigger the timeout, eventually say it's killing with extreme prejudice and need to be hard aborted otherwise it will be stuck forever.

This mainly manifests as a problem when doing maintenance/restarts where some jobs might properly resume but end up stuck for other reasons and never cleanup.

mstewart@riotgames.com (JIRA)

unread,
Apr 18, 2018, 1:08:03 AM4/18/18
to jenkinsc...@googlegroups.com
Maxfield Stewart edited a comment on Bug JENKINS-40839
Here's my minimal repro for this:

```  
{code:java}
node ('somelabel)
\ {

  timeout (30) \ {

     timetstamps \ {

        withEnv(someEnvArray) \ {

              sleep 15

        }

     }

  }
}
{code }
```  

While the sleep is running, put Jenkins in shutdown.  Then cancel shutdown.  The job will trigger the timeout, eventually say it's killing with extreme prejudice and need to be hard aborted otherwise it will be stuck forever.

This mainly manifests as a problem when doing maintenance/restarts where some jobs might properly resume but end up stuck for other reasons and never cleanup.

mstewart@riotgames.com (JIRA)

unread,
Apr 18, 2018, 1:09:03 AM4/18/18
to jenkinsc...@googlegroups.com
Maxfield Stewart edited a comment on Bug JENKINS-40839
Here's my minimal repro for this:

 
{code:java}
node ('somelabel) {
  timeout (30) {
     timetstamps {
        withEnv(someEnvArray) {
              sleep 15
        }
     }
  }
}
{code}
 

While the sleep is running, put Jenkins in shutdown.  Then cancel shutdown.  The job will trigger the timeout, eventually say it's killing with extreme prejudice and need to be hard aborted otherwise it will be stuck forever.

This mainly manifests as a problem when doing maintenance/restarts where some jobs might properly resume but end up stuck for other reasons and never cleanup. When I forcibly terminate at the text prompt it's still stuck inside "withEnv"

mstewart@riotgames.com (JIRA)

unread,
Apr 18, 2018, 1:14:02 AM4/18/18
to jenkinsc...@googlegroups.com
Maxfield Stewart edited a comment on Bug JENKINS-40839
Here's my minimal repro for this:

 
{code:java}
node ('somelabel) {
  timeout (30) {
      timetstamps timestamps {

        withEnv(someEnvArray) {
              sleep 15
        }
     }
  }
}
{code}
 

While the sleep is running, put Jenkins in shutdown.  Then cancel shutdown.  The job will trigger the timeout, eventually say it's killing with extreme prejudice and need to be hard aborted otherwise it will be stuck forever.

This mainly manifests as a problem when doing maintenance/restarts where some jobs might properly resume but end up stuck for other reasons and never cleanup. When I forcibly terminate at the text prompt it's still stuck inside "withEnv"


I've also tested this by removing the "withEnv" and just using "timestamps"  and the same problem occurs. As well as doing it without "timestamps" at each interval the nested section it's stuck in is inner one. So this seems to be a problem with the timeout handler.

ilya.shaisultanov@gmail.com (JIRA)

unread,
Jun 30, 2018, 1:18:04 AM6/30/18
to jenkinsc...@googlegroups.com
ilya s commented on Bug JENKINS-40839

We're on Jenkins ver. 2.107.3 and Pipeline v2.5. What I'm seeing is the same thing everyone is describing here – timeout occurs and throws but instead of failing the build it's being caught but whatever the closest catch is for the currently running command. For example:

void doTimeout(body) {
  timeout(time: 1, unit: 'MINUTES') {
    node(agentId) {
      timestamps {
        ansiColor('xterm') {
          body()
        }
      }
    }
  }
} 

this is simplified but reflects the setup of things in our pipeline + timeout. What I saw, then, is try/catch statements in body receiving the timeout exception and handling it, instead of the exception failing the build.

This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

jenkins@plytro.com (JIRA)

unread,
Jun 30, 2018, 11:40:02 AM6/30/18
to jenkinsc...@googlegroups.com

Minimum viable to reproduce the issue. The problem appears to be that timeout throws an exception of some sort and the innermost matching catch block will handle the exception. If it does not re-throw the exception the job continues on running commands.

node {
  timeout (1) {
    try {
      sh 'sleep 15000'
    } catch (Exception ex) {
      echo 'In exception'
    }  
    echo 'I made it here after catching exception'
  }
} 

You can see even though the timeout closure wrapped all the commands, the catch caused it to continue executing things in the block after the timeout had expired.

Started by user plytro
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] node
Still waiting to schedule task
Waiting for next available executor
Agent jnlp-w834q is provisioned from template Kubernetes Pod Template
Agent specification [Kubernetes Pod Template] (jenkins): 
* [jnlp] jenkinsci/jnlp-slave(resourceRequestCpu: 200m, resourceRequestMemory: 256Mi, resourceLimitCpu: , resourceLimitMemory: )

Running on jnlp-w834q in /home/jenkins/workspace/plytro-test
[Pipeline] {
[Pipeline] timeout
Timeout set to expire in 1 min 0 sec
[Pipeline] {
[Pipeline] sh
[plytro-test] Running shell script
+ sleep 15000
Cancelling nested steps due to timeout
Sending interrupt signal to process
Terminated
[Pipeline] echo
In exception
[Pipeline] echo
I made it here after catching exception
[Pipeline] }
[Pipeline] // timeout
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS

jenkins@plytro.com (JIRA)

unread,
Jun 30, 2018, 11:42:04 AM6/30/18
to jenkinsc...@googlegroups.com
Steve Stodola edited a comment on Bug JENKINS-40839
Minimum viable to reproduce the issue. The problem appears to be that timeout throws an exception of some sort and the innermost matching catch block will handle the exception. If it does not re-throw the exception , the job continues on running commands.
{code:java}

node {
  timeout (1) {
    try {
      sh 'sleep 15000'
    } catch (Exception ex) {
      echo 'In exception'
    }  
    echo 'I made it here after catching exception'
  }
} {code}

You can see
that, even though the timeout closure wrapped all the commands, the {{ catch }} caused it to continue executing things in the block after the timeout had expired.

{noformat}
Finished: SUCCESS{noformat}

jenkins@plytro.com (JIRA)

unread,
Jun 30, 2018, 12:04:02 PM6/30/18
to jenkinsc...@googlegroups.com
Steve Stodola edited a comment on Bug JENKINS-40839
Minimum viable to reproduce the issue. The problem appears to be that timeout throws an exception of some sort and the innermost matching catch block will handle the exception. If it does not re-throw the exception, the job continues on running commands.

{code:java}
node {
  timeout (1) {
    try {
      sh 'sleep 15000'
    } catch (Exception ex) {
      echo 'In exception'
    }  
    echo 'I made it here after catching exception'
  }
} {code}

You can see that, even though the timeout closure wrapped all the commands, the {{catch}} caused it to continue executing things in the block after the timeout had expired.

{noformat}
Started by user plytro
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] node
Still waiting to schedule task
Waiting for next available executor
Agent jnlp-w834q is provisioned from template Kubernetes Pod Template
Agent specification [Kubernetes Pod Template] (jenkins):
* [jnlp] jenkinsci/jnlp-slave(resourceRequestCpu: 200m, resourceRequestMemory: 256Mi, resourceLimitCpu: , resourceLimitMemory: )

Running on jnlp-w834q Jenkins in / home var / jenkins jenkins_home /workspace/plytro-test

[Pipeline] {
[Pipeline] timeout
Timeout set to expire in 1 min 0 sec
[Pipeline] {
[Pipeline] sh
[plytro-test] Running shell script
+ sleep 15000
Cancelling nested steps due to timeout
Sending interrupt signal to process
Terminated
[Pipeline] echo
In exception
[Pipeline] echo
I made it here after catching exception
[Pipeline] }
[Pipeline] // timeout
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS

{noformat}

jenkins@plytro.com (JIRA)

unread,
Jun 30, 2018, 12:07:02 PM6/30/18
to jenkinsc...@googlegroups.com
plytro commented on Bug JENKINS-40839

For the above I ran the docker run -p 8080:8080 -p 50000:50000 jenkins/jenkins:2.107.3 and installed the Build Timeout plugin and the Pipeline plugin on initial startup.

Below is the copied from the Installed tab of the Manage Plugins page.

Apache HttpComponents Client 4.x API Plugin
Bundles Apache HttpComponents Client 4.x and allows it to be used by Jenkins plugins.
4.5.5-3.0   
  
Authentication Tokens API Plugin
This plugin provides an API for converting credentials into authentication tokens in Jenkins.
1.3   
  
bouncycastle API Plugin
This plugin provides an stable API to Bouncy Castle related tasks.
2.16.3    
  
Branch API Plugin
This plugin provides an API for multiple branch based projects.
2.0.20    
  
Build Timeout
This plugin allows builds to be automatically terminated after the specified amount of time has elapsed.
1.19    
  
Command Agent Launcher Plugin
Allows agents to be launched using a specified command.
1.2   
  
Credentials Binding Plugin
Allows credentials to be bound to environment variables for use from miscellaneous build steps.
1.16    
  
Credentials Plugin
This plugin allows you to store credentials in Jenkins.
2.1.17    
  
Display URL API
Provides the DisplayURLProvider extension point to provide alternate URLs for use in notifications
2.2.0   
  
Docker Commons Plugin
Provides the common shared functionality for various Docker-related plugins.
1.13    
  
Docker Pipeline
Build and use Docker containers from pipelines.
1.17    
  
Durable Task Plugin
Library offering an extension point for processes which can run outside of Jenkins yet be monitored.
1.22    
  
Folders Plugin
This plugin allows users to create "folders" to organize jobs. Users can define custom taxonomies (like by project type, organization type etc). Folders are nestable and you can define views within folders. Maintained by CloudBees, Inc.
6.5.1   
  
Git client plugin
Utility plugin for Git support in Jenkins
2.7.2   
  
GIT server Plugin
Allows Jenkins to act as a Git server.
1.7   
  
Jackson 2 API Plugin
This plugin exposes the Jackson 2 JSON APIs to other Jenkins plugins.
2.8.11.3    
  
JavaScript GUI Lib: ACE Editor bundle plugin
JavaScript GUI Lib: ACE Editor bundle plugin.
1.1   
  
JavaScript GUI Lib: Handlebars bundle plugin
JavaScript GUI Lib: Handlebars bundle plugin.
1.1.1   
  
JavaScript GUI Lib: jQuery bundles (jQuery and jQuery UI) plugin
JavaScript GUI Lib: jQuery bundles (jQuery and jQuery UI) plugin.
1.2.1   
  
JavaScript GUI Lib: Moment.js bundle plugin
JavaScript GUI Lib: Moment.js bundle plugin.
1.1.1   
  
JSch dependency plugin
Jenkins plugin that brings the JSch library as a plugin dependency, and provides an SSHAuthenticatorFactory for using JSch with the ssh-credentials plugin.
0.1.54.2    
  
Mailer Plugin
This plugin allows you to configure email notifications for build results
1.21    
  
Pipeline
A suite of plugins that lets you orchestrate automation, simple or complex. See Pipeline as Code with Jenkins for more details.
2.5   
  
Pipeline Graph Analysis Plugin
Provides a REST API to access pipeline and pipeline run data.
1.7   
  
Pipeline: API
Plugin that defines Pipeline API.
2.27    
  
Pipeline: Basic Steps
Commonly used steps for Pipelines.
2.8   
  
Pipeline: Build Step
Adds the Pipeline step build to trigger builds of other jobs.
2.7   
  
Pipeline: Declarative
An opinionated, declarative Pipeline.
1.3.1   
  
Pipeline: Declarative Agent API
Replaced by Pipeline: Declarative Extension Points API plugin.
1.1.1   
  
Pipeline: Declarative Extension Points API
APIs for extension points used in Declarative Pipelines.
1.3.1   
  
Pipeline: Groovy
Pipeline execution engine based on continuation passing style transformation of Groovy scripts.
2.54    
  
Pipeline: Input Step
Adds the Pipeline step input to wait for human input or approval.
2.8   
  
Pipeline: Job
Defines a new job type for pipelines and provides their generic user interface.
2.22    
  
Pipeline: Milestone Step
Plugin that provides the milestone step
1.3.1   
  
Pipeline: Model API
Model API for Declarative Pipeline.
1.3.1   
  
Pipeline: Multibranch
Enhances Pipeline plugin to handle branches better by automatically grouping builds from different branches.
2.19    
  
Pipeline: Nodes and Processes
Pipeline steps locking agents and workspaces, and running external processes that may survive a Jenkins restart or slave reconnection.
2.19    
  
Pipeline: REST API Plugin
Provides a REST API to access pipeline and pipeline run data.
2.10    
  
Pipeline: SCM Step
Adds a Pipeline step to check out or update working sources from various SCMs (version control).
2.6   
  
Pipeline: Shared Groovy Libraries
Shared libraries for Pipeline scripts.
2.9   
  
Pipeline: Stage Step
Adds the Pipeline step stage to delineate portions of a build.
2.3   
  
Pipeline: Stage Tags Metadata
Library plugin for Pipeline stage tag metadata.
1.3.1   
  
Pipeline: Stage View Plugin
Pipeline Stage View Plugin.
2.10    
  
Pipeline: Step API
API for asynchronous build step primitive.
2.16    
  
Pipeline: Supporting APIs
Common utility implementations to build Pipeline Plugin
2.19    
  
Plain Credentials Plugin
Allows use of plain strings and files as credentials.
1.4   
  
SCM API Plugin
This plugin provides a new enhanced API for interacting with SCM systems.
2.2.7   
  
Script Security Plugin
Allows Jenkins administrators to control what in-process scripts can be run by less-privileged users.
1.44    
  
SSH Credentials Plugin
Allows storage of SSH credentials in Jenkins
1.14    
  
Structs Plugin
Library plugin for DSL plugins that need names for Jenkins objects.
1.14    
  
Token Macro Plugin
This plug-in adds reusable macro expansion capability for other plug-ins to use.
2.5   

jenkins@plytro.com (JIRA)

unread,
Jun 30, 2018, 12:23:02 PM6/30/18
to jenkinsc...@googlegroups.com
plytro edited a comment on Bug JENKINS-40839
For the above I ran the
{{docker run -p 8080:8080 -p 50000:50000  jenkins/jenkins:2.107.3}} and installed the Build Timeout plugin and the Pipeline plugin on initial startup.


Below is the copied from the Installed tab of the Manage Plugins page.
{noformat}
{noformat}

jglick@cloudbees.com (JIRA)

unread,
Jul 20, 2018, 3:58:02 PM7/20/18
to jenkinsc...@googlegroups.com

While the sleep is running, put Jenkins in shutdown. Then cancel shutdown.

is an unrelated known bug in workflow-cps-plugin.

Zach Welz / plytro your cases are as designed. The timeout step throws an exception indicating that its body exceeded the timeout; you caught the exception and decided to proceed.

ilya.shaisultanov@gmail.com (JIRA)

unread,
Jul 20, 2018, 5:45:05 PM7/20/18
to jenkinsc...@googlegroups.com
ilya s commented on Bug JENKINS-40839

Doesn't that basically defeat the purpose of this step? The expectation for users is that the timeout will kill whatever's in the timeout block. Effectively, this means that timeouts cannot be enforced by the pipeline when using libraries that aren't explicitly rethrow timeout exceptions.

ilya.shaisultanov@gmail.com (JIRA)

unread,
Jul 20, 2018, 5:45:06 PM7/20/18
to jenkinsc...@googlegroups.com
ilya s edited a comment on Bug JENKINS-40839
Doesn't that basically defeat the purpose of this step? The expectation for users is that the timeout will kill whatever's in the timeout block. Effectively, this means that timeouts cannot be enforced by the pipeline when using libraries that aren don 't explicitly rethrow timeout exceptions.

jglick@cloudbees.com (JIRA)

unread,
Jul 20, 2018, 6:49:02 PM7/20/18
to jenkinsc...@googlegroups.com

The expectation for users is that the timeout will kill whatever's in the timeout block.

Which it did. Whether or not the corresponding exception results in an immediate termination of the overall build with an ABORTED status is up to the script to decide.

ilya.shaisultanov@gmail.com (JIRA)

unread,
Jul 20, 2018, 8:44:02 PM7/20/18
to jenkinsc...@googlegroups.com
ilya s commented on Bug JENKINS-40839

According to this example that's not accurate, since in the output we still get the second echo from within the timeout block.

amirbarkal@sparkbeyond.com (JIRA)

unread,
Sep 2, 2018, 9:56:07 AM9/2/18
to jenkinsc...@googlegroups.com
Amir Barkal edited a comment on Bug JENKINS-40839
Another simple reproduction of the timeout() step not throwing an exception:

 
{quote}node() {
  try {
    timeout(time: 3 as Integer, unit: 'SECONDS')
{
   
  int result = sh(returnStatus : true, script: 'sleep 5')
   
}
}
catch(e)
{
Unknown macro: \{   println "TIMEOUT" // will never get here!
  throw e
  }
}
{quote}
 

Env details:

Jenkins [2.138|https://jenkins.io/]

workflow-basic-steps 2.9

 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

amirbarkal@sparkbeyond.com (JIRA)

unread,
Sep 2, 2018, 9:56:07 AM9/2/18
to jenkinsc...@googlegroups.com

Another simple reproduction of the timeout() step not throwing an exception:

 

node() {


  try {
    timeout(time: 3 as Integer, unit: 'SECONDS')

Unknown macro: {       int result = sh(returnStatus}

}
catch(e)

Unknown macro: {   println "TIMEOUT" // will never get here!   throw e   }

}

 

Env details:

Jenkins 2.138

workflow-basic-steps 2.9

 

amirbarkal@sparkbeyond.com (JIRA)

unread,
Sep 2, 2018, 9:57:02 AM9/2/18
to jenkinsc...@googlegroups.com
Amir Barkal edited a comment on Bug JENKINS-40839
Another simple reproduction of the timeout() step not throwing an exception:

 
{quote}node() {
  try {

    timeout(time: 3 as Integer, unit: 'SECONDS') {quote}
{quote}     int result = sh timeout ( returnStatus time }
}
catch(e)
{  {quote}
Unknown macro: \ { quote}   println "TIMEOUT" // will never get here!   throw e   }
}

{quote}
 

Env details:

Jenkins [2.138|https://jenkins.io/]

workflow-basic-steps 2.9

 

amirbarkal@sparkbeyond.com (JIRA)

unread,
Sep 2, 2018, 9:58:02 AM9/2/18
to jenkinsc...@googlegroups.com
Amir Barkal edited a comment on Bug JENKINS-40839
Another simple reproduction of the timeout() step not throwing an exception:

 
{ quote code }
node() {
  try{     {quote}
{quote}  timeout(time : 3 as Integer, unit: 'SECONDS') {

int result = sh(returnStatus: true, script:'sleep 5')

}
}
catch(e) {
 {quote}
{quote}  println "TIMEOUT" // will Will never get here !  
throw e  
}
}

{ quote code }
 

 

Env details:

Jenkins [2.138|https://jenkins.io/]

workflow-basic-steps 2.9

 

amirbarkal@sparkbeyond.com (JIRA)

unread,
Sep 2, 2018, 9:59:03 AM9/2/18
to jenkinsc...@googlegroups.com
Amir Barkal edited a comment on Bug JENKINS-40839
Another simple reproduction of the timeout() step not throwing an exception:

{code}
node() {
try {

timeout(time: 3 as Integer, unit: 'SECONDS') {
int result = sh(returnStatus: true, script:'sleep 5')

}
}
catch(e) {
println "TIMEOUT" // Will never get here
throw e
}
}
{code}

 

 

Env details:

Jenkins [2.138|https://jenkins.io/]

workflow-basic-steps 2.9

 

amirbarkal@sparkbeyond.com (JIRA)

unread,
Sep 2, 2018, 9:59:05 AM9/2/18
to jenkinsc...@googlegroups.com

amirbarkal@sparkbeyond.com (JIRA)

unread,
Sep 2, 2018, 10:01:04 AM9/2/18
to jenkinsc...@googlegroups.com
Amir Barkal edited a comment on Bug JENKINS-40839
Another simple reproduction of the timeout() step not throwing an exception:

{code :java }

node() {
try {
   timeout(time: 3 as Integer, unit: 'SECONDS') {
     int result = sh(returnStatus: true, script:'sleep 5')
   }
}
catch(e) {
  println "TIMEOUT" // Will never get here
  throw e
}
}
{code}
 

 

Env details:

Jenkins [2.138|https://jenkins.io/]

workflow-basic-steps 2.9

 

jglick@cloudbees.com (JIRA)

unread,
Sep 4, 2018, 5:54:05 PM9/4/18
to jenkinsc...@googlegroups.com

svanoort@cloudbees.com (JIRA)

unread,
Sep 14, 2018, 10:12:03 AM9/14/18
to jenkinsc...@googlegroups.com
Change By: Sam Van Oort
Assignee: Jose Blas Camacho Taboada

jtaboada@cloudbees.com (JIRA)

unread,
Nov 13, 2018, 11:33:11 AM11/13/18
to jenkinsc...@googlegroups.com
Jose Blas Camacho Taboada assigned an issue to Unassigned
Assignee: Jose Blas Camacho Taboada

Jonathan_Gray@comcast.com (JIRA)

unread,
Apr 1, 2019, 11:52:03 PM4/1/19
to jenkinsc...@googlegroups.com
Jonathan Gray commented on Bug JENKINS-40839
 
Re: pipeline timeout doesn't kill the job

Looks like this is still going on:

Jenkins 2.164.1

Pipeline: Basic Steps 2.15

jglick@cloudbees.com (JIRA)

unread,
Apr 5, 2019, 10:56:05 AM4/5/19
to jenkinsc...@googlegroups.com
Jesse Glick resolved as Incomplete
 

Zach Welz’s case sounds like a bug in durable-task. Hard to say without knowing how to reproduce from scratch.

Maxfield Stewart’s case is a duplicate of a well-known open bug about cancelling quiet mode.

ilya s’s case is as designed (JENKINS-51928). Ditto plytro.

Some other cases are old and likely correspond to behavioral fixes in either timeout or specific nested steps done in the past.

I am closing this issue as it is mixing up a lot of distinct cases and is pretty old. Please do not reopen or add comments. If you have what you consider a bug (after reading JENKINS-51928) which is reproducible using the latest released versions of all plugins and a current Jenkins LTS, please file a separate (but linked) bug report with complete, minimal, self-contained steps to reproduce the problem from scratch.

Change By: Jesse Glick
Status: Open Resolved
Resolution: Incomplete
Reply all
Reply to author
Forward
0 new messages