Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-69543

CPU pegged handling WebSocket agent connection due to thread-unsafe code

XMLWordPrintable

    • 2.368

      The change introduced in JENKINS-68933 is not thread safe.

      It causes CPU pegging and prevents websockets agents from connecting.

       

      Snippet of a thread dump in an affected instance.

      "Jetty (winstone)-1241" id=1241 (0x4d9) state=RUNNABLE cpu=99%
          at java.base@11.0.16/java.util.WeakHashMap.put(WeakHashMap.java:454)
          at jenkins.websocket.Jetty10Provider$2.onWebSocketConnect(Jetty10Provider.java:151)
          at java.base@11.0.16/java.lang.invoke.DirectMethodHandle$Holder.invokeInterface(DirectMethodHandle$Holder)
          at java.base@11.0.16/java.lang.invoke.LambdaForm$MH/0x0000000841fb2840.invoke(LambdaForm$MH)
          at java.base@11.0.16/java.lang.invoke.LambdaForm$MH/0x0000000841fb2440.invoke_MT(LambdaForm$MH)
          at org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandler.onOpen(JettyWebSocketFrameHandler.java:177)
          at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.lambda$onOpen$6(WebSocketCoreSession.java:411)
          at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession$$Lambda$1122/0x0000000841fb3840.run(Unknown Source)
          at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1463)
          at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1482)
          at org.eclipse.jetty.websocket.core.server.internal.AbstractHandshaker$1.handle(AbstractHandshaker.java:212)
          at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.onOpen(WebSocketCoreSession.java:411)
          at org.eclipse.jetty.websocket.core.internal.WebSocketConnection.onOpen(WebSocketConnection.java:542)
          at org.eclipse.jetty.io.AbstractEndPoint.upgrade(AbstractEndPoint.java:451)
          at org.eclipse.jetty.server.HttpConnection.upgrade(HttpConnection.java:419)
          at org.eclipse.jetty.server.HttpConnection.onCompleted(HttpConnection.java:450)
          at org.eclipse.jetty.server.HttpChannel.onCompleted(HttpChannel.java:968)
          at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:485)
          at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:282)
          at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:319)
          at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)
          at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
          at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:412)
          at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:381)
          at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:268)
          at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.lambda$new$0(AdaptiveExecutionStrategy.java:138)
          at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy$$Lambda$237/0x00000008402a8440.run(Unknown Source)
          at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:407)
          at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:894)
          at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1038)
          at java.base@11.0.16/java.lang.Thread.run(Thread.java:829)
      
      "Jetty (winstone)-1242" id=1242 (0x4da) state=RUNNABLE cpu=99%
          at java.base@11.0.16/java.util.WeakHashMap.put(WeakHashMap.java:454)
          at jenkins.websocket.Jetty10Provider$2.onWebSocketConnect(Jetty10Provider.java:151)
          at java.base@11.0.16/java.lang.invoke.DirectMethodHandle$Holder.invokeInterface(DirectMethodHandle$Holder)
          at java.base@11.0.16/java.lang.invoke.LambdaForm$MH/0x0000000841fb2840.invoke(LambdaForm$MH)
          at java.base@11.0.16/java.lang.invoke.LambdaForm$MH/0x0000000841fb2440.invoke_MT(LambdaForm$MH)
          at org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandler.onOpen(JettyWebSocketFrameHandler.java:177)
          at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.lambda$onOpen$6(WebSocketCoreSession.java:411)
          at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession$$Lambda$1122/0x0000000841fb3840.run(Unknown Source)
          at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1463)
          at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1482)
          at org.eclipse.jetty.websocket.core.server.internal.AbstractHandshaker$1.handle(AbstractHandshaker.java:212)
          at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.onOpen(WebSocketCoreSession.java:411)
          at org.eclipse.jetty.websocket.core.internal.WebSocketConnection.onOpen(WebSocketConnection.java:542)
          at org.eclipse.jetty.io.AbstractEndPoint.upgrade(AbstractEndPoint.java:451)
          at org.eclipse.jetty.server.HttpConnection.upgrade(HttpConnection.java:419)
          at org.eclipse.jetty.server.HttpConnection.onCompleted(HttpConnection.java:450)
          at org.eclipse.jetty.server.HttpChannel.onCompleted(HttpChannel.java:968)
          at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:485)
          at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:282)
          at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:319)
          at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)
          at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
          at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:412)
          at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:381)
          at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:268)
          at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.lambda$new$0(AdaptiveExecutionStrategy.java:138)
          at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy$$Lambda$237/0x00000008402a8440.run(Unknown Source)
          at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:407)
          at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:894)
          at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1038)
          at java.base@11.0.16/java.lang.Thread.run(Thread.java:829) 

            vlatombe Vincent Latombe
            vlatombe Vincent Latombe
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: