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

Improve driver robustness on node restart

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Connection Management
    • Labels:
      None
    • Story Points:
      1

      Description

      a client using the java driver encounters exceptions when reading from a server that gets restarted gracefully, although another node is up and available for reads.
      I use a topology of 2 nodes, with one being set as a fixed primary for my tests. on the client side I use read mode primaryPreferred. during the test, I constantly query a collection while repeatdly restarting the primary using the windows service. the expectation is that a read never fails because: 1) the primary is gracefully restarted and 2) the secondary is always up and running.

      during the course of running the test, I get exceptions on the client side from time to time. so far I identified these 2:

      java.lang.NullPointerException
          at com.mongodb.DBTCPConnector$MyPort.error(DBTCPConnector.java:470)
          at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:281)
          at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:290)
          at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:275)
          at com.mongodb.DBCollection.findOne(DBCollection.java:727)
          at com.mongodb.DBCollection.findOne(DBCollection.java:669)
          at com.lodh.arte.test.robustmongo.ReproducerPrimaryPreferredSystemTest.readSecondary(ReproducerPrimaryPreferredSystemTest.java:87)

      com.mongodb.MongoException: not talking to master and retries used up
          at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:304)
          at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:306)
          at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:306)
          at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:290)
          at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:275)
          at com.mongodb.DBCollection.findOne(DBCollection.java:727)
          at com.mongodb.DBCollection.findOne(DBCollection.java:669)
          at com.lodh.arte.test.robustmongo.ReproducerPrimaryPreferredSystemTest.readSecondary(ReproducerPrimaryPreferredSystemTest.java:87)

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            v.sevel@lombardodier.com Vincent Sevel
            Participants:
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: