← 输入框|github.com|刷新
Skip to content

fix: prevent reconnect loop with legacy quit - #3462

Merged
nkaradzhov merged 1 commit into
redis:masterfrom
aartisonigra:fix/2273-legacy-quit-clean
Sep 21, 2026
Merged

nkaradzhov merged 1 commit into
redis:masterfrom
aartisonigra:fix/2273-legacy-quit-clean

Conversation

@aartisonigra

@aartisonigra aartisonigra commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add callback-compatible legacy.quit() handling.
  • Delegate legacy quit to the lifecycle-aware client quit flow.
  • Add a regression test to verify the client closes without reconnecting.

Closes #2273


Note

Low Risk
Narrow legacy-mode lifecycle fix with a targeted regression test; no auth or data-path changes.

Overview
Fixes legacy-mode quit so it no longer behaves like a normal Redis command from the auto-generated command map, which could leave the connection in a bad state and trigger unwanted reconnect attempts.

RedisLegacyClient now exposes an explicit quit that forwards to #client.quit(), with the same optional callback / error-event behavior as other legacy APIs. A regression test asserts that after legacy.quit, the underlying client is closed (isOpen is false) and no reconnecting events fire.

Reviewed by Cursor Bugbot for commit 5829c9d. Bugbot is set up for automated code reviews on this repo. Configure here.

@aartisonigra

Copy link
Copy Markdown
Contributor Author

review please.

@nkaradzhov nkaradzhov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, CLGTM

@nkaradzhov
nkaradzhov merged commit 9c8be97 into redis:master Sep 21, 2026
15 checks passed
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.

New SocketClosedUnexpectedlyError Error When Upgrading from 3 to 4 via Legacy Mode

2 participants