Skip to content

🐞 Database connection does not retry after server restart #340

Description

@rahulkumarsingh73690

What happened?

When the database server restarts (or there’s a temporary DB outage), the app fails to reconnect automatically. It remains disconnected until the entire usesend app is manually restarted.

Expected behavior
The application should automatically retry the database connection and recover once the database is available again, without requiring a full app restart.

Actual behavior
The app stays disconnected and does not retry connecting to the database until the app is manually restarted.

Environment

  • Hosting: EasyPanel
  • Deployment: Docker (via EasyPanel)
  • Database: PostgreSQL
  • App: usesend
  • OS: Linux (server)

Additional context
This can cause downtime in production if the database restarts due to maintenance, scaling, or temporary failures. A retry/backoff mechanism or persistent connection handling would improve reliability.

Replication Steps

  1. Deploy the app using EasyPanel
  2. Start the application normally
  3. Restart the database server (or cause a temporary DB outage)
  4. Observe that the app does not reconnect to the database
  5. Restart the app container → connection works again

Self hosted or Cloud?

Self hosted

What browsers are you seeing the problem on?

No response

Activity

  1. rahulkumarsingh73690 commented on Feb 6, 2026

    @rahulkumarsingh73690
    Author

    Internal Server Error every time on server maintenance, please push the DB connection retry update

  2. sutharjigar commented on Apr 15, 2026

    @sutharjigar

    @rahulkumarsingh73690 Is this bug still open? Can I contribute?

  3. rahulkumarsingh73690 commented on Apr 26, 2026

    @rahulkumarsingh73690
    Author

    @sutharjigar It’s still open; however, I am not sure if maintainers allow it because there is already 1 pr pending by @Razano26

  4. sutharjigar commented on Apr 27, 2026

    @sutharjigar

    So should I contribute (or give time to this or not)? @rahulkumarsingh73690

  5. rahulkumarsingh73690 commented on Apr 29, 2026

    @rahulkumarsingh73690
    Author
  6. TJothiprakash commented on May 5, 2026

    @TJothiprakash
    Contributor

    Hey! I set up the project locally and tested the DB restart scenario.

    From my testing and reviewing the implementation, it looks like retry logic is already handled at the Prisma query level along with job-level retries.

    The system successfully recovers after DB restarts, so this issue seems to be effectively resolved.

    Let me know if any further improvements are expected here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions