Commit 573ac8c4 authored by Andrea Sgambelluri's avatar Andrea Sgambelluri
Browse files

telemetry: return a stagger slot when its job expires, not only on unsubscribe

UnsubscribeState released slots from the jobs it removed, but a job whose
duration_s has elapsed is dropped by APScheduler itself, so the call that
TerminateCollector makes afterwards finds nothing to remove, returns early
and the slot is never handed back. Duration-limited collectors are the
common case, so the offset still grew for the life of the process.

Track the slot taken by each subscription id, and release it from that
record in UnsubscribeState and in Disconnect, whichever happens first.
parent 13f56428
Loading
Loading
Loading