We am seeing a strange error pasted below all of sudden in the Prod environment:
com.mongodb.MongoInterruptedException: Interrupted acquiring a permit to retrieve an item from the pool
at com.mongodb.internal.connection.ConcurrentPool.acquirePermit(ConcurrentPool.java:186)
We have a plain java mongo driver version of 3.0.2.The application code is also in java and deployed in tomcat server.
Sequence of flow which is leading to the cause is :
1.Future task runs across 6 collections and tries to pull data based on certain date 2.Only one of the collection is sharded and it is splitted across three sets.Sets having a primary ,secondary and arbiter.
Is there any special consideration to be done on the connection pool or infra applied on the mongo server environment .Data which resides on the mongo is close to 150GB
Appreciate any response.
For all those coming across this question:
It happens to me that this problem is arising only when debugging with IntelliJ Idea. If the exception is thrown in the code or in the normal processing flow, the problem doesn't occur.
I had the same issue when called Thread.currentThread().interrupt()
There is even a closed ticket in Jira https://jira.mongodb.org/browse/JAVA-2091 which says
the thread has already been interrupted when the mongo call is made
and
it Works as Designed.
The other question is whether this is correct design, since calling interrupt()
on a Thread considered to be the right practice.
I'm not sure that's your case, though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With