# error: context canceled

- **ID:** `go/context-canceled-propagated`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A parent context was canceled (or timed out) and child operations returned context.Canceled. Often caused by deferring cancel() too early or sharing a request context across background work.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.21+ | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   bg := context.WithoutCancel(ctx)
go func() { longRunning(bg) }()
   ```
2. **** (92% success)
   ```
   if errors.Is(err, context.Canceled) {
    return nil // expected shutdown
}
   ```

## Dead Ends

- **** — Hides real shutdown bugs and leaks resources; also masks timeout-induced failures. (60% fail)
- **** — Breaks request cancellation and leaks goroutines after client disconnect. (70% fail)
