gitaly: Compute initial_backoff for Gitaly client

What does this MR do and why?

A previous merge request allowed clients to configure the max_backoff and max_attempts of the retry policy of the Gitaly client.

See here:

But it turns out that the gRPC library caps the max attempts to 5, even if a user configure a much higher value.

That limitation defeats a bit the purpose of exposing those new fields to outside configuration. With the current hardcoded initial_backoff of 0.4 seconds, the maximum backoff time is 12.8 seconds, even if a clients set max_backoff to 20 seconds.

This commit introduces computing the initial backoff time from the max_backoff and max_attempts, essentially making max_backoff the maximum amount of time the client will keep on retrying.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Olivier Campeau

Merge request reports

Loading