diff --git a/bazel/experiments.bzl b/bazel/experiments.bzl index 6e0200f2fd9..67b51d9c3e7 100644 --- a/bazel/experiments.bzl +++ b/bazel/experiments.bzl @@ -42,10 +42,10 @@ EXPERIMENT_ENABLES = { "pick_first_happy_eyeballs": "pick_first_happy_eyeballs", "ping_on_rst_stream": "ping_on_rst_stream", "promise_based_client_call": "promise_based_client_call", - "promise_based_inproc_transport": "promise_based_inproc_transport", "promise_based_server_call": "lazier_stream_updates,promise_based_server_call", "red_max_concurrent_streams": "red_max_concurrent_streams", "registered_method_lookup_in_transport": "registered_method_lookup_in_transport", + "promise_based_inproc_transport": "promise_based_client_call,promise_based_inproc_transport,promise_based_server_call,registered_method_lookup_in_transport", "registered_methods_map": "registered_methods_map", "rfc_max_concurrent_streams": "rfc_max_concurrent_streams", "round_robin_delegate_to_pick_first": "round_robin_delegate_to_pick_first", diff --git a/src/core/lib/experiments/experiments.cc b/src/core/lib/experiments/experiments.cc index 1e8c852545d..4f42616be4b 100644 --- a/src/core/lib/experiments/experiments.cc +++ b/src/core/lib/experiments/experiments.cc @@ -120,9 +120,6 @@ const char* const description_promise_based_client_call = "If set, use the new gRPC promise based call code when it's appropriate " "(ie when all filters in a stack are promise based)"; const char* const additional_constraints_promise_based_client_call = "{}"; -const char* const description_promise_based_inproc_transport = - "Use promises for the in-process transport."; -const char* const additional_constraints_promise_based_inproc_transport = "{}"; const char* const description_promise_based_server_call = "If set, use the new gRPC promise based call code when it's appropriate " "(ie when all filters in a stack are promise based)"; @@ -137,6 +134,14 @@ const char* const description_registered_method_lookup_in_transport = "Change registered method's lookup point to transport"; const char* const additional_constraints_registered_method_lookup_in_transport = "{}"; +const char* const description_promise_based_inproc_transport = + "Use promises for the in-process transport."; +const char* const additional_constraints_promise_based_inproc_transport = "{}"; +const uint8_t required_experiments_promise_based_inproc_transport[] = { + static_cast(grpc_core::kExperimentIdPromiseBasedClientCall), + static_cast(grpc_core::kExperimentIdPromiseBasedServerCall), + static_cast( + grpc_core::kExperimentIdRegisteredMethodLookupInTransport)}; const char* const description_registered_methods_map = "Use absl::flat_hash_map for registered methods."; const char* const additional_constraints_registered_methods_map = "{}"; @@ -282,10 +287,6 @@ const ExperimentMetadata g_experiment_metadata[] = { additional_constraints_ping_on_rst_stream, nullptr, 0, true, true}, {"promise_based_client_call", description_promise_based_client_call, additional_constraints_promise_based_client_call, nullptr, 0, false, true}, - {"promise_based_inproc_transport", - description_promise_based_inproc_transport, - additional_constraints_promise_based_inproc_transport, nullptr, 0, false, - false}, {"promise_based_server_call", description_promise_based_server_call, additional_constraints_promise_based_server_call, required_experiments_promise_based_server_call, 1, false, true}, @@ -296,6 +297,10 @@ const ExperimentMetadata g_experiment_metadata[] = { description_registered_method_lookup_in_transport, additional_constraints_registered_method_lookup_in_transport, nullptr, 0, true, true}, + {"promise_based_inproc_transport", + description_promise_based_inproc_transport, + additional_constraints_promise_based_inproc_transport, + required_experiments_promise_based_inproc_transport, 3, false, false}, {"registered_methods_map", description_registered_methods_map, additional_constraints_registered_methods_map, nullptr, 0, false, true}, {"rfc_max_concurrent_streams", description_rfc_max_concurrent_streams, @@ -447,9 +452,6 @@ const char* const description_promise_based_client_call = "If set, use the new gRPC promise based call code when it's appropriate " "(ie when all filters in a stack are promise based)"; const char* const additional_constraints_promise_based_client_call = "{}"; -const char* const description_promise_based_inproc_transport = - "Use promises for the in-process transport."; -const char* const additional_constraints_promise_based_inproc_transport = "{}"; const char* const description_promise_based_server_call = "If set, use the new gRPC promise based call code when it's appropriate " "(ie when all filters in a stack are promise based)"; @@ -464,6 +466,14 @@ const char* const description_registered_method_lookup_in_transport = "Change registered method's lookup point to transport"; const char* const additional_constraints_registered_method_lookup_in_transport = "{}"; +const char* const description_promise_based_inproc_transport = + "Use promises for the in-process transport."; +const char* const additional_constraints_promise_based_inproc_transport = "{}"; +const uint8_t required_experiments_promise_based_inproc_transport[] = { + static_cast(grpc_core::kExperimentIdPromiseBasedClientCall), + static_cast(grpc_core::kExperimentIdPromiseBasedServerCall), + static_cast( + grpc_core::kExperimentIdRegisteredMethodLookupInTransport)}; const char* const description_registered_methods_map = "Use absl::flat_hash_map for registered methods."; const char* const additional_constraints_registered_methods_map = "{}"; @@ -609,10 +619,6 @@ const ExperimentMetadata g_experiment_metadata[] = { additional_constraints_ping_on_rst_stream, nullptr, 0, true, true}, {"promise_based_client_call", description_promise_based_client_call, additional_constraints_promise_based_client_call, nullptr, 0, false, true}, - {"promise_based_inproc_transport", - description_promise_based_inproc_transport, - additional_constraints_promise_based_inproc_transport, nullptr, 0, false, - false}, {"promise_based_server_call", description_promise_based_server_call, additional_constraints_promise_based_server_call, required_experiments_promise_based_server_call, 1, false, true}, @@ -623,6 +629,10 @@ const ExperimentMetadata g_experiment_metadata[] = { description_registered_method_lookup_in_transport, additional_constraints_registered_method_lookup_in_transport, nullptr, 0, true, true}, + {"promise_based_inproc_transport", + description_promise_based_inproc_transport, + additional_constraints_promise_based_inproc_transport, + required_experiments_promise_based_inproc_transport, 3, false, false}, {"registered_methods_map", description_registered_methods_map, additional_constraints_registered_methods_map, nullptr, 0, false, true}, {"rfc_max_concurrent_streams", description_rfc_max_concurrent_streams, @@ -774,9 +784,6 @@ const char* const description_promise_based_client_call = "If set, use the new gRPC promise based call code when it's appropriate " "(ie when all filters in a stack are promise based)"; const char* const additional_constraints_promise_based_client_call = "{}"; -const char* const description_promise_based_inproc_transport = - "Use promises for the in-process transport."; -const char* const additional_constraints_promise_based_inproc_transport = "{}"; const char* const description_promise_based_server_call = "If set, use the new gRPC promise based call code when it's appropriate " "(ie when all filters in a stack are promise based)"; @@ -791,6 +798,14 @@ const char* const description_registered_method_lookup_in_transport = "Change registered method's lookup point to transport"; const char* const additional_constraints_registered_method_lookup_in_transport = "{}"; +const char* const description_promise_based_inproc_transport = + "Use promises for the in-process transport."; +const char* const additional_constraints_promise_based_inproc_transport = "{}"; +const uint8_t required_experiments_promise_based_inproc_transport[] = { + static_cast(grpc_core::kExperimentIdPromiseBasedClientCall), + static_cast(grpc_core::kExperimentIdPromiseBasedServerCall), + static_cast( + grpc_core::kExperimentIdRegisteredMethodLookupInTransport)}; const char* const description_registered_methods_map = "Use absl::flat_hash_map for registered methods."; const char* const additional_constraints_registered_methods_map = "{}"; @@ -936,10 +951,6 @@ const ExperimentMetadata g_experiment_metadata[] = { additional_constraints_ping_on_rst_stream, nullptr, 0, true, true}, {"promise_based_client_call", description_promise_based_client_call, additional_constraints_promise_based_client_call, nullptr, 0, false, true}, - {"promise_based_inproc_transport", - description_promise_based_inproc_transport, - additional_constraints_promise_based_inproc_transport, nullptr, 0, false, - false}, {"promise_based_server_call", description_promise_based_server_call, additional_constraints_promise_based_server_call, required_experiments_promise_based_server_call, 1, false, true}, @@ -950,6 +961,10 @@ const ExperimentMetadata g_experiment_metadata[] = { description_registered_method_lookup_in_transport, additional_constraints_registered_method_lookup_in_transport, nullptr, 0, true, true}, + {"promise_based_inproc_transport", + description_promise_based_inproc_transport, + additional_constraints_promise_based_inproc_transport, + required_experiments_promise_based_inproc_transport, 3, false, false}, {"registered_methods_map", description_registered_methods_map, additional_constraints_registered_methods_map, nullptr, 0, false, true}, {"rfc_max_concurrent_streams", description_rfc_max_concurrent_streams, diff --git a/src/core/lib/experiments/experiments.h b/src/core/lib/experiments/experiments.h index 60db6dfc1f3..31da2f682ba 100644 --- a/src/core/lib/experiments/experiments.h +++ b/src/core/lib/experiments/experiments.h @@ -103,11 +103,11 @@ inline bool IsPickFirstHappyEyeballsEnabled() { return true; } #define GRPC_EXPERIMENT_IS_INCLUDED_PING_ON_RST_STREAM inline bool IsPingOnRstStreamEnabled() { return true; } inline bool IsPromiseBasedClientCallEnabled() { return false; } -inline bool IsPromiseBasedInprocTransportEnabled() { return false; } inline bool IsPromiseBasedServerCallEnabled() { return false; } inline bool IsRedMaxConcurrentStreamsEnabled() { return false; } #define GRPC_EXPERIMENT_IS_INCLUDED_REGISTERED_METHOD_LOOKUP_IN_TRANSPORT inline bool IsRegisteredMethodLookupInTransportEnabled() { return true; } +inline bool IsPromiseBasedInprocTransportEnabled() { return false; } inline bool IsRegisteredMethodsMapEnabled() { return false; } inline bool IsRfcMaxConcurrentStreamsEnabled() { return false; } #define GRPC_EXPERIMENT_IS_INCLUDED_ROUND_ROBIN_DELEGATE_TO_PICK_FIRST @@ -185,11 +185,11 @@ inline bool IsPickFirstHappyEyeballsEnabled() { return true; } #define GRPC_EXPERIMENT_IS_INCLUDED_PING_ON_RST_STREAM inline bool IsPingOnRstStreamEnabled() { return true; } inline bool IsPromiseBasedClientCallEnabled() { return false; } -inline bool IsPromiseBasedInprocTransportEnabled() { return false; } inline bool IsPromiseBasedServerCallEnabled() { return false; } inline bool IsRedMaxConcurrentStreamsEnabled() { return false; } #define GRPC_EXPERIMENT_IS_INCLUDED_REGISTERED_METHOD_LOOKUP_IN_TRANSPORT inline bool IsRegisteredMethodLookupInTransportEnabled() { return true; } +inline bool IsPromiseBasedInprocTransportEnabled() { return false; } inline bool IsRegisteredMethodsMapEnabled() { return false; } inline bool IsRfcMaxConcurrentStreamsEnabled() { return false; } #define GRPC_EXPERIMENT_IS_INCLUDED_ROUND_ROBIN_DELEGATE_TO_PICK_FIRST @@ -267,11 +267,11 @@ inline bool IsPickFirstHappyEyeballsEnabled() { return true; } #define GRPC_EXPERIMENT_IS_INCLUDED_PING_ON_RST_STREAM inline bool IsPingOnRstStreamEnabled() { return true; } inline bool IsPromiseBasedClientCallEnabled() { return false; } -inline bool IsPromiseBasedInprocTransportEnabled() { return false; } inline bool IsPromiseBasedServerCallEnabled() { return false; } inline bool IsRedMaxConcurrentStreamsEnabled() { return false; } #define GRPC_EXPERIMENT_IS_INCLUDED_REGISTERED_METHOD_LOOKUP_IN_TRANSPORT inline bool IsRegisteredMethodLookupInTransportEnabled() { return true; } +inline bool IsPromiseBasedInprocTransportEnabled() { return false; } inline bool IsRegisteredMethodsMapEnabled() { return false; } inline bool IsRfcMaxConcurrentStreamsEnabled() { return false; } #define GRPC_EXPERIMENT_IS_INCLUDED_ROUND_ROBIN_DELEGATE_TO_PICK_FIRST @@ -329,10 +329,10 @@ enum ExperimentIds { kExperimentIdPickFirstHappyEyeballs, kExperimentIdPingOnRstStream, kExperimentIdPromiseBasedClientCall, - kExperimentIdPromiseBasedInprocTransport, kExperimentIdPromiseBasedServerCall, kExperimentIdRedMaxConcurrentStreams, kExperimentIdRegisteredMethodLookupInTransport, + kExperimentIdPromiseBasedInprocTransport, kExperimentIdRegisteredMethodsMap, kExperimentIdRfcMaxConcurrentStreams, kExperimentIdRoundRobinDelegateToPickFirst, @@ -455,10 +455,6 @@ inline bool IsPingOnRstStreamEnabled() { inline bool IsPromiseBasedClientCallEnabled() { return IsExperimentEnabled(kExperimentIdPromiseBasedClientCall); } -#define GRPC_EXPERIMENT_IS_INCLUDED_PROMISE_BASED_INPROC_TRANSPORT -inline bool IsPromiseBasedInprocTransportEnabled() { - return IsExperimentEnabled(kExperimentIdPromiseBasedInprocTransport); -} #define GRPC_EXPERIMENT_IS_INCLUDED_PROMISE_BASED_SERVER_CALL inline bool IsPromiseBasedServerCallEnabled() { return IsExperimentEnabled(kExperimentIdPromiseBasedServerCall); @@ -471,6 +467,10 @@ inline bool IsRedMaxConcurrentStreamsEnabled() { inline bool IsRegisteredMethodLookupInTransportEnabled() { return IsExperimentEnabled(kExperimentIdRegisteredMethodLookupInTransport); } +#define GRPC_EXPERIMENT_IS_INCLUDED_PROMISE_BASED_INPROC_TRANSPORT +inline bool IsPromiseBasedInprocTransportEnabled() { + return IsExperimentEnabled(kExperimentIdPromiseBasedInprocTransport); +} #define GRPC_EXPERIMENT_IS_INCLUDED_REGISTERED_METHODS_MAP inline bool IsRegisteredMethodsMapEnabled() { return IsExperimentEnabled(kExperimentIdRegisteredMethodsMap); diff --git a/src/core/lib/experiments/experiments.yaml b/src/core/lib/experiments/experiments.yaml index 76273515fdf..7feede01e01 100644 --- a/src/core/lib/experiments/experiments.yaml +++ b/src/core/lib/experiments/experiments.yaml @@ -209,6 +209,7 @@ owner: ctiller@google.com test_tags: [] allow_in_fuzzing_config: false # experiment currently crashes if enabled + requires: [promise_based_client_call, promise_based_server_call, registered_method_lookup_in_transport] - name: promise_based_server_call description: If set, use the new gRPC promise based call code when it's appropriate