Docker: idempotency-aware retry; Observer independent fetch degradation

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

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

評価

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

調査の方向性

指定された行にある reconciler、janitor、Events.Tap の参照されたエントリポイントを読み、その後、既存の修正、release 処理、Tap 初期化のフローを追跡します。各受け入れ条件を検証します。respawn が稼働し続けること、例外をスローする release 関数によってアプリが再起動ループに入らないこと、Tap の再起動後もイベントの順序が維持されることです。

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

説明

bug reliability

Problem

Three coordination-layer hardening gaps.

Reconciler clobbers fresh state with a stale snapshot (TOCTOU). lib/loopyard/agent/reconciler.ex:128,188 — do_reconcile captures {id, summary} from ETS, checks Registry, then applies corrections after the full scan. If an agent respawns between check_entry and apply_correction, apply_correction does :ets.insert(:chat_agents, {id, %{stale_summary | status: :crashed}}) — overwriting the new agent's fresh summary with a stale one marked :crashed. The UI shows a live agent as crashed until its next status publish. This is precisely the crash-then-respawn window the reconciler targets.

Janitor doesn't catch :throw. lib/loopyard/resources/janitor.ex:356 — run_release/4 has rescue + catch :exit, _ but no :throw clause (contrast Saga.safe_run). A throwing release_fn crashes the Janitor mid-release_for_owner (remaining resources skipped), and on restart rehydrate_from_ets re-runs the same release_fn inside init/1 → throws again → restart loop → root supervisor's restart budget exhausted → whole app shuts down from one bad closure.

Events.Tap seq resets on restart. lib/loopyard/events/tap.ex:117 — :events_tap is StateKeeper-owned and survives a Tap restart, but state.seq restarts at 0. Post-restart events get keys 1,2,3… which overwrite the oldest surviving records and sort as the oldest in recent/0 → /system/events shows fresh broadcasts at the bottom and destroys prior tape. Seed seq from :ets.last(@table) in init/1.

Fix

  • Re-check agent_alive?(id) and re-read the ETS row inside apply_correction before inserting.
  • Add :throw, value -> clauses to run_release/4 mirroring the :exit handling.
  • Seed Events.Tap seq from the surviving table in init/1.

Acceptance

  • A respawn during reconcile does not mark the live agent crashed.
  • A throwing release_fn is contained and does not restart-loop the app.
  • /system/events ordering survives a Tap restart.
主要言語
Elixir
スター
85
フォーク
11
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

loopyard/loopyard のほかの issue

loopyard/loopyard の issue をすべて見る

似ている issue

Elixir の issue をもっと見る

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

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