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

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • amazon-ecs-plugin
    • None
    • amazon-ecs plugin version 1.16
    • v1.18

      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.

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

              Created:
              Updated:
              Resolved: