Skip to content

go.grpc.missing_deadline

Stability Critical

Detects gRPC calls without deadline or timeout.

gRPC calls without deadlines:

  • Resource exhaustion — Hanging calls consume connections
  • Cascading failures — Slow services block callers indefinitely
  • No failure feedback — Clients wait forever
// ❌ Before (no deadline)
resp, err := client.GetUser(context.Background(), req)
// ✅ After (with deadline)
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
resp, err := client.GetUser(ctx, req)
if err != nil {
if status.Code(err) == codes.DeadlineExceeded {
// Handle timeout
}
return nil, err
}
  • gRPC client calls with context.Background()
  • Missing context.WithTimeout or WithDeadline
  • Unreasonably long timeout values

Unfault can wrap gRPC calls with appropriate timeout contexts.