Skip to content

Commit f2a5b62

Browse files
committed
Adding opentcptimeout
1 parent 93ccbb7 commit f2a5b62

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

articles/cosmos-db/nosql/troubleshoot-dotnet-sdk-request-timeout.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to diagnose and fix .NET SDK request timeout exceptions.
44
author: seesharprun
55
ms.service: cosmos-db
66
ms.subservice: nosql
7-
ms.date: 09/16/2022
7+
ms.date: 09/15/2023
88
ms.author: sidandrews
99
ms.topic: troubleshooting
1010
ms.reviewer: mjbrown
@@ -28,13 +28,17 @@ When evaluating the case for timeout errors:
2828

2929
The SDK has two distinct alternatives to control timeouts, each with a different scope.
3030

31-
### RequestTimeout
31+
### Request level timeouts
3232

33-
The `CosmosClientOptions.RequestTimeout` (or `ConnectionPolicy.RequestTimeout` for SDK v2) configuration allows you to set a timeout that affects each individual network request. An operation started by a user can span multiple network requests (for example, there could be throttling). This configuration would apply for each network request on the retry. This timeout isn't an end-to-end operation request timeout.
33+
The `CosmosClientOptions.RequestTimeout` (or `ConnectionPolicy.RequestTimeout` for SDK v2) configuration allows you to set a timeout for the network request after the request left the SDK and is on the network, until a response is received.
34+
35+
The `CosmosClientOptions.OpenTcpConnectionTimeout` (or `ConnectionPolicy.OpenTcpConnectionTimeout` for SDK v2) configuration allows you to set a timeout for the time spent opening an initial connection. Once a connection is opened, subsequent requests will use the connection.
36+
37+
An operation started by a user can span multiple network requests, for example, retries. These two configurations are per-request, not end-to-end for an operation.
3438

3539
### CancellationToken
3640

37-
All the async operations in the SDK have an optional CancellationToken parameter. This [CancellationToken](/dotnet/standard/threading/how-to-listen-for-cancellation-requests-by-polling) parameter is used throughout the entire operation, across all network requests. In between network requests, the cancellation token might be checked and an operation canceled if the related token is expired. The cancellation token should be used to define an approximate expected timeout on the operation scope.
41+
All the async operations in the SDK have an optional CancellationToken parameter. This [CancellationToken](/dotnet/standard/threading/how-to-listen-for-cancellation-requests-by-polling) parameter is used throughout the entire operation, across all network requests and retries. In between network requests, the cancellation token might be checked and an operation canceled if the related token is expired. The cancellation token should be used to define an approximate expected timeout on the operation scope.
3842

3943
> [!NOTE]
4044
> The `CancellationToken` parameter is a mechanism where the library will check the cancellation when it [won't cause an invalid state](https://devblogs.microsoft.com/premier-developer/recommended-patterns-for-cancellationtoken/). The operation might not cancel exactly when the time defined in the cancellation is up. Instead, after the time is up, it cancels when it's safe to do so.

0 commit comments

Comments
 (0)