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

Driver not retrying on Connection timed out SocketException

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: 2.6.5
    • Fix Version/s: None
    • Component/s: Performance
    • # Replies:
      7
    • Last comment by Customer:
      true

      Description

      I've got a MongoDB replica set across two datacenters. In my second data center I have some servers that point back to the primary instance in data center 1.

      I ran into a connection timeout issue (this happens pretty consistently) on the server, here is the stack trace:

      com.mongodb.DBPortPool gotError
      WARNING: emptying DBPortPool to 10.240.110.42:27017 b/c of error
      java.net.SocketException: Connection timed out
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
      at java.io.BufferedInputStream.read1(BufferedInputStream.java:256)
      at java.io.BufferedInputStream.read(BufferedInputStream.java:313)
      at org.bson.io.Bits.readFully(Bits.java:35)
      at org.bson.io.Bits.readFully(Bits.java:28)
      at com.mongodb.Response.<init>(Response.java:39)
      at com.mongodb.DBPort.go(DBPort.java:123)
      at com.mongodb.DBPort.go(DBPort.java:82)
      at com.mongodb.DBPort.call(DBPort.java:72)
      at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:202)
      at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:303)
      at com.mongodb.DBCollection.findOne(DBCollection.java:565)
      at com.mongodb.DBCollection.findOne(DBCollection.java:554)

      Is it possible for the driver to attempt recreate the connections and retry the query? It looks like the next query worked as expected.

      I do not see these errors on servers in the same data center as the primary mongodb server

      Note: latency between the my app server and the primary mongodb server is ~50 ms

      THANKS!

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                4 years, 27 weeks, 5 days ago
                Date of 1st Reply: