# error: context canceled while worker still processing (ctx not checked in loop)

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

## Root Cause

Long-running goroutines select only on data channels and never check ctx.Done(), so cancellation does not stop them; they keep working and may block shutdown.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   Add ctx to every select: 'select { case <-ctx.Done(): return ctx.Err(); case v := <-in: ... }'
   ```
2. **** (90% success)
   ```
   Pass ctx into blocking calls (http.NewRequestWithContext, db.QueryContext) so they abort on cancel
   ```

## Dead Ends

- **** — Skips deferred cleanup, corrupts state, drops in-flight data (85% fail)
- **** — Does not propagate intent; workers run to full timeout even when done (75% fail)
