You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -583,6 +583,18 @@ public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosm
583
583
returnthis;
584
584
}
585
585
586
+
/// <summary>
587
+
/// Sets the maximum number of in-region retries for session retry policy.
588
+
/// </summary>
589
+
/// <param name="maxInRegionRetryCount">The maximum number of retries within each region for read and write operations.
590
+
/// use value of less than or equal to 0 for this parameter with care as this will have negative consequences for multi-master and some other scenerios.</param>
/// Sets the maximum number of retries within each region for read and write operations. The minimum value is 1 - the backoff time for the last in-region retry will ensure that the total retry time within the
31
+
/// Sets the maximum number of retries within each region for read and write operations - the backoff time for the last in-region retry will ensure that the total retry time within the
32
32
/// region is at least the min. in-region retry time.
33
33
/// </summary>
34
-
publicintMaxInRegionRetryCount{get;privateset;}
34
+
publicintMaxInRegionRetryCount{get;internalset;}
35
35
36
36
/// <summary>
37
37
/// hints which guide SDK-internal retry policies on how early to switch retries to a different region. If true, will retry all replicas once and add a minimum delay before switching to the next region.If false, it will
/// intent is If a client specify a value, we will force it to be atleast 1, otherwise default is going to be 1(right now both the values are 1 but we have the provision to change them in future).
83
+
/// If a client specify a value less than or equal to 0 we will not retry and yield after the original attempt, otherwise default is going to be 1
Assert.AreEqual(0,options.SessionRetryOptions.MaxInRegionRetryCount,"Should allow setting MaxInRegionRetryCount to 0 via CosmosClientOptions");
47
+
48
+
// Set to negative
49
+
options.MaxInRegionRetryCountForSessionRetry=-10;
50
+
Assert.AreEqual(-10,options.SessionRetryOptions.MaxInRegionRetryCount,"Should allow setting MaxInRegionRetryCount to negative value via CosmosClientOptions");
0 commit comments