# DEADLINE_EXCEEDED: grpc: write deadline exceeded on stream 456 after 10000ms

- **ID:** `grpc/write-deadline-exceeded-on-stream`
- **Domain:** grpc
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The server took too long to write data to the stream, exceeding the configured write deadline, often due to slow network or blocked I/O.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| gRPC C++ 1.60.0 | active | — | — |
| gRPC Core 1.61.0 | active | — | — |
| gRPC Ruby 1.62.0 | active | — | — |

## Workarounds

1. **Configure write deadline via channel args: `export GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE=65536` and set `GRPC_ARG_KEEPALIVE_TIME_MS=10000` to detect dead connections faster** (80% success)
   ```
   Configure write deadline via channel args: `export GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE=65536` and set `GRPC_ARG_KEEPALIVE_TIME_MS=10000` to detect dead connections faster
   ```
2. **In server code, use a separate goroutine with `context.WithTimeout` for write operations to handle slow clients gracefully** (85% success)
   ```
   In server code, use a separate goroutine with `context.WithTimeout` for write operations to handle slow clients gracefully
   ```

## Dead Ends

- **Increase the overall RPC deadline only, ignoring write deadline** — Write deadline is separate; increased RPC deadline won't fix write-specific timeout. (70% fail)
- **Restart the server to clear the stream state** — The underlying network issue or blocking I/O persists. (80% fail)
- **Set a very large write deadline (e.g., 60s) without investigating root cause** — Masks the issue; slow writes can still cause user-perceived timeouts. (50% fail)
