Repository navigation
Fix HTTP/2 window accounting and parser test socket leaks - #3749
Open
chenBright wants to merge 2 commits into
Open
chenBright wants to merge 2 commits into
chenBright wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
3 open issues
What changed in this PR
Fixes an HTTP/2 flow-control window leak when rejecting oversized DATA frames (including padding), and plugs socket lifetime leaks in memcache/Couchbase parser regression tests.
Changes:
- Account for the full HTTP/2 DATA payload (including padding) before body parsing so cleanup restores connection credit on oversized bodies.
- Release extra
Socketcreation references in memcache/Couchbase parser tests and assert sockets are recycled. - Add an HTTP/2 regression test covering split vs. unsplit and padded vs. unpadded oversized bodies.
| File | Description |
|---|---|
| test/brpc_memcache_unittest.cpp | Releases socket creation ref and asserts socket is destroyed to prevent test socket leaks. |
| test/brpc_http_rpc_protocol_unittest.cpp | Adds HTTP/2 flow-control regression test for oversized DATA handling and window restoration. |
| test/brpc_couchbase_unittest.cpp | Releases socket creation ref and asserts socket is destroyed to prevent test socket leaks. |
| src/brpc/policy/http2_rpc_protocol.cpp | Fixes DATA window accounting by recording full payload size before OnBody() can reject. |
Review effort: Lite
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The review identifies no active issues, with the changes addressing HTTP/2 flow-control cleanup and socket-reference leaks through targeted regression coverage.
No open issues 🎉
3 resolved since last review
Review effort: Lite
Contributor
Author
|
@wwbmmm PTAL. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.


What problem does this PR solve?
Issue Number: N/A (follow-up to #3382)
Problem Summary:
Oversized HTTP/2 DATA frames are rejected before their flow-control credit is recorded. Stream cleanup cannot recover that credit, gradually reducing the connection window and potentially stalling other streams.
The memcache and Couchbase regression tests also retain the extra Socket creation reference, preventing the sockets from being recycled.
What is changed and the side effects?
Changed:
Side effects:
Performance effects:
Breaking backward compatibility:
Check List: