Retries are not working because incoming configs use string gRPC codes while gRPC exceptions use numeric codes
dazuma opened this issue · 0 comments
AFAICT no retries are currently working in the generated clients. This is because input grpc_service_config.json files use the string forms of gRPC error codes (e.g. "UNAVAILABLE"
or "DEADLINE_EXCEEDED"
) and the generator is copying those as strings into the default RPC configs. However, the retry logic in gapic-common is comparing those string codes with the numeric codes from GRPC::BadStatus#code
. As a result, the retry logic thinks that no error is retryable.
We should fix this in two places. (Technically, only one or the other is sufficient, but for safety I think it's better to do both.)
Gapic::CallOptions::RetryPolicy
should include logic that maps string retry codes to their numeric equivalents before comparing them with the incoming gRPC error code.- When the generator generates initial RPC configs from the grpc_service_config.json data, it should map string codes to numeric codes.
The mapping is defined at https://developers.google.com/maps-booking/reference/grpc-api/status_codes
We will release a fixed gapic-common gem, and a fixed generator. This will regenerate all versioned gems.