[JAVA-483] MongoException$Network on stale connection pool for selection queries only Created: 05/Dec/11  Updated: 25/Jun/13  Resolved: 10/Mar/12

Status: Closed
Project: Java Driver
Component/s: API
Affects Version/s: 2.7.2
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Nick Matheson Assignee: Jeffrey Yemin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OSX Lion
Java 1.6
Mongo 2.0.0



 Description   

Steps to reproduce

1. Establish connection to mongo (i.e.: execute a single query)
2. Pause java process and stop/start mongo process
3. Perform one or more selection queries in java process (the first selection query ends with the exception below, all remaining queries succeed.)

This may be the expected behavior in this scenario but was surprising since inserts do not exhibit the behavior.

Exception:

com.mongodb.MongoException$Network: can't call something : /127.0.0.1:27017/connection_test
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:227)
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:305)
at com.mongodb.DBCursor._check(DBCursor.java:369)
at com.mongodb.DBCursor._hasNext(DBCursor.java:498)
at com.mongodb.DBCursor.hasNext(DBCursor.java:523)
at foobar.Testing123.readTest(Testing123.java:65)
at foobar.Testing123.main(Testing123.java:38)
Caused by: java.io.EOFException
at org.bson.io.Bits.readFully(Bits.java:37)
at org.bson.io.Bits.readFully(Bits.java:28)
at com.mongodb.Response.<init>(Response.java:39)
at com.mongodb.DBPort.go(DBPort.java:128)
at com.mongodb.DBPort.call(DBPort.java:79)
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:218)
... 6 more



 Comments   
Comment by Nick Matheson [ 20/Dec/11 ]

Jeff-

Thanks for the clarification.

Nick

Comment by Jeffrey Yemin [ 15/Dec/11 ]

This is expected behavior when a connection goes stale. You'll get the same result on insert if you use WriteConcern.SAFE.

Comment by Jeffrey Yemin [ 14/Dec/11 ]

Do you have sample code? I assume you're not doing slaveOk reads.

Generated at Thu Feb 08 08:52:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.