-
-
Notifications
You must be signed in to change notification settings - Fork 970
Description
Describe the bug
- Node.js version: 10.12
- OS & version: Docker node:10.12-slim
Problem
We started seeing a large increase in memory usage in our code after updating to the latest version of got in code that is running a few hundred requests a second. After testing every commit between v9.3.0 and v9.4.0 we were able to narrow it down to this one: https://github.com/sindresorhus/got/pull/659/files.
In our setup we are running got configured with timeout, retries and http-keepalive.
Code to reproduce
I'm working on trying to isolate the case into one that is reproducible outside of our code base. It seems to start leaking when there are requests that timeout.
I'm creating this issue now in case someone is able to look at the commit above and understand why it causes memory usage to increase.
Question
What is the purpose of setting request.setTimeout(0) after the request is canceled? Could it be that 0 in this case means "no timeout", so that we end up in a situation where there are a lot more connections open consuming memory?
Checklist
- I have read the documentation.
- I have tried my code with the latest version of Node.js and Got.