-
Type: Bug
-
Resolution: Done
-
Priority: Critical - P2
-
Affects Version/s: None
-
Component/s: Cluster Management
-
None
With a replica set connection, use of DB.requestEnsureConnection has a race condition which can cause a NullPointerException:
java.lang.NullPointerException at com.mongodb.DBTCPConnector$MyPort.requestEnsureConnection(DBTCPConnector.java:483) at com.mongodb.DBTCPConnector.requestEnsureConnection(DBTCPConnector.java:129) at com.mongodb.DBApiLayer.requestEnsureConnection(DBApiLayer.java:110)MongoDBConnection.java:482
This race condition is not actually new, but the NPE happens more frequently now that the driver is handling a list of servers that can be either mongos server or replica set members.