首页 > 解决方案 > jenkins 上的 Windows 代理连接不稳定

问题描述

在 jenkins 上配置为从属的多个 windows 代理。我们的 Windows 代理经常因以下错误而断开连接。我们正在使用 websocket 进行连接。

细节:

Jenkins v2.263 和 Windows 服务器 2016 / 2012 R2 / 2019

代理端的错误日志

Oct 01, 2021 7:46:45 AM hudson.remoting.jnlp.Main createEngine
INFO: Setting up agent: jwinslave001
Oct 01, 2021 7:46:45 AM hudson.remoting.jnlp.Main$CuiListener <init>
INFO: Jenkins agent is running in headless mode.
Oct 01, 2021 7:46:45 AM hudson.remoting.Engine startEngine
INFO: Using Remoting version: 4.5
Oct 01, 2021 7:46:45 AM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
INFO: Using C:\jwinslave001-slave\remoting as a remoting work directory
Oct 01, 2021 7:47:06 AM hudson.remoting.jnlp.Main$CuiListener error
SEVERE: Connection failed.
io.jenkins.remoting.shaded.javax.websocket.DeploymentException: Connection failed.
    at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.JdkClientContainer$1.call(JdkClientContainer.java:200)
    at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.JdkClientContainer$1.call(JdkClientContainer.java:126)
    at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.JdkClientContainer.openClientSocket(JdkClientContainer.java:205)
    at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager$3$1.run(ClientManager.java:663)
    at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager$3.run(ClientManager.java:712)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager$SameThreadExecutorService.execute(ClientManager.java:866)
    at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
    at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:511)
    at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:355)
    at hudson.remoting.Engine.runWebSocket(Engine.java:628)
    at hudson.remoting.Engine.run(Engine.java:470)
Caused by: java.io.IOException: The semaphore timeout period has expired.

    at sun.nio.ch.Iocp.translateErrorToIOException(Unknown Source)
    at sun.nio.ch.Iocp.access$700(Unknown Source)
    at sun.nio.ch.Iocp$EventHandlerTask.run(Unknown Source)
    at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

此外,当测试作业被配置为在 Windows 从属设备上运行时,下面的日志。测试作业运行了大约一天,然后代理因以下错误断开连接..

Sep 28, 2021 10:22:13 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Read side closed
Sep 28, 2021 10:22:14 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Terminated
Sep 28, 2021 10:22:35 PM hudson.remoting.jnlp.Main$CuiListener error
SEVERE: Connection failed.
io.jenkins.remoting.shaded.javax.websocket.DeploymentException: Connection failed.
    at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.JdkClientContainer$1.call(JdkClientContainer.java:200)
    at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.JdkClientContainer$1.call(JdkClientContainer.java:126)
    at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.JdkClientContainer.openClientSocket(JdkClientContainer.java:205)
    at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager$3$1.run(ClientManager.java:663)
    at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager$3.run(ClientManager.java:712)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager$SameThreadExecutorService.execute(ClientManager.java:866)
    at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
    at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:511)
    at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:355)
    at hudson.remoting.Engine.runWebSocket(Engine.java:628)
    at hudson.remoting.Engine.run(Engine.java:470)
Caused by: java.io.IOException: The semaphore timeout period has expired.

    at sun.nio.ch.Iocp.translateErrorToIOException(Iocp.java:309)
    at sun.nio.ch.Iocp.access$700(Iocp.java:46)
    at sun.nio.ch.Iocp$EventHandlerTask.run(Iocp.java:399)
    at java.lang.Thread.run(Thread.java:748)

在詹金斯上看到的日志..

2021-09-20 17:35:43.962+0000 [id=24231] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-24231 for jwinslave0037 terminated: java.nio.channels.ClosedChannelException
2021-09-20 17:42:23.510+0000 [id=24231] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-24231 for jwinslave0037 terminated: java.nio.channels.ClosedChannelException
2021-09-20 18:04:39.918+0000 [id=46158] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-46158 for jwinslave0037 terminated: java.nio.channels.ClosedChannelException
2021-09-20 18:04:39.921+0000 [id=46642] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-46642 for jwinslave0037 terminated: java.nio.channels.ClosedChannelException
2021-09-20 18:15:14.245+0000 [id=46498] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-46498 for jwinslave0049 terminated: java.nio.channels.ClosedChannelException
2021-09-20 18:15:44.682+0000 [id=46503] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-46503 for jwinslave0051 terminated: java.nio.channels.ClosedChannelException
2021-09-20 18:35:45.473+0000 [id=46503] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-46503 for jwinslave0055 terminated: java.nio.channels.ClosedChannelException


2021-09-20 18:35:45.471+0000 [id=27959] INFO    hudson.slaves.ChannelPinger$1#onDead: Ping failed. Terminating the channel jwinslave0055.
java.util.concurrent.TimeoutException: Ping started at 1632162705470 hasn't completed by 1632162945471
        at hudson.remoting.PingThread.ping(PingThread.java:134)
        at hudson.remoting.PingThread.run(PingThread.java:90)
2021-09-20 18:35:45.473+0000 [id=46503] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-46503 for jwinslave0055 terminated: java.nio.channels.ClosedChannelException

2021-09-20 18:45:16.789+0000 [id=46503] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-46503 for jwinslave0056 terminated: java.nio.channels.ClosedChannelException

2021-09-20 18:56:30.353+0000 [id=46498] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-46498 for jwinslave0058 terminated: java.nio.channels.ClosedChannelException

2021-09-20 18:59:46.368+0000 [id=46971] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-46971 for jwinslave0058 terminated: java.nio.channels.ClosedChannelException
2021-09-20 19:54:02.241+0000 [id=47687] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-47687 for jwinslave0049 terminated: java.nio.channels.ClosedChannelException
2021-09-20 19:54:02.241+0000 [id=43]    WARNING n.b.j.internal.common.JavaLogger#warn: exception while collecting data
java.nio.channels.ClosedChannelException
        at jenkins.agents.WebSocketAgents$Session.closed(WebSocketAgents.java:141)
        at jenkins.websocket.WebSocketSession.onWebSocketSomething(WebSocketSession.java:91)
        at com.sun.proxy.$Proxy126.onWebSocketClose(Unknown Source)
        at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onClose(JettyListenerEventDriver.java:149)
        at org.eclipse.jetty.websocket.common.WebSocketSession.callApplicationOnClose(WebSocketSession.java:394)
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.disconnect(AbstractWebSocketConnection.java:316)
        at org.eclipse.jetty.websocket.common.io.DisconnectCallback.succeeded(DisconnectCallback.java:42)
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection$CallbackBridge.writeSuccess(AbstractWebSocketConnection.java:86)
        at org.eclipse.jetty.websocket.common.io.FrameFlusher.notifyCallbackSuccess(FrameFlusher.java:359)
        at org.eclipse.jetty.websocket.common.io.FrameFlusher.succeedEntries(FrameFlusher.java:288)
        at org.eclipse.jetty.websocket.common.io.FrameFlusher.succeeded(FrameFlusher.java:280)
        at org.eclipse.jetty.io.WriteFlusher.write(WriteFlusher.java:293)
        at org.eclipse.jetty.io.AbstractEndPoint.write(AbstractEndPoint.java:381)
        at org.eclipse.jetty.websocket.common.io.FrameFlusher.flush(FrameFlusher.java:264)
        at org.eclipse.jetty.websocket.common.io.FrameFlusher.process(FrameFlusher.java:193)
        at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241)
        at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:223)
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.outgoingFrame(AbstractWebSocketConnection.java:581)
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.close(AbstractWebSocketConnection.java:181)
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:510)
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:440)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
        at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:773)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:905)
        at java.lang.Thread.run(Thread.java:748)
Caused: hudson.remoting.ChannelClosedException: Channel "hudson.remoting.Channel@3cce4ea7:jwinslave0032": Remote call on jwinslave0032 failed. The channel is closing down or has closed down
        at hudson.remoting.Channel.callAsync(Channel.java:1029)
        at net.bull.javamelody.RemoteCallHelper.collectDataByNodeName(RemoteCallHelper.java:188)
        at net.bull.javamelody.RemoteCallHelper.collectJavaInformationsListByName(RemoteCallHelper.java:213)
        at net.bull.javamelody.NodesCollector.collectWithoutErrorsNow(NodesCollector.java:159)
        at net.bull.javamelody.NodesCollector.collectWithoutErrors(NodesCollector.java:147)
        at net.bull.javamelody.NodesCollector$2.run(NodesCollector.java:115)
        at java.util.TimerThread.mainLoop(Timer.java:555)
        at java.util.TimerThread.run(Timer.java:505)
2021-09-20 19:54:02.243+0000 [id=47687] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-47687 for jwinslave0043 terminated: java.nio.channels.ClosedChannelException
2021-09-20 19:54:02.243+0000 [id=47687] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-47687 for jwinslave0043 terminated: java.nio.channels.ClosedChannelException
2021-09-20 19:54:02.246+0000 [id=43]    WARNING n.b.j.internal.common.JavaLogger#warn: exception while collecting data
java.nio.channels.ClosedChannelException
        at jenkins.agents.WebSocketAgents$Session.closed(WebSocketAgents.java:141)
        at jenkins.websocket.WebSocketSession.onWebSocketSomething(WebSocketSession.java:91)
        at com.sun.proxy.$Proxy126.onWebSocketClose(Unknown Source)
        at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onClose(JettyListenerEventDriver.java:149)
        at org.eclipse.jetty.websocket.common.WebSocketSession.callApplicationOnClose(WebSocketSession.java:394)
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.disconnect(AbstractWebSocketConnection.java:316)
        at org.eclipse.jetty.websocket.common.io.DisconnectCallback.succeeded(DisconnectCallback.java:42)
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection$CallbackBridge.writeSuccess(AbstractWebSocketConnection.java:86)
        at org.eclipse.jetty.websocket.common.io.FrameFlusher.notifyCallbackSuccess(FrameFlusher.java:359)
        at org.eclipse.jetty.websocket.common.io.FrameFlusher.succeedEntries(FrameFlusher.java:288)
        at org.eclipse.jetty.websocket.common.io.FrameFlusher.succeeded(FrameFlusher.java:280)
        at org.eclipse.jetty.io.WriteFlusher.write(WriteFlusher.java:293)
        at org.eclipse.jetty.io.AbstractEndPoint.write(AbstractEndPoint.java:381)
        at org.eclipse.jetty.websocket.common.io.FrameFlusher.flush(FrameFlusher.java:264)
        at org.eclipse.jetty.websocket.common.io.FrameFlusher.process(FrameFlusher.java:193)
        at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241)
        at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:223)
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.outgoingFrame(AbstractWebSocketConnection.java:581)
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.close(AbstractWebSocketConnection.java:181)
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:510)
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:440)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
        at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:773)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:905)
        at java.lang.Thread.run(Thread.java:748)
Caused: hudson.remoting.ChannelClosedException: Channel "hudson.remoting.Channel@3cce4ea7:jwinslave0032": Remote call on jwinslave0032 failed. The channel is closing down or has closed down
        at hudson.remoting.Channel.callAsync(Channel.java:1029)
        at net.bull.javamelody.RemoteCallHelper.collectDataByNodeName(RemoteCallHelper.java:188)
        at net.bull.javamelody.RemoteCallHelper.collectJavaInformationsListByName(RemoteCallHelper.java:213)
        at net.bull.javamelody.NodesCollector.collectWithoutErrorsNow(NodesCollector.java:159)
        at net.bull.javamelody.NodesCollector.collectWithoutErrors(NodesCollector.java:147)
        at net.bull.javamelody.NodesCollector$2.run(NodesCollector.java:115)
        at java.util.TimerThread.mainLoop(Timer.java:555)
        at java.util.TimerThread.run(Timer.java:505)
2021-09-20 19:54:02.254+0000 [id=46158] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-46158 for jwinslave0032 terminated: java.nio.channels.ClosedChannelException
2021-09-20 19:54:02.255+0000 [id=47687] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-47687 for jwinslave0051 terminated: java.nio.channels.ClosedChannelException
2021-09-20 19:54:02.262+0000 [id=46642] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-46642 for jwinslave0055 terminated: java.nio.channels.ClosedChannelException
2021-09-20 19:54:03.020+0000 [id=46158] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-46158 for jwinslave0036 terminated: java.nio.channels.ClosedChannelException
2021-09-20 19:54:03.022+0000 [id=46328] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-46328 for jwinslave0056 terminated: java.nio.channels.ClosedChannelException
2021-09-20 19:54:03.158+0000 [id=46503] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-46503 for jwinslave0058 terminated: java.nio.channels.ClosedChannelException
2021-09-20 19:54:03.159+0000 [id=46158] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-46158 for jwinslave0037 terminated: java.nio.channels.ClosedChannelException
2021-09-20 19:54:03.159+0000 [id=43]    WARNING n.b.j.internal.common.JavaLogger#warn: exception while collecting data
java.nio.channels.ClosedChannelException
        at jenkins.agents.WebSocketAgents$Session.closed(WebSocketAgents.java:141)
        at jenkins.websocket.WebSocketSession.onWebSocketSomething(WebSocketSession.java:91)
        at com.sun.proxy.$Proxy126.onWebSocketClose(Unknown Source)
        at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onClose(JettyListenerEventDriver.java:149)
        at org.eclipse.jetty.websocket.common.WebSocketSession.callApplicationOnClose(WebSocketSession.java:394)
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.disconnect(AbstractWebSocketConnection.java:316)
        at org.eclipse.jetty.websocket.common.io.DisconnectCallback.succeeded(DisconnectCallback.java:42)
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection$CallbackBridge.writeSuccess(AbstractWebSocketConnection.java:86)
        at org.eclipse.jetty.websocket.common.io.FrameFlusher.notifyCallbackSuccess(FrameFlusher.java:359)
        at org.eclipse.jetty.websocket.common.io.FrameFlusher.succeedEntries(FrameFlusher.java:288)
        at org.eclipse.jetty.websocket.common.io.FrameFlusher.succeeded(FrameFlusher.java:280)
        at org.eclipse.jetty.io.WriteFlusher.write(WriteFlusher.java:293)
        at org.eclipse.jetty.io.AbstractEndPoint.write(AbstractEndPoint.java:381)
        at org.eclipse.jetty.websocket.common.io.FrameFlusher.flush(FrameFlusher.java:264)
        at org.eclipse.jetty.websocket.common.io.FrameFlusher.process(FrameFlusher.java:193)
        at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241)
        at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:223)
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.outgoingFrame(AbstractWebSocketConnection.java:581)
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.close(AbstractWebSocketConnection.java:181)
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:510)
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:440)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
        at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:773)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:905)
        at java.lang.Thread.run(Thread.java:748)
Caused: hudson.remoting.ChannelClosedException: Channel "hudson.remoting.Channel@7288d1eb:jwinslave0037": Remote call on jwinslave0037 failed. The channel is closing down or has closed down
        at hudson.remoting.Channel.callAsync(Channel.java:1029)
        at net.bull.javamelody.RemoteCallHelper.collectDataByNodeName(RemoteCallHelper.java:188)
        at net.bull.javamelody.RemoteCallHelper.collectJavaInformationsListByName(RemoteCallHelper.java:213)
        at net.bull.javamelody.NodesCollector.collectWithoutErrorsNow(NodesCollector.java:159)
        at net.bull.javamelody.NodesCollector.collectWithoutErrors(NodesCollector.java:147)
        at net.bull.javamelody.NodesCollector$2.run(NodesCollector.java:115)
        at java.util.TimerThread.mainLoop(Timer.java:555)
        at java.util.TimerThread.run(Timer.java:505)
2021-09-21 11:55:32.504+0000 [id=46158] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-46158 for jwinslave0036 terminated: java.nio.channels.ClosedChannelException
2021-09-21 11:55:33.256+0000 [id=46158] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-46158 for jwinslave0037 terminated: java.nio.channels.ClosedChannelException
2021-09-21 11:55:33.403+0000 [id=47687] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-47687 for jwinslave0051 terminated: java.nio.channels.ClosedChannelException
2021-09-21 11:55:33.403+0000 [id=46498] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-46498 for jwinslave0058 terminated: java.nio.channels.ClosedChannelException
2021-09-21 11:55:33.406+0000 [id=46328] INFO    j.s.DefaultJnlpSlaveReceiver#channelClosed: Jetty (winstone)-46328 for jwinslave0056 terminated: java.nio.channels.ClosedChannelException
2021-09-21 11:55:33.405+0000 [id=43]    WARNING n.b.j.internal.common.JavaLogger#warn: exception while collecting data
java.nio.channels.ClosedChannelException
        at jenkins.agents.WebSocketAgents$Session.closed(WebSocketAgents.java:141)
        at jenkins.websocket.WebSocketSession.onWebSocketSomething(WebSocketSession.java:91)
        at com.sun.proxy.$Proxy126.onWebSocketClose(Unknown Source)
        at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onClose(JettyListenerEventDriver.java:149)
        at org.eclipse.jetty.websocket.common.WebSocketSession.callApplicationOnClose(WebSocketSession.java:394)
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.disconnect(AbstractWebSocketConnection.java:316)
        at org.eclipse.jetty.websocket.common.io.DisconnectCallback.succeeded(DisconnectCallback.java:42)
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection$CallbackBridge.writeSuccess(AbstractWebSocketConnection.java:86)
        at org.eclipse.jetty.websocket.common.io.FrameFlusher.notifyCallbackSuccess(FrameFlusher.java:359)
        at org.eclipse.jetty.websocket.common.io.FrameFlusher.succeedEntries(FrameFlusher.java:288)
        at org.eclipse.jetty.websocket.common.io.FrameFlusher.succeeded(FrameFlusher.java:280)
        at org.eclipse.jetty.io.WriteFlusher.write(WriteFlusher.java:293)
        at org.eclipse.jetty.io.AbstractEndPoint.write(AbstractEndPoint.java:381)
        at org.eclipse.jetty.websocket.common.io.FrameFlusher.flush(FrameFlusher.java:264)
        at org.eclipse.jetty.websocket.common.io.FrameFlusher.process(FrameFlusher.java:193)
        at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241)
        at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:223)
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.outgoingFrame(AbstractWebSocketConnection.java:581)
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.close(AbstractWebSocketConnection.java:181)
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:510)
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:440)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
        at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:773)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:905)
        at java.lang.Thread.run(Thread.java:748)
Caused: hudson.remoting.ChannelClosedException: Channel "hudson.remoting.Channel@4a56294d:jwinslave0056": Remote call on jwinslave0056 failed. The channel is closing down or has closed down
        at hudson.remoting.Channel.callAsync(Channel.java:1029)
        at net.bull.javamelody.RemoteCallHelper.collectDataByNodeName(RemoteCallHelper.java:188)
        at net.bull.javamelody.RemoteCallHelper.collectJavaInformationsListByName(RemoteCallHelper.java:213)
        at net.bull.javamelody.NodesCollector.collectWithoutErrorsNow(NodesCollector.java:159)
        at net.bull.javamelody.NodesCollector.collectWithoutErrors(NodesCollector.java:147)
        at net.bull.javamelody.NodesCollector$2.run(NodesCollector.java:115)
        at java.util.TimerThread.mainLoop(Timer.java:555)
        at java.util.TimerThread.run(Timer.java:505)

我们已经在 windows 上配置了一个批处理脚本,并在 windows 服务器上的任务调度程序中创建了一个任务,以使连接始终处于 Up 状态。另一个问题是任务有时会从运行状态变为就绪状态。有时即使任务正在运行,代理仍然断开连接。

标签: javawindowsjenkins

解决方案


推荐阅读