Skip to content

Commit

Permalink
Fix HttpTimeoutPolicies to not accidentally suppress retries
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianMeiswinkel committed Jun 27, 2023
1 parent abab80e commit d45830c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private HttpTimeoutPolicyControlPlaneRetriableHotPath(bool shouldThrow503OnTimeo

public override string TimeoutPolicyName => HttpTimeoutPolicyControlPlaneRetriableHotPath.Name;

public override TimeSpan MaximumRetryTimeLimit => CosmosHttpClient.GatewayRequestTimeout;
public override TimeSpan MaximumRetryTimeLimit => CosmosHttpClient.GatewayRequestTimeout + TimeSpan.FromSeconds(7.5); // 0.5s + 5 s + 65s + 1s delay + 1s buffer

public override int TotalRetryCount => this.TimeoutsAndDelays.Count;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private HttpTimeoutPolicyDefault(bool shouldThrow503OnTimeout)

public override string TimeoutPolicyName => HttpTimeoutPolicyDefault.Name;

public override TimeSpan MaximumRetryTimeLimit => CosmosHttpClient.GatewayRequestTimeout;
public override TimeSpan MaximumRetryTimeLimit => TimeSpan.FromSeconds((3 * CosmosHttpClient.GatewayRequestTimeout.TotalSeconds) + 1); // 3 times 65s + 1s delay + 1s buffer

public override int TotalRetryCount => this.TimeoutsAndDelays.Count;

Expand Down

0 comments on commit d45830c

Please sign in to comment.