-
Bug
-
Resolution: Not A Defect
-
Minor
-
None
-
Jenkins version: 2.60.3
Plugins
ace-editor 1.1
analysis-core 1.92
ansible 0.6.2
ansicolor 0.5.2
ant 1.6
antisamy-markup-formatter 1.5
any-buildstep 0.1
authentication-tokens 1.3
bouncycastle-api 2.16.2
branch-api 2.0.11
build-flow-plugin 0.19
build-name-setter 1.6.7
build-timeout 1.18
build-user-vars-plugin 1.5
buildgraph-view 1.8
built-on-column 1.1
cloudbees-folder 6.1.2
conditional-buildstep 1.3.6
config-file-provider 2.16.3
copyartifact 1.38.1
credentials 2.1.14
credentials-binding 1.13
cvs 2.13
dashboard-view 2.9.11
display-url-api 2.0
docker-commons 1.8
docker-workflow 1.12
durable-task 1.14
email-ext 2.58
envinject 2.1.3
envinject-api 1.2
external-monitor-job 1.7
extra-columns 1.18
flexible-publish 0.15.2
git 3.5.1
git-client 2.5.0
git-server 1.7
github 1.28.0
github-api 1.86
github-branch-source 2.2.3
gradle 1.27.1
handlebars 1.1.1
htmlpublisher 1.14
icon-shim 2.0.3
jackson2-api 2.7.3
javadoc 1.4
jenkins-multijob-plugin 1.27
job-dsl 1.64
jquery 1.11.2-0
jquery-detached 1.2.1
junit 1.21
junit-attachments 1.4.2
ldap 1.16
logstash 1.3.0
mailer 1.20
mapdb-api 1.0.9.0
matrix-auth 1.7
matrix-project 1.11
maven-plugin 2.17
momentjs 1.1.1
monitoring 1.68.1
multiple-scms 0.6
nodelabelparameter 1.7.2
pam-auth 1.3
parameterized-trigger 2.35.1
pipeline-build-step 2.5.1
pipeline-github-lib 1.0
pipeline-graph-analysis 1.5
pipeline-input-step 2.8
pipeline-milestone-step 1.3.1
pipeline-model-api 1.1.9
pipeline-model-declarative-agent 1.1.1
pipeline-model-definition 1.1.9
pipeline-model-extensions 1.1.9
pipeline-rest-api 2.8
pipeline-stage-step 2.2
pipeline-stage-tags-metadata 1.1.9
pipeline-stage-view 2.8
pipeline-utility-steps 1.4.0
plain-credentials 1.4
progress-bar-column-plugin 1.0
promoted-builds 2.29
rebuild 1.25
resource-disposer 0.7
run-condition 1.0
scm-api 2.2.0
script-security 1.34
slack 2.2
ssh-credentials 1.13
ssh-slaves 1.20
structs 1.10
subversion 2.9
swarm 3.4
test-results-analyzer 0.3.4
throttle-concurrents 2.0.1
timestamper 1.8.8
token-macro 2.1
windows-slaves 1.3.1
workflow-aggregator 2.5
workflow-api 2.20
workflow-basic-steps 2.6
workflow-cps 2.40
workflow-cps-global-lib 2.8
workflow-durable-task-step 2.15
workflow-job 2.12.2
workflow-multibranch 2.16
workflow-scm-step 2.6
workflow-step-api 2.12
workflow-support 2.14
ws-cleanup 0.34Jenkins version: 2.60.3 Plugins ace-editor 1.1 analysis-core 1.92 ansible 0.6.2 ansicolor 0.5.2 ant 1.6 antisamy-markup-formatter 1.5 any-buildstep 0.1 authentication-tokens 1.3 bouncycastle-api 2.16.2 branch-api 2.0.11 build-flow-plugin 0.19 build-name-setter 1.6.7 build-timeout 1.18 build-user-vars-plugin 1.5 buildgraph-view 1.8 built-on-column 1.1 cloudbees-folder 6.1.2 conditional-buildstep 1.3.6 config-file-provider 2.16.3 copyartifact 1.38.1 credentials 2.1.14 credentials-binding 1.13 cvs 2.13 dashboard-view 2.9.11 display-url-api 2.0 docker-commons 1.8 docker-workflow 1.12 durable-task 1.14 email-ext 2.58 envinject 2.1.3 envinject-api 1.2 external-monitor-job 1.7 extra-columns 1.18 flexible-publish 0.15.2 git 3.5.1 git-client 2.5.0 git-server 1.7 github 1.28.0 github-api 1.86 github-branch-source 2.2.3 gradle 1.27.1 handlebars 1.1.1 htmlpublisher 1.14 icon-shim 2.0.3 jackson2-api 2.7.3 javadoc 1.4 jenkins-multijob-plugin 1.27 job-dsl 1.64 jquery 1.11.2-0 jquery-detached 1.2.1 junit 1.21 junit-attachments 1.4.2 ldap 1.16 logstash 1.3.0 mailer 1.20 mapdb-api 1.0.9.0 matrix-auth 1.7 matrix-project 1.11 maven-plugin 2.17 momentjs 1.1.1 monitoring 1.68.1 multiple-scms 0.6 nodelabelparameter 1.7.2 pam-auth 1.3 parameterized-trigger 2.35.1 pipeline-build-step 2.5.1 pipeline-github-lib 1.0 pipeline-graph-analysis 1.5 pipeline-input-step 2.8 pipeline-milestone-step 1.3.1 pipeline-model-api 1.1.9 pipeline-model-declarative-agent 1.1.1 pipeline-model-definition 1.1.9 pipeline-model-extensions 1.1.9 pipeline-rest-api 2.8 pipeline-stage-step 2.2 pipeline-stage-tags-metadata 1.1.9 pipeline-stage-view 2.8 pipeline-utility-steps 1.4.0 plain-credentials 1.4 progress-bar-column-plugin 1.0 promoted-builds 2.29 rebuild 1.25 resource-disposer 0.7 run-condition 1.0 scm-api 2.2.0 script-security 1.34 slack 2.2 ssh-credentials 1.13 ssh-slaves 1.20 structs 1.10 subversion 2.9 swarm 3.4 test-results-analyzer 0.3.4 throttle-concurrents 2.0.1 timestamper 1.8.8 token-macro 2.1 windows-slaves 1.3.1 workflow-aggregator 2.5 workflow-api 2.20 workflow-basic-steps 2.6 workflow-cps 2.40 workflow-cps-global-lib 2.8 workflow-durable-task-step 2.15 workflow-job 2.12.2 workflow-multibranch 2.16 workflow-scm-step 2.6 workflow-step-api 2.12 workflow-support 2.14 ws-cleanup 0.34
I ran a pipeline job which failed in this way:
// [...] Start a VM and have the VM connect back as a swarm slave named "example-eff65ede" [Pipeline] node 22:44:19 Running on example-eff65ede in /var/tmp/jenkins/workspace/devops-gate/master/install-os-usher [Pipeline] { [Pipeline] stage (Unset publishers) 22:44:19 Entering stage Unset publishers 22:44:19 Proceeding [Pipeline] sh [Pipeline] stage (Send Notifications) 22:49:19 Using the ‘stage’ step without a block argument is deprecated 22:49:19 Entering stage Send Notifications 22:49:19 Proceeding 22:49:19 Sending email to: example@example.com [Pipeline] emailext [Pipeline] } [Pipeline] // timestamps [Pipeline] End of Pipeline java.lang.InterruptedException at java.lang.Object.wait(Native Method) at hudson.remoting.Request.call(Request.java:147) at hudson.remoting.Channel.call(Channel.java:829) at hudson.FilePath.act(FilePath.java:987) at hudson.FilePath.act(FilePath.java:976) at hudson.FilePath.chmod(FilePath.java:1592) at org.jenkinsci.plugins.durabletask.BourneShellScript.launchWithCookie(BourneShellScript.java:101) at org.jenkinsci.plugins.durabletask.FileMonitoringTask.launch(FileMonitoringTask.java:64) at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.start(DurableTaskStep.java:167) at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:224) at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:150) at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108) at sun.reflect.GeneratedMethodAccessor1275.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1218) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1027) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:155) at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:133) at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:153) at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:157) at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:127) at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:127) at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:127) at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:127) at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:127) at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17) at WorkflowScript.run(WorkflowScript:65) at ___cps.transform___(Native Method) at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:57) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82) at sun.reflect.GeneratedMethodAccessor609.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:103) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82) at sun.reflect.GeneratedMethodAccessor609.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72) at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:60) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82) at sun.reflect.GeneratedMethodAccessor609.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72) at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21) at com.cloudbees.groovy.cps.Next.step(Next.java:83) at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174) at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163) at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122) at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261) at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:35) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:32) at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:330) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:82) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:242) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:230) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Finished: FAILURE
This is interesting. First, the swarm plugin has connected back to the master at 22:44:19 and so we successfully enter the node block and start running on the slave. Then we enter an sh step. This step seems to be taking a very long time and then exactly 5 minutes later at 22:49:19 we get an interrupt.
At the time that we get the interrupt, we're in hudson.FilePath.chmod(FilePath.java:1592) via BourneShellScript.launchWithCookie via DurableTaskStep$Execution.start. Essentially we are trying to start the execution of the BourneShellScriptDurableTaskStep and as part of its launch method it is trying to chmod the script to 0755. This seems to be hanging or at the very least taking quite a long time. Five minutes later we get an interrupt.
Where could this interrupt have come from? Further up in the stack trace, we see org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174). Looking at the source of that method, there is a 5-minute timer on each instruction in the CPS VM thread introduced by JENKINS-32986. This seems likely to be what is causing the interrupt.
I read JENKINS-32986 as well as related bug JENKINS-42561. It seems that the suggestion there was to use DurableStep. But the thing is, I am using a DurableStep here already, in particular the durable-task-plugin and workflow-durable-task-step-plugin. The advice given in JENKINS-42561 was to implement Step directly, but it appears that is already done in BourneShellScript.
Unfortunately, I don't have the logs on the swarm client side (I am trying to get those), but the VM was running on a network quite far away from the Jenkins master. It was also still booting up at the time we started the swarm client, so it's possible that performance was bad either due to the machine still booting up or the network being very poor (or both). Either way, it sounds like the Durable Task Plugin needs to account for the possibility that this work may take a long time and do it outside the VM CPS thread.
- relates to
-
JENKINS-32986 hard killing a pipeline leaves the JVM CPS thread running.
- Open