Skip to content

Commit

Permalink
Code changes to address cosmetic review comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
kundadebdatta committed Sep 17, 2024
1 parent 40560cc commit a198a04
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Microsoft.Azure.Cosmos/src/ClientRetryPolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ internal sealed class ClientRetryPolicy : IDocumentClientRetryPolicy
private int serviceUnavailableRetryCount;
private bool isReadRequest;
private bool canUseMultipleWriteLocations;
private bool isMultiMasterWriteRegion;
private bool isMultiMasterWriteRequest;
private Uri locationEndpoint;
private RetryContext retryContext;
private DocumentServiceRequest documentServiceRequest;
Expand All @@ -58,7 +58,7 @@ public ClientRetryPolicy(
this.sessionTokenRetryCount = 0;
this.serviceUnavailableRetryCount = 0;
this.canUseMultipleWriteLocations = false;
this.isMultiMasterWriteRegion = false;
this.isMultiMasterWriteRequest = false;
this.isPertitionLevelFailoverEnabled = isPertitionLevelFailoverEnabled;
}

Expand Down Expand Up @@ -192,7 +192,7 @@ public void OnBeforeSendRequest(DocumentServiceRequest request)
this.isReadRequest = request.IsReadOnlyRequest;
this.canUseMultipleWriteLocations = this.globalEndpointManager.CanUseMultipleWriteLocations(request);
this.documentServiceRequest = request;
this.isMultiMasterWriteRegion = !this.isReadRequest
this.isMultiMasterWriteRequest = !this.isReadRequest
&& (this.globalEndpointManager?.CanSupportMultipleWriteLocations(request) ?? false);

// clear previous location-based routing directive
Expand Down Expand Up @@ -518,7 +518,7 @@ private bool ShouldMarkEndpointUnavailableOnSystemResourceUnavailableForWrite(
HttpStatusCode? statusCode,
SubStatusCodes? subStatusCode)
{
return this.isMultiMasterWriteRegion
return this.isMultiMasterWriteRequest
&& statusCode.HasValue
&& (int)statusCode.Value == (int)StatusCodes.TooManyRequests
&& subStatusCode == SubStatusCodes.SystemResourceUnavailable;
Expand Down

0 comments on commit a198a04

Please sign in to comment.