Fix Netty reference leak. by rozza · Pull Request #1762 · mongodb/mongo-java-driver

@rozza

Fixes netty byte buffer releases in edge case scenarios:

- Ensure async select server uses a callback if the cluster had been closed
- Ensure that handleReadResponse checks to see if the cluster had been closed
  before retaining incoming buffers
- Ensure closing the netty stream releases all references

Test fixes
- Ensure tests run using paranoid leak detection
- Fail the testsuite if a leak is detected.
- Fixed releasing buffers in the ByteBufferBsonOutputTest.

JAVA-5901

@rozza

vbabanin

@rozza @vbabanin

…tyStream.java

Co-authored-by: Viacheslav Babanin <frest0512@gmail.com>

@rozza

vbabanin

@rozza rozza deleted the JAVA-5901 branch

July 10, 2025 16:20