Skip to content

[bug] TCP memory leak caused by aborted client connections when streaming data with node-fetch #1834

Open
@AtnesNess

Description

@AtnesNess

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

  • [+] I have searched through GitHub issues for similar issues.
  • [+] I have completely read through the README and documentation.
  • [+] I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions