Jenkins executor busy - job with loading bar 但没有 link 或 id - ghost job

Jenkins executor busy - job with loading bar but no link or id - ghost job

Jenkins 重启后,我们发现执行程序繁忙的节点很少。占用执行者的工作有条纹白色蓝色加载条并且没有 link 到任何特定的 build(实际上没有 build 正在进行该工作)。所以我们没有 id 或 ui 方法来中止它,你可以在这里看到它:

How the job looks on jenkins node

现在,我想找到一种方法来杀死它,而无需真正调查问题的原因,也许它与 有关 - 但在我们的例子中,我们没有基本的完成工作。 我们试图通过以下方式杀死它:

None 上面的工作,幽灵工作仍然存在。任何线索如何杀死这样的工作或至少在没有 id 的情况下指向它?

编辑:我发现类似的帖子 How to stop an unstoppable zombie job on Jenkins without restarting the server? 有很多答案,但不同的解决方案对我不起作用

好的,所以我找到了一种通过在 Jenkins Script Console 上执行的 groovy 脚本释放这些执行程序的方法。

我设法杀死它的方法 是通过标签获取节点作为 Computer,遍历执行器(或者更确切地说,调用唯一的一个 ;))和调用中断()

def busyExecutors = Jenkins.instance.getNode("myNode").toComputer()
 
println "Busy Executors list"

println busyExecutors;
println busyExecutors.getExecutors().get(0)
println busyExecutors.getExecutors().get(0).interrupt() 

这是我的 result 脚本。重要的部分当然是中断,上面的其他打印仅供参考。