{
  "id": "go/context-deadline-exceeded-worker",
  "signature": "error: context deadline exceeded (goroutine worker)",
  "signature_zh": "error: context 超时（goroutine worker）",
  "regex": "error:\\ context\\ deadline\\ exceeded\\ \\(goroutine\\ worker\\)",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A ctx with a deadline expired before the worker finished, often because the deadline was too short or a downstream call is slow.",
  "root_cause_type": "generic",
  "root_cause_zh": "带截止时间的 ctx 在 worker 完成前过期，通常因为截止时间过短或下游调用过慢。",
  "versions": [
    {
      "version": "1.19",
      "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"
    },
    {
      "version": "1.22",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Eliminates the safety net; slow calls can hang the goroutine indefinitely.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Arbitrary; if the downstream is genuinely slow, it still times out and the root latency issue remains.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Measure p99 latency and set deadline accordingly; propagate ctx everywhere:\n\nctx, cancel := context.WithTimeout(parent, 5*time.Second)\ndefer cancel()",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Add retries with exponential backoff for transient downstream timeouts.",
      "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-12-08",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}