{
  "id": "go/goroutine-leak-blocked-on-channel-send",
  "signature": "goroutine leak: goroutine blocked on channel send",
  "signature_zh": "goroutine 泄漏：goroutine 阻塞在通道发送",
  "regex": "goroutine\\ leak:\\ goroutine\\ blocked\\ on\\ channel\\ send",
  "domain": "go",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "A goroutine sends to a channel that no one receives, often because the receiver exited early or the channel is unbuffered and no reader is active.",
  "root_cause_type": "generic",
  "root_cause_zh": "一个 goroutine 向无人接收的通道发送数据，通常是因为接收方提前退出，或通道无缓冲且没有活跃的接收者。",
  "versions": [
    {
      "version": "1.18",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.21",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Only delays the leak; if buffer fills, goroutine still blocks.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Leaks accumulate over time, causing memory growth and eventual OOM.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.92,
      "how": "Use select with context cancellation:\nselect {\ncase ch <- val:\ncase <-ctx.Done():\n    return\n}",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.88,
      "how": "Ensure the receiver always drains the channel or closes it to unblock senders. Use a done channel to signal shutdown.",
      "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.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-09-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}