<!-- llms-explorer concept facts · https://llms-explorer.com/tree/client-side-operation-timeout-csot/ · pack 2026-10-24 · ~1910 tokens -->

# Client-side operation timeout (CSOT)

> Source-anchored research for Client-side operation timeout (CSOT). Run status: COMPLETED.

Parent: [MongoDB Query Shape Optimization: Sort, Pagination, Operators and Sharded Targeting](https://llms-explorer.com/tree/mongodb-query-shape-optimization-sort-pagination-operators-and-sharded-targeting/) · 6 facets · 23 facts · page: https://llms-explorer.com/tree/client-side-operation-timeout-csot/

## 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](https://www.mongodb.com/docs/drivers/node/current/connect/connection-options/csot.md)
- An unset timeoutMS preserves legacy behavior; zero means an infinite operation budget, but serverSelectionTimeoutMS can still apply. Negative values are invalid. (low confidence) — [source](https://github.com/mongodb/specifications/blob/master/source/client-side-operations-timeout/client-side-operations-timeout.md)

## How it works

- When timeoutMS is set, it overrides socketTimeoutMS, waitQueueTimeoutMS, wTimeoutMS, maxTimeMS, and maxCommitTimeMS. (high confidence) — [source](https://www.mongodb.com/docs/drivers/node/current/connect/connection-options/csot.md)
- 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](https://errors.standardbeagle.com/mongodb/node-mongodb-native/timed-out-during-connection-checkout/)
- 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](https://github.com/mongodb/specifications/blob/master/source/client-side-operations-timeout/client-side-operations-timeout.md)
- The specification deducts minimum network RTT when deriving server maxTimeMS. Insufficient remaining time can cause rejection before sending the command. (high confidence) — [source](https://github.com/mongodb/specifications/blob/master/source/client-side-operations-timeout/client-side-operations-timeout.md)
- 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](https://pkg.go.dev/github.com/go-dto/go-common@v0.2.0/database/mongodb)

## 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](https://www.mongodb.com/docs/drivers/node/current/connect/connection-options/csot.md)

## 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](https://jira.mongodb.org/browse/DRIVERS-2884)
- 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](https://pymongo.readthedocs.io/en/4.11.2/examples/timeouts.html)

## 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](https://www.mongodb.com/docs/drivers/node/current/connect/connection-options/csot.md)

## 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](https://github.com/mongodb/specifications/blob/master/source/client-side-operations-timeout/client-side-operations-timeout.md)
- Cursor cleanup gets a refreshed timeout for killCursors, so cleanup can extend beyond the original cursor budget. (high confidence) — [source](https://www.mongodb.com/docs/drivers/node/current/connect/connection-options/csot.md)
- The specification defines a best-effort deadline: transaction-abort cleanup can make withTransaction take up to twice timeoutMS. (low confidence) — [source](https://github.com/mongodb/specifications/blob/master/source/client-side-operations-timeout/client-side-operations-timeout.md)
- The specification retains serverSelectionTimeoutMS and connectTimeoutMS; timeoutMS=0 does not eliminate every other timeout. (low confidence) — [source](https://github.com/mongodb/specifications/blob/master/source/client-side-operations-timeout/client-side-operations-timeout.md)
- Eligible retries consume the same timeoutMS budget, and a multi-batch bulk write shares one budget across its batches. (low confidence) — [source](https://github.com/mongodb/specifications/blob/master/source/client-side-operations-timeout/client-side-operations-timeout.md)
- 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](https://github.com/spring-projects/spring-data-mongodb/issues/5003)
- In Node.js, timeoutMS overrides socketTimeoutMS, waitQueueTimeoutMS, wTimeoutMS, maxTimeMS and maxCommitTimeMS. Ordinary per-operation overrides can customize a client-level budget. (high confidence) — [source](https://www.mongodb.com/docs/drivers/node/current/connect/connection-options/csot.md)
- 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](https://www.mongodb.com/docs/drivers/node/current/connect/connection-options/csot.md)
- 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](https://github.com/mongodb/node-mongodb-native/blob/main/EXPERIMENTAL_FEATURES.md)
- Node.js disallows an operation-level timeoutMS override within the explicit session passed to a withTransaction() callback. (high confidence) — [source](https://www.mongodb.com/docs/drivers/node/current/connect/connection-options/csot.md)
- 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](https://pymongo.readthedocs.io/en/4.11.2/examples/timeouts.html)
- 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](https://github.com/spring-projects/spring-data-mongodb/issues/5003)
