gRPC clients see `rpc error: code = DeadlineExceeded desc = context deadline exceeded` even though the server logs show requests finishing in 200 ms.
AdvancedTroubleshootingReliability Patterns in Production
Answer
Likely causes → The deadline is consumed before the request reaches this server: an upstream caller set a short overall deadline and earlier hops used most of it, or queueing (client-side connection limits, server max concurrent streams) delays the start. Server logs measure only processing time.
Diagnose → Use distributed traces to see where time is spent across hops; check the grpc-timeout header received by the server and client-side queueing metrics.
Fix → Rebalance deadlines along the chain, parallelize calls, remove queueing (raise MaxConcurrentStreams, add connections), and fail fast when remaining deadline is too small.
Prevent → Define latency budgets per hop from the top-level SLO, and propagate deadlines everywhere.
More on Reliability Patterns in Production
Clients get 503s with body `upstream connect error or disconnect/reset before headers. reset reason: overflow`, and Envoy logs show flag `UO`.AdvancedNGINX ingress returns 504 and logs `upstream timed out (110: Connection timed out) while reading response header from upstream`.BeginnerAfter a 30-second database blip, Postgres keeps rejecting connections with `FATAL: sorry, too many clients already` for 20 minutes.AdvancedCustomers were charged twice during an incident where the payment API timed out.AdvancedEvery rolling deploy produces a short burst of 502s on the AWS ALB.IntermediateRedis restarted and immediately the database CPU hit 100% and the site went down.Advanced