Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-51948

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

    Details

    • Similar Issues:

      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.

        Attachments

          Activity

          Hide
          macdrega Joerg Schwaerzler added a comment -

          While working on JENKINS-36547 I came accross this issue. At least when running my unit tests it looks like computeEnclosingLabel() is not able to find the label for the parallel branches created in my test code.
          Is there someone already working on a fix? I'd like to avoid duplicate work here...

          Show
          macdrega Joerg Schwaerzler added a comment - While working on JENKINS-36547 I came accross this issue. At least when running my unit tests it looks like computeEnclosingLabel() is not able to find the label for the parallel branches created in my test code. Is there someone already working on a fix? I'd like to avoid duplicate work here...
          Hide
          jsoref Josh Soref added a comment -

          I gave up trying to figure out how to fix this. When I work on things, I tend to post PR requests fairly quickly... Otherwise, I file bugs and hope someone else will fix...

          Show
          jsoref Josh Soref added a comment - I gave up trying to figure out how to fix this. When I work on things, I tend to post PR requests fairly quickly... Otherwise, I file bugs and hope someone else will fix...
          Hide
          macdrega Joerg Schwaerzler added a comment -

          Thanks for the fast reply. In that case I'll see whether the fix I need will possibly fix this one as well and document the PR accordingly.

          Show
          macdrega Joerg Schwaerzler added a comment - Thanks for the fast reply. In that case I'll see whether the fix I need will possibly fix this one as well and document the PR accordingly.

            People

            • Assignee:
              Unassigned
              Reporter:
              jsoref Josh Soref
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: