How to stop an unstoppable zombie job on Jenkins without restarting the server?

前端 未结 27 1616
南旧
南旧 2020-11-27 09:18

Our Jenkins server has a job that has been running for three days, but is not doing anything. Clicking the little X in the corner does nothing, and the console output log do

27条回答
  •  余生分开走
    2020-11-27 09:27

    The first proposed solution is pretty close. If you use stop() instead of interrupt() it even kills runaway threads, that run endlessly in a groovy system script. This will kill any build, that runs for a job. Here is the code:

    Thread.getAllStackTraces().keySet().each() {
        if (it.name.contains('YOUR JOBNAME')) {  
          println "Stopping $it.name"
          it.stop()
        }
    }
    

提交回复
热议问题