jenkinsci / jenkinsci/workflow-cps-plugin
[JENKINS-43413] RejectedExecutionException at SingleLaneExecutorService when loading CpsFlowExecution after restart
- Dominant language
- Java
- Stars
- 186
- Forks
- 213
- Avg merge
- 12h 12m
- Merged PRs (30d)
- 8
Description
One one of the Jenkins instances I see the following behavior after the Jenkins restart:
```
2017-04-05 10:56:30.569+0000 [id=72] WARNING o.j.p.w.f.FlowExecutionList$ItemListenerImpl$1#onFailure: Failed to load CpsFlowExecution[Owner[ *SECRET* #15]]java.util.concurrent.RejectedExecutionException
at hudson.remoting.SingleLaneExecutorService.execute(SingleLaneExecutorService.java:100)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at com.google.common.util.concurrent.ForwardingExecutorService.submit(ForwardingExecutorService.java:110)
at jenkins.util.InterceptingExecutorService.submit(InterceptingExecutorService.java:49)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$4.onSuccess(CpsFlowExecution.java:648)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$4.onSuccess(CpsFlowExecution.java:644)
at org.jenkinsci.plugins.workflow.support.concurrent.Futures$1.run(Futures.java:150)
```
According to the remoting Code-base, it happens when the Executor Service is shutting down due to whatever reason. I am not sure why it could be shutting down in Pipeline CPS Plugin during the startup, but this issue should be gracefully handled.
Diagnostics PR on the remoting side: https://github.com/jenkinsci/remoting/pull/156.
---
Originally reported by
oleg_nenashev, imported from: RejectedExecutionException at SingleLaneExecutorService when loading CpsFlowExecution after restart
Raw content of original issue
One one of the Jenkins instances I see the following behavior after the Jenkins restart:
2017-04-05 10:56:30.569+0000 [id=72] WARNING o.j.p.w.f.FlowExecutionList$ItemListenerImpl$1#onFailure: Failed to load CpsFlowExecution[Owner[ *SECRET* #15]]java.util.concurrent.RejectedExecutionException
at hudson.remoting.SingleLaneExecutorService.execute(SingleLaneExecutorService.java:100)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at com.google.common.util.concurrent.ForwardingExecutorService.submit(ForwardingExecutorService.java:110)
at jenkins.util.InterceptingExecutorService.submit(InterceptingExecutorService.java:49)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$4.onSuccess(CpsFlowExecution.java:648)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$4.onSuccess(CpsFlowExecution.java:644)
at org.jenkinsci.plugins.workflow.support.concurrent.Futures$1.run(Futures.java:150)According to the remoting Code-base, it happens when the Executor Service is shutting down due to whatever reason. I am not sure why it could be shutting down in Pipeline CPS Plugin during the startup, but this issue should be gracefully handled.
Diagnostics PR on the remoting side: https://github.com/jenkinsci/remoting/pull/156.
environment
```
* Jenkins 2.32.2
* workflow-aggregator:2.4 'Pipeline'
* workflow-api:2.8 'Pipeline: API'
* workflow-basic-steps:2.3 'Pipeline: Basic Steps'
* workflow-cps:2.24 'Pipeline: Groovy'
* workflow-cps-checkpoint:2.4 'CloudBees Pipeline: Groovy Checkpoint Plugin'
* workflow-cps-global-lib:2.5 'Pipeline: Shared Groovy Libraries'
* workflow-durable-task-step:2.8 'Pipeline: Nodes and Processes'
* workflow-job:2.9 'Pipeline: Job'
* workflow-multibranch:2.9.2 'Pipeline: Multibranch'
* workflow-scm-step:2.3 'Pipeline: SCM Step'
* workflow-step-api:2.7 'Pipeline: Step API'
* workflow-support:2.12 'Pipeline: Supporting APIs'
```
Contributor guide
Research direction
Start by tracing CpsFlowExecution$4.onSuccess through Futures$1.run to SingleLaneExecutorService.execute in the reported stack trace, then compare the remoting diagnostics PR linked in the issue. Done means loading CpsFlowExecution after restart handles the rejected executor gracefully instead of failing with RejectedExecutionException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100