fix(redis): preserve ioredis reconnect ownership - #2350
Closed
og2701 wants to merge 2 commits into
Closed
Conversation
og2701
marked this pull request as ready for review
July 22, 2026 12:07
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Contributor
|
Capy auto-review is paused for this organization because the usage-cycle auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews. |
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
disconnect(true)only when repeated probe failures occur while the client still reports readyRoot cause
During an in-place Dragonfly resize, the provider can close an established connection. ioredis starts its normal reconnect loop, but the availability monitor previously treated a reconnect lasting more than five seconds as stale and called
disconnect(false)followed byconnect(). The explicit non-reconnecting disconnect could cancel the client-owned retry lifecycle and leave the process unable to recover when the endpoint returned.Impact
Redis-backed features can recover automatically after Dragonfly closes connections during a resize, without restarting the application process.
Verification
git diff --check: passedA real staging Dragonfly in-place resize remains the final provider-level validation.
Summary by cubic
Prevent Redis downtime during Dragonfly in-place resize by letting
ioredisown reconnects after provider-side closes. Also enables staging deploy for this branch to validate recovery.Bug Fixes
ioredisreconnect loops.disconnect(true)and report connection down until recovery.disconnect(false)usage.CI
fix/dragonfly-resize-reconnecttoSTAGING_DEPLOY_BRANCH_ALLOWLISTto allow staging validation.Written for commit 44c7931. Summary will update on new commits.
Greptile Summary
This PR keeps Redis reconnect handling under ioredis control. The main changes are:
disconnect(true)after repeated probe failures while the client remains ready.Confidence Score: 5/5
This looks safe to merge.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Run Redis probe] --> B{Client ready?} B -- No --> C[Report connection down] B -- Yes --> D[Send PING] D -- PONG --> E[Report available] D -- Failure --> F{Failure threshold reached?} F -- No --> G[Report unresponsive] F -- Yes --> H[Call disconnect true] H --> I[ioredis schedules reconnect] I --> J{Endpoint restored?} J -- No --> C J -- Yes --> AReviews (1): Last reviewed commit: "ci: allow dragonfly reconnect staging de..." | Re-trigger Greptile
Context used: