Windows Azure上与Jenkins slave的连接问题

Dec*_*oll 7 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:无法在hudson.remoting.Request.call上的hudson.remoting.RequestAbortedException.wrapForRethrow(RequestAbortedException.java:34)的hudson.remoting.RequestAbortedException.wrapForRethrow(RequestAbortedException.java:41)中止(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)at hudson.tasks.CommandInterpreter.join(CommandInterpreter.java:137)at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:97)at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)at hudson.tasks.BuildStepMonitor $ 1.perform(BuildStepMonitor.java:20)at h udson.model.AbstractBuild $ AbstractBuildExecution.perform(AbstractBuild.java:745)at hudson.model.Build $ BuildExecution.build(Build.java:198)at hudson.model.Build $ BuildExecution.doRun(Build.java:159)在hudson.model.AbstractBuild $ AbstractBuildExecution.run(AbstractBuild.java:518)位于hudson的hudson.model.Run.execute(Run.java:1709)hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43). model.ResourceController.execute(ResourceController.java:88)at hudson.model.Executor.run(Executor.java:231)

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

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

引起:java.io.IOException:远程主机在sun.nio.ch.SocketDispatcher.read0(本机方法)的sun.nio.ch.SocketDispatcher.read(未知来源)处强制关闭现有连接.来自org.jenkinsci.remoting.nio.FifoBuffer $的sun.nio.ch.SocketChannelImpl.read(未知来源)sun.nio.ch.IOUtil.read(未知来源)的nio.ch.IOUtil.readIntoNativeBuffer(未知来源) Pointer.receive(FifoBuffer.java:136)位于org.jenkinsci.remoting.nio.FiooBuffer.receive(FifoBuffer.java:306)org.jenkinsci.remoting.nio.NioChannelHub.run(NioChannelHub.java:496).还有7个

小智 3

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

SEVERE: I/O error in channel channel
java.net.SocketException: Connection reset
Run Code Online (Sandbox Code Playgroud)

要解决此问题,您需要增加从站 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>
Run Code Online (Sandbox Code Playgroud)

欲了解更多信息,您可以查看相关票证