The overall method timeout for collection admin operations.
Such methods include (but may not be limited to):
db.createCollection()
db.dropCollection()
db.listCollections()
collection.options()
Default: 1 minute
The overall method timeout for database admin operations.
Such methods include (but may not be limited to):
admin.createDatabase()
admin.dropDatabase()
admin.listDatabases()
dbAdmin.info()
dbAdmin.findEmbeddingProviders()
Default: 10 minutes
The overall method timeout for methods that don't have a specific overall method timeout.
Mostly applies to document/row-level operations. DDL-esque operations (working with collections, tables, databases, keyspaces, indexes, etc.) have their own overall method timeouts.
In single-call methods, such as insertOne
, the minimum of requestTimeoutMs
and generalMethodTimeoutMs
is used as the timeout.
In multi-call methods, such as insertMany
, the requestTimeoutMs
is used as the timeout for each individual call, and the generalMethodTimeoutMs
is used as the timeout for the entire method.
Default: 30 seconds
The overall method timeout for keyspace admin operations.
Such methods include (but may not be limited to):
admin.createKeyspace()
admin.dropKeyspace()
admin.listKeyspaces()
Default: 30 seconds
The maximum time the client will wait for a response from the server.
Note that it is technically possible for a request to time out, but still have the request be processed, and even succeed, on the server.
Every HTTP call will use a requestTimeout
, except for very special cases (at the moment, only createCollection
, where the request may take a long time to return).
Default: 10 seconds
The overall method timeout for table admin operations.
Such methods include (but may not be limited to):
db.createTable()
db.dropTable()
db.listTables()
table.alter()
table.createIndex()
db.dropTableIndex()
table.definition()
Default: 30 seconds
Overview
The generic timeout descriptor that is used to define the timeout for all the various operations supported by the DataAPIClient and its children.
Inheritance
The TimeoutDescriptor, or a subset of it, may be specified at any level of the client hierarchy, all the way from the DataAPIClient down to the individual methods. The timeout specified at a lower level will override the timeout specified at a higher level (through a typical object merge).
Example
The
WithTimeout
interfaceThe WithTimeout interface lets you specify timeouts for individual methods, in two different formats:
Example
Example
Timeout types
There are 6 generalized categories of timeouts, each with its own default values.
In general though, two types of timeouts are always in play:
requestTimeoutMs
, which is the maximum time the client will wait for a response from the server.Timeout behavior depends on the type of method being called:
requestTimeoutMs
is used as the timeout for each individual call, and the overall method timeout is used as the timeout for the entire method.This two-part timeout system is used in all methods but, but for a special few, where the overall method timeout is the only one used (only
createCollection
, at the moment). This is because the method is a single call, but it takes a long time for the server to complete.If any timeout is set to
0
, that category is effectively disabled.Timeout categories
See each individual field for more information, but in general, the timeouts are as follows:
requestTimeoutMs
:generalMethodTimeoutMs
:collectionAdminTimeoutMs
:tableAdminTimeoutMs
:databaseAdminTimeoutMs
:keyspaceAdminTimeoutMs
:See
WithTimeout