fix: extend cryptify retry budget to cover restart window#186
Closed
dobby-coder[bot] wants to merge 1 commit into
Closed
fix: extend cryptify retry budget to cover restart window#186dobby-coder[bot] wants to merge 1 commit into
dobby-coder[bot] wants to merge 1 commit into
Conversation
The default pg-js retry policy (5 attempts, 500ms initial delay, multiplier 2) exhausts in ~7.5s of total wait time. That's shorter than a typical cryptify service restart, so users see a hard failure during what should be a recoverable outage. Bump maxAttempts to 8 and initialDelayMs to 1000ms so the retry budget covers ~90s of total wait — long enough to ride out a restart while still failing fast for genuinely down backends. Closes #181
Contributor
Author
|
Superseded by #202 (consolidation per encryption4all/dobby#53). Closing to keep the queue tidy. |
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.
Summary
The default pg-js retry policy (5 attempts, 500ms initial, multiplier 2) exhausts the total wait budget in ~7.5s. That's shorter than a typical cryptify service restart, so a brief backend outage surfaces as a hard failure for the user.
This bumps the retry config on the shared `PostGuard` instance:
With the existing multiplier (2) and 30s cap, total cumulative wait is now ~91s (1s + 2s + 4s + 8s + 16s + 30s + 30s) — enough to ride out a restart while still failing fast for genuinely unreachable backends.
Closes #181
Test plan
Reviewer quickstart:
```
git fetch origin && git checkout fix/issue-181-retry-policy && npm install --legacy-peer-deps && npm run dev
```