-
Notifications
You must be signed in to change notification settings - Fork 5.3k
http3: capacity fixes #18879
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
http3: capacity fixes #18879
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,6 +35,11 @@ class ActiveClient : public MultiplexedActiveClientBase { | |
| return MultiplexedActiveClientBase::newStreamEncoder(response_decoder); | ||
| } | ||
|
|
||
| uint32_t effectiveConcurrentStreamLimit() const override { | ||
| return std::min<int64_t>(MultiplexedActiveClientBase::effectiveConcurrentStreamLimit(), | ||
| quiche_capacity_); | ||
| } | ||
|
|
||
| // Overload the default capacity calculations to return the quic capacity | ||
| // (modified by any stream limits in Envoy config) | ||
| int64_t currentUnusedCapacity() const override { | ||
|
|
@@ -54,10 +59,18 @@ class ActiveClient : public MultiplexedActiveClientBase { | |
| quiche_capacity_ = new_quiche_capacity; | ||
| uint64_t new_capacity = currentUnusedCapacity(); | ||
|
|
||
| if (new_capacity < old_capacity) { | ||
| parent_.decrClusterStreamCapacity(old_capacity - new_capacity); | ||
| } else if (old_capacity < new_capacity) { | ||
| parent_.incrClusterStreamCapacity(new_capacity - old_capacity); | ||
| if (connect_timer_) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question: Why doesn't this just call
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if this answers your question but, I think the crux of the issue is that with HTTP/2 the setting SETTINGS_MAX_CONCURRENT_STREAMS specifies a limit on "open" streams. This means that a client may open a new stream any time it closes a stream. But HTTP/3 stream limits are managed at the QUIC layer. With QUIC, the limit is (effectively) the largest stream ID that can be opened. When a client closes a stream, that has no effect on the limit and the client may not be able to open a new stream. Only when the server sends a new MAX_STREAMS frame will the limit increase. This difference between HTTP/2 and HTTP/3 is pretty fundamental, albeit rather annoying.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it; that makes sense. Thanks! |
||
| if (new_capacity < old_capacity) { | ||
| parent_.decrConnectingAndConnectedStreamCapacity(old_capacity - new_capacity); | ||
| } else if (old_capacity < new_capacity) { | ||
| parent_.incrConnectingAndConnectedStreamCapacity(new_capacity - old_capacity); | ||
| } | ||
| } else { | ||
| if (new_capacity < old_capacity) { | ||
| parent_.decrClusterStreamCapacity(old_capacity - new_capacity); | ||
| } else if (old_capacity < new_capacity) { | ||
| parent_.incrClusterStreamCapacity(new_capacity - old_capacity); | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
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.
nit: newline before
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.
done