Client-side operation timeout (CSOT)
Parent: MongoDB Query Shape Optimization: Sort, Pagination, Operators and Sharded Targeting · Published reference · snapshot 2026-10-24 · skill mongodb-cohort-9cff09d95361
↓ Facts as markdownall context files
Source-anchored research for Client-side operation timeout (CSOT). Run status: COMPLETED.
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.
Definitions
- For ordinary non-tailable cursors, cursorLifetime is the default; iteration instead refreshes the budget for each cursor call. Pagination code must choose its intended scope. (high confidence) [source]
- An unset timeoutMS preserves legacy behavior; zero means an infinite operation budget, but serverSelectionTimeoutMS can still apply. Negative values are invalid. (low confidence) [source]
How it works
- When timeoutMS is set, it overrides socketTimeoutMS, waitQueueTimeoutMS, wTimeoutMS, maxTimeMS, and maxCommitTimeMS. (high confidence) [source]
- ErrLookup reproduces Node.js ConnectionPool.checkOut code that wraps WaitQueueTimeoutError in MongoOperationTimeoutError with the message "Timed out during connection checkout" when CSOT is enabled. This identifies pool waiting as a timeout stage before query execution. (low confidence) (verified as of 2026-08-11) [source]
- Under the specification, a non-tailable cursor may return already-buffered documents after its lifetime budget expires; timeout is raised when another getMore is required. (low confidence) [source]
- The specification deducts minimum network RTT when deriving server maxTimeMS. Insufficient remaining time can cause rejection before sending the command. (high confidence) [source]
- The independent go-dto/go-common v0.2.0 wrapper documents Config.Timeout as CSOT used when the operation context has no deadline, with zero meaning none. This is wrapper-specific evidence, not a universal cross-driver precedence rule. (low confidence) [source]
How-to and procedures
- Configure a client default and override timeoutMS for individual operations; an override inside a withTransaction callback using its timed session is invalid. (high confidence) [source]
Problems, failure modes and limitations
- MongoDB documented a CSOT failure mode where latency spikes caused socket timeouts, connection churn, and further server load. DRIVERS-2884 describes pending-response reuse as a proposed mitigation, not a universal shipped guarantee. (medium confidence) (verified as of 2026-09-23) [source]
- PyMongo 4.11.2 documents pymongo.timeout(seconds) as a deadline for all driver operations in its block. Nested blocks may shorten but cannot extend the outer deadline; the block overrides client timeoutMS. (low confidence) [source]
Comparisons and alternatives
- The Node.js guide and experimental-features file both mark CSOT experimental; validate behavior against the deployed driver rather than assuming that an accepted specification means a stable implementation. (high confidence) (verified as of 2026-10-23) [source]
Facts and statements
- CSOT uses timeoutMS as a shared operation budget covering server selection, connection checkout and server execution; it is a best-effort deadline. (high confidence) [source]
- Cursor cleanup gets a refreshed timeout for killCursors, so cleanup can extend beyond the original cursor budget. (high confidence) [source]
- The specification defines a best-effort deadline: transaction-abort cleanup can make withTransaction take up to twice timeoutMS. (low confidence) [source]
- The specification retains serverSelectionTimeoutMS and connectTimeoutMS; timeoutMS=0 does not eliminate every other timeout. (low confidence) [source]
- Eligible retries consume the same timeoutMS budget, and a multi-batch bulk write shares one budget across its batches. (low confidence) [source]
- Spring Data issue 5003 requested per-operation CSOT overrides; a June 16, 2025 contributor comment suggested waiting until the driver feature ceased being experimental. This establishes integration demand, not completed framework support. (low confidence) (verified as of 2025-06-16) [source]
- In Node.js, timeoutMS overrides socketTimeoutMS, waitQueueTimeoutMS, wTimeoutMS, maxTimeMS and maxCommitTimeMS. Ordinary per-operation overrides can customize a client-level budget. (high confidence) [source]
- Node.js documents CSOT as experimental. Its experimental-features policy permits behavior and TypeScript compatibility changes even in patch and minor releases. (high confidence) (verified as of 2026-10-23) [source]
- Node.js cursors support cursorLifetime and iteration timeout modes. Non-tailable cursors default to cursorLifetime; tailable cursors default to iteration, which budgets each next() call. (high confidence) [source]
- Node.js disallows an operation-level timeoutMS override within the explicit session passed to a withTransaction() callback. (high confidence) [source]
- A PyMongo timeout does not prove that a write had no effect: its documentation warns that a server-cancelled operation may have partially completed. PyMongoError.timeout identifies timeout-related failures. (low confidence) [source]
- Spring Data MongoDB issue #5003, opened June 15, 2025, requests per-operation timeoutMS overrides; the request demonstrates that driver functionality and framework-level configuration are separate integration concerns. (low confidence) [source]
Children
- Cursor timeout modes (frontier)
- CSOT connection churn and pending response draining (frontier)
- Timeout budgets across retries (frontier)
Frontier under this node: CSOT connection churn and pending response draining, Cursor timeout modes, Timeout budgets across retries