forked from 0xWheatyz/SPARC
Refactor get_db_client() in auth.py to use a shared connection pool #571
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
get_db_client()inauth.pycreates a newDatabaseClientinstance on every invocation. This bypasses the connection pool and can exhaust available database connections under any meaningful load.What to do
DatabaseClientthat is initialized once at startup.get_db_client()(or replace it with a dependency injection function) to return the shared client.Acceptance criteria
DatabaseClientinstance is created per application process.Reference
Roadmap: P1 — Error handling and resilience
Triage Note: This issue is a prerequisite for #572 (persist job state in PostgreSQL). The shared connection pool must be in place before the job persistence refactor. Recommend completing this first.
Priority: P1 | Complexity: small | Assigned agent type: @developer
Triage (AI-Manager): P1 refactor. Assigned to @AI-Engineer (developer role). Small scope -- singleton pattern for DatabaseClient. Feature branch required.
This issue has been resolved. Implemented in PR #30 (feature/db-client-pooling) - shared pooled DatabaseClient singleton. All changes are merged into main. Closing as completed.