mirror of
https://github.com/jambonz/sbc-outbound.git
synced 2026-10-04 02:04:19 +00:00
A server may run several sbc-inbound and sbc-outbound processes. When one of the sbc-inbound processes handles an AWS autoscale drain it must complete the terminating lifecycle hook only when the whole server is idle, not just its own process — otherwise the instance is terminated while sibling processes still have calls in progress. Each process now writes its own call count to a per-pid redis key (120s expiry, refreshed every 15s from activeCallIds.size) and registers that key in a per-host set, which the draining process enumerates and sums. See the companion change in sbc-inbound. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>