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

nested 'node' step always jumps to a new node unnecessarily

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • pipeline
    • None
    • Jenkins 2.332.3
      Plugins are as recent as possible

      We have some labels assigned to various nodes and we run certain things in a relatively complex build process involving a shared Jenkins library. There it happens quite often that the pipeline has multiple nested 'node' steps running with exactly the same labels.

      node('mylabel') {
         for (int i = 0; i < 1000; i++) {
            node('mylabel') {
               sleep(10)
            }
         }
      }
      

      Jenkins ends up switching the node all the time, causing quite a bit of lock contention on the Queue processing. In this case the node step should have some kind of a mechanism to know that it is already on a suitable node and no node switch is required.

      Imagine this scenario with a 100 jobs with around 20 parallel stages each, the builds grind to a halt. This should be more scalable.

          [JENKINS-69132] nested 'node' step always jumps to a new node unnecessarily

          Edgars Batna created issue -
          Edgars Batna made changes -
          Priority Original: Minor [ 4 ] New: Major [ 3 ]
          Edgars Batna made changes -
          Issue Type Original: Bug [ 1 ] New: Improvement [ 4 ]
          Edgars Batna made changes -
          Link New: This issue relates to JENKINS-69025 [ JENKINS-69025 ]

          Edgars Batna added a comment -

          The issue causes a snowball effect.

          Edgars Batna added a comment - The issue causes a snowball effect.
          Edgars Batna made changes -
          Description Original: We have some labels assigned to various nodes and we run certain things in a relatively complex build process involving a shared Jenkins library. There it happens quite often that the pipeline has multiple nested 'node' steps running with exactly the same labels.
          {code:java}
          node('mylabel') {
             for (int i = 0; i < 1000; i++) {
                node('mylabel') {
                   sleep(10)
                }
             }
          }
          {code}
          Jenkins ends up switching the node all the time, causing quite a bit of lock contention on the Queue processing. In this case the node step should have some kind of a mechanism to know that it is already on a suitable node and no node switch is required.

          Imagine this scenario with a 100 jobs with around 20 paralllel stages each, the builds grind to a halt. This should be more scalable.
          New: We have some labels assigned to various nodes and we run certain things in a relatively complex build process involving a shared Jenkins library. There it happens quite often that the pipeline has multiple nested 'node' steps running with exactly the same labels.
          {code:java}
          node('mylabel') {
             for (int i = 0; i < 1000; i++) {
                node('mylabel') {
                   sleep(10)
                }
             }
          }
          {code}
          Jenkins ends up switching the node all the time, causing quite a bit of lock contention on the Queue processing. In this case the node step should have some kind of a mechanism to know that it is already on a suitable node and no node switch is required.

          Imagine this scenario with a 100 jobs with around 20 parallel stages each, the builds grind to a halt. This should be more scalable.

            Unassigned Unassigned
            gl1koz3 Edgars Batna
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: