{
  "id": "go/goroutine-leak-http-server",
  "signature": "runtime: goroutine leak detected: N goroutines blocked on chan send",
  "signature_zh": "runtime: 检测到 goroutine 泄漏：N 个 goroutine 阻塞在通道发送上",
  "regex": "runtime:\\ goroutine\\ leak\\ detected:\\ N\\ goroutines\\ blocked\\ on\\ chan\\ send",
  "domain": "go",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "Handler spawns goroutines writing to a channel that no one drains after client disconnects, or waits on a channel that is never closed. Goroutines accumulate over time.",
  "root_cause_type": "generic",
  "root_cause_zh": "处理程序启动的 goroutine 向无人消费的通道写入，或在永不关闭的通道上等待，客户端断开后 goroutine 持续累积。",
  "versions": [
    {
      "version": "1.20",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.22",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.23",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Leaked goroutines still hold stacks and channel references; memory grows regardless of scheduler tuning.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "GC does not collect goroutines that are still runnable or blocked on a channel.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.92,
      "how": "go func() {\n    select {\n    case ch <- result:\n    case <-ctx.Done():\n        return\n    }\n}()",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "results := make(chan Result, len(tasks))",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-07-30",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}