python-sdk
python-sdk copied to clipboard
WIP: Retry with native grpc
Description
This is one of the possible options we're looking at for implementing retry policies.
gRPC specifies that retry policy definitions should be defined on the service itself and transmitted to the client through the service config mechanism (https://github.com/grpc/proposal/blob/master/A6-client-retries.md). All gRPC clients are supposed to execute the retries, based on the policy.
This PR specifies the retry policy service config on the client. It's a very clean way to do it, with minimal code change, but there's two main drawbacks:
- It doesn't handle statuses that have a
RetryInfodetail where the server instructs the client when it should retry the request - It can not handle the requirement for infinite retries defined in our proposal, the maximum retry attempts it allows is 5.