{
  "id": "python/flask-mysql-pool-timeout",
  "signature": "sqlalchemy.exc.TimeoutError: QueuePool limit of size 10 overflow 10 reached, connection timed out",
  "signature_zh": "SQLAlchemy 异常：QueuePool 大小 10 溢出 10 达到上限，连接超时",
  "regex": "sqlalchemy\\.exc\\.TimeoutError:\\ QueuePool\\ limit\\ of\\ size\\ 10\\ overflow\\ 10\\ reached,\\ connection\\ timed\\ out",
  "domain": "python",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "数据库连接池已满，因为连接未被正确释放或并发请求过多。",
  "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": "",
      "why_fails": "只是暂时缓解，如果连接泄漏，仍会超时。",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "用户会看到 500 错误，且连接池仍可能阻塞。",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "with db.session() as session: session.execute(...) 或使用 try/finally 关闭连接",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.8,
      "how": "engine = create_engine(url, pool_pre_ping=True, pool_recycle=3600)",
      "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-04-18",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}