Server Selection Timeout
Parent: Client Side Operations Timeout (CSOT) · Published reference · snapshot 2026-10-15
↓ Facts as markdownall context files
Depth-first rabbithole dossier for Server Selection Timeout; source-anchored research pack.
These notes link each claim to its source. Some citations identify archived research reports that are no longer hosted on this site. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
How it works
- [low] When serverSelectionTryOnce is true, server selection timeouts have no effect; instead, a single immediate topology check is performed if the topology is stale or the first selection attempt fails. Sources: https://raw.githubusercontent.com/mongodb/specifications/master/source/server-selection/server-selection.md [source]
- [low] When serverSelectionTryOnce is false, the server selection process loops until a server is successfully selected or until the serverSelectionTimeoutMS is exceeded. Sources: https://raw.githubusercontent.com/mongodb/specifications/master/source/server-selection/server-selection.md [source]
Problems, failure modes and limitations
- [high] The MongoDB driver retries finding a server for serverSelectionTimeoutMS milliseconds, and after each iteration, it returns a server selection timeout error if the context expired or the process exceeded the timeout setting. Sources: https://www.mongodb.com/docs/drivers/go/current/context.md, https://mongoosejs.com/docs/connections.html [source]
- [low] If the MongoDB driver cannot find a server to send an operation to after serverSelectionTimeoutMS, it raises a MongoTimeoutError indicating the server selection timed out after 30000 ms. Sources: https://mongoosejs.com/docs/connections.html [source]
Comparisons and alternatives
- [low] In a full network outage scenario, setting all timeouts to 1000ms may not prevent a 30-second delay because the error is caused by a DNS operation timeout rather than the server selection timeout. Sources: https://jira.mongodb.org/browse/PYTHON-1902 [source]
Facts and statements
- [high] The serverSelectionTimeoutMS setting defines the maximum time to block for server selection before throwing an exception, with a default value of 30,000 milliseconds (30 seconds). Sources: https://raw.githubusercontent.com/mongodb/specifications/master/source/server-selection/server-selection.md, https://mongoosejs.com/docs/connections.html [source]
- [low] The default serverSelectionTimeoutMS value of 30 seconds was chosen to be sufficient for a typical server primary election to complete, though it may be revised downward as election speeds improve. Sources: https://raw.githubusercontent.com/mongodb/specifications/master/source/server-selection/server-selection.md [source]
Related concepts
- Server — is a part of Server Selection Timeout
- Selection — is a part of Server Selection Timeout
- Timeout — is a part of Server Selection Timeout
Children
- No children recorded.