Skip to content

perry-ext-http's AGENT_CLIENTS cache never evicts #10328

Closed

Description

@proggeramlug

Problem

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions