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

listener: move active_tcp_listener out of conn handler #15553

Merged
merged 6 commits into from
Mar 25, 2021

Conversation

lambdai
Copy link
Contributor

@lambdai lambdai commented Mar 18, 2021

Commit Message:
Move active_tcp_listener out of conn handler.
Similar to #15349 but for tcp listener.
Signed-off-by: Yuchen Dai [email protected]

Additional Description:

Risk Level: Low. Mostly just move.
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
Fixes #15126
[Optional Deprecated:]
[Optional API Considerations:]

@lambdai lambdai marked this pull request as ready for review March 18, 2021 15:59
@lambdai
Copy link
Contributor Author

lambdai commented Mar 18, 2021

@ggreenway Could you take a look? As you suggested this is a code move with a minor change to support the move

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.

looks good overall

/wait

source/server/BUILD Show resolved Hide resolved
@@ -52,6 +38,7 @@ void ConnectionHandlerImpl::addListener(absl::optional<uint64_t> overridden_list
}
NOT_REACHED_GCOVR_EXCL_LINE;
}
// TODO(lambdai): Remove the dependency of ActiveTcpListener.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ggreenway This is the why active_tcp_listener.h is required at this PR.
The next PR will erase the dependency.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's fine, but the way to pull that in is via deps, not hdrs. I don't see a good reason to do it via hdrs, even temporarily.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There was a circle dependency if I don't use hdrs :(

Active_tcp_listener target depends on connection_handler_impl target: require ConnectionImplHandler:ActiveListenerImplBase in connection_handler_impl.h.

I can add the active_tcp_listener_header target to avoid this hdrs issue, like below. Hold on

active_tcp_listener_header: connection_handler_impl.h, active_tcp_listener.h
connection_handler_impl : connection_handler_impl.cc, active_tcp_listener_header
active_tcp_listener : active_tcp_listener.cc, active_tcp_listener_header

In active_tcp_listener.h

class ActiveTcpListener : public Network::TcpListenerCallbacks,
                          public ConnectionHandlerImpl::ActiveListenerImplBase,

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I see, I didn't understand that there was a circular dependency. Can you add a comment in the BUILD file explaining that, along with a TODO to fix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add the explanation and TODO in BUILD

Signed-off-by: Yuchen Dai <[email protected]>
ggreenway
ggreenway previously approved these changes Mar 23, 2021
Signed-off-by: Yuchen Dai <[email protected]>
lambdai added 2 commits March 23, 2021 16:11
Signed-off-by: Yuchen Dai <[email protected]>
@lambdai
Copy link
Contributor Author

lambdai commented Mar 24, 2021

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #15553 (comment) was created by @lambdai.

see: more, trace.

@lambdai
Copy link
Contributor Author

lambdai commented Mar 25, 2021

gental ping @ggreenway This PR is now passing all check

@ggreenway ggreenway merged commit fff2cf8 into envoyproxy:main Mar 25, 2021
@lambdai
Copy link
Contributor Author

lambdai commented Mar 25, 2021

Thank you!

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.

tech debt: connection handler implementation
2 participants