python.grpc_no_deadline
Stability
High
Common in Incidents
Detects gRPC client calls without timeout parameter.
Why It Matters
Section titled “Why It Matters”gRPC calls without deadlines are dangerous:
- Infinite waits — If the server is unresponsive, the call waits forever
- Resource exhaustion — Stuck calls hold connections and threads
- Cascade failures — One slow service blocks all callers
- No recovery — Unlike HTTP, gRPC doesn’t have browser-style timeouts
Deadlines are a fundamental gRPC best practice. Google’s own gRPC documentation emphasizes this heavily.
Example
Section titled “Example”# ❌ Beforeresponse = stub.GetUser(request)If the server is slow or dead, this call never returns.
# ✅ Afterresponse = stub.GetUser(request, timeout=30.0)After 30 seconds, the call fails with DEADLINE_EXCEEDED.
What Unfault Detects
Section titled “What Unfault Detects”- gRPC stub method calls without
timeoutparameter - gRPC calls with
timeout=None - Missing deadline in streaming calls
Auto-Fix
Section titled “Auto-Fix”Unfault can add timeout=30.0 to gRPC calls when the pattern is recognized. Adjust based on your SLOs.
Best Practices
Section titled “Best Practices”# Set appropriate timeouts based on operation type# Quick lookupsuser = stub.GetUser(request, timeout=5.0)
# Slower operationsreport = stub.GenerateReport(request, timeout=60.0)
# Use deadline propagation in server handlersdef GetUser(self, request, context): # Pass the deadline to downstream calls remaining = context.time_remaining() data = downstream_stub.GetData(req, timeout=remaining)