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

Multiple parameterized upstreams with joined in one "blocked while.." job result in multiple executions rather one only

      Job setup:
      TestRoot - TestP1 - TestJoin
      - TestP2 /

      All of the jobs are configurated with parameterized string parameters in pre job and TestRoot, TestP1 and TestP2 uses "Trigger parameterized build on other projects" with file as input.
      The TestJoin is configurated with "Block while upstreams are build"

      The issue is as follows:
      The Jenkins build-in feature works ok and does not execute while jobs are building upstream, but the big problem is that the parameterized trigger kicks off two job executions(or as many as there are parallel upstream) rather than just one.

      It has been fine one this server when it was original configurated. At some point I moved some upstreams to join in a separated joiner. It seems that changing of configuration triggered the problem. The "funny" thing is that the problem occurs not only on the job I changed configuration but on all using the this setup.

      The test setup mentioned above is created after the problem occured and it still have the problem.

      I have updated the plugin to get the latest release, but it did not help on this problem.

      This is showstopper for me, as I cannot have more than one job execution due to the fact that I need one joined result of my whole "graph" and then continue further actions based on this..
      I have not seen it earlier in my use of the this plugin.

          [JENKINS-14108] Multiple parameterized upstreams with joined in one "blocked while.." job result in multiple executions rather one only

          additional information:
          The plugin/build in feature: "Build other projects" work fine concerning this issue.. Eg it only generate one build after "Block while upstreams..." has released the block.

          Claus Schneider added a comment - additional information: The plugin/build in feature: "Build other projects" work fine concerning this issue.. Eg it only generate one build after "Block while upstreams..." has released the block.

          cjo9900 added a comment -

          Can you add some details on the config so this can be reproduced.

          cjo9900 added a comment - Can you add some details on the config so this can be reproduced.

          cjo9900 added a comment -

          I have talked to Claus on the cause of this issue and found that the behaviour is caused by how the core handled the dependencies.

          The use case was
          Job A param trigger -> Job B1 Param trigger -\
          \> Job B2 Param trigger -> Job C

          and parameters from jobs B1 and B2 passed to Job C are different.

          In older versions before Jenkins ~1.402, job C would be triggered only once so would imitate a join of B1 and B2. After 1.402 Job C would be triggered twice once with the parameters from Job B1 and once with parameters from Job B2 as these are different.

          In this case the join plugin cannot be used as the downstream job C required parameters from B1 and B2, and links upstream started that the join plugin cannot pass.

          Possible solution is to have a special ParameterAction that implements the QueueAction(returning false even if there are existing parameters) and FoldableAction interface allowing parameters to be combined into a single Action and build. Which should then allow this join behaviour to occur.

          However this may cause issues for other plugins wanting to get the ParametersAction.

          cjo9900 added a comment - I have talked to Claus on the cause of this issue and found that the behaviour is caused by how the core handled the dependencies. The use case was Job A param trigger -> Job B1 Param trigger -\ \> Job B2 Param trigger -> Job C and parameters from jobs B1 and B2 passed to Job C are different. In older versions before Jenkins ~1.402, job C would be triggered only once so would imitate a join of B1 and B2. After 1.402 Job C would be triggered twice once with the parameters from Job B1 and once with parameters from Job B2 as these are different. In this case the join plugin cannot be used as the downstream job C required parameters from B1 and B2, and links upstream started that the join plugin cannot pass. Possible solution is to have a special ParameterAction that implements the QueueAction(returning false even if there are existing parameters) and FoldableAction interface allowing parameters to be combined into a single Action and build. Which should then allow this join behaviour to occur. However this may cause issues for other plugins wanting to get the ParametersAction.

          ikedam added a comment -

          This looks a current designated behavior of Jenkins.
          When triggerd a job with different parameters, Jenkins should trigger builds for each parameters, and shouldn't merge them.

          It's recommended to use Promoted Builds plugin or Join plugin for this scenario.

          Anyway, this issue is very old, and I'm afraid there are no longer users interested in this issue. (And I don't think this is still a blocker.)
          I plan to close this issue with "Won't Fix" in a month.
          Please let me know if anyone still looks this issue.

          ikedam added a comment - This looks a current designated behavior of Jenkins. When triggerd a job with different parameters, Jenkins should trigger builds for each parameters, and shouldn't merge them. It's recommended to use Promoted Builds plugin or Join plugin for this scenario. Anyway, this issue is very old, and I'm afraid there are no longer users interested in this issue. (And I don't think this is still a blocker.) I plan to close this issue with "Won't Fix" in a month. Please let me know if anyone still looks this issue.

          ikedam added a comment -

          It's the current designated behavior of Jenkins.

          ikedam added a comment - It's the current designated behavior of Jenkins.

          Daniel Beck added a comment -

          One possible solution would be checking out the orchestration plugins, e.g. Build Flow, Workflow (still in development), ... but that's something to discuss on the jenkinsci-users list, and not in Jira.

          Daniel Beck added a comment - One possible solution would be checking out the orchestration plugins, e.g. Build Flow, Workflow (still in development), ... but that's something to discuss on the jenkinsci-users list, and not in Jira.

            huybrechts huybrechts
            bic_schneider Claus Schneider
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: