MongoTimeoutException
JavaMongoExceptionconnectivitytimeout
The driver timed out waiting for a suitable server or for the operation to complete
What is happening?
MongoTimeoutException in the Java driver indicates the driver could not find a suitable server or complete the operation within the configured timeout. With CSOT (Client-Side Operation Timeout) in driver 5.x+, this replaces the older MongoSocketReadTimeoutException for many scenarios.
Common causes
- serverSelectionTimeoutMS exceeded — no suitable server found
- All servers unreachable
- Read preference cannot be satisfied
- Connection pool exhausted
- Server under heavy load