[JAVA-756] SSL Connection Pool Threading - Stale Connections Created: 09/Feb/13 Updated: 25/Jun/13 Resolved: 10/Feb/13 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Connection Management |
| Affects Version/s: | 2.10.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Torben Werner | Assignee: | Unassigned |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | connections, ssl | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
java version "1.7.0_11" |
||
| Description |
|
Client is initialized as follows: String dbHost = SSL_SERVER_ADDRESS; The mongo object is stored as a singleton and is accessed by other threads. Getting a collection, saving and inserting while in the thread that initialized the client is fine. The problem occurs when the client is accessed by other threads. When another thread attempts to get a collection as follows: db.getCollection("testCollection"); I receive the following exception: Caused by: com.mongodb.MongoException$Network: can't call something : {HOST_NAME}/ {HOST_IP_ADDRESS}: {PORT}/ {DBNAME} at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:295) ~[mongo-java-driver-2.10.1.jar:na] This exception is generated by any threads that attempt to access a collection in this manner until the number of attempts have exceeded the connection pool size. After this point the exception no longer occur. This problem does not occur when a non-SSL connection is made in the following way: MongoClientOptions o = new MongoClientOptions.Builder() This leads me to believe that the issue is specific to SSL connections. I have also found the following workaround prevents the exceptions from occurring when other threads attempt to access a collection: String dbHost = SSL_SERVER_ADDRESS; Note the above code is run within the same thread that initializes the client. However, if the collections are cycled through by the initializing thread as in the above code, other threads no longer generate exceptions when accessing a collection. |
| Comments |
| Comment by Jeffrey Yemin [ 10/Feb/13 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
OK, thanks for the report. Please re-open if you see it again. | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Torben Werner [ 09/Feb/13 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
For completeness, here is the test harness:
| ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Torben Werner [ 09/Feb/13 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
I am no longer able to reproduce this issue. Not sure why as it was reliably reproducible up until just now. As I cannot reproduce this anymore I suspect this issue may have actually been some other connection issue. This issue can probably be closed... |