http2: fix session memory accounting after pausing#30684
Closed
mikelehen wants to merge 1 commit intonodejs:masterfrom
Closed
http2: fix session memory accounting after pausing#30684mikelehen wants to merge 1 commit intonodejs:masterfrom
mikelehen wants to merge 1 commit intonodejs:masterfrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
(
node/src/node_http2.cc
Line 871 in f36331c
the early return on line 873 skips the
DecrementCurrentSessionMemory(stream_buf_.len) call below (line 878).
When we later finished processing the input chunk
(
node/src/node_http2.cc
Line 1858 in f36331c
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)