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

Parameterized builds launched by multijob phases are not properly queued

XMLWordPrintable

      After upgrading to a recent version of the Jenkins 2 core and several different plugins, we discovered a critical defect in the handling of queued parameterized builds that are triggered by multijob phases. I've managed to reduce the use case to this simple example:

       

      Job A:
          Type: Freestyle job
          Quiet time: 30 seconds

          Execute concurrent builds: checked

          This Build is Parameterized -> String Parameter -> Name: MyParam

      Job B:
          Type: multijob

          Add one phase build step with the following config:

              trigger: Job A

              Add Parameter -> Predefined Parameter ->  MyParam=JobB

       

      Job C:
          Type: multijob

          Add one phase build step with the following config:

              trigger: Job A

              Add Parameter -> Predefined Parameter ->  MyParam=JobC

       

      With these 3 jobs configured, manually trigger a build of Job B and Job C back to back. You will see only one instance of Job A ends up in the queue and this build is then associated with both builds of Job B and Job C. This is incorrect behavior because the input parameters are different between the two. I would expect to see 2 builds of Job A to be run - one with MyParam set to JobB and another with MyParam set to JobC.

       

      I probably should mention that I retested this configuration with Job B and Job C of type Freestyle job and using the conventional "trigger parameterized build" publish stage and the behavior was as expected, so this problem has something to do with the way the multijob phases are trigger / queuing builds of parameterized downstream jobs.

       

      Further, I feel the need to point out that in our case we have thousands of jobs on our build farm that leverage this particular combination of plugins to orchestrate our build pipeline, all of which are sharing different downstream jobs in this way, which is why I've set the impact to critical. It completely breaks the behavior of the downstream triggers and any subsequent build phases that depend on the output of those triggered jobs.

       

      Our current configuration:
      Jenkins LTS v2.46.1 

      Parameterized Trigger Plugin v2.33

      Multijob Plugin v1.24

            huybrechts huybrechts
            leedega Kevin Phillips
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: