-
Bug
-
Resolution: Unresolved
-
Major
-
MacOS High Sierra
Jenkins ver. 2.111
ace-editor 1.1
ansicolor 0.5.2
ant 1.8
antisamy-markup-formatter 1.5
apache-httpcomponents-client-4-api 4.5.3-2.1
authentication-tokens 1.3
blueocean 1.4.2
blueocean-autofavorite 1.2.2
blueocean-bitbucket-pipeline 1.4.2
blueocean-commons 1.4.2
blueocean-config 1.4.2
blueocean-core-js 1.4.2
blueocean-dashboard 1.4.2
blueocean-display-url 2.2.0
blueocean-events 1.4.2
blueocean-git-pipeline 1.4.2
blueocean-github-pipeline 1.4.2
blueocean-i18n 1.4.2
blueocean-jira 1.4.2
blueocean-jwt 1.4.2
blueocean-personalization 1.4.2
blueocean-pipeline-api-impl 1.4.2
blueocean-pipeline-editor 1.4.2
blueocean-pipeline-scm-api 1.4.2
blueocean-rest 1.4.2
blueocean-rest-impl 1.4.2
blueocean-web 1.4.2
bouncycastle-api 2.16.2
branch-api 2.0.18
build-timeout 1.19
cloudbees-bitbucket-branch-source 2.2.10
cloudbees-folder 6.3
command-launcher 1.2
credentials 2.1.16
credentials-binding 1.15
cucumber 0.0.2
cucumber-reports 3.15.0
cucumber-testresult-plugin 0.10.1
cucumber-trends-report 1.3
display-url-api 2.2.0
docker-commons 1.11
docker-java-api 3.0.14
docker-plugin 1.1.3
docker-workflow 1.15.1
durable-task 1.22
email-ext 2.61
emailext-template 1
external-monitor-job 1.7
favorite 2.3.1
ghprb 1.40.0
git 3.8.0
git-client 2.7.1
git-server 1.7
github 1.29.0
github-api 1.9
github-branch-source 2.3.2
gradle 1.28
groovy-postbuild 2.3.1
handlebars 1.1.1
handy-uri-templates-2-api 2.1.6-1.0
htmlpublisher 1.14
http_request 1.8.22
icon-shim 2.0.3
jackson2-api 2.8.11.1
jenkins-design-language 1.4.2
jira 2.5
jquery-detached 1.2.1
jsch 0.1.54.2
junit 1.24
ldap 1.2
mailer 1.2
mapdb-api 1.0.9.0
matrix-auth 2.2
matrix-project 1.12
mercurial 2.3
momentjs 1.1.1
pam-auth 1.3
performance 3.5
pipeline-build-step 2.7
pipeline-github-lib 1
pipeline-graph-analysis 1.6
pipeline-input-step 2.8
pipeline-milestone-step 1.3.1
pipeline-model-api 1.2.7
pipeline-model-declarative-agent 1.1.1
pipeline-model-definition 1.2.7
pipeline-model-extensions 1.2.7
pipeline-rest-api 2.9
pipeline-stage-step 2.3
pipeline-stage-tags-metadata 1.2.7
pipeline-stage-view 2.9
pipeline-utility-steps 2.0.1
plain-credentials 1.4
pubsub-light 1.12
resource-disposer 0.8
ruby-runtime 0.12
scm-api 2.2.6
script-security 1.42
sse-gateway 1.15
ssh-agent 1.15
ssh-credentials 1.13
ssh-slaves 1.26
structs 1.14
subversion 2.10.3
timestamper 1.8.9
token-macro 2.3
variant 1.1
windows-slaves 1.3.1
workflow-aggregator 2.5
workflow-api 2.26
workflow-basic-steps 2.6
workflow-cps 2.45
workflow-cps-global-lib 2.9
workflow-durable-task-step 2.19
workflow-job 2.17
workflow-multibranch 2.17
workflow-scm-step 2.6
workflow-step-api 2.14
workflow-support 2.18
ws-cleanup 0.34MacOS High Sierra Jenkins ver. 2.111 ace-editor 1.1 ansicolor 0.5.2 ant 1.8 antisamy-markup-formatter 1.5 apache-httpcomponents-client-4-api 4.5.3-2.1 authentication-tokens 1.3 blueocean 1.4.2 blueocean-autofavorite 1.2.2 blueocean-bitbucket-pipeline 1.4.2 blueocean-commons 1.4.2 blueocean-config 1.4.2 blueocean-core-js 1.4.2 blueocean-dashboard 1.4.2 blueocean-display-url 2.2.0 blueocean-events 1.4.2 blueocean-git-pipeline 1.4.2 blueocean-github-pipeline 1.4.2 blueocean-i18n 1.4.2 blueocean-jira 1.4.2 blueocean-jwt 1.4.2 blueocean-personalization 1.4.2 blueocean-pipeline-api-impl 1.4.2 blueocean-pipeline-editor 1.4.2 blueocean-pipeline-scm-api 1.4.2 blueocean-rest 1.4.2 blueocean-rest-impl 1.4.2 blueocean-web 1.4.2 bouncycastle-api 2.16.2 branch-api 2.0.18 build-timeout 1.19 cloudbees-bitbucket-branch-source 2.2.10 cloudbees-folder 6.3 command-launcher 1.2 credentials 2.1.16 credentials-binding 1.15 cucumber 0.0.2 cucumber-reports 3.15.0 cucumber-testresult-plugin 0.10.1 cucumber-trends-report 1.3 display-url-api 2.2.0 docker-commons 1.11 docker-java-api 3.0.14 docker-plugin 1.1.3 docker-workflow 1.15.1 durable-task 1.22 email-ext 2.61 emailext-template 1 external-monitor-job 1.7 favorite 2.3.1 ghprb 1.40.0 git 3.8.0 git-client 2.7.1 git-server 1.7 github 1.29.0 github-api 1.9 github-branch-source 2.3.2 gradle 1.28 groovy-postbuild 2.3.1 handlebars 1.1.1 handy-uri-templates-2-api 2.1.6-1.0 htmlpublisher 1.14 http_request 1.8.22 icon-shim 2.0.3 jackson2-api 2.8.11.1 jenkins-design-language 1.4.2 jira 2.5 jquery-detached 1.2.1 jsch 0.1.54.2 junit 1.24 ldap 1.2 mailer 1.2 mapdb-api 1.0.9.0 matrix-auth 2.2 matrix-project 1.12 mercurial 2.3 momentjs 1.1.1 pam-auth 1.3 performance 3.5 pipeline-build-step 2.7 pipeline-github-lib 1 pipeline-graph-analysis 1.6 pipeline-input-step 2.8 pipeline-milestone-step 1.3.1 pipeline-model-api 1.2.7 pipeline-model-declarative-agent 1.1.1 pipeline-model-definition 1.2.7 pipeline-model-extensions 1.2.7 pipeline-rest-api 2.9 pipeline-stage-step 2.3 pipeline-stage-tags-metadata 1.2.7 pipeline-stage-view 2.9 pipeline-utility-steps 2.0.1 plain-credentials 1.4 pubsub-light 1.12 resource-disposer 0.8 ruby-runtime 0.12 scm-api 2.2.6 script-security 1.42 sse-gateway 1.15 ssh-agent 1.15 ssh-credentials 1.13 ssh-slaves 1.26 structs 1.14 subversion 2.10.3 timestamper 1.8.9 token-macro 2.3 variant 1.1 windows-slaves 1.3.1 workflow-aggregator 2.5 workflow-api 2.26 workflow-basic-steps 2.6 workflow-cps 2.45 workflow-cps-global-lib 2.9 workflow-durable-task-step 2.19 workflow-job 2.17 workflow-multibranch 2.17 workflow-scm-step 2.6 workflow-step-api 2.14 workflow-support 2.18 ws-cleanup 0.34
When I try to run parallel branches with failFast set to false, parallel branch 'foo' kills other parallel branch 'bar' when foo times-out.
When I use try/catch in 'foo', exception is not being handled and 'bar' gets killed.
In both cases 'bar is getting killed'
Code snippet without try/catch:
pipeline { agent any options { timestamps() timeout(time: 30, unit: 'MINUTES') } stages { stage('Setup'){ steps{ script{ parallel 'foo': { timeout(time: 60, unit: 'SECONDS'){ sh "sleep 90" } echo "Done with foo" }, 'bar': { sh "sleep 200" echo "Done with bar" }, failFast: false } } } } }
Snippet of the console log without try/catch block (you can see that 'bar' is getting killed):
[Pipeline] node Running on Jenkins in /Users/Shared/Jenkins/Home/workspace/dummy [Pipeline] { [Pipeline] timestamps [Pipeline] { [Pipeline] timeout 16:28:05 Timeout set to expire in 30 min [Pipeline] { [Pipeline] stage [Pipeline] { (Setup) [Pipeline] script [Pipeline] { [Pipeline] parallel [Pipeline] [foo] { (Branch: foo) [Pipeline] [bar] { (Branch: bar) [Pipeline] [foo] timeout 16:28:05 [foo] Timeout set to expire in 1 min 0 sec [Pipeline] [foo] { [Pipeline] [bar] sh 16:28:05 [bar] [dummy] Running shell script [Pipeline] [foo] sh 16:28:05 [bar] + sleep 200 16:28:05 [foo] [dummy] Running shell script 16:28:05 [foo] + sleep 90 16:29:05 [foo] Cancelling nested steps due to timeout 16:29:05 [bar] sh: line 1: 9520 Terminated: 15 JENKINS_SERVER_COOKIE=$jsc '/Users/Shared/Jenkins/Home/workspace/dummy@tmp/durable-920b4cdf/script.sh' > '/Users/Shared/Jenkins/Home/workspace/dummy@tmp/durable-920b4cdf/jenkins-log.txt' 2>&1 16:29:05 [foo] Sending interrupt signal to process 16:29:05 [foo] sh: line 1: 9526 Terminated: 15 JENKINS_SERVER_COOKIE=$jsc '/Users/Shared/Jenkins/Home/workspace/dummy@tmp/durable-9c5ebea8/script.sh' > '/Users/Shared/Jenkins/Home/workspace/dummy@tmp/durable-9c5ebea8/jenkins-log.txt' 2>&1 [Pipeline] [bar] } 16:29:14 [bar] Failed in branch bar [Pipeline] [foo] } [Pipeline] [foo] // timeout [Pipeline] [foo] } 16:29:14 [foo] Failed in branch foo [Pipeline] // parallel [Pipeline] } [Pipeline] // script [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // timeout [Pipeline] } [Pipeline] // timestamps [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline ERROR: script returned exit code 143 Finished: FAILURE
Code snippet with try/catch inside 'foo' branch:
pipeline { agent any options { timestamps() timeout(time: 30, unit: 'MINUTES') } stages { stage('Setup'){ steps{ script{ parallel 'foo': { try{ timeout(time: 60, unit: 'SECONDS'){ sh "sleep 90" } echo "Done with foo" } catch(err) { "Caught exception ignore: ${err}" } }, 'bar': { sh "sleep 200" echo "Done with bar" }, failFast: false } } } } }
Snippet of the console log with try/catch block inside 'foo' branch (you can see that 'bar' is getting killed):
[Pipeline] node Running on Jenkins in /Users/Shared/Jenkins/Home/workspace/dummy [Pipeline] { [Pipeline] timestamps [Pipeline] { [Pipeline] timeout 16:32:58 Timeout set to expire in 30 min [Pipeline] { [Pipeline] stage [Pipeline] { (Setup) [Pipeline] script [Pipeline] { [Pipeline] parallel [Pipeline] [foo] { (Branch: foo) [Pipeline] [bar] { (Branch: bar) [Pipeline] [foo] timeout 16:32:58 [foo] Timeout set to expire in 1 min 0 sec [Pipeline] [foo] { [Pipeline] [bar] sh 16:32:58 [bar] [dummy] Running shell script [Pipeline] [foo] sh 16:32:58 [bar] + sleep 200 16:32:58 [foo] [dummy] Running shell script 16:32:58 [foo] + sleep 90 16:33:58 [foo] Cancelling nested steps due to timeout 16:33:58 [bar] sh: line 1: 9756 Terminated: 15 JENKINS_SERVER_COOKIE=$jsc '/Users/Shared/Jenkins/Home/workspace/dummy@tmp/durable-4d63fae2/script.sh' > '/Users/Shared/Jenkins/Home/workspace/dummy@tmp/durable-4d63fae2/jenkins-log.txt' 2>&1 16:33:58 [foo] Sending interrupt signal to process 16:33:58 [foo] sh: line 1: 9762 Terminated: 15 JENKINS_SERVER_COOKIE=$jsc '/Users/Shared/Jenkins/Home/workspace/dummy@tmp/durable-76186e5f/script.sh' > '/Users/Shared/Jenkins/Home/workspace/dummy@tmp/durable-76186e5f/jenkins-log.txt' 2>&1 [Pipeline] [bar] } 16:34:07 [bar] Failed in branch bar [Pipeline] [foo] } [Pipeline] [foo] // timeout [Pipeline] [foo] } [Pipeline] // parallel [Pipeline] } [Pipeline] // script [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // timeout [Pipeline] } [Pipeline] // timestamps [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline ERROR: script returned exit code 143 Finished: FAILURE
I tried having parallel in steps and not inside script block. None the less I see same error.
snippet for console output: