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

Thread labels in console output don't persist after a node block

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Output after the first node block is not labeled.

      In my use case I call various nodes during a parallel execution step, but here is a contrived example just using the master node:

      threads = ['thread1','thread2']
      def branches = [:]
      for(int i = 0; i < threads.size(); i++) {
      def thread = threads[i]
          branches[thread] = {
              println 'labeled'
              node('master') {println "labeled"}
              println 'not labeled'
              node('master') {println "also not labeled"}
          }
      }
      parallel branches
      

      Results in:

      Running: Execute sub-workflows in parallel : Start
      [thread1] Running: Parallel branch: thread1
      [thread2] Running: Parallel branch: thread2
      [thread1] Running: Print Message
      [thread1] labeled
      [thread1] Running: Allocate node : Start
      [thread1] Running on master in /var/lib/jenkins/workspace/test@3
      [thread2] Running: Print Message
      [thread2] labeled
      [thread2] Running: Allocate node : Start
      [thread2] Running on master in /var/lib/jenkins/workspace/test@4
      [thread1] Running: Allocate node : Body : Start
      [thread2] Running: Allocate node : Body : Start
      [thread1] Running: Print Message
      [thread1] labeled
      Running: Allocate node : Body : End
      [thread2] Running: Print Message
      [thread2] labeled
      Running: Allocate node : Body : End
      Running: Allocate node : End
      Running: Allocate node : End
      Running: Print Message
      not labeled
      Running: Allocate node : Start
      Running on master in /var/lib/jenkins/workspace/test@3
      Running: Print Message
      not labeled
      Running: Allocate node : Start
      Running on master in /var/lib/jenkins/workspace/test@4
      Running: Allocate node : Body : Start
      Running: Allocate node : Body : Start
      Running: Print Message
      also not labeled
      Running: Allocate node : Body : End
      Running: Print Message
      also not labeled
      Running: Allocate node : Body : End
      Running: Allocate node : End
      Running: Allocate node : End
      Running: Execute sub-workflows in parallel : Body : End
      Running: Execute sub-workflows in parallel : Body : End
      Running: Execute sub-workflows in parallel : End
      Running: End of Workflow
      Finished: SUCCESS
      

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/test/java/org/jenkinsci/plugins/workflow/cps/steps/ParallelStepTest.java
            http://jenkins-ci.org/commit/workflow-cps-plugin/1b586ec4149faa0f68619d14e07cdf7647a2ca3f
            Log:
            JENKINS-28222 Moving getLogPrefix test to workflow-job, where this is implemented anyway.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/test/java/org/jenkinsci/plugins/workflow/cps/steps/ParallelStepTest.java http://jenkins-ci.org/commit/workflow-cps-plugin/1b586ec4149faa0f68619d14e07cdf7647a2ca3f Log: JENKINS-28222 Moving getLogPrefix test to workflow-job, where this is implemented anyway.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/test/java/org/jenkinsci/plugins/workflow/cps/steps/ParallelStepTest.java
            http://jenkins-ci.org/commit/workflow-cps-plugin/b5b1ed0d06aa057666ec43d55e99e18de058740b
            Log:
            Merge pull request #54 from jglick/getLogPrefix-JENKINS-28222

            JENKINS-28222 Moving getLogPrefix test to workflow-job, where this is implemented anyway

            Compare: https://github.com/jenkinsci/workflow-cps-plugin/compare/788eccc2cfd3...b5b1ed0d06aa

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/test/java/org/jenkinsci/plugins/workflow/cps/steps/ParallelStepTest.java http://jenkins-ci.org/commit/workflow-cps-plugin/b5b1ed0d06aa057666ec43d55e99e18de058740b Log: Merge pull request #54 from jglick/getLogPrefix- JENKINS-28222 JENKINS-28222 Moving getLogPrefix test to workflow-job, where this is implemented anyway Compare: https://github.com/jenkinsci/workflow-cps-plugin/compare/788eccc2cfd3...b5b1ed0d06aa
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
            src/test/java/org/jenkinsci/plugins/workflow/job/WorkflowRunTest.java
            http://jenkins-ci.org/commit/workflow-job-plugin/1f24b2e61d865bdbb1ab9b2023a61074537e74e1
            Log:
            [FIXED JENKINS-28222] Branch labels were being incorrectly skipped after an end block node.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java src/test/java/org/jenkinsci/plugins/workflow/job/WorkflowRunTest.java http://jenkins-ci.org/commit/workflow-job-plugin/1f24b2e61d865bdbb1ab9b2023a61074537e74e1 Log: [FIXED JENKINS-28222] Branch labels were being incorrectly skipped after an end block node.

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                anshuarya Anshu Arya
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: