Skip to content
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

tcp: towards pluggable upstreams #13331

Merged
merged 7 commits into from
Oct 13, 2020

Conversation

alyssawilk
Copy link
Contributor

Commit Message: Refactoring TCP code to match HTTP code in preparation for pluggable TCP upstreams.
Risk Level: High - fairly major refactor
Testing: existing tests pass
Docs Changes: n/a
Release Notes: n/a

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
antoniovicente
antoniovicente previously approved these changes Oct 1, 2020
Copy link
Contributor

@antoniovicente antoniovicente left a comment

Choose a reason for hiding this comment

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

Just a few nits. Thanks for the refactor.

const Network::Address::InstanceConstSharedPtr& local_address,
Ssl::ConnectionInfoConstSharedPtr ssl_info) {
upstream_ = std::move(upstream);
generic_conn_pool_.reset();
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be good to say something about the invariants on generic_conn_pool_ and upstream_. It seems that upstream_ should be null as we enter this method and when we create a generic_conn_pool_, and generic_conn_pool_ should be null when upstream_ is not null.

upstream_handle_ = nullptr;
callbacks_->onGenericPoolFailure(reason, host);
}
void TcpConnPool::onPoolReady(Tcp::ConnectionPool::ConnectionDataPtr&& conn_data,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: missing newline above.

upstream_handle_ = nullptr;
callbacks_->onGenericPoolFailure(reason, host);
}
void HttpConnPool::onPoolReady(Http::RequestEncoder& request_encoder,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: missing newline above.

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

@ggreenway any thoughts?

@ggreenway
Copy link
Contributor

Sorry, I'm behind on my reviews. Will review today.

Copy link
Contributor

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

I like the direction this is going.

source/common/tcp_proxy/upstream.h Show resolved Hide resolved

HttpConnPool::~HttpConnPool() {
if (upstream_handle_ != nullptr) {
upstream_handle_->cancel(Tcp::ConnectionPool::CancelPolicy::Default);
Copy link
Contributor

Choose a reason for hiding this comment

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

This cancel uses Default, but the Tcp one above uses CloseExcess. Why are they different?

Copy link
Contributor

Choose a reason for hiding this comment

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

This would read better if you used Http::ConnectionPool::.... They're the same type, but it looks weird this way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

legacy - the TCP pool always used close excess, and HTTP always used default.

Copy link
Contributor

Choose a reason for hiding this comment

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

Add comment explaining that please.

source/common/tcp_proxy/upstream.h Outdated Show resolved Hide resolved
source/common/tcp_proxy/tcp_proxy.cc Show resolved Hide resolved
@ggreenway
Copy link
Contributor

/wait

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

@antoniovicente antoniovicente left a comment

Choose a reason for hiding this comment

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

Changes look good, see if greg has any remaining comments. Sorry for the delays on review due to vacation.

@alyssawilk
Copy link
Contributor Author

@ggreenway added your comment - anything else?

@alyssawilk alyssawilk merged commit 82e7109 into envoyproxy:master Oct 13, 2020
mpuncel added a commit to mpuncel/envoy that referenced this pull request Oct 14, 2020
* master: (22 commits)
  http: using CONNECT_ERROR for HTTP/2 (envoyproxy#13519)
  listener: respect address.pipe.mode (it didn't work) (envoyproxy#13493)
  examples: Fix more deprecations/warnings in configs (envoyproxy#13529)
  overload: tcp connection refusal overload action (envoyproxy#13311)
  tcp: towards pluggable upstreams (envoyproxy#13331)
  conn_pool: fixing comments (envoyproxy#13520)
  Prevent SEGFAULT when disabling listener (envoyproxy#13515)
  Convert overload manager config literals to YAML (envoyproxy#13518)
  Fix runtime feature variable name (envoyproxy#13533)
  dependencies: refactor repository location schema utils, cleanups. (envoyproxy#13452)
  router:  fix an invalid ASSERT when encoding metadata frames in the router. (envoyproxy#13511)
  http2: Proactively disconnect connections flooded when resetting stream (envoyproxy#13482)
  ci use azp to sync filter example (envoyproxy#13501)
  mongo_proxy: support configurable command list for metrics (envoyproxy#13494)
  http local rate limit: note token bucket is shared (envoyproxy#13525)
  wasm/extensions: Wasm extension policy. (envoyproxy#13526)
  http: removing envoy.reloadable_features.http1_flood_protection (envoyproxy#13508)
  build: update ppc64le CI build status shield (envoyproxy#13521)
  dependencies: enforce dependency shepherd sign-off via RepoKitteh. (envoyproxy#13522)
  Add no_traffic_healthy_interval (envoyproxy#13336)
  ...

Signed-off-by: Michael Puncel <mpuncel@squareup.com>
@alyssawilk alyssawilk deleted the pluggable_tcp_tcp branch June 10, 2021 13:43
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.

3 participants