Skip to main content

Module offload_link

Module offload_link 

Source
Expand description

The perception offload-link sidecar: the drone’s live “a workstation is paired + reachable, and I am offloading to it” state.

The offload reconciler (on the drone) writes this file each tick; the status surfaces read it staleness-gated and feed a REAL compute_node_paired / bearer_acceptable into crate’s tier decision, so an NPU-less drone with a reachable workstation reports (and runs) tier offload instead of the hardcoded “no node” default. Absent / stale ⇒ no offload link ⇒ the drone reports none (honest: never a fabricated paired node).

Producer: the ados-cloud offload reconciler. Consumers: ados-control (/api/status) and ados-cloud (the cloud heartbeat). Single writer, many readers — the same sidecar shape as compute-heartbeat / atlas-forward.

Structs§

OffloadLink
The drone’s live offload-link state, written by the reconciler each tick.

Constants§

OFFLOAD_LINK_SIDECAR
The offload-link sidecar path (tmpfs, cleared on boot).
OFFLOAD_LINK_SIDECAR_VERSION
The sidecar schema version, stamped on write and checked (warn-only) on read.
OFFLOAD_LINK_STALE_MS
A link file not re-written within this window is treated as absent, so a dead / hung reconciler (whose tmpfs file persists) never keeps a drone reporting a frozen offload tier after the workstation is gone. 4x the reconciler’s ~5 s tick.

Functions§

read_offload_link
Read the offload-link sidecar from the default path, staleness-gated at now_ms.
read_offload_link_from
Read + parse the offload-link sidecar at path, or None when it is absent, unparseable, missing its write-time, or STALE (older than OFFLOAD_LINK_STALE_MS at now_ms). now_ms is injected so the staleness gate is testable without touching the clock.
write_offload_link
Atomically write link to the default sidecar path.
write_offload_link_to
Atomically write link to path (tmp + rename), creating the parent dir if needed. The reconciler stamps the link (OffloadLink::stamped) before calling this.