Skip to content

server: Introduce ServerFactoryContext#8485

Merged
htuch merged 24 commits intoenvoyproxy:masterfrom
lambdai:serverfactorycontext
Oct 18, 2019
Merged

server: Introduce ServerFactoryContext#8485
htuch merged 24 commits intoenvoyproxy:masterfrom
lambdai:serverfactorycontext

Conversation

@lambdai
Copy link
Copy Markdown
Contributor

@lambdai lambdai commented Oct 4, 2019

Description:
Introduce ServerFactoryContext which is an implementation of CommonFactoryContext. Comparing to ListenerFactoryContext, ServerFactoryContext has a wider lifetime.
This is the prerequisite to share rds configuration among listeners.

Also experimenting move messageValidateVisitor out of CommonFactoryContext. The benefit is that now Server::Instance perfectly implements CommonFactoryContext.

  • ServerFactoryContext doesn't implement the function. The test shows it is never invoked.
  • Will put messageValidateVisitor into FactoryContext: this piece of work will be done in follow up PR

Notes to reviewers:
clang-tidy error is not introduced in this PR. Create #8509 to track
Will fix once this PR is merged

This PR is extracted from #8454

Risk Level:
Testing:
Docs Changes:
Release Notes:
Fixes #8303

Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
@lambdai
Copy link
Copy Markdown
Contributor Author

lambdai commented Oct 4, 2019

Not fixing all the tests yet. Will resume tomorrow

Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
@htuch
Copy link
Copy Markdown
Member

htuch commented Oct 7, 2019

/assign @htuch

Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
@lambdai
Copy link
Copy Markdown
Contributor Author

lambdai commented Oct 8, 2019

clang_tidy passed!

@lambdai
Copy link
Copy Markdown
Contributor Author

lambdai commented Oct 8, 2019

Also CC @mattklein123 as in the #8303

@mattklein123 mattklein123 self-assigned this Oct 8, 2019
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Copy link
Copy Markdown
Contributor Author

@lambdai lambdai left a comment

Choose a reason for hiding this comment

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

Thank you for the review! I plan to chat with @htuch on how {dynamic,static} message valiadator should be provided in server::Instance and ServerFactoryContext.

Signed-off-by: Yuchen Dai <silentdai@gmail.com>
@lambdai
Copy link
Copy Markdown
Contributor Author

lambdai commented Oct 14, 2019

Chatted with @htuch
The goal is not to introduce is_dynamic arg and the messageValidationVisitor in ServerFactoryContext. So that ServerFactoryContext is a subset of server::Instance.

The plan is to

  1. messageValidationVisitor() should not be used in ServerFactoryContext. Mark it NOT_IMPLEMENT. Provide a visitor ref if it is needed.
  2. Moving messageValidationVisitor out of CommonFactoryContext in the follow up PR.

Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
@lambdai
Copy link
Copy Markdown
Contributor Author

lambdai commented Oct 15, 2019

/retest

@repokitteh-read-only
Copy link
Copy Markdown

🔨 rebuilding ci/circleci: docs (failed build)
🔨 rebuilding ci/circleci: clang_tidy (failed build)
🔨 rebuilding ci/circleci: coverage (failed build)
🔨 rebuilding ci/circleci: release (failed build)
🔨 rebuilding ci/circleci: api (failed build)
🔨 rebuilding ci/circleci: filter_example_mirror (failed build)

🐱

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

see: more, trace.

@lambdai lambdai requested a review from mattklein123 October 15, 2019 21:18
@lambdai
Copy link
Copy Markdown
Contributor Author

lambdai commented Oct 15, 2019

/retest

@repokitteh-read-only
Copy link
Copy Markdown

🤷‍♀️ nothing to rebuild.

🐱

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

see: more, trace.

@lambdai
Copy link
Copy Markdown
Contributor Author

lambdai commented Oct 16, 2019

It's probably flaky test since I couldn't reproduce
/azp run

mattklein123
mattklein123 previously approved these changes Oct 16, 2019
Copy link
Copy Markdown
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.

Thanks, nice change. Some small nits and will defer to @htuch for further review.

Stats::Scope& scope() override { return *server_scope_; }
Singleton::Manager& singletonManager() override { return server_.singletonManager(); }
ThreadLocal::Instance& threadLocal() override { return server_.threadLocal(); }
// TODO(lambdai): remove messageValidationVisitor from ServerFactoryContext
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.

Can this just be done as part of this change?

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.

Please allow me to address it in a follow up PR

Copy link
Copy Markdown
Member

@htuch htuch Oct 18, 2019

Choose a reason for hiding this comment

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

OK, but this really should be removed in some PR in this space, as it's a problematic pattern, we now have multiple validation visitor accessors apparent in the per-route filter factory method.

@mattklein123 mattklein123 removed their assignment Oct 16, 2019
@lambdai
Copy link
Copy Markdown
Contributor Author

lambdai commented Oct 17, 2019

@mattklein123 Thanks!
The next PRs will be out pretty soon. With reasonable size and avoid you reviewers going though this large but plain PR.
And the nit will be fixed there

@lambdai
Copy link
Copy Markdown
Contributor Author

lambdai commented Oct 17, 2019

Oops. I am resolving the conflict
I suspect it's due to another PR by me...

Signed-off-by: Yuchen Dai <silentdai@gmail.com>
@lambdai
Copy link
Copy Markdown
Contributor Author

lambdai commented Oct 18, 2019

@mattklein123
The last commit is about merging
the listener_impl.h split PR
and
forward proxy which uses ConfigPerRoute

@lambdai
Copy link
Copy Markdown
Contributor Author

lambdai commented Oct 18, 2019

@mattklein123 I think the failed envoy-macos is pure test infra failure. Is it good to merge? If not, should i merge master and retrigger the tests? Thanks!

@mattklein123
Copy link
Copy Markdown
Member

@lambdai the change LGTM but @htuch had previously reviewed so I would like him to verify and merge. Thank you!

@lambdai
Copy link
Copy Markdown
Contributor Author

lambdai commented Oct 18, 2019

@mattklein123 Thank you for the update!

Copy link
Copy Markdown
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

Thanks, nice correctness improvement!

Stats::Scope& scope() override { return *server_scope_; }
Singleton::Manager& singletonManager() override { return server_.singletonManager(); }
ThreadLocal::Instance& threadLocal() override { return server_.threadLocal(); }
// TODO(lambdai): remove messageValidationVisitor from ServerFactoryContext
Copy link
Copy Markdown
Member

@htuch htuch Oct 18, 2019

Choose a reason for hiding this comment

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

OK, but this really should be removed in some PR in this space, as it's a problematic pattern, we now have multiple validation visitor accessors apparent in the per-route filter factory method.

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.

rds: make RouteConfigProvider shared among ListenerImpls, or move factory_context_ outside of Listener.

3 participants