mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-07 21:59:15 +00:00
* fix(store): debounce container change notifications to avoid reconcile storms SubscribeContainers forwarded every raw row-level change event from Corrosion as its own signal, with no coalescing. Each signal triggers a full reconcile (ListContainers + regenerate) in every independent subscriber (caddy-controller, DNS resolver) on every machine in the cluster. With enough container/health-check churn across services, this produces a sustained stream of events (observed ~1.6-1.7/sec cluster-wide on a 45-service, 7-machine cluster) and burns meaningful CPU on every machine continuously, regardless of whether that machine runs Caddy locally. On a resource-constrained node this escalated into kernel RCU stall warnings and a full freeze. Coalesce bursts of events into a single signal per debounce window instead of forwarding one per event. * bound debounced changes by the window --------- Co-authored-by: Pasha Sviderski <me@psviderski.name>