Docker: idempotency-aware retry; Observer independent fetch degradation

Abierto
#44 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Tranquilo
Stack tecnológico
elixir

Línea de trabajo

Lee los puntos de entrada citados de reconciler, janitor y Events.Tap en las líneas indicadas y, a continuación, sigue los flujos existentes de corrección, gestión de release e inicialización de Tap. Valida cada caso de aceptación: un respawn permanece activo, una función de release que lanza una excepción no hace que la app entre en un bucle de reinicios y el orden de los eventos se conserva tras reiniciar Tap.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
Elixir
Estrellas
85
Forks
11
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de loopyard/loopyard

Todos los issues de loopyard/loopyard

Issues similares

Más issues de Elixir

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.