-
Bug
-
Resolution: Fixed
-
Major
-
-
Pipeline Groovy 2.56
When a parallel step is nested in a node step, the executor associated with the node appears to outlive both the parallel and node steps. This leads to the executor being rehydrated when a pipeline is restarted, even if the pipeline is outside of the node block.
Reproduction test case:
@Test public void shouldNotLeakExecutorsViaContextVars() { story.then(r -> { DumbSlave s = r.createOnlineSlave(); WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "demo"); p.setDefinition(new CpsFlowDefinition("node('" + s.getNodeName() + "') {\n" + " parallel one: {\n" + " echo '" + s.getNodeName() + "'\n" + " }\n" + "}\n" + "semaphore 'wait'\n", false)); WorkflowRun b = p.scheduleBuild2(0).waitForStart(); SemaphoreStep.waitForStart("wait/1", b); r.jenkins.removeNode(s); }); story.then(r -> { WorkflowRun b = r.jenkins.getItemByFullName("demo", WorkflowJob.class).getBuildByNumber(1); SemaphoreStep.waitForStart("wait/1", b); SemaphoreStep.success("wait/1", null); while (b.isBuilding()) { r.assertLogNotContains("Jenkins doesn’t have label", b); Thread.sleep(100); } r.assertBuildStatusSuccess(b); }); }
This test currently fails because the pipeline waits for the 'Test' agent to become available after restarting even though we are not in a node block.
- is duplicated by
-
JENKINS-51539 A paused Workflow job does not resume after safeExit when parallel step is wrapped by a node step
-
- Resolved
-
-
JENKINS-39552 After restart, interrupted pipeline deadlocks waiting for executor
-
- Closed
-
- relates to
-
JENKINS-41791 Build cannot be resumed if parallel was used with Kubernetes plugin
-
- Resolved
-
-
JENKINS-63164 Closures in block-scoped steps can reference dead CpsBodyExecutions
-
- Resolved
-
- links to
[JENKINS-53709] Parallel blocks in node blocks cause executors to be persisted outside of the node block
Status | Original: Open [ 1 ] | New: In Progress [ 3 ] |
Description |
Original:
When a {{parallel}} step is nested in a {{node}} step, the executor associated with the node appears to outlive both the {{parallel}} and {{node}} steps. This leads to the executor being rehydrated when a pipeline is restarted, even if the pipeline is outside of the node block. Reproduction test case: {code} @Test public void shouldNotLeakExecutorsViaContextVars() { story.then(r -> { DumbSlave s = r.createOnlineSlave(); WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "demo"); p.setDefinition(new CpsFlowDefinition("node('" + s.getNodeName() + "') {\n" + " parallel one: {\n" + " echo '" + s.getNodeName() + "'\n" + " }\n" + "}\n" + "semaphore 'wait'\n", false)); WorkflowRun b = p.scheduleBuild2(0).waitForStart(); SemaphoreStep.waitForStart("wait/1", b); r.disconnectSlave(s); }); story.then(r -> { WorkflowRun b = r.jenkins.getItemByFullName("demo", WorkflowJob.class).getBuildByNumber(1); SemaphoreStep.waitForStart("wait/1", b); SemaphoreStep.success("wait/1", null); while (b.isBuilding()) { r.assertLogNotContains(" is offline", b); Thread.sleep(100); } r.assertBuildStatusSuccess(b); }); } {code} This test currently fails because the pipeline waits for the 'Test' agent to become available after restarting even though we are not in a node block. From a quick investigation, I think this may have been introduced by |
New:
When a {{parallel}} step is nested in a {{node}} step, the executor associated with the node appears to outlive both the {{parallel}} and {{node}} steps. This leads to the executor being rehydrated when a pipeline is restarted, even if the pipeline is outside of the node block. Reproduction test case: {code} @Test public void shouldNotLeakExecutorsViaContextVars() { story.then(r -> { DumbSlave s = r.createOnlineSlave(); WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "demo"); p.setDefinition(new CpsFlowDefinition("node('" + s.getNodeName() + "') {\n" + " parallel one: {\n" + " echo '" + s.getNodeName() + "'\n" + " }\n" + "}\n" + "semaphore 'wait'\n", false)); WorkflowRun b = p.scheduleBuild2(0).waitForStart(); SemaphoreStep.waitForStart("wait/1", b); r.jenkins.removeNode(s); }); story.then(r -> { WorkflowRun b = r.jenkins.getItemByFullName("demo", WorkflowJob.class).getBuildByNumber(1); SemaphoreStep.waitForStart("wait/1", b); SemaphoreStep.success("wait/1", null); while (b.isBuilding()) { r.assertLogNotContains("Jenkins doesn’t have label", b); Thread.sleep(100); } r.assertBuildStatusSuccess(b); }); } {code} This test currently fails because the pipeline waits for the 'Test' agent to become available after restarting even though we are not in a node block. From a quick investigation, I think this may have been introduced by |
Description |
Original:
When a {{parallel}} step is nested in a {{node}} step, the executor associated with the node appears to outlive both the {{parallel}} and {{node}} steps. This leads to the executor being rehydrated when a pipeline is restarted, even if the pipeline is outside of the node block. Reproduction test case: {code} @Test public void shouldNotLeakExecutorsViaContextVars() { story.then(r -> { DumbSlave s = r.createOnlineSlave(); WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "demo"); p.setDefinition(new CpsFlowDefinition("node('" + s.getNodeName() + "') {\n" + " parallel one: {\n" + " echo '" + s.getNodeName() + "'\n" + " }\n" + "}\n" + "semaphore 'wait'\n", false)); WorkflowRun b = p.scheduleBuild2(0).waitForStart(); SemaphoreStep.waitForStart("wait/1", b); r.jenkins.removeNode(s); }); story.then(r -> { WorkflowRun b = r.jenkins.getItemByFullName("demo", WorkflowJob.class).getBuildByNumber(1); SemaphoreStep.waitForStart("wait/1", b); SemaphoreStep.success("wait/1", null); while (b.isBuilding()) { r.assertLogNotContains("Jenkins doesn’t have label", b); Thread.sleep(100); } r.assertBuildStatusSuccess(b); }); } {code} This test currently fails because the pipeline waits for the 'Test' agent to become available after restarting even though we are not in a node block. From a quick investigation, I think this may have been introduced by |
New:
When a {{parallel}} step is nested in a {{node}} step, the executor associated with the node appears to outlive both the {{parallel}} and {{node}} steps. This leads to the executor being rehydrated when a pipeline is restarted, even if the pipeline is outside of the node block. Reproduction test case: {code} @Test public void shouldNotLeakExecutorsViaContextVars() { story.then(r -> { DumbSlave s = r.createOnlineSlave(); WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "demo"); p.setDefinition(new CpsFlowDefinition("node('" + s.getNodeName() + "') {\n" + " parallel one: {\n" + " echo '" + s.getNodeName() + "'\n" + " }\n" + "}\n" + "semaphore 'wait'\n", false)); WorkflowRun b = p.scheduleBuild2(0).waitForStart(); SemaphoreStep.waitForStart("wait/1", b); r.jenkins.removeNode(s); }); story.then(r -> { WorkflowRun b = r.jenkins.getItemByFullName("demo", WorkflowJob.class).getBuildByNumber(1); SemaphoreStep.waitForStart("wait/1", b); SemaphoreStep.success("wait/1", null); while (b.isBuilding()) { r.assertLogNotContains("Jenkins doesn’t have label", b); Thread.sleep(100); } r.assertBuildStatusSuccess(b); }); } {code} This test currently fails because the pipeline waits for the 'Test' agent to become available after restarting even though we are not in a node block. |
Status | Original: In Progress [ 3 ] | New: In Review [ 10005 ] |
Remote Link | New: This issue links to "jenkinsci/workflow-cps-plugin#245 (Web Link)" [ 21829 ] |
Released As | New: Pipeline Groovy 2.56 | |
Resolution | New: Fixed [ 1 ] | |
Status | Original: In Review [ 10005 ] | New: Resolved [ 5 ] |
Link |
New:
This issue is duplicated by |
Link |
New:
This issue relates to |
Link |
New:
This issue relates to |
Link |
New:
This issue is duplicated by |