Skip to content

http3: applying config options upstream#16532

Merged
alyssawilk merged 4 commits intoenvoyproxy:mainfrom
alyssawilk:apply_quic_config
May 24, 2021
Merged

http3: applying config options upstream#16532
alyssawilk merged 4 commits intoenvoyproxy:mainfrom
alyssawilk:apply_quic_config

Conversation

@alyssawilk
Copy link
Copy Markdown
Contributor

Risk Level: low (http/3 only)
Testing: new unit tests
Docs Changes: n/a
Release Notes: n/a

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
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.

Sweet! Looks great!

namespace Http3 {
class Http3ConnPoolImplTest;

void setQuicConfigFromClusterConfig(const Upstream::ClusterInfo& cluster,
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.

Perhaps a comment on this method?

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!

Upstream::ClusterConnectivityState& state, CreateClientFn client_fn,
CreateCodecFn codec_fn, std::vector<Http::Protocol> protocol,
TimeSource& time_source)
: FixedHttpConnPoolImpl(host, priority, dispatcher, options, transport_socket_options,
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.

Your call, but I'd be inclined to move the body of both the constructor and destructor to the .cc file.

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

envoy_cc_test(
name = "conn_pool_test",
srcs = envoy_select_enable_http3(["conn_pool_test.cc"]),
tags = ["nofips"],
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.

nofips? As in the compliance standard?

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.

yeah. they did a fips version of boring a year or two back but we need a more modern version of boringssl for some of the QUIC crypto functions, so our QUIC impl is not compatible with Envoy builds latched to the fips boring.

Network::TransportSocketFactory& transport_socket_factory = host->transportSocketFactory();
quic_info_ = std::make_unique<Quic::PersistentQuicInfoImpl>(
dispatcher, transport_socket_factory, time_source, source_address);
setQuicConfigFromClusterConfig(host_->cluster(), quic_info_->quic_config_);
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.

It looks like this method is only called from the constructor. Do we have other places we expect to call it from? If not, perhaps we should just inline it into the constructor?

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.

I think it's slightly cleaner as a utility, but I could make it a static method in the pool to make usage a bit more clear?

setQuicConfigFromClusterConfig(host_->cluster(), quic_info_->quic_config_);
}

Quic::PersistentQuicInfoImpl& quicInfo() { return *quic_info_; }
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.

Should this be a const ref, or do we intend callers to modify it?

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.

this is basically a container of things passed to quic client sessions as they're created. since many of the items like the crypto config are non-const I think the into needs to be non-const as well.

initialize();

Quic::PersistentQuicInfoImpl& info = static_cast<Http3ConnPoolImpl*>(pool_.get())->quicInfo();
EXPECT_EQ(info.quic_config_.GetMaxUnidirectionalStreamsToSend(), 15);
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: Instead of repeating the numbers, could we do:
options->mutable_max_concurrent_streams()->value()?

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

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

@lizan PTAL

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
lizan
lizan previously approved these changes May 20, 2021
namespace Envoy {
namespace Http {
namespace Http3 {
class Http3ConnPoolImplTest;
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.

Http3ConnPoolImplTest is not used in this header?

@yanavlasov
Copy link
Copy Markdown
Contributor

LGTM, modulo small cleanup comment from Lizan.

/wait

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@alyssawilk alyssawilk merged commit c69eb57 into envoyproxy:main May 24, 2021
leyao-daily pushed a commit to leyao-daily/envoy that referenced this pull request Sep 30, 2021
Risk Level: low (http/3 only)
Testing: new unit tests
Docs Changes: n/a
Release Notes: n/a

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@alyssawilk alyssawilk deleted the apply_quic_config branch August 4, 2022 00:56
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