# error: context deadline exceeded (goroutine worker)

- **ID:** `go/context-deadline-exceeded-worker`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A ctx with a deadline expired before the worker finished, often because the deadline was too short or a downstream call is slow.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.19 | active | — | — |
| 1.21 | active | — | — |
| 1.22 | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   Measure p99 latency and set deadline accordingly; propagate ctx everywhere:

ctx, cancel := context.WithTimeout(parent, 5*time.Second)
defer cancel()
   ```
2. **** (85% success)
   ```
   Add retries with exponential backoff for transient downstream timeouts.
   ```

## Dead Ends

- **** — Eliminates the safety net; slow calls can hang the goroutine indefinitely. (80% fail)
- **** — Arbitrary; if the downstream is genuinely slow, it still times out and the root latency issue remains. (70% fail)
