Skip to content

http3: capacity fixes#18879

Merged
alyssawilk merged 3 commits intoenvoyproxy:mainfrom
alyssawilk:capacity
Nov 8, 2021
Merged

http3: capacity fixes#18879
alyssawilk merged 3 commits intoenvoyproxy:mainfrom
alyssawilk:capacity

Conversation

@alyssawilk
Copy link
Copy Markdown
Contributor

Fixing a bug where the new quic limits weren't respected on connection creation, because accounting used effectiveConcurrentStreamLimit() which wasn't aware of quic stream limitations.

Risk Level: Medium
Testing: new integration test
Docs Changes: n/a
Release Notes: n/a

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@alyssawilk
Copy link
Copy Markdown
Contributor Author

cc @mum4k thanks again for the pointers w.r.t. nighthawk!

RyanTheOptimist
RyanTheOptimist previously approved these changes Nov 3, 2021
Copy link
Copy Markdown
Contributor

@RyanTheOptimist RyanTheOptimist left a comment

Choose a reason for hiding this comment

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

LGTM, modulo two nits. Nice catch!

ASSERT(connecting_stream_capacity_ >= delta);
connecting_stream_capacity_ -= delta;
}
void incrConnectingAndConnectedStreamCapacity(uint32_t delta) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: newline before

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

}

TEST_P(Http2UpstreamIntegrationTest, ManySimultaneousRequestsLaxUpstreamLimits) {
if (upstreamProtocol() == Http::CodecType::HTTP2) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this imply that this test will run for HTTP/1 and HTTP/3? Or is this only for HTTP/3 (since the file is multiplexed_upstream and HTTP/1 is not multiplexed?). If it's only HTTP/3, then maybe:

if (upstreamProtocol() != Http::CodecType::HTTP3) {
  return;
}

(and skip the conditional at line 283).

Alternatively, if it runs for HTTP/1, maybe add a comment?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

was cargo culted from prior test - it actually works for both so updating.

@mum4k
Copy link
Copy Markdown
Contributor

mum4k commented Nov 3, 2021

Thank you for your help in addressing this @alyssawilk.

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
RyanTheOptimist
RyanTheOptimist previously approved these changes Nov 4, 2021
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
parent_.decrClusterStreamCapacity(old_capacity - new_capacity);
} else if (old_capacity < new_capacity) {
parent_.incrClusterStreamCapacity(new_capacity - old_capacity);
if (connect_timer_) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Question: Why doesn't this just call MultiplexedActiveClientBase::onSettings()? In other words, why is this handled completely differently than http/2?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Got it; that makes sense. Thanks!

Copy link
Copy Markdown
Member

@ggreenway ggreenway left a comment

Choose a reason for hiding this comment

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

LGTM

@alyssawilk alyssawilk merged commit 6fe10e6 into envoyproxy:main Nov 8, 2021
mum4k added a commit to mum4k/nighthawk that referenced this pull request Nov 9, 2021
- as of envoyproxy/envoy#18668 `Envoy::Config::Utility::createTagProducer` now takes a new parameter `Stats::TagVector`.
- removed workaround that allowed the HTTP3 integration test to pass while Envoy assumed that `--max-concurrent-streams` is always 100. This was fixed in envoyproxy/envoy#18879.
- no changes in `.bazelrc`, `.bazelversion` or `ci/run_envoy_docker.sh`.

Signed-off-by: Jakub Sobon <mumak@google.com>
dubious90 pushed a commit to envoyproxy/nighthawk that referenced this pull request Nov 9, 2021
- as of envoyproxy/envoy#18668 `Envoy::Config::Utility::createTagProducer` now takes a new parameter `Stats::TagVector`.
- removed workaround that allowed the HTTP3 integration test to pass while Envoy assumed that `--max-concurrent-streams` is always 100. This was fixed in envoyproxy/envoy#18879.
- updated `tools/update_cli_readme_documentation.py` to match on custom markers rather than the backtick character, since one of the flags now contains backticks in its description. Marked sections for replacement with the custom edit markers in our documents.
- executed `update_cli_readme_documentation --mode fix`.
- no changes in `.bazelrc`, `.bazelversion` or `ci/run_envoy_docker.sh`.

Signed-off-by: Jakub Sobon <mumak@google.com>
@alyssawilk alyssawilk deleted the capacity branch August 4, 2022 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants