-
Notifications
You must be signed in to change notification settings - Fork 5.3k
quic: ameliorating stream limit bug #18614
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
Changes from all commits
296d9f5
6c7de37
3f51660
b67b07c
d145421
bef23af
60ca832
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 |
|---|---|---|
|
|
@@ -15,14 +15,28 @@ | |
| namespace Envoy { | ||
| namespace Http { | ||
| namespace Http3 { | ||
| namespace { | ||
|
|
||
| uint32_t getMaxStreams(const Upstream::ClusterInfo& cluster) { | ||
| return PROTOBUF_GET_WRAPPED_OR_DEFAULT(cluster.http3Options().quic_protocol_options(), | ||
| max_concurrent_streams, 100); | ||
| } | ||
|
|
||
| } // namespace | ||
|
|
||
| ActiveClient::ActiveClient(Envoy::Http::HttpConnPoolImplBase& parent, | ||
| Upstream::Host::CreateConnectionData& data) | ||
| : MultiplexedActiveClientBase(parent, getMaxStreams(parent.host()->cluster()), | ||
|
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. Do MultiplexedActiveClientBase() and quic_config regard the value of getMaxStreams() differently which caused the stream accounting to be inconsistent? How does ActiveClient handle newStream exceeding limit? Does it close the request encoder immediately? If so can we just +1 of that value to pass into quic config so that we don't violate QUICHE assertion?
Contributor
Author
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 think I covered this in the debate on the main thread so I think it's resolved. |
||
| parent.host()->cluster().stats().upstream_cx_http3_total_, data) { | ||
| } | ||
|
|
||
| void Http3ConnPoolImpl::setQuicConfigFromClusterConfig(const Upstream::ClusterInfo& cluster, | ||
| quic::QuicConfig& quic_config) { | ||
| // TODO(alyssawilk) use and test other defaults. | ||
| quic::QuicTime::Delta crypto_timeout = | ||
| quic::QuicTime::Delta::FromMilliseconds(cluster.connectTimeout().count()); | ||
| quic_config.set_max_time_before_crypto_handshake(crypto_timeout); | ||
| int32_t max_streams = | ||
| cluster.http3Options().quic_protocol_options().max_concurrent_streams().value(); | ||
| int32_t max_streams = getMaxStreams(cluster); | ||
|
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. Nice find! |
||
| quic_config.SetMaxBidirectionalStreamsToSend(max_streams); | ||
| quic_config.SetMaxUnidirectionalStreamsToSend(max_streams); | ||
| Quic::configQuicInitialFlowControlWindow(cluster.http3Options().quic_protocol_options(), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,7 +80,12 @@ class EnvoyQuicClientSession : public QuicFilterManagerConnectionImpl, | |
| quic::QuicSpdyStream* CreateIncomingStream(quic::QuicStreamId id) override; | ||
| quic::QuicSpdyStream* CreateIncomingStream(quic::PendingStream* pending) override; | ||
| std::unique_ptr<quic::QuicCryptoClientStreamBase> CreateQuicCryptoStream() override; | ||
|
|
||
| bool ShouldCreateOutgoingBidirectionalStream() override { | ||
|
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. Please add TODO(18160) to honor stream limit and state that current overriding may result in peer close connection.
Contributor
Author
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. Would make sense as a TODO but I missed this and have the follow-up PR ready so I'm going to claim a fix counts as better than a TODO :-) |
||
| ASSERT(quic::QuicSpdyClientSession::ShouldCreateOutgoingBidirectionalStream()); | ||
| // Prefer creating an "invalid" stream outside of current stream bounds to | ||
RyanTheOptimist marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // crashing when dereferencing a nullptr in QuicHttpClientConnectionImpl::newStream | ||
| return true; | ||
| } | ||
| // QuicFilterManagerConnectionImpl | ||
| bool hasDataToWrite() override; | ||
| // Used by base class to access quic connection after initialization. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -128,6 +128,7 @@ FQDN | |
| FREEBIND | ||
| FUZZER | ||
| FUZZERS | ||
| dereferencing | ||
|
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. lol |
||
| dnsresolvers | ||
| guarddog | ||
| GC | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.