Skip to main content

mark_component_starting

Function mark_component_starting 

pub fn mark_component_starting(component: &str)
Expand description

Register the component as present but not yet proven healthy.

Distinct from both ok and error: the component exists and has not failed, but nothing has succeeded for its current incarnation. Callers use this when they know a component is running and know they have no evidence it works.

Two things make this more than a no-op, because the registry only creates an entry when a mutation reaches it:

  • On first call the entry is created, so the component appears in snapshot as starting instead of being absent from /health altogether.
  • On a later call it invalidates a last_ok left by a previous incarnation. The registry lives in a process-wide OnceLock and outlives a daemon reload, so a replacement component reusing the same name would otherwise inherit its predecessor’s ok and keep reporting healthy while it has never once succeeded.

last_error is deliberately preserved: erasing a recorded failure is how a status becomes misleading, and “starting” is not evidence that a prior error has been resolved. restart_count is untouched.