Skip to content
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

Issue #1060 maximum number of streams on the client should be capped … #1071

Merged
merged 7 commits into from
Mar 1, 2017

Conversation

MakMukhi
Copy link
Contributor

@MakMukhi MakMukhi commented Feb 10, 2017

…at 100 by default

fixes #1060

Copy link
Contributor

@menghanl menghanl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Some minor comments.
Thanks.

}
var rstStream bool
defer func() {
if !rstStream {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comments here to explain what rstStream means and our special handling for streams quota pool.

@@ -1085,6 +1068,7 @@ func (t *http2Client) controller() {
t.framer.writeSettings(true, i.ss...)
}
case *resetStream:
t.streamsQuota.add(1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain a little bit about the race.

@@ -213,6 +213,9 @@ type Stream struct {
// the status received from the server.
statusCode codes.Code
statusDesc string
// rstStream is a flag that is true when a RST stream frame
// is sent to the server signifying that this stream is closing.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rstStream indicates whether a RSTStream needs to be sent to the server to signify that this stream is closing.

"is sent" is a bit confusing.

@@ -2671,6 +2671,45 @@ func testExceedMaxStreamsLimit(t *testing.T, e env) {
}
}

const defaultMaxStreamsClient = 100

func TestClientExceedMaxStreamsLimit(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about TestExceedDefaultMaxStreamsLimit, as opposed to the previous test TestExceedMaxStreamsLimit.

"Conn.resetTransport failed to create client transport",
"grpc: the connection is closing",
)
te.maxStream = 0 // Server allows infinite streams. The cap should be on client side.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add something saying that "the server won't send the settings frame for MaxConcurrentStreams"?

@menghanl menghanl merged commit 8b2e129 into grpc:master Mar 1, 2017
@MakMukhi MakMukhi deleted the issue_1060 branch May 4, 2018 02:05
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Client should avoid sending too many streams that exceeds server max stream limits
2 participants