#367 MEDIUM: Connection leak in get_raw_db_connection docstring example
Description
Edit## Issue
The docstring for get_raw_db_connection() in engine/db.py:515-547 shows improper usage:
```python
conn = get_raw_db_connection()
try:
...
finally:
conn.close() # BUG: destroys pooled connection!
```
Calling close() on a pooled connection destroys it instead of returning to pool. Should use db._pool.putconn(conn).
## Impact
- Connection pool exhaustion under load
- Workers can't acquire connections
- System degradation
## Location
engine/db.py:515-547 (docstring example)
## Fix
Update docstring to show correct pattern OR use context manager exclusively
Comments
Loading comments...
Context
Loading context...
Audit History
View AllLoading audit history...