After a MOVING handoff, a client never becomes ready again on reconnect
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- node.js, typescript
- Área
- backend, networking
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- TypeScript
- Estrellas
- 17.6k
- Forks
- 2k
- Merge medio
- 1 d 22 h
- PR fusionados (30 d)
- 62
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de redis/node-redis
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
redis/node-redis#3664 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
accepted Bug
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
redis/node-redis#3674 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Support Uint8Array values for zero-copy transfer to worker_threadsPosiblemente ocupada @umeshmore45 la tomó hace 286 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
redis/node-redis#3106 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
`RedisClientType` type is slow to typecheck (TS performance issue)Quizá libre de nuevo @nkaradzhov la tomó hace 556 días y no hay ningún pull request abierto. AbiertoBug
redis/node-redis#2975 · 30 comentarios · 27 reacciones · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Bug
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
redis/node-redis#2855 · 4 comentarios · 2 reacciones ·
Los mantenedores suelen responder en 1 día
Todos los issues de redis/node-redis
Issues similares
-
dependencies effort: small good first issue priority: low
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
TMHSDigital/screencast-mcp#509 ·
Los mantenedores suelen responder en 1 día
-
from-review tech-debt testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
blamechris/chroxy#9520 ·
Los mantenedores suelen responder en 1 día
-
area:web complexity:S priority:P2 type:chore
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
nahuelcostac/agent-hub#104 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
snaglet-org/snaglet#78 ·
Los mantenedores suelen responder en 1 día
-
agent/guide documentation help wanted stage/010-actionable
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
kubestellar/console-marketplace#1101 ·
Los mantenedores suelen responder en 1 día