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

Hard killed job's stage blocks stage in following jobs

    XMLWordPrintable

Details

    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

            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.

            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 .
            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.

            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 .
            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)
            
            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)
            jgrant216 Jeff G added a comment -

            sag47, 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.

            jgrant216 Jeff G added a comment - sag47 , 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.
            sag47 Sam Gleske added a comment -

            jgrant216, 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

            sag47 Sam Gleske added a comment - jgrant216 , 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

            People

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

              Dates

                Created:
                Updated:
                Resolved: