我们使用 Hudson 作为我们的持续构建环境。出于某种原因,SCM 轮询的线程在一段时间后挂起。我已经对这些设置进行了很多尝试,但似乎没有任何效果。如何解决这个问题,是否有一些脚本可以检测到这种情况以便能够重新启动 hudson ?顺便提一句。重启 hudson 是我们目前解决这个问题的唯一方法。
最佳答案
这类似于 bug 5413 ,这应该从 2010 年末用 HUDSON 5977 解决( hudson 1.380+,或者现在是 Jenkins )。
你在那些帖子里有 some way to kill any thread stuck on the polling step :
very primitive (I'm too lazy to develop something better as this is not very important issue) Groovy script is bellow.
It could happened that it will kill also SCM polling which are not stuck, but we run this script automatically only once a day so it doesn't cause any troubles for us.
You can improve it e.g. by saving ids and names of SCM polling threads, check once again after some time and kill only threads which ids are on the list from previous check.
Thread.getAllStackTraces().keySet().each(){ item ->
if( item.getName().contains("SCM polling") &&
item.getName().contains("waiting for hudson.remoting")){
println "Interrupting thread " + item.getId() item.interrupt()
}
}
关于multithreading - Hudson SCM 轮询线程在轮询时挂起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5754968/