{
  "id": "go/context-canceled-error",
  "signature": "error: context canceled",
  "signature_zh": "error: context canceled",
  "regex": "error:\\ context\\ canceled",
  "domain": "go",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "A context was canceled (parent cancel, timeout, or client disconnect) while a downstream operation was in flight. The error surfaces from any context-aware call.",
  "root_cause_type": "generic",
  "root_cause_zh": "上下文被取消（父级取消、超时或客户端断开），而下游操作正在进行。任何感知上下文的调用都会返回此错误。",
  "versions": [
    {
      "version": "1.17",
      "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": "Retrying with the same canceled context fails instantly in a tight loop; burns CPU and logs.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Removes timeout propagation; leaked requests and shutdown hangs.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "if errors.Is(err, context.Canceled) {\n    return nil // expected on shutdown\n}",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.88,
      "how": "if errors.Is(err, context.DeadlineExceeded) { retry() }\nif errors.Is(err, context.Canceled) { return err }",
      "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.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-03-19",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}