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

ServerAddressSelector returns a List with a null element

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.13.0
    • None
    • Cluster Management
    • None

    Description

      On Jenkins, we occasionally see this stack trace:

      java.lang.NullPointerException
      	at com.mongodb.BaseCluster.getRandomServer(BaseCluster.java:204)
      	at com.mongodb.BaseCluster.getServer(BaseCluster.java:75)
      	at com.mongodb.DBTCPConnector.getServer(DBTCPConnector.java:650)
      	at com.mongodb.DBTCPConnector.access$300(DBTCPConnector.java:39)
      	at com.mongodb.DBTCPConnector$MyPort.error(DBTCPConnector.java:482)
      	at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:301)
      	at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:268)
      	at com.mongodb.DBTCPConnectorTest.testConnectionReservationForReadThenWrite(DBTCPConnectorTest.java:137)

      I've traced it down to ServerAddressSelector.choose returning a list with a single null element in the case where the ServerAddress is no longer in the cluster.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: