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

Multijob runs one parameterized child job instead of running multiple child jobs with different parameters

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • multijob-plugin
    • None
    • Jenkins 2.7.4
      Multijob plugin 1.22
      Environment Injector Plugin 1.92.1
      Matrix Project Plugin 1.7.1
      Parameterized Trigger plugin 2.32
      Token Macro Plugin 2.0
      Conditional BuildStep 1.3.5
      Maven Integration plugin 2.13

      Precondition

      Job name Input parameters Child jobs Input parameters of child jobs
      A a B, C a=$a
      B a D a=$a, b=1
      C a D a=$a, b=2
      D a, b    

      See jobs B,C in attachment.

      Steps

      1. Run A

      Expected result

      Job D runs twice. Each run with different parameters.

      Actual result

      Job D runs once. In the log of job D something like the following:

      Started by upstream project "B" build number 80
      originally caused by:
       Started by upstream project "A" build number 7
         originally caused by:
          Started by user user
      Started by upstream project "C" build number 80
      originally caused by:
       Started by upstream project "A" build number 7
         originally caused by:
          Started by user user
      

      Additional info

      Statistics example: 11 runs of job D instead of expected 40.

        1. ~X-config.xml
          7 kB
        2. ~X1-to-X5-config.xml
          3 kB
        3. ~worker-config.xml
          2 kB
        4. job-builds-merged.png
          job-builds-merged.png
          34 kB
        5. multijob-structure.png
          multijob-structure.png
          23 kB
        6. MultijobBC.png
          MultijobBC.png
          85 kB

          [JENKINS-38850] Multijob runs one parameterized child job instead of running multiple child jobs with different parameters

          Dmitrii Shiriaev created issue -
          Dmitrii Shiriaev made changes -
          Description Original: h4. Precondition

          ||Job name||Input parameters||Child jobs||Input parameters of child jobs||
          |A|a|B, C|a=$a|
          |B|a|D|a=$a, b=1|
          |C|a|D|a=$a, b=2|
          |D|a, b| | |

          See jobs B,C in attachment.

          h4. Steps
          # Run A

          h4. Expected result
          Job D runs twice. Each run with different parameters.

          h4. Actual result
          Job D runs once. In the log of job D something like the following:
          {noformat}
          Started by upstream project "B" build number 80
          originally caused by:
           Started by upstream project "A" build number 7
             originally caused by:
              Started by user user
          Started by upstream project "C" build number 80
          originally caused by:
           Started by upstream project "A" build number 7
             originally caused by:
              Started by user user
          {noformat}
          New: h4. Precondition

          ||Job name||Input parameters||Child jobs||Input parameters of child jobs||
          |A|a|B, C|a=$a|
          |B|a|D|a=$a, b=1|
          |C|a|D|a=$a, b=2|
          |D|a, b| | |

          See jobs B,C in attachment.

          h4. Steps
          # Run A

          h4. Expected result
          Job D runs twice. Each run with different parameters.

          h4. Actual result
          Job D runs once. In the log of job D something like the following:
          {noformat}
          Started by upstream project "B" build number 80
          originally caused by:
           Started by upstream project "A" build number 7
             originally caused by:
              Started by user user
          Started by upstream project "C" build number 80
          originally caused by:
           Started by upstream project "A" build number 7
             originally caused by:
              Started by user user
          {noformat}

          h4. Additional info
          Statistics example: 11 runs of job D instead of expected 40.
          Dmitrii Shiriaev made changes -
          Summary Original: Sometimes multijob runs one parameterized child job instead of running multiple child jobs with different parameters New: Multijob runs one parameterized child job instead of running multiple child jobs with different parameters

          Joan Roch added a comment - - edited

          Running into the exact same problem here:

          • Jenkins 1.650
          • Multijob plugin 1.23

          The problem occurs only when the upstream builds share the same build number.

          Using the example provided by dshiryaev_plesk, here is what happens:

          Precondition

          Job name Next Build Number Input parameters Child jobs Input parameters of child jobs
          A i a B, C a=$a
          B j a D a=$a, b=1
          C j a D a=$a, b=2
          D k a, b    

          Note that B and C share the same build number. If they do not, the problem does not occur as D is launched twice, as expected.

          See jobs B,C in attachment.

          Steps

          1. Run A

          Expected result

          Job D runs twice. Each run with different parameters.

          Actual result

          Job D runs once. In the log of job D something like the following:

          Started by upstream project "B" build number j
          originally caused by:
           Started by upstream project "A" build number i
             originally caused by:
              Started by user user
          Started by upstream project "C" build number j
          originally caused by:
           Started by upstream project "A" build number i
             originally caused by:
              Started by user user
          

          Joan Roch added a comment - - edited Running into the exact same problem here: Jenkins 1.650 Multijob plugin 1.23 The problem occurs only when the upstream builds share the same build number. Using the example provided by dshiryaev_plesk , here is what happens: Precondition Job name Next Build Number Input parameters Child jobs Input parameters of child jobs A i a B, C a=$a B j a D a=$a, b=1 C j a D a=$a, b=2 D k a, b     Note that B and C share the same build number. If they do not, the problem does not occur as D is launched twice, as expected. See jobs B,C in attachment. Steps Run A Expected result Job D runs twice. Each run with different parameters. Actual result Job D runs once. In the log of job D something like the following: Started by upstream project "B" build number j originally caused by: Started by upstream project "A" build number i originally caused by: Started by user user Started by upstream project "C" build number j originally caused by: Started by upstream project "A" build number i originally caused by: Started by user user
          Victor Ott made changes -
          Attachment New: multijob-structure.png [ 35291 ]
          Victor Ott made changes -
          Attachment New: job-builds-merged.png [ 35292 ]
          Victor Ott made changes -
          Attachment New: ~worker-config.xml [ 35293 ]
          Victor Ott made changes -
          Attachment New: ~X1-to-X5-config.xml [ 35294 ]
          Victor Ott made changes -
          Attachment New: ~X-config.xml [ 35295 ]

          Victor Ott added a comment - - edited

          I'm "glad" someone else experienced this too...

          Configuration:

          • Jenkins 2.19.4
          • Multijob Plugin 1.21
          • EnvInject Plugin 1.93.1
          • Token Macro Plugin 2.0
          • Parameterized Trigger Plugin 2.32

          Six weeks ago we updated some plugins, including Multijob Plugin 1.21 => 1.23. Since then we started missing job builds.
          Today I rolled back only the Multijob Plugin 1.23 => 1.21, and the issue dissapeared.

          I've assembled some test jobs and have let them run extensively, with following structure

          where the ~worker job can run in parallel.

          The ~X1 .. ~X5 jobs invoke the ~worker job with different parameters, that's 100% sure (see attached XML job configuration files).

          With Multijob Plugin 1.23 some (up to all) ~worker invocations are merged, and the resulting build receives the parameters of one of the merged invocations, here an example:

          As joanroch already noted, the problem occurs only if the build number (ID) of the upstream jobs ~X1 .. ~X5 is the same. If you start one of the upstream jobs few times separately, thus increasing its "next build number" to a number != to the other build numbers, that upstream job will reliably invoke the downstream job.

          Victor Ott added a comment - - edited I'm "glad" someone else experienced this too... Configuration: Jenkins 2.19.4 Multijob Plugin 1.21 EnvInject Plugin 1.93.1 Token Macro Plugin 2.0 Parameterized Trigger Plugin 2.32 Six weeks ago we updated some plugins, including Multijob Plugin 1.21 => 1.23. Since then we started missing job builds. Today I rolled back only the Multijob Plugin 1.23 => 1.21, and the issue dissapeared. I've assembled some test jobs and have let them run extensively, with following structure where the ~worker job can run in parallel. The ~X1 .. ~X5 jobs invoke the ~worker job with different parameters, that's 100% sure (see attached XML job configuration files). With Multijob Plugin 1.23 some (up to all) ~worker invocations are merged, and the resulting build receives the parameters of one of the merged invocations, here an example: As joanroch already noted, the problem occurs only if the build number (ID) of the upstream jobs ~X1 .. ~X5 is the same. If you start one of the upstream jobs few times separately, thus increasing its "next build number" to a number != to the other build numbers, that upstream job will reliably invoke the downstream job.

            oleg_nenashev Oleg Nenashev
            dshiryaev_plesk Dmitrii Shiriaev
            Votes:
            4 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: