mirror of
https://github.com/jmcorgan/fips.git
synced 2026-08-09 16:24:45 +00:00
The pool's TTL clock (VirtualIpMapping.last_referenced) advanced only on DNS re-query, never on traffic, and the mapping-TTL is wired equal to the DNS TTL, so an in-use mapping was forced to drain at TTL and reclaimed at the first zero-conntrack tick (a stale drain_start gave no grace effective protection), breaking long-lived, bursty, or DNS-cached clients. In tick(), refresh last_referenced whenever conntrack reports sessions > 0 so an actively used mapping never ages out, and recover a Draining mapping to Active (clearing drain_start) when traffic resumes, so a later drain gets a fresh grace window instead of a stale one. The Active arm now only drains an idle mapping. The DNS-TTL / idle-reclaim-TTL wiring is unchanged. Adds regression tests for continuous-traffic-survives-past-TTL, bursty drain-then-recover, and fresh-grace-on-redrain.