# rpc error: code = DeadlineExceeded desc = context deadline exceeded

- **ID:** `go/grpc-deadline-exceeded-long-running`
- **Domain:** go
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The client set a deadline (via context.WithTimeout or context.WithDeadline) for the RPC, but the server took longer to respond than the allowed time.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.x | active | — | — |

## Workarounds

1. **** (70% success)
   ```
   Profile the handler and reduce database queries or external calls.
   ```
2. **** (80% success)
   ```
   ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second); defer cancel(); for i := 0; i < 3; i++ { err := client.Call(ctx, ...); if err == nil { break }; time.Sleep(time.Duration(i)*time.Second) }
   ```

## Dead Ends

- **** — This may hide the underlying performance issue and cause long hangs. (40% fail)
- **** — The server may have partially processed the request, leading to inconsistency. (90% fail)
