-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
http2: strictly limit number of concurrent streams #16766
Conversation
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.
LGTM
src/node_http2_core-inl.h
Outdated
NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS); | ||
uint32_t maxSize = | ||
std::min(static_cast<uint32_t>(streams_.max_size()), | ||
maxConcurrentStreams); |
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.
If this works it’s going to be implementation-dependent luck, wrapping the size_t
to an uint32_t
is going to truncate the important bits away on 64-bit platforms. I think upcasting maxConcurrentStreams
to size_t
is what you’d rather want here, especially since you’re comparing streams_.size()
with the result, which generally is a size_t
too
Also, common core style is snake_case
for local variables
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.
Yeah, good point.
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.
LGTM, just nit/question.
server.listen(0, common.mustCall(() => { | ||
const client = http2.connect(`http://localhost:${server.address().port}`); | ||
|
||
client.on('sessionError', console.log); |
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.
Are these logs needed? To be explicit maybe wrap them in common.must(Not)Call
.
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.
oh, no, they're not. just forgot to remove them
d3ec486
to
f55d8e9
Compare
Failed on osx due to a flaky condition, updated and running again: https://ci.nodejs.org/job/node-test-pull-request/11398/ |
Trying again on OSX: https://ci.nodejs.org/job/node-test-pull-request/11402/ |
f8767f0
to
62e8632
Compare
CI is green now. @mcollina ... PTAL |
// is being handled on the server side. This is safe | ||
// to ignore on Windows because of the assert.strictEqual | ||
// check in the on('stream') handler which ensures that | ||
// only one request is being handled at any given time. |
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.
I don't think this is safe to ignore. IMHO it is part of the error handling refactoring that we talked about. All client in all OS must get an error in this condition. This test is about the server-side, so it's ok. If we have an issue to track the error handling refactoring, link it.
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.
The comment is a bit incorrect, we're not so much ignoring an error, we're just not expecting one. I'll be investigating further on why later on today, but on windows this second request is serialized out after the first response is received -- which is what should be happening. I actually think it's a bug on the posix side. The test is working exactly as it should. I'm not planning on landing this until I track down the specific issue.
62e8632
to
27cebcc
Compare
TODO: ci failed on OSX also. Will investigate |
Strictly limit the number of concurrent streams based on the current setting of the MAX_CONCURRENT_STREAMS setting
991b61c
to
22eb93b
Compare
updated and rebased |
CI is good. Getting this landed |
Strictly limit the number of concurrent streams based on the current setting of the MAX_CONCURRENT_STREAMS setting PR-URL: #16766 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Sebastiaan Deckers <[email protected]>
Landed in 653e894 |
Strictly limit the number of concurrent streams based on the current setting of the MAX_CONCURRENT_STREAMS setting PR-URL: #16766 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Sebastiaan Deckers <[email protected]>
Strictly limit the number of concurrent streams based on the current setting of the MAX_CONCURRENT_STREAMS setting PR-URL: #16766 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Sebastiaan Deckers <[email protected]>
Strictly limit the number of concurrent streams based on the current setting of the MAX_CONCURRENT_STREAMS setting PR-URL: nodejs#16766 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Sebastiaan Deckers <[email protected]>
Strictly limit the number of concurrent streams based on the current setting of the MAX_CONCURRENT_STREAMS setting Backport-PR-URL: #18050 PR-URL: #16766 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Sebastiaan Deckers <[email protected]>
Strictly limit the number of concurrent streams based on the current setting of the MAX_CONCURRENT_STREAMS setting Backport-PR-URL: #18050 PR-URL: #16766 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Sebastiaan Deckers <[email protected]>
Strictly limit the number of concurrent streams based on the current setting of the MAX_CONCURRENT_STREAMS setting Backport-PR-URL: nodejs#18050 PR-URL: nodejs#16766 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Sebastiaan Deckers <[email protected]>
Strictly limit the number of concurrent streams based on the current setting of the MAX_CONCURRENT_STREAMS setting Backport-PR-URL: #18050 Backport-PR-URL: #20456 PR-URL: #16766 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Sebastiaan Deckers <[email protected]>
Strictly limit the number of concurrent streams based on the
current setting the MAX_CONCURRENT_STREAMS setting.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
http2