java.net.SocketException: Connection timed out

JIRA | John Danner | 5 years ago
  1. 0

    [JAVA-481] Driver not retrying on Connection timed out SocketException - MongoDB

    mongodb.org | 2 years ago
    java.net.SocketException: Connection timed out
  2. 0

    [JAVA-481] Driver not retrying on Connection timed out SocketException - MongoDB

    mongodb.org | 1 year ago
    java.net.SocketException: Connection timed out
  3. 0

    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!

    JIRA | 5 years ago | John Danner
    java.net.SocketException: Connection timed out
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    SocketException in Mongo

    Stack Overflow | 3 years ago | Greg
    java.net.SocketException: Connection timed out
  6. 0

    [mongodb-user] db error [not master]

    Google Groups | 7 years ago | Zsombor
    java.net.SocketException: Connection reset

  1. Andreas Häber 4 times, last 2 months ago
  2. sriharshakiran 1 times, last 7 months ago
14 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.net.SocketException

    Connection timed out

    at java.net.SocketInputStream.socketRead0()
  2. Java RT
    BufferedInputStream.read
    1. java.net.SocketInputStream.socketRead0(Native Method)
    2. java.net.SocketInputStream.read(SocketInputStream.java:129)
    3. java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
    4. java.io.BufferedInputStream.read1(BufferedInputStream.java:256)
    5. java.io.BufferedInputStream.read(BufferedInputStream.java:313)
    5 frames
  3. MongoDB Java Driver
    DBCollection.findOne
    1. org.bson.io.Bits.readFully(Bits.java:35)
    2. org.bson.io.Bits.readFully(Bits.java:28)
    3. com.mongodb.Response.<init>(Response.java:39)
    4. com.mongodb.DBPort.go(DBPort.java:123)
    5. com.mongodb.DBPort.go(DBPort.java:82)
    6. com.mongodb.DBPort.call(DBPort.java:72)
    7. com.mongodb.DBTCPConnector.call(DBTCPConnector.java:202)
    8. com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:303)
    9. com.mongodb.DBCollection.findOne(DBCollection.java:565)
    10. com.mongodb.DBCollection.findOne(DBCollection.java:554)
    10 frames