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

Triggering the same job twice results in zombie workflow run

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Critical
    • Resolution: Fixed
    • pipeline
    • None
    • Jenkins ver. 1.610
      workflow-plugin 1.5

    Description

      When two workflow jobs try to trigger the same job at the same time, java.hudson.model.Queue#scheduleInternal may detect a duplicate.

      When that happens, a second instance of WaitingItem does not get created, meaning one of the workflow runs will have no listeners related to the triggered job.

      When the triggered job ends, only one workflow run will be notified and continue, the other one will stay listening forever.

      The workaround I've had to apply to deal with this is running the following in scriptler:

      Jenkins.instance.getItemByFullName(jobName)
      .builds.findAll

      {it.building}

      .each{it.execution.currentExecutions.get()
      .each

      {it.context.onFailure(new Exception())}

      }

      Attachments

        Issue Links

          Activity

            jglick Jesse Glick added a comment -

            I have heard mention of this but was not sure if it was reproducible. Definitely looks like a bug.

            In the meantime, JENKINS-25550 may offer an easier workaround to kill off the zombie builds.

            jglick Jesse Glick added a comment - I have heard mention of this but was not sure if it was reproducible. Definitely looks like a bug. In the meantime, JENKINS-25550 may offer an easier workaround to kill off the zombie builds.

            Code changed in jenkins
            User: Jesse Glick
            Path:
            CHANGES.md
            aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/build/BuildTriggerStepTest.java
            support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildQueueListener.java
            support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerAction.java
            support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerListener.java
            support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStepExecution.java
            http://jenkins-ci.org/commit/workflow-plugin/90f9e44d498e167d6ab7fd3ef744ac0980ea65ae
            Log:
            [FIXED JENKINS-28063] BuildTriggerAction must implement FoldableAction and multiple instances checked.
            Otherwise any redundant upstream builds never receive notification of the downstream build’s completion, and hang.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: CHANGES.md aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/build/BuildTriggerStepTest.java support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildQueueListener.java support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerAction.java support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerListener.java support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStepExecution.java http://jenkins-ci.org/commit/workflow-plugin/90f9e44d498e167d6ab7fd3ef744ac0980ea65ae Log: [FIXED JENKINS-28063] BuildTriggerAction must implement FoldableAction and multiple instances checked. Otherwise any redundant upstream builds never receive notification of the downstream build’s completion, and hang.

            Code changed in jenkins
            User: Jesse Glick
            Path:
            CHANGES.md
            aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/build/BuildTriggerStepTest.java
            support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildQueueListener.java
            support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerAction.java
            support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerListener.java
            support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStepExecution.java
            http://jenkins-ci.org/commit/workflow-plugin/1c8d22ab0ee7471d0ceb56b03070579d873bf9b8
            Log:
            Merge pull request #121 from jglick/coalesced-build-JENKINS-28063

            JENKINS-28063 Handle redundant upstream builds

            Compare: https://github.com/jenkinsci/workflow-plugin/compare/408efbcfbc2f...1c8d22ab0ee7

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: CHANGES.md aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/build/BuildTriggerStepTest.java support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildQueueListener.java support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerAction.java support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerListener.java support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStepExecution.java http://jenkins-ci.org/commit/workflow-plugin/1c8d22ab0ee7471d0ceb56b03070579d873bf9b8 Log: Merge pull request #121 from jglick/coalesced-build- JENKINS-28063 JENKINS-28063 Handle redundant upstream builds Compare: https://github.com/jenkinsci/workflow-plugin/compare/408efbcfbc2f...1c8d22ab0ee7

            Code changed in jenkins
            User: Jesse Glick
            Path:
            aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/build/BuildTriggerStepTest.java
            support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildQueueListener.java
            support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerAction.java
            support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerListener.java
            support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStepExecution.java
            http://jenkins-ci.org/commit/pipeline-build-step-plugin/4693412e578233dded9cfc93f3a56d1660899771
            Log:
            [FIXED JENKINS-28063] BuildTriggerAction must implement FoldableAction and multiple instances checked.
            Otherwise any redundant upstream builds never receive notification of the downstream build’s completion, and hang.
            Originally-Committed-As: 90f9e44d498e167d6ab7fd3ef744ac0980ea65ae

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/build/BuildTriggerStepTest.java support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildQueueListener.java support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerAction.java support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerListener.java support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStepExecution.java http://jenkins-ci.org/commit/pipeline-build-step-plugin/4693412e578233dded9cfc93f3a56d1660899771 Log: [FIXED JENKINS-28063] BuildTriggerAction must implement FoldableAction and multiple instances checked. Otherwise any redundant upstream builds never receive notification of the downstream build’s completion, and hang. Originally-Committed-As: 90f9e44d498e167d6ab7fd3ef744ac0980ea65ae

            People

              jglick Jesse Glick
              micpiekar Michal Piekarczyk
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: