Skip to content

http2: fix session memory accounting after pausing#30684

Closed
mikelehen wants to merge 1 commit intonodejs:masterfrom
mikelehen:mikelehen/fix-http2-session-memory-accounting-leak
Closed

http2: fix session memory accounting after pausing#30684
mikelehen wants to merge 1 commit intonodejs:masterfrom
mikelehen:mikelehen/fix-http2-session-memory-accounting-leak

Conversation

@mikelehen
Copy link

The ability to pause input processing was added in 8a4a193 but
introduced a session memory accounting mismatch leading to potential
NGHTTP2_ENHANCE_YOUR_CALM errors.

After pausing
(

// Mark the remainder of the data as available for later consumption.
),
the early return on line 873 skips the
DecrementCurrentSessionMemory(stream_buf_.len) call below (line 878).

When we later finished processing the input chunk
(

if (UNLIKELY(stream_buf_offset_ > 0)) {
),
we were calling DecrementCurrentSessionMemory(stream_buf_offset_) [line
1875] which was a no-op since we just set stream_buf_offset_ to 0 [line
1873].

The correct amount to decrement by is still stream_buf_.len, since
that's the amount we skipped previously (line 878).

Fixes: #29223
Refs: 164ac5b

Checklist
  • make -j4 test (UNIX)
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

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

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. http2 Issues or PRs related to the http2 subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NGHTTP2_ENHANCE_YOUR_CALM when starting with version 10.16.3

9 participants