{
  "id": "python/asyncio-cancel-future",
  "signature": "concurrent.futures.CancelledError: Future was cancelled",
  "signature_zh": "并发未来异常：未来被取消",
  "regex": "concurrent\\.futures\\.CancelledError:\\ Future\\ was\\ cancelled",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Awaiting a future that has been cancelled, often due to a parent task being cancelled.",
  "root_cause_type": "generic",
  "root_cause_zh": "等待一个已被取消的future，通常是因为父任务被取消。",
  "versions": [
    {
      "version": "3.7",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Swallowing cancellation can lead to inconsistent state and resource leaks.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "result() raises the same error; it's not a proper fix.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "if not fut.cancelled(): await fut",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.95,
      "how": "try: await fut except asyncio.CancelledError: raise",
      "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.83,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-11-20",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}