-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Reactive Streams
-
None
-
Fully Compatible
-
Not Needed
This race condition showed up in a unit test but it seems possible, though rare, that it could affect an application using the driver.
The issue is that DefaultServer.AsyncOperationCountTrackingConnection#release is not synchronized, and it some circumstances be called concurrently. So if the timing is just wrong, multiple concurrent calls can observe a 0 reference count, resulting in the operation count decrementing below 0, which in turn causes an assertion to fire.
There are several approaches to fixing this, but the cleanest is to change the RefererenceCounted#release method to atomically return the decremented count and compare the returned value to 0.
- is caused by
-
JAVA-3926 Consider server load during server selection
- Closed