After a MOVING handoff, a client never becomes ready again on reconnect
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, typescript
- Ambito
- backend, networking
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- TypeScript
- Stelle
- 17.6k
- Fork
- 2k
- Merge medio
- 1g 22h
- PR unite (30g)
- 62
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di redis/node-redis
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
redis/node-redis#3664 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
accepted Bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
redis/node-redis#3674 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Support Uint8Array values for zero-copy transfer to worker_threadsForse già presa @umeshmore45 l’ha presa 286 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
redis/node-redis#3106 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
`RedisClientType` type is slow to typecheck (TS performance issue)Forse di nuovo libera @nkaradzhov l’ha presa 556 giorni fa e non c’è nessuna pull request aperta. ApertaBug
redis/node-redis#2975 · 30 commenti · 27 reazioni · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
redis/node-redis#2855 · 4 commenti · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di redis/node-redis
Issue simili
-
agent/guide documentation help wanted stage/010-actionable
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
kubestellar/console-marketplace#1101 ·
I maintainer di solito rispondono entro 1 giorno
-
Java Edition Tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
JSPrismarine/JSPrismarine#4178 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
totec448-spec/chat-on-steroids#2394 ·
I maintainer di solito rispondono entro 1 giorno
-
github_actions
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
StellarHyperion/stellarhyperion-backend#499 ·
I maintainer di solito rispondono entro 1 giorno