{
  "id": "go/goroutine-channel-buffer-overflow",
  "signature": "fatal error: all goroutines are asleep - deadlock! (buffered channel full)",
  "signature_zh": "致命错误：所有协程都处于睡眠状态 - 死锁！（缓冲通道已满）",
  "regex": "fatal\\ error:\\ all\\ goroutines\\ are\\ asleep\\ \\-\\ deadlock!\\ \\(buffered\\ channel\\ full\\)",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Sending to a buffered channel that is full, with no receiver ready, causing sender to block indefinitely.",
  "root_cause_type": "generic",
  "root_cause_zh": "向已满的缓冲通道发送数据，没有接收者就绪，导致发送者无限阻塞。",
  "versions": [
    {
      "version": "1.0",
      "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": "Increasing buffer size arbitrarily",
      "why_fails": "Only delays the problem; if consumers are missing, buffer will fill again.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using non-blocking send with select default",
      "why_fails": "Default case drops data; may lose messages.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Ensure sufficient consumer goroutines to drain channel",
      "success_rate": 0.9,
      "how": "ch := make(chan int, 10)\ngo func() {\n    for val := range ch {\n        // consume\n    }\n}()\nfor i := 0; i < 20; i++ {\n    ch <- i\n}",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use unbuffered channel with proper synchronization",
      "success_rate": 0.85,
      "how": "ch := make(chan int)\ngo func() {\n    for val := range ch {\n        // consume\n    }\n}()\nch <- 42 // blocks until receiver ready",
      "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.83,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-02-28",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}