Why does idempotency matter when configuring retries in gRPC, and which calls are safe to retry?
Last updated
A retry may fire after the server already applied the request (e.g. the response was lost), so non-idempotent calls can duplicate side effects like double charges.
Safe to retry: reads, idempotent writes (upserts keyed by a stable ID), and failures where work never ran (e.g.
UNAVAILABLEon connect). Creates, increments, and appends need an idempotency key.Configure per method in the service config with
maxAttempts, backoff, andretryableStatusCodes, only for methods known to be safe.
- https://grpc.io/docs/guides/status-codes/
- https://grpc.io/docs/guides/wire/
- https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md
- https://github.com/grpc/proposal/blob/master/A6-client-retries.md?rgh-link-date=2019-09-04T16%3A17%3A40Z
- https://www.secondtalent.com/interview-guide/grpc-developers/
- https://medium.com/codeelevation/we-lost-500gb-of-data-because-of-this-one-configuration-e23c34a6902e
- https://prachub.com/resources/grpc-interview-questions-for-backend-engineers-protobuf-streaming-deadlines-and-retries
- https://platformwale.blog/2026/04/30/resilience-patterns-at-scale-exponential-backoff-jitter-retry-budgets-and-circuit-breakers-in-practice/