-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ignore flow control in h2 when sending first request #849
Merged
jamesge
merged 6 commits into
apache:master
from
zyearn:ignore_flowcontrol_in_first_req
Jul 22, 2019
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b307a42
ignore flow control in h2 when sending first request
zyearn cc83f72
revert some log format in H2Context::Describe
zyearn c64fbea
ignore_flowcontrol_in_first_req: init stream flow size to max
zyearn 418bb77
ignore_flowcontrol_in_first_req: make parseh2setting unchanged
zyearn fec8f10
ignore_flowcontrol_in_first_req: refine code
zyearn cc3c99f
ignore_flowcontrol_in_first_req: move comments inside if
zyearn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
首先这段代码可以如下简化:
其次目前的改法在WINDOWS_UPDATE过来前,还是有段时间_remote_window_left已经归位了,理论上做不到“只要server端connection-level window size设得很大就总能发送成功”,不过窗口比较小
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.这样简化是不是有个race:当client端第一个setting包收到后,将stream_window_size和_remote_window_left复原了,此时一个req的AppendAndDestroy正在调用,发现window太小,就发失败了。现在的pr代码可以避免”复原到初始“这个中间态。
2.从server的视角来说,client的default connection window size一定是65536,所以一定是server端来负责在合适的时候发WINDOWS_UPDATE来保证client可以一直发。如果接收到setting后,并且WINDOWS_UPDATE一直没发过来,这时候发送失败是个预期的行为。如果server的connection size很大,正确的实现是发完setting后立刻发WINDOWS_UPDATE(让client立刻感知),现在brpc server的代码就是这么实现的