rust.grpc_no_deadline
Stability
High
Detects gRPC calls without deadline/timeout configuration.
Why It Matters
Section titled “Why It Matters”Missing gRPC deadlines:
- Requests hang forever — No timeout means indefinite wait
- Resource exhaustion — Connections never released
- Cascading failures — Slow services block callers
Example
Section titled “Example”// ❌ Before (no deadline)async fn get_user(client: &UserServiceClient) -> User { client.get_user(GetUserRequest { id: 123 }).await?}// ✅ After (with deadline)use tonic::Request;use std::time::Duration;
async fn get_user(client: &UserServiceClient) -> User { let mut request = Request::new(GetUserRequest { id: 123 }); request.set_timeout(Duration::from_secs(5));
client.get_user(request).await?}What Unfault Detects
Section titled “What Unfault Detects”- Tonic client calls without set_timeout
- Missing deadline propagation
- gRPC streams without timeout
Auto-Fix
Section titled “Auto-Fix”Unfault can add timeout configuration to gRPC requests.