{
  "id": "python/sqlalchemy-connection-timeout",
  "signature": "sqlalchemy.exc.TimeoutError: QueuePool limit of size 5 overflow 10 reached, connection timed out, timeout 30",
  "signature_zh": "sqlalchemy.exc.TimeoutError: QueuePool 大小限制 5 溢出 10 已达到，连接超时，超时时间 30",
  "regex": "sqlalchemy\\.exc\\.TimeoutError:\\ QueuePool\\ limit\\ of\\ size\\ 5\\ overflow\\ 10\\ reached,\\ connection\\ timed\\ out,\\ timeout\\ 30",
  "domain": "python",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "The connection pool is exhausted because too many connections are in use, and the timeout is exceeded waiting for a free connection.",
  "root_cause_type": "generic",
  "root_cause_zh": "连接池已耗尽，因为太多连接正在使用中，等待空闲连接超时。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Increasing pool_size without monitoring usage",
      "why_fails": "This may mask the underlying issue of connection leaks.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "Restarting the application",
      "why_fails": "Connections may leak again if not properly closed.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase pool_size and overflow, and ensure connections are closed",
      "success_rate": 0.85,
      "how": "engine = create_engine('postgresql://user:pass@localhost/db', pool_size=20, max_overflow=40, pool_timeout=60)",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use context managers for sessions to ensure closure",
      "success_rate": 0.95,
      "how": "with Session() as session:\n    session.query(User).all()",
      "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-08-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}