Repository navigation
feat(listener): automatic database reconnection with bounded backoff - #858
Merged
Abd-Standard merged 3 commits intoOct 2, 2026
Merged
Abd-Standard merged 3 commits into
Abd-Standard merged 3 commits into
Conversation
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.
|
@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! 🚀 |
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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
listener/src/database/database.ts: the database layer now detects a dead connection and reconnects automatically with bounded exponential backoff, so transient drops recover on their own while a genuinely unavailable database fails fast instead of spinning.listener/src/utils/request-id.ts: carries the minimal docstring repair from fix: repair mangled docstring in request-id.ts breaking the build on main #846 so this branch builds and reviews independently (drops out on rebase once fix: repair mangled docstring in request-id.ts breaking the build on main #846 lands).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.