mirror of
https://github.com/openziti/ziti.git
synced 2026-09-11 13:29:03 +00:00
ebbf8684a6
Registry.Meter is reference counted: every call takes a reference, including calls that find the meter already present, and only Dispose releases one. The enforcers resolved a meter inside Run, so each run took a reference it never shed. Disposing such a meter decrements the count instead of stopping it, so it leaves the registry and keeps sampling. - resolves each enforcer's meter once, where the enforcer is built, and holds it - holds the timers alongside, though Timer is not reference counted, so a reader is not left working out why one of two adjacent lookups was cached - supplies the metrics in the session enforcer test, which builds the enforcer directly to get a negative session timeout that NewSessionEnforcer refuses Per enforcement cycle rather than per event, so the growth was one reference per run. Unbounded over a controller's lifetime, but slow. grep -rnE '\.(Meter|Histogram)\([^)]*\)\.(Mark|Update)' finds this shape; there are no others left outside tests.