Retry logic does not handle unresponsive connections well
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- node.js, redis, typescript
調査の方向性
レポートで言及されているエントリーポイント on_connect()、initialize_retry_vars()、on_ready()、send_offline_queue()、init_retry_vars() を追跡します。説明されている toxiproxy のセットアップで切断モードのシナリオを再現し、その後、リトライ試行が早期にリセットされないこと、および正常な認証済み接続が確認されるまでキューに入れられたコマンドが保持されることを検証します。
索引モデルが issue の本文から書いたものです。
説明
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'
- 主要言語
- TypeScript
- スター
- 17.6k
- フォーク
- 2k
- 平均マージ
- 1日 22時間
- マージ済み PR(30日)
- 62
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
redis/node-redis のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
redis/node-redis#3664 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
After a MOVING handoff, a client never becomes ready again on reconnect対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
redis/node-redis#3705 ·
メンテナーはふだん 1 日以内に返信
-
accepted Bug
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
redis/node-redis#3674 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Support Uint8Array values for zero-copy transfer to worker_threads対応中かも @umeshmore45 が 286 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
redis/node-redis#3106 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
`RedisClientType` type is slow to typecheck (TS performance issue)再び着手できるかも @nkaradzhov が 556 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンBug
redis/node-redis#2975 · コメント 30 件 · リアクション 27 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
redis/node-redis の issue をすべて見る
似ている issue
-
dependencies effort: small good first issue priority: low
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
TMHSDigital/screencast-mcp#509 ·
メンテナーはふだん 1 日以内に返信
-
from-review tech-debt testing
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
blamechris/chroxy#9520 ·
メンテナーはふだん 1 日以内に返信
-
area:web complexity:S priority:P2 type:chore
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
nahuelcostac/agent-hub#104 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
snaglet-org/snaglet#78 ·
メンテナーはふだん 1 日以内に返信
-
agent/guide documentation help wanted stage/010-actionable
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
kubestellar/console-marketplace#1101 ·
メンテナーはふだん 1 日以内に返信