[JAVA-3761] ConcurrentPool doesn't release semaphore permit properly after com.mongodb.MongoSocketException:<host_name_of_read_replica> Created: 11/Jun/20  Updated: 03/Aug/20  Resolved: 03/Aug/20

Status: Closed
Project: Java Driver
Component/s: Async
Affects Version/s: 3.11.2
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Anastasiya Kaluzhonak Assignee: Jeffrey Yemin
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File Error in background maintenance task.txt     Text File Error in callback.txt     Text File Error in monitor thread.txt    
Issue Links:
Duplicate
duplicates JAVA-3690 Domain name resolution issues break D... Closed

 Description   

One of our application's node was faced with some network issues, yet the node did not completely restore its operation after the issue was gone.  
It faced the increased number of errors "com.mongodb.MongoTimeoutException: Timeout waiting for a pooled item after.."

During network issues connections were closed because of com.mongodb.MongoSocketReadTimeoutException: Timeout while receiving message. After network issues were gone opening new connections were failed for only one of two read replicas with 
com.mongodb.MongoSocketException:<host_name_of_read_replica>
For second read replica connections were opened successfully.

Mongo Async driver v3.11.2

ClusterSettings: 
type=REPLICA_SET_SECONDARY

ConnectionOptions: maxPoolSize=10&minPoolSize=10&w=1&wtimeoutMS=500&j=0&connectTimeoutMS=500&socketTimeoutMS=2000&readPreference=secondaryPreferred&waitQueueMultiple=5&waitQueueTimeoutMS=2000&replicaSet=rs0

Issue:
I assume that during com.mongodb.MongoSocketException:<host_name_of_read_replica> ConcurrentPool doesn't release semaphore permit properly. As a result, application faced with errors like "com.mongodb.MongoTimeoutException: Timeout waiting for a pooled item after.."

Please see the attached stacktrace with some obfuscation for more detailes.



 Comments   
Comment by Jeffrey Yemin [ 16/Jul/20 ]

Hi anastasiya.kaluzhonak@gmail.com

It looks like this duplicates JAVA-3690, which will be fixed in the upcoming 4.1.0 release (and is available in the 4.1.0-rc0 pre-release).

Let me know if you can test out that release. We can also consider backporting that fix to a 3.12 patch release.

Generated at Thu Feb 08 09:00:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.