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

前端 未结 27 1604
南旧
南旧 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:26

    Alexandru Bantiuc's answer worked well for me to stop the build, but my executors were still showing up as busy. I was able clear the busy executor status using the following

    server_name_pattern = /your-servers-[1-5]/
    jenkins.model.Jenkins.instance.getComputers().each { computer ->
      if (computer.getName().find(server_name_pattern)) {
        println computer.getName()
        execList = computer.getExecutors()      
        for( exec in execList ) {
          busyState = exec.isBusy() ? ' busy' : ' idle'
          println '--' + exec.getDisplayName() + busyState
          if (exec.isBusy()) {
            exec.interrupt()
          }
        }
      }
    }
    

提交回复
热议问题