Windows Azure上与Jenkins slave的连接问题

时间:2014-04-28 17:08:02

标签: azure jenkins

我在Windows Azure VM上设置了Jenkins从属节点。在该节点上构建时,项目将平稳运行大约20-30分钟,之后连接将被丢弃。连接被删除后,我一直在节点VM上,看起来它正在丢失/重置与Jenkins Master(也是Azure VM)的连接。有没有人有类似的问题,并能够解决它?堆栈跟踪如下。任何帮助将不胜感激。

  

进展:| =====================致命:hudson.remoting.RequestAbortedException:java.io.IOException:无法中止   hudson.remoting.RequestAbortedException:hudson.remoting.RequestAbortedException:java.io.IOException:无法中止       at hudson.remoting.RequestAbortedException.wrapForRethrow(RequestAbortedException.java:41)       at hudson.remoting.RequestAbortedException.wrapForRethrow(RequestAbortedException.java:34)       在hudson.remoting.Request.call(Request.java:174)       在hudson.remoting.Channel.call(Channel.java:739)       在hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:168)       在com.sun.proxy。$ Proxy49.join(未知来源)       在hudson.Launcher $ RemoteLauncher $ ProcImpl.join(Launcher.java:951)       在hudson.tasks.CommandInterpreter.join(CommandInterpreter.java:137)       在hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:97)       在hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)       在hudson.tasks.BuildStepMonitor $ 1.perform(BuildStepMonitor.java:20)       在   hudson.model.AbstractBuild $ AbstractBuildExecution.perform(AbstractBuild.java:745)       在hudson.model.Build $ BuildExecution.build(Build.java:198)       在hudson.model.Build $ BuildExecution.doRun(Build.java:159)       在hudson.model.AbstractBuild $ AbstractBuildExecution.run(AbstractBuild.java:518)       在hudson.model.Run.execute(Run.java:1709)       在hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)       在hudson.model.ResourceController.execute(ResourceController.java:88)       在hudson.model.Executor.run(Executor.java:231)

     

引起:hudson.remoting.RequestAbortedException:java.io.IOException:无法中止       在hudson.remoting.Request.abort(Request.java:299)       在hudson.remoting.Channel.terminate(Channel.java:802)       在hudson.remoting.Channel $ 2.terminate(Channel.java:483)       在hudson.remoting.AbstractByteArrayCommandTransport $ 1.terminate(AbstractByteArrayCommandTransport.java:72)       在org.jenkinsci.remoting.nio.NioChannelHub $ NioTransport.abort(NioChannelHub.java:184)       在org.jenkinsci.remoting.nio.NioChannelHub.run(NioChannelHub.java:563)       在jenkins.util.ContextResettingExecutorService $ 1.run(ContextResettingExecutorService.java:28)       at java.util.concurrent.Executors $ RunnableAdapter.call(Unknown Source)       at java.util.concurrent.FutureTask $ Sync.innerRun(Unknown Source)       at java.util.concurrent.FutureTask.run(Unknown Source)       at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)       at java.util.concurrent.ThreadPoolExecutor $ Worker.run(Unknown Source)       在java.lang.Thread.run(未知来源)

     

引起:java.io.IOException:无法中止       ... 9更多

     

引起:java.io.IOException:远程主机强行关闭现有连接       at sun.nio.ch.SocketDispatcher.read0(Native Method)       在sun.nio.ch.SocketDispatcher.read(未知来源)       at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source)       在sun.nio.ch.IOUtil.read(未知来源)       在sun.nio.ch.SocketChannelImpl.read(未知来源)       at org.jenkinsci.remoting.nio.FifoBuffer $ Pointer.receive(FifoBuffer.java:136)       在org.jenkinsci.remoting.nio.FifoBuffer.receive(FifoBuffer.java:306)       在org.jenkinsci.remoting.nio.NioChannelHub.run(NioChannelHub.java:496)       ......还有7个

2 个答案:

答案 0 :(得分:3)

我也在Azure中设置了Jenkins CI并遇到了同样的问题。具体来说,我会在Jenkins从站错误日志中看到此错误:

SEVERE: I/O error in channel channel
java.net.SocketException: Connection reset

要解决此问题,您需要增加从站ping主站的频率。您可以通过将Dhudson.slaves.ChannelPinger.pingInterval系统属性添加到主jenkins.xml文件来执行此操作。

我将其修改为每2分钟ping一次,并且该频道能够保持连接而不丢弃它。 XML看起来像这样:

<arguments>
  -Xrs -Xmx256m -Dhudson.slaves.ChannelPinger.pingInterval=2 
  -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle 
  -jar "%BASE%\jenkins.war" 
  --httpPort=8080
</arguments>

有关详细信息,请参阅the related ticket

答案 1 :(得分:1)

如果你有更新版本的Jenkins(我们的是1.584),你可以转到奴隶的节点配置页面,点击Launch Method下的Advanced按钮,然后将-Dhudson.slaves.ChannelPinger.pingInterval=2添加到JVM Options字段

这对我们起了作用!