A database outage stops the app or the scheduler

オープン
#66 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
64/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
csharp
領域
backend

調査の方向性

Start in src/TickerNet/Src/BackgroundServices/TickerNetSchedulerBackgroundService.cs, reading ExecuteAsync around lines 60-95 and noting every path that calls ReleaseAllResourcesAsync or ReleaseAcquiredResources. Then find the persistence-provider abstraction those calls go through and the test project where a fake provider can be made to throw, so the test fails before the change. Done means a database failure is caught and logged, the loop backs off with a capped delay and keeps running, and that test passes.

索引モデルが issue の本文から書いたものです。

説明

.NET bug

What happens

When the scheduler loop in src/TickerNet/Src/BackgroundServices/TickerNetSchedulerBackgroundService.cs (ExecuteAsync, around lines 60-95) catches an exception, for example because the database is unreachable, its catch calls ReleaseAllResourcesAsync, which writes to the same database. The restart and shutdown paths call ReleaseAcquiredResources the same way. If that call throws too, the exception leaves ExecuteAsync.

With the default BackgroundServiceExceptionBehavior.StopHost, the whole app stops. With Ignore, the scheduler stays stopped until the app restarts.

Impact

A short database outage takes down the app, or silently stops all scheduling. High.

Fix idea

Wrap the release calls in try/catch, log the failure, back off (growing delay with a cap) and keep looping. ExecuteAsync should only end on shutdown. Test with a persistence provider that 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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TickerNet/TickerNet のほかの issue

TickerNet/TickerNet の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。