From 8a3a46e295f3f4cbaef7e3e44b67c835d86f533f Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Fri, 26 Jan 2024 13:45:50 -0800 Subject: [PATCH] [EventEngine] Enable the PosixEventEngine client experiment (#35669) Closes #35669 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35669 from drfloob:posix-ee-client-flip 0d563ed3a185e3dd5269b64b5fd344fca1602d70 PiperOrigin-RevId: 601857289 --- bazel/experiments.bzl | 8 ++++---- src/core/lib/event_engine/shim.cc | 5 +++-- src/core/lib/experiments/experiments.cc | 2 +- src/core/lib/experiments/experiments.h | 3 ++- src/core/lib/experiments/rollouts.yaml | 2 +- src/python/grpcio_tests/tests/fork/BUILD.bazel | 2 ++ 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/bazel/experiments.bzl b/bazel/experiments.bzl index b6a95d39fe0..1656f5aef83 100644 --- a/bazel/experiments.bzl +++ b/bazel/experiments.bzl @@ -217,7 +217,6 @@ EXPERIMENTS = { "v3_compression_filter", ], "core_end2end_test": [ - "event_engine_client", "promise_based_server_call", "work_serializer_dispatch", ], @@ -229,9 +228,6 @@ EXPERIMENTS = { "tcp_frame_size_tuning", "tcp_rcv_lowat", ], - "event_engine_client_test": [ - "event_engine_client", - ], "flow_control_test": [ "multiping", "peer_state_based_framing", @@ -259,6 +255,7 @@ EXPERIMENTS = { }, "on": { "core_end2end_test": [ + "event_engine_client", "event_engine_listener", ], "cpp_lb_end2end_test": [ @@ -266,6 +263,9 @@ EXPERIMENTS = { "round_robin_delegate_to_pick_first", "wrr_delegate_to_pick_first", ], + "event_engine_client_test": [ + "event_engine_client", + ], "event_engine_listener_test": [ "event_engine_listener", ], diff --git a/src/core/lib/event_engine/shim.cc b/src/core/lib/event_engine/shim.cc index 168043a0752..5ac74519bb0 100644 --- a/src/core/lib/event_engine/shim.cc +++ b/src/core/lib/event_engine/shim.cc @@ -25,9 +25,10 @@ namespace experimental { bool UseEventEngineClient() { // TODO(hork, eryu): Adjust the ifdefs accordingly when event engines become // available for other platforms. -#if defined(GRPC_POSIX_SOCKET_TCP) && !defined(GRPC_CFSTREAM) +#if defined(GRPC_POSIX_SOCKET_TCP) && !defined(GRPC_CFSTREAM) && \ + !defined(GRPC_DO_NOT_INSTANTIATE_POSIX_POLLER) return grpc_core::IsEventEngineClientEnabled(); -#elif defined(GPR_WINDOWS) +#elif defined(GPR_WINDOWS) && !defined(GRPC_DO_NOT_INSTANTIATE_POSIX_POLLER) return grpc_core::IsEventEngineClientEnabled(); #elif defined(GRPC_IOS_EVENT_ENGINE_CLIENT) return true; diff --git a/src/core/lib/experiments/experiments.cc b/src/core/lib/experiments/experiments.cc index 3c40e129ae1..4afd8a7b2f6 100644 --- a/src/core/lib/experiments/experiments.cc +++ b/src/core/lib/experiments/experiments.cc @@ -715,7 +715,7 @@ const ExperimentMetadata g_experiment_metadata[] = { {"client_privacy", description_client_privacy, additional_constraints_client_privacy, nullptr, 0, false, false}, {"event_engine_client", description_event_engine_client, - additional_constraints_event_engine_client, nullptr, 0, false, true}, + additional_constraints_event_engine_client, nullptr, 0, true, true}, {"event_engine_dns", description_event_engine_dns, additional_constraints_event_engine_dns, nullptr, 0, false, false}, {"event_engine_listener", description_event_engine_listener, diff --git a/src/core/lib/experiments/experiments.h b/src/core/lib/experiments/experiments.h index d631bf357a4..b9a6ecca096 100644 --- a/src/core/lib/experiments/experiments.h +++ b/src/core/lib/experiments/experiments.h @@ -194,7 +194,8 @@ inline bool IsCanaryClientPrivacyEnabled() { return false; } #define GRPC_EXPERIMENT_IS_INCLUDED_CLIENT_IDLENESS inline bool IsClientIdlenessEnabled() { return true; } inline bool IsClientPrivacyEnabled() { return false; } -inline bool IsEventEngineClientEnabled() { return false; } +#define GRPC_EXPERIMENT_IS_INCLUDED_EVENT_ENGINE_CLIENT +inline bool IsEventEngineClientEnabled() { return true; } inline bool IsEventEngineDnsEnabled() { return false; } #define GRPC_EXPERIMENT_IS_INCLUDED_EVENT_ENGINE_LISTENER inline bool IsEventEngineListenerEnabled() { return true; } diff --git a/src/core/lib/experiments/rollouts.yaml b/src/core/lib/experiments/rollouts.yaml index d83ae1b4f8b..58f297999e0 100644 --- a/src/core/lib/experiments/rollouts.yaml +++ b/src/core/lib/experiments/rollouts.yaml @@ -52,7 +52,7 @@ default: # not tested on iOS at all ios: broken - posix: false + posix: true # TODO(hork): resolve when the client end2end test flake rate reduces to # a tolerable amount. windows: broken diff --git a/src/python/grpcio_tests/tests/fork/BUILD.bazel b/src/python/grpcio_tests/tests/fork/BUILD.bazel index 62909a1db3d..03ef926d508 100644 --- a/src/python/grpcio_tests/tests/fork/BUILD.bazel +++ b/src/python/grpcio_tests/tests/fork/BUILD.bazel @@ -22,6 +22,8 @@ pyx_library( py_test( name = "fork_test", srcs = glob(["*.py"]), + # TODO(yijiem): remove this to test EventEngine fork support + env = {"GRPC_EXPERIMENTS": "-event_engine_client"}, imports = ["../.."], main = "_fork_interop_test.py", python_version = "PY3",