{
  "id": "go/goroutine-leak-blocked-on-channel-receive",
  "signature": "goroutine leak: goroutine blocked on channel receive",
  "signature_zh": "goroutine 泄漏：goroutine 阻塞在通道接收",
  "regex": "goroutine\\ leak:\\ goroutine\\ blocked\\ on\\ channel\\ receive",
  "domain": "go",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "A goroutine waits to receive from a channel that is never sent to or closed, often due to a sender exiting without closing.",
  "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": "time.After allocates a timer each call and can leak timers; also doesn't fix the root cause.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Closing from receiver can cause panic if sender later sends; violates channel ownership.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Use select with context:\nselect {\ncase v := <-ch:\n    _ = v\ncase <-ctx.Done():\n    return\n}",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.92,
      "how": "Ensure the sender closes the channel when done. Use defer close(ch) in the sender goroutine.",
      "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.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-10-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}