pacote icon indicating copy to clipboard operation
pacote copied to clipboard

Support ECONNRESET recovery

Open zkat opened this issue 7 years ago • 1 comments

So with the http client, it's possible for a request to die mid-stream. Right now, that just kinda implodes and starts the process over. Instead, we should emit reset events on retries. For bonus points, the client should handle http Range requests, which would avoid that reset on http retries -- so the stream can start over exactly where it left off!

Range requests are often supported OOTB by various http servers, and we can just check if our Range was accepted (by looking for Content-Range) and otherwise do the full reset. This should be cool!

Implementing this, though, very likely requires ripping open npm-registry-client, which I guess we should be doing anyway.

zkat avatar Feb 03 '17 03:02 zkat

Note: Tarball fetches do this already, which I'm actually kinda fine with -- most installs once package-lock.json is in place will only touch tarballs. As long as we can repeat those, we're good.

zkat avatar Apr 29 '17 06:04 zkat