将 Jenkins 更新到版本 2.156(从版本 1.6)后,我们的一些构建作业在完成后和进行构建后操作之前会陷入困境。作业本身会在 5 分钟内完成(与之前相同),然后挂起 5-10 分钟,然后再继续。
我设法将其范围缩小到:
"Executor #10 for master : executing 03_masa #4390" Id=34464 Group=main TIMED_WAITING
at java.lang.Thread.sleep(Native Method)
at hudson.util.ProcessTree$WindowsOSProcess.killSoftly(ProcessTree.java:560)
at hudson.util.ProcessTree$WindowsOSProcess.killRecursively(ProcessTree.java:520)
at hudson.util.ProcessTree$Windows.killAll(ProcessTree.java:666)
at hudson.Launcher$LocalLauncher.kill(Launcher.java:955)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:510)
at hudson.model.Run.execute(Run.java:1810)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
参考代码可以找到here https://github.com/jenkinsci/jenkins/blob/jenkins-2.156/core/src/main/java/hudson/util/ProcessTree.java#L560(自版本 2.141 以来存在)。
线程转储 #1 https://hastebin.com/votipirotu.rb, 线程转储 #2 https://hastebin.com/ubiqarowem.rb
我们能做点什么吗?
2.141 引入了 2 分钟的进程终止等待时间(看起来与构建期间创建的进程数成倍增加)
https://github.com/jenkinsci/jenkins/commit/d8eac92ee9a1c19bf145763589f1c152607bf3ed https://github.com/jenkinsci/jenkins/commit/d8eac92ee9a1c19bf145763589f1c152607bf3ed
不确定为什么killSoftly不起作用,但你可以配置超时
在你的 jenkins.xml 中你可以将其添加到你的/service/arguments
元素(在 -jar 之前)如下所示:
-DSoftKillWaitSeconds=0
执行此操作并重新启动 jenkins 后,您应该能够在下面找到您的 SoftKillWaitSeconds 设置/systemInfo
并且您的构建时间应该恢复正常
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)