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

Using "Conditional build step" and "Parameterized build step" in same step is preventing parallel executions of same job

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Job A triggers a variable number of job B depending on a environment variable. It can be zero but since "Counter Parameter Factory" doesnt allow zero repetitions (Java exception) I had to include this step as a conditional build step. Job A must wait until the end of all B jobs so option "Block until the triggered projects finish their builds" is selected (because it is really a diamond execution).

      This jobs configuration works fine but if you launch another A (in parallel) when it finish its first step and reach conditional step, it get stuck waiting until the end of all the jobs from first execution, once first A execution finished second execution continue executing its B jobs.

      This is a kind of interlocking process between executions.

        Attachments

          Activity

          Hide
          jacojm Jacobo Jimenez added a comment -

          I have attached an example project with this problem, executable job is "QueueInterlockTest_main". To test this problem you must launch two executions of this job (in parallel), you will notice how second execution do not trigger "QueueInterlockTest_subtask" until first execution is finished.

          Show
          jacojm Jacobo Jimenez added a comment - I have attached an example project with this problem, executable job is "QueueInterlockTest_main". To test this problem you must launch two executions of this job (in parallel), you will notice how second execution do not trigger "QueueInterlockTest_subtask" until first execution is finished.
          Hide
          abespaly Alexey Bespaly added a comment -

          We are experiencing the same problem in our automated regression test system built on Jenkins and are looking for a solution for this one to be able to parallelize our job execution. Is there anything I could help in terms of diagnosing the issue? The description from Jacobo looks exhaustive, though...

          Show
          abespaly Alexey Bespaly added a comment - We are experiencing the same problem in our automated regression test system built on Jenkins and are looking for a solution for this one to be able to parallelize our job execution. Is there anything I could help in terms of diagnosing the issue? The description from Jacobo looks exhaustive, though...
          Hide
          kevinc Kevin Chiu added a comment - - edited

          Same issue here. This is also a very common case when commonly used step is created for workflows in which multiple instants of job will be executed on the same node.

          Show
          kevinc Kevin Chiu added a comment - - edited Same issue here. This is also a very common case when commonly used step is created for workflows in which multiple instants of job will be executed on the same node.
          Hide
          advantiss Peter S added a comment -

          I've got this problem too, but with wrapped "execute nant target" build step inside conditional section.
          The steps to reproduce issue is next

          • Install node-label plugin, which allows to target build executon on some exact node.
          • Create job, configure single conditional step with wrapped long executable task(groovy script while(true){} fits maybe).
          • Allow concurrent builds for this job.
          • Make job parametrized, configure node-label parameter, with allowed two nodes to run this job
          • Run job on first node, after that run job on another node.
          • Console Output shows that second run hangs execution before conditional step
          Show
          advantiss Peter S added a comment - I've got this problem too, but with wrapped "execute nant target" build step inside conditional section. The steps to reproduce issue is next Install node-label plugin, which allows to target build executon on some exact node. Create job, configure single conditional step with wrapped long executable task(groovy script while(true){} fits maybe). Allow concurrent builds for this job. Make job parametrized, configure node-label parameter, with allowed two nodes to run this job Run job on first node, after that run job on another node. Console Output shows that second run hangs execution before conditional step
          Hide
          kevinc Kevin Chiu added a comment - - edited

          Turns out the blocking I encountered is due to the post-build steps of a concurrent tasks. It seems to be a more general one on plugins that do artifcats copy/upload:

          JENKINS-10234

          Before we are using copy artifacts back to master, now have changed to use the Publish over SSH plugin instead. Tested concurrent build couple of times and issue gone.

          Show
          kevinc Kevin Chiu added a comment - - edited Turns out the blocking I encountered is due to the post-build steps of a concurrent tasks. It seems to be a more general one on plugins that do artifcats copy/upload: JENKINS-10234 Before we are using copy artifacts back to master, now have changed to use the Publish over SSH plugin instead. Tested concurrent build couple of times and issue gone.
          Show
          advantiss Peter S added a comment - You can try my fix https://github.com/jenkinsci/conditional-buildstep-plugin/pull/7
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: advantiss
          Path:
          src/main/java/org/jenkinsci/plugins/conditionalbuildstep/singlestep/SingleConditionalBuilder.java
          http://jenkins-ci.org/commit/conditional-buildstep-plugin/96a6b5e0f4de783bfd1f264852397d270268a977
          Log:
          [Fixed JENKINS-13871] respects wrapped build step

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: advantiss Path: src/main/java/org/jenkinsci/plugins/conditionalbuildstep/singlestep/SingleConditionalBuilder.java http://jenkins-ci.org/commit/conditional-buildstep-plugin/96a6b5e0f4de783bfd1f264852397d270268a977 Log: [Fixed JENKINS-13871] respects wrapped build step
          Hide
          domi Dominik Bartholdi added a comment -

          fixed with 1.2.1

          Show
          domi Dominik Bartholdi added a comment - fixed with 1.2.1

            People

            • Assignee:
              domi Dominik Bartholdi
              Reporter:
              jacojm Jacobo Jimenez
            • Votes:
              2 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: