After a MOVING handoff, a client never becomes ready again on reconnect
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
- Lĩnh vực
- backend, networking
Hướng nghiên cứu
Start by reading #initiateSocket(), _ejectSocket(), and _insertSocket() and how EnterpriseMaintenanceManager moves a socket during a MOVING handoff. Reproduce with the RESP3 fake node used in enterprise-maintenance-manager.spec.ts, then check whether reconnect sends the handshake after the socket is inserted into the receiving client. Done means both automatic reconnect and destroy() followed by connect() become ready and ping() settles.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
After a MOVING handoff completes, any later reconnect hangs. This covers an automatic reconnect after the connection drops and a manual destroy() then connect(). The client opens a TCP connection to the endpoint but never sends the handshake, so it stays open and never becomes ready, and commands sent after the drop never settle.
Cause. #initiateSocket() builds each RedisSocket with an initiator closure bound to the client that created it. During a handoff, EnterpriseMaintenanceManager connects a duplicate() (the temporary client), then moves that client's RedisSocket into the real client via _ejectSocket()/_insertSocket() and destroys the temporary client. The swapped-in socket keeps the temporary client's initiator. On the next connect, the handshake is queued on the destroyed temporary client's queue and written through that client's #write(), so nothing reaches the new connection.
Reproduction (on master, with a minimal RESP3 fake node like the one in enterprise-maintenance-manager.spec.ts):
createClient({ RESP: 3, maintNotifications: 'enabled', socket: { host, port: source, reconnectStrategy: 50 } }), thenconnect().- Have the source send
MOVINGto the target, and wait for the handoff to complete.client.ping()works. - Drop the connection on the target's side.
Expected: the client reconnects and client.ping() returns.
Actual: the client emits reconnecting and the target accepts a new TCP connection, but receives nothing. The client stays isOpen: true, isReady: false and client.ping() never settles.
The same happens if step 3 is client.destroy() followed by client.connect(): connect() never resolves.
As a control, the same drop with no handoff reconnects and becomes ready.
Possible fix: have _insertSocket() rebind the inserted socket's initiator to the receiving client, or build the replacement RedisSocket from the receiving client's own #initiateSocket() and move only the underlying net.Socket across.
Found while working on #3699.
Node.js Version
v22.22.0
Redis Server Version
N/A: reproduced against a minimal RESP3 fake node (as in enterprise-maintenance-manager.spec.ts), since the bug is in the client
Node Redis Version
master at ae5cfde4 (@redis/client 6.4.0)
Platform
Linux (WSL2)
Logs
# after the handoff completes, the target drops the connection (reconnectStrategy: 50)
isOpen=true isReady=false events=reconnecting # ping() still pending after 1000ms
# after the handoff completes, destroy() then connect()
isOpen=true isReady=false events=end # connect() never resolves
# control: same drop, no handoff
isOpen=true isReady=true # ping() returns OK
- Ngôn ngữ chính
- TypeScript
- Star
- 17.6k
- Fork
- 2k
- Merge trung bình
- 1 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 62
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của redis/node-redis
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
redis/node-redis#3664 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
accepted Bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
redis/node-redis#3674 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Support Uint8Array values for zero-copy transfer to worker_threadsCó thể đã có người làm @umeshmore45 đã nhận 286 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
redis/node-redis#3106 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`RedisClientType` type is slow to typecheck (TS performance issue)Có thể làm lại được @nkaradzhov đã nhận 556 ngày trước và không có pull request nào đang mở. Đang mởBug
redis/node-redis#2975 · 30 bình luận · 27 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
redis/node-redis#2855 · 4 bình luận · 2 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của redis/node-redis
Issue tương tự
-
dependencies effort: small good first issue priority: low
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
TMHSDigital/screencast-mcp#509 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
from-review tech-debt testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
blamechris/chroxy#9520 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:web complexity:S priority:P2 type:chore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
nahuelcostac/agent-hub#104 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
snaglet-org/snaglet#78 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent/guide documentation help wanted stage/010-actionable
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
kubestellar/console-marketplace#1101 ·
Maintainer thường phản hồi trong vòng 1 ngày