{
  "id": "go/context-canceled-propagated",
  "signature": "error: context canceled",
  "signature_zh": "error: context 已取消",
  "regex": "error:\\ context\\ canceled",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A parent context was canceled (or timed out) and child operations returned context.Canceled. Often caused by deferring cancel() too early or sharing a request context across background work.",
  "root_cause_type": "generic",
  "root_cause_zh": "父 context 被取消(或超时),子操作返回 context.Canceled。常见原因是过早 defer cancel(),或把请求 context 复用到后台任务。",
  "versions": [
    {
      "version": "1.21+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Hides real shutdown bugs and leaks resources; also masks timeout-induced failures.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Breaks request cancellation and leaks goroutines after client disconnect.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "bg := context.WithoutCancel(ctx)\ngo func() { longRunning(bg) }()",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.92,
      "how": "if errors.Is(err, context.Canceled) {\n    return nil // expected shutdown\n}",
      "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-04",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}