code wiki / _hdl_build / nx_consul_health.nx
nx_consul_health.nx
buildroot/runtime/_hdl_build/nx_consul_health.nx
about
nx_consul_health.nx -- sovereign LIVE HEALTH CHECKS (HashiCorp Consul health-check-class; CONSUL-004).
Drives each instance's health (PASSING/CRITICAL in the CONSUL-001 registry) from a probe result -- in
production probe_ok = (nx_reach_probe(addr,port) == 0), real TCP reachability. FLAP PROTECTION: a single
failure does NOT flip a healthy node; it takes fail_thr CONSECUTIVE failures to go CRITICAL, and pass_thr
CONSECUTIVE successes to recover to PASSING -- so transient blips don't yank a node out of discovery/DNS.
The updated health array feeds cs_discover / csd_resolve directly = the loop is closed. Composes
nx_consul_registry. license_tier: ORIGINAL
dependencies 2 imports · 2 importers
imports: nx_consul_registry.nxnx_syscalls.nx
imported by: nx_consul_health_test.nxnx_consul_suite_test.nx
structs
| none |
consts
| none |
functions
| 13 | func hc_tick(health: *i64, cfails: *i64, cpasses: *i64, idx: i64, probe_ok: i64, fail_thr: i64, pass_thr: i64) -> i64 |