Retry logic does not handle unresponsive connections well
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- node.js, redis, typescript
Direzione di ricerca
Traccia i punti di ingresso on_connect(), initialize_retry_vars(), on_ready(), send_offline_queue() e init_retry_vars() menzionati nel report. Riproduci lo scenario in modalità disconnessione con la configurazione di toxiproxy descritta, quindi verifica che i tentativi di retry non vengano reimpostati prematuramente e che i comandi accodati vengano mantenuti fino alla conferma di una connessione autenticata e funzionante.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Issue
I was doing experiments of putting Redis behind a toxiproxy service in kubernetes for integration-test automation of network connectivity errors and server-behavior errors and noticed a few things. In this particular setup when the disconnect-mode testing was active, the redis-client was able to tcp-connect to a forwarding proxy, but would get then get disconnected a few milliseconds after it sent data, with no responses. I noticed this caused problems in two ways in the driver:
-
The on_connect() logic would call this.initialize_retry_vars(), causing the attempt count seen in the retryStrategy handler to be perpetually stuck at 1.
-
The use of this.send_offline_queue() in the on_ready() would assume it had a healthy & authenticated connection. At that point, the driver thinks it had run 'auth' and 'select', when actually the 'auth' command had actually failed, and the invocation of this.send_offline_queue() would dequeue and lose all the off-line queued commands on the first failed reconnect.
It seems to me like the code needs two changes to handle this scenario:
-
The on_ready() should validate it has a healthy connection by making sure a 'ping' command is sent and gets a reply before it tries to send the offline queue commands. Perhaps this could be conditioned with a pingOnConnect connect-option.
-
The clearing of attempts & re-initialization in init_retry_vars should only happen after all the off-line queue has been sent.
I ended up working around this issue by changing our test-environment to not provide the faux-connection when the redis was in 'disconnect mode' testing. That said, this seems like something that might occur in the future with various HA load-balancers in front of Redis, so I wanted to get this discussed with the code owners and get their agreement on the solutions above before working on a PR.
Environment
- Node.js Version:
12.16.1
- Redis Version:
redis-10.5.4
-
Platform:
Linux (container on MacOS docker) -
node-redis version: '3.0.2'
- 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
-
After a MOVING handoff, a client never becomes ready again on reconnectForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
redis/node-redis#3705 ·
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
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