{
  "id": "go/grpc-context-canceled",
  "signature": "rpc error: code = Canceled desc = context canceled",
  "signature_zh": "rpc 错误：code = Canceled，desc = 上下文已取消",
  "regex": "rpc\\ error:\\ code\\ =\\ Canceled\\ desc\\ =\\ context\\ canceled",
  "domain": "go",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "The caller's context was canceled (e.g., HTTP request aborted, parent context deadline hit, or explicit cancel()) before the RPC completed.",
  "root_cause_type": "generic",
  "root_cause_zh": "在 RPC 完成前调用方的 context 被取消（例如 HTTP 请求中止、父 context 超时或显式 cancel()）。",
  "versions": [
    {
      "version": "go 1.21+ (context.WithoutCancel)",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "An already-canceled context immediately fails every subsequent call.",
      "fail_rate": 0.99,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The cancellation originates on the client side; server timeouts are irrelevant.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Detach from the request context for background work:\nctx = context.WithoutCancel(ctx)\n// or use context.Background() with an explicit timeout",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Distinguish cancellation from real failures:\nif status.Code(err) == codes.Canceled {\n    return // caller went away, do not log as error\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.88,
  "fix_success_rate": 0.8,
  "resolvable": "partial",
  "first_seen": "2024-02-20",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}