jenkinsci / jenkinsci/workflow-durable-task-step-plugin

[JENKINS-51948] ExecutorStepExecution.PlaceholderTask getEnclosingLabel/computeEnclosingLabel incorrectly calculate node resulting in mislabeled stages in parallel if they don't have an agent

Open
#562 3 comments 0 reactions 0 assignees View on GitHub
component:workflow-durable-task-step-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
46
Forks
110
PR merge metrics
No merged PRs in 30d

Description

The best I've managed to debug is to finger this code:

https://github.com/jenkinsci/workflow-durable-task-step-plugin/blob/e63e949faeecb3b50293fad7b76865f4d650be52/src/main/java/org/jenkinsci/plugins/workflow/support/steps/ExecutorStepExecution.java#L464-L522

I think it should be replaced/rewritten to use the same code methodology as flowGraphTable

I've attached a jenkinsfile, you'll need to change the agent "pipeline" to an agent class that you have on your system. Then run the job and look at the build executor status.

You should see two nodes, one with (Code) and one with (Frontend), instead you'll see two with the former and none with the latter.

The logic in the highlighted code block doesn't actually pick nodes, it sort of picks a potential name, leaves it in a reachable variable, and then loops. Also, afaict, the n.equals method seems to spuriously result in true – i.e., whatever logic the author was expecting to use it to deterministically identify the right corresponding node fails miserably.

---
Originally reported by jsoref, imported from: ExecutorStepExecution.PlaceholderTask getEnclosingLabel/computeEnclosingLabel incorrectly calculate node resulting in mislabeled stages in parallel if they don't have an agent


  • status: In Progress
  • priority: Minor
  • component(s): workflow-durable-task-step-plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 2
  • imported: 20251212-090250

Raw content of original issue

The best I've managed to debug is to finger this code:

https://github.com/jenkinsci/workflow-durable-task-step-plugin/blob/e63e949faeecb3b50293fad7b76865f4d650be52/src/main/java/org/jenkinsci/plugins/workflow/support/steps/ExecutorStepExecution.java#L464-L522

I think it should be replaced/rewritten to use the same code methodology as flowGraphTable

I've attached a jenkinsfile, you'll need to change the agent "pipeline" to an agent class that you have on your system. Then run the job and look at the build executor status.
You should see two nodes, one with (Code) and one with (Frontend), instead you'll see two with the former and none with the latter.

The logic in the highlighted code block doesn't actually pick nodes, it sort of picks a potential name, leaves it in a reachable variable, and then loops. Also, afaict, the n.equals method seems to spuriously result in true – i.e., whatever logic the author was expecting to use it to deterministically identify the right corresponding node fails miserably.

1 attachment

- [Jenkinsfile](https://issues.jenkins.io/secure/attachment/42878/Jenkinsfile)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.