{
  "id": "go/goroutine-leak-pprof",
  "signature": "runtime: goroutine count grows unbounded (observed via runtime.NumGoroutine())",
  "signature_zh": "runtime: goroutine 数量无限增长（通过 runtime.NumGoroutine() 观测）",
  "regex": "runtime:\\ goroutine\\ count\\ grows\\ unbounded\\ \\(observed\\ via\\ runtime\\.NumGoroutine\\(\\)\\)",
  "domain": "go",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "Goroutines block forever on channel send/receive or wait on a context that is never cancelled, so they never exit.",
  "root_cause_type": "generic",
  "root_cause_zh": "goroutine 永远阻塞在 channel 发送/接收上，或等待一个永不取消的 context，因此永不退出。",
  "versions": [
    {
      "version": "1.18",
      "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"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "GC does not kill blocked goroutines.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Delays OOM but goroutines still accumulate.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "go func(ctx context.Context) {\n    select {\n    case <-ctx.Done():\n        return\n    case work <- job:\n    }\n}(ctx)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.88,
      "how": "import _ \"net/http/pprof\"\n// go tool pprof http://localhost:6060/debug/pprof/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-06-11",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}