# sqlalchemy.exc.TimeoutError: QueuePool limit of size 10 overflow 10 reached, connection timed out

- **ID:** `python/flask-mysql-pool-timeout`
- **Domain:** python
- **Category:** system_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

数据库连接池已满，因为连接未被正确释放或并发请求过多。

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   with db.session() as session: session.execute(...) 或使用 try/finally 关闭连接
   ```
2. **** (80% success)
   ```
   engine = create_engine(url, pool_pre_ping=True, pool_recycle=3600)
   ```

## Dead Ends

- **** — 只是暂时缓解，如果连接泄漏，仍会超时。 (50% fail)
- **** — 用户会看到 500 错误，且连接池仍可能阻塞。 (90% fail)
