-
Type:
Build Failure
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: Test Failure
-
None
-
None
-
Java Drivers
-
None
-
None
-
None
-
None
-
None
-
None
In https://github.com/mongodb/mongo-java-driver/pull/1762 we started failing the build if the Netty leak detector detected any leaks. Since then, Netty variants of the test-reactive-task and test-core-task often fail, e.g. here. The leak stack trace is typically something like:
[2025/12/03 18:33:58.890] 23:33:58.850 [cluster-rtt-ClusterId{value='6930c8e66803719710c5d5f2', description='client0'}-localhost:27017] ERROR io.netty.util.ResourceLeakDetector - LEAK: ByteBuf.release() was not called before it's garbage-collected. See https://netty.io/wiki/reference-counted-objects.html for more information.
[2025/12/03 18:33:58.890] Recent access records:
[2025/12/03 18:33:58.890] Created at:
[2025/12/03 18:33:58.890] io.netty.buffer.PooledByteBufAllocator.newDirectBuffer(PooledByteBufAllocator.java:403)
[2025/12/03 18:33:58.890] io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:188)
[2025/12/03 18:33:58.890] io.netty.buffer.AbstractByteBufAllocator.buffer(AbstractByteBufAllocator.java:124)
[2025/12/03 18:33:58.890] com.mongodb.internal.connection.netty.NettyStream.getBuffer(NettyStream.java:160)
[2025/12/03 18:33:58.890] com.mongodb.internal.connection.InternalStreamConnection.getBuffer(InternalStreamConnection.java:939)
[2025/12/03 18:33:58.890] com.mongodb.internal.connection.ByteBufferBsonOutput.getByteBufferAtIndex(ByteBufferBsonOutput.java:191)
[2025/12/03 18:33:58.890] com.mongodb.internal.connection.ByteBufferBsonOutput.getCurrentByteBuffer(ByteBufferBsonOutput.java:177)
[2025/12/03 18:33:58.890] com.mongodb.internal.connection.ByteBufferBsonOutput.writeInt32(ByteBufferBsonOutput.java:91)
[2025/12/03 18:33:58.890] com.mongodb.internal.connection.RequestMessage.writeMessagePrologue(RequestMessage.java:105)
[2025/12/03 18:33:58.890] com.mongodb.internal.connection.RequestMessage.encode(RequestMessage.java:94)
[2025/12/03 18:33:58.890] com.mongodb.internal.connection.CommandMessage.encode(CommandMessage.java:74)
[2025/12/03 18:33:58.890] com.mongodb.internal.connection.InternalStreamConnection.sendAndReceiveAsyncInternal(InternalStreamConnection.java:611)
- is related to
-
JAVA-6010 ByteBufBsonDocument duplicates a ByteBuf with no way to release it
-
- Backlog
-