Skip to content

feat(listener): automatic database reconnection with bounded backoff - #858

Merged
Abd-Standard merged 3 commits into
Core-Foundry:mainfrom
MaybeSomeone-arc18:bounty/786-db-reconnection
Oct 2, 2026
Merged

Abd-Standard merged 3 commits into
Core-Foundry:mainfrom
MaybeSomeone-arc18:bounty/786-db-reconnection

Conversation

@MaybeSomeone-arc18

Copy link
Copy Markdown
Contributor

Closes #786

Problem

When the listener's database connection drops (network blip, idle timeout, server restart), the connection is not re-established. Every subsequent query fails and the listener needs a manual restart to recover.

Fix

Tests

listener/src/__tests__/database-recovery.test.ts (new) exercises drop-and-reconnect recovery: queries succeed after a killed connection, backoff stays bounded under repeated failures, and in-flight reconnects do not stampede. Verified locally against the listener test suite.

Added recovery options for database connection handling, including max reconnect attempts and base delay for retries. Updated methods to utilize connection recovery during database operations.
This test suite verifies the database connection recovery mechanisms, including handling transient failures, bounded reconnect attempts, and behavior during transactions.
@drips-wave

drips-wave Bot commented Sep 28, 2026

Copy link
Copy Markdown

@MaybeSomeone-arc18 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@MaybeSomeone-arc18

Copy link
Copy Markdown
Contributor Author

Hey, quick nudge - the wave closes tomorrow (Sep 30) 6:30 PM IST. This one's ready and tested locally: the listener now reconnects to the database automatically with bounded backoff when the connection drops, instead of needing a manual restart. Would really appreciate a review before the deadline. Per Drips' maintainer guidance, if merging isn't possible in time you can mark the issue resolved anyway so the work still counts. Thanks!

@Abd-Standard
Abd-Standard merged commit 5e2db4a into Core-Foundry:main Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Database Connection Recovery

2 participants