Skip to content

Database Reconnection Pool Resilience #3

Description

@harsharajkumar-273

Description

The Node.js Express backend connects to PostgreSQL using pg.Pool inside config.ts.

Problem

If the local PostgreSQL database server restarts, experiences connection timeouts, or drops temporarily, active queries on the pool will fail, and some routes do not automatically try to re-establish the pool state, requiring a manual process restart.

Proposed Action Items

  • Add error listeners to the database pool (pool.on('error', ...)).
  • Implement a graceful re-connection loop with exponential backoff if the database connection is lost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions