Skip to content

http2: release memory credit for canceled writes - #66784

Open
fatihguzeldev wants to merge 1 commit into
nodejs:mainfrom
fatihguzeldev:http2-cancelled-upload-memory
Open

fatihguzeldev wants to merge 1 commit into
nodejs:mainfrom
fatihguzeldev:http2-cancelled-upload-memory

Conversation

@fatihguzeldev

Copy link
Copy Markdown

when an upload was canceled, its queued data was discarded but still counted toward the session's memory limit. that could make later requests on the same session fail with NGHTTP2_ENHANCE_YOUR_CALM.

cleanup now subtracts those bytes before running the write callbacks. the test checks both cancellation by the server and destroy() from a write callback.

Fixes: #66742

Canceled uploads left unsent bytes charged to the session,
causing later requests to fail with NGHTTP2_ENHANCE_YOUR_CALM.

Release the remaining credit during deferred cleanup, before
running write callbacks.

Signed-off-by: Fatih Güzel <fatihguzeldev@gmail.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/http2
  • @nodejs/net

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. http2 Issues and PRs related to the http2 subsystem. needs-ci PRs that need a full CI run. labels Oct 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Welcome to Node.js, and thank you for your first contribution!

Before review, please take a moment to read:

Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. http2 Issues and PRs related to the http2 subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

http2: canceled upload leaves session memory accounting over budget

2 participants