# error: context canceled (goroutine worker returned)

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

## Root Cause

A parent context was canceled (deadline, manual cancel, or HTTP client disconnect) and the worker goroutine observes ctx.Err() == context.Canceled.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.20 | active | — | — |
| 1.21 | active | — | — |
| 1.22 | active | — | — |
| 1.23 | active | — | — |

## Workarounds

1. **** (92% success)
   ```
   Treat context.Canceled as expected and return without error at shutdown:

if errors.Is(err, context.Canceled) {
    return nil
}
   ```
2. **** (90% success)
   ```
   Propagate the context through all calls and check ctx.Err() at loop boundaries.
   ```

## Dead Ends

- **** — The context remains canceled; retries fail immediately and waste resources. (90% fail)
- **** — Leaks the goroutine past shutdown and defeats the purpose of cancellation. (85% fail)
