[JAVA-2091] Exception: Interrupted acquiring a permit to retrieve an item from the pool Created: 19/Jan/16 Updated: 21/Jan/16 Resolved: 21/Jan/16 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Connection Management |
| Affects Version/s: | 3.2.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Justin Knight | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Ubuntu, connecting to single instance of Mongo DB 3.0.6 on localhost |
||
| Description |
|
We recently upgraded from a older version of the MongoDB driver to 3.2 and are see multiple exceptions being thrown. Our application runs OK for a day or so but then we're seeing this exception being thrown frequently...
We have a single MongoClient instance:
This is the cache code, called from multiple threads:
|
| Comments |
| Comment by Jeffrey Yemin [ 21/Jan/16 ] |
|
Thanks for reporting the resolution of this issue. I'm closing it as Works as Designed. |
| Comment by Justin Knight [ 21/Jan/16 ] |
|
On further investigation it seems the exception is being thrown because the thread has already been interrupted when the mongo call is made. In these circumstances it seems reasonable for Java driver to throw this exception. |
| Comment by Justin Knight [ 21/Jan/16 ] |
|
ExecutorService#shutdownNow is called on the threads after a 10 second timeout. Normally the threads take less than a second to run. Is it possible that mongo connections are leaking somehow? That could cause the mongo operations to take longer than the timeout causing the exceptions to start firing. |
| Comment by Jeffrey Yemin [ 20/Jan/16 ] |
|
Looking more closely at the stack trace, I see that the driver code is being executed via an executor service. My current hypothesis is that application code is calling the java.util.concurrent.ExecutorService#shutdownNow method on an ExecutorService instance that is generating this stack trace. Please check to see if that is a possibility. |
| Comment by Justin Knight [ 20/Jan/16 ] |
|
Hi Jeff,
|
| Comment by Jeffrey Yemin [ 19/Jan/16 ] |
|
A few questions:
|