Watching a Core
A Core says it is alive at an interval, and nothing asks it. The signal begins when the instance becomes observable and stops when an orderly shutdown begins.
- One mechanism on the Core's side, two watchers chosen by the form: the guardian in the application form; the init system, through its own protocol for supervised services, in the service form.
- On the guardian's channel it is a stream the Core opens at readiness, one beat per message, naming the instance. The first beat is observability.
- A beat is accepted only from the process the guardian executed for that instance, taken from the socket's peer credentials.
- The stream ending is an orderly shutdown only if the Core said so first; otherwise it is a silence.
- The interval and its tolerance are the deployment's
policy.heartbeat, and generous.
When it stops arriving
Every step is bounded, because the step before it may be what has wedged.
| # | Step | Bounded by |
|---|---|---|
| 1 | ask the Core to stop | the deployment's stop window |
| 2 | terminate the process | — |
| 3 | empty the control group, and clear the incarnation's debris | — |
| 4 | bring the instance back to its declared state | the growing wait below |
Acting on a silence cannot produce two Cores. The claim is an exclusive lock a Core takes before anything else, so a replacement that starts while the old process somehow lives fails to take it and says so. The worst a false positive costs is an unnecessary restart.
Coming back
An instance restarts as a unit does: the wait grows, stops at a ceiling, and a stability window measured from observability resets the count. The figures are the deployment's, and not separately declarable.
- A start the gate refused is untouched by any of this.
- The replacement is a new incarnation, and says so. The account of the interval goes where the guardian's output goes.