concept

gRPC Status Codes

A fixed set of codes that classify failures and tell a client whether retrying is appropriate.

grpcerrorsretries

The set is deliberately small and its value is that it is uniform across every gRPC service in an estate, so generic retry middleware can behave correctly without knowing the service.

The ones that carry retry meaning: UNAVAILABLE — transient, retry with backoff. DEADLINE_EXCEEDED — out of time, do not retry at this layer. RESOURCE_EXHAUSTED — rate limited or out of quota, back off substantially. ABORTED — a concurrency conflict, retry at a higher level after re-reading. FAILED_PRECONDITION — do not retry until the state changes.

The distinction between UNAVAILABLE (retry) and FAILED_PRECONDITION / INVALID_ARGUMENT (do not) is the one that matters most, and returning the wrong code causes clients either to hammer a service that cannot succeed or to give up on something transient.

Detail carries in google.rpc.Status metadata rather than in the code itself.