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

Hard killed job's stage blocks stage in following jobs

    Details

    • Similar Issues:

      Description

      Build #480 of my job hung in Stage 'Imaging' and I had to do a hard kill using BUILD_URL/doDelete

      Now all builds of my job hang on:

      Running: Imaging
      Entering stage Imaging
      Waiting for builds [480]

      Restarting Jenkins does not help.

        Attachments

          Issue Links

            Activity

            Hide
            sag47 Sam Gleske added a comment -

            Jeff G, glad it helped. I have other kill-all-*.groovy scripts which make it even easier. Refer to https://github.com/samrocketman/jenkins-script-console-scripts

            Show
            sag47 Sam Gleske added a comment - Jeff G , glad it helped. I have other kill-all-*.groovy scripts which make it even easier. Refer to https://github.com/samrocketman/jenkins-script-console-scripts
            Hide
            jgrant216 Jeff G added a comment -

            Sam Gleske, thank you for that script.

            Latest pipeline plugins on current LTS and I had a pair of multi-branch pipeline jobs stuck between the master and slave assignment.  Even a restart caused the jobs to resume from where they had stalled, but still not continue and still not respond to abort requests (no force kill showed up either).  The script you provided allowed me to kill those and the subsequent builds worked correctly.

            Show
            jgrant216 Jeff G added a comment - Sam Gleske , thank you for that script. Latest pipeline plugins on current LTS and I had a pair of multi-branch pipeline jobs stuck between the master and slave assignment.  Even a restart caused the jobs to resume from where they had stalled, but still not continue and still not respond to abort requests (no force kill showed up either).  The script you provided allowed me to kill those and the subsequent builds worked correctly.
            Hide
            sag47 Sam Gleske added a comment -

            For those who encounter this issue and DON'T want to restart your Jenkins instance. This can be cleaned up via script console.

            import jenkins.model.Jenkins
            import org.jenkinsci.plugins.workflow.job.WorkflowRun
            import org.jenkinsci.plugins.workflow.support.steps.StageStepExecution
            
            jobByFullName = 'folder/job'
            jobBuildNumber = '3'
            
            //kill it
            Jenkins j = Jenkins.instance
            WorkflowRun b = j.getItemByFullName(jobByFullName).getBuild(jobBuildNumber)
            b.doKill()
            StageStepExecution.exit(b)
            
            Show
            sag47 Sam Gleske added a comment - For those who encounter this issue and DON'T want to restart your Jenkins instance. This can be cleaned up via script console. import jenkins.model.Jenkins import org.jenkinsci.plugins.workflow.job.WorkflowRun import org.jenkinsci.plugins.workflow.support.steps.StageStepExecution jobByFullName = 'folder/job' jobBuildNumber = '3' //kill it Jenkins j = Jenkins.instance WorkflowRun b = j.getItemByFullName(jobByFullName).getBuild(jobBuildNumber) b.doKill() StageStepExecution.exit(b)
            Hide
            recampbell Ryan Campbell added a comment -

            As per the discussion above, this issue will not be fixed. The concurrency option of the stage step has been deprecated. Instead, users are advised to use the lock step of the Lockable Resource plugin.

            Show
            recampbell Ryan Campbell added a comment - As per the discussion above, this issue will not be fixed. The concurrency option of the stage step has been deprecated. Instead, users are advised to use the lock step of the Lockable Resource plugin .
            Hide
            abayer Andrew Bayer added a comment -

            Once JENKINS-26107 is released, stage concurrency will be deprecated. So this won't actually get fixed - instead, the recommendation will be to use lockable-resources, which is getting a fix for at least some of this scenario over at JENKINS-36479.

            Show
            abayer Andrew Bayer added a comment - Once JENKINS-26107 is released, stage concurrency will be deprecated. So this won't actually get fixed - instead, the recommendation will be to use lockable-resources , which is getting a fix for at least some of this scenario over at JENKINS-36479 .

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                anshuarya Anshu Arya
              • Votes:
                7 Vote for this issue
                Watchers:
                16 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: