race condition in DB.requestEnsureConnection can cause NullPointerException

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Critical - P2
    • 2.9.0
    • Affects Version/s: None
    • Component/s: Cluster Management
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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.

              Assignee:
              Jeffrey Yemin
              Reporter:
              Barrie Segal (Inactive)
              None
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: