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

When using the same label 2+ times in a parallel block, plugin only launches one agent

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • amazon-ecs-plugin
    • None
    • amazon-ecs plugin version 1.16
    • v1.18

    Description

      If you have one agent template with labels defined, and you create a Pipeline job that requests nodes of the same label in a parallel block, only one ECS agent will be launched. As a result, the work is only done serially, rather than in parallel as expected, because only one executor is available. Example Pipeline code:

      def tasks = [:]
      
      tasks["task_1"] = {
        stage ("task_1"){    
          node('mylabel') {  
              sh 'echo foo'
          }
        }
      }
      tasks["task_2"] = {
        stage ("task_2"){    
          node('mylabel') {  
              sh 'echo bar'
          }
        }
      }
      
      parallel tasks
      

      If you run two copies of this job, or any other job that uses the same label, an agent will be launched for each job that is running. And if the parallel block of your Pipeline job refers to two different labels, then two agents will be launched. The issue is only with uses of the same label within the parallel branches.

      Attachments

        Activity

          owenmehegan Owen Mehegan created issue -
          owenmehegan Owen Mehegan made changes -
          Field Original Value New Value
          Assignee Jan Roehrich [ roehrijn2 ] Philipp Garbe [ pgarbe ]
          pgarbe Philipp Garbe made changes -
          Released As v1.18
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]

          People

            pgarbe Philipp Garbe
            owenmehegan Owen Mehegan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: