Repository navigation
fix(timekeeper): セッション・ハングによる無言の永続停止を防止 (#128) - #129
Merged
Merged
Conversation
A wedged runSession (unbounded Discord REST / storage await) previously left the daily schedule disarmed forever: the reschedule only ran in .finally, which never fires for a hung promise, and nothing logged between the schedule timer and the first session event. - Log when the schedule timer fires so timer-vs-session hangs are distinguishable in logs. - Bound pre-flight awaits (channel resolution, voice connect, session engagement) with timeouts so a zombie gateway fails loudly. - Add a session watchdog (session budget + margin) that bumps a generation counter, destroys the tracked voice connection, persists the interrupted session, and re-arms the next day even when runSession never settles. - Skip re-arming the same start slot after a run so a pre-start failure cannot hot-loop on a zero delay. - Log the scheduled-announcements idle transition once instead of every 60s tick, which was flooding ~1440 lines/day and shrinking log retention to ~2.5 days. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Issue #128 対応。2026-11-22 の本番障害 (タイムキーパー無発火・ログ保持圧縮) の再発防止。
timekeeper session timer firedを info ログ出力し、「タイマー不発」と「セッション内ハング」を切り分け可能にrunSessionの pre-flight (チャンネル解決・voice connect・engagement 生成) にタイムアウトを付与し、REST ゾンビ化を fail-loud 化scheduled-announcementsの idle ログを遷移時1回のみに削減 (約1440行/日 → ログ保持期間の圧縮を解消)Test plan
bun run lint/bun run type-check/bun run biomeグリーンtests/timekeeper-watchdog.test.ts新規: pre-flight ハング時の翌日再スケジュール、ウォッチドッグによる abort + connection 破棄 + 翌日再発火を検証tests/scheduled-announcements.test.ts: idle ログが複数 tick で1回のみ出力されることを検証bun run test: 1051 件パス (anon-audit-store の POSIX 権限テスト2件は Windows 環境起因の既存失敗で本変更と無関係)Generated with Devin