RestartThrottleManager throws NullReferenceException after Dispose and ends the process
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
src/TickerNet/Src/RestartThrottleManager.cs から始めてください。Dispose、OnTimerCallback(54 行目付近の _debounceTimer.Change 呼び出し)と RequestRestart を読み、これらはいずれも同じロックの下で実行されます。両方のコールバックを _disposed フラグ(Dispose で設定される)でガードし、そこで _restartPending をクリアし、タイマーに null 条件を付けてください。再起動を要求し、すぐに dispose し、debounce ウィンドウを過ぎるまで待機して、何も例外を投げないことをアサートするテストを追加し、修正前にそれが失敗することを確認してください。CONTRIBUTING.md に従い、この説明と TickerNet 自身のコードだけに基づいて作業してください。
索引モデルが issue の本文から書いたものです。
説明
What happens
RestartThrottleManager (src/TickerNet/Src/RestartThrottleManager.cs) sets _debounceTimer to null in Dispose, but leaves _restartPending as it was and has no disposed flag. A timer callback that was already queued then runs _debounceTimer.Change(...) on null (around line 54) and throws NullReferenceException on a thread-pool thread, which ends the process. RequestRestart after Dispose fails the same way.
It shows up when a host stops shortly after a restart was requested, and in test hosts that are disposed quickly.
Fix idea
Add a _disposed flag checked under the lock in OnTimerCallback and RequestRestart, clear _restartPending in Dispose, and use _debounceTimer?.. Test: request a restart, dispose at once, wait past the debounce window, and check that nothing throws.
Found while checking which problems that TickerQ fixed after the fork still exist in TickerNet. Fix it from this description and TickerNet's own code only: never read or copy code from TickerQ 10.5.0 or later (see CONTRIBUTING.md). Please add a test that fails before the fix.
- 主要言語
- C#
- スター
- 0
- フォーク
- 2
- 平均マージ
- 1時間 8分
- マージ済み PR(30日)
- 24
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TickerNet/TickerNet のほかの issue
-
.NET enhancement good first issue roadmap
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Document PathBase inside the dashboard branch and WebDAV on IIS対応中かも @harryhawwy69 が今日担当しました。 オープンdocumentation
難易度 2/5 1〜3時間 初心者へのやさしさ 40/100
メンテナーはふだん 1 日以内に返信
-
TickerFunctionProvider's registry is publicly writable対応中かも @harryhawwy69 が今日担当しました。 オープン.NET bug
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
-
Cron editor accepts 7 for Sunday, then saving fails with a generic error対応中かも @harryhawwy69 が今日担当しました。 オープンbug good first issue javascript
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
メンテナーはふだん 1 日以内に返信
-
Dashboard logs a warning for the missing updatenodeheartbeat handler対応中かも @harryhawwy69 が今日担当しました。 オープンbug good first issue javascript
難易度 2/5 1〜3時間 初心者へのやさしさ 40/100
メンテナーはふだん 1 日以内に返信
TickerNet/TickerNet の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
dotnet-outdated/dotnet-outdated#871 ·
メンテナーはふだん 1 日以内に返信
-
triage/untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
unoplatform/uno#26676 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
jhaizhou-ops/S2Arm#2177 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
area-CodeGen-coreclr untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
dotnet/runtime#138181 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
S: Untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 2 日以内に返信