Agent Context Cleanup Service
internal class AgentContextCleanupService(proxy: Proxy, configVals: ConfigVals.Proxy2.Internal2, initBlock: AgentContextCleanupService.() -> Unit = {}) : GenericExecutionThreadService(source)
Background service that periodically evicts stale agent contexts.
Runs a loop that checks for agents whose last activity exceeds maxAgentInactivitySecs. Stale agents are removed from the path map and context manager, and their in-flight scrape requests are failed. A TOCTOU re-check guards against evicting agents that sent a heartbeat between the scan and the eviction.
Parameters
proxy
the parent Proxy instance
config Vals
internal proxy configuration (inactivity timeout, check interval)
init Block
optional initialization block run after listener registration
See also
Constructors
Link copied to clipboard
constructor(proxy: Proxy, configVals: ConfigVals.Proxy2.Internal2, initBlock: AgentContextCleanupService.() -> Unit = {})