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

grpc: Separate out grpc_init into its own class #8293

Merged
merged 10 commits into from
Sep 23, 2019

Conversation

jmarantz
Copy link
Contributor

@jmarantz jmarantz commented Sep 19, 2019

Description: Resolves memory-allocation non-determinism stemming from async activity initiated from grpc_init(). See grpc/grpc#20303 for background.
Risk Level: medium -- changes the way grpc is initialized in tests, but in prod should be the same.
Testing: //test/...
Docs Changes: n/a
Release Notes: n/a
Fixes: #8282

Signed-off-by: Joshua Marantz <[email protected]>
Signed-off-by: Joshua Marantz <[email protected]>
@jmarantz jmarantz changed the title Separate out grpc init to a separate class. grpc: Separate out grpc_init into its own class Sep 19, 2019
…re no one calls grpc_init directly.

Signed-off-by: Joshua Marantz <[email protected]>
source/common/grpc/google_grpc_context.h Outdated Show resolved Hide resolved
source/exe/main_common.h Outdated Show resolved Hide resolved
@lizan lizan added the waiting label Sep 19, 2019
Signed-off-by: Joshua Marantz <[email protected]>
Copy link
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.

LGTM modulo minor nits. I wish we didn't need to do this, but the gRPC lib is largely opaque, so not much can be done I think.

source/common/grpc/google_grpc_context.h Outdated Show resolved Hide resolved
source/exe/process_wide.cc Outdated Show resolved Hide resolved
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.

LGTM with small nit if possible. Thank you!

@@ -65,7 +66,8 @@ class MainCommonBase {
const AdminRequestFn& handler);

protected:
ProcessWide process_wide_; // Process-wide state setup/teardown.
ProcessWide process_wide_; // Process-wide state setup/teardown (excluding grpc).
Grpc::GoogleGrpcContext google_grpc_context_;
Copy link
Member

Choose a reason for hiding this comment

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

nit: is it possible for this to be stubbed when there is no Google-gRPC support compiled in? It's a little strange that we still have the context, but the actual calls inside it are compiled out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK fair enough; can make that change. Do you want to consider merging this in first though and I will commit to cleaning it up in a follow-up, so we can de-flake CI?

Copy link
Member

Choose a reason for hiding this comment

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

Sure sounds good.

@jmarantz jmarantz merged commit 2fd5fe6 into envoyproxy:master Sep 23, 2019
@jmarantz jmarantz deleted the deflake-stats-mem-tests branch September 23, 2019 18:51
danzh2010 pushed a commit to danzh2010/envoy that referenced this pull request Sep 24, 2019
* Separate out grpc init to a separate class.

Signed-off-by: Joshua Marantz <[email protected]>
danzh2010 pushed a commit to danzh2010/envoy that referenced this pull request Oct 4, 2019
* Separate out grpc init to a separate class.

Signed-off-by: Joshua Marantz <[email protected]>
danzh2010 pushed a commit to danzh2010/envoy that referenced this pull request Oct 4, 2019
* Separate out grpc init to a separate class.

Signed-off-by: Joshua Marantz <[email protected]>
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.

StatsThreadLocalStoreTestNoFixture.MemoryWithoutTlsFakeSymbolTable flaky?
4 participants