pub struct Reconciler { /* private fields */ }Expand description
The reconciliation loop.
One per target, as f3 runs them; they share a RunnerLauncher and an
AllocationLock, which is what keeps the host ceiling true across all of
them.
Implementations§
Source§impl Reconciler
impl Reconciler
Sourcepub fn new(host: Host, ports: ReconcilerPorts) -> Self
pub fn new(host: Host, ports: ReconcilerPorts) -> Self
Build a reconciler polling at the host’s configured interval.
pub const fn host(&self) -> &Host
pub const fn schedule(&self) -> &PollSchedule
Sourcepub const fn repositories(&self) -> &RepositoryCache
pub const fn repositories(&self) -> &RepositoryCache
The repository-list cache, so f1 can report what it has spent.
Sourcepub async fn reconcile(&mut self, policies: &[ScalePolicy]) -> ReconcileReport
pub async fn reconcile(&mut self, policies: &[ScalePolicy]) -> ReconcileReport
One reconciliation pass over policies.
The order of operations is 03-control-flows.md flow 2, and the two
steps most worth naming are the ones that are silent when they are wrong:
- Monitor-only policies are removed before the demand poll, not
after. D19 says such a policy “is skipped entirely by reconciliation”,
and a poll issued on its behalf would spend requests from the shared
ceiling for a policy that can never act on the answer. This is asserted
on
ScalePolicy::owns_runnersrather than deduced frommax_capacitybeing absent. - The attempt set is re-read under the lock, once per runtime. See
RunnerLauncherfor why it comes from there and nowhere else.
Sourcepub async fn scale_down(&self, policy: &ScalePolicy) -> ScaleDownReport
pub async fn scale_down(&self, policy: &ScalePolicy) -> ScaleDownReport
Reclaim what can be reclaimed for one policy, and nothing else.
A busy attempt is never removed. 04-subsystem-contracts.md:
“busy cannot transition to cleanup due to a scale-down request”.
Capacity comes back when an attempt reaches a terminal state and at no
other time, so a scale-down against a host full of busy runners removes
nothing, changes nothing, and says so.