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

parallel([:]) hangs forever

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • pipeline
    • None

      Hi,

      The following workflow will just hang forever:

      node {
        parallel([:])
      }
      

      Log:

      Started by user anonymous
      Running: Allocate node : Start
      Running on master in /home/ehencae/src/workflow-plugin/aggregator/work/jobs/test1/workspace@2
      Running: Allocate node : Body : Start
      Running: Execute sub-workflows in parallel : Start
      Aborted by anonymous
      Aborted by anonymous
      Aborted by anonymous
      Resuming build
      

      After that it is not possible to abort it, not even by restart. The workaround in JENKINS-25550 did the trick. Parallel should not just hang when executed with a empty map. Even though it's easy to workaround in the flow so that it isn't called for empty maps.

      Possible to recreate in:

      org.jenkinsci.plugins.workflow.steps.parallel.ParallelStepTest
          @Test
          public void parallelEmptyMap() {
              story.addStep(new Statement() {
                  @Override public void evaluate() throws Throwable {
                      p = jenkins().createProject(WorkflowJob.class, "demo");
                      p.setDefinition(new CpsFlowDefinition(join(
                              "node {\n" +
                                      "    parallel([:])\n" +
                                      "}\n"
                      )));
      
                      startBuilding().get();
                      assertBuildCompletedSuccessfully();
                  }
              });
          }
      

      Log:

      ...
      === Starting parallelEmptyMap(org.jenkinsci.plugins.workflow.steps.parallel.ParallelStepTest)
      [demo #1] Started
      [demo #1] Running: Allocate node : Start
      [demo #1] Running on master in /tmp/junit1594929993299071723/junit5524096835654718071/workspace/demo
      [demo #1] Running: Allocate node : Body : Start
      [demo #1] Running: Execute sub-workflows in parallel : Start
      

            jglick Jesse Glick
            henrikcaesar Henrik Caesar
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: