You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What I found is that stream is being destroyed on client connection abort. However, node-fetch stream abortion doesn't destroy the socket. I could see that by checking heap dump, this reference is not being cleared out with garbage collector since the request is not aborted. Ideally this function should be called on stream destroy.
Describe the bug
Node.js version: v18.16.0
OS version: Amazon Linux 2 x86_64
Description: Providing node-fetch response body stream into
ctx.body
leads to TCP memory leak when client aborts data download half way through.Actual behavior
TCP memory keeps increasing with every aborted request and never goes down
Expected behavior
TCP memory to recover after streaming is complete/aborted
Code to reproduce
See https://github.com/AtnesNess/koa-node-fetch-issue
Checklist
The text was updated successfully, but these errors were encountered: