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

Build Executor number is not consistent with EXECUTOR_NUMBER

    XMLWordPrintable

Details

    Description

      Build Executor display number is not consistent with the number is provided by EXECUTOR_NUMBER variable.
      Display number should always by EXECUTOR_NUMBER+1 but it randomly shows different values.

      When using 4-5 executors per node (master included) seemed to be easier to replicate but not 100%.

      It seems to only be an issue on the display side.
      When using EXECUTOR_NUMBER to separate folders of maven repository artifacts, to build in parallel, the value is very important to avoid "cross contamination".
      We also use this variable to avoid constant download artifacts on every build, by mounting /var/lib/jenkins/.m2/repository/EXECUTOR_NUMBER inside a container.

      Jenkinsfile:

      node('master') {
          stage('on master') {
              echo EXECUTOR_NUMBER
              sleep 30
              sh 'echo ${EXECUTOR_NUMBER}'
          }
      }
      
      node('docker') {
          stage('on slave') {
              echo EXECUTOR_NUMBER
              sleep 30
              sh 'echo ${EXECUTOR_NUMBER}'
          }
      }
      

      Not sure if there is some way to get the Build Executor display number, so to compare, I took a screenshot from the nodes page, during the build.

      Attachments

        Issue Links

          Activity

            ncosta Nuno Costa created issue -
            ncosta Nuno Costa made changes -
            Field Original Value New Value
            Description Build Executor display number is not consistent with the number is provided by EXECUTOR_NUMBER variable.
            Display number should always by EXECUTOR_NUMBER+1 but it randomly shows different values.

            When using 4-5 executors per node (master included) seemed to be easier to replicate but not 100%.

            It seems to only be an issue on the display side.
            When using EXECUTOR_NUMBER to separate folders of maven repository artifacts, to build in parallel, the value is very important to avoid "cross contamination".
            We also use this variable to avoid constant download artifacts on every build, by mounting /var/lib/jenkins/.m2/repository/EXECUTOR_NUMBER inside a container.

            Jenkinsfile:
            {code:java}
            node('master') {
                stage('on master') {
                    echo EXECUTOR_NUMBER
                    sleep 30
                    sh 'echo ${EXECUTOR_NUMBER}'
                }
            }

            node('docker') {
                stage('on slave') {
                    echo EXECUTOR_NUMBER
                    sleep 30
                    sh 'echo ${EXECUTOR_NUMBER}'
                }
            }
            {code}

            Not sure if there is some way to get the Build Executor display number, so to compare, I took a screenshot from the nodes page, during the build.
            Build Executor display number is not consistent with the number is provided by {{EXECUTOR_NUMBER}} variable.
             Display number should always by {{EXECUTOR_NUMBER}}+1 but it randomly shows different values.

            When using 4-5 executors per node (master included) seemed to be easier to replicate but not 100%.

            It seems to only be an issue on the display side.
             When using {{EXECUTOR_NUMBER}} to *separate* folders of maven repository artifacts, to build in parallel, *the value is very important* to avoid "cross contamination".
             We also use this variable to *avoid* *constant* download artifacts on every build, by mounting {{/var/lib/jenkins/.m2/repository/EXECUTOR_NUMBER}} inside a container.

            Jenkinsfile:
            {code:java}
            node('master') {
                stage('on master') {
                    echo EXECUTOR_NUMBER
                    sleep 30
                    sh 'echo ${EXECUTOR_NUMBER}'
                }
            }

            node('docker') {
                stage('on slave') {
                    echo EXECUTOR_NUMBER
                    sleep 30
                    sh 'echo ${EXECUTOR_NUMBER}'
                }
            }
            {code}
            Not sure if there is some way to get the Build Executor display number, so to compare, I took a screenshot from the nodes page, during the build.
            abayer Andrew Bayer made changes -
            Component/s workflow-durable-task-step-plugin [ 21715 ]
            Component/s pipeline [ 21692 ]
            p4karl Karl Wirth made changes -
            Priority Minor [ 4 ] Blocker [ 1 ]
            p4karl Karl Wirth made changes -
            Link This issue is related to JENKINS-60213 [ JENKINS-60213 ]

            People

              Unassigned Unassigned
              ncosta Nuno Costa
              Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated: