Closed mistval closed 2 months ago
Hey, can you reproduce without express
and dd-trace
?
Hey, can you reproduce without
express
anddd-trace
?
Hi, no I cannot. Removing any of the four contributing factors leads to resolution of the leak.
In that case, it sounds like this is an issue with a third-party dependency, and not Node.js itself.
does it happen if you use fetch from the latest version of undici?
does it happen if you use fetch from the latest version of undici?
Actually it does NOT happen if I import fetch from 'undici';
I suppose that must mean this is already on its way to being resolved, so I'll go ahead and close this. Thanks!
Version
v20.16.0
Platform
Subsystem
fetch
What steps will reproduce the bug?
This leak seems to require several factors:
dd-trace
npm modulefetch
to the Expressrequest
objectIf any of these factors are missing, there is no leak. I'm not sure whether this would better be understood as a defect in Node.js or in
dd-trace
. The event that triggered this leak in our case was the upgrade from Node v20.15.1 to Node v20.16.0.To reproduce:
npm i dd-trace@5.2.0 express@4.18.2
(and optionally node-fetch@3.3.2 if you want to confirm that node-fetch does not trigger the leak)docker run -p 3001:80 -d kennethreitz/httpbin
(server to respond to the fetch requests)node --max-old-space-size=50 repro.mjs
withrepro.mjs
having the following content:npx autocannon -m GET -d 1000 'http://localhost:3000'
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
No OOM crash, as that is the behavior of the previous LTS release of Node.js.
What do you see instead?
OOM crash:
Additional information
It seems likely that this is triggered by an update of undici in Node core as mentioned in this issue: https://github.com/nodejs/node/issues/54274#issuecomment-2288834439
But it seems like a distinct issue.