-
Notifications
You must be signed in to change notification settings - Fork 4.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
Decouple transport flow control from application read. #1265
Conversation
transport/http2_client.go
Outdated
@@ -845,22 +837,19 @@ func (t *http2Client) handleData(f *http2.DataFrame) { | |||
t.notifyError(connectionErrorf(true, err, "%v", err)) | |||
return | |||
} | |||
// Decouple connection's flow control form application's read. |
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.
s/form/from
Also, explain a bit more here?
We won't remember what we decoupled when we get used to the new flow control structure.
transport/http2_server.go
Outdated
// Select the right stream to dispatch. | ||
s, ok := t.getStream(f) | ||
if !ok { | ||
if w := t.fc.onRead(uint32(size)); w > 0 { | ||
t.controlBuf.put(&windowUpdate{0, w}) | ||
} | ||
return | ||
} | ||
if size > 0 { | ||
s.mu.Lock() | ||
if s.state == streamDone { | ||
s.mu.Unlock() | ||
// The stream has been closed. Release the corresponding quota. |
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.
remove this comment
transport/http2_client.go
Outdated
@@ -845,22 +837,26 @@ func (t *http2Client) handleData(f *http2.DataFrame) { | |||
t.notifyError(connectionErrorf(true, err, "%v", err)) | |||
return | |||
} | |||
// Decouple connection's flow control from application's read. | |||
// An update on connection's flow control should not depend on | |||
// whether user-applicaiton has read the data or not. Such a |
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.
s/user-applicaiton/user application
(ditto for the comment further down)
transport/transport_test.go
Outdated
return false, nil | ||
}) | ||
|
||
// Exhaust client's conneciton window. |
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.
typo: connection
No description provided.