Skip to main content
Version: 0.5.0

Reconciling

The guardian compares what each record declares with what is alive, and acts on the difference. Nothing it does is on a timer: it is told, or it notices a Core end.

Wakes itIt reconciles
startingevery record
reconcile this recordthat one
reconcile everythingevery record
a Core it watches endingthat Core's record
a Core it watches falling silentthe same — Watching a Core

What it derives​

Current state is derived when asked, from facts that cannot lie.

The questionAnswered by
is a Core alive for this instanceits claim, which the kernel releases when the holder dies
what still belongs to itits control group
is it observablethe liveness the Core sends, which begins at observability

A cached answer is allowed only as a labelled cache with the moment it was taken, and never as the answer.

What it brings up​

PassBrings up
at bootevery instance whose autostart is set and whose desired state was not left stopped
any other timeevery instance whose desired state is running

An ephemeral record is never eligible for autostart.

Starting one​

  1. Read the record, refusing one whose name is not its directory's.
  2. Resolve the bundle: <install root>/<id>/<version>/bundle/, or the working directory an ephemeral record's source names.
  3. Run the gate. Nothing may execute a Core without it.
  4. Create the instance's control group.
  5. Execute the Core inside it, the binary manager.conf names, handing it the engine's address and the retention ceiling.
  6. Wait for it to become observable — its first beat — and watch for the absence of the next.

The guardian writes nothing to the record.

Stopping one​

The manager writes the desired state; the guardian asks the Core to stop, waits the stop window, terminates it, and empties the control group. An ephemeral record is removed once its instance is down.

A refused start​

A refusal is not a failure, and is not retried.

  • The desired state is not altered: the record still says what somebody declared.
  • The guardian's account changes: refused, with the gate's findings, carried by the channel.
  • It is recorded where the guardian's output goes, so a start nobody watched leaves something to find.
  • Nothing enters the restart policy. An explicit reconcile this record tries it again.

A failed start​

A failure is retried: the wait grows, stops growing at a ceiling, and a stability window measured from observability resets the count. The figures are the deployment's own policy.restart, and are not separately declarable.

An ephemeral run that fails is not retried: its record is marked outcome: failed and kept.

The control group​

An instance that loses its Core loses everything in it, because the Core and everything launched under it share one control group, which is emptied in one operation without enumerating anything.

WhatHow it gets there
the Corethe guardian executes it inside the group
a host unita child of the Core, it inherits the group
a containerised unitthe Core names the group as the parent of every container it launches
  • It is a systemd slice, yoke-<instance>.slice, under yoke.slice, in the subtree the session manager delegates to the account — a container engine driven through systemd accepts only a slice as a container's parent.
  • The guardian creates it before executing anything, so it can empty it when the Core is what went wrong.
  • It is emptied after an instance stops, after a silent Core is terminated, and before an instance is brought back.

Where a host cannot provide one​

Without control-group delegation, the guardian signals the process group and reaps the containers carrying the instance's label. That is a declared weaker arrangement, reported by the gate as confinement.no_cgroup_delegation, class weaker, and repeated whenever the instance is read. It is weaker twice: reaping works only while the guardian is alive, and it makes the guardian address the container engine.