Skip to content

Lifecycle & Failure Handling

Job states: queued → assigned → running → complete, where complete is reached only on controller validation of the full digest (metrics + artifact manifest with checksums + logs pointer + machine digest + config version). Exactly-once results on at-least-once execution. A job whose dependency fails moves to blocked (client notified; retry the dependency or cancel).

Heartbeat timeout

Node goes unreachable; its running jobs move to needs-retry with attempt numbers — not the plain queue, because the scheduler must know GPU-hours were already burned.

Attempt accounting, both directions

  • A job failing on 3+ different nodes is a bad job: flag to the client with logs. Do not blindly retry a segfaulting recipe.
  • A node killing many different jobs is a bad node: quarantine it, notify the donor.

Stable node IDs make this possible — without them you can't tell "this job is cursed" from "this machine is cursed."

Failure classification

  • Unreachable node → requeue elsewhere.
  • Job crash → report to client, don't auto-retry.
  • Incomplete digest → ask the node to resend before giving up.

Duplicate digests

A "dead" node resurrects and submits results for a job that was already retried elsewhere. Handle idempotently: keep the first validated digest, record the duplicate with lineage. Home power outages make this routine, not exotic.

Churn is normal

Volunteer nodes vanish for outages, ISP drops, and planned reboots. Design consequences:

  • Reliability history feeds placement (per stable node ID).
  • Donors declare availability windows ("weekends are mine") for graceful drain instead of surprise disappearance.
  • Long jobs stream partial artifacts, so 90%-done still yields 90% of the value.

Between runs: memory hygiene

Unified memory accumulates cruft across iterations — page cache, orphaned SHM, fragmented CUDA allocations. Before reporting ready for the next job, the daemon:

  • Kills the job's cgroup (no strays; GPU contexts die with their processes)
  • Drops page cache (echo 3 > /proc/sys/vm/drop_caches, via a sudoers rule limited to exactly that command — the daemon itself stays unprivileged)
  • Verifies no unexpected processes hold GPU memory
  • Records free/allocatable memory into the run's pre-flight metadata

If free memory trends downward across runs on a node (fragmentation the kernel won't reclaim), the daemon flags it and the scheduler routes memory-hungry jobs elsewhere until a maintenance reboot. Reboot is the only real defragmenter on this hardware.