Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-626

race condition in DB.requestEnsureConnection can cause NullPointerException

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical - P2
    • Resolution: Fixed
    • None
    • 2.9.0
    • Cluster Management
    • None

    Description

      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.

      Attachments

        Activity

          People

            jeff.yemin@mongodb.com Jeffrey Yemin
            barrie Barrie Segal
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: