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

Join plugin 1.9 does not work with downstream matrix projects

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • join-plugin
    • None
    • Ubuntu (2.6.32-24-server)
      Hudson 1.377
      Join 1.9

      After upgrading the Join plugin to 1.9, it does not work if one of the downstream tasks is a matrix job. This is true for the basic join functionality, as well as the 'Run post-build actions at join -> Trigger parameterized build on other projects' functionality. Downgrading the plugin to 1.8 fixes this problem (of course, 'Run post-build actions at join' is broken with 1.8).

      Here's a simplified repro, where the 'downstream tasks' consists of a single matrix job:

      • Create Job_A (free-style). Make it call Job_B with 'trigger parametrized build', and set up some dummy pre-defined parameters to send to Job_B. Also make it call Job_C as the 'join' job, in the 'Projects to build once, after all downstream projects have finished' field
      • Create Job_B (matrix), give it some axis and values
      • Create Job_C (free-style)

      With that configuration, if I run Job_A, Job_B will run, but Job_C will not run. I have tested this with a mix of freestyle and matrix downstream jobs, with the same results - all the downstream jobs run, but the 'join job' does not run. I see the same behavior if I put Job_C into the Run post-build actions at join -> Trigger parameterized build on other projects' field instead of the 'Projects to build once, after all downstream projects have finished' field.

      If I downgrade the Join plugin to 1.8, this test works.

          [JENKINS-7521] Join plugin 1.9 does not work with downstream matrix projects

          Stefan Wolf added a comment -

          I understand why it doesn't work. As a workaround, just add for example an empty (=no projects to trigger) parameterized trigger to the matrix build. As a consequence the join trigger will be triggered.
          I will further investigate the problem to find a solution. The problem is that the matrix build does not trigger downstream builds via the dependency graph, whereas the freestyle-build does. But the parameterized trigger and the regular build trigger add an aggregator to the matrix build which triggers the dependencies. If no trigger is added, then no dependency gets triggered.

          Stefan Wolf added a comment - I understand why it doesn't work. As a workaround, just add for example an empty (=no projects to trigger) parameterized trigger to the matrix build. As a consequence the join trigger will be triggered. I will further investigate the problem to find a solution. The problem is that the matrix build does not trigger downstream builds via the dependency graph, whereas the freestyle-build does. But the parameterized trigger and the regular build trigger add an aggregator to the matrix build which triggers the dependencies. If no trigger is added, then no dependency gets triggered.

          SauravSengupta added a comment -

          Thanks for the information. I'd like to make sure I understand you correctly. My 'main' job has a list of downstream jobs (matrix and freestyle) that are triggered with parameters, and then a 'final' job that's called through the join plugin. What you're saying is, in each of the downstream matrix jobs, I should add an empty parametrized trigger entry? So it would look like each matrix job was calling a further downstream job, which had no parameters?

          Another question. I rely on the join plugin not firing if one of the downstream jobs fails. Will this workaround convey failure information from the matrix job back up to the join plugin? In other words, if one of the matrix job configurations fails, and that's the only failure, will the join plugin still fire?

          The problem is that the matrix build does not trigger downstream builds via the dependency graph, whereas the freestyle-build does.

          I think that explains some other behavior I've seen. I may be remembering this wrong, but I think I had a setup as follows:

          • Job A (freestyle)
            • Job B (freestyle)
              • Job C (matrix)
            • Job D (called through join)

          I would expect that Job A would run, then Job B would run, then all the configurations of Job C would run, and then finally Job D would run. However, as far as I remember, Job D gets triggered as soon as Job C finishes the initial work and forks off all the matrix configurations. If I understand you right, this would probably be another manifestation of the same issue?

          SauravSengupta added a comment - Thanks for the information. I'd like to make sure I understand you correctly. My 'main' job has a list of downstream jobs (matrix and freestyle) that are triggered with parameters, and then a 'final' job that's called through the join plugin. What you're saying is, in each of the downstream matrix jobs, I should add an empty parametrized trigger entry? So it would look like each matrix job was calling a further downstream job, which had no parameters? Another question. I rely on the join plugin not firing if one of the downstream jobs fails. Will this workaround convey failure information from the matrix job back up to the join plugin? In other words, if one of the matrix job configurations fails, and that's the only failure, will the join plugin still fire? The problem is that the matrix build does not trigger downstream builds via the dependency graph, whereas the freestyle-build does. I think that explains some other behavior I've seen. I may be remembering this wrong, but I think I had a setup as follows: Job A (freestyle) Job B (freestyle) Job C (matrix) Job D (called through join) I would expect that Job A would run, then Job B would run, then all the configurations of Job C would run, and then finally Job D would run. However, as far as I remember, Job D gets triggered as soon as Job C finishes the initial work and forks off all the matrix configurations. If I understand you right, this would probably be another manifestation of the same issue?

          Stefan Wolf added a comment - - edited

          By adding an empty parameterized trigger to the matrix project I mean the configuration as shown in the screenshot. And yes, you have to add this to every downstream (from the main project) matrix-project.
          By the way: this issue will only happen if the matrix build is the last project built. If it is any other freestyle project, then the join trigger will also work normally.

          For the triggering when one of the matrix jobs fails: If one of the matrix sub-jobs fail, then the whole matrix build is marked as failed? If this is the case, then conditionally triggering will still work.

          I cannot reproduce the other issue you have: For me, the join project is always built after all of the matrix build finishes.

          Stefan Wolf added a comment - - edited By adding an empty parameterized trigger to the matrix project I mean the configuration as shown in the screenshot. And yes, you have to add this to every downstream (from the main project) matrix-project. By the way: this issue will only happen if the matrix build is the last project built. If it is any other freestyle project, then the join trigger will also work normally. For the triggering when one of the matrix jobs fails: If one of the matrix sub-jobs fail, then the whole matrix build is marked as failed? If this is the case, then conditionally triggering will still work. I cannot reproduce the other issue you have: For me, the join project is always built after all of the matrix build finishes.

          Stefan Wolf added a comment -

          The patch attached to JENKINS-6274 fixes this problem.

          Stefan Wolf added a comment - The patch attached to JENKINS-6274 fixes this problem.

          Stefan Wolf added a comment - - edited

          Resolved by fixing JENKINS-6274. Should would with Hudson >= 1.386

          Stefan Wolf added a comment - - edited Resolved by fixing JENKINS-6274 . Should would with Hudson >= 1.386

            wolfs Stefan Wolf
            sauravsengupta sauravsengupta
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: