Repository navigation
[JENKINS-46507] Parallel Pipeline random java.lang.InterruptedException #1355
Copy link
Copy link
Closed
Description
In my pipeline job,
sometimes it'd randomly receive the java.lang.InterruptedException below:
java.lang.InterruptedException at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1302) at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:275) at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:111) at org.jenkinsci.plugins.workflow.cps.CpsStepContext.getThreadGroupSynchronously(CpsStepContext.java:248) at org.jenkinsci.plugins.workflow.cps.CpsStepContext.getThreadSynchronously(CpsStepContext.java:237) at org.jenkinsci.plugins.workflow.cps.CpsStepContext.doGet(CpsStepContext.java:294) at org.jenkinsci.plugins.workflow.support.DefaultStepContext.get(DefaultStepContext.java:61) at org.jenkinsci.plugins.workflow.steps.StepDescriptor.checkContextAvailability(StepDescriptor.java:251) at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:179) at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:126) at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108) at org.jenkinsci.plugins.workflow.cps.CpsScript.println(CpsScript.java:207) at org.jenkinsci.plugins.workflow.cps.CpsScript.print(CpsScript.java:202) at sun.reflect.GeneratedMethodAccessor103253.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) .... ....
Please refer to the file attachment for the full console log and the pipeline Jenkinsfile code.
Originally reported by totoroliu, imported from: Parallel Pipeline random java.lang.InterruptedException
- assignee:
dnusbaum
- status: Resolved
- priority: Major
- component(s): pipeline, workflow-cps-plugin
- resolution: Fixed
- resolved: 2019-01-31T21:32:26+00:00
- votes: 19
- watchers: 30
- imported: 2025-12-07
Raw content of original issue
In my pipeline job, sometimes it'd randomly receive the java.lang.InterruptedException below:
java.lang.InterruptedException at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1302) at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:275) at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:111) at org.jenkinsci.plugins.workflow.cps.CpsStepContext.getThreadGroupSynchronously(CpsStepContext.java:248) at org.jenkinsci.plugins.workflow.cps.CpsStepContext.getThreadSynchronously(CpsStepContext.java:237) at org.jenkinsci.plugins.workflow.cps.CpsStepContext.doGet(CpsStepContext.java:294) at org.jenkinsci.plugins.workflow.support.DefaultStepContext.get(DefaultStepContext.java:61) at org.jenkinsci.plugins.workflow.steps.StepDescriptor.checkContextAvailability(StepDescriptor.java:251) at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:179) at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:126) at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108) at org.jenkinsci.plugins.workflow.cps.CpsScript.println(CpsScript.java:207) at org.jenkinsci.plugins.workflow.cps.CpsScript.print(CpsScript.java:202) at sun.reflect.GeneratedMethodAccessor103253.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) .... ....Please refer to the file attachment for the full console log and the pipeline Jenkinsfile code.
environment
Ubuntu 14.04.5 LTS<br/>
openjdk version "1.8.0_111"<br/>
Jenkins ver. 2.46.1<br/>
Pipeline: API ver. 2.12<br/>
Pipeline: Basic Steps ver. 2.4<br/>
Pipeline: Build Step ver. 2.4<br/>
Pipeline: Groovy ver. 2.29<br/>
Lockable Resources plugin ver. 1.11.2
Reactions are currently unavailable
Activity
jenkins-infra-bot commentedon Aug 28, 2017
Remote link associated with this issue:
jenkins-infra-bot commentedon Aug 28, 2017
Raw content of original comment:
svanoort - may be of interest to you.
jenkins-infra-bot commentedon Sep 28, 2017
carbon:
Raw content of original comment:
+1 to this issue. Experiencing a hang followed by this error when large amount of pipelines run concurrently
jenkins-infra-bot commentedon Oct 24, 2017
abeeskau:
Raw content of original comment:
+1 we're experiencing this as well.
jenkins-infra-bot commentedon Dec 8, 2017
syedimran89:
Raw content of original comment:
+1 we're experiencing this as well. expecting a resolution
jenkins-infra-bot commentedon Jan 11, 2018
ghenzler:
Raw content of original comment:
+1 we're experiencing this as well.
jenkins-infra-bot commentedon Jan 16, 2018
suriyanath:
Raw content of original comment:
We are also experiencing the same, on jenkins version 2.69
jenkins-infra-bot commentedon Jan 29, 2018
lorenzo_cubero:
Raw content of original comment:
Same here using Jenkins 2.73.2
jenkins-infra-bot commentedon Feb 8, 2018
singhshyam:
Raw content of original comment:
+1 Same here, we are facing this issue very frequently
jenkins-infra-bot commentedon Apr 11, 2018
bksoux:
Raw content of original comment:
+1 same here
jenkins-infra-bot commentedon Apr 18, 2018
architeuthis:
Raw content of original comment:
+1 Same here
jenkins-infra-bot commentedon Apr 18, 2018
ghenzler:
Raw content of original comment:
We also had this problem again today... reading jglick's comment in https://issues.jenkins-ci.org/browse/JENKINS-35710?focusedCommentId=268398&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-268398 I suspect adding more slaves does not help (as the stacktrace clearly points to CPS, and according the comment that always runs on master)... but I suppose using https://github.com/jenkinsci/throttle-concurrent-builds-plugin to ensure only a maximum of builds run in parallel globally could help. svanoort before trying, do you think this is a valid way of getting rid of the problem? (asking before trying as this is not easy to reproduce)
jenkins-infra-bot commentedon Apr 18, 2018
svanoort:
Raw content of original comment:
ghenzler Executors have nothing to do with this, and this issue is generally within the scope of a single build, so limiting the maximum number should have no impact – except when restarting Jenkins, where there might be enough of a bottleneck due to loading FlowExecutions to hit the 1 minute timeout. Maybe if you had maybe 10x as many Pipelines as CPU cores on the master, or really complex Program state – in this case we'd be blocking on the code here: https://github.com/jenkinsci/workflow-job-plugin/blob/master/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java#L1024
Do you have a message like this in your logs? WARNING, failed to wait for $someRun to be loaded (and then a stack trace).
More likely there's something subtly wrong with the concurrency/error-handling model here – some of what I'm doing right now to untangle some nasty issues in these guts may help – and there was a change in the last release of workflow-cps that might help if you don't have it already (it caught more exceptions and prevented threads from potentially waiting forever).
jenkins-infra-bot commentedon Sep 4, 2018
iceiceice:
Raw content of original comment:
Same here. I'm running a @NonCPS labeled method in library and if fails with this error randomly in the middle
jenkins 2.107.3
jenkins-infra-bot commentedon Sep 5, 2018
Raw content of original comment:
We are seeing this error quite often lately. Is there anything I can do to help troubleshoot?
31 remaining items
jenkins-infra-bot commentedon Jan 14, 2019
Raw content of original comment:
ncrmnt did those timeouts end up helping? If so, I can roll them up into jenkinsci/workflow-durable-task-step-plugin#90 and release that so they can be configured without needing to run custom code.
jenkins-infra-bot commentedon Jan 15, 2019
ncrmnt:
Raw content of original comment:
dnusbaum Sorry for not reporting earlier. 60 seconds seem to have fixed all issues for me. The rest of the problems were due to ctest (and our numa scheduler wrapped within it before the actual simulator) not correctly dying when jenkins asked them to do so.
jenkins-infra-bot commentedon Jan 15, 2019
Raw content of original comment:
ncrmnt No problem! I will move forward with my PR (adding an additional timeout), thanks so much for interactively debugging the issue!
jenkins-infra-bot commentedon Jan 31, 2019
Raw content of original comment:
As of version 2.29 of the Pipeline Nodes and Process Plugin, the default timeout for remote calls is 20 seconds, and the value can be configured using the system property org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep.REMOTE_TIMEOUT.
I am marking this ticket as closed since that is the main cause of the issue identified from discussion in the comments (thanks ncrmnt!). If this issue is still occurring frequently for someone after increasing that value, please comment and we can investigate further.
jenkins-infra-bot commentedon Oct 18, 2019
tpoerio:
Raw content of original comment:
Hi dnusbaum – when will this fix be released? My team needs it. (Or at least we think we do.)
And I saw that this message is from about 9 months back, at time of writing.
As of right now, the current release is only `2.200`, (released 10-14-2019).
However, the post immediately above is referencing version `2.29`.
Is it possible that this update is already present in `2.200`?
If not, when will it become available in a stable release? Many thanks for the help.
jenkins-infra-bot commentedon Dec 7, 2025
[Original
is_duplicated_byfrom Jira: JENKINS-55416]