0

I can see the following in my tomcat logs but do not understand why and how to solve:

Mar 19, 2013 3:50:01 PM com.mongodb.DBPort _open SEVERE: going to sleep and retry. total sleep time after = 38ms this time:100ms

I am using java, spring-data.

Any ideas?

Asya Kamsky
  • 41,784
  • 5
  • 109
  • 133
checklist
  • 12,340
  • 15
  • 58
  • 102
  • What does this have to do with MongoDB going to sleep? This is tomcat log, not mongod. MongoDB doesn't "go to sleep" - looks like the port you are using may be closed. – Asya Kamsky Mar 19 '13 at 16:18

1 Answers1

1

This is a message logged by the MongoDB Java driver, by com.mongodb.DBPort - indicating that it could not connect your MongoDB instance (the socket cannot be established) but will retry to connect in X ms since the autoConnectRetry option is set to true. You can set the maxAutoConnectRetryTime to control the maximum amount of time in MS to spend retrying to open connection to the same server. Default is 0, which means to use the default 15s if autoConnectRetry is on.
You should see a "connect fail to : ..." message in the log file before you see this message.
You should probably check that you configured a proper host and port for the connection, there is no firewall that is blocking the connection and that the server is up.
If this message appears once but the application behaves correctly, than it means that the driver had temporary issues to connect with the database but managed to reconnect after waiting for X ms.

Dror Bereznitsky
  • 20,048
  • 3
  • 48
  • 57
  • There is nothing wrong with the mongo server. It looks like the application is working fine. Only issue is with the log. I do think it is the mongodb java driver. – checklist Mar 20 '13 at 05:47
  • This message appears many times in the log and does not say connect fail to... beforehand. – checklist Dec 13 '13 at 13:07