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

hcm: move StreamInfo and filter creation into FM #12470

Merged
merged 18 commits into from
Aug 5, 2020

Conversation

snowp
Copy link
Contributor

@snowp snowp commented Aug 4, 2020

Moves the ownership of the StreamInfoImpl into the FilterManager, exposed via an accessor to allow the ActiveStream to
still modify/read the StreamInfo.

Moves the interaction with the FilterChainFactory into the FilterManager, as well as ownership over the access logs created
via the factory callbacks.

Risk Level: Medium
Testing: Existing tests
Docs Changes: n/a
Release Notes: n/a
Part of #10454

Snow Pettersen and others added 17 commits July 28, 2020 10:07
Introduces FilterManagerCallbacks which can be used by the FM to call
back out with the encoded data. This interface will be expanded as more
functionalitiy is split between the ActiveStream and the FilterManager.

Also makes the majority of FM functions private, relying on befriending
the filter wrappers and a more well defined interface for the ActiveStream
to pass headers/data to be decoded by the FM.

Signed-off-by: Snow Pettersen <kpettersen@netflix.com>
Signed-off-by: Snow Pettersen <kpettersen@netflix.com>
Signed-off-by: Snow Pettersen <kpettersen@netflix.com>
Signed-off-by: Snow Pettersen <kpettersen@netflix.com>
Signed-off-by: Snow Pettersen <kpettersen@netflix.com>
Signed-off-by: Snow Pettersen <kpettersen@netflix.com>
Signed-off-by: Snow Pettersen <kpettersen@netflix.com>
Signed-off-by: Snow Pettersen <kpettersen@netflix.com>
Signed-off-by: Snow Pettersen <kpettersen@netflix.com>
Signed-off-by: Snow Pettersen <kpettersen@netflix.com>
Signed-off-by: Snow Pettersen <kpettersen@netflix.com>
Signed-off-by: Snow Pettersen <kpettersen@netflix.com>
Signed-off-by: Snow Pettersen <kpettersen@netflix.com>
Signed-off-by: Snow Pettersen <kpettersen@netflix.com>
Signed-off-by: Snow Pettersen <kpettersen@netflix.com>
Signed-off-by: Snow Pettersen <kpettersen@netflix.com>
Signed-off-by: Snow Pettersen <aickck@gmail.com>
@snowp
Copy link
Contributor Author

snowp commented Aug 4, 2020

An alternative approach would be to keep the StreamInfo at the AS level but pass a mutable ref to the filter manager via its ctor, which might be better? Open for suggestions here

@@ -533,8 +534,12 @@ ConnectionManagerImpl::ActiveStream::ActiveStream(ConnectionManagerImpl& connect
connection_manager.config_.scopedRouteConfigProvider() == nullptr)),
"Either routeConfigProvider or scopedRouteConfigProvider should be set in "
"ConnectionManagerImpl.");
for (const AccessLog::InstanceSharedPtr& access_log : connection_manager_.config_.accessLogs()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This pushes the access logs via the config onto the same list as the ones coming via the filter factory, so we avoid having to loop over both this and the list of registered access logs in the FM dtor

Signed-off-by: Snow Pettersen <aickck@gmail.com>
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Nice, thanks.

@snowp snowp merged commit 014a255 into envoyproxy:master Aug 5, 2020
chaoqin-li1123 pushed a commit to chaoqin-li1123/envoy that referenced this pull request Aug 7, 2020
Moves the ownership of the StreamInfoImpl into the FilterManager, exposed via an accessor to allow the ActiveStream to
still modify/read the StreamInfo.

Moves the interaction with the FilterChainFactory into the FilterManager, as well as ownership over the access logs created
via the factory callbacks.

Signed-off-by: Snow Pettersen <aickck@gmail.com>
chaoqin-li1123 pushed a commit to chaoqin-li1123/envoy that referenced this pull request Aug 7, 2020
Moves the ownership of the StreamInfoImpl into the FilterManager, exposed via an accessor to allow the ActiveStream to
still modify/read the StreamInfo.

Moves the interaction with the FilterChainFactory into the FilterManager, as well as ownership over the access logs created
via the factory callbacks.

Signed-off-by: Snow Pettersen <aickck@gmail.com>
Signed-off-by: chaoqinli <chaoqinli@google.com>
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.

2 participants