mongoDB timeout issue from Java Client

Hi Guys,

Looking for MongoDB’s help with the issue we are facing
Issue: MongoDB instance connection timeout issue with instance unavailable message in the log file when MongoDB primary instance goes into lock status while backup

Note : We are not able to replicate the issue from the dev instance with the same Mongo client configuration and we are able to read the data from the DB instance from Intellij Idea Database Pane.

Error from the tomcat log:

Mar 15, 2023, 2:06:35 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [appServlet] in context with path [/ws] threw exception [Request processing failed; nested exception is org.springframework.dao.DataAccessResourceFailureException: Timeout waiting for a pooled item after 30000 MILLISECONDS; nested exception is com.mongodb.MongoTimeoutException: Timeout waiting for a pooled item after 30000 MILLISECONDS] with root cause
com.mongodb.MongoTimeoutException: Timeout waiting for a pooled item after 30000 MILLISECONDS

MongoDB Client configuration :

<mongo:mongo-client credentials="${}:${}@${}" id="mongoClient" replica-set="${}:${},${}:${},${}:${}">
    <mongo:client-options connections-per-host="5"

Hi @Prasad_Basutkar and welcome to MongoDB community forums!!

I see that your post hasn’t been addressed yet.
Are you still facing the issue with the system?

Based on the above statement, I understand that you are using the fsync process on the primary member of the replica set?
Although using fsyncLock() is one method to perform a backup, it’s disruptive to the server’s operation since all writes are forbidden while the server is in this state.

If you wish to backup a replica set configuration, you could follow the steps mentioned in the documentation Restore a Replica Set from MongoDB Backups.