{
  "id": "python/aiohttp-timeout-total",
  "signature": "asyncio.exceptions.TimeoutError: Connection timeout to host https://slow.example.com",
  "signature_zh": "asyncio.exceptions.TimeoutError: 连接主机 https://slow.example.com 超时",
  "regex": "asyncio\\.exceptions\\.TimeoutError:\\ Connection\\ timeout\\ to\\ host\\ https://slow\\.example\\.com",
  "domain": "python",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "The aiohttp ClientTimeout (total or sock_connect) elapsed before the server responded; default total is 5 minutes but sock_connect is only 30s.",
  "root_cause_type": "generic",
  "root_cause_zh": "aiohttp ClientTimeout（total 或 sock_connect）在服务器响应之前耗尽；默认 total 为 5 分钟，但 sock_connect 只有 30 秒。",
  "versions": [
    {
      "version": "3.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "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"
    },
    {
      "version": "3.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Requests hang forever on dead servers, exhausting the connection pool.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Masks slow endpoints but ties up sockets and worker slots.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Hammers an already-slow server and can trigger rate limits.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Configure explicit timeouts:\n\ntimeout = aiohttp.ClientTimeout(total=30, connect=5, sock_read=10)\nasync with aiohttp.ClientSession(timeout=timeout) as s:\n    await s.get(url)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Wrap with asyncio.wait_for for a per-call ceiling:\n\nawait asyncio.wait_for(session.get(url), timeout=15)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.88,
      "how": "Use aiohttp-retry for exponential backoff on TimeoutError.",
      "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-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}