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

Canceling a Parallel step make the build hang

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Duplicate
    • Component/s: pipeline
    • Labels:
      None
    • Environment:
      Jenkins 1.642.18.1
      Pipeline 2.1
    • Similar Issues:

      Description

      Issue

      Building a pipeline job with parallel steps, whenever I cancel a parallel step that waits in the Build Queue, the corresponding job hangs.

      Reproduce

      • I have a node label osx-master that contains 2 nodes
      • Each node has one executor
      • I create a pipeline script like the following
          def branches = [:] 
          branches["one"] = { 
              node('osx-master'){ 
                  echo "branch 1: here is something that happens in stage one" 
                  sh "sleep 10" 
              } 
          } 
          branches["two"] = { 
              node('osx-master'){ 
                  echo "branch 2: here is something that happens in stage one" 
                  sh "sleep 10" 
              } 
          } 
          parallel branches 
          echo "Done with build" 
      
      • I run 2 builds concurrently - for example #15 and #16
      • #15 tasks are immediately picked up from the build queue and are executed
      • #16 tasks shows up in the Build Queue
      • I cancel one of #16 tasks from the Build Queue. It disappears
      • #15 end with SUCCESS
      • #16 never ends and hangs...

      Attached logs of:

      • Queue-Executors.log: `hudson.model.Queue` and `hudson.model.Executors`
      • Pipeline.log: `org.jenkinsci.plugins.workflow.flow`, `org.jenkinsci.plugins.workflow.job` and `org.jenkinsci.plugins.workflow.support`

        Attachments

        1. build-console-logs.png
          build-console-logs.png
          69 kB
        2. build-history.png
          build-history.png
          12 kB
        3. build-queue.png
          build-queue.png
          26 kB
        4. build-steps.png
          build-steps.png
          127 kB
        5. build-thread-dump.png
          build-thread-dump.png
          31 kB
        6. Pipeline.log
          49 kB
        7. Queue-Executors.log
          117 kB

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            Possibly fixed as part of JENKINS-34281.

            Show
            jglick Jesse Glick added a comment - Possibly fixed as part of JENKINS-34281 .
            Hide
            jglick Jesse Glick added a comment -

            Working with up-to-date plugins:

            Started by user anonymous
            [Pipeline] parallel
            [Pipeline] [one] { (Branch: one)
            [Pipeline] [two] { (Branch: two)
            [Pipeline] [one] node
            [Pipeline] [two] node
            [Pipeline] // node
            [Pipeline] }
            Failed in branch two
            [one] Still waiting to schedule task
            [one] Waiting for next available executor
            [one] Running on master in /space/tmp/JENKINS-35213/jobs/parallel/workspace
            [Pipeline] [one] {
            [Pipeline] [one] echo
            [one] branch 1: here is something that happens in stage one
            [Pipeline] [one] sh
            [one] [workspace] Running shell script
            [one] + sleep 30
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] }
            [Pipeline] // parallel
            [Pipeline] End of Pipeline
            ERROR: Queue task was cancelled
            Finished: FAILURE
            
            Show
            jglick Jesse Glick added a comment - Working with up-to-date plugins: Started by user anonymous [Pipeline] parallel [Pipeline] [one] { (Branch: one) [Pipeline] [two] { (Branch: two) [Pipeline] [one] node [Pipeline] [two] node [Pipeline] // node [Pipeline] } Failed in branch two [one] Still waiting to schedule task [one] Waiting for next available executor [one] Running on master in /space/tmp/JENKINS-35213/jobs/parallel/workspace [Pipeline] [one] { [Pipeline] [one] echo [one] branch 1: here is something that happens in stage one [Pipeline] [one] sh [one] [workspace] Running shell script [one] + sleep 30 [Pipeline] } [Pipeline] // node [Pipeline] } [Pipeline] // parallel [Pipeline] End of Pipeline ERROR: Queue task was cancelled Finished: FAILURE

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                allan_burdajewicz Allan BURDAJEWICZ
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: