From 2d616e993dceb6d25acedd6bfc4d263adfb8b746 Mon Sep 17 00:00:00 2001 From: chaoqin-li1123 <55518381+chaoqin-li1123@users.noreply.github.com> Date: Tue, 18 Jan 2022 11:36:59 -0600 Subject: [PATCH] runtime: make grpc client cache enabled by default(#19253) Risk Level: low Testing: change testing to verify new behavior Docs Changes: n/a Release Notes: added Platform Specific Features: n/a Signed-off-by: chaoqin-li1123 --- docs/root/version_history/current.rst | 1 + source/common/runtime/runtime_features.cc | 5 +---- test/common/grpc/async_client_manager_impl_test.cc | 6 +++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/docs/root/version_history/current.rst b/docs/root/version_history/current.rst index c3305ee72152..f66453d09e8b 100644 --- a/docs/root/version_history/current.rst +++ b/docs/root/version_history/current.rst @@ -11,6 +11,7 @@ Minor Behavior Changes ---------------------- *Changes that may cause incompatibilities for some users, but should not for most* +* grpc: flip runtime guard ``envoy.reloadable_features.enable_grpc_async_client_cache`` to be default enabled. async grpc client created through getOrCreateRawAsyncClient will be cached by default. * http: now the max concurrent streams of http2 connection can not only be adjusted down according to the SETTINGS frame but also can be adjusted up, of course, it can not exceed the configured upper bounds. This fix is guarded by ``envoy.reloadable_features.http2_allow_capacity_increase_by_settings``. Bug Fixes diff --git a/source/common/runtime/runtime_features.cc b/source/common/runtime/runtime_features.cc index e5252e5e593b..0058f1ad5605 100644 --- a/source/common/runtime/runtime_features.cc +++ b/source/common/runtime/runtime_features.cc @@ -62,6 +62,7 @@ constexpr const char* runtime_features[] = { "envoy.reloadable_features.correct_scheme_and_xfp", "envoy.reloadable_features.correctly_validate_alpn", "envoy.reloadable_features.disable_tls_inspector_injection", + "envoy.reloadable_features.enable_grpc_async_client_cache", "envoy.reloadable_features.fix_added_trailers", "envoy.reloadable_features.grpc_bridge_stats_disabled", "envoy.reloadable_features.handle_stream_reset_during_hcm_encoding", @@ -111,10 +112,6 @@ constexpr const char* disabled_runtime_features[] = { "envoy.reloadable_features.allow_multiple_dns_addresses", // Sentinel and test flag. "envoy.reloadable_features.test_feature_false", - // When the runtime is flipped to true, use shared cache in getOrCreateRawAsyncClient method if - // CacheOption is CacheWhenRuntimeEnabled. - // Caller that use AlwaysCache option will always cache, unaffected by this runtime. - "envoy.reloadable_features.enable_grpc_async_client_cache", // TODO(dmitri-d) reset to true to enable unified mux by default "envoy.reloadable_features.unified_mux", // TODO(birenroy): flip to true in a future PR to enable by default diff --git a/test/common/grpc/async_client_manager_impl_test.cc b/test/common/grpc/async_client_manager_impl_test.cc index a6c1440d17c3..c3ffb0d79572 100644 --- a/test/common/grpc/async_client_manager_impl_test.cc +++ b/test/common/grpc/async_client_manager_impl_test.cc @@ -128,6 +128,9 @@ TEST_F(AsyncClientManagerImplTest, EnvoyGrpcOk) { } TEST_F(AsyncClientManagerImplTest, DisableRawAsyncClientCache) { + TestScopedRuntime scoped_runtime; + Runtime::LoaderSingleton::getExisting()->mergeValues( + {{"envoy.reloadable_features.enable_grpc_async_client_cache", "false"}}); envoy::config::core::v3::GrpcService grpc_service; grpc_service.mutable_envoy_grpc()->set_cluster_name("foo"); @@ -146,9 +149,6 @@ TEST_F(AsyncClientManagerImplTest, DisableRawAsyncClientCache) { } TEST_F(AsyncClientManagerImplTest, EnableRawAsyncClientCache) { - TestScopedRuntime scoped_runtime; - Runtime::LoaderSingleton::getExisting()->mergeValues( - {{"envoy.reloadable_features.enable_grpc_async_client_cache", "true"}}); envoy::config::core::v3::GrpcService grpc_service; grpc_service.mutable_envoy_grpc()->set_cluster_name("foo");