# goroutine 泄漏：N 个 goroutine 阻塞在通道发送 (runtime.gopark)

- **ID:** `go/goroutine-leak-blocked-channel`
- **领域:** go
- **类别:** resource_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

goroutine 向无缓冲通道发送数据，但接收方已退出或从未运行，导致永久阻塞。内存和 goroutine 数量随时间无限增长。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.7+ | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   select {
case out <- v:
case <-ctx.Done():
    return ctx.Err()
}
   ```
2. **** (82% 成功率)
   ```
   ch := make(chan int, len(producers))
// producers can always send without blocking
   ```

## 无效尝试

- **** — GOMAXPROCS controls scheduler parallelism, not goroutine blocking; blocked goroutines remain blocked. (95% 失败率)
- **** — Blocked goroutines are reachable from the scheduler and are not collected; GC cannot free them. (90% 失败率)
