Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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(1), TimeSpan.Zero),
(TimeSpan.FromSeconds(6), TimeSpan.Zero),
(TimeSpan.FromSeconds(6), TimeSpan.Zero),
(TimeSpan.FromSeconds(10), TimeSpan.Zero),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update PR description with more context (based on our conversation)

};

private readonly IReadOnlyList<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> TimeoutsAndDelaysForNonPointReads = new List<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)>()
Expand Down
2 changes: 1 addition & 1 deletion Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
/// </summary>
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<T>(string variable, T defaultValue)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,13 +628,13 @@ public void HttpTimeoutPolicyForParitionFailoverForReads()
int count = 0;
while (availableRetries.MoveNext())
{
if (count == 0)
if (count <= 1)
{
Assert.AreEqual(new TimeSpan(0, 0, 1), availableRetries.Current.requestTimeout);
Assert.AreEqual(new TimeSpan(0, 0, 6), availableRetries.Current.requestTimeout);
}
else if (count == 1 || count ==2 )
else if (count == 2)
{
Assert.AreEqual(new TimeSpan(0, 0, 6), availableRetries.Current.requestTimeout);
Assert.AreEqual(new TimeSpan(0, 0, 10), availableRetries.Current.requestTimeout);
}
count++;
}
Expand Down
Loading