{
  "id": "python/starlette-http-connection-timeout",
  "signature": "httpx.ConnectTimeout: Connection timed out after 5000ms",
  "signature_zh": "httpx 连接超时：5000 毫秒后连接超时",
  "regex": "httpx\\.ConnectTimeout:\\ Connection\\ timed\\ out\\ after\\ 5000ms",
  "domain": "python",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "Starlette 应用尝试连接外部服务时，网络请求超时",
  "root_cause_type": "generic",
  "root_cause_zh": "Starlette 应用尝试连接外部服务时，网络请求超时",
  "versions": [
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "无限增加超时时间",
      "why_fails": "掩盖了根本问题，且可能导致资源耗尽",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "忽略异常而不重试",
      "why_fails": "请求失败可能导致数据不一致",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "增加超时时间并添加重试机制",
      "success_rate": 0.85,
      "how": "client = httpx.AsyncClient(timeout=10.0)\nfor i in range(3):\n    try:\n        response = await client.get(url)\n        break\n    except httpx.ConnectTimeout:\n        await asyncio.sleep(1)",
      "condition": "",
      "sources": []
    },
    {
      "action": "检查网络连接和服务可用性",
      "success_rate": 0.9,
      "how": "ping example.com\ncurl -v http://example.com",
      "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-06-18",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}