From 28692fdcae144446fa84a05ef7d284d71bb3e5a1 Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Tue, 6 Jun 2023 15:50:31 -0700 Subject: [PATCH] [EventEngine] Enable work stealing thread pool in debug builds (#33333) --- bazel/experiments.bzl | 4 +++- src/core/lib/experiments/experiments.cc | 7 ++++++- src/core/lib/experiments/experiments.h | 11 ++++++++++- src/core/lib/experiments/rollouts.yaml | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/bazel/experiments.bzl b/bazel/experiments.bzl index 0c0b83d2237..5d778c27703 100644 --- a/bazel/experiments.bzl +++ b/bazel/experiments.bzl @@ -18,6 +18,9 @@ EXPERIMENTS = { "dbg": { + "core_end2end_test": [ + "work_stealing", + ], }, "off": { "census_test": [ @@ -28,7 +31,6 @@ EXPERIMENTS = { "event_engine_listener", "promise_based_client_call", "promise_based_server_call", - "work_stealing", ], "cpp_end2end_test": [ "promise_based_server_call", diff --git a/src/core/lib/experiments/experiments.cc b/src/core/lib/experiments/experiments.cc index dc48e9b928c..dcbeb6e8860 100644 --- a/src/core/lib/experiments/experiments.cc +++ b/src/core/lib/experiments/experiments.cc @@ -86,6 +86,11 @@ const char* const description_canary_client_privacy = const char* const additional_constraints_canary_client_privacy = "{}"; const char* const description_server_privacy = "If set, server privacy"; const char* const additional_constraints_server_privacy = "{}"; +#ifdef NDEBUG +const bool kDefaultForDebugOnly = false; +#else +const bool kDefaultForDebugOnly = true; +#endif } // namespace namespace grpc_core { @@ -125,7 +130,7 @@ const ExperimentMetadata g_experiment_metadata[] = { {"event_engine_dns", description_event_engine_dns, additional_constraints_event_engine_dns, false, false}, {"work_stealing", description_work_stealing, - additional_constraints_work_stealing, false, false}, + additional_constraints_work_stealing, kDefaultForDebugOnly, false}, {"client_privacy", description_client_privacy, additional_constraints_client_privacy, false, false}, {"canary_client_privacy", description_canary_client_privacy, diff --git a/src/core/lib/experiments/experiments.h b/src/core/lib/experiments/experiments.h index ced23dd2b66..3862ddc9946 100644 --- a/src/core/lib/experiments/experiments.h +++ b/src/core/lib/experiments/experiments.h @@ -73,7 +73,16 @@ inline bool IsEventEngineListenerEnabled() { return false; } inline bool IsScheduleCancellationOverWriteEnabled() { return false; } inline bool IsTraceRecordCallopsEnabled() { return false; } inline bool IsEventEngineDnsEnabled() { return false; } -inline bool IsWorkStealingEnabled() { return false; } +#ifndef NDEBUG +#define GRPC_EXPERIMENT_IS_INCLUDED_WORK_STEALING +#endif +inline bool IsWorkStealingEnabled() { +#ifdef NDEBUG + return false; +#else + return true; +#endif +} inline bool IsClientPrivacyEnabled() { return false; } inline bool IsCanaryClientPrivacyEnabled() { return false; } inline bool IsServerPrivacyEnabled() { return false; } diff --git a/src/core/lib/experiments/rollouts.yaml b/src/core/lib/experiments/rollouts.yaml index 767529cf10f..5e85459fa77 100644 --- a/src/core/lib/experiments/rollouts.yaml +++ b/src/core/lib/experiments/rollouts.yaml @@ -53,7 +53,7 @@ - name: event_engine_dns default: false - name: work_stealing - default: false + default: debug - name: client_privacy default: false - name: canary_client_privacy