You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perry-ext-http's AGENT_CLIENTS cache never evicts #10328
perry-ext-http's AGENT_CLIENTS cache never evicts. It holds one reqwest::Client per http.Agent, retained for the entire life of the process. The comment in the code itself acknowledges this.
Why it matters
A long-running program that creates many distinct http.Agent instances over its lifetime (which Node programs commonly do, including per-request or per-tenant agents in some frameworks) accumulates one reqwest::Client's worth of connections, buffers and TLS state per agent, unbounded, for as long as the process runs.
What would fix it
An eviction policy on AGENT_CLIENTS — LRU with a cap, a TTL, or tying an entry's lifetime to the Agent object's own GC lifetime — so the cache does not grow without bound over a long-running process.
Activity