Skip to content

core(supervision): rebuild from kameo reference — links, death-watch, restart strategies #120

Description

@joeldsouzax

Part of the core-rebuild epic — follows the shared rigor contract there.

Component

src/supervision.rs, src/links.rs (~2,588 LOC). Link graph, death-watch, SupervisionStrategy, restart. The gnarliest, most concurrency-heavy part — and the source of the current flaky-test pain (#100-class settle races).

Learning & discussion

Erlang/OTP-style supervision. Death detection and restart policy are distinct — Zenoh liveliness will later supply detection across nodes, but the policy state machine stays ours. Restart storms and link/unlink/die interleavings are where correctness lives.

Existing crates

parking_lot for the link graph locking (#52); consider petgraph for the graph structure.

Research — best algorithm/approach

OTP supervision trees; restart strategies (one-for-one / all-for-one / rest-for-one); escalation; restart-intensity/max-restarts limits (limit hit = Result, not panic).

Testing — hard as fuck

Sequence (link → die → notify ordering), lifecycle, linearizability (restart storms; concurrent link/unlink/die), and the heaviest DST burden of any card — deterministically reproduce the #100-class flakes instead of settling-with-timeouts. loom on the link graph. Mutation: cargo-mutants, zero survivors.

Absorbs

#52 (parking_lot for the supervision link graph).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions