Proactive periodic liveness scheduler — Boundary stage of the resilience CPPB pipeline.
Single responsibility: own a timer that fires a health check on a fixed
cadence, so a connection that dies while the store is IDLE (no traffic to
trigger the reactive retry path or the on-demand ensure-live! gate)
still heals. This closes the gap where auto-heal was 100% traffic-driven:
after a network blip with no in-flight RPC, nothing re-probed and the dead
client sat dead until the next operation happened to touch it.
Why this ns owns ONLY the timer (SRP + DRY):
retry/ensure-live!
(reads cached liveness, kicks the reconnect loop only when-not it is
already running). Re-implementing it here would duplicate the guard and
risk calling reconnect/kick! mid-heal, which drops the fresh client on
every tick. So the tick DELEGATES the policy and keeps only the
scheduling (Boundary) concern.Lifecycle: started from store.lifecycle/connect! once the config-atom
exists; stopped from store.lifecycle/disconnect! before teardown, so the
timer can't kick a heal loop right after the operator closed the store.
Time discipline: never call System/currentTimeMillis directly — go
through hive-ttracking.clock/now-millis (mirrors probe/reconnect).
Proactive periodic liveness scheduler — Boundary stage of the resilience CPPB pipeline. Single responsibility: own a timer that fires a health check on a fixed cadence, so a connection that dies while the store is IDLE (no traffic to trigger the reactive `retry` path or the on-demand `ensure-live!` gate) still heals. This closes the gap where auto-heal was 100% traffic-driven: after a network blip with no in-flight RPC, nothing re-probed and the dead client sat dead until the next operation happened to touch it. Why this ns owns ONLY the timer (SRP + DRY): - The health *decision* — 'is it dead, and if so start a heal loop WITHOUT disturbing one already in flight' — already lives in `retry/ensure-live!` (reads cached liveness, kicks the reconnect loop only `when-not` it is already running). Re-implementing it here would duplicate the guard and risk calling `reconnect/kick!` mid-heal, which drops the fresh client on every tick. So the tick DELEGATES the policy and keeps only the scheduling (Boundary) concern. - Complements, does not replace: reactive retry (on failure) + preemptive ensure-live! (at op start) stay as-is; this adds the idle heartbeat that neither covered. Lifecycle: started from `store.lifecycle/connect!` once the config-atom exists; stopped from `store.lifecycle/disconnect!` before teardown, so the timer can't kick a heal loop right after the operator closed the store. Time discipline: never call `System/currentTimeMillis` directly — go through `hive-ttracking.clock/now-millis` (mirrors probe/reconnect).
Idle liveness-probe cadence (seconds). 30 s sits well above the ~5 s probe
cache TTL (so every tick forces a genuine round-trip, never a stale
positive) and well below any human-scale idle window (so a blip heals
within one tick). Promotable to a MilvusConfig field if per-deployment
tuning is ever needed.
Idle liveness-probe cadence (seconds). 30 s sits well above the ~5 s probe cache TTL (so every tick forces a genuine round-trip, never a stale positive) and well below any human-scale idle window (so a blip heals within one tick). Promotable to a `MilvusConfig` field if per-deployment tuning is ever needed.
(health-tick! config-atom)One idle health check. Forces a fresh liveness read (invalidate the probe
cache so ensure-live!'s cached alive? re-probes rather than trusting a
possibly stale-positive snapshot), then delegates to retry/ensure-live!,
which kicks the background reconnect loop iff the client is dead AND no
loop is already running. Returns the boolean liveness at end of tick.
r/rescue guarantees a boolean, never a throw — a tick must never be the
thing that kills its own scheduler.
One idle health check. Forces a fresh liveness read (invalidate the probe cache so `ensure-live!`'s cached `alive?` re-probes rather than trusting a possibly stale-positive snapshot), then delegates to `retry/ensure-live!`, which kicks the background reconnect loop iff the client is dead AND no loop is already running. Returns the boolean liveness at end of tick. `r/rescue` guarantees a boolean, never a throw — a tick must never be the thing that kills its own scheduler.
(start! config-atom)(start! config-atom interval-s)Start the periodic idle-liveness scheduler. Idempotent (a second call while
running is a no-op). interval-s <= 0 disables it. The first tick fires
after one full interval — connect! has already established (or handed off)
the connection, so there is no point probing immediately.
Start the periodic idle-liveness scheduler. Idempotent (a second call while running is a no-op). `interval-s <= 0` disables it. The first tick fires after one full interval — connect! has already established (or handed off) the connection, so there is no point probing immediately.
(status)Current scheduler status — for ops tooling / health endpoints.
Current scheduler status — for ops tooling / health endpoints.
(stop!)Stop the scheduler (if running). Called from the store's disconnect! path so the timer can't kick a heal loop after a deliberate close. Idempotent.
Stop the scheduler (if running). Called from the store's disconnect! path so the timer can't kick a heal loop after a deliberate close. Idempotent.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |