Mint-health transitions are 5-min-poll driven with escalating backoff — repeated mint outages make recovery exceed any test budget

Abierto
#747 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

  • #777 de @Amperstrand — cerrado sin fusionar

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
go

Línea de trabajo

Start with the failing tests/api/test_merchant_provider.py and trace how mint probe and swap results reach wallet state and discovery health; the issue does not identify the relevant implementation files. Reproduce a mint block/unblock and restart in the local virtual lab, checking whether probe success refreshes wallet state and resets per-mint backoff. Done means discovery transitions promptly between degraded and full and repeated recovery cycles complete within the test window.

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

Descripción

Migrated from Amperstrand/tollgate-module-basic-go#87 as part of the fork retirement — OpenTollGate/tollgate-module-basic-go is the single source of truth; the fork issue carries the original discussion and any lab evidence. Retirement plan: see the tracking issue linked in the migration comment there.]

Evidence (local virtual lab, 2026-09-04, cdk-mintd 0.18.0 fakewallet)

Live probes during a failing tests/api/test_merchant_provider.py run:

  1. Wallet state vs prober disagree. After the mint work-dir is wiped and restarted (same mnemonic → same keysets), discovery served kind 21023 no-reachable-mints while:

    • proactive prober: mint probe: url=http://10.99.99.2:8383/v1/info status=200 ok=true (twice, 5 min apart)
    • curl http://10.99.99.2:8383/v1/info from the router: 200
    • tollgate status reported wallet_ok=true while discovery said degraded
      Only /etc/init.d/tollgate-wrt restart flipped discovery to kind 10021 (~10s). The wallet's cached mint state (wallet.db) is not re-validated on prober success.
  2. Health transitions ride the 300s proactive poll. iptables-blocking all mints does not flip discovery to degraded until the next probe cycle (up to 5 min); same for unblock→full. Test budgets of 180s expired before the first probe fired. (Worked around test-side: HEALTH_POLL_TIMEOUT 420, module timeout 900 — prta fix/local-lab-green 90bf9c6.)

  3. Recovery after repeated block/unblock cycles exceeds any test budget. In one file run: cycle 1 recovered well within 420s; cycles 2–4 did not recover within 420s (Service did not recover, swap-test stop reason test window ended, recovered=False). Escalating backoff on the mint URL after repeated failures is the likely mechanism; it does not reset on unblock.

Impact

  • Degraded/recovery tests are timing-flaky against any mint that restarts (mints DO restart — new deployments, CDK upgrades).
  • Discovery can serve no-reachable-mints while the mint is healthy, for up to the next probe cycle + wallet re-validation delay (currently: forever, absent a backend restart).

Suggested direction

  • Event-driven health transition: flip degraded/full immediately on swap/probe failure+recovery (probe success already detected per-cycle — propagate it to the wallet/discovery state).
  • Reset per-mint backoff when a probe or swap succeeds.
  • Re-validate cached wallet mint state when the prober reports ok=true but the wallet considers the mint down.
Lenguaje dominante
Go
Estrellas
12
Forks
14
Merge medio
3 d 20 h
PR fusionados (30 d)
261

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 OpenTollGate/tollgate-module-basic-go

Todos los issues de OpenTollGate/tollgate-module-basic-go

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.