詹金斯(Jenkins)在构建和构建后之间徘徊 [英] Jenkins hangs between build and post-build

查看:161
本文介绍了詹金斯(Jenkins)在构建和构建后之间徘徊的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在将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)

可以找到参考代码此处(自2.141版本开始存在).

threadDump#1 解决方案

2.141引入了2分钟的进程终止等待时间(似乎与构建期间创建的进程数量一样多)

https://github.com/jenkinsci/jenkins/commit/d8eac92ee9a1c19bf145763> /p>

不确定为什么killSoftly不起作用,但是您可以配置超时时间

可以在jenkins.xml中将其添加到/service/arguments元素中(在-jar之前),如下所示:

-DSoftKillWaitSeconds=0

这样做并重新启动jenkins之后,您应该能够在/systemInfo

下找到您的SoftKillWaitSeconds设置.

您的构建时间应该恢复正常

After updating Jenkins to version 2.156 (from version 1.6), some of our build jobs get stuck after completing and before moving to post-build action. Job itself is finished within 5 minutes (same as before), then it hangs for 5-10 minutes before moving on.

I managed to narrow it down to this:

"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)

Referenced code can be found here (present since version 2.141).

threadDump #1, threadDump #2

Can we do something about it?

解决方案

2.141 introduced a 2min wait on process termination (it would seem that multiplies with as many processes as were created during your build)

https://github.com/jenkinsci/jenkins/commit/d8eac92ee9a1c19bf145763589f1c152607bf3ed

unsure why killSoftly does not work but you can configure the timeout

In your jenkins.xml you can add this to your /service/arguments element (before the -jar) like so:

-DSoftKillWaitSeconds=0

After doing so and restarting jenkins you should be able to find your SoftKillWaitSeconds setting under /systemInfo

and your build time should be back to normal

这篇关于詹金斯(Jenkins)在构建和构建后之间徘徊的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆