-
Bug
-
Resolution: Done
-
Major
-
2.0.29.Final
-
None
-
None
While attempting to reproduce a client connection leak I encountered 'UT000091: Buffer has already been freed'.
Note this occurred while running 32 concurrent clients after just over 200,000 total requests.
Handler implementation:
new BlockingHandler(exchange -> { Thread.sleep(1); exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "application/json"); exchange.getOutputStream().write(responseData); // 200kb })
13:24:35.528 [XNIO-1 task-38] ERROR io.undertow.request - UT005071: Undertow request failed HttpServerExchange{ POST /simple/ping} java.lang.IllegalStateException: UT000091: Buffer has already been freed at io.undertow.server.DefaultByteBufferPool$DefaultPooledBuffer.getBuffer(DefaultByteBufferPool.java:260) at io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.sendWriteBuffer(AbstractFramedStreamSinkChannel.java:497) at io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.handleBufferFull(AbstractFramedStreamSinkChannel.java:485) at io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.write(AbstractFramedStreamSinkChannel.java:396) at org.xnio.conduits.StreamSinkChannelWrappingConduit.write(StreamSinkChannelWrappingConduit.java:61) at org.xnio.conduits.ConduitStreamSinkChannel.write(ConduitStreamSinkChannel.java:158) at io.undertow.channels.DetachableStreamSinkChannel.write(DetachableStreamSinkChannel.java:179) at io.undertow.server.HttpServerExchange$WriteDispatchChannel.write(HttpServerExchange.java:2070) at org.xnio.channels.Channels.writeBlocking(Channels.java:152) at io.undertow.io.UndertowOutputStream.write(UndertowOutputStream.java:185) at io.undertow.io.UndertowOutputStream.write(UndertowOutputStream.java:105) at com.palantir.conjure.java.client.jaxrs.Repro.lambda$main$0(Repro.java:75) at io.undertow.server.Connectors.executeRootHandler(Connectors.java:376) at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834)