fix(redis): preserve ioredis reconnect ownership - #2350
Merged
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
Keeps
ioredisfully in charge of reconnects and isolates health checks on a duplicate client to prevent downtime during Dragonfly in-place resize. Also enables a staging deploy of this branch to validate recovery.Bug Fixes
disconnect(false); letioredishandle retries.redis.duplicate()created when monitoring starts; keep the request client untouched and warm both connections concurrently.redis.status === "ready", and the state is healthy; add regression tests for provider-close recovery and probe isolation.CI
fix/dragonfly-resize-reconnecttoSTAGING_DEPLOY_BRANCH_ALLOWLISTto allow staging validation.Written for commit 888961b. Summary will update on new commits.
Greptile Summary
This PR preserves automatic Redis recovery when a provider closes an active connection.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Sequence Diagram
sequenceDiagram participant Monitor as Availability monitor participant Probe as Probe Redis client participant Request as Request Redis client participant Endpoint as Redis endpoint Monitor->>Probe: PING Probe->>Endpoint: PING Endpoint-->>Probe: PONG Endpoint--xRequest: Provider closes connection Request->>Request: ioredis owns retry lifecycle Monitor->>Probe: Continue availability probes Endpoint-->>Request: Endpoint becomes available Request->>Endpoint: Reconnect automatically Request-->>Monitor: Status readyReviews (2): Last reviewed commit: "Merge existing PR #2350 history" | Re-trigger Greptile