From 751bef5aa26c2f3717ce422c6a270fbf34d947eb Mon Sep 17 00:00:00 2001 From: Praveen Kolluri Date: Fri, 14 Nov 2025 09:23:21 -0800 Subject: [PATCH 1/4] PPAF: Fixes http first retry timeout value to be configurable for point reads --- .../HttpTimeoutPolicyForPartitionFailover.cs | 2 +- .../src/Util/ConfigurationManager.cs | 22 ++++++++++++- .../CosmosHttpClientCoreTests.cs | 32 +++++++++++++++++++ 3 files changed, 54 insertions(+), 2 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyForPartitionFailover.cs b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyForPartitionFailover.cs index b4606ab1e4..a2c2175dc3 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyForPartitionFailover.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyForPartitionFailover.cs @@ -24,7 +24,7 @@ private HttpTimeoutPolicyForPartitionFailover(bool isPointRead) // For non-point reads: 3 attempts with timeouts of 6s, 6s, and 10s respectively. private readonly IReadOnlyList<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> TimeoutsAndDelaysForPointReads = new List<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)>() { - (TimeSpan.FromSeconds(1), TimeSpan.Zero), + (TimeSpan.FromSeconds(ConfigurationManager.GetHttpFirstRetryTimeoutForPPAFPointReadsInSeconds()), TimeSpan.Zero), (TimeSpan.FromSeconds(6), TimeSpan.Zero), (TimeSpan.FromSeconds(6), TimeSpan.Zero), }; diff --git a/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs b/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs index b5b4d8eec2..2ca0bacb74 100644 --- a/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs +++ b/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs @@ -123,7 +123,12 @@ internal static class ConfigurationManager /// By default length aware range comparator is enabled. Refer to Range.cs in Msdata project for more details. Range.LengthAwareMinComparer/LengthAwareMaxComparer. /// Setting the value to false will disable length aware range comparator and switch to using the regular Range.MinComparer/MaxComparer. /// - internal static readonly string UseLengthAwareRangeComparator = "AZURE_COSMOS_USE_LENGTH_AWARE_RANGE_COMPARATOR"; + internal static readonly string UseLengthAwareRangeComparator = "AZURE_COSMOS_USE_LENGTH_AWARE_RANGE_COMPARATOR"; + + /// + /// A read-only string containing the environment variable name for capturing the http first retry timeout in seconds applicable for PPAF point reads + /// + internal static readonly string HttpFirstRetryTimeoutForPPAFPointReads = "AZURE_COSMOS_PPAF_POINT_READS_HTTP_FIRST_RETY_TIMEOUT_IN_SECONDS"; public static T GetEnvironmentVariable(string variable, T defaultValue) { @@ -400,6 +405,21 @@ public static bool IsLengthAwareRangeComparatorEnabled() .GetEnvironmentVariable( variable: ConfigurationManager.UseLengthAwareRangeComparator, defaultValue: defaultValue); + } + + /// + /// Gets http retry timeout value for first retry in case of PPAF point reads. + /// The default value is 1 second. The user can set the respective + /// environment variable 'AZURE_COSMOS_PPAF_POINT_READS_HTTP_FIRST_RETY_TIMEOUT_IN_SECONDS' + /// to override the value. + /// + /// An integer representing the refresh interval in seconds. + public static int GetHttpFirstRetryTimeoutForPPAFPointReadsInSeconds() + { + return ConfigurationManager + .GetEnvironmentVariable( + variable: ConfigurationManager.HttpFirstRetryTimeoutForPPAFPointReads, + defaultValue: 1); } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs index 6217444a36..8296c91f70 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs @@ -640,6 +640,38 @@ public void HttpTimeoutPolicyForParitionFailoverForReads() } } + [TestMethod] + public void HttpTimeoutPolicyForParitionFailoverConfigurableTimeoutForReads() + { + Environment.SetEnvironmentVariable(ConfigurationManager.HttpFirstRetryTimeoutForPPAFPointReads, "4"); + try + { + HttpTimeoutPolicy httpTimeoutPolicyForQuery = HttpTimeoutPolicy.GetTimeoutPolicy( + documentServiceRequest: CosmosHttpClientCoreTests.CreateDocumentServiceRequestByOperation(ResourceType.Document, OperationType.Read), + isPartitionLevelFailoverEnabled: true, + isThinClientEnabled: false); + IEnumerator<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> availableRetries = httpTimeoutPolicyForQuery.GetTimeoutEnumerator(); + + int count = 0; + while (availableRetries.MoveNext()) + { + if (count == 0) + { + Assert.AreEqual(new TimeSpan(0, 0, 4), availableRetries.Current.requestTimeout); + } + else if (count == 1 || count == 2) + { + Assert.AreEqual(new TimeSpan(0, 0, 6), availableRetries.Current.requestTimeout); + } + count++; + } + } + finally + { + Environment.SetEnvironmentVariable(ConfigurationManager.HttpFirstRetryTimeoutForPPAFPointReads, null); + } + } + private static DocumentServiceRequest CreateDocumentServiceRequestByOperation( ResourceType resourceType, OperationType operationType) From d35b0b90dabf914d03e29c0881b5d39bfcb52aa8 Mon Sep 17 00:00:00 2001 From: Praveen Kolluri Date: Fri, 14 Nov 2025 11:39:59 -0800 Subject: [PATCH 2/4] Keep same timeouts for PPAF point reads and non-point reads, remove the configurable timeouts. --- .../HttpTimeoutPolicyForPartitionFailover.cs | 4 +- .../src/Util/ConfigurationManager.cs | 20 ---------- .../CosmosHttpClientCoreTests.cs | 40 ++----------------- 3 files changed, 6 insertions(+), 58 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyForPartitionFailover.cs b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyForPartitionFailover.cs index a2c2175dc3..c93bde7cd4 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyForPartitionFailover.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyForPartitionFailover.cs @@ -20,13 +20,13 @@ private HttpTimeoutPolicyForPartitionFailover(bool isPointRead) } // Timeouts and delays are based on the following rationale: - // For point reads: 3 attempts with timeouts of 1s, 6s, and 6s respectively. + // For point reads: 3 attempts with timeouts of 6s, 6s, and 10s respectively. // For non-point reads: 3 attempts with timeouts of 6s, 6s, and 10s respectively. private readonly IReadOnlyList<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> TimeoutsAndDelaysForPointReads = new List<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)>() { - (TimeSpan.FromSeconds(ConfigurationManager.GetHttpFirstRetryTimeoutForPPAFPointReadsInSeconds()), TimeSpan.Zero), (TimeSpan.FromSeconds(6), TimeSpan.Zero), (TimeSpan.FromSeconds(6), TimeSpan.Zero), + (TimeSpan.FromSeconds(10), TimeSpan.Zero), }; private readonly IReadOnlyList<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> TimeoutsAndDelaysForNonPointReads = new List<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)>() diff --git a/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs b/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs index 2ca0bacb74..2b2c86cd5b 100644 --- a/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs +++ b/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs @@ -124,11 +124,6 @@ internal static class ConfigurationManager /// Setting the value to false will disable length aware range comparator and switch to using the regular Range.MinComparer/MaxComparer. /// internal static readonly string UseLengthAwareRangeComparator = "AZURE_COSMOS_USE_LENGTH_AWARE_RANGE_COMPARATOR"; - - /// - /// A read-only string containing the environment variable name for capturing the http first retry timeout in seconds applicable for PPAF point reads - /// - internal static readonly string HttpFirstRetryTimeoutForPPAFPointReads = "AZURE_COSMOS_PPAF_POINT_READS_HTTP_FIRST_RETY_TIMEOUT_IN_SECONDS"; public static T GetEnvironmentVariable(string variable, T defaultValue) { @@ -405,21 +400,6 @@ public static bool IsLengthAwareRangeComparatorEnabled() .GetEnvironmentVariable( variable: ConfigurationManager.UseLengthAwareRangeComparator, defaultValue: defaultValue); - } - - /// - /// Gets http retry timeout value for first retry in case of PPAF point reads. - /// The default value is 1 second. The user can set the respective - /// environment variable 'AZURE_COSMOS_PPAF_POINT_READS_HTTP_FIRST_RETY_TIMEOUT_IN_SECONDS' - /// to override the value. - /// - /// An integer representing the refresh interval in seconds. - public static int GetHttpFirstRetryTimeoutForPPAFPointReadsInSeconds() - { - return ConfigurationManager - .GetEnvironmentVariable( - variable: ConfigurationManager.HttpFirstRetryTimeoutForPPAFPointReads, - defaultValue: 1); } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs index 8296c91f70..fa8a5a1406 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs @@ -628,47 +628,15 @@ public void HttpTimeoutPolicyForParitionFailoverForReads() int count = 0; while (availableRetries.MoveNext()) { - if (count == 0) - { - Assert.AreEqual(new TimeSpan(0, 0, 1), availableRetries.Current.requestTimeout); - } - else if (count == 1 || count ==2 ) + if (count <= 1) { Assert.AreEqual(new TimeSpan(0, 0, 6), availableRetries.Current.requestTimeout); } - count++; - } - } - - [TestMethod] - public void HttpTimeoutPolicyForParitionFailoverConfigurableTimeoutForReads() - { - Environment.SetEnvironmentVariable(ConfigurationManager.HttpFirstRetryTimeoutForPPAFPointReads, "4"); - try - { - HttpTimeoutPolicy httpTimeoutPolicyForQuery = HttpTimeoutPolicy.GetTimeoutPolicy( - documentServiceRequest: CosmosHttpClientCoreTests.CreateDocumentServiceRequestByOperation(ResourceType.Document, OperationType.Read), - isPartitionLevelFailoverEnabled: true, - isThinClientEnabled: false); - IEnumerator<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> availableRetries = httpTimeoutPolicyForQuery.GetTimeoutEnumerator(); - - int count = 0; - while (availableRetries.MoveNext()) + else if (count == 2) { - if (count == 0) - { - Assert.AreEqual(new TimeSpan(0, 0, 4), availableRetries.Current.requestTimeout); - } - else if (count == 1 || count == 2) - { - Assert.AreEqual(new TimeSpan(0, 0, 6), availableRetries.Current.requestTimeout); - } - count++; + Assert.AreEqual(new TimeSpan(0, 0, 10), availableRetries.Current.requestTimeout); } - } - finally - { - Environment.SetEnvironmentVariable(ConfigurationManager.HttpFirstRetryTimeoutForPPAFPointReads, null); + count++; } } From 12fdc132df4a04ec6aef923c3200b1564a306ada Mon Sep 17 00:00:00 2001 From: Praveen Kolluri Date: Fri, 14 Nov 2025 12:13:16 -0800 Subject: [PATCH 3/4] Separate the timeouts for point reads and non-point-reads for thin-client http policy. --- .../src/HttpClient/HttpTimeoutPolicy.cs | 13 +++-- .../HttpTimeoutPolicyForThinClient.cs | 29 +++++++---- .../src/Util/ConfigurationManager.cs | 2 +- .../CosmosHttpClientCoreTests.cs | 50 ++++++++++++++++++- 4 files changed, 80 insertions(+), 14 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs index 1120dce759..84cbd0a64f 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs @@ -48,9 +48,16 @@ public static HttpTimeoutPolicy GetTimeoutPolicy( { if (isThinClientEnabled) { - return documentServiceRequest.IsReadOnlyRequest - ? HttpTimeoutPolicyForThinClient.InstanceShouldRetryAndThrow503OnTimeout - : HttpTimeoutPolicyForThinClient.InstanceShouldNotRetryAndThrow503OnTimeout; + if (documentServiceRequest.IsReadOnlyRequest) + { + return documentServiceRequest.OperationType == OperationType.Read + ? HttpTimeoutPolicyForThinClient.InstanceShouldRetryAndThrow503OnTimeoutForPointReads + : HttpTimeoutPolicyForThinClient.InstanceShouldRetryAndThrow503OnTimeoutForNonPointReads; + } + else + { + return HttpTimeoutPolicyForThinClient.InstanceShouldNotRetryAndThrow503OnTimeout; + } } // Data Plane Reads. else if (documentServiceRequest.IsReadOnlyRequest) diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyForThinClient.cs b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyForThinClient.cs index 4f1d9f598f..46e9170edc 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyForThinClient.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyForThinClient.cs @@ -11,32 +11,43 @@ internal sealed class HttpTimeoutPolicyForThinClient : HttpTimeoutPolicy { public bool shouldRetry; public bool shouldThrow503OnTimeout; + public bool isPointRead; private static readonly string Name = nameof(HttpTimeoutPolicyForThinClient); - public static readonly HttpTimeoutPolicy InstanceShouldRetryAndThrow503OnTimeout = new HttpTimeoutPolicyForThinClient(true, true); - public static readonly HttpTimeoutPolicy InstanceShouldNotRetryAndThrow503OnTimeout = new HttpTimeoutPolicyForThinClient(true, false); + public static readonly HttpTimeoutPolicy InstanceShouldRetryAndThrow503OnTimeoutForPointReads = new HttpTimeoutPolicyForThinClient(shouldThrow503OnTimeout: true, shouldRetry: true, isPointRead: true); + public static readonly HttpTimeoutPolicy InstanceShouldRetryAndThrow503OnTimeoutForNonPointReads = new HttpTimeoutPolicyForThinClient(shouldThrow503OnTimeout: true, shouldRetry: true, isPointRead: false); + public static readonly HttpTimeoutPolicy InstanceShouldNotRetryAndThrow503OnTimeout = new HttpTimeoutPolicyForThinClient(shouldThrow503OnTimeout: true, shouldRetry: false, isPointRead: false); private HttpTimeoutPolicyForThinClient( bool shouldThrow503OnTimeout, - bool shouldRetry) + bool shouldRetry, + bool isPointRead) { this.shouldThrow503OnTimeout = shouldThrow503OnTimeout; this.shouldRetry = shouldRetry; + this.isPointRead = isPointRead; } - private readonly IReadOnlyList<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> TimeoutsAndDelays = new List<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)>() + private readonly IReadOnlyList<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> TimeoutsAndDelaysForPointReads = new List<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)>() { - (TimeSpan.FromSeconds(.5), TimeSpan.Zero), - (TimeSpan.FromSeconds(1), TimeSpan.Zero), - (TimeSpan.FromSeconds(5), TimeSpan.Zero), + (TimeSpan.FromSeconds(6), TimeSpan.Zero), + (TimeSpan.FromSeconds(6), TimeSpan.Zero), + (TimeSpan.FromSeconds(10), TimeSpan.Zero), + }; + + private readonly IReadOnlyList<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> TimeoutsAndDelaysForNonPointReads = new List<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)>() + { + (TimeSpan.FromSeconds(6), TimeSpan.Zero), + (TimeSpan.FromSeconds(6), TimeSpan.Zero), + (TimeSpan.FromSeconds(10), TimeSpan.Zero), }; public override string TimeoutPolicyName => HttpTimeoutPolicyForThinClient.Name; - public override int TotalRetryCount => this.TimeoutsAndDelays.Count; + public override int TotalRetryCount => this.isPointRead ? this.TimeoutsAndDelaysForPointReads.Count : this.TimeoutsAndDelaysForNonPointReads.Count; public override IEnumerator<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> GetTimeoutEnumerator() { - return this.TimeoutsAndDelays.GetEnumerator(); + return this.isPointRead ? this.TimeoutsAndDelaysForPointReads.GetEnumerator() : this.TimeoutsAndDelaysForNonPointReads.GetEnumerator(); } public override bool ShouldRetryBasedOnResponse(HttpMethod requestHttpMethod, HttpResponseMessage responseMessage) diff --git a/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs b/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs index 2b2c86cd5b..b5b4d8eec2 100644 --- a/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs +++ b/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs @@ -123,7 +123,7 @@ internal static class ConfigurationManager /// By default length aware range comparator is enabled. Refer to Range.cs in Msdata project for more details. Range.LengthAwareMinComparer/LengthAwareMaxComparer. /// Setting the value to false will disable length aware range comparator and switch to using the regular Range.MinComparer/MaxComparer. /// - internal static readonly string UseLengthAwareRangeComparator = "AZURE_COSMOS_USE_LENGTH_AWARE_RANGE_COMPARATOR"; + internal static readonly string UseLengthAwareRangeComparator = "AZURE_COSMOS_USE_LENGTH_AWARE_RANGE_COMPARATOR"; public static T GetEnvironmentVariable(string variable, T defaultValue) { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs index fa8a5a1406..4d4eb201a2 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs @@ -619,10 +619,58 @@ public void HttpTimeoutPolicyForParitionFailoverForQueries() [TestMethod] public void HttpTimeoutPolicyForParitionFailoverForReads() { - HttpTimeoutPolicy httpTimeoutPolicyForQuery = HttpTimeoutPolicy.GetTimeoutPolicy( + HttpTimeoutPolicy httpTimeoutPolicyForPointReads = HttpTimeoutPolicy.GetTimeoutPolicy( documentServiceRequest: CosmosHttpClientCoreTests.CreateDocumentServiceRequestByOperation(ResourceType.Document, OperationType.Read), isPartitionLevelFailoverEnabled: true, isThinClientEnabled: false); + IEnumerator<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> availableRetries = httpTimeoutPolicyForPointReads.GetTimeoutEnumerator(); + + int count = 0; + while (availableRetries.MoveNext()) + { + if (count <= 1) + { + Assert.AreEqual(new TimeSpan(0, 0, 6), availableRetries.Current.requestTimeout); + } + else if (count == 2) + { + Assert.AreEqual(new TimeSpan(0, 0, 10), availableRetries.Current.requestTimeout); + } + count++; + } + } + + [TestMethod] + public void HttpTimeoutPolicyWhenThinClientEnabledForPointReads() + { + HttpTimeoutPolicy httpTimeoutPolicyForPointReads = HttpTimeoutPolicy.GetTimeoutPolicy( + documentServiceRequest: CosmosHttpClientCoreTests.CreateDocumentServiceRequestByOperation(ResourceType.Document, OperationType.Read), + isPartitionLevelFailoverEnabled: false, + isThinClientEnabled: true); + IEnumerator<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> availableRetries = httpTimeoutPolicyForPointReads.GetTimeoutEnumerator(); + + int count = 0; + while (availableRetries.MoveNext()) + { + if (count <= 1) + { + Assert.AreEqual(new TimeSpan(0, 0, 6), availableRetries.Current.requestTimeout); + } + else if (count == 2) + { + Assert.AreEqual(new TimeSpan(0, 0, 10), availableRetries.Current.requestTimeout); + } + count++; + } + } + + [TestMethod] + public void HttpTimeoutPolicyWhenThinClientEnabledForNonPointReads() + { + HttpTimeoutPolicy httpTimeoutPolicyForQuery = HttpTimeoutPolicy.GetTimeoutPolicy( + documentServiceRequest: CosmosHttpClientCoreTests.CreateDocumentServiceRequestByOperation(ResourceType.Document, OperationType.Query), + isPartitionLevelFailoverEnabled: false, + isThinClientEnabled: true); IEnumerator<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> availableRetries = httpTimeoutPolicyForQuery.GetTimeoutEnumerator(); int count = 0; From 06b7153451548cb1f896a1f4b55601943df30c1a Mon Sep 17 00:00:00 2001 From: Praveen Kolluri Date: Fri, 14 Nov 2025 13:27:56 -0800 Subject: [PATCH 4/4] Update the instance name to InstanceShouldNotRetryAndThrow503OnTimeoutForWrites --- Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs | 2 +- .../src/HttpClient/HttpTimeoutPolicyForThinClient.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs index 84cbd0a64f..f5eb179c66 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs @@ -56,7 +56,7 @@ public static HttpTimeoutPolicy GetTimeoutPolicy( } else { - return HttpTimeoutPolicyForThinClient.InstanceShouldNotRetryAndThrow503OnTimeout; + return HttpTimeoutPolicyForThinClient.InstanceShouldNotRetryAndThrow503OnTimeoutForWrites; } } // Data Plane Reads. diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyForThinClient.cs b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyForThinClient.cs index 46e9170edc..7693c5940f 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyForThinClient.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyForThinClient.cs @@ -15,7 +15,7 @@ internal sealed class HttpTimeoutPolicyForThinClient : HttpTimeoutPolicy private static readonly string Name = nameof(HttpTimeoutPolicyForThinClient); public static readonly HttpTimeoutPolicy InstanceShouldRetryAndThrow503OnTimeoutForPointReads = new HttpTimeoutPolicyForThinClient(shouldThrow503OnTimeout: true, shouldRetry: true, isPointRead: true); public static readonly HttpTimeoutPolicy InstanceShouldRetryAndThrow503OnTimeoutForNonPointReads = new HttpTimeoutPolicyForThinClient(shouldThrow503OnTimeout: true, shouldRetry: true, isPointRead: false); - public static readonly HttpTimeoutPolicy InstanceShouldNotRetryAndThrow503OnTimeout = new HttpTimeoutPolicyForThinClient(shouldThrow503OnTimeout: true, shouldRetry: false, isPointRead: false); + public static readonly HttpTimeoutPolicy InstanceShouldNotRetryAndThrow503OnTimeoutForWrites = new HttpTimeoutPolicyForThinClient(shouldThrow503OnTimeout: true, shouldRetry: false, isPointRead: false); private HttpTimeoutPolicyForThinClient( bool shouldThrow503OnTimeout,