-
Bug
-
Resolution: Done
-
Critical
-
None
-
None
-
None
-
-
Workaround Exists
-
-
Undefined
If websocket endpoint did not added the handler for PongMessage and sends the PING messages.
On unconfigured wildfly it leads to "XNIO001007: A channel event listener threw an exception: java.lang.OutOfMemoryError: Direct buffer memory" errors in server.log and server eventually stops servicing any requests (not only websocket connections).
After configuring Byte Buffer Pool with Leak detection percent = 100, every gc leads to the following messages in log (one message per single PONG frame):
server.log
2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) java.lang.Throwable: Buffer leak detected 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at io.undertow.server.DefaultByteBufferPool$LeakDetector.<init>(DefaultByteBufferPool.java:314) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at io.undertow.server.DefaultByteBufferPool$LeakDetector.<init>(DefaultByteBufferPool.java:308) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at io.undertow.server.DefaultByteBufferPool$DefaultPooledBuffer.<init>(DefaultByteBufferPool.java:254) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at io.undertow.server.DefaultByteBufferPool.allocate(DefaultByteBufferPool.java:157) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at io.undertow.websockets.core.BufferedBinaryMessage.read(BufferedBinaryMessage.java:90) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at io.undertow.websockets.core.AbstractReceiveListener.readBufferedBinary(AbstractReceiveListener.java:124) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at io.undertow.websockets.core.AbstractReceiveListener.bufferFullMessage(AbstractReceiveListener.java:94) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at io.undertow.websockets.core.AbstractReceiveListener.onPong(AbstractReceiveListener.java:66) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at io.undertow.websockets.core.AbstractReceiveListener.handleEvent(AbstractReceiveListener.java:46) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at io.undertow.websockets.core.AbstractReceiveListener.handleEvent(AbstractReceiveListener.java:33) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at io.undertow.server.protocol.framed.AbstractFramedChannel$FrameReadListener.handleEvent(AbstractFramedChannel.java:952) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at io.undertow.server.protocol.framed.AbstractFramedChannel$FrameReadListener.handleEvent(AbstractFramedChannel.java:932) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:89) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at org.xnio.nio.WorkerThread.run(WorkerThread.java:591)