Potential concurrency bugs in ConfigManager
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず ConfigManager と、その GetConfig および WatchConfig の呼び出し箇所を特定します。初期化、通知のブロック、ウォッチャーのライフタイムがどのように扱われているかを確認します。完了とするには、取りこぼした更新、ブロックされたモジュール、購読解除に対応する合意済みの設計と、それに対応するテストが必要です。
索引モデルが issue の本文から書いたものです。
説明
Development Task
ConfigManager notifies other modules with the config change by a channel. There are some bugs:
- When a module starts, it must receive an initial config and a channel as its parameters, such as
someModule.Init(cfgMgr.GetConfig(), cfgMgr.WatchConfig()). However, between callingGetConfig()andWatchConfig(), there may be a config change, and thussomeModulemay miss this config change. ConfigManagernotifies all the modules by writing to the channels when config changes. If one module blocks (maybe forever or temporarily), it hangs. If the module blocks forever, such as deadlock or panic, the config change will block forever. But if you add a timeout on writing the channel, the module may miss the config change if it just blocks temporarily, such as busy handling other things.- There's no way to unsubscribe from
ConfigManagerafter callingWatchConfig(). If a module wants to quit,ConfigManagerwill still try to notify it.
For the 1st problem, one workaround is calling WatchConfig() after GetConfig().
For the 2nd problem, one workaround is to set the channel size to a big enough size and also set a timeout on writing the channel.
For the 3rd problem, one workaround is to add another function to unsubscribe.
If we deprecate the WatchConfig() way and always use GetConfig(), all problems will be solved.
- 主要言語
- Go
- スター
- 73
- フォーク
- 41
- 平均マージ
- 10時間 52分
- マージ済み PR(30日)
- 20
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pingcap/tiproxy のほかの issue
-
contribution first-time-contributor type/enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
pingcap/tiproxy#1239 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
type/enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
severity/minor type/bug
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
type/bug
難易度 3/5 1〜2日 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
メンテナーはふだん 1 日以内に返信
pingcap/tiproxy の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
LanternOps/breeze#8353 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
prime-radiant-inc/evener#4223 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
input.Scanner.Scan loops forever when the input reaches EOF, hanging every ConfirmAction prompt対応中かも @mlliarm が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
elastic/cloud-sdk-go#521 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
open-telemetry/opentelemetry-go-compile-instrumentation#1467 ·
メンテナーはふだん 3 日以内に返信