Skip to content

reconciler: convergence loops ​

For Go code, follow the repository Go anti-pattern rules.

Metal specification · overview: Metal overview

Purpose ​

This package schedules convergence work. It owns no VM, image, snapshot, or traffic state.

Types ​

TypeResponsibility
VirtualMachineReconcilerRuns VM reconciliation passes.
ImageReconcilerCaches images, prunes unused images, kernels, and staged snapshots.
MigrationReconcilerAdvances each active destination migration.
GuestCheckerPings running guests every minute, so a silent guest counts as unavailable.
passSchedulerRuns a pass at startup, on an interval, and on request.

Pass model ​

  • Each operation has its own timeout.
  • The VM pass limits concurrency, so one slow VM cannot block others.
  • Errors are logged. A later pass retries safe operations.
  • A failing VM waits twice as long after each failure, up to 1 minute. Wake clears the wait.
  • Errors after cancellation are suppressed.

Ownership ​

  • metald owns each goroutine and its context.
  • The VM manager owns every state decision and per-VM lock.

AGPL-3.0