statusboard icon indicating copy to clipboard operation
statusboard copied to clipboard

feat(agent): introduce new, consolidated http agent

Open darcyclarke opened this issue 3 years ago • 7 comments

Summary

Historically npm has had 3-4 different http agents; consolidating on a single one allows us to optimize perf in one place & add new capabilities

Exit Criteria

  • [x] create new @npmcli/agent library
  • [x] remove legacy agents & refactor code paths to use @npmcli/agent
  • [ ] add new configs for fine-grained timeouts (ex. time-to-first-byte, total transfer time, idel-time etc.) & bubble them up to the CLI
  • [ ] document new configs

darcyclarke avatar Oct 17 '22 18:10 darcyclarke

This is blocked while we figure out a feature flag approach for things like this.

wraithgar avatar Dec 12 '22 19:12 wraithgar

what is the priority, can this wait?

saquibkhan avatar Jan 03 '23 17:01 saquibkhan

not extremely high priority, but it is a significant fix for any of our users that leverage a proxy. the current http agents we use for proxies do not support socket limiting, so it's fairly common for the folks who use them to end up seeing connection reset errors and extremely long response times since we're sending a lot of http requests without concurrency limits

nlf avatar Jan 03 '23 17:01 nlf

ok, do we know high level effort needed to complete this?

saquibkhan avatar Jan 03 '23 18:01 saquibkhan

i've opened issues for the remaining work to be done to the agent itself in its own repo https://github.com/npm/agent/issues

the config work is not represented in an issue yet, i'll open one for designing feature flags

nlf avatar Jan 03 '23 18:01 nlf

We have lots of issues due to ECONNRESET while using a internal proxy and setting fetch-retries and fetch-factor doesn't help as seems like it doesn't retry on ECONNRESET. I hope this might help und it would be awesome if it would not be far down the road.

burka avatar Jan 05 '23 09:01 burka

it has dependency on experimantal flag - https://github.com/npm/statusboard/issues/631

saquibkhan avatar Jan 26 '23 18:01 saquibkhan

This is complete except for the fine grained configs which will be a followup task here.

lukekarrys avatar May 06 '24 23:05 lukekarrys