Skip to content

node:http Agent socket pooling — getName works, real pool absent (#2129 followup) #2154

@proggeramlug

Description

@proggeramlug

Summary

PR #2XXX (#2129) shipped http.Agent / https.Agent as a constructible class with a real getName(options) and chainable no-op methods. That unblocks the basic agent-getname test family.

What Perry's Agent does NOT do today:

  • Socket poolinghttp.request({ agent }) opens a fresh reqwest connection every call, ignoring the agent. keepAlive/maxSockets/maxFreeSockets/maxTotalSockets are stored as state but not enforced.
  • agent.sockets / agent.freeSockets / agent.requests accessors — return undefined (no pool state to expose).
  • agent.createConnection / agent.createSocket overrides — tests like test-http-agent-close.js rewrite these to inject error paths; Perry stores the assignment but never calls back into it.
  • Argument validationnew http.Agent({ maxTotalSockets: -1 }) doesn't throw ERR_OUT_OF_RANGE (matches test-http-agent-maxtotalsockets.js's assert.throws expectations); see also stdlib doesn't throw Node arg-validation errors (ERR_INVALID_ARG_TYPE/EBADF/...) on bad input — ~85 tests across fs/buffer/net/http/crypto/zlib/process #2013 for the broader arg-validation gap.

Scope

These all require a real connection pool wired into the request path (js_http_request / js_https_request). That's a much larger change than the constructor + metadata work in #2129's first PR.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions