From 6ad141ae8c71ad5e3418ac03decd650e17b3741b Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Tue, 18 Jul 2023 15:17:02 -0700 Subject: [PATCH 001/205] [LB policies] use helper GetAuthority() instead of GRPC_ARG_SERVER_URI channel arg (#33671) --- src/core/BUILD | 2 -- .../client_channel/lb_policy/grpclb/grpclb.cc | 28 ++++-------------- .../lb_policy/grpclb/load_balancer_api.cc | 7 +++-- .../lb_policy/grpclb/load_balancer_api.h | 4 ++- .../client_channel/lb_policy/rls/rls.cc | 29 +++++-------------- 5 files changed, 20 insertions(+), 50 deletions(-) diff --git a/src/core/BUILD b/src/core/BUILD index 24e0e676570ad..52a5a5f167cd6 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -3917,7 +3917,6 @@ grpc_cc_library( "//:ref_counted_ptr", "//:server_address", "//:sockaddr_utils", - "//:uri_parser", "//:work_serializer", ], ) @@ -4004,7 +4003,6 @@ grpc_cc_library( "//:ref_counted_ptr", "//:rls_upb", "//:server_address", - "//:uri_parser", "//:work_serializer", ], ) diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc index 182bb9f1187cf..88afb0600b21b 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc @@ -78,7 +78,6 @@ #include "absl/strings/str_format.h" #include "absl/strings/str_join.h" #include "absl/strings/string_view.h" -#include "absl/strings/strip.h" #include "absl/types/optional.h" #include "absl/types/variant.h" #include "upb/upb.hpp" @@ -144,7 +143,6 @@ #include "src/core/lib/surface/channel_stack_type.h" #include "src/core/lib/transport/connectivity_state.h" #include "src/core/lib/transport/metadata_batch.h" -#include "src/core/lib/uri/uri_parser.h" #define GRPC_GRPCLB_INITIAL_CONNECT_BACKOFF_SECONDS 1 #define GRPC_GRPCLB_RECONNECT_BACKOFF_MULTIPLIER 1.6 @@ -523,8 +521,6 @@ class GrpcLb : public LoadBalancingPolicy { void StartSubchannelCacheTimerLocked(); void OnSubchannelCacheTimerLocked(); - // Who the client is trying to communicate with. - std::string server_name_; // Configurations for the policy. RefCountedPtr config_; @@ -854,8 +850,6 @@ GrpcLb::BalancerCallState::BalancerCallState( // Init the LB call. Note that the LB call will progress every time there's // activity in grpclb_policy_->interested_parties(), which is comprised of // the polling entities from client_channel. - GPR_ASSERT(!grpclb_policy()->server_name_.empty()); - // Closure Initialization GRPC_CLOSURE_INIT(&lb_on_initial_request_sent_, OnInitialRequestSent, this, grpc_schedule_on_exec_ctx); GRPC_CLOSURE_INIT(&lb_on_balancer_message_received_, @@ -877,8 +871,8 @@ GrpcLb::BalancerCallState::BalancerCallState( upb::Arena arena; grpc_slice request_payload_slice = GrpcLbRequestCreate( grpclb_policy()->config_->service_name().empty() - ? grpclb_policy()->server_name_.c_str() - : grpclb_policy()->config_->service_name().c_str(), + ? grpclb_policy()->channel_control_helper()->GetAuthority() + : grpclb_policy()->config_->service_name(), arena.ptr()); send_message_payload_ = grpc_raw_byte_buffer_create(&request_payload_slice, 1); @@ -1372,10 +1366,6 @@ ChannelArgs BuildBalancerChannelArgs( // Strip out the service config, since we don't want the LB policy // config specified for the parent channel to affect the LB channel. .Remove(GRPC_ARG_SERVICE_CONFIG) - // The channel arg for the server URI, since that will be different - // for the LB channel than for the parent channel. The client - // channel factory will re-add this arg with the right value. - .Remove(GRPC_ARG_SERVER_URI) // The fake resolver response generator, because we are replacing it // with the one from the grpclb policy, used to propagate updates to // the LB channel. @@ -1411,16 +1401,8 @@ ChannelArgs BuildBalancerChannelArgs( // ctor and dtor // -std::string GetServerNameFromChannelArgs(const ChannelArgs& args) { - absl::StatusOr uri = - URI::Parse(args.GetString(GRPC_ARG_SERVER_URI).value()); - GPR_ASSERT(uri.ok() && !uri->path().empty()); - return std::string(absl::StripPrefix(uri->path(), "/")); -} - GrpcLb::GrpcLb(Args args) : LoadBalancingPolicy(std::move(args)), - server_name_(GetServerNameFromChannelArgs(channel_args())), response_generator_(MakeRefCounted()), lb_call_timeout_(std::max( Duration::Zero(), @@ -1451,7 +1433,8 @@ GrpcLb::GrpcLb(Args args) if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) { gpr_log(GPR_INFO, "[grpclb %p] Will use '%s' as the server name for LB request.", - this, server_name_.c_str()); + this, + std::string(channel_control_helper()->GetAuthority()).c_str()); } } @@ -1581,7 +1564,8 @@ absl::Status GrpcLb::UpdateBalancerChannelLocked() { BuildBalancerChannelArgs(response_generator_.get(), args_); // Create balancer channel if needed. if (lb_channel_ == nullptr) { - std::string uri_str = absl::StrCat("fake:///", server_name_); + std::string uri_str = + absl::StrCat("fake:///", channel_control_helper()->GetAuthority()); lb_channel_ = grpc_channel_create(uri_str.c_str(), channel_credentials.get(), lb_channel_args.ToC().get()); diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc index b1b792a98bda3..457cd5a00ce70 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc @@ -59,15 +59,16 @@ grpc_slice grpc_grpclb_request_encode( } // namespace -grpc_slice GrpcLbRequestCreate(const char* lb_service_name, upb_Arena* arena) { +grpc_slice GrpcLbRequestCreate(absl::string_view lb_service_name, + upb_Arena* arena) { grpc_lb_v1_LoadBalanceRequest* req = grpc_lb_v1_LoadBalanceRequest_new(arena); grpc_lb_v1_InitialLoadBalanceRequest* initial_request = grpc_lb_v1_LoadBalanceRequest_mutable_initial_request(req, arena); - size_t name_len = std::min(strlen(lb_service_name), + size_t name_len = std::min(lb_service_name.size(), size_t{GRPC_GRPCLB_SERVICE_NAME_MAX_LENGTH}); grpc_lb_v1_InitialLoadBalanceRequest_set_name( initial_request, - upb_StringView_FromDataAndSize(lb_service_name, name_len)); + upb_StringView_FromDataAndSize(lb_service_name.data(), name_len)); return grpc_grpclb_request_encode(req, arena); } diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h index b74868ce3347b..9b7177d059728 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h @@ -24,6 +24,7 @@ #include +#include "absl/strings/string_view.h" #include "upb/mem/arena.h" #include @@ -56,7 +57,8 @@ struct GrpcLbResponse { }; // Creates a serialized grpclb request. -grpc_slice GrpcLbRequestCreate(const char* lb_service_name, upb_Arena* arena); +grpc_slice GrpcLbRequestCreate(absl::string_view lb_service_name, + upb_Arena* arena); // Creates a serialized grpclb load report request. grpc_slice GrpcLbLoadReportRequestCreate( diff --git a/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc b/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc index 3b1927d6d0cea..de19ba71a51ac 100644 --- a/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +++ b/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc @@ -48,7 +48,6 @@ #include "absl/strings/str_format.h" #include "absl/strings/str_join.h" #include "absl/strings/string_view.h" -#include "absl/strings/strip.h" #include "absl/types/optional.h" #include "upb/base/string_view.h" #include "upb/upb.hpp" @@ -103,7 +102,6 @@ #include "src/core/lib/surface/channel.h" #include "src/core/lib/transport/connectivity_state.h" #include "src/core/lib/transport/error_utils.h" -#include "src/core/lib/uri/uri_parser.h" #include "src/proto/grpc/lookup/v1/rls.upb.h" namespace grpc_core { @@ -693,9 +691,6 @@ class RlsLb : public LoadBalancingPolicy { // Updates the picker in the work serializer. void UpdatePickerLocked() ABSL_LOCKS_EXCLUDED(&mu_); - // The name of the server for the channel. - std::string server_name_; - // Mutex to guard LB policy state that is accessed by the picker. Mutex mu_; bool is_shutdown_ ABSL_GUARDED_BY(mu_) = false; @@ -899,7 +894,7 @@ void RlsLb::ChildPolicyWrapper::ChildPolicyHelper::UpdateState( // Builds the key to be used for a request based on path and initial_metadata. std::map BuildKeyMap( const RlsLbConfig::KeyBuilderMap& key_builder_map, absl::string_view path, - const std::string& host, + absl::string_view host, const LoadBalancingPolicy::MetadataInterface* initial_metadata) { size_t last_slash_pos = path.npos; // May need this a few times, so cache it. // Find key builder for this path. @@ -935,7 +930,7 @@ std::map BuildKeyMap( key_builder->constant_keys.end()); // Add host key. if (!key_builder->host_key.empty()) { - key_map[key_builder->host_key] = host; + key_map[key_builder->host_key] = std::string(host); } // Add service key. if (!key_builder->service_key.empty()) { @@ -970,9 +965,10 @@ RlsLb::Picker::Picker(RefCountedPtr lb_policy) LoadBalancingPolicy::PickResult RlsLb::Picker::Pick(PickArgs args) { // Construct key for request. - RequestKey key = {BuildKeyMap(config_->key_builder_map(), args.path, - lb_policy_->server_name_, - args.initial_metadata)}; + RequestKey key = { + BuildKeyMap(config_->key_builder_map(), args.path, + lb_policy_->channel_control_helper()->GetAuthority(), + args.initial_metadata)}; if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { gpr_log(GPR_INFO, "[rlslb %p] picker=%p: request keys: %s", lb_policy_.get(), this, key.ToString().c_str()); @@ -1857,18 +1853,7 @@ RlsLb::ResponseInfo RlsLb::RlsRequest::ParseResponseProto() { // RlsLb // -std::string GetServerUri(const ChannelArgs& args) { - auto server_uri_str = args.GetString(GRPC_ARG_SERVER_URI); - GPR_ASSERT(server_uri_str.has_value()); - absl::StatusOr uri = URI::Parse(*server_uri_str); - GPR_ASSERT(uri.ok()); - return std::string(absl::StripPrefix(uri->path(), "/")); -} - -RlsLb::RlsLb(Args args) - : LoadBalancingPolicy(std::move(args)), - server_name_(GetServerUri(channel_args())), - cache_(this) { +RlsLb::RlsLb(Args args) : LoadBalancingPolicy(std::move(args)), cache_(this) { if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { gpr_log(GPR_INFO, "[rlslb %p] policy created", this); } From 76bd606bae852698f73febd33842bd72f5e72339 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 18 Jul 2023 15:23:46 -0700 Subject: [PATCH 002/205] [build] Make GRPC_MUST_USE_RESULT default backed by nodiscard (#33742) Going forward `[[nodiscard]]` is the portable way to spell this; requires yanking a bunch of usage from after the param list to before. We should further refine the GRPC_MUST_USE_RESULT macro to make it work uniformly for any compilers that it doesn't today (most likely by making it expand to nothing). --------- Co-authored-by: ctiller --- include/grpc/support/port_platform.h | 52 +++++++++++-------- include/grpcpp/ext/gcp_observability.h | 2 +- include/grpcpp/impl/call_op_set.h | 12 ++--- .../filters/client_channel/dynamic_filters.h | 6 +-- .../ext/filters/client_channel/subchannel.h | 6 +-- .../transport/chttp2/server/chttp2_server.cc | 7 ++- .../chttp2/transport/hpack_parser_table.h | 2 +- src/core/lib/address_utils/sockaddr_utils.h | 4 +- src/core/lib/channel/channel_args.cc | 20 +++---- .../lib/event_engine/posix_engine/timer.h | 2 +- src/core/lib/gprpp/dual_ref_counted.h | 18 +++---- src/core/lib/gprpp/orphanable.h | 6 +-- src/core/lib/gprpp/ref_counted.h | 12 ++--- src/core/lib/gprpp/status_helper.h | 31 +++++------ src/core/lib/http/httpcli.h | 15 +++--- src/core/lib/iomgr/error.h | 19 ++++--- src/core/lib/iomgr/ev_poll_posix.cc | 2 +- src/core/lib/iomgr/pollset.h | 9 ++-- src/core/lib/iomgr/wakeup_fd_posix.h | 9 ++-- src/core/lib/promise/party.h | 2 +- src/core/lib/resource_quota/memory_quota.h | 2 +- src/core/lib/surface/server.h | 4 +- 22 files changed, 120 insertions(+), 122 deletions(-) diff --git a/include/grpc/support/port_platform.h b/include/grpc/support/port_platform.h index 1e99dc628e51d..bb055465e5f27 100644 --- a/include/grpc/support/port_platform.h +++ b/include/grpc/support/port_platform.h @@ -563,29 +563,6 @@ typedef unsigned __int64 uint64_t; #define GRPC_IF_NAMETOINDEX 1 #endif -#ifndef GRPC_MUST_USE_RESULT -#if defined(__GNUC__) && !defined(__MINGW32__) -#define GRPC_MUST_USE_RESULT __attribute__((warn_unused_result)) -#define GPR_ALIGN_STRUCT(n) __attribute__((aligned(n))) -#else -#define GRPC_MUST_USE_RESULT -#define GPR_ALIGN_STRUCT(n) -#endif -#ifdef USE_STRICT_WARNING -/* When building with USE_STRICT_WARNING (which -Werror), types with this - attribute will be treated as annotated with warn_unused_result, enforcing - returned values of this type should be used. - This is added in grpc::Status in mind to address the issue where it always - has this annotation internally but OSS doesn't, sometimes causing internal - build failure. To prevent this, this is added while not introducing - a breaking change to existing user code which may not use returned values - of grpc::Status. */ -#define GRPC_MUST_USE_RESULT_WHEN_USE_STRICT_WARNING GRPC_MUST_USE_RESULT -#else -#define GRPC_MUST_USE_RESULT_WHEN_USE_STRICT_WARNING -#endif -#endif - #ifndef GRPC_UNUSED #if defined(__GNUC__) && !defined(__MINGW32__) #define GRPC_UNUSED __attribute__((unused)) @@ -611,6 +588,35 @@ typedef unsigned __int64 uint64_t; #endif #endif /* GPR_HAS_CPP_ATTRIBUTE */ +#if defined(__GNUC__) && !defined(__MINGW32__) +#define GPR_ALIGN_STRUCT(n) __attribute__((aligned(n))) +#else +#define GPR_ALIGN_STRUCT(n) +#endif + +#ifndef GRPC_MUST_USE_RESULT +#if GPR_HAS_CPP_ATTRIBUTE(nodiscard) +#define GRPC_MUST_USE_RESULT [[nodiscard]] +#elif defined(__GNUC__) && !defined(__MINGW32__) +#define GRPC_MUST_USE_RESULT __attribute__((warn_unused_result)) +#else +#define GRPC_MUST_USE_RESULT +#endif +#ifdef USE_STRICT_WARNING +/* When building with USE_STRICT_WARNING (which -Werror), types with this + attribute will be treated as annotated with warn_unused_result, enforcing + returned values of this type should be used. + This is added in grpc::Status in mind to address the issue where it always + has this annotation internally but OSS doesn't, sometimes causing internal + build failure. To prevent this, this is added while not introducing + a breaking change to existing user code which may not use returned values + of grpc::Status. */ +#define GRPC_MUST_USE_RESULT_WHEN_USE_STRICT_WARNING GRPC_MUST_USE_RESULT +#else +#define GRPC_MUST_USE_RESULT_WHEN_USE_STRICT_WARNING +#endif +#endif + #ifndef GPR_HAS_ATTRIBUTE #ifdef __has_attribute #define GPR_HAS_ATTRIBUTE(a) __has_attribute(a) diff --git a/include/grpcpp/ext/gcp_observability.h b/include/grpcpp/ext/gcp_observability.h index 871b51dce66af..b215312c68a1a 100644 --- a/include/grpcpp/ext/gcp_observability.h +++ b/include/grpcpp/ext/gcp_observability.h @@ -67,7 +67,7 @@ class GcpObservability { // As an implementation detail, this properly initializes the OpenCensus stats // and tracing plugin, so applications do not need to perform any additional // gRPC C++ OpenCensus setup/registration to get GCP Observability for gRPC. - static absl::StatusOr Init() GRPC_MUST_USE_RESULT; + static absl::StatusOr Init(); GcpObservability() = default; // Move constructor and Move-assignment operator. diff --git a/include/grpcpp/impl/call_op_set.h b/include/grpcpp/impl/call_op_set.h index 40d8f5d01c575..48c958a96f6c5 100644 --- a/include/grpcpp/impl/call_op_set.h +++ b/include/grpcpp/impl/call_op_set.h @@ -290,23 +290,23 @@ class CallOpSendMessage { /// Send \a message using \a options for the write. The \a options are cleared /// after use. template - Status SendMessage(const M& message, - WriteOptions options) GRPC_MUST_USE_RESULT; + GRPC_MUST_USE_RESULT Status SendMessage(const M& message, + WriteOptions options); template - Status SendMessage(const M& message) GRPC_MUST_USE_RESULT; + GRPC_MUST_USE_RESULT Status SendMessage(const M& message); /// Send \a message using \a options for the write. The \a options are cleared /// after use. This form of SendMessage allows gRPC to reference \a message /// beyond the lifetime of SendMessage. template - Status SendMessagePtr(const M* message, - WriteOptions options) GRPC_MUST_USE_RESULT; + GRPC_MUST_USE_RESULT Status SendMessagePtr(const M* message, + WriteOptions options); /// This form of SendMessage allows gRPC to reference \a message beyond the /// lifetime of SendMessage. template - Status SendMessagePtr(const M* message) GRPC_MUST_USE_RESULT; + GRPC_MUST_USE_RESULT Status SendMessagePtr(const M* message); protected: void AddOp(grpc_op* ops, size_t* nops) { diff --git a/src/core/ext/filters/client_channel/dynamic_filters.h b/src/core/ext/filters/client_channel/dynamic_filters.h index 50eafa75aabf6..87712aa6c5c2b 100644 --- a/src/core/ext/filters/client_channel/dynamic_filters.h +++ b/src/core/ext/filters/client_channel/dynamic_filters.h @@ -68,9 +68,9 @@ class DynamicFilters : public RefCounted { void SetAfterCallStackDestroy(grpc_closure* closure); // Interface of RefCounted<>. - RefCountedPtr Ref() GRPC_MUST_USE_RESULT; - RefCountedPtr Ref(const DebugLocation& location, - const char* reason) GRPC_MUST_USE_RESULT; + GRPC_MUST_USE_RESULT RefCountedPtr Ref(); + GRPC_MUST_USE_RESULT RefCountedPtr Ref(const DebugLocation& location, + const char* reason); // When refcount drops to 0, destroys itself and the associated call stack, // but does NOT free the memory because it's in the call arena. void Unref(); diff --git a/src/core/ext/filters/client_channel/subchannel.h b/src/core/ext/filters/client_channel/subchannel.h index 033c711bb6cba..e66d80fd13965 100644 --- a/src/core/ext/filters/client_channel/subchannel.h +++ b/src/core/ext/filters/client_channel/subchannel.h @@ -119,9 +119,9 @@ class SubchannelCall { void SetAfterCallStackDestroy(grpc_closure* closure); // Interface of RefCounted<>. - RefCountedPtr Ref() GRPC_MUST_USE_RESULT; - RefCountedPtr Ref(const DebugLocation& location, - const char* reason) GRPC_MUST_USE_RESULT; + GRPC_MUST_USE_RESULT RefCountedPtr Ref(); + GRPC_MUST_USE_RESULT RefCountedPtr Ref( + const DebugLocation& location, const char* reason); // When refcount drops to 0, destroys itself and the associated call stack, // but does NOT free the memory because it's in the call arena. void Unref(); diff --git a/src/core/ext/transport/chttp2/server/chttp2_server.cc b/src/core/ext/transport/chttp2/server/chttp2_server.cc index 40c1727b9c99f..7b4143bfb548b 100644 --- a/src/core/ext/transport/chttp2/server/chttp2_server.cc +++ b/src/core/ext/transport/chttp2/server/chttp2_server.cc @@ -246,13 +246,12 @@ class Chttp2ServerListener : public Server::ListenerInterface { IncrementRefCount(); } - RefCountedPtr Ref() GRPC_MUST_USE_RESULT { + GRPC_MUST_USE_RESULT RefCountedPtr Ref() { IncrementRefCount(); return RefCountedPtr(this); } - RefCountedPtr Ref(const DebugLocation& /* location */, - const char* /* reason */) - GRPC_MUST_USE_RESULT { + GRPC_MUST_USE_RESULT RefCountedPtr Ref( + const DebugLocation& /* location */, const char* /* reason */) { return Ref(); } diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser_table.h b/src/core/ext/transport/chttp2/transport/hpack_parser_table.h index 283a3184b0d79..c9839dae77102 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +++ b/src/core/ext/transport/chttp2/transport/hpack_parser_table.h @@ -71,7 +71,7 @@ class HPackTable { } // add a table entry to the index - bool Add(Memento md) GRPC_MUST_USE_RESULT; + GRPC_MUST_USE_RESULT bool Add(Memento md); void AddLargerThanCurrentTableSize(); // Current entry count in the table. diff --git a/src/core/lib/address_utils/sockaddr_utils.h b/src/core/lib/address_utils/sockaddr_utils.h index 871dfedfc64fd..32c72bd525fef 100644 --- a/src/core/lib/address_utils/sockaddr_utils.h +++ b/src/core/lib/address_utils/sockaddr_utils.h @@ -67,8 +67,8 @@ int grpc_sockaddr_set_port(grpc_resolved_address* addr, int port); // Currently, only the AF_INET, AF_INET6, and AF_UNIX families are recognized. // If the normalize flag is enabled, ::ffff:0.0.0.0/96 IPv6 addresses are // displayed as plain IPv4. -absl::StatusOr grpc_sockaddr_to_string( - const grpc_resolved_address* addr, bool normalize) GRPC_MUST_USE_RESULT; +GRPC_MUST_USE_RESULT absl::StatusOr grpc_sockaddr_to_string( + const grpc_resolved_address* addr, bool normalize); // Returns the URI string corresponding to \a addr absl::StatusOr grpc_sockaddr_to_uri( diff --git a/src/core/lib/channel/channel_args.cc b/src/core/lib/channel/channel_args.cc index 52bcb1d087e30..fe8c4761c6c2c 100644 --- a/src/core/lib/channel/channel_args.cc +++ b/src/core/lib/channel/channel_args.cc @@ -189,25 +189,25 @@ ChannelArgs ChannelArgs::Set(absl::string_view name, int value) const { return Set(name, Value(value)); } -ChannelArgs ChannelArgs::Set(absl::string_view key, Value value) const { - return ChannelArgs(args_.Add(std::string(key), std::move(value))); +ChannelArgs ChannelArgs::Set(absl::string_view name, Value value) const { + return ChannelArgs(args_.Add(std::string(name), std::move(value))); } -ChannelArgs ChannelArgs::Set(absl::string_view key, +ChannelArgs ChannelArgs::Set(absl::string_view name, absl::string_view value) const { - return Set(key, std::string(value)); + return Set(name, std::string(value)); } -ChannelArgs ChannelArgs::Set(absl::string_view key, const char* value) const { - return Set(key, std::string(value)); +ChannelArgs ChannelArgs::Set(absl::string_view name, const char* value) const { + return Set(name, std::string(value)); } -ChannelArgs ChannelArgs::Set(absl::string_view key, std::string value) const { - return Set(key, Value(std::move(value))); +ChannelArgs ChannelArgs::Set(absl::string_view name, std::string value) const { + return Set(name, Value(std::move(value))); } -ChannelArgs ChannelArgs::Remove(absl::string_view key) const { - return ChannelArgs(args_.Remove(key)); +ChannelArgs ChannelArgs::Remove(absl::string_view name) const { + return ChannelArgs(args_.Remove(name)); } ChannelArgs ChannelArgs::RemoveAllKeysWithPrefix( diff --git a/src/core/lib/event_engine/posix_engine/timer.h b/src/core/lib/event_engine/posix_engine/timer.h index c21a03dce10d2..9c9b220c41199 100644 --- a/src/core/lib/event_engine/posix_engine/timer.h +++ b/src/core/lib/event_engine/posix_engine/timer.h @@ -89,7 +89,7 @@ class TimerList { // timer has already fired, or if its closure is currently running. The // closure is guaranteed to run eventually if this method returns false. // Otherwise, this returns true, and the closure will not be run. - bool TimerCancel(Timer* timer) GRPC_MUST_USE_RESULT; + GRPC_MUST_USE_RESULT bool TimerCancel(Timer* timer); // Check for timers to be run, and return them. // Return nullopt if timers could not be checked due to contention with diff --git a/src/core/lib/gprpp/dual_ref_counted.h b/src/core/lib/gprpp/dual_ref_counted.h index e83b27370ca0b..4fc6ea760dabe 100644 --- a/src/core/lib/gprpp/dual_ref_counted.h +++ b/src/core/lib/gprpp/dual_ref_counted.h @@ -49,13 +49,13 @@ class DualRefCounted : public Orphanable { public: ~DualRefCounted() override = default; - RefCountedPtr Ref() GRPC_MUST_USE_RESULT { + GRPC_MUST_USE_RESULT RefCountedPtr Ref() { IncrementRefCount(); return RefCountedPtr(static_cast(this)); } - RefCountedPtr Ref(const DebugLocation& location, - const char* reason) GRPC_MUST_USE_RESULT { + GRPC_MUST_USE_RESULT RefCountedPtr Ref(const DebugLocation& location, + const char* reason) { IncrementRefCount(location, reason); return RefCountedPtr(static_cast(this)); } @@ -103,7 +103,7 @@ class DualRefCounted : public Orphanable { WeakUnref(location, reason); } - RefCountedPtr RefIfNonZero() GRPC_MUST_USE_RESULT { + GRPC_MUST_USE_RESULT RefCountedPtr RefIfNonZero() { uint64_t prev_ref_pair = refs_.load(std::memory_order_acquire); do { const uint32_t strong_refs = GetStrongRefs(prev_ref_pair); @@ -121,8 +121,8 @@ class DualRefCounted : public Orphanable { return RefCountedPtr(static_cast(this)); } - RefCountedPtr RefIfNonZero(const DebugLocation& location, - const char* reason) GRPC_MUST_USE_RESULT { + GRPC_MUST_USE_RESULT RefCountedPtr RefIfNonZero( + const DebugLocation& location, const char* reason) { uint64_t prev_ref_pair = refs_.load(std::memory_order_acquire); do { const uint32_t strong_refs = GetStrongRefs(prev_ref_pair); @@ -146,13 +146,13 @@ class DualRefCounted : public Orphanable { return RefCountedPtr(static_cast(this)); } - WeakRefCountedPtr WeakRef() GRPC_MUST_USE_RESULT { + GRPC_MUST_USE_RESULT WeakRefCountedPtr WeakRef() { IncrementWeakRefCount(); return WeakRefCountedPtr(static_cast(this)); } - WeakRefCountedPtr WeakRef(const DebugLocation& location, - const char* reason) GRPC_MUST_USE_RESULT { + GRPC_MUST_USE_RESULT WeakRefCountedPtr WeakRef( + const DebugLocation& location, const char* reason) { IncrementWeakRefCount(location, reason); return WeakRefCountedPtr(static_cast(this)); } diff --git a/src/core/lib/gprpp/orphanable.h b/src/core/lib/gprpp/orphanable.h index a2f24cb54c2ff..86319429e5c2d 100644 --- a/src/core/lib/gprpp/orphanable.h +++ b/src/core/lib/gprpp/orphanable.h @@ -87,12 +87,12 @@ class InternallyRefCounted : public Orphanable { : refs_(initial_refcount, trace) {} ~InternallyRefCounted() override = default; - RefCountedPtr Ref() GRPC_MUST_USE_RESULT { + GRPC_MUST_USE_RESULT RefCountedPtr Ref() { IncrementRefCount(); return RefCountedPtr(static_cast(this)); } - RefCountedPtr Ref(const DebugLocation& location, - const char* reason) GRPC_MUST_USE_RESULT { + GRPC_MUST_USE_RESULT RefCountedPtr Ref(const DebugLocation& location, + const char* reason) { IncrementRefCount(location, reason); return RefCountedPtr(static_cast(this)); } diff --git a/src/core/lib/gprpp/ref_counted.h b/src/core/lib/gprpp/ref_counted.h index 96fe288ff6f72..66ef042489956 100644 --- a/src/core/lib/gprpp/ref_counted.h +++ b/src/core/lib/gprpp/ref_counted.h @@ -277,13 +277,13 @@ class RefCounted : public Impl { // Note: Depending on the Impl used, this dtor can be implicitly virtual. ~RefCounted() = default; - RefCountedPtr Ref() GRPC_MUST_USE_RESULT { + GRPC_MUST_USE_RESULT RefCountedPtr Ref() { IncrementRefCount(); return RefCountedPtr(static_cast(this)); } - RefCountedPtr Ref(const DebugLocation& location, - const char* reason) GRPC_MUST_USE_RESULT { + GRPC_MUST_USE_RESULT RefCountedPtr Ref(const DebugLocation& location, + const char* reason) { IncrementRefCount(location, reason); return RefCountedPtr(static_cast(this)); } @@ -303,12 +303,12 @@ class RefCounted : public Impl { } } - RefCountedPtr RefIfNonZero() GRPC_MUST_USE_RESULT { + GRPC_MUST_USE_RESULT RefCountedPtr RefIfNonZero() { return RefCountedPtr(refs_.RefIfNonZero() ? static_cast(this) : nullptr); } - RefCountedPtr RefIfNonZero(const DebugLocation& location, - const char* reason) GRPC_MUST_USE_RESULT { + GRPC_MUST_USE_RESULT RefCountedPtr RefIfNonZero( + const DebugLocation& location, const char* reason) { return RefCountedPtr(refs_.RefIfNonZero(location, reason) ? static_cast(this) : nullptr); diff --git a/src/core/lib/gprpp/status_helper.h b/src/core/lib/gprpp/status_helper.h index 3f61c3e16457c..536ced385c604 100644 --- a/src/core/lib/gprpp/status_helper.h +++ b/src/core/lib/gprpp/status_helper.h @@ -116,57 +116,58 @@ enum class StatusTimeProperty { }; /// Creates a status with given additional information -absl::Status StatusCreate( - absl::StatusCode code, absl::string_view msg, const DebugLocation& location, - std::vector children) GRPC_MUST_USE_RESULT; +absl::Status StatusCreate(absl::StatusCode code, absl::string_view msg, + const DebugLocation& location, + std::vector children); /// Sets the int property to the status void StatusSetInt(absl::Status* status, StatusIntProperty key, intptr_t value); /// Gets the int property from the status -absl::optional StatusGetInt( - const absl::Status& status, StatusIntProperty key) GRPC_MUST_USE_RESULT; +GRPC_MUST_USE_RESULT +absl::optional StatusGetInt(const absl::Status& status, + StatusIntProperty key); /// Sets the str property to the status void StatusSetStr(absl::Status* status, StatusStrProperty key, absl::string_view value); /// Gets the str property from the status -absl::optional StatusGetStr( - const absl::Status& status, StatusStrProperty key) GRPC_MUST_USE_RESULT; +GRPC_MUST_USE_RESULT absl::optional StatusGetStr( + const absl::Status& status, StatusStrProperty key); /// Sets the time property to the status void StatusSetTime(absl::Status* status, StatusTimeProperty key, absl::Time time); /// Gets the time property from the status -absl::optional StatusGetTime( - const absl::Status& status, StatusTimeProperty key) GRPC_MUST_USE_RESULT; +GRPC_MUST_USE_RESULT absl::optional StatusGetTime( + const absl::Status& status, StatusTimeProperty key); /// Adds a child status to status void StatusAddChild(absl::Status* status, absl::Status child); /// Returns all children status from a status -std::vector StatusGetChildren(absl::Status status) - GRPC_MUST_USE_RESULT; +GRPC_MUST_USE_RESULT std::vector StatusGetChildren( + absl::Status status); /// Returns a string representation from status /// Error status will be like /// STATUS[:MESSAGE] [{PAYLOADS[, children:[CHILDREN-STATUS-LISTS]]}] /// e.g. /// CANCELLATION:SampleMessage {errno:'2021', line:'54', children:[ABORTED]} -std::string StatusToString(const absl::Status& status) GRPC_MUST_USE_RESULT; +GRPC_MUST_USE_RESULT std::string StatusToString(const absl::Status& status); namespace internal { /// Builds a upb message, google_rpc_Status from a status /// This is for internal implementation & test only -google_rpc_Status* StatusToProto(const absl::Status& status, - upb_Arena* arena) GRPC_MUST_USE_RESULT; +GRPC_MUST_USE_RESULT google_rpc_Status* StatusToProto( + const absl::Status& status, upb_Arena* arena); /// Builds a status from a upb message, google_rpc_Status /// This is for internal implementation & test only -absl::Status StatusFromProto(google_rpc_Status* msg) GRPC_MUST_USE_RESULT; +absl::Status StatusFromProto(google_rpc_Status* msg); /// Returns ptr that is allocated in the heap memory and the given status is /// copied into. This ptr can be used to get Status later and should be diff --git a/src/core/lib/http/httpcli.h b/src/core/lib/http/httpcli.h index bcbaa315b92a2..bfa98a378f664 100644 --- a/src/core/lib/http/httpcli.h +++ b/src/core/lib/http/httpcli.h @@ -100,12 +100,11 @@ class HttpRequest : public InternallyRefCounted { // nullptr is treated as insecure credentials. // TODO(yihuaz): disallow nullptr as a value after unsecure builds // are removed. - static OrphanablePtr Get( + GRPC_MUST_USE_RESULT static OrphanablePtr Get( URI uri, const grpc_channel_args* args, grpc_polling_entity* pollent, const grpc_http_request* request, Timestamp deadline, grpc_closure* on_done, grpc_http_response* response, - RefCountedPtr channel_creds) - GRPC_MUST_USE_RESULT; + RefCountedPtr channel_creds); // Asynchronously perform a HTTP POST. // 'uri' is the target to make the request to. The scheme field is used to @@ -126,12 +125,11 @@ class HttpRequest : public InternallyRefCounted { // TODO(apolcyn): disallow nullptr as a value after unsecure builds // are removed. // Does not support ?var1=val1&var2=val2 in the path. - static OrphanablePtr Post( + GRPC_MUST_USE_RESULT static OrphanablePtr Post( URI uri, const grpc_channel_args* args, grpc_polling_entity* pollent, const grpc_http_request* request, Timestamp deadline, grpc_closure* on_done, grpc_http_response* response, - RefCountedPtr channel_creds) - GRPC_MUST_USE_RESULT; + RefCountedPtr channel_creds); // Asynchronously perform a HTTP PUT. // 'uri' is the target to make the request to. The scheme field is used to @@ -152,12 +150,11 @@ class HttpRequest : public InternallyRefCounted { // TODO(apolcyn): disallow nullptr as a value after unsecure builds // are removed. // Does not support ?var1=val1&var2=val2 in the path. - static OrphanablePtr Put( + GRPC_MUST_USE_RESULT static OrphanablePtr Put( URI uri, const grpc_channel_args* args, grpc_polling_entity* pollent, const grpc_http_request* request, Timestamp deadline, grpc_closure* on_done, grpc_http_response* response, - RefCountedPtr channel_creds) - GRPC_MUST_USE_RESULT; + RefCountedPtr channel_creds); HttpRequest(URI uri, const grpc_slice& request_text, grpc_http_response* response, Timestamp deadline, diff --git a/src/core/lib/iomgr/error.h b/src/core/lib/iomgr/error.h index 79ce199b5340d..e1bec1b91dfe5 100644 --- a/src/core/lib/iomgr/error.h +++ b/src/core/lib/iomgr/error.h @@ -46,8 +46,7 @@ typedef absl::Status grpc_error_handle; absl::Status grpc_status_create(absl::StatusCode code, absl::string_view msg, const grpc_core::DebugLocation& location, - size_t children_count, - absl::Status* children) GRPC_MUST_USE_RESULT; + size_t children_count, absl::Status* children); // Create an error that references some other errors. #define GRPC_ERROR_CREATE_REFERENCING(desc, errs, count) \ @@ -73,7 +72,7 @@ static absl::Status grpc_status_create_from_vector( grpc_status_create_from_vector(DEBUG_LOCATION, desc, error_list) absl::Status grpc_os_error(const grpc_core::DebugLocation& location, int err, - const char* call_name) GRPC_MUST_USE_RESULT; + const char* call_name); inline absl::Status grpc_assert_never_ok(absl::Status error) { GPR_ASSERT(!error.ok()); @@ -85,7 +84,7 @@ inline absl::Status grpc_assert_never_ok(absl::Status error) { grpc_assert_never_ok(grpc_os_error(DEBUG_LOCATION, err, call_name)) absl::Status grpc_wsa_error(const grpc_core::DebugLocation& location, int err, - absl::string_view call_name) GRPC_MUST_USE_RESULT; + absl::string_view call_name); /// windows only: create an error associated with WSAGetLastError()!=0 #define GRPC_WSA_ERROR(err, call_name) \ @@ -93,14 +92,14 @@ absl::Status grpc_wsa_error(const grpc_core::DebugLocation& location, int err, grpc_error_handle grpc_error_set_int(grpc_error_handle src, grpc_core::StatusIntProperty which, - intptr_t value) GRPC_MUST_USE_RESULT; + intptr_t value); /// It is an error to pass nullptr as `p`. Caller should allocate a phony /// intptr_t for `p`, even if the value of `p` is not used. bool grpc_error_get_int(grpc_error_handle error, grpc_core::StatusIntProperty which, intptr_t* p); -grpc_error_handle grpc_error_set_str( - grpc_error_handle src, grpc_core::StatusStrProperty which, - absl::string_view str) GRPC_MUST_USE_RESULT; +grpc_error_handle grpc_error_set_str(grpc_error_handle src, + grpc_core::StatusStrProperty which, + absl::string_view str); /// Returns false if the specified string is not set. bool grpc_error_get_str(grpc_error_handle error, grpc_core::StatusStrProperty which, std::string* str); @@ -116,8 +115,8 @@ bool grpc_error_get_str(grpc_error_handle error, /// returns absl::OkStatus(). 3) If \a src and \a child point to the same error, /// returns a single reference. (Note that, 2 references should have been /// received to the error in this case.) -grpc_error_handle grpc_error_add_child( - grpc_error_handle src, grpc_error_handle child) GRPC_MUST_USE_RESULT; +grpc_error_handle grpc_error_add_child(grpc_error_handle src, + grpc_error_handle child); bool grpc_log_error(const char* what, grpc_error_handle error, const char* file, int line); diff --git a/src/core/lib/iomgr/ev_poll_posix.cc b/src/core/lib/iomgr/ev_poll_posix.cc index e72bb404600b9..75acbbe8d1d25 100644 --- a/src/core/lib/iomgr/ev_poll_posix.cc +++ b/src/core/lib/iomgr/ev_poll_posix.cc @@ -235,7 +235,7 @@ static int poll_deadline_to_millis_timeout(grpc_core::Timestamp deadline); // -- mostly for fd_posix's use. static grpc_error_handle pollset_kick_ext(grpc_pollset* p, grpc_pollset_worker* specific_worker, - uint32_t flags) GRPC_MUST_USE_RESULT; + uint32_t flags); // Return 1 if the pollset has active threads in pollset_work (pollset must // be locked) diff --git a/src/core/lib/iomgr/pollset.h b/src/core/lib/iomgr/pollset.h index b04f71fa376c1..137a581b91faf 100644 --- a/src/core/lib/iomgr/pollset.h +++ b/src/core/lib/iomgr/pollset.h @@ -86,14 +86,13 @@ void grpc_pollset_destroy(grpc_pollset* pollset); // May call grpc_closure_list_run on grpc_closure_list, without holding the // pollset // lock -grpc_error_handle grpc_pollset_work( - grpc_pollset* pollset, grpc_pollset_worker** worker, - grpc_core::Timestamp deadline) GRPC_MUST_USE_RESULT; +grpc_error_handle grpc_pollset_work(grpc_pollset* pollset, + grpc_pollset_worker** worker, + grpc_core::Timestamp deadline); // Break one polling thread out of polling work for this pollset. // If specific_worker is non-NULL, then kick that worker. grpc_error_handle grpc_pollset_kick(grpc_pollset* pollset, - grpc_pollset_worker* specific_worker) - GRPC_MUST_USE_RESULT; + grpc_pollset_worker* specific_worker); #endif // GRPC_SRC_CORE_LIB_IOMGR_POLLSET_H diff --git a/src/core/lib/iomgr/wakeup_fd_posix.h b/src/core/lib/iomgr/wakeup_fd_posix.h index 3c8ed5278bb12..329e7ddd710c5 100644 --- a/src/core/lib/iomgr/wakeup_fd_posix.h +++ b/src/core/lib/iomgr/wakeup_fd_posix.h @@ -81,12 +81,9 @@ extern int grpc_allow_pipe_wakeup_fd; #define GRPC_WAKEUP_FD_GET_READ_FD(fd_info) ((fd_info)->read_fd) -grpc_error_handle grpc_wakeup_fd_init(grpc_wakeup_fd* fd_info) - GRPC_MUST_USE_RESULT; -grpc_error_handle grpc_wakeup_fd_consume_wakeup(grpc_wakeup_fd* fd_info) - GRPC_MUST_USE_RESULT; -grpc_error_handle grpc_wakeup_fd_wakeup(grpc_wakeup_fd* fd_info) - GRPC_MUST_USE_RESULT; +grpc_error_handle grpc_wakeup_fd_init(grpc_wakeup_fd* fd_info); +grpc_error_handle grpc_wakeup_fd_consume_wakeup(grpc_wakeup_fd* fd_info); +grpc_error_handle grpc_wakeup_fd_wakeup(grpc_wakeup_fd* fd_info); void grpc_wakeup_fd_destroy(grpc_wakeup_fd* fd_info); // Defined in some specialized implementation's .c file, or by diff --git a/src/core/lib/promise/party.h b/src/core/lib/promise/party.h index 909ef8e74aff1..206cbd5af80d6 100644 --- a/src/core/lib/promise/party.h +++ b/src/core/lib/promise/party.h @@ -384,7 +384,7 @@ class Party : public Activity, private Wakeable { // Should not be called by derived types except as a tail call to the base // class RunParty when overriding this method to add custom context. // Returns true if the party is over. - virtual bool RunParty() GRPC_MUST_USE_RESULT; + GRPC_MUST_USE_RESULT virtual bool RunParty(); bool RefIfNonZero() { return sync_.RefIfNonZero(); } diff --git a/src/core/lib/resource_quota/memory_quota.h b/src/core/lib/resource_quota/memory_quota.h index c6772d897e4b6..3f264e257cb6f 100644 --- a/src/core/lib/resource_quota/memory_quota.h +++ b/src/core/lib/resource_quota/memory_quota.h @@ -459,7 +459,7 @@ class GrpcMemoryAllocatorImpl final : public EventEngineMemoryAllocatorImpl { static constexpr size_t kMaxQuotaBufferSize = 1024 * 1024; // Primitive reservation function. - absl::optional TryReserve(MemoryRequest request) GRPC_MUST_USE_RESULT; + GRPC_MUST_USE_RESULT absl::optional TryReserve(MemoryRequest request); // This function may be invoked during a memory release operation. // It will try to return half of our free pool to the quota. void MaybeDonateBack(); diff --git a/src/core/lib/surface/server.h b/src/core/lib/surface/server.h index d635da585b7b9..ac4624c66b562 100644 --- a/src/core/lib/surface/server.h +++ b/src/core/lib/surface/server.h @@ -420,8 +420,8 @@ class Server : public InternallyRefCounted, } // Returns a notification pointer to wait on if there are requests in-flight, // or null. - Notification* ShutdownUnrefOnShutdownCall() - ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_global_) GRPC_MUST_USE_RESULT { + GRPC_MUST_USE_RESULT Notification* ShutdownUnrefOnShutdownCall() + ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_global_) { if (shutdown_refs_.fetch_sub(1, std::memory_order_acq_rel) == 1) { // There is no request in-flight. MaybeFinishShutdown(); From fae2982647e6d903f2c5563c510bc3025eddca67 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson <52979934+matthewstevenson88@users.noreply.github.com> Date: Tue, 18 Jul 2023 16:35:56 -0700 Subject: [PATCH 003/205] [ssl] Fix SSL stack to handle large handshake messages whose length exceeds the BIO buffer size. (#33638) There is a bug in the SSL stack that was only partially fixed in #29176: if more than 17kb is written to the BIO buffer, then everything over 17kb will be discarded, and the SSL handshake will fail with a bad record mac error or hang if not enough bytes have arrived yet. It's relatively uncommon to hit this bug, because the TLS handshake messages need to be much larger than normal for you to have a chance of hitting this bug. However, there was a separate bug in the SSL stack (recently fixed in #33558) that causes the ServerHello produced by a gRPC-C++ TLS server to grow linearly in size with the size of the trust bundle; these 2 bugs combined to cause a large number of TLS handshake failures for gRPC-C++ clients talking to gRPC-C++ servers when the server had a large trust bundle. This PR fixes the bug by ensuring that all bytes are successfully written to the BIO buffer. An initial quick fix for this bug was planned in #33611, but abandoned because we were worried about temporarily doubling the memory footprint of all SSL channels. The complexity in this PR is mostly in the test: it is fairly tricky to force gRPC-C++'s SSL stack to generate a sufficiently large ServerHello to trigger this bug. --- src/core/tsi/ssl_transport_security.cc | 35 +++++++-- test/core/tsi/BUILD | 9 ++- test/core/tsi/ssl_transport_security_test.cc | 71 ++++++++++++++++-- test/core/tsi/transport_security_test_lib.cc | 78 ++++++++++++++++++++ test/core/tsi/transport_security_test_lib.h | 10 +++ 5 files changed, 187 insertions(+), 16 deletions(-) diff --git a/src/core/tsi/ssl_transport_security.cc b/src/core/tsi/ssl_transport_security.cc index 10e99d6be1140..ad3b9be2bac12 100644 --- a/src/core/tsi/ssl_transport_security.cc +++ b/src/core/tsi/ssl_transport_security.cc @@ -65,6 +65,7 @@ // --- Constants. --- +#define TSI_SSL_MAX_BIO_WRITE_ATTEMPTS 100 #define TSI_SSL_MAX_PROTECTED_FRAME_SIZE_UPPER_BOUND 16384 #define TSI_SSL_MAX_PROTECTED_FRAME_SIZE_LOWER_BOUND 1024 #define TSI_SSL_HANDSHAKER_OUTGOING_BUFFER_INITIAL_SIZE 1024 @@ -1538,15 +1539,35 @@ static tsi_result ssl_handshaker_next(tsi_handshaker* self, // If there are received bytes, process them first. tsi_ssl_handshaker* impl = reinterpret_cast(self); tsi_result status = TSI_OK; - size_t bytes_consumed = received_bytes_size; size_t bytes_written = 0; if (received_bytes_size > 0) { - status = ssl_handshaker_process_bytes_from_peer(impl, received_bytes, - &bytes_consumed, error); - while (status == TSI_DRAIN_BUFFER) { - status = ssl_handshaker_write_output_buffer(self, &bytes_written, error); - if (status != TSI_OK) return status; - status = ssl_handshaker_do_handshake(impl, error); + unsigned char* remaining_bytes_to_write_to_openssl = + const_cast(received_bytes); + size_t remaining_bytes_to_write_to_openssl_size = received_bytes_size; + size_t number_bio_write_attempts = 0; + while (remaining_bytes_to_write_to_openssl_size > 0 && + (status == TSI_OK || status == TSI_INCOMPLETE_DATA) && + number_bio_write_attempts < TSI_SSL_MAX_BIO_WRITE_ATTEMPTS) { + ++number_bio_write_attempts; + // Try to write all of the remaining bytes to the BIO. + size_t bytes_written_to_openssl = + remaining_bytes_to_write_to_openssl_size; + status = ssl_handshaker_process_bytes_from_peer( + impl, remaining_bytes_to_write_to_openssl, &bytes_written_to_openssl, + error); + // As long as the BIO is full, drive the SSL handshake to consume bytes + // from the BIO. If the SSL handshake returns any bytes, write them to the + // peer. + while (status == TSI_DRAIN_BUFFER) { + status = + ssl_handshaker_write_output_buffer(self, &bytes_written, error); + if (status != TSI_OK) return status; + status = ssl_handshaker_do_handshake(impl, error); + } + // Move the pointer to the first byte not yet successfully written to the + // BIO. + remaining_bytes_to_write_to_openssl_size -= bytes_written_to_openssl; + remaining_bytes_to_write_to_openssl += bytes_written_to_openssl; } } if (status != TSI_OK) return status; diff --git a/test/core/tsi/BUILD b/test/core/tsi/BUILD index ee63a43f141df..4e15dc10c6454 100644 --- a/test/core/tsi/BUILD +++ b/test/core/tsi/BUILD @@ -25,6 +25,10 @@ grpc_cc_library( name = "transport_security_test_lib", srcs = ["transport_security_test_lib.cc"], hdrs = ["transport_security_test_lib.h"], + external_deps = [ + "libssl", + "libcrypto", + ], deps = [ "//:grpc", ], @@ -90,7 +94,10 @@ grpc_cc_test( "//src/core/tsi/test_creds:server1.key", "//src/core/tsi/test_creds:server1.pem", ], - external_deps = ["gtest"], + external_deps = [ + "absl/strings", + "gtest", + ], language = "C++", tags = ["no_windows"], deps = [ diff --git a/test/core/tsi/ssl_transport_security_test.cc b/test/core/tsi/ssl_transport_security_test.cc index 227289f51839a..55c78f779ac56 100644 --- a/test/core/tsi/ssl_transport_security_test.cc +++ b/test/core/tsi/ssl_transport_security_test.cc @@ -27,6 +27,8 @@ #include #include +#include "absl/strings/str_cat.h" + #include #include #include @@ -180,6 +182,7 @@ static void ssl_test_setup_handshakers(tsi_test_fixture* fixture) { server_options.client_certificate_request = TSI_DONT_REQUEST_CLIENT_CERTIFICATE; } + server_options.send_client_ca_list = test_send_client_ca_list; server_options.session_ticket_key = ssl_fixture->session_ticket_key; server_options.session_ticket_key_size = ssl_fixture->session_ticket_key_size; server_options.min_tls_version = test_tls_version; @@ -502,6 +505,32 @@ static char* load_file(const char* dir_path, const char* file_name) { return data; } +static bool is_slow_build() { +#if defined(GPR_ARCH_32) || defined(__APPLE__) + return true; +#else + return BuiltUnderMsan() || BuiltUnderTsan(); +#endif +} + +static std::string GenerateTrustBundle() { + // Create a trust bundle, consisting of 200 self-signed certs. The self-signed + // certs have subject DNs that are sufficiently big and complex that they + // substantially increase the server handshake message size. + std::string trust_bundle; + int trust_bundle_size = is_slow_build() ? 20 : 200; + for (int i = 0; i < trust_bundle_size; ++i) { + SelfSignedCertificateOptions options; + options.common_name = + absl::StrCat("{46f0eaed-6e05-43f5-9289-379104612fc", i, "}"); + options.organization = absl::StrCat("organization-", i); + options.organizational_unit = absl::StrCat("organizational-unit-", i); + std::string self_signed_cert = GenerateSelfSignedCertificate(options); + trust_bundle.append(self_signed_cert); + } + return trust_bundle; +} + static tsi_test_fixture* ssl_tsi_test_fixture_create() { ssl_tsi_test_fixture* ssl_fixture = grpc_core::Zalloc(); tsi_test_fixture_init(&ssl_fixture->base); @@ -622,6 +651,37 @@ void ssl_tsi_test_do_handshake_with_root_store() { tsi_test_fixture_destroy(fixture); } +void ssl_tsi_test_do_handshake_with_large_server_handshake_messages( + const std::string& trust_bundle) { + gpr_log(GPR_INFO, + "ssl_tsi_test_do_handshake_with_large_server_handshake_messages"); + tsi_test_fixture* fixture = ssl_tsi_test_fixture_create(); + // Force the test to read more handshake bytes from the peer than we have room + // for in the BIO. The default BIO buffer size is 17kB. + fixture->handshake_buffer_size = 18000; + ssl_tsi_test_fixture* ssl_fixture = + reinterpret_cast(fixture); + // Make a copy of the root cert and free the original. + std::string root_cert(ssl_fixture->key_cert_lib->root_cert); + gpr_free(ssl_fixture->key_cert_lib->root_cert); + ssl_fixture->key_cert_lib->root_cert = nullptr; + // Create a new root store, consisting of the root cert that is actually + // needed and 200 self-signed certs. + std::string effective_trust_bundle = absl::StrCat(root_cert, trust_bundle); + tsi_ssl_root_certs_store_destroy(ssl_fixture->key_cert_lib->root_store); + ssl_fixture->key_cert_lib->root_cert = + const_cast(effective_trust_bundle.c_str()); + ssl_fixture->key_cert_lib->root_store = + tsi_ssl_root_certs_store_create(effective_trust_bundle.c_str()); + ssl_fixture->key_cert_lib->use_root_store = true; + ssl_fixture->force_client_auth = true; + tsi_test_do_handshake(fixture); + // Overwrite the root_cert pointer so that tsi_test_fixture_destroy does not + // try to gpr_free it. + ssl_fixture->key_cert_lib->root_cert = nullptr; + tsi_test_fixture_destroy(fixture); +} + void ssl_tsi_test_do_handshake_with_client_authentication() { gpr_log(GPR_INFO, "ssl_tsi_test_do_handshake_with_client_authentication"); tsi_test_fixture* fixture = ssl_tsi_test_fixture_create(); @@ -781,14 +841,6 @@ void ssl_tsi_test_do_round_trip_with_error_on_stack() { tsi_test_fixture_destroy(fixture); } -static bool is_slow_build() { -#if defined(GPR_ARCH_32) || defined(__APPLE__) - return true; -#else - return BuiltUnderMsan() || BuiltUnderTsan(); -#endif -} - void ssl_tsi_test_do_round_trip_odd_buffer_size() { gpr_log(GPR_INFO, "ssl_tsi_test_do_round_trip_odd_buffer_size"); const size_t odd_sizes[] = {1025, 2051, 4103, 8207, 16409}; @@ -1166,6 +1218,7 @@ void ssl_tsi_test_do_handshake_with_custom_bio_pair() { TEST(SslTransportSecurityTest, MainTest) { grpc_init(); + std::string trust_bundle = GenerateTrustBundle(); const size_t number_tls_versions = 2; const tsi_tls_version tls_versions[] = {tsi_tls_version::TSI_TLS1_2, tsi_tls_version::TSI_TLS1_3}; @@ -1178,6 +1231,8 @@ TEST(SslTransportSecurityTest, MainTest) { ssl_tsi_test_do_handshake_small_handshake_buffer(); ssl_tsi_test_do_handshake(); ssl_tsi_test_do_handshake_with_root_store(); + ssl_tsi_test_do_handshake_with_large_server_handshake_messages( + trust_bundle); ssl_tsi_test_do_handshake_with_client_authentication(); ssl_tsi_test_do_handshake_with_client_authentication_and_root_store(); ssl_tsi_test_do_handshake_with_server_name_indication_exact_domain(); diff --git a/test/core/tsi/transport_security_test_lib.cc b/test/core/tsi/transport_security_test_lib.cc index eda7ae8794cbd..660b0afdd3607 100644 --- a/test/core/tsi/transport_security_test_lib.cc +++ b/test/core/tsi/transport_security_test_lib.cc @@ -22,6 +22,17 @@ #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include #include #include @@ -402,6 +413,11 @@ void tsi_test_do_handshake(tsi_test_fixture* fixture) { if (!server_args->error.ok()) { break; } + // If this assertion is hit, this is likely an indication that the client + // and server handshakers are hanging, each thinking that the other is + // responsible for sending the next chunk of bytes to the other. This can + // happen e.g. when a bug in the handshaker code results in some bytes being + // dropped instead of passed to the BIO or SSL objects. GPR_ASSERT(client_args->transferred_data || server_args->transferred_data); } while (fixture->client_result == nullptr || fixture->server_result == nullptr); @@ -664,3 +680,65 @@ void tsi_test_frame_protector_fixture_destroy( tsi_frame_protector_destroy(fixture->server_frame_protector); gpr_free(fixture); } + +std::string GenerateSelfSignedCertificate( + const SelfSignedCertificateOptions& options) { + // Generate an RSA keypair. + RSA* rsa = RSA_new(); + BIGNUM* bignum = BN_new(); + GPR_ASSERT(BN_set_word(bignum, RSA_F4)); + GPR_ASSERT( + RSA_generate_key_ex(rsa, /*key_size=*/2048, bignum, /*cb=*/nullptr)); + EVP_PKEY* key = EVP_PKEY_new(); + GPR_ASSERT(EVP_PKEY_assign_RSA(key, rsa)); + // Create the X509 object. + X509* x509 = X509_new(); + GPR_ASSERT(X509_set_version(x509, X509_VERSION_3)); + // Set the not_before/after fields to infinite past/future. The value for + // infinite future is from RFC 5280 Section 4.1.2.5.1. + ASN1_UTCTIME* infinite_past = ASN1_UTCTIME_new(); + GPR_ASSERT(ASN1_UTCTIME_set(infinite_past, /*posix_time=*/0)); + GPR_ASSERT(X509_set1_notBefore(x509, infinite_past)); + ASN1_UTCTIME_free(infinite_past); + ASN1_GENERALIZEDTIME* infinite_future = ASN1_GENERALIZEDTIME_new(); + GPR_ASSERT( + ASN1_GENERALIZEDTIME_set_string(infinite_future, "99991231235959Z")); + GPR_ASSERT(X509_set1_notAfter(x509, infinite_future)); + ASN1_GENERALIZEDTIME_free(infinite_future); + // Set the subject DN. + X509_NAME* subject_name = X509_NAME_new(); + GPR_ASSERT(X509_NAME_add_entry_by_txt( + subject_name, /*field=*/"CN", MBSTRING_ASC, + reinterpret_cast(options.common_name.c_str()), + /*len=*/-1, /*loc=*/-1, + /*set=*/0)); + GPR_ASSERT(X509_NAME_add_entry_by_txt( + subject_name, /*field=*/"O", MBSTRING_ASC, + reinterpret_cast(options.organization.c_str()), + /*len=*/-1, /*loc=*/-1, + /*set=*/0)); + GPR_ASSERT( + X509_NAME_add_entry_by_txt(subject_name, /*field=*/"OU", MBSTRING_ASC, + reinterpret_cast( + options.organizational_unit.c_str()), + /*len=*/-1, /*loc=*/-1, + /*set=*/0)); + GPR_ASSERT(X509_set_subject_name(x509, subject_name)); + X509_NAME_free(subject_name); + // Set the public key and sign the certificate. + GPR_ASSERT(X509_set_pubkey(x509, key)); + GPR_ASSERT(X509_sign(x509, key, EVP_sha256())); + // Convert to PEM. + BIO* bio = BIO_new(BIO_s_mem()); + GPR_ASSERT(PEM_write_bio_X509(bio, x509)); + const uint8_t* data = nullptr; + size_t len = 0; + GPR_ASSERT(BIO_mem_contents(bio, &data, &len)); + std::string pem = std::string(reinterpret_cast(data), len); + // Cleanup all of the OpenSSL objects and return the PEM-encoded cert. + EVP_PKEY_free(key); + X509_free(x509); + BIO_free(bio); + BN_free(bignum); + return pem; +} diff --git a/test/core/tsi/transport_security_test_lib.h b/test/core/tsi/transport_security_test_lib.h index d52bae1220b94..69f07c1269c6f 100644 --- a/test/core/tsi/transport_security_test_lib.h +++ b/test/core/tsi/transport_security_test_lib.h @@ -228,4 +228,14 @@ void tsi_test_do_round_trip(tsi_test_fixture* fixture); void tsi_test_frame_protector_do_round_trip_no_handshake( tsi_test_frame_protector_fixture* fixture); +struct SelfSignedCertificateOptions { + std::string common_name; + std::string organization; + std::string organizational_unit; +}; + +// Returns a PEM-encoded self-signed certificate. +std::string GenerateSelfSignedCertificate( + const SelfSignedCertificateOptions& options); + #endif // GRPC_TEST_CORE_TSI_TRANSPORT_SECURITY_TEST_LIB_H From 2c81c5619e80d69c96496098879620ed973d7b2c Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Wed, 19 Jul 2023 10:56:11 -0700 Subject: [PATCH 004/205] [deps] Remove libuv dependency (#33748) --- .gitmodules | 3 - bazel/grpc_deps.bzl | 22 - doc/core/grpc-polling-engines.md | 2 - third_party/BUILD | 1 - third_party/libuv | 1 - third_party/libuv.BUILD | 391 ------------------ .../run_tests/sanity/check_bazel_workspace.py | 1 - tools/run_tests/sanity/check_submodules.sh | 1 - 8 files changed, 422 deletions(-) delete mode 160000 third_party/libuv delete mode 100644 third_party/libuv.BUILD diff --git a/.gitmodules b/.gitmodules index 55b22264b89f8..99016a3d37d8e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -22,9 +22,6 @@ [submodule "third_party/googletest"] path = third_party/googletest url = https://github.com/google/googletest.git -[submodule "third_party/libuv"] - path = third_party/libuv - url = https://github.com/libuv/libuv.git [submodule "third_party/opencensus-proto"] path = third_party/opencensus-proto url = https://github.com/census-instrumentation/opencensus-proto.git diff --git a/bazel/grpc_deps.bzl b/bazel/grpc_deps.bzl index 7b124cc170bf8..ce0f40493d1db 100644 --- a/bazel/grpc_deps.bzl +++ b/bazel/grpc_deps.bzl @@ -195,16 +195,6 @@ def grpc_deps(): actual = "@io_opencensus_cpp//opencensus/exporters/stats/stackdriver:stackdriver_exporter", ) - native.bind( - name = "libuv", - actual = "@com_github_libuv_libuv//:libuv", - ) - - native.bind( - name = "libuv_test", - actual = "@com_github_libuv_libuv//:libuv_test", - ) - native.bind( name = "googleapis_trace_grpc_service", actual = "@com_google_googleapis//google/devtools/cloudtrace/v2:cloudtrace_cc_grpc", @@ -443,18 +433,6 @@ def grpc_deps(): ], ) - if "com_github_libuv_libuv" not in native.existing_rules(): - http_archive( - name = "com_github_libuv_libuv", - build_file = "@com_github_grpc_grpc//third_party:libuv.BUILD", - sha256 = "5ca4e9091f3231d8ad8801862dc4e851c23af89c69141d27723157776f7291e7", - strip_prefix = "libuv-02a9e1be252b623ee032a3137c0b0c94afbe6809", - urls = [ - "https://storage.googleapis.com/grpc-bazel-mirror/github.com/libuv/libuv/archive/02a9e1be252b623ee032a3137c0b0c94afbe6809.tar.gz", - "https://github.com/libuv/libuv/archive/02a9e1be252b623ee032a3137c0b0c94afbe6809.tar.gz", - ], - ) - if "com_google_googleapis" not in native.existing_rules(): http_archive( name = "com_google_googleapis", diff --git a/doc/core/grpc-polling-engines.md b/doc/core/grpc-polling-engines.md index 0a15e3312bb22..64d1aeae46f80 100644 --- a/doc/core/grpc-polling-engines.md +++ b/doc/core/grpc-polling-engines.md @@ -24,8 +24,6 @@ There are multiple polling engine implementations depending on the OS and the OS - `poll` (If kernel does not have epoll support) - Mac: **`poll`** (default) - Windows: (no name) -- One-off polling engines: - - NodeJS : `libuv` polling engine implementation (requires different compile `#define`s) ## Polling Engine Interface diff --git a/third_party/BUILD b/third_party/BUILD index 72a4730d890fc..b346d6edc0f3b 100644 --- a/third_party/BUILD +++ b/third_party/BUILD @@ -10,7 +10,6 @@ exports_files([ "six.BUILD", "enum34.BUILD", "futures.BUILD", - "libuv.BUILD", "protobuf.patch", "rules_python.patch", "protoc-gen-validate.patch", diff --git a/third_party/libuv b/third_party/libuv deleted file mode 160000 index 02a9e1be252b6..0000000000000 --- a/third_party/libuv +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 02a9e1be252b623ee032a3137c0b0c94afbe6809 diff --git a/third_party/libuv.BUILD b/third_party/libuv.BUILD deleted file mode 100644 index a3a9355d7d999..0000000000000 --- a/third_party/libuv.BUILD +++ /dev/null @@ -1,391 +0,0 @@ -# Copyright 2021 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("@bazel_skylib//lib:selects.bzl", "selects") - -config_setting( - name = "darwin", - values = {"cpu": "darwin"}, -) - -config_setting( - name = "darwin_x86_64", - values = {"cpu": "darwin_x86_64"}, -) - -config_setting( - name = "darwin_arm64", - values = {"cpu": "darwin_arm64"}, -) - -config_setting( - name = "darwin_arm64e", - values = {"cpu": "darwin_arm64e"}, -) - -config_setting( - name = "windows", - values = {"cpu": "x64_windows"}, -) - -config_setting( - name = "freebsd", - constraint_values = ["@platforms//os:freebsd"], -) - -# Android is not officially supported through C++. -# This just helps with the build for now. -config_setting( - name = "android", - values = { - "crosstool_top": "//external:android/crosstool", - }, -) - -# iOS is not officially supported through C++. -# This just helps with the build for now. -config_setting( - name = "ios_x86_64", - values = {"cpu": "ios_x86_64"}, -) - -config_setting( - name = "ios_armv7", - values = {"cpu": "ios_armv7"}, -) - -config_setting( - name = "ios_armv7s", - values = {"cpu": "ios_armv7s"}, -) - -config_setting( - name = "ios_arm64", - values = {"cpu": "ios_arm64"}, -) - -# The following architectures are found in -# https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/rules/apple/ApplePlatform.java -config_setting( - name = "tvos_x86_64", - values = {"cpu": "tvos_x86_64"}, -) - -config_setting( - name = "tvos_arm64", - values = {"cpu": "tvos_arm64"}, -) - -config_setting( - name = "watchos_i386", - values = {"cpu": "watchos_i386"}, -) - -config_setting( - name = "watchos_x86_64", - values = {"cpu": "watchos_x86_64"}, -) - -config_setting( - name = "watchos_armv7k", - values = {"cpu": "watchos_armv7k"}, -) - -config_setting( - name = "watchos_arm64_32", - values = {"cpu": "watchos_arm64_32"}, -) - -selects.config_setting_group( - name = "apple", - match_any = [ - ":darwin", - ":darwin_x86_64", - ":darwin_arm64", - ":darwin_arm64e", - "ios_x86_64", - "ios_armv7", - "ios_armv7s", - "ios_arm64", - "tvos_x86_64", - "tvos_arm64", - "watchos_i386", - "watchos_x86_64", - "watchos_armv7k", - "watchos_arm64_32", - ], -) - -COMMON_LIBUV_HEADERS = [ - "include/uv.h", - "include/uv/errno.h", - "include/uv/threadpool.h", - "include/uv/version.h", - "include/uv/tree.h", -] - -UNIX_LIBUV_HEADERS = [ - "include/uv/unix.h", - "src/unix/atomic-ops.h", - "src/unix/internal.h", - "src/unix/spinlock.h", -] - -LINUX_LIBUV_HEADERS = [ - "include/uv/linux.h", - "src/unix/linux-syscalls.h", -] - -ANDROID_LIBUV_HEADERS = [ - "include/uv/android-ifaddrs.h", -] - -DARWIN_LIBUV_HEADERS = [ - "include/uv/darwin.h", -] - -WINDOWS_LIBUV_HEADERS = [ - "include/uv/win.h", - "src/win/atomicops-inl.h", - "src/win/handle-inl.h", - "src/win/internal.h", - "src/win/req-inl.h", - "src/win/stream-inl.h", - "src/win/winapi.h", - "src/win/winsock.h", -] - -COMMON_LIBUV_SOURCES = [ - "src/fs-poll.c", - "src/heap-inl.h", - "src/idna.c", - "src/idna.h", - "src/inet.c", - "src/queue.h", - "src/strscpy.c", - "src/strscpy.h", - "src/threadpool.c", - "src/timer.c", - "src/uv-data-getter-setters.c", - "src/uv-common.c", - "src/uv-common.h", - "src/version.c", -] - -UNIX_LIBUV_SOURCES = [ - "src/unix/async.c", - "src/unix/atomic-ops.h", - "src/unix/core.c", - "src/unix/dl.c", - "src/unix/fs.c", - "src/unix/getaddrinfo.c", - "src/unix/getnameinfo.c", - "src/unix/internal.h", - "src/unix/loop.c", - "src/unix/loop-watcher.c", - "src/unix/pipe.c", - "src/unix/poll.c", - "src/unix/process.c", - "src/unix/signal.c", - "src/unix/spinlock.h", - "src/unix/stream.c", - "src/unix/tcp.c", - "src/unix/thread.c", - "src/unix/tty.c", - "src/unix/udp.c", -] - -LINUX_LIBUV_SOURCES = [ - "src/unix/linux-core.c", - "src/unix/linux-inotify.c", - "src/unix/linux-syscalls.c", - "src/unix/linux-syscalls.h", - "src/unix/procfs-exepath.c", - "src/unix/proctitle.c", - "src/unix/sysinfo-loadavg.c", - "src/unix/sysinfo-memory.c", -] - -ANDROID_LIBUV_SOURCES = [ - "src/unix/android-ifaddrs.c", - "src/unix/pthread-fixes.c", -] - -DARWIN_LIBUV_SOURCES = [ - "src/unix/bsd-ifaddrs.c", - "src/unix/darwin.c", - "src/unix/fsevents.c", - "src/unix/kqueue.c", - "src/unix/darwin-proctitle.c", - "src/unix/proctitle.c", -] - -WINDOWS_LIBUV_SOURCES = [ - "src/win/async.c", - "src/win/atomicops-inl.h", - "src/win/core.c", - "src/win/detect-wakeup.c", - "src/win/dl.c", - "src/win/error.c", - "src/win/fs-event.c", - "src/win/fs.c", - "src/win/getaddrinfo.c", - "src/win/getnameinfo.c", - "src/win/handle.c", - "src/win/handle-inl.h", - "src/win/internal.h", - "src/win/loop-watcher.c", - "src/win/pipe.c", - "src/win/poll.c", - "src/win/process-stdio.c", - "src/win/process.c", - "src/win/req-inl.h", - "src/win/signal.c", - "src/win/stream.c", - "src/win/stream-inl.h", - "src/win/tcp.c", - "src/win/thread.c", - "src/win/tty.c", - "src/win/udp.c", - "src/win/util.c", - "src/win/winapi.c", - "src/win/winapi.h", - "src/win/winsock.c", - "src/win/winsock.h", -] - -cc_library( - name = "libuv", - srcs = select({ - ":android": COMMON_LIBUV_SOURCES + UNIX_LIBUV_SOURCES + LINUX_LIBUV_SOURCES + ANDROID_LIBUV_SOURCES, - ":apple": COMMON_LIBUV_SOURCES + UNIX_LIBUV_SOURCES + DARWIN_LIBUV_SOURCES, - ":windows": COMMON_LIBUV_SOURCES + WINDOWS_LIBUV_SOURCES, - "//conditions:default": COMMON_LIBUV_SOURCES + UNIX_LIBUV_SOURCES + LINUX_LIBUV_SOURCES, - }), - hdrs = select({ - ":android": COMMON_LIBUV_HEADERS + UNIX_LIBUV_HEADERS + LINUX_LIBUV_HEADERS + ANDROID_LIBUV_HEADERS, - ":apple": COMMON_LIBUV_HEADERS + UNIX_LIBUV_HEADERS + DARWIN_LIBUV_HEADERS, - ":windows": COMMON_LIBUV_HEADERS + WINDOWS_LIBUV_HEADERS, - "//conditions:default": COMMON_LIBUV_HEADERS + UNIX_LIBUV_HEADERS + LINUX_LIBUV_HEADERS, - }), - copts = [ - "-D_LARGEFILE_SOURCE", - "-D_FILE_OFFSET_BITS=64", - "-D_GNU_SOURCE", - "-pthread", - "--std=gnu89", - "-pedantic", - "-Wno-error", - "-Wno-strict-aliasing", - "-Wstrict-aliasing", - "-O2", - "-Wno-implicit-function-declaration", - "-Wno-unused-function", - "-Wno-unused-variable", - ] + select({ - ":apple": [], - ":windows": [ - "-DWIN32_LEAN_AND_MEAN", - "-D_WIN32_WINNT=0x0600", - ], - "//conditions:default": [ - "-Wno-tree-vrp", - "-Wno-omit-frame-pointer", - "-D_DARWIN_USE_64_BIT_INODE=1", - "-D_DARWIN_UNLIMITED_SELECT=1", - ], - }), - includes = [ - "include", - "src", - ], - linkopts = select({ - ":windows": [ - "-Xcrosstool-compilation-mode=$(COMPILATION_MODE)", - "-Wl,Iphlpapi.lib", - "-Wl,Psapi.lib", - "-Wl,User32.lib", - "-Wl,Userenv.lib", - ], - "//conditions:default": [], - }), - visibility = [ - "//visibility:public", - ], -) - -cc_library( - name = "libuv_test", - srcs = [ - "test/test-timer.c", - "test/test-timer-again.c", - "test/test-timer-from-check.c", - "test/test-getaddrinfo.c", - "test/test-gethostname.c", - "test/test-getnameinfo.c", - "test/test-getsockname.c", - ], - hdrs = [ - "test/runner.h", - "test/runner-unix.h", - "test/task.h", - ], - includes = [ - "include", - "src", - ], - deps = [ - ":libuv" - ], - copts = [ - "-D_LARGEFILE_SOURCE", - "-D_FILE_OFFSET_BITS=64", - "-D_GNU_SOURCE", - "-pthread", - "--std=gnu89", - "-pedantic", - "-Wno-error", - "-Wno-strict-aliasing", - "-Wstrict-aliasing", - "-O2", - "-Wno-implicit-function-declaration", - "-Wno-unused-function", - "-Wno-unused-variable", - ] + select({ - ":apple": [], - ":windows": [ - "-DWIN32_LEAN_AND_MEAN", - "-D_WIN32_WINNT=0x0600", - ], - "//conditions:default": [ - "-Wno-tree-vrp", - "-Wno-omit-frame-pointer", - "-D_DARWIN_USE_64_BIT_INODE=1", - "-D_DARWIN_UNLIMITED_SELECT=1", - ], - }), - linkopts = select({ - ":windows": [ - "-Xcrosstool-compilation-mode=$(COMPILATION_MODE)", - "-Wl,Iphlpapi.lib", - "-Wl,Psapi.lib", - "-Wl,User32.lib", - "-Wl,Userenv.lib", - ], - "//conditions:default": [], - }), - visibility = [ - "//visibility:public", - ], -) diff --git a/tools/run_tests/sanity/check_bazel_workspace.py b/tools/run_tests/sanity/check_bazel_workspace.py index 8d37a4bb92d8e..2b78c439c18fa 100755 --- a/tools/run_tests/sanity/check_bazel_workspace.py +++ b/tools/run_tests/sanity/check_bazel_workspace.py @@ -71,7 +71,6 @@ "io_bazel_rules_go", "build_bazel_rules_apple", "build_bazel_apple_support", - "com_github_libuv_libuv", "com_googlesource_code_re2", "bazel_gazelle", "opencensus_proto", diff --git a/tools/run_tests/sanity/check_submodules.sh b/tools/run_tests/sanity/check_submodules.sh index 0332888f7e94c..7fd75cb3a735e 100755 --- a/tools/run_tests/sanity/check_submodules.sh +++ b/tools/run_tests/sanity/check_submodules.sh @@ -33,7 +33,6 @@ third_party/cares/cares 6360e96b5cf8e5980c887ce58ef727e53d77243a third_party/envoy-api e53e7bbd012f81965f2e79848ad9a58ceb67201f third_party/googleapis 2f9af297c84c55c8b871ba4495e01ade42476c92 third_party/googletest 0e402173c97aea7a00749e825b194bfede4f2e45 -third_party/libuv 02a9e1be252b623ee032a3137c0b0c94afbe6809 third_party/opencensus-proto 4aa53e15cbf1a47bc9087e6cfdca214c1eea4e89 third_party/opentelemetry 60fa8754d890b5c55949a8c68dcfd7ab5c2395df third_party/protobuf 2c5fa078d8e86e5f4bd34e6f4c9ea9e8d7d4d44a From 73605f4eac355bcbbbf43114d3801948d55fbcdd Mon Sep 17 00:00:00 2001 From: Yijie Ma Date: Wed, 19 Jul 2023 14:23:26 -0700 Subject: [PATCH 005/205] [EventEngine] Change `GetDNSResolver` to return `absl::StatusOr>` (#33744) Based on the discussion at: https://github.com/grpc/grpc/pull/32701/files/595a75cc5d56f8d7341a9533a24428ad37810269..e3b402a8fa27fc8787a73775068721bf9f322640#r1244325752 --- include/grpc/event_engine/event_engine.h | 7 +++++-- .../event_engine_client_channel_resolver.cc | 12 ++++++++++-- .../client_channel/resolver/polling_resolver.cc | 9 +++++++-- src/core/lib/event_engine/cf_engine/cf_engine.cc | 3 ++- src/core/lib/event_engine/cf_engine/cf_engine.h | 2 +- .../lib/event_engine/posix_engine/posix_engine.cc | 3 ++- .../lib/event_engine/posix_engine/posix_engine.h | 2 +- .../thready_event_engine/thready_event_engine.cc | 5 +++-- .../thready_event_engine/thready_event_engine.h | 2 +- src/core/lib/event_engine/windows/windows_engine.cc | 3 ++- src/core/lib/event_engine/windows/windows_engine.h | 2 +- .../core/event_engine/default_engine_methods_test.cc | 2 +- .../fuzzing_event_engine/fuzzing_event_engine.cc | 4 ++-- .../fuzzing_event_engine/fuzzing_event_engine.h | 2 +- test/core/event_engine/mock_event_engine.h | 2 +- .../test_suite/posix/oracle_event_engine_posix.h | 2 +- test/core/event_engine/util/aborting_event_engine.h | 2 +- .../resolver_fuzzer.cc | 2 +- 18 files changed, 43 insertions(+), 23 deletions(-) diff --git a/include/grpc/event_engine/event_engine.h b/include/grpc/event_engine/event_engine.h index 4e0df0ef56a09..00b57629e7341 100644 --- a/include/grpc/event_engine/event_engine.h +++ b/include/grpc/event_engine/event_engine.h @@ -397,8 +397,11 @@ class EventEngine : public std::enable_shared_from_this { virtual bool IsWorkerThread() = 0; /// Creates and returns an instance of a DNSResolver, optionally configured by - /// the \a options struct. - virtual std::unique_ptr GetDNSResolver( + /// the \a options struct. This method may return a non-OK status if an error + /// occurred when creating the DNSResolver. If the caller requests a custom + /// DNS server, and the EventEngine implementation does not support it, this + /// must return an error. + virtual absl::StatusOr> GetDNSResolver( const DNSResolver::ResolverOptions& options) = 0; /// Asynchronously executes a task as soon as possible. diff --git a/src/core/ext/filters/client_channel/resolver/dns/event_engine/event_engine_client_channel_resolver.cc b/src/core/ext/filters/client_channel/resolver/dns/event_engine/event_engine_client_channel_resolver.cc index a7061cfe9231c..a8596e7c7ca5c 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/event_engine/event_engine_client_channel_resolver.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/event_engine/event_engine_client_channel_resolver.cc @@ -200,9 +200,17 @@ EventEngineClientChannelDNSResolver::EventEngineClientChannelDNSResolver( event_engine_(channel_args().GetObjectRef()) {} OrphanablePtr EventEngineClientChannelDNSResolver::StartRequest() { + auto dns_resolver = + event_engine_->GetDNSResolver({/*dns_server=*/authority()}); + if (!dns_resolver.ok()) { + Result result; + result.addresses = dns_resolver.status(); + result.service_config = dns_resolver.status(); + OnRequestComplete(std::move(result)); + return nullptr; + } return MakeOrphanable( - Ref(DEBUG_LOCATION, "dns-resolving"), - event_engine_->GetDNSResolver({/*dns_server=*/authority()})); + Ref(DEBUG_LOCATION, "dns-resolving"), std::move(*dns_resolver)); } // ---------------------------------------------------------------------------- diff --git a/src/core/ext/filters/client_channel/resolver/polling_resolver.cc b/src/core/ext/filters/client_channel/resolver/polling_resolver.cc index 46f63e68e7a68..ff94e9834de7c 100644 --- a/src/core/ext/filters/client_channel/resolver/polling_resolver.cc +++ b/src/core/ext/filters/client_channel/resolver/polling_resolver.cc @@ -260,8 +260,13 @@ void PollingResolver::StartResolvingLocked() { request_ = StartRequest(); last_resolution_timestamp_ = Timestamp::Now(); if (GPR_UNLIKELY(tracer_ != nullptr && tracer_->enabled())) { - gpr_log(GPR_INFO, "[polling resolver %p] starting resolution, request_=%p", - this, request_.get()); + if (request_ != nullptr) { + gpr_log(GPR_INFO, + "[polling resolver %p] starting resolution, request_=%p", this, + request_.get()); + } else { + gpr_log(GPR_INFO, "[polling resolver %p] StartRequest failed", this); + } } } diff --git a/src/core/lib/event_engine/cf_engine/cf_engine.cc b/src/core/lib/event_engine/cf_engine/cf_engine.cc index ecd5e4fe21869..f835e64a21e8c 100644 --- a/src/core/lib/event_engine/cf_engine/cf_engine.cc +++ b/src/core/lib/event_engine/cf_engine/cf_engine.cc @@ -155,7 +155,8 @@ bool CFEventEngine::CancelConnectInternal(ConnectionHandle handle, bool CFEventEngine::IsWorkerThread() { grpc_core::Crash("unimplemented"); } -std::unique_ptr CFEventEngine::GetDNSResolver( +absl::StatusOr> +CFEventEngine::GetDNSResolver( const DNSResolver::ResolverOptions& /* options */) { grpc_core::Crash("unimplemented"); } diff --git a/src/core/lib/event_engine/cf_engine/cf_engine.h b/src/core/lib/event_engine/cf_engine/cf_engine.h index 3e55ce85616a4..e67f9c7533157 100644 --- a/src/core/lib/event_engine/cf_engine/cf_engine.h +++ b/src/core/lib/event_engine/cf_engine/cf_engine.h @@ -51,7 +51,7 @@ class CFEventEngine : public EventEngine, Duration timeout) override; bool CancelConnect(ConnectionHandle handle) override; bool IsWorkerThread() override; - std::unique_ptr GetDNSResolver( + absl::StatusOr> GetDNSResolver( const DNSResolver::ResolverOptions& options) override; void Run(Closure* closure) override; void Run(absl::AnyInvocable closure) override; diff --git a/src/core/lib/event_engine/posix_engine/posix_engine.cc b/src/core/lib/event_engine/posix_engine/posix_engine.cc index 0bb74bbab587d..a1d217cd3bd92 100644 --- a/src/core/lib/event_engine/posix_engine/posix_engine.cc +++ b/src/core/lib/event_engine/posix_engine/posix_engine.cc @@ -487,7 +487,8 @@ EventEngine::TaskHandle PosixEventEngine::RunAfterInternal( return handle; } -std::unique_ptr PosixEventEngine::GetDNSResolver( +absl::StatusOr> +PosixEventEngine::GetDNSResolver( EventEngine::DNSResolver::ResolverOptions const& /*options*/) { grpc_core::Crash("unimplemented"); } diff --git a/src/core/lib/event_engine/posix_engine/posix_engine.h b/src/core/lib/event_engine/posix_engine/posix_engine.h index 815a663d3d0a5..7fc40a1d33a74 100644 --- a/src/core/lib/event_engine/posix_engine/posix_engine.h +++ b/src/core/lib/event_engine/posix_engine/posix_engine.h @@ -188,7 +188,7 @@ class PosixEventEngine final : public PosixEventEngineWithFdSupport, bool CancelConnect(ConnectionHandle handle) override; bool IsWorkerThread() override; - std::unique_ptr GetDNSResolver( + absl::StatusOr> GetDNSResolver( const DNSResolver::ResolverOptions& options) override; void Run(Closure* closure) override; void Run(absl::AnyInvocable closure) override; diff --git a/src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc b/src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc index 81794e02cd075..4beb7b68bcfff 100644 --- a/src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc +++ b/src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc @@ -82,9 +82,10 @@ bool ThreadyEventEngine::IsWorkerThread() { grpc_core::Crash("we should remove this"); } -std::unique_ptr ThreadyEventEngine::GetDNSResolver( +absl::StatusOr> +ThreadyEventEngine::GetDNSResolver( const DNSResolver::ResolverOptions& options) { - return std::make_unique(impl_->GetDNSResolver(options)); + return std::make_unique(*impl_->GetDNSResolver(options)); } void ThreadyEventEngine::Run(Closure* closure) { diff --git a/src/core/lib/event_engine/thready_event_engine/thready_event_engine.h b/src/core/lib/event_engine/thready_event_engine/thready_event_engine.h index bcb972a8d65e9..23b79dc62cfed 100644 --- a/src/core/lib/event_engine/thready_event_engine/thready_event_engine.h +++ b/src/core/lib/event_engine/thready_event_engine/thready_event_engine.h @@ -63,7 +63,7 @@ class ThreadyEventEngine final : public EventEngine { bool IsWorkerThread() override; - std::unique_ptr GetDNSResolver( + absl::StatusOr> GetDNSResolver( const DNSResolver::ResolverOptions& options) override; void Run(Closure* closure) override; diff --git a/src/core/lib/event_engine/windows/windows_engine.cc b/src/core/lib/event_engine/windows/windows_engine.cc index 435b9c32197ab..552488639f130 100644 --- a/src/core/lib/event_engine/windows/windows_engine.cc +++ b/src/core/lib/event_engine/windows/windows_engine.cc @@ -194,7 +194,8 @@ EventEngine::TaskHandle WindowsEventEngine::RunAfterInternal( return handle; } -std::unique_ptr WindowsEventEngine::GetDNSResolver( +absl::StatusOr> +WindowsEventEngine::GetDNSResolver( EventEngine::DNSResolver::ResolverOptions const& /*options*/) { grpc_core::Crash("unimplemented"); } diff --git a/src/core/lib/event_engine/windows/windows_engine.h b/src/core/lib/event_engine/windows/windows_engine.h index 67de37211892d..5fed3ae95f0ce 100644 --- a/src/core/lib/event_engine/windows/windows_engine.h +++ b/src/core/lib/event_engine/windows/windows_engine.h @@ -75,7 +75,7 @@ class WindowsEventEngine : public EventEngine, bool CancelConnect(ConnectionHandle handle) override; bool IsWorkerThread() override; - std::unique_ptr GetDNSResolver( + absl::StatusOr> GetDNSResolver( const DNSResolver::ResolverOptions& options) override; void Run(Closure* closure) override; void Run(absl::AnyInvocable closure) override; diff --git a/test/core/event_engine/default_engine_methods_test.cc b/test/core/event_engine/default_engine_methods_test.cc index 4f98c5736ff5a..6ec633184093e 100644 --- a/test/core/event_engine/default_engine_methods_test.cc +++ b/test/core/event_engine/default_engine_methods_test.cc @@ -66,7 +66,7 @@ class DefaultEngineTest : public testing::Test { return false; }; bool IsWorkerThread() override { return false; }; - std::unique_ptr GetDNSResolver( + absl::StatusOr> GetDNSResolver( const DNSResolver::ResolverOptions& /* options */) override { return nullptr; }; diff --git a/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc b/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc index 9779e0f04404a..36dcfa5f0290b 100644 --- a/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc +++ b/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc @@ -461,8 +461,8 @@ bool FuzzingEventEngine::CancelConnect(ConnectionHandle connection_handle) { bool FuzzingEventEngine::IsWorkerThread() { abort(); } -std::unique_ptr FuzzingEventEngine::GetDNSResolver( - const DNSResolver::ResolverOptions&) { +absl::StatusOr> +FuzzingEventEngine::GetDNSResolver(const DNSResolver::ResolverOptions&) { abort(); } diff --git a/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.h b/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.h index 870505bc8735e..936d926ddfb84 100644 --- a/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.h +++ b/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.h @@ -85,7 +85,7 @@ class FuzzingEventEngine : public EventEngine { bool IsWorkerThread() override; - std::unique_ptr GetDNSResolver( + absl::StatusOr> GetDNSResolver( const DNSResolver::ResolverOptions& options) override; void Run(Closure* closure) ABSL_LOCKS_EXCLUDED(mu_) override; diff --git a/test/core/event_engine/mock_event_engine.h b/test/core/event_engine/mock_event_engine.h index 60a1129c76e06..e25f526cc7f16 100644 --- a/test/core/event_engine/mock_event_engine.h +++ b/test/core/event_engine/mock_event_engine.h @@ -44,7 +44,7 @@ class MockEventEngine : public EventEngine { Duration timeout)); MOCK_METHOD(bool, CancelConnect, (ConnectionHandle handle)); MOCK_METHOD(bool, IsWorkerThread, ()); - MOCK_METHOD(std::unique_ptr, GetDNSResolver, + MOCK_METHOD(absl::StatusOr>, GetDNSResolver, (const DNSResolver::ResolverOptions& options)); MOCK_METHOD(void, Run, (Closure * closure)); MOCK_METHOD(void, Run, (absl::AnyInvocable closure)); diff --git a/test/core/event_engine/test_suite/posix/oracle_event_engine_posix.h b/test/core/event_engine/test_suite/posix/oracle_event_engine_posix.h index 817480bb4e643..dc6de649e7150 100644 --- a/test/core/event_engine/test_suite/posix/oracle_event_engine_posix.h +++ b/test/core/event_engine/test_suite/posix/oracle_event_engine_posix.h @@ -171,7 +171,7 @@ class PosixOracleEventEngine final : public EventEngine { grpc_core::Crash("unimplemented"); } bool IsWorkerThread() override { return false; }; - std::unique_ptr GetDNSResolver( + absl::StatusOr> GetDNSResolver( const DNSResolver::ResolverOptions& /*options*/) override { grpc_core::Crash("unimplemented"); } diff --git a/test/core/event_engine/util/aborting_event_engine.h b/test/core/event_engine/util/aborting_event_engine.h index 016bd89950476..3144e015a9e33 100644 --- a/test/core/event_engine/util/aborting_event_engine.h +++ b/test/core/event_engine/util/aborting_event_engine.h @@ -49,7 +49,7 @@ class AbortingEventEngine : public EventEngine { abort(); }; bool IsWorkerThread() override { abort(); } - std::unique_ptr GetDNSResolver( + absl::StatusOr> GetDNSResolver( const DNSResolver::ResolverOptions& /* options */) override { abort(); } diff --git a/test/core/ext/filters/event_engine_client_channel_resolver/resolver_fuzzer.cc b/test/core/ext/filters/event_engine_client_channel_resolver/resolver_fuzzer.cc index 3f8412dc41634..5c862fa074ea5 100644 --- a/test/core/ext/filters/event_engine_client_channel_resolver/resolver_fuzzer.cc +++ b/test/core/ext/filters/event_engine_client_channel_resolver/resolver_fuzzer.cc @@ -132,7 +132,7 @@ class FuzzingResolverEventEngine } } - std::unique_ptr GetDNSResolver( + absl::StatusOr> GetDNSResolver( const DNSResolver::ResolverOptions& /* options */) override { return std::make_unique(this); } From 67f4e4e4c2692be4de5ee1f9142c5c4aba9aee23 Mon Sep 17 00:00:00 2001 From: Vignesh Babu Date: Wed, 19 Jul 2023 16:41:19 -0700 Subject: [PATCH 006/205] [resource quota] Reduce stress test size to prevent OOMs (#33776) --- test/cpp/end2end/resource_quota_end2end_stress_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cpp/end2end/resource_quota_end2end_stress_test.cc b/test/cpp/end2end/resource_quota_end2end_stress_test.cc index c475fa1ab68cd..83af5a2fe27ee 100644 --- a/test/cpp/end2end/resource_quota_end2end_stress_test.cc +++ b/test/cpp/end2end/resource_quota_end2end_stress_test.cc @@ -45,7 +45,7 @@ namespace testing { namespace { constexpr int kResourceQuotaSizeBytes = 1024 * 1024; constexpr int kPayloadSizeBytes = 1024 * 1024; -constexpr int kNumParallelChannels = 1024; +constexpr int kNumParallelChannels = 10; } // namespace class EchoClientUnaryReactor : public grpc::ClientUnaryReactor { From 112a29c6af3c8e4e04a38a48c9818d16dfa73f14 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 19 Jul 2023 16:54:12 -0700 Subject: [PATCH 007/205] [fuzzing] Increase deadline (#33765) Fix b/290782226 --- ...compressed_payload_fuzzer-4878596866899968 | 5093 +++++++++++++++++ test/core/end2end/tests/compressed_payload.cc | 2 +- 2 files changed, 5094 insertions(+), 1 deletion(-) create mode 100644 test/core/end2end/end2end_test_corpus/compressed_payload/clusterfuzz-testcase-minimized-compressed_payload_fuzzer-4878596866899968 diff --git a/test/core/end2end/end2end_test_corpus/compressed_payload/clusterfuzz-testcase-minimized-compressed_payload_fuzzer-4878596866899968 b/test/core/end2end/end2end_test_corpus/compressed_payload/clusterfuzz-testcase-minimized-compressed_payload_fuzzer-4878596866899968 new file mode 100644 index 0000000000000..6d3903cfe0fcb --- /dev/null +++ b/test/core/end2end/end2end_test_corpus/compressed_payload/clusterfuzz-testcase-minimized-compressed_payload_fuzzer-4878596866899968 @@ -0,0 +1,5093 @@ +test_id: 8 +event_engine_actions { + run_delay: 0 + run_delay: 0 + run_delay: 11258999068426240 + run_delay: 0 + run_delay: 1585267068834414592 + run_delay: 27710326379540257 + run_delay: 43980465111040 + run_delay: 0 + run_delay: 0 + run_delay: 27710326379540256 + run_delay: 0 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 0 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 9007199254741017 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 0 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540376 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 0 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 0 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 282574488338432 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 175 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + run_delay: 27710326379540257 + assign_ports: 8250 + assign_ports: 0 + assign_ports: 116 + assign_ports: 170930208 + connections { + write_size: 0 + } + connections { + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 5 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 16775936 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 229 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1694498817 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 0 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 10 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 1 + write_size: 65537 + write_size: 1 + write_size: 1 + write_size: 0 + write_size: 1 + write_size: 0 + write_size: 1 + write_size: 1 + } + connections { + write_size: 842203136 + write_size: 1 + write_size: 0 + write_size: 0 + write_size: 1 + write_size: 1 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 1 + write_size: 0 + write_size: 0 + write_size: 1 + write_size: 1 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 1 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 2105344 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 1000000000 + write_size: 0 + write_size: 0 + write_size: 1 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 41 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 1 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 23808 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 127 + write_size: 842203136 + write_size: 1 + write_size: 0 + write_size: 0 + write_size: 1 + write_size: 1 + write_size: 842203136 + write_size: 0 + write_size: 0 + } +} +config_vars { + experiments: "http" +} diff --git a/test/core/end2end/tests/compressed_payload.cc b/test/core/end2end/tests/compressed_payload.cc index 4f56534804704..50786307ed1ba 100644 --- a/test/core/end2end/tests/compressed_payload.cc +++ b/test/core/end2end/tests/compressed_payload.cc @@ -88,7 +88,7 @@ class TestConfigurator { void DisabledAlgorithmTest() { Init(); - auto c = test_.NewClientCall("/foo").Timeout(Duration::Seconds(5)).Create(); + auto c = test_.NewClientCall("/foo").Timeout(Duration::Minutes(1)).Create(); auto s = test_.RequestCall(101); CoreEnd2endTest::IncomingMetadata server_initial_metadata; CoreEnd2endTest::IncomingStatusOnClient server_status; From 4198a372274423a8e19e551149c0b8bd730a3ad3 Mon Sep 17 00:00:00 2001 From: Vignesh Babu Date: Wed, 19 Jul 2023 17:06:44 -0700 Subject: [PATCH 008/205] [experiments] Introduce a visibility class for experiments target (#33775) --- bazel/grpc_build_system.bzl | 1 + src/core/BUILD | 1 + 2 files changed, 2 insertions(+) diff --git a/bazel/grpc_build_system.bzl b/bazel/grpc_build_system.bzl index 107a655e8341d..c0bc4ebbb0f69 100644 --- a/bazel/grpc_build_system.bzl +++ b/bazel/grpc_build_system.bzl @@ -98,6 +98,7 @@ def _update_visibility(visibility): "endpoint_tests": PRIVATE, "exec_ctx": PRIVATE, "grpclb": PRIVATE, + "grpc_experiments": PRIVATE, "grpc_opencensus_plugin": PUBLIC, "grpcpp_gcp_observability": PUBLIC, "grpc_resolver_fake": PRIVATE, diff --git a/src/core/BUILD b/src/core/BUILD index 52a5a5f167cd6..8743a8aa76e14 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -127,6 +127,7 @@ grpc_cc_library( ], language = "c++", tags = ["nofixdeps"], + visibility = ["@grpc:grpc_experiments"], deps = [ "no_destruct", "//:config_vars", From 38da78e4169364ef6cf39bcc63c43351bd6340d9 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Wed, 19 Jul 2023 17:32:10 -0700 Subject: [PATCH 009/205] [test] delete client_channel_stress_test (#33763) This test has been disabled for a long time now due to flakiness, but it's now causing problems with the import. And stress tests don't provide positive ROI anyway, so let's just get rid of it. --- CMakeLists.txt | 67 ---- build_autogenerated.yaml | 22 -- test/cpp/client/BUILD | 30 -- test/cpp/client/client_channel_stress_test.cc | 351 ------------------ 4 files changed, 470 deletions(-) delete mode 100644 test/cpp/client/client_channel_stress_test.cc diff --git a/CMakeLists.txt b/CMakeLists.txt index 325581d4b3c6b..9c2d9099b06b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -898,9 +898,6 @@ if(gRPC_BUILD_TESTS) add_dependencies(buildtests_cxx client_authority_filter_test) add_dependencies(buildtests_cxx client_callback_end2end_test) add_dependencies(buildtests_cxx client_channel_service_config_test) - if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) - add_dependencies(buildtests_cxx client_channel_stress_test) - endif() add_dependencies(buildtests_cxx client_channel_test) add_dependencies(buildtests_cxx client_context_test_peer_test) add_dependencies(buildtests_cxx client_interceptors_end2end_test) @@ -8997,70 +8994,6 @@ target_link_libraries(client_channel_service_config_test ) -endif() -if(gRPC_BUILD_TESTS) -if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) - - add_executable(client_channel_stress_test - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v1/load_balancer.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v1/load_balancer.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v1/load_balancer.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v1/load_balancer.grpc.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/duplicate/echo_duplicate.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/duplicate/echo_duplicate.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.grpc.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.grpc.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_load_report.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_load_report.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_load_report.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_load_report.grpc.pb.h - test/cpp/client/client_channel_stress_test.cc - test/cpp/end2end/test_service_impl.cc - third_party/googletest/googletest/src/gtest-all.cc - third_party/googletest/googlemock/src/gmock-all.cc - ) - target_compile_features(client_channel_stress_test PUBLIC cxx_std_14) - target_include_directories(client_channel_stress_test - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} - ${_gRPC_RE2_INCLUDE_DIR} - ${_gRPC_SSL_INCLUDE_DIR} - ${_gRPC_UPB_GENERATED_DIR} - ${_gRPC_UPB_GRPC_GENERATED_DIR} - ${_gRPC_UPB_INCLUDE_DIR} - ${_gRPC_XXHASH_INCLUDE_DIR} - ${_gRPC_ZLIB_INCLUDE_DIR} - third_party/googletest/googletest/include - third_party/googletest/googletest - third_party/googletest/googlemock/include - third_party/googletest/googlemock - ${_gRPC_PROTO_GENS_DIR} - ) - - target_link_libraries(client_channel_stress_test - ${_gRPC_BASELIB_LIBRARIES} - ${_gRPC_PROTOBUF_LIBRARIES} - ${_gRPC_ZLIB_LIBRARIES} - ${_gRPC_ALLTARGETS_LIBRARIES} - grpc++_test_util - ) - - -endif() endif() if(gRPC_BUILD_TESTS) diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index f8a523b124c13..a4ae130713a9a 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -6258,28 +6258,6 @@ targets: deps: - grpc_test_util uses_polling: false -- name: client_channel_stress_test - gtest: true - build: test - run: false - language: c++ - headers: - - test/cpp/end2end/test_service_impl.h - src: - - src/proto/grpc/lb/v1/load_balancer.proto - - src/proto/grpc/testing/duplicate/echo_duplicate.proto - - src/proto/grpc/testing/echo.proto - - src/proto/grpc/testing/echo_messages.proto - - src/proto/grpc/testing/simple_messages.proto - - src/proto/grpc/testing/xds/v3/orca_load_report.proto - - test/cpp/client/client_channel_stress_test.cc - - test/cpp/end2end/test_service_impl.cc - deps: - - grpc++_test_util - platforms: - - linux - - posix - - mac - name: client_channel_test gtest: true build: test diff --git a/test/cpp/client/BUILD b/test/cpp/client/BUILD index 530cfe81a0995..5b2dc69a850b2 100644 --- a/test/cpp/client/BUILD +++ b/test/cpp/client/BUILD @@ -38,36 +38,6 @@ grpc_cc_test( ], ) -grpc_cc_test( - name = "client_channel_stress_test", - srcs = ["client_channel_stress_test.cc"], - # TODO(jtattermusch): test fails frequently on Win RBE, but passes locally - # reenable the tests once it works reliably on Win RBE. - # TODO(roth): Test marked as manual for now due to variable duration - # problem triggered by https://github.com/grpc/grpc/pull/22481. - # Once we figure out the problem, either re-enable or just decide to - # remove this test. Tracked internally in b/153136407. - tags = [ - "manual", - "no_test_android", # fails on android due to "Too many open files". - "no_windows", - ], - deps = [ - "//:exec_ctx", - "//:gpr", - "//:grpc", - "//:grpc++", - "//:grpc_resolver_fake", - "//src/proto/grpc/lb/v1:load_balancer_proto", - "//src/proto/grpc/testing:echo_messages_proto", - "//src/proto/grpc/testing:echo_proto", - "//src/proto/grpc/testing/duplicate:echo_duplicate_proto", - "//test/core/util:grpc_test_util", - "//test/cpp/end2end:test_service_impl", - "//test/cpp/util:test_util", - ], -) - grpc_cc_test( name = "destroy_grpclb_channel_with_active_connect_stress_test", srcs = ["destroy_grpclb_channel_with_active_connect_stress_test.cc"], diff --git a/test/cpp/client/client_channel_stress_test.cc b/test/cpp/client/client_channel_stress_test.cc deleted file mode 100644 index 6485b06022a7c..0000000000000 --- a/test/cpp/client/client_channel_stress_test.cc +++ /dev/null @@ -1,351 +0,0 @@ -// -// -// Copyright 2017 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// - -#include -#include -#include -#include -#include -#include -#include - -#include "absl/memory/memory.h" -#include "absl/strings/str_cat.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h" -#include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h" -#include "src/core/lib/address_utils/parse_address.h" -#include "src/core/lib/gprpp/crash.h" -#include "src/core/lib/gprpp/ref_counted_ptr.h" -#include "src/core/lib/gprpp/thd.h" -#include "src/core/lib/iomgr/exec_ctx.h" -#include "src/core/lib/iomgr/sockaddr.h" -#include "src/core/lib/resolver/server_address.h" -#include "src/core/lib/service_config/service_config_impl.h" -#include "src/proto/grpc/lb/v1/load_balancer.grpc.pb.h" -#include "src/proto/grpc/testing/echo.grpc.pb.h" -#include "test/core/util/port.h" -#include "test/core/util/test_config.h" -#include "test/cpp/end2end/test_service_impl.h" - -using grpc::lb::v1::LoadBalancer; -using grpc::lb::v1::LoadBalanceRequest; -using grpc::lb::v1::LoadBalanceResponse; - -namespace grpc { -namespace testing { -namespace { - -const size_t kNumBackends = 10; -const size_t kNumBalancers = 5; -const size_t kNumClientThreads = 10; -const int kResolutionUpdateIntervalMs = 50; -const int kServerlistUpdateIntervalMs = 10; -const int kTestDurationSec = 30; - -using BackendServiceImpl = TestServiceImpl; - -class BalancerServiceImpl : public LoadBalancer::Service { - public: - using Stream = ServerReaderWriter; - - explicit BalancerServiceImpl(const std::vector& all_backend_ports) - : all_backend_ports_(all_backend_ports) {} - - Status BalanceLoad(ServerContext* /*context*/, Stream* stream) override { - gpr_log(GPR_INFO, "LB[%p]: Start BalanceLoad.", this); - LoadBalanceRequest request; - stream->Read(&request); - while (!shutdown_) { - stream->Write(BuildRandomResponseForBackends()); - std::this_thread::sleep_for( - std::chrono::milliseconds(kServerlistUpdateIntervalMs)); - } - gpr_log(GPR_INFO, "LB[%p]: Finish BalanceLoad.", this); - return Status::OK; - } - - void Shutdown() { shutdown_ = true; } - - private: - std::string Ip4ToPackedString(const char* ip_str) { - struct in_addr ip4; - GPR_ASSERT(inet_pton(AF_INET, ip_str, &ip4) == 1); - return std::string(reinterpret_cast(&ip4), sizeof(ip4)); - } - - LoadBalanceResponse BuildRandomResponseForBackends() { - // Generate a random serverlist with varying size (if N = - // all_backend_ports_.size(), num_non_drop_entry is in [0, 2N], - // num_drop_entry is in [0, N]), order, duplicate, and drop rate. - size_t num_non_drop_entry = - std::rand() % (all_backend_ports_.size() * 2 + 1); - size_t num_drop_entry = std::rand() % (all_backend_ports_.size() + 1); - std::vector random_backend_indices; - for (size_t i = 0; i < num_non_drop_entry; ++i) { - random_backend_indices.push_back(std::rand() % all_backend_ports_.size()); - } - for (size_t i = 0; i < num_drop_entry; ++i) { - random_backend_indices.push_back(-1); - } - std::shuffle(random_backend_indices.begin(), random_backend_indices.end(), - std::mt19937(std::random_device()())); - // Build the response according to the random list generated above. - LoadBalanceResponse response; - for (int index : random_backend_indices) { - auto* server = response.mutable_server_list()->add_servers(); - if (index < 0) { - server->set_drop(true); - server->set_load_balance_token("load_balancing"); - } else { - server->set_ip_address(Ip4ToPackedString("127.0.0.1")); - server->set_port(all_backend_ports_[index]); - } - } - return response; - } - - std::atomic_bool shutdown_{false}; - const std::vector all_backend_ports_; -}; - -class ClientChannelStressTest { - public: - void Run() { - Start(); - // Keep updating resolution for the test duration. - gpr_log(GPR_INFO, "Start updating resolution."); - const auto wait_duration = - std::chrono::milliseconds(kResolutionUpdateIntervalMs); - std::vector addresses; - auto start_time = std::chrono::steady_clock::now(); - while (true) { - if (std::chrono::duration_cast( - std::chrono::steady_clock::now() - start_time) - .count() > kTestDurationSec) { - break; - } - // Generate a random subset of balancers. - addresses.clear(); - for (const auto& balancer_server : balancer_servers_) { - // Select each address with probability of 0.8. - if (std::rand() % 10 < 8) { - addresses.emplace_back(AddressData{balancer_server.port_, ""}); - } - } - std::shuffle(addresses.begin(), addresses.end(), - std::mt19937(std::random_device()())); - SetNextResolution(addresses); - std::this_thread::sleep_for(wait_duration); - } - gpr_log(GPR_INFO, "Finish updating resolution."); - Shutdown(); - } - - private: - template - struct ServerThread { - explicit ServerThread(const std::string& type, - const std::string& server_host, T* service) - : type_(type), service_(service) { - grpc::internal::Mutex mu; - // We need to acquire the lock here in order to prevent the notify_one - // by ServerThread::Start from firing before the wait below is hit. - grpc::internal::MutexLock lock(&mu); - port_ = grpc_pick_unused_port_or_die(); - gpr_log(GPR_INFO, "starting %s server on port %d", type_.c_str(), port_); - grpc::internal::CondVar cond; - thread_ = std::make_unique( - std::bind(&ServerThread::Start, this, server_host, &mu, &cond)); - cond.Wait(&mu); - gpr_log(GPR_INFO, "%s server startup complete", type_.c_str()); - } - - void Start(const std::string& server_host, grpc::internal::Mutex* mu, - grpc::internal::CondVar* cond) { - // We need to acquire the lock here in order to prevent the notify_one - // below from firing before its corresponding wait is executed. - grpc::internal::MutexLock lock(mu); - std::ostringstream server_address; - server_address << server_host << ":" << port_; - ServerBuilder builder; - builder.AddListeningPort(server_address.str(), - InsecureServerCredentials()); - builder.RegisterService(service_); - server_ = builder.BuildAndStart(); - cond->Signal(); - } - - void Shutdown() { - gpr_log(GPR_INFO, "%s about to shutdown", type_.c_str()); - server_->Shutdown(grpc_timeout_milliseconds_to_deadline(0)); - thread_->join(); - gpr_log(GPR_INFO, "%s shutdown completed", type_.c_str()); - } - - int port_; - std::string type_; - std::unique_ptr server_; - T* service_; - std::unique_ptr thread_; - }; - - struct AddressData { - int port; - std::string balancer_name; - }; - - static grpc_core::ServerAddressList CreateAddressListFromAddressDataList( - const std::vector& address_data) { - grpc_core::ServerAddressList addresses; - for (const auto& addr : address_data) { - std::string lb_uri_str = absl::StrCat("ipv4:127.0.0.1:", addr.port); - absl::StatusOr lb_uri = grpc_core::URI::Parse(lb_uri_str); - GPR_ASSERT(lb_uri.ok()); - grpc_resolved_address address; - GPR_ASSERT(grpc_parse_uri(*lb_uri, &address)); - addresses.emplace_back( - address, grpc_core::ChannelArgs().Set(GRPC_ARG_DEFAULT_AUTHORITY, - addr.balancer_name)); - } - return addresses; - } - - static grpc_core::Resolver::Result MakeResolverResult( - const std::vector& balancer_address_data) { - grpc_core::Resolver::Result result; - result.service_config = grpc_core::ServiceConfigImpl::Create( - grpc_core::ChannelArgs(), - "{\"loadBalancingConfig\":[{\"grpclb\":{}}]}"); - GPR_ASSERT(result.service_config.ok()); - grpc_core::ServerAddressList balancer_addresses = - CreateAddressListFromAddressDataList(balancer_address_data); - result.args = grpc_core::SetGrpcLbBalancerAddresses( - grpc_core::ChannelArgs(), std::move(balancer_addresses)); - return result; - } - - void SetNextResolution(const std::vector& address_data) { - grpc_core::ExecCtx exec_ctx; - grpc_core::Resolver::Result result = MakeResolverResult(address_data); - response_generator_->SetResponse(std::move(result)); - } - - void KeepSendingRequests() { - gpr_log(GPR_INFO, "Start sending requests."); - while (!shutdown_) { - ClientContext context; - context.set_deadline(grpc_timeout_milliseconds_to_deadline(1000)); - EchoRequest request; - request.set_message("test"); - EchoResponse response; - { - std::lock_guard lock(stub_mutex_); - Status status = stub_->Echo(&context, request, &response); - } - } - gpr_log(GPR_INFO, "Finish sending requests."); - } - - void CreateStub() { - ChannelArguments args; - response_generator_ = - grpc_core::MakeRefCounted(); - args.SetPointer(GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR, - response_generator_.get()); - std::ostringstream uri; - uri << "fake:///servername_not_used"; - channel_ = grpc::CreateCustomChannel(uri.str(), - InsecureChannelCredentials(), args); - stub_ = grpc::testing::EchoTestService::NewStub(channel_); - } - - void Start() { - // Start the backends. - std::vector backend_ports; - for (size_t i = 0; i < kNumBackends; ++i) { - backends_.emplace_back(new BackendServiceImpl()); - backend_servers_.emplace_back(ServerThread( - "backend", server_host_, backends_.back().get())); - backend_ports.push_back(backend_servers_.back().port_); - } - // Start the load balancers. - for (size_t i = 0; i < kNumBalancers; ++i) { - balancers_.emplace_back(new BalancerServiceImpl(backend_ports)); - balancer_servers_.emplace_back(ServerThread( - "balancer", server_host_, balancers_.back().get())); - } - // Start sending RPCs in multiple threads. - CreateStub(); - for (size_t i = 0; i < kNumClientThreads; ++i) { - client_threads_.emplace_back( - std::thread(&ClientChannelStressTest::KeepSendingRequests, this)); - } - } - - void Shutdown() { - shutdown_ = true; - for (size_t i = 0; i < client_threads_.size(); ++i) { - client_threads_[i].join(); - } - for (size_t i = 0; i < balancers_.size(); ++i) { - balancers_[i]->Shutdown(); - balancer_servers_[i].Shutdown(); - } - for (size_t i = 0; i < backends_.size(); ++i) { - backend_servers_[i].Shutdown(); - } - } - - std::atomic_bool shutdown_{false}; - const std::string server_host_ = "localhost"; - std::shared_ptr channel_; - std::unique_ptr stub_; - std::mutex stub_mutex_; - std::vector> backends_; - std::vector> balancers_; - std::vector> backend_servers_; - std::vector> balancer_servers_; - grpc_core::RefCountedPtr - response_generator_; - std::vector client_threads_; -}; - -} // namespace -} // namespace testing -} // namespace grpc - -int main(int argc, char** argv) { - grpc::testing::TestEnvironment env(&argc, argv); - grpc::testing::ClientChannelStressTest test; - grpc_init(); - test.Run(); - grpc_shutdown(); - return 0; -} From b33a0781fa5f4bfd7cb9883f06db8e61eba73efd Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Thu, 20 Jul 2023 09:22:33 -0700 Subject: [PATCH 010/205] [build] Private visibility for internal EE library (#33764) --- test/core/event_engine/posix/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/core/event_engine/posix/BUILD b/test/core/event_engine/posix/BUILD index 6576c2157eb8a..93854b8117080 100644 --- a/test/core/event_engine/posix/BUILD +++ b/test/core/event_engine/posix/BUILD @@ -29,7 +29,7 @@ grpc_cc_library( tags = [ "no_windows", ], - visibility = ["//test:__subpackages__"], + visibility = ["//visibility:private"], deps = [ "//src/core:event_engine_common", "//src/core:posix_event_engine_event_poller", From 7ac032ba466c7da9e091510fad57cab8fcbdeaee Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 20 Jul 2023 09:59:48 -0700 Subject: [PATCH 011/205] [build] Add visibility rule for arena, resource quota (#33777) Will be needed in order to fix some internal tests for the promise conversion --- src/core/BUILD | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/BUILD b/src/core/BUILD index 8743a8aa76e14..f4f043119667b 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -1128,6 +1128,9 @@ grpc_cc_library( "absl/meta:type_traits", "absl/utility", ], + visibility = [ + "@grpc:alt_grpc_base_legacy", + ], deps = [ "construct_destruct", "context", @@ -1176,6 +1179,9 @@ grpc_cc_library( "lib/resource_quota/resource_quota.h", ], external_deps = ["absl/strings"], + visibility = [ + "@grpc:alt_grpc_base_legacy", + ], deps = [ "memory_quota", "ref_counted", From e821494739d8ca2034b8697e7f835b7145f1c866 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 20 Jul 2023 10:00:00 -0700 Subject: [PATCH 012/205] [test] Increase deadline after observed failure internally (#33778) (needed to unblock promises rollout) --- test/core/transport/chttp2/too_many_pings_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/core/transport/chttp2/too_many_pings_test.cc b/test/core/transport/chttp2/too_many_pings_test.cc index 0d03aedf0d169..2858e74a216c8 100644 --- a/test/core/transport/chttp2/too_many_pings_test.cc +++ b/test/core/transport/chttp2/too_many_pings_test.cc @@ -250,7 +250,7 @@ grpc_status_code PerformWaitingCall(grpc_channel* channel, grpc_server* server, grpc_status_code status; grpc_call_error error; grpc_slice details; - gpr_timespec deadline = grpc_timeout_seconds_to_deadline(15); + gpr_timespec deadline = grpc_timeout_seconds_to_deadline(30); // Start a call c = grpc_channel_create_call(channel, nullptr, GRPC_PROPAGATE_DEFAULTS, cq, grpc_slice_from_static_string("/foo"), nullptr, From 25ed074b0d093231292786028f58f58de92929a2 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 20 Jul 2023 10:00:27 -0700 Subject: [PATCH 013/205] [bad_client] Increase timeout (saw this exceeded internally) (#33781) Unblocks promises rollout --- test/core/bad_client/bad_client.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/core/bad_client/bad_client.cc b/test/core/bad_client/bad_client.cc index 0f26d91225bf3..c0149fe44118d 100644 --- a/test/core/bad_client/bad_client.cc +++ b/test/core/bad_client/bad_client.cc @@ -245,7 +245,7 @@ void grpc_run_bad_client_test( &sfd, client_cq); } // Wait for server thread to finish - GPR_ASSERT(gpr_event_wait(&a.done_thd, grpc_timeout_seconds_to_deadline(1))); + GPR_ASSERT(gpr_event_wait(&a.done_thd, grpc_timeout_seconds_to_deadline(5))); // Shutdown. shutdown_client(&sfd.client); From 4c7107794d0fbc1d83926e22d230de64614c4840 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 20 Jul 2023 10:03:50 -0700 Subject: [PATCH 014/205] [promises] Handle the case that a rejection happens without reporting to the app (#33782) Promises code can prevent these bad requests from even reaching the application, which is beneficial but this test needs a minor update to handle it. --------- Co-authored-by: ctiller --- test/core/bad_client/tests/duplicate_header.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/test/core/bad_client/tests/duplicate_header.cc b/test/core/bad_client/tests/duplicate_header.cc index 2ee3b814bc8a6..ad5754d1db98f 100644 --- a/test/core/bad_client/tests/duplicate_header.cc +++ b/test/core/bad_client/tests/duplicate_header.cc @@ -23,6 +23,7 @@ #include #include +#include "src/core/lib/gprpp/time.h" #include "test/core/bad_client/bad_client.h" #include "test/core/end2end/cq_verifier.h" #include "test/core/util/test_config.h" @@ -70,8 +71,18 @@ static void verifier(grpc_server* server, grpc_completion_queue* cq, &request_metadata_recv, cq, cq, grpc_core::CqVerifier::tag(101)); GPR_ASSERT(GRPC_CALL_OK == error); - cqv.Expect(grpc_core::CqVerifier::tag(101), true); - cqv.Verify(); + bool got = false; + cqv.Expect(grpc_core::CqVerifier::tag(101), + grpc_core::CqVerifier::Maybe{&got}); + cqv.Verify(grpc_core::Duration::Seconds(1)); + + if (!got) { + grpc_server_shutdown_and_notify(server, cq, grpc_core::CqVerifier::tag(99)); + cqv.Expect(grpc_core::CqVerifier::tag(101), false); + cqv.Expect(grpc_core::CqVerifier::tag(99), true); + cqv.Verify(); + return; + } GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.host, "localhost")); GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo/bar")); From a28900a9cf3c0de9ce28832dc45781464d86efc8 Mon Sep 17 00:00:00 2001 From: apolcyn Date: Thu, 20 Jul 2023 10:07:24 -0700 Subject: [PATCH 015/205] [ruby] raise RPC deadline in a flakey test (#33713) As title - use a deadline that rules out starvation as a source of flakiness --- ...rning_bad_metadata_doesnt_kill_background_thread_test.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ruby/end2end/call_credentials_returning_bad_metadata_doesnt_kill_background_thread_test.rb b/src/ruby/end2end/call_credentials_returning_bad_metadata_doesnt_kill_background_thread_test.rb index 5ff9405a65367..eda85c6da091d 100755 --- a/src/ruby/end2end/call_credentials_returning_bad_metadata_doesnt_kill_background_thread_test.rb +++ b/src/ruby/end2end/call_credentials_returning_bad_metadata_doesnt_kill_background_thread_test.rb @@ -126,20 +126,20 @@ def main create_channel_creds.compose(GRPC::Core::CallCredentials.new(good_header_proc)), channel_args: channel_args) STDERR.puts 'perform an RPC using call creds that return valid headers and expect OK...' - good_stub.echo(Echo::EchoRequest.new(request: 'hello'), deadline: Time.now + 10) + good_stub.echo(Echo::EchoRequest.new(request: 'hello'), deadline: Time.now + 300) STDERR.puts 'perform an RPC using call creds that return an empty header and expect it to fail...' run_rpc_expect_unavailable(empty_header_stub) STDERR.puts 'perform an RPC using call creds that return a bad type and expect it to fail...' run_rpc_expect_unavailable(bad_type_stub) STDERR.puts 'perform an RPC using call creds that return nil and expect OK...' - nil_stub.echo(Echo::EchoRequest.new(request: 'hello'), deadline: Time.now + 10) + nil_stub.echo(Echo::EchoRequest.new(request: 'hello'), deadline: Time.now + 300) STDERR.puts 'perform an RPC using call creds that raise an error and expect it to fail...' run_rpc_expect_unavailable(raising_stub) STDERR.puts 'perform an RPC using call creds that return valid headers and expect OK...' # Note that the purpose of this RPC is to test that the bad call creds used by the previous # RPCs didn't get the gRPC-ruby library into a wedged state (specifically by killing # the call credentials user callback invocation thread). - good_stub.echo(Echo::EchoRequest.new(request: 'hello'), deadline: Time.now + 10) + good_stub.echo(Echo::EchoRequest.new(request: 'hello'), deadline: Time.now + 300) server_runner.stop call_creds_invocation_count_mu.synchronize do unless call_creds_invocation_count.value == 6 From 76e48328650a61e795b119ef14c735e24b6d3eb6 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 20 Jul 2023 10:28:45 -0700 Subject: [PATCH 016/205] [promises] Use call finalization to destroy call data - avoids a use after free (#33780) --- src/core/lib/channel/connected_channel.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/lib/channel/connected_channel.cc b/src/core/lib/channel/connected_channel.cc index 44b1fdb97baf6..83dcb93845b7a 100644 --- a/src/core/lib/channel/connected_channel.cc +++ b/src/core/lib/channel/connected_channel.cc @@ -39,6 +39,7 @@ #include #include +#include "src/core/lib/channel/call_finalization.h" #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_fwd.h" #include "src/core/lib/channel/channel_stack.h" @@ -597,7 +598,9 @@ ArenaPromise MakeServerCallPromise( bool sent_initial_metadata = false; bool sent_trailing_metadata = false; }; - auto* call_data = GetContext()->ManagedNew(); + auto* call_data = GetContext()->New(); + GetContext()->Add( + [call_data](const grpc_call_final_info*) { call_data->~CallData(); }); party->Spawn( "set_polling_entity", call_data->polling_entity_latch.Wait(), From 5b46c8bdbad733fa74ddf07c5b6fa3c9a600dbb9 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 20 Jul 2023 10:29:11 -0700 Subject: [PATCH 017/205] [fuzzing] Increase deadline, fix b/291630910 (#33768) --- ...-trailing_metadata_fuzzer-6205653957804032 | 988 ++++++++++++++++++ test/core/end2end/tests/trailing_metadata.cc | 2 +- 2 files changed, 989 insertions(+), 1 deletion(-) create mode 100644 test/core/end2end/end2end_test_corpus/trailing_metadata/clusterfuzz-testcase-minimized-trailing_metadata_fuzzer-6205653957804032 diff --git a/test/core/end2end/end2end_test_corpus/trailing_metadata/clusterfuzz-testcase-minimized-trailing_metadata_fuzzer-6205653957804032 b/test/core/end2end/end2end_test_corpus/trailing_metadata/clusterfuzz-testcase-minimized-trailing_metadata_fuzzer-6205653957804032 new file mode 100644 index 0000000000000..79f1564a218b6 --- /dev/null +++ b/test/core/end2end/end2end_test_corpus/trailing_metadata/clusterfuzz-testcase-minimized-trailing_metadata_fuzzer-6205653957804032 @@ -0,0 +1,988 @@ +event_engine_actions { + run_delay: 32651097298436092 + run_delay: 8358680908399640576 + run_delay: 0 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 1342177280 + run_delay: 8358680908399640576 + run_delay: 0 + run_delay: 8358680908399640576 + run_delay: 0 + run_delay: 0 + run_delay: 8358680908399640576 + run_delay: 32651097298436092 + run_delay: 8358680908399640576 + run_delay: 0 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 1342177280 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 32651097298436096 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 0 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 32651097298436096 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 771751936 + run_delay: 0 + run_delay: 0 + run_delay: 0 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 8358680908399640576 + run_delay: 32651097298436092 + run_delay: 8358680908399640576 + run_delay: 0 + connections { + write_size: 0 + write_size: 29696 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 1079 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 4 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 1 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 7 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 7 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 7 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 2 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 7 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 4 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 3 + write_size: 0 + write_size: 0 + write_size: 924613087 + write_size: 0 + write_size: 3 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 2 + } + connections { + write_size: 0 + write_size: 1886680168 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 1006633024 + write_size: 0 + write_size: 0 + write_size: 7 + write_size: 0 + write_size: 0 + write_size: 536870912 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 29696 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 4 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 7 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 4 + } +} diff --git a/test/core/end2end/tests/trailing_metadata.cc b/test/core/end2end/tests/trailing_metadata.cc index 6c9b694852d6e..cfd3f1ecadac5 100644 --- a/test/core/end2end/tests/trailing_metadata.cc +++ b/test/core/end2end/tests/trailing_metadata.cc @@ -27,7 +27,7 @@ namespace grpc_core { namespace { CORE_END2END_TEST(CoreEnd2endTest, TrailingMetadata) { - auto c = NewClientCall("/foo").Timeout(Duration::Seconds(5)).Create(); + auto c = NewClientCall("/foo").Timeout(Duration::Minutes(1)).Create(); CoreEnd2endTest::IncomingStatusOnClient server_status; CoreEnd2endTest::IncomingMetadata server_initial_metadata; CoreEnd2endTest::IncomingMessage server_message; From 0155478ae737a3e66ae01a98a12044cfdf8fd7cf Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Thu, 20 Jul 2023 10:51:23 -0700 Subject: [PATCH 018/205] [test] Increase timeout for ssl_transport_security_test (#33789) This test appears to be timing out more often lately. Example: https://fusion2.corp.google.com/ci/kokoro/prod:grpc%2Fcore%2Fpull_request%2Flinux%2Fbazel_rbe%2Fgrpc_bazel_rbe_ubsan/activity/980ac4a8-da71-4b9b-838e-e9ea235820a1/log --- test/core/tsi/BUILD | 1 + 1 file changed, 1 insertion(+) diff --git a/test/core/tsi/BUILD b/test/core/tsi/BUILD index 4e15dc10c6454..2c2a31ab90c11 100644 --- a/test/core/tsi/BUILD +++ b/test/core/tsi/BUILD @@ -76,6 +76,7 @@ grpc_cc_test( grpc_cc_test( name = "ssl_transport_security_test", + timeout = "long", srcs = ["ssl_transport_security_test.cc"], data = [ "//src/core/tsi/test_creds:badclient.key", From d4cbb7a96d47af4da2262fe27bef91d12aa29164 Mon Sep 17 00:00:00 2001 From: apolcyn Date: Thu, 20 Jul 2023 11:26:02 -0700 Subject: [PATCH 019/205] [ruby] fix crash when prefork/postfork is used without previously using grpc (#33788) Should fix https://github.com/grpc/grpc/issues/33787 --- .../prefork_without_using_grpc_test.rb | 41 +++++++++++++++++++ src/ruby/ext/grpc/rb_grpc.c | 9 ++-- tools/run_tests/run_tests.py | 2 + 3 files changed, 49 insertions(+), 3 deletions(-) create mode 100755 src/ruby/end2end/prefork_without_using_grpc_test.rb diff --git a/src/ruby/end2end/prefork_without_using_grpc_test.rb b/src/ruby/end2end/prefork_without_using_grpc_test.rb new file mode 100755 index 0000000000000..f6791b27ad6fb --- /dev/null +++ b/src/ruby/end2end/prefork_without_using_grpc_test.rb @@ -0,0 +1,41 @@ +#!/usr/bin/env ruby +# +# Copyright 2016 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +ENV['GRPC_ENABLE_FORK_SUPPORT'] = "1" +fail "forking only supported on linux" unless RUBY_PLATFORM =~ /linux/ + +this_dir = File.expand_path(File.dirname(__FILE__)) +protos_lib_dir = File.join(this_dir, 'lib') +grpc_lib_dir = File.join(File.dirname(this_dir), 'lib') +$LOAD_PATH.unshift(grpc_lib_dir) unless $LOAD_PATH.include?(grpc_lib_dir) +$LOAD_PATH.unshift(protos_lib_dir) unless $LOAD_PATH.include?(protos_lib_dir) +$LOAD_PATH.unshift(this_dir) unless $LOAD_PATH.include?(this_dir) + +require 'grpc' +require 'end2end_common' + +def main + with_logging("GRPC.pre_fork") { GRPC.prefork } + pid = fork do + with_logging("child: GRPC.postfork_child") { GRPC.postfork_child } + STDERR.puts "child: done" + end + with_logging("parent: GRPC.postfork_parent") { GRPC.postfork_parent } + Process.wait pid + STDERR.puts "parent: done" +end + +main diff --git a/src/ruby/ext/grpc/rb_grpc.c b/src/ruby/ext/grpc/rb_grpc.c index e6b4df18b79f5..ebc52f3f6a802 100644 --- a/src/ruby/ext/grpc/rb_grpc.c +++ b/src/ruby/ext/grpc/rb_grpc.c @@ -362,9 +362,12 @@ void grpc_ruby_init() { // into the gRPC library during or after prefork has been called, until // the corresponding postfork_{parent,child} APIs have been called. static VALUE grpc_rb_prefork(VALUE self) { - gpr_once_init( - &g_once_init, - grpc_ruby_basic_init); // maybe be the first time called into gRPC + // This might be the first time we've called into the grpc library, so make + // sure basic one-time initialization is taken care of. Note that if this is + // the case, then grpc_init() will start up c-core threads; that's OK since + // they will be shut down in C-core's pthread_atfork handler. + gpr_once_init(&g_once_init, grpc_ruby_basic_init); + grpc_init(); if (!g_enable_fork_support) { rb_raise(rb_eRuntimeError, "forking with gRPC/Ruby is only supported on linux with env var: " diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index b11bf55cdb0b5..47b12f1091748 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -944,6 +944,7 @@ def test_specs(self): for test in [ "src/ruby/end2end/fork_test.rb", "src/ruby/end2end/simple_fork_test.rb", + "src/ruby/end2end/prefork_without_using_grpc_test.rb", "src/ruby/end2end/secure_fork_test.rb", "src/ruby/end2end/bad_usage_fork_test.rb", "src/ruby/end2end/sig_handling_test.rb", @@ -967,6 +968,7 @@ def test_specs(self): "src/ruby/end2end/simple_fork_test.rb", "src/ruby/end2end/secure_fork_test.rb", "src/ruby/end2end/bad_usage_fork_test.rb", + "src/ruby/end2end/prefork_without_using_grpc_test.rb", ]: if platform_string() == "mac": # Skip fork tests on mac, it's only supported on linux. From e399f1d447b3b2e1da0caebc9cb79e54f87283a9 Mon Sep 17 00:00:00 2001 From: Eugene Ostroukhov Date: Thu, 20 Jul 2023 11:26:15 -0700 Subject: [PATCH 020/205] [Build] Update Phusion baseimage (#33767) Fixes b/282107030 I tested this locally by building the images and running some PSM interop tests. --- .../interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client | 4 ++-- .../interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client b/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client index 5cc368bad28ad..9feea3396d696 100644 --- a/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client +++ b/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client @@ -14,7 +14,7 @@ # Dockerfile for building //test/cpp/interop:xds_interop_client -FROM phusion/baseimage:master@sha256:65ea10d5f757e5e86272625f8675d437dd83d8db64bdb429e2354d58f5462750 +FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc RUN apt-get update -y && \ apt-get install -y \ @@ -32,7 +32,7 @@ COPY . . RUN tools/bazel build //test/cpp/interop:xds_interop_client RUN cp -rL /workdir/bazel-bin/test/cpp/interop/xds_interop_client /artifacts/ -FROM phusion/baseimage:master@sha256:65ea10d5f757e5e86272625f8675d437dd83d8db64bdb429e2354d58f5462750 +FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc COPY --from=0 /artifacts ./ ENV GRPC_VERBOSITY="DEBUG" diff --git a/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server b/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server index 1209d0f1c9b7f..83c0e61a40d1a 100644 --- a/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server +++ b/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server @@ -14,7 +14,7 @@ # Dockerfile for building //test/cpp/interop:xds_interop_client -FROM phusion/baseimage:master@sha256:65ea10d5f757e5e86272625f8675d437dd83d8db64bdb429e2354d58f5462750 +FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc RUN apt-get update -y && \ apt-get install -y \ @@ -32,7 +32,7 @@ COPY . . RUN tools/bazel build //test/cpp/interop:xds_interop_server RUN cp -rL /workdir/bazel-bin/test/cpp/interop/xds_interop_server /artifacts/ -FROM phusion/baseimage:master@sha256:65ea10d5f757e5e86272625f8675d437dd83d8db64bdb429e2354d58f5462750 +FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc COPY --from=0 /artifacts ./ ENV GRPC_VERBOSITY="DEBUG" From 801f106992596d1154751f053033b0f90011afae Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 20 Jul 2023 12:54:26 -0700 Subject: [PATCH 021/205] [promises] Add logging_test to promise_based_server_call testing (#33774) --- bazel/experiments.bzl | 3 +++ src/core/lib/experiments/experiments.yaml | 2 +- test/cpp/ext/filters/logging/BUILD | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bazel/experiments.bzl b/bazel/experiments.bzl index 244ac830a4941..a5c78363eb2b4 100644 --- a/bazel/experiments.bzl +++ b/bazel/experiments.bzl @@ -52,6 +52,9 @@ EXPERIMENTS = { "lame_client_test": [ "promise_based_client_call", ], + "logging_test": [ + "promise_based_server_call", + ], "resource_quota_test": [ "free_large_allocator", "memory_pressure_controller", diff --git a/src/core/lib/experiments/experiments.yaml b/src/core/lib/experiments/experiments.yaml index a8051ee067fa4..9c5a6121f905b 100644 --- a/src/core/lib/experiments/experiments.yaml +++ b/src/core/lib/experiments/experiments.yaml @@ -93,7 +93,7 @@ (ie when all filters in a stack are promise based) expiry: 2023/11/01 owner: ctiller@google.com - test_tags: ["core_end2end_test", "cpp_end2end_test", "xds_end2end_test"] + test_tags: ["core_end2end_test", "cpp_end2end_test", "xds_end2end_test", "logging_test"] - name: transport_supplies_client_latency description: If set, use the transport represented value for client latency in opencensus expiry: 2023/09/01 diff --git a/test/cpp/ext/filters/logging/BUILD b/test/cpp/ext/filters/logging/BUILD index 46bcb460fdf3f..6ca2bb8961628 100644 --- a/test/cpp/ext/filters/logging/BUILD +++ b/test/cpp/ext/filters/logging/BUILD @@ -51,6 +51,7 @@ grpc_cc_test( ], language = "C++", tags = [ + "logging_test", "no_mac", # TODO(yashykt): The default stack-sizes are not enough to run this test on MacOS ], deps = [ @@ -76,6 +77,7 @@ grpc_cc_test( ], language = "C++", tags = [ + "logging_test", "no_mac", # TODO(yashykt): The default stack-sizes are not enough to run this test on MacOS ], deps = [ From 3d9f2d8f77a65fe803035580a6f8786f0cb0db77 Mon Sep 17 00:00:00 2001 From: apolcyn Date: Thu, 20 Jul 2023 13:47:13 -0700 Subject: [PATCH 022/205] [ruby] improve possible error message in postfork parent (#33791) The case of `!grpc_ruby_initial_pid()` can be a *cause* of the second case, `!grpc_ruby_initial_thread`, so check the pid first. --- src/ruby/ext/grpc/rb_grpc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ruby/ext/grpc/rb_grpc.c b/src/ruby/ext/grpc/rb_grpc.c index ebc52f3f6a802..30281b54630ae 100644 --- a/src/ruby/ext/grpc/rb_grpc.c +++ b/src/ruby/ext/grpc/rb_grpc.c @@ -429,16 +429,16 @@ static VALUE grpc_rb_postfork_parent(VALUE self) { "GRPC::postfork_parent can only be called once following a " "GRPC::prefork"); } - if (!grpc_ruby_initial_thread()) { - rb_raise(rb_eRuntimeError, - "GRPC.postfork_parent needs to be called from the same thread " - "that GRPC.prefork (and fork) was called from"); - } if (!grpc_ruby_initial_pid()) { rb_raise(rb_eRuntimeError, "GRPC.postfork_parent must be called only from the parent process " "after a fork"); } + if (!grpc_ruby_initial_thread()) { + rb_raise(rb_eRuntimeError, + "GRPC.postfork_parent needs to be called from the same thread " + "that GRPC.prefork (and fork) was called from"); + } grpc_ruby_init_threads(); g_grpc_rb_prefork_pending = false; return Qnil; From ef770e584820e1b68ac29a7fcc8cac405f9cdb15 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 20 Jul 2023 16:29:22 -0700 Subject: [PATCH 023/205] [promises] Promise based filter needs to set context before finalization (#33790) --- src/core/lib/channel/promise_based_filter.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/lib/channel/promise_based_filter.h b/src/core/lib/channel/promise_based_filter.h index fdacc6be0cce6..23181395da7b8 100644 --- a/src/core/lib/channel/promise_based_filter.h +++ b/src/core/lib/channel/promise_based_filter.h @@ -188,6 +188,7 @@ class BaseCallData : public Activity, private Wakeable { std::string ActivityDebugTag(WakeupMask) const override { return DebugTag(); } void Finalize(const grpc_call_final_info* final_info) { + ScopedContext ctx(this); finalization_.Run(final_info); } From abdeffc4af8bfa5889a872c99e863dca76aca439 Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Thu, 20 Jul 2023 17:00:35 -0700 Subject: [PATCH 024/205] [test] Run PHP distribtests with -j 2 instead of 4 (#33795) We are seeing `g++: fatal error: Killed signal terminated program cc1plus` on PHP distribtest builds. In case it's an OOM, let's try reducing the build parallelism to see if it helps. --- tools/internal_ci/linux/grpc_distribtests_php.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/internal_ci/linux/grpc_distribtests_php.sh b/tools/internal_ci/linux/grpc_distribtests_php.sh index 9fd5ade49d79f..76c6abfa3e9b4 100755 --- a/tools/internal_ci/linux/grpc_distribtests_php.sh +++ b/tools/internal_ci/linux/grpc_distribtests_php.sh @@ -24,7 +24,7 @@ cd $(dirname $0)/../../.. source tools/internal_ci/helper_scripts/prepare_build_linux_rc # Build all PHP linux artifacts -tools/run_tests/task_runner.py -f artifact linux php ${TASK_RUNNER_EXTRA_FILTERS} -j 4 -x build_artifacts/sponge_log.xml || FAILED="true" +tools/run_tests/task_runner.py -f artifact linux php ${TASK_RUNNER_EXTRA_FILTERS} -j 2 -x build_artifacts/sponge_log.xml || FAILED="true" # the next step expects to find the artifacts from the previous step in the "input_artifacts" folder. rm -rf input_artifacts @@ -44,7 +44,7 @@ cp -r artifacts/* input_artifacts/ || true # Run all PHP linux distribtests # We run the distribtests even if some of the artifacts have failed to build, since that gives # a better signal about which distribtest are affected by the currently broken artifact builds. -tools/run_tests/task_runner.py -f distribtest linux php ${TASK_RUNNER_EXTRA_FILTERS} -j 4 -x distribtests/sponge_log.xml || FAILED="true" +tools/run_tests/task_runner.py -f distribtest linux php ${TASK_RUNNER_EXTRA_FILTERS} -j 2 -x distribtests/sponge_log.xml || FAILED="true" tools/internal_ci/helper_scripts/store_artifacts_from_moved_src_tree.sh From 19ca737da631700669a14dd87c4a987e899351b9 Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Thu, 20 Jul 2023 20:54:48 -0700 Subject: [PATCH 025/205] [Release] Bump core version to 34.0.0 for upcoming release (#33800) Change was created by the release automation script. See go/grpc-release --- BUILD | 2 +- CMakeLists.txt | 4 ++-- Makefile | 24 ++++++++++++------------ build_config.rb | 2 +- build_handwritten.yaml | 2 +- src/core/lib/surface/version.cc | 2 +- src/objective-c/tests/version.h | 2 +- tools/doxygen/Doxyfile.core | 2 +- tools/doxygen/Doxyfile.core.internal | 2 +- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/BUILD b/BUILD index 3ad0906925618..fd9b69007cbfc 100644 --- a/BUILD +++ b/BUILD @@ -213,7 +213,7 @@ python_config_settings() # This should be updated along with build_handwritten.yaml g_stands_for = "grounded" # @unused -core_version = "33.0.0" # @unused +core_version = "34.0.0" # @unused version = "1.57.0-dev" # @unused diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c2d9099b06b5..ee3538afcc6de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,8 +26,8 @@ cmake_minimum_required(VERSION 3.8) set(PACKAGE_NAME "grpc") set(PACKAGE_VERSION "1.57.0-dev") -set(gRPC_CORE_VERSION "33.0.0") -set(gRPC_CORE_SOVERSION "33") +set(gRPC_CORE_VERSION "34.0.0") +set(gRPC_CORE_SOVERSION "34") set(gRPC_CPP_VERSION "1.57.0-dev") set(gRPC_CPP_SOVERSION "1.57") set(gRPC_CSHARP_VERSION "2.57.0-dev") diff --git a/Makefile b/Makefile index 2d51656900209..5094236d47e20 100644 --- a/Makefile +++ b/Makefile @@ -410,7 +410,7 @@ E = @echo Q = @ endif -CORE_VERSION = 33.0.0 +CORE_VERSION = 34.0.0 CPP_VERSION = 1.57.0-dev CSHARP_VERSION = 2.57.0-dev @@ -448,7 +448,7 @@ SHARED_EXT_CORE = dll SHARED_EXT_CPP = dll SHARED_EXT_CSHARP = dll SHARED_PREFIX = -SHARED_VERSION_CORE = -33 +SHARED_VERSION_CORE = -34 SHARED_VERSION_CPP = -1 SHARED_VERSION_CSHARP = -2 else ifeq ($(SYSTEM),Darwin) @@ -826,8 +826,8 @@ $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): ifeq ($(SYSTEM),Darwin) $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBADDRESS_SORTING_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libaddress_sorting.so.33 -o $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBADDRESS_SORTING_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).so.33 + $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libaddress_sorting.so.34 -o $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBADDRESS_SORTING_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).so.34 $(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).so endif endif @@ -948,8 +948,8 @@ $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBGPR_OB ifeq ($(SYSTEM),Darwin) $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgpr.so.33 -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so.33 + $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgpr.so.34 -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so.34 $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so endif endif @@ -1838,8 +1838,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBGRPC_ ifeq ($(SYSTEM),Darwin) $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(LIBDIR)/$(CONFIG)/libupb.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.33 -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(LIBDIR)/$(CONFIG)/libupb.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so.33 + $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.34 -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(LIBDIR)/$(CONFIG)/libupb.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so.34 $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so endif endif @@ -2327,8 +2327,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $ ifeq ($(SYSTEM),Darwin) $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(LIBDIR)/$(CONFIG)/libupb.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_unsecure.so.33 -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(LIBDIR)/$(CONFIG)/libupb.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so.33 + $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_unsecure.so.34 -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(LIBDIR)/$(CONFIG)/libupb.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so.34 $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so endif endif @@ -2756,8 +2756,8 @@ $(LIBDIR)/$(CONFIG)/libupb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBUPB_OB ifeq ($(SYSTEM),Darwin) $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)upb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libupb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBUPB_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libupb.so.33 -o $(LIBDIR)/$(CONFIG)/libupb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBUPB_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)upb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libupb$(SHARED_VERSION_CORE).so.33 + $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libupb.so.34 -o $(LIBDIR)/$(CONFIG)/libupb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBUPB_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)upb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libupb$(SHARED_VERSION_CORE).so.34 $(Q) ln -sf $(SHARED_PREFIX)upb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libupb$(SHARED_VERSION_CORE).so endif endif diff --git a/build_config.rb b/build_config.rb index b05432e364fe4..2c1092220d8f7 100644 --- a/build_config.rb +++ b/build_config.rb @@ -13,5 +13,5 @@ # limitations under the License. module GrpcBuildConfig - CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-33.dll' + CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-34.dll' end diff --git a/build_handwritten.yaml b/build_handwritten.yaml index 603f55c9ed04b..feb2217025467 100644 --- a/build_handwritten.yaml +++ b/build_handwritten.yaml @@ -12,7 +12,7 @@ settings: '#08': Use "-preN" suffixes to identify pre-release versions '#09': Per-language overrides are possible with (eg) ruby_version tag here '#10': See the expand_version.py for all the quirks here - core_version: 33.0.0 + core_version: 34.0.0 csharp_major_version: 2 g_stands_for: grounded protobuf_version: 3.23.4 diff --git a/src/core/lib/surface/version.cc b/src/core/lib/surface/version.cc index 2f13f20c4473f..76fe1318a444f 100644 --- a/src/core/lib/surface/version.cc +++ b/src/core/lib/surface/version.cc @@ -23,6 +23,6 @@ #include -const char* grpc_version_string(void) { return "33.0.0"; } +const char* grpc_version_string(void) { return "34.0.0"; } const char* grpc_g_stands_for(void) { return "grounded"; } diff --git a/src/objective-c/tests/version.h b/src/objective-c/tests/version.h index 894fc89a98bf1..b48bc82a19048 100644 --- a/src/objective-c/tests/version.h +++ b/src/objective-c/tests/version.h @@ -23,4 +23,4 @@ // `tools/buildgen/generate_projects.sh`. #define GRPC_OBJC_VERSION_STRING @"1.57.0-dev" -#define GRPC_C_VERSION_STRING @"33.0.0" +#define GRPC_C_VERSION_STRING @"34.0.0" diff --git a/tools/doxygen/Doxyfile.core b/tools/doxygen/Doxyfile.core index a7e09014fc242..41008ce4415a8 100644 --- a/tools/doxygen/Doxyfile.core +++ b/tools/doxygen/Doxyfile.core @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 33.0.0 +PROJECT_NUMBER = 34.0.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 7a3e69a4d73ca..2eae3f09ed2bc 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 33.0.0 +PROJECT_NUMBER = 34.0.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a From 20cd331e557f61b4ec75ffd82fc55fcb91d1a94c Mon Sep 17 00:00:00 2001 From: Hannah Shi Date: Thu, 20 Jul 2023 21:07:18 -0700 Subject: [PATCH 026/205] [ObjC] address review comments in #33590 (#33747) follow up from #33590 --- tools/internal_ci/macos/grpc_objc_bazel_test.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/internal_ci/macos/grpc_objc_bazel_test.sh b/tools/internal_ci/macos/grpc_objc_bazel_test.sh index 7b5ca0c421a5b..3ed4556dd9987 100644 --- a/tools/internal_ci/macos/grpc_objc_bazel_test.sh +++ b/tools/internal_ci/macos/grpc_objc_bazel_test.sh @@ -122,16 +122,13 @@ objc_bazel_tests/bazel_wrapper \ # Enable event engine and run tests again. -TEST_TARGETS=( +EVENT_ENGINE_TEST_TARGETS=( //src/objective-c/tests:InteropTestsLocalCleartext //src/objective-c/tests:InteropTestsLocalSSL //src/objective-c/tests:InteropTestsRemote //src/objective-c/tests:MacTests //src/objective-c/tests:UnitTests //src/objective-c/tests:tvtests_build_test - # codegen plugin tests - //src/objective-c/tests:objc_codegen_plugin_test - //src/objective-c/tests:objc_codegen_plugin_option_test ) python3 tools/run_tests/python_utils/bazel_report_helper.py --report_path objc_event_engine_bazel_tests @@ -148,4 +145,4 @@ objc_event_engine_bazel_tests/bazel_wrapper \ "${OBJC_TEST_ENV_ARGS[@]}" \ -- \ "${EXAMPLE_TARGETS[@]}" \ - "${TEST_TARGETS[@]}" + "${EVENT_ENGINE_TEST_TARGETS[@]}" From 19414da96d6235226c41063d607dfef2c7210df1 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 21 Jul 2023 16:28:04 +0200 Subject: [PATCH 027/205] [bazel rbe] RBE config: update names of some deprecated bazel option flags (#33759) just a bit of cleanup --- tools/remote_build/include/rbe_base_config.bazelrc | 6 ++---- tools/remote_build/include/rbe_remote_execution.bazelrc | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tools/remote_build/include/rbe_base_config.bazelrc b/tools/remote_build/include/rbe_base_config.bazelrc index 1333ab3eb2da4..a7fc8c152b5e6 100644 --- a/tools/remote_build/include/rbe_base_config.bazelrc +++ b/tools/remote_build/include/rbe_base_config.bazelrc @@ -27,8 +27,7 @@ build --remote_instance_name=projects/grpc-testing/instances/default_instance # unless overridden by --google_credentials=service_account_credentials.json # How to setup credentials to be able to use bazel RBE locally: # https://cloud.google.com/remote-build-execution/docs/results-ui/getting-started-results-ui -# TODO(jtattermusch): Option 'auth_enabled' is deprecated: Use --google_default_credentials instead -build --auth_enabled=true +build --google_default_credentials # use remote cache (remote execution needs to be configured separately) # Note that remote cache is needed @@ -41,5 +40,4 @@ build --remote_cache=grpcs://remotebuildexecution.googleapis.com build --bes_backend=grpcs://buildeventservice.googleapis.com build --bes_timeout=600s build --bes_results_url="https://source.cloud.google.com/results/invocations/" -# TODO(jtattermusch): Option 'project_id' is deprecated: Use --bes_instance_name instead -build --project_id=grpc-testing +build --bes_instance_name=grpc-testing diff --git a/tools/remote_build/include/rbe_remote_execution.bazelrc b/tools/remote_build/include/rbe_remote_execution.bazelrc index cbb091b3e8a2b..cab072225a010 100644 --- a/tools/remote_build/include/rbe_remote_execution.bazelrc +++ b/tools/remote_build/include/rbe_remote_execution.bazelrc @@ -30,8 +30,7 @@ build --remote_timeout=7200 # very large value to avoid problems like https://g # and port server won't be available. build --define GRPC_PORT_ISOLATED_RUNTIME=1 -# TODO(jtattermusch): is this still required for remote execution to work? -# TODO(jtattermusch): Option 'experimental_strict_action_env' is deprecated: Use --incompatible_strict_action_env instead -build --experimental_strict_action_env=true +# Prevents host environment variables from leaking into Bazel actions and ensures that the remote cache is shared across machines +build --incompatible_strict_action_env=true # TODO(jtattermusch): is this still required for remote execution to work? build --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 From 112421760a7417d219c89deb97df09e0bdea6e29 Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Fri, 21 Jul 2023 09:25:47 -0700 Subject: [PATCH 028/205] [EventEngine] Eliminate busy loop in the work stealing lifeguard's shutdown (#33386) Co-authored-by: drfloob --- src/core/BUILD | 1 + .../thread_pool/work_stealing_thread_pool.cc | 85 ++++++++++++++----- .../thread_pool/work_stealing_thread_pool.h | 11 +-- test/core/event_engine/BUILD | 1 + test/core/event_engine/thread_pool_test.cc | 37 ++++++++ 5 files changed, 108 insertions(+), 27 deletions(-) diff --git a/src/core/BUILD b/src/core/BUILD index f4f043119667b..34736a7a53f6d 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -1510,6 +1510,7 @@ grpc_cc_library( "event_engine_work_queue", "experiments", "forkable", + "notification", "time", "useful", "//:backoff", diff --git a/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc b/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc index 89b34d919cd34..29eefb2facfd2 100644 --- a/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +++ b/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc @@ -23,7 +23,6 @@ #include #include -#include #include #include @@ -39,10 +38,50 @@ #include "src/core/lib/event_engine/trace.h" #include "src/core/lib/event_engine/work_queue/basic_work_queue.h" #include "src/core/lib/event_engine/work_queue/work_queue.h" -#include "src/core/lib/gpr/time_precise.h" #include "src/core/lib/gprpp/thd.h" #include "src/core/lib/gprpp/time.h" +// ## Thread Pool Fork-handling +// +// Thread-safety needs special attention with regard to fork() calls. The +// Forkable system employs a pre- and post- fork callback system that does not +// guarantee any ordering of execution. On fork() events, the thread pool does +// the following: +// +// On pre-fork: +// * the WorkStealingThreadPool triggers all threads to exit, +// * all queued work is saved, and +// * all threads will are down, including the Lifeguard thread. +// +// On post-fork: +// * all threads are restarted, including the Lifeguard thread, and +// * all previously-saved work is enqueued for execution. +// +// However, the queue may may get into trouble if one thread is attempting to +// restart the thread pool while another thread is shutting it down. For that +// reason, Quiesce and Start must be thread-safe, and Quiesce must wait for the +// pool to be in a fully started state before it is allowed to continue. +// Consider this potential ordering of events between Start and Quiesce: +// +// ┌──────────┐ +// │ Thread 1 │ +// └────┬─────┘ ┌──────────┐ +// │ │ Thread 2 │ +// ▼ └────┬─────┘ +// Start() │ +// │ ▼ +// │ Quiesce() +// │ Wait for worker threads to exit +// │ Wait for the lifeguard thread to exit +// ▼ +// Start the Lifeguard thread +// Start the worker threads +// +// Thread 2 will find no worker threads, and it will then want to wait on a +// non-existent Lifeguard thread to finish. Trying a simple +// `lifeguard_thread_.Join()` leads to memory access errors. This implementation +// uses Notifications to coordinate startup and shutdown states. + namespace grpc_event_engine { namespace experimental { @@ -169,16 +208,13 @@ void WorkStealingThreadPool::WorkStealingThreadPoolImpl::Quiesce() { // Note that if this is a threadpool thread then we won't exit this thread // until all other threads have exited, so we need to wait for just one thread // running instead of zero. - gpr_cycle_counter start_time = gpr_get_cycle_counter(); bool is_threadpool_thread = g_local_queue != nullptr; thread_count()->BlockUntilThreadCount(CounterType::kLivingThreadCount, is_threadpool_thread ? 1 : 0, "shutting down", work_signal()); GPR_ASSERT(queue_.Empty()); quiesced_.store(true, std::memory_order_relaxed); - lifeguard_.BlockUntilShutdown(); - GRPC_EVENT_ENGINE_TRACE("%ld cycles spent quiescing the pool", - std::lround(gpr_get_cycle_counter() - start_time)); + lifeguard_.BlockUntilShutdownAndReset(); } bool WorkStealingThreadPool::WorkStealingThreadPoolImpl::SetThrottled( @@ -215,7 +251,7 @@ void WorkStealingThreadPool::WorkStealingThreadPoolImpl::PrepareFork() { SetForking(true); thread_count()->BlockUntilThreadCount(CounterType::kLivingThreadCount, 0, "forking", &work_signal_); - lifeguard_.BlockUntilShutdown(); + lifeguard_.BlockUntilShutdownAndReset(); } void WorkStealingThreadPool::WorkStealingThreadPoolImpl::Postfork() { @@ -231,13 +267,14 @@ WorkStealingThreadPool::WorkStealingThreadPoolImpl::Lifeguard::Lifeguard( backoff_(grpc_core::BackOff::Options() .set_initial_backoff(kLifeguardMinSleepBetweenChecks) .set_max_backoff(kLifeguardMaxSleepBetweenChecks) - .set_multiplier(1.3)) {} + .set_multiplier(1.3)), + lifeguard_should_shut_down_(std::make_unique()), + lifeguard_is_shut_down_(std::make_unique()) {} void WorkStealingThreadPool::WorkStealingThreadPoolImpl::Lifeguard::Start() { // lifeguard_running_ is set early to avoid a quiesce race while the // lifeguard is still starting up. - grpc_core::MutexLock lock(&lifeguard_shutdown_mu_); - lifeguard_running_ = true; + lifeguard_running_.store(true); grpc_core::Thread( "lifeguard", [](void* arg) { @@ -251,7 +288,6 @@ void WorkStealingThreadPool::WorkStealingThreadPoolImpl::Lifeguard::Start() { void WorkStealingThreadPool::WorkStealingThreadPoolImpl::Lifeguard:: LifeguardMain() { - grpc_core::MutexLock lock(&lifeguard_shutdown_mu_); while (true) { if (pool_->IsForking()) break; // If the pool is shut down, loop quickly until quiesced. Otherwise, @@ -259,29 +295,33 @@ void WorkStealingThreadPool::WorkStealingThreadPoolImpl::Lifeguard:: if (pool_->IsShutdown()) { if (pool_->IsQuiesced()) break; } else { - lifeguard_shutdown_cv_.WaitWithTimeout( - &lifeguard_shutdown_mu_, + lifeguard_should_shut_down_->WaitForNotificationWithTimeout( absl::Milliseconds( (backoff_.NextAttemptTime() - grpc_core::Timestamp::Now()) .millis())); } MaybeStartNewThread(); } - lifeguard_running_ = false; - lifeguard_shutdown_cv_.Signal(); + lifeguard_running_.store(false, std::memory_order_relaxed); + lifeguard_is_shut_down_->Notify(); } void WorkStealingThreadPool::WorkStealingThreadPoolImpl::Lifeguard:: - BlockUntilShutdown() { - grpc_core::MutexLock lock(&lifeguard_shutdown_mu_); - while (lifeguard_running_) { - lifeguard_shutdown_cv_.Signal(); - lifeguard_shutdown_cv_.WaitWithTimeout( - &lifeguard_shutdown_mu_, absl::Seconds(kBlockingQuiesceLogRateSeconds)); + BlockUntilShutdownAndReset() { + lifeguard_should_shut_down_->Notify(); + while (lifeguard_running_.load(std::memory_order_relaxed)) { GRPC_LOG_EVERY_N_SEC_DELAYED(kBlockingQuiesceLogRateSeconds, GPR_DEBUG, "%s", "Waiting for lifeguard thread to shut down"); + lifeguard_is_shut_down_->WaitForNotification(); } + // Do an additional wait in case this method races with LifeguardMain's + // shutdown. This should return immediately if the lifeguard is already shut + // down. + lifeguard_is_shut_down_->WaitForNotification(); + backoff_.Reset(); + lifeguard_should_shut_down_ = std::make_unique(); + lifeguard_is_shut_down_ = std::make_unique(); } void WorkStealingThreadPool::WorkStealingThreadPoolImpl::Lifeguard:: @@ -406,6 +446,7 @@ bool WorkStealingThreadPool::ThreadState::Step() { if (pool_->IsShutdown()) break; bool timed_out = pool_->work_signal()->WaitWithTimeout( backoff_.NextAttemptTime() - grpc_core::Timestamp::Now()); + if (pool_->IsForking() || pool_->IsShutdown()) break; // Quit a thread if the pool has more than it requires, and this thread // has been idle long enough. if (timed_out && @@ -472,6 +513,7 @@ void WorkStealingThreadPool::ThreadCount::BlockUntilThreadCount( CounterType counter_type, size_t desired_threads, const char* why, WorkSignal* work_signal) { // Wait for all threads to exit. + work_signal->SignalAll(); while (true) { auto curr_threads = WaitForCountChange( counter_type, desired_threads, @@ -482,7 +524,6 @@ void WorkStealingThreadPool::ThreadCount::BlockUntilThreadCount( "Waiting for thread pool to idle before %s. (%" PRIdPTR " to %" PRIdPTR ")", why, curr_threads, desired_threads); - work_signal->SignalAll(); } } diff --git a/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h b/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h index 9f933eb563bd4..96afc8ab5404c 100644 --- a/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h +++ b/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h @@ -36,6 +36,7 @@ #include "src/core/lib/event_engine/thread_pool/thread_pool.h" #include "src/core/lib/event_engine/work_queue/basic_work_queue.h" #include "src/core/lib/event_engine/work_queue/work_queue.h" +#include "src/core/lib/gprpp/notification.h" #include "src/core/lib/gprpp/sync.h" #include "src/core/lib/gprpp/time.h" @@ -202,7 +203,8 @@ class WorkStealingThreadPool final : public ThreadPool { // Start the lifeguard thread. void Start(); // Block until the lifeguard thread is shut down. - void BlockUntilShutdown(); + // Afterwards, reset the lifeguard state so it can start again cleanly. + void BlockUntilShutdownAndReset(); private: // The main body of the lifeguard thread. @@ -213,10 +215,9 @@ class WorkStealingThreadPool final : public ThreadPool { WorkStealingThreadPoolImpl* pool_; grpc_core::BackOff backoff_; // Used for signaling that the lifeguard thread has stopped running. - grpc_core::Mutex lifeguard_shutdown_mu_; - bool lifeguard_running_ ABSL_GUARDED_BY(lifeguard_shutdown_mu_) = false; - grpc_core::CondVar lifeguard_shutdown_cv_ - ABSL_GUARDED_BY(lifeguard_shutdown_mu_); + std::unique_ptr lifeguard_should_shut_down_; + std::unique_ptr lifeguard_is_shut_down_; + std::atomic lifeguard_running_{false}; }; const size_t reserve_threads_; diff --git a/test/core/event_engine/BUILD b/test/core/event_engine/BUILD index 8131aa5d7a209..e2a3d99262619 100644 --- a/test/core/event_engine/BUILD +++ b/test/core/event_engine/BUILD @@ -58,6 +58,7 @@ grpc_cc_test( "gtest", ], deps = [ + "//:gpr", "//:grpc", "//src/core:event_engine_thread_pool", "//src/core:notification", diff --git a/test/core/event_engine/thread_pool_test.cc b/test/core/event_engine/thread_pool_test.cc index 91879b8bf0793..8aa86c14a8f20 100644 --- a/test/core/event_engine/thread_pool_test.cc +++ b/test/core/event_engine/thread_pool_test.cc @@ -29,6 +29,7 @@ #include "src/core/lib/event_engine/thread_pool/original_thread_pool.h" #include "src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h" #include "src/core/lib/gprpp/notification.h" +#include "src/core/lib/gprpp/thd.h" #include "test/core/util/test_config.h" namespace grpc_event_engine { @@ -132,6 +133,42 @@ TYPED_TEST(ThreadPoolTest, ForkStressTest) { pool.Quiesce(); } +TYPED_TEST(ThreadPoolTest, StartQuiesceRaceStressTest) { + // Repeatedly race Start and Quiesce against each other to ensure thread + // safety. + constexpr int iter_count = 500; + struct ThdState { + std::unique_ptr pool; + int i; + }; + for (int i = 0; i < iter_count; i++) { + ThdState state{std::make_unique(8), i}; + state.pool->PrepareFork(); + grpc_core::Thread t1( + "t1", + [](void* arg) { + ThdState* state = static_cast(arg); + state->i % 2 == 0 ? state->pool->Quiesce() + : state->pool->PostforkParent(); + }, + &state, nullptr, + grpc_core::Thread::Options().set_tracked(false).set_joinable(true)); + grpc_core::Thread t2( + "t2", + [](void* arg) { + ThdState* state = static_cast(arg); + state->i % 2 == 1 ? state->pool->Quiesce() + : state->pool->PostforkParent(); + }, + &state, nullptr, + grpc_core::Thread::Options().set_tracked(false).set_joinable(true)); + t1.Start(); + t2.Start(); + t1.Join(); + t2.Join(); + } +} + void ScheduleSelf(ThreadPool* p) { p->Run([p] { ScheduleSelf(p); }); } From 3e2acbd947994fbeb9ec4f4140ae228dd48495e8 Mon Sep 17 00:00:00 2001 From: Sergii Tkachenko Date: Fri, 21 Jul 2023 12:44:07 -0400 Subject: [PATCH 029/205] [PSM Interop] Legacy tests: fix xDS test client build (#33796) https://github.com/grpc/grpc/pull/33699 incorrectly changed the legacy builds to not just use the test driver from the master, but also to build from it. This PR fixes the issue, and also updates the python job to work use the driver from master. --- .../linux/grpc_xds_bazel_python_test_in_docker.sh | 9 ++++----- tools/internal_ci/linux/grpc_xds_bazel_test_in_docker.sh | 3 ++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/internal_ci/linux/grpc_xds_bazel_python_test_in_docker.sh b/tools/internal_ci/linux/grpc_xds_bazel_python_test_in_docker.sh index d692c5611e489..f3eefec5833eb 100755 --- a/tools/internal_ci/linux/grpc_xds_bazel_python_test_in_docker.sh +++ b/tools/internal_ci/linux/grpc_xds_bazel_python_test_in_docker.sh @@ -16,11 +16,9 @@ trap 'date' DEBUG set -ex -o igncr || set -ex + mkdir -p /var/local/git -git clone /var/local/jenkins/grpc /var/local/git/grpc -(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \ -&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ -${name}') +git clone -b master --single-branch --depth=1 https://github.com/grpc/grpc.git /var/local/git/grpc cd /var/local/git/grpc python3 -m pip install virtualenv @@ -62,13 +60,14 @@ touch "$TOOLS_DIR"/src/proto/grpc/health/v1/__init__.py --grpc_python_out=${TOOLS_DIR} \ ${HEALTH_PROTO_SOURCE_DIR}/health.proto +cd /var/local/jenkins/grpc/ bazel build //src/python/grpcio_tests/tests_py3_only/interop:xds_interop_client # Test cases "path_matching" and "header_matching" are not included in "all", # because not all interop clients in all languages support these new tests. export PYTHONUNBUFFERED=true GRPC_VERBOSITY=debug GRPC_TRACE=xds_client,xds_resolver,xds_cluster_manager_lb,cds_lb,xds_cluster_resolver_lb,priority_lb,xds_cluster_impl_lb,weighted_target_lb "$PYTHON" \ - tools/run_tests/run_xds_tests.py \ + /var/local/git/grpc/tools/run_tests/run_xds_tests.py \ --halt_after_fail \ --test_case="ping_pong,circuit_breaking" \ --project_id=grpc-testing \ diff --git a/tools/internal_ci/linux/grpc_xds_bazel_test_in_docker.sh b/tools/internal_ci/linux/grpc_xds_bazel_test_in_docker.sh index 90b90a3f8a3b4..cd820579bdf38 100755 --- a/tools/internal_ci/linux/grpc_xds_bazel_test_in_docker.sh +++ b/tools/internal_ci/linux/grpc_xds_bazel_test_in_docker.sh @@ -59,6 +59,7 @@ touch "$TOOLS_DIR"/src/proto/grpc/health/v1/__init__.py --grpc_python_out=${TOOLS_DIR} \ ${HEALTH_PROTO_SOURCE_DIR}/health.proto +cd /var/local/jenkins/grpc/ bazel build test/cpp/interop:xds_interop_client # Test cases "path_matching" and "header_matching" are not included in "all", @@ -67,7 +68,7 @@ bazel build test/cpp/interop:xds_interop_client # TODO: remove "path_matching" and "header_matching" from --test_case after # they are added into "all". GRPC_VERBOSITY=debug GRPC_TRACE=xds_client,xds_resolver,xds_cluster_manager_lb,cds_lb,xds_cluster_resolver_lb,priority_lb,xds_cluster_impl_lb,weighted_target_lb "$PYTHON" \ - tools/run_tests/run_xds_tests.py \ + /var/local/git/grpc/tools/run_tests/run_xds_tests.py \ --halt_after_fail \ --test_case="ping_pong,circuit_breaking" \ --project_id=grpc-testing \ From 04a7b80e98e6ba2b6dbb739e2339e9d8b0a81b64 Mon Sep 17 00:00:00 2001 From: sanjaypujare Date: Fri, 21 Jul 2023 11:30:50 -0700 Subject: [PATCH 030/205] [PSM Interop] used fixed names like latest, oldest to maintain history (#33794) Co-authored-by: Sergii Tkachenko --- tools/internal_ci/linux/grpc_xds_k8s_run_xtest.sh | 11 +++++++---- tools/internal_ci/linux/grpc_xds_k8s_xbranch.sh | 8 ++++---- tools/internal_ci/linux/grpc_xds_k8s_xlang.sh | 4 +++- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/tools/internal_ci/linux/grpc_xds_k8s_run_xtest.sh b/tools/internal_ci/linux/grpc_xds_k8s_run_xtest.sh index 03dff0e75578a..6f2a1c926148b 100755 --- a/tools/internal_ci/linux/grpc_xds_k8s_run_xtest.sh +++ b/tools/internal_ci/linux/grpc_xds_k8s_run_xtest.sh @@ -64,8 +64,8 @@ find_oldest_branch() { # Test xUnit report to ${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml ####################################### run_test() { - if [ "$#" -ne 4 ]; then - echo "Usage: run_test client_lang client_branch server_lang server_branch" >&2 + if [ "$#" -ne 6 ]; then + echo "Usage: run_test client_lang client_branch server_lang server_branch cl-branch-fixed srv-branch-fixed" >&2 exit 1 fi # Test driver usage: @@ -74,6 +74,8 @@ run_test() { local client_branch="$2" local server_lang="$3" local server_branch="$4" + local client_branch_fixed="$5" + local server_branch_fixed="$6" local server_image_name="${IMAGE_REPO}/${server_lang}-server" local client_image_name="${IMAGE_REPO}/${client_lang}-client" @@ -87,9 +89,10 @@ run_test() { local server_image_name_tag="${server_image_name}:${server_branch}" local client_image_name_tag="${client_image_name}:${client_branch}" - local out_dir="${TEST_XML_OUTPUT_DIR}/${client_branch}-${server_branch}/${client_lang}-${server_lang}" + local out_dir="${TEST_XML_OUTPUT_DIR}/${client_branch_fixed}-${server_branch_fixed}/${client_lang}-${server_lang}" mkdir -pv "${out_dir}" set -x + echo "Client branch='${client_branch}', Server branch='${server_branch}'" > ${out_dir}/sponge_log.log python -m "tests.security_test" \ --flagfile="${TEST_DRIVER_FLAGFILE}" \ --kube_context="${KUBE_CONTEXT}" \ @@ -101,5 +104,5 @@ run_test() { --collect_app_logs \ --log_dir="${out_dir}" \ --xml_output_file="${out_dir}/sponge_log.xml" \ - |& tee "${out_dir}/sponge_log.log" + |& tee -a "${out_dir}/sponge_log.log" } diff --git a/tools/internal_ci/linux/grpc_xds_k8s_xbranch.sh b/tools/internal_ci/linux/grpc_xds_k8s_xbranch.sh index 1eb6d713ed247..09204d88edb72 100644 --- a/tools/internal_ci/linux/grpc_xds_k8s_xbranch.sh +++ b/tools/internal_ci/linux/grpc_xds_k8s_xbranch.sh @@ -75,25 +75,25 @@ main() { # Run cross branch tests per language: master x latest and master x oldest for LANG in ${LANGS} do - if run_test "${LANG}" "${MAIN_BRANCH}" "${LANG}" "${LATEST_BRANCH}"; then + if run_test "${LANG}" "${MAIN_BRANCH}" "${LANG}" "${LATEST_BRANCH}" "${MAIN_BRANCH}" "latest"; then successful_string="${successful_string} ${MAIN_BRANCH}-${LATEST_BRANCH}/${LANG}" else failed_tests=$((failed_tests + 1)) failed_string="${failed_string} ${MAIN_BRANCH}-${LATEST_BRANCH}/${LANG}" fi - if run_test "${LANG}" "${LATEST_BRANCH}" "${LANG}" "${MAIN_BRANCH}"; then + if run_test "${LANG}" "${LATEST_BRANCH}" "${LANG}" "${MAIN_BRANCH}" "latest" "${MAIN_BRANCH}"; then successful_string="${successful_string} ${LATEST_BRANCH}-${MAIN_BRANCH}/${LANG}" else failed_tests=$((failed_tests + 1)) failed_string="${failed_string} ${LATEST_BRANCH}-${MAIN_BRANCH}/${LANG}" fi - if run_test "${LANG}" "${MAIN_BRANCH}" "${LANG}" "${OLDEST_BRANCH}"; then + if run_test "${LANG}" "${MAIN_BRANCH}" "${LANG}" "${OLDEST_BRANCH}" "${MAIN_BRANCH}" "oldest"; then successful_string="${successful_string} ${MAIN_BRANCH}-${OLDEST_BRANCH}/${LANG}" else failed_tests=$((failed_tests + 1)) failed_string="${failed_string} ${MAIN_BRANCH}-${OLDEST_BRANCH}/${LANG}" fi - if run_test "${LANG}" "${OLDEST_BRANCH}" "${LANG}" "${MAIN_BRANCH}"; then + if run_test "${LANG}" "${OLDEST_BRANCH}" "${LANG}" "${MAIN_BRANCH}" "oldest" "${MAIN_BRANCH}"; then successful_string="${successful_string} ${OLDEST_BRANCH}-${MAIN_BRANCH}/${LANG}" else failed_tests=$((failed_tests + 1)) diff --git a/tools/internal_ci/linux/grpc_xds_k8s_xlang.sh b/tools/internal_ci/linux/grpc_xds_k8s_xlang.sh index 93922a06c2724..cab473f7c6bb3 100755 --- a/tools/internal_ci/linux/grpc_xds_k8s_xlang.sh +++ b/tools/internal_ci/linux/grpc_xds_k8s_xlang.sh @@ -75,6 +75,7 @@ main() { OLDEST_BRANCH=$(find_oldest_branch "${OLDEST_BRANCH}" "${LATEST_BRANCH}") # Run cross lang tests: for given cross lang versions XLANG_VERSIONS="${MAIN_BRANCH} ${LATEST_BRANCH} ${OLDEST_BRANCH}" + declare -A FIXED_VERSION_NAMES=( ["${MAIN_BRANCH}"]="${MAIN_BRANCH}" ["${LATEST_BRANCH}"]="latest" ["${OLDEST_BRANCH}"]="oldest") for VERSION in ${XLANG_VERSIONS} do for CLIENT_LANG in ${CLIENT_LANGS} @@ -82,7 +83,8 @@ main() { for SERVER_LANG in ${SERVER_LANGS} do if [ "${CLIENT_LANG}" != "${SERVER_LANG}" ]; then - if run_test "${CLIENT_LANG}" "${VERSION}" "${SERVER_LANG}" "${VERSION}"; then + FIXED="${FIXED_VERSION_NAMES[${VERSION}]}" + if run_test "${CLIENT_LANG}" "${VERSION}" "${SERVER_LANG}" "${VERSION}" "${FIXED}" "${FIXED}"; then successful_string="${successful_string} ${VERSION}/${CLIENT_LANG}-${SERVER_LANG}" else failed_tests=$((failed_tests+1)) From a7bf07e86a5a5e37ab0889b72055c4d3bb0b998e Mon Sep 17 00:00:00 2001 From: Yijie Ma Date: Fri, 21 Jul 2023 13:24:16 -0700 Subject: [PATCH 031/205] [EventEngine] PosixEventEngine DNS Resolver (#32701) This PR implements a c-ares based DNS resolver for EventEngine with the reference from the original [grpc_ares_wrapper.h](../blob/master/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h). The PosixEventEngine DNSResolver is implemented on top of that. Tests which use the client channel resolver API ([resolver.h](../blob/master/src/core/lib/resolver/resolver.h#L54)) are ported, namely the [resolver_component_test.cc](../blob/master/test/cpp/naming/resolver_component_test.cc) and the [cancel_ares_query_test.cc](../blob/master/test/cpp/naming/cancel_ares_query_test.cc). The WindowsEventEngine DNSResolver will use the same EventEngine's grpc_ares_wrapper and will be worked on next. The [resolve_address_test.cc](https://github.com/grpc/grpc/blob/master/test/core/iomgr/resolve_address_test.cc) which uses the iomgr [DNSResolver](../blob/master/src/core/lib/iomgr/resolve_address.h#L44) API has been ported to EventEngine's dns_test.cc. That leaves only 2 tests which use iomgr's API, notably the [dns_resolver_cooldown_test.cc](../blob/master/test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc) and the [goaway_server_test.cc](../blob/master/test/core/end2end/goaway_server_test.cc) which probably need to be restructured to use EventEngine DNSResolver (for one thing they override the original grpc_ares_wrapper's free functions). I will try to tackle these in the next step. --- CMakeLists.txt | 11 +- Makefile | 2 + Package.swift | 4 + bazel/experiments.bzl | 6 + build_autogenerated.yaml | 24 +- config.m4 | 1 + config.w32 | 1 + gRPC-C++.podspec | 6 + gRPC-Core.podspec | 7 + grpc.gemspec | 4 + grpc.gyp | 3 + include/grpc/event_engine/event_engine.h | 1 - package.xml | 4 + src/core/BUILD | 46 ++ .../resolver/dns/c_ares/grpc_ares_wrapper.cc | 6 +- .../resolver/dns/c_ares/grpc_ares_wrapper.h | 2 +- .../event_engine_client_channel_resolver.cc | 53 +- .../resolver/polling_resolver.cc | 5 +- src/core/lib/event_engine/ares_resolver.cc | 705 ++++++++++++++++++ src/core/lib/event_engine/ares_resolver.h | 147 ++++ src/core/lib/event_engine/grpc_polled_fd.h | 73 ++ .../posix_engine/grpc_polled_fd_posix.h | 112 +++ .../event_engine/posix_engine/posix_engine.cc | 44 +- .../event_engine/posix_engine/posix_engine.h | 13 +- src/core/lib/experiments/experiments.yaml | 2 +- src/python/grpcio/grpc_core_dependencies.py | 1 + templates/CMakeLists.txt.template | 4 + .../resolver_component_tests_defs.include | 5 +- test/core/event_engine/test_suite/BUILD | 1 + test/core/event_engine/test_suite/tests/BUILD | 18 + .../event_engine/test_suite/tests/dns_test.cc | 520 ++++++++++++- .../tests/dns_test_record_groups.yaml | 21 + test/core/http/httpcli_test.cc | 7 +- test/core/iomgr/resolve_address_test.cc | 6 +- test/cpp/naming/BUILD | 1 + test/cpp/naming/cancel_ares_query_test.cc | 14 +- .../generate_resolver_component_tests.bzl | 9 +- test/cpp/naming/resolver_component_test.cc | 39 +- .../naming/resolver_component_tests_runner.py | 5 +- test/cpp/naming/utils/BUILD | 6 + test/cpp/naming/utils/dns_resolver.py | 2 +- test/cpp/naming/utils/dns_server.py | 2 +- test/cpp/naming/utils/health_check.py | 121 +++ .../run_dns_server_for_lb_interop_tests.py | 2 +- test/cpp/naming/utils/tcp_connect.py | 2 +- test/cpp/util/BUILD | 16 + test/cpp/util/get_grpc_test_runfile_dir.cc | 29 + test/cpp/util/get_grpc_test_runfile_dir.h | 32 + tools/doxygen/Doxyfile.c++.internal | 4 + tools/doxygen/Doxyfile.core.internal | 4 + 50 files changed, 2097 insertions(+), 56 deletions(-) create mode 100644 src/core/lib/event_engine/ares_resolver.cc create mode 100644 src/core/lib/event_engine/ares_resolver.h create mode 100644 src/core/lib/event_engine/grpc_polled_fd.h create mode 100644 src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h create mode 100644 test/core/event_engine/test_suite/tests/dns_test_record_groups.yaml create mode 100644 test/cpp/naming/utils/health_check.py create mode 100644 test/cpp/util/get_grpc_test_runfile_dir.cc create mode 100644 test/cpp/util/get_grpc_test_runfile_dir.h diff --git a/CMakeLists.txt b/CMakeLists.txt index ee3538afcc6de..e4f151dad5226 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2150,6 +2150,7 @@ add_library(grpc src/core/lib/debug/stats.cc src/core/lib/debug/stats_data.cc src/core/lib/debug/trace.cc + src/core/lib/event_engine/ares_resolver.cc src/core/lib/event_engine/cf_engine/cf_engine.cc src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc src/core/lib/event_engine/channel_args_endpoint_config.cc @@ -2855,6 +2856,7 @@ add_library(grpc_unsecure src/core/lib/debug/stats.cc src/core/lib/debug/stats_data.cc src/core/lib/debug/trace.cc + src/core/lib/event_engine/ares_resolver.cc src/core/lib/event_engine/cf_engine/cf_engine.cc src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc src/core/lib/event_engine/channel_args_endpoint_config.cc @@ -4391,6 +4393,7 @@ add_library(grpc_authorization_provider src/core/lib/debug/stats.cc src/core/lib/debug/stats_data.cc src/core/lib/debug/trace.cc + src/core/lib/event_engine/ares_resolver.cc src/core/lib/event_engine/cf_engine/cf_engine.cc src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc src/core/lib/event_engine/channel_args_endpoint_config.cc @@ -4654,6 +4657,7 @@ target_link_libraries(grpc_authorization_provider ${_gRPC_BASELIB_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ZLIB_LIBRARIES} + ${_gRPC_CARES_LIBRARIES} ${_gRPC_RE2_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} absl::cleanup @@ -12385,6 +12389,7 @@ add_executable(frame_test src/core/lib/debug/stats.cc src/core/lib/debug/stats_data.cc src/core/lib/debug/trace.cc + src/core/lib/event_engine/ares_resolver.cc src/core/lib/event_engine/cf_engine/cf_engine.cc src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc src/core/lib/event_engine/channel_args_endpoint_config.cc @@ -12608,6 +12613,7 @@ target_link_libraries(frame_test ${_gRPC_BASELIB_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ZLIB_LIBRARIES} + ${_gRPC_CARES_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} absl::cleanup absl::flat_hash_map @@ -18583,8 +18589,11 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX) test/core/event_engine/test_suite/posix/oracle_event_engine_posix.cc test/core/event_engine/test_suite/posix_event_engine_test.cc test/core/event_engine/test_suite/tests/client_test.cc + test/core/event_engine/test_suite/tests/dns_test.cc test/core/event_engine/test_suite/tests/server_test.cc test/core/event_engine/test_suite/tests/timer_test.cc + test/core/util/fake_udp_and_tcp_server.cc + test/cpp/util/get_grpc_test_runfile_dir.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc ) @@ -18614,7 +18623,7 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX) ${_gRPC_ZLIB_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} grpc_unsecure - grpc_test_util + grpc++_test_util ) diff --git a/Makefile b/Makefile index 5094236d47e20..a9c5977295f8d 100644 --- a/Makefile +++ b/Makefile @@ -1435,6 +1435,7 @@ LIBGRPC_SRC = \ src/core/lib/debug/stats.cc \ src/core/lib/debug/stats_data.cc \ src/core/lib/debug/trace.cc \ + src/core/lib/event_engine/ares_resolver.cc \ src/core/lib/event_engine/cf_engine/cf_engine.cc \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc \ src/core/lib/event_engine/channel_args_endpoint_config.cc \ @@ -1993,6 +1994,7 @@ LIBGRPC_UNSECURE_SRC = \ src/core/lib/debug/stats.cc \ src/core/lib/debug/stats_data.cc \ src/core/lib/debug/trace.cc \ + src/core/lib/event_engine/ares_resolver.cc \ src/core/lib/event_engine/cf_engine/cf_engine.cc \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc \ src/core/lib/event_engine/channel_args_endpoint_config.cc \ diff --git a/Package.swift b/Package.swift index 9c40122a6737d..a3d31ce6d56aa 100644 --- a/Package.swift +++ b/Package.swift @@ -1057,6 +1057,8 @@ let package = Package( "src/core/lib/debug/stats_data.h", "src/core/lib/debug/trace.cc", "src/core/lib/debug/trace.h", + "src/core/lib/event_engine/ares_resolver.cc", + "src/core/lib/event_engine/ares_resolver.h", "src/core/lib/event_engine/cf_engine/cf_engine.cc", "src/core/lib/event_engine/cf_engine/cf_engine.h", "src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc", @@ -1072,6 +1074,7 @@ let package = Package( "src/core/lib/event_engine/event_engine.cc", "src/core/lib/event_engine/forkable.cc", "src/core/lib/event_engine/forkable.h", + "src/core/lib/event_engine/grpc_polled_fd.h", "src/core/lib/event_engine/handle_containers.h", "src/core/lib/event_engine/memory_allocator.cc", "src/core/lib/event_engine/memory_allocator_factory.h", @@ -1084,6 +1087,7 @@ let package = Package( "src/core/lib/event_engine/posix_engine/event_poller.h", "src/core/lib/event_engine/posix_engine/event_poller_posix_default.cc", "src/core/lib/event_engine/posix_engine/event_poller_posix_default.h", + "src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h", "src/core/lib/event_engine/posix_engine/internal_errqueue.cc", "src/core/lib/event_engine/posix_engine/internal_errqueue.h", "src/core/lib/event_engine/posix_engine/lockfree_event.cc", diff --git a/bazel/experiments.bzl b/bazel/experiments.bzl index a5c78363eb2b4..e04ba5720aeeb 100644 --- a/bazel/experiments.bzl +++ b/bazel/experiments.bzl @@ -20,6 +20,9 @@ EXPERIMENTS = { "dbg": { }, "off": { + "cancel_ares_query_test": [ + "event_engine_dns", + ], "census_test": [ "transport_supplies_client_latency", ], @@ -55,6 +58,9 @@ EXPERIMENTS = { "logging_test": [ "promise_based_server_call", ], + "resolver_component_tests_runner_invoker": [ + "event_engine_dns", + ], "resource_quota_test": [ "free_large_allocator", "memory_pressure_controller", diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index a4ae130713a9a..891c136a6644f 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -680,6 +680,7 @@ libs: - src/core/lib/debug/stats.h - src/core/lib/debug/stats_data.h - src/core/lib/debug/trace.h + - src/core/lib/event_engine/ares_resolver.h - src/core/lib/event_engine/cf_engine/cf_engine.h - src/core/lib/event_engine/cf_engine/cfstream_endpoint.h - src/core/lib/event_engine/cf_engine/cftype_unique_ref.h @@ -688,6 +689,7 @@ libs: - src/core/lib/event_engine/default_event_engine.h - src/core/lib/event_engine/default_event_engine_factory.h - src/core/lib/event_engine/forkable.h + - src/core/lib/event_engine/grpc_polled_fd.h - src/core/lib/event_engine/handle_containers.h - src/core/lib/event_engine/memory_allocator_factory.h - src/core/lib/event_engine/poller.h @@ -696,6 +698,7 @@ libs: - src/core/lib/event_engine/posix_engine/ev_poll_posix.h - src/core/lib/event_engine/posix_engine/event_poller.h - src/core/lib/event_engine/posix_engine/event_poller_posix_default.h + - src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h - src/core/lib/event_engine/posix_engine/internal_errqueue.h - src/core/lib/event_engine/posix_engine/lockfree_event.h - src/core/lib/event_engine/posix_engine/posix_endpoint.h @@ -1492,6 +1495,7 @@ libs: - src/core/lib/debug/stats.cc - src/core/lib/debug/stats_data.cc - src/core/lib/debug/trace.cc + - src/core/lib/event_engine/ares_resolver.cc - src/core/lib/event_engine/cf_engine/cf_engine.cc - src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc - src/core/lib/event_engine/channel_args_endpoint_config.cc @@ -2070,6 +2074,7 @@ libs: - src/core/lib/debug/stats.h - src/core/lib/debug/stats_data.h - src/core/lib/debug/trace.h + - src/core/lib/event_engine/ares_resolver.h - src/core/lib/event_engine/cf_engine/cf_engine.h - src/core/lib/event_engine/cf_engine/cfstream_endpoint.h - src/core/lib/event_engine/cf_engine/cftype_unique_ref.h @@ -2078,6 +2083,7 @@ libs: - src/core/lib/event_engine/default_event_engine.h - src/core/lib/event_engine/default_event_engine_factory.h - src/core/lib/event_engine/forkable.h + - src/core/lib/event_engine/grpc_polled_fd.h - src/core/lib/event_engine/handle_containers.h - src/core/lib/event_engine/memory_allocator_factory.h - src/core/lib/event_engine/poller.h @@ -2086,6 +2092,7 @@ libs: - src/core/lib/event_engine/posix_engine/ev_poll_posix.h - src/core/lib/event_engine/posix_engine/event_poller.h - src/core/lib/event_engine/posix_engine/event_poller_posix_default.h + - src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h - src/core/lib/event_engine/posix_engine/internal_errqueue.h - src/core/lib/event_engine/posix_engine/lockfree_event.h - src/core/lib/event_engine/posix_engine/posix_endpoint.h @@ -2489,6 +2496,7 @@ libs: - src/core/lib/debug/stats.cc - src/core/lib/debug/stats_data.cc - src/core/lib/debug/trace.cc + - src/core/lib/event_engine/ares_resolver.cc - src/core/lib/event_engine/cf_engine/cf_engine.cc - src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc - src/core/lib/event_engine/channel_args_endpoint_config.cc @@ -3573,6 +3581,7 @@ libs: - src/core/lib/debug/stats.h - src/core/lib/debug/stats_data.h - src/core/lib/debug/trace.h + - src/core/lib/event_engine/ares_resolver.h - src/core/lib/event_engine/cf_engine/cf_engine.h - src/core/lib/event_engine/cf_engine/cfstream_endpoint.h - src/core/lib/event_engine/cf_engine/cftype_unique_ref.h @@ -3581,6 +3590,7 @@ libs: - src/core/lib/event_engine/default_event_engine.h - src/core/lib/event_engine/default_event_engine_factory.h - src/core/lib/event_engine/forkable.h + - src/core/lib/event_engine/grpc_polled_fd.h - src/core/lib/event_engine/handle_containers.h - src/core/lib/event_engine/memory_allocator_factory.h - src/core/lib/event_engine/poller.h @@ -3589,6 +3599,7 @@ libs: - src/core/lib/event_engine/posix_engine/ev_poll_posix.h - src/core/lib/event_engine/posix_engine/event_poller.h - src/core/lib/event_engine/posix_engine/event_poller_posix_default.h + - src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h - src/core/lib/event_engine/posix_engine/internal_errqueue.h - src/core/lib/event_engine/posix_engine/lockfree_event.h - src/core/lib/event_engine/posix_engine/posix_endpoint.h @@ -3873,6 +3884,7 @@ libs: - src/core/lib/debug/stats.cc - src/core/lib/debug/stats_data.cc - src/core/lib/debug/trace.cc + - src/core/lib/event_engine/ares_resolver.cc - src/core/lib/event_engine/cf_engine/cf_engine.cc - src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc - src/core/lib/event_engine/channel_args_endpoint_config.cc @@ -8071,6 +8083,7 @@ targets: - src/core/lib/debug/stats.h - src/core/lib/debug/stats_data.h - src/core/lib/debug/trace.h + - src/core/lib/event_engine/ares_resolver.h - src/core/lib/event_engine/cf_engine/cf_engine.h - src/core/lib/event_engine/cf_engine/cfstream_endpoint.h - src/core/lib/event_engine/cf_engine/cftype_unique_ref.h @@ -8079,6 +8092,7 @@ targets: - src/core/lib/event_engine/default_event_engine.h - src/core/lib/event_engine/default_event_engine_factory.h - src/core/lib/event_engine/forkable.h + - src/core/lib/event_engine/grpc_polled_fd.h - src/core/lib/event_engine/handle_containers.h - src/core/lib/event_engine/memory_allocator_factory.h - src/core/lib/event_engine/poller.h @@ -8087,6 +8101,7 @@ targets: - src/core/lib/event_engine/posix_engine/ev_poll_posix.h - src/core/lib/event_engine/posix_engine/event_poller.h - src/core/lib/event_engine/posix_engine/event_poller_posix_default.h + - src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h - src/core/lib/event_engine/posix_engine/internal_errqueue.h - src/core/lib/event_engine/posix_engine/lockfree_event.h - src/core/lib/event_engine/posix_engine/posix_endpoint.h @@ -8353,6 +8368,7 @@ targets: - src/core/lib/debug/stats.cc - src/core/lib/debug/stats_data.cc - src/core/lib/debug/trace.cc + - src/core/lib/event_engine/ares_resolver.cc - src/core/lib/event_engine/cf_engine/cf_engine.cc - src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc - src/core/lib/event_engine/channel_args_endpoint_config.cc @@ -11427,19 +11443,25 @@ targets: - test/core/event_engine/test_suite/event_engine_test_framework.h - test/core/event_engine/test_suite/posix/oracle_event_engine_posix.h - test/core/event_engine/test_suite/tests/client_test.h + - test/core/event_engine/test_suite/tests/dns_test.h - test/core/event_engine/test_suite/tests/server_test.h - test/core/event_engine/test_suite/tests/timer_test.h + - test/core/util/fake_udp_and_tcp_server.h + - test/cpp/util/get_grpc_test_runfile_dir.h src: - test/core/event_engine/event_engine_test_utils.cc - test/core/event_engine/test_suite/event_engine_test_framework.cc - test/core/event_engine/test_suite/posix/oracle_event_engine_posix.cc - test/core/event_engine/test_suite/posix_event_engine_test.cc - test/core/event_engine/test_suite/tests/client_test.cc + - test/core/event_engine/test_suite/tests/dns_test.cc - test/core/event_engine/test_suite/tests/server_test.cc - test/core/event_engine/test_suite/tests/timer_test.cc + - test/core/util/fake_udp_and_tcp_server.cc + - test/cpp/util/get_grpc_test_runfile_dir.cc deps: - grpc_unsecure - - grpc_test_util + - grpc++_test_util platforms: - linux - posix diff --git a/config.m4 b/config.m4 index e7ddb42f6c361..44e239db30e92 100644 --- a/config.m4 +++ b/config.m4 @@ -517,6 +517,7 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/debug/stats.cc \ src/core/lib/debug/stats_data.cc \ src/core/lib/debug/trace.cc \ + src/core/lib/event_engine/ares_resolver.cc \ src/core/lib/event_engine/cf_engine/cf_engine.cc \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc \ src/core/lib/event_engine/channel_args_endpoint_config.cc \ diff --git a/config.w32 b/config.w32 index 64851c79e4370..da44d20aedd1e 100644 --- a/config.w32 +++ b/config.w32 @@ -482,6 +482,7 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\debug\\stats.cc " + "src\\core\\lib\\debug\\stats_data.cc " + "src\\core\\lib\\debug\\trace.cc " + + "src\\core\\lib\\event_engine\\ares_resolver.cc " + "src\\core\\lib\\event_engine\\cf_engine\\cf_engine.cc " + "src\\core\\lib\\event_engine\\cf_engine\\cfstream_endpoint.cc " + "src\\core\\lib\\event_engine\\channel_args_endpoint_config.cc " + diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index ffc0b13517902..94d9b33784eda 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -752,6 +752,7 @@ Pod::Spec.new do |s| 'src/core/lib/debug/stats.h', 'src/core/lib/debug/stats_data.h', 'src/core/lib/debug/trace.h', + 'src/core/lib/event_engine/ares_resolver.h', 'src/core/lib/event_engine/cf_engine/cf_engine.h', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.h', 'src/core/lib/event_engine/cf_engine/cftype_unique_ref.h', @@ -760,6 +761,7 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/default_event_engine.h', 'src/core/lib/event_engine/default_event_engine_factory.h', 'src/core/lib/event_engine/forkable.h', + 'src/core/lib/event_engine/grpc_polled_fd.h', 'src/core/lib/event_engine/handle_containers.h', 'src/core/lib/event_engine/memory_allocator_factory.h', 'src/core/lib/event_engine/poller.h', @@ -768,6 +770,7 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/posix_engine/ev_poll_posix.h', 'src/core/lib/event_engine/posix_engine/event_poller.h', 'src/core/lib/event_engine/posix_engine/event_poller_posix_default.h', + 'src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h', 'src/core/lib/event_engine/posix_engine/internal_errqueue.h', 'src/core/lib/event_engine/posix_engine/lockfree_event.h', 'src/core/lib/event_engine/posix_engine/posix_endpoint.h', @@ -1798,6 +1801,7 @@ Pod::Spec.new do |s| 'src/core/lib/debug/stats.h', 'src/core/lib/debug/stats_data.h', 'src/core/lib/debug/trace.h', + 'src/core/lib/event_engine/ares_resolver.h', 'src/core/lib/event_engine/cf_engine/cf_engine.h', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.h', 'src/core/lib/event_engine/cf_engine/cftype_unique_ref.h', @@ -1806,6 +1810,7 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/default_event_engine.h', 'src/core/lib/event_engine/default_event_engine_factory.h', 'src/core/lib/event_engine/forkable.h', + 'src/core/lib/event_engine/grpc_polled_fd.h', 'src/core/lib/event_engine/handle_containers.h', 'src/core/lib/event_engine/memory_allocator_factory.h', 'src/core/lib/event_engine/poller.h', @@ -1814,6 +1819,7 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/posix_engine/ev_poll_posix.h', 'src/core/lib/event_engine/posix_engine/event_poller.h', 'src/core/lib/event_engine/posix_engine/event_poller_posix_default.h', + 'src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h', 'src/core/lib/event_engine/posix_engine/internal_errqueue.h', 'src/core/lib/event_engine/posix_engine/lockfree_event.h', 'src/core/lib/event_engine/posix_engine/posix_endpoint.h', diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 36f40caf3864b..9c1956cbeb0d0 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -1158,6 +1158,8 @@ Pod::Spec.new do |s| 'src/core/lib/debug/stats_data.h', 'src/core/lib/debug/trace.cc', 'src/core/lib/debug/trace.h', + 'src/core/lib/event_engine/ares_resolver.cc', + 'src/core/lib/event_engine/ares_resolver.h', 'src/core/lib/event_engine/cf_engine/cf_engine.cc', 'src/core/lib/event_engine/cf_engine/cf_engine.h', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc', @@ -1173,6 +1175,7 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/event_engine.cc', 'src/core/lib/event_engine/forkable.cc', 'src/core/lib/event_engine/forkable.h', + 'src/core/lib/event_engine/grpc_polled_fd.h', 'src/core/lib/event_engine/handle_containers.h', 'src/core/lib/event_engine/memory_allocator.cc', 'src/core/lib/event_engine/memory_allocator_factory.h', @@ -1185,6 +1188,7 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/posix_engine/event_poller.h', 'src/core/lib/event_engine/posix_engine/event_poller_posix_default.cc', 'src/core/lib/event_engine/posix_engine/event_poller_posix_default.h', + 'src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h', 'src/core/lib/event_engine/posix_engine/internal_errqueue.cc', 'src/core/lib/event_engine/posix_engine/internal_errqueue.h', 'src/core/lib/event_engine/posix_engine/lockfree_event.cc', @@ -2529,6 +2533,7 @@ Pod::Spec.new do |s| 'src/core/lib/debug/stats.h', 'src/core/lib/debug/stats_data.h', 'src/core/lib/debug/trace.h', + 'src/core/lib/event_engine/ares_resolver.h', 'src/core/lib/event_engine/cf_engine/cf_engine.h', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.h', 'src/core/lib/event_engine/cf_engine/cftype_unique_ref.h', @@ -2537,6 +2542,7 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/default_event_engine.h', 'src/core/lib/event_engine/default_event_engine_factory.h', 'src/core/lib/event_engine/forkable.h', + 'src/core/lib/event_engine/grpc_polled_fd.h', 'src/core/lib/event_engine/handle_containers.h', 'src/core/lib/event_engine/memory_allocator_factory.h', 'src/core/lib/event_engine/poller.h', @@ -2545,6 +2551,7 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/posix_engine/ev_poll_posix.h', 'src/core/lib/event_engine/posix_engine/event_poller.h', 'src/core/lib/event_engine/posix_engine/event_poller_posix_default.h', + 'src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h', 'src/core/lib/event_engine/posix_engine/internal_errqueue.h', 'src/core/lib/event_engine/posix_engine/lockfree_event.h', 'src/core/lib/event_engine/posix_engine/posix_endpoint.h', diff --git a/grpc.gemspec b/grpc.gemspec index f3dccb93dc2b7..4e8db38014281 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -1063,6 +1063,8 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/debug/stats_data.h ) s.files += %w( src/core/lib/debug/trace.cc ) s.files += %w( src/core/lib/debug/trace.h ) + s.files += %w( src/core/lib/event_engine/ares_resolver.cc ) + s.files += %w( src/core/lib/event_engine/ares_resolver.h ) s.files += %w( src/core/lib/event_engine/cf_engine/cf_engine.cc ) s.files += %w( src/core/lib/event_engine/cf_engine/cf_engine.h ) s.files += %w( src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc ) @@ -1078,6 +1080,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/event_engine/event_engine.cc ) s.files += %w( src/core/lib/event_engine/forkable.cc ) s.files += %w( src/core/lib/event_engine/forkable.h ) + s.files += %w( src/core/lib/event_engine/grpc_polled_fd.h ) s.files += %w( src/core/lib/event_engine/handle_containers.h ) s.files += %w( src/core/lib/event_engine/memory_allocator.cc ) s.files += %w( src/core/lib/event_engine/memory_allocator_factory.h ) @@ -1090,6 +1093,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/event_engine/posix_engine/event_poller.h ) s.files += %w( src/core/lib/event_engine/posix_engine/event_poller_posix_default.cc ) s.files += %w( src/core/lib/event_engine/posix_engine/event_poller_posix_default.h ) + s.files += %w( src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h ) s.files += %w( src/core/lib/event_engine/posix_engine/internal_errqueue.cc ) s.files += %w( src/core/lib/event_engine/posix_engine/internal_errqueue.h ) s.files += %w( src/core/lib/event_engine/posix_engine/lockfree_event.cc ) diff --git a/grpc.gyp b/grpc.gyp index 57482cc048e09..d82377051ff6e 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -739,6 +739,7 @@ 'src/core/lib/debug/stats.cc', 'src/core/lib/debug/stats_data.cc', 'src/core/lib/debug/trace.cc', + 'src/core/lib/event_engine/ares_resolver.cc', 'src/core/lib/event_engine/cf_engine/cf_engine.cc', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc', 'src/core/lib/event_engine/channel_args_endpoint_config.cc', @@ -1237,6 +1238,7 @@ 'src/core/lib/debug/stats.cc', 'src/core/lib/debug/stats_data.cc', 'src/core/lib/debug/trace.cc', + 'src/core/lib/event_engine/ares_resolver.cc', 'src/core/lib/event_engine/cf_engine/cf_engine.cc', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc', 'src/core/lib/event_engine/channel_args_endpoint_config.cc', @@ -1757,6 +1759,7 @@ 'src/core/lib/debug/stats.cc', 'src/core/lib/debug/stats_data.cc', 'src/core/lib/debug/trace.cc', + 'src/core/lib/event_engine/ares_resolver.cc', 'src/core/lib/event_engine/cf_engine/cf_engine.cc', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc', 'src/core/lib/event_engine/channel_args_endpoint_config.cc', diff --git a/include/grpc/event_engine/event_engine.h b/include/grpc/event_engine/event_engine.h index 00b57629e7341..4b671d2d3f750 100644 --- a/include/grpc/event_engine/event_engine.h +++ b/include/grpc/event_engine/event_engine.h @@ -365,7 +365,6 @@ class EventEngine : public std::enable_shared_from_this { /// lookup. Implementations should pass the appropriate statuses to the /// callback. For example, callbacks might expect to receive CANCELLED or /// NOT_FOUND. - /// virtual void LookupHostname(LookupHostnameCallback on_resolve, absl::string_view name, absl::string_view default_port) = 0; diff --git a/package.xml b/package.xml index db3a373a32727..28a722fe16e8c 100644 --- a/package.xml +++ b/package.xml @@ -1045,6 +1045,8 @@ + + @@ -1060,6 +1062,7 @@ + @@ -1072,6 +1075,7 @@ + diff --git a/src/core/BUILD b/src/core/BUILD index 34736a7a53f6d..5b05d7481b4cf 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -1975,6 +1975,7 @@ grpc_cc_library( "absl/strings", ], deps = [ + "ares_resolver", "event_engine_common", "event_engine_poller", "event_engine_tcp_socket_utils", @@ -1996,6 +1997,7 @@ grpc_cc_library( "//:event_engine_base_hdrs", "//:gpr", "//:grpc_trace", + "//:orphanable", ], ) @@ -2298,6 +2300,49 @@ grpc_cc_library( ], ) +grpc_cc_library( + name = "ares_resolver", + srcs = [ + "lib/event_engine/ares_resolver.cc", + ], + hdrs = [ + "lib/event_engine/ares_resolver.h", + "lib/event_engine/grpc_polled_fd.h", + "lib/event_engine/posix_engine/grpc_polled_fd_posix.h", + ], + external_deps = [ + "absl/base:core_headers", + "absl/container:flat_hash_map", + "absl/functional:any_invocable", + "absl/hash", + "absl/status", + "absl/status:statusor", + "absl/strings", + "absl/strings:str_format", + "absl/types:optional", + "absl/types:variant", + "cares", + ], + deps = [ + "error", + "event_engine_time_util", + "grpc_sockaddr", + "iomgr_port", + "posix_event_engine_closure", + "posix_event_engine_event_poller", + "posix_event_engine_tcp_socket_utils", + "resolved_address", + "//:debug_location", + "//:event_engine_base_hdrs", + "//:gpr", + "//:grpc_trace", + "//:orphanable", + "//:parse_address", + "//:ref_counted_ptr", + "//:sockaddr_utils", + ], +) + grpc_cc_library( name = "channel_args_preconditioning", srcs = [ @@ -5153,6 +5198,7 @@ grpc_cc_library( "validation_errors", "//:backoff", "//:debug_location", + "//:exec_ctx", "//:gpr", "//:gpr_platform", "//:grpc_base", diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc index cee19837b4843..f8278cc6fc2dc 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc @@ -510,9 +510,9 @@ void grpc_ares_ev_driver_start_locked(grpc_ares_ev_driver* ev_driver) &ev_driver->on_ares_backup_poll_alarm_locked); } -static void noop_inject_channel_config(ares_channel /*channel*/) {} +static void noop_inject_channel_config(ares_channel* /*channel*/) {} -void (*grpc_ares_test_only_inject_config)(ares_channel channel) = +void (*grpc_ares_test_only_inject_config)(ares_channel* channel) = noop_inject_channel_config; grpc_error_handle grpc_ares_ev_driver_create_locked( @@ -524,7 +524,7 @@ grpc_error_handle grpc_ares_ev_driver_create_locked( memset(&opts, 0, sizeof(opts)); opts.flags |= ARES_FLAG_STAYOPEN; int status = ares_init_options(&(*ev_driver)->channel, &opts, ARES_OPT_FLAGS); - grpc_ares_test_only_inject_config((*ev_driver)->channel); + grpc_ares_test_only_inject_config(&(*ev_driver)->channel); GRPC_CARES_TRACE_LOG("request:%p grpc_ares_ev_driver_create_locked", request); if (status != ARES_SUCCESS) { grpc_error_handle err = GRPC_ERROR_CREATE(absl::StrCat( diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h index ffe7cf9e01aa5..69f52bc3df11b 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h @@ -131,6 +131,6 @@ void grpc_cares_wrapper_address_sorting_sort( const grpc_ares_request* request, grpc_core::ServerAddressList* addresses); // Exposed in this header for C-core tests only -extern void (*grpc_ares_test_only_inject_config)(ares_channel channel); +extern void (*grpc_ares_test_only_inject_config)(ares_channel* channel); #endif // GRPC_SRC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_WRAPPER_H diff --git a/src/core/ext/filters/client_channel/resolver/dns/event_engine/event_engine_client_channel_resolver.cc b/src/core/ext/filters/client_channel/resolver/dns/event_engine/event_engine_client_channel_resolver.cc index a8596e7c7ca5c..b2b03cf5a4037 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/event_engine/event_engine_client_channel_resolver.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/event_engine/event_engine_client_channel_resolver.cc @@ -22,7 +22,6 @@ #include #include #include -#include #include #include @@ -51,6 +50,7 @@ #include "src/core/lib/gprpp/sync.h" #include "src/core/lib/gprpp/time.h" #include "src/core/lib/gprpp/validation_errors.h" +#include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/resolve_address.h" #include "src/core/lib/resolver/resolver.h" #include "src/core/lib/resolver/resolver_factory.h" @@ -231,8 +231,12 @@ EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper:: is_hostname_inflight_ = true; event_engine_resolver_->LookupHostname( [self = Ref(DEBUG_LOCATION, "OnHostnameResolved")]( - absl::StatusOr> addresses) { + absl::StatusOr> + addresses) mutable { + ApplicationCallbackExecCtx callback_exec_ctx; + ExecCtx exec_ctx; self->OnHostnameResolved(std::move(addresses)); + self.reset(); }, resolver_->name_to_resolve(), kDefaultSecurePort); if (resolver_->enable_srv_queries_) { @@ -243,8 +247,13 @@ EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper:: event_engine_resolver_->LookupSRV( [self = Ref(DEBUG_LOCATION, "OnSRVResolved")]( absl::StatusOr> - srv_records) { self->OnSRVResolved(std::move(srv_records)); }, - resolver_->name_to_resolve()); + srv_records) mutable { + ApplicationCallbackExecCtx callback_exec_ctx; + ExecCtx exec_ctx; + self->OnSRVResolved(std::move(srv_records)); + self.reset(); + }, + absl::StrCat("_grpclb._tcp.", resolver_->name_to_resolve())); } if (resolver_->request_service_config_) { GRPC_EVENT_ENGINE_RESOLVER_TRACE( @@ -253,8 +262,11 @@ EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper:: is_txt_inflight_ = true; event_engine_resolver_->LookupTXT( [self = Ref(DEBUG_LOCATION, "OnTXTResolved")]( - absl::StatusOr> service_config) { + absl::StatusOr> service_config) mutable { + ApplicationCallbackExecCtx callback_exec_ctx; + ExecCtx exec_ctx; self->OnTXTResolved(std::move(service_config)); + self.reset(); }, absl::StrCat("_grpc_config.", resolver_->name_to_resolve())); } @@ -263,8 +275,12 @@ EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper:: ? EventEngine::Duration::max() : resolver_->query_timeout_ms_; timeout_handle_ = resolver_->event_engine_->RunAfter( - timeout, - [self = Ref(DEBUG_LOCATION, "OnTimeout")]() { self->OnTimeout(); }); + timeout, [self = Ref(DEBUG_LOCATION, "OnTimeout")]() mutable { + ApplicationCallbackExecCtx callback_exec_ctx; + ExecCtx exec_ctx; + self->OnTimeout(); + self.reset(); + }); } EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper:: @@ -300,10 +316,11 @@ void EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper:: void EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper:: OnHostnameResolved(absl::StatusOr> new_addresses) { - ValidationErrors::ScopedField field(&errors_, "hostname lookup"); absl::optional result; { MutexLock lock(&on_resolved_mu_); + // Make sure field destroys before cleanup. + ValidationErrors::ScopedField field(&errors_, "hostname lookup"); if (orphaned_) return; is_hostname_inflight_ = false; if (!new_addresses.ok()) { @@ -325,7 +342,6 @@ void EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper:: OnSRVResolved( absl::StatusOr> srv_records) { - ValidationErrors::ScopedField field(&errors_, "srv lookup"); absl::optional result; auto cleanup = absl::MakeCleanup([&]() { if (result.has_value()) { @@ -333,6 +349,8 @@ void EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper:: } }); MutexLock lock(&on_resolved_mu_); + // Make sure field destroys before cleanup. + ValidationErrors::ScopedField field(&errors_, "srv lookup"); if (orphaned_) return; is_srv_inflight_ = false; if (!srv_records.ok()) { @@ -359,12 +377,15 @@ void EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper:: resolver_.get(), srv_record.host.c_str(), srv_record.port); ++number_of_balancer_hostnames_initiated_; event_engine_resolver_->LookupHostname( - [host = std::move(srv_record.host), + [host = srv_record.host, self = Ref(DEBUG_LOCATION, "OnBalancerHostnamesResolved")]( absl::StatusOr> new_balancer_addresses) mutable { + ApplicationCallbackExecCtx callback_exec_ctx; + ExecCtx exec_ctx; self->OnBalancerHostnamesResolved(std::move(host), std::move(new_balancer_addresses)); + self.reset(); }, srv_record.host, std::to_string(srv_record.port)); } @@ -375,8 +396,6 @@ void EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper:: std::string authority, absl::StatusOr> new_balancer_addresses) { - ValidationErrors::ScopedField field( - &errors_, absl::StrCat("balancer lookup for ", authority)); absl::optional result; auto cleanup = absl::MakeCleanup([&]() { if (result.has_value()) { @@ -384,6 +403,9 @@ void EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper:: } }); MutexLock lock(&on_resolved_mu_); + // Make sure field destroys before cleanup. + ValidationErrors::ScopedField field( + &errors_, absl::StrCat("balancer lookup for ", authority)); if (orphaned_) return; ++number_of_balancer_hostnames_resolved_; if (!new_balancer_addresses.ok()) { @@ -405,10 +427,11 @@ void EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper:: void EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper:: OnTXTResolved(absl::StatusOr> service_config) { - ValidationErrors::ScopedField field(&errors_, "txt lookup"); absl::optional result; { MutexLock lock(&on_resolved_mu_); + // Make sure field destroys before cleanup. + ValidationErrors::ScopedField field(&errors_, "txt lookup"); if (orphaned_) return; GPR_ASSERT(is_txt_inflight_); is_txt_inflight_ = false; @@ -424,8 +447,12 @@ void EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper:: s, kServiceConfigAttributePrefix); }); if (result != service_config->end()) { + // Found a service config record. service_config_json_ = result->substr(kServiceConfigAttributePrefix.size()); + GRPC_EVENT_ENGINE_RESOLVER_TRACE( + "DNSResolver::%p found service config: %s", + event_engine_resolver_.get(), service_config_json_->c_str()); } else { service_config_json_ = absl::UnavailableError(absl::StrCat( "failed to find attribute prefix: ", kServiceConfigAttributePrefix, diff --git a/src/core/ext/filters/client_channel/resolver/polling_resolver.cc b/src/core/ext/filters/client_channel/resolver/polling_resolver.cc index ff94e9834de7c..bd99aebae537e 100644 --- a/src/core/ext/filters/client_channel/resolver/polling_resolver.cc +++ b/src/core/ext/filters/client_channel/resolver/polling_resolver.cc @@ -159,7 +159,7 @@ void PollingResolver::OnRequestCompleteLocked(Result result) { if (GPR_UNLIKELY(tracer_ != nullptr && tracer_->enabled())) { gpr_log(GPR_INFO, "[polling resolver %p] returning result: " - "addresses=%s, service_config=%s", + "addresses=%s, service_config=%s, resolution_note=%s", this, result.addresses.ok() ? absl::StrCat("<", result.addresses->size(), " addresses>") @@ -170,7 +170,8 @@ void PollingResolver::OnRequestCompleteLocked(Result result) { ? "" : std::string((*result.service_config)->json_string()) .c_str()) - : result.service_config.status().ToString().c_str()); + : result.service_config.status().ToString().c_str(), + result.resolution_note.c_str()); } GPR_ASSERT(result.result_health_callback == nullptr); RefCountedPtr self = diff --git a/src/core/lib/event_engine/ares_resolver.cc b/src/core/lib/event_engine/ares_resolver.cc new file mode 100644 index 0000000000000..c78028e5be956 --- /dev/null +++ b/src/core/lib/event_engine/ares_resolver.cc @@ -0,0 +1,705 @@ +// Copyright 2023 The gRPC Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#include + +#include "src/core/lib/event_engine/ares_resolver.h" + +#include + +#include +#include + +#include "src/core/lib/iomgr/port.h" + +// IWYU pragma: no_include +// IWYU pragma: no_include +// IWYU pragma: no_include +// IWYU pragma: no_include +// IWYU pragma: no_include +// IWYU pragma: no_include +// IWYU pragma: no_include +// IWYU pragma: no_include + +#if GRPC_ARES == 1 + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "absl/functional/any_invocable.h" +#include "absl/hash/hash.h" +#include "absl/strings/match.h" +#include "absl/strings/numbers.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_format.h" +#include "absl/types/optional.h" + +#include +#include + +#include "src/core/lib/address_utils/parse_address.h" +#include "src/core/lib/address_utils/sockaddr_utils.h" +#include "src/core/lib/event_engine/grpc_polled_fd.h" +#include "src/core/lib/event_engine/time_util.h" +#include "src/core/lib/gprpp/debug_location.h" +#include "src/core/lib/gprpp/host_port.h" +#include "src/core/lib/gprpp/ref_counted_ptr.h" +#include "src/core/lib/iomgr/resolved_address.h" +#include "src/core/lib/iomgr/sockaddr.h" +#ifdef GRPC_POSIX_SOCKET_ARES_EV_DRIVER +#include "src/core/lib/event_engine/posix_engine/tcp_socket_utils.h" +#endif + +namespace grpc_event_engine { +namespace experimental { + +grpc_core::TraceFlag grpc_trace_ares_resolver(false, "cares_resolver"); + +namespace { + +absl::Status AresStatusToAbslStatus(int status, absl::string_view error_msg) { + switch (status) { + case ARES_ECANCELLED: + return absl::CancelledError(error_msg); + case ARES_ENOTIMP: + return absl::UnimplementedError(error_msg); + case ARES_ENOTFOUND: + return absl::NotFoundError(error_msg); + default: + return absl::UnknownError(error_msg); + } +} + +// An alternative here could be to use ares_timeout to try to be more +// accurate, but that would require using "struct timeval"'s, which just +// makes things a bit more complicated. So just poll every second, as +// suggested by the c-ares code comments. +constexpr EventEngine::Duration kAresBackupPollAlarmDuration = + std::chrono::seconds(1); + +bool IsIpv6LoopbackAvailable() { +#ifdef GRPC_POSIX_SOCKET_ARES_EV_DRIVER + return PosixSocketWrapper::IsIpv6LoopbackAvailable(); +#elif defined(GRPC_WINDOWS_SOCKET_ARES_EV_DRIVER) + // TODO(yijiem): implement this for Windows + return true; +#else +#error "Unsupported platform" +#endif +} + +absl::Status SetRequestDNSServer(absl::string_view dns_server, + ares_channel* channel) { + GRPC_ARES_RESOLVER_TRACE_LOG("Using DNS server %s", dns_server.data()); + grpc_resolved_address addr; + struct ares_addr_port_node dns_server_addr = {}; + if (grpc_parse_ipv4_hostport(dns_server, &addr, /*log_errors=*/false)) { + dns_server_addr.family = AF_INET; + struct sockaddr_in* in = reinterpret_cast(addr.addr); + memcpy(&dns_server_addr.addr.addr4, &in->sin_addr, sizeof(struct in_addr)); + dns_server_addr.tcp_port = grpc_sockaddr_get_port(&addr); + dns_server_addr.udp_port = grpc_sockaddr_get_port(&addr); + } else if (grpc_parse_ipv6_hostport(dns_server, &addr, + /*log_errors=*/false)) { + dns_server_addr.family = AF_INET6; + struct sockaddr_in6* in6 = + reinterpret_cast(addr.addr); + memcpy(&dns_server_addr.addr.addr6, &in6->sin6_addr, + sizeof(struct in6_addr)); + dns_server_addr.tcp_port = grpc_sockaddr_get_port(&addr); + dns_server_addr.udp_port = grpc_sockaddr_get_port(&addr); + } else { + return absl::InvalidArgumentError( + absl::StrCat("Cannot parse authority: ", dns_server)); + } + int status = ares_set_servers_ports(*channel, &dns_server_addr); + if (status != ARES_SUCCESS) { + return AresStatusToAbslStatus(status, ares_strerror(status)); + } + return absl::OkStatus(); +} + +struct QueryArg { + QueryArg(AresResolver* ar, int id, absl::string_view name) + : ares_resolver(ar), callback_map_id(id), query_name(name) {} + AresResolver* ares_resolver; + int callback_map_id; + std::string query_name; +}; + +struct HostnameQueryArg : public QueryArg { + HostnameQueryArg(AresResolver* ar, int id, absl::string_view name, int p) + : QueryArg(ar, id, name), port(p) {} + int port; +}; + +} // namespace + +absl::StatusOr> +AresResolver::CreateAresResolver( + absl::string_view dns_server, + std::unique_ptr polled_fd_factory, + std::shared_ptr event_engine) { + ares_options opts = {}; + opts.flags |= ARES_FLAG_STAYOPEN; + ares_channel channel; + int status = ares_init_options(&channel, &opts, ARES_OPT_FLAGS); + if (status != ARES_SUCCESS) { + gpr_log(GPR_ERROR, "ares_init_options failed, status: %d", status); + return AresStatusToAbslStatus( + status, + absl::StrCat("Failed to init c-ares channel: ", ares_strerror(status))); + } + event_engine_grpc_ares_test_only_inject_config(&channel); + if (!dns_server.empty()) { + absl::Status status = SetRequestDNSServer(dns_server, &channel); + if (!status.ok()) { + return status; + } + } + return grpc_core::MakeOrphanable( + std::move(polled_fd_factory), std::move(event_engine), channel); +} + +AresResolver::~AresResolver() { + GPR_ASSERT(fd_node_list_.empty()); + GPR_ASSERT(callback_map_.empty()); + ares_destroy(channel_); +} + +void AresResolver::Orphan() { + { + grpc_core::MutexLock lock(&mutex_); + shutting_down_ = true; + if (ares_backup_poll_alarm_handle_.has_value()) { + event_engine_->Cancel(*ares_backup_poll_alarm_handle_); + ares_backup_poll_alarm_handle_.reset(); + } + for (const auto& fd_node : fd_node_list_) { + if (!fd_node->already_shutdown) { + GRPC_ARES_RESOLVER_TRACE_LOG("request: %p shutdown fd: %s", this, + fd_node->polled_fd->GetName()); + fd_node->polled_fd->ShutdownLocked( + absl::CancelledError("AresResolver::Orphan")); + fd_node->already_shutdown = true; + } + } + } + Unref(DEBUG_LOCATION, "Orphan"); +} + +void AresResolver::LookupHostname( + absl::string_view name, absl::string_view default_port, + EventEngine::DNSResolver::LookupHostnameCallback callback) { + absl::string_view host; + absl::string_view port_string; + if (!grpc_core::SplitHostPort(name, &host, &port_string)) { + event_engine_->Run( + [callback = std::move(callback), + status = absl::InvalidArgumentError(absl::StrCat( + "Unparseable name: ", name))]() mutable { callback(status); }); + return; + } + GPR_ASSERT(!host.empty()); + if (port_string.empty()) { + if (default_port.empty()) { + event_engine_->Run([callback = std::move(callback), + status = absl::InvalidArgumentError(absl::StrFormat( + "No port in name %s or default_port argument", + name))]() mutable { callback(status); }); + return; + } + port_string = default_port; + } + int port = 0; + if (port_string == "http") { + port = 80; + } else if (port_string == "https") { + port = 443; + } else if (!absl::SimpleAtoi(port_string, &port)) { + event_engine_->Run([callback = std::move(callback), + status = absl::InvalidArgumentError(absl::StrCat( + "Failed to parse port in name: ", + name))]() mutable { callback(status); }); + return; + } + // TODO(yijiem): Change this when refactoring code in + // src/core/lib/address_utils to use EventEngine::ResolvedAddress. + grpc_resolved_address addr; + const std::string hostport = grpc_core::JoinHostPort(host, port); + if (grpc_parse_ipv4_hostport(hostport.c_str(), &addr, + false /* log errors */) || + grpc_parse_ipv6_hostport(hostport.c_str(), &addr, + false /* log errors */)) { + // Early out if the target is an ipv4 or ipv6 literal. + std::vector result; + result.emplace_back(reinterpret_cast(addr.addr), addr.len); + event_engine_->Run( + [callback = std::move(callback), result = std::move(result)]() mutable { + callback(std::move(result)); + }); + return; + } + grpc_core::MutexLock lock(&mutex_); + callback_map_.emplace(++id_, std::move(callback)); + auto* resolver_arg = new HostnameQueryArg(this, id_, name, port); + if (IsIpv6LoopbackAvailable()) { + ares_gethostbyname(channel_, std::string(host).c_str(), AF_UNSPEC, + &AresResolver::OnHostbynameDoneLocked, resolver_arg); + } else { + ares_gethostbyname(channel_, std::string(host).c_str(), AF_INET, + &AresResolver::OnHostbynameDoneLocked, resolver_arg); + } + CheckSocketsLocked(); + MaybeStartTimerLocked(); +} + +void AresResolver::LookupSRV( + absl::string_view name, + EventEngine::DNSResolver::LookupSRVCallback callback) { + absl::string_view host; + absl::string_view port; + if (!grpc_core::SplitHostPort(name, &host, &port)) { + event_engine_->Run( + [callback = std::move(callback), + status = absl::InvalidArgumentError(absl::StrCat( + "Unparseable name: ", name))]() mutable { callback(status); }); + return; + } + GPR_ASSERT(!host.empty()); + // Don't query for SRV records if the target is "localhost" + if (absl::EqualsIgnoreCase(host, "localhost")) { + event_engine_->Run([callback = std::move(callback)]() mutable { + callback(std::vector()); + }); + return; + } + grpc_core::MutexLock lock(&mutex_); + callback_map_.emplace(++id_, std::move(callback)); + auto* resolver_arg = new QueryArg(this, id_, host); + ares_query(channel_, std::string(host).c_str(), ns_c_in, ns_t_srv, + &AresResolver::OnSRVQueryDoneLocked, resolver_arg); + CheckSocketsLocked(); + MaybeStartTimerLocked(); +} + +void AresResolver::LookupTXT( + absl::string_view name, + EventEngine::DNSResolver::LookupTXTCallback callback) { + absl::string_view host; + absl::string_view port; + if (!grpc_core::SplitHostPort(name, &host, &port)) { + event_engine_->Run( + [callback = std::move(callback), + status = absl::InvalidArgumentError(absl::StrCat( + "Unparseable name: ", name))]() mutable { callback(status); }); + return; + } + GPR_ASSERT(!host.empty()); + // Don't query for TXT records if the target is "localhost" + if (absl::EqualsIgnoreCase(host, "localhost")) { + event_engine_->Run([callback = std::move(callback)]() mutable { + callback(std::vector()); + }); + return; + } + grpc_core::MutexLock lock(&mutex_); + callback_map_.emplace(++id_, std::move(callback)); + auto* resolver_arg = new QueryArg(this, id_, host); + ares_search(channel_, std::string(host).c_str(), ns_c_in, ns_t_txt, + &AresResolver::OnTXTDoneLocked, resolver_arg); + CheckSocketsLocked(); + MaybeStartTimerLocked(); +} + +AresResolver::AresResolver( + std::unique_ptr polled_fd_factory, + std::shared_ptr event_engine, ares_channel channel) + : grpc_core::InternallyRefCounted( + GRPC_TRACE_FLAG_ENABLED(grpc_trace_ares_resolver) ? "AresResolver" + : nullptr), + channel_(channel), + polled_fd_factory_(std::move(polled_fd_factory)), + event_engine_(std::move(event_engine)) {} + +void AresResolver::CheckSocketsLocked() { + FdNodeList new_list; + if (!shutting_down_) { + ares_socket_t socks[ARES_GETSOCK_MAXNUM]; + int socks_bitmask = ares_getsock(channel_, socks, ARES_GETSOCK_MAXNUM); + for (size_t i = 0; i < ARES_GETSOCK_MAXNUM; i++) { + if (ARES_GETSOCK_READABLE(socks_bitmask, i) || + ARES_GETSOCK_WRITABLE(socks_bitmask, i)) { + auto iter = std::find_if( + fd_node_list_.begin(), fd_node_list_.end(), + [sock = socks[i]](const auto& node) { return node->as == sock; }); + if (iter == fd_node_list_.end()) { + new_list.push_back(std::make_unique( + socks[i], polled_fd_factory_->NewGrpcPolledFdLocked(socks[i]))); + GRPC_ARES_RESOLVER_TRACE_LOG("request:%p new fd: %d", this, socks[i]); + } else { + new_list.splice(new_list.end(), fd_node_list_, iter); + } + FdNode* fd_node = new_list.back().get(); + if (ARES_GETSOCK_READABLE(socks_bitmask, i) && + !fd_node->readable_registered) { + fd_node->readable_registered = true; + if (fd_node->polled_fd->IsFdStillReadableLocked()) { + // If c-ares is interested to read and the socket already has data + // available for read, schedules OnReadable directly here. This is + // to cope with the edge-triggered poller not getting an event if no + // new data arrives and c-ares hasn't read all the data in the + // previous ares_process_fd. + GRPC_ARES_RESOLVER_TRACE_LOG( + "request:%p schedule read directly on: %d", this, fd_node->as); + event_engine_->Run( + [self = Ref(DEBUG_LOCATION, "CheckSocketsLocked"), + fd_node]() mutable { + self->OnReadable(fd_node, absl::OkStatus()); + }); + } else { + // Otherwise register with the poller for readable event. + GRPC_ARES_RESOLVER_TRACE_LOG("request:%p notify read on: %d", this, + fd_node->as); + fd_node->polled_fd->RegisterForOnReadableLocked( + [self = Ref(DEBUG_LOCATION, "CheckSocketsLocked"), + fd_node](absl::Status status) mutable { + self->OnReadable(fd_node, status); + }); + } + } + // Register write_closure if the socket is writable and write_closure + // has not been registered with this socket. + if (ARES_GETSOCK_WRITABLE(socks_bitmask, i) && + !fd_node->writable_registered) { + GRPC_ARES_RESOLVER_TRACE_LOG("request:%p notify write on: %d", this, + fd_node->as); + fd_node->writable_registered = true; + fd_node->polled_fd->RegisterForOnWriteableLocked( + [self = Ref(DEBUG_LOCATION, "CheckSocketsLocked"), + fd_node](absl::Status status) mutable { + self->OnWritable(fd_node, status); + }); + } + } + } + } + // Any remaining fds in fd_node_list_ were not returned by ares_getsock() + // and are therefore no longer in use, so they can be shut down and removed + // from the list. + while (!fd_node_list_.empty()) { + FdNode* fd_node = fd_node_list_.front().get(); + if (!fd_node->already_shutdown) { + GRPC_ARES_RESOLVER_TRACE_LOG("request: %p shutdown fd: %s", this, + fd_node->polled_fd->GetName()); + fd_node->polled_fd->ShutdownLocked(absl::OkStatus()); + fd_node->already_shutdown = true; + } + if (!fd_node->readable_registered && !fd_node->writable_registered) { + GRPC_ARES_RESOLVER_TRACE_LOG("request: %p delete fd: %s", this, + fd_node->polled_fd->GetName()); + fd_node_list_.pop_front(); + } else { + new_list.splice(new_list.end(), fd_node_list_, fd_node_list_.begin()); + } + } + fd_node_list_ = std::move(new_list); +} + +void AresResolver::MaybeStartTimerLocked() { + if (ares_backup_poll_alarm_handle_.has_value()) { + return; + } + // Initialize the backup poll alarm + GRPC_ARES_RESOLVER_TRACE_LOG( + "request:%p MaybeStartTimerLocked next ares process poll time in %zu ms", + this, Milliseconds(kAresBackupPollAlarmDuration)); + ares_backup_poll_alarm_handle_ = event_engine_->RunAfter( + kAresBackupPollAlarmDuration, + [self = Ref(DEBUG_LOCATION, "MaybeStartTimerLocked")]() { + self->OnAresBackupPollAlarm(); + }); +} + +void AresResolver::OnReadable(FdNode* fd_node, absl::Status status) { + grpc_core::MutexLock lock(&mutex_); + GPR_ASSERT(fd_node->readable_registered); + fd_node->readable_registered = false; + GRPC_ARES_RESOLVER_TRACE_LOG("OnReadable: fd: %d; request: %p; status: %s", + fd_node->as, this, status.ToString().c_str()); + if (status.ok() && !shutting_down_) { + ares_process_fd(channel_, fd_node->as, ARES_SOCKET_BAD); + } else { + // If error is not absl::OkStatus() or the resolution was cancelled, it + // means the fd has been shutdown or timed out. The pending lookups made + // on this request will be cancelled by the following ares_cancel(). The + // remaining file descriptors in this request will be cleaned up in the + // following Work() method. + ares_cancel(channel_); + } + CheckSocketsLocked(); +} + +void AresResolver::OnWritable(FdNode* fd_node, absl::Status status) { + grpc_core::MutexLock lock(&mutex_); + GPR_ASSERT(fd_node->writable_registered); + fd_node->writable_registered = false; + GRPC_ARES_RESOLVER_TRACE_LOG("OnWritable: fd: %d; request:%p; status: %s", + fd_node->as, this, status.ToString().c_str()); + if (status.ok() && !shutting_down_) { + ares_process_fd(channel_, ARES_SOCKET_BAD, fd_node->as); + } else { + // If error is not absl::OkStatus() or the resolution was cancelled, it + // means the fd has been shutdown or timed out. The pending lookups made + // on this request will be cancelled by the following ares_cancel(). The + // remaining file descriptors in this request will be cleaned up in the + // following Work() method. + ares_cancel(channel_); + } + CheckSocketsLocked(); +} + +// In case of non-responsive DNS servers, dropped packets, etc., c-ares has +// intelligent timeout and retry logic, which we can take advantage of by +// polling ares_process_fd on time intervals. Overall, the c-ares library is +// meant to be called into and given a chance to proceed name resolution: +// a) when fd events happen +// b) when some time has passed without fd events having happened +// For the latter, we use this backup poller. Also see +// https://github.com/grpc/grpc/pull/17688 description for more details. +void AresResolver::OnAresBackupPollAlarm() { + grpc_core::MutexLock lock(&mutex_); + ares_backup_poll_alarm_handle_.reset(); + GRPC_ARES_RESOLVER_TRACE_LOG( + "request:%p OnAresBackupPollAlarm shutting_down=%d.", this, + shutting_down_); + if (!shutting_down_) { + for (const auto& fd_node : fd_node_list_) { + if (!fd_node->already_shutdown) { + GRPC_ARES_RESOLVER_TRACE_LOG( + "request:%p OnAresBackupPollAlarm; ares_process_fd. fd=%s", this, + fd_node->polled_fd->GetName()); + ares_socket_t as = fd_node->polled_fd->GetWrappedAresSocketLocked(); + ares_process_fd(channel_, as, as); + } + } + MaybeStartTimerLocked(); + CheckSocketsLocked(); + } +} + +void AresResolver::OnHostbynameDoneLocked(void* arg, int status, + int /*timeouts*/, + struct hostent* hostent) { + std::unique_ptr hostname_qa( + static_cast(arg)); + auto* ares_resolver = hostname_qa->ares_resolver; + auto nh = ares_resolver->callback_map_.extract(hostname_qa->callback_map_id); + GPR_ASSERT(!nh.empty()); + GPR_ASSERT( + absl::holds_alternative( + nh.mapped())); + auto callback = absl::get( + std::move(nh.mapped())); + if (status != ARES_SUCCESS) { + std::string error_msg = + absl::StrFormat("address lookup failed for %s: %s", + hostname_qa->query_name, ares_strerror(status)); + GRPC_ARES_RESOLVER_TRACE_LOG("resolver:%p OnHostbynameDoneLocked: %s", + ares_resolver, error_msg.c_str()); + ares_resolver->event_engine_->Run( + [callback = std::move(callback), + status = AresStatusToAbslStatus(status, error_msg)]() mutable { + callback(status); + }); + return; + } + GRPC_ARES_RESOLVER_TRACE_LOG( + "resolver:%p OnHostbynameDoneLocked name=%s ARES_SUCCESS", ares_resolver, + hostname_qa->query_name.c_str()); + std::vector result; + for (size_t i = 0; hostent->h_addr_list[i] != nullptr; i++) { + switch (hostent->h_addrtype) { + case AF_INET6: { + size_t addr_len = sizeof(struct sockaddr_in6); + struct sockaddr_in6 addr; + memset(&addr, 0, addr_len); + memcpy(&addr.sin6_addr, hostent->h_addr_list[i], + sizeof(struct in6_addr)); + addr.sin6_family = static_cast(hostent->h_addrtype); + addr.sin6_port = htons(hostname_qa->port); + result.emplace_back(reinterpret_cast(&addr), addr_len); + char output[INET6_ADDRSTRLEN]; + ares_inet_ntop(AF_INET6, &addr.sin6_addr, output, INET6_ADDRSTRLEN); + GRPC_ARES_RESOLVER_TRACE_LOG( + "resolver:%p c-ares resolver gets a AF_INET6 result: \n" + " addr: %s\n port: %d\n sin6_scope_id: %d\n", + ares_resolver, output, hostname_qa->port, addr.sin6_scope_id); + break; + } + case AF_INET: { + size_t addr_len = sizeof(struct sockaddr_in); + struct sockaddr_in addr; + memset(&addr, 0, addr_len); + memcpy(&addr.sin_addr, hostent->h_addr_list[i], sizeof(struct in_addr)); + addr.sin_family = static_cast(hostent->h_addrtype); + addr.sin_port = htons(hostname_qa->port); + result.emplace_back(reinterpret_cast(&addr), addr_len); + char output[INET_ADDRSTRLEN]; + ares_inet_ntop(AF_INET, &addr.sin_addr, output, INET_ADDRSTRLEN); + GRPC_ARES_RESOLVER_TRACE_LOG( + "resolver:%p c-ares resolver gets a AF_INET result: \n" + " addr: %s\n port: %d\n", + ares_resolver, output, hostname_qa->port); + break; + } + } + } + ares_resolver->event_engine_->Run( + [callback = std::move(callback), result = std::move(result)]() mutable { + callback(std::move(result)); + }); +} + +void AresResolver::OnSRVQueryDoneLocked(void* arg, int status, int /*timeouts*/, + unsigned char* abuf, int alen) { + std::unique_ptr qa(static_cast(arg)); + auto* ares_resolver = qa->ares_resolver; + auto nh = ares_resolver->callback_map_.extract(qa->callback_map_id); + GPR_ASSERT(!nh.empty()); + GPR_ASSERT( + absl::holds_alternative( + nh.mapped())); + auto callback = absl::get( + std::move(nh.mapped())); + auto fail = [&](absl::string_view prefix) { + std::string error_message = absl::StrFormat( + "%s for %s: %s", prefix, qa->query_name, ares_strerror(status)); + GRPC_ARES_RESOLVER_TRACE_LOG("OnSRVQueryDoneLocked: %s", + error_message.c_str()); + ares_resolver->event_engine_->Run( + [callback = std::move(callback), + status = AresStatusToAbslStatus(status, error_message)]() mutable { + callback(status); + }); + }; + if (status != ARES_SUCCESS) { + fail("SRV lookup failed"); + return; + } + GRPC_ARES_RESOLVER_TRACE_LOG( + "resolver:%p OnSRVQueryDoneLocked name=%s ARES_SUCCESS", ares_resolver, + qa->query_name.c_str()); + struct ares_srv_reply* reply = nullptr; + status = ares_parse_srv_reply(abuf, alen, &reply); + GRPC_ARES_RESOLVER_TRACE_LOG("resolver:%p ares_parse_srv_reply: %d", + ares_resolver, status); + if (status != ARES_SUCCESS) { + fail("Failed to parse SRV reply"); + return; + } + std::vector result; + for (struct ares_srv_reply* srv_it = reply; srv_it != nullptr; + srv_it = srv_it->next) { + EventEngine::DNSResolver::SRVRecord record; + record.host = srv_it->host; + record.port = srv_it->port; + record.priority = srv_it->priority; + record.weight = srv_it->weight; + result.push_back(std::move(record)); + } + if (reply != nullptr) { + ares_free_data(reply); + } + ares_resolver->event_engine_->Run( + [callback = std::move(callback), result = std::move(result)]() mutable { + callback(std::move(result)); + }); +} + +void AresResolver::OnTXTDoneLocked(void* arg, int status, int /*timeouts*/, + unsigned char* buf, int len) { + std::unique_ptr qa(static_cast(arg)); + auto* ares_resolver = qa->ares_resolver; + auto nh = ares_resolver->callback_map_.extract(qa->callback_map_id); + GPR_ASSERT(!nh.empty()); + GPR_ASSERT( + absl::holds_alternative( + nh.mapped())); + auto callback = absl::get( + std::move(nh.mapped())); + auto fail = [&](absl::string_view prefix) { + std::string error_message = absl::StrFormat( + "%s for %s: %s", prefix, qa->query_name, ares_strerror(status)); + GRPC_ARES_RESOLVER_TRACE_LOG("resolver:%p OnTXTDoneLocked: %s", + ares_resolver, error_message.c_str()); + ares_resolver->event_engine_->Run( + [callback = std::move(callback), + status = AresStatusToAbslStatus(status, error_message)]() mutable { + callback(status); + }); + }; + if (status != ARES_SUCCESS) { + fail("TXT lookup failed"); + return; + } + GRPC_ARES_RESOLVER_TRACE_LOG( + "resolver:%p OnTXTDoneLocked name=%s ARES_SUCCESS", ares_resolver, + qa->query_name.c_str()); + struct ares_txt_ext* reply = nullptr; + status = ares_parse_txt_reply_ext(buf, len, &reply); + if (status != ARES_SUCCESS) { + fail("Failed to parse TXT result"); + return; + } + std::vector result; + for (struct ares_txt_ext* part = reply; part != nullptr; part = part->next) { + if (part->record_start) { + result.emplace_back(reinterpret_cast(part->txt), part->length); + } else { + absl::StrAppend( + &result.back(), + std::string(reinterpret_cast(part->txt), part->length)); + } + } + GRPC_ARES_RESOLVER_TRACE_LOG("resolver:%p Got %zu TXT records", ares_resolver, + result.size()); + if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_ares_resolver)) { + for (const auto& record : result) { + gpr_log(GPR_INFO, "%s", record.c_str()); + } + } + // Clean up. + ares_free_data(reply); + ares_resolver->event_engine_->Run( + [callback = std::move(callback), result = std::move(result)]() mutable { + callback(std::move(result)); + }); +} + +} // namespace experimental +} // namespace grpc_event_engine + +void noop_inject_channel_config(ares_channel* /*channel*/) {} + +void (*event_engine_grpc_ares_test_only_inject_config)(ares_channel* channel) = + noop_inject_channel_config; + +#endif // GRPC_ARES == 1 diff --git a/src/core/lib/event_engine/ares_resolver.h b/src/core/lib/event_engine/ares_resolver.h new file mode 100644 index 0000000000000..dbae35cff8f46 --- /dev/null +++ b/src/core/lib/event_engine/ares_resolver.h @@ -0,0 +1,147 @@ +// Copyright 2023 The gRPC Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef GRPC_SRC_CORE_LIB_EVENT_ENGINE_ARES_RESOLVER_H +#define GRPC_SRC_CORE_LIB_EVENT_ENGINE_ARES_RESOLVER_H + +#include + +#include "src/core/lib/debug/trace.h" + +#if GRPC_ARES == 1 + +#include +#include + +#include + +#include "absl/base/thread_annotations.h" +#include "absl/container/flat_hash_map.h" +#include "absl/status/status.h" +#include "absl/status/statusor.h" +#include "absl/strings/string_view.h" +#include "absl/types/optional.h" +#include "absl/types/variant.h" + +#include +#include + +#include "src/core/lib/event_engine/grpc_polled_fd.h" +#include "src/core/lib/gprpp/orphanable.h" +#include "src/core/lib/gprpp/sync.h" + +namespace grpc_event_engine { +namespace experimental { + +extern grpc_core::TraceFlag grpc_trace_ares_resolver; + +#define GRPC_ARES_RESOLVER_TRACE_LOG(format, ...) \ + do { \ + if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_ares_resolver)) { \ + gpr_log(GPR_INFO, "(EventEngine c-ares resolver) " format, __VA_ARGS__); \ + } \ + } while (0) + +class AresResolver : public grpc_core::InternallyRefCounted { + public: + static absl::StatusOr> + CreateAresResolver(absl::string_view dns_server, + std::unique_ptr polled_fd_factory, + std::shared_ptr event_engine); + + // Do not instantiate directly -- use CreateAresResolver() instead. + AresResolver(std::unique_ptr polled_fd_factory, + std::shared_ptr event_engine, ares_channel channel); + ~AresResolver() override; + void Orphan() override ABSL_LOCKS_EXCLUDED(mutex_); + + void LookupHostname(absl::string_view name, absl::string_view default_port, + EventEngine::DNSResolver::LookupHostnameCallback callback) + ABSL_LOCKS_EXCLUDED(mutex_); + void LookupSRV(absl::string_view name, + EventEngine::DNSResolver::LookupSRVCallback callback) + ABSL_LOCKS_EXCLUDED(mutex_); + void LookupTXT(absl::string_view name, + EventEngine::DNSResolver::LookupTXTCallback callback) + ABSL_LOCKS_EXCLUDED(mutex_); + + private: + // A FdNode saves (not owns) a live socket/fd which c-ares creates, and owns a + // GrpcPolledFd object which has a platform-agnostic interface to interact + // with the poller. The liveness of the socket means that c-ares needs us to + // monitor r/w events on this socket and notifies c-ares when such events have + // happened which we achieve through the GrpcPolledFd object. FdNode also + // handles the shutdown (maybe due to socket no longer used, finished request, + // cancel or timeout) and the destruction of the poller handle. Note that + // FdNode does not own the socket and it's the c-ares' responsibility to + // close the socket (possibly through ares_destroy). + struct FdNode { + FdNode() = default; + FdNode(ares_socket_t as, GrpcPolledFd* polled_fd) + : as(as), polled_fd(polled_fd) {} + ares_socket_t as; + std::unique_ptr polled_fd; + // true if the readable closure has been registered + bool readable_registered = false; + // true if the writable closure has been registered + bool writable_registered = false; + bool already_shutdown = false; + }; + using FdNodeList = std::list>; + + using CallbackType = + absl::variant; + + void CheckSocketsLocked() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + void MaybeStartTimerLocked() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + void OnReadable(FdNode* fd_node, absl::Status status) + ABSL_LOCKS_EXCLUDED(mutex_); + void OnWritable(FdNode* fd_node, absl::Status status) + ABSL_LOCKS_EXCLUDED(mutex_); + void OnAresBackupPollAlarm() ABSL_LOCKS_EXCLUDED(mutex_); + + // These callbacks are invoked from the c-ares library, so disable thread + // safety analysis. We are guaranteed to be holding mutex_. + static void OnHostbynameDoneLocked(void* arg, int status, int /*timeouts*/, + struct hostent* hostent) + ABSL_NO_THREAD_SAFETY_ANALYSIS; + static void OnSRVQueryDoneLocked(void* arg, int status, int /*timeouts*/, + unsigned char* abuf, + int alen) ABSL_NO_THREAD_SAFETY_ANALYSIS; + static void OnTXTDoneLocked(void* arg, int status, int /*timeouts*/, + unsigned char* buf, + int len) ABSL_NO_THREAD_SAFETY_ANALYSIS; + + grpc_core::Mutex mutex_; + bool shutting_down_ ABSL_GUARDED_BY(mutex_) = false; + ares_channel channel_ ABSL_GUARDED_BY(mutex_); + FdNodeList fd_node_list_ ABSL_GUARDED_BY(mutex_); + int id_ ABSL_GUARDED_BY(mutex_) = 0; + absl::flat_hash_map callback_map_ ABSL_GUARDED_BY(mutex_); + absl::optional ares_backup_poll_alarm_handle_ + ABSL_GUARDED_BY(mutex_); + std::unique_ptr polled_fd_factory_; + std::shared_ptr event_engine_; +}; + +} // namespace experimental +} // namespace grpc_event_engine + +// Exposed in this header for C-core tests only +extern void (*event_engine_grpc_ares_test_only_inject_config)( + ares_channel* channel); + +#endif // GRPC_ARES == 1 +#endif // GRPC_SRC_CORE_LIB_EVENT_ENGINE_ARES_RESOLVER_H diff --git a/src/core/lib/event_engine/grpc_polled_fd.h b/src/core/lib/event_engine/grpc_polled_fd.h new file mode 100644 index 0000000000000..bb66089d5ada2 --- /dev/null +++ b/src/core/lib/event_engine/grpc_polled_fd.h @@ -0,0 +1,73 @@ +// Copyright 2023 The gRPC Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef GRPC_SRC_CORE_LIB_EVENT_ENGINE_GRPC_POLLED_FD_H +#define GRPC_SRC_CORE_LIB_EVENT_ENGINE_GRPC_POLLED_FD_H + +#include + +#if GRPC_ARES == 1 + +#include + +#include "absl/functional/any_invocable.h" +#include "absl/status/status.h" + +#include "src/core/lib/iomgr/error.h" + +namespace grpc_event_engine { +namespace experimental { + +// A wrapped fd that integrates with the EventEngine poller of the current +// platform. A GrpcPolledFd knows how to create grpc platform-specific poller +// handle from "ares_socket_t" sockets, and then sign up for +// readability/writeability with that poller handle, and do shutdown and +// destruction. +class GrpcPolledFd { + public: + virtual ~GrpcPolledFd() {} + // Called when c-ares library is interested and there's no pending callback + virtual void RegisterForOnReadableLocked( + absl::AnyInvocable read_closure) = 0; + // Called when c-ares library is interested and there's no pending callback + virtual void RegisterForOnWriteableLocked( + absl::AnyInvocable write_closure) = 0; + // Indicates if there is data left even after just being read from + virtual bool IsFdStillReadableLocked() = 0; + // Called once and only once. Must cause cancellation of any pending + // read/write callbacks. + virtual void ShutdownLocked(grpc_error_handle error) = 0; + // Get the underlying ares_socket_t that this was created from + virtual ares_socket_t GetWrappedAresSocketLocked() = 0; + // A unique name, for logging + virtual const char* GetName() const = 0; +}; + +// A GrpcPolledFdFactory is 1-to-1 with and owned by a GrpcAresRequest. It knows +// how to create GrpcPolledFd's for the current platform, and the +// GrpcAresRequest uses it for all of its fd's. +class GrpcPolledFdFactory { + public: + virtual ~GrpcPolledFdFactory() {} + // Creates a new wrapped fd for the current platform + virtual GrpcPolledFd* NewGrpcPolledFdLocked(ares_socket_t as) = 0; + // Optionally configures the ares channel after creation + virtual void ConfigureAresChannelLocked(ares_channel channel) = 0; +}; + +} // namespace experimental +} // namespace grpc_event_engine + +#endif // GRPC_ARES == 1 +#endif // GRPC_SRC_CORE_LIB_EVENT_ENGINE_GRPC_POLLED_FD_H diff --git a/src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h b/src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h new file mode 100644 index 0000000000000..da54dbd35178e --- /dev/null +++ b/src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h @@ -0,0 +1,112 @@ +// Copyright 2023 The gRPC Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef GRPC_SRC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_GRPC_POLLED_FD_POSIX_H +#define GRPC_SRC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_GRPC_POLLED_FD_POSIX_H + +#include + +#include "src/core/lib/iomgr/port.h" + +#if GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_ARES_EV_DRIVER) + +#include +#include + +#include +#include + +#include + +#include "absl/functional/any_invocable.h" +#include "absl/status/status.h" +#include "absl/strings/str_cat.h" + +#include "src/core/lib/event_engine/grpc_polled_fd.h" +#include "src/core/lib/event_engine/posix_engine/event_poller.h" +#include "src/core/lib/event_engine/posix_engine/posix_engine_closure.h" +#include "src/core/lib/iomgr/error.h" + +namespace grpc_event_engine { +namespace experimental { + +class GrpcPolledFdPosix : public GrpcPolledFd { + public: + GrpcPolledFdPosix(ares_socket_t as, EventHandle* handle) + : name_(absl::StrCat("c-ares fd: ", static_cast(as))), + as_(as), + handle_(handle) {} + + ~GrpcPolledFdPosix() override { + // c-ares library will close the fd. This fd may be picked up immediately by + // another thread and should not be closed by the following OrphanHandle. + int phony_release_fd; + handle_->OrphanHandle(/*on_done=*/nullptr, &phony_release_fd, + "c-ares query finished"); + } + + void RegisterForOnReadableLocked( + absl::AnyInvocable read_closure) override { + handle_->NotifyOnRead(new PosixEngineClosure(std::move(read_closure), + /*is_permanent=*/false)); + } + + void RegisterForOnWriteableLocked( + absl::AnyInvocable write_closure) override { + handle_->NotifyOnWrite(new PosixEngineClosure(std::move(write_closure), + /*is_permanent=*/false)); + } + + bool IsFdStillReadableLocked() override { + size_t bytes_available = 0; + return ioctl(handle_->WrappedFd(), FIONREAD, &bytes_available) == 0 && + bytes_available > 0; + } + + void ShutdownLocked(grpc_error_handle error) override { + handle_->ShutdownHandle(error); + } + + ares_socket_t GetWrappedAresSocketLocked() override { return as_; } + + const char* GetName() const override { return name_.c_str(); } + + private: + const std::string name_; + const ares_socket_t as_; + EventHandle* handle_; +}; + +class GrpcPolledFdFactoryPosix : public GrpcPolledFdFactory { + public: + explicit GrpcPolledFdFactoryPosix(PosixEventPoller* poller) + : poller_(poller) {} + + GrpcPolledFd* NewGrpcPolledFdLocked(ares_socket_t as) override { + return new GrpcPolledFdPosix( + as, + poller_->CreateHandle(as, "c-ares socket", poller_->CanTrackErrors())); + } + + void ConfigureAresChannelLocked(ares_channel /*channel*/) override {} + + private: + PosixEventPoller* poller_; +}; + +} // namespace experimental +} // namespace grpc_event_engine + +#endif // GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_ARES_EV_DRIVER) +#endif // GRPC_SRC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_GRPC_POLLED_FD_POSIX_H diff --git a/src/core/lib/event_engine/posix_engine/posix_engine.cc b/src/core/lib/event_engine/posix_engine/posix_engine.cc index a1d217cd3bd92..8e71e435f9499 100644 --- a/src/core/lib/event_engine/posix_engine/posix_engine.cc +++ b/src/core/lib/event_engine/posix_engine/posix_engine.cc @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -37,8 +38,10 @@ #include #include "src/core/lib/debug/trace.h" +#include "src/core/lib/event_engine/grpc_polled_fd.h" #include "src/core/lib/event_engine/poller.h" #include "src/core/lib/event_engine/posix.h" +#include "src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h" #include "src/core/lib/event_engine/posix_engine/tcp_socket_utils.h" #include "src/core/lib/event_engine/posix_engine/timer.h" #include "src/core/lib/event_engine/tcp_socket_utils.h" @@ -487,10 +490,49 @@ EventEngine::TaskHandle PosixEventEngine::RunAfterInternal( return handle; } +#if GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_TCP) + +PosixEventEngine::PosixDNSResolver::PosixDNSResolver( + grpc_core::OrphanablePtr ares_resolver) + : ares_resolver_(std::move(ares_resolver)) {} + +void PosixEventEngine::PosixDNSResolver::LookupHostname( + LookupHostnameCallback on_resolve, absl::string_view name, + absl::string_view default_port) { + ares_resolver_->LookupHostname(name, default_port, std::move(on_resolve)); +} + +void PosixEventEngine::PosixDNSResolver::LookupSRV(LookupSRVCallback on_resolve, + absl::string_view name) { + ares_resolver_->LookupSRV(name, std::move(on_resolve)); +} + +void PosixEventEngine::PosixDNSResolver::LookupTXT(LookupTXTCallback on_resolve, + absl::string_view name) { + ares_resolver_->LookupTXT(name, std::move(on_resolve)); +} + +#endif // GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_TCP) + absl::StatusOr> PosixEventEngine::GetDNSResolver( - EventEngine::DNSResolver::ResolverOptions const& /*options*/) { + const EventEngine::DNSResolver::ResolverOptions& options) { +#if GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_TCP) + auto ares_resolver = AresResolver::CreateAresResolver( + options.dns_server, + std::make_unique(poller_manager_->Poller()), + shared_from_this()); + if (!ares_resolver.ok()) { + return ares_resolver.status(); + } + return std::make_unique( + std::move(*ares_resolver)); +#else // GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_TCP) + // TODO(yijiem): Implement a basic A/AAAA-only native resolver in + // PosixEventEngine. + (void)options; grpc_core::Crash("unimplemented"); +#endif // GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_TCP) } bool PosixEventEngine::IsWorkerThread() { grpc_core::Crash("unimplemented"); } diff --git a/src/core/lib/event_engine/posix_engine/posix_engine.h b/src/core/lib/event_engine/posix_engine/posix_engine.h index 7fc40a1d33a74..bd28bde9509f5 100644 --- a/src/core/lib/event_engine/posix_engine/posix_engine.h +++ b/src/core/lib/event_engine/posix_engine/posix_engine.h @@ -34,11 +34,13 @@ #include #include +#include "src/core/lib/event_engine/ares_resolver.h" #include "src/core/lib/event_engine/handle_containers.h" #include "src/core/lib/event_engine/posix.h" #include "src/core/lib/event_engine/posix_engine/event_poller.h" #include "src/core/lib/event_engine/posix_engine/timer_manager.h" #include "src/core/lib/event_engine/thread_pool/thread_pool.h" +#include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/gprpp/sync.h" #include "src/core/lib/iomgr/port.h" #include "src/core/lib/surface/init_internally.h" @@ -138,7 +140,11 @@ class PosixEventEngine final : public PosixEventEngineWithFdSupport, public: class PosixDNSResolver : public EventEngine::DNSResolver { public: - ~PosixDNSResolver() override; + PosixDNSResolver() = delete; +#if GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_TCP) + explicit PosixDNSResolver( + grpc_core::OrphanablePtr ares_resolver); +#endif // GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_TCP) void LookupHostname(LookupHostnameCallback on_resolve, absl::string_view name, absl::string_view default_port) override; @@ -146,6 +152,11 @@ class PosixEventEngine final : public PosixEventEngineWithFdSupport, absl::string_view name) override; void LookupTXT(LookupTXTCallback on_resolve, absl::string_view name) override; + +#if GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_TCP) + private: + grpc_core::OrphanablePtr ares_resolver_; +#endif // GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_TCP) }; #ifdef GRPC_POSIX_SOCKET_TCP diff --git a/src/core/lib/experiments/experiments.yaml b/src/core/lib/experiments/experiments.yaml index 9c5a6121f905b..f34ffc7c4f0ee 100644 --- a/src/core/lib/experiments/experiments.yaml +++ b/src/core/lib/experiments/experiments.yaml @@ -119,7 +119,7 @@ If set, use EventEngine DNSResolver for client channel resolution expiry: 2023/10/01 owner: yijiem@google.com - test_tags: [] + test_tags: ["cancel_ares_query_test", "resolver_component_tests_runner_invoker"] allow_in_fuzzing_config: false - name: work_stealing description: diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index eadfa0e6e41e4..468e401a36ad9 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -491,6 +491,7 @@ 'src/core/lib/debug/stats.cc', 'src/core/lib/debug/stats_data.cc', 'src/core/lib/debug/trace.cc', + 'src/core/lib/event_engine/ares_resolver.cc', 'src/core/lib/event_engine/cf_engine/cf_engine.cc', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc', 'src/core/lib/event_engine/channel_args_endpoint_config.cc', diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index ea308132378a3..4f058f20ece48 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -82,7 +82,11 @@ deps.append("${_gRPC_ADDRESS_SORTING_LIBRARIES}") deps.append("${_gRPC_RE2_LIBRARIES}") deps.append("${_gRPC_UPB_LIBRARIES}") + # TODO(yijiem): These targets depend on grpc_base instead of grpc. Since we don't populate grpc_base as a cmake target, the sources all get collapsed into these targets. This workaround adds c-ares and/or re2 dependencies to these targets. We should clean this up. + if target_dict['name'] in ['frame_test']: + deps.append("${_gRPC_CARES_LIBRARIES}") if target_dict['name'] in ['grpc_authorization_provider']: + deps.append("${_gRPC_CARES_LIBRARIES}") deps.append("${_gRPC_RE2_LIBRARIES}") deps.append("${_gRPC_ALLTARGETS_LIBRARIES}") for d in target_dict.get('deps', []): diff --git a/templates/test/cpp/naming/resolver_component_tests_defs.include b/templates/test/cpp/naming/resolver_component_tests_defs.include index 94d403d52dd16..6877f6a5b09c4 100644 --- a/templates/test/cpp/naming/resolver_component_tests_defs.include +++ b/templates/test/cpp/naming/resolver_component_tests_defs.include @@ -1,4 +1,4 @@ -<%def name="resolver_component_tests(tests)">#!/usr/bin/env python +<%def name="resolver_component_tests(tests)">#!/usr/bin/env python3 # Copyright 2015 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -58,6 +58,9 @@ if cur_resolver and cur_resolver != 'ares': test_runner_log('Exit 1 without running tests.') sys.exit(1) os.environ.update({'GRPC_TRACE': 'cares_resolver,cares_address_sorting'}) +experiments = os.environ.get('GRPC_EXPERIMENTS') +if experiments is not None and 'event_engine_dns' in experiments: + os.environ.update({'GRPC_TRACE': 'event_engine_client_channel_resolver,cares_resolver'}) def wait_until_dns_server_is_up(args, dns_server_subprocess, diff --git a/test/core/event_engine/test_suite/BUILD b/test/core/event_engine/test_suite/BUILD index d3c3f6ac82cf4..cc485a4d9a269 100644 --- a/test/core/event_engine/test_suite/BUILD +++ b/test/core/event_engine/test_suite/BUILD @@ -50,6 +50,7 @@ grpc_cc_test( "//test/core/event_engine:event_engine_test_utils", "//test/core/event_engine/test_suite/posix:oracle_event_engine_posix", "//test/core/event_engine/test_suite/tests:client", + "//test/core/event_engine/test_suite/tests:dns", "//test/core/event_engine/test_suite/tests:server", "//test/core/event_engine/test_suite/tests:timer", ], diff --git a/test/core/event_engine/test_suite/tests/BUILD b/test/core/event_engine/test_suite/tests/BUILD index ece7abf8cfb72..ef297860a97d9 100644 --- a/test/core/event_engine/test_suite/tests/BUILD +++ b/test/core/event_engine/test_suite/tests/BUILD @@ -54,9 +54,27 @@ grpc_cc_library( testonly = True, srcs = ["dns_test.cc"], hdrs = ["dns_test.h"], + data = [ + "dns_test_record_groups.yaml", + "//test/cpp/naming/utils:dns_resolver", + "//test/cpp/naming/utils:dns_server", + "//test/cpp/naming/utils:health_check", + "//test/cpp/naming/utils:tcp_connect", + ], + external_deps = [ + "absl/status:statusor", + "absl/strings", + "absl/strings:str_format", + "address_sorting", + ], deps = [ + "//src/core:env", "//test/core/event_engine:event_engine_test_utils", "//test/core/event_engine/test_suite:event_engine_test_framework", + "//test/core/util:fake_udp_and_tcp_server", + "//test/core/util:grpc_test_util_base", + "//test/cpp/util:get_grpc_test_runfile_dir", + "//test/cpp/util:test_util", ], alwayslink = 1, ) diff --git a/test/core/event_engine/test_suite/tests/dns_test.cc b/test/core/event_engine/test_suite/tests/dns_test.cc index 798a1871efb4f..cbd48e26bc775 100644 --- a/test/core/event_engine/test_suite/tests/dns_test.cc +++ b/test/core/event_engine/test_suite/tests/dns_test.cc @@ -12,10 +12,36 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +// IWYU pragma: no_include +// IWYU pragma: no_include -#include "src/core/lib/iomgr/exec_ctx.h" +#include +#include +#include +#include +#include +#include +#include + +#include "absl/status/status.h" +#include "absl/status/statusor.h" +#include "absl/strings/str_format.h" +#include "absl/strings/str_join.h" +#include "absl/strings/string_view.h" +#include "absl/types/optional.h" +#include "gmock/gmock.h" +#include "gtest/gtest.h" + +#include + +#include "src/core/lib/event_engine/tcp_socket_utils.h" +#include "src/core/lib/gprpp/notification.h" +#include "src/core/lib/iomgr/sockaddr.h" #include "test/core/event_engine/test_suite/event_engine_test_framework.h" +#include "test/core/util/fake_udp_and_tcp_server.h" +#include "test/core/util/port.h" +#include "test/cpp/util/get_grpc_test_runfile_dir.h" +#include "test/cpp/util/subprocess.h" namespace grpc_event_engine { namespace experimental { @@ -25,7 +51,493 @@ void InitDNSTests() {} } // namespace experimental } // namespace grpc_event_engine +#ifdef GPR_WINDOWS class EventEngineDNSTest : public EventEngineTest {}; -// TODO(hork): establish meaningful tests -TEST_F(EventEngineDNSTest, TODO) { grpc_core::ExecCtx exec_ctx; } +// TODO(yijiem): make the test run on Windows +TEST_F(EventEngineDNSTest, TODO) {} +#else + +namespace { + +using grpc_event_engine::experimental::EventEngine; +using grpc_event_engine::experimental::URIToResolvedAddress; +using SRVRecord = EventEngine::DNSResolver::SRVRecord; +using testing::ElementsAre; +using testing::Pointwise; +using testing::SizeIs; +using testing::UnorderedPointwise; + +// TODO(yijiem): make this portable for Windows +constexpr char kDNSTestRecordGroupsYamlPath[] = + "test/core/event_engine/test_suite/tests/dns_test_record_groups.yaml"; +// Invoke bazel's executable links to the .sh and .py scripts (don't use +// the .sh and .py suffixes) to make sure that we're using bazel's test +// environment. +constexpr char kDNSServerRelPath[] = "test/cpp/naming/utils/dns_server"; +constexpr char kDNSResolverRelPath[] = "test/cpp/naming/utils/dns_resolver"; +constexpr char kTCPConnectRelPath[] = "test/cpp/naming/utils/tcp_connect"; +constexpr char kHealthCheckRelPath[] = "test/cpp/naming/utils/health_check"; + +MATCHER(ResolvedAddressEq, "") { + const auto& addr0 = std::get<0>(arg); + const auto& addr1 = std::get<1>(arg); + return addr0.size() == addr1.size() && + memcmp(addr0.address(), addr1.address(), addr0.size()) == 0; +} + +MATCHER(SRVRecordEq, "") { + const auto& arg0 = std::get<0>(arg); + const auto& arg1 = std::get<1>(arg); + return arg0.host == arg1.host && arg0.port == arg1.port && + arg0.priority == arg1.priority && arg0.weight == arg1.weight; +} + +MATCHER(StatusCodeEq, "") { + return std::get<0>(arg).code() == std::get<1>(arg); +} + +} // namespace + +class EventEngineDNSTest : public EventEngineTest { + protected: + static void SetUpTestSuite() { + std::string test_records_path = kDNSTestRecordGroupsYamlPath; + std::string dns_server_path = kDNSServerRelPath; + std::string dns_resolver_path = kDNSResolverRelPath; + std::string tcp_connect_path = kTCPConnectRelPath; + std::string health_check_path = kHealthCheckRelPath; + absl::optional runfile_dir = grpc::GetGrpcTestRunFileDir(); + if (runfile_dir.has_value()) { + // We sure need a portable filesystem lib for this to work on Windows. + test_records_path = absl::StrJoin({*runfile_dir, test_records_path}, "/"); + dns_server_path = absl::StrJoin({*runfile_dir, dns_server_path}, "/"); + dns_resolver_path = absl::StrJoin({*runfile_dir, dns_resolver_path}, "/"); + tcp_connect_path = absl::StrJoin({*runfile_dir, tcp_connect_path}, "/"); + health_check_path = absl::StrJoin({*runfile_dir, health_check_path}, "/"); + } else { + // Invoke the .py scripts directly where they are in source code if we are + // not running with bazel. + dns_server_path += ".py"; + dns_resolver_path += ".py"; + tcp_connect_path += ".py"; + health_check_path += ".py"; + } + // 1. launch dns_server + int port = grpc_pick_unused_port_or_die(); + // -p -r + dns_server_.server_process = new grpc::SubProcess( + {dns_server_path, "-p", std::to_string(port), "-r", test_records_path}); + dns_server_.port = port; + + // 2. wait until dns_server is up (health check) + grpc::SubProcess health_check({ + health_check_path, + "-p", + std::to_string(port), + "--dns_resolver_bin_path", + dns_resolver_path, + "--tcp_connect_bin_path", + tcp_connect_path, + }); + int status = health_check.Join(); + // TODO(yijiem): make this portable for Windows + ASSERT_TRUE(WIFEXITED(status) && WEXITSTATUS(status) == 0); + } + + static void TearDownTestSuite() { + dns_server_.server_process->Interrupt(); + dns_server_.server_process->Join(); + delete dns_server_.server_process; + } + + std::unique_ptr CreateDefaultDNSResolver() { + std::shared_ptr test_ee(this->NewEventEngine()); + EventEngine::DNSResolver::ResolverOptions options; + options.dns_server = dns_server_.address(); + return *test_ee->GetDNSResolver(options); + } + + std::unique_ptr + CreateDNSResolverWithNonResponsiveServer() { + using FakeUdpAndTcpServer = grpc_core::testing::FakeUdpAndTcpServer; + // Start up fake non responsive DNS server + fake_dns_server_ = std::make_unique( + FakeUdpAndTcpServer::AcceptMode::kWaitForClientToSendFirstBytes, + FakeUdpAndTcpServer::CloseSocketUponCloseFromPeer); + const std::string dns_server = + absl::StrFormat("[::1]:%d", fake_dns_server_->port()); + std::shared_ptr test_ee(this->NewEventEngine()); + EventEngine::DNSResolver::ResolverOptions options; + options.dns_server = dns_server; + return *test_ee->GetDNSResolver(options); + } + + std::unique_ptr + CreateDNSResolverWithoutSpecifyingServer() { + std::shared_ptr test_ee(this->NewEventEngine()); + EventEngine::DNSResolver::ResolverOptions options; + return *test_ee->GetDNSResolver(options); + } + + struct DNSServer { + std::string address() { return "127.0.0.1:" + std::to_string(port); } + int port; + grpc::SubProcess* server_process; + }; + grpc_core::Notification dns_resolver_signal_; + + private: + static DNSServer dns_server_; + std::unique_ptr fake_dns_server_; +}; + +EventEngineDNSTest::DNSServer EventEngineDNSTest::dns_server_; + +TEST_F(EventEngineDNSTest, QueryNXHostname) { + auto dns_resolver = CreateDefaultDNSResolver(); + dns_resolver->LookupHostname( + [this](auto result) { + ASSERT_FALSE(result.ok()); + EXPECT_EQ(result.status(), + absl::NotFoundError("address lookup failed for " + "nonexisting-target.dns-test.event-" + "engine.: Domain name not found")); + dns_resolver_signal_.Notify(); + }, + "nonexisting-target.dns-test.event-engine.", /*default_port=*/"443"); + dns_resolver_signal_.WaitForNotification(); +} + +TEST_F(EventEngineDNSTest, QueryWithIPLiteral) { + auto dns_resolver = CreateDefaultDNSResolver(); + dns_resolver->LookupHostname( + [this](auto result) { + ASSERT_TRUE(result.ok()); + EXPECT_THAT(*result, + Pointwise(ResolvedAddressEq(), + {*URIToResolvedAddress("ipv4:4.3.2.1:1234")})); + dns_resolver_signal_.Notify(); + }, + "4.3.2.1:1234", + /*default_port=*/""); + dns_resolver_signal_.WaitForNotification(); +} + +TEST_F(EventEngineDNSTest, QueryARecord) { + auto dns_resolver = CreateDefaultDNSResolver(); + dns_resolver->LookupHostname( + [this](auto result) { + ASSERT_TRUE(result.ok()); + EXPECT_THAT(*result, UnorderedPointwise( + ResolvedAddressEq(), + {*URIToResolvedAddress("ipv4:1.2.3.4:443"), + *URIToResolvedAddress("ipv4:1.2.3.5:443"), + *URIToResolvedAddress("ipv4:1.2.3.6:443")})); + dns_resolver_signal_.Notify(); + }, + "ipv4-only-multi-target.dns-test.event-engine.", + /*default_port=*/"443"); + dns_resolver_signal_.WaitForNotification(); +} + +TEST_F(EventEngineDNSTest, QueryAAAARecord) { + auto dns_resolver = CreateDefaultDNSResolver(); + dns_resolver->LookupHostname( + [this](auto result) { + ASSERT_TRUE(result.ok()); + EXPECT_THAT( + *result, + UnorderedPointwise( + ResolvedAddressEq(), + {*URIToResolvedAddress("ipv6:[2607:f8b0:400a:801::1002]:443"), + *URIToResolvedAddress("ipv6:[2607:f8b0:400a:801::1003]:443"), + *URIToResolvedAddress( + "ipv6:[2607:f8b0:400a:801::1004]:443")})); + dns_resolver_signal_.Notify(); + }, + "ipv6-only-multi-target.dns-test.event-engine.:443", + /*default_port=*/""); + dns_resolver_signal_.WaitForNotification(); +} + +TEST_F(EventEngineDNSTest, TestAddressSorting) { + auto dns_resolver = CreateDefaultDNSResolver(); + dns_resolver->LookupHostname( + [this](auto result) { + ASSERT_TRUE(result.ok()); + EXPECT_THAT( + *result, + Pointwise(ResolvedAddressEq(), + {*URIToResolvedAddress("ipv6:[::1]:1234"), + *URIToResolvedAddress("ipv6:[2002::1111]:1234")})); + dns_resolver_signal_.Notify(); + }, + "ipv6-loopback-preferred-target.dns-test.event-engine.:1234", + /*default_port=*/""); + dns_resolver_signal_.WaitForNotification(); +} + +TEST_F(EventEngineDNSTest, QuerySRVRecord) { + const SRVRecord kExpectedRecords[] = { + {/*host=*/"ipv4-only-multi-target.dns-test.event-engine", /*port=*/1234, + /*priority=*/0, /*weight=*/0}, + {"ipv6-only-multi-target.dns-test.event-engine", 1234, 0, 0}, + }; + + auto dns_resolver = CreateDefaultDNSResolver(); + dns_resolver->LookupSRV( + [&kExpectedRecords, this](auto result) { + ASSERT_TRUE(result.ok()); + EXPECT_THAT(*result, Pointwise(SRVRecordEq(), kExpectedRecords)); + dns_resolver_signal_.Notify(); + }, + "_grpclb._tcp.srv-multi-target.dns-test.event-engine."); + dns_resolver_signal_.WaitForNotification(); +} + +TEST_F(EventEngineDNSTest, QuerySRVRecordWithLocalhost) { + auto dns_resolver = CreateDefaultDNSResolver(); + dns_resolver->LookupSRV( + [this](auto result) { + ASSERT_TRUE(result.ok()); + EXPECT_THAT(*result, SizeIs(0)); + dns_resolver_signal_.Notify(); + }, + "localhost:1000"); + dns_resolver_signal_.WaitForNotification(); +} + +TEST_F(EventEngineDNSTest, QueryTXTRecord) { + // clang-format off + const std::string kExpectedRecord = + "grpc_config=[{" + "\"serviceConfig\":{" + "\"loadBalancingPolicy\":\"round_robin\"," + "\"methodConfig\":[{" + "\"name\":[{" + "\"method\":\"Foo\"," + "\"service\":\"SimpleService\"" + "}]," + "\"waitForReady\":true" + "}]" + "}" + "}]"; + // clang-format on + + auto dns_resolver = CreateDefaultDNSResolver(); + dns_resolver->LookupTXT( + [&kExpectedRecord, this](auto result) { + ASSERT_TRUE(result.ok()); + EXPECT_THAT(*result, + ElementsAre(kExpectedRecord, "other_config=other config")); + dns_resolver_signal_.Notify(); + }, + "_grpc_config.simple-service.dns-test.event-engine."); + dns_resolver_signal_.WaitForNotification(); +} + +TEST_F(EventEngineDNSTest, QueryTXTRecordWithLocalhost) { + auto dns_resolver = CreateDefaultDNSResolver(); + dns_resolver->LookupTXT( + [this](auto result) { + ASSERT_TRUE(result.ok()); + EXPECT_THAT(*result, SizeIs(0)); + dns_resolver_signal_.Notify(); + }, + "localhost:1000"); + dns_resolver_signal_.WaitForNotification(); +} + +TEST_F(EventEngineDNSTest, TestCancelActiveDNSQuery) { + const std::string name = "dont-care-since-wont-be-resolved.test.com:1234"; + auto dns_resolver = CreateDNSResolverWithNonResponsiveServer(); + dns_resolver->LookupHostname( + [this](auto result) { + ASSERT_FALSE(result.ok()); + EXPECT_EQ(result.status(), + absl::CancelledError("address lookup failed for " + "dont-care-since-wont-be-resolved.test." + "com:1234: DNS query cancelled")); + dns_resolver_signal_.Notify(); + }, + name, "1234"); + dns_resolver.reset(); + dns_resolver_signal_.WaitForNotification(); +} + +#define EXPECT_SUCCESS() \ + do { \ + EXPECT_TRUE(result.ok()); \ + EXPECT_FALSE(result->empty()); \ + } while (0) + +// The following tests are almost 1-to-1 ported from +// test/core/iomgr/resolve_address_test.cc (except tests for the native DNS +// resolver and tests that would not make sense using the +// EventEngine::DNSResolver API). + +// START +TEST_F(EventEngineDNSTest, LocalHost) { + auto dns_resolver = CreateDNSResolverWithoutSpecifyingServer(); + dns_resolver->LookupHostname( + [this](auto result) { + EXPECT_SUCCESS(); + dns_resolver_signal_.Notify(); + }, + "localhost:1", ""); + dns_resolver_signal_.WaitForNotification(); +} + +TEST_F(EventEngineDNSTest, DefaultPort) { + auto dns_resolver = CreateDNSResolverWithoutSpecifyingServer(); + dns_resolver->LookupHostname( + [this](auto result) { + EXPECT_SUCCESS(); + dns_resolver_signal_.Notify(); + }, + "localhost", "1"); + dns_resolver_signal_.WaitForNotification(); +} + +// This test assumes the environment has an ipv6 loopback +TEST_F(EventEngineDNSTest, LocalhostResultHasIPv6First) { + auto dns_resolver = CreateDNSResolverWithoutSpecifyingServer(); + dns_resolver->LookupHostname( + [this](auto result) { + EXPECT_TRUE(result.ok()); + EXPECT_TRUE(!result->empty() && + (*result)[0].address()->sa_family == AF_INET6); + dns_resolver_signal_.Notify(); + }, + "localhost:1", ""); + dns_resolver_signal_.WaitForNotification(); +} + +TEST_F(EventEngineDNSTest, NonNumericDefaultPort) { + auto dns_resolver = CreateDNSResolverWithoutSpecifyingServer(); + dns_resolver->LookupHostname( + [this](auto result) { + EXPECT_SUCCESS(); + dns_resolver_signal_.Notify(); + }, + "localhost", "http"); + dns_resolver_signal_.WaitForNotification(); +} + +TEST_F(EventEngineDNSTest, MissingDefaultPort) { + auto dns_resolver = CreateDNSResolverWithoutSpecifyingServer(); + dns_resolver->LookupHostname( + [this](auto result) { + EXPECT_FALSE(result.ok()); + dns_resolver_signal_.Notify(); + }, + "localhost", ""); + dns_resolver_signal_.WaitForNotification(); +} + +TEST_F(EventEngineDNSTest, IPv6WithPort) { + auto dns_resolver = CreateDNSResolverWithoutSpecifyingServer(); + dns_resolver->LookupHostname( + [this](auto result) { + EXPECT_SUCCESS(); + dns_resolver_signal_.Notify(); + }, + "[2001:db8::1]:1", ""); + dns_resolver_signal_.WaitForNotification(); +} + +void TestIPv6WithoutPort(std::unique_ptr dns_resolver, + grpc_core::Notification* barrier, + absl::string_view target) { + dns_resolver->LookupHostname( + [barrier](auto result) { + EXPECT_TRUE(result.ok()); + EXPECT_FALSE(result->empty()); + barrier->Notify(); + }, + target, "80"); + barrier->WaitForNotification(); +} + +TEST_F(EventEngineDNSTest, IPv6WithoutPortNoBrackets) { + TestIPv6WithoutPort(CreateDNSResolverWithoutSpecifyingServer(), + &dns_resolver_signal_, "2001:db8::1"); +} + +TEST_F(EventEngineDNSTest, IPv6WithoutPortWithBrackets) { + TestIPv6WithoutPort(CreateDNSResolverWithoutSpecifyingServer(), + &dns_resolver_signal_, "[2001:db8::1]"); +} + +TEST_F(EventEngineDNSTest, IPv6WithoutPortV4MappedV6) { + TestIPv6WithoutPort(CreateDNSResolverWithoutSpecifyingServer(), + &dns_resolver_signal_, "2001:db8::1.2.3.4"); +} + +void TestInvalidIPAddress( + std::unique_ptr dns_resolver, + grpc_core::Notification* barrier, absl::string_view target) { + dns_resolver->LookupHostname( + [barrier](auto result) { + EXPECT_FALSE(result.ok()); + barrier->Notify(); + }, + target, ""); + barrier->WaitForNotification(); +} + +TEST_F(EventEngineDNSTest, InvalidIPv4Addresses) { + TestInvalidIPAddress(CreateDNSResolverWithoutSpecifyingServer(), + &dns_resolver_signal_, "293.283.1238.3:1"); +} + +TEST_F(EventEngineDNSTest, InvalidIPv6Addresses) { + TestInvalidIPAddress(CreateDNSResolverWithoutSpecifyingServer(), + &dns_resolver_signal_, "[2001:db8::11111]:1"); +} + +void TestUnparseableHostPort( + std::unique_ptr dns_resolver, + grpc_core::Notification* barrier, absl::string_view target) { + dns_resolver->LookupHostname( + [barrier](auto result) { + EXPECT_FALSE(result.ok()); + barrier->Notify(); + }, + target, "1"); + barrier->WaitForNotification(); +} + +TEST_F(EventEngineDNSTest, UnparseableHostPortsOnlyBracket) { + TestUnparseableHostPort(CreateDNSResolverWithoutSpecifyingServer(), + &dns_resolver_signal_, "["); +} + +TEST_F(EventEngineDNSTest, UnparseableHostPortsMissingRightBracket) { + TestUnparseableHostPort(CreateDNSResolverWithoutSpecifyingServer(), + &dns_resolver_signal_, "[::1"); +} + +TEST_F(EventEngineDNSTest, UnparseableHostPortsBadPort) { + TestUnparseableHostPort(CreateDNSResolverWithoutSpecifyingServer(), + &dns_resolver_signal_, "[::1]bad"); +} + +TEST_F(EventEngineDNSTest, UnparseableHostPortsBadIPv6) { + TestUnparseableHostPort(CreateDNSResolverWithoutSpecifyingServer(), + &dns_resolver_signal_, "[1.2.3.4]"); +} + +TEST_F(EventEngineDNSTest, UnparseableHostPortsBadLocalhost) { + TestUnparseableHostPort(CreateDNSResolverWithoutSpecifyingServer(), + &dns_resolver_signal_, "[localhost]"); +} + +TEST_F(EventEngineDNSTest, UnparseableHostPortsBadLocalhostWithPort) { + TestUnparseableHostPort(CreateDNSResolverWithoutSpecifyingServer(), + &dns_resolver_signal_, "[localhost]:1"); +} +// END + +#endif // GPR_WINDOWS diff --git a/test/core/event_engine/test_suite/tests/dns_test_record_groups.yaml b/test/core/event_engine/test_suite/tests/dns_test_record_groups.yaml new file mode 100644 index 0000000000000..834962ca5e033 --- /dev/null +++ b/test/core/event_engine/test_suite/tests/dns_test_record_groups.yaml @@ -0,0 +1,21 @@ +resolver_tests_common_zone_name: dns-test.event-engine. +resolver_component_tests: +- records: + ipv4-only-multi-target: + - {TTL: '2100', data: 1.2.3.4, type: A} + - {TTL: '2100', data: 1.2.3.5, type: A} + - {TTL: '2100', data: 1.2.3.6, type: A} + ipv6-only-multi-target: + - {TTL: '2100', data: '2607:f8b0:400a:801::1002', type: AAAA} + - {TTL: '2100', data: '2607:f8b0:400a:801::1003', type: AAAA} + - {TTL: '2100', data: '2607:f8b0:400a:801::1004', type: AAAA} + ipv6-loopback-preferred-target: + - {TTL: '2100', data: '2002::1111', type: AAAA} + - {TTL: '2100', data: '::1', type: AAAA} + _grpclb._tcp.srv-multi-target: + - {TTL: '2100', data: 0 0 1234 ipv4-only-multi-target, type: SRV} + - {TTL: '2100', data: 0 0 1234 ipv6-only-multi-target, type: SRV} + _grpc_config.simple-service: + - {TTL: '2100', data: 'grpc_config=[{"serviceConfig":{"loadBalancingPolicy":"round_robin","methodConfig":[{"name":[{"method":"Foo","service":"SimpleService"}],"waitForReady":true}]}}]', + type: TXT} + - {TTL: '2100', data: 'other_config=other config', type: TXT} diff --git a/test/core/http/httpcli_test.cc b/test/core/http/httpcli_test.cc index 4e20e925c7943..519e7fd3aaf49 100644 --- a/test/core/http/httpcli_test.cc +++ b/test/core/http/httpcli_test.cc @@ -241,7 +241,7 @@ TEST_F(HttpRequestTest, Post) { int g_fake_non_responsive_dns_server_port; -void InjectNonResponsiveDNSServer(ares_channel channel) { +void InjectNonResponsiveDNSServer(ares_channel* channel) { gpr_log(GPR_DEBUG, "Injecting broken nameserver list. Bad server address:|[::1]:%d|.", g_fake_non_responsive_dns_server_port); @@ -253,7 +253,8 @@ void InjectNonResponsiveDNSServer(ares_channel channel) { dns_server_addrs[0].tcp_port = g_fake_non_responsive_dns_server_port; dns_server_addrs[0].udp_port = g_fake_non_responsive_dns_server_port; dns_server_addrs[0].next = nullptr; - GPR_ASSERT(ares_set_servers_ports(channel, dns_server_addrs) == ARES_SUCCESS); + GPR_ASSERT(ares_set_servers_ports(*channel, dns_server_addrs) == + ARES_SUCCESS); } TEST_F(HttpRequestTest, CancelGetDuringDNSResolution) { @@ -263,7 +264,7 @@ TEST_F(HttpRequestTest, CancelGetDuringDNSResolution) { kWaitForClientToSendFirstBytes, grpc_core::testing::FakeUdpAndTcpServer::CloseSocketUponCloseFromPeer); g_fake_non_responsive_dns_server_port = fake_dns_server.port(); - void (*prev_test_only_inject_config)(ares_channel channel) = + void (*prev_test_only_inject_config)(ares_channel * channel) = grpc_ares_test_only_inject_config; grpc_ares_test_only_inject_config = InjectNonResponsiveDNSServer; // Run the same test on several threads in parallel to try to trigger races diff --git a/test/core/iomgr/resolve_address_test.cc b/test/core/iomgr/resolve_address_test.cc index 2e32d903bd47a..4dd7e04f08b12 100644 --- a/test/core/iomgr/resolve_address_test.cc +++ b/test/core/iomgr/resolve_address_test.cc @@ -176,7 +176,7 @@ class ResolveAddressTest : public ::testing::Test { grpc_pollset_set* pollset_set_; // the default value of grpc_ares_test_only_inject_config, which might // be modified during a test - void (*default_inject_config_)(ares_channel channel) = nullptr; + void (*default_inject_config_)(ares_channel* channel) = nullptr; }; } // namespace @@ -390,7 +390,7 @@ namespace { int g_fake_non_responsive_dns_server_port; -void InjectNonResponsiveDNSServer(ares_channel channel) { +void InjectNonResponsiveDNSServer(ares_channel* channel) { gpr_log(GPR_DEBUG, "Injecting broken nameserver list. Bad server address:|[::1]:%d|.", g_fake_non_responsive_dns_server_port); @@ -403,7 +403,7 @@ void InjectNonResponsiveDNSServer(ares_channel channel) { dns_server_addrs[0].tcp_port = g_fake_non_responsive_dns_server_port; dns_server_addrs[0].udp_port = g_fake_non_responsive_dns_server_port; dns_server_addrs[0].next = nullptr; - ASSERT_EQ(ares_set_servers_ports(channel, dns_server_addrs), ARES_SUCCESS); + ASSERT_EQ(ares_set_servers_ports(*channel, dns_server_addrs), ARES_SUCCESS); } } // namespace diff --git a/test/cpp/naming/BUILD b/test/cpp/naming/BUILD index 32d1b462c9bca..462c0c74e33bf 100644 --- a/test/cpp/naming/BUILD +++ b/test/cpp/naming/BUILD @@ -38,6 +38,7 @@ grpc_cc_test( name = "cancel_ares_query_test", srcs = ["cancel_ares_query_test.cc"], external_deps = ["gtest"], + tags = ["cancel_ares_query_test"], deps = [ "//:gpr", "//:grpc", diff --git a/test/cpp/naming/cancel_ares_query_test.cc b/test/cpp/naming/cancel_ares_query_test.cc index c2da75a13d1f7..1e2f6287941ff 100644 --- a/test/cpp/naming/cancel_ares_query_test.cc +++ b/test/cpp/naming/cancel_ares_query_test.cc @@ -39,6 +39,7 @@ #include "src/core/lib/debug/stats.h" #include "src/core/lib/debug/stats_data.h" #include "src/core/lib/event_engine/default_event_engine.h" +#include "src/core/lib/experiments/experiments.h" #include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/orphanable.h" @@ -54,6 +55,7 @@ #include "test/core/util/fake_udp_and_tcp_server.h" #include "test/core/util/port.h" #include "test/core/util/test_config.h" +#include "test/cpp/util/test_config.h" #ifdef GPR_WINDOWS #include "src/core/lib/iomgr/sockaddr_windows.h" @@ -310,8 +312,13 @@ void TestCancelDuringActiveQuery( // The DNS resolution timeout should fire well before the // RPC's deadline expires. expected_status_code = GRPC_STATUS_UNAVAILABLE; - expected_error_message_substring = - absl::StrCat("DNS resolution failed for ", name); + if (grpc_core::IsEventEngineDnsEnabled()) { + expected_error_message_substring = + absl::StrCat("errors resolving ", name); + } else { + expected_error_message_substring = + absl::StrCat("DNS resolution failed for ", name); + } grpc_arg arg; arg.type = GRPC_ARG_INTEGER; arg.key = const_cast(GRPC_ARG_DNS_ARES_QUERY_TIMEOUT_MS); @@ -424,8 +431,9 @@ TEST_F( } // namespace int main(int argc, char** argv) { - grpc::testing::TestEnvironment env(&argc, argv); ::testing::InitGoogleTest(&argc, argv); + grpc::testing::InitTest(&argc, &argv, true); + grpc::testing::TestEnvironment env(&argc, argv); auto result = RUN_ALL_TESTS(); return result; } diff --git a/test/cpp/naming/generate_resolver_component_tests.bzl b/test/cpp/naming/generate_resolver_component_tests.bzl index 626d9c0f46f65..edd9c4e40e36a 100755 --- a/test/cpp/naming/generate_resolver_component_tests.bzl +++ b/test/cpp/naming/generate_resolver_component_tests.bzl @@ -21,6 +21,10 @@ load("//bazel:grpc_build_system.bzl", "grpc_cc_binary", "grpc_cc_test") # buildifier: disable=unnamed-macro def generate_resolver_component_tests(): + """Generate address_sorting_test and resolver_component_test suite with different configurations. + + Note that the resolver_component_test suite's configuration is 2 dimensional: security and whether to enable the event_engine_dns experiment. + """ for unsecure_build_config_suffix in ["_unsecure", ""]: grpc_cc_test( name = "address_sorting_test%s" % unsecure_build_config_suffix, @@ -58,6 +62,7 @@ def generate_resolver_component_tests(): "//:grpc++%s" % unsecure_build_config_suffix, "//:grpc%s" % unsecure_build_config_suffix, "//:gpr", + "//src/core:ares_resolver", "//test/cpp/util:test_config", ], tags = ["no_windows"], @@ -84,7 +89,7 @@ def generate_resolver_component_tests(): "//test/cpp/naming/utils:dns_server", "//test/cpp/naming/utils:dns_resolver", "//test/cpp/naming/utils:tcp_connect", - "resolver_test_record_groups.yaml", # include the transitive dependency so that the dns sever py binary can locate this + "resolver_test_record_groups.yaml", # include the transitive dependency so that the dns server py binary can locate this ], args = [ "--test_bin_name=resolver_component_test%s" % unsecure_build_config_suffix, @@ -93,5 +98,5 @@ def generate_resolver_component_tests(): # The test is highly flaky on AWS workers that we use for running ARM64 tests. # The "no_arm64" tag can be used to skip it. # (see https://github.com/grpc/grpc/issues/25289). - tags = ["no_windows", "no_mac", "no_arm64"], + tags = ["no_windows", "no_mac", "no_arm64", "resolver_component_tests_runner_invoker"], ) diff --git a/test/cpp/naming/resolver_component_test.cc b/test/cpp/naming/resolver_component_test.cc index 1316143246da6..7fe90b704e5bf 100644 --- a/test/cpp/naming/resolver_component_test.cc +++ b/test/cpp/naming/resolver_component_test.cc @@ -47,7 +47,9 @@ #include "src/core/lib/address_utils/sockaddr_utils.h" #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/config/core_configuration.h" +#include "src/core/lib/event_engine/ares_resolver.h" #include "src/core/lib/event_engine/default_event_engine.h" +#include "src/core/lib/experiments/experiments.h" #include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/host_port.h" @@ -255,11 +257,20 @@ void PollPollsetUntilRequestDone(ArgsStruct* args) { GPR_ASSERT(gpr_time_cmp(time_left, gpr_time_0(GPR_TIMESPAN)) >= 0); grpc_pollset_worker* worker = nullptr; grpc_core::ExecCtx exec_ctx; - GRPC_LOG_IF_ERROR( - "pollset_work", - grpc_pollset_work( - args->pollset, &worker, - grpc_core::Timestamp::FromTimespecRoundUp(NSecondDeadline(1)))); + if (grpc_core::IsEventEngineDnsEnabled()) { + // This essentially becomes a condition variable. + GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work( + args->pollset, &worker, + grpc_core::Timestamp::FromTimespecRoundUp(deadline))); + } else { + GRPC_LOG_IF_ERROR( + "pollset_work", + grpc_pollset_work( + args->pollset, &worker, + grpc_core::Timestamp::FromTimespecRoundUp(NSecondDeadline(1)))); + } } gpr_event_set(&args->ev, reinterpret_cast(1)); } @@ -529,7 +540,7 @@ int g_fake_non_responsive_dns_server_port = -1; // resolver. This is useful to effectively mock /etc/resolv.conf settings // (and equivalent on Windows), which unit tests don't have write permissions. // -void InjectBrokenNameServerList(ares_channel channel) { +void InjectBrokenNameServerList(ares_channel* channel) { struct ares_addr_port_node dns_server_addrs[2]; memset(dns_server_addrs, 0, sizeof(dns_server_addrs)); std::string unused_host; @@ -558,7 +569,8 @@ void InjectBrokenNameServerList(ares_channel channel) { dns_server_addrs[1].tcp_port = atoi(local_dns_server_port.c_str()); dns_server_addrs[1].udp_port = atoi(local_dns_server_port.c_str()); dns_server_addrs[1].next = nullptr; - GPR_ASSERT(ares_set_servers_ports(channel, dns_server_addrs) == ARES_SUCCESS); + GPR_ASSERT(ares_set_servers_ports(*channel, dns_server_addrs) == + ARES_SUCCESS); } void StartResolvingLocked(grpc_core::Resolver* r) { r->StartLocked(); } @@ -591,7 +603,12 @@ void RunResolvesRelevantRecordsTest( grpc_core::testing::FakeUdpAndTcpServer::CloseSocketUponCloseFromPeer); g_fake_non_responsive_dns_server_port = fake_non_responsive_dns_server->port(); - grpc_ares_test_only_inject_config = InjectBrokenNameServerList; + if (grpc_core::IsEventEngineDnsEnabled()) { + event_engine_grpc_ares_test_only_inject_config = + InjectBrokenNameServerList; + } else { + grpc_ares_test_only_inject_config = InjectBrokenNameServerList; + } whole_uri = absl::StrCat("dns:///", absl::GetFlag(FLAGS_target_name)); } else if (absl::GetFlag(FLAGS_inject_broken_nameserver_list) == "False") { gpr_log(GPR_INFO, "Specifying authority in uris to: %s", @@ -673,13 +690,15 @@ TEST(ResolverComponentTest, TestDoesntCrashOrHangWith1MsTimeout) { } // namespace int main(int argc, char** argv) { - grpc_init(); - grpc::testing::TestEnvironment env(&argc, argv); ::testing::InitGoogleTest(&argc, argv); + // Need before TestEnvironment construct for --grpc_experiments flag at + // least. grpc::testing::InitTest(&argc, &argv, true); + grpc::testing::TestEnvironment env(&argc, argv); if (absl::GetFlag(FLAGS_target_name).empty()) { grpc_core::Crash("Missing target_name param."); } + grpc_init(); auto result = RUN_ALL_TESTS(); grpc_shutdown(); return result; diff --git a/test/cpp/naming/resolver_component_tests_runner.py b/test/cpp/naming/resolver_component_tests_runner.py index 33118701d1a15..cf648ac16143d 100755 --- a/test/cpp/naming/resolver_component_tests_runner.py +++ b/test/cpp/naming/resolver_component_tests_runner.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright 2015 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -58,6 +58,9 @@ def python_args(arg_list): test_runner_log('Exit 1 without running tests.') sys.exit(1) os.environ.update({'GRPC_TRACE': 'cares_resolver,cares_address_sorting'}) +experiments = os.environ.get('GRPC_EXPERIMENTS') +if experiments is not None and 'event_engine_dns' in experiments: + os.environ.update({'GRPC_TRACE': 'event_engine_client_channel_resolver,cares_resolver'}) def wait_until_dns_server_is_up(args, dns_server_subprocess, diff --git a/test/cpp/naming/utils/BUILD b/test/cpp/naming/utils/BUILD index 02b82b03392ad..6927a29bd1b41 100644 --- a/test/cpp/naming/utils/BUILD +++ b/test/cpp/naming/utils/BUILD @@ -48,3 +48,9 @@ grpc_py_binary( testonly = True, srcs = ["tcp_connect.py"], ) + +grpc_py_binary( + name = "health_check", + testonly = True, + srcs = ["health_check.py"], +) diff --git a/test/cpp/naming/utils/dns_resolver.py b/test/cpp/naming/utils/dns_resolver.py index 91b01e856d1c2..923aec43e5f2d 100755 --- a/test/cpp/naming/utils/dns_resolver.py +++ b/test/cpp/naming/utils/dns_resolver.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2.7 +#!/usr/bin/env python3 # Copyright 2015 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test/cpp/naming/utils/dns_server.py b/test/cpp/naming/utils/dns_server.py index 02e1541875bef..f9c118df7a18e 100755 --- a/test/cpp/naming/utils/dns_server.py +++ b/test/cpp/naming/utils/dns_server.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2.7 +#!/usr/bin/env python3 # Copyright 2015 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test/cpp/naming/utils/health_check.py b/test/cpp/naming/utils/health_check.py new file mode 100644 index 0000000000000..a7950c65f6b67 --- /dev/null +++ b/test/cpp/naming/utils/health_check.py @@ -0,0 +1,121 @@ +#!/usr/bin/env python3 +# Copyright 2023 The gRPC Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import argparse +import platform +import subprocess +import sys +import time + + +def test_runner_log(msg): + sys.stderr.write("\n%s: %s\n" % (__file__, msg)) + + +def python_args(arg_list): + if platform.system() == "Windows": + return [sys.executable] + arg_list + return arg_list + + +def wait_until_dns_server_is_up(args): + for i in range(0, 30): + test_runner_log( + "Health check: attempt to connect to DNS server over TCP." + ) + tcp_connect_subprocess = subprocess.Popen( + python_args( + [ + args.tcp_connect_bin_path, + "--server_host", + "127.0.0.1", + "--server_port", + str(args.dns_server_port), + "--timeout", + str(1), + ] + ) + ) + tcp_connect_subprocess.communicate() + if tcp_connect_subprocess.returncode == 0: + test_runner_log( + ( + "Health check: attempt to make an A-record " + "query to DNS server." + ) + ) + dns_resolver_subprocess = subprocess.Popen( + python_args( + [ + args.dns_resolver_bin_path, + "--qname", + "health-check-local-dns-server-is-alive.resolver-tests.grpctestingexp", + "--server_host", + "127.0.0.1", + "--server_port", + str(args.dns_server_port), + ] + ), + stdout=subprocess.PIPE, + ) + dns_resolver_stdout, _ = dns_resolver_subprocess.communicate( + str.encode("ascii") + ) + if dns_resolver_subprocess.returncode == 0: + if "123.123.123.123".encode("ascii") in dns_resolver_stdout: + test_runner_log( + ( + "DNS server is up! " + "Successfully reached it over UDP and TCP." + ) + ) + return + time.sleep(1) + test_runner_log( + ( + "Failed to reach DNS server over TCP and/or UDP. " + "Exitting without running tests." + ) + ) + sys.exit(1) + + +def main(): + argp = argparse.ArgumentParser(description="Make DNS queries for A records") + argp.add_argument( + "-p", + "--dns_server_port", + default=None, + type=int, + help=("Port that local DNS server is listening on."), + ) + argp.add_argument( + "--dns_resolver_bin_path", + default=None, + type=str, + help=("Path to the DNS health check utility."), + ) + argp.add_argument( + "--tcp_connect_bin_path", + default=None, + type=str, + help=("Path to the TCP health check utility."), + ) + args = argp.parse_args() + wait_until_dns_server_is_up(args) + + +if __name__ == "__main__": + main() diff --git a/test/cpp/naming/utils/run_dns_server_for_lb_interop_tests.py b/test/cpp/naming/utils/run_dns_server_for_lb_interop_tests.py index 403b23dbde3ec..ccc06eaab88b4 100755 --- a/test/cpp/naming/utils/run_dns_server_for_lb_interop_tests.py +++ b/test/cpp/naming/utils/run_dns_server_for_lb_interop_tests.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2.7 +#!/usr/bin/env python3 # Copyright 2015 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test/cpp/naming/utils/tcp_connect.py b/test/cpp/naming/utils/tcp_connect.py index f06a5e4655e65..41ce399febe29 100755 --- a/test/cpp/naming/utils/tcp_connect.py +++ b/test/cpp/naming/utils/tcp_connect.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2.7 +#!/usr/bin/env python3 # Copyright 2015 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test/cpp/util/BUILD b/test/cpp/util/BUILD index 8438cf60794ba..d8aed93aa50fe 100644 --- a/test/cpp/util/BUILD +++ b/test/cpp/util/BUILD @@ -423,3 +423,19 @@ grpc_cc_test( ":test_util", ], ) + +grpc_cc_library( + name = "get_grpc_test_runfile_dir", + srcs = [ + "get_grpc_test_runfile_dir.cc", + ], + hdrs = [ + "get_grpc_test_runfile_dir.h", + ], + external_deps = [ + "absl/types:optional", + ], + deps = [ + "//src/core:env", + ], +) diff --git a/test/cpp/util/get_grpc_test_runfile_dir.cc b/test/cpp/util/get_grpc_test_runfile_dir.cc new file mode 100644 index 0000000000000..4e0ce11ca5a58 --- /dev/null +++ b/test/cpp/util/get_grpc_test_runfile_dir.cc @@ -0,0 +1,29 @@ +// Copyright 2023 The gRPC Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "test/cpp/util/get_grpc_test_runfile_dir.h" + +#include "src/core/lib/gprpp/env.h" + +namespace grpc { + +absl::optional GetGrpcTestRunFileDir() { + absl::optional test_srcdir = grpc_core::GetEnv("TEST_SRCDIR"); + if (!test_srcdir.has_value()) { + return absl::nullopt; + } + return *test_srcdir + "/com_github_grpc_grpc"; +} + +} // namespace grpc diff --git a/test/cpp/util/get_grpc_test_runfile_dir.h b/test/cpp/util/get_grpc_test_runfile_dir.h new file mode 100644 index 0000000000000..885a44e05187a --- /dev/null +++ b/test/cpp/util/get_grpc_test_runfile_dir.h @@ -0,0 +1,32 @@ +// Copyright 2023 The gRPC Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef GRPC_TEST_CPP_UTIL_GET_GRPC_TEST_RUNFILE_DIR_H +#define GRPC_TEST_CPP_UTIL_GET_GRPC_TEST_RUNFILE_DIR_H + +#include + +#include "absl/types/optional.h" + +namespace grpc { + +// Gets the absolute path of the runfile directory (a bazel/blaze concept) for a +// gRPC test. The path to the data files can be referred by joining the runfile +// directory with the workspace-relative path (e.g. +// "test/cpp/util/get_grpc_test_runfile_dir.h"). +absl::optional GetGrpcTestRunFileDir(); + +} // namespace grpc + +#endif // GRPC_TEST_CPP_UTIL_GET_GRPC_TEST_RUNFILE_DIR_H diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 92d52f2675e04..a9f3726fbfd7b 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -2060,6 +2060,8 @@ src/core/lib/debug/stats_data.cc \ src/core/lib/debug/stats_data.h \ src/core/lib/debug/trace.cc \ src/core/lib/debug/trace.h \ +src/core/lib/event_engine/ares_resolver.cc \ +src/core/lib/event_engine/ares_resolver.h \ src/core/lib/event_engine/cf_engine/cf_engine.cc \ src/core/lib/event_engine/cf_engine/cf_engine.h \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc \ @@ -2075,6 +2077,7 @@ src/core/lib/event_engine/default_event_engine_factory.h \ src/core/lib/event_engine/event_engine.cc \ src/core/lib/event_engine/forkable.cc \ src/core/lib/event_engine/forkable.h \ +src/core/lib/event_engine/grpc_polled_fd.h \ src/core/lib/event_engine/handle_containers.h \ src/core/lib/event_engine/memory_allocator.cc \ src/core/lib/event_engine/memory_allocator_factory.h \ @@ -2087,6 +2090,7 @@ src/core/lib/event_engine/posix_engine/ev_poll_posix.h \ src/core/lib/event_engine/posix_engine/event_poller.h \ src/core/lib/event_engine/posix_engine/event_poller_posix_default.cc \ src/core/lib/event_engine/posix_engine/event_poller_posix_default.h \ +src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h \ src/core/lib/event_engine/posix_engine/internal_errqueue.cc \ src/core/lib/event_engine/posix_engine/internal_errqueue.h \ src/core/lib/event_engine/posix_engine/lockfree_event.cc \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 2eae3f09ed2bc..e1778392a6213 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -1838,6 +1838,8 @@ src/core/lib/debug/stats_data.cc \ src/core/lib/debug/stats_data.h \ src/core/lib/debug/trace.cc \ src/core/lib/debug/trace.h \ +src/core/lib/event_engine/ares_resolver.cc \ +src/core/lib/event_engine/ares_resolver.h \ src/core/lib/event_engine/cf_engine/cf_engine.cc \ src/core/lib/event_engine/cf_engine/cf_engine.h \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc \ @@ -1853,6 +1855,7 @@ src/core/lib/event_engine/default_event_engine_factory.h \ src/core/lib/event_engine/event_engine.cc \ src/core/lib/event_engine/forkable.cc \ src/core/lib/event_engine/forkable.h \ +src/core/lib/event_engine/grpc_polled_fd.h \ src/core/lib/event_engine/handle_containers.h \ src/core/lib/event_engine/memory_allocator.cc \ src/core/lib/event_engine/memory_allocator_factory.h \ @@ -1865,6 +1868,7 @@ src/core/lib/event_engine/posix_engine/ev_poll_posix.h \ src/core/lib/event_engine/posix_engine/event_poller.h \ src/core/lib/event_engine/posix_engine/event_poller_posix_default.cc \ src/core/lib/event_engine/posix_engine/event_poller_posix_default.h \ +src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h \ src/core/lib/event_engine/posix_engine/internal_errqueue.cc \ src/core/lib/event_engine/posix_engine/internal_errqueue.h \ src/core/lib/event_engine/posix_engine/lockfree_event.cc \ From 2bb9aea332bf610f03a8df61c0b7db295559c9c0 Mon Sep 17 00:00:00 2001 From: Yijie Ma Date: Fri, 21 Jul 2023 15:28:54 -0700 Subject: [PATCH 032/205] [CI breakage] Fix health_check.py permission (#33815) --- test/cpp/naming/utils/health_check.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 test/cpp/naming/utils/health_check.py diff --git a/test/cpp/naming/utils/health_check.py b/test/cpp/naming/utils/health_check.py old mode 100644 new mode 100755 From f85b7c79ee704305eb7f6f28c4848113ba74646e Mon Sep 17 00:00:00 2001 From: Vignesh Babu Date: Fri, 21 Jul 2023 16:06:01 -0700 Subject: [PATCH 033/205] [experiments] Fix processing of platform specific test tags (#33749) Also adds a unit test: experiments_tag_test which should fail if the appropriate tags are not set for it. --- CMakeLists.txt | 39 ++++ bazel/experiments.bzl | 220 +++++++++++++----- bazel/grpc_build_system.bzl | 50 ++-- bazel/test_experiments.bzl | 50 ++++ build_autogenerated.yaml | 12 + src/core/lib/experiments/config.cc | 14 ++ test/core/experiments/BUILD | 23 ++ test/core/experiments/experiments_tag_test.cc | 86 +++++++ test/core/experiments/experiments_test.cc | 11 +- test/core/experiments/fixtures/experiments.cc | 4 +- test/core/experiments/fixtures/experiments.h | 13 +- .../fixtures/test_experiments.yaml | 1 + .../fixtures/test_experiments_rollout.yaml | 4 +- tools/codegen/core/experiments_compiler.py | 80 ++++--- tools/codegen/core/gen_experiments.py | 5 +- tools/remote_build/linux.bazelrc | 4 +- tools/run_tests/generated/tests.json | 24 ++ 17 files changed, 526 insertions(+), 114 deletions(-) create mode 100644 bazel/test_experiments.bzl create mode 100644 test/core/experiments/experiments_tag_test.cc diff --git a/CMakeLists.txt b/CMakeLists.txt index e4f151dad5226..c4ccaacc01634 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -965,6 +965,7 @@ if(gRPC_BUILD_TESTS) endif() add_dependencies(buildtests_cxx exception_test) add_dependencies(buildtests_cxx exec_ctx_wakeup_scheduler_test) + add_dependencies(buildtests_cxx experiments_tag_test) add_dependencies(buildtests_cxx experiments_test) add_dependencies(buildtests_cxx factory_test) add_dependencies(buildtests_cxx fake_binder_test) @@ -11305,6 +11306,44 @@ target_link_libraries(exec_ctx_wakeup_scheduler_test ) +endif() +if(gRPC_BUILD_TESTS) + +add_executable(experiments_tag_test + test/core/experiments/experiments_tag_test.cc + test/core/experiments/fixtures/experiments.cc + third_party/googletest/googletest/src/gtest-all.cc + third_party/googletest/googlemock/src/gmock-all.cc +) +target_compile_features(experiments_tag_test PUBLIC cxx_std_14) +target_include_directories(experiments_tag_test + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + ${_gRPC_RE2_INCLUDE_DIR} + ${_gRPC_SSL_INCLUDE_DIR} + ${_gRPC_UPB_GENERATED_DIR} + ${_gRPC_UPB_GRPC_GENERATED_DIR} + ${_gRPC_UPB_INCLUDE_DIR} + ${_gRPC_XXHASH_INCLUDE_DIR} + ${_gRPC_ZLIB_INCLUDE_DIR} + third_party/googletest/googletest/include + third_party/googletest/googletest + third_party/googletest/googlemock/include + third_party/googletest/googlemock + ${_gRPC_PROTO_GENS_DIR} +) + +target_link_libraries(experiments_tag_test + ${_gRPC_BASELIB_LIBRARIES} + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ZLIB_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + grpc_test_util +) + + endif() if(gRPC_BUILD_TESTS) diff --git a/bazel/experiments.bzl b/bazel/experiments.bzl index e04ba5720aeeb..67bf4b68e48a8 100644 --- a/bazel/experiments.bzl +++ b/bazel/experiments.bzl @@ -17,59 +17,175 @@ """Dictionary of tags to experiments so we know when to test different experiments.""" EXPERIMENTS = { - "dbg": { + "windows": { + "dbg": { + }, + "off": { + "cancel_ares_query_test": [ + "event_engine_dns", + ], + "census_test": [ + "transport_supplies_client_latency", + ], + "core_end2end_test": [ + "event_engine_client", + "event_engine_listener", + "promise_based_client_call", + "promise_based_server_call", + "unique_metadata_strings", + "work_stealing", + ], + "cpp_end2end_test": [ + "promise_based_server_call", + ], + "endpoint_test": [ + "tcp_frame_size_tuning", + "tcp_rcv_lowat", + ], + "event_engine_client_test": [ + "event_engine_client", + ], + "event_engine_listener_test": [ + "event_engine_listener", + ], + "flow_control_test": [ + "peer_state_based_framing", + "tcp_frame_size_tuning", + "tcp_rcv_lowat", + ], + "lame_client_test": [ + "promise_based_client_call", + ], + "logging_test": [ + "promise_based_server_call", + ], + "resolver_component_tests_runner_invoker": [ + "event_engine_dns", + ], + "resource_quota_test": [ + "free_large_allocator", + "memory_pressure_controller", + "unconstrained_max_quota_buffer_size", + ], + "xds_end2end_test": [ + "promise_based_server_call", + ], + }, + "on": { + }, }, - "off": { - "cancel_ares_query_test": [ - "event_engine_dns", - ], - "census_test": [ - "transport_supplies_client_latency", - ], - "core_end2end_test": [ - "event_engine_client", - "event_engine_listener", - "promise_based_client_call", - "promise_based_server_call", - "unique_metadata_strings", - "work_stealing", - ], - "cpp_end2end_test": [ - "promise_based_server_call", - ], - "endpoint_test": [ - "tcp_frame_size_tuning", - "tcp_rcv_lowat", - ], - "event_engine_client_test": [ - "event_engine_client", - ], - "event_engine_listener_test": [ - "event_engine_listener", - ], - "flow_control_test": [ - "peer_state_based_framing", - "tcp_frame_size_tuning", - "tcp_rcv_lowat", - ], - "lame_client_test": [ - "promise_based_client_call", - ], - "logging_test": [ - "promise_based_server_call", - ], - "resolver_component_tests_runner_invoker": [ - "event_engine_dns", - ], - "resource_quota_test": [ - "free_large_allocator", - "memory_pressure_controller", - "unconstrained_max_quota_buffer_size", - ], - "xds_end2end_test": [ - "promise_based_server_call", - ], + "ios": { + "dbg": { + }, + "off": { + "cancel_ares_query_test": [ + "event_engine_dns", + ], + "census_test": [ + "transport_supplies_client_latency", + ], + "core_end2end_test": [ + "event_engine_client", + "event_engine_listener", + "promise_based_client_call", + "promise_based_server_call", + "unique_metadata_strings", + "work_stealing", + ], + "cpp_end2end_test": [ + "promise_based_server_call", + ], + "endpoint_test": [ + "tcp_frame_size_tuning", + "tcp_rcv_lowat", + ], + "event_engine_client_test": [ + "event_engine_client", + ], + "event_engine_listener_test": [ + "event_engine_listener", + ], + "flow_control_test": [ + "peer_state_based_framing", + "tcp_frame_size_tuning", + "tcp_rcv_lowat", + ], + "lame_client_test": [ + "promise_based_client_call", + ], + "logging_test": [ + "promise_based_server_call", + ], + "resolver_component_tests_runner_invoker": [ + "event_engine_dns", + ], + "resource_quota_test": [ + "free_large_allocator", + "memory_pressure_controller", + "unconstrained_max_quota_buffer_size", + ], + "xds_end2end_test": [ + "promise_based_server_call", + ], + }, + "on": { + }, }, - "on": { + "posix": { + "dbg": { + }, + "off": { + "cancel_ares_query_test": [ + "event_engine_dns", + ], + "census_test": [ + "transport_supplies_client_latency", + ], + "core_end2end_test": [ + "event_engine_client", + "event_engine_listener", + "promise_based_client_call", + "promise_based_server_call", + "unique_metadata_strings", + "work_stealing", + ], + "cpp_end2end_test": [ + "promise_based_server_call", + ], + "endpoint_test": [ + "tcp_frame_size_tuning", + "tcp_rcv_lowat", + ], + "event_engine_client_test": [ + "event_engine_client", + ], + "event_engine_listener_test": [ + "event_engine_listener", + ], + "flow_control_test": [ + "peer_state_based_framing", + "tcp_frame_size_tuning", + "tcp_rcv_lowat", + ], + "lame_client_test": [ + "promise_based_client_call", + ], + "logging_test": [ + "promise_based_server_call", + ], + "resolver_component_tests_runner_invoker": [ + "event_engine_dns", + ], + "resource_quota_test": [ + "free_large_allocator", + "memory_pressure_controller", + "unconstrained_max_quota_buffer_size", + ], + "xds_end2end_test": [ + "promise_based_server_call", + ], + }, + "on": { + }, }, } diff --git a/bazel/grpc_build_system.bzl b/bazel/grpc_build_system.bzl index c0bc4ebbb0f69..4b2243074b2a0 100644 --- a/bazel/grpc_build_system.bzl +++ b/bazel/grpc_build_system.bzl @@ -30,6 +30,7 @@ Contains macros used throughout the repo. load("//bazel:cc_grpc_library.bzl", "cc_grpc_library") load("//bazel:copts.bzl", "GRPC_DEFAULT_COPTS") load("//bazel:experiments.bzl", "EXPERIMENTS") +load("//bazel:test_experiments.bzl", "TEST_EXPERIMENTS") load("@upb//bazel:upb_proto_library.bzl", "upb_proto_library", "upb_proto_reflection_library") load("@build_bazel_rules_apple//apple:ios.bzl", "ios_unit_test") load("@build_bazel_rules_apple//apple/testing/default_runner:ios_test_runner.bzl", "ios_test_runner") @@ -366,18 +367,26 @@ def expand_tests(name, srcs, deps, tags, args, exclude_pollers, uses_polling, us }) experiments = {} - for mode, tag_to_experiments in EXPERIMENTS.items(): - experiments[mode] = {} - for tag in tags: - if tag not in tag_to_experiments: - continue - for experiment in tag_to_experiments[tag]: - experiments[mode][experiment] = 1 - experiments[mode] = list(experiments[mode].keys()) + + # buildifier: disable=uninitialized + def _populate_experiments_platform_config(config, platform_experiments_map): + for platform, experiments_on_platform in platform_experiments_map.items(): + for mode, tag_to_experiments in experiments_on_platform.items(): + if mode not in config: + config[mode] = {} + for tag in tags: + if tag not in tag_to_experiments: + continue + for experiment in tag_to_experiments[tag]: + if experiment not in config[mode]: + config[mode][experiment] = [] + config[mode][experiment].append(platform) + + _populate_experiments_platform_config(experiments, EXPERIMENTS) + _populate_experiments_platform_config(experiments, TEST_EXPERIMENTS) mode_config = { # format: : (enabled_target_tags, disabled_target_tags) - "dbg": (["noopt"], ["nodbg"]), "on": (None, []), "off": ([], None), } @@ -392,11 +401,26 @@ def expand_tests(name, srcs, deps, tags, args, exclude_pollers, uses_polling, us # Nor on arm64 "no_arm64", ] + + def _update_experiments_platform_test_tags(tags, platforms): + if "posix" not in platforms: + if "no_linux" not in tags: + tags.append("no_linux") + if "no_mac" not in tags: + tags.append("no_mac") + if "windows" not in platforms: + if "no_windows" not in tags: + tags.append("no_windows") + if "ios" not in platforms: + if "no_test_ios" not in tags: + tags.append("no_test_ios") + return tags + experiment_config = list(poller_config) for mode, config in mode_config.items(): enabled_tags, disabled_tags = config if enabled_tags != None: - for experiment in experiments[mode]: + for experiment in experiments[mode].keys(): for config in poller_config: config = dict(config) config["name"] = config["name"] + "@experiment=" + experiment @@ -407,11 +431,11 @@ def expand_tests(name, srcs, deps, tags, args, exclude_pollers, uses_polling, us for tag in must_have_tags + enabled_tags: if tag not in tags: tags = tags + [tag] - config["tags"] = tags + config["tags"] = _update_experiments_platform_test_tags(tags, experiments[mode][experiment]) config["flaky"] = True experiment_config.append(config) if disabled_tags != None: - for experiment in experiments[mode]: + for experiment in experiments[mode].keys(): for config in poller_config: config = dict(config) config["name"] = config["name"] + "@experiment=no_" + experiment @@ -422,7 +446,7 @@ def expand_tests(name, srcs, deps, tags, args, exclude_pollers, uses_polling, us for tag in must_have_tags + disabled_tags: if tag not in tags: tags = tags + [tag] - config["tags"] = tags + config["tags"] = _update_experiments_platform_test_tags(tags, experiments[mode][experiment]) experiment_config.append(config) return experiment_config diff --git a/bazel/test_experiments.bzl b/bazel/test_experiments.bzl new file mode 100644 index 0000000000000..21c52e747ad60 --- /dev/null +++ b/bazel/test_experiments.bzl @@ -0,0 +1,50 @@ +# Copyright 2023 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto generated by tools/codegen/core/gen_experiments.py + +"""Dictionary of tags to experiments so we know when to test different experiments.""" + +TEST_EXPERIMENTS = { + "windows": { + "dbg": { + }, + "off": { + "experiments_tag_test": [ + "test_experiment_1", + ], + }, + "on": { + }, + }, + "ios": { + "dbg": { + }, + "off": { + }, + "on": { + }, + }, + "posix": { + "dbg": { + }, + "off": { + }, + "on": { + "experiments_tag_test": [ + "test_experiment_1", + ], + }, + }, +} diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 891c136a6644f..c669637de3862 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -7365,6 +7365,18 @@ targets: - gpr - upb uses_polling: false +- name: experiments_tag_test + gtest: true + build: test + language: c++ + headers: + - test/core/experiments/fixtures/experiments.h + src: + - test/core/experiments/experiments_tag_test.cc + - test/core/experiments/fixtures/experiments.cc + deps: + - grpc_test_util + uses_polling: false - name: experiments_test gtest: true build: test diff --git a/src/core/lib/experiments/config.cc b/src/core/lib/experiments/config.cc index 891229bc151be..e65a623f180fe 100644 --- a/src/core/lib/experiments/config.cc +++ b/src/core/lib/experiments/config.cc @@ -27,6 +27,7 @@ #include "absl/strings/str_cat.h" #include "absl/strings/str_split.h" #include "absl/strings/string_view.h" +#include "absl/strings/strip.h" #include @@ -66,6 +67,19 @@ class TestExperiments { enabled_[i] = experiment_metadata[i].default_value; } } + // For each comma-separated experiment in the global config: + for (auto experiment : absl::StrSplit(ConfigVars::Get().Experiments(), ',', + absl::SkipWhitespace())) { + // Enable unless prefixed with '-' (=> disable). + bool enable = !absl::ConsumePrefix(&experiment, "-"); + // See if we can find the experiment in the list in this binary. + for (size_t i = 0; i < num_experiments; i++) { + if (experiment == experiment_metadata[i].name) { + enabled_[i] = enable; + break; + } + } + } } // Overloading [] operator to access elements in array style diff --git a/test/core/experiments/BUILD b/test/core/experiments/BUILD index 2e2a75907d3d2..892e15769a748 100644 --- a/test/core/experiments/BUILD +++ b/test/core/experiments/BUILD @@ -45,3 +45,26 @@ grpc_cc_test( "//test/core/util:grpc_test_util", ], ) + +grpc_cc_test( + name = "experiments_tag_test", + srcs = ["experiments_tag_test.cc"], + external_deps = [ + "gtest", + "absl/strings", + "absl/status", + ], + language = "C++", + tags = [ + "experiments_tag_test", + ], + uses_event_engine = False, + uses_polling = False, + deps = [ + ":experiments_lib", + "//:config_vars", + "//:gpr", + "//src/core:experiments", + "//test/core/util:grpc_test_util", + ], +) diff --git a/test/core/experiments/experiments_tag_test.cc b/test/core/experiments/experiments_tag_test.cc new file mode 100644 index 0000000000000..bc1bfa4f041f5 --- /dev/null +++ b/test/core/experiments/experiments_tag_test.cc @@ -0,0 +1,86 @@ +// Copyright 2023 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include + +#include "absl/status/status.h" +#include "absl/status/statusor.h" +#include "absl/strings/str_split.h" +#include "absl/strings/string_view.h" +#include "absl/strings/strip.h" +#include "gtest/gtest.h" + +#include "src/core/lib/config/config_vars.h" +#include "src/core/lib/experiments/config.h" +#include "test/core/experiments/fixtures/experiments.h" + +// This test is coupled with bazel/test_experiments.bzl because it is tagged +// with test_experiments. If the +// test/core/experiments/fixtures/test_experiments.yaml is changed this test +// may require an update depending on the default values of the test +// experiments. + +#ifndef GRPC_EXPERIMENTS_ARE_FINAL + +absl::StatusOr IsExperimentEnabledThroughFlag( + std::string experiment_name) { + for (auto experiment : + absl::StrSplit(grpc_core::ConfigVars::Get().Experiments(), ',', + absl::SkipWhitespace())) { + // Enable unless prefixed with '-' (=> disable). + bool enable = !absl::ConsumePrefix(&experiment, "-"); + // See if we can find the experiment in the list in this binary. + if (experiment == experiment_name) { + return enable; + } + } + return absl::NotFoundError("experiment not found"); +} + +TEST(ExperimentsTestTagTest, CheckExperimentValuesTest) { + auto is_experiment_enabled_through_flag = + IsExperimentEnabledThroughFlag("test_experiment_1"); + if (!is_experiment_enabled_through_flag.ok()) { + return; + } +#ifdef GRPC_CFSTREAM + FAIL() << "test_experiment_1 is broken on ios. so this test should not have " + "executed on RBE." +#elif GPR_WINDOWS + // Since default on windows is false, when this test is run using the + // command line vars, we expect that the value of the experiment should be + // true since this test uses the test_tag. This test should not execute + // with experiment set to false using the command line vars. + EXPECT_TRUE(*is_experiment_enabled_through_flag); + EXPECT_TRUE(grpc_core::IsTestExperiment1Enabled()); +#else + // Since default on posix is debug, when this test is run using the + // command line vars, we expect that the value of the experiment should be + // false since this test uses the test_tag. This test should not execute + // with experiment set to true using the command line vars. + EXPECT_FALSE(*is_experiment_enabled_through_flag); + EXPECT_FALSE(grpc_core::IsTestExperiment1Enabled()); +#endif +} + +#endif // GRPC_EXPERIMENTS_ARE_FINAL + +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + grpc_core::LoadTestOnlyExperimentsFromMetadata( + grpc_core::g_test_experiment_metadata, grpc_core::kNumTestExperiments); + return RUN_ALL_TESTS(); +} diff --git a/test/core/experiments/experiments_test.cc b/test/core/experiments/experiments_test.cc index b32130d256272..618cccde8cb2f 100644 --- a/test/core/experiments/experiments_test.cc +++ b/test/core/experiments/experiments_test.cc @@ -40,7 +40,7 @@ bool GetExperimentTestExperiment3ExpectedValue() { bool GetExperimentTestExperiment4ExpectedValue() { return true; } #elif defined(GPR_WINDOWS) -bool GetExperimentTestExperiment1ExpectedValue() { return true; } +bool GetExperimentTestExperiment1ExpectedValue() { return false; } bool GetExperimentTestExperiment2ExpectedValue() { return false; } @@ -56,7 +56,14 @@ bool GetExperimentTestExperiment3ExpectedValue() { bool GetExperimentTestExperiment4ExpectedValue() { return true; } #else -bool GetExperimentTestExperiment1ExpectedValue() { return true; } +bool GetExperimentTestExperiment1ExpectedValue() { + +#ifdef NDEBUG + return false; +#else + return true; +#endif +} bool GetExperimentTestExperiment2ExpectedValue() { diff --git a/test/core/experiments/fixtures/experiments.cc b/test/core/experiments/fixtures/experiments.cc index 870e9ccd9c7f9..7d13644bb393b 100644 --- a/test/core/experiments/fixtures/experiments.cc +++ b/test/core/experiments/fixtures/experiments.cc @@ -73,7 +73,7 @@ namespace grpc_core { const ExperimentMetadata g_test_experiment_metadata[] = { {"test_experiment_1", description_test_experiment_1, - additional_constraints_test_experiment_1, true, true}, + additional_constraints_test_experiment_1, false, true}, {"test_experiment_2", description_test_experiment_2, additional_constraints_test_experiment_2, false, true}, {"test_experiment_3", description_test_experiment_3, @@ -105,7 +105,7 @@ namespace grpc_core { const ExperimentMetadata g_test_experiment_metadata[] = { {"test_experiment_1", description_test_experiment_1, - additional_constraints_test_experiment_1, true, true}, + additional_constraints_test_experiment_1, kDefaultForDebugOnly, true}, {"test_experiment_2", description_test_experiment_2, additional_constraints_test_experiment_2, kDefaultForDebugOnly, true}, {"test_experiment_3", description_test_experiment_3, diff --git a/test/core/experiments/fixtures/experiments.h b/test/core/experiments/fixtures/experiments.h index a0c197d6255d2..f2965811b6773 100644 --- a/test/core/experiments/fixtures/experiments.h +++ b/test/core/experiments/fixtures/experiments.h @@ -76,8 +76,7 @@ inline bool IsTestExperiment3Enabled() { inline bool IsTestExperiment4Enabled() { return true; } #elif defined(GPR_WINDOWS) -#define GRPC_EXPERIMENT_IS_INCLUDED_TEST_EXPERIMENT_1 -inline bool IsTestExperiment1Enabled() { return true; } +inline bool IsTestExperiment1Enabled() { return false; } inline bool IsTestExperiment2Enabled() { return false; } #ifndef NDEBUG #define GRPC_EXPERIMENT_IS_INCLUDED_TEST_EXPERIMENT_3 @@ -93,8 +92,16 @@ inline bool IsTestExperiment3Enabled() { inline bool IsTestExperiment4Enabled() { return true; } #else +#ifndef NDEBUG #define GRPC_EXPERIMENT_IS_INCLUDED_TEST_EXPERIMENT_1 -inline bool IsTestExperiment1Enabled() { return true; } +#endif +inline bool IsTestExperiment1Enabled() { +#ifdef NDEBUG + return false; +#else + return true; +#endif +} #ifndef NDEBUG #define GRPC_EXPERIMENT_IS_INCLUDED_TEST_EXPERIMENT_2 #endif diff --git a/test/core/experiments/fixtures/test_experiments.yaml b/test/core/experiments/fixtures/test_experiments.yaml index 34d1fe3d28da5..5be0e1c9e003c 100644 --- a/test/core/experiments/fixtures/test_experiments.yaml +++ b/test/core/experiments/fixtures/test_experiments.yaml @@ -16,6 +16,7 @@ description: Test Experiment 1 expiry: 2023/08/01 owner: blah@abc.com + test_tags: [experiments_tag_test] - name: test_experiment_2 description: Test Experiment 2 expiry: 2023/01/01 diff --git a/test/core/experiments/fixtures/test_experiments_rollout.yaml b/test/core/experiments/fixtures/test_experiments_rollout.yaml index da41094f173ec..df0283363c7fe 100644 --- a/test/core/experiments/fixtures/test_experiments_rollout.yaml +++ b/test/core/experiments/fixtures/test_experiments_rollout.yaml @@ -15,8 +15,8 @@ - name: test_experiment_1 default: ios: broken - windows: true - posix: true + windows: false + posix: debug - name: test_experiment_2 default: ios: true diff --git a/tools/codegen/core/experiments_compiler.py b/tools/codegen/core/experiments_compiler.py index 0f713419dbf54..c693ed8afc362 100644 --- a/tools/codegen/core/experiments_compiler.py +++ b/tools/codegen/core/experiments_compiler.py @@ -20,6 +20,7 @@ from __future__ import print_function import collections +from copy import deepcopy import ctypes import datetime import json @@ -552,37 +553,33 @@ def GenTest(self, output_file): test_body += _EXPERIMENT_CHECK_TEXT(SnakeToPascal(exp.name)) print(_EXPERIMENTS_TEST_SKELETON(defs, test_body), file=C) - def GenExperimentsBzl(self, output_file): + def GenExperimentsBzl(self, mode, output_file): if self._bzl_list_for_defaults is None: return - bzl_to_tags_to_experiments = dict( + defaults = dict( (key, collections.defaultdict(list)) for key in self._bzl_list_for_defaults.keys() if key is not None ) - for _, exp in self._experiment_definitions.items(): - for tag in exp.test_tags: - default = False - # Search through default values for all platforms. - for platform in self._platforms_define.keys(): - platform_default = exp.default(platform) - # if the experiment is disabled on any platform, only - # add it to the "off" list. - if not platform_default or platform_default == "broken": - default = platform_default - break - elif platform_default == "debug": - # Only add the experiment to the "dbg" list if it is - # debug in atleast one platform and true in every other - # platform. - default = "debug" - elif platform_default and default != "debug": - # Only add the experiment to the "on" list if it is - # enabled in every platform. + bzl_to_tags_to_experiments = dict( + (platform, deepcopy(defaults)) + for platform in self._platforms_define.keys() + ) + + for platform in self._platforms_define.keys(): + for _, exp in self._experiment_definitions.items(): + for tag in exp.test_tags: + # Search through default values for all platforms. + default = exp.default(platform) + # Interpret the debug default value as True to switch the + # experiment to the "on" mode. + if default == "debug": default = True - bzl_to_tags_to_experiments[default][tag].append(exp.name) + bzl_to_tags_to_experiments[platform][default][tag].append( + exp.name + ) with open(output_file, "w") as B: PutCopyright(B, "#") @@ -600,20 +597,31 @@ def GenExperimentsBzl(self, output_file): file=B, ) - bzl_to_tags_to_experiments = sorted( - (self._bzl_list_for_defaults[default], tags_to_experiments) - for default, tags_to_experiments in bzl_to_tags_to_experiments.items() - if self._bzl_list_for_defaults[default] is not None - ) - print(file=B) - print("EXPERIMENTS = {", file=B) - for key, tags_to_experiments in bzl_to_tags_to_experiments: - print(' "%s": {' % key, file=B) - for tag, experiments in sorted(tags_to_experiments.items()): - print(' "%s": [' % tag, file=B) - for experiment in sorted(experiments): - print(' "%s",' % experiment, file=B) - print(" ],", file=B) + if mode == "test": + print("TEST_EXPERIMENTS = {", file=B) + else: + print("EXPERIMENTS = {", file=B) + + for platform in self._platforms_define.keys(): + bzl_to_tags_to_experiments_platform = sorted( + (self._bzl_list_for_defaults[default], tags_to_experiments) + for default, tags_to_experiments in bzl_to_tags_to_experiments[ + platform + ].items() + if self._bzl_list_for_defaults[default] is not None + ) + print(' "%s": {' % platform, file=B) + for ( + key, + tags_to_experiments, + ) in bzl_to_tags_to_experiments_platform: + print(' "%s": {' % key, file=B) + for tag, experiments in sorted(tags_to_experiments.items()): + print(' "%s": [' % tag, file=B) + for experiment in sorted(experiments): + print(' "%s",' % experiment, file=B) + print(" ],", file=B) + print(" },", file=B) print(" },", file=B) print("}", file=B) diff --git a/tools/codegen/core/gen_experiments.py b/tools/codegen/core/gen_experiments.py index 9b0dbf1f12019..2a1c3b3ba569a 100755 --- a/tools/codegen/core/gen_experiments.py +++ b/tools/codegen/core/gen_experiments.py @@ -143,12 +143,13 @@ def _GenerateExperimentFiles(args, mode): _EXPERIMENTS_SRC_FILE, _EXPERIMENTS_HDR_FILE, mode ) + print("Generating experiments.bzl") if mode == "test": + compiler.GenExperimentsBzl(mode, "bazel/test_experiments.bzl") print("Generating experiments tests") compiler.GenTest("test/core/experiments/experiments_test.cc") else: - print("Generating experiments.bzl") - compiler.GenExperimentsBzl("bazel/experiments.bzl") + compiler.GenExperimentsBzl(mode, "bazel/experiments.bzl") _GenerateExperimentFiles(args, "production") diff --git a/tools/remote_build/linux.bazelrc b/tools/remote_build/linux.bazelrc index f78e23ae4ee9d..fda5c50161a92 100644 --- a/tools/remote_build/linux.bazelrc +++ b/tools/remote_build/linux.bazelrc @@ -34,8 +34,8 @@ import %workspace%/tools/remote_build/include/test_config_common.bazelrc build --jobs=100 -build:opt --test_tag_filters=-noopt -build:dbg --test_tag_filters=-nodbg +build:opt --test_tag_filters=-noopt,-no_linux +build:dbg --test_tag_filters=-nodbg,-no_linux # address sanitizer: most settings are already in %workspace%/.bazelrc # we only need a few additional ones that are Foundry specific diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index 8cfe6362b26c8..c96618b14d961 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -3159,6 +3159,30 @@ ], "uses_polling": false }, + { + "args": [], + "benchmark": false, + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": true, + "language": "c++", + "name": "experiments_tag_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "uses_polling": false + }, { "args": [], "benchmark": false, From e74b7d826250ad46e28578fbdfc9d668a6c906d7 Mon Sep 17 00:00:00 2001 From: Yijie Ma Date: Fri, 21 Jul 2023 18:50:48 -0700 Subject: [PATCH 034/205] [CI breakage] Skip some dns tests as a temporary workaround (#33819) Those tests are failing on CIs which do not have twisted installed. Skip them for now and will fix the docker images next. --- .../event_engine/test_suite/tests/dns_test.cc | 49 ++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/test/core/event_engine/test_suite/tests/dns_test.cc b/test/core/event_engine/test_suite/tests/dns_test.cc index cbd48e26bc775..b8dd6abbc1428 100644 --- a/test/core/event_engine/test_suite/tests/dns_test.cc +++ b/test/core/event_engine/test_suite/tests/dns_test.cc @@ -142,7 +142,12 @@ class EventEngineDNSTest : public EventEngineTest { }); int status = health_check.Join(); // TODO(yijiem): make this portable for Windows - ASSERT_TRUE(WIFEXITED(status) && WEXITSTATUS(status) == 0); + // TODO(yijiem): remove the if block and reenable the ASSERT_TRUE below once + // we have added twisted to the docker images. + if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) { + skip_end2end_tests_ = true; + } + // ASSERT_TRUE(WIFEXITED(status) && WEXITSTATUS(status) == 0); } static void TearDownTestSuite() { @@ -186,6 +191,7 @@ class EventEngineDNSTest : public EventEngineTest { grpc::SubProcess* server_process; }; grpc_core::Notification dns_resolver_signal_; + static bool skip_end2end_tests_; private: static DNSServer dns_server_; @@ -193,8 +199,13 @@ class EventEngineDNSTest : public EventEngineTest { }; EventEngineDNSTest::DNSServer EventEngineDNSTest::dns_server_; +bool EventEngineDNSTest::skip_end2end_tests_ = false; TEST_F(EventEngineDNSTest, QueryNXHostname) { + // TODO(yijiem): remove once the docker images are fixed. + if (skip_end2end_tests_) { + GTEST_SKIP(); + } auto dns_resolver = CreateDefaultDNSResolver(); dns_resolver->LookupHostname( [this](auto result) { @@ -210,6 +221,10 @@ TEST_F(EventEngineDNSTest, QueryNXHostname) { } TEST_F(EventEngineDNSTest, QueryWithIPLiteral) { + // TODO(yijiem): remove once the docker images are fixed. + if (skip_end2end_tests_) { + GTEST_SKIP(); + } auto dns_resolver = CreateDefaultDNSResolver(); dns_resolver->LookupHostname( [this](auto result) { @@ -225,6 +240,10 @@ TEST_F(EventEngineDNSTest, QueryWithIPLiteral) { } TEST_F(EventEngineDNSTest, QueryARecord) { + // TODO(yijiem): remove once the docker images are fixed. + if (skip_end2end_tests_) { + GTEST_SKIP(); + } auto dns_resolver = CreateDefaultDNSResolver(); dns_resolver->LookupHostname( [this](auto result) { @@ -242,6 +261,10 @@ TEST_F(EventEngineDNSTest, QueryARecord) { } TEST_F(EventEngineDNSTest, QueryAAAARecord) { + // TODO(yijiem): remove once the docker images are fixed. + if (skip_end2end_tests_) { + GTEST_SKIP(); + } auto dns_resolver = CreateDefaultDNSResolver(); dns_resolver->LookupHostname( [this](auto result) { @@ -262,6 +285,10 @@ TEST_F(EventEngineDNSTest, QueryAAAARecord) { } TEST_F(EventEngineDNSTest, TestAddressSorting) { + // TODO(yijiem): remove once the docker images are fixed. + if (skip_end2end_tests_) { + GTEST_SKIP(); + } auto dns_resolver = CreateDefaultDNSResolver(); dns_resolver->LookupHostname( [this](auto result) { @@ -279,6 +306,10 @@ TEST_F(EventEngineDNSTest, TestAddressSorting) { } TEST_F(EventEngineDNSTest, QuerySRVRecord) { + // TODO(yijiem): remove once the docker images are fixed. + if (skip_end2end_tests_) { + GTEST_SKIP(); + } const SRVRecord kExpectedRecords[] = { {/*host=*/"ipv4-only-multi-target.dns-test.event-engine", /*port=*/1234, /*priority=*/0, /*weight=*/0}, @@ -297,6 +328,10 @@ TEST_F(EventEngineDNSTest, QuerySRVRecord) { } TEST_F(EventEngineDNSTest, QuerySRVRecordWithLocalhost) { + // TODO(yijiem): remove once the docker images are fixed. + if (skip_end2end_tests_) { + GTEST_SKIP(); + } auto dns_resolver = CreateDefaultDNSResolver(); dns_resolver->LookupSRV( [this](auto result) { @@ -309,6 +344,10 @@ TEST_F(EventEngineDNSTest, QuerySRVRecordWithLocalhost) { } TEST_F(EventEngineDNSTest, QueryTXTRecord) { + // TODO(yijiem): remove once the docker images are fixed. + if (skip_end2end_tests_) { + GTEST_SKIP(); + } // clang-format off const std::string kExpectedRecord = "grpc_config=[{" @@ -338,6 +377,10 @@ TEST_F(EventEngineDNSTest, QueryTXTRecord) { } TEST_F(EventEngineDNSTest, QueryTXTRecordWithLocalhost) { + // TODO(yijiem): remove once the docker images are fixed. + if (skip_end2end_tests_) { + GTEST_SKIP(); + } auto dns_resolver = CreateDefaultDNSResolver(); dns_resolver->LookupTXT( [this](auto result) { @@ -350,6 +393,10 @@ TEST_F(EventEngineDNSTest, QueryTXTRecordWithLocalhost) { } TEST_F(EventEngineDNSTest, TestCancelActiveDNSQuery) { + // TODO(yijiem): remove once the docker images are fixed. + if (skip_end2end_tests_) { + GTEST_SKIP(); + } const std::string name = "dont-care-since-wont-be-resolved.test.com:1234"; auto dns_resolver = CreateDNSResolverWithNonResponsiveServer(); dns_resolver->LookupHostname( From 457fd65b93cd0c2932c24b0b0f2699e854b68fa7 Mon Sep 17 00:00:00 2001 From: Paulo Castello da Costa Date: Mon, 24 Jul 2023 00:29:37 -0700 Subject: [PATCH 035/205] [Test] Fix load test configuration generation for `node`. (#33821) Scenarios for language `node` specify the server language as `node` (instead of leaving it blank), so a flag must be added to `--allow_server_language=node`. Scenarios for language `node_purejs` differ in name and in scenario settings, but otherwise run on identical clients and servers. This change treats `node_purejs` as `node` for the purpose of generating load test configurations. --- tools/internal_ci/linux/grpc_e2e_performance_gke.sh | 1 + .../internal_ci/linux/grpc_e2e_performance_gke_experiment.sh | 1 + tools/run_tests/performance/loadtest_config.py | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/tools/internal_ci/linux/grpc_e2e_performance_gke.sh b/tools/internal_ci/linux/grpc_e2e_performance_gke.sh index eec24426f5503..204610a119baa 100755 --- a/tools/internal_ci/linux/grpc_e2e_performance_gke.sh +++ b/tools/internal_ci/linux/grpc_e2e_performance_gke.sh @@ -94,6 +94,7 @@ buildConfigs() { --prefix="${LOAD_TEST_PREFIX}" -u "${UNIQUE_IDENTIFIER}" -u "${pool}" \ -a pool="${pool}" --category=scalable \ --allow_client_language=c++ --allow_server_language=c++ \ + --allow_server_language=node \ -o "loadtest_with_prebuilt_workers_${pool}.yaml" } diff --git a/tools/internal_ci/linux/grpc_e2e_performance_gke_experiment.sh b/tools/internal_ci/linux/grpc_e2e_performance_gke_experiment.sh index b0a7c3ef8079a..f2081364bb33a 100755 --- a/tools/internal_ci/linux/grpc_e2e_performance_gke_experiment.sh +++ b/tools/internal_ci/linux/grpc_e2e_performance_gke_experiment.sh @@ -108,6 +108,7 @@ buildConfigs() { --prefix="${LOAD_TEST_PREFIX}" -u "${UNIQUE_IDENTIFIER}" -u "${pool}" \ -a pool="${pool}" --category=scalable \ --allow_client_language=c++ --allow_server_language=c++ \ + --allow_server_language=node \ -o "loadtest_with_prebuilt_workers_${pool}.yaml" } diff --git a/tools/run_tests/performance/loadtest_config.py b/tools/run_tests/performance/loadtest_config.py index 6c0097011fc7b..4c73c8f802d30 100755 --- a/tools/run_tests/performance/loadtest_config.py +++ b/tools/run_tests/performance/loadtest_config.py @@ -47,6 +47,10 @@ def safe_name(language: str) -> str: """Returns a name that is safe to use in labels and file names.""" + # The language "node_purejs" differs from "node" only in the scenarios + # covered, so it is treated the same as "node". + if language == "node_purejs": + return scenario_config.LANGUAGES["node"].safename return scenario_config.LANGUAGES[language].safename From 42b0d01e68dd2588ed73d80cb520a5cb1fcb53e5 Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Mon, 24 Jul 2023 10:09:08 -0700 Subject: [PATCH 036/205] [Release] Bump version to 1.58.0-dev (on master branch) (#33825) Change was created by the release automation script. See go/grpc-release --- BUILD | 4 ++-- CMakeLists.txt | 12 ++++++------ Makefile | 4 ++-- _metadata.py | 2 +- build_handwritten.yaml | 4 ++-- config.m4 | 2 +- doc/g_stands_for.md | 3 ++- gRPC-C++.podspec | 2 +- gRPC-Core.podspec | 2 +- gRPC-ProtoRPC.podspec | 2 +- gRPC-RxLibrary.podspec | 2 +- gRPC.podspec | 2 +- include/grpcpp/version_info.h | 4 ++-- package.xml | 6 +++--- src/core/lib/surface/version.cc | 2 +- src/csharp/build/dependencies.props | 2 +- src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec | 2 +- src/objective-c/!ProtoCompiler-gRPCPlugin.podspec | 2 +- src/objective-c/GRPCClient/version.h | 2 +- src/objective-c/tests/version.h | 2 +- src/php/composer.json | 2 +- src/php/ext/grpc/version.h | 2 +- src/python/grpcio/grpc/_grpcio_metadata.py | 2 +- src/python/grpcio/grpc_version.py | 2 +- src/python/grpcio_admin/grpc_version.py | 2 +- src/python/grpcio_channelz/grpc_version.py | 2 +- src/python/grpcio_csds/grpc_version.py | 2 +- src/python/grpcio_health_checking/grpc_version.py | 2 +- src/python/grpcio_reflection/grpc_version.py | 2 +- src/python/grpcio_status/grpc_version.py | 2 +- src/python/grpcio_testing/grpc_version.py | 2 +- src/python/grpcio_tests/grpc_version.py | 2 +- src/ruby/lib/grpc/version.rb | 2 +- src/ruby/tools/version.rb | 2 +- tools/distrib/python/grpc_version.py | 2 +- tools/distrib/python/grpcio_tools/grpc_version.py | 2 +- tools/doxygen/Doxyfile.c++ | 2 +- tools/doxygen/Doxyfile.c++.internal | 2 +- tools/doxygen/Doxyfile.objc | 2 +- tools/doxygen/Doxyfile.objc.internal | 2 +- tools/doxygen/Doxyfile.php | 2 +- 41 files changed, 53 insertions(+), 52 deletions(-) diff --git a/BUILD b/BUILD index fd9b69007cbfc..68362ea3412ce 100644 --- a/BUILD +++ b/BUILD @@ -211,11 +211,11 @@ config_setting( python_config_settings() # This should be updated along with build_handwritten.yaml -g_stands_for = "grounded" # @unused +g_stands_for = "goku" # @unused core_version = "34.0.0" # @unused -version = "1.57.0-dev" # @unused +version = "1.58.0-dev" # @unused GPR_PUBLIC_HDRS = [ "include/grpc/support/alloc.h", diff --git a/CMakeLists.txt b/CMakeLists.txt index c4ccaacc01634..3c95908cafb05 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,13 +25,13 @@ cmake_minimum_required(VERSION 3.8) set(PACKAGE_NAME "grpc") -set(PACKAGE_VERSION "1.57.0-dev") +set(PACKAGE_VERSION "1.58.0-dev") set(gRPC_CORE_VERSION "34.0.0") set(gRPC_CORE_SOVERSION "34") -set(gRPC_CPP_VERSION "1.57.0-dev") -set(gRPC_CPP_SOVERSION "1.57") -set(gRPC_CSHARP_VERSION "2.57.0-dev") -set(gRPC_CSHARP_SOVERSION "2.57") +set(gRPC_CPP_VERSION "1.58.0-dev") +set(gRPC_CPP_SOVERSION "1.58") +set(gRPC_CSHARP_VERSION "2.58.0-dev") +set(gRPC_CSHARP_SOVERSION "2.58") set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/") @@ -299,7 +299,7 @@ endif() if (gRPC_XDS_USER_AGENT_IS_CSHARP) # The value of the defines needs to contain quotes. # See https://github.com/grpc/grpc/blob/fbf32836a418cc84f58786700273b65cb9174e1d/src/core/ext/xds/xds_api.cc#L854 - add_definitions("-DGRPC_XDS_USER_AGENT_NAME_SUFFIX=\"csharp\"" "-DGRPC_XDS_USER_AGENT_VERSION_SUFFIX=\"2.57.0-dev\"") + add_definitions("-DGRPC_XDS_USER_AGENT_NAME_SUFFIX=\"csharp\"" "-DGRPC_XDS_USER_AGENT_VERSION_SUFFIX=\"2.58.0-dev\"") endif() if(UNIX AND NOT HAIKU) diff --git a/Makefile b/Makefile index a9c5977295f8d..3937fbc7a2a2a 100644 --- a/Makefile +++ b/Makefile @@ -411,8 +411,8 @@ Q = @ endif CORE_VERSION = 34.0.0 -CPP_VERSION = 1.57.0-dev -CSHARP_VERSION = 2.57.0-dev +CPP_VERSION = 1.58.0-dev +CSHARP_VERSION = 2.58.0-dev CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES)) CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS) diff --git a/_metadata.py b/_metadata.py index 49cc3f9ffb1ee..e54817b24d1b9 100644 --- a/_metadata.py +++ b/_metadata.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/_metadata.py.template`!!! -__version__ = """1.57.0.dev0""" +__version__ = """1.58.0.dev0""" diff --git a/build_handwritten.yaml b/build_handwritten.yaml index feb2217025467..4cc459650fc1e 100644 --- a/build_handwritten.yaml +++ b/build_handwritten.yaml @@ -14,9 +14,9 @@ settings: '#10': See the expand_version.py for all the quirks here core_version: 34.0.0 csharp_major_version: 2 - g_stands_for: grounded + g_stands_for: goku protobuf_version: 3.23.4 - version: 1.57.0-dev + version: 1.58.0-dev configs: asan: CC: clang diff --git a/config.m4 b/config.m4 index 44e239db30e92..46102ab65769f 100644 --- a/config.m4 +++ b/config.m4 @@ -1324,7 +1324,7 @@ if test "$PHP_GRPC" != "no"; then -D_HAS_EXCEPTIONS=0 -DNOMINMAX -DGRPC_ARES=0 \ -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1 \ -DGRPC_XDS_USER_AGENT_NAME_SUFFIX='"\"PHP\""' \ - -DGRPC_XDS_USER_AGENT_VERSION_SUFFIX='"\"1.57.0dev\""') + -DGRPC_XDS_USER_AGENT_VERSION_SUFFIX='"\"1.58.0dev\""') PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/backend_metrics) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/census) diff --git a/doc/g_stands_for.md b/doc/g_stands_for.md index 7ce834458dc24..667a0003c03cc 100644 --- a/doc/g_stands_for.md +++ b/doc/g_stands_for.md @@ -56,4 +56,5 @@ - 1.54 'g' stands for ['gracious'](https://github.com/grpc/grpc/tree/v1.54.x) - 1.55 'g' stands for ['grandslam'](https://github.com/grpc/grpc/tree/v1.55.x) - 1.56 'g' stands for ['galvanized'](https://github.com/grpc/grpc/tree/v1.56.x) -- 1.57 'g' stands for ['grounded'](https://github.com/grpc/grpc/tree/master) +- 1.57 'g' stands for ['grounded'](https://github.com/grpc/grpc/tree/v1.57.x) +- 1.58 'g' stands for ['goku'](https://github.com/grpc/grpc/tree/master) diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 94d9b33784eda..80d676e573582 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -22,7 +22,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-C++' # TODO (mxyan): use version that match gRPC version when pod is stabilized - version = '1.57.0-dev' + version = '1.58.0-dev' s.version = version s.summary = 'gRPC C++ library' s.homepage = 'https://grpc.io' diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 9c1956cbeb0d0..11debea0f5fff 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-Core' - version = '1.57.0-dev' + version = '1.58.0-dev' s.version = version s.summary = 'Core cross-platform gRPC library, written in C' s.homepage = 'https://grpc.io' diff --git a/gRPC-ProtoRPC.podspec b/gRPC-ProtoRPC.podspec index fd4cbad2ddfbf..1ff7b41f65511 100644 --- a/gRPC-ProtoRPC.podspec +++ b/gRPC-ProtoRPC.podspec @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-ProtoRPC' - version = '1.57.0-dev' + version = '1.58.0-dev' s.version = version s.summary = 'RPC library for Protocol Buffers, based on gRPC' s.homepage = 'https://grpc.io' diff --git a/gRPC-RxLibrary.podspec b/gRPC-RxLibrary.podspec index affa95ede182e..ae878deace15a 100644 --- a/gRPC-RxLibrary.podspec +++ b/gRPC-RxLibrary.podspec @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-RxLibrary' - version = '1.57.0-dev' + version = '1.58.0-dev' s.version = version s.summary = 'Reactive Extensions library for iOS/OSX.' s.homepage = 'https://grpc.io' diff --git a/gRPC.podspec b/gRPC.podspec index ad24fc65a4f32..c12df35b83c58 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -20,7 +20,7 @@ Pod::Spec.new do |s| s.name = 'gRPC' - version = '1.57.0-dev' + version = '1.58.0-dev' s.version = version s.summary = 'gRPC client library for iOS/OSX' s.homepage = 'https://grpc.io' diff --git a/include/grpcpp/version_info.h b/include/grpcpp/version_info.h index d84dee3fd9fdf..10f5dc207bb1a 100644 --- a/include/grpcpp/version_info.h +++ b/include/grpcpp/version_info.h @@ -19,9 +19,9 @@ #define GRPCPP_VERSION_INFO_H #define GRPC_CPP_VERSION_MAJOR 1 -#define GRPC_CPP_VERSION_MINOR 57 +#define GRPC_CPP_VERSION_MINOR 58 #define GRPC_CPP_VERSION_PATCH 0 #define GRPC_CPP_VERSION_TAG "dev" -#define GRPC_CPP_VERSION_STRING "1.57.0-dev" +#define GRPC_CPP_VERSION_STRING "1.58.0-dev" #endif // GRPCPP_VERSION_INFO_H diff --git a/package.xml b/package.xml index 28a722fe16e8c..5417e51fde077 100644 --- a/package.xml +++ b/package.xml @@ -13,8 +13,8 @@ 2019-09-24 - 1.57.0dev - 1.57.0dev + 1.58.0dev + 1.58.0dev beta @@ -22,7 +22,7 @@ Apache 2.0 -- gRPC Core 1.57.0 update +- gRPC Core 1.58.0 update diff --git a/src/core/lib/surface/version.cc b/src/core/lib/surface/version.cc index 76fe1318a444f..2217b79a36430 100644 --- a/src/core/lib/surface/version.cc +++ b/src/core/lib/surface/version.cc @@ -25,4 +25,4 @@ const char* grpc_version_string(void) { return "34.0.0"; } -const char* grpc_g_stands_for(void) { return "grounded"; } +const char* grpc_g_stands_for(void) { return "goku"; } diff --git a/src/csharp/build/dependencies.props b/src/csharp/build/dependencies.props index 68ea3c813c59c..ee0ee30a587e1 100644 --- a/src/csharp/build/dependencies.props +++ b/src/csharp/build/dependencies.props @@ -1,7 +1,7 @@ - 2.57.0-dev + 2.58.0-dev 3.23.4 diff --git a/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec index 39681971f5e74..479f9d60f6f0c 100644 --- a/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec @@ -42,7 +42,7 @@ Pod::Spec.new do |s| # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed # before them. s.name = '!ProtoCompiler-gRPCCppPlugin' - v = '1.57.0-dev' + v = '1.58.0-dev' s.version = v s.summary = 'The gRPC ProtoC plugin generates C++ files from .proto services.' s.description = <<-DESC diff --git a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec index 36844ef4886df..b36c5cfcbacd7 100644 --- a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec @@ -42,7 +42,7 @@ Pod::Spec.new do |s| # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed # before them. s.name = '!ProtoCompiler-gRPCPlugin' - v = '1.57.0-dev' + v = '1.58.0-dev' s.version = v s.summary = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.' s.description = <<-DESC diff --git a/src/objective-c/GRPCClient/version.h b/src/objective-c/GRPCClient/version.h index cdc809c40042b..f08eca6973e74 100644 --- a/src/objective-c/GRPCClient/version.h +++ b/src/objective-c/GRPCClient/version.h @@ -22,4 +22,4 @@ // instead. This file can be regenerated from the template by running // `tools/buildgen/generate_projects.sh`. -#define GRPC_OBJC_VERSION_STRING @"1.57.0-dev" +#define GRPC_OBJC_VERSION_STRING @"1.58.0-dev" diff --git a/src/objective-c/tests/version.h b/src/objective-c/tests/version.h index b48bc82a19048..5e106e3b418c5 100644 --- a/src/objective-c/tests/version.h +++ b/src/objective-c/tests/version.h @@ -22,5 +22,5 @@ // instead. This file can be regenerated from the template by running // `tools/buildgen/generate_projects.sh`. -#define GRPC_OBJC_VERSION_STRING @"1.57.0-dev" +#define GRPC_OBJC_VERSION_STRING @"1.58.0-dev" #define GRPC_C_VERSION_STRING @"34.0.0" diff --git a/src/php/composer.json b/src/php/composer.json index 44540ba839697..2b52ed3155463 100644 --- a/src/php/composer.json +++ b/src/php/composer.json @@ -2,7 +2,7 @@ "name": "grpc/grpc-dev", "description": "gRPC library for PHP - for Development use only", "license": "Apache-2.0", - "version": "1.57.0", + "version": "1.58.0", "require": { "php": ">=7.0.0", "google/protobuf": "^v3.3.0" diff --git a/src/php/ext/grpc/version.h b/src/php/ext/grpc/version.h index 0d3511cd6a0e0..50c756a7c63af 100644 --- a/src/php/ext/grpc/version.h +++ b/src/php/ext/grpc/version.h @@ -20,6 +20,6 @@ #ifndef VERSION_H #define VERSION_H -#define PHP_GRPC_VERSION "1.57.0dev" +#define PHP_GRPC_VERSION "1.58.0dev" #endif /* VERSION_H */ diff --git a/src/python/grpcio/grpc/_grpcio_metadata.py b/src/python/grpcio/grpc/_grpcio_metadata.py index 8b31cb1ebed73..1a8f8bfe2e479 100644 --- a/src/python/grpcio/grpc/_grpcio_metadata.py +++ b/src/python/grpcio/grpc/_grpcio_metadata.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc/_grpcio_metadata.py.template`!!! -__version__ = """1.57.0.dev0""" +__version__ = """1.58.0.dev0""" diff --git a/src/python/grpcio/grpc_version.py b/src/python/grpcio/grpc_version.py index 97df5563d5969..4ea658f94716e 100644 --- a/src/python/grpcio/grpc_version.py +++ b/src/python/grpcio/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!! -VERSION = '1.57.0.dev0' +VERSION = '1.58.0.dev0' diff --git a/src/python/grpcio_admin/grpc_version.py b/src/python/grpcio_admin/grpc_version.py index 4d1ae6712de41..bf866ccd16218 100644 --- a/src/python/grpcio_admin/grpc_version.py +++ b/src/python/grpcio_admin/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_admin/grpc_version.py.template`!!! -VERSION = '1.57.0.dev0' +VERSION = '1.58.0.dev0' diff --git a/src/python/grpcio_channelz/grpc_version.py b/src/python/grpcio_channelz/grpc_version.py index 81c5596d486ef..074387986a18c 100644 --- a/src/python/grpcio_channelz/grpc_version.py +++ b/src/python/grpcio_channelz/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_channelz/grpc_version.py.template`!!! -VERSION = '1.57.0.dev0' +VERSION = '1.58.0.dev0' diff --git a/src/python/grpcio_csds/grpc_version.py b/src/python/grpcio_csds/grpc_version.py index 85d78d60778d9..46f2c73e83ab2 100644 --- a/src/python/grpcio_csds/grpc_version.py +++ b/src/python/grpcio_csds/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_csds/grpc_version.py.template`!!! -VERSION = '1.57.0.dev0' +VERSION = '1.58.0.dev0' diff --git a/src/python/grpcio_health_checking/grpc_version.py b/src/python/grpcio_health_checking/grpc_version.py index 4adbcbe706aed..ef70e0d58ecbf 100644 --- a/src/python/grpcio_health_checking/grpc_version.py +++ b/src/python/grpcio_health_checking/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_health_checking/grpc_version.py.template`!!! -VERSION = '1.57.0.dev0' +VERSION = '1.58.0.dev0' diff --git a/src/python/grpcio_reflection/grpc_version.py b/src/python/grpcio_reflection/grpc_version.py index 215bba6080f86..0c663c2b6ea16 100644 --- a/src/python/grpcio_reflection/grpc_version.py +++ b/src/python/grpcio_reflection/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_reflection/grpc_version.py.template`!!! -VERSION = '1.57.0.dev0' +VERSION = '1.58.0.dev0' diff --git a/src/python/grpcio_status/grpc_version.py b/src/python/grpcio_status/grpc_version.py index cb5886a9b5622..98ae5d3653727 100644 --- a/src/python/grpcio_status/grpc_version.py +++ b/src/python/grpcio_status/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_status/grpc_version.py.template`!!! -VERSION = '1.57.0.dev0' +VERSION = '1.58.0.dev0' diff --git a/src/python/grpcio_testing/grpc_version.py b/src/python/grpcio_testing/grpc_version.py index dcce5b39f1a08..b0b5fc32b83b0 100644 --- a/src/python/grpcio_testing/grpc_version.py +++ b/src/python/grpcio_testing/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_testing/grpc_version.py.template`!!! -VERSION = '1.57.0.dev0' +VERSION = '1.58.0.dev0' diff --git a/src/python/grpcio_tests/grpc_version.py b/src/python/grpcio_tests/grpc_version.py index bf99e1c315fa7..502a36dcbef79 100644 --- a/src/python/grpcio_tests/grpc_version.py +++ b/src/python/grpcio_tests/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_tests/grpc_version.py.template`!!! -VERSION = '1.57.0.dev0' +VERSION = '1.58.0.dev0' diff --git a/src/ruby/lib/grpc/version.rb b/src/ruby/lib/grpc/version.rb index 6f850e4fb0bce..a9c49cdba701f 100644 --- a/src/ruby/lib/grpc/version.rb +++ b/src/ruby/lib/grpc/version.rb @@ -14,5 +14,5 @@ # GRPC contains the General RPC module. module GRPC - VERSION = '1.57.0.dev' + VERSION = '1.58.0.dev' end diff --git a/src/ruby/tools/version.rb b/src/ruby/tools/version.rb index d125d5521117b..38da990681f4a 100644 --- a/src/ruby/tools/version.rb +++ b/src/ruby/tools/version.rb @@ -14,6 +14,6 @@ module GRPC module Tools - VERSION = '1.57.0.dev' + VERSION = '1.58.0.dev' end end diff --git a/tools/distrib/python/grpc_version.py b/tools/distrib/python/grpc_version.py index ce1329f8b6248..d63bf16019a04 100644 --- a/tools/distrib/python/grpc_version.py +++ b/tools/distrib/python/grpc_version.py @@ -14,5 +14,5 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!! -VERSION = '1.57.0.dev0' +VERSION = '1.58.0.dev0' PROTOBUF_VERSION = '3.23.4' diff --git a/tools/distrib/python/grpcio_tools/grpc_version.py b/tools/distrib/python/grpcio_tools/grpc_version.py index 70635364ff43c..b2f783eee0fc2 100644 --- a/tools/distrib/python/grpcio_tools/grpc_version.py +++ b/tools/distrib/python/grpcio_tools/grpc_version.py @@ -14,5 +14,5 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!! -VERSION = '1.57.0.dev0' +VERSION = '1.58.0.dev0' PROTOBUF_VERSION = '3.23.4' diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index 39f23e155d971..292bfaa66a3ce 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.57.0-dev +PROJECT_NUMBER = 1.58.0-dev # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index a9f3726fbfd7b..0482efeb35de1 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.57.0-dev +PROJECT_NUMBER = 1.58.0-dev # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.objc b/tools/doxygen/Doxyfile.objc index baea11b364cac..3b6bf7ac1ff7c 100644 --- a/tools/doxygen/Doxyfile.objc +++ b/tools/doxygen/Doxyfile.objc @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Objective-C" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.57.0-dev +PROJECT_NUMBER = 1.58.0-dev # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.objc.internal b/tools/doxygen/Doxyfile.objc.internal index 21ac297bf50f4..f4a87b2e880d6 100644 --- a/tools/doxygen/Doxyfile.objc.internal +++ b/tools/doxygen/Doxyfile.objc.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Objective-C" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.57.0-dev +PROJECT_NUMBER = 1.58.0-dev # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.php b/tools/doxygen/Doxyfile.php index e215aec7b0d96..4809d08eede92 100644 --- a/tools/doxygen/Doxyfile.php +++ b/tools/doxygen/Doxyfile.php @@ -40,7 +40,7 @@ # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.57.0-dev +PROJECT_NUMBER = 1.58.0-dev # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a From f4f3a907f389dac76dabed5de494727b9cb2c3d2 Mon Sep 17 00:00:00 2001 From: Vignesh Babu Date: Mon, 24 Jul 2023 10:26:45 -0700 Subject: [PATCH 037/205] [import] Fix missing dependency in experiments_tag_test (#33827) --- CMakeLists.txt | 9 +++++++-- build_autogenerated.yaml | 13 +++++++++++-- test/core/experiments/BUILD | 13 +++++-------- tools/distrib/fix_build_deps.py | 1 + 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c95908cafb05..bb3a3756bdb18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11310,6 +11310,8 @@ endif() if(gRPC_BUILD_TESTS) add_executable(experiments_tag_test + src/core/lib/experiments/config.cc + src/core/lib/experiments/experiments.cc test/core/experiments/experiments_tag_test.cc test/core/experiments/fixtures/experiments.cc third_party/googletest/googletest/src/gtest-all.cc @@ -11340,7 +11342,8 @@ target_link_libraries(experiments_tag_test ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ZLIB_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} - grpc_test_util + absl::statusor + gpr ) @@ -11348,6 +11351,8 @@ endif() if(gRPC_BUILD_TESTS) add_executable(experiments_test + src/core/lib/experiments/config.cc + src/core/lib/experiments/experiments.cc test/core/experiments/experiments_test.cc test/core/experiments/fixtures/experiments.cc third_party/googletest/googletest/src/gtest-all.cc @@ -11378,7 +11383,7 @@ target_link_libraries(experiments_test ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ZLIB_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} - grpc_test_util + gpr ) diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index c669637de3862..3b03656e521ad 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -7370,24 +7370,33 @@ targets: build: test language: c++ headers: + - src/core/lib/experiments/config.h + - src/core/lib/experiments/experiments.h - test/core/experiments/fixtures/experiments.h src: + - src/core/lib/experiments/config.cc + - src/core/lib/experiments/experiments.cc - test/core/experiments/experiments_tag_test.cc - test/core/experiments/fixtures/experiments.cc deps: - - grpc_test_util + - absl/status:statusor + - gpr uses_polling: false - name: experiments_test gtest: true build: test language: c++ headers: + - src/core/lib/experiments/config.h + - src/core/lib/experiments/experiments.h - test/core/experiments/fixtures/experiments.h src: + - src/core/lib/experiments/config.cc + - src/core/lib/experiments/experiments.cc - test/core/experiments/experiments_test.cc - test/core/experiments/fixtures/experiments.cc deps: - - grpc_test_util + - gpr uses_polling: false - name: factory_test gtest: true diff --git a/test/core/experiments/BUILD b/test/core/experiments/BUILD index 892e15769a748..f413bc27c80db 100644 --- a/test/core/experiments/BUILD +++ b/test/core/experiments/BUILD @@ -24,10 +24,8 @@ grpc_cc_library( ], language = "c++", deps = [ - "//:config_vars", "//:gpr", "//src/core:experiments", - "//src/core:no_destruct", ], ) @@ -39,10 +37,9 @@ grpc_cc_test( uses_event_engine = False, uses_polling = False, deps = [ - ":experiments_lib", + "experiments_lib", "//:gpr", "//src/core:experiments", - "//test/core/util:grpc_test_util", ], ) @@ -50,9 +47,10 @@ grpc_cc_test( name = "experiments_tag_test", srcs = ["experiments_tag_test.cc"], external_deps = [ - "gtest", - "absl/strings", "absl/status", + "absl/status:statusor", + "absl/strings", + "gtest", ], language = "C++", tags = [ @@ -61,10 +59,9 @@ grpc_cc_test( uses_event_engine = False, uses_polling = False, deps = [ - ":experiments_lib", + "experiments_lib", "//:config_vars", "//:gpr", "//src/core:experiments", - "//test/core/util:grpc_test_util", ], ) diff --git a/tools/distrib/fix_build_deps.py b/tools/distrib/fix_build_deps.py index 019c27e38ab55..5350fade9fb90 100755 --- a/tools/distrib/fix_build_deps.py +++ b/tools/distrib/fix_build_deps.py @@ -381,6 +381,7 @@ def score_best(proposed, existing): "src/cpp/ext/gcp", "src/cpp/ext/otel", "test/core/backoff", + "test/core/experiments", "test/core/uri", "test/core/util", "test/core/end2end", From 99b0e54877c453a61b13dc4ed40ff8470ad4f9e8 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson <52979934+matthewstevenson88@users.noreply.github.com> Date: Mon, 24 Jul 2023 10:44:00 -0700 Subject: [PATCH 038/205] [ssl] Disable slow SSL transport security tests for UBSAN builds. (#33824) This PR is expected to fix the flakes of `//test/core/tsi:ssl_transport_security_test` when built under UBSAN. Why is this needed? There are several tests in `ssl_transport_security_test.cc` that involve doing many expensive operations and PR #33638 recently added one more (namely, repeatedly signing with an ECDSA key). The slow tests are already altered for MSAN and TSAN, and now we need to do the same for UBSAN. --- test/core/tsi/ssl_transport_security_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/core/tsi/ssl_transport_security_test.cc b/test/core/tsi/ssl_transport_security_test.cc index 55c78f779ac56..4a2f9eda4de86 100644 --- a/test/core/tsi/ssl_transport_security_test.cc +++ b/test/core/tsi/ssl_transport_security_test.cc @@ -509,7 +509,7 @@ static bool is_slow_build() { #if defined(GPR_ARCH_32) || defined(__APPLE__) return true; #else - return BuiltUnderMsan() || BuiltUnderTsan(); + return BuiltUnderMsan() || BuiltUnderTsan() || BuiltUnderUbsan(); #endif } From 035d27924bf0c9b1d069e823e1df1da34babf151 Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Mon, 24 Jul 2023 11:38:50 -0700 Subject: [PATCH 039/205] [test] Run PHP distribtests with make -j8 (#33831) Related to https://github.com/grpc/grpc/pull/33795. The tests are still OOMing, and I found that this distribtest script is still running `make -j ...` on a 16-core machine. Reducing it to `8` to see if that helps. Example OOM: https://fusion2.corp.google.com/invocations/c306e6b9-24e3-498d-8971-3e914feea29b/log --- test/distrib/php/run_distrib_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/distrib/php/run_distrib_test.sh b/test/distrib/php/run_distrib_test.sh index 89ad6e91dbab8..8c43b90ba50f9 100755 --- a/test/distrib/php/run_distrib_test.sh +++ b/test/distrib/php/run_distrib_test.sh @@ -23,6 +23,6 @@ cp -r "$EXTERNAL_GIT_ROOT"/input_artifacts/grpc-*.tgz . # the exact version string in advance) GRPC_PEAR_PACKAGE_NAME=$(find . -regex '.*/grpc-[0-9].*.tgz' | sed 's|./||') -MAKEFLAGS=-j pecl install "${GRPC_PEAR_PACKAGE_NAME}" +MAKEFLAGS=-j8 pecl install "${GRPC_PEAR_PACKAGE_NAME}" php -d extension=grpc.so -d max_execution_time=300 distribtest.php From 087b74f739a269e436822b17ac38e62cf3b5d74e Mon Sep 17 00:00:00 2001 From: Vignesh Babu Date: Mon, 24 Jul 2023 12:02:02 -0700 Subject: [PATCH 040/205] Revert "Revert "[interop] Add absl dependency to interop server"" #33828 (#33830) Reverts https://github.com/grpc/grpc/pull/33676 The serve method needs to be called with args. The previous attempt did not change the signature in commands.py which lead to errors such as https://screenshot.googleplex.com/6wZVER9ZETMGAmA. The fix is in https://github.com/grpc/grpc/pull/33830/commits/4e211d02914fa9886ea1283442a9a6f6a54a61bd --- requirements.bazel.txt | 1 + src/python/grpcio_tests/commands.py | 5 +++-- src/python/grpcio_tests/setup.py | 1 + src/python/grpcio_tests/tests/interop/BUILD.bazel | 1 + src/python/grpcio_tests/tests/interop/server.py | 15 +++++++-------- .../grpcio_tests/tests_aio/interop/server.py | 8 ++++---- tools/run_tests/helper_scripts/build_python.sh | 2 +- 7 files changed, 18 insertions(+), 15 deletions(-) diff --git a/requirements.bazel.txt b/requirements.bazel.txt index 0a26df5ac2746..b42c8f63bd768 100644 --- a/requirements.bazel.txt +++ b/requirements.bazel.txt @@ -15,3 +15,4 @@ setuptools==44.1.1 xds-protos==0.0.11 opencensus==0.10.0 opencensus-ext-stackdriver==0.8.0 +absl-py==1.4.0 diff --git a/src/python/grpcio_tests/commands.py b/src/python/grpcio_tests/commands.py index 22f458b8c9b62..9fb3abb4dada4 100644 --- a/src/python/grpcio_tests/commands.py +++ b/src/python/grpcio_tests/commands.py @@ -330,12 +330,13 @@ def run_server(self): from tests_aio.interop import server sys.argv[1:] = self.args.split() - asyncio.get_event_loop().run_until_complete(server.serve()) + args = server.parse_interop_server_arguments(sys.argv) + asyncio.get_event_loop().run_until_complete(server.serve(args)) else: from tests.interop import server sys.argv[1:] = self.args.split() - server.serve() + server.serve(server.parse_interop_server_arguments(sys.argv)) def run_client(self): # We import here to ensure that our setuptools parent has had a chance to diff --git a/src/python/grpcio_tests/setup.py b/src/python/grpcio_tests/setup.py index 8409dcc95197b..0cef4c2755e1c 100644 --- a/src/python/grpcio_tests/setup.py +++ b/src/python/grpcio_tests/setup.py @@ -47,6 +47,7 @@ "protobuf>=4.21.6rc1,!=4.22.0.*", "google-auth>=1.17.2", "requests>=2.14.2", + "absl-py>=1.4.0", ) COMMAND_CLASS = { diff --git a/src/python/grpcio_tests/tests/interop/BUILD.bazel b/src/python/grpcio_tests/tests/interop/BUILD.bazel index aa7e15544c4a8..2d16484742328 100644 --- a/src/python/grpcio_tests/tests/interop/BUILD.bazel +++ b/src/python/grpcio_tests/tests/interop/BUILD.bazel @@ -94,6 +94,7 @@ py_library( "//src/proto/grpc/testing:py_test_proto", "//src/python/grpcio/grpc:grpcio", "//src/python/grpcio_tests/tests/unit:test_common", + requirement("absl-py"), ], ) diff --git a/src/python/grpcio_tests/tests/interop/server.py b/src/python/grpcio_tests/tests/interop/server.py index d51671ef8a979..cc705b026da9b 100644 --- a/src/python/grpcio_tests/tests/interop/server.py +++ b/src/python/grpcio_tests/tests/interop/server.py @@ -13,10 +13,11 @@ # limitations under the License. """The Python implementation of the GRPC interoperability test server.""" -import argparse from concurrent import futures import logging +from absl import app +from absl.flags import argparse_flags import grpc from src.proto.grpc.testing import test_pb2_grpc @@ -28,8 +29,8 @@ _LOGGER = logging.getLogger(__name__) -def parse_interop_server_arguments(): - parser = argparse.ArgumentParser() +def parse_interop_server_arguments(argv): + parser = argparse_flags.ArgumentParser() parser.add_argument( "--port", type=int, required=True, help="the port on which to serve" ) @@ -45,7 +46,7 @@ def parse_interop_server_arguments(): type=resources.parse_bool, help="require an ALTS connection", ) - return parser.parse_args() + return parser.parse_args(argv[1:]) def get_server_credentials(use_tls): @@ -57,9 +58,7 @@ def get_server_credentials(use_tls): return grpc.alts_server_credentials() -def serve(): - args = parse_interop_server_arguments() - +def serve(args): server = test_common.test_server() test_pb2_grpc.add_TestServiceServicer_to_server( service.TestService(), server @@ -77,4 +76,4 @@ def serve(): if __name__ == "__main__": - serve() + app.run(serve, flags_parser=parse_interop_server_arguments) diff --git a/src/python/grpcio_tests/tests_aio/interop/server.py b/src/python/grpcio_tests/tests_aio/interop/server.py index 7786a4206a6d6..3247bed26a836 100644 --- a/src/python/grpcio_tests/tests_aio/interop/server.py +++ b/src/python/grpcio_tests/tests_aio/interop/server.py @@ -16,6 +16,7 @@ import argparse import asyncio import logging +import sys import grpc @@ -27,9 +28,7 @@ _LOGGER.setLevel(logging.DEBUG) -async def serve(): - args = interop_server_lib.parse_interop_server_arguments() - +async def serve(args): if args.use_tls or args.use_alts: credentials = interop_server_lib.get_server_credentials(args.use_tls) address, server = await _test_server.start_test_server( @@ -47,4 +46,5 @@ async def serve(): if __name__ == "__main__": - asyncio.get_event_loop().run_until_complete(serve()) + args = interop_server_lib.parse_interop_server_arguments(sys.argv) + asyncio.get_event_loop().run_until_complete(serve(args)) diff --git a/tools/run_tests/helper_scripts/build_python.sh b/tools/run_tests/helper_scripts/build_python.sh index 5057b642c9c19..b2a9e91c7cfb6 100755 --- a/tools/run_tests/helper_scripts/build_python.sh +++ b/tools/run_tests/helper_scripts/build_python.sh @@ -209,7 +209,7 @@ pip_install_dir "$ROOT/src/python/grpcio_testing" # Build/install tests pip_install coverage==4.4 oauth2client==4.1.0 \ google-auth>=1.17.2 requests==2.14.2 \ - googleapis-common-protos>=1.5.5 rsa==4.0 + googleapis-common-protos>=1.5.5 rsa==4.0 absl-py==1.4.0 $VENV_PYTHON "$ROOT/src/python/grpcio_tests/setup.py" preprocess $VENV_PYTHON "$ROOT/src/python/grpcio_tests/setup.py" build_package_protos pip_install_dir "$ROOT/src/python/grpcio_tests" From 29dd271d4403937df9ead7699fb6ec00abbca423 Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Mon, 24 Jul 2023 13:23:02 -0700 Subject: [PATCH 041/205] [testing] Enable end2end experiments for Windows continuous integration jobs (#32567) Co-authored-by: drfloob --- bazel/experiments.bzl | 20 -------------------- bazel/grpc_build_system.bzl | 2 -- src/core/lib/experiments/rollouts.yaml | 18 +++++++++++++++--- 3 files changed, 15 insertions(+), 25 deletions(-) diff --git a/bazel/experiments.bzl b/bazel/experiments.bzl index 67bf4b68e48a8..914cd1f0fef01 100644 --- a/bazel/experiments.bzl +++ b/bazel/experiments.bzl @@ -21,14 +21,10 @@ EXPERIMENTS = { "dbg": { }, "off": { - "cancel_ares_query_test": [ - "event_engine_dns", - ], "census_test": [ "transport_supplies_client_latency", ], "core_end2end_test": [ - "event_engine_client", "event_engine_listener", "promise_based_client_call", "promise_based_server_call", @@ -42,9 +38,6 @@ EXPERIMENTS = { "tcp_frame_size_tuning", "tcp_rcv_lowat", ], - "event_engine_client_test": [ - "event_engine_client", - ], "event_engine_listener_test": [ "event_engine_listener", ], @@ -59,9 +52,6 @@ EXPERIMENTS = { "logging_test": [ "promise_based_server_call", ], - "resolver_component_tests_runner_invoker": [ - "event_engine_dns", - ], "resource_quota_test": [ "free_large_allocator", "memory_pressure_controller", @@ -78,14 +68,10 @@ EXPERIMENTS = { "dbg": { }, "off": { - "cancel_ares_query_test": [ - "event_engine_dns", - ], "census_test": [ "transport_supplies_client_latency", ], "core_end2end_test": [ - "event_engine_client", "event_engine_listener", "promise_based_client_call", "promise_based_server_call", @@ -99,9 +85,6 @@ EXPERIMENTS = { "tcp_frame_size_tuning", "tcp_rcv_lowat", ], - "event_engine_client_test": [ - "event_engine_client", - ], "event_engine_listener_test": [ "event_engine_listener", ], @@ -116,9 +99,6 @@ EXPERIMENTS = { "logging_test": [ "promise_based_server_call", ], - "resolver_component_tests_runner_invoker": [ - "event_engine_dns", - ], "resource_quota_test": [ "free_large_allocator", "memory_pressure_controller", diff --git a/bazel/grpc_build_system.bzl b/bazel/grpc_build_system.bzl index 4b2243074b2a0..3c62942b6052b 100644 --- a/bazel/grpc_build_system.bzl +++ b/bazel/grpc_build_system.bzl @@ -394,8 +394,6 @@ def expand_tests(name, srcs, deps, tags, args, exclude_pollers, uses_polling, us must_have_tags = [ # We don't run experiments on cmake builds "bazel_only", - # Nor on windows - "no_windows", # Nor on mac "no_mac", # Nor on arm64 diff --git a/src/core/lib/experiments/rollouts.yaml b/src/core/lib/experiments/rollouts.yaml index 6a80638b6c90f..ced29a773c4be 100644 --- a/src/core/lib/experiments/rollouts.yaml +++ b/src/core/lib/experiments/rollouts.yaml @@ -33,7 +33,7 @@ # ios: broken # windows: false # posix: debug -# +# # Supported platforms: ios, windows, posix - name: tcp_frame_size_tuning @@ -47,7 +47,13 @@ - name: unconstrained_max_quota_buffer_size default: false - name: event_engine_client - default: false + default: + # not tested on iOS at all + ios: broken + posix: false + # TODO(hork): resolve when the client end2end test flake rate reduces to + # a tolerable amount. + windows: broken - name: monitoring_experiment default: true - name: promise_based_client_call @@ -65,7 +71,13 @@ - name: trace_record_callops default: false - name: event_engine_dns - default: false + default: + # not tested on iOS at all + ios: broken + posix: false + # TODO(yijiem): resolve when the WindowsEventEngine DNS Resolver is + # implemented + windows: broken - name: work_stealing default: false - name: client_privacy From 7c21997dbadaee392e6fa2a65602741eebf7d119 Mon Sep 17 00:00:00 2001 From: apolcyn Date: Mon, 24 Jul 2023 15:17:54 -0700 Subject: [PATCH 042/205] [ruby] remove unnecessary background thread startup wait logic that interferes with forking (#33805) Alternative to https://github.com/grpc/grpc/pull/33804 - this takes the approach in https://github.com/grpc/grpc/pull/33804#issuecomment-1645792677 Fix https://github.com/grpc/grpc/issues/33802 cc @casperisfine --- .../end2end/prefork_postfork_loop_test.rb | 44 +++++++++++++++ src/ruby/ext/grpc/rb_channel.c | 54 +------------------ tools/run_tests/run_tests.py | 2 + 3 files changed, 47 insertions(+), 53 deletions(-) create mode 100755 src/ruby/end2end/prefork_postfork_loop_test.rb diff --git a/src/ruby/end2end/prefork_postfork_loop_test.rb b/src/ruby/end2end/prefork_postfork_loop_test.rb new file mode 100755 index 0000000000000..a09f85bcc775a --- /dev/null +++ b/src/ruby/end2end/prefork_postfork_loop_test.rb @@ -0,0 +1,44 @@ +#!/usr/bin/env ruby +# +# Copyright 2016 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +ENV['GRPC_ENABLE_FORK_SUPPORT'] = "1" +fail "forking only supported on linux" unless RUBY_PLATFORM =~ /linux/ + +this_dir = File.expand_path(File.dirname(__FILE__)) +protos_lib_dir = File.join(this_dir, 'lib') +grpc_lib_dir = File.join(File.dirname(this_dir), 'lib') +$LOAD_PATH.unshift(grpc_lib_dir) unless $LOAD_PATH.include?(grpc_lib_dir) +$LOAD_PATH.unshift(protos_lib_dir) unless $LOAD_PATH.include?(protos_lib_dir) +$LOAD_PATH.unshift(this_dir) unless $LOAD_PATH.include?(this_dir) + +require 'grpc' +require 'end2end_common' + +def main + 10_000.times do + # The prefork and postfork APIs are meant to be used before and after a + # fork. So this is not technically correct usage of the API. However, the + # current implementation doesn't actually care about a "fork" call happening + # in between prefork and postfork_parent, and this is unlikely to change anytime + # soon. Also note the goal of this test is mainly to test the background thread startup + # and shutdown that happens in prefork and postfork_parent. If we were to actually + # fork in this test, it would take much longer to run. + GRPC.prefork + GRPC.postfork_parent + end +end + +main diff --git a/src/ruby/ext/grpc/rb_channel.c b/src/ruby/ext/grpc/rb_channel.c index aa8fb8a6f42b7..c8b4af07b998d 100644 --- a/src/ruby/ext/grpc/rb_channel.c +++ b/src/ruby/ext/grpc/rb_channel.c @@ -97,8 +97,6 @@ static bg_watched_channel* bg_watched_channel_list_head = NULL; static void grpc_rb_channel_try_register_connection_polling( bg_watched_channel* bg); -static void* wait_until_channel_polling_thread_started_no_gil(void*); -static void wait_until_channel_polling_thread_started_unblocking_func(void*); static void* channel_init_try_register_connection_polling_without_gil( void* arg); @@ -111,7 +109,6 @@ static grpc_completion_queue* g_channel_polling_cq; static gpr_mu global_connection_polling_mu; static gpr_cv global_connection_polling_cv; static int g_abort_channel_polling = 0; -static int g_channel_polling_thread_started = 0; static gpr_once g_once_init = GPR_ONCE_INIT; static VALUE g_channel_polling_thread = Qnil; @@ -224,12 +221,6 @@ static VALUE grpc_rb_channel_init(int argc, VALUE* argv, VALUE self) { channel_init_try_register_stack stack; grpc_ruby_fork_guard(); - int stop_waiting_for_thread_start = 0; - rb_thread_call_without_gvl( - wait_until_channel_polling_thread_started_no_gil, - &stop_waiting_for_thread_start, - wait_until_channel_polling_thread_started_unblocking_func, - &stop_waiting_for_thread_start); /* "3" == 3 mandatory args */ rb_scan_args(argc, argv, "3", &target, &channel_args, &credentials); @@ -286,7 +277,6 @@ static void* get_state_without_gil(void* arg) { get_state_stack* stack = (get_state_stack*)arg; gpr_mu_lock(&global_connection_polling_mu); - GPR_ASSERT(g_abort_channel_polling || g_channel_polling_thread_started); if (stack->bg->channel_destroyed) { stack->out = GRPC_CHANNEL_SHUTDOWN; } else { @@ -423,15 +413,8 @@ static void grpc_rb_channel_maybe_recreate_channel_after_fork( bg_watched_channel* bg = wrapper->bg_wrapped; if (bg->channel_destroyed) { // There must be one ref at this point, held by the ruby-level channel - // object. + // object, drop this one here. GPR_ASSERT(bg->refcount == 1); - // Wait for channel polling thread to re-initialize - int stop_waiting_for_thread_start = 0; - rb_thread_call_without_gvl( - wait_until_channel_polling_thread_started_no_gil, - &stop_waiting_for_thread_start, - wait_until_channel_polling_thread_started_unblocking_func, - &stop_waiting_for_thread_start); rb_thread_call_without_gvl(channel_safe_destroy_without_gil, bg, NULL, NULL); // re-create C-core channel @@ -635,9 +618,6 @@ static void grpc_rb_channel_try_register_connection_polling( bg_watched_channel* bg) { grpc_connectivity_state conn_state; watch_state_op* op = NULL; - - GPR_ASSERT(g_channel_polling_thread_started || g_abort_channel_polling); - if (bg->refcount == 0) { GPR_ASSERT(bg->channel_destroyed); bg_watched_channel_list_free_and_remove(bg); @@ -647,7 +627,6 @@ static void grpc_rb_channel_try_register_connection_polling( if (bg->channel_destroyed || g_abort_channel_polling) { return; } - conn_state = grpc_channel_check_connectivity_state(bg->channel, 0); if (conn_state == GRPC_CHANNEL_SHUTDOWN) { return; @@ -655,7 +634,6 @@ static void grpc_rb_channel_try_register_connection_polling( GPR_ASSERT(bg_watched_channel_list_lookup(bg)); // prevent bg from being free'd by GC while background thread is watching it bg->refcount++; - op = gpr_zalloc(sizeof(watch_state_op)); op->op_type = CONTINUOUS_WATCH; op->op.continuous_watch_callback_args.bg = bg; @@ -678,9 +656,6 @@ static void* run_poll_channels_loop_no_gil(void* arg) { gpr_log(GPR_DEBUG, "GRPC_RUBY: run_poll_channels_loop_no_gil - begin"); gpr_mu_lock(&global_connection_polling_mu); - GPR_ASSERT(!g_abort_channel_polling); - GPR_ASSERT(!g_channel_polling_thread_started); - g_channel_polling_thread_started = 1; gpr_cv_broadcast(&global_connection_polling_cv); gpr_mu_unlock(&global_connection_polling_mu); @@ -761,31 +736,6 @@ static VALUE run_poll_channels_loop(VALUE arg) { return Qnil; } -static void* wait_until_channel_polling_thread_started_no_gil(void* arg) { - int* stop_waiting = (int*)arg; - gpr_log(GPR_DEBUG, "GRPC_RUBY: wait for channel polling thread to start"); - gpr_mu_lock(&global_connection_polling_mu); - while (!g_channel_polling_thread_started && !g_abort_channel_polling && - !*stop_waiting) { - gpr_cv_wait(&global_connection_polling_cv, &global_connection_polling_mu, - gpr_inf_future(GPR_CLOCK_REALTIME)); - } - gpr_mu_unlock(&global_connection_polling_mu); - - return NULL; -} - -static void wait_until_channel_polling_thread_started_unblocking_func( - void* arg) { - int* stop_waiting = (int*)arg; - gpr_mu_lock(&global_connection_polling_mu); - gpr_log(GPR_DEBUG, - "GRPC_RUBY: interrupt wait for channel polling thread to start"); - *stop_waiting = 1; - gpr_cv_broadcast(&global_connection_polling_cv); - gpr_mu_unlock(&global_connection_polling_mu); -} - static void* set_abort_channel_polling_without_gil(void* arg) { (void)arg; gpr_mu_lock(&global_connection_polling_mu); @@ -814,7 +764,6 @@ void grpc_rb_channel_polling_thread_start() { gpr_once_init(&g_once_init, do_basic_init); GPR_ASSERT(!RTEST(g_channel_polling_thread)); GPR_ASSERT(!g_abort_channel_polling); - GPR_ASSERT(!g_channel_polling_thread_started); GPR_ASSERT(g_channel_polling_cq == NULL); g_channel_polling_cq = grpc_completion_queue_create_for_next(NULL); @@ -841,7 +790,6 @@ void grpc_rb_channel_polling_thread_stop() { // we can start again later g_channel_polling_thread = Qnil; g_abort_channel_polling = false; - g_channel_polling_thread_started = false; g_channel_polling_cq = NULL; } diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 47b12f1091748..774bf054e7da6 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -945,6 +945,7 @@ def test_specs(self): "src/ruby/end2end/fork_test.rb", "src/ruby/end2end/simple_fork_test.rb", "src/ruby/end2end/prefork_without_using_grpc_test.rb", + "src/ruby/end2end/prefork_postfork_loop_test.rb", "src/ruby/end2end/secure_fork_test.rb", "src/ruby/end2end/bad_usage_fork_test.rb", "src/ruby/end2end/sig_handling_test.rb", @@ -969,6 +970,7 @@ def test_specs(self): "src/ruby/end2end/secure_fork_test.rb", "src/ruby/end2end/bad_usage_fork_test.rb", "src/ruby/end2end/prefork_without_using_grpc_test.rb", + "src/ruby/end2end/prefork_postfork_loop_test.rb", ]: if platform_string() == "mac": # Skip fork tests on mac, it's only supported on linux. From 9104269a3f04fc3ed81542f60759106668e88416 Mon Sep 17 00:00:00 2001 From: Hannah Shi Date: Mon, 24 Jul 2023 16:37:08 -0700 Subject: [PATCH 043/205] [ObjC] fix a leaked CFStringRef created from CFStringCreateWithCString (#33822) Use CFTypeUniqueRef to management it. --- src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc b/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc index f77a626d7f533..1dd3107381f04 100644 --- a/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc +++ b/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc @@ -96,8 +96,8 @@ void CFStreamEndpointImpl::Connect( std::string host_string; std::string port_string; grpc_core::SplitHostPort(host_port.value(), &host_string, &port_string); - CFStringRef host = CFStringCreateWithCString(NULL, host_string.c_str(), - kCFStringEncodingUTF8); + CFTypeUniqueRef host = CFStringCreateWithCString( + NULL, host_string.c_str(), kCFStringEncodingUTF8); int port = ResolvedAddressGetPort(peer_address_); CFStreamCreatePairWithSocketToHost(NULL, host, port, &cf_read_stream_, &cf_write_stream_); From 8bdbd96ba82b86fe4bbfe0179b6fe1568d0297b0 Mon Sep 17 00:00:00 2001 From: Eugene Ostroukhov Date: Mon, 24 Jul 2023 16:39:19 -0700 Subject: [PATCH 044/205] [Interop] Update docker images (#33847) This fixes the security issues that were identified. --- .../grpcio_tests/tests_py3_only/interop/Dockerfile.client | 4 ++-- .../grpcio_tests/tests_py3_only/interop/Dockerfile.server | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.client b/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.client index 5c8965e70d097..6bd6d4ce8b3c2 100644 --- a/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.client +++ b/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.client @@ -1,4 +1,4 @@ -FROM phusion/baseimage:master@sha256:65ea10d5f757e5e86272625f8675d437dd83d8db64bdb429e2354d58f5462750 +FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc RUN apt-get update -y && \ apt-get install -y \ @@ -16,7 +16,7 @@ COPY . . RUN tools/bazel build -c dbg //src/python/grpcio_tests/tests_py3_only/interop:xds_interop_client RUN cp -rL /workdir/bazel-bin/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_client* /artifacts/ -FROM phusion/baseimage:master@sha256:65ea10d5f757e5e86272625f8675d437dd83d8db64bdb429e2354d58f5462750 +FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc COPY --from=0 /artifacts ./ ENV GRPC_VERBOSITY="DEBUG" diff --git a/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.server b/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.server index d9fa7b3b14b00..bc63f4ecd9fa0 100644 --- a/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.server +++ b/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.server @@ -1,4 +1,4 @@ -FROM phusion/baseimage:master@sha256:65ea10d5f757e5e86272625f8675d437dd83d8db64bdb429e2354d58f5462750 +FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc RUN apt-get update -y && \ apt-get install -y \ @@ -16,7 +16,7 @@ COPY . . RUN tools/bazel build -c dbg //src/python/grpcio_tests/tests_py3_only/interop:xds_interop_server RUN cp -rL /workdir/bazel-bin/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_server* /artifacts/ -FROM phusion/baseimage:master@sha256:65ea10d5f757e5e86272625f8675d437dd83d8db64bdb429e2354d58f5462750 +FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc COPY --from=0 /artifacts ./ ENV GRPC_VERBOSITY="DEBUG" From 44864c1589040d5dfcb9c793a070efe51d0fb574 Mon Sep 17 00:00:00 2001 From: nanahpang <31627465+nanahpang@users.noreply.github.com> Date: Mon, 24 Jul 2023 22:45:22 -0700 Subject: [PATCH 045/205] [chaotic-good] Clean up unused requested_read_args in PromiseEndpoint::ReadCallback. (#33848) This is a clean up PR for discussion in #33257. --- src/core/lib/transport/promise_endpoint.cc | 21 +++++++---------- src/core/lib/transport/promise_endpoint.h | 26 +++++++++------------- 2 files changed, 18 insertions(+), 29 deletions(-) diff --git a/src/core/lib/transport/promise_endpoint.cc b/src/core/lib/transport/promise_endpoint.cc index 5ce0ba3568e4b..660d183a6474d 100644 --- a/src/core/lib/transport/promise_endpoint.cc +++ b/src/core/lib/transport/promise_endpoint.cc @@ -68,11 +68,8 @@ void PromiseEndpoint::WriteCallback(absl::Status status) { write_waker_.Wakeup(); } -void PromiseEndpoint::ReadCallback( - absl::Status status, size_t num_bytes_requested, - absl::optional< - struct grpc_event_engine::experimental::EventEngine::Endpoint::ReadArgs> - requested_read_args) { +void PromiseEndpoint::ReadCallback(absl::Status status, + size_t num_bytes_requested) { if (!status.ok()) { // Invalidates all previous reads. pending_read_buffer_.Clear(); @@ -88,18 +85,16 @@ void PromiseEndpoint::ReadCallback( if (read_buffer_.Length() < num_bytes_requested) { // A further read is needed. // Set read args with number of bytes needed as hint. - requested_read_args = { - static_cast(num_bytes_requested - read_buffer_.Length())}; + grpc_event_engine::experimental::EventEngine::Endpoint::ReadArgs + read_args = {static_cast(num_bytes_requested - + read_buffer_.Length())}; // If `Read()` returns true immediately, the callback will not be // called. We still need to call our callback to pick up the result and // maybe do further reads. if (endpoint_->Read(std::bind(&PromiseEndpoint::ReadCallback, this, - std::placeholders::_1, num_bytes_requested, - requested_read_args), - &pending_read_buffer_, - &(requested_read_args.value()))) { - ReadCallback(absl::OkStatus(), num_bytes_requested, - requested_read_args); + std::placeholders::_1, num_bytes_requested), + &pending_read_buffer_, &read_args)) { + ReadCallback(absl::OkStatus(), num_bytes_requested); } } else { MutexLock lock(&read_mutex_); diff --git a/src/core/lib/transport/promise_endpoint.h b/src/core/lib/transport/promise_endpoint.h index dc672548ed1ff..d80071703d60e 100644 --- a/src/core/lib/transport/promise_endpoint.h +++ b/src/core/lib/transport/promise_endpoint.h @@ -107,16 +107,14 @@ class PromiseEndpoint { lock.Release(); // Set read args with hinted bytes. grpc_event_engine::experimental::EventEngine::Endpoint::ReadArgs - read_args; - read_args.read_hint_bytes = num_bytes; + read_args = {static_cast(num_bytes)}; // If `Read()` returns true immediately, the callback will not be // called. We still need to call our callback to pick up the result and // maybe do further reads. if (endpoint_->Read(std::bind(&PromiseEndpoint::ReadCallback, this, - std::placeholders::_1, num_bytes, - absl::nullopt /* uses default arguments */), + std::placeholders::_1, num_bytes), &pending_read_buffer_, &read_args)) { - ReadCallback(absl::OkStatus(), num_bytes, read_args); + ReadCallback(absl::OkStatus(), num_bytes); } } else { read_result_ = absl::OkStatus(); @@ -158,16 +156,15 @@ class PromiseEndpoint { if (read_buffer_.Length() < num_bytes) { lock.Release(); // Set read args with num_bytes as hint. - const struct grpc_event_engine::experimental::EventEngine::Endpoint:: - ReadArgs read_args = {static_cast(num_bytes)}; + grpc_event_engine::experimental::EventEngine::Endpoint::ReadArgs + read_args = {static_cast(num_bytes)}; // If `Read()` returns true immediately, the callback will not be // called. We still need to call our callback to pick up the result // and maybe do further reads. - if (endpoint_->Read( - std::bind(&PromiseEndpoint::ReadCallback, this, - std::placeholders::_1, num_bytes, read_args), - &pending_read_buffer_, &read_args)) { - ReadCallback(absl::OkStatus(), num_bytes, read_args); + if (endpoint_->Read(std::bind(&PromiseEndpoint::ReadCallback, this, + std::placeholders::_1, num_bytes), + &pending_read_buffer_, &read_args)) { + ReadCallback(absl::OkStatus(), num_bytes); } } else { read_result_ = absl::OkStatus(); @@ -284,10 +281,7 @@ class PromiseEndpoint { // Callback function used for `EventEngine::Endpoint::Read()` shared between // `Read()` and `ReadSlice()`. - void ReadCallback(absl::Status status, size_t num_bytes_requested, - absl::optional - requested_read_arg = absl::nullopt); + void ReadCallback(absl::Status status, size_t num_bytes_requested); // Callback function used for `EventEngine::Endpoint::Read()` in `ReadByte()`. void ReadByteCallback(absl::Status status); }; From baa7c1ac4b563feb9209aa540b0ebeb4392c6f02 Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Tue, 25 Jul 2023 09:36:38 -0700 Subject: [PATCH 046/205] [experiment] Extend work stealing experiment expiration (#33856) --- src/core/lib/experiments/experiments.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/lib/experiments/experiments.yaml b/src/core/lib/experiments/experiments.yaml index f34ffc7c4f0ee..99e62bcc84b63 100644 --- a/src/core/lib/experiments/experiments.yaml +++ b/src/core/lib/experiments/experiments.yaml @@ -124,7 +124,7 @@ - name: work_stealing description: If set, use a work stealing thread pool implementation in EventEngine - expiry: 2023/08/01 + expiry: 2023/10/01 owner: hork@google.com test_tags: ["core_end2end_test"] allow_in_fuzzing_config: false From 6582789e4fc1e517cffa0d47c811dc5df969b6f7 Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Tue, 25 Jul 2023 10:20:23 -0700 Subject: [PATCH 047/205] [fix] GRPC_LOG_EVERY_N_SEC (#33858) This method was not printing every N seconds. This problem has been seen many times, sometimes printing erratically, sometimes printing once and never again. [Example](https://source.cloud.google.com/results/invocations/32b85281-19ef-4e73-b2c4-cbfe2c1daf9a/targets/%2F%2Ftest%2Fcore%2Fend2end:retry_cancel_after_first_attempt_starts_test@poller%3Depoll1@experiment%3Devent_engine_listener/log) --- src/core/lib/gprpp/time.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/lib/gprpp/time.h b/src/core/lib/gprpp/time.h index 3c39916c3b072..32b1065e380b5 100644 --- a/src/core/lib/gprpp/time.h +++ b/src/core/lib/gprpp/time.h @@ -37,8 +37,8 @@ uint64_t now = grpc_core::Timestamp::FromTimespecRoundDown( \ gpr_now(GPR_CLOCK_MONOTONIC)) \ .milliseconds_after_process_epoch(); \ - uint64_t prev_tsamp = prev.exchange(now); \ - if (prev_tsamp == 0 || now - prev_tsamp > (n)*1000) { \ + if (prev == 0 || now - prev > (n)*1000) { \ + prev = now; \ gpr_log(severity, format, __VA_ARGS__); \ } \ } while (0) From e62f600838d936732742e8b52e455af103961705 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 25 Jul 2023 19:30:23 +0200 Subject: [PATCH 048/205] [dockerfiles] Improvements and fixes to push_testing_images.sh script (#33760) - add check that there are no unwanted .current_version files left in the repo after foobar/Dockerfile gets deleted. - revisit the logic for repo digest vs id digest of docker images. --- ..._stretch_aarch64_cross_x64.current_version | 1 - .../cpp_stretch_x64.current_version | 1 - .../csharp_stretch_x64.current_version | 1 - .../php7_stretch_x64.current_version | 1 - .../ruby_stretch_x64.current_version | 1 - .../ruby_stretch_x64_ruby_2_6.current_version | 1 - .../ruby_stretch_x64_ruby_2_7.current_version | 1 - .../ruby_stretch_x64_ruby_3_0.current_version | 1 - tools/dockerfile/push_testing_images.sh | 51 +++++++++++++++---- 9 files changed, 40 insertions(+), 19 deletions(-) delete mode 100644 tools/dockerfile/distribtest/cpp_stretch_aarch64_cross_x64.current_version delete mode 100644 tools/dockerfile/distribtest/cpp_stretch_x64.current_version delete mode 100644 tools/dockerfile/distribtest/csharp_stretch_x64.current_version delete mode 100644 tools/dockerfile/distribtest/php7_stretch_x64.current_version delete mode 100644 tools/dockerfile/distribtest/ruby_stretch_x64.current_version delete mode 100644 tools/dockerfile/distribtest/ruby_stretch_x64_ruby_2_6.current_version delete mode 100644 tools/dockerfile/distribtest/ruby_stretch_x64_ruby_2_7.current_version delete mode 100644 tools/dockerfile/distribtest/ruby_stretch_x64_ruby_3_0.current_version diff --git a/tools/dockerfile/distribtest/cpp_stretch_aarch64_cross_x64.current_version b/tools/dockerfile/distribtest/cpp_stretch_aarch64_cross_x64.current_version deleted file mode 100644 index ce29a826cadee..0000000000000 --- a/tools/dockerfile/distribtest/cpp_stretch_aarch64_cross_x64.current_version +++ /dev/null @@ -1 +0,0 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/cpp_stretch_aarch64_cross_x64:936bd8a34fcd95c00b40e1e08ad31a39fb5211a6@sha256:5f43add221246deb62fbdff53fe3819c66c854a3913bf77f2f5b785b6a94900b \ No newline at end of file diff --git a/tools/dockerfile/distribtest/cpp_stretch_x64.current_version b/tools/dockerfile/distribtest/cpp_stretch_x64.current_version deleted file mode 100644 index 57b7600089999..0000000000000 --- a/tools/dockerfile/distribtest/cpp_stretch_x64.current_version +++ /dev/null @@ -1 +0,0 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/cpp_stretch_x64:02187d31870bf506ac5868b46c2192e01e94fa0a@sha256:1711316cc325618ca43e1d04804833d373166f8313bf439eb4c33e4dbaa905e9 \ No newline at end of file diff --git a/tools/dockerfile/distribtest/csharp_stretch_x64.current_version b/tools/dockerfile/distribtest/csharp_stretch_x64.current_version deleted file mode 100644 index 80c83e1265c6a..0000000000000 --- a/tools/dockerfile/distribtest/csharp_stretch_x64.current_version +++ /dev/null @@ -1 +0,0 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_stretch_x64:d2178edef3faf5fb811b8c4d10fa98ab8e8bd189@sha256:fec8c0637c0163308ba1e2b2592dfbabba8d89c0391e58065bf10ea2659d9d59 \ No newline at end of file diff --git a/tools/dockerfile/distribtest/php7_stretch_x64.current_version b/tools/dockerfile/distribtest/php7_stretch_x64.current_version deleted file mode 100644 index 936ec6e310d4d..0000000000000 --- a/tools/dockerfile/distribtest/php7_stretch_x64.current_version +++ /dev/null @@ -1 +0,0 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/php7_stretch_x64:6cb7b602cb33592b27bd512966d6f8f93687d349@sha256:ac384de1434b4f922a0b68c7acde5c5811fc89b8f78a67d195222487c0f83fa5 \ No newline at end of file diff --git a/tools/dockerfile/distribtest/ruby_stretch_x64.current_version b/tools/dockerfile/distribtest/ruby_stretch_x64.current_version deleted file mode 100644 index 27f680e58737f..0000000000000 --- a/tools/dockerfile/distribtest/ruby_stretch_x64.current_version +++ /dev/null @@ -1 +0,0 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_stretch_x64:10177ff0d2d316c3bb7552726524137c2ae19c90@sha256:fb3c9a4fb54aaf0c2e759be4b544cce7a8c9e115902f8f80b5e5992dcf110021 \ No newline at end of file diff --git a/tools/dockerfile/distribtest/ruby_stretch_x64_ruby_2_6.current_version b/tools/dockerfile/distribtest/ruby_stretch_x64_ruby_2_6.current_version deleted file mode 100644 index 266b98f7ba2e8..0000000000000 --- a/tools/dockerfile/distribtest/ruby_stretch_x64_ruby_2_6.current_version +++ /dev/null @@ -1 +0,0 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_stretch_x64_ruby_2_6:4b215aa6d7029aaa63679881d54b8ca620e2d775@sha256:b9cc471908386767a9dbf3baffb7a67aa93c4cd1057c4ba8572c691c8ba4b3e6 \ No newline at end of file diff --git a/tools/dockerfile/distribtest/ruby_stretch_x64_ruby_2_7.current_version b/tools/dockerfile/distribtest/ruby_stretch_x64_ruby_2_7.current_version deleted file mode 100644 index ce033d128a4e8..0000000000000 --- a/tools/dockerfile/distribtest/ruby_stretch_x64_ruby_2_7.current_version +++ /dev/null @@ -1 +0,0 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_stretch_x64_ruby_2_7:ab78ab5469a4245bff384c61814f940403206afe@sha256:086280e74db8a0f3c4bdc54626f94011284f02d5e787d9d55413261c35526394 \ No newline at end of file diff --git a/tools/dockerfile/distribtest/ruby_stretch_x64_ruby_3_0.current_version b/tools/dockerfile/distribtest/ruby_stretch_x64_ruby_3_0.current_version deleted file mode 100644 index d7c23343bd5f2..0000000000000 --- a/tools/dockerfile/distribtest/ruby_stretch_x64_ruby_3_0.current_version +++ /dev/null @@ -1 +0,0 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_stretch_x64_ruby_3_0:bbc6812686a00d8f9d1254acdbe86e0ef0d00d28@sha256:a28654540308499bc45592118f115fbdbf4813fd692438219bbe8574235c902e \ No newline at end of file diff --git a/tools/dockerfile/push_testing_images.sh b/tools/dockerfile/push_testing_images.sh index 2bb774bd3bf8a..f922a59fcc00f 100755 --- a/tools/dockerfile/push_testing_images.sh +++ b/tools/dockerfile/push_testing_images.sh @@ -67,6 +67,22 @@ ALL_DOCKERFILE_DIRS=( CHECK_FAILED="" +if [ "${CHECK_MODE}" != "" ] +then + # Check that there are no stale .current_version files (for which the corresponding + # dockerfile_dir doesn't exist anymore). + for CURRENTVERSION_FILE in $(find tools/ third_party/rake-compiler-dock -name '*.current_version') + do + DOCKERFILE_DIR="$(echo ${CURRENTVERSION_FILE} | sed 's/.current_version$//')" + if [ ! -e "${DOCKERFILE_DIR}/Dockerfile" ] + then + echo "Found that ${DOCKERFILE_DIR} has '.current_version' file but there is no corresponding Dockerfile." + echo "Should the ${CURRENTVERSION_FILE} file be deleted?" + CHECK_FAILED=true + fi + done +fi + for DOCKERFILE_DIR in "${ALL_DOCKERFILE_DIRS[@]}" do # Generate image name based on Dockerfile checksum. That works well as long @@ -86,6 +102,7 @@ do if [ "${LOCAL_ONLY_MODE}" == "" ] then + # value obtained here corresponds to the "RepoDigests" from "docker image inspect", but without the need to actually pull the image DOCKER_IMAGE_DIGEST_REMOTE=$(gcloud artifacts docker images describe "${ARTIFACT_REGISTRY_PREFIX}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG}" --format=json | jq -r '.image_summary.digest') if [ "${DOCKER_IMAGE_DIGEST_REMOTE}" != "" ] @@ -130,7 +147,12 @@ do # if the .current_version file doesn't exist or it doesn't contain the right SHA checksum, # it is out of date and we will need to rebuild the docker image locally. LOCAL_BUILD_REQUIRED="" - grep "^${ARTIFACT_REGISTRY_PREFIX}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG}@sha256:.*" ${DOCKERFILE_DIR}.current_version >/dev/null || LOCAL_BUILD_REQUIRED=true + grep "^${ARTIFACT_REGISTRY_PREFIX}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG}@sha256:.*$" ${DOCKERFILE_DIR}.current_version >/dev/null || LOCAL_BUILD_REQUIRED=true + + # If the current version file has contains SHA checksum, but not the remote image digest, + # it means the locally-built image hasn't been pushed to artifact registry yet. + DIGEST_MISSING_IN_CURRENT_VERSION_FILE="" + grep "^${ARTIFACT_REGISTRY_PREFIX}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG}$" ${DOCKERFILE_DIR}.current_version >/dev/null && DIGEST_MISSING_IN_CURRENT_VERSION_FILE=true if [ "${LOCAL_BUILD_REQUIRED}" == "" ] then @@ -138,6 +160,13 @@ do continue fi + if [ "${CHECK_MODE}" != "" ] && [ "${DIGEST_MISSING_IN_CURRENT_VERSION_FILE}" != "" ] + then + echo "CHECK FAILED: Dockerfile for ${DOCKER_IMAGE_NAME} has changed and was built locally, but looks like it hasn't been pushed." + CHECK_FAILED=true + continue + fi + if [ "${CHECK_MODE}" != "" ] then echo "CHECK FAILED: Dockerfile for ${DOCKER_IMAGE_NAME} has changed, but the ${DOCKERFILE_DIR}.current_version is not up to date." @@ -162,23 +191,23 @@ do docker tag ${DOCKERHUB_ORGANIZATION}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG} ${ARTIFACT_REGISTRY_PREFIX}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG} fi - DOCKER_IMAGE_DIGEST_LOCAL=$(docker image inspect "${ARTIFACT_REGISTRY_PREFIX}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG}" | jq -e -r '.[0].Id') - - # update info on what we consider to be the current version of the docker image (which will be used to run tests) - echo -n "${ARTIFACT_REGISTRY_PREFIX}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG}@${DOCKER_IMAGE_DIGEST_LOCAL}" >${DOCKERFILE_DIR}.current_version + # After building the docker image locally, we don't know the image's RepoDigest (which is distinct from image's "Id" digest) yet + # so we can only update the .current_version file with the image tag (which will be enough for running tests under docker locally). + # The .current_version file will be updated with both tag and SHA256 repo digest later, once we actually push it. + # See b/278226801 for context. + echo -n "${ARTIFACT_REGISTRY_PREFIX}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG}" >${DOCKERFILE_DIR}.current_version if [ "${SKIP_UPLOAD}" == "" ] && [ "${LOCAL_ONLY_MODE}" == "" ] then docker push ${ARTIFACT_REGISTRY_PREFIX}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG} + + # After successful push, the image's RepoDigest info will become available in "docker image inspect", + # so we update the .current_version file with the repo digest. + DOCKER_IMAGE_DIGEST_REMOTE=$(docker image inspect "${ARTIFACT_REGISTRY_PREFIX}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG}" | jq -e -r ".[0].RepoDigests[] | select(contains(\"${ARTIFACT_REGISTRY_PREFIX}/${DOCKER_IMAGE_NAME}@\"))" | sed 's/^.*@sha256:/sha256:/') + echo -n "${ARTIFACT_REGISTRY_PREFIX}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG}@${DOCKER_IMAGE_DIGEST_REMOTE}" >${DOCKERFILE_DIR}.current_version fi done -if [ "${CHECK_MODE}" != "" ] -then - # TODO(jtattermusch): check there are no extra current_version files (for which there isn't a corresponding Dockerfile) - true -fi - if [ "${CHECK_FAILED}" != "" ] then echo "ERROR: Some checks have failed." From c82d31677aeea66c128a5b912ad87efcd5f74d67 Mon Sep 17 00:00:00 2001 From: Sergii Tkachenko Date: Tue, 25 Jul 2023 14:08:19 -0400 Subject: [PATCH 049/205] [PSM Interop] Legacy tests: update Kokoro to Ubuntu 22.04 (#33685) ref b/274944592, cl/550719530 --- tools/run_tests/helper_scripts/prep_xds.sh | 24 +++++++++++++++++----- tools/run_tests/run_xds_tests.py | 8 ++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/tools/run_tests/helper_scripts/prep_xds.sh b/tools/run_tests/helper_scripts/prep_xds.sh index 64e7c40eb344a..ece7a2d74c863 100755 --- a/tools/run_tests/helper_scripts/prep_xds.sh +++ b/tools/run_tests/helper_scripts/prep_xds.sh @@ -17,12 +17,24 @@ trap 'date' DEBUG set -ex # change to grpc repo root -cd "$(dirname "$0")/../../.." +pushd "${KOKORO_ARTIFACTS_DIR}/github/grpc" -sudo apt-get install -y python3-pip -sudo python3 -m pip install --upgrade pip -sudo python3 -m pip install --upgrade setuptools -sudo python3 -m pip install --upgrade grpcio==1.31.0 grpcio-tools==1.31.0 protobuf google-api-python-client google-auth-httplib2 oauth2client xds-protos +# Note: we don't use venv here because then per-language build files would need +# to source this script to have venv python be on the PATH. This would require +# backport this change to ~30 branches. Instead, we just install pip packages +# globally here. If this ever breaks, uncomment the following lines, remove +# sudo from pip install, and do the backports. +# +# sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update +# sudo DEBIAN_FRONTEND=noninteractive apt-get -qq install --auto-remove "python3.10-venv" +# VIRTUAL_ENV=$(mktemp -d) +# python3 -m venv "${VIRTUAL_ENV}" +# source "${VIRTUAL_ENV}/bin/activate" + +sudo python3 -m pip install --upgrade pip==19.3.1 +# TODO(sergiitk): Unpin grpcio-tools when a version of xds-protos +# compatible with protobuf 4.X is uploaded to PyPi. +sudo python3 -m pip install --upgrade grpcio grpcio-tools==1.48.1 google-api-python-client google-auth-httplib2 oauth2client xds-protos # Prepare generated Python code. TOOLS_DIR=tools/run_tests @@ -47,3 +59,5 @@ python3 -m grpc_tools.protoc \ --python_out=${TOOLS_DIR} \ --grpc_python_out=${TOOLS_DIR} \ ${HEALTH_PROTO_SOURCE_DIR}/health.proto + +popd diff --git a/tools/run_tests/run_xds_tests.py b/tools/run_tests/run_xds_tests.py index a727d8614ae0a..9c33ba10b3e56 100755 --- a/tools/run_tests/run_xds_tests.py +++ b/tools/run_tests/run_xds_tests.py @@ -337,6 +337,14 @@ def parse_port_range(port_arg): if args.verbose: logger.setLevel(logging.DEBUG) +# In grpc-testing, use non-legacy network. +if ( + args.project_id == "grpc-testing" + and args.network + and args.network == argp.get_default("network") +): + args.network += "-vpc" + CLIENT_HOSTS = [] if args.client_hosts: CLIENT_HOSTS = args.client_hosts.split(",") From 498fc99479a01177aa2ad257f1390521495b0788 Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Tue, 25 Jul 2023 16:41:02 -0700 Subject: [PATCH 050/205] [packaging] Publish xds-protos as part of the standard package pipeline (#33797) This PR: - Fixes the xds-protos Python package, which was broken when the `udpa` submodule was removed - This required re-adding the protoc-gen-validate submodule - Adds non-Bazel tests for xds-protos and all of its dependent packages - Versions xds-protos the same way as the rest of the Python packages - Fixes Python 3.11 support in `run_tests.py`, which is necessary for the testing mentioned above CC @sergiitk You won't be able to consume this in the interop tests until it makes it into a release. I'm thinking I'll want to backport this to the 1.57.x branch to make that happen faster. CC @drfloob to inform him about the likely backport. --- src/python/grpcio_csds/setup.py | 4 +- src/python/grpcio_tests/tests/tests.json | 2 + .../xds_protos/grpc_version.py.template | 20 +++ .../dockerfile/compile_python_311.include | 21 ++++ .../Dockerfile.template | 6 + third_party/protoc-gen-validate | 1 + tools/distrib/python/xds_protos/MANIFEST.in | 1 + tools/distrib/python/xds_protos/build.py | 29 +++-- .../distrib/python/xds_protos/grpc_version.py | 18 +++ tools/distrib/python/xds_protos/setup.py | 12 +- ...ython_debian11_default_x64.current_version | 2 +- .../python_debian11_default_x64/Dockerfile | 26 ++++ .../artifacts/build_artifact_python.sh | 10 +- .../run_tests/helper_scripts/build_python.sh | 7 +- tools/run_tests/run_tests.py | 116 +++++++++++------- tools/run_tests/sanity/check_submodules.sh | 1 + 16 files changed, 218 insertions(+), 58 deletions(-) create mode 100644 templates/tools/distrib/python/xds_protos/grpc_version.py.template create mode 100644 templates/tools/dockerfile/compile_python_311.include create mode 160000 third_party/protoc-gen-validate create mode 100644 tools/distrib/python/xds_protos/MANIFEST.in create mode 100644 tools/distrib/python/xds_protos/grpc_version.py diff --git a/src/python/grpcio_csds/setup.py b/src/python/grpcio_csds/setup.py index 120f127e7ae3d..8310345b8e1bf 100644 --- a/src/python/grpcio_csds/setup.py +++ b/src/python/grpcio_csds/setup.py @@ -40,8 +40,8 @@ INSTALL_REQUIRES = ( "protobuf>=4.21.6", - "xds-protos>=0.0.7", - "grpcio>={version}".format(version=grpc_version.VERSION), + f"xds-protos=={grpc_version.VERSION}", + f"grpcio>={grpc_version.VERSION}", ) SETUP_REQUIRES = INSTALL_REQUIRES diff --git a/src/python/grpcio_tests/tests/tests.json b/src/python/grpcio_tests/tests/tests.json index 7251a4b111481..60d86d8727fd2 100644 --- a/src/python/grpcio_tests/tests/tests.json +++ b/src/python/grpcio_tests/tests/tests.json @@ -1,6 +1,8 @@ [ "_sanity._sanity_test.SanityTest", + "admin.test_admin.TestAdmin", "channelz._channelz_servicer_test.ChannelzServicerTest", + "csds.test_csds.TestCsds", "fork._fork_interop_test.ForkInteropTest", "health_check._health_servicer_test.HealthServicerBackwardsCompatibleWatchTest", "health_check._health_servicer_test.HealthServicerTest", diff --git a/templates/tools/distrib/python/xds_protos/grpc_version.py.template b/templates/tools/distrib/python/xds_protos/grpc_version.py.template new file mode 100644 index 0000000000000..7808e28e2197e --- /dev/null +++ b/templates/tools/distrib/python/xds_protos/grpc_version.py.template @@ -0,0 +1,20 @@ +%YAML 1.2 +--- | + # Copyright 2023 gRPC authors. + # + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + + # AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!! + + VERSION = '${settings.python_version.pep440()}' + PROTOBUF_VERSION = '${settings.protobuf_version}' diff --git a/templates/tools/dockerfile/compile_python_311.include b/templates/tools/dockerfile/compile_python_311.include new file mode 100644 index 0000000000000..7076b05e039ae --- /dev/null +++ b/templates/tools/dockerfile/compile_python_311.include @@ -0,0 +1,21 @@ +#================= +# Compile CPython 3.11.4 from source + +RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean +RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean + +RUN cd /tmp && ${'\\'} + wget -q https://www.python.org/ftp/python/3.11.4/Python-3.11.4.tgz && ${'\\'} + tar xzvf Python-3.11.4.tgz && ${'\\'} + cd Python-3.11.4 && ${'\\'} + ./configure && ${'\\'} + make -j4 && ${'\\'} + make install + + +RUN cd /tmp && ${'\\'} + echo "bf6ec50f2f3bfa6ffbdb385286f2c628 Python-3.11.4.tgz" > checksum.md5 && ${'\\'} + md5sum -c checksum.md5 + +RUN python3.11 -m ensurepip && ${'\\'} + python3.11 -m pip install coverage diff --git a/templates/tools/dockerfile/test/python_debian11_default_x64/Dockerfile.template b/templates/tools/dockerfile/test/python_debian11_default_x64/Dockerfile.template index 0edbf070aaef6..9a420cf267d8b 100644 --- a/templates/tools/dockerfile/test/python_debian11_default_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/python_debian11_default_x64/Dockerfile.template @@ -23,6 +23,7 @@ <%include file="../../compile_python_37.include"/> <%include file="../../compile_python_38.include"/> <%include file="../../compile_python_310.include"/> + <%include file="../../compile_python_311.include"/> # 3.9 is the default python3 version on debian11 RUN apt-get update && apt-get install -y python3.9 python3.9-dev python3-pip @@ -34,3 +35,8 @@ <%include file="../../cmake.include"/> <%include file="../../ccache.include"/> + + # Fix dubious ownerhsip issue. + RUN git config --global --add safe.directory '*' && ${'\\'} + git config --global protocol.file.allow always + diff --git a/third_party/protoc-gen-validate b/third_party/protoc-gen-validate new file mode 160000 index 0000000000000..fab737efbb4b4 --- /dev/null +++ b/third_party/protoc-gen-validate @@ -0,0 +1 @@ +Subproject commit fab737efbb4b4d03e7c771393708f75594b121e4 diff --git a/tools/distrib/python/xds_protos/MANIFEST.in b/tools/distrib/python/xds_protos/MANIFEST.in new file mode 100644 index 0000000000000..d83c49b9186de --- /dev/null +++ b/tools/distrib/python/xds_protos/MANIFEST.in @@ -0,0 +1 @@ +include grpc_version.py diff --git a/tools/distrib/python/xds_protos/build.py b/tools/distrib/python/xds_protos/build.py index 6cbfc0fcc1526..3f9f518dcd2cf 100644 --- a/tools/distrib/python/xds_protos/build.py +++ b/tools/distrib/python/xds_protos/build.py @@ -19,19 +19,27 @@ from grpc_tools import protoc import pkg_resources + +def localize_path(p): + return os.path.join(*p.split("/")) + + # We might not want to compile all the protos -EXCLUDE_PROTO_PACKAGES_LIST = [ - # Requires extra dependency to Prometheus protos - "envoy/service/metrics/v2", - "envoy/service/metrics/v3", - "envoy/service/metrics/v4alpha", -] +EXCLUDE_PROTO_PACKAGES_LIST = tuple( + localize_path(p) + for p in ( + # Requires extra dependency to Prometheus protos + "envoy/service/metrics/v2", + "envoy/service/metrics/v3", + "envoy/service/metrics/v4alpha", + ) +) # Compute the pathes WORK_DIR = os.path.dirname(os.path.abspath(__file__)) GRPC_ROOT = os.path.abspath(os.path.join(WORK_DIR, "..", "..", "..", "..")) -XDS_PROTO_ROOT = os.path.join(GRPC_ROOT, "third_party", "envoy-api") -UDPA_PROTO_ROOT = os.path.join(GRPC_ROOT, "third_party", "udpa") +ENVOY_API_PROTO_ROOT = os.path.join(GRPC_ROOT, "third_party", "envoy-api") +XDS_PROTO_ROOT = os.path.join(GRPC_ROOT, "third_party", "xds") GOOGLEAPIS_ROOT = os.path.join(GRPC_ROOT, "third_party", "googleapis") VALIDATE_ROOT = os.path.join(GRPC_ROOT, "third_party", "protoc-gen-validate") OPENCENSUS_PROTO_ROOT = os.path.join( @@ -43,6 +51,7 @@ WELL_KNOWN_PROTOS_INCLUDE = pkg_resources.resource_filename( "grpc_tools", "_proto" ) + OUTPUT_PATH = WORK_DIR # Prepare the test file generation @@ -79,8 +88,8 @@ def add_test_import( # Prepare Protoc command COMPILE_PROTO_ONLY = [ "grpc_tools.protoc", + "--proto_path={}".format(ENVOY_API_PROTO_ROOT), "--proto_path={}".format(XDS_PROTO_ROOT), - "--proto_path={}".format(UDPA_PROTO_ROOT), "--proto_path={}".format(GOOGLEAPIS_ROOT), "--proto_path={}".format(VALIDATE_ROOT), "--proto_path={}".format(WELL_KNOWN_PROTOS_INCLUDE), @@ -131,8 +140,8 @@ def create_init_file(path: str, package_path: str = "") -> None: def main(): # Compile xDS protos + compile_protos(ENVOY_API_PROTO_ROOT) compile_protos(XDS_PROTO_ROOT) - compile_protos(UDPA_PROTO_ROOT) # We don't want to compile the entire GCP surface API, just the essential ones compile_protos(GOOGLEAPIS_ROOT, os.path.join("google", "api")) compile_protos(GOOGLEAPIS_ROOT, os.path.join("google", "rpc")) diff --git a/tools/distrib/python/xds_protos/grpc_version.py b/tools/distrib/python/xds_protos/grpc_version.py new file mode 100644 index 0000000000000..a0100dfea1a89 --- /dev/null +++ b/tools/distrib/python/xds_protos/grpc_version.py @@ -0,0 +1,18 @@ +# Copyright 2023 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!! + +VERSION = '1.58.0.dev0' +PROTOBUF_VERSION = '3.23.4' diff --git a/tools/distrib/python/xds_protos/setup.py b/tools/distrib/python/xds_protos/setup.py index c4542556bd5b5..0737c96bc37ac 100644 --- a/tools/distrib/python/xds_protos/setup.py +++ b/tools/distrib/python/xds_protos/setup.py @@ -18,7 +18,13 @@ import setuptools +import grpc_version + WORK_DIR = os.path.dirname(os.path.abspath(__file__)) + +# Ensure we're in the proper directory whether or not we're being used by pip. +os.chdir(WORK_DIR) + EXCLUDE_PYTHON_FILES = ["generated_file_import_test.py", "build.py"] # Use setuptools to build Python package @@ -35,10 +41,12 @@ "grpcio>=1.49.0", "protobuf>=4.21.6,<5.0dev", ] -SETUP_REQUIRES = INSTALL_REQUIRES + ["grpcio-tools"] + +SETUP_REQUIRES = INSTALL_REQUIRES + ["grpcio-tools>=1.49.0"] + setuptools.setup( name="xds-protos", - version="0.0.12", + version=grpc_version.VERSION, packages=PACKAGES, description="Generated Python code from envoyproxy/data-plane-api", long_description_content_type="text/x-rst", diff --git a/tools/dockerfile/test/python_debian11_default_x64.current_version b/tools/dockerfile/test/python_debian11_default_x64.current_version index e99215e6461a4..4a8cfedcf8d40 100644 --- a/tools/dockerfile/test/python_debian11_default_x64.current_version +++ b/tools/dockerfile/test/python_debian11_default_x64.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_x64:ee6a567ba2dee1502abec2d08b87b0c0caba8a42@sha256:df00d587bda7cbe4308e18def313fe893cffbeb5a807ab14a90ff0d87b1a001c \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_x64:31ceb004af0498642b186d28e5c6411b974c2c04@sha256:4f29e539941d22b7abb911f9b6b3101ff5c7c4fb75585bfe3b7389251ea6be1d \ No newline at end of file diff --git a/tools/dockerfile/test/python_debian11_default_x64/Dockerfile b/tools/dockerfile/test/python_debian11_default_x64/Dockerfile index 67a3acf132454..582c7ca2f99d8 100644 --- a/tools/dockerfile/test/python_debian11_default_x64/Dockerfile +++ b/tools/dockerfile/test/python_debian11_default_x64/Dockerfile @@ -141,6 +141,28 @@ RUN cd /tmp && \ RUN python3.10 -m ensurepip && \ python3.10 -m pip install coverage +#================= +# Compile CPython 3.11.4 from source + +RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean +RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean + +RUN cd /tmp && \ + wget -q https://www.python.org/ftp/python/3.11.4/Python-3.11.4.tgz && \ + tar xzvf Python-3.11.4.tgz && \ + cd Python-3.11.4 && \ + ./configure && \ + make -j4 && \ + make install + + +RUN cd /tmp && \ + echo "bf6ec50f2f3bfa6ffbdb385286f2c628 Python-3.11.4.tgz" > checksum.md5 && \ + md5sum -c checksum.md5 + +RUN python3.11 -m ensurepip && \ + python3.11 -m pip install coverage + # 3.9 is the default python3 version on debian11 RUN apt-get update && apt-get install -y python3.9 python3.9-dev python3-pip @@ -173,3 +195,7 @@ RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/downloa && cd ../.. \ && rm -rf ccache-4.5.1 ccache.tar.gz + +# Fix dubious ownerhsip issue. +RUN git config --global --add safe.directory '*' && \ + git config --global protocol.file.allow always diff --git a/tools/run_tests/artifacts/build_artifact_python.sh b/tools/run_tests/artifacts/build_artifact_python.sh index 75c4c89074215..a09f25af7efb9 100755 --- a/tools/run_tests/artifacts/build_artifact_python.sh +++ b/tools/run_tests/artifacts/build_artifact_python.sh @@ -219,6 +219,12 @@ then # through setup.py, but we can optimize it with "bdist_wheel" command, which # skips the wheel building step. + # Build grpcio_reflection source distribution + ${SETARCH_CMD} "${PYTHON}" tools/distrib/python/xds_protos/build.py + ${SETARCH_CMD} "${PYTHON}" tools/distrib/python/xds_protos/setup.py \ + sdist bdist_wheel install + cp -r tools/distrib/python/xds_protos/dist/* "$ARTIFACT_DIR" + # Build grpcio_testing source distribution ${SETARCH_CMD} "${PYTHON}" src/python/grpcio_testing/setup.py preprocess \ sdist bdist_wheel @@ -244,6 +250,9 @@ then preprocess sdist bdist_wheel cp -r src/python/grpcio_status/dist/* "$ARTIFACT_DIR" + # Install xds-protos as a dependency of grpcio-csds + "${PYTHON}" -m pip install xds-protos --no-index --find-links "file://$ARTIFACT_DIR/" + # Build grpcio_csds source distribution ${SETARCH_CMD} "${PYTHON}" src/python/grpcio_csds/setup.py \ sdist bdist_wheel @@ -251,7 +260,6 @@ then # Build grpcio_admin source distribution and it needs the cutting-edge version # of Channelz and CSDS to be installed. - "${PYTHON}" -m pip install --upgrade xds-protos==0.0.8 "${PYTHON}" -m pip install grpcio-channelz --no-index --find-links "file://$ARTIFACT_DIR/" "${PYTHON}" -m pip install grpcio-csds --no-index --find-links "file://$ARTIFACT_DIR/" ${SETARCH_CMD} "${PYTHON}" src/python/grpcio_admin/setup.py \ diff --git a/tools/run_tests/helper_scripts/build_python.sh b/tools/run_tests/helper_scripts/build_python.sh index b2a9e91c7cfb6..625bbe1278529 100755 --- a/tools/run_tests/helper_scripts/build_python.sh +++ b/tools/run_tests/helper_scripts/build_python.sh @@ -197,6 +197,11 @@ $VENV_PYTHON "$ROOT/src/python/grpcio_status/setup.py" preprocess $VENV_PYTHON "$ROOT/src/python/grpcio_status/setup.py" build_package_protos pip_install_dir "$ROOT/src/python/grpcio_status" + +# Build/install status proto mapping +$VENV_PYTHON "$ROOT/tools/distrib/python/xds_protos/build.py" +pip_install_dir "$ROOT/tools/distrib/python/xds_protos" + # Build/install csds pip_install_dir "$ROOT/src/python/grpcio_csds" @@ -208,7 +213,7 @@ pip_install_dir "$ROOT/src/python/grpcio_testing" # Build/install tests pip_install coverage==4.4 oauth2client==4.1.0 \ - google-auth>=1.17.2 requests==2.14.2 \ + google-auth>=1.35.0 requests==2.31.0 \ googleapis-common-protos>=1.5.5 rsa==4.0 absl-py==1.4.0 $VENV_PYTHON "$ROOT/src/python/grpcio_tests/setup.py" preprocess $VENV_PYTHON "$ROOT/src/python/grpcio_tests/setup.py" build_package_protos diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 774bf054e7da6..8634fa4455479 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -221,17 +221,15 @@ def _python_config_generator(name, major, minor, bits, config_vars): + config_vars.venv_relative_python + config_vars.toolchain ) - run = ( - config_vars.shell - + config_vars.runner - + [ - os.path.join(name, config_vars.venv_relative_python[0]), - ] - ) - return PythonConfig(name, build, run) + # run: [tools/run_tests/helper_scripts/run_python.sh py37/bin/python] + python_path = os.path.join(name, config_vars.venv_relative_python[0]) + run = config_vars.shell + config_vars.runner + [python_path] + return PythonConfig(name, build, run, python_path) def _pypy_config_generator(name, major, config_vars): + # Something like "py37/bin/python" + python_path = os.path.join(name, config_vars.venv_relative_python[0]) return PythonConfig( name, config_vars.shell @@ -241,9 +239,8 @@ def _pypy_config_generator(name, major, config_vars): + [name] + config_vars.venv_relative_python + config_vars.toolchain, - config_vars.shell - + config_vars.runner - + [os.path.join(name, config_vars.venv_relative_python[0])], + config_vars.shell + config_vars.runner + [python_path], + python_path, ) @@ -700,7 +697,9 @@ def __str__(self): class PythonConfig( - collections.namedtuple("PythonConfig", ["name", "build", "run"]) + collections.namedtuple( + "PythonConfig", ["name", "build", "run", "python_path"] + ) ): """Tuple of commands (named s.t. 'what it says on the tin' applies)""" @@ -729,35 +728,53 @@ def configure(self, config, args): def test_specs(self): # load list of known test suites jobs = [] - for io_platform in self._TEST_SPECS_FILE: - test_cases = [] - for tests_json_file_name in self._TEST_SPECS_FILE[io_platform]: - with open(tests_json_file_name) as tests_json_file: - test_cases.extend(json.load(tests_json_file)) - - environment = dict(_FORCE_ENVIRON_FOR_WRAPPERS) - # TODO(https://github.com/grpc/grpc/issues/21401) Fork handlers is not - # designed for non-native IO manager. It has a side-effect that - # overrides threading settings in C-Core. - if io_platform != "native": - environment["GRPC_ENABLE_FORK_SUPPORT"] = "0" - for python_config in self.pythons: - jobs.extend( - [ - self.config.job_spec( - python_config.run - + [self._TEST_COMMAND[io_platform]], - timeout_seconds=8 * 60, - environ=dict( - GRPC_PYTHON_TESTRUNNER_FILTER=str(test_case), - **environment, - ), - shortname="%s.%s.%s" - % (python_config.name, io_platform, test_case), - ) - for test_case in test_cases - ] + + # Run tests across all supported interpreters. + for python_config in self.pythons: + # Run non-io-manager-specific tests. + if os.name != "nt": + jobs.append( + self.config.job_spec( + [ + python_config.python_path, + "tools/distrib/python/xds_protos/generated_file_import_test.py", + ], + timeout_seconds=60, + environ=_FORCE_ENVIRON_FOR_WRAPPERS, + shortname="f{python_config.name}.xds_protos", + ) ) + + # Run main test suite across all support IO managers. + for io_platform in self._TEST_SPECS_FILE: + test_cases = [] + for tests_json_file_name in self._TEST_SPECS_FILE[io_platform]: + with open(tests_json_file_name) as tests_json_file: + test_cases.extend(json.load(tests_json_file)) + + environment = dict(_FORCE_ENVIRON_FOR_WRAPPERS) + # TODO(https://github.com/grpc/grpc/issues/21401) Fork handlers is not + # designed for non-native IO manager. It has a side-effect that + # overrides threading settings in C-Core. + if io_platform != "native": + environment["GRPC_ENABLE_FORK_SUPPORT"] = "0" + jobs.extend( + [ + self.config.job_spec( + python_config.run + + [self._TEST_COMMAND[io_platform]], + timeout_seconds=8 * 60, + environ=dict( + GRPC_PYTHON_TESTRUNNER_FILTER=str( + test_case + ), + **environment, + ), + shortname=f"{python_config.name}.{io_platform}.{test_case}", + ) + for test_case in test_cases + ] + ) return jobs def pre_build_steps(self): @@ -835,6 +852,9 @@ def _get_pythons(self, args): toolchain, runner, ) + + # TODO: Supported version range should be defined by a single + # source of truth. python37_config = _python_config_generator( name="py37", major="3", @@ -863,6 +883,13 @@ def _get_pythons(self, args): bits=bits, config_vars=config_vars, ) + python311_config = _python_config_generator( + name="py311", + major="3", + minor="11", + bits=bits, + config_vars=config_vars, + ) pypy27_config = _pypy_config_generator( name="pypy", major="2", config_vars=config_vars ) @@ -884,9 +911,10 @@ def _get_pythons(self, args): # for arm64 testing) return (python39_config,) else: + # Default set tested on master. Test oldest and newest. return ( python37_config, - python38_config, + python311_config, ) elif args.compiler == "python3.7": return (python37_config,) @@ -896,6 +924,8 @@ def _get_pythons(self, args): return (python39_config,) elif args.compiler == "python3.10": return (python310_config,) + elif args.compiler == "python3.11": + return (python311_config,) elif args.compiler == "pypy": return (pypy27_config,) elif args.compiler == "pypy3": @@ -908,6 +938,7 @@ def _get_pythons(self, args): python38_config, python39_config, python310_config, + python311_config, ) else: raise Exception("Compiler %s not supported." % args.compiler) @@ -1678,11 +1709,14 @@ def _build_and_run( "gcc_musl", "clang6", "clang15", + # TODO: Automatically populate from supported version "python2.7", "python3.5", "python3.7", "python3.8", "python3.9", + "python3.10", + "python3.11", "pypy", "pypy3", "python_alpine", diff --git a/tools/run_tests/sanity/check_submodules.sh b/tools/run_tests/sanity/check_submodules.sh index 7fd75cb3a735e..84f5f6142f962 100755 --- a/tools/run_tests/sanity/check_submodules.sh +++ b/tools/run_tests/sanity/check_submodules.sh @@ -36,6 +36,7 @@ third_party/googletest 0e402173c97aea7a00749e825b194bfede4f2e45 third_party/opencensus-proto 4aa53e15cbf1a47bc9087e6cfdca214c1eea4e89 third_party/opentelemetry 60fa8754d890b5c55949a8c68dcfd7ab5c2395df third_party/protobuf 2c5fa078d8e86e5f4bd34e6f4c9ea9e8d7d4d44a +third_party/protoc-gen-validate fab737efbb4b4d03e7c771393708f75594b121e4 third_party/re2 0c5616df9c0aaa44c9440d87422012423d91c7d1 third_party/xds e9ce68804cb4e64cab5a52e3c8baf840d4ff87b7 third_party/zlib 04f42ceca40f73e2978b50e93806c2a18c1281fc From 4dee8bf3fd6a5380dbd2e01a1bfcdddfdbbdcce8 Mon Sep 17 00:00:00 2001 From: Yijie Ma Date: Wed, 26 Jul 2023 09:13:34 -0700 Subject: [PATCH 051/205] [CI] Update cxx_* docker images to install twisted (#33857) This is so that the newly added dns_test (which uses twisted-based server) within the posix_event_engine_test can run on those platforms. --- .../tools/dockerfile/cxx_test_deps.include | 2 ++ .../run_tests_python_deps_pep668.include | 24 +++++++++++++++++++ .../test/cxx_alpine_x64/Dockerfile.template | 3 ++- .../test/cxx_clang_15_x64/Dockerfile.template | 1 + .../test/cxx_clang_6_x64/Dockerfile.template | 2 ++ .../Dockerfile.template | 2 ++ .../test/cxx_debian11_x64/Dockerfile.template | 9 +++++++ .../test/cxx_debian11_x86/Dockerfile.template | 2 ++ .../test/cxx_gcc_12_x64/Dockerfile.template | 4 +++- .../test/cxx_gcc_7_x64/Dockerfile.template | 2 ++ .../test/cxx_alpine_x64.current_version | 2 +- .../dockerfile/test/cxx_alpine_x64/Dockerfile | 5 +++- .../test/cxx_clang_15_x64.current_version | 2 +- .../test/cxx_clang_15_x64/Dockerfile | 3 +++ .../test/cxx_clang_6_x64.current_version | 2 +- .../test/cxx_clang_6_x64/Dockerfile | 9 +++++++ ...xx_debian11_openssl102_x64.current_version | 2 +- .../cxx_debian11_openssl102_x64/Dockerfile | 9 +++++++ .../test/cxx_debian11_x64.current_version | 2 +- .../test/cxx_debian11_x64/Dockerfile | 11 +++++++++ .../test/cxx_debian11_x86.current_version | 2 +- .../test/cxx_debian11_x86/Dockerfile | 9 +++++++ .../test/cxx_gcc_12_x64.current_version | 2 +- .../dockerfile/test/cxx_gcc_12_x64/Dockerfile | 14 ++++++++++- .../test/cxx_gcc_7_x64.current_version | 2 +- .../dockerfile/test/cxx_gcc_7_x64/Dockerfile | 9 +++++++ 26 files changed, 124 insertions(+), 12 deletions(-) create mode 100644 templates/tools/dockerfile/cxx_test_deps.include create mode 100644 templates/tools/dockerfile/run_tests_python_deps_pep668.include diff --git a/templates/tools/dockerfile/cxx_test_deps.include b/templates/tools/dockerfile/cxx_test_deps.include new file mode 100644 index 0000000000000..8154e1c294f46 --- /dev/null +++ b/templates/tools/dockerfile/cxx_test_deps.include @@ -0,0 +1,2 @@ +# Some cxx tests depend on the twisted package +RUN python3 -m pip install twisted diff --git a/templates/tools/dockerfile/run_tests_python_deps_pep668.include b/templates/tools/dockerfile/run_tests_python_deps_pep668.include new file mode 100644 index 0000000000000..bbc74ec627933 --- /dev/null +++ b/templates/tools/dockerfile/run_tests_python_deps_pep668.include @@ -0,0 +1,24 @@ +#==================== +# run_tests.py python dependencies + +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) +RUN apt-get update && apt-get install -y ${'\\'} + python3 ${'\\'} + python3-pip ${'\\'} + python3-setuptools ${'\\'} + python3-yaml ${'\\'} + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +# Some newer distros that have already implemented PEP 668. Use of +# --break-system-packages is to workaround that. We should look into using +# virtualenv in Dockerfile though. +RUN python3 -m pip install --break-system-packages --upgrade pip==19.3.1 + +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 + +<%include file="./gcp_api_libraries.include"/> diff --git a/templates/tools/dockerfile/test/cxx_alpine_x64/Dockerfile.template b/templates/tools/dockerfile/test/cxx_alpine_x64/Dockerfile.template index 1f0e6ae9496e9..02fbcadfdecd2 100644 --- a/templates/tools/dockerfile/test/cxx_alpine_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/cxx_alpine_x64/Dockerfile.template @@ -49,8 +49,9 @@ # These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) RUN python3 -m pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 - RUN python3 -m pip install --upgrade --ignore-installed PyYAML==5.4.1 --user + RUN python3 -m pip install --upgrade --ignore-installed PyYAML==6.0.1 --user + <%include file="../../cxx_test_deps.include"/> <%include file="../../ccache.include"/> <%include file="../../run_tests_addons.include"/> <%include file="../../git-jenkins.include"/> diff --git a/templates/tools/dockerfile/test/cxx_clang_15_x64/Dockerfile.template b/templates/tools/dockerfile/test/cxx_clang_15_x64/Dockerfile.template index 3bce77078cd6f..159b1c02c1854 100644 --- a/templates/tools/dockerfile/test/cxx_clang_15_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/cxx_clang_15_x64/Dockerfile.template @@ -18,6 +18,7 @@ RUN apt-get update && apt-get install -y build-essential curl git time wget zip && apt-get clean <%include file="../../run_tests_python_deps.include"/> + <%include file="../../cxx_test_deps.include"/> <%include file="../../cmake.include"/> <%include file="../../ccache.include"/> <%include file="../../run_tests_addons.include"/> diff --git a/templates/tools/dockerfile/test/cxx_clang_6_x64/Dockerfile.template b/templates/tools/dockerfile/test/cxx_clang_6_x64/Dockerfile.template index 6fc4b30dc63d2..e45b1b541ab58 100644 --- a/templates/tools/dockerfile/test/cxx_clang_6_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/cxx_clang_6_x64/Dockerfile.template @@ -18,10 +18,12 @@ RUN apt-get update && apt-get install -y build-essential curl git time wget zip && apt-get clean <%include file="../../run_tests_python_deps.include"/> + <%include file="../../cxx_test_deps.include"/> <%include file="../../cxx_deps.include"/> <%include file="../../cmake.include"/> <%include file="../../ccache.include"/> <%include file="../../run_tests_addons.include"/> + <%include file="../../git-jenkins.include"/> # Define the default command. CMD ["bash"] diff --git a/templates/tools/dockerfile/test/cxx_debian11_openssl102_x64/Dockerfile.template b/templates/tools/dockerfile/test/cxx_debian11_openssl102_x64/Dockerfile.template index 0f57c96e7a716..d1ad35875bd69 100644 --- a/templates/tools/dockerfile/test/cxx_debian11_openssl102_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/cxx_debian11_openssl102_x64/Dockerfile.template @@ -18,10 +18,12 @@ <%include file="../../apt_get_basic.include"/> <%include file="../../run_tests_python_deps.include"/> + <%include file="../../cxx_test_deps.include"/> <%include file="../../cxx_deps.include"/> <%include file="../../cmake.include"/> <%include file="../../ccache.include"/> <%include file="../../run_tests_addons.include"/> + <%include file="../../git-jenkins.include"/> # Install openssl 1.0.2 from source RUN apt-get update && apt-get install -y build-essential zlib1g-dev diff --git a/templates/tools/dockerfile/test/cxx_debian11_x64/Dockerfile.template b/templates/tools/dockerfile/test/cxx_debian11_x64/Dockerfile.template index 41b7c44e33458..5de74c02bf3cc 100644 --- a/templates/tools/dockerfile/test/cxx_debian11_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/cxx_debian11_x64/Dockerfile.template @@ -18,10 +18,19 @@ <%include file="../../apt_get_basic.include"/> <%include file="../../run_tests_python_deps.include"/> + <%include file="../../cxx_test_deps.include"/> <%include file="../../cxx_deps.include"/> <%include file="../../cmake.include"/> <%include file="../../ccache.include"/> <%include file="../../run_tests_addons.include"/> + + #================= + # Setup git to access working directory across docker boundary + + RUN git config --global --add safe.directory "*" + RUN git config --global protocol.file.allow always + + # Define the default command. CMD ["bash"] diff --git a/templates/tools/dockerfile/test/cxx_debian11_x86/Dockerfile.template b/templates/tools/dockerfile/test/cxx_debian11_x86/Dockerfile.template index 10c025a4df9f1..7a38ee94a1785 100644 --- a/templates/tools/dockerfile/test/cxx_debian11_x86/Dockerfile.template +++ b/templates/tools/dockerfile/test/cxx_debian11_x86/Dockerfile.template @@ -18,10 +18,12 @@ <%include file="../../apt_get_basic.include"/> <%include file="../../run_tests_python_deps.include"/> + <%include file="../../cxx_test_deps.include"/> <%include file="../../cxx_deps.include"/> <%include file="../../cmake.include"/> <%include file="../../ccache.include"/> <%include file="../../run_tests_addons.include"/> + <%include file="../../git-jenkins.include"/> # Define the default command. CMD ["bash"] diff --git a/templates/tools/dockerfile/test/cxx_gcc_12_x64/Dockerfile.template b/templates/tools/dockerfile/test/cxx_gcc_12_x64/Dockerfile.template index c5358fc43150f..1e6377badbc09 100644 --- a/templates/tools/dockerfile/test/cxx_gcc_12_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/cxx_gcc_12_x64/Dockerfile.template @@ -17,10 +17,12 @@ FROM gcc:12 RUN apt-get update && apt-get install -y curl git time wget zip && apt-get clean - <%include file="../../run_tests_python_deps.include"/> + <%include file="../../run_tests_python_deps_pep668.include"/> + <%include file="../../cxx_test_deps.include"/> <%include file="../../cmake.include"/> <%include file="../../ccache.include"/> <%include file="../../run_tests_addons.include"/> + <%include file="../../git-jenkins.include"/> # Define the default command. CMD ["bash"] diff --git a/templates/tools/dockerfile/test/cxx_gcc_7_x64/Dockerfile.template b/templates/tools/dockerfile/test/cxx_gcc_7_x64/Dockerfile.template index 98eaedc83c6d9..74bd403c1b2d0 100644 --- a/templates/tools/dockerfile/test/cxx_gcc_7_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/cxx_gcc_7_x64/Dockerfile.template @@ -18,9 +18,11 @@ RUN apt-get update && apt-get install -y curl git time wget zip && apt-get clean <%include file="../../run_tests_python_deps.include"/> + <%include file="../../cxx_test_deps.include"/> <%include file="../../cmake.include"/> <%include file="../../ccache.include"/> <%include file="../../run_tests_addons.include"/> + <%include file="../../git-jenkins.include"/> # Define the default command. CMD ["bash"] diff --git a/tools/dockerfile/test/cxx_alpine_x64.current_version b/tools/dockerfile/test/cxx_alpine_x64.current_version index 9a3f785bf57e3..2da4b2e1c87fb 100644 --- a/tools/dockerfile/test/cxx_alpine_x64.current_version +++ b/tools/dockerfile/test/cxx_alpine_x64.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_alpine_x64:946399d3635bc9bcf2f40c026b80213ce30e479c@sha256:a84a6faf639dcf4a3e32eec0f5a08169e9c9866750e5aa53bdf89e8d378d326a \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_alpine_x64:79e6fb5086e7f367b90cf4a418f63b43fbe929e2@sha256:61fc7408e1171d9470bdd6920cc9da34e31fc43115b80f0fb6f7b9669ba6e366 \ No newline at end of file diff --git a/tools/dockerfile/test/cxx_alpine_x64/Dockerfile b/tools/dockerfile/test/cxx_alpine_x64/Dockerfile index 9121f4f7d3404..35d0a43bc06c2 100644 --- a/tools/dockerfile/test/cxx_alpine_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_alpine_x64/Dockerfile @@ -47,7 +47,10 @@ RUN python3 -m pip install six==1.16.0 # These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) RUN python3 -m pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 -RUN python3 -m pip install --upgrade --ignore-installed PyYAML==5.4.1 --user +RUN python3 -m pip install --upgrade --ignore-installed PyYAML==6.0.1 --user + +# Some cxx tests depend on the twisted package +RUN python3 -m pip install twisted #================= # Install ccache diff --git a/tools/dockerfile/test/cxx_clang_15_x64.current_version b/tools/dockerfile/test/cxx_clang_15_x64.current_version index 2259255e55246..addfdf1a7fd75 100644 --- a/tools/dockerfile/test/cxx_clang_15_x64.current_version +++ b/tools/dockerfile/test/cxx_clang_15_x64.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_clang_15_x64:99325d14f5121515b2454bfab9b59c155e182c18@sha256:906c0ca1edcab595fce313636528e6244d8fc914a6e72a22764e96208f465936 \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_clang_15_x64:5cbbc7a77c098836dc97cb2d45b06bfba121e93e@sha256:aaac47bdeccfcf43331963a75df6a377923c69d1b57ea076c2072b140e00af65 \ No newline at end of file diff --git a/tools/dockerfile/test/cxx_clang_15_x64/Dockerfile b/tools/dockerfile/test/cxx_clang_15_x64/Dockerfile index e6d60b4a00c5d..6bf6c16a0003f 100644 --- a/tools/dockerfile/test/cxx_clang_15_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_clang_15_x64/Dockerfile @@ -40,6 +40,9 @@ RUN python3 -m pip install six==1.16.0 RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 +# Some cxx tests depend on the twisted package +RUN python3 -m pip install twisted + #================= # Install cmake # Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement. diff --git a/tools/dockerfile/test/cxx_clang_6_x64.current_version b/tools/dockerfile/test/cxx_clang_6_x64.current_version index f3d145989663d..2a23ab70a2154 100644 --- a/tools/dockerfile/test/cxx_clang_6_x64.current_version +++ b/tools/dockerfile/test/cxx_clang_6_x64.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_clang_6_x64:78958e51f94dfb5c8c5e0a1fde2cfa4ccf0fee02@sha256:c5cec74947c06174b21188eb9565f322a8543cd4878dc40b34cfcaee9a5fd94a \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_clang_6_x64:6a71e16cb0463e881d2201bc2d1b92f91961f649@sha256:79ecf682702190564c41289ffe00d4e6f80c104807cca324340349e84288ad99 \ No newline at end of file diff --git a/tools/dockerfile/test/cxx_clang_6_x64/Dockerfile b/tools/dockerfile/test/cxx_clang_6_x64/Dockerfile index e5ac6c1e25da5..62cc4821ecfdc 100644 --- a/tools/dockerfile/test/cxx_clang_6_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_clang_6_x64/Dockerfile @@ -40,6 +40,9 @@ RUN python3 -m pip install six==1.16.0 RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 +# Some cxx tests depend on the twisted package +RUN python3 -m pip install twisted + #================= # C++ dependencies RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean @@ -67,6 +70,12 @@ RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/downloa RUN mkdir /var/local/jenkins +#================= +# Setup git to access working directory across docker boundary + +RUN git config --global --add safe.directory /var/local/jenkins/grpc +RUN git config --global protocol.file.allow always + # Define the default command. CMD ["bash"] diff --git a/tools/dockerfile/test/cxx_debian11_openssl102_x64.current_version b/tools/dockerfile/test/cxx_debian11_openssl102_x64.current_version index 04ee616ee1cab..a82cf265b2142 100644 --- a/tools/dockerfile/test/cxx_debian11_openssl102_x64.current_version +++ b/tools/dockerfile/test/cxx_debian11_openssl102_x64.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_debian11_openssl102_x64:af647277e5acb05a89769f23a73a763be7423c53@sha256:15af353947cad7d7bead70ddb1e43a20cfa561de8e894aa7f92e320f55673959 \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_debian11_openssl102_x64:aa2bca3103b5c348b196dba01f7bbeb5e878cff9@sha256:8552c41ecca59e32cb3079981cce0b2993a443f1730562a7f19a172ab29f1b2d \ No newline at end of file diff --git a/tools/dockerfile/test/cxx_debian11_openssl102_x64/Dockerfile b/tools/dockerfile/test/cxx_debian11_openssl102_x64/Dockerfile index 95df506379aaa..afd263bc73dea 100644 --- a/tools/dockerfile/test/cxx_debian11_openssl102_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_debian11_openssl102_x64/Dockerfile @@ -78,6 +78,9 @@ RUN python3 -m pip install six==1.16.0 RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 +# Some cxx tests depend on the twisted package +RUN python3 -m pip install twisted + #================= # C++ dependencies RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean @@ -105,6 +108,12 @@ RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/downloa RUN mkdir /var/local/jenkins +#================= +# Setup git to access working directory across docker boundary + +RUN git config --global --add safe.directory /var/local/jenkins/grpc +RUN git config --global protocol.file.allow always + # Install openssl 1.0.2 from source RUN apt-get update && apt-get install -y build-essential zlib1g-dev diff --git a/tools/dockerfile/test/cxx_debian11_x64.current_version b/tools/dockerfile/test/cxx_debian11_x64.current_version index e65323904ba04..a4bfcd76ff0b3 100644 --- a/tools/dockerfile/test/cxx_debian11_x64.current_version +++ b/tools/dockerfile/test/cxx_debian11_x64.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_debian11_x64:47b0a0916781ab659c049d44efb3f1496dae4660@sha256:a69a1ed729137c3ea347f0a3488524573285be7832dd74cec830db57b61a9b8c \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_debian11_x64:5a98939a2d0c3b327619e64dc64de9c2fc109e07@sha256:f4d2b360e8a49d95e8e92971566674a06015427c2488a841b3386feb41d2ff22 \ No newline at end of file diff --git a/tools/dockerfile/test/cxx_debian11_x64/Dockerfile b/tools/dockerfile/test/cxx_debian11_x64/Dockerfile index 29ed6fc300509..e9938c33701e5 100644 --- a/tools/dockerfile/test/cxx_debian11_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_debian11_x64/Dockerfile @@ -78,6 +78,9 @@ RUN python3 -m pip install six==1.16.0 RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 +# Some cxx tests depend on the twisted package +RUN python3 -m pip install twisted + #================= # C++ dependencies RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean @@ -106,5 +109,13 @@ RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/downloa RUN mkdir /var/local/jenkins + +#================= +# Setup git to access working directory across docker boundary + +RUN git config --global --add safe.directory "*" +RUN git config --global protocol.file.allow always + + # Define the default command. CMD ["bash"] diff --git a/tools/dockerfile/test/cxx_debian11_x86.current_version b/tools/dockerfile/test/cxx_debian11_x86.current_version index 63e3a3f299fc1..2f2dea432a62d 100644 --- a/tools/dockerfile/test/cxx_debian11_x86.current_version +++ b/tools/dockerfile/test/cxx_debian11_x86.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_debian11_x86:7b84ff94b76bcf1e67126468bcb816cd1badc859@sha256:fcb11fd175ef153f7abddf25d1f71e338d1874a4075287dcf3af765ea6226a98 \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_debian11_x86:12152416b01acee79e4d18bcb855692fa11351b5@sha256:77a0be06797567ad9e4924bb5f1a523cd23555af0518a1525fc4a940d60d035c \ No newline at end of file diff --git a/tools/dockerfile/test/cxx_debian11_x86/Dockerfile b/tools/dockerfile/test/cxx_debian11_x86/Dockerfile index f8d7dedd92271..30b0b98b3f57f 100644 --- a/tools/dockerfile/test/cxx_debian11_x86/Dockerfile +++ b/tools/dockerfile/test/cxx_debian11_x86/Dockerfile @@ -78,6 +78,9 @@ RUN python3 -m pip install six==1.16.0 RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 +# Some cxx tests depend on the twisted package +RUN python3 -m pip install twisted + #================= # C++ dependencies RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean @@ -105,6 +108,12 @@ RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/downloa RUN mkdir /var/local/jenkins +#================= +# Setup git to access working directory across docker boundary + +RUN git config --global --add safe.directory /var/local/jenkins/grpc +RUN git config --global protocol.file.allow always + # Define the default command. CMD ["bash"] diff --git a/tools/dockerfile/test/cxx_gcc_12_x64.current_version b/tools/dockerfile/test/cxx_gcc_12_x64.current_version index 843b08bbd7ac2..bbba05cc4192b 100644 --- a/tools/dockerfile/test/cxx_gcc_12_x64.current_version +++ b/tools/dockerfile/test/cxx_gcc_12_x64.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_gcc_12_x64:6c0ab4904f3c9aa9a38ba29f14c94dfc3e7901b2@sha256:a6d9f04d8075e697e16245004ab22bf22dd972c9724ecb750919816396186c09 \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_gcc_12_x64:bb89a34b51f9b7cdb6d53c1194cb617f42a161d7@sha256:ca86af6cb592b4426585a67c7fe58d9925a6e5413801ab45831cd268102c4211 \ No newline at end of file diff --git a/tools/dockerfile/test/cxx_gcc_12_x64/Dockerfile b/tools/dockerfile/test/cxx_gcc_12_x64/Dockerfile index 41b11be2a2547..d9b02508f8a23 100644 --- a/tools/dockerfile/test/cxx_gcc_12_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_gcc_12_x64/Dockerfile @@ -29,7 +29,10 @@ RUN apt-get update && apt-get install -y \ && apt-get clean # use pinned version of pip to avoid sudden breakages -RUN python3 -m pip install --upgrade pip==19.3.1 +# Some newer distros that have already implemented PEP 668. Use of +# --break-system-packages is to workaround that. We should look into using +# virtualenv in Dockerfile though. +RUN python3 -m pip install --break-system-packages --upgrade pip==19.3.1 # TODO(jtattermusch): currently six is needed for tools/run_tests scripts # but since our python2 usage is deprecated, we should get rid of it. @@ -40,6 +43,9 @@ RUN python3 -m pip install six==1.16.0 RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 +# Some cxx tests depend on the twisted package +RUN python3 -m pip install twisted + #================= # Install cmake # Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement. @@ -63,6 +69,12 @@ RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/downloa RUN mkdir /var/local/jenkins +#================= +# Setup git to access working directory across docker boundary + +RUN git config --global --add safe.directory /var/local/jenkins/grpc +RUN git config --global protocol.file.allow always + # Define the default command. CMD ["bash"] diff --git a/tools/dockerfile/test/cxx_gcc_7_x64.current_version b/tools/dockerfile/test/cxx_gcc_7_x64.current_version index 7e105ab315419..1804164919f09 100644 --- a/tools/dockerfile/test/cxx_gcc_7_x64.current_version +++ b/tools/dockerfile/test/cxx_gcc_7_x64.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_gcc_7_x64:953aea35378bad8c12f2513c0dc6199bed1ca11d@sha256:7d33f341c7f7a5f358943c1f0b887de756079f406b7c7794e76cb0e42439c95b \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_gcc_7_x64:a0054d259ebb76a5151bec9a1afe0743ab144d2c@sha256:7d1af94c7329b6b09f6266a56380c0690a31e9121abc89cb8a57820e0f6eb3bb \ No newline at end of file diff --git a/tools/dockerfile/test/cxx_gcc_7_x64/Dockerfile b/tools/dockerfile/test/cxx_gcc_7_x64/Dockerfile index 07283c83481b3..e25deca148ef1 100644 --- a/tools/dockerfile/test/cxx_gcc_7_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_gcc_7_x64/Dockerfile @@ -40,6 +40,9 @@ RUN python3 -m pip install six==1.16.0 RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 +# Some cxx tests depend on the twisted package +RUN python3 -m pip install twisted + #================= # Install cmake # Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement. @@ -63,6 +66,12 @@ RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/downloa RUN mkdir /var/local/jenkins +#================= +# Setup git to access working directory across docker boundary + +RUN git config --global --add safe.directory /var/local/jenkins/grpc +RUN git config --global protocol.file.allow always + # Define the default command. CMD ["bash"] From 417c8e349956adbb60a2eb0b7f6a40f3afdce2ff Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 26 Jul 2023 09:19:17 -0700 Subject: [PATCH 052/205] [fuzzing] Increase deadline, tweak timeouts for b/291372661 (#33766) --- .../6569258070900736 | 610 ++++++++++++++++++ .../tests/retry_server_pushback_delay.cc | 4 +- 2 files changed, 612 insertions(+), 2 deletions(-) create mode 100644 test/core/end2end/end2end_test_corpus/retry_server_pushback_delay/6569258070900736 diff --git a/test/core/end2end/end2end_test_corpus/retry_server_pushback_delay/6569258070900736 b/test/core/end2end/end2end_test_corpus/retry_server_pushback_delay/6569258070900736 new file mode 100644 index 0000000000000..d8b621c0d8c13 --- /dev/null +++ b/test/core/end2end/end2end_test_corpus/retry_server_pushback_delay/6569258070900736 @@ -0,0 +1,610 @@ +test_id: 541065219 +event_engine_actions { + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 512 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 44754521296994304 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 127953324631296 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 4179340454468255744 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 0 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 13153337344 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 9223372036854775807 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 4294967297 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435457 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 0 + run_delay: 0 + run_delay: 7560960 + assign_ports: 0 + assign_ports: 2 + assign_ports: 0 + connections { + write_size: 0 + write_size: 3 + write_size: 0 + write_size: 0 + write_size: 3 + write_size: 3 + write_size: 0 + write_size: 3 + write_size: 3 + write_size: 0 + write_size: 0 + write_size: 4 + write_size: 3 + write_size: 0 + write_size: 0 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 0 + write_size: 3 + write_size: 0 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 0 + write_size: 3 + write_size: 4 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 1 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 0 + write_size: 3 + write_size: 1 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 0 + write_size: 3 + write_size: 1 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 0 + write_size: 0 + } +} +config_vars { + dns_resolver: "3\n write_size: 3\n write_size: 3\n write_size: 3\n write_size: 3\n write_size: 3\n }\n}\nconfig_vars {\n enable_fork_support: true\n trace: \"\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\0L" + stacktrace_minloglevel: "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" + trace: "3\n write_size: 3\n write_size: 3\n write_size: 3\n write_size: 3\n write_size: 20120770\n }\n}\nconfig_vars {\n enable_fork_support: true\n trace: \"\\000\\000\\000\\000\\000\\2147483647\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\340282366920938463463374607431768211456\\000\\000\\000\\000\\000\\000\\000\\000\\0L" + experiments: "3\n write_size: 3\n write_size: 3\n write_size: 3\n write_size: 3\n write_size: 3\n }\n}\nconfig_vars {\n enable_fork_support: true\n trace: \"\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\0L" +} diff --git a/test/core/end2end/tests/retry_server_pushback_delay.cc b/test/core/end2end/tests/retry_server_pushback_delay.cc index 6249ec9c28fb1..4039a526bbe87 100644 --- a/test/core/end2end/tests/retry_server_pushback_delay.cc +++ b/test/core/end2end/tests/retry_server_pushback_delay.cc @@ -53,7 +53,7 @@ CORE_END2END_TEST(RetryTest, RetryServerPushbackDelay) { " } ]\n" "}")); auto c = - NewClientCall("/service/method").Timeout(Duration::Seconds(5)).Create(); + NewClientCall("/service/method").Timeout(Duration::Minutes(1)).Create(); EXPECT_NE(c.GetPeer(), absl::nullopt); IncomingMessage server_message; IncomingMetadata server_initial_metadata; @@ -87,7 +87,7 @@ CORE_END2END_TEST(RetryTest, RetryServerPushbackDelay) { const auto retry_delay = after_retry - before_retry; // Configured back-off was 1 second, server push-back said 2 seconds. // To avoid flakiness, we allow some fudge factor here. - EXPECT_GE(retry_delay, Duration::Milliseconds(1800)); + EXPECT_GE(retry_delay, Duration::Milliseconds(1500)); EXPECT_NE(s->GetPeer(), absl::nullopt); EXPECT_NE(c.GetPeer(), absl::nullopt); IncomingCloseOnServer client_close2; From 3717ff04bafd18504d8613d753d4605927305de3 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 26 Jul 2023 09:19:35 -0700 Subject: [PATCH 053/205] [chttp2] Split ping policy from transport (#33703) Why: Cleanup for chttp2_transport ahead of promise conversion - lots of logic has become interleaved throughout chttp2, so some effort to isolate logic out is warranted ahead of that conversion. What: Split configuration and policy tracking for each of ping rate throttling and abuse detection into their own modules. Add tests for them. Incidentally: Split channel args into their own header so that we can split the policy stuff into separate build targets. --------- Co-authored-by: ctiller --- BUILD | 27 +- CMakeLists.txt | 107 +++++ Makefile | 6 + Package.swift | 5 + build_autogenerated.yaml | 81 ++++ config.m4 | 2 + config.w32 | 2 + gRPC-C++.podspec | 4 + gRPC-Core.podspec | 7 + grpc.gemspec | 5 + grpc.gyp | 4 + include/grpc/impl/channel_arg_names.h | 371 ++++++++++++++++++ include/grpc/impl/grpc_types.h | 354 +---------------- include/grpc/module.modulemap | 1 + package.xml | 5 + src/core/BUILD | 70 ++++ .../backend_metrics/backend_metric_filter.cc | 2 +- .../channel_idle/channel_idle_filter.cc | 2 +- .../filters/client_channel/client_channel.cc | 1 + .../ext/filters/client_channel/http_proxy.cc | 2 +- .../client_channel/lb_policy/grpclb/grpclb.cc | 1 + .../lb_policy/health_check_client.cc | 2 +- .../lb_policy/pick_first/pick_first.cc | 2 +- .../lb_policy/priority/priority.cc | 2 +- .../lb_policy/ring_hash/ring_hash.cc | 3 +- .../client_channel/lb_policy/rls/rls.cc | 1 + .../lb_policy/subchannel_list.h | 2 +- .../lb_policy/xds/xds_cluster_resolver.cc | 2 +- .../resolver/dns/c_ares/dns_resolver_ares.cc | 2 +- .../resolver/dns/c_ares/grpc_ares_wrapper.cc | 2 +- .../event_engine_client_channel_resolver.cc | 2 +- .../resolver/dns/native/dns_resolver.cc | 2 +- .../resolver/xds/xds_resolver.cc | 2 +- .../ext/filters/client_channel/retry_filter.h | 1 + .../client_channel/retry_service_config.cc | 2 +- .../service_config_channel_arg_filter.cc | 2 +- .../ext/filters/client_channel/subchannel.cc | 2 +- .../ext/filters/deadline/deadline_filter.cc | 2 +- .../filters/http/client/http_client_filter.cc | 1 + .../filters/http/client_authority_filter.cc | 2 +- .../message_compress/compression_filter.cc | 1 + .../filters/http/server/http_server_filter.cc | 2 +- .../server_load_reporting_filter.cc | 2 +- .../ext/filters/logging/logging_filter.cc | 2 +- .../message_size/message_size_filter.cc | 1 + .../chttp2/client/chttp2_connector.cc | 1 + .../transport/chttp2/server/chttp2_server.cc | 1 + .../chttp2/transport/chttp2_transport.cc | 86 ++-- .../transport/chttp2/transport/frame_ping.cc | 23 +- .../ext/transport/chttp2/transport/internal.h | 28 +- .../ext/transport/chttp2/transport/parsing.cc | 6 +- .../chttp2/transport/ping_abuse_policy.cc | 80 ++++ .../chttp2/transport/ping_abuse_policy.h | 55 +++ .../chttp2/transport/ping_rate_policy.cc | 98 +++++ .../chttp2/transport/ping_rate_policy.h | 73 ++++ .../ext/transport/chttp2/transport/writing.cc | 171 ++++---- .../client/secure/cronet_channel_create.cc | 1 + .../cronet/transport/cronet_transport.cc | 1 + .../ext/transport/inproc/inproc_transport.cc | 1 + src/core/ext/xds/xds_client_grpc.cc | 1 + src/core/ext/xds/xds_transport_grpc.cc | 1 + src/core/lib/channel/channel_args.cc | 1 + .../posix_engine/tcp_socket_utils.cc | 1 + .../lib/http/httpcli_security_connector.cc | 1 + src/core/lib/resource_quota/api.cc | 1 + src/core/lib/resource_quota/resource_quota.h | 1 + .../authorization_policy_provider.h | 2 +- .../google_default_credentials.cc | 1 + .../credentials/ssl/ssl_credentials.cc | 1 + .../credentials/tls/tls_credentials.cc | 1 + .../credentials/xds/xds_credentials.cc | 1 + .../alts/alts_security_connector.cc | 1 + .../fake/fake_security_connector.cc | 1 + .../security/security_connector/ssl_utils.cc | 1 + .../security/transport/security_handshaker.cc | 1 + src/core/lib/surface/channel.cc | 1 + src/core/lib/surface/init.cc | 1 + src/core/lib/surface/server.cc | 1 + src/cpp/common/channel_arguments.cc | 1 + src/cpp/common/secure_channel_arguments.cc | 1 + src/cpp/ext/gcp/BUILD | 1 + src/cpp/ext/gcp/observability_logging_sink.cc | 1 + ...reporting_service_server_builder_option.cc | 2 +- src/cpp/server/server_builder.cc | 1 + src/cpp/server/server_cc.cc | 1 + src/python/grpcio/grpc_core_dependencies.py | 2 + test/core/bad_connection/close_fd_test.cc | 1 + test/core/bad_ssl/bad_ssl_test.cc | 1 + test/core/channel/channel_args_test.cc | 1 + test/core/channel/channel_trace_test.cc | 1 + test/core/channel/channelz_test.cc | 1 + .../channel/minimal_stack_is_minimal_test.cc | 1 + .../client_channel/client_channel_test.cc | 2 +- .../client_channel/http_proxy_mapper_test.cc | 2 +- .../lb_policy/outlier_detection_test.cc | 1 + .../lb_policy/pick_first_test.cc | 1 + .../resolvers/dns_resolver_cooldown_test.cc | 1 + .../retry_service_config_test.cc | 1 + test/core/end2end/BUILD | 8 + test/core/end2end/connection_refused_test.cc | 1 + test/core/end2end/end2end_test_suites.cc | 1 + test/core/end2end/fixtures/h2_oauth2_common.h | 1 + .../fixtures/h2_ssl_cred_reload_fixture.h | 1 + .../core/end2end/fixtures/h2_ssl_tls_common.h | 1 + test/core/end2end/fixtures/h2_tls_common.h | 1 + test/core/end2end/fixtures/proxy.cc | 1 + test/core/end2end/fixtures/sockpair_fixture.h | 1 + test/core/end2end/fuzzers/client_fuzzer.cc | 1 + test/core/end2end/goaway_server_test.cc | 1 + test/core/end2end/h2_ssl_cert_test.cc | 1 + .../core/end2end/h2_ssl_session_reuse_test.cc | 1 + ...ls_peer_property_external_verifier_test.cc | 1 + test/core/end2end/tests/bad_ping.cc | 2 +- test/core/end2end/tests/binary_metadata.cc | 2 +- test/core/end2end/tests/call_host_override.cc | 2 +- .../core/end2end/tests/cancel_after_accept.cc | 2 +- .../end2end/tests/cancel_after_round_trip.cc | 2 +- test/core/end2end/tests/channelz.cc | 2 +- test/core/end2end/tests/compressed_payload.cc | 1 + test/core/end2end/tests/connectivity.cc | 1 + test/core/end2end/tests/grpc_authz.cc | 1 + test/core/end2end/tests/high_initial_seqno.cc | 2 +- test/core/end2end/tests/hpack_size.cc | 2 +- .../end2end/tests/invoke_large_request.cc | 2 +- test/core/end2end/tests/keepalive_timeout.cc | 2 +- test/core/end2end/tests/large_metadata.cc | 2 +- .../end2end/tests/max_concurrent_streams.cc | 2 +- test/core/end2end/tests/max_connection_age.cc | 2 +- .../core/end2end/tests/max_connection_idle.cc | 1 + test/core/end2end/tests/max_message_length.cc | 2 +- test/core/end2end/tests/ping.cc | 1 + .../end2end/tests/resource_quota_server.cc | 1 + test/core/end2end/tests/retry.cc | 2 +- ...retry_cancel_after_first_attempt_starts.cc | 2 +- .../tests/retry_cancel_during_delay.cc | 2 +- ...retry_cancel_with_multiple_send_batches.cc | 2 +- test/core/end2end/tests/retry_cancellation.cc | 2 +- test/core/end2end/tests/retry_disabled.cc | 2 +- .../retry_exceeds_buffer_size_in_delay.cc | 2 +- ...ry_exceeds_buffer_size_in_initial_batch.cc | 2 +- ...exceeds_buffer_size_in_subsequent_batch.cc | 2 +- test/core/end2end/tests/retry_lb_drop.cc | 1 + test/core/end2end/tests/retry_lb_fail.cc | 2 +- .../tests/retry_non_retriable_status.cc | 2 +- ...ry_non_retriable_status_before_trailers.cc | 2 +- .../tests/retry_per_attempt_recv_timeout.cc | 2 +- ...er_attempt_recv_timeout_on_last_attempt.cc | 2 +- .../tests/retry_recv_initial_metadata.cc | 2 +- test/core/end2end/tests/retry_recv_message.cc | 2 +- .../tests/retry_recv_message_replay.cc | 2 +- .../retry_recv_trailing_metadata_error.cc | 2 +- .../tests/retry_send_initial_metadata_refs.cc | 2 +- .../core/end2end/tests/retry_send_op_fails.cc | 2 +- .../end2end/tests/retry_send_recv_batch.cc | 2 +- .../tests/retry_server_pushback_delay.cc | 2 +- .../tests/retry_server_pushback_disabled.cc | 2 +- test/core/end2end/tests/retry_streaming.cc | 2 +- .../tests/retry_streaming_after_commit.cc | 2 +- ...reaming_succeeds_before_replay_finished.cc | 2 +- test/core/end2end/tests/retry_throttled.cc | 2 +- .../end2end/tests/retry_too_many_attempts.cc | 2 +- .../end2end/tests/retry_transparent_goaway.cc | 2 +- ...etry_transparent_max_concurrent_streams.cc | 1 + .../retry_transparent_not_sent_on_wire.cc | 2 +- .../tests/retry_unref_before_finish.cc | 2 +- .../end2end/tests/retry_unref_before_recv.cc | 2 +- .../end2end/tests/simple_delayed_request.cc | 1 + .../event_engine/posix/posix_endpoint_test.cc | 1 + .../posix/posix_event_engine_connect_test.cc | 1 + .../test_suite/tests/client_test.cc | 2 +- .../test_suite/tests/server_test.cc | 2 +- test/core/handshake/client_ssl.cc | 1 + test/core/http/httpscli_test.cc | 1 + test/core/memory_usage/callback_client.cc | 1 + test/core/memory_usage/client.cc | 1 + test/core/memory_usage/server.cc | 1 + ...num_external_connectivity_watchers_test.cc | 1 + .../surface/sequential_connectivity_test.cc | 1 + test/core/surface/server_chttp2_test.cc | 1 + test/core/surface/server_test.cc | 1 + test/core/transport/chttp2/BUILD | 28 ++ .../chttp2/graceful_shutdown_test.cc | 1 + .../chttp2/ping_abuse_policy_test.cc | 111 ++++++ .../chttp2/ping_configuration_test.cc | 30 +- .../transport/chttp2/ping_rate_policy_test.cc | 77 ++++ .../remove_stream_from_stalled_lists_test.cc | 1 + .../transport/chttp2/settings_timeout_test.cc | 1 + ...ak_with_queued_flow_control_update_test.cc | 1 + .../transport/chttp2/streams_not_seen_test.cc | 1 + .../transport/chttp2/too_many_pings_test.cc | 1 + tools/doxygen/Doxyfile.c++ | 1 + tools/doxygen/Doxyfile.c++.internal | 5 + tools/doxygen/Doxyfile.core | 1 + tools/doxygen/Doxyfile.core.internal | 5 + tools/run_tests/generated/tests.json | 48 +++ 195 files changed, 1593 insertions(+), 628 deletions(-) create mode 100644 include/grpc/impl/channel_arg_names.h create mode 100644 src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc create mode 100644 src/core/ext/transport/chttp2/transport/ping_abuse_policy.h create mode 100644 src/core/ext/transport/chttp2/transport/ping_rate_policy.cc create mode 100644 src/core/ext/transport/chttp2/transport/ping_rate_policy.h create mode 100644 test/core/transport/chttp2/ping_abuse_policy_test.cc create mode 100644 test/core/transport/chttp2/ping_rate_policy_test.cc diff --git a/BUILD b/BUILD index 68362ea3412ce..1b81c905824f8 100644 --- a/BUILD +++ b/BUILD @@ -552,6 +552,7 @@ grpc_cc_library( ], visibility = ["@grpc:public"], deps = [ + "channel_arg_names", "channel_stack_builder", "config", "exec_ctx", @@ -624,6 +625,7 @@ grpc_cc_library( "@grpc:public", ], deps = [ + "channel_arg_names", "channel_stack_builder", "config", "exec_ctx", @@ -837,7 +839,10 @@ grpc_cc_library( "avoid_dep", "nofixdeps", ], - deps = ["gpr_public_hdrs"], + deps = [ + "channel_arg_names", + "gpr_public_hdrs", + ], ) grpc_cc_library( @@ -860,6 +865,11 @@ grpc_cc_library( ], ) +grpc_cc_library( + name = "channel_arg_names", + hdrs = ["include/grpc/impl/channel_arg_names.h"], +) + grpc_cc_library( name = "grpc++", hdrs = [ @@ -1258,6 +1268,7 @@ grpc_cc_library( "nofixdeps", ], deps = [ + "channel_arg_names", "gpr", ], ) @@ -1496,6 +1507,7 @@ grpc_cc_library( public_hdrs = GRPC_PUBLIC_HDRS + GRPC_PUBLIC_EVENT_ENGINE_HDRS, visibility = ["@grpc:alt_grpc_base_legacy"], deps = [ + "channel_arg_names", "channel_stack_builder", "config", "config_vars", @@ -1659,6 +1671,7 @@ grpc_cc_library( ], tags = ["nofixdeps"], deps = [ + "channel_arg_names", "gpr", "gpr_platform", "grpc", @@ -1772,6 +1785,7 @@ grpc_cc_library( public_hdrs = GRPC_PUBLIC_HDRS, visibility = ["@grpc:public"], deps = [ + "channel_arg_names", "config", "debug_location", "exec_ctx", @@ -1922,6 +1936,7 @@ grpc_cc_library( tags = ["nofixdeps"], visibility = ["@grpc:alt_grpc++_base_legacy"], deps = [ + "channel_arg_names", "channel_stack_builder", "config", "exec_ctx", @@ -1997,6 +2012,7 @@ grpc_cc_library( ], visibility = ["@grpc:alt_grpc++_base_unsecure_legacy"], deps = [ + "channel_arg_names", "channel_stack_builder", "config", "exec_ctx", @@ -3008,6 +3024,7 @@ grpc_cc_library( visibility = ["@grpc:client_channel"], deps = [ "backoff", + "channel_arg_names", "channel_stack_builder", "config", "config_vars", @@ -3110,6 +3127,7 @@ grpc_cc_library( language = "c++", deps = [ "backoff", + "channel_arg_names", "config", "config_vars", "debug_location", @@ -3217,6 +3235,7 @@ grpc_cc_library( visibility = ["@grpc:public"], deps = [ "alts_util", + "channel_arg_names", "debug_location", "exec_ctx", "gpr", @@ -3479,6 +3498,7 @@ grpc_cc_library( language = "c++", visibility = ["@grpc:public"], deps = [ + "channel_arg_names", "config_vars", "gpr", "grpc_base", @@ -3523,6 +3543,7 @@ grpc_cc_library( language = "c++", visibility = ["@grpc:http"], deps = [ + "channel_arg_names", "channel_stack_builder", "config", "gpr", @@ -3912,6 +3933,7 @@ grpc_cc_library( language = "c++", visibility = ["@grpc:grpclb"], deps = [ + "channel_arg_names", "chttp2_context_list_entry", "chttp2_frame", "chttp2_varint", @@ -3943,7 +3965,10 @@ grpc_cc_library( "//src/core:init_internally", "//src/core:iomgr_fwd", "//src/core:iomgr_port", + "//src/core:match", "//src/core:memory_quota", + "//src/core:ping_abuse_policy", + "//src/core:ping_rate_policy", "//src/core:poll", "//src/core:ref_counted", "//src/core:resource_quota", diff --git a/CMakeLists.txt b/CMakeLists.txt index bb3a3756bdb18..923aa95102fa0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1136,8 +1136,10 @@ if(gRPC_BUILD_TESTS) add_dependencies(buildtests_cxx periodic_update_test) add_dependencies(buildtests_cxx pick_first_test) add_dependencies(buildtests_cxx pid_controller_test) + add_dependencies(buildtests_cxx ping_abuse_policy_test) add_dependencies(buildtests_cxx ping_configuration_test) add_dependencies(buildtests_cxx ping_pong_streaming_test) + add_dependencies(buildtests_cxx ping_rate_policy_test) add_dependencies(buildtests_cxx ping_test) add_dependencies(buildtests_cxx pipe_test) add_dependencies(buildtests_cxx poll_test) @@ -1781,6 +1783,8 @@ add_library(grpc src/core/ext/transport/chttp2/transport/http_trace.cc src/core/ext/transport/chttp2/transport/huffsyms.cc src/core/ext/transport/chttp2/transport/parsing.cc + src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc + src/core/ext/transport/chttp2/transport/ping_rate_policy.cc src/core/ext/transport/chttp2/transport/stream_lists.cc src/core/ext/transport/chttp2/transport/varint.cc src/core/ext/transport/chttp2/transport/writing.cc @@ -2529,6 +2533,7 @@ foreach(_hdr include/grpc/grpc_posix.h include/grpc/grpc_security.h include/grpc/grpc_security_constants.h + include/grpc/impl/channel_arg_names.h include/grpc/impl/codegen/atm.h include/grpc/impl/codegen/atm_gcc_atomic.h include/grpc/impl/codegen/atm_gcc_sync.h @@ -2807,6 +2812,8 @@ add_library(grpc_unsecure src/core/ext/transport/chttp2/transport/http_trace.cc src/core/ext/transport/chttp2/transport/huffsyms.cc src/core/ext/transport/chttp2/transport/parsing.cc + src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc + src/core/ext/transport/chttp2/transport/ping_rate_policy.cc src/core/ext/transport/chttp2/transport/stream_lists.cc src/core/ext/transport/chttp2/transport/varint.cc src/core/ext/transport/chttp2/transport/writing.cc @@ -3175,6 +3182,7 @@ foreach(_hdr include/grpc/grpc_posix.h include/grpc/grpc_security.h include/grpc/grpc_security_constants.h + include/grpc/impl/channel_arg_names.h include/grpc/impl/codegen/atm.h include/grpc/impl/codegen/atm_gcc_atomic.h include/grpc/impl/codegen/atm_gcc_sync.h @@ -4694,6 +4702,7 @@ foreach(_hdr include/grpc/grpc_posix.h include/grpc/grpc_security.h include/grpc/grpc_security_constants.h + include/grpc/impl/channel_arg_names.h include/grpc/impl/codegen/atm.h include/grpc/impl/codegen/atm_gcc_atomic.h include/grpc/impl/codegen/atm_gcc_sync.h @@ -18224,6 +18233,55 @@ target_link_libraries(pid_controller_test ) +endif() +if(gRPC_BUILD_TESTS) + +add_executable(ping_abuse_policy_test + test/core/transport/chttp2/ping_abuse_policy_test.cc + test/core/util/cmdline.cc + test/core/util/fuzzer_util.cc + test/core/util/grpc_profiler.cc + test/core/util/histogram.cc + test/core/util/mock_endpoint.cc + test/core/util/parse_hexstring.cc + test/core/util/passthru_endpoint.cc + test/core/util/resolve_localhost_ip46.cc + test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc + test/core/util/tracer_util.cc + third_party/googletest/googletest/src/gtest-all.cc + third_party/googletest/googlemock/src/gmock-all.cc +) +target_compile_features(ping_abuse_policy_test PUBLIC cxx_std_14) +target_include_directories(ping_abuse_policy_test + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + ${_gRPC_RE2_INCLUDE_DIR} + ${_gRPC_SSL_INCLUDE_DIR} + ${_gRPC_UPB_GENERATED_DIR} + ${_gRPC_UPB_GRPC_GENERATED_DIR} + ${_gRPC_UPB_INCLUDE_DIR} + ${_gRPC_XXHASH_INCLUDE_DIR} + ${_gRPC_ZLIB_INCLUDE_DIR} + third_party/googletest/googletest/include + third_party/googletest/googletest + third_party/googletest/googlemock/include + third_party/googletest/googlemock + ${_gRPC_PROTO_GENS_DIR} +) + +target_link_libraries(ping_abuse_policy_test + ${_gRPC_BASELIB_LIBRARIES} + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ZLIB_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + grpc_test_util +) + + endif() if(gRPC_BUILD_TESTS) @@ -18321,6 +18379,55 @@ target_link_libraries(ping_pong_streaming_test ) +endif() +if(gRPC_BUILD_TESTS) + +add_executable(ping_rate_policy_test + test/core/transport/chttp2/ping_rate_policy_test.cc + test/core/util/cmdline.cc + test/core/util/fuzzer_util.cc + test/core/util/grpc_profiler.cc + test/core/util/histogram.cc + test/core/util/mock_endpoint.cc + test/core/util/parse_hexstring.cc + test/core/util/passthru_endpoint.cc + test/core/util/resolve_localhost_ip46.cc + test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc + test/core/util/tracer_util.cc + third_party/googletest/googletest/src/gtest-all.cc + third_party/googletest/googlemock/src/gmock-all.cc +) +target_compile_features(ping_rate_policy_test PUBLIC cxx_std_14) +target_include_directories(ping_rate_policy_test + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + ${_gRPC_RE2_INCLUDE_DIR} + ${_gRPC_SSL_INCLUDE_DIR} + ${_gRPC_UPB_GENERATED_DIR} + ${_gRPC_UPB_GRPC_GENERATED_DIR} + ${_gRPC_UPB_INCLUDE_DIR} + ${_gRPC_XXHASH_INCLUDE_DIR} + ${_gRPC_ZLIB_INCLUDE_DIR} + third_party/googletest/googletest/include + third_party/googletest/googletest + third_party/googletest/googlemock/include + third_party/googletest/googlemock + ${_gRPC_PROTO_GENS_DIR} +) + +target_link_libraries(ping_rate_policy_test + ${_gRPC_BASELIB_LIBRARIES} + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ZLIB_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + grpc_test_util +) + + endif() if(gRPC_BUILD_TESTS) diff --git a/Makefile b/Makefile index 3937fbc7a2a2a..f1a04b993b045 100644 --- a/Makefile +++ b/Makefile @@ -1065,6 +1065,8 @@ LIBGRPC_SRC = \ src/core/ext/transport/chttp2/transport/http_trace.cc \ src/core/ext/transport/chttp2/transport/huffsyms.cc \ src/core/ext/transport/chttp2/transport/parsing.cc \ + src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc \ + src/core/ext/transport/chttp2/transport/ping_rate_policy.cc \ src/core/ext/transport/chttp2/transport/stream_lists.cc \ src/core/ext/transport/chttp2/transport/varint.cc \ src/core/ext/transport/chttp2/transport/writing.cc \ @@ -1752,6 +1754,7 @@ PUBLIC_HEADERS_C += \ include/grpc/grpc_posix.h \ include/grpc/grpc_security.h \ include/grpc/grpc_security_constants.h \ + include/grpc/impl/channel_arg_names.h \ include/grpc/impl/codegen/atm.h \ include/grpc/impl/codegen/atm_gcc_atomic.h \ include/grpc/impl/codegen/atm_gcc_sync.h \ @@ -1944,6 +1947,8 @@ LIBGRPC_UNSECURE_SRC = \ src/core/ext/transport/chttp2/transport/http_trace.cc \ src/core/ext/transport/chttp2/transport/huffsyms.cc \ src/core/ext/transport/chttp2/transport/parsing.cc \ + src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc \ + src/core/ext/transport/chttp2/transport/ping_rate_policy.cc \ src/core/ext/transport/chttp2/transport/stream_lists.cc \ src/core/ext/transport/chttp2/transport/varint.cc \ src/core/ext/transport/chttp2/transport/writing.cc \ @@ -2252,6 +2257,7 @@ PUBLIC_HEADERS_C += \ include/grpc/grpc_posix.h \ include/grpc/grpc_security.h \ include/grpc/grpc_security_constants.h \ + include/grpc/impl/channel_arg_names.h \ include/grpc/impl/codegen/atm.h \ include/grpc/impl/codegen/atm_gcc_atomic.h \ include/grpc/impl/codegen/atm_gcc_sync.h \ diff --git a/Package.swift b/Package.swift index a3d31ce6d56aa..62ca96e64a41c 100644 --- a/Package.swift +++ b/Package.swift @@ -60,6 +60,7 @@ let package = Package( "include/grpc/grpc_posix.h", "include/grpc/grpc_security.h", "include/grpc/grpc_security_constants.h", + "include/grpc/impl/channel_arg_names.h", "include/grpc/impl/codegen/atm.h", "include/grpc/impl/codegen/atm_gcc_atomic.h", "include/grpc/impl/codegen/atm_gcc_sync.h", @@ -309,6 +310,10 @@ let package = Package( "src/core/ext/transport/chttp2/transport/huffsyms.h", "src/core/ext/transport/chttp2/transport/internal.h", "src/core/ext/transport/chttp2/transport/parsing.cc", + "src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc", + "src/core/ext/transport/chttp2/transport/ping_abuse_policy.h", + "src/core/ext/transport/chttp2/transport/ping_rate_policy.cc", + "src/core/ext/transport/chttp2/transport/ping_rate_policy.h", "src/core/ext/transport/chttp2/transport/stream_lists.cc", "src/core/ext/transport/chttp2/transport/varint.cc", "src/core/ext/transport/chttp2/transport/varint.h", diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 3b03656e521ad..d7a2af54dd2cf 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -161,6 +161,7 @@ libs: - include/grpc/grpc_posix.h - include/grpc/grpc_security.h - include/grpc/grpc_security_constants.h + - include/grpc/impl/channel_arg_names.h - include/grpc/impl/codegen/atm.h - include/grpc/impl/codegen/atm_gcc_atomic.h - include/grpc/impl/codegen/atm_gcc_sync.h @@ -307,6 +308,8 @@ libs: - src/core/ext/transport/chttp2/transport/http_trace.h - src/core/ext/transport/chttp2/transport/huffsyms.h - src/core/ext/transport/chttp2/transport/internal.h + - src/core/ext/transport/chttp2/transport/ping_abuse_policy.h + - src/core/ext/transport/chttp2/transport/ping_rate_policy.h - src/core/ext/transport/chttp2/transport/varint.h - src/core/ext/transport/inproc/inproc_transport.h - src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h @@ -1125,6 +1128,8 @@ libs: - src/core/ext/transport/chttp2/transport/http_trace.cc - src/core/ext/transport/chttp2/transport/huffsyms.cc - src/core/ext/transport/chttp2/transport/parsing.cc + - src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc + - src/core/ext/transport/chttp2/transport/ping_rate_policy.cc - src/core/ext/transport/chttp2/transport/stream_lists.cc - src/core/ext/transport/chttp2/transport/varint.cc - src/core/ext/transport/chttp2/transport/writing.cc @@ -1891,6 +1896,7 @@ libs: - include/grpc/grpc_posix.h - include/grpc/grpc_security.h - include/grpc/grpc_security_constants.h + - include/grpc/impl/channel_arg_names.h - include/grpc/impl/codegen/atm.h - include/grpc/impl/codegen/atm_gcc_atomic.h - include/grpc/impl/codegen/atm_gcc_sync.h @@ -2025,6 +2031,8 @@ libs: - src/core/ext/transport/chttp2/transport/http_trace.h - src/core/ext/transport/chttp2/transport/huffsyms.h - src/core/ext/transport/chttp2/transport/internal.h + - src/core/ext/transport/chttp2/transport/ping_abuse_policy.h + - src/core/ext/transport/chttp2/transport/ping_rate_policy.h - src/core/ext/transport/chttp2/transport/varint.h - src/core/ext/transport/inproc/inproc_transport.h - src/core/ext/upb-generated/google/api/annotations.upb.h @@ -2446,6 +2454,8 @@ libs: - src/core/ext/transport/chttp2/transport/http_trace.cc - src/core/ext/transport/chttp2/transport/huffsyms.cc - src/core/ext/transport/chttp2/transport/parsing.cc + - src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc + - src/core/ext/transport/chttp2/transport/ping_rate_policy.cc - src/core/ext/transport/chttp2/transport/stream_lists.cc - src/core/ext/transport/chttp2/transport/varint.cc - src/core/ext/transport/chttp2/transport/writing.cc @@ -3497,6 +3507,7 @@ libs: - include/grpc/grpc_posix.h - include/grpc/grpc_security.h - include/grpc/grpc_security_constants.h + - include/grpc/impl/channel_arg_names.h - include/grpc/impl/codegen/atm.h - include/grpc/impl/codegen/atm_gcc_atomic.h - include/grpc/impl/codegen/atm_gcc_sync.h @@ -11258,6 +11269,41 @@ targets: - test/core/util/tracer_util.cc deps: - grpc_test_util +- name: ping_abuse_policy_test + gtest: true + build: test + language: c++ + headers: + - test/core/util/cmdline.h + - test/core/util/evaluate_args_test_util.h + - test/core/util/fuzzer_util.h + - test/core/util/grpc_profiler.h + - test/core/util/histogram.h + - test/core/util/mock_authorization_endpoint.h + - test/core/util/mock_endpoint.h + - test/core/util/parse_hexstring.h + - test/core/util/passthru_endpoint.h + - test/core/util/resolve_localhost_ip46.h + - test/core/util/slice_splitter.h + - test/core/util/subprocess.h + - test/core/util/tracer_util.h + src: + - test/core/transport/chttp2/ping_abuse_policy_test.cc + - test/core/util/cmdline.cc + - test/core/util/fuzzer_util.cc + - test/core/util/grpc_profiler.cc + - test/core/util/histogram.cc + - test/core/util/mock_endpoint.cc + - test/core/util/parse_hexstring.cc + - test/core/util/passthru_endpoint.cc + - test/core/util/resolve_localhost_ip46.cc + - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc + - test/core/util/tracer_util.cc + deps: + - grpc_test_util + uses_polling: false - name: ping_configuration_test gtest: true build: test @@ -11328,6 +11374,41 @@ targets: - grpc_authorization_provider - grpc_unsecure - grpc_test_util +- name: ping_rate_policy_test + gtest: true + build: test + language: c++ + headers: + - test/core/util/cmdline.h + - test/core/util/evaluate_args_test_util.h + - test/core/util/fuzzer_util.h + - test/core/util/grpc_profiler.h + - test/core/util/histogram.h + - test/core/util/mock_authorization_endpoint.h + - test/core/util/mock_endpoint.h + - test/core/util/parse_hexstring.h + - test/core/util/passthru_endpoint.h + - test/core/util/resolve_localhost_ip46.h + - test/core/util/slice_splitter.h + - test/core/util/subprocess.h + - test/core/util/tracer_util.h + src: + - test/core/transport/chttp2/ping_rate_policy_test.cc + - test/core/util/cmdline.cc + - test/core/util/fuzzer_util.cc + - test/core/util/grpc_profiler.cc + - test/core/util/histogram.cc + - test/core/util/mock_endpoint.cc + - test/core/util/parse_hexstring.cc + - test/core/util/passthru_endpoint.cc + - test/core/util/resolve_localhost_ip46.cc + - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc + - test/core/util/tracer_util.cc + deps: + - grpc_test_util + uses_polling: false - name: ping_test gtest: true build: test diff --git a/config.m4 b/config.m4 index 46102ab65769f..7963168b68356 100644 --- a/config.m4 +++ b/config.m4 @@ -144,6 +144,8 @@ if test "$PHP_GRPC" != "no"; then src/core/ext/transport/chttp2/transport/http_trace.cc \ src/core/ext/transport/chttp2/transport/huffsyms.cc \ src/core/ext/transport/chttp2/transport/parsing.cc \ + src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc \ + src/core/ext/transport/chttp2/transport/ping_rate_policy.cc \ src/core/ext/transport/chttp2/transport/stream_lists.cc \ src/core/ext/transport/chttp2/transport/varint.cc \ src/core/ext/transport/chttp2/transport/writing.cc \ diff --git a/config.w32 b/config.w32 index da44d20aedd1e..e8412bdeb19c3 100644 --- a/config.w32 +++ b/config.w32 @@ -109,6 +109,8 @@ if (PHP_GRPC != "no") { "src\\core\\ext\\transport\\chttp2\\transport\\http_trace.cc " + "src\\core\\ext\\transport\\chttp2\\transport\\huffsyms.cc " + "src\\core\\ext\\transport\\chttp2\\transport\\parsing.cc " + + "src\\core\\ext\\transport\\chttp2\\transport\\ping_abuse_policy.cc " + + "src\\core\\ext\\transport\\chttp2\\transport\\ping_rate_policy.cc " + "src\\core\\ext\\transport\\chttp2\\transport\\stream_lists.cc " + "src\\core\\ext\\transport\\chttp2\\transport\\varint.cc " + "src\\core\\ext\\transport\\chttp2\\transport\\writing.cc " + diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 80d676e573582..a32da7153857f 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -377,6 +377,8 @@ Pod::Spec.new do |s| 'src/core/ext/transport/chttp2/transport/http_trace.h', 'src/core/ext/transport/chttp2/transport/huffsyms.h', 'src/core/ext/transport/chttp2/transport/internal.h', + 'src/core/ext/transport/chttp2/transport/ping_abuse_policy.h', + 'src/core/ext/transport/chttp2/transport/ping_rate_policy.h', 'src/core/ext/transport/chttp2/transport/varint.h', 'src/core/ext/transport/inproc/inproc_transport.h', 'src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h', @@ -1426,6 +1428,8 @@ Pod::Spec.new do |s| 'src/core/ext/transport/chttp2/transport/http_trace.h', 'src/core/ext/transport/chttp2/transport/huffsyms.h', 'src/core/ext/transport/chttp2/transport/internal.h', + 'src/core/ext/transport/chttp2/transport/ping_abuse_policy.h', + 'src/core/ext/transport/chttp2/transport/ping_rate_policy.h', 'src/core/ext/transport/chttp2/transport/varint.h', 'src/core/ext/transport/inproc/inproc_transport.h', 'src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h', diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 11debea0f5fff..a2b15673bf4fb 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -126,6 +126,7 @@ Pod::Spec.new do |s| 'include/grpc/grpc_posix.h', 'include/grpc/grpc_security.h', 'include/grpc/grpc_security_constants.h', + 'include/grpc/impl/channel_arg_names.h', 'include/grpc/impl/codegen/atm.h', 'include/grpc/impl/codegen/atm_gcc_atomic.h', 'include/grpc/impl/codegen/atm_gcc_sync.h', @@ -410,6 +411,10 @@ Pod::Spec.new do |s| 'src/core/ext/transport/chttp2/transport/huffsyms.h', 'src/core/ext/transport/chttp2/transport/internal.h', 'src/core/ext/transport/chttp2/transport/parsing.cc', + 'src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc', + 'src/core/ext/transport/chttp2/transport/ping_abuse_policy.h', + 'src/core/ext/transport/chttp2/transport/ping_rate_policy.cc', + 'src/core/ext/transport/chttp2/transport/ping_rate_policy.h', 'src/core/ext/transport/chttp2/transport/stream_lists.cc', 'src/core/ext/transport/chttp2/transport/varint.cc', 'src/core/ext/transport/chttp2/transport/varint.h', @@ -2158,6 +2163,8 @@ Pod::Spec.new do |s| 'src/core/ext/transport/chttp2/transport/http_trace.h', 'src/core/ext/transport/chttp2/transport/huffsyms.h', 'src/core/ext/transport/chttp2/transport/internal.h', + 'src/core/ext/transport/chttp2/transport/ping_abuse_policy.h', + 'src/core/ext/transport/chttp2/transport/ping_rate_policy.h', 'src/core/ext/transport/chttp2/transport/varint.h', 'src/core/ext/transport/inproc/inproc_transport.h', 'src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h', diff --git a/grpc.gemspec b/grpc.gemspec index 4e8db38014281..67a4bfcf084a6 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -66,6 +66,7 @@ Gem::Specification.new do |s| s.files += %w( include/grpc/grpc_posix.h ) s.files += %w( include/grpc/grpc_security.h ) s.files += %w( include/grpc/grpc_security_constants.h ) + s.files += %w( include/grpc/impl/channel_arg_names.h ) s.files += %w( include/grpc/impl/codegen/atm.h ) s.files += %w( include/grpc/impl/codegen/atm_gcc_atomic.h ) s.files += %w( include/grpc/impl/codegen/atm_gcc_sync.h ) @@ -315,6 +316,10 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/transport/chttp2/transport/huffsyms.h ) s.files += %w( src/core/ext/transport/chttp2/transport/internal.h ) s.files += %w( src/core/ext/transport/chttp2/transport/parsing.cc ) + s.files += %w( src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc ) + s.files += %w( src/core/ext/transport/chttp2/transport/ping_abuse_policy.h ) + s.files += %w( src/core/ext/transport/chttp2/transport/ping_rate_policy.cc ) + s.files += %w( src/core/ext/transport/chttp2/transport/ping_rate_policy.h ) s.files += %w( src/core/ext/transport/chttp2/transport/stream_lists.cc ) s.files += %w( src/core/ext/transport/chttp2/transport/varint.cc ) s.files += %w( src/core/ext/transport/chttp2/transport/varint.h ) diff --git a/grpc.gyp b/grpc.gyp index d82377051ff6e..9a53deff7e9aa 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -369,6 +369,8 @@ 'src/core/ext/transport/chttp2/transport/http_trace.cc', 'src/core/ext/transport/chttp2/transport/huffsyms.cc', 'src/core/ext/transport/chttp2/transport/parsing.cc', + 'src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc', + 'src/core/ext/transport/chttp2/transport/ping_rate_policy.cc', 'src/core/ext/transport/chttp2/transport/stream_lists.cc', 'src/core/ext/transport/chttp2/transport/varint.cc', 'src/core/ext/transport/chttp2/transport/writing.cc', @@ -1188,6 +1190,8 @@ 'src/core/ext/transport/chttp2/transport/http_trace.cc', 'src/core/ext/transport/chttp2/transport/huffsyms.cc', 'src/core/ext/transport/chttp2/transport/parsing.cc', + 'src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc', + 'src/core/ext/transport/chttp2/transport/ping_rate_policy.cc', 'src/core/ext/transport/chttp2/transport/stream_lists.cc', 'src/core/ext/transport/chttp2/transport/varint.cc', 'src/core/ext/transport/chttp2/transport/writing.cc', diff --git a/include/grpc/impl/channel_arg_names.h b/include/grpc/impl/channel_arg_names.h new file mode 100644 index 0000000000000..cf1f616c176a9 --- /dev/null +++ b/include/grpc/impl/channel_arg_names.h @@ -0,0 +1,371 @@ +// Copyright 2023 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef GRPC_IMPL_CHANNEL_ARG_NAMES_H +#define GRPC_IMPL_CHANNEL_ARG_NAMES_H + +/** \defgroup grpc_arg_keys + * Channel argument keys. + * \{ + */ +/** If non-zero, enable census for tracing and stats collection. */ +#define GRPC_ARG_ENABLE_CENSUS "grpc.census" +/** If non-zero, enable load reporting. */ +#define GRPC_ARG_ENABLE_LOAD_REPORTING "grpc.loadreporting" +/** If non-zero, call metric recording is enabled. */ +#define GRPC_ARG_SERVER_CALL_METRIC_RECORDING \ + "grpc.server_call_metric_recording" +/** Request that optional features default to off (regardless of what they + usually default to) - to enable tight control over what gets enabled */ +#define GRPC_ARG_MINIMAL_STACK "grpc.minimal_stack" +/** Maximum number of concurrent incoming streams to allow on a http2 + connection. Int valued. */ +#define GRPC_ARG_MAX_CONCURRENT_STREAMS "grpc.max_concurrent_streams" +/** Maximum message length that the channel can receive. Int valued, bytes. + -1 means unlimited. */ +#define GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH "grpc.max_receive_message_length" +/** \deprecated For backward compatibility. + * Use GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH instead. */ +#define GRPC_ARG_MAX_MESSAGE_LENGTH GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH +/** Maximum message length that the channel can send. Int valued, bytes. + -1 means unlimited. */ +#define GRPC_ARG_MAX_SEND_MESSAGE_LENGTH "grpc.max_send_message_length" +/** Maximum time that a channel may have no outstanding rpcs, after which the + * server will close the connection. Int valued, milliseconds. INT_MAX means + * unlimited. */ +#define GRPC_ARG_MAX_CONNECTION_IDLE_MS "grpc.max_connection_idle_ms" +/** Maximum time that a channel may exist. Int valued, milliseconds. + * INT_MAX means unlimited. */ +#define GRPC_ARG_MAX_CONNECTION_AGE_MS "grpc.max_connection_age_ms" +/** Grace period after the channel reaches its max age. Int valued, + milliseconds. INT_MAX means unlimited. */ +#define GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS "grpc.max_connection_age_grace_ms" +/** Timeout after the last RPC finishes on the client channel at which the + * channel goes back into IDLE state. Int valued, milliseconds. INT_MAX means + * unlimited. The default value is 30 minutes and the min value is 1 second. */ +#define GRPC_ARG_CLIENT_IDLE_TIMEOUT_MS "grpc.client_idle_timeout_ms" +/** Enable/disable support for per-message compression. Defaults to 1, unless + GRPC_ARG_MINIMAL_STACK is enabled, in which case it defaults to 0. */ +#define GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION "grpc.per_message_compression" +/** Experimental Arg. Enable/disable support for per-message decompression. + Defaults to 1. If disabled, decompression will not be performed and the + application will see the compressed message in the byte buffer. */ +#define GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION \ + "grpc.per_message_decompression" +/** Enable/disable support for deadline checking. Defaults to 1, unless + GRPC_ARG_MINIMAL_STACK is enabled, in which case it defaults to 0 */ +#define GRPC_ARG_ENABLE_DEADLINE_CHECKS "grpc.enable_deadline_checking" +/** Initial stream ID for http2 transports. Int valued. */ +#define GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER \ + "grpc.http2.initial_sequence_number" +/** Amount to read ahead on individual streams. Defaults to 64kb, larger + values can help throughput on high-latency connections. + NOTE: at some point we'd like to auto-tune this, and this parameter + will become a no-op. Int valued, bytes. */ +#define GRPC_ARG_HTTP2_STREAM_LOOKAHEAD_BYTES "grpc.http2.lookahead_bytes" +/** How much memory to use for hpack decoding. Int valued, bytes. */ +#define GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_DECODER \ + "grpc.http2.hpack_table_size.decoder" +/** How much memory to use for hpack encoding. Int valued, bytes. */ +#define GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_ENCODER \ + "grpc.http2.hpack_table_size.encoder" +/** How big a frame are we willing to receive via HTTP2. + Min 16384, max 16777215. Larger values give lower CPU usage for large + messages, but more head of line blocking for small messages. */ +#define GRPC_ARG_HTTP2_MAX_FRAME_SIZE "grpc.http2.max_frame_size" +/** Should BDP probing be performed? */ +#define GRPC_ARG_HTTP2_BDP_PROBE "grpc.http2.bdp_probe" +/** (DEPRECATED) Does not have any effect. + Earlier, this arg configured the minimum time between successive ping frames + without receiving any data/header frame, Int valued, milliseconds. This put + unnecessary constraints on the configuration of keepalive pings, + requiring users to set this channel arg along with + GRPC_ARG_KEEPALIVE_TIME_MS. This arg also limited the activity of the other + source of pings in gRPC Core - BDP pings, but BDP pings are only sent when + there is receive-side data activity, making this arg unuseful for BDP pings + too. */ +#define GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS \ + "grpc.http2.min_time_between_pings_ms" +/** Minimum allowed time between a server receiving successive ping frames + without sending any data/header frame. Int valued, milliseconds + */ +#define GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS \ + "grpc.http2.min_ping_interval_without_data_ms" +/** Channel arg to override the http2 :scheme header */ +#define GRPC_ARG_HTTP2_SCHEME "grpc.http2_scheme" +/** How many pings can the client send before needing to send a + data/header frame? (0 indicates that an infinite number of + pings can be sent without sending a data frame or header frame) */ +#define GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA \ + "grpc.http2.max_pings_without_data" +/** How many misbehaving pings the server can bear before sending goaway and + closing the transport? (0 indicates that the server can bear an infinite + number of misbehaving pings) */ +#define GRPC_ARG_HTTP2_MAX_PING_STRIKES "grpc.http2.max_ping_strikes" +/** How much data are we willing to queue up per stream if + GRPC_WRITE_BUFFER_HINT is set? This is an upper bound */ +#define GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE "grpc.http2.write_buffer_size" +/** Should we allow receipt of true-binary data on http2 connections? + Defaults to on (1) */ +#define GRPC_ARG_HTTP2_ENABLE_TRUE_BINARY "grpc.http2.true_binary" +/** An experimental channel arg which determines whether the preferred crypto + * frame size http2 setting sent to the peer at startup. If set to 0 (false + * - default), the preferred frame size is not sent to the peer. Otherwise it + * sends a default preferred crypto frame size value of 4GB to the peer at + * the startup of each connection. */ +#define GRPC_ARG_EXPERIMENTAL_HTTP2_PREFERRED_CRYPTO_FRAME_SIZE \ + "grpc.experimental.http2.enable_preferred_frame_size" +/** After a duration of this time the client/server pings its peer to see if the + transport is still alive. Int valued, milliseconds. */ +#define GRPC_ARG_KEEPALIVE_TIME_MS "grpc.keepalive_time_ms" +/** After waiting for a duration of this time, if the keepalive ping sender does + not receive the ping ack, it will close the transport. Int valued, + milliseconds. */ +#define GRPC_ARG_KEEPALIVE_TIMEOUT_MS "grpc.keepalive_timeout_ms" +/** Is it permissible to send keepalive pings from the client without any + outstanding streams. Int valued, 0(false)/1(true). */ +#define GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS \ + "grpc.keepalive_permit_without_calls" +/** Default authority to pass if none specified on call construction. A string. + * */ +#define GRPC_ARG_DEFAULT_AUTHORITY "grpc.default_authority" +/** Primary user agent: goes at the start of the user-agent metadata + sent on each request. A string. */ +#define GRPC_ARG_PRIMARY_USER_AGENT_STRING "grpc.primary_user_agent" +/** Secondary user agent: goes at the end of the user-agent metadata + sent on each request. A string. */ +#define GRPC_ARG_SECONDARY_USER_AGENT_STRING "grpc.secondary_user_agent" +/** The minimum time between subsequent connection attempts, in ms */ +#define GRPC_ARG_MIN_RECONNECT_BACKOFF_MS "grpc.min_reconnect_backoff_ms" +/** The maximum time between subsequent connection attempts, in ms */ +#define GRPC_ARG_MAX_RECONNECT_BACKOFF_MS "grpc.max_reconnect_backoff_ms" +/** The time between the first and second connection attempts, in ms */ +#define GRPC_ARG_INITIAL_RECONNECT_BACKOFF_MS \ + "grpc.initial_reconnect_backoff_ms" +/** Minimum amount of time between DNS resolutions, in ms */ +#define GRPC_ARG_DNS_MIN_TIME_BETWEEN_RESOLUTIONS_MS \ + "grpc.dns_min_time_between_resolutions_ms" +/** The timeout used on servers for finishing handshaking on an incoming + connection. Defaults to 120 seconds. */ +#define GRPC_ARG_SERVER_HANDSHAKE_TIMEOUT_MS "grpc.server_handshake_timeout_ms" +/** This *should* be used for testing only. + The caller of the secure_channel_create functions may override the target + name used for SSL host name checking using this channel argument which is of + type \a GRPC_ARG_STRING. If this argument is not specified, the name used + for SSL host name checking will be the target parameter (assuming that the + secure channel is an SSL channel). If this parameter is specified and the + underlying is not an SSL channel, it will just be ignored. */ +#define GRPC_SSL_TARGET_NAME_OVERRIDE_ARG "grpc.ssl_target_name_override" +/** If non-zero, a pointer to a session cache (a pointer of type + grpc_ssl_session_cache*). (use grpc_ssl_session_cache_arg_vtable() to fetch + an appropriate pointer arg vtable) */ +#define GRPC_SSL_SESSION_CACHE_ARG "grpc.ssl_session_cache" +/** If non-zero, it will determine the maximum frame size used by TSI's frame + * protector. + */ +#define GRPC_ARG_TSI_MAX_FRAME_SIZE "grpc.tsi.max_frame_size" +/** Maximum metadata size (soft limit), in bytes. Note this limit applies to the + max sum of all metadata key-value entries in a batch of headers. Some random + sample of requests between this limit and + `GRPC_ARG_ABSOLUTE_MAX_METADATA_SIZE` will be rejected. Defaults to maximum + of 8 KB and `GRPC_ARG_ABSOLUTE_MAX_METADATA_SIZE` * 0.8 (if set). + */ +#define GRPC_ARG_MAX_METADATA_SIZE "grpc.max_metadata_size" +/** Maximum metadata size (hard limit), in bytes. Note this limit applies to the + max sum of all metadata key-value entries in a batch of headers. All requests + exceeding this limit will be rejected. Defaults to maximum of 16 KB and + `GRPC_ARG_MAX_METADATA_SIZE` * 1.25 (if set). */ +#define GRPC_ARG_ABSOLUTE_MAX_METADATA_SIZE "grpc.absolute_max_metadata_size" +/** If non-zero, allow the use of SO_REUSEPORT if it's available (default 1) */ +#define GRPC_ARG_ALLOW_REUSEPORT "grpc.so_reuseport" +/** If non-zero, a pointer to a buffer pool (a pointer of type + * grpc_resource_quota*). (use grpc_resource_quota_arg_vtable() to fetch an + * appropriate pointer arg vtable) */ +#define GRPC_ARG_RESOURCE_QUOTA "grpc.resource_quota" +/** If non-zero, expand wildcard addresses to a list of local addresses. */ +#define GRPC_ARG_EXPAND_WILDCARD_ADDRS "grpc.expand_wildcard_addrs" +/** Service config data in JSON form. + This value will be ignored if the name resolver returns a service config. */ +#define GRPC_ARG_SERVICE_CONFIG "grpc.service_config" +/** Disable looking up the service config via the name resolver. */ +#define GRPC_ARG_SERVICE_CONFIG_DISABLE_RESOLUTION \ + "grpc.service_config_disable_resolution" +/** LB policy name. */ +#define GRPC_ARG_LB_POLICY_NAME "grpc.lb_policy_name" +/** Cap for ring size in the ring_hash LB policy. The min and max ring size + values set in the LB policy config will be capped to this value. + Default is 4096. */ +#define GRPC_ARG_RING_HASH_LB_RING_SIZE_CAP "grpc.lb.ring_hash.ring_size_cap" +/** The grpc_socket_mutator instance that set the socket options. A pointer. */ +#define GRPC_ARG_SOCKET_MUTATOR "grpc.socket_mutator" +/** The grpc_socket_factory instance to create and bind sockets. A pointer. */ +#define GRPC_ARG_SOCKET_FACTORY "grpc.socket_factory" +/** The maximum amount of memory used by trace events per channel trace node. + * Once the maximum is reached, subsequent events will evict the oldest events + * from the buffer. The unit for this knob is bytes. Setting it to zero causes + * channel tracing to be disabled. */ +#define GRPC_ARG_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE \ + "grpc.max_channel_trace_event_memory_per_node" +/** If non-zero, gRPC library will track stats and information at at per channel + * level. Disabling channelz naturally disables channel tracing. The default + * is for channelz to be enabled. */ +#define GRPC_ARG_ENABLE_CHANNELZ "grpc.enable_channelz" +/** If non-zero, Cronet transport will coalesce packets to fewer frames + * when possible. */ +#define GRPC_ARG_USE_CRONET_PACKET_COALESCING \ + "grpc.use_cronet_packet_coalescing" +/** Channel arg (integer) setting how large a slice to try and read from the + wire each time recvmsg (or equivalent) is called **/ +#define GRPC_ARG_TCP_READ_CHUNK_SIZE "grpc.experimental.tcp_read_chunk_size" +/** Note this is not a "channel arg" key. This is the default slice size to use + * when trying to read from the wire if the GRPC_ARG_TCP_READ_CHUNK_SIZE + * channel arg is unspecified. */ +#define GRPC_TCP_DEFAULT_READ_SLICE_SIZE 8192 +#define GRPC_ARG_TCP_MIN_READ_CHUNK_SIZE \ + "grpc.experimental.tcp_min_read_chunk_size" +#define GRPC_ARG_TCP_MAX_READ_CHUNK_SIZE \ + "grpc.experimental.tcp_max_read_chunk_size" +/* TCP TX Zerocopy enable state: zero is disabled, non-zero is enabled. By + default, it is disabled. */ +#define GRPC_ARG_TCP_TX_ZEROCOPY_ENABLED \ + "grpc.experimental.tcp_tx_zerocopy_enabled" +/* TCP TX Zerocopy send threshold: only zerocopy if >= this many bytes sent. By + default, this is set to 16KB. */ +#define GRPC_ARG_TCP_TX_ZEROCOPY_SEND_BYTES_THRESHOLD \ + "grpc.experimental.tcp_tx_zerocopy_send_bytes_threshold" +/* TCP TX Zerocopy max simultaneous sends: limit for maximum number of pending + calls to tcp_write() using zerocopy. A tcp_write() is considered pending + until the kernel performs the zerocopy-done callback for all sendmsg() calls + issued by the tcp_write(). By default, this is set to 4. */ +#define GRPC_ARG_TCP_TX_ZEROCOPY_MAX_SIMULT_SENDS \ + "grpc.experimental.tcp_tx_zerocopy_max_simultaneous_sends" +/* Overrides the TCP socket recieve buffer size, SO_RCVBUF. */ +#define GRPC_ARG_TCP_RECEIVE_BUFFER_SIZE "grpc.tcp_receive_buffer_size" +/* Timeout in milliseconds to use for calls to the grpclb load balancer. + If 0 or unset, the balancer calls will have no deadline. */ +#define GRPC_ARG_GRPCLB_CALL_TIMEOUT_MS "grpc.grpclb_call_timeout_ms" +/* Specifies the xDS bootstrap config as a JSON string. + FOR TESTING PURPOSES ONLY -- DO NOT USE IN PRODUCTION. + This option allows controlling the bootstrap configuration on a + per-channel basis, which is useful in tests. However, this results + in having a separate xDS client instance per channel rather than + using the global instance, which is not the intended way to use xDS. + Currently, this will (a) add unnecessary load on the xDS server and + (b) break use of CSDS, and there may be additional side effects in + the future. */ +#define GRPC_ARG_TEST_ONLY_DO_NOT_USE_IN_PROD_XDS_BOOTSTRAP_CONFIG \ + "grpc.TEST_ONLY_DO_NOT_USE_IN_PROD.xds_bootstrap_config" +/* Timeout in milliseconds to wait for the serverlist from the grpclb load + balancer before using fallback backend addresses from the resolver. + If 0, enter fallback mode immediately. Default value is 10000. */ +#define GRPC_ARG_GRPCLB_FALLBACK_TIMEOUT_MS "grpc.grpclb_fallback_timeout_ms" +/* Experimental Arg. Channel args to be used for the control-plane channel + * created to the grpclb load balancers. This is a pointer arg whose value is a + * grpc_channel_args object. If unset, most channel args from the parent channel + * will be propagated to the grpclb channel. */ +#define GRPC_ARG_EXPERIMENTAL_GRPCLB_CHANNEL_ARGS \ + "grpc.experimental.grpclb_channel_args" +/* Timeout in milliseconds to wait for the child of a specific priority to + complete its initial connection attempt before the priority LB policy fails + over to the next priority. Default value is 10 seconds. */ +#define GRPC_ARG_PRIORITY_FAILOVER_TIMEOUT_MS \ + "grpc.priority_failover_timeout_ms" +/** If non-zero, grpc server's cronet compression workaround will be enabled */ +#define GRPC_ARG_WORKAROUND_CRONET_COMPRESSION \ + "grpc.workaround.cronet_compression" +/** String defining the optimization target for a channel. + Can be: "latency" - attempt to minimize latency at the cost of throughput + "blend" - try to balance latency and throughput + "throughput" - attempt to maximize throughput at the expense of + latency + Defaults to "blend". In the current implementation "blend" is equivalent to + "latency". */ +#define GRPC_ARG_OPTIMIZATION_TARGET "grpc.optimization_target" +/** Enables retry functionality. Defaults to true. When enabled, + transparent retries will be performed as appropriate, and configurable + retries are enabled when they are configured via the service config. + For details, see: + https://github.com/grpc/proposal/blob/master/A6-client-retries.md + NOTE: Hedging functionality is not yet implemented, so those + fields in the service config will currently be ignored. See + also the GRPC_ARG_EXPERIMENTAL_ENABLE_HEDGING arg below. + */ +#define GRPC_ARG_ENABLE_RETRIES "grpc.enable_retries" +/** Enables hedging functionality, as described in: + https://github.com/grpc/proposal/blob/master/A6-client-retries.md + Default is currently false, since this functionality is not yet + fully implemented. + NOTE: This channel arg is experimental and will eventually be removed. + Once hedging functionality has been implemented and proves stable, + this arg will be removed, and the hedging functionality will + be enabled via the GRPC_ARG_ENABLE_RETRIES arg above. */ +#define GRPC_ARG_EXPERIMENTAL_ENABLE_HEDGING "grpc.experimental.enable_hedging" +/** Per-RPC retry buffer size, in bytes. Default is 256 KiB. */ +#define GRPC_ARG_PER_RPC_RETRY_BUFFER_SIZE "grpc.per_rpc_retry_buffer_size" +/** Channel arg that carries the bridged objective c object for custom metrics + * logging filter. */ +#define GRPC_ARG_MOBILE_LOG_CONTEXT "grpc.mobile_log_context" +/** If non-zero, client authority filter is disabled for the channel */ +#define GRPC_ARG_DISABLE_CLIENT_AUTHORITY_FILTER \ + "grpc.disable_client_authority_filter" +/** If set to zero, disables use of http proxies. Enabled by default. */ +#define GRPC_ARG_ENABLE_HTTP_PROXY "grpc.enable_http_proxy" +/** Channel arg to set http proxy per channel. If set, the channel arg + * value will be preferred over the environment variable settings. */ +#define GRPC_ARG_HTTP_PROXY "grpc.http_proxy" +/** If set to non zero, surfaces the user agent string to the server. User + agent is surfaced by default. */ +#define GRPC_ARG_SURFACE_USER_AGENT "grpc.surface_user_agent" +/** If set, inhibits health checking (which may be enabled via the + * service config.) */ +#define GRPC_ARG_INHIBIT_HEALTH_CHECKING "grpc.inhibit_health_checking" +/** If enabled, the channel's DNS resolver queries for SRV records. + * This is useful only when using the "grpclb" load balancing policy, + * as described in the following documents: + * https://github.com/grpc/proposal/blob/master/A5-grpclb-in-dns.md + * https://github.com/grpc/proposal/blob/master/A24-lb-policy-config.md + * https://github.com/grpc/proposal/blob/master/A26-grpclb-selection.md + * Note that this works only with the "ares" DNS resolver; it isn't supported + * by the "native" DNS resolver. */ +#define GRPC_ARG_DNS_ENABLE_SRV_QUERIES "grpc.dns_enable_srv_queries" +/** If set, determines an upper bound on the number of milliseconds that the + * c-ares based DNS resolver will wait on queries before cancelling them. + * The default value is 120,000. Setting this to "0" will disable the + * overall timeout entirely. Note that this doesn't include internal c-ares + * timeouts/backoff/retry logic, and so the actual DNS resolution may time out + * sooner than the value specified here. */ +#define GRPC_ARG_DNS_ARES_QUERY_TIMEOUT_MS "grpc.dns_ares_query_timeout" +/** If set, uses a local subchannel pool within the channel. Otherwise, uses the + * global subchannel pool. */ +#define GRPC_ARG_USE_LOCAL_SUBCHANNEL_POOL "grpc.use_local_subchannel_pool" +/** gRPC Objective-C channel pooling domain string. */ +#define GRPC_ARG_CHANNEL_POOL_DOMAIN "grpc.channel_pooling_domain" +/** gRPC Objective-C channel pooling id. */ +#define GRPC_ARG_CHANNEL_ID "grpc.channel_id" +/** Channel argument for grpc_authorization_policy_provider. If present, enables + gRPC authorization check. */ +#define GRPC_ARG_AUTHORIZATION_POLICY_PROVIDER \ + "grpc.authorization_policy_provider" +/** EXPERIMENTAL. Updates to a server's configuration from a config fetcher (for + * example, listener updates from xDS) cause all older connections to be + * gracefully shut down (i.e., "drained") with a grace period configured by this + * channel arg. Int valued, milliseconds. Defaults to 10 minutes.*/ +#define GRPC_ARG_SERVER_CONFIG_CHANGE_DRAIN_GRACE_TIME_MS \ + "grpc.experimental.server_config_change_drain_grace_time_ms" +/** Configure the Differentiated Services Code Point used on outgoing packets. + * Integer value ranging from 0 to 63. */ +#define GRPC_ARG_DSCP "grpc.dscp" +/** \} */ + +#endif /* GRPC_IMPL_CHANNEL_ARG_NAMES_H */ diff --git a/include/grpc/impl/grpc_types.h b/include/grpc/impl/grpc_types.h index 425fe0b630b6a..9250ce8f6b6ec 100644 --- a/include/grpc/impl/grpc_types.h +++ b/include/grpc/impl/grpc_types.h @@ -25,6 +25,7 @@ #include +#include #include #include #include @@ -133,359 +134,6 @@ typedef struct { grpc_arg* args; } grpc_channel_args; -/** \defgroup grpc_arg_keys - * Channel argument keys. - * \{ - */ -/** If non-zero, enable census for tracing and stats collection. */ -#define GRPC_ARG_ENABLE_CENSUS "grpc.census" -/** If non-zero, enable load reporting. */ -#define GRPC_ARG_ENABLE_LOAD_REPORTING "grpc.loadreporting" -/** If non-zero, call metric recording is enabled. */ -#define GRPC_ARG_SERVER_CALL_METRIC_RECORDING \ - "grpc.server_call_metric_recording" -/** Request that optional features default to off (regardless of what they - usually default to) - to enable tight control over what gets enabled */ -#define GRPC_ARG_MINIMAL_STACK "grpc.minimal_stack" -/** Maximum number of concurrent incoming streams to allow on a http2 - connection. Int valued. */ -#define GRPC_ARG_MAX_CONCURRENT_STREAMS "grpc.max_concurrent_streams" -/** Maximum message length that the channel can receive. Int valued, bytes. - -1 means unlimited. */ -#define GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH "grpc.max_receive_message_length" -/** \deprecated For backward compatibility. - * Use GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH instead. */ -#define GRPC_ARG_MAX_MESSAGE_LENGTH GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH -/** Maximum message length that the channel can send. Int valued, bytes. - -1 means unlimited. */ -#define GRPC_ARG_MAX_SEND_MESSAGE_LENGTH "grpc.max_send_message_length" -/** Maximum time that a channel may have no outstanding rpcs, after which the - * server will close the connection. Int valued, milliseconds. INT_MAX means - * unlimited. */ -#define GRPC_ARG_MAX_CONNECTION_IDLE_MS "grpc.max_connection_idle_ms" -/** Maximum time that a channel may exist. Int valued, milliseconds. - * INT_MAX means unlimited. */ -#define GRPC_ARG_MAX_CONNECTION_AGE_MS "grpc.max_connection_age_ms" -/** Grace period after the channel reaches its max age. Int valued, - milliseconds. INT_MAX means unlimited. */ -#define GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS "grpc.max_connection_age_grace_ms" -/** Timeout after the last RPC finishes on the client channel at which the - * channel goes back into IDLE state. Int valued, milliseconds. INT_MAX means - * unlimited. The default value is 30 minutes and the min value is 1 second. */ -#define GRPC_ARG_CLIENT_IDLE_TIMEOUT_MS "grpc.client_idle_timeout_ms" -/** Enable/disable support for per-message compression. Defaults to 1, unless - GRPC_ARG_MINIMAL_STACK is enabled, in which case it defaults to 0. */ -#define GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION "grpc.per_message_compression" -/** Experimental Arg. Enable/disable support for per-message decompression. - Defaults to 1. If disabled, decompression will not be performed and the - application will see the compressed message in the byte buffer. */ -#define GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION \ - "grpc.per_message_decompression" -/** Enable/disable support for deadline checking. Defaults to 1, unless - GRPC_ARG_MINIMAL_STACK is enabled, in which case it defaults to 0 */ -#define GRPC_ARG_ENABLE_DEADLINE_CHECKS "grpc.enable_deadline_checking" -/** Initial stream ID for http2 transports. Int valued. */ -#define GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER \ - "grpc.http2.initial_sequence_number" -/** Amount to read ahead on individual streams. Defaults to 64kb, larger - values can help throughput on high-latency connections. - NOTE: at some point we'd like to auto-tune this, and this parameter - will become a no-op. Int valued, bytes. */ -#define GRPC_ARG_HTTP2_STREAM_LOOKAHEAD_BYTES "grpc.http2.lookahead_bytes" -/** How much memory to use for hpack decoding. Int valued, bytes. */ -#define GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_DECODER \ - "grpc.http2.hpack_table_size.decoder" -/** How much memory to use for hpack encoding. Int valued, bytes. */ -#define GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_ENCODER \ - "grpc.http2.hpack_table_size.encoder" -/** How big a frame are we willing to receive via HTTP2. - Min 16384, max 16777215. Larger values give lower CPU usage for large - messages, but more head of line blocking for small messages. */ -#define GRPC_ARG_HTTP2_MAX_FRAME_SIZE "grpc.http2.max_frame_size" -/** Should BDP probing be performed? */ -#define GRPC_ARG_HTTP2_BDP_PROBE "grpc.http2.bdp_probe" -/** (DEPRECATED) Does not have any effect. - Earlier, this arg configured the minimum time between successive ping frames - without receiving any data/header frame, Int valued, milliseconds. This put - unnecessary constraints on the configuration of keepalive pings, - requiring users to set this channel arg along with - GRPC_ARG_KEEPALIVE_TIME_MS. This arg also limited the activity of the other - source of pings in gRPC Core - BDP pings, but BDP pings are only sent when - there is receive-side data activity, making this arg unuseful for BDP pings - too. */ -#define GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS \ - "grpc.http2.min_time_between_pings_ms" -/** Minimum allowed time between a server receiving successive ping frames - without sending any data/header frame. Int valued, milliseconds - */ -#define GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS \ - "grpc.http2.min_ping_interval_without_data_ms" -/** Channel arg to override the http2 :scheme header */ -#define GRPC_ARG_HTTP2_SCHEME "grpc.http2_scheme" -/** How many pings can the client send before needing to send a - data/header frame? (0 indicates that an infinite number of - pings can be sent without sending a data frame or header frame) */ -#define GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA \ - "grpc.http2.max_pings_without_data" -/** How many misbehaving pings the server can bear before sending goaway and - closing the transport? (0 indicates that the server can bear an infinite - number of misbehaving pings) */ -#define GRPC_ARG_HTTP2_MAX_PING_STRIKES "grpc.http2.max_ping_strikes" -/** How much data are we willing to queue up per stream if - GRPC_WRITE_BUFFER_HINT is set? This is an upper bound */ -#define GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE "grpc.http2.write_buffer_size" -/** Should we allow receipt of true-binary data on http2 connections? - Defaults to on (1) */ -#define GRPC_ARG_HTTP2_ENABLE_TRUE_BINARY "grpc.http2.true_binary" -/** An experimental channel arg which determines whether the preferred crypto - * frame size http2 setting sent to the peer at startup. If set to 0 (false - * - default), the preferred frame size is not sent to the peer. Otherwise it - * sends a default preferred crypto frame size value of 4GB to the peer at - * the startup of each connection. */ -#define GRPC_ARG_EXPERIMENTAL_HTTP2_PREFERRED_CRYPTO_FRAME_SIZE \ - "grpc.experimental.http2.enable_preferred_frame_size" -/** After a duration of this time the client/server pings its peer to see if the - transport is still alive. Int valued, milliseconds. */ -#define GRPC_ARG_KEEPALIVE_TIME_MS "grpc.keepalive_time_ms" -/** After waiting for a duration of this time, if the keepalive ping sender does - not receive the ping ack, it will close the transport. Int valued, - milliseconds. */ -#define GRPC_ARG_KEEPALIVE_TIMEOUT_MS "grpc.keepalive_timeout_ms" -/** Is it permissible to send keepalive pings from the client without any - outstanding streams. Int valued, 0(false)/1(true). */ -#define GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS \ - "grpc.keepalive_permit_without_calls" -/** Default authority to pass if none specified on call construction. A string. - * */ -#define GRPC_ARG_DEFAULT_AUTHORITY "grpc.default_authority" -/** Primary user agent: goes at the start of the user-agent metadata - sent on each request. A string. */ -#define GRPC_ARG_PRIMARY_USER_AGENT_STRING "grpc.primary_user_agent" -/** Secondary user agent: goes at the end of the user-agent metadata - sent on each request. A string. */ -#define GRPC_ARG_SECONDARY_USER_AGENT_STRING "grpc.secondary_user_agent" -/** The minimum time between subsequent connection attempts, in ms */ -#define GRPC_ARG_MIN_RECONNECT_BACKOFF_MS "grpc.min_reconnect_backoff_ms" -/** The maximum time between subsequent connection attempts, in ms */ -#define GRPC_ARG_MAX_RECONNECT_BACKOFF_MS "grpc.max_reconnect_backoff_ms" -/** The time between the first and second connection attempts, in ms */ -#define GRPC_ARG_INITIAL_RECONNECT_BACKOFF_MS \ - "grpc.initial_reconnect_backoff_ms" -/** Minimum amount of time between DNS resolutions, in ms */ -#define GRPC_ARG_DNS_MIN_TIME_BETWEEN_RESOLUTIONS_MS \ - "grpc.dns_min_time_between_resolutions_ms" -/** The timeout used on servers for finishing handshaking on an incoming - connection. Defaults to 120 seconds. */ -#define GRPC_ARG_SERVER_HANDSHAKE_TIMEOUT_MS "grpc.server_handshake_timeout_ms" -/** This *should* be used for testing only. - The caller of the secure_channel_create functions may override the target - name used for SSL host name checking using this channel argument which is of - type \a GRPC_ARG_STRING. If this argument is not specified, the name used - for SSL host name checking will be the target parameter (assuming that the - secure channel is an SSL channel). If this parameter is specified and the - underlying is not an SSL channel, it will just be ignored. */ -#define GRPC_SSL_TARGET_NAME_OVERRIDE_ARG "grpc.ssl_target_name_override" -/** If non-zero, a pointer to a session cache (a pointer of type - grpc_ssl_session_cache*). (use grpc_ssl_session_cache_arg_vtable() to fetch - an appropriate pointer arg vtable) */ -#define GRPC_SSL_SESSION_CACHE_ARG "grpc.ssl_session_cache" -/** If non-zero, it will determine the maximum frame size used by TSI's frame - * protector. - */ -#define GRPC_ARG_TSI_MAX_FRAME_SIZE "grpc.tsi.max_frame_size" -/** Maximum metadata size (soft limit), in bytes. Note this limit applies to the - max sum of all metadata key-value entries in a batch of headers. Some random - sample of requests between this limit and - `GRPC_ARG_ABSOLUTE_MAX_METADATA_SIZE` will be rejected. Defaults to maximum - of 8 KB and `GRPC_ARG_ABSOLUTE_MAX_METADATA_SIZE` * 0.8 (if set). - */ -#define GRPC_ARG_MAX_METADATA_SIZE "grpc.max_metadata_size" -/** Maximum metadata size (hard limit), in bytes. Note this limit applies to the - max sum of all metadata key-value entries in a batch of headers. All requests - exceeding this limit will be rejected. Defaults to maximum of 16 KB and - `GRPC_ARG_MAX_METADATA_SIZE` * 1.25 (if set). */ -#define GRPC_ARG_ABSOLUTE_MAX_METADATA_SIZE "grpc.absolute_max_metadata_size" -/** If non-zero, allow the use of SO_REUSEPORT if it's available (default 1) */ -#define GRPC_ARG_ALLOW_REUSEPORT "grpc.so_reuseport" -/** If non-zero, a pointer to a buffer pool (a pointer of type - * grpc_resource_quota*). (use grpc_resource_quota_arg_vtable() to fetch an - * appropriate pointer arg vtable) */ -#define GRPC_ARG_RESOURCE_QUOTA "grpc.resource_quota" -/** If non-zero, expand wildcard addresses to a list of local addresses. */ -#define GRPC_ARG_EXPAND_WILDCARD_ADDRS "grpc.expand_wildcard_addrs" -/** Service config data in JSON form. - This value will be ignored if the name resolver returns a service config. */ -#define GRPC_ARG_SERVICE_CONFIG "grpc.service_config" -/** Disable looking up the service config via the name resolver. */ -#define GRPC_ARG_SERVICE_CONFIG_DISABLE_RESOLUTION \ - "grpc.service_config_disable_resolution" -/** LB policy name. */ -#define GRPC_ARG_LB_POLICY_NAME "grpc.lb_policy_name" -/** Cap for ring size in the ring_hash LB policy. The min and max ring size - values set in the LB policy config will be capped to this value. - Default is 4096. */ -#define GRPC_ARG_RING_HASH_LB_RING_SIZE_CAP "grpc.lb.ring_hash.ring_size_cap" -/** The grpc_socket_mutator instance that set the socket options. A pointer. */ -#define GRPC_ARG_SOCKET_MUTATOR "grpc.socket_mutator" -/** The grpc_socket_factory instance to create and bind sockets. A pointer. */ -#define GRPC_ARG_SOCKET_FACTORY "grpc.socket_factory" -/** The maximum amount of memory used by trace events per channel trace node. - * Once the maximum is reached, subsequent events will evict the oldest events - * from the buffer. The unit for this knob is bytes. Setting it to zero causes - * channel tracing to be disabled. */ -#define GRPC_ARG_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE \ - "grpc.max_channel_trace_event_memory_per_node" -/** If non-zero, gRPC library will track stats and information at at per channel - * level. Disabling channelz naturally disables channel tracing. The default - * is for channelz to be enabled. */ -#define GRPC_ARG_ENABLE_CHANNELZ "grpc.enable_channelz" -/** If non-zero, Cronet transport will coalesce packets to fewer frames - * when possible. */ -#define GRPC_ARG_USE_CRONET_PACKET_COALESCING \ - "grpc.use_cronet_packet_coalescing" -/** Channel arg (integer) setting how large a slice to try and read from the - wire each time recvmsg (or equivalent) is called **/ -#define GRPC_ARG_TCP_READ_CHUNK_SIZE "grpc.experimental.tcp_read_chunk_size" -/** Note this is not a "channel arg" key. This is the default slice size to use - * when trying to read from the wire if the GRPC_ARG_TCP_READ_CHUNK_SIZE - * channel arg is unspecified. */ -#define GRPC_TCP_DEFAULT_READ_SLICE_SIZE 8192 -#define GRPC_ARG_TCP_MIN_READ_CHUNK_SIZE \ - "grpc.experimental.tcp_min_read_chunk_size" -#define GRPC_ARG_TCP_MAX_READ_CHUNK_SIZE \ - "grpc.experimental.tcp_max_read_chunk_size" -/* TCP TX Zerocopy enable state: zero is disabled, non-zero is enabled. By - default, it is disabled. */ -#define GRPC_ARG_TCP_TX_ZEROCOPY_ENABLED \ - "grpc.experimental.tcp_tx_zerocopy_enabled" -/* TCP TX Zerocopy send threshold: only zerocopy if >= this many bytes sent. By - default, this is set to 16KB. */ -#define GRPC_ARG_TCP_TX_ZEROCOPY_SEND_BYTES_THRESHOLD \ - "grpc.experimental.tcp_tx_zerocopy_send_bytes_threshold" -/* TCP TX Zerocopy max simultaneous sends: limit for maximum number of pending - calls to tcp_write() using zerocopy. A tcp_write() is considered pending - until the kernel performs the zerocopy-done callback for all sendmsg() calls - issued by the tcp_write(). By default, this is set to 4. */ -#define GRPC_ARG_TCP_TX_ZEROCOPY_MAX_SIMULT_SENDS \ - "grpc.experimental.tcp_tx_zerocopy_max_simultaneous_sends" -/* Overrides the TCP socket recieve buffer size, SO_RCVBUF. */ -#define GRPC_ARG_TCP_RECEIVE_BUFFER_SIZE "grpc.tcp_receive_buffer_size" -/* Timeout in milliseconds to use for calls to the grpclb load balancer. - If 0 or unset, the balancer calls will have no deadline. */ -#define GRPC_ARG_GRPCLB_CALL_TIMEOUT_MS "grpc.grpclb_call_timeout_ms" -/* Specifies the xDS bootstrap config as a JSON string. - FOR TESTING PURPOSES ONLY -- DO NOT USE IN PRODUCTION. - This option allows controlling the bootstrap configuration on a - per-channel basis, which is useful in tests. However, this results - in having a separate xDS client instance per channel rather than - using the global instance, which is not the intended way to use xDS. - Currently, this will (a) add unnecessary load on the xDS server and - (b) break use of CSDS, and there may be additional side effects in - the future. */ -#define GRPC_ARG_TEST_ONLY_DO_NOT_USE_IN_PROD_XDS_BOOTSTRAP_CONFIG \ - "grpc.TEST_ONLY_DO_NOT_USE_IN_PROD.xds_bootstrap_config" -/* Timeout in milliseconds to wait for the serverlist from the grpclb load - balancer before using fallback backend addresses from the resolver. - If 0, enter fallback mode immediately. Default value is 10000. */ -#define GRPC_ARG_GRPCLB_FALLBACK_TIMEOUT_MS "grpc.grpclb_fallback_timeout_ms" -/* Experimental Arg. Channel args to be used for the control-plane channel - * created to the grpclb load balancers. This is a pointer arg whose value is a - * grpc_channel_args object. If unset, most channel args from the parent channel - * will be propagated to the grpclb channel. */ -#define GRPC_ARG_EXPERIMENTAL_GRPCLB_CHANNEL_ARGS \ - "grpc.experimental.grpclb_channel_args" -/* Timeout in milliseconds to wait for the child of a specific priority to - complete its initial connection attempt before the priority LB policy fails - over to the next priority. Default value is 10 seconds. */ -#define GRPC_ARG_PRIORITY_FAILOVER_TIMEOUT_MS \ - "grpc.priority_failover_timeout_ms" -/** If non-zero, grpc server's cronet compression workaround will be enabled */ -#define GRPC_ARG_WORKAROUND_CRONET_COMPRESSION \ - "grpc.workaround.cronet_compression" -/** String defining the optimization target for a channel. - Can be: "latency" - attempt to minimize latency at the cost of throughput - "blend" - try to balance latency and throughput - "throughput" - attempt to maximize throughput at the expense of - latency - Defaults to "blend". In the current implementation "blend" is equivalent to - "latency". */ -#define GRPC_ARG_OPTIMIZATION_TARGET "grpc.optimization_target" -/** Enables retry functionality. Defaults to true. When enabled, - transparent retries will be performed as appropriate, and configurable - retries are enabled when they are configured via the service config. - For details, see: - https://github.com/grpc/proposal/blob/master/A6-client-retries.md - NOTE: Hedging functionality is not yet implemented, so those - fields in the service config will currently be ignored. See - also the GRPC_ARG_EXPERIMENTAL_ENABLE_HEDGING arg below. - */ -#define GRPC_ARG_ENABLE_RETRIES "grpc.enable_retries" -/** Enables hedging functionality, as described in: - https://github.com/grpc/proposal/blob/master/A6-client-retries.md - Default is currently false, since this functionality is not yet - fully implemented. - NOTE: This channel arg is experimental and will eventually be removed. - Once hedging functionality has been implemented and proves stable, - this arg will be removed, and the hedging functionality will - be enabled via the GRPC_ARG_ENABLE_RETRIES arg above. */ -#define GRPC_ARG_EXPERIMENTAL_ENABLE_HEDGING "grpc.experimental.enable_hedging" -/** Per-RPC retry buffer size, in bytes. Default is 256 KiB. */ -#define GRPC_ARG_PER_RPC_RETRY_BUFFER_SIZE "grpc.per_rpc_retry_buffer_size" -/** Channel arg that carries the bridged objective c object for custom metrics - * logging filter. */ -#define GRPC_ARG_MOBILE_LOG_CONTEXT "grpc.mobile_log_context" -/** If non-zero, client authority filter is disabled for the channel */ -#define GRPC_ARG_DISABLE_CLIENT_AUTHORITY_FILTER \ - "grpc.disable_client_authority_filter" -/** If set to zero, disables use of http proxies. Enabled by default. */ -#define GRPC_ARG_ENABLE_HTTP_PROXY "grpc.enable_http_proxy" -/** Channel arg to set http proxy per channel. If set, the channel arg - * value will be preferred over the environment variable settings. */ -#define GRPC_ARG_HTTP_PROXY "grpc.http_proxy" -/** If set to non zero, surfaces the user agent string to the server. User - agent is surfaced by default. */ -#define GRPC_ARG_SURFACE_USER_AGENT "grpc.surface_user_agent" -/** If set, inhibits health checking (which may be enabled via the - * service config.) */ -#define GRPC_ARG_INHIBIT_HEALTH_CHECKING "grpc.inhibit_health_checking" -/** If enabled, the channel's DNS resolver queries for SRV records. - * This is useful only when using the "grpclb" load balancing policy, - * as described in the following documents: - * https://github.com/grpc/proposal/blob/master/A5-grpclb-in-dns.md - * https://github.com/grpc/proposal/blob/master/A24-lb-policy-config.md - * https://github.com/grpc/proposal/blob/master/A26-grpclb-selection.md - * Note that this works only with the "ares" DNS resolver; it isn't supported - * by the "native" DNS resolver. */ -#define GRPC_ARG_DNS_ENABLE_SRV_QUERIES "grpc.dns_enable_srv_queries" -/** If set, determines an upper bound on the number of milliseconds that the - * c-ares based DNS resolver will wait on queries before cancelling them. - * The default value is 120,000. Setting this to "0" will disable the - * overall timeout entirely. Note that this doesn't include internal c-ares - * timeouts/backoff/retry logic, and so the actual DNS resolution may time out - * sooner than the value specified here. */ -#define GRPC_ARG_DNS_ARES_QUERY_TIMEOUT_MS "grpc.dns_ares_query_timeout" -/** If set, uses a local subchannel pool within the channel. Otherwise, uses the - * global subchannel pool. */ -#define GRPC_ARG_USE_LOCAL_SUBCHANNEL_POOL "grpc.use_local_subchannel_pool" -/** gRPC Objective-C channel pooling domain string. */ -#define GRPC_ARG_CHANNEL_POOL_DOMAIN "grpc.channel_pooling_domain" -/** gRPC Objective-C channel pooling id. */ -#define GRPC_ARG_CHANNEL_ID "grpc.channel_id" -/** Channel argument for grpc_authorization_policy_provider. If present, enables - gRPC authorization check. */ -#define GRPC_ARG_AUTHORIZATION_POLICY_PROVIDER \ - "grpc.authorization_policy_provider" -/** EXPERIMENTAL. Updates to a server's configuration from a config fetcher (for - * example, listener updates from xDS) cause all older connections to be - * gracefully shut down (i.e., "drained") with a grace period configured by this - * channel arg. Int valued, milliseconds. Defaults to 10 minutes.*/ -#define GRPC_ARG_SERVER_CONFIG_CHANGE_DRAIN_GRACE_TIME_MS \ - "grpc.experimental.server_config_change_drain_grace_time_ms" -/** Configure the Differentiated Services Code Point used on outgoing packets. - * Integer value ranging from 0 to 63. */ -#define GRPC_ARG_DSCP "grpc.dscp" -/** \} */ - /** Result of a grpc call. If the caller satisfies the prerequisites of a particular operation, the grpc_call_error returned will be GRPC_CALL_OK. Receiving any other value listed here is an indication of a bug in the diff --git a/include/grpc/module.modulemap b/include/grpc/module.modulemap index 3f8840ccaff7f..a37f5dcaafc82 100644 --- a/include/grpc/module.modulemap +++ b/include/grpc/module.modulemap @@ -12,6 +12,7 @@ header "byte_buffer.h" header "grpc_posix.h" header "grpc_security.h" header "grpc_security_constants.h" + header "impl/channel_arg_names.h" header "impl/codegen/atm.h" header "impl/codegen/byte_buffer.h" header "impl/codegen/byte_buffer_reader.h" diff --git a/package.xml b/package.xml index 5417e51fde077..7a21ab7ac7d8a 100644 --- a/package.xml +++ b/package.xml @@ -48,6 +48,7 @@ + @@ -297,6 +298,10 @@ + + + + diff --git a/src/core/BUILD b/src/core/BUILD index 5b05d7481b4cf..d34265179224e 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -1187,6 +1187,7 @@ grpc_cc_library( "ref_counted", "thread_quota", "useful", + "//:channel_arg_names", "//:cpp_impl_of", "//:event_engine_base_hdrs", "//:gpr_platform", @@ -1894,6 +1895,7 @@ grpc_cc_library( "strerror", "time", "useful", + "//:channel_arg_names", "//:event_engine_base_hdrs", "//:gpr", "//:ref_counted_ptr", @@ -2634,6 +2636,7 @@ grpc_cc_library( "ref_counted", "time", "useful", + "//:channel_arg_names", "//:debug_location", "//:event_engine_base_hdrs", "//:gpr", @@ -2953,6 +2956,7 @@ grpc_cc_library( "resolved_address", "slice", "useful", + "//:channel_arg_names", "//:gpr", "//:grpc_base", "//:grpc_credentials_util", @@ -2993,6 +2997,7 @@ grpc_cc_library( "slice", "unique_type_name", "useful", + "//:channel_arg_names", "//:debug_location", "//:exec_ctx", "//:gpr", @@ -3127,6 +3132,7 @@ grpc_cc_library( "iomgr_fwd", "unique_type_name", "useful", + "//:channel_arg_names", "//:debug_location", "//:exec_ctx", "//:gpr", @@ -3178,6 +3184,7 @@ grpc_cc_library( "unique_type_name", "useful", "//:alts_util", + "//:channel_arg_names", "//:exec_ctx", "//:gpr", "//:grpc_alts_credentials", @@ -3247,6 +3254,7 @@ grpc_cc_library( "status_helper", "unique_type_name", "useful", + "//:channel_arg_names", "//:debug_location", "//:exec_ctx", "//:gpr", @@ -3412,6 +3420,7 @@ grpc_cc_library( "error", "iomgr_fwd", "unique_type_name", + "//:channel_arg_names", "//:debug_location", "//:exec_ctx", "//:gpr", @@ -3640,6 +3649,7 @@ grpc_cc_library( "status_helper", "time", "try_seq", + "//:channel_arg_names", "//:channel_stack_builder", "//:config", "//:debug_location", @@ -3678,6 +3688,7 @@ grpc_cc_library( "error", "status_helper", "time", + "//:channel_arg_names", "//:channel_stack_builder", "//:config", "//:debug_location", @@ -3710,6 +3721,7 @@ grpc_cc_library( "channel_fwd", "channel_stack_type", "slice", + "//:channel_arg_names", "//:channel_stack_builder", "//:config", "//:gpr_platform", @@ -3752,6 +3764,7 @@ grpc_cc_library( "slice", "slice_buffer", "validation_errors", + "//:channel_arg_names", "//:channel_stack_builder", "//:config", "//:gpr", @@ -3950,6 +3963,7 @@ grpc_cc_library( "useful", "validation_errors", "//:backoff", + "//:channel_arg_names", "//:channel_stack_builder", "//:config", "//:debug_location", @@ -4041,6 +4055,7 @@ grpc_cc_library( "time", "validation_errors", "//:backoff", + "//:channel_arg_names", "//:config", "//:debug_location", "//:exec_ctx", @@ -4238,6 +4253,7 @@ grpc_cc_library( "validation_errors", "xds_type_upb", "xds_type_upbdefs", + "//:channel_arg_names", "//:config", "//:debug_location", "//:exec_ctx", @@ -4438,6 +4454,7 @@ grpc_cc_library( "lb_policy_registry", "pollset_set", "validation_errors", + "//:channel_arg_names", "//:config", "//:debug_location", "//:gpr", @@ -4623,6 +4640,7 @@ grpc_cc_library( "slice", "subchannel_interface", "unique_type_name", + "//:channel_arg_names", "//:debug_location", "//:exec_ctx", "//:gpr", @@ -4655,6 +4673,7 @@ grpc_cc_library( "iomgr_fwd", "lb_policy", "subchannel_interface", + "//:channel_arg_names", "//:debug_location", "//:gpr", "//:grpc_base", @@ -4694,6 +4713,7 @@ grpc_cc_library( "lb_policy_factory", "subchannel_interface", "validation_errors", + "//:channel_arg_names", "//:config", "//:debug_location", "//:gpr", @@ -4739,6 +4759,7 @@ grpc_cc_library( "subchannel_interface", "unique_type_name", "validation_errors", + "//:channel_arg_names", "//:config", "//:debug_location", "//:exec_ctx", @@ -4934,6 +4955,7 @@ grpc_cc_library( "pollset_set", "time", "validation_errors", + "//:channel_arg_names", "//:config", "//:debug_location", "//:exec_ctx", @@ -5070,6 +5092,7 @@ grpc_cc_library( "resolved_address", "seq", "slice", + "//:channel_arg_names", "//:channel_stack_builder", "//:config", "//:gpr", @@ -5109,6 +5132,7 @@ grpc_cc_library( "grpc_backend_metric_provider", "map", "slice", + "//:channel_arg_names", "//:channel_stack_builder", "//:config", "//:gpr", @@ -5197,6 +5221,7 @@ grpc_cc_library( "time", "validation_errors", "//:backoff", + "//:channel_arg_names", "//:debug_location", "//:exec_ctx", "//:gpr", @@ -5257,6 +5282,7 @@ grpc_cc_library( "resolved_address", "time", "//:backoff", + "//:channel_arg_names", "//:config", "//:debug_location", "//:gpr", @@ -5369,6 +5395,7 @@ grpc_cc_library( "ref_counted", "slice", "time", + "//:channel_arg_names", "//:config", "//:debug_location", "//:gpr", @@ -5475,6 +5502,45 @@ grpc_cc_library( ], ) +grpc_cc_library( + name = "ping_abuse_policy", + srcs = [ + "ext/transport/chttp2/transport/ping_abuse_policy.cc", + ], + hdrs = [ + "ext/transport/chttp2/transport/ping_abuse_policy.h", + ], + external_deps = ["absl/types:optional"], + deps = [ + "channel_args", + "time", + "//:channel_arg_names", + "//:gpr_platform", + ], +) + +grpc_cc_library( + name = "ping_rate_policy", + srcs = [ + "ext/transport/chttp2/transport/ping_rate_policy.cc", + ], + hdrs = [ + "ext/transport/chttp2/transport/ping_rate_policy.h", + ], + external_deps = [ + "absl/strings", + "absl/types:optional", + "absl/types:variant", + ], + deps = [ + "channel_args", + "match", + "time", + "//:channel_arg_names", + "//:gpr_platform", + ], +) + grpc_cc_library( name = "huffsyms", srcs = [ @@ -5558,6 +5624,7 @@ grpc_cc_library( "time", "transport_fwd", "unique_type_name", + "//:channel_arg_names", "//:config", "//:debug_location", "//:exec_ctx", @@ -5609,6 +5676,7 @@ grpc_cc_library( "time", "transport_fwd", "unique_type_name", + "//:channel_arg_names", "//:chttp2_frame", "//:config", "//:debug_location", @@ -5655,6 +5723,7 @@ grpc_cc_library( "status_helper", "time", "transport_fwd", + "//:channel_arg_names", "//:config", "//:debug_location", "//:exec_ctx", @@ -5801,6 +5870,7 @@ grpc_cc_library( "slice", "slice_buffer", "time", + "//:channel_arg_names", "//:channel_stack_builder", "//:config", "//:gpr", diff --git a/src/core/ext/filters/backend_metrics/backend_metric_filter.cc b/src/core/ext/filters/backend_metrics/backend_metric_filter.cc index e1eae2a62b32c..61cd59b393280 100644 --- a/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +++ b/src/core/ext/filters/backend_metrics/backend_metric_filter.cc @@ -30,7 +30,7 @@ #include "upb/upb.hpp" #include "xds/data/orca/v3/orca_load_report.upb.h" -#include +#include #include #include "src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h" diff --git a/src/core/ext/filters/channel_idle/channel_idle_filter.cc b/src/core/ext/filters/channel_idle/channel_idle_filter.cc index e2a6c36bb2ba0..34601e5e3a0a2 100644 --- a/src/core/ext/filters/channel_idle/channel_idle_filter.cc +++ b/src/core/ext/filters/channel_idle/channel_idle_filter.cc @@ -26,7 +26,7 @@ #include "absl/types/optional.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc index d250c32102b46..1bab8f8003432 100644 --- a/src/core/ext/filters/client_channel/client_channel.cc +++ b/src/core/ext/filters/client_channel/client_channel.cc @@ -41,6 +41,7 @@ #include "absl/types/variant.h" #include +#include #include #include #include diff --git a/src/core/ext/filters/client_channel/http_proxy.cc b/src/core/ext/filters/client_channel/http_proxy.cc index 6eb61fce4fa6d..54dac2dbf4393 100644 --- a/src/core/ext/filters/client_channel/http_proxy.cc +++ b/src/core/ext/filters/client_channel/http_proxy.cc @@ -39,7 +39,7 @@ #include "absl/strings/strip.h" #include "absl/types/optional.h" -#include +#include #include #include diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc index 88afb0600b21b..2d079ed2b7d50 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc @@ -54,6 +54,7 @@ #include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h" #include +#include #include // IWYU pragma: no_include diff --git a/src/core/ext/filters/client_channel/lb_policy/health_check_client.cc b/src/core/ext/filters/client_channel/lb_policy/health_check_client.cc index f9b02cdfe5339..859fc4b78bd1c 100644 --- a/src/core/ext/filters/client_channel/lb_policy/health_check_client.cc +++ b/src/core/ext/filters/client_channel/lb_policy/health_check_client.cc @@ -33,7 +33,7 @@ #include "upb/base/string_view.h" #include "upb/upb.hpp" -#include +#include #include #include #include diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc index 4b84091950c01..c65edd910e912 100644 --- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc @@ -33,7 +33,7 @@ #include "absl/strings/string_view.h" #include "absl/types/optional.h" -#include +#include #include #include diff --git a/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc b/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc index b1b39dae5e7f6..fe22f3b926368 100644 --- a/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +++ b/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc @@ -35,7 +35,7 @@ #include "absl/types/optional.h" #include -#include +#include #include #include diff --git a/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc b/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc index f5767e4679fdf..6cc1a948b3447 100644 --- a/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +++ b/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc @@ -37,10 +37,11 @@ #include "absl/strings/string_view.h" #include "absl/types/optional.h" +#include + #define XXH_INLINE_ALL #include "xxhash.h" -#include #include #include diff --git a/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc b/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc index de19ba71a51ac..7a23aa8308440 100644 --- a/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +++ b/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h index 87072c7381c6d..4acd432d7eb59 100644 --- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h @@ -30,7 +30,7 @@ #include "absl/status/status.h" #include "absl/types/optional.h" -#include +#include #include #include diff --git a/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc b/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc index b4db0dbec1428..ca487ad5dc576 100644 --- a/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +++ b/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc @@ -35,7 +35,7 @@ #include "absl/strings/string_view.h" #include "absl/types/optional.h" -#include +#include #include #include #include diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc index 1f609a8e2f04b..47706e2cbb84f 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc @@ -33,7 +33,7 @@ #include "absl/strings/strip.h" #include "absl/types/optional.h" -#include +#include #include #include diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc index f8278cc6fc2dc..a088c114585b8 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc @@ -24,7 +24,7 @@ #include "absl/strings/string_view.h" -#include +#include #include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/iomgr/sockaddr.h" diff --git a/src/core/ext/filters/client_channel/resolver/dns/event_engine/event_engine_client_channel_resolver.cc b/src/core/ext/filters/client_channel/resolver/dns/event_engine/event_engine_client_channel_resolver.cc index b2b03cf5a4037..8d5566677ae0a 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/event_engine/event_engine_client_channel_resolver.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/event_engine/event_engine_client_channel_resolver.cc @@ -35,7 +35,7 @@ #include "absl/types/optional.h" #include -#include +#include #include #include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h" diff --git a/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc b/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc index 019ce8706a883..4de874fccc108 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc @@ -30,7 +30,7 @@ #include "absl/strings/strip.h" #include "absl/types/optional.h" -#include +#include #include #include "src/core/ext/filters/client_channel/resolver/polling_resolver.h" diff --git a/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc b/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc index 43af7b0adec40..04b76b7f73153 100644 --- a/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +++ b/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc @@ -44,7 +44,7 @@ #include "absl/types/variant.h" #include "re2/re2.h" -#include +#include #include "src/core/lib/slice/slice.h" diff --git a/src/core/ext/filters/client_channel/retry_filter.h b/src/core/ext/filters/client_channel/retry_filter.h index fbaf6ce336f65..c5d713f5fa95b 100644 --- a/src/core/ext/filters/client_channel/retry_filter.h +++ b/src/core/ext/filters/client_channel/retry_filter.h @@ -28,6 +28,7 @@ #include #include +#include #include #include "src/core/ext/filters/client_channel/client_channel.h" diff --git a/src/core/ext/filters/client_channel/retry_service_config.cc b/src/core/ext/filters/client_channel/retry_service_config.cc index 9743d00014229..db8ee91579162 100644 --- a/src/core/ext/filters/client_channel/retry_service_config.cc +++ b/src/core/ext/filters/client_channel/retry_service_config.cc @@ -27,7 +27,7 @@ #include "absl/strings/str_cat.h" #include "absl/types/optional.h" -#include +#include #include #include #include diff --git a/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc b/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc index 81ef16ee58f31..077e69f857964 100644 --- a/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +++ b/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc @@ -28,7 +28,7 @@ #include "absl/status/statusor.h" #include "absl/types/optional.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/src/core/ext/filters/client_channel/subchannel.cc b/src/core/ext/filters/client_channel/subchannel.cc index 3f7599e9a3657..85da64014fa7e 100644 --- a/src/core/ext/filters/client_channel/subchannel.cc +++ b/src/core/ext/filters/client_channel/subchannel.cc @@ -33,7 +33,7 @@ #include "absl/strings/string_view.h" #include "absl/types/optional.h" -#include +#include #include #include #include diff --git a/src/core/ext/filters/deadline/deadline_filter.cc b/src/core/ext/filters/deadline/deadline_filter.cc index bd2f290ca7339..4562e45c61282 100644 --- a/src/core/ext/filters/deadline/deadline_filter.cc +++ b/src/core/ext/filters/deadline/deadline_filter.cc @@ -26,7 +26,7 @@ #include "absl/status/status.h" #include "absl/types/optional.h" -#include +#include #include #include diff --git a/src/core/ext/filters/http/client/http_client_filter.cc b/src/core/ext/filters/http/client/http_client_filter.cc index 89ff0356ccebf..6ed05d9518651 100644 --- a/src/core/ext/filters/http/client/http_client_filter.cc +++ b/src/core/ext/filters/http/client/http_client_filter.cc @@ -35,6 +35,7 @@ #include "absl/types/optional.h" #include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/src/core/ext/filters/http/client_authority_filter.cc b/src/core/ext/filters/http/client_authority_filter.cc index 9e15fa18da609..6350788b40325 100644 --- a/src/core/ext/filters/http/client_authority_filter.cc +++ b/src/core/ext/filters/http/client_authority_filter.cc @@ -29,7 +29,7 @@ #include "absl/strings/string_view.h" #include "absl/types/optional.h" -#include +#include #include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/channel/channel_stack_builder.h" diff --git a/src/core/ext/filters/http/message_compress/compression_filter.cc b/src/core/ext/filters/http/message_compress/compression_filter.cc index 26868c51ef1f7..2fefd04bb66cb 100644 --- a/src/core/ext/filters/http/message_compress/compression_filter.cc +++ b/src/core/ext/filters/http/message_compress/compression_filter.cc @@ -32,6 +32,7 @@ #include #include +#include #include #include diff --git a/src/core/ext/filters/http/server/http_server_filter.cc b/src/core/ext/filters/http/server/http_server_filter.cc index 8ec0e54df0b0b..6b7648ddb881c 100644 --- a/src/core/ext/filters/http/server/http_server_filter.cc +++ b/src/core/ext/filters/http/server/http_server_filter.cc @@ -30,7 +30,7 @@ #include "absl/status/status.h" #include "absl/types/optional.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc b/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc index 29d2a2cf6a491..77575cddf1f63 100644 --- a/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc +++ b/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc @@ -40,8 +40,8 @@ #include "opencensus/stats/stats.h" #include "opencensus/tags/tag_key.h" -#include #include +#include #include #include #include diff --git a/src/core/ext/filters/logging/logging_filter.cc b/src/core/ext/filters/logging/logging_filter.cc index 37e5450bb0841..561e4718ab352 100644 --- a/src/core/ext/filters/logging/logging_filter.cc +++ b/src/core/ext/filters/logging/logging_filter.cc @@ -43,7 +43,7 @@ #include "absl/strings/strip.h" #include "absl/types/optional.h" -#include +#include #include #include #include diff --git a/src/core/ext/filters/message_size/message_size_filter.cc b/src/core/ext/filters/message_size/message_size_filter.cc index 6143239c0c0ca..be5505cf05ab9 100644 --- a/src/core/ext/filters/message_size/message_size_filter.cc +++ b/src/core/ext/filters/message_size/message_size_filter.cc @@ -28,6 +28,7 @@ #include "absl/strings/str_format.h" #include +#include #include #include diff --git a/src/core/ext/transport/chttp2/client/chttp2_connector.cc b/src/core/ext/transport/chttp2/client/chttp2_connector.cc index f4e716c9265e7..e720ce52ddbbe 100644 --- a/src/core/ext/transport/chttp2/client/chttp2_connector.cc +++ b/src/core/ext/transport/chttp2/client/chttp2_connector.cc @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include diff --git a/src/core/ext/transport/chttp2/server/chttp2_server.cc b/src/core/ext/transport/chttp2/server/chttp2_server.cc index 7b4143bfb548b..a4718fc769a50 100644 --- a/src/core/ext/transport/chttp2/server/chttp2_server.cc +++ b/src/core/ext/transport/chttp2/server/chttp2_server.cc @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index fb1903a256cf3..06f9d90478d07 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -44,6 +44,7 @@ #include #include +#include #include #include #include @@ -61,6 +62,8 @@ #include "src/core/ext/transport/chttp2/transport/http2_settings.h" #include "src/core/ext/transport/chttp2/transport/http_trace.h" #include "src/core/ext/transport/chttp2/transport/internal.h" +#include "src/core/ext/transport/chttp2/transport/ping_abuse_policy.h" +#include "src/core/ext/transport/chttp2/transport/ping_rate_policy.h" #include "src/core/ext/transport/chttp2/transport/varint.h" #include "src/core/lib/channel/call_tracer.h" #include "src/core/lib/channel/channel_args.h" @@ -123,11 +126,6 @@ static grpc_core::Duration g_default_server_keepalive_timeout = static bool g_default_client_keepalive_permit_without_calls = false; static bool g_default_server_keepalive_permit_without_calls = false; -static grpc_core::Duration g_default_min_recv_ping_interval_without_data = - grpc_core::Duration::Minutes(5); -static int g_default_max_pings_without_data = 2; -static int g_default_max_ping_strikes = 2; - #define MAX_CLIENT_STREAM_ID 0x7fffffffu grpc_core::TraceFlag grpc_keepalive_trace(false, "http_keepalive"); grpc_core::DebugOnlyTraceFlag grpc_trace_chttp2_refcount(false, @@ -346,18 +344,6 @@ static void read_channel_args(grpc_chttp2_transport* t, t->hpack_compressor.SetMaxUsableSize(max_hpack_table_size); } - t->ping_policy.max_pings_without_data = - std::max(0, channel_args.GetInt(GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA) - .value_or(g_default_max_pings_without_data)); - t->ping_policy.max_ping_strikes = - std::max(0, channel_args.GetInt(GRPC_ARG_HTTP2_MAX_PING_STRIKES) - .value_or(g_default_max_ping_strikes)); - t->ping_policy.min_recv_ping_interval_without_data = - std::max(grpc_core::Duration::Zero(), - channel_args - .GetDurationFromIntMillis( - GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS) - .value_or(g_default_min_recv_ping_interval_without_data)); t->write_buffer_size = std::max(0, channel_args.GetInt(GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE) .value_or(grpc_core::chttp2::kDefaultWindow)); @@ -546,6 +532,8 @@ grpc_chttp2_transport::grpc_chttp2_transport( GRPC_CHANNEL_READY), is_client(is_client), next_stream_id(is_client ? 1 : 2), + ping_abuse_policy(channel_args), + ping_rate_policy(channel_args, is_client), flow_control( peer_string.as_string_view(), channel_args.GetBool(GRPC_ARG_HTTP2_BDP_PROBE).value_or(true), @@ -588,13 +576,6 @@ grpc_chttp2_transport::grpc_chttp2_transport( read_channel_args(this, channel_args, is_client); - // No pings allowed before receiving a header or data frame. - ping_state.pings_before_data_required = 0; - ping_state.last_ping_sent_time = grpc_core::Timestamp::InfPast(); - - ping_recv_state.last_ping_recv_time = grpc_core::Timestamp::InfPast(); - ping_recv_state.ping_strikes = 0; - grpc_core::ExecCtx exec_ctx; combiner->Run( GRPC_CLOSURE_INIT(&init_keepalive_ping_locked, @@ -663,10 +644,10 @@ static void close_transport_locked(grpc_chttp2_transport* t, t->closed_with_error = error; connectivity_state_set(t, GRPC_CHANNEL_SHUTDOWN, absl::Status(), "close_transport"); - if (t->ping_state.delayed_ping_timer_handle.has_value()) { - if (t->event_engine->Cancel(*t->ping_state.delayed_ping_timer_handle)) { + if (t->delayed_ping_timer_handle.has_value()) { + if (t->event_engine->Cancel(*t->delayed_ping_timer_handle)) { GRPC_CHTTP2_UNREF_TRANSPORT(t, "retry_initiate_ping_locked"); - t->ping_state.delayed_ping_timer_handle.reset(); + t->delayed_ping_timer_handle.reset(); } } if (t->next_bdp_ping_timer_handle.has_value()) { @@ -1673,8 +1654,8 @@ static void retry_initiate_ping_locked(void* tp, GRPC_UNUSED grpc_error_handle error) { GPR_DEBUG_ASSERT(error.ok()); grpc_chttp2_transport* t = static_cast(tp); - GPR_ASSERT(t->ping_state.delayed_ping_timer_handle.has_value()); - t->ping_state.delayed_ping_timer_handle.reset(); + GPR_ASSERT(t->delayed_ping_timer_handle.has_value()); + t->delayed_ping_timer_handle.reset(); grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_RETRY_SEND_PING); GRPC_CHTTP2_UNREF_TRANSPORT(t, "retry_initiate_ping_locked"); } @@ -1825,29 +1806,24 @@ static void send_goaway(grpc_chttp2_transport* t, grpc_error_handle error, grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_GOAWAY_SENT); } -void grpc_chttp2_add_ping_strike(grpc_chttp2_transport* t) { - if (++t->ping_recv_state.ping_strikes > t->ping_policy.max_ping_strikes && - t->ping_policy.max_ping_strikes != 0) { - send_goaway(t, - grpc_error_set_int(GRPC_ERROR_CREATE("too_many_pings"), - grpc_core::StatusIntProperty::kHttp2Error, - GRPC_HTTP2_ENHANCE_YOUR_CALM), - /*immediate_disconnect_hint=*/true); - // The transport will be closed after the write is done - close_transport_locked( - t, grpc_error_set_int(GRPC_ERROR_CREATE("Too many pings"), - grpc_core::StatusIntProperty::kRpcStatus, - GRPC_STATUS_UNAVAILABLE)); - } +void grpc_chttp2_exceeded_ping_strikes(grpc_chttp2_transport* t) { + send_goaway(t, + grpc_error_set_int(GRPC_ERROR_CREATE("too_many_pings"), + grpc_core::StatusIntProperty::kHttp2Error, + GRPC_HTTP2_ENHANCE_YOUR_CALM), + /*immediate_disconnect_hint=*/true); + // The transport will be closed after the write is done + close_transport_locked( + t, grpc_error_set_int(GRPC_ERROR_CREATE("Too many pings"), + grpc_core::StatusIntProperty::kRpcStatus, + GRPC_STATUS_UNAVAILABLE)); } void grpc_chttp2_reset_ping_clock(grpc_chttp2_transport* t) { if (!t->is_client) { - t->ping_recv_state.last_ping_recv_time = grpc_core::Timestamp::InfPast(); - t->ping_recv_state.ping_strikes = 0; + t->ping_abuse_policy.ResetPingStrikes(); } - t->ping_state.pings_before_data_required = - t->ping_policy.max_pings_without_data; + t->ping_rate_policy.ResetPingsBeforeDataRequired(); } static void perform_transport_op_locked(void* stream_op, @@ -2736,20 +2712,8 @@ void grpc_chttp2_config_default_keepalive_args( keepalive_permit_without_calls; } - g_default_max_ping_strikes = - std::max(0, channel_args.GetInt(GRPC_ARG_HTTP2_MAX_PING_STRIKES) - .value_or(g_default_max_ping_strikes)); - - g_default_max_pings_without_data = - std::max(0, channel_args.GetInt(GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA) - .value_or(g_default_max_pings_without_data)); - - g_default_min_recv_ping_interval_without_data = - std::max(grpc_core::Duration::Zero(), - channel_args - .GetDurationFromIntMillis( - GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS) - .value_or(g_default_min_recv_ping_interval_without_data)); + grpc_core::Chttp2PingAbusePolicy::SetDefaults(channel_args); + grpc_core::Chttp2PingRatePolicy::SetDefaults(channel_args); } static void init_keepalive_ping(grpc_chttp2_transport* t) { diff --git a/src/core/ext/transport/chttp2/transport/frame_ping.cc b/src/core/ext/transport/chttp2/transport/frame_ping.cc index 8cf45a59dcf1a..18a73a3cab27a 100644 --- a/src/core/ext/transport/chttp2/transport/frame_ping.cc +++ b/src/core/ext/transport/chttp2/transport/frame_ping.cc @@ -33,7 +33,7 @@ #include #include "src/core/ext/transport/chttp2/transport/internal.h" -#include "src/core/lib/gprpp/time.h" +#include "src/core/ext/transport/chttp2/transport/ping_abuse_policy.h" grpc_slice grpc_chttp2_ping_create(uint8_t ack, uint64_t opaque_8bytes) { grpc_slice slice = GRPC_SLICE_MALLOC(9 + 8); @@ -94,24 +94,11 @@ grpc_error_handle grpc_chttp2_ping_parser_parse(void* parser, grpc_chttp2_ack_ping(t, p->opaque_8bytes); } else { if (!t->is_client) { - grpc_core::Timestamp now = grpc_core::Timestamp::Now(); - grpc_core::Timestamp next_allowed_ping = - t->ping_recv_state.last_ping_recv_time + - t->ping_policy.min_recv_ping_interval_without_data; - - if (t->keepalive_permit_without_calls == 0 && t->stream_map.empty()) { - // According to RFC1122, the interval of TCP Keep-Alive is default to - // no less than two hours. When there is no outstanding streams, we - // restrict the number of PINGS equivalent to TCP Keep-Alive. - next_allowed_ping = t->ping_recv_state.last_ping_recv_time + - grpc_core::Duration::Hours(2); - } - - if (next_allowed_ping > now) { - grpc_chttp2_add_ping_strike(t); + const bool transport_idle = + t->keepalive_permit_without_calls == 0 && t->stream_map.empty(); + if (t->ping_abuse_policy.ReceivedOnePing(transport_idle)) { + grpc_chttp2_exceeded_ping_strikes(t); } - - t->ping_recv_state.last_ping_recv_time = now; } if (t->ack_pings) { if (t->ping_ack_count == t->ping_ack_capacity) { diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h index 479c7518e2e46..807a105ebda4f 100644 --- a/src/core/ext/transport/chttp2/transport/internal.h +++ b/src/core/ext/transport/chttp2/transport/internal.h @@ -48,6 +48,8 @@ #include "src/core/ext/transport/chttp2/transport/hpack_encoder.h" #include "src/core/ext/transport/chttp2/transport/hpack_parser.h" #include "src/core/ext/transport/chttp2/transport/http2_settings.h" +#include "src/core/ext/transport/chttp2/transport/ping_abuse_policy.h" +#include "src/core/ext/transport/chttp2/transport/ping_rate_policy.h" #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channelz.h" #include "src/core/lib/debug/trace.h" @@ -146,21 +148,14 @@ struct grpc_chttp2_ping_queue { grpc_closure_list lists[GRPC_CHTTP2_PCL_COUNT] = {}; uint64_t inflight_id = 0; }; -struct grpc_chttp2_repeated_ping_policy { - int max_pings_without_data; - int max_ping_strikes; - grpc_core::Duration min_recv_ping_interval_without_data; -}; + struct grpc_chttp2_repeated_ping_state { grpc_core::Timestamp last_ping_sent_time; int pings_before_data_required; absl::optional delayed_ping_timer_handle; }; -struct grpc_chttp2_server_ping_recv_state { - grpc_core::Timestamp last_ping_recv_time; - int ping_strikes; -}; + // deframer state for the overall http2 stream of bytes typedef enum { // prefix: one entry per http2 connection prefix byte @@ -343,8 +338,10 @@ struct grpc_chttp2_transport : public grpc_core::KeepsGrpcInitialized { /// ping queues for various ping insertion points grpc_chttp2_ping_queue ping_queue = grpc_chttp2_ping_queue(); - grpc_chttp2_repeated_ping_policy ping_policy; - grpc_chttp2_repeated_ping_state ping_state; + grpc_core::Chttp2PingAbusePolicy ping_abuse_policy; + grpc_core::Chttp2PingRatePolicy ping_rate_policy; + absl::optional + delayed_ping_timer_handle; uint64_t ping_ctr = 0; // unique id for pings grpc_closure retry_initiate_ping_locked; @@ -352,7 +349,6 @@ struct grpc_chttp2_transport : public grpc_core::KeepsGrpcInitialized { size_t ping_ack_count = 0; size_t ping_ack_capacity = 0; uint64_t* ping_acks = nullptr; - grpc_chttp2_server_ping_recv_state ping_recv_state; /// parser for headers grpc_core::HPackParser hpack_parser; @@ -772,11 +768,9 @@ inline void grpc_chttp2_ref_transport(grpc_chttp2_transport* t) { void grpc_chttp2_ack_ping(grpc_chttp2_transport* t, uint64_t id); -/// Add a new ping strike to ping_recv_state.ping_strikes. If -/// ping_recv_state.ping_strikes > ping_policy.max_ping_strikes, it sends GOAWAY -/// with error code ENHANCE_YOUR_CALM and additional debug data resembling -/// "too_many_pings" followed by immediately closing the connection. -void grpc_chttp2_add_ping_strike(grpc_chttp2_transport* t); +/// Sends GOAWAY with error code ENHANCE_YOUR_CALM and additional debug data +/// resembling "too_many_pings" followed by immediately closing the connection. +void grpc_chttp2_exceeded_ping_strikes(grpc_chttp2_transport* t); /// Resets ping clock. Should be called when flushing window updates, /// initial/trailing metadata or data frames. For a server, it resets the number diff --git a/src/core/ext/transport/chttp2/transport/parsing.cc b/src/core/ext/transport/chttp2/transport/parsing.cc index 9fd946297216d..f5ed79108e94d 100644 --- a/src/core/ext/transport/chttp2/transport/parsing.cc +++ b/src/core/ext/transport/chttp2/transport/parsing.cc @@ -47,11 +47,11 @@ #include "src/core/ext/transport/chttp2/transport/http2_settings.h" #include "src/core/ext/transport/chttp2/transport/http_trace.h" #include "src/core/ext/transport/chttp2/transport/internal.h" +#include "src/core/ext/transport/chttp2/transport/ping_rate_policy.h" #include "src/core/lib/channel/channelz.h" #include "src/core/lib/debug/trace.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/status_helper.h" -#include "src/core/lib/gprpp/time.h" #include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/combiner.h" #include "src/core/lib/iomgr/endpoint.h" @@ -549,7 +549,7 @@ static grpc_error_handle init_data_frame_parser(grpc_chttp2_transport* t) { t->incoming_stream = s; t->parser = grpc_chttp2_transport::Parser{ "data", grpc_chttp2_data_parser_parse, nullptr}; - t->ping_state.last_ping_sent_time = grpc_core::Timestamp::InfPast(); + t->ping_rate_policy.ReceivedDataFrame(); return absl::OkStatus(); } else if (s != nullptr) { // handle stream errors by closing the stream @@ -588,7 +588,7 @@ static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t, ? HPackParser::Priority::Included : HPackParser::Priority::None; - t->ping_state.last_ping_sent_time = grpc_core::Timestamp::InfPast(); + t->ping_rate_policy.ReceivedDataFrame(); // could be a new grpc_chttp2_stream or an existing grpc_chttp2_stream s = grpc_chttp2_parsing_lookup_stream(t, t->incoming_stream_id); diff --git a/src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc b/src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc new file mode 100644 index 0000000000000..1ace22dd9a8f0 --- /dev/null +++ b/src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc @@ -0,0 +1,80 @@ +// Copyright 2023 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include "src/core/ext/transport/chttp2/transport/ping_abuse_policy.h" + +#include + +#include "absl/types/optional.h" + +#include + +namespace grpc_core { + +namespace { +Duration g_default_min_recv_ping_interval_without_data = Duration::Minutes(5); +int g_default_max_ping_strikes = 2; +} // namespace + +Chttp2PingAbusePolicy::Chttp2PingAbusePolicy(const ChannelArgs& args) + : min_recv_ping_interval_without_data_(std::max( + Duration::Zero(), + args.GetDurationFromIntMillis( + GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS) + .value_or(g_default_min_recv_ping_interval_without_data))), + max_ping_strikes_( + std::max(0, args.GetInt(GRPC_ARG_HTTP2_MAX_PING_STRIKES) + .value_or(g_default_max_ping_strikes))) {} + +void Chttp2PingAbusePolicy::SetDefaults(const ChannelArgs& args) { + g_default_max_ping_strikes = + std::max(0, args.GetInt(GRPC_ARG_HTTP2_MAX_PING_STRIKES) + .value_or(g_default_max_ping_strikes)); + g_default_min_recv_ping_interval_without_data = + std::max(Duration::Zero(), + args.GetDurationFromIntMillis( + GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS) + .value_or(g_default_min_recv_ping_interval_without_data)); +} + +bool Chttp2PingAbusePolicy::ReceivedOnePing(bool transport_idle) { + const Timestamp now = Timestamp::Now(); + const Timestamp next_allowed_ping = + last_ping_recv_time_ + RecvPingIntervalWithoutData(transport_idle); + last_ping_recv_time_ = now; + if (next_allowed_ping <= now) return false; + // Received ping too soon: increment strike count. + ++ping_strikes_; + return ping_strikes_ > max_ping_strikes_ && max_ping_strikes_ != 0; +} + +Duration Chttp2PingAbusePolicy::RecvPingIntervalWithoutData( + bool transport_idle) const { + if (transport_idle) { + // According to RFC1122, the interval of TCP Keep-Alive is default to + // no less than two hours. When there is no outstanding streams, we + // restrict the number of PINGS equivalent to TCP Keep-Alive. + return Duration::Hours(2); + } + return min_recv_ping_interval_without_data_; +} + +void Chttp2PingAbusePolicy::ResetPingStrikes() { + last_ping_recv_time_ = Timestamp::InfPast(); + ping_strikes_ = 0; +} + +} // namespace grpc_core diff --git a/src/core/ext/transport/chttp2/transport/ping_abuse_policy.h b/src/core/ext/transport/chttp2/transport/ping_abuse_policy.h new file mode 100644 index 0000000000000..adc5cb7969920 --- /dev/null +++ b/src/core/ext/transport/chttp2/transport/ping_abuse_policy.h @@ -0,0 +1,55 @@ +// Copyright 2023 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_PING_ABUSE_POLICY_H +#define GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_PING_ABUSE_POLICY_H + +#include + +#include "src/core/lib/channel/channel_args.h" +#include "src/core/lib/gprpp/time.h" + +namespace grpc_core { + +class Chttp2PingAbusePolicy { + public: + explicit Chttp2PingAbusePolicy(const ChannelArgs& args); + + static void SetDefaults(const ChannelArgs& args); + + // Record one received ping; returns true if the connection should be closed. + // If transport_idle is true, we increase the allowed time between pings up to + // TCP keep-alive check time. + GRPC_MUST_USE_RESULT bool ReceivedOnePing(bool transport_idle); + + // Reset the ping clock, strike count. + void ResetPingStrikes(); + + int TestOnlyMaxPingStrikes() const { return max_ping_strikes_; } + Duration TestOnlyMinPingIntervalWithoutData() const { + return min_recv_ping_interval_without_data_; + } + + private: + Duration RecvPingIntervalWithoutData(bool transport_idle) const; + + Timestamp last_ping_recv_time_ = Timestamp::InfPast(); + const Duration min_recv_ping_interval_without_data_; + int ping_strikes_ = 0; + const int max_ping_strikes_; +}; + +} // namespace grpc_core + +#endif // GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_PING_ABUSE_POLICY_H diff --git a/src/core/ext/transport/chttp2/transport/ping_rate_policy.cc b/src/core/ext/transport/chttp2/transport/ping_rate_policy.cc new file mode 100644 index 0000000000000..51b7b38d578d1 --- /dev/null +++ b/src/core/ext/transport/chttp2/transport/ping_rate_policy.cc @@ -0,0 +1,98 @@ +// Copyright 2023 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include "src/core/ext/transport/chttp2/transport/ping_rate_policy.h" + +#include +#include +#include + +#include "absl/strings/str_cat.h" +#include "absl/types/optional.h" + +#include + +#include "src/core/lib/gprpp/match.h" + +namespace grpc_core { + +namespace { +int g_default_max_pings_without_data = 2; +} // namespace + +Chttp2PingRatePolicy::Chttp2PingRatePolicy(const ChannelArgs& args, + bool is_client) + : max_pings_without_data_( + is_client + ? std::max(0, args.GetInt(GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA) + .value_or(g_default_max_pings_without_data)) + : 0) {} + +void Chttp2PingRatePolicy::SetDefaults(const ChannelArgs& args) { + g_default_max_pings_without_data = + std::max(0, args.GetInt(GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA) + .value_or(g_default_max_pings_without_data)); +} + +Chttp2PingRatePolicy::RequestSendPingResult +Chttp2PingRatePolicy::RequestSendPing(Duration next_allowed_ping_interval) { + if (max_pings_without_data_ != 0 && pings_before_data_required_ == 0) { + return TooManyRecentPings{}; + } + const Timestamp next_allowed_ping = + last_ping_sent_time_ + next_allowed_ping_interval; + const Timestamp now = Timestamp::Now(); + if (next_allowed_ping > now) { + return TooSoon{next_allowed_ping_interval, last_ping_sent_time_, + next_allowed_ping - now}; + } + last_ping_sent_time_ = now; + if (pings_before_data_required_) --pings_before_data_required_; + return SendGranted{}; +} + +void Chttp2PingRatePolicy::ReceivedDataFrame() { + last_ping_sent_time_ = Timestamp::InfPast(); +} + +void Chttp2PingRatePolicy::ResetPingsBeforeDataRequired() { + pings_before_data_required_ = max_pings_without_data_; +} + +std::string Chttp2PingRatePolicy::GetDebugString() const { + return absl::StrCat( + "max_pings_without_data: ", max_pings_without_data_, + ", pings_before_data_required: ", pings_before_data_required_, + ", last_ping_sent_time_: ", last_ping_sent_time_.ToString()); +} + +std::ostream& operator<<(std::ostream& out, + const Chttp2PingRatePolicy::RequestSendPingResult& r) { + Match( + r, [&out](Chttp2PingRatePolicy::SendGranted) { out << "SendGranted"; }, + [&out](Chttp2PingRatePolicy::TooManyRecentPings) { + out << "TooManyRecentPings"; + }, + [&out](Chttp2PingRatePolicy::TooSoon r) { + out << "TooSoon: next_allowed=" + << r.next_allowed_ping_interval.ToString() + << " last_ping_sent_time=" << r.last_ping.ToString() + << " wait=" << r.wait.ToString(); + }); + return out; +} + +} // namespace grpc_core diff --git a/src/core/ext/transport/chttp2/transport/ping_rate_policy.h b/src/core/ext/transport/chttp2/transport/ping_rate_policy.h new file mode 100644 index 0000000000000..7363259fb8b1e --- /dev/null +++ b/src/core/ext/transport/chttp2/transport/ping_rate_policy.h @@ -0,0 +1,73 @@ +// Copyright 2023 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_PING_RATE_POLICY_H +#define GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_PING_RATE_POLICY_H + +#include + +#include +#include + +#include "absl/types/variant.h" + +#include "src/core/lib/channel/channel_args.h" +#include "src/core/lib/gprpp/time.h" + +namespace grpc_core { + +class Chttp2PingRatePolicy { + public: + explicit Chttp2PingRatePolicy(const ChannelArgs& args, bool is_client); + + static void SetDefaults(const ChannelArgs& args); + + struct SendGranted { + bool operator==(const SendGranted&) const { return true; } + }; + struct TooManyRecentPings { + bool operator==(const TooManyRecentPings&) const { return true; } + }; + struct TooSoon { + Duration next_allowed_ping_interval; + Timestamp last_ping; + Duration wait; + bool operator==(const TooSoon& other) const { + return next_allowed_ping_interval == other.next_allowed_ping_interval && + last_ping == other.last_ping && wait == other.wait; + } + }; + using RequestSendPingResult = + absl::variant; + + RequestSendPingResult RequestSendPing(Duration next_allowed_ping_interval); + void ResetPingsBeforeDataRequired(); + void ReceivedDataFrame(); + std::string GetDebugString() const; + + int TestOnlyMaxPingsWithoutData() const { return max_pings_without_data_; } + + private: + const int max_pings_without_data_; + // No pings allowed before receiving a header or data frame. + int pings_before_data_required_ = 0; + Timestamp last_ping_sent_time_ = Timestamp::InfPast(); +}; + +std::ostream& operator<<(std::ostream& out, + const Chttp2PingRatePolicy::RequestSendPingResult& r); + +} // namespace grpc_core + +#endif // GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_PING_RATE_POLICY_H diff --git a/src/core/ext/transport/chttp2/transport/writing.cc b/src/core/ext/transport/chttp2/transport/writing.cc index f24c852d73a6c..e949f410246e2 100644 --- a/src/core/ext/transport/chttp2/transport/writing.cc +++ b/src/core/ext/transport/chttp2/transport/writing.cc @@ -24,6 +24,7 @@ #include #include #include +#include #include "absl/container/flat_hash_map.h" #include "absl/status/status.h" @@ -35,10 +36,6 @@ #include #include -#include "src/core/ext/transport/chttp2/transport/http_trace.h" - -// IWYU pragma: no_include "src/core/lib/gprpp/orphanable.h" - #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/ext/transport/chttp2/transport/context_list_entry.h" #include "src/core/ext/transport/chttp2/transport/flow_control.h" @@ -50,12 +47,15 @@ #include "src/core/ext/transport/chttp2/transport/frame_window_update.h" #include "src/core/ext/transport/chttp2/transport/hpack_encoder.h" #include "src/core/ext/transport/chttp2/transport/http2_settings.h" +#include "src/core/ext/transport/chttp2/transport/http_trace.h" #include "src/core/ext/transport/chttp2/transport/internal.h" +#include "src/core/ext/transport/chttp2/transport/ping_rate_policy.h" #include "src/core/lib/channel/channelz.h" #include "src/core/lib/debug/stats.h" #include "src/core/lib/debug/stats_data.h" #include "src/core/lib/debug/trace.h" #include "src/core/lib/gprpp/debug_location.h" +#include "src/core/lib/gprpp/match.h" #include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/time.h" @@ -69,6 +69,8 @@ #include "src/core/lib/transport/metadata_batch.h" #include "src/core/lib/transport/transport.h" +// IWYU pragma: no_include "src/core/lib/gprpp/orphanable.h" + static void add_to_write_list(grpc_chttp2_write_cb** list, grpc_chttp2_write_cb* cb) { cb->next = *list; @@ -83,6 +85,25 @@ static void finish_write_cb(grpc_chttp2_transport* t, grpc_chttp2_stream* s, t->write_cb_pool = cb; } +static grpc_core::Duration NextAllowedPingInterval(grpc_chttp2_transport* t) { + if (t->is_client) { + return (t->keepalive_permit_without_calls == 0 && t->stream_map.empty()) + ? grpc_core::Duration::Hours(2) + : grpc_core::Duration::Seconds( + 1); // A second is added to deal with + // network delays and timing imprecision + } + if (t->sent_goaway_state != GRPC_CHTTP2_GRACEFUL_GOAWAY) { + // The gRPC keepalive spec doesn't call for any throttling on the server + // side, but we are adding some throttling for protection anyway, unless + // we are doing a graceful GOAWAY in which case we don't want to wait. + return t->keepalive_time == grpc_core::Duration::Infinity() + ? grpc_core::Duration::Seconds(20) + : t->keepalive_time / 2; + } + return grpc_core::Duration::Zero(); +} + static void maybe_initiate_ping(grpc_chttp2_transport* t) { grpc_chttp2_ping_queue* pq = &t->ping_queue; if (grpc_closure_list_empty(pq->lists[GRPC_CHTTP2_PCL_NEXT])) { @@ -100,95 +121,67 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) { } return; } - if (t->is_client && t->ping_state.pings_before_data_required == 0 && - t->ping_policy.max_pings_without_data != 0) { - // need to receive something of substance before sending a ping again - if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || - GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace) || - GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) { - gpr_log(GPR_INFO, - "CLIENT: Ping delayed [%s]: too many recent pings: %d/%d", - std::string(t->peer_string.as_string_view()).c_str(), - t->ping_state.pings_before_data_required, - t->ping_policy.max_pings_without_data); - } - return; - } // InvalidateNow to avoid getting stuck re-initializing the ping timer // in a loop while draining the currently-held combiner. Also see // https://github.com/grpc/grpc/issues/26079. grpc_core::ExecCtx::Get()->InvalidateNow(); - grpc_core::Timestamp now = grpc_core::Timestamp::Now(); - - grpc_core::Duration next_allowed_ping_interval = grpc_core::Duration::Zero(); - if (t->is_client) { - next_allowed_ping_interval = - (t->keepalive_permit_without_calls == 0 && t->stream_map.empty()) - ? grpc_core::Duration::Hours(2) - : grpc_core::Duration::Seconds( - 1); // A second is added to deal with - // network delays and timing imprecision - } else if (t->sent_goaway_state != GRPC_CHTTP2_GRACEFUL_GOAWAY) { - // The gRPC keepalive spec doesn't call for any throttling on the server - // side, but we are adding some throttling for protection anyway, unless - // we are doing a graceful GOAWAY in which case we don't want to wait. - next_allowed_ping_interval = - t->keepalive_time == grpc_core::Duration::Infinity() - ? grpc_core::Duration::Seconds(20) - : t->keepalive_time / 2; - } - grpc_core::Timestamp next_allowed_ping = - t->ping_state.last_ping_sent_time + next_allowed_ping_interval; - - if (next_allowed_ping > now) { - // not enough elapsed time between successive pings - if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || - GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace) || - GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) { - gpr_log( - GPR_INFO, - "%s: Ping delayed [%s]: not enough time elapsed since last " - "ping. " - " Last ping %" PRId64 ": Next ping %" PRId64 ": Now %" PRId64, - t->is_client ? "CLIENT" : "SERVER", - std::string(t->peer_string.as_string_view()).c_str(), - t->ping_state.last_ping_sent_time.milliseconds_after_process_epoch(), - next_allowed_ping.milliseconds_after_process_epoch(), - now.milliseconds_after_process_epoch()); - } - if (!t->ping_state.delayed_ping_timer_handle.has_value()) { - GRPC_CHTTP2_REF_TRANSPORT(t, "retry_initiate_ping_locked"); - t->ping_state.delayed_ping_timer_handle = - t->event_engine->RunAfter(next_allowed_ping - now, [t] { - grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; - grpc_core::ExecCtx exec_ctx; - grpc_chttp2_retry_initiate_ping(t); - }); - } - return; - } - t->ping_state.last_ping_sent_time = now; - - pq->inflight_id = t->ping_ctr; - t->ping_ctr++; - grpc_core::ExecCtx::RunList(DEBUG_LOCATION, - &pq->lists[GRPC_CHTTP2_PCL_INITIATE]); - grpc_closure_list_move(&pq->lists[GRPC_CHTTP2_PCL_NEXT], - &pq->lists[GRPC_CHTTP2_PCL_INFLIGHT]); - grpc_slice_buffer_add(&t->outbuf, - grpc_chttp2_ping_create(false, pq->inflight_id)); - grpc_core::global_stats().IncrementHttp2PingsSent(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || - GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace) || - GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) { - gpr_log(GPR_INFO, "%s: Ping sent [%s]: %d/%d", - t->is_client ? "CLIENT" : "SERVER", - std::string(t->peer_string.as_string_view()).c_str(), - t->ping_state.pings_before_data_required, - t->ping_policy.max_pings_without_data); - } - t->ping_state.pings_before_data_required -= - (t->ping_state.pings_before_data_required != 0); + Match( + t->ping_rate_policy.RequestSendPing(NextAllowedPingInterval(t)), + [pq, t](grpc_core::Chttp2PingRatePolicy::SendGranted) { + pq->inflight_id = t->ping_ctr; + t->ping_ctr++; + grpc_core::ExecCtx::RunList(DEBUG_LOCATION, + &pq->lists[GRPC_CHTTP2_PCL_INITIATE]); + grpc_closure_list_move(&pq->lists[GRPC_CHTTP2_PCL_NEXT], + &pq->lists[GRPC_CHTTP2_PCL_INFLIGHT]); + grpc_slice_buffer_add(&t->outbuf, + grpc_chttp2_ping_create(false, pq->inflight_id)); + grpc_core::global_stats().IncrementHttp2PingsSent(); + if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || + GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace) || + GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) { + gpr_log(GPR_INFO, "%s: Ping sent [%s]: %s", + t->is_client ? "CLIENT" : "SERVER", + std::string(t->peer_string.as_string_view()).c_str(), + t->ping_rate_policy.GetDebugString().c_str()); + } + }, + [t](grpc_core::Chttp2PingRatePolicy::TooManyRecentPings) { + // need to receive something of substance before sending a ping again + if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || + GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace) || + GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) { + gpr_log(GPR_INFO, + "CLIENT: Ping delayed [%s]: too many recent pings: %s", + std::string(t->peer_string.as_string_view()).c_str(), + t->ping_rate_policy.GetDebugString().c_str()); + } + }, + [t](grpc_core::Chttp2PingRatePolicy::TooSoon too_soon) { + // not enough elapsed time between successive pings + if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || + GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace) || + GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) { + gpr_log(GPR_INFO, + "%s: Ping delayed [%s]: not enough time elapsed since last " + "ping. " + " Last ping:%s, minimum wait:%s need to wait:%s", + t->is_client ? "CLIENT" : "SERVER", + std::string(t->peer_string.as_string_view()).c_str(), + too_soon.last_ping.ToString().c_str(), + too_soon.next_allowed_ping_interval.ToString().c_str(), + too_soon.wait.ToString().c_str()); + } + if (!t->delayed_ping_timer_handle.has_value()) { + GRPC_CHTTP2_REF_TRANSPORT(t, "retry_initiate_ping_locked"); + t->delayed_ping_timer_handle = + t->event_engine->RunAfter(too_soon.wait, [t] { + grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; + grpc_core::ExecCtx exec_ctx; + grpc_chttp2_retry_initiate_ping(t); + }); + } + }); } static bool update_list(grpc_chttp2_transport* t, grpc_chttp2_stream* s, diff --git a/src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc b/src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc index f5e602fc89cbe..5cc1d5b554c1c 100644 --- a/src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc +++ b/src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc @@ -22,6 +22,7 @@ #include "absl/status/statusor.h" +#include #include #include "src/core/ext/transport/cronet/transport/cronet_transport.h" diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.cc b/src/core/ext/transport/cronet/transport/cronet_transport.cc index e1dfbb33b714b..270639362a001 100644 --- a/src/core/ext/transport/cronet/transport/cronet_transport.cc +++ b/src/core/ext/transport/cronet/transport/cronet_transport.cc @@ -37,6 +37,7 @@ #include "absl/types/optional.h" #include "third_party/objective_c/Cronet/bidirectional_stream_c.h" +#include #include #include #include diff --git a/src/core/ext/transport/inproc/inproc_transport.cc b/src/core/ext/transport/inproc/inproc_transport.cc index b4185e454c05b..fb9bd9d6fe913 100644 --- a/src/core/ext/transport/inproc/inproc_transport.cc +++ b/src/core/ext/transport/inproc/inproc_transport.cc @@ -35,6 +35,7 @@ #include "absl/types/optional.h" #include +#include #include #include #include diff --git a/src/core/ext/xds/xds_client_grpc.cc b/src/core/ext/xds/xds_client_grpc.cc index ca14f536266f9..7df4c36a5b255 100644 --- a/src/core/ext/xds/xds_client_grpc.cc +++ b/src/core/ext/xds/xds_client_grpc.cc @@ -30,6 +30,7 @@ #include "absl/types/optional.h" #include +#include #include #include #include diff --git a/src/core/ext/xds/xds_transport_grpc.cc b/src/core/ext/xds/xds_transport_grpc.cc index 9c0cc48cf138c..1a012416106e8 100644 --- a/src/core/ext/xds/xds_transport_grpc.cc +++ b/src/core/ext/xds/xds_transport_grpc.cc @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include diff --git a/src/core/lib/channel/channel_args.cc b/src/core/lib/channel/channel_args.cc index fe8c4761c6c2c..1e76d6dca6df3 100644 --- a/src/core/lib/channel/channel_args.cc +++ b/src/core/lib/channel/channel_args.cc @@ -34,6 +34,7 @@ #include "absl/strings/str_format.h" #include "absl/strings/str_join.h" +#include #include #include #include diff --git a/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc b/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc index 1841212d58ac1..326248cb84677 100644 --- a/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +++ b/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc @@ -27,6 +27,7 @@ #include "absl/types/optional.h" #include +#include #include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" // IWYU pragma: keep diff --git a/src/core/lib/http/httpcli_security_connector.cc b/src/core/lib/http/httpcli_security_connector.cc index d99befef0996d..22efdc30034c7 100644 --- a/src/core/lib/http/httpcli_security_connector.cc +++ b/src/core/lib/http/httpcli_security_connector.cc @@ -29,6 +29,7 @@ #include #include +#include #include #include #include diff --git a/src/core/lib/resource_quota/api.cc b/src/core/lib/resource_quota/api.cc index 5c5a4dd69783e..302b5d1a86e26 100644 --- a/src/core/lib/resource_quota/api.cc +++ b/src/core/lib/resource_quota/api.cc @@ -26,6 +26,7 @@ #include "absl/strings/str_cat.h" #include +#include #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" diff --git a/src/core/lib/resource_quota/resource_quota.h b/src/core/lib/resource_quota/resource_quota.h index 25da8218dbd55..f6dde768daa2a 100644 --- a/src/core/lib/resource_quota/resource_quota.h +++ b/src/core/lib/resource_quota/resource_quota.h @@ -23,6 +23,7 @@ #include "absl/strings/string_view.h" #include +#include #include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/cpp_impl_of.h" diff --git a/src/core/lib/security/authorization/authorization_policy_provider.h b/src/core/lib/security/authorization/authorization_policy_provider.h index 6f93c7fb964fe..e5bee1a5e0c8b 100644 --- a/src/core/lib/security/authorization/authorization_policy_provider.h +++ b/src/core/lib/security/authorization/authorization_policy_provider.h @@ -19,8 +19,8 @@ #include "absl/strings/string_view.h" -#include #include +#include #include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/dual_ref_counted.h" diff --git a/src/core/lib/security/credentials/google_default/google_default_credentials.cc b/src/core/lib/security/credentials/google_default/google_default_credentials.cc index 6d2eb20cda390..3601adae6a2be 100644 --- a/src/core/lib/security/credentials/google_default/google_default_credentials.cc +++ b/src/core/lib/security/credentials/google_default/google_default_credentials.cc @@ -32,6 +32,7 @@ #include // IWYU pragma: keep #include +#include #include #include #include diff --git a/src/core/lib/security/credentials/ssl/ssl_credentials.cc b/src/core/lib/security/credentials/ssl/ssl_credentials.cc index 86a220bf79520..e31225e82ff4d 100644 --- a/src/core/lib/security/credentials/ssl/ssl_credentials.cc +++ b/src/core/lib/security/credentials/ssl/ssl_credentials.cc @@ -28,6 +28,7 @@ #include "absl/strings/string_view.h" #include "absl/types/optional.h" +#include #include #include #include diff --git a/src/core/lib/security/credentials/tls/tls_credentials.cc b/src/core/lib/security/credentials/tls/tls_credentials.cc index 7548121ee1320..34f27c0d593a2 100644 --- a/src/core/lib/security/credentials/tls/tls_credentials.cc +++ b/src/core/lib/security/credentials/tls/tls_credentials.cc @@ -28,6 +28,7 @@ #include #include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/src/core/lib/security/credentials/xds/xds_credentials.cc b/src/core/lib/security/credentials/xds/xds_credentials.cc index 7d0035a988a1a..9d9fe3df2a781 100644 --- a/src/core/lib/security/credentials/xds/xds_credentials.cc +++ b/src/core/lib/security/credentials/xds/xds_credentials.cc @@ -24,6 +24,7 @@ #include "absl/types/optional.h" #include +#include #include #include "src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h" diff --git a/src/core/lib/security/security_connector/alts/alts_security_connector.cc b/src/core/lib/security/security_connector/alts/alts_security_connector.cc index 5f6c7a738d83b..5e64e8d49d3a6 100644 --- a/src/core/lib/security/security_connector/alts/alts_security_connector.cc +++ b/src/core/lib/security/security_connector/alts/alts_security_connector.cc @@ -31,6 +31,7 @@ #include #include +#include #include #include #include diff --git a/src/core/lib/security/security_connector/fake/fake_security_connector.cc b/src/core/lib/security/security_connector/fake/fake_security_connector.cc index d316face73913..384da2cd480fb 100644 --- a/src/core/lib/security/security_connector/fake/fake_security_connector.cc +++ b/src/core/lib/security/security_connector/fake/fake_security_connector.cc @@ -34,6 +34,7 @@ #include "absl/types/optional.h" #include +#include #include #include #include diff --git a/src/core/lib/security/security_connector/ssl_utils.cc b/src/core/lib/security/security_connector/ssl_utils.cc index fc51a6f57a654..230be953dcc1c 100644 --- a/src/core/lib/security/security_connector/ssl_utils.cc +++ b/src/core/lib/security/security_connector/ssl_utils.cc @@ -30,6 +30,7 @@ #include "absl/strings/str_split.h" #include +#include #include #include #include diff --git a/src/core/lib/security/transport/security_handshaker.cc b/src/core/lib/security/transport/security_handshaker.cc index 21227d656874e..3f629517ef02b 100644 --- a/src/core/lib/security/transport/security_handshaker.cc +++ b/src/core/lib/security/transport/security_handshaker.cc @@ -36,6 +36,7 @@ #include #include +#include #include #include #include diff --git a/src/core/lib/surface/channel.cc b/src/core/lib/surface/channel.cc index 0448134a04a11..2d47449c02eb3 100644 --- a/src/core/lib/surface/channel.cc +++ b/src/core/lib/surface/channel.cc @@ -32,6 +32,7 @@ #include #include +#include #include #include #include diff --git a/src/core/lib/surface/init.cc b/src/core/lib/surface/init.cc index 32d72fb2ae2ae..e5ff4f88657de 100644 --- a/src/core/lib/surface/init.cc +++ b/src/core/lib/surface/init.cc @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc index 9c67a82cfe6ee..e2a2bbca1f78a 100644 --- a/src/core/lib/surface/server.cc +++ b/src/core/lib/surface/server.cc @@ -40,6 +40,7 @@ #include #include +#include #include #include #include diff --git a/src/cpp/common/channel_arguments.cc b/src/cpp/common/channel_arguments.cc index d593b271db298..b975b2e4edd7d 100644 --- a/src/cpp/common/channel_arguments.cc +++ b/src/cpp/common/channel_arguments.cc @@ -20,6 +20,7 @@ #include #include +#include #include #include #include diff --git a/src/cpp/common/secure_channel_arguments.cc b/src/cpp/common/secure_channel_arguments.cc index 3ad0ff9fb7d87..66e34506ffbf5 100644 --- a/src/cpp/common/secure_channel_arguments.cc +++ b/src/cpp/common/secure_channel_arguments.cc @@ -20,6 +20,7 @@ #include #include +#include #include namespace grpc { diff --git a/src/cpp/ext/gcp/BUILD b/src/cpp/ext/gcp/BUILD index cc49fecb1cffe..41c9878390dc2 100644 --- a/src/cpp/ext/gcp/BUILD +++ b/src/cpp/ext/gcp/BUILD @@ -126,6 +126,7 @@ grpc_cc_library( deps = [ "environment_autodetect", "observability_config", + "//:channel_arg_names", "//:event_engine_base_hdrs", "//:gpr", "//:gpr_platform", diff --git a/src/cpp/ext/gcp/observability_logging_sink.cc b/src/cpp/ext/gcp/observability_logging_sink.cc index 84ea2127ed685..2ae582fa54ecc 100644 --- a/src/cpp/ext/gcp/observability_logging_sink.cc +++ b/src/cpp/ext/gcp/observability_logging_sink.cc @@ -36,6 +36,7 @@ #include "google/logging/v2/logging.pb.h" #include "google/protobuf/text_format.h" +#include #include #include #include diff --git a/src/cpp/server/load_reporter/load_reporting_service_server_builder_option.cc b/src/cpp/server/load_reporter/load_reporting_service_server_builder_option.cc index a940525430150..30f86b06e050f 100644 --- a/src/cpp/server/load_reporter/load_reporting_service_server_builder_option.cc +++ b/src/cpp/server/load_reporter/load_reporting_service_server_builder_option.cc @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc index efa813af2bae2..6f42aaa46bbf1 100644 --- a/src/cpp/server/server_builder.cc +++ b/src/cpp/server/server_builder.cc @@ -27,6 +27,7 @@ #include #include +#include #include #include #include diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc index 343fb424665d3..ad40fb29eeb03 100644 --- a/src/cpp/server/server_cc.cc +++ b/src/cpp/server/server_cc.cc @@ -33,6 +33,7 @@ #include #include +#include #include #include #include diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 468e401a36ad9..3a03e18ac0874 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -118,6 +118,8 @@ 'src/core/ext/transport/chttp2/transport/http_trace.cc', 'src/core/ext/transport/chttp2/transport/huffsyms.cc', 'src/core/ext/transport/chttp2/transport/parsing.cc', + 'src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc', + 'src/core/ext/transport/chttp2/transport/ping_rate_policy.cc', 'src/core/ext/transport/chttp2/transport/stream_lists.cc', 'src/core/ext/transport/chttp2/transport/varint.cc', 'src/core/ext/transport/chttp2/transport/writing.cc', diff --git a/test/core/bad_connection/close_fd_test.cc b/test/core/bad_connection/close_fd_test.cc index 6ffc08eaefa6c..06a68a8478aa0 100644 --- a/test/core/bad_connection/close_fd_test.cc +++ b/test/core/bad_connection/close_fd_test.cc @@ -28,6 +28,7 @@ #include "absl/status/statusor.h" #include "absl/strings/str_format.h" +#include #include #include #include diff --git a/test/core/bad_ssl/bad_ssl_test.cc b/test/core/bad_ssl/bad_ssl_test.cc index 0b313383663cd..51d5a95b63f9d 100644 --- a/test/core/bad_ssl/bad_ssl_test.cc +++ b/test/core/bad_ssl/bad_ssl_test.cc @@ -23,6 +23,7 @@ #include #include +#include #include #include #include diff --git a/test/core/channel/channel_args_test.cc b/test/core/channel/channel_args_test.cc index a7e55f9724a3c..10a05d35e2637 100644 --- a/test/core/channel/channel_args_test.cc +++ b/test/core/channel/channel_args_test.cc @@ -24,6 +24,7 @@ #include #include +#include #include #include diff --git a/test/core/channel/channel_trace_test.cc b/test/core/channel/channel_trace_test.cc index 5aae3bbcff0c9..1a346f3da6c9d 100644 --- a/test/core/channel/channel_trace_test.cc +++ b/test/core/channel/channel_trace_test.cc @@ -26,6 +26,7 @@ #include #include +#include #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channelz.h" diff --git a/test/core/channel/channelz_test.cc b/test/core/channel/channelz_test.cc index f9f4ac828dd72..5a3750c3e0f55 100644 --- a/test/core/channel/channelz_test.cc +++ b/test/core/channel/channelz_test.cc @@ -31,6 +31,7 @@ #include #include +#include #include #include #include diff --git a/test/core/channel/minimal_stack_is_minimal_test.cc b/test/core/channel/minimal_stack_is_minimal_test.cc index cbdb10b4bb63d..7f9fc905af7c4 100644 --- a/test/core/channel/minimal_stack_is_minimal_test.cc +++ b/test/core/channel/minimal_stack_is_minimal_test.cc @@ -38,6 +38,7 @@ #include "gtest/gtest.h" #include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/client_channel/client_channel_test.cc b/test/core/client_channel/client_channel_test.cc index 58f16e2166e6e..475fd8433eb53 100644 --- a/test/core/client_channel/client_channel_test.cc +++ b/test/core/client_channel/client_channel_test.cc @@ -21,7 +21,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include "src/core/ext/filters/client_channel/subchannel_pool_interface.h" #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/client_channel/http_proxy_mapper_test.cc b/test/core/client_channel/http_proxy_mapper_test.cc index a8086cafef8a1..460a10ef65f77 100644 --- a/test/core/client_channel/http_proxy_mapper_test.cc +++ b/test/core/client_channel/http_proxy_mapper_test.cc @@ -19,7 +19,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include "src/core/ext/filters/client_channel/http_proxy.h" #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/client_channel/lb_policy/outlier_detection_test.cc b/test/core/client_channel/lb_policy/outlier_detection_test.cc index 907db1b4d19e7..440b117f2cb05 100644 --- a/test/core/client_channel/lb_policy/outlier_detection_test.cc +++ b/test/core/client_channel/lb_policy/outlier_detection_test.cc @@ -33,6 +33,7 @@ #include #include +#include #include #include diff --git a/test/core/client_channel/lb_policy/pick_first_test.cc b/test/core/client_channel/lb_policy/pick_first_test.cc index 46d833d99c2a2..d9d81ce22d950 100644 --- a/test/core/client_channel/lb_policy/pick_first_test.cc +++ b/test/core/client_channel/lb_policy/pick_first_test.cc @@ -31,6 +31,7 @@ #include "gtest/gtest.h" #include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc b/test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc index 5c00a0755dec1..998f77398e666 100644 --- a/test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc +++ b/test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc @@ -31,6 +31,7 @@ #include #include +#include #include #include #include diff --git a/test/core/client_channel/retry_service_config_test.cc b/test/core/client_channel/retry_service_config_test.cc index 4ce8d0cf0378e..b161b6091e81f 100644 --- a/test/core/client_channel/retry_service_config_test.cc +++ b/test/core/client_channel/retry_service_config_test.cc @@ -21,6 +21,7 @@ #include "gtest/gtest.h" #include +#include #include #include diff --git a/test/core/end2end/BUILD b/test/core/end2end/BUILD index 29cace309e86f..3118dc39520dc 100644 --- a/test/core/end2end/BUILD +++ b/test/core/end2end/BUILD @@ -95,6 +95,7 @@ grpc_cc_library( hdrs = ["fixtures/proxy.h"], language = "C++", deps = [ + "//:channel_arg_names", "//:gpr", "//:grpc", "//:grpc_public_hdrs", @@ -164,6 +165,7 @@ grpc_cc_library( language = "C++", deps = [ "end2end_test_lib", + "//:channel_arg_names", "//:config", "//:exec_ctx", "//:gpr", @@ -204,6 +206,7 @@ grpc_cc_library( "fixture_support", "http_proxy", "proxy", + "//:channel_arg_names", "//:exec_ctx", "//:gpr", "//:grpc", @@ -472,6 +475,7 @@ grpc_cc_test( language = "C++", deps = [ "cq_verifier", + "//:channel_arg_names", "//:exec_ctx", "//:gpr", "//:grpc_public_hdrs", @@ -514,6 +518,7 @@ grpc_cc_test( language = "C++", deps = [ "cq_verifier", + "//:channel_arg_names", "//:debug_location", "//:exec_ctx", "//:gpr", @@ -595,6 +600,7 @@ grpc_cc_test( "end2end_test_lib", "fixture_support", "ssl_test_data", + "//:channel_arg_names", "//:config_vars", "//:debug_location", "//:gpr", @@ -627,6 +633,7 @@ grpc_cc_test( language = "C++", deps = [ "cq_verifier", + "//:channel_arg_names", "//:config_vars", "//:exec_ctx", "//:gpr", @@ -656,6 +663,7 @@ grpc_cc_test( language = "C++", deps = [ "cq_verifier", + "//:channel_arg_names", "//:config_vars", "//:exec_ctx", "//:gpr", diff --git a/test/core/end2end/connection_refused_test.cc b/test/core/end2end/connection_refused_test.cc index c7f52366af31c..a670f4ece5d1f 100644 --- a/test/core/end2end/connection_refused_test.cc +++ b/test/core/end2end/connection_refused_test.cc @@ -22,6 +22,7 @@ #include #include +#include #include #include #include diff --git a/test/core/end2end/end2end_test_suites.cc b/test/core/end2end/end2end_test_suites.cc index 4a7c133f85022..76b0644657e58 100644 --- a/test/core/end2end/end2end_test_suites.cc +++ b/test/core/end2end/end2end_test_suites.cc @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include diff --git a/test/core/end2end/fixtures/h2_oauth2_common.h b/test/core/end2end/fixtures/h2_oauth2_common.h index bd54b59095cbd..76e246b0821df 100644 --- a/test/core/end2end/fixtures/h2_oauth2_common.h +++ b/test/core/end2end/fixtures/h2_oauth2_common.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/test/core/end2end/fixtures/h2_ssl_cred_reload_fixture.h b/test/core/end2end/fixtures/h2_ssl_cred_reload_fixture.h index 2cafcdc895694..1e52f14b02ffe 100644 --- a/test/core/end2end/fixtures/h2_ssl_cred_reload_fixture.h +++ b/test/core/end2end/fixtures/h2_ssl_cred_reload_fixture.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/test/core/end2end/fixtures/h2_ssl_tls_common.h b/test/core/end2end/fixtures/h2_ssl_tls_common.h index d8fcf984637d6..2337dd89ac6f5 100644 --- a/test/core/end2end/fixtures/h2_ssl_tls_common.h +++ b/test/core/end2end/fixtures/h2_ssl_tls_common.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/test/core/end2end/fixtures/h2_tls_common.h b/test/core/end2end/fixtures/h2_tls_common.h index 8854436885f55..c9fe5b4925ff2 100644 --- a/test/core/end2end/fixtures/h2_tls_common.h +++ b/test/core/end2end/fixtures/h2_tls_common.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include diff --git a/test/core/end2end/fixtures/proxy.cc b/test/core/end2end/fixtures/proxy.cc index 8e99c5b73a7e1..ddd96a2138f43 100644 --- a/test/core/end2end/fixtures/proxy.cc +++ b/test/core/end2end/fixtures/proxy.cc @@ -24,6 +24,7 @@ #include #include +#include #include #include #include diff --git a/test/core/end2end/fixtures/sockpair_fixture.h b/test/core/end2end/fixtures/sockpair_fixture.h index 4c74a6b9b5f78..8aa1f715c2e01 100644 --- a/test/core/end2end/fixtures/sockpair_fixture.h +++ b/test/core/end2end/fixtures/sockpair_fixture.h @@ -22,6 +22,7 @@ #include "gtest/gtest.h" #include +#include #include #include diff --git a/test/core/end2end/fuzzers/client_fuzzer.cc b/test/core/end2end/fuzzers/client_fuzzer.cc index a3f554c7f4daa..04766c7ac008e 100644 --- a/test/core/end2end/fuzzers/client_fuzzer.cc +++ b/test/core/end2end/fuzzers/client_fuzzer.cc @@ -24,6 +24,7 @@ #include #include +#include #include #include #include diff --git a/test/core/end2end/goaway_server_test.cc b/test/core/end2end/goaway_server_test.cc index a876b9a87100c..ed64801cdb794 100644 --- a/test/core/end2end/goaway_server_test.cc +++ b/test/core/end2end/goaway_server_test.cc @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include diff --git a/test/core/end2end/h2_ssl_cert_test.cc b/test/core/end2end/h2_ssl_cert_test.cc index 98501b319dd0d..aa7a5299be9b8 100644 --- a/test/core/end2end/h2_ssl_cert_test.cc +++ b/test/core/end2end/h2_ssl_cert_test.cc @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/test/core/end2end/h2_ssl_session_reuse_test.cc b/test/core/end2end/h2_ssl_session_reuse_test.cc index 1aac4dfd8ff82..30c1640c08bb5 100644 --- a/test/core/end2end/h2_ssl_session_reuse_test.cc +++ b/test/core/end2end/h2_ssl_session_reuse_test.cc @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/test/core/end2end/h2_tls_peer_property_external_verifier_test.cc b/test/core/end2end/h2_tls_peer_property_external_verifier_test.cc index 1a367aa9b3b5f..9093b8d979c33 100644 --- a/test/core/end2end/h2_tls_peer_property_external_verifier_test.cc +++ b/test/core/end2end/h2_tls_peer_property_external_verifier_test.cc @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/test/core/end2end/tests/bad_ping.cc b/test/core/end2end/tests/bad_ping.cc index 50759b5bc23e4..d13a19605b28a 100644 --- a/test/core/end2end/tests/bad_ping.cc +++ b/test/core/end2end/tests/bad_ping.cc @@ -18,7 +18,7 @@ #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/binary_metadata.cc b/test/core/end2end/tests/binary_metadata.cc index bf0bc83c014a6..77c1692ff4c3f 100644 --- a/test/core/end2end/tests/binary_metadata.cc +++ b/test/core/end2end/tests/binary_metadata.cc @@ -18,7 +18,7 @@ #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/call_host_override.cc b/test/core/end2end/tests/call_host_override.cc index 9847497bdbc0c..678e50803737e 100644 --- a/test/core/end2end/tests/call_host_override.cc +++ b/test/core/end2end/tests/call_host_override.cc @@ -19,7 +19,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/cancel_after_accept.cc b/test/core/end2end/tests/cancel_after_accept.cc index 6abce4a227473..d56272eab0cc2 100644 --- a/test/core/end2end/tests/cancel_after_accept.cc +++ b/test/core/end2end/tests/cancel_after_accept.cc @@ -21,7 +21,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/cancel_after_round_trip.cc b/test/core/end2end/tests/cancel_after_round_trip.cc index 11c1ed9a10589..2e63182a5f7d8 100644 --- a/test/core/end2end/tests/cancel_after_round_trip.cc +++ b/test/core/end2end/tests/cancel_after_round_trip.cc @@ -21,7 +21,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/channelz.cc b/test/core/end2end/tests/channelz.cc index 8f3b198266f45..66c35f5928e3d 100644 --- a/test/core/end2end/tests/channelz.cc +++ b/test/core/end2end/tests/channelz.cc @@ -23,7 +23,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/compressed_payload.cc b/test/core/end2end/tests/compressed_payload.cc index 50786307ed1ba..bb8cfe6814828 100644 --- a/test/core/end2end/tests/compressed_payload.cc +++ b/test/core/end2end/tests/compressed_payload.cc @@ -27,6 +27,7 @@ #include #include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/connectivity.cc b/test/core/end2end/tests/connectivity.cc index 7d527b6dab0a9..043cbbf103d34 100644 --- a/test/core/end2end/tests/connectivity.cc +++ b/test/core/end2end/tests/connectivity.cc @@ -20,6 +20,7 @@ #include "gtest/gtest.h" #include +#include #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/gprpp/time.h" diff --git a/test/core/end2end/tests/grpc_authz.cc b/test/core/end2end/tests/grpc_authz.cc index e5c307d571cfb..0de07397ed826 100644 --- a/test/core/end2end/tests/grpc_authz.cc +++ b/test/core/end2end/tests/grpc_authz.cc @@ -20,6 +20,7 @@ #include #include +#include #include #include diff --git a/test/core/end2end/tests/high_initial_seqno.cc b/test/core/end2end/tests/high_initial_seqno.cc index 31c000dd3d9e5..e891d25ad1195 100644 --- a/test/core/end2end/tests/high_initial_seqno.cc +++ b/test/core/end2end/tests/high_initial_seqno.cc @@ -18,7 +18,7 @@ #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/hpack_size.cc b/test/core/end2end/tests/hpack_size.cc index fb2e39097db27..465de045e0373 100644 --- a/test/core/end2end/tests/hpack_size.cc +++ b/test/core/end2end/tests/hpack_size.cc @@ -25,7 +25,7 @@ #include "absl/strings/string_view.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/invoke_large_request.cc b/test/core/end2end/tests/invoke_large_request.cc index 5a0e83a4fcb9f..9ea09ab042050 100644 --- a/test/core/end2end/tests/invoke_large_request.cc +++ b/test/core/end2end/tests/invoke_large_request.cc @@ -20,7 +20,7 @@ #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/keepalive_timeout.cc b/test/core/end2end/tests/keepalive_timeout.cc index 1b8e7bb5162ab..751ca3cb00d86 100644 --- a/test/core/end2end/tests/keepalive_timeout.cc +++ b/test/core/end2end/tests/keepalive_timeout.cc @@ -19,7 +19,7 @@ #include "absl/strings/string_view.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/large_metadata.cc b/test/core/end2end/tests/large_metadata.cc index ff2e09d4e4c5e..d44f5e725badb 100644 --- a/test/core/end2end/tests/large_metadata.cc +++ b/test/core/end2end/tests/large_metadata.cc @@ -24,7 +24,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/max_concurrent_streams.cc b/test/core/end2end/tests/max_concurrent_streams.cc index ff7b609fd3570..b8aa989824954 100644 --- a/test/core/end2end/tests/max_concurrent_streams.cc +++ b/test/core/end2end/tests/max_concurrent_streams.cc @@ -18,7 +18,7 @@ #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/max_connection_age.cc b/test/core/end2end/tests/max_connection_age.cc index 680b263088237..9a1a47cea03be 100644 --- a/test/core/end2end/tests/max_connection_age.cc +++ b/test/core/end2end/tests/max_connection_age.cc @@ -20,7 +20,7 @@ #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/max_connection_idle.cc b/test/core/end2end/tests/max_connection_idle.cc index fea7e0075d966..3c8332f2e3347 100644 --- a/test/core/end2end/tests/max_connection_idle.cc +++ b/test/core/end2end/tests/max_connection_idle.cc @@ -21,6 +21,7 @@ #include "gtest/gtest.h" #include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/max_message_length.cc b/test/core/end2end/tests/max_message_length.cc index a296aee787110..83c53f01b8662 100644 --- a/test/core/end2end/tests/max_message_length.cc +++ b/test/core/end2end/tests/max_message_length.cc @@ -22,7 +22,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/ping.cc b/test/core/end2end/tests/ping.cc index 572696f19d77c..61eb6fbeef7d2 100644 --- a/test/core/end2end/tests/ping.cc +++ b/test/core/end2end/tests/ping.cc @@ -20,6 +20,7 @@ #include "gtest/gtest.h" #include +#include #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/gprpp/time.h" diff --git a/test/core/end2end/tests/resource_quota_server.cc b/test/core/end2end/tests/resource_quota_server.cc index 64fbbf697e187..680106cd1a125 100644 --- a/test/core/end2end/tests/resource_quota_server.cc +++ b/test/core/end2end/tests/resource_quota_server.cc @@ -26,6 +26,7 @@ #include "gtest/gtest.h" #include +#include #include #include diff --git a/test/core/end2end/tests/retry.cc b/test/core/end2end/tests/retry.cc index 845d45797573e..84991d0e42dd0 100644 --- a/test/core/end2end/tests/retry.cc +++ b/test/core/end2end/tests/retry.cc @@ -19,7 +19,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_cancel_after_first_attempt_starts.cc b/test/core/end2end/tests/retry_cancel_after_first_attempt_starts.cc index 48a6c40a2ccd1..cbe7dcd517dd9 100644 --- a/test/core/end2end/tests/retry_cancel_after_first_attempt_starts.cc +++ b/test/core/end2end/tests/retry_cancel_after_first_attempt_starts.cc @@ -16,7 +16,7 @@ #include "absl/types/optional.h" -#include +#include #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/gprpp/time.h" diff --git a/test/core/end2end/tests/retry_cancel_during_delay.cc b/test/core/end2end/tests/retry_cancel_during_delay.cc index 41da4a604eeb7..a45d84293d038 100644 --- a/test/core/end2end/tests/retry_cancel_during_delay.cc +++ b/test/core/end2end/tests/retry_cancel_during_delay.cc @@ -21,7 +21,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_cancel_with_multiple_send_batches.cc b/test/core/end2end/tests/retry_cancel_with_multiple_send_batches.cc index cf73f5e7a62e5..28b3f04d4a226 100644 --- a/test/core/end2end/tests/retry_cancel_with_multiple_send_batches.cc +++ b/test/core/end2end/tests/retry_cancel_with_multiple_send_batches.cc @@ -25,7 +25,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_cancellation.cc b/test/core/end2end/tests/retry_cancellation.cc index bc9b9d8dde275..5944f2b8b7081 100644 --- a/test/core/end2end/tests/retry_cancellation.cc +++ b/test/core/end2end/tests/retry_cancellation.cc @@ -21,7 +21,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_disabled.cc b/test/core/end2end/tests/retry_disabled.cc index f7b61ef2fe71a..f16295d94751d 100644 --- a/test/core/end2end/tests/retry_disabled.cc +++ b/test/core/end2end/tests/retry_disabled.cc @@ -19,7 +19,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_exceeds_buffer_size_in_delay.cc b/test/core/end2end/tests/retry_exceeds_buffer_size_in_delay.cc index 5b4b3a32d5cfb..3a0b681d19840 100644 --- a/test/core/end2end/tests/retry_exceeds_buffer_size_in_delay.cc +++ b/test/core/end2end/tests/retry_exceeds_buffer_size_in_delay.cc @@ -19,7 +19,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc b/test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc index 7a038020fcb09..47476a023b32f 100644 --- a/test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc +++ b/test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc @@ -19,7 +19,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc b/test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc index 65aed1db8d60e..1d6669c11213c 100644 --- a/test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc +++ b/test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc @@ -21,7 +21,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_lb_drop.cc b/test/core/end2end/tests/retry_lb_drop.cc index 70a593342b247..b711a9aa0b1f6 100644 --- a/test/core/end2end/tests/retry_lb_drop.cc +++ b/test/core/end2end/tests/retry_lb_drop.cc @@ -25,6 +25,7 @@ #include "gtest/gtest.h" #include +#include #include #include diff --git a/test/core/end2end/tests/retry_lb_fail.cc b/test/core/end2end/tests/retry_lb_fail.cc index ce3d765b7150d..75d8dca976ea4 100644 --- a/test/core/end2end/tests/retry_lb_fail.cc +++ b/test/core/end2end/tests/retry_lb_fail.cc @@ -19,7 +19,7 @@ #include "absl/status/status.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_non_retriable_status.cc b/test/core/end2end/tests/retry_non_retriable_status.cc index b4cfbae34ce70..45e8b923461f3 100644 --- a/test/core/end2end/tests/retry_non_retriable_status.cc +++ b/test/core/end2end/tests/retry_non_retriable_status.cc @@ -19,7 +19,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_non_retriable_status_before_trailers.cc b/test/core/end2end/tests/retry_non_retriable_status_before_trailers.cc index e54d24466eb59..b4a083d687bb8 100644 --- a/test/core/end2end/tests/retry_non_retriable_status_before_trailers.cc +++ b/test/core/end2end/tests/retry_non_retriable_status_before_trailers.cc @@ -19,7 +19,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_per_attempt_recv_timeout.cc b/test/core/end2end/tests/retry_per_attempt_recv_timeout.cc index 97687c164415d..20103656be478 100644 --- a/test/core/end2end/tests/retry_per_attempt_recv_timeout.cc +++ b/test/core/end2end/tests/retry_per_attempt_recv_timeout.cc @@ -20,7 +20,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_per_attempt_recv_timeout_on_last_attempt.cc b/test/core/end2end/tests/retry_per_attempt_recv_timeout_on_last_attempt.cc index f051f37ea28e8..45e4ae87058ea 100644 --- a/test/core/end2end/tests/retry_per_attempt_recv_timeout_on_last_attempt.cc +++ b/test/core/end2end/tests/retry_per_attempt_recv_timeout_on_last_attempt.cc @@ -20,7 +20,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_recv_initial_metadata.cc b/test/core/end2end/tests/retry_recv_initial_metadata.cc index 7460caf9e1f53..1d7f514fb5fe5 100644 --- a/test/core/end2end/tests/retry_recv_initial_metadata.cc +++ b/test/core/end2end/tests/retry_recv_initial_metadata.cc @@ -20,7 +20,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_recv_message.cc b/test/core/end2end/tests/retry_recv_message.cc index 6b0a586404f46..cee5ddfa81d16 100644 --- a/test/core/end2end/tests/retry_recv_message.cc +++ b/test/core/end2end/tests/retry_recv_message.cc @@ -19,7 +19,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_recv_message_replay.cc b/test/core/end2end/tests/retry_recv_message_replay.cc index 2f7450f681586..ba3000afa14cd 100644 --- a/test/core/end2end/tests/retry_recv_message_replay.cc +++ b/test/core/end2end/tests/retry_recv_message_replay.cc @@ -22,7 +22,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_recv_trailing_metadata_error.cc b/test/core/end2end/tests/retry_recv_trailing_metadata_error.cc index 886aaa9af570f..8f0ddeb2ab1d9 100644 --- a/test/core/end2end/tests/retry_recv_trailing_metadata_error.cc +++ b/test/core/end2end/tests/retry_recv_trailing_metadata_error.cc @@ -20,7 +20,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_send_initial_metadata_refs.cc b/test/core/end2end/tests/retry_send_initial_metadata_refs.cc index 9348801424c7b..676efd1543c02 100644 --- a/test/core/end2end/tests/retry_send_initial_metadata_refs.cc +++ b/test/core/end2end/tests/retry_send_initial_metadata_refs.cc @@ -22,7 +22,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include diff --git a/test/core/end2end/tests/retry_send_op_fails.cc b/test/core/end2end/tests/retry_send_op_fails.cc index a4ca292c14305..cc45fe051acb7 100644 --- a/test/core/end2end/tests/retry_send_op_fails.cc +++ b/test/core/end2end/tests/retry_send_op_fails.cc @@ -22,7 +22,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_send_recv_batch.cc b/test/core/end2end/tests/retry_send_recv_batch.cc index 3d6e018b7de7f..95ede4b54cc28 100644 --- a/test/core/end2end/tests/retry_send_recv_batch.cc +++ b/test/core/end2end/tests/retry_send_recv_batch.cc @@ -16,7 +16,7 @@ #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_server_pushback_delay.cc b/test/core/end2end/tests/retry_server_pushback_delay.cc index 4039a526bbe87..4eacd99fdbb55 100644 --- a/test/core/end2end/tests/retry_server_pushback_delay.cc +++ b/test/core/end2end/tests/retry_server_pushback_delay.cc @@ -20,7 +20,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_server_pushback_disabled.cc b/test/core/end2end/tests/retry_server_pushback_disabled.cc index e59772fd06c77..268bb6a041d6d 100644 --- a/test/core/end2end/tests/retry_server_pushback_disabled.cc +++ b/test/core/end2end/tests/retry_server_pushback_disabled.cc @@ -20,7 +20,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_streaming.cc b/test/core/end2end/tests/retry_streaming.cc index d900c1c44db50..d21dd512444c2 100644 --- a/test/core/end2end/tests/retry_streaming.cc +++ b/test/core/end2end/tests/retry_streaming.cc @@ -22,7 +22,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_streaming_after_commit.cc b/test/core/end2end/tests/retry_streaming_after_commit.cc index 2195c5549f458..6a669c463503e 100644 --- a/test/core/end2end/tests/retry_streaming_after_commit.cc +++ b/test/core/end2end/tests/retry_streaming_after_commit.cc @@ -19,7 +19,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_streaming_succeeds_before_replay_finished.cc b/test/core/end2end/tests/retry_streaming_succeeds_before_replay_finished.cc index 63cb8e444a99f..f9621b84a2418 100644 --- a/test/core/end2end/tests/retry_streaming_succeeds_before_replay_finished.cc +++ b/test/core/end2end/tests/retry_streaming_succeeds_before_replay_finished.cc @@ -19,7 +19,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_throttled.cc b/test/core/end2end/tests/retry_throttled.cc index db9789d0c92eb..3dba07c026bbf 100644 --- a/test/core/end2end/tests/retry_throttled.cc +++ b/test/core/end2end/tests/retry_throttled.cc @@ -19,7 +19,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_too_many_attempts.cc b/test/core/end2end/tests/retry_too_many_attempts.cc index 742db131f6404..43c4e82d9c68b 100644 --- a/test/core/end2end/tests/retry_too_many_attempts.cc +++ b/test/core/end2end/tests/retry_too_many_attempts.cc @@ -19,7 +19,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_transparent_goaway.cc b/test/core/end2end/tests/retry_transparent_goaway.cc index 631f195453551..a10490df99d55 100644 --- a/test/core/end2end/tests/retry_transparent_goaway.cc +++ b/test/core/end2end/tests/retry_transparent_goaway.cc @@ -20,7 +20,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_transparent_max_concurrent_streams.cc b/test/core/end2end/tests/retry_transparent_max_concurrent_streams.cc index 52ba8b809c3cd..335d934423e7f 100644 --- a/test/core/end2end/tests/retry_transparent_max_concurrent_streams.cc +++ b/test/core/end2end/tests/retry_transparent_max_concurrent_streams.cc @@ -18,6 +18,7 @@ #include "gtest/gtest.h" #include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_transparent_not_sent_on_wire.cc b/test/core/end2end/tests/retry_transparent_not_sent_on_wire.cc index bb808f65aaf7b..b576688687415 100644 --- a/test/core/end2end/tests/retry_transparent_not_sent_on_wire.cc +++ b/test/core/end2end/tests/retry_transparent_not_sent_on_wire.cc @@ -22,7 +22,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_unref_before_finish.cc b/test/core/end2end/tests/retry_unref_before_finish.cc index 49937bd808cd4..ceff069e9ced3 100644 --- a/test/core/end2end/tests/retry_unref_before_finish.cc +++ b/test/core/end2end/tests/retry_unref_before_finish.cc @@ -16,7 +16,7 @@ #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/retry_unref_before_recv.cc b/test/core/end2end/tests/retry_unref_before_recv.cc index d2a926ec6cf64..a11c3c5bc4f12 100644 --- a/test/core/end2end/tests/retry_unref_before_recv.cc +++ b/test/core/end2end/tests/retry_unref_before_recv.cc @@ -17,7 +17,7 @@ #include "absl/types/optional.h" #include "gtest/gtest.h" -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/end2end/tests/simple_delayed_request.cc b/test/core/end2end/tests/simple_delayed_request.cc index 495cc649ddc2a..5758fbe299ed4 100644 --- a/test/core/end2end/tests/simple_delayed_request.cc +++ b/test/core/end2end/tests/simple_delayed_request.cc @@ -19,6 +19,7 @@ #include "gtest/gtest.h" #include +#include #include #include diff --git a/test/core/event_engine/posix/posix_endpoint_test.cc b/test/core/event_engine/posix/posix_endpoint_test.cc index 265b3c9ddcb1c..e58bd84bf3ebb 100644 --- a/test/core/event_engine/posix/posix_endpoint_test.cc +++ b/test/core/event_engine/posix/posix_endpoint_test.cc @@ -32,6 +32,7 @@ #include #include +#include #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/config/config_vars.h" diff --git a/test/core/event_engine/posix/posix_event_engine_connect_test.cc b/test/core/event_engine/posix/posix_event_engine_connect_test.cc index 4d0294b030c1c..9d988259ee94d 100644 --- a/test/core/event_engine/posix/posix_event_engine_connect_test.cc +++ b/test/core/event_engine/posix/posix_event_engine_connect_test.cc @@ -38,6 +38,7 @@ #include #include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/event_engine/test_suite/tests/client_test.cc b/test/core/event_engine/test_suite/tests/client_test.cc index b06f89308b735..47bcf4236f441 100644 --- a/test/core/event_engine/test_suite/tests/client_test.cc +++ b/test/core/event_engine/test_suite/tests/client_test.cc @@ -34,7 +34,7 @@ #include #include -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/event_engine/test_suite/tests/server_test.cc b/test/core/event_engine/test_suite/tests/server_test.cc index 320ebe6e04cdd..bbcba7e935263 100644 --- a/test/core/event_engine/test_suite/tests/server_test.cc +++ b/test/core/event_engine/test_suite/tests/server_test.cc @@ -34,7 +34,7 @@ #include #include -#include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/handshake/client_ssl.cc b/test/core/handshake/client_ssl.cc index 69f14d17217d0..bcdc8743d5cc0 100644 --- a/test/core/handshake/client_ssl.cc +++ b/test/core/handshake/client_ssl.cc @@ -26,6 +26,7 @@ #include "absl/base/thread_annotations.h" #include "gtest/gtest.h" +#include #include #include diff --git a/test/core/http/httpscli_test.cc b/test/core/http/httpscli_test.cc index a4aa918f1df2f..281ccda42698a 100644 --- a/test/core/http/httpscli_test.cc +++ b/test/core/http/httpscli_test.cc @@ -35,6 +35,7 @@ #include "absl/time/time.h" #include +#include #include #include #include diff --git a/test/core/memory_usage/callback_client.cc b/test/core/memory_usage/callback_client.cc index f460ff460f845..59d3ec96dc00c 100644 --- a/test/core/memory_usage/callback_client.cc +++ b/test/core/memory_usage/callback_client.cc @@ -29,6 +29,7 @@ #include "absl/flags/parse.h" #include "absl/strings/string_view.h" +#include #include #include #include diff --git a/test/core/memory_usage/client.cc b/test/core/memory_usage/client.cc index 43bcf44b2ecdb..c7c73b4ad9606 100644 --- a/test/core/memory_usage/client.cc +++ b/test/core/memory_usage/client.cc @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include diff --git a/test/core/memory_usage/server.cc b/test/core/memory_usage/server.cc index 23eb9ee865969..9ccab48de9c18 100644 --- a/test/core/memory_usage/server.cc +++ b/test/core/memory_usage/server.cc @@ -33,6 +33,7 @@ #include #include #include +#include #include #include diff --git a/test/core/surface/num_external_connectivity_watchers_test.cc b/test/core/surface/num_external_connectivity_watchers_test.cc index a276cbc19916d..5917330aaa0ff 100644 --- a/test/core/surface/num_external_connectivity_watchers_test.cc +++ b/test/core/surface/num_external_connectivity_watchers_test.cc @@ -24,6 +24,7 @@ #include #include +#include #include #include #include diff --git a/test/core/surface/sequential_connectivity_test.cc b/test/core/surface/sequential_connectivity_test.cc index ab76f57217c5b..d9623f22ceed1 100644 --- a/test/core/surface/sequential_connectivity_test.cc +++ b/test/core/surface/sequential_connectivity_test.cc @@ -26,6 +26,7 @@ #include #include +#include #include #include #include diff --git a/test/core/surface/server_chttp2_test.cc b/test/core/surface/server_chttp2_test.cc index e350676fe7d8e..3c211a9dd81ce 100644 --- a/test/core/surface/server_chttp2_test.cc +++ b/test/core/surface/server_chttp2_test.cc @@ -22,6 +22,7 @@ #include #include +#include #include #include "src/core/lib/channel/channel_args.h" diff --git a/test/core/surface/server_test.cc b/test/core/surface/server_test.cc index c1c0535f5b4f6..9e7d35d31303e 100644 --- a/test/core/surface/server_test.cc +++ b/test/core/surface/server_test.cc @@ -27,6 +27,7 @@ #include #include +#include #include #include diff --git a/test/core/transport/chttp2/BUILD b/test/core/transport/chttp2/BUILD index 37ad1c24f4481..fff43730be9aa 100644 --- a/test/core/transport/chttp2/BUILD +++ b/test/core/transport/chttp2/BUILD @@ -160,6 +160,34 @@ grpc_cc_test( ], ) +grpc_cc_test( + name = "ping_abuse_policy_test", + srcs = ["ping_abuse_policy_test.cc"], + external_deps = ["gtest"], + language = "C++", + uses_polling = False, + deps = [ + "//:gpr", + "//:grpc", + "//test/core/util:grpc_test_util", + "//test/core/util:grpc_test_util_base", + ], +) + +grpc_cc_test( + name = "ping_rate_policy_test", + srcs = ["ping_rate_policy_test.cc"], + external_deps = ["gtest"], + language = "C++", + uses_polling = False, + deps = [ + "//:gpr", + "//:grpc", + "//test/core/util:grpc_test_util", + "//test/core/util:grpc_test_util_base", + ], +) + grpc_cc_test( name = "ping_configuration_test", srcs = ["ping_configuration_test.cc"], diff --git a/test/core/transport/chttp2/graceful_shutdown_test.cc b/test/core/transport/chttp2/graceful_shutdown_test.cc index e68cb105660b3..ca6aaa48cf373 100644 --- a/test/core/transport/chttp2/graceful_shutdown_test.cc +++ b/test/core/transport/chttp2/graceful_shutdown_test.cc @@ -38,6 +38,7 @@ #include "gtest/gtest.h" #include +#include #include #include #include diff --git a/test/core/transport/chttp2/ping_abuse_policy_test.cc b/test/core/transport/chttp2/ping_abuse_policy_test.cc new file mode 100644 index 0000000000000..279158fb370f5 --- /dev/null +++ b/test/core/transport/chttp2/ping_abuse_policy_test.cc @@ -0,0 +1,111 @@ +// Copyright 2023 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "src/core/ext/transport/chttp2/transport/ping_abuse_policy.h" + +#include +#include + +#include "gtest/gtest.h" + +#include + +namespace grpc_core { +namespace { + +TEST(PingAbusePolicy, NoOp) { + Chttp2PingAbusePolicy policy{ChannelArgs()}; + EXPECT_EQ(policy.TestOnlyMaxPingStrikes(), 2); + EXPECT_EQ(policy.TestOnlyMinPingIntervalWithoutData(), Duration::Minutes(5)); +} + +TEST(PingAbusePolicy, WithChannelArgs) { + Chttp2PingAbusePolicy policy{ + ChannelArgs() + .Set(GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS, 100) + .Set(GRPC_ARG_HTTP2_MAX_PING_STRIKES, 42)}; + EXPECT_EQ(policy.TestOnlyMaxPingStrikes(), 42); + EXPECT_EQ(policy.TestOnlyMinPingIntervalWithoutData(), + Duration::Milliseconds(100)); +} + +TEST(PingAbusePolicy, ChannelArgsRangeCheck) { + Chttp2PingAbusePolicy policy{ + ChannelArgs() + .Set(GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS, -1000) + .Set(GRPC_ARG_HTTP2_MAX_PING_STRIKES, -100)}; + EXPECT_EQ(policy.TestOnlyMaxPingStrikes(), 0); + EXPECT_EQ(policy.TestOnlyMinPingIntervalWithoutData(), Duration::Zero()); +} + +TEST(PingAbusePolicy, BasicOut) { + Chttp2PingAbusePolicy policy{ChannelArgs()}; + EXPECT_EQ(policy.TestOnlyMaxPingStrikes(), 2); + // First ping ok + EXPECT_FALSE(policy.ReceivedOnePing(false)); + // Strike 1... too soon + EXPECT_FALSE(policy.ReceivedOnePing(false)); + // Strike 2... too soon + EXPECT_FALSE(policy.ReceivedOnePing(false)); + // Strike 3... you're out! + EXPECT_TRUE(policy.ReceivedOnePing(false)); +} + +TEST(PingAbusePolicy, TimePreventsOut) { + Chttp2PingAbusePolicy policy{ChannelArgs().Set( + GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS, 1000)}; + EXPECT_EQ(policy.TestOnlyMaxPingStrikes(), 2); + // First ping ok + EXPECT_FALSE(policy.ReceivedOnePing(false)); + // Strike 1... too soon + EXPECT_FALSE(policy.ReceivedOnePing(false)); + // Strike 2... too soon + EXPECT_FALSE(policy.ReceivedOnePing(false)); + // Sleep a bit, allowed + std::this_thread::sleep_for(std::chrono::seconds(2)); + EXPECT_FALSE(policy.ReceivedOnePing(false)); +} + +TEST(PingAbusePolicy, TimerSustains) { + Chttp2PingAbusePolicy policy{ChannelArgs().Set( + GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS, 10)}; + EXPECT_EQ(policy.TestOnlyMaxPingStrikes(), 2); + for (int i = 0; i < 100; i++) { + EXPECT_FALSE(policy.ReceivedOnePing(false)); + std::this_thread::sleep_for(std::chrono::milliseconds(20)); + } +} + +TEST(PingAbusePolicy, IdleIncreasesTimeout) { + Chttp2PingAbusePolicy policy{ChannelArgs().Set( + GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS, 1000)}; + EXPECT_EQ(policy.TestOnlyMaxPingStrikes(), 2); + // First ping ok + EXPECT_FALSE(policy.ReceivedOnePing(true)); + // Strike 1... too soon + EXPECT_FALSE(policy.ReceivedOnePing(true)); + // Strike 2... too soon + EXPECT_FALSE(policy.ReceivedOnePing(true)); + // Sleep a bit, allowed + std::this_thread::sleep_for(std::chrono::seconds(2)); + EXPECT_TRUE(policy.ReceivedOnePing(true)); +} + +} // namespace +} // namespace grpc_core + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/test/core/transport/chttp2/ping_configuration_test.cc b/test/core/transport/chttp2/ping_configuration_test.cc index bac71bc9efe72..5bc12bddaa069 100644 --- a/test/core/transport/chttp2/ping_configuration_test.cc +++ b/test/core/transport/chttp2/ping_configuration_test.cc @@ -15,11 +15,14 @@ #include "gtest/gtest.h" #include +#include #include #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/ext/transport/chttp2/transport/frame.h" #include "src/core/ext/transport/chttp2/transport/internal.h" +#include "src/core/ext/transport/chttp2/transport/ping_abuse_policy.h" +#include "src/core/ext/transport/chttp2/transport/ping_rate_policy.h" #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/event_engine/default_event_engine.h" #include "src/core/lib/experiments/config.h" @@ -57,7 +60,7 @@ TEST_F(ConfigurationTest, ClientKeepaliveDefaults) { EXPECT_EQ(t->keepalive_time, Duration::Infinity()); EXPECT_EQ(t->keepalive_timeout, Duration::Seconds(20)); EXPECT_EQ(t->keepalive_permit_without_calls, false); - EXPECT_EQ(t->ping_policy.max_pings_without_data, 2); + EXPECT_EQ(t->ping_rate_policy.TestOnlyMaxPingsWithoutData(), 2); grpc_transport_destroy(&t->base); } @@ -72,7 +75,7 @@ TEST_F(ConfigurationTest, ClientKeepaliveExplicitArgs) { EXPECT_EQ(t->keepalive_time, Duration::Seconds(20)); EXPECT_EQ(t->keepalive_timeout, Duration::Seconds(10)); EXPECT_EQ(t->keepalive_permit_without_calls, true); - EXPECT_EQ(t->ping_policy.max_pings_without_data, 3); + EXPECT_EQ(t->ping_rate_policy.TestOnlyMaxPingsWithoutData(), 3); grpc_transport_destroy(&t->base); } @@ -83,10 +86,11 @@ TEST_F(ConfigurationTest, ServerKeepaliveDefaults) { EXPECT_EQ(t->keepalive_time, Duration::Hours(2)); EXPECT_EQ(t->keepalive_timeout, Duration::Seconds(20)); EXPECT_EQ(t->keepalive_permit_without_calls, false); - EXPECT_EQ(t->ping_policy.max_pings_without_data, 2); - EXPECT_EQ(t->ping_policy.min_recv_ping_interval_without_data, + // Server never limits based on number of pings without data. + EXPECT_EQ(t->ping_rate_policy.TestOnlyMaxPingsWithoutData(), 0); + EXPECT_EQ(t->ping_abuse_policy.TestOnlyMinPingIntervalWithoutData(), Duration::Minutes(5)); - EXPECT_EQ(t->ping_policy.max_ping_strikes, 2); + EXPECT_EQ(t->ping_abuse_policy.TestOnlyMaxPingStrikes(), 2); grpc_transport_destroy(&t->base); } @@ -104,10 +108,11 @@ TEST_F(ConfigurationTest, ServerKeepaliveExplicitArgs) { EXPECT_EQ(t->keepalive_time, Duration::Seconds(20)); EXPECT_EQ(t->keepalive_timeout, Duration::Seconds(10)); EXPECT_EQ(t->keepalive_permit_without_calls, true); - EXPECT_EQ(t->ping_policy.max_pings_without_data, 3); - EXPECT_EQ(t->ping_policy.min_recv_ping_interval_without_data, + // Server never limits based on number of pings without data. + EXPECT_EQ(t->ping_rate_policy.TestOnlyMaxPingsWithoutData(), 0); + EXPECT_EQ(t->ping_abuse_policy.TestOnlyMinPingIntervalWithoutData(), Duration::Seconds(20)); - EXPECT_EQ(t->ping_policy.max_ping_strikes, 0); + EXPECT_EQ(t->ping_abuse_policy.TestOnlyMaxPingStrikes(), 0); grpc_transport_destroy(&t->base); } @@ -130,7 +135,7 @@ TEST_F(ConfigurationTest, ModifyClientDefaults) { EXPECT_EQ(t->keepalive_time, Duration::Seconds(20)); EXPECT_EQ(t->keepalive_timeout, Duration::Seconds(10)); EXPECT_EQ(t->keepalive_permit_without_calls, true); - EXPECT_EQ(t->ping_policy.max_pings_without_data, 3); + EXPECT_EQ(t->ping_rate_policy.TestOnlyMaxPingsWithoutData(), 3); grpc_transport_destroy(&t->base); } @@ -155,10 +160,11 @@ TEST_F(ConfigurationTest, ModifyServerDefaults) { EXPECT_EQ(t->keepalive_time, Duration::Seconds(20)); EXPECT_EQ(t->keepalive_timeout, Duration::Seconds(10)); EXPECT_EQ(t->keepalive_permit_without_calls, true); - EXPECT_EQ(t->ping_policy.max_pings_without_data, 3); - EXPECT_EQ(t->ping_policy.min_recv_ping_interval_without_data, + // Server never limits based on number of pings without data. + EXPECT_EQ(t->ping_rate_policy.TestOnlyMaxPingsWithoutData(), 0); + EXPECT_EQ(t->ping_abuse_policy.TestOnlyMinPingIntervalWithoutData(), Duration::Seconds(20)); - EXPECT_EQ(t->ping_policy.max_ping_strikes, 0); + EXPECT_EQ(t->ping_abuse_policy.TestOnlyMaxPingStrikes(), 0); grpc_transport_destroy(&t->base); } diff --git a/test/core/transport/chttp2/ping_rate_policy_test.cc b/test/core/transport/chttp2/ping_rate_policy_test.cc new file mode 100644 index 0000000000000..cbe05cd4f22e3 --- /dev/null +++ b/test/core/transport/chttp2/ping_rate_policy_test.cc @@ -0,0 +1,77 @@ +// Copyright 2023 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "src/core/ext/transport/chttp2/transport/ping_rate_policy.h" + +#include +#include + +#include "gtest/gtest.h" + +namespace grpc_core { +namespace { + +Chttp2PingRatePolicy::RequestSendPingResult SendGranted() { + return Chttp2PingRatePolicy::SendGranted{}; +} + +Chttp2PingRatePolicy::RequestSendPingResult TooManyRecentPings() { + return Chttp2PingRatePolicy::TooManyRecentPings{}; +} + +TEST(PingRatePolicy, NoOpClient) { + Chttp2PingRatePolicy policy{ChannelArgs(), true}; + EXPECT_EQ(policy.TestOnlyMaxPingsWithoutData(), 2); +} + +TEST(PingRatePolicy, NoOpServer) { + Chttp2PingRatePolicy policy{ChannelArgs(), false}; + EXPECT_EQ(policy.TestOnlyMaxPingsWithoutData(), 0); +} + +TEST(PingRatePolicy, ServerCanSendAtStart) { + Chttp2PingRatePolicy policy{ChannelArgs(), false}; + EXPECT_EQ(policy.RequestSendPing(Duration::Milliseconds(100)), SendGranted()); +} + +TEST(PingRatePolicy, ClientBlockedUntilDataSent) { + Chttp2PingRatePolicy policy{ChannelArgs(), true}; + EXPECT_EQ(policy.RequestSendPing(Duration::Milliseconds(10)), + TooManyRecentPings()); + policy.ResetPingsBeforeDataRequired(); + EXPECT_EQ(policy.RequestSendPing(Duration::Milliseconds(10)), SendGranted()); + EXPECT_EQ(policy.RequestSendPing(Duration::Zero()), SendGranted()); + EXPECT_EQ(policy.RequestSendPing(Duration::Zero()), TooManyRecentPings()); +} + +TEST(PingRatePolicy, RateThrottlingWorks) { + Chttp2PingRatePolicy policy{ChannelArgs(), false}; + // Observe that we can fail if we send in a tight loop + while (policy.RequestSendPing(Duration::Milliseconds(10)) == SendGranted()) { + } + // Observe that we can succeed if we wait a bit between pings + for (int i = 0; i < 100; i++) { + std::this_thread::sleep_for(std::chrono::milliseconds(20)); + EXPECT_EQ(policy.RequestSendPing(Duration::Milliseconds(10)), + SendGranted()); + } +} + +} // namespace +} // namespace grpc_core + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/test/core/transport/chttp2/remove_stream_from_stalled_lists_test.cc b/test/core/transport/chttp2/remove_stream_from_stalled_lists_test.cc index b1fc3b3a4f20f..95092f9ff8ad4 100644 --- a/test/core/transport/chttp2/remove_stream_from_stalled_lists_test.cc +++ b/test/core/transport/chttp2/remove_stream_from_stalled_lists_test.cc @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include diff --git a/test/core/transport/chttp2/settings_timeout_test.cc b/test/core/transport/chttp2/settings_timeout_test.cc index ddeef1d64dfd7..58f1869f0f781 100644 --- a/test/core/transport/chttp2/settings_timeout_test.cc +++ b/test/core/transport/chttp2/settings_timeout_test.cc @@ -31,6 +31,7 @@ #include #include +#include #include #include #include diff --git a/test/core/transport/chttp2/stream_leak_with_queued_flow_control_update_test.cc b/test/core/transport/chttp2/stream_leak_with_queued_flow_control_update_test.cc index 2ab3b4fb63dbb..0c3aed882cfbb 100644 --- a/test/core/transport/chttp2/stream_leak_with_queued_flow_control_update_test.cc +++ b/test/core/transport/chttp2/stream_leak_with_queued_flow_control_update_test.cc @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/test/core/transport/chttp2/streams_not_seen_test.cc b/test/core/transport/chttp2/streams_not_seen_test.cc index 1d7ebfd335357..a67c5ccbc2c46 100644 --- a/test/core/transport/chttp2/streams_not_seen_test.cc +++ b/test/core/transport/chttp2/streams_not_seen_test.cc @@ -42,6 +42,7 @@ #include #include +#include #include #include #include diff --git a/test/core/transport/chttp2/too_many_pings_test.cc b/test/core/transport/chttp2/too_many_pings_test.cc index 2858e74a216c8..d888f9a1aabb8 100644 --- a/test/core/transport/chttp2/too_many_pings_test.cc +++ b/test/core/transport/chttp2/too_many_pings_test.cc @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index 292bfaa66a3ce..80e284fc7cf37 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -895,6 +895,7 @@ include/grpc/grpc_audit_logging.h \ include/grpc/grpc_posix.h \ include/grpc/grpc_security.h \ include/grpc/grpc_security_constants.h \ +include/grpc/impl/channel_arg_names.h \ include/grpc/impl/codegen/atm.h \ include/grpc/impl/codegen/atm_gcc_atomic.h \ include/grpc/impl/codegen/atm_gcc_sync.h \ diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 0482efeb35de1..4e3efe3e04403 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -895,6 +895,7 @@ include/grpc/grpc_audit_logging.h \ include/grpc/grpc_posix.h \ include/grpc/grpc_security.h \ include/grpc/grpc_security_constants.h \ +include/grpc/impl/channel_arg_names.h \ include/grpc/impl/codegen/atm.h \ include/grpc/impl/codegen/atm_gcc_atomic.h \ include/grpc/impl/codegen/atm_gcc_sync.h \ @@ -1312,6 +1313,10 @@ src/core/ext/transport/chttp2/transport/huffsyms.cc \ src/core/ext/transport/chttp2/transport/huffsyms.h \ src/core/ext/transport/chttp2/transport/internal.h \ src/core/ext/transport/chttp2/transport/parsing.cc \ +src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc \ +src/core/ext/transport/chttp2/transport/ping_abuse_policy.h \ +src/core/ext/transport/chttp2/transport/ping_rate_policy.cc \ +src/core/ext/transport/chttp2/transport/ping_rate_policy.h \ src/core/ext/transport/chttp2/transport/stream_lists.cc \ src/core/ext/transport/chttp2/transport/varint.cc \ src/core/ext/transport/chttp2/transport/varint.h \ diff --git a/tools/doxygen/Doxyfile.core b/tools/doxygen/Doxyfile.core index 41008ce4415a8..89dabe26317cd 100644 --- a/tools/doxygen/Doxyfile.core +++ b/tools/doxygen/Doxyfile.core @@ -828,6 +828,7 @@ include/grpc/grpc_audit_logging.h \ include/grpc/grpc_posix.h \ include/grpc/grpc_security.h \ include/grpc/grpc_security_constants.h \ +include/grpc/impl/channel_arg_names.h \ include/grpc/impl/codegen/atm.h \ include/grpc/impl/codegen/atm_gcc_atomic.h \ include/grpc/impl/codegen/atm_gcc_sync.h \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index e1778392a6213..e778bb99a8e77 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -828,6 +828,7 @@ include/grpc/grpc_audit_logging.h \ include/grpc/grpc_posix.h \ include/grpc/grpc_security.h \ include/grpc/grpc_security_constants.h \ +include/grpc/impl/channel_arg_names.h \ include/grpc/impl/codegen/atm.h \ include/grpc/impl/codegen/atm_gcc_atomic.h \ include/grpc/impl/codegen/atm_gcc_sync.h \ @@ -1088,6 +1089,10 @@ src/core/ext/transport/chttp2/transport/huffsyms.cc \ src/core/ext/transport/chttp2/transport/huffsyms.h \ src/core/ext/transport/chttp2/transport/internal.h \ src/core/ext/transport/chttp2/transport/parsing.cc \ +src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc \ +src/core/ext/transport/chttp2/transport/ping_abuse_policy.h \ +src/core/ext/transport/chttp2/transport/ping_rate_policy.cc \ +src/core/ext/transport/chttp2/transport/ping_rate_policy.h \ src/core/ext/transport/chttp2/transport/stream_lists.cc \ src/core/ext/transport/chttp2/transport/varint.cc \ src/core/ext/transport/chttp2/transport/varint.h \ diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index c96618b14d961..04210d5b1c9d4 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -6339,6 +6339,30 @@ ], "uses_polling": true }, + { + "args": [], + "benchmark": false, + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": true, + "language": "c++", + "name": "ping_abuse_policy_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "uses_polling": false + }, { "args": [], "benchmark": false, @@ -6387,6 +6411,30 @@ ], "uses_polling": true }, + { + "args": [], + "benchmark": false, + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": true, + "language": "c++", + "name": "ping_rate_policy_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "uses_polling": false + }, { "args": [], "benchmark": false, From 8c2c35785e8c3be4e4bfa49d2dab0034b6cc2a53 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 26 Jul 2023 13:16:10 -0700 Subject: [PATCH 054/205] [chttp2] Fix for when global config is overridden via InitGoogleTest (#33885) (should unblock the current import) --- test/core/transport/chttp2/ping_abuse_policy_test.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/core/transport/chttp2/ping_abuse_policy_test.cc b/test/core/transport/chttp2/ping_abuse_policy_test.cc index 279158fb370f5..f11e1f268e55d 100644 --- a/test/core/transport/chttp2/ping_abuse_policy_test.cc +++ b/test/core/transport/chttp2/ping_abuse_policy_test.cc @@ -107,5 +107,11 @@ TEST(PingAbusePolicy, IdleIncreasesTimeout) { int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); + // hardcode expected defaults so we don't account for external configuration + grpc_core::Chttp2PingAbusePolicy::SetDefaults( + grpc_core::ChannelArgs() + .Set(GRPC_ARG_HTTP2_MAX_PING_STRIKES, 2) + .Set(GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS, + grpc_core::Duration::Minutes(5).millis())); return RUN_ALL_TESTS(); } From dd3279ab53dd6fb97e9b61dd4dff3d86d51f1580 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 26 Jul 2023 14:47:31 -0700 Subject: [PATCH 055/205] [promises] Fix ordering problems shown up deploying experiment internally (#33779) Resolves a set of failures seen rolling out promises - we need to read all of the incoming payload before doing request matching. --------- Co-authored-by: ctiller --- BUILD | 2 -- Package.swift | 2 -- build_autogenerated.yaml | 10 ++---- gRPC-C++.podspec | 4 --- gRPC-Core.podspec | 4 --- grpc.gemspec | 2 -- package.xml | 2 -- src/core/lib/surface/server.cc | 52 +++++++++++++++++----------- tools/doxygen/Doxyfile.c++.internal | 2 -- tools/doxygen/Doxyfile.core.internal | 2 -- 10 files changed, 34 insertions(+), 48 deletions(-) diff --git a/BUILD b/BUILD index 1b81c905824f8..37f59e2115c19 100644 --- a/BUILD +++ b/BUILD @@ -1534,7 +1534,6 @@ grpc_cc_library( "//src/core:arena", "//src/core:arena_promise", "//src/core:atomic_utils", - "//src/core:basic_join", "//src/core:basic_seq", "//src/core:bitset", "//src/core:cancel_callback", @@ -1603,7 +1602,6 @@ grpc_cc_library( "//src/core:thread_quota", "//src/core:time", "//src/core:transport_fwd", - "//src/core:try_join", "//src/core:try_seq", "//src/core:type_list", "//src/core:useful", diff --git a/Package.swift b/Package.swift index 62ca96e64a41c..b712cd822d941 100644 --- a/Package.swift +++ b/Package.swift @@ -1442,7 +1442,6 @@ let package = Package( "src/core/lib/promise/arena_promise.h", "src/core/lib/promise/cancel_callback.h", "src/core/lib/promise/context.h", - "src/core/lib/promise/detail/basic_join.h", "src/core/lib/promise/detail/basic_seq.h", "src/core/lib/promise/detail/promise_factory.h", "src/core/lib/promise/detail/promise_like.h", @@ -1467,7 +1466,6 @@ let package = Package( "src/core/lib/promise/sleep.h", "src/core/lib/promise/trace.cc", "src/core/lib/promise/trace.h", - "src/core/lib/promise/try_join.h", "src/core/lib/promise/try_seq.h", "src/core/lib/resolver/resolver.cc", "src/core/lib/resolver/resolver.h", diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index d7a2af54dd2cf..4be7bf55a5a6c 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -853,7 +853,6 @@ libs: - src/core/lib/promise/arena_promise.h - src/core/lib/promise/cancel_callback.h - src/core/lib/promise/context.h - - src/core/lib/promise/detail/basic_join.h - src/core/lib/promise/detail/basic_seq.h - src/core/lib/promise/detail/promise_factory.h - src/core/lib/promise/detail/promise_like.h @@ -875,7 +874,6 @@ libs: - src/core/lib/promise/seq.h - src/core/lib/promise/sleep.h - src/core/lib/promise/trace.h - - src/core/lib/promise/try_join.h - src/core/lib/promise/try_seq.h - src/core/lib/resolver/resolver.h - src/core/lib/resolver/resolver_factory.h @@ -2249,7 +2247,6 @@ libs: - src/core/lib/promise/arena_promise.h - src/core/lib/promise/cancel_callback.h - src/core/lib/promise/context.h - - src/core/lib/promise/detail/basic_join.h - src/core/lib/promise/detail/basic_seq.h - src/core/lib/promise/detail/promise_factory.h - src/core/lib/promise/detail/promise_like.h @@ -2271,7 +2268,6 @@ libs: - src/core/lib/promise/seq.h - src/core/lib/promise/sleep.h - src/core/lib/promise/trace.h - - src/core/lib/promise/try_join.h - src/core/lib/promise/try_seq.h - src/core/lib/resolver/resolver.h - src/core/lib/resolver/resolver_factory.h @@ -3753,7 +3749,6 @@ libs: - src/core/lib/promise/arena_promise.h - src/core/lib/promise/cancel_callback.h - src/core/lib/promise/context.h - - src/core/lib/promise/detail/basic_join.h - src/core/lib/promise/detail/basic_seq.h - src/core/lib/promise/detail/promise_factory.h - src/core/lib/promise/detail/promise_like.h @@ -3773,7 +3768,6 @@ libs: - src/core/lib/promise/race.h - src/core/lib/promise/seq.h - src/core/lib/promise/trace.h - - src/core/lib/promise/try_join.h - src/core/lib/promise/try_seq.h - src/core/lib/resolver/resolver.h - src/core/lib/resolver/resolver_factory.h @@ -8274,7 +8268,6 @@ targets: - src/core/lib/promise/arena_promise.h - src/core/lib/promise/cancel_callback.h - src/core/lib/promise/context.h - - src/core/lib/promise/detail/basic_join.h - src/core/lib/promise/detail/basic_seq.h - src/core/lib/promise/detail/promise_factory.h - src/core/lib/promise/detail/promise_like.h @@ -8294,7 +8287,6 @@ targets: - src/core/lib/promise/race.h - src/core/lib/promise/seq.h - src/core/lib/promise/trace.h - - src/core/lib/promise/try_join.h - src/core/lib/promise/try_seq.h - src/core/lib/resolver/resolver.h - src/core/lib/resolver/resolver_factory.h @@ -11449,6 +11441,7 @@ targets: build: test language: c++ headers: + - src/core/lib/promise/detail/basic_join.h - src/core/lib/promise/join.h - test/core/promise/test_wakeup_schedulers.h src: @@ -11584,6 +11577,7 @@ targets: build: test language: c++ headers: + - src/core/lib/promise/detail/basic_join.h - src/core/lib/promise/join.h - src/core/lib/transport/promise_endpoint.h - test/core/promise/test_wakeup_schedulers.h diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index a32da7153857f..0ff4a85975684 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -947,7 +947,6 @@ Pod::Spec.new do |s| 'src/core/lib/promise/arena_promise.h', 'src/core/lib/promise/cancel_callback.h', 'src/core/lib/promise/context.h', - 'src/core/lib/promise/detail/basic_join.h', 'src/core/lib/promise/detail/basic_seq.h', 'src/core/lib/promise/detail/promise_factory.h', 'src/core/lib/promise/detail/promise_like.h', @@ -969,7 +968,6 @@ Pod::Spec.new do |s| 'src/core/lib/promise/seq.h', 'src/core/lib/promise/sleep.h', 'src/core/lib/promise/trace.h', - 'src/core/lib/promise/try_join.h', 'src/core/lib/promise/try_seq.h', 'src/core/lib/resolver/resolver.h', 'src/core/lib/resolver/resolver_factory.h', @@ -1998,7 +1996,6 @@ Pod::Spec.new do |s| 'src/core/lib/promise/arena_promise.h', 'src/core/lib/promise/cancel_callback.h', 'src/core/lib/promise/context.h', - 'src/core/lib/promise/detail/basic_join.h', 'src/core/lib/promise/detail/basic_seq.h', 'src/core/lib/promise/detail/promise_factory.h', 'src/core/lib/promise/detail/promise_like.h', @@ -2020,7 +2017,6 @@ Pod::Spec.new do |s| 'src/core/lib/promise/seq.h', 'src/core/lib/promise/sleep.h', 'src/core/lib/promise/trace.h', - 'src/core/lib/promise/try_join.h', 'src/core/lib/promise/try_seq.h', 'src/core/lib/resolver/resolver.h', 'src/core/lib/resolver/resolver_factory.h', diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index a2b15673bf4fb..1f7ee059f5212 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -1543,7 +1543,6 @@ Pod::Spec.new do |s| 'src/core/lib/promise/arena_promise.h', 'src/core/lib/promise/cancel_callback.h', 'src/core/lib/promise/context.h', - 'src/core/lib/promise/detail/basic_join.h', 'src/core/lib/promise/detail/basic_seq.h', 'src/core/lib/promise/detail/promise_factory.h', 'src/core/lib/promise/detail/promise_like.h', @@ -1568,7 +1567,6 @@ Pod::Spec.new do |s| 'src/core/lib/promise/sleep.h', 'src/core/lib/promise/trace.cc', 'src/core/lib/promise/trace.h', - 'src/core/lib/promise/try_join.h', 'src/core/lib/promise/try_seq.h', 'src/core/lib/resolver/resolver.cc', 'src/core/lib/resolver/resolver.h', @@ -2733,7 +2731,6 @@ Pod::Spec.new do |s| 'src/core/lib/promise/arena_promise.h', 'src/core/lib/promise/cancel_callback.h', 'src/core/lib/promise/context.h', - 'src/core/lib/promise/detail/basic_join.h', 'src/core/lib/promise/detail/basic_seq.h', 'src/core/lib/promise/detail/promise_factory.h', 'src/core/lib/promise/detail/promise_like.h', @@ -2755,7 +2752,6 @@ Pod::Spec.new do |s| 'src/core/lib/promise/seq.h', 'src/core/lib/promise/sleep.h', 'src/core/lib/promise/trace.h', - 'src/core/lib/promise/try_join.h', 'src/core/lib/promise/try_seq.h', 'src/core/lib/resolver/resolver.h', 'src/core/lib/resolver/resolver_factory.h', diff --git a/grpc.gemspec b/grpc.gemspec index 67a4bfcf084a6..8eecc38bea735 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -1448,7 +1448,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/promise/arena_promise.h ) s.files += %w( src/core/lib/promise/cancel_callback.h ) s.files += %w( src/core/lib/promise/context.h ) - s.files += %w( src/core/lib/promise/detail/basic_join.h ) s.files += %w( src/core/lib/promise/detail/basic_seq.h ) s.files += %w( src/core/lib/promise/detail/promise_factory.h ) s.files += %w( src/core/lib/promise/detail/promise_like.h ) @@ -1473,7 +1472,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/promise/sleep.h ) s.files += %w( src/core/lib/promise/trace.cc ) s.files += %w( src/core/lib/promise/trace.h ) - s.files += %w( src/core/lib/promise/try_join.h ) s.files += %w( src/core/lib/promise/try_seq.h ) s.files += %w( src/core/lib/resolver/resolver.cc ) s.files += %w( src/core/lib/resolver/resolver.h ) diff --git a/package.xml b/package.xml index 7a21ab7ac7d8a..00f44d11922be 100644 --- a/package.xml +++ b/package.xml @@ -1430,7 +1430,6 @@ - @@ -1455,7 +1454,6 @@ - diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc index e2a2bbca1f78a..264d8e9ba1cfa 100644 --- a/src/core/lib/surface/server.cc +++ b/src/core/lib/surface/server.cc @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -62,13 +61,11 @@ #include "src/core/lib/iomgr/pollset_set.h" #include "src/core/lib/promise/activity.h" #include "src/core/lib/promise/context.h" -#include "src/core/lib/promise/detail/basic_join.h" #include "src/core/lib/promise/detail/basic_seq.h" #include "src/core/lib/promise/map.h" #include "src/core/lib/promise/pipe.h" #include "src/core/lib/promise/poll.h" #include "src/core/lib/promise/promise.h" -#include "src/core/lib/promise/try_join.h" #include "src/core/lib/promise/try_seq.h" #include "src/core/lib/slice/slice_buffer.h" #include "src/core/lib/slice/slice_internal.h" @@ -322,19 +319,18 @@ class Server::RealRequestMatcher : public RequestMatcherInterface { while (true) { NextPendingCall next_pending = pop_next_pending(); if (next_pending.rc == nullptr) break; - auto mr = MatchResult(server(), request_queue_index, next_pending.rc); Match( next_pending.pending, - [&mr](CallData* calld) { + [&](CallData* calld) { if (!calld->MaybeActivate()) { // Zombied Call calld->KillZombie(); } else { - calld->Publish(mr.cq_idx(), mr.TakeCall()); + calld->Publish(request_queue_index, next_pending.rc); } }, - [&mr](const std::shared_ptr& w) { - w->Finish(std::move(mr)); + [&](const std::shared_ptr& w) { + w->Finish(server(), request_queue_index, next_pending.rc); }); } } @@ -430,8 +426,14 @@ class Server::RealRequestMatcher : public RequestMatcherInterface { struct ActivityWaiter { explicit ActivityWaiter(Waker waker) : waker(std::move(waker)) {} ~ActivityWaiter() { delete result.load(std::memory_order_acquire); } - void Finish(absl::StatusOr r) { - result.store(new absl::StatusOr(std::move(r)), + void Finish(absl::Status status) { + result.store(new absl::StatusOr(std::move(status)), + std::memory_order_release); + waker.Wakeup(); + } + void Finish(Server* server, size_t cq_idx, RequestedCall* requested_call) { + result.store(new absl::StatusOr( + MatchResult(server, cq_idx, requested_call)), std::memory_order_release); waker.Wakeup(); } @@ -1336,22 +1338,32 @@ ArenaPromise Server::ChannelData::MakeCallPromise( matcher = server->unregistered_request_matcher_.get(); } return TrySeq( - TryJoin(matcher->MatchRequest(chand->cq_idx()), - std::move(maybe_read_first_message)), - [path = std::move(*path), host_ptr, deadline, - call_args = std::move(call_args)]( - std::tuple> - match_result_and_payload) mutable { - auto& mr = std::get<0>(match_result_and_payload); - auto& payload = std::get<1>(match_result_and_payload); + std::move(maybe_read_first_message), + [matcher, chand](NextResult payload) { + return Map( + matcher->MatchRequest(chand->cq_idx()), + [payload = std::move(payload)]( + absl::StatusOr mr) mutable + -> absl::StatusOr>> { + if (!mr.ok()) return mr.status(); + return std::make_pair(std::move(*mr), std::move(payload)); + }); + }, + [host_ptr, path = std::move(path), deadline, + call_args = + std::move(call_args)](std::pair> + r) mutable { + auto& mr = r.first; + auto& payload = r.second; auto* rc = mr.TakeCall(); auto* cq_for_new_request = mr.cq(); switch (rc->type) { case RequestedCall::Type::BATCH_CALL: GPR_ASSERT(!payload.has_value()); rc->data.batch.details->host = CSliceRef(host_ptr->c_slice()); - rc->data.batch.details->method = CSliceRef(path.c_slice()); + rc->data.batch.details->method = CSliceRef(path->c_slice()); rc->data.batch.details->deadline = deadline.as_timespec(GPR_CLOCK_MONOTONIC); break; diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 4e3efe3e04403..ab7809664f8a2 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -2445,7 +2445,6 @@ src/core/lib/promise/activity.h \ src/core/lib/promise/arena_promise.h \ src/core/lib/promise/cancel_callback.h \ src/core/lib/promise/context.h \ -src/core/lib/promise/detail/basic_join.h \ src/core/lib/promise/detail/basic_seq.h \ src/core/lib/promise/detail/promise_factory.h \ src/core/lib/promise/detail/promise_like.h \ @@ -2470,7 +2469,6 @@ src/core/lib/promise/sleep.cc \ src/core/lib/promise/sleep.h \ src/core/lib/promise/trace.cc \ src/core/lib/promise/trace.h \ -src/core/lib/promise/try_join.h \ src/core/lib/promise/try_seq.h \ src/core/lib/resolver/resolver.cc \ src/core/lib/resolver/resolver.h \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index e778bb99a8e77..d5b0b9258ab8a 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -2226,7 +2226,6 @@ src/core/lib/promise/activity.h \ src/core/lib/promise/arena_promise.h \ src/core/lib/promise/cancel_callback.h \ src/core/lib/promise/context.h \ -src/core/lib/promise/detail/basic_join.h \ src/core/lib/promise/detail/basic_seq.h \ src/core/lib/promise/detail/promise_factory.h \ src/core/lib/promise/detail/promise_like.h \ @@ -2251,7 +2250,6 @@ src/core/lib/promise/sleep.cc \ src/core/lib/promise/sleep.h \ src/core/lib/promise/trace.cc \ src/core/lib/promise/trace.h \ -src/core/lib/promise/try_join.h \ src/core/lib/promise/try_seq.h \ src/core/lib/resolver/resolver.cc \ src/core/lib/resolver/resolver.h \ From 7524e899d145ea17eb0a7df6036f00c758daf37f Mon Sep 17 00:00:00 2001 From: Yijie Ma Date: Wed, 26 Jul 2023 15:06:17 -0700 Subject: [PATCH 056/205] Revert "[CI breakage] Skip some dns tests as a temporary workaround" (#33882) Reverts grpc/grpc#33819 Verified that it passed these jobs: `grpc/core/master/linux/grpc_basictests_c_cpp_dbg` `grpc/core/master/linux/grpc_basictests_c_cpp_opt` `grpc/core/master/linux/grpc_portability` --- .../event_engine/test_suite/tests/dns_test.cc | 49 +------------------ 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/test/core/event_engine/test_suite/tests/dns_test.cc b/test/core/event_engine/test_suite/tests/dns_test.cc index b8dd6abbc1428..cbd48e26bc775 100644 --- a/test/core/event_engine/test_suite/tests/dns_test.cc +++ b/test/core/event_engine/test_suite/tests/dns_test.cc @@ -142,12 +142,7 @@ class EventEngineDNSTest : public EventEngineTest { }); int status = health_check.Join(); // TODO(yijiem): make this portable for Windows - // TODO(yijiem): remove the if block and reenable the ASSERT_TRUE below once - // we have added twisted to the docker images. - if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) { - skip_end2end_tests_ = true; - } - // ASSERT_TRUE(WIFEXITED(status) && WEXITSTATUS(status) == 0); + ASSERT_TRUE(WIFEXITED(status) && WEXITSTATUS(status) == 0); } static void TearDownTestSuite() { @@ -191,7 +186,6 @@ class EventEngineDNSTest : public EventEngineTest { grpc::SubProcess* server_process; }; grpc_core::Notification dns_resolver_signal_; - static bool skip_end2end_tests_; private: static DNSServer dns_server_; @@ -199,13 +193,8 @@ class EventEngineDNSTest : public EventEngineTest { }; EventEngineDNSTest::DNSServer EventEngineDNSTest::dns_server_; -bool EventEngineDNSTest::skip_end2end_tests_ = false; TEST_F(EventEngineDNSTest, QueryNXHostname) { - // TODO(yijiem): remove once the docker images are fixed. - if (skip_end2end_tests_) { - GTEST_SKIP(); - } auto dns_resolver = CreateDefaultDNSResolver(); dns_resolver->LookupHostname( [this](auto result) { @@ -221,10 +210,6 @@ TEST_F(EventEngineDNSTest, QueryNXHostname) { } TEST_F(EventEngineDNSTest, QueryWithIPLiteral) { - // TODO(yijiem): remove once the docker images are fixed. - if (skip_end2end_tests_) { - GTEST_SKIP(); - } auto dns_resolver = CreateDefaultDNSResolver(); dns_resolver->LookupHostname( [this](auto result) { @@ -240,10 +225,6 @@ TEST_F(EventEngineDNSTest, QueryWithIPLiteral) { } TEST_F(EventEngineDNSTest, QueryARecord) { - // TODO(yijiem): remove once the docker images are fixed. - if (skip_end2end_tests_) { - GTEST_SKIP(); - } auto dns_resolver = CreateDefaultDNSResolver(); dns_resolver->LookupHostname( [this](auto result) { @@ -261,10 +242,6 @@ TEST_F(EventEngineDNSTest, QueryARecord) { } TEST_F(EventEngineDNSTest, QueryAAAARecord) { - // TODO(yijiem): remove once the docker images are fixed. - if (skip_end2end_tests_) { - GTEST_SKIP(); - } auto dns_resolver = CreateDefaultDNSResolver(); dns_resolver->LookupHostname( [this](auto result) { @@ -285,10 +262,6 @@ TEST_F(EventEngineDNSTest, QueryAAAARecord) { } TEST_F(EventEngineDNSTest, TestAddressSorting) { - // TODO(yijiem): remove once the docker images are fixed. - if (skip_end2end_tests_) { - GTEST_SKIP(); - } auto dns_resolver = CreateDefaultDNSResolver(); dns_resolver->LookupHostname( [this](auto result) { @@ -306,10 +279,6 @@ TEST_F(EventEngineDNSTest, TestAddressSorting) { } TEST_F(EventEngineDNSTest, QuerySRVRecord) { - // TODO(yijiem): remove once the docker images are fixed. - if (skip_end2end_tests_) { - GTEST_SKIP(); - } const SRVRecord kExpectedRecords[] = { {/*host=*/"ipv4-only-multi-target.dns-test.event-engine", /*port=*/1234, /*priority=*/0, /*weight=*/0}, @@ -328,10 +297,6 @@ TEST_F(EventEngineDNSTest, QuerySRVRecord) { } TEST_F(EventEngineDNSTest, QuerySRVRecordWithLocalhost) { - // TODO(yijiem): remove once the docker images are fixed. - if (skip_end2end_tests_) { - GTEST_SKIP(); - } auto dns_resolver = CreateDefaultDNSResolver(); dns_resolver->LookupSRV( [this](auto result) { @@ -344,10 +309,6 @@ TEST_F(EventEngineDNSTest, QuerySRVRecordWithLocalhost) { } TEST_F(EventEngineDNSTest, QueryTXTRecord) { - // TODO(yijiem): remove once the docker images are fixed. - if (skip_end2end_tests_) { - GTEST_SKIP(); - } // clang-format off const std::string kExpectedRecord = "grpc_config=[{" @@ -377,10 +338,6 @@ TEST_F(EventEngineDNSTest, QueryTXTRecord) { } TEST_F(EventEngineDNSTest, QueryTXTRecordWithLocalhost) { - // TODO(yijiem): remove once the docker images are fixed. - if (skip_end2end_tests_) { - GTEST_SKIP(); - } auto dns_resolver = CreateDefaultDNSResolver(); dns_resolver->LookupTXT( [this](auto result) { @@ -393,10 +350,6 @@ TEST_F(EventEngineDNSTest, QueryTXTRecordWithLocalhost) { } TEST_F(EventEngineDNSTest, TestCancelActiveDNSQuery) { - // TODO(yijiem): remove once the docker images are fixed. - if (skip_end2end_tests_) { - GTEST_SKIP(); - } const std::string name = "dont-care-since-wont-be-resolved.test.com:1234"; auto dns_resolver = CreateDNSResolverWithNonResponsiveServer(); dns_resolver->LookupHostname( From 4477930b6cced153038d34dc761ab1061fd59ff2 Mon Sep 17 00:00:00 2001 From: Xuan Wang Date: Wed, 26 Jul 2023 16:02:50 -0700 Subject: [PATCH 057/205] [distribute] Add LICENSE to python ancillary packages. (#33574) Fix: #33557 ### Testing * Verified through `distribtests_python` that `LICENSE` file exists in both [.tar.gz](https://storage.googleapis.com/grpc-testing-kokoro-prod/test_result_public/prod/grpc/core/pull_request/linux/f69791e2-b7fd-4729-b55e-caca9171a170/1/20230629-092736/github/grpc/artifacts/grpcio-status-1.57.0.dev0.tar.gz) and [.whl](https://storage.googleapis.com/grpc-testing-kokoro-prod/test_result_public/prod/grpc/core/pull_request/linux/f69791e2-b7fd-4729-b55e-caca9171a170/1/20230629-092736/github/grpc/artifacts/grpcio_status-1.57.0.dev0-py3-none-any.whl). --- .../run_tests/artifacts/build_artifact_python.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/run_tests/artifacts/build_artifact_python.sh b/tools/run_tests/artifacts/build_artifact_python.sh index a09f25af7efb9..ce3cff865eee7 100755 --- a/tools/run_tests/artifacts/build_artifact_python.sh +++ b/tools/run_tests/artifacts/build_artifact_python.sh @@ -81,6 +81,21 @@ then export GRPC_BUILD_OVERRIDE_BORING_SSL_ASM_PLATFORM="linux-arm" fi +ancillary_package_dir=( + "src/python/grpcio_admin/" + "src/python/grpcio_channelz/" + "src/python/grpcio_csds/" + "src/python/grpcio_health_checking/" + "src/python/grpcio_reflection/" + "src/python/grpcio_status/" + "src/python/grpcio_testing/" +) + +# Copy license to ancillary package directories so it will be distributed. +for directory in "${ancillary_package_dir[@]}"; do + cp "LICENSE" "${directory}" +done + # Build the source distribution first because MANIFEST.in cannot override # exclusion of built shared objects among package resources (for some # inexplicable reason). From 5974ea7553f0fe4e0ee8f965f0cd951c08aa1c10 Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Thu, 27 Jul 2023 08:37:38 -0700 Subject: [PATCH 058/205] [interop] Add v1.57.0 release of grpc-go to interop matrix, and v1.56.2 (#33886) --- tools/interop_matrix/client_matrix.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/interop_matrix/client_matrix.py b/tools/interop_matrix/client_matrix.py index e37fe5d8de4cd..42097820840f2 100644 --- a/tools/interop_matrix/client_matrix.py +++ b/tools/interop_matrix/client_matrix.py @@ -286,6 +286,8 @@ def __init__(self, patch=[], runtimes=[], testcases_file=None): ("v1.53.0", ReleaseInfo(runtimes=["go1.19"])), ("v1.54.1", ReleaseInfo(runtimes=["go1.19"])), ("v1.55.0", ReleaseInfo(runtimes=["go1.19"])), + ("v1.56.2", ReleaseInfo(runtimes=["go1.19"])), + ("v1.57.0", ReleaseInfo(runtimes=["go1.19"])), ] ), "java": OrderedDict( From cb003bb1e33199eb8b7990da58320d4d8b34ccf9 Mon Sep 17 00:00:00 2001 From: Alisha Nanda Date: Thu, 27 Jul 2023 09:42:33 -0700 Subject: [PATCH 059/205] [tracing] Add new RecordAnnotation method to CallTracer API (#33696) Adding a new method for custom Annotation types (per design suggested in #33649) to unblock metadata annotation. --- src/core/lib/channel/call_tracer.h | 20 ++++++++++++ src/cpp/ext/filters/census/client_filter.cc | 31 +++++++++++++++++-- .../filters/census/open_census_call_tracer.h | 2 ++ .../ext/filters/census/server_call_tracer.cc | 14 +++++++++ src/cpp/ext/otel/otel_call_tracer.h | 2 ++ src/cpp/ext/otel/otel_client_filter.cc | 10 ++++++ src/cpp/ext/otel/otel_server_call_tracer.cc | 4 +++ 7 files changed, 81 insertions(+), 2 deletions(-) diff --git a/src/core/lib/channel/call_tracer.h b/src/core/lib/channel/call_tracer.h index 3b2a94faaf449..0e291a6a557ea 100644 --- a/src/core/lib/channel/call_tracer.h +++ b/src/core/lib/channel/call_tracer.h @@ -49,11 +49,31 @@ namespace grpc_core { // The base class for all tracer implementations. class CallTracerAnnotationInterface { public: + // Enum associated with types of Annotations. + enum class AnnotationType { + kDoNotUse_MustBeLast, + }; + + // Base class to define a new type of annotation. + class Annotation { + public: + explicit Annotation(AnnotationType type) : type_(type) {} + AnnotationType type() const { return type_; } + virtual std::string ToString() const = 0; + + protected: + ~Annotation() {} + + private: + const AnnotationType type_; + }; + virtual ~CallTracerAnnotationInterface() {} // Records an annotation on the call attempt. // TODO(yashykt): If needed, extend this to attach attributes with // annotations. virtual void RecordAnnotation(absl::string_view annotation) = 0; + virtual void RecordAnnotation(const Annotation& annotation) = 0; virtual std::string TraceId() = 0; virtual std::string SpanId() = 0; virtual bool IsSampled() = 0; diff --git a/src/cpp/ext/filters/census/client_filter.cc b/src/cpp/ext/filters/census/client_filter.cc index 8add7880d19ca..aed4f4aa14c85 100644 --- a/src/cpp/ext/filters/census/client_filter.cc +++ b/src/cpp/ext/filters/census/client_filter.cc @@ -284,10 +284,24 @@ void OpenCensusCallTracer::OpenCensusCallAttemptTracer::RecordEnd( void OpenCensusCallTracer::OpenCensusCallAttemptTracer::RecordAnnotation( absl::string_view annotation) { - // If tracing is disabled, the following will be a no-op. + if (!context_.Span().IsRecording()) { + return; + } context_.AddSpanAnnotation(annotation, {}); } +void OpenCensusCallTracer::OpenCensusCallAttemptTracer::RecordAnnotation( + const Annotation& annotation) { + if (!context_.Span().IsRecording()) { + return; + } + + switch (annotation.type()) { + default: + context_.AddSpanAnnotation(annotation.ToString(), {}); + } +} + // // OpenCensusCallTracer // @@ -355,10 +369,23 @@ OpenCensusCallTracer::StartNewAttempt(bool is_transparent_retry) { } void OpenCensusCallTracer::RecordAnnotation(absl::string_view annotation) { - // If tracing is disabled, the following will be a no-op. + if (!context_.Span().IsRecording()) { + return; + } context_.AddSpanAnnotation(annotation, {}); } +void OpenCensusCallTracer::RecordAnnotation(const Annotation& annotation) { + if (!context_.Span().IsRecording()) { + return; + } + + switch (annotation.type()) { + default: + context_.AddSpanAnnotation(annotation.ToString(), {}); + } +} + void OpenCensusCallTracer::RecordApiLatency(absl::Duration api_latency, absl::StatusCode status_code) { if (OpenCensusStatsEnabled()) { diff --git a/src/cpp/ext/filters/census/open_census_call_tracer.h b/src/cpp/ext/filters/census/open_census_call_tracer.h index dfdadfaa38711..1b4c5f7d9fa8e 100644 --- a/src/cpp/ext/filters/census/open_census_call_tracer.h +++ b/src/cpp/ext/filters/census/open_census_call_tracer.h @@ -99,6 +99,7 @@ class OpenCensusCallTracer : public grpc_core::ClientCallTracer { void RecordCancel(grpc_error_handle cancel_error) override; void RecordEnd(const gpr_timespec& /*latency*/) override; void RecordAnnotation(absl::string_view annotation) override; + void RecordAnnotation(const Annotation& annotation) override; experimental::CensusContext* context() { return &context_; } @@ -136,6 +137,7 @@ class OpenCensusCallTracer : public grpc_core::ClientCallTracer { OpenCensusCallAttemptTracer* StartNewAttempt( bool is_transparent_retry) override; void RecordAnnotation(absl::string_view annotation) override; + void RecordAnnotation(const Annotation& annotation) override; // APIs to record API call latency void RecordApiLatency(absl::Duration api_latency, diff --git a/src/cpp/ext/filters/census/server_call_tracer.cc b/src/cpp/ext/filters/census/server_call_tracer.cc index c8c034a83f9a7..9e6672259a650 100644 --- a/src/cpp/ext/filters/census/server_call_tracer.cc +++ b/src/cpp/ext/filters/census/server_call_tracer.cc @@ -157,9 +157,23 @@ class OpenCensusServerCallTracer : public grpc_core::ServerCallTracer { void RecordEnd(const grpc_call_final_info* final_info) override; void RecordAnnotation(absl::string_view annotation) override { + if (!context_.Span().IsRecording()) { + return; + } context_.AddSpanAnnotation(annotation, {}); } + void RecordAnnotation(const Annotation& annotation) override { + if (!context_.Span().IsRecording()) { + return; + } + + switch (annotation.type()) { + default: + context_.AddSpanAnnotation(annotation.ToString(), {}); + } + } + private: experimental::CensusContext context_; // server method diff --git a/src/cpp/ext/otel/otel_call_tracer.h b/src/cpp/ext/otel/otel_call_tracer.h index f8af05f2a78e6..059c0bb352726 100644 --- a/src/cpp/ext/otel/otel_call_tracer.h +++ b/src/cpp/ext/otel/otel_call_tracer.h @@ -85,6 +85,7 @@ class OpenTelemetryCallTracer : public grpc_core::ClientCallTracer { void RecordCancel(grpc_error_handle cancel_error) override; void RecordEnd(const gpr_timespec& /*latency*/) override; void RecordAnnotation(absl::string_view /*annotation*/) override; + void RecordAnnotation(const Annotation& /*annotation*/) override; private: const OpenTelemetryCallTracer* parent_; @@ -115,6 +116,7 @@ class OpenTelemetryCallTracer : public grpc_core::ClientCallTracer { OpenTelemetryCallAttemptTracer* StartNewAttempt( bool is_transparent_retry) override; void RecordAnnotation(absl::string_view /*annotation*/) override; + void RecordAnnotation(const Annotation& /*annotation*/) override; private: // Client method. diff --git a/src/cpp/ext/otel/otel_client_filter.cc b/src/cpp/ext/otel/otel_client_filter.cc index a9b2123249a98..d5a09eeee70de 100644 --- a/src/cpp/ext/otel/otel_client_filter.cc +++ b/src/cpp/ext/otel/otel_client_filter.cc @@ -167,6 +167,11 @@ void OpenTelemetryCallTracer::OpenTelemetryCallAttemptTracer::RecordAnnotation( // Not implemented } +void OpenTelemetryCallTracer::OpenTelemetryCallAttemptTracer::RecordAnnotation( + const Annotation& /*annotation*/) { + // Not implemented +} + // // OpenTelemetryCallTracer // @@ -208,5 +213,10 @@ void OpenTelemetryCallTracer::RecordAnnotation( // Not implemented } +void OpenTelemetryCallTracer::RecordAnnotation( + const Annotation& /*annotation*/) { + // Not implemented +} + } // namespace internal } // namespace grpc diff --git a/src/cpp/ext/otel/otel_server_call_tracer.cc b/src/cpp/ext/otel/otel_server_call_tracer.cc index b9f5b0d6f275a..546323f81500e 100644 --- a/src/cpp/ext/otel/otel_server_call_tracer.cc +++ b/src/cpp/ext/otel/otel_server_call_tracer.cc @@ -114,6 +114,10 @@ class OpenTelemetryServerCallTracer : public grpc_core::ServerCallTracer { // Not implemented } + void RecordAnnotation(const Annotation& /*annotation*/) override { + // Not implemented + } + private: grpc_core::Slice path_; absl::string_view method_; From a00802689017acbe9a371bb3d7422029d26508e6 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 27 Jul 2023 09:55:55 -0700 Subject: [PATCH 060/205] [fuzzing] Increase deadline, fix b/293425905 (#33897) --- ...fering_at_end_fuzzer-5310085049942016.test | 945 ++++++++++++++++++ .../end2end/tests/write_buffering_at_end.cc | 2 +- 2 files changed, 946 insertions(+), 1 deletion(-) create mode 100644 test/core/end2end/end2end_test_corpus/write_buffering_at_end/clusterfuzz-testcase-minimized-write_buffering_at_end_fuzzer-5310085049942016.test diff --git a/test/core/end2end/end2end_test_corpus/write_buffering_at_end/clusterfuzz-testcase-minimized-write_buffering_at_end_fuzzer-5310085049942016.test b/test/core/end2end/end2end_test_corpus/write_buffering_at_end/clusterfuzz-testcase-minimized-write_buffering_at_end_fuzzer-5310085049942016.test new file mode 100644 index 0000000000000..ae95452543fce --- /dev/null +++ b/test/core/end2end/end2end_test_corpus/write_buffering_at_end/clusterfuzz-testcase-minimized-write_buffering_at_end_fuzzer-5310085049942016.test @@ -0,0 +1,945 @@ +test_id: 786688 +event_engine_actions { + run_delay: 32769 + run_delay: 0 + run_delay: 268435456 + run_delay: 4563402753 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 8 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 4294967295 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 0 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 0 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 4096 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 16 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 2684356 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 264690523 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 0 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 268435456 + run_delay: 0 + run_delay: 268435456 + connections { + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 15616 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 49 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 4 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 128 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 2818048 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 49 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 49 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 1 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 1660944388 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 1 + write_size: 1 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 981 + } + connections { + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 15616 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 49 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 4 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 128 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 2818048 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 49 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 49 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 1 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 1 + write_size: 1 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 981 + } +} diff --git a/test/core/end2end/tests/write_buffering_at_end.cc b/test/core/end2end/tests/write_buffering_at_end.cc index 70bb25cf04956..aa80b72efd1c5 100644 --- a/test/core/end2end/tests/write_buffering_at_end.cc +++ b/test/core/end2end/tests/write_buffering_at_end.cc @@ -28,7 +28,7 @@ namespace grpc_core { namespace { CORE_END2END_TEST(WriteBufferingTest, WriteBufferingAtEnd) { - auto c = NewClientCall("/foo").Timeout(Duration::Seconds(5)).Create(); + auto c = NewClientCall("/foo").Timeout(Duration::Minutes(1)).Create(); c.NewBatch(1).SendInitialMetadata({}); CoreEnd2endTest::IncomingMetadata server_initial_metadata; c.NewBatch(2).RecvInitialMetadata(server_initial_metadata); From aca70e8ccab51fcb3e6c23eaf9fc05839b450f33 Mon Sep 17 00:00:00 2001 From: Sergii Tkachenko Date: Thu, 27 Jul 2023 13:41:57 -0400 Subject: [PATCH 061/205] [PSM Interop] Legacy tests: delete PHP and Ruby (#33869) ref b/257007535, cl/550946605 --- tools/internal_ci/linux/grpc_xds_php.cfg | 25 ----- tools/internal_ci/linux/grpc_xds_php.sh | 25 ----- .../linux/grpc_xds_php_test_in_docker.sh | 100 ------------------ tools/internal_ci/linux/grpc_xds_ruby.cfg | 25 ----- tools/internal_ci/linux/grpc_xds_ruby.sh | 25 ----- .../linux/grpc_xds_ruby_test_in_docker.sh | 76 ------------- tools/internal_ci/linux/grpc_xds_v3_php.cfg | 25 ----- tools/internal_ci/linux/grpc_xds_v3_php.sh | 25 ----- .../linux/grpc_xds_v3_php_test_in_docker.sh | 16 --- tools/internal_ci/linux/grpc_xds_v3_ruby.cfg | 25 ----- tools/internal_ci/linux/grpc_xds_v3_ruby.sh | 25 ----- .../linux/grpc_xds_v3_ruby_test_in_docker.sh | 16 --- 12 files changed, 408 deletions(-) delete mode 100644 tools/internal_ci/linux/grpc_xds_php.cfg delete mode 100755 tools/internal_ci/linux/grpc_xds_php.sh delete mode 100755 tools/internal_ci/linux/grpc_xds_php_test_in_docker.sh delete mode 100644 tools/internal_ci/linux/grpc_xds_ruby.cfg delete mode 100644 tools/internal_ci/linux/grpc_xds_ruby.sh delete mode 100755 tools/internal_ci/linux/grpc_xds_ruby_test_in_docker.sh delete mode 100644 tools/internal_ci/linux/grpc_xds_v3_php.cfg delete mode 100755 tools/internal_ci/linux/grpc_xds_v3_php.sh delete mode 100755 tools/internal_ci/linux/grpc_xds_v3_php_test_in_docker.sh delete mode 100644 tools/internal_ci/linux/grpc_xds_v3_ruby.cfg delete mode 100644 tools/internal_ci/linux/grpc_xds_v3_ruby.sh delete mode 100755 tools/internal_ci/linux/grpc_xds_v3_ruby_test_in_docker.sh diff --git a/tools/internal_ci/linux/grpc_xds_php.cfg b/tools/internal_ci/linux/grpc_xds_php.cfg deleted file mode 100644 index af8d24cf30f3a..0000000000000 --- a/tools/internal_ci/linux/grpc_xds_php.cfg +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2020 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Config file for the internal CI (in protobuf text format) - -# Location of the continuous shell script in repository. -build_file: "grpc/tools/internal_ci/linux/grpc_xds_php.sh" -timeout_mins: 360 -action { - define_artifacts { - regex: "**/*sponge_log.*" - regex: "github/grpc/reports/**" - } -} diff --git a/tools/internal_ci/linux/grpc_xds_php.sh b/tools/internal_ci/linux/grpc_xds_php.sh deleted file mode 100755 index b9126096657ed..0000000000000 --- a/tools/internal_ci/linux/grpc_xds_php.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -ex - -# change to grpc repo root -cd $(dirname $0)/../../.. - -source tools/internal_ci/helper_scripts/prepare_build_linux_rc - -export DOCKERFILE_DIR=tools/dockerfile/test/php73_zts_debian11_x64 -export DOCKER_RUN_SCRIPT=tools/internal_ci/linux/grpc_xds_php_test_in_docker.sh -exec tools/run_tests/dockerize/build_and_run_docker.sh diff --git a/tools/internal_ci/linux/grpc_xds_php_test_in_docker.sh b/tools/internal_ci/linux/grpc_xds_php_test_in_docker.sh deleted file mode 100755 index 37f833e7785d8..0000000000000 --- a/tools/internal_ci/linux/grpc_xds_php_test_in_docker.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2020 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -trap 'date' DEBUG -set -ex -o igncr || set -ex - -mkdir -p /var/local/git -git clone /var/local/jenkins/grpc /var/local/git/grpc -(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \ -&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ -${name}') -cd /var/local/git/grpc - -python3 -m pip install virtualenv -VIRTUAL_ENV=$(mktemp -d) -python3 -m virtualenv "$VIRTUAL_ENV" -p python3 -PYTHON="$VIRTUAL_ENV"/bin/python -"$PYTHON" -m pip install --upgrade pip==19.3.1 -"$PYTHON" -m pip install --upgrade grpcio-tools google-api-python-client google-auth-httplib2 oauth2client xds-protos - -# Prepare generated Python code. -TOOLS_DIR=tools/run_tests -PROTO_SOURCE_DIR=src/proto/grpc/testing -PROTO_DEST_DIR="$TOOLS_DIR"/"$PROTO_SOURCE_DIR" -mkdir -p "$PROTO_DEST_DIR" -touch "$TOOLS_DIR"/src/__init__.py -touch "$TOOLS_DIR"/src/proto/__init__.py -touch "$TOOLS_DIR"/src/proto/grpc/__init__.py -touch "$TOOLS_DIR"/src/proto/grpc/testing/__init__.py - -"$PYTHON" -m grpc_tools.protoc \ - --proto_path=. \ - --python_out="$TOOLS_DIR" \ - --grpc_python_out="$TOOLS_DIR" \ - "$PROTO_SOURCE_DIR"/test.proto \ - "$PROTO_SOURCE_DIR"/messages.proto \ - "$PROTO_SOURCE_DIR"/empty.proto - -HEALTH_PROTO_SOURCE_DIR=src/proto/grpc/health/v1 -HEALTH_PROTO_DEST_DIR=${TOOLS_DIR}/${HEALTH_PROTO_SOURCE_DIR} -mkdir -p ${HEALTH_PROTO_DEST_DIR} -touch "$TOOLS_DIR"/src/proto/grpc/health/__init__.py -touch "$TOOLS_DIR"/src/proto/grpc/health/v1/__init__.py - -"$PYTHON" -m grpc_tools.protoc \ - --proto_path=. \ - --python_out=${TOOLS_DIR} \ - --grpc_python_out=${TOOLS_DIR} \ - ${HEALTH_PROTO_SOURCE_DIR}/health.proto - -# Generate and compile the PHP extension. -(pear package && \ - find . -name grpc-*.tgz | xargs -I{} pecl install {}) - -# Prepare generated PHP code. -export CC=/usr/bin/gcc -./tools/bazel build @com_google_protobuf//:protoc -./tools/bazel build src/compiler:grpc_php_plugin -(cd src/php && \ - composer install && \ - ./bin/generate_proto_php.sh) - -GRPC_VERBOSITY=debug GRPC_TRACE=xds_client,xds_resolver,xds_cluster_manager_lb,cds_lb,xds_cluster_resolver_lb,priority_lb,xds_cluster_impl_lb,weighted_target_lb "$PYTHON" \ - tools/run_tests/run_xds_tests.py \ - --halt_after_fail \ - --test_case="timeout,fault_injection" \ - --project_id=grpc-testing \ - --project_num=830293263384 \ - --source_image=projects/grpc-testing/global/images/xds-test-server-5 \ - --path_to_server_binary=/java_server/grpc-java/interop-testing/build/install/grpc-interop-testing/bin/xds-test-server \ - --gcp_suffix=$(date '+%s') \ - --verbose \ - --qps=20 \ - ${XDS_V3_OPT-} \ - --client_cmd='./src/php/bin/run_xds_client.sh --server=xds:///{server_uri} --stats_port={stats_port} --qps={qps} {fail_on_failed_rpc} {rpcs_to_send} {metadata_to_send}' - -GRPC_VERBOSITY=debug GRPC_TRACE=xds_client,xds_resolver,xds_cluster_manager_lb,cds_lb,xds_cluster_resolver_lb,priority_lb,xds_cluster_impl_lb,weighted_target_lb "$PYTHON" \ - tools/run_tests/run_xds_tests.py \ - --halt_after_fail \ - --test_case="all,path_matching,header_matching" \ - --project_id=grpc-testing \ - --project_num=830293263384 \ - --source_image=projects/grpc-testing/global/images/xds-test-server-5 \ - --path_to_server_binary=/java_server/grpc-java/interop-testing/build/install/grpc-interop-testing/bin/xds-test-server \ - --gcp_suffix=$(date '+%s') \ - --verbose \ - ${XDS_V3_OPT-} \ - --client_cmd='php -d extension=grpc.so -d extension=pthreads.so src/php/tests/interop/xds_client.php --server=xds:///{server_uri} --stats_port={stats_port} --qps={qps} {fail_on_failed_rpc} {rpcs_to_send} {metadata_to_send}' diff --git a/tools/internal_ci/linux/grpc_xds_ruby.cfg b/tools/internal_ci/linux/grpc_xds_ruby.cfg deleted file mode 100644 index d723f85ffd552..0000000000000 --- a/tools/internal_ci/linux/grpc_xds_ruby.cfg +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2020 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Config file for the internal CI (in protobuf text format) - -# Location of the continuous shell script in repository. -build_file: "grpc/tools/internal_ci/linux/grpc_xds_ruby.sh" -timeout_mins: 360 -action { - define_artifacts { - regex: "**/*sponge_log.*" - regex: "github/grpc/reports/**" - } -} diff --git a/tools/internal_ci/linux/grpc_xds_ruby.sh b/tools/internal_ci/linux/grpc_xds_ruby.sh deleted file mode 100644 index 5cf78b1705932..0000000000000 --- a/tools/internal_ci/linux/grpc_xds_ruby.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -ex - -# change to grpc repo root -cd $(dirname $0)/../../.. - -source tools/internal_ci/helper_scripts/prepare_build_linux_rc - -export DOCKERFILE_DIR=tools/dockerfile/test/ruby_debian11_x64 -export DOCKER_RUN_SCRIPT=tools/internal_ci/linux/grpc_xds_ruby_test_in_docker.sh -exec tools/run_tests/dockerize/build_and_run_docker.sh diff --git a/tools/internal_ci/linux/grpc_xds_ruby_test_in_docker.sh b/tools/internal_ci/linux/grpc_xds_ruby_test_in_docker.sh deleted file mode 100755 index 23cabd3ee735d..0000000000000 --- a/tools/internal_ci/linux/grpc_xds_ruby_test_in_docker.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2020 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -trap 'date' DEBUG -set -ex -o igncr || set -ex - -mkdir -p /var/local/git -git clone /var/local/jenkins/grpc /var/local/git/grpc -(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \ -&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ -${name}') -cd /var/local/git/grpc - -python3 -m pip install virtualenv -VIRTUAL_ENV=$(mktemp -d) -python3 -m virtualenv "$VIRTUAL_ENV" -p python3 -PYTHON="$VIRTUAL_ENV"/bin/python -"$PYTHON" -m pip install --upgrade pip==19.3.1 -"$PYTHON" -m pip install --upgrade grpcio-tools google-api-python-client google-auth-httplib2 oauth2client xds-protos - -# Prepare generated Python code. -TOOLS_DIR=tools/run_tests -PROTO_SOURCE_DIR=src/proto/grpc/testing -PROTO_DEST_DIR="$TOOLS_DIR"/"$PROTO_SOURCE_DIR" -mkdir -p "$PROTO_DEST_DIR" -touch "$TOOLS_DIR"/src/__init__.py -touch "$TOOLS_DIR"/src/proto/__init__.py -touch "$TOOLS_DIR"/src/proto/grpc/__init__.py -touch "$TOOLS_DIR"/src/proto/grpc/testing/__init__.py - -"$PYTHON" -m grpc_tools.protoc \ - --proto_path=. \ - --python_out="$TOOLS_DIR" \ - --grpc_python_out="$TOOLS_DIR" \ - "$PROTO_SOURCE_DIR"/test.proto \ - "$PROTO_SOURCE_DIR"/messages.proto \ - "$PROTO_SOURCE_DIR"/empty.proto - -HEALTH_PROTO_SOURCE_DIR=src/proto/grpc/health/v1 -HEALTH_PROTO_DEST_DIR=${TOOLS_DIR}/${HEALTH_PROTO_SOURCE_DIR} -mkdir -p ${HEALTH_PROTO_DEST_DIR} -touch "$TOOLS_DIR"/src/proto/grpc/health/__init__.py -touch "$TOOLS_DIR"/src/proto/grpc/health/v1/__init__.py - -"$PYTHON" -m grpc_tools.protoc \ - --proto_path=. \ - --python_out=${TOOLS_DIR} \ - --grpc_python_out=${TOOLS_DIR} \ - ${HEALTH_PROTO_SOURCE_DIR}/health.proto - -(cd src/ruby && bundle && bundle exec rake compile) - -GRPC_VERBOSITY=debug GRPC_TRACE=xds_client,xds_resolver,xds_cluster_manager_lb,cds_lb,xds_cluster_resolver_lb,priority_lb,xds_cluster_impl_lb,weighted_target_lb "$PYTHON" \ - tools/run_tests/run_xds_tests.py \ - --halt_after_fail \ - --test_case="all,circuit_breaking,timeout,fault_injection" \ - --project_id=grpc-testing \ - --project_num=830293263384 \ - --source_image=projects/grpc-testing/global/images/xds-test-server-5 \ - --path_to_server_binary=/java_server/grpc-java/interop-testing/build/install/grpc-interop-testing/bin/xds-test-server \ - --gcp_suffix=$(date '+%s') \ - --verbose \ - ${XDS_V3_OPT-} \ - --client_cmd='ruby src/ruby/pb/test/xds_client.rb --server=xds:///{server_uri} --stats_port={stats_port} --qps={qps} {fail_on_failed_rpc} {rpcs_to_send} {metadata_to_send}' diff --git a/tools/internal_ci/linux/grpc_xds_v3_php.cfg b/tools/internal_ci/linux/grpc_xds_v3_php.cfg deleted file mode 100644 index 39f640654fba7..0000000000000 --- a/tools/internal_ci/linux/grpc_xds_v3_php.cfg +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2021 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Config file for the internal CI (in protobuf text format) - -# Location of the continuous shell script in repository. -build_file: "grpc/tools/internal_ci/linux/grpc_xds_v3_php.sh" -timeout_mins: 360 -action { - define_artifacts { - regex: "**/*sponge_log.*" - regex: "github/grpc/reports/**" - } -} diff --git a/tools/internal_ci/linux/grpc_xds_v3_php.sh b/tools/internal_ci/linux/grpc_xds_v3_php.sh deleted file mode 100755 index 0a92be4f7a310..0000000000000 --- a/tools/internal_ci/linux/grpc_xds_v3_php.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2021 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -ex - -# change to grpc repo root -cd $(dirname $0)/../../.. - -source tools/internal_ci/helper_scripts/prepare_build_linux_rc - -export DOCKERFILE_DIR=tools/dockerfile/test/php73_zts_debian11_x64 -export DOCKER_RUN_SCRIPT=tools/internal_ci/linux/grpc_xds_v3_php_test_in_docker.sh -exec tools/run_tests/dockerize/build_and_run_docker.sh diff --git a/tools/internal_ci/linux/grpc_xds_v3_php_test_in_docker.sh b/tools/internal_ci/linux/grpc_xds_v3_php_test_in_docker.sh deleted file mode 100755 index 23337deb3bd1a..0000000000000 --- a/tools/internal_ci/linux/grpc_xds_v3_php_test_in_docker.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2021 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -XDS_V3_OPT="--xds_v3_support" `dirname $0`/grpc_xds_php_test_in_docker.sh diff --git a/tools/internal_ci/linux/grpc_xds_v3_ruby.cfg b/tools/internal_ci/linux/grpc_xds_v3_ruby.cfg deleted file mode 100644 index f512b59622241..0000000000000 --- a/tools/internal_ci/linux/grpc_xds_v3_ruby.cfg +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2021 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Config file for the internal CI (in protobuf text format) - -# Location of the continuous shell script in repository. -build_file: "grpc/tools/internal_ci/linux/grpc_xds_v3_ruby.sh" -timeout_mins: 360 -action { - define_artifacts { - regex: "**/*sponge_log.*" - regex: "github/grpc/reports/**" - } -} diff --git a/tools/internal_ci/linux/grpc_xds_v3_ruby.sh b/tools/internal_ci/linux/grpc_xds_v3_ruby.sh deleted file mode 100644 index 3046ef037868c..0000000000000 --- a/tools/internal_ci/linux/grpc_xds_v3_ruby.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2021 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -ex - -# change to grpc repo root -cd $(dirname $0)/../../.. - -source tools/internal_ci/helper_scripts/prepare_build_linux_rc - -export DOCKERFILE_DIR=tools/dockerfile/test/ruby_debian11_x64 -export DOCKER_RUN_SCRIPT=tools/internal_ci/linux/grpc_xds_v3_ruby_test_in_docker.sh -exec tools/run_tests/dockerize/build_and_run_docker.sh diff --git a/tools/internal_ci/linux/grpc_xds_v3_ruby_test_in_docker.sh b/tools/internal_ci/linux/grpc_xds_v3_ruby_test_in_docker.sh deleted file mode 100755 index c380e33429b83..0000000000000 --- a/tools/internal_ci/linux/grpc_xds_v3_ruby_test_in_docker.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2021 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -XDS_V3_OPT="--xds_v3_support" `dirname $0`/grpc_xds_ruby_test_in_docker.sh From 0897f0faf38626f42b89477034aa863b3f82e6f0 Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Thu, 27 Jul 2023 11:29:02 -0700 Subject: [PATCH 062/205] [EventEngine][Windows] Temporary changes for rare-flake debugging (#33894) CNR a WindowsEventEngine listener flake in: * 10k local Windows development machine runs * 50k Windows RBE runs * 10k Windows VM runs It fails ~5 times per day on the master CI jobs. This PR adds some logging to try to see if an edge is missed, and switches the thread pool implementation to see if that makes the flake go away. If the flakes disappear, I'll try removing one or the other to see if either independently fix the problem (hopefully not logging). --------- Co-authored-by: drfloob --- .../event_engine/thread_pool/thread_pool_factory.cc | 7 +++++++ src/core/lib/surface/completion_queue.cc | 10 ++++++++++ test/core/end2end/tests/no_logging.cc | 6 ++++++ 3 files changed, 23 insertions(+) diff --git a/src/core/lib/event_engine/thread_pool/thread_pool_factory.cc b/src/core/lib/event_engine/thread_pool/thread_pool_factory.cc index be175fcbef9f9..c0aeae596095c 100644 --- a/src/core/lib/event_engine/thread_pool/thread_pool_factory.cc +++ b/src/core/lib/event_engine/thread_pool/thread_pool_factory.cc @@ -29,6 +29,13 @@ namespace grpc_event_engine { namespace experimental { std::shared_ptr MakeThreadPool(size_t reserve_threads) { +// TODO(hork): remove when the listener flake is identified +#ifdef GPR_WINDOWS + if (grpc_core::IsEventEngineListenerEnabled()) { + return std::make_shared( + grpc_core::Clamp(gpr_cpu_num_cores(), 2u, 16u)); + } +#endif if (grpc_core::IsWorkStealingEnabled()) { return std::make_shared( grpc_core::Clamp(gpr_cpu_num_cores(), 2u, 16u)); diff --git a/src/core/lib/surface/completion_queue.cc b/src/core/lib/surface/completion_queue.cc index 0ca8027ab21ee..0d4b185d5f107 100644 --- a/src/core/lib/surface/completion_queue.cc +++ b/src/core/lib/surface/completion_queue.cc @@ -57,6 +57,10 @@ #include "src/core/lib/surface/api_trace.h" #include "src/core/lib/surface/event_string.h" +#ifdef GPR_WINDOWS +#include "src/core/lib/experiments/experiments.h" +#endif + grpc_core::TraceFlag grpc_trace_operation_failures(false, "op_failure"); grpc_core::DebugOnlyTraceFlag grpc_trace_pending_tags(false, "pending_tags"); grpc_core::DebugOnlyTraceFlag grpc_trace_cq_refcount(false, "cq_refcount"); @@ -882,6 +886,12 @@ void grpc_cq_end_op(grpc_completion_queue* cq, void* tag, void (*done)(void* done_arg, grpc_cq_completion* storage), void* done_arg, grpc_cq_completion* storage, bool internal) { +// TODO(hork): remove when the listener flake is identified +#ifdef GPR_WINDOWS + if (grpc_core::IsEventEngineListenerEnabled()) { + gpr_log(GPR_ERROR, "cq_end_op called for tag %d (0x%p)", tag, tag); + } +#endif cq->vtable->end_op(cq, tag, error, done, done_arg, storage, internal); } diff --git a/test/core/end2end/tests/no_logging.cc b/test/core/end2end/tests/no_logging.cc index 88897dcf7b304..4b875cb1a5c85 100644 --- a/test/core/end2end/tests/no_logging.cc +++ b/test/core/end2end/tests/no_logging.cc @@ -139,6 +139,12 @@ void SimpleRequest(CoreEnd2endTest& test) { } CORE_END2END_TEST(NoLoggingTest, NoLoggingTest) { +// TODO(hork): remove when the listener flake is identified +#ifdef GPR_WINDOWS + if (IsEventEngineListenerEnabled()) { + GTEST_SKIP() << "not for windows + event engine listener"; + } +#endif Verifier verifier; verifier.FailOnNonErrorLog(); for (int i = 0; i < 10; i++) { From 15bb1267c10f49d8d4fc96fcb0366818932b1290 Mon Sep 17 00:00:00 2001 From: Alisha Nanda Date: Thu, 27 Jul 2023 12:07:11 -0700 Subject: [PATCH 063/205] [observability] Update Python calltracer implementation (#33899) --- .../grpc_observability/client_call_tracer.cc | 32 +++++++++++++++++-- .../grpc_observability/client_call_tracer.h | 2 ++ .../grpc_observability/server_call_tracer.cc | 14 ++++++++ 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/src/python/grpcio_observability/grpc_observability/client_call_tracer.cc b/src/python/grpcio_observability/grpc_observability/client_call_tracer.cc index 1319cec7ec5ec..35b3eba2c7931 100644 --- a/src/python/grpcio_observability/grpc_observability/client_call_tracer.cc +++ b/src/python/grpcio_observability/grpc_observability/client_call_tracer.cc @@ -56,10 +56,24 @@ void PythonOpenCensusCallTracer::GenerateContext() {} void PythonOpenCensusCallTracer::RecordAnnotation( absl::string_view annotation) { - // If tracing is disabled, the following will be a no-op. + if (!context_.SpanContext().IsSampled()) { + return; + } context_.AddSpanAnnotation(annotation); } +void PythonOpenCensusCallTracer::RecordAnnotation( + const Annotation& annotation) { + if (!context_.SpanContext().IsSampled()) { + return; + } + + switch (annotation.type()) { + default: + context_.AddSpanAnnotation(annotation.ToString()); + } +} + PythonOpenCensusCallTracer::~PythonOpenCensusCallTracer() { if (PythonCensusStatsEnabled()) { context_.Labels().emplace_back(kClientMethod, std::string(method_)); @@ -275,8 +289,22 @@ void PythonOpenCensusCallTracer::PythonOpenCensusCallAttemptTracer::RecordEnd( void PythonOpenCensusCallTracer::PythonOpenCensusCallAttemptTracer:: RecordAnnotation(absl::string_view annotation) { - // If tracing is disabled, the following will be a no-op. + if (!context_.SpanContext().IsSampled()) { + return; + } context_.AddSpanAnnotation(annotation); } +void PythonOpenCensusCallTracer::PythonOpenCensusCallAttemptTracer:: + RecordAnnotation(const Annotation& annotation) { + if (!context_.SpanContext().IsSampled()) { + return; + } + + switch (annotation.type()) { + default: + context_.AddSpanAnnotation(annotation.ToString()); + } +} + } // namespace grpc_observability diff --git a/src/python/grpcio_observability/grpc_observability/client_call_tracer.h b/src/python/grpcio_observability/grpc_observability/client_call_tracer.h index db35da357331a..55d2283ddc506 100644 --- a/src/python/grpcio_observability/grpc_observability/client_call_tracer.h +++ b/src/python/grpcio_observability/grpc_observability/client_call_tracer.h @@ -76,6 +76,7 @@ class PythonOpenCensusCallTracer : public grpc_core::ClientCallTracer { void RecordCancel(grpc_error_handle cancel_error) override; void RecordEnd(const gpr_timespec& /*latency*/) override; void RecordAnnotation(absl::string_view annotation) override; + void RecordAnnotation(const Annotation& annotation) override; private: // Maximum size of trace context is sent on the wire. @@ -115,6 +116,7 @@ class PythonOpenCensusCallTracer : public grpc_core::ClientCallTracer { bool is_transparent_retry) override; void RecordAnnotation(absl::string_view annotation) override; + void RecordAnnotation(const Annotation& annotation) override; private: PythonCensusContext CreateCensusContextForCallAttempt(); diff --git a/src/python/grpcio_observability/grpc_observability/server_call_tracer.cc b/src/python/grpcio_observability/grpc_observability/server_call_tracer.cc index 2259950c47559..bf347ce02e518 100644 --- a/src/python/grpcio_observability/grpc_observability/server_call_tracer.cc +++ b/src/python/grpcio_observability/grpc_observability/server_call_tracer.cc @@ -150,9 +150,23 @@ class PythonOpenCensusServerCallTracer : public grpc_core::ServerCallTracer { void RecordEnd(const grpc_call_final_info* final_info) override; void RecordAnnotation(absl::string_view annotation) override { + if (!context_.SpanContext().IsSampled()) { + return; + } context_.AddSpanAnnotation(annotation); } + void RecordAnnotation(const Annotation& annotation) override { + if (!context_.SpanContext().IsSampled()) { + return; + } + + switch (annotation.type()) { + default: + context_.AddSpanAnnotation(annotation.ToString()); + } + } + private: PythonCensusContext context_; // server method From 9e5c3652d7dbe613f4be145657e6f4618e647545 Mon Sep 17 00:00:00 2001 From: Xuan Wang Date: Thu, 27 Jul 2023 12:16:10 -0700 Subject: [PATCH 064/205] [print backtrace] Print exception backtrace for all exceptions (#33442) Action item from: https://github.com/grpc/grpc/issues/33364 ### Before change: * Printable Exception (Only printing exception): ``` ERROR:grpc._server:Exception calling application: Test exception Traceback (most recent call last): File "/usr/local/google/home/xuanwn/.cache/bazel/_bazel_xuanwn/da3828576aa39e99a5c826cc2e2e22fb/sandbox/linux-sandbox/2110/execroot/com_github_grpc_grpc/bazel-out/k8-fastbuild/bin/src/python/grpcio_tests/tests/unit/_metadata_test.native.runfiles/com_github_grpc_grpc/src/python/grpcio/grpc/_server.py", line 561, in _call_behavior raise TestException grpc._server.TestException: Test exception ERROR ``` * Un-Printable Exception (Only printing traceback): ``` Traceback (most recent call last): File "/usr/local/google/home/xuanwn/.cache/bazel/_bazel_xuanwn/da3828576aa39e99a5c826cc2e2e22fb/sandbox/linux-sandbox/2112/execroot/com_github_grpc_grpc/bazel-out/k8-fastbuild/bin/src/python/grpcio_tests/tests/unit/_metadata_test.native.runfiles/com_github_grpc_grpc/src/python/grpcio/grpc/_server.py", line 561, in _call_behavior raise TestException grpc._server.TestException: During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/google/home/xuanwn/.cache/bazel/_bazel_xuanwn/da3828576aa39e99a5c826cc2e2e22fb/sandbox/linux-sandbox/2112/execroot/com_github_grpc_grpc/bazel-out/k8-fastbuild/bin/src/python/grpcio_tests/tests/unit/_metadata_test.native.runfiles/com_github_grpc_grpc/src/python/grpcio/grpc/_server.py", line 574, in _call_behavior details = "Exception calling application: {}".format( File "/usr/local/google/home/xuanwn/.cache/bazel/_bazel_xuanwn/da3828576aa39e99a5c826cc2e2e22fb/sandbox/linux-sandbox/2112/execroot/com_github_grpc_grpc/bazel-out/k8-fastbuild/bin/src/python/grpcio_tests/tests/unit/_metadata_test.native.runfiles/com_github_grpc_grpc/src/python/grpcio/grpc/_server.py", line 536, in __str__ return 'Test exception {0}'.format(self.val) AttributeError: 'TestException' object has no attribute 'val' ERROR:grpc._server:Calling application raised unprintable Exception! Traceback (most recent call last): File "/usr/local/google/home/xuanwn/.cache/bazel/_bazel_xuanwn/da3828576aa39e99a5c826cc2e2e22fb/sandbox/linux-sandbox/2112/execroot/com_github_grpc_grpc/bazel-out/k8-fastbuild/bin/src/python/grpcio_tests/tests/unit/_metadata_test.native.runfiles/com_github_grpc_grpc/src/python/grpcio/grpc/_server.py", line 561, in _call_behavior raise TestException grpc._server.TestException: ERROR ``` ### After change: * Printable Exception (Printing both exception and traceback): ``` Traceback (most recent call last): File "/usr/local/google/home/xuanwn/.cache/bazel/_bazel_xuanwn/da3828576aa39e99a5c826cc2e2e22fb/sandbox/linux-sandbox/2114/execroot/com_github_grpc_grpc/bazel-out/k8-fastbuild/bin/src/python/grpcio_tests/tests/unit/_metadata_test.native.runfiles/com_github_grpc_grpc/src/python/grpcio/grpc/_server.py", line 561, in _call_behavior raise TestException grpc._server.TestException: Test exception ERROR:grpc._server:Exception calling application: Test exception Traceback (most recent call last): File "/usr/local/google/home/xuanwn/.cache/bazel/_bazel_xuanwn/da3828576aa39e99a5c826cc2e2e22fb/sandbox/linux-sandbox/2114/execroot/com_github_grpc_grpc/bazel-out/k8-fastbuild/bin/src/python/grpcio_tests/tests/unit/_metadata_test.native.runfiles/com_github_grpc_grpc/src/python/grpcio/grpc/_server.py", line 561, in _call_behavior raise TestException grpc._server.TestException: Test exception ERROR ``` * Un-Printable Exception (Printing both exception and traceback): ``` ERROR:grpc._server:['Traceback (most recent call last):\n', ' File "/usr/local/google/home/xuanwn/.cache/bazel/_bazel_xuanwn/da3828576aa39e99a5c826cc2e2e22fb/sandbox/linux-sandbox/2116/execroot/com_github_grpc_grpc/bazel-out/k8-fastbuild/bin/src/python/grpcio_tests/tests/unit/_metadata_test.native.runfiles/com_github_grpc_grpc/src/python/grpcio/grpc/_server.py", line 561, in _call_behavior\n raise TestException\n', 'grpc._server.TestException: \n'] Traceback (most recent call last): File "/usr/local/google/home/xuanwn/.cache/bazel/_bazel_xuanwn/da3828576aa39e99a5c826cc2e2e22fb/sandbox/linux-sandbox/2116/execroot/com_github_grpc_grpc/bazel-out/k8-fastbuild/bin/src/python/grpcio_tests/tests/unit/_metadata_test.native.runfiles/com_github_grpc_grpc/src/python/grpcio/grpc/_server.py", line 561, in _call_behavior raise TestException grpc._server.TestException: During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/google/home/xuanwn/.cache/bazel/_bazel_xuanwn/da3828576aa39e99a5c826cc2e2e22fb/sandbox/linux-sandbox/2116/execroot/com_github_grpc_grpc/bazel-out/k8-fastbuild/bin/src/python/grpcio_tests/tests/unit/_metadata_test.native.runfiles/com_github_grpc_grpc/src/python/grpcio/grpc/_server.py", line 574, in _call_behavior details = "Exception calling application: {}".format( File "/usr/local/google/home/xuanwn/.cache/bazel/_bazel_xuanwn/da3828576aa39e99a5c826cc2e2e22fb/sandbox/linux-sandbox/2116/execroot/com_github_grpc_grpc/bazel-out/k8-fastbuild/bin/src/python/grpcio_tests/tests/unit/_metadata_test.native.runfiles/com_github_grpc_grpc/src/python/grpcio/grpc/_server.py", line 536, in __str__ return 'Test exception {0}'.format(self.val) AttributeError: 'TestException' object has no attribute 'val' Traceback (most recent call last): File "/usr/local/google/home/xuanwn/.cache/bazel/_bazel_xuanwn/da3828576aa39e99a5c826cc2e2e22fb/sandbox/linux-sandbox/2116/execroot/com_github_grpc_grpc/bazel-out/k8-fastbuild/bin/src/python/grpcio_tests/tests/unit/_metadata_test.native.runfiles/com_github_grpc_grpc/src/python/grpcio/grpc/_server.py", line 561, in _call_behavior raise TestException grpc._server.TestException: ERROR:grpc._server:Calling application raised unprintable Exception! Traceback (most recent call last): File "/usr/local/google/home/xuanwn/.cache/bazel/_bazel_xuanwn/da3828576aa39e99a5c826cc2e2e22fb/sandbox/linux-sandbox/2116/execroot/com_github_grpc_grpc/bazel-out/k8-fastbuild/bin/src/python/grpcio_tests/tests/unit/_metadata_test.native.runfiles/com_github_grpc_grpc/src/python/grpcio/grpc/_server.py", line 561, in _call_behavior raise TestException grpc._server.TestException: ERROR ``` --- src/python/grpcio/grpc/_server.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/python/grpcio/grpc/_server.py b/src/python/grpcio/grpc/_server.py index 5d05eead76c36..84aae73b24620 100644 --- a/src/python/grpcio/grpc/_server.py +++ b/src/python/grpcio/grpc/_server.py @@ -569,7 +569,14 @@ def _call_behavior( details = ( "Calling application raised unprintable Exception!" ) - traceback.print_exc() + _LOGGER.exception( + traceback.format_exception( + type(exception), + exception, + exception.__traceback__, + ) + ) + traceback.print_exc() _LOGGER.exception(details) _abort( state, From 96140caba61fe2e635035afe0caabd3c96740215 Mon Sep 17 00:00:00 2001 From: Xuan Wang Date: Thu, 27 Jul 2023 12:16:23 -0700 Subject: [PATCH 065/205] [Aio AioRpcError] Allow pickle AioRpcError (#33891) Fix: #33643. This change adds `__reduce__` to `AioRpcError` to allow pickle. ### Testing Added bazel unit test, without this change, test will fail with error: ``` TypeError: AioRpcError.__init__() missing 3 required positional arguments: 'code', 'initial_metadata', and 'trailing_metadata' ``` --- src/python/grpcio/grpc/aio/_call.py | 12 ++++++++++ .../tests_aio/unit/aio_rpc_error_test.py | 23 +++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/src/python/grpcio/grpc/aio/_call.py b/src/python/grpcio/grpc/aio/_call.py index cb32f235fe5a4..5d5dbdd4c65b5 100644 --- a/src/python/grpcio/grpc/aio/_call.py +++ b/src/python/grpcio/grpc/aio/_call.py @@ -153,6 +153,18 @@ def __repr__(self) -> str: def __str__(self) -> str: return self._repr() + def __reduce__(self): + return ( + type(self), + ( + self._code, + self._initial_metadata, + self._trailing_metadata, + self._details, + self._debug_error_string, + ), + ) + def _create_rpc_error( initial_metadata: Metadata, status: cygrpc.AioRpcStatus diff --git a/src/python/grpcio_tests/tests_aio/unit/aio_rpc_error_test.py b/src/python/grpcio_tests/tests_aio/unit/aio_rpc_error_test.py index 83cf239dacc89..b72f97530a66c 100644 --- a/src/python/grpcio_tests/tests_aio/unit/aio_rpc_error_test.py +++ b/src/python/grpcio_tests/tests_aio/unit/aio_rpc_error_test.py @@ -14,6 +14,7 @@ """Tests AioRpcError class.""" import logging +import pickle import unittest import grpc @@ -52,6 +53,28 @@ def test_attributes(self): aio_rpc_error.debug_error_string(), _TEST_DEBUG_ERROR_STRING ) + def test_pickle(self): + aio_rpc_error = AioRpcError( + grpc.StatusCode.CANCELLED, + initial_metadata=_TEST_INITIAL_METADATA, + trailing_metadata=_TEST_TRAILING_METADATA, + details="details", + debug_error_string=_TEST_DEBUG_ERROR_STRING, + ) + dump_error = pickle.dumps(aio_rpc_error) + loaded_error = pickle.loads(dump_error) + self.assertEqual(loaded_error.code(), grpc.StatusCode.CANCELLED) + self.assertEqual(loaded_error.details(), "details") + self.assertEqual( + loaded_error.initial_metadata(), _TEST_INITIAL_METADATA + ) + self.assertEqual( + loaded_error.trailing_metadata(), _TEST_TRAILING_METADATA + ) + self.assertEqual( + loaded_error.debug_error_string(), _TEST_DEBUG_ERROR_STRING + ) + if __name__ == "__main__": logging.basicConfig() From 9ea30fa9fd552052dc7d23a71f06e7d4d6eda22e Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Thu, 27 Jul 2023 14:05:19 -0700 Subject: [PATCH 066/205] [OTel] Add an OpenTelemetryPluginBuilder (#33895) --- src/cpp/ext/otel/BUILD | 1 + src/cpp/ext/otel/otel_client_filter.cc | 40 ++++-- src/cpp/ext/otel/otel_plugin.cc | 151 ++++++++++++++++---- src/cpp/ext/otel/otel_plugin.h | 50 ++++++- src/cpp/ext/otel/otel_server_call_tracer.cc | 32 +++-- test/cpp/ext/otel/otel_plugin_test.cc | 68 +++++++-- 6 files changed, 275 insertions(+), 67 deletions(-) diff --git a/src/cpp/ext/otel/BUILD b/src/cpp/ext/otel/BUILD index f202e08905196..1cd9c05501d56 100644 --- a/src/cpp/ext/otel/BUILD +++ b/src/cpp/ext/otel/BUILD @@ -43,6 +43,7 @@ grpc_cc_library( ], external_deps = [ "absl/base:core_headers", + "absl/container:flat_hash_set", "absl/container:inlined_vector", "absl/status", "absl/status:statusor", diff --git a/src/cpp/ext/otel/otel_client_filter.cc b/src/cpp/ext/otel/otel_client_filter.cc index d5a09eeee70de..504d48616129d 100644 --- a/src/cpp/ext/otel/otel_client_filter.cc +++ b/src/cpp/ext/otel/otel_client_filter.cc @@ -98,8 +98,10 @@ OpenTelemetryCallTracer::OpenTelemetryCallAttemptTracer:: arena_allocated_(arena_allocated), start_time_(absl::Now()) { // TODO(yashykt): Figure out how to get this to work with absl::string_view - OTelPluginState().client.attempt.started->Add( - 1, {{std::string(OTelMethodKey()), std::string(parent_->method_)}}); + if (OTelPluginState().client.attempt.started != nullptr) { + OTelPluginState().client.attempt.started->Add( + 1, {{std::string(OTelMethodKey()), std::string(parent_->method_)}}); + } } void OpenTelemetryCallTracer::OpenTelemetryCallAttemptTracer::RecordSendMessage( @@ -135,19 +137,27 @@ void OpenTelemetryCallTracer::OpenTelemetryCallAttemptTracer:: absl::InlinedVector, 2> attributes = { {std::string(OTelMethodKey()), std::string(parent_->method_)}, {std::string(OTelStatusKey()), absl::StatusCodeToString(status.code())}}; - OTelPluginState().client.attempt.duration->Record( - absl::ToDoubleSeconds(absl::Now() - start_time_), attributes, - opentelemetry::context::Context{}); - OTelPluginState().client.attempt.sent_total_compressed_message_size->Record( - transport_stream_stats != nullptr - ? transport_stream_stats->outgoing.data_bytes - : 0, - attributes, opentelemetry::context::Context{}); - OTelPluginState().client.attempt.rcvd_total_compressed_message_size->Record( - transport_stream_stats != nullptr - ? transport_stream_stats->incoming.data_bytes - : 0, - attributes, opentelemetry::context::Context{}); + if (OTelPluginState().client.attempt.duration != nullptr) { + OTelPluginState().client.attempt.duration->Record( + absl::ToDoubleSeconds(absl::Now() - start_time_), attributes, + opentelemetry::context::Context{}); + } + if (OTelPluginState().client.attempt.sent_total_compressed_message_size != + nullptr) { + OTelPluginState().client.attempt.sent_total_compressed_message_size->Record( + transport_stream_stats != nullptr + ? transport_stream_stats->outgoing.data_bytes + : 0, + attributes, opentelemetry::context::Context{}); + } + if (OTelPluginState().client.attempt.rcvd_total_compressed_message_size != + nullptr) { + OTelPluginState().client.attempt.rcvd_total_compressed_message_size->Record( + transport_stream_stats != nullptr + ? transport_stream_stats->incoming.data_bytes + : 0, + attributes, opentelemetry::context::Context{}); + } } void OpenTelemetryCallTracer::OpenTelemetryCallAttemptTracer::RecordCancel( diff --git a/src/cpp/ext/otel/otel_plugin.cc b/src/cpp/ext/otel/otel_plugin.cc index 79de2ff77758e..05f045861047e 100644 --- a/src/cpp/ext/otel/otel_plugin.cc +++ b/src/cpp/ext/otel/otel_plugin.cc @@ -22,6 +22,8 @@ #include +#include + #include "opentelemetry/metrics/meter.h" #include "opentelemetry/metrics/meter_provider.h" #include "opentelemetry/metrics/provider.h" @@ -49,31 +51,119 @@ const struct OTelPluginState& OTelPluginState() { return *g_otel_plugin_state_; } -void RegisterOpenTelemetryPlugin() { - auto meter_provider = opentelemetry::metrics::Provider::GetMeterProvider(); +absl::string_view OTelMethodKey() { return "grpc.method"; } + +absl::string_view OTelStatusKey() { return "grpc.status"; } + +absl::string_view OTelClientAttemptStartedInstrumentName() { + return "grpc.client.attempt.started"; +} +absl::string_view OTelClientAttemptDurationInstrumentName() { + return "grpc.client.attempt.duration"; +} + +absl::string_view +OTelClientAttemptSentTotalCompressedMessageSizeInstrumentName() { + return "grpc.client.attempt.sent_total_compressed_message_size"; +} + +absl::string_view +OTelClientAttemptRcvdTotalCompressedMessageSizeInstrumentName() { + return "grpc.client.attempt.rcvd_total_compressed_message_size"; +} + +absl::string_view OTelServerCallStartedInstrumentName() { + return "grpc.server.call.started"; +} + +absl::string_view OTelServerCallDurationInstrumentName() { + return "grpc.server.call.duration"; +} + +absl::string_view OTelServerCallSentTotalCompressedMessageSizeInstrumentName() { + return "grpc.server.call.sent_total_compressed_message_size"; +} + +absl::string_view OTelServerCallRcvdTotalCompressedMessageSizeInstrumentName() { + return "grpc.server.call.rcvd_total_compressed_message_size"; +} +// +// OpenTelemetryPluginBuilder +// + +OpenTelemetryPluginBuilder& OpenTelemetryPluginBuilder::SetMeterProvider( + std::shared_ptr meter_provider) { + meter_provider_ = std::move(meter_provider); + return *this; +} + +OpenTelemetryPluginBuilder& OpenTelemetryPluginBuilder::EnableMetrics( + const absl::flat_hash_set& metric_names) { + for (auto& metric_name : metric_names) { + metrics_.emplace(metric_name); + } + return *this; +} + +OpenTelemetryPluginBuilder& OpenTelemetryPluginBuilder::DisableMetrics( + const absl::flat_hash_set& metric_names) { + for (auto& metric_name : metric_names) { + metrics_.erase(metric_name); + } + return *this; +} + +void OpenTelemetryPluginBuilder::BuildAndRegisterGlobal() { + opentelemetry::nostd::shared_ptr + meter_provider = meter_provider_; + if (meter_provider == nullptr) { + meter_provider = opentelemetry::metrics::Provider::GetMeterProvider(); + } auto meter = meter_provider->GetMeter("grpc"); delete g_otel_plugin_state_; g_otel_plugin_state_ = new struct OTelPluginState; - g_otel_plugin_state_->client.attempt.started = - meter->CreateUInt64Counter("grpc.client.attempt.started"); - g_otel_plugin_state_->client.attempt.duration = - meter->CreateDoubleHistogram("grpc.client.attempt.duration"); - g_otel_plugin_state_->client.attempt.sent_total_compressed_message_size = - meter->CreateUInt64Histogram( - "grpc.client.attempt.sent_total_compressed_message_size"); - g_otel_plugin_state_->client.attempt.rcvd_total_compressed_message_size = - meter->CreateUInt64Histogram( - "grpc.client.attempt.rcvd_total_compressed_message_size"); - g_otel_plugin_state_->server.call.started = - meter->CreateUInt64Counter("grpc.server.call.started"); - g_otel_plugin_state_->server.call.duration = - meter->CreateDoubleHistogram("grpc.server.call.duration"); - g_otel_plugin_state_->server.call.sent_total_compressed_message_size = - meter->CreateUInt64Histogram( - "grpc.server.call.sent_total_compressed_message_size"); - g_otel_plugin_state_->server.call.rcvd_total_compressed_message_size = - meter->CreateUInt64Histogram( - "grpc.server.call.rcvd_total_compressed_message_size"); + g_otel_plugin_state_->meter_provider = std::move(meter_provider); + if (metrics_.contains(OTelClientAttemptStartedInstrumentName())) { + g_otel_plugin_state_->client.attempt.started = meter->CreateUInt64Counter( + std::string(OTelClientAttemptStartedInstrumentName())); + } + if (metrics_.contains(OTelClientAttemptDurationInstrumentName())) { + g_otel_plugin_state_->client.attempt.duration = + meter->CreateDoubleHistogram( + std::string(OTelClientAttemptDurationInstrumentName())); + } + if (metrics_.contains( + OTelClientAttemptSentTotalCompressedMessageSizeInstrumentName())) { + g_otel_plugin_state_->client.attempt.sent_total_compressed_message_size = + meter->CreateUInt64Histogram(std::string( + OTelClientAttemptSentTotalCompressedMessageSizeInstrumentName())); + } + if (metrics_.contains( + OTelClientAttemptRcvdTotalCompressedMessageSizeInstrumentName())) { + g_otel_plugin_state_->client.attempt.rcvd_total_compressed_message_size = + meter->CreateUInt64Histogram(std::string( + OTelClientAttemptRcvdTotalCompressedMessageSizeInstrumentName())); + } + if (metrics_.contains(OTelServerCallStartedInstrumentName())) { + g_otel_plugin_state_->server.call.started = meter->CreateUInt64Counter( + std::string(OTelServerCallStartedInstrumentName())); + } + if (metrics_.contains(OTelServerCallDurationInstrumentName())) { + g_otel_plugin_state_->server.call.duration = meter->CreateDoubleHistogram( + std::string(OTelServerCallDurationInstrumentName())); + } + if (metrics_.contains( + OTelServerCallSentTotalCompressedMessageSizeInstrumentName())) { + g_otel_plugin_state_->server.call.sent_total_compressed_message_size = + meter->CreateUInt64Histogram(std::string( + OTelServerCallSentTotalCompressedMessageSizeInstrumentName())); + } + if (metrics_.contains( + OTelServerCallRcvdTotalCompressedMessageSizeInstrumentName())) { + g_otel_plugin_state_->server.call.rcvd_total_compressed_message_size = + meter->CreateUInt64Histogram(std::string( + OTelServerCallRcvdTotalCompressedMessageSizeInstrumentName())); + } grpc_core::ServerCallTracerFactory::RegisterGlobal( new grpc::internal::OpenTelemetryServerCallTracerFactory); grpc_core::CoreConfiguration::RegisterBuilder( @@ -88,9 +178,20 @@ void RegisterOpenTelemetryPlugin() { }); } -absl::string_view OTelMethodKey() { return "grpc.method"; } - -absl::string_view OTelStatusKey() { return "grpc.status"; } +absl::flat_hash_set OpenTelemetryPluginBuilder::BaseMetrics() { + return absl::flat_hash_set{ + std::string(OTelClientAttemptStartedInstrumentName()), + std::string(OTelClientAttemptDurationInstrumentName()), + std::string( + OTelClientAttemptSentTotalCompressedMessageSizeInstrumentName()), + std::string( + OTelClientAttemptRcvdTotalCompressedMessageSizeInstrumentName()), + std::string(OTelServerCallStartedInstrumentName()), + std::string(OTelServerCallDurationInstrumentName()), + std::string(OTelServerCallSentTotalCompressedMessageSizeInstrumentName()), + std::string( + OTelServerCallRcvdTotalCompressedMessageSizeInstrumentName())}; +} } // namespace internal } // namespace grpc diff --git a/src/cpp/ext/otel/otel_plugin.h b/src/cpp/ext/otel/otel_plugin.h index fa7d41225a4a5..1624d35d13427 100644 --- a/src/cpp/ext/otel/otel_plugin.h +++ b/src/cpp/ext/otel/otel_plugin.h @@ -24,9 +24,13 @@ #include #include +#include +#include "absl/container/flat_hash_set.h" #include "absl/strings/string_view.h" +#include "opentelemetry/metrics/meter_provider.h" #include "opentelemetry/metrics/sync_instruments.h" +#include "opentelemetry/nostd/shared_ptr.h" namespace grpc { namespace internal { @@ -52,15 +56,57 @@ struct OTelPluginState { rcvd_total_compressed_message_size; } call; } server; + opentelemetry::nostd::shared_ptr + meter_provider; }; const struct OTelPluginState& OTelPluginState(); -void RegisterOpenTelemetryPlugin(); - +// Tags absl::string_view OTelMethodKey(); absl::string_view OTelStatusKey(); +// Metrics +absl::string_view OTelClientAttemptStartedInstrumentName(); +absl::string_view OTelClientAttemptDurationInstrumentName(); +absl::string_view +OTelClientAttemptSentTotalCompressedMessageSizeInstrumentName(); +absl::string_view +OTelClientAttemptRcvdTotalCompressedMessageSizeInstrumentName(); +absl::string_view OTelServerCallStartedInstrumentName(); +absl::string_view OTelServerCallDurationInstrumentName(); +absl::string_view OTelServerCallSentTotalCompressedMessageSizeInstrumentName(); +absl::string_view OTelServerCallRcvdTotalCompressedMessageSizeInstrumentName(); + +class OpenTelemetryPluginBuilder { + public: + OpenTelemetryPluginBuilder& SetMeterProvider( + std::shared_ptr meter_provider); + // Enable metrics in \a metric_names + OpenTelemetryPluginBuilder& EnableMetrics( + const absl::flat_hash_set& metric_names); + // Disable metrics in \a metric_names + OpenTelemetryPluginBuilder& DisableMetrics( + const absl::flat_hash_set& metric_names); + // Builds and registers the OTel Plugin + void BuildAndRegisterGlobal(); + + // The base set of metrics - + // grpc.client.attempt.started + // grpc.client.attempt.duration + // grpc.client.attempt.sent_total_compressed_message_size + // grpc.client.attempt.rcvd_total_compressed_message_size + // grpc.server.call.started + // grpc.server.call.duration + // grpc.server.call.sent_total_compressed_message_size + // grpc.server.call.rcvd_total_compressed_message_size + static absl::flat_hash_set BaseMetrics(); + + private: + std::shared_ptr meter_provider_; + absl::flat_hash_set metrics_; +}; + } // namespace internal } // namespace grpc diff --git a/src/cpp/ext/otel/otel_server_call_tracer.cc b/src/cpp/ext/otel/otel_server_call_tracer.cc index 546323f81500e..c4834179d248e 100644 --- a/src/cpp/ext/otel/otel_server_call_tracer.cc +++ b/src/cpp/ext/otel/otel_server_call_tracer.cc @@ -134,8 +134,10 @@ void OpenTelemetryServerCallTracer::RecordReceivedInitialMetadata( } method_ = absl::StripPrefix(path_.as_string_view(), "/"); // TODO(yashykt): Figure out how to get this to work with absl::string_view - OTelPluginState().server.call.started->Add( - 1, {{std::string(OTelMethodKey()), std::string(method_)}}); + if (OTelPluginState().server.call.started != nullptr) { + OTelPluginState().server.call.started->Add( + 1, {{std::string(OTelMethodKey()), std::string(method_)}}); + } } void OpenTelemetryServerCallTracer::RecordSendTrailingMetadata( @@ -152,15 +154,23 @@ void OpenTelemetryServerCallTracer::RecordEnd( {std::string(OTelStatusKey()), absl::StatusCodeToString( static_cast(final_info->final_status))}}; - OTelPluginState().server.call.duration->Record( - absl::ToDoubleSeconds(elapsed_time_), attributes, - opentelemetry::context::Context{}); - OTelPluginState().server.call.sent_total_compressed_message_size->Record( - final_info->stats.transport_stream_stats.outgoing.data_bytes, attributes, - opentelemetry::context::Context{}); - OTelPluginState().server.call.rcvd_total_compressed_message_size->Record( - final_info->stats.transport_stream_stats.incoming.data_bytes, attributes, - opentelemetry::context::Context{}); + if (OTelPluginState().server.call.duration != nullptr) { + OTelPluginState().server.call.duration->Record( + absl::ToDoubleSeconds(elapsed_time_), attributes, + opentelemetry::context::Context{}); + } + if (OTelPluginState().server.call.sent_total_compressed_message_size != + nullptr) { + OTelPluginState().server.call.sent_total_compressed_message_size->Record( + final_info->stats.transport_stream_stats.outgoing.data_bytes, + attributes, opentelemetry::context::Context{}); + } + if (OTelPluginState().server.call.rcvd_total_compressed_message_size != + nullptr) { + OTelPluginState().server.call.rcvd_total_compressed_message_size->Record( + final_info->stats.transport_stream_stats.incoming.data_bytes, + attributes, opentelemetry::context::Context{}); + } } } // namespace diff --git a/test/cpp/ext/otel/otel_plugin_test.cc b/test/cpp/ext/otel/otel_plugin_test.cc index be96873e27a23..4aa8ac3fa3230 100644 --- a/test/cpp/ext/otel/otel_plugin_test.cc +++ b/test/cpp/ext/otel/otel_plugin_test.cc @@ -62,18 +62,28 @@ class MockMetricReader : public opentelemetry::sdk::metrics::MetricReader { class OTelPluginEnd2EndTest : public ::testing::Test { protected: - void SetUp() override { + using ::testing::Test::SetUp; + void SetUp(const absl::flat_hash_set& metric_names, + bool global_meter_provider = false) { // We are resetting the MeterProvider and OpenTelemetry plugin at the start // of each test to avoid test results from one test carrying over to another // test. (Some measurements can get arbitrarily delayed.) - auto meter_provider = new opentelemetry::sdk::metrics::MeterProvider; - opentelemetry::metrics::Provider::SetMeterProvider( - opentelemetry::nostd::shared_ptr( - meter_provider)); + auto meter_provider = + std::make_shared(); reader_.reset(new grpc::testing::MockMetricReader); meter_provider->AddMetricReader(reader_); grpc_core::CoreConfiguration::Reset(); - grpc::internal::RegisterOpenTelemetryPlugin(); + grpc::internal::OpenTelemetryPluginBuilder ot_builder; + ot_builder.EnableMetrics(metric_names); + if (global_meter_provider) { + opentelemetry::metrics::Provider::SetMeterProvider( + opentelemetry::nostd::shared_ptr< + opentelemetry::metrics::MeterProvider>( + std::move(meter_provider))); + } else { + ot_builder.SetMeterProvider(std::move(meter_provider)); + } + ot_builder.BuildAndRegisterGlobal(); grpc_init(); grpc::ServerBuilder builder; int port; @@ -147,12 +157,13 @@ class OTelPluginEnd2EndTest : public ::testing::Test { }; TEST_F(OTelPluginEnd2EndTest, ClientAttemptStarted) { + SetUp({grpc::internal::OTelClientAttemptStartedInstrumentName()}); SendRPC(); const char* kMetricName = "grpc.client.attempt.started"; auto data = ReadCurrentMetricsData( [&](const absl::flat_hash_map< std::string, std::vector>& - data) { return data.size() != 8; }); + data) { return !data.contains(kMetricName); }); ASSERT_EQ(data[kMetricName].size(), 1); auto point_data = absl::get_if( &data[kMetricName][0]); @@ -163,12 +174,13 @@ TEST_F(OTelPluginEnd2EndTest, ClientAttemptStarted) { } TEST_F(OTelPluginEnd2EndTest, ClientAttemptDuration) { + SetUp({grpc::internal::OTelClientAttemptDurationInstrumentName()}); SendRPC(); const char* kMetricName = "grpc.client.attempt.duration"; auto data = ReadCurrentMetricsData( [&](const absl::flat_hash_map< std::string, std::vector>& - data) { return data.size() != 8; }); + data) { return !data.contains(kMetricName); }); ASSERT_EQ(data[kMetricName].size(), 1); auto point_data = absl::get_if( @@ -178,13 +190,15 @@ TEST_F(OTelPluginEnd2EndTest, ClientAttemptDuration) { } TEST_F(OTelPluginEnd2EndTest, ClientAttemptSentTotalCompressedMessageSize) { + SetUp({grpc::internal:: + OTelClientAttemptSentTotalCompressedMessageSizeInstrumentName()}); SendRPC(); const char* kMetricName = "grpc.client.attempt.sent_total_compressed_message_size"; auto data = ReadCurrentMetricsData( [&](const absl::flat_hash_map< std::string, std::vector>& - data) { return data.size() != 8; }); + data) { return !data.contains(kMetricName); }); ASSERT_EQ(data[kMetricName].size(), 1); auto point_data = absl::get_if( @@ -194,13 +208,15 @@ TEST_F(OTelPluginEnd2EndTest, ClientAttemptSentTotalCompressedMessageSize) { } TEST_F(OTelPluginEnd2EndTest, ClientAttemptRcvdTotalCompressedMessageSize) { + SetUp({grpc::internal:: + OTelClientAttemptRcvdTotalCompressedMessageSizeInstrumentName()}); SendRPC(); const char* kMetricName = "grpc.client.attempt.rcvd_total_compressed_message_size"; auto data = ReadCurrentMetricsData( [&](const absl::flat_hash_map< std::string, std::vector>& - data) { return data.size() != 8; }); + data) { return !data.contains(kMetricName); }); ASSERT_EQ(data[kMetricName].size(), 1); auto point_data = absl::get_if( @@ -210,12 +226,13 @@ TEST_F(OTelPluginEnd2EndTest, ClientAttemptRcvdTotalCompressedMessageSize) { } TEST_F(OTelPluginEnd2EndTest, ServerCallStarted) { + SetUp({grpc::internal::OTelServerCallStartedInstrumentName()}); SendRPC(); const char* kMetricName = "grpc.server.call.started"; auto data = ReadCurrentMetricsData( [&](const absl::flat_hash_map< std::string, std::vector>& - data) { return data.size() != 8; }); + data) { return !data.contains(kMetricName); }); ASSERT_EQ(data[kMetricName].size(), 1); auto point_data = absl::get_if( &data[kMetricName][0]); @@ -226,12 +243,13 @@ TEST_F(OTelPluginEnd2EndTest, ServerCallStarted) { } TEST_F(OTelPluginEnd2EndTest, ServerCallDuration) { + SetUp({grpc::internal::OTelServerCallDurationInstrumentName()}); SendRPC(); const char* kMetricName = "grpc.server.call.duration"; auto data = ReadCurrentMetricsData( [&](const absl::flat_hash_map< std::string, std::vector>& - data) { return data.size() != 8; }); + data) { return !data.contains(kMetricName); }); ASSERT_EQ(data[kMetricName].size(), 1); auto point_data = absl::get_if( @@ -241,13 +259,15 @@ TEST_F(OTelPluginEnd2EndTest, ServerCallDuration) { } TEST_F(OTelPluginEnd2EndTest, ServerCallSentTotalCompressedMessageSize) { + SetUp({grpc::internal:: + OTelServerCallSentTotalCompressedMessageSizeInstrumentName()}); SendRPC(); const char* kMetricName = "grpc.server.call.sent_total_compressed_message_size"; auto data = ReadCurrentMetricsData( [&](const absl::flat_hash_map< std::string, std::vector>& - data) { return data.size() != 8; }); + data) { return !data.contains(kMetricName); }); ASSERT_EQ(data[kMetricName].size(), 1); auto point_data = absl::get_if( @@ -257,13 +277,15 @@ TEST_F(OTelPluginEnd2EndTest, ServerCallSentTotalCompressedMessageSize) { } TEST_F(OTelPluginEnd2EndTest, ServerCallRcvdTotalCompressedMessageSize) { + SetUp({grpc::internal:: + OTelServerCallRcvdTotalCompressedMessageSizeInstrumentName()}); SendRPC(); const char* kMetricName = "grpc.server.call.rcvd_total_compressed_message_size"; auto data = ReadCurrentMetricsData( [&](const absl::flat_hash_map< std::string, std::vector>& - data) { return data.size() != 8; }); + data) { return !data.contains(kMetricName); }); ASSERT_EQ(data[kMetricName].size(), 1); auto point_data = absl::get_if( @@ -272,6 +294,24 @@ TEST_F(OTelPluginEnd2EndTest, ServerCallRcvdTotalCompressedMessageSize) { ASSERT_EQ(point_data->count_, 1); } +// Make sure that things work with the global meter provider as well +TEST_F(OTelPluginEnd2EndTest, UseGlobalMeterProvider) { + SetUp({grpc::internal::OTelClientAttemptStartedInstrumentName()}); + SendRPC(); + const char* kMetricName = "grpc.client.attempt.started"; + auto data = ReadCurrentMetricsData( + [&](const absl::flat_hash_map< + std::string, std::vector>& + data) { return !data.contains(kMetricName); }); + ASSERT_EQ(data[kMetricName].size(), 1); + auto point_data = absl::get_if( + &data[kMetricName][0]); + ASSERT_NE(point_data, nullptr); + auto client_started_value = absl::get_if(&point_data->value_); + ASSERT_NE(client_started_value, nullptr); + ASSERT_EQ(*client_started_value, 1); +} + } // namespace } // namespace testing } // namespace grpc From 23dc8fde780d0e89402c2cecb0d3c8e8cd7a72e4 Mon Sep 17 00:00:00 2001 From: Sergii Tkachenko Date: Thu, 27 Jul 2023 17:55:08 -0400 Subject: [PATCH 067/205] [PSM Interop] Update and improve local-dev.cfg example (#33892) The most important change here is to setting `resource_suffix` and `server_xds_port` flags to "generate randomly" by default. Previously we were suggesting static values, and devs ended up with resource conflict errors. --- .../config/local-dev.cfg.example | 74 ++++++++++++------- 1 file changed, 49 insertions(+), 25 deletions(-) diff --git a/tools/run_tests/xds_k8s_test_driver/config/local-dev.cfg.example b/tools/run_tests/xds_k8s_test_driver/config/local-dev.cfg.example index 9c90b9082a02a..88e3afb013886 100644 --- a/tools/run_tests/xds_k8s_test_driver/config/local-dev.cfg.example +++ b/tools/run_tests/xds_k8s_test_driver/config/local-dev.cfg.example @@ -1,38 +1,62 @@ -# Copy to local-dev.cfg; replace ${UPPERCASED_VARS} with your settings. -# Usage: python -m tests.baseline_test --flagfile=config/local-dev.cfg -# Alt usage: ./run.sh tests/baseline_test.py +# Copy to local-dev.cfg; replace ${UPPERCASED_VARS}. Details in README.md. -# Import common settings +## Import common settings --flagfile=config/common.cfg -# Project settings +### --------------------------------- Project ---------------------------------- + +## Project settings --project=${PROJECT_ID} --gcp_service_account=${WORKLOAD_SA_EMAIL} --private_api_key_secret_name=projects/${PROJECT_NUMBER}/secrets/xds-interop-tests-private-api-access-key -# Uncomment to ensure the allow health check firewall exists before test case runs -# --ensure_firewall -# Uncomment if the health check port opened in firewall is different than 8080 -# --server_port=50051 -# Use a resource prefix to describe usage and ownership ---resource_prefix=xds-k8s-test +### --------------------------------- Clusters --------------------------------- -# Use predictable resource suffix to simplify debugging -# If left blank, the framework will randomly generate one ---resource_suffix=dev - -# The name of kube context to use. See `gcloud container clusters get-credentials` and `kubectl config` +## The name of kube context to use (points to your GKE cluster). --kube_context=${KUBE_CONTEXT} -# Test images, f.e. java v1.46.x: ---server_image=gcr.io/grpc-testing/xds-interop/java-server:v1.46.x ---client_image=gcr.io/grpc-testing/xds-interop/java-client:v1.46.x +### ------------------------------- App images --------------------------------- + +## Test images, f.e. java v1.57.x. +--server_image=gcr.io/grpc-testing/xds-interop/java-server:v1.57.x +--client_image=gcr.io/grpc-testing/xds-interop/java-client:v1.57.x + +### ----------------------------------- App ------------------------------------ + +## Use a resource prefix to describe usage and ownership. +--resource_prefix=${USER}-psm + +## Use random port in the server xds address, f.e. xds://my-test-server:42 +--server_xds_port=0 + +## When running ./bin helpers, you might need to set randomly generated fields +## to a static value. +# --resource_suffix=dev +# --server_xds_port=1111 -# Uncomment for verbose output -#--logger_levels=__main__:DEBUG,framework:DEBUG -#--verbosity=1 +### --------------------------------- Logging ---------------------------------- -# Enable port forwarding in local dev +## Verbosity: -3 (fatal/critical), -2 (error), -1 (warning), 0 (info), 1 (debug) +# --verbosity=1 + +## Uncomment and set different log levels per module. Examples: +# --logger_levels=__main__:DEBUG,framework:INFO +# --logger_levels=__main__:INFO,framework:DEBUG,urllib3.connectionpool:ERROR + +## Uncomment to collect test client, server logs to out/test_app_logs/ folder. +# --collect_app_logs +# --log_dir=out + +### ------------------------------- Local dev --------------------------------- + +## Enable port forwarding in local dev. --debug_use_port_forwarding -# (convenience) Allow to set always known flags ---undefok=private_api_key_secret_name + +## (convenience) Allow to set always known flags. +--undefok=private_api_key_secret_name,gcp_ui_url + +## Uncomment to create the firewall rule before test case runs. +# --ensure_firewall + +## Uncomment if the health check port opened in firewall is different than 8080. +# --server_port=50051 From 3dc307b5676a68c7e38dddef1bddff5919211cf5 Mon Sep 17 00:00:00 2001 From: Paulo Castello da Costa Date: Thu, 27 Jul 2023 15:24:44 -0700 Subject: [PATCH 068/205] [Test] Update benchmarks job configuration to match experiment. (#33823) This change updates the kokoro job configuration to match the changes in https://github.com/grpc/grpc/pull/33238. --- .../linux/grpc_e2e_performance_gke.sh | 89 ++++++++++++++----- 1 file changed, 66 insertions(+), 23 deletions(-) diff --git a/tools/internal_ci/linux/grpc_e2e_performance_gke.sh b/tools/internal_ci/linux/grpc_e2e_performance_gke.sh index 204610a119baa..2c87a19453b91 100755 --- a/tools/internal_ci/linux/grpc_e2e_performance_gke.sh +++ b/tools/internal_ci/linux/grpc_e2e_performance_gke.sh @@ -19,6 +19,20 @@ cd "$(dirname "$0")/../../.." source tools/internal_ci/helper_scripts/prepare_build_linux_rc + +# Environment variables to select repos and branches for various repos. +# You can edit these lines if you want to run from a fork. +GRPC_CORE_REPO=grpc/grpc +GRPC_CORE_GITREF=master +GRPC_DOTNET_REPO=grpc/grpc-dotnet +GRPC_DOTNET_GITREF=master +GRPC_GO_REPO=grpc/grpc-go +GRPC_GO_GITREF=master +GRPC_JAVA_REPO=grpc/grpc-java +GRPC_JAVA_GITREF=master +TEST_INFRA_REPO=grpc/test-infra +TEST_INFRA_GITREF=master + # This is to ensure we can push and pull images from gcr.io. We do not # necessarily need it to run load tests, but will need it when we employ # pre-built images in the optimization. @@ -45,16 +59,17 @@ PREBUILT_IMAGE_PREFIX="gcr.io/grpc-testing/e2etest/prebuilt/${LOAD_TEST_PREFIX}" UNIQUE_IDENTIFIER="$(date +%Y%m%d%H%M%S)" ROOT_DIRECTORY_OF_DOCKERFILES="../test-infra/containers/pre_built_workers/" # Head of the workspace checked out by Kokoro. -GRPC_GITREF="$(git show --format="%H" --no-patch)" +GRPC_COMMIT="$(git show --format="%H" --no-patch)" # Prebuilt workers for core languages are always built from grpc/grpc. if [[ "${KOKORO_GITHUB_COMMIT_URL%/*}" == "https://github.com/grpc/grpc/commit" ]]; then - GRPC_CORE_GITREF="${KOKORO_GIT_COMMIT}" + GRPC_CORE_COMMIT="${KOKORO_GIT_COMMIT}" else - GRPC_CORE_GITREF="$(git ls-remote -h https://github.com/grpc/grpc.git master | cut -f1)" + GRPC_CORE_COMMIT="$(git ls-remote -h "https://github.com/${GRPC_CORE_REPO}.git" "${GRPC_CORE_GITREF}" | cut -f1)" fi -GRPC_DOTNET_GITREF="$(git ls-remote -h https://github.com/grpc/grpc-dotnet.git master | cut -f1)" -GRPC_GO_GITREF="$(git ls-remote -h https://github.com/grpc/grpc-go.git master | cut -f1)" -GRPC_JAVA_GITREF="$(git ls-remote -h https://github.com/grpc/grpc-java.git master | cut -f1)" + +GRPC_DOTNET_COMMIT="$(git ls-remote "https://github.com/${GRPC_DOTNET_REPO}.git" "${GRPC_DOTNET_GITREF}" | cut -f1)" +GRPC_GO_COMMIT="$(git ls-remote "https://github.com/${GRPC_GO_REPO}.git" "${GRPC_GO_GITREF}" | cut -f1)" +GRPC_JAVA_COMMIT="$(git ls-remote "https://github.com/${GRPC_JAVA_REPO}.git" "${GRPC_JAVA_GITREF}" | cut -f1)" # Kokoro jobs run on dedicated pools. DRIVER_POOL=drivers-ci WORKER_POOL_8CORE=workers-c2-8core-ci @@ -64,11 +79,10 @@ WORKER_POOL_32CORE=workers-c2-30core-ci LOG_URL_PREFIX="http://cnsviewer/placer/prod/home/kokoro-dedicated/build_artifacts/${KOKORO_BUILD_ARTIFACTS_SUBDIR}/github/grpc/" # Clone test-infra repository and build all tools. -pushd .. -git clone https://github.com/grpc/test-infra.git -cd test-infra -# Tools are built from HEAD. -git checkout --detach +mkdir ../test-infra +pushd ../test-infra +git clone "https://github.com/${TEST_INFRA_REPO}.git" . +git checkout "${TEST_INFRA_GITREF}" make all-tools popd @@ -87,9 +101,11 @@ buildConfigs() { -a ci_buildNumber="${KOKORO_BUILD_NUMBER}" \ -a ci_buildUrl="${CLOUD_LOGGING_URL}" \ -a ci_jobName="${KOKORO_JOB_NAME}" \ - -a ci_gitCommit="${GRPC_GITREF}" \ - -a ci_gitCommit_go="${GRPC_GO_GITREF}" \ - -a ci_gitCommit_java="${GRPC_JAVA_GITREF}" \ + -a ci_gitCommit="${GRPC_COMMIT}" \ + -a ci_gitCommit_core="${GRPC_CORE_COMMIT}" \ + -a ci_gitCommit_dotnet="${GRPC_DOTNET_COMMIT}" \ + -a ci_gitCommit_go="${GRPC_GO_COMMIT}" \ + -a ci_gitCommit_java="${GRPC_JAVA_COMMIT}" \ -a ci_gitActualCommit="${KOKORO_GIT_COMMIT}" \ --prefix="${LOAD_TEST_PREFIX}" -u "${UNIQUE_IDENTIFIER}" -u "${pool}" \ -a pool="${pool}" --category=scalable \ @@ -98,8 +114,41 @@ buildConfigs() { -o "loadtest_with_prebuilt_workers_${pool}.yaml" } -buildConfigs "${WORKER_POOL_8CORE}" "${BIGQUERY_TABLE_8CORE}" -l c++ -l dotnet -l go -l java -l python -l ruby -buildConfigs "${WORKER_POOL_32CORE}" "${BIGQUERY_TABLE_32CORE}" -l c++ -l dotnet -l go -l java +# Add languages +declare -a configLangArgs8core=() +declare -a configLangArgs32core=() +declare -a runnerLangArgs=() + +# c++ +configLangArgs8core+=( -l c++ ) +configLangArgs32core+=( -l c++ ) +runnerLangArgs+=( -l "cxx:${GRPC_CORE_REPO}:${GRPC_CORE_COMMIT}" ) + +# dotnet +configLangArgs8core+=( -l dotnet ) +configLangArgs32core+=( -l dotnet ) +runnerLangArgs+=( -l "dotnet:${GRPC_DOTNET_REPO}:${GRPC_DOTNET_COMMIT}" ) + +# go +configLangArgs8core+=( -l go ) +configLangArgs32core+=( -l go ) +runnerLangArgs+=( -l "go:${GRPC_GO_REPO}:${GRPC_GO_COMMIT}" ) + +# java +configLangArgs8core+=( -l java ) +configLangArgs32core+=( -l java ) +runnerLangArgs+=( -l "java:${GRPC_JAVA_REPO}:${GRPC_JAVA_COMMIT}" ) + +# python +configLangArgs8core+=( -l python ) # 8-core only. +runnerLangArgs+=( -l "python:${GRPC_CORE_REPO}:${GRPC_CORE_COMMIT}" ) + +# ruby +configLangArgs8core+=( -l ruby ) # 8-core only. +runnerLangArgs+=( -l "ruby:${GRPC_CORE_REPO}:${GRPC_CORE_COMMIT}" ) + +buildConfigs "${WORKER_POOL_8CORE}" "${BIGQUERY_TABLE_8CORE}" "${configLangArgs8core[@]}" +buildConfigs "${WORKER_POOL_32CORE}" "${BIGQUERY_TABLE_32CORE}" "${configLangArgs32core[@]}" # Delete prebuilt images on exit. deleteImages() { @@ -111,13 +160,7 @@ deleteImages() { trap deleteImages EXIT # Build and push prebuilt images for running tests. -time ../test-infra/bin/prepare_prebuilt_workers \ - -l "cxx:${GRPC_CORE_GITREF}" \ - -l "dotnet:${GRPC_DOTNET_GITREF}" \ - -l "go:${GRPC_GO_GITREF}" \ - -l "java:${GRPC_JAVA_GITREF}" \ - -l "python:${GRPC_CORE_GITREF}" \ - -l "ruby:${GRPC_CORE_GITREF}" \ +time ../test-infra/bin/prepare_prebuilt_workers "${runnerLangArgs[@]}" \ -p "${PREBUILT_IMAGE_PREFIX}" \ -t "${UNIQUE_IDENTIFIER}" \ -r "${ROOT_DIRECTORY_OF_DOCKERFILES}" From b701a5433e3d3020bf2815748d810cdba049fd55 Mon Sep 17 00:00:00 2001 From: yifeizhuang Date: Thu, 27 Jul 2023 15:45:48 -0700 Subject: [PATCH 069/205] [interop] update client matrix images for java (#32349) --- tools/interop_matrix/client_matrix.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/interop_matrix/client_matrix.py b/tools/interop_matrix/client_matrix.py index 42097820840f2..303b3da49c46a 100644 --- a/tools/interop_matrix/client_matrix.py +++ b/tools/interop_matrix/client_matrix.py @@ -412,14 +412,15 @@ def __init__(self, patch=[], runtimes=[], testcases_file=None): ("v1.42.3", ReleaseInfo()), ("v1.43.3", ReleaseInfo()), ("v1.44.2", ReleaseInfo()), - ("v1.45.3", ReleaseInfo()), + ("v1.45.4", ReleaseInfo()), ("v1.46.1", ReleaseInfo()), ("v1.47.1", ReleaseInfo()), ("v1.48.2", ReleaseInfo()), ("v1.49.2", ReleaseInfo()), ("v1.50.3", ReleaseInfo()), - ("v1.51.1", ReleaseInfo()), - ("v1.52.0", ReleaseInfo()), + ("v1.51.3", ReleaseInfo()), + ("v1.52.1", ReleaseInfo()), + ("v1.53.0", ReleaseInfo()), ("v1.54.0", ReleaseInfo()), ("v1.55.1", ReleaseInfo()), ("v1.56.0", ReleaseInfo()), From 2b3400052d5c670ec8c974cad311735f7c551661 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 27 Jul 2023 15:55:14 -0700 Subject: [PATCH 070/205] [avl] Use RefCountedPtr instead of shared_ptr (#33900) Reduces node size from 112 bytes to 88 bytes on x64 opt builds. (also delete the unused specialization of `AVL`) --------- Co-authored-by: ctiller --- CMakeLists.txt | 3 +- build_autogenerated.yaml | 7 +- src/core/BUILD | 2 + src/core/lib/avl/avl.h | 183 +++------------------------------------ 4 files changed, 17 insertions(+), 178 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 923aa95102fa0..fb8fda2c87950 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6383,8 +6383,7 @@ target_link_libraries(avl_test ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ZLIB_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} - absl::strings - absl::variant + gpr ) diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 4be7bf55a5a6c..49236f99ad5dd 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -4776,12 +4776,13 @@ targets: language: c++ headers: - src/core/lib/avl/avl.h - - src/core/lib/gpr/useful.h + - src/core/lib/gprpp/atomic_utils.h + - src/core/lib/gprpp/ref_counted.h + - src/core/lib/gprpp/ref_counted_ptr.h src: - test/core/avl/avl_test.cc deps: - - absl/strings:strings - - absl/types:variant + - gpr uses_polling: false - name: aws_request_signer_test gtest: true diff --git a/src/core/BUILD b/src/core/BUILD index d34265179224e..14f615158b153 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -1360,8 +1360,10 @@ grpc_cc_library( "lib/avl/avl.h", ], deps = [ + "ref_counted", "useful", "//:gpr_platform", + "//:ref_counted_ptr", ], ) diff --git a/src/core/lib/avl/avl.h b/src/core/lib/avl/avl.h index 9ce529689cb2b..269bdb85c7087 100644 --- a/src/core/lib/avl/avl.h +++ b/src/core/lib/avl/avl.h @@ -20,10 +20,11 @@ #include #include // IWYU pragma: keep -#include #include #include "src/core/lib/gpr/useful.h" +#include "src/core/lib/gprpp/ref_counted.h" +#include "src/core/lib/gprpp/ref_counted_ptr.h" namespace grpc_core { @@ -42,12 +43,12 @@ class AVL { template const V* Lookup(const SomethingLikeK& key) const { NodePtr n = Get(root_, key); - return n ? &n->kv.second : nullptr; + return n != nullptr ? &n->kv.second : nullptr; } const std::pair* LookupBelow(const K& key) const { NodePtr n = GetBelow(root_, *key); - return n ? &n->kv : nullptr; + return n != nullptr ? &n->kv : nullptr; } bool Empty() const { return root_ == nullptr; } @@ -95,8 +96,8 @@ class AVL { private: struct Node; - typedef std::shared_ptr NodePtr; - struct Node : public std::enable_shared_from_this { + typedef RefCountedPtr NodePtr; + struct Node : public RefCounted { Node(K k, V v, NodePtr l, NodePtr r, long h) : kv(std::move(k), std::move(v)), left(std::move(l)), @@ -167,12 +168,12 @@ class AVL { ForEachImpl(n->right.get(), std::forward(f)); } - static long Height(const NodePtr& n) { return n ? n->height : 0; } + static long Height(const NodePtr& n) { return n != nullptr ? n->height : 0; } static NodePtr MakeNode(K key, V value, const NodePtr& left, const NodePtr& right) { - return std::make_shared(std::move(key), std::move(value), left, right, - 1 + std::max(Height(left), Height(right))); + return MakeRefCounted(std::move(key), std::move(value), left, right, + 1 + std::max(Height(left), Height(right))); } template @@ -259,7 +260,7 @@ class AVL { } static NodePtr AddKey(const NodePtr& node, K key, V value) { - if (!node) { + if (node == nullptr) { return MakeNode(std::move(key), std::move(value), nullptr, nullptr); } if (node->kv.first < key) { @@ -318,170 +319,6 @@ class AVL { } }; -template -class AVL { - public: - AVL() {} - - AVL Add(K key) const { return AVL(AddKey(root_, std::move(key))); } - AVL Remove(const K& key) const { return AVL(RemoveKey(root_, key)); } - bool Lookup(const K& key) const { return Get(root_, key) != nullptr; } - bool Empty() const { return root_ == nullptr; } - - template - void ForEach(F&& f) const { - ForEachImpl(root_.get(), std::forward(f)); - } - - bool SameIdentity(AVL avl) const { return root_ == avl.root_; } - - private: - struct Node; - - typedef std::shared_ptr NodePtr; - struct Node : public std::enable_shared_from_this { - Node(K k, NodePtr l, NodePtr r, long h) - : key(std::move(k)), - left(std::move(l)), - right(std::move(r)), - height(h) {} - const K key; - const NodePtr left; - const NodePtr right; - const long height; - }; - NodePtr root_; - - explicit AVL(NodePtr root) : root_(std::move(root)) {} - - template - static void ForEachImpl(const Node* n, F&& f) { - if (n == nullptr) return; - ForEachImpl(n->left.get(), std::forward(f)); - f(const_cast(n->key)); - ForEachImpl(n->right.get(), std::forward(f)); - } - - static long Height(const NodePtr& n) { return n ? n->height : 0; } - - static NodePtr MakeNode(K key, const NodePtr& left, const NodePtr& right) { - return std::make_shared(std::move(key), left, right, - 1 + std::max(Height(left), Height(right))); - } - - static NodePtr Get(const NodePtr& node, const K& key) { - if (node == nullptr) { - return nullptr; - } - - if (node->key > key) { - return Get(node->left, key); - } else if (node->key < key) { - return Get(node->right, key); - } else { - return node; - } - } - - static NodePtr RotateLeft(K key, const NodePtr& left, const NodePtr& right) { - return MakeNode(right->key, MakeNode(std::move(key), left, right->left), - right->right); - } - - static NodePtr RotateRight(K key, const NodePtr& left, const NodePtr& right) { - return MakeNode(left->key, left->left, - MakeNode(std::move(key), left->right, right)); - } - - static NodePtr RotateLeftRight(K key, const NodePtr& left, - const NodePtr& right) { - // rotate_right(..., rotate_left(left), right) - return MakeNode(left->right->key, - MakeNode(left->key, left->left, left->right->left), - MakeNode(std::move(key), left->right->right, right)); - } - - static NodePtr RotateRightLeft(K key, const NodePtr& left, - const NodePtr& right) { - // rotate_left(..., left, rotate_right(right)) - return MakeNode(right->left->key, - MakeNode(std::move(key), left, right->left->left), - MakeNode(right->key, right->left->right, right->right)); - } - - static NodePtr Rebalance(K key, const NodePtr& left, const NodePtr& right) { - switch (Height(left) - Height(right)) { - case 2: - if (Height(left->left) - Height(left->right) == -1) { - return RotateLeftRight(std::move(key), left, right); - } else { - return RotateRight(std::move(key), left, right); - } - case -2: - if (Height(right->left) - Height(right->right) == 1) { - return RotateRightLeft(std::move(key), left, right); - } else { - return RotateLeft(std::move(key), left, right); - } - default: - return MakeNode(key, left, right); - } - } - - static NodePtr AddKey(const NodePtr& node, K key) { - if (!node) { - return MakeNode(std::move(key), nullptr, nullptr); - } - if (node->key < key) { - return Rebalance(node->key, node->left, - AddKey(node->right, std::move(key))); - } - if (key < node->key) { - return Rebalance(node->key, AddKey(node->left, std::move(key)), - node->right); - } - return MakeNode(std::move(key), node->left, node->right); - } - - static NodePtr InOrderHead(NodePtr node) { - while (node->left != nullptr) { - node = node->left; - } - return node; - } - - static NodePtr InOrderTail(NodePtr node) { - while (node->right != nullptr) { - node = node->right; - } - return node; - } - - static NodePtr RemoveKey(const NodePtr& node, const K& key) { - if (node == nullptr) { - return nullptr; - } - if (key < node->key) { - return Rebalance(node->key, RemoveKey(node->left, key), node->right); - } else if (node->key < key) { - return Rebalance(node->key, node->left, RemoveKey(node->right, key)); - } else { - if (node->left == nullptr) { - return node->right; - } else if (node->right == nullptr) { - return node->left; - } else if (node->left->height < node->right->height) { - NodePtr h = InOrderHead(node->right); - return Rebalance(h->key, node->left, RemoveKey(node->right, h->key)); - } else { - NodePtr h = InOrderTail(node->left); - return Rebalance(h->key, RemoveKey(node->left, h->key), node->right); - } - } - abort(); - } -}; - } // namespace grpc_core #endif // GRPC_SRC_CORE_LIB_AVL_AVL_H From e5438767e7040ec5c96c074dd2f7aa70fccbd6c3 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 27 Jul 2023 16:45:13 -0700 Subject: [PATCH 071/205] [channel-args] Do not mutate the AVL if there is no change (#33905) Inserts and removals create `O(log(n))` new nodes with a persistent AVL - which is nice - but if there's ultimately no mutation even this is wasteful. Do some extra work in channel args to verify that there is indeed a mutation, otherwise continue to share the same underlying object. --- src/core/lib/channel/channel_args.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/core/lib/channel/channel_args.cc b/src/core/lib/channel/channel_args.cc index 1e76d6dca6df3..6a74d9b10445b 100644 --- a/src/core/lib/channel/channel_args.cc +++ b/src/core/lib/channel/channel_args.cc @@ -191,6 +191,9 @@ ChannelArgs ChannelArgs::Set(absl::string_view name, int value) const { } ChannelArgs ChannelArgs::Set(absl::string_view name, Value value) const { + if (const auto* p = args_.Lookup(name)) { + if (*p == value) return *this; // already have this value for this key + } return ChannelArgs(args_.Add(std::string(name), std::move(value))); } @@ -208,18 +211,17 @@ ChannelArgs ChannelArgs::Set(absl::string_view name, std::string value) const { } ChannelArgs ChannelArgs::Remove(absl::string_view name) const { + if (args_.Lookup(name) == nullptr) return *this; return ChannelArgs(args_.Remove(name)); } ChannelArgs ChannelArgs::RemoveAllKeysWithPrefix( absl::string_view prefix) const { - ChannelArgs result; - args_.ForEach([&](const std::string& key, const Value& value) { - if (!absl::StartsWith(key, prefix)) { - result.args_ = result.args_.Add(key, value); - } + auto args = args_; + args_.ForEach([&args, prefix](const std::string& key, const Value&) { + if (absl::StartsWith(key, prefix)) args = args.Remove(key); }); - return result; + return ChannelArgs(std::move(args)); } absl::optional ChannelArgs::GetInt(absl::string_view name) const { From 8082abb60c116f63232de4b0ca18a2645edf5b5a Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Thu, 27 Jul 2023 17:42:51 -0700 Subject: [PATCH 072/205] [benchmark] Allow PSM categories to be exported (#33904) I don't personally need this, but it seems like a missed piece of https://github.com/grpc/grpc/pull/29336 --- tools/run_tests/performance/scenario_config_exporter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/run_tests/performance/scenario_config_exporter.py b/tools/run_tests/performance/scenario_config_exporter.py index 6ce831678358b..baa41f47e3426 100755 --- a/tools/run_tests/performance/scenario_config_exporter.py +++ b/tools/run_tests/performance/scenario_config_exporter.py @@ -188,7 +188,7 @@ def main() -> None: argp.add_argument( "--category", default="all", - choices=["all", "inproc", "scalable", "smoketest", "sweep"], + choices=["all", "inproc", "scalable", "smoketest", "sweep", "psm"], help="Select scenarios for a category of tests.", ) argp.add_argument( From 9c30f6742f1ee1af07e351f126350e73bdd54f3b Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Fri, 28 Jul 2023 09:21:42 -0700 Subject: [PATCH 073/205] [benchmark] Add "dashboard" category to scenario_config.py (#33907) This PR covers C++ only. Other language owners: feel free to ping me if this would be useful for you. This allows scenario_config to produce a small superset of tests required to generate the performance dashboard https://grafana-dot-grpc-testing.appspot.com/. This only adds a category to some existing scenarios, and to my knowledge, should not affect any current automation that uses scenario_config. I plan to use this category to run gRPC-core experiments and produce equivalent dashboards. It seems worth landing this independently of those job configurations, but I'm flexible. --------- Co-authored-by: drfloob --- tools/run_tests/performance/scenario_config.py | 18 ++++++++++++++++-- .../performance/scenario_config_exporter.py | 10 +++++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/tools/run_tests/performance/scenario_config.py b/tools/run_tests/performance/scenario_config.py index 21ed19916f92d..395c8df25e072 100644 --- a/tools/run_tests/performance/scenario_config.py +++ b/tools/run_tests/performance/scenario_config.py @@ -25,6 +25,9 @@ INPROC = "inproc" SWEEP = "sweep" PSM = "psm" +# A small superset of the benchmarks required to produce +# https://grafana-dot-grpc-testing.appspot.com/ +DASHBOARD = "dashboard" DEFAULT_CATEGORIES = (SCALABLE, SMOKETEST) SECURE_SECARGS = { @@ -527,7 +530,7 @@ def scenarios(self): minimal_stack=not secure, categories=smoketest_categories + inproc_categories - + [SCALABLE], + + [SCALABLE, DASHBOARD], ) for rpc_type in [ @@ -536,6 +539,9 @@ def scenarios(self): "streaming_from_client", "streaming_from_server", ]: + maybe_dashboard = ( + [DASHBOARD] if rpc_type in ("unary", "streaming") else [] + ) for synchronicity in ["sync", "async"]: yield _ping_pong_scenario( "cpp_protobuf_%s_%s_ping_pong_%s" @@ -546,6 +552,7 @@ def scenarios(self): async_server_threads=1, minimal_stack=not secure, secure=secure, + categories=list(DEFAULT_CATEGORIES) + maybe_dashboard, ) for size in geometric_progression( @@ -576,6 +583,11 @@ def scenarios(self): # see b/198275705 maybe_scalable = [SWEEP] + maybe_dashboard = ( + [DASHBOARD] + if rpc_type in ("unary", "streaming") + else [] + ) yield _ping_pong_scenario( "cpp_protobuf_%s_%s_qps_unconstrained_%s" % (synchronicity, rpc_type, secstr), @@ -587,7 +599,9 @@ def scenarios(self): minimal_stack=not secure, server_threads_per_cq=2, client_threads_per_cq=2, - categories=inproc_categories + maybe_scalable, + categories=inproc_categories + + maybe_scalable + + maybe_dashboard, ) # TODO(vjpai): Re-enable this test. It has a lot of timeouts diff --git a/tools/run_tests/performance/scenario_config_exporter.py b/tools/run_tests/performance/scenario_config_exporter.py index baa41f47e3426..436557f5691d3 100755 --- a/tools/run_tests/performance/scenario_config_exporter.py +++ b/tools/run_tests/performance/scenario_config_exporter.py @@ -188,7 +188,15 @@ def main() -> None: argp.add_argument( "--category", default="all", - choices=["all", "inproc", "scalable", "smoketest", "sweep", "psm"], + choices=[ + "all", + "inproc", + "scalable", + "smoketest", + "sweep", + "psm", + "dashboard", + ], help="Select scenarios for a category of tests.", ) argp.add_argument( From 0e9553cf4ebdb9a42efc05f13735b8d7cd3d8b3e Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Fri, 28 Jul 2023 10:46:54 -0700 Subject: [PATCH 074/205] [EventEngine] Add TODOs to re-enable EventEngine end2end tests (#33911) These tests should be re-enabled before we claim confidence in the engine implementations. It seems these tests are still being run, not sure if that's true in all cases ([example](https://source.cloud.google.com/results/invocations/be524340-c98f-4915-a833-192047ae9925/targets/%2F%2Ftest%2Fcore%2Fend2end:call_creds_test@experiment%3Devent_engine_client/log)). Alternatively, we can scrap this PR and enable all tests now if you feel you're ready to start looking at PosixEventEngine test failures. CC @yijiem @ctiller --- test/core/end2end/tests/binary_metadata.cc | 1 + test/core/end2end/tests/call_creds.cc | 2 ++ test/core/end2end/tests/cancel_after_accept.cc | 1 + test/core/end2end/tests/cancel_after_invoke.cc | 4 ++++ test/core/end2end/tests/cancel_with_status.cc | 1 + test/core/end2end/tests/filtered_metadata.cc | 1 + test/core/end2end/tests/retry_recv_initial_metadata.cc | 1 + test/core/end2end/tests/simple_request.cc | 1 + 8 files changed, 12 insertions(+) diff --git a/test/core/end2end/tests/binary_metadata.cc b/test/core/end2end/tests/binary_metadata.cc index 77c1692ff4c3f..85076d8c6e014 100644 --- a/test/core/end2end/tests/binary_metadata.cc +++ b/test/core/end2end/tests/binary_metadata.cc @@ -117,6 +117,7 @@ CORE_END2END_TEST(CoreEnd2endTest, CORE_END2END_TEST(CoreEnd2endTest, BinaryMetadataServerHttp2FallbackClientHttp2Fallback) { + // TODO(vigneshbabu): re-enable these before release SKIP_IF_USES_EVENT_ENGINE_CLIENT(); BinaryMetadata(*this, false, false); } diff --git a/test/core/end2end/tests/call_creds.cc b/test/core/end2end/tests/call_creds.cc index 983f8462d036f..15f9529deec80 100644 --- a/test/core/end2end/tests/call_creds.cc +++ b/test/core/end2end/tests/call_creds.cc @@ -288,6 +288,7 @@ CORE_END2END_TEST(PerCallCredsTest, CORE_END2END_TEST(PerCallCredsTest, RequestResponseWithPayloadAndDeletedInsecureCallCreds) { + // TODO(vigneshbabu): re-enable these before release SKIP_IF_USES_EVENT_ENGINE_CLIENT(); TestRequestResponseWithPayloadAndDeletedCallCreds(*this, false); } @@ -304,6 +305,7 @@ CORE_END2END_TEST(PerCallCredsOnInsecureTest, CORE_END2END_TEST(PerCallCredsOnInsecureTest, RequestResponseWithPayloadAndDeletedInsecureCallCreds) { + // TODO(vigneshbabu): re-enable these before release SKIP_IF_USES_EVENT_ENGINE_CLIENT(); TestRequestResponseWithPayloadAndDeletedCallCreds(*this, false); } diff --git a/test/core/end2end/tests/cancel_after_accept.cc b/test/core/end2end/tests/cancel_after_accept.cc index d56272eab0cc2..2e6b031ac7f2e 100644 --- a/test/core/end2end/tests/cancel_after_accept.cc +++ b/test/core/end2end/tests/cancel_after_accept.cc @@ -76,6 +76,7 @@ CORE_END2END_TEST(CoreDeadlineTest, DeadlineAfterAccept) { } CORE_END2END_TEST(CoreClientChannelTest, DeadlineAfterAcceptWithServiceConfig) { + // TODO(vigneshbabu): re-enable these before release SKIP_IF_USES_EVENT_ENGINE_CLIENT(); SKIP_IF_USES_EVENT_ENGINE_LISTENER(); InitServer(ChannelArgs()); diff --git a/test/core/end2end/tests/cancel_after_invoke.cc b/test/core/end2end/tests/cancel_after_invoke.cc index c6fd16d0f29b9..24d8d9e6ffeab 100644 --- a/test/core/end2end/tests/cancel_after_invoke.cc +++ b/test/core/end2end/tests/cancel_after_invoke.cc @@ -104,21 +104,25 @@ void CancelAfterInvoke3(CoreEnd2endTest& test, } CORE_END2END_TEST(CoreEnd2endTest, CancelAfterInvoke6) { + // TODO(vigneshbabu): re-enable these before release SKIP_IF_USES_EVENT_ENGINE_LISTENER(); CancelAfterInvoke6(*this, std::make_unique()); } CORE_END2END_TEST(CoreEnd2endTest, CancelAfterInvoke5) { + // TODO(vigneshbabu): re-enable these before release SKIP_IF_USES_EVENT_ENGINE_LISTENER(); CancelAfterInvoke5(*this, std::make_unique()); } CORE_END2END_TEST(CoreEnd2endTest, CancelAfterInvoke4) { + // TODO(vigneshbabu): re-enable these before release SKIP_IF_USES_EVENT_ENGINE_LISTENER(); CancelAfterInvoke4(*this, std::make_unique()); } CORE_END2END_TEST(CoreEnd2endTest, CancelAfterInvoke3) { + // TODO(vigneshbabu): re-enable these before release SKIP_IF_USES_EVENT_ENGINE_LISTENER(); CancelAfterInvoke3(*this, std::make_unique()); } diff --git a/test/core/end2end/tests/cancel_with_status.cc b/test/core/end2end/tests/cancel_with_status.cc index 36f3c531abe3d..8fb09d3f66670 100644 --- a/test/core/end2end/tests/cancel_with_status.cc +++ b/test/core/end2end/tests/cancel_with_status.cc @@ -81,6 +81,7 @@ CORE_END2END_TEST(CoreEnd2endTest, CancelWithStatus3) { } CORE_END2END_TEST(CoreEnd2endTest, CancelWithStatus4) { + // TODO(vigneshbabu): re-enable these before release SKIP_IF_USES_EVENT_ENGINE_LISTENER(); auto c = NewClientCall("/foo").Timeout(Duration::Seconds(5)).Create(); CoreEnd2endTest::IncomingMetadata server_initial_metadata; diff --git a/test/core/end2end/tests/filtered_metadata.cc b/test/core/end2end/tests/filtered_metadata.cc index 442451f116c7b..0248cb5ff6cf4 100644 --- a/test/core/end2end/tests/filtered_metadata.cc +++ b/test/core/end2end/tests/filtered_metadata.cc @@ -72,6 +72,7 @@ void TestRequestResponseWithMetadataToBeFiltered( } CORE_END2END_TEST(CoreEnd2endTest, ContentLengthIsFiltered) { + // TODO(vigneshbabu): re-enable these before release SKIP_IF_USES_EVENT_ENGINE_CLIENT(); TestRequestResponseWithMetadataToBeFiltered(*this, "content-length", "45"); } diff --git a/test/core/end2end/tests/retry_recv_initial_metadata.cc b/test/core/end2end/tests/retry_recv_initial_metadata.cc index 1d7f514fb5fe5..eee7683da39ce 100644 --- a/test/core/end2end/tests/retry_recv_initial_metadata.cc +++ b/test/core/end2end/tests/retry_recv_initial_metadata.cc @@ -35,6 +35,7 @@ namespace { // - first attempt receives initial metadata before trailing metadata, // so no retry is done even though status was ABORTED CORE_END2END_TEST(RetryTest, RetryRecvInitialMetadata) { + // TODO(vigneshbabu): re-enable these before release SKIP_IF_USES_EVENT_ENGINE_CLIENT(); InitServer(ChannelArgs()); InitClient(ChannelArgs().Set( diff --git a/test/core/end2end/tests/simple_request.cc b/test/core/end2end/tests/simple_request.cc index 59f205fa53f0f..08645cc1f3aa4 100644 --- a/test/core/end2end/tests/simple_request.cc +++ b/test/core/end2end/tests/simple_request.cc @@ -99,6 +99,7 @@ void SimpleRequestBody(CoreEnd2endTest& test) { } CORE_END2END_TEST(CoreEnd2endTest, SimpleRequest) { + // TODO(vigneshbabu): re-enable these before release SKIP_IF_USES_EVENT_ENGINE_LISTENER(); SimpleRequestBody(*this); } From 6b2de0fa4bd486b9f8461154ac985528d11ed47a Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 28 Jul 2023 11:24:22 -0700 Subject: [PATCH 075/205] [chttp2] Use RefCountedPtr for grpc_chttp2_transport (#33746) Co-authored-by: ctiller --- include/grpc/event_engine/memory_allocator.h | 4 +- .../transport/chttp2/server/chttp2_server.cc | 19 +- .../chttp2/transport/chttp2_transport.cc | 619 +++++++++--------- .../ext/transport/chttp2/transport/internal.h | 57 +- .../ext/transport/chttp2/transport/parsing.cc | 5 +- .../ext/transport/chttp2/transport/writing.cc | 7 +- 6 files changed, 358 insertions(+), 353 deletions(-) diff --git a/include/grpc/event_engine/memory_allocator.h b/include/grpc/event_engine/memory_allocator.h index b31bed0ed216d..b3143d8dd6a79 100644 --- a/include/grpc/event_engine/memory_allocator.h +++ b/include/grpc/event_engine/memory_allocator.h @@ -56,8 +56,8 @@ class MemoryAllocator { /// The object will not be usable after this call unless it's a valid /// allocator is moved into it. void Reset() { - if (allocator_ != nullptr) allocator_->Shutdown(); - allocator_.reset(); + auto a = std::move(allocator_); + if (a != nullptr) a->Shutdown(); } /// Reserve bytes from the quota. diff --git a/src/core/ext/transport/chttp2/server/chttp2_server.cc b/src/core/ext/transport/chttp2/server/chttp2_server.cc index a4718fc769a50..7ba070e479e7a 100644 --- a/src/core/ext/transport/chttp2/server/chttp2_server.cc +++ b/src/core/ext/transport/chttp2/server/chttp2_server.cc @@ -210,7 +210,8 @@ class Chttp2ServerListener : public Server::ListenerInterface { OrphanablePtr handshaking_state_ ABSL_GUARDED_BY(&mu_); // Set by HandshakingState when handshaking is done and a valid transport // is created. - grpc_chttp2_transport* transport_ ABSL_GUARDED_BY(&mu_) = nullptr; + RefCountedPtr transport_ ABSL_GUARDED_BY(&mu_) = + nullptr; grpc_closure on_close_; absl::optional drain_grace_timer_handle_ ABSL_GUARDED_BY(&mu_); @@ -419,7 +420,7 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::OnTimeout() { { MutexLock lock(&connection_->mu_); if (timer_handle_.has_value()) { - transport = connection_->transport_; + transport = connection_->transport_.get(); timer_handle_.reset(); } } @@ -490,9 +491,7 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::OnHandshakeDone( // TODO(roth): Change to static_cast<> when we C++-ify the // transport API. self->connection_->transport_ = - reinterpret_cast(transport); - GRPC_CHTTP2_REF_TRANSPORT(self->connection_->transport_, - "ActiveConnection"); // Held by connection_ + reinterpret_cast(transport)->Ref(); self->Ref().release(); // Held by OnReceiveSettings(). GRPC_CLOSURE_INIT(&self->on_receive_settings_, OnReceiveSettings, self, grpc_schedule_on_exec_ctx); @@ -572,11 +571,7 @@ Chttp2ServerListener::ActiveConnection::ActiveConnection( grpc_schedule_on_exec_ctx); } -Chttp2ServerListener::ActiveConnection::~ActiveConnection() { - if (transport_ != nullptr) { - GRPC_CHTTP2_UNREF_TRANSPORT(transport_, "ActiveConnection"); - } -} +Chttp2ServerListener::ActiveConnection::~ActiveConnection() {} void Chttp2ServerListener::ActiveConnection::Orphan() { OrphanablePtr handshaking_state; @@ -595,7 +590,7 @@ void Chttp2ServerListener::ActiveConnection::SendGoAway() { { MutexLock lock(&mu_); if (transport_ != nullptr && !shutdown_) { - transport = transport_; + transport = transport_.get(); drain_grace_timer_handle_ = event_engine_->RunAfter( std::max(Duration::Zero(), listener_->args_ @@ -667,7 +662,7 @@ void Chttp2ServerListener::ActiveConnection::OnDrainGraceTimeExpiry() { { MutexLock lock(&mu_); if (drain_grace_timer_handle_.has_value()) { - transport = transport_; + transport = transport_.get(); drain_grace_timer_handle_.reset(); } } diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index 06f9d90478d07..092fb6b86ceee 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -132,14 +133,20 @@ grpc_core::DebugOnlyTraceFlag grpc_trace_chttp2_refcount(false, "chttp2_refcount"); // forward declarations of various callbacks that we'll build closures around -static void write_action_begin_locked(void* t, grpc_error_handle error); -static void write_action(void* t, grpc_error_handle error); -static void write_action_end(void* t, grpc_error_handle error); -static void write_action_end_locked(void* t, grpc_error_handle error); - -static void read_action(void* t, grpc_error_handle error); -static void read_action_locked(void* t, grpc_error_handle error); -static void continue_read_action_locked(grpc_chttp2_transport* t); +static void write_action_begin_locked( + grpc_core::RefCountedPtr, grpc_error_handle error); +static void write_action(grpc_chttp2_transport* t); +static void write_action_end(grpc_core::RefCountedPtr, + grpc_error_handle error); +static void write_action_end_locked( + grpc_core::RefCountedPtr, grpc_error_handle error); + +static void read_action(grpc_core::RefCountedPtr, + grpc_error_handle error); +static void read_action_locked(grpc_core::RefCountedPtr, + grpc_error_handle error); +static void continue_read_action_locked( + grpc_core::RefCountedPtr t); // Set a transport level setting, and push it to our peer static void queue_setting_update(grpc_chttp2_transport* t, @@ -156,8 +163,10 @@ static void connectivity_state_set(grpc_chttp2_transport* t, const absl::Status& status, const char* reason); -static void benign_reclaimer_locked(void* arg, grpc_error_handle error); -static void destructive_reclaimer_locked(void* arg, grpc_error_handle error); +static void benign_reclaimer_locked( + grpc_core::RefCountedPtr, grpc_error_handle error); +static void destructive_reclaimer_locked( + grpc_core::RefCountedPtr, grpc_error_handle error); static void post_benign_reclaimer(grpc_chttp2_transport* t); static void post_destructive_reclaimer(grpc_chttp2_transport* t); @@ -167,31 +176,45 @@ static void close_transport_locked(grpc_chttp2_transport* t, static void end_all_the_calls(grpc_chttp2_transport* t, grpc_error_handle error); -static void start_bdp_ping(void* tp, grpc_error_handle error); -static void finish_bdp_ping(void* tp, grpc_error_handle error); -static void start_bdp_ping_locked(void* tp, grpc_error_handle error); -static void finish_bdp_ping_locked(void* tp, grpc_error_handle error); +static void start_bdp_ping(grpc_core::RefCountedPtr, + grpc_error_handle error); +static void finish_bdp_ping(grpc_core::RefCountedPtr, + grpc_error_handle error); +static void start_bdp_ping_locked( + grpc_core::RefCountedPtr, grpc_error_handle error); +static void finish_bdp_ping_locked( + grpc_core::RefCountedPtr, grpc_error_handle error); static void next_bdp_ping_timer_expired(grpc_chttp2_transport* t); static void next_bdp_ping_timer_expired_locked( - void* tp, GRPC_UNUSED grpc_error_handle error); + grpc_core::RefCountedPtr tp, + GRPC_UNUSED grpc_error_handle error); static void cancel_pings(grpc_chttp2_transport* t, grpc_error_handle error); static void send_ping_locked(grpc_chttp2_transport* t, grpc_closure* on_initiate, grpc_closure* on_ack); -static void retry_initiate_ping_locked(void* tp, - GRPC_UNUSED grpc_error_handle error); +static void retry_initiate_ping_locked( + grpc_core::RefCountedPtr t, + GRPC_UNUSED grpc_error_handle error); // keepalive-relevant functions -static void init_keepalive_ping(grpc_chttp2_transport* t); -static void init_keepalive_ping_locked(void* arg, - GRPC_UNUSED grpc_error_handle error); -static void start_keepalive_ping(void* arg, grpc_error_handle error); -static void finish_keepalive_ping(void* arg, grpc_error_handle error); -static void start_keepalive_ping_locked(void* arg, grpc_error_handle error); -static void finish_keepalive_ping_locked(void* arg, grpc_error_handle error); -static void keepalive_watchdog_fired(grpc_chttp2_transport* t); +static void init_keepalive_ping( + grpc_core::RefCountedPtr t); +static void init_keepalive_ping_locked( + grpc_core::RefCountedPtr t, + GRPC_UNUSED grpc_error_handle error); +static void start_keepalive_ping( + grpc_core::RefCountedPtr t, grpc_error_handle error); +static void finish_keepalive_ping( + grpc_core::RefCountedPtr t, grpc_error_handle error); +static void start_keepalive_ping_locked( + grpc_core::RefCountedPtr t, grpc_error_handle error); +static void finish_keepalive_ping_locked( + grpc_core::RefCountedPtr t, grpc_error_handle error); +static void keepalive_watchdog_fired( + grpc_core::RefCountedPtr t); static void keepalive_watchdog_fired_locked( - void* arg, GRPC_UNUSED grpc_error_handle error); + grpc_core::RefCountedPtr t, + GRPC_UNUSED grpc_error_handle error); static void maybe_reset_keepalive_ping_timer_locked(grpc_chttp2_transport* t); namespace { @@ -211,6 +234,24 @@ grpc_core::CopyContextFn g_get_copied_context_fn = nullptr; namespace grpc_core { +namespace { +// Initialize a grpc_closure \a c to call \a Fn with \a t and \a error. Holds +// the passed in reference to \a t until it's moved into Fn. +template , grpc_error_handle)> +grpc_closure* InitTransportClosure(RefCountedPtr t, + grpc_closure* c) { + GRPC_CLOSURE_INIT( + c, + [](void* tp, grpc_error_handle error) { + Fn(RefCountedPtr( + static_cast(tp)), + std::move(error)); + }, + t.release(), nullptr); + return c; +} +} // namespace + namespace { TestOnlyGlobalHttp2TransportInitCallback test_only_init_callback = nullptr; TestOnlyGlobalHttp2TransportDestructCallback test_only_destruct_callback = @@ -493,17 +534,16 @@ static void read_channel_args(grpc_chttp2_transport* t, } static void init_keepalive_pings_if_enabled_locked( - void* arg, GRPC_UNUSED grpc_error_handle error) { + grpc_core::RefCountedPtr t, + GRPC_UNUSED grpc_error_handle error) { GPR_DEBUG_ASSERT(error.ok()); - grpc_chttp2_transport* t = static_cast(arg); if (t->keepalive_time != grpc_core::Duration::Infinity()) { t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_WAITING; - GRPC_CHTTP2_REF_TRANSPORT(t, "init keepalive ping"); t->keepalive_ping_timer_handle = - t->event_engine->RunAfter(t->keepalive_time, [t] { + t->event_engine->RunAfter(t->keepalive_time, [t = t->Ref()]() mutable { grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; grpc_core::ExecCtx exec_ctx; - init_keepalive_ping(t); + init_keepalive_ping(std::move(t)); }); } else { // Use GRPC_CHTTP2_KEEPALIVE_STATE_DISABLED to indicate there are no @@ -578,8 +618,8 @@ grpc_chttp2_transport::grpc_chttp2_transport( grpc_core::ExecCtx exec_ctx; combiner->Run( - GRPC_CLOSURE_INIT(&init_keepalive_ping_locked, - init_keepalive_pings_if_enabled_locked, this, nullptr), + grpc_core::InitTransportClosure( + Ref(), &init_keepalive_ping_locked), absl::OkStatus()); if (flow_control.bdp_probe()) { @@ -604,15 +644,15 @@ grpc_chttp2_transport::grpc_chttp2_transport( } static void destroy_transport_locked(void* tp, grpc_error_handle /*error*/) { - grpc_chttp2_transport* t = static_cast(tp); + grpc_core::RefCountedPtr t( + static_cast(tp)); t->destroying = 1; close_transport_locked( - t, grpc_error_set_int(GRPC_ERROR_CREATE("Transport destroyed"), - grpc_core::StatusIntProperty::kOccurredDuringWrite, - t->write_state)); + t.get(), + grpc_error_set_int(GRPC_ERROR_CREATE("Transport destroyed"), + grpc_core::StatusIntProperty::kOccurredDuringWrite, + t->write_state)); t->memory_owner.Reset(); - // Must be the last line. - GRPC_CHTTP2_UNREF_TRANSPORT(t, "destroy"); } static void destroy_transport(grpc_transport* gt) { @@ -646,13 +686,11 @@ static void close_transport_locked(grpc_chttp2_transport* t, "close_transport"); if (t->delayed_ping_timer_handle.has_value()) { if (t->event_engine->Cancel(*t->delayed_ping_timer_handle)) { - GRPC_CHTTP2_UNREF_TRANSPORT(t, "retry_initiate_ping_locked"); t->delayed_ping_timer_handle.reset(); } } if (t->next_bdp_ping_timer_handle.has_value()) { if (t->event_engine->Cancel(*t->next_bdp_ping_timer_handle)) { - GRPC_CHTTP2_UNREF_TRANSPORT(t, "bdp_ping"); t->next_bdp_ping_timer_handle.reset(); } } @@ -660,7 +698,6 @@ static void close_transport_locked(grpc_chttp2_transport* t, case GRPC_CHTTP2_KEEPALIVE_STATE_WAITING: if (t->keepalive_ping_timer_handle.has_value()) { if (t->event_engine->Cancel(*t->keepalive_ping_timer_handle)) { - GRPC_CHTTP2_UNREF_TRANSPORT(t, "init keepalive ping"); t->keepalive_ping_timer_handle.reset(); } } @@ -668,13 +705,11 @@ static void close_transport_locked(grpc_chttp2_transport* t, case GRPC_CHTTP2_KEEPALIVE_STATE_PINGING: if (t->keepalive_ping_timer_handle.has_value()) { if (t->event_engine->Cancel(*t->keepalive_ping_timer_handle)) { - GRPC_CHTTP2_UNREF_TRANSPORT(t, "init keepalive ping"); t->keepalive_ping_timer_handle.reset(); } } if (t->keepalive_watchdog_timer_handle.has_value()) { if (t->event_engine->Cancel(*t->keepalive_watchdog_timer_handle)) { - GRPC_CHTTP2_UNREF_TRANSPORT(t, "keepalive watchdog"); t->keepalive_watchdog_timer_handle.reset(); } } @@ -720,21 +755,23 @@ void grpc_chttp2_stream_unref(grpc_chttp2_stream* s) { } #endif -grpc_chttp2_stream::Reffer::Reffer(grpc_chttp2_stream* s) { - // We reserve one 'active stream' that's dropped when the stream is - // read-closed. The others are for Chttp2IncomingByteStreams that are - // actively reading - GRPC_CHTTP2_STREAM_REF(s, "chttp2"); - GRPC_CHTTP2_REF_TRANSPORT(s->t, "stream"); -} - grpc_chttp2_stream::grpc_chttp2_stream(grpc_chttp2_transport* t, grpc_stream_refcount* refcount, const void* server_data, grpc_core::Arena* arena) - : t(t), - refcount(refcount), - reffer(this), + : t(t->Ref()), + refcount([refcount]() { +// We reserve one 'active stream' that's dropped when the stream is +// read-closed. The others are for Chttp2IncomingByteStreams that are +// actively reading +// We do this here to avoid cache misses. +#ifndef NDEBUG + grpc_stream_ref(refcount, "chttp2"); +#else + grpc_stream_ref(refcount); +#endif + return refcount; + }()), initial_metadata_buffer(arena), trailing_metadata_buffer(arena), flow_control(&t->flow_control) { @@ -754,8 +791,8 @@ grpc_chttp2_stream::grpc_chttp2_stream(grpc_chttp2_transport* t, } grpc_chttp2_stream::~grpc_chttp2_stream() { - grpc_chttp2_list_remove_stalled_by_stream(t, this); - grpc_chttp2_list_remove_stalled_by_transport(t, this); + grpc_chttp2_list_remove_stalled_by_stream(t.get(), this); + grpc_chttp2_list_remove_stalled_by_transport(t.get(), this); if (t->channelz_socket != nullptr) { if ((t->is_client && eos_received) || (!t->is_client && eos_sent)) { @@ -786,7 +823,6 @@ grpc_chttp2_stream::~grpc_chttp2_stream() { GPR_ASSERT(recv_message_ready == nullptr); GPR_ASSERT(recv_trailing_metadata_finished == nullptr); grpc_slice_buffer_destroy(&flow_controlled_buffer); - GRPC_CHTTP2_UNREF_TRANSPORT(t, "stream"); grpc_core::ExecCtx::Run(DEBUG_LOCATION, destroy_stream_arg, absl::OkStatus()); } @@ -874,7 +910,6 @@ void grpc_chttp2_initiate_write(grpc_chttp2_transport* t, case GRPC_CHTTP2_WRITE_STATE_IDLE: set_write_state(t, GRPC_CHTTP2_WRITE_STATE_WRITING, grpc_chttp2_initiate_write_reason_string(reason)); - GRPC_CHTTP2_REF_TRANSPORT(t, "writing"); // Note that the 'write_action_begin_locked' closure is being scheduled // on the 'finally_scheduler' of t->combiner. This means that // 'write_action_begin_locked' is called only *after* all the other @@ -892,8 +927,8 @@ void grpc_chttp2_initiate_write(grpc_chttp2_transport* t, // It does not call the endpoint to write the bytes. That is done by the // 'write_action' (which is scheduled by 'write_action_begin_locked') t->combiner->FinallyRun( - GRPC_CLOSURE_INIT(&t->write_action_begin_locked, - write_action_begin_locked, t, nullptr), + grpc_core::InitTransportClosure( + t->Ref(), &t->write_action_begin_locked), absl::OkStatus()); break; case GRPC_CHTTP2_WRITE_STATE_WRITING: @@ -920,22 +955,22 @@ static const char* begin_writing_desc(bool partial) { } } -static void write_action_begin_locked(void* gt, - grpc_error_handle /*error_ignored*/) { - grpc_chttp2_transport* t = static_cast(gt); +static void write_action_begin_locked( + grpc_core::RefCountedPtr t, + grpc_error_handle /*error_ignored*/) { GPR_ASSERT(t->write_state != GRPC_CHTTP2_WRITE_STATE_IDLE); grpc_chttp2_begin_write_result r; if (!t->closed_with_error.ok()) { r.writing = false; } else { - r = grpc_chttp2_begin_write(t); + r = grpc_chttp2_begin_write(t.get()); } if (r.writing) { - set_write_state(t, + set_write_state(t.get(), r.partial ? GRPC_CHTTP2_WRITE_STATE_WRITING_WITH_MORE : GRPC_CHTTP2_WRITE_STATE_WRITING, begin_writing_desc(r.partial)); - write_action(t, absl::OkStatus()); + write_action(t.get()); if (t->reading_paused_on_pending_induced_frames) { GPR_ASSERT(t->num_pending_induced_frames == 0); // We had paused reading, because we had many induced frames (SETTINGS @@ -945,18 +980,17 @@ static void write_action_begin_locked(void* gt, GPR_INFO, "transport %p : Resuming reading after being paused due to too " "many unwritten SETTINGS ACK, PINGS ACK and RST_STREAM frames", - t)); + t.get())); t->reading_paused_on_pending_induced_frames = false; - continue_read_action_locked(t); + continue_read_action_locked(std::move(t)); } } else { - set_write_state(t, GRPC_CHTTP2_WRITE_STATE_IDLE, "begin writing nothing"); - GRPC_CHTTP2_UNREF_TRANSPORT(t, "writing"); + set_write_state(t.get(), GRPC_CHTTP2_WRITE_STATE_IDLE, + "begin writing nothing"); } } -static void write_action(void* gt, grpc_error_handle /*error*/) { - grpc_chttp2_transport* t = static_cast(gt); +static void write_action(grpc_chttp2_transport* t) { void* cl = t->cl; if (!t->cl->empty()) { // Transfer the ownership of the context list to the endpoint and create and @@ -980,28 +1014,28 @@ static void write_action(void* gt, grpc_error_handle /*error*/) { if (max_frame_size == 0) { max_frame_size = INT_MAX; } - grpc_endpoint_write( - t->ep, &t->outbuf, - GRPC_CLOSURE_INIT(&t->write_action_end_locked, write_action_end, t, - grpc_schedule_on_exec_ctx), - cl, max_frame_size); + grpc_endpoint_write(t->ep, &t->outbuf, + grpc_core::InitTransportClosure( + t->Ref(), &t->write_action_end_locked), + cl, max_frame_size); } -static void write_action_end(void* tp, grpc_error_handle error) { - grpc_chttp2_transport* t = static_cast(tp); - t->combiner->Run(GRPC_CLOSURE_INIT(&t->write_action_end_locked, - write_action_end_locked, t, nullptr), - error); +static void write_action_end(grpc_core::RefCountedPtr t, + grpc_error_handle error) { + auto* tp = t.get(); + tp->combiner->Run(grpc_core::InitTransportClosure( + std::move(t), &tp->write_action_end_locked), + error); } // Callback from the grpc_endpoint after bytes have been written by calling // sendmsg -static void write_action_end_locked(void* tp, grpc_error_handle error) { - grpc_chttp2_transport* t = static_cast(tp); - +static void write_action_end_locked( + grpc_core::RefCountedPtr t, + grpc_error_handle error) { bool closed = false; if (!error.ok()) { - close_transport_locked(t, error); + close_transport_locked(t.get(), error); closed = true; } @@ -1009,7 +1043,7 @@ static void write_action_end_locked(void* tp, grpc_error_handle error) { t->sent_goaway_state = GRPC_CHTTP2_FINAL_GOAWAY_SENT; closed = true; if (t->stream_map.empty()) { - close_transport_locked(t, GRPC_ERROR_CREATE("goaway sent")); + close_transport_locked(t.get(), GRPC_ERROR_CREATE("goaway sent")); } } @@ -1017,11 +1051,11 @@ static void write_action_end_locked(void* tp, grpc_error_handle error) { case GRPC_CHTTP2_WRITE_STATE_IDLE: GPR_UNREACHABLE_CODE(break); case GRPC_CHTTP2_WRITE_STATE_WRITING: - set_write_state(t, GRPC_CHTTP2_WRITE_STATE_IDLE, "finish writing"); + set_write_state(t.get(), GRPC_CHTTP2_WRITE_STATE_IDLE, "finish writing"); break; case GRPC_CHTTP2_WRITE_STATE_WRITING_WITH_MORE: - set_write_state(t, GRPC_CHTTP2_WRITE_STATE_WRITING, "continue writing"); - GRPC_CHTTP2_REF_TRANSPORT(t, "writing"); + set_write_state(t.get(), GRPC_CHTTP2_WRITE_STATE_WRITING, + "continue writing"); // If the transport is closed, we will retry writing on the endpoint // and next write may contain part of the currently serialized frames. // So, we should only call the run_after_write callbacks when the next @@ -1031,14 +1065,13 @@ static void write_action_end_locked(void* tp, grpc_error_handle error) { grpc_core::ExecCtx::RunList(DEBUG_LOCATION, &t->run_after_write); } t->combiner->FinallyRun( - GRPC_CLOSURE_INIT(&t->write_action_begin_locked, - write_action_begin_locked, t, nullptr), + grpc_core::InitTransportClosure( + t, &t->write_action_begin_locked), absl::OkStatus()); break; } - grpc_chttp2_end_write(t, error); - GRPC_CHTTP2_UNREF_TRANSPORT(t, "writing"); + grpc_chttp2_end_write(t.get(), error); } // Dirties an HTTP2 setting to be sent out next time a writing path occurs. @@ -1111,7 +1144,7 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t, s->trailing_metadata_buffer.Set( grpc_core::GrpcStreamNetworkState(), grpc_core::GrpcStreamNetworkState::kNotSeenByServer); - grpc_chttp2_cancel_stream(s->t, s, s->t->goaway_error); + grpc_chttp2_cancel_stream(s->t.get(), s, s->t->goaway_error); } } absl::Status status = grpc_error_to_absl_status(t->goaway_error); @@ -1300,7 +1333,7 @@ static void perform_stream_op_locked(void* stream_op, grpc_chttp2_stream* s = static_cast(op->handler_private.extra_arg); grpc_transport_stream_op_batch_payload* op_payload = op->payload; - grpc_chttp2_transport* t = s->t; + grpc_chttp2_transport* t = s->t.get(); s->context = op->payload->context; s->traced = op->is_traced; @@ -1608,56 +1641,61 @@ static void send_ping_locked(grpc_chttp2_transport* t, // Specialized form of send_ping_locked for keepalive ping. If there is already // a ping in progress, the keepalive ping would piggyback onto that ping, // instead of waiting for that ping to complete and then starting a new ping. -static void send_keepalive_ping_locked(grpc_chttp2_transport* t) { +static void send_keepalive_ping_locked( + grpc_core::RefCountedPtr t) { if (!t->closed_with_error.ok()) { - t->combiner->Run(GRPC_CLOSURE_INIT(&t->start_keepalive_ping_locked, - start_keepalive_ping_locked, t, nullptr), - t->closed_with_error); t->combiner->Run( - GRPC_CLOSURE_INIT(&t->finish_keepalive_ping_locked, - finish_keepalive_ping_locked, t, nullptr), + grpc_core::InitTransportClosure( + t->Ref(), &t->start_keepalive_ping_locked), + t->closed_with_error); + t->combiner->Run( + grpc_core::InitTransportClosure( + t->Ref(), &t->finish_keepalive_ping_locked), t->closed_with_error); return; } grpc_chttp2_ping_queue* pq = &t->ping_queue; if (!grpc_closure_list_empty(pq->lists[GRPC_CHTTP2_PCL_INFLIGHT])) { // There is a ping in flight. Add yourself to the inflight closure list. - t->combiner->Run(GRPC_CLOSURE_INIT(&t->start_keepalive_ping_locked, - start_keepalive_ping_locked, t, nullptr), - t->closed_with_error); + t->combiner->Run( + grpc_core::InitTransportClosure( + t->Ref(), &t->start_keepalive_ping_locked), + t->closed_with_error); grpc_closure_list_append( &pq->lists[GRPC_CHTTP2_PCL_INFLIGHT], - GRPC_CLOSURE_INIT(&t->finish_keepalive_ping_locked, - finish_keepalive_ping, t, grpc_schedule_on_exec_ctx), + grpc_core::InitTransportClosure( + t->Ref(), &t->finish_keepalive_ping_locked), absl::OkStatus()); return; } grpc_closure_list_append( &pq->lists[GRPC_CHTTP2_PCL_INITIATE], - GRPC_CLOSURE_INIT(&t->start_keepalive_ping_locked, start_keepalive_ping, - t, grpc_schedule_on_exec_ctx), + grpc_core::InitTransportClosure( + t->Ref(), &t->start_keepalive_ping_locked), absl::OkStatus()); grpc_closure_list_append( &pq->lists[GRPC_CHTTP2_PCL_NEXT], - GRPC_CLOSURE_INIT(&t->finish_keepalive_ping_locked, finish_keepalive_ping, - t, grpc_schedule_on_exec_ctx), + grpc_core::InitTransportClosure( + t->Ref(), &t->finish_keepalive_ping_locked), absl::OkStatus()); } -void grpc_chttp2_retry_initiate_ping(grpc_chttp2_transport* t) { - t->combiner->Run(GRPC_CLOSURE_INIT(&t->retry_initiate_ping_locked, - retry_initiate_ping_locked, t, nullptr), - absl::OkStatus()); +void grpc_chttp2_retry_initiate_ping( + grpc_core::RefCountedPtr t) { + auto tp = t.get(); + tp->combiner->Run(grpc_core::InitTransportClosure( + std::move(t), &tp->retry_initiate_ping_locked), + absl::OkStatus()); } -static void retry_initiate_ping_locked(void* tp, - GRPC_UNUSED grpc_error_handle error) { +static void retry_initiate_ping_locked( + grpc_core::RefCountedPtr t, + GRPC_UNUSED grpc_error_handle error) { GPR_DEBUG_ASSERT(error.ok()); - grpc_chttp2_transport* t = static_cast(tp); GPR_ASSERT(t->delayed_ping_timer_handle.has_value()); t->delayed_ping_timer_handle.reset(); - grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_RETRY_SEND_PING); - GRPC_CHTTP2_UNREF_TRANSPORT(t, "retry_initiate_ping_locked"); + grpc_chttp2_initiate_write(t.get(), + GRPC_CHTTP2_INITIATE_WRITE_RETRY_SEND_PING); } void grpc_chttp2_ack_ping(grpc_chttp2_transport* t, uint64_t id) { @@ -1687,16 +1725,11 @@ class GracefulGoaway : public grpc_core::RefCounted { public: static void Start(grpc_chttp2_transport* t) { new GracefulGoaway(t); } - ~GracefulGoaway() override { - GRPC_CHTTP2_UNREF_TRANSPORT(t_, "graceful goaway"); - } - private: using TaskHandle = ::grpc_event_engine::experimental::EventEngine::TaskHandle; - explicit GracefulGoaway(grpc_chttp2_transport* t) : t_(t) { + explicit GracefulGoaway(grpc_chttp2_transport* t) : t_(t->Ref()) { t->sent_goaway_state = GRPC_CHTTP2_GRACEFUL_GOAWAY; - GRPC_CHTTP2_REF_TRANSPORT(t_, "graceful goaway"); grpc_chttp2_goaway_append((1u << 31) - 1, 0, grpc_empty_slice(), &t->qbuf); send_ping_locked( t, nullptr, GRPC_CLOSURE_INIT(&on_ping_ack_, OnPingAck, this, nullptr)); @@ -1724,7 +1757,7 @@ class GracefulGoaway : public grpc_core::RefCounted { gpr_log(GPR_INFO, "transport:%p %s peer:%s Transport already shutting down. " "Graceful GOAWAY abandoned.", - t_, t_->is_client ? "CLIENT" : "SERVER", + t_.get(), t_->is_client ? "CLIENT" : "SERVER", std::string(t_->peer_string.as_string_view()).c_str())); return; } @@ -1733,13 +1766,14 @@ class GracefulGoaway : public grpc_core::RefCounted { gpr_log(GPR_INFO, "transport:%p %s peer:%s Graceful shutdown: Ping received. " "Sending final GOAWAY with stream_id:%d", - t_, t_->is_client ? "CLIENT" : "SERVER", + t_.get(), t_->is_client ? "CLIENT" : "SERVER", std::string(t_->peer_string.as_string_view()).c_str(), t_->last_new_stream_id)); t_->sent_goaway_state = GRPC_CHTTP2_FINAL_GOAWAY_SEND_SCHEDULED; grpc_chttp2_goaway_append(t_->last_new_stream_id, 0, grpc_empty_slice(), &t_->qbuf); - grpc_chttp2_initiate_write(t_, GRPC_CHTTP2_INITIATE_WRITE_GOAWAY_SENT); + grpc_chttp2_initiate_write(t_.get(), + GRPC_CHTTP2_INITIATE_WRITE_GOAWAY_SENT); } static void OnPingAck(void* arg, grpc_error_handle /* error */) { @@ -1767,7 +1801,7 @@ class GracefulGoaway : public grpc_core::RefCounted { self->Unref(); } - grpc_chttp2_transport* t_; + const grpc_core::RefCountedPtr t_; grpc_closure on_ping_ack_; TaskHandle timer_handle_ = TaskHandle::kInvalid; grpc_closure on_timer_; @@ -1829,11 +1863,11 @@ void grpc_chttp2_reset_ping_clock(grpc_chttp2_transport* t) { static void perform_transport_op_locked(void* stream_op, grpc_error_handle /*error_ignored*/) { grpc_transport_op* op = static_cast(stream_op); - grpc_chttp2_transport* t = - static_cast(op->handler_private.extra_arg); + grpc_core::RefCountedPtr t( + static_cast(op->handler_private.extra_arg)); if (!op->goaway_error.ok()) { - send_goaway(t, op->goaway_error, /*immediate_disconnect_hint=*/false); + send_goaway(t.get(), op->goaway_error, /*immediate_disconnect_hint=*/false); } if (op->set_accept_stream) { @@ -1850,8 +1884,9 @@ static void perform_transport_op_locked(void* stream_op, } if (op->send_ping.on_initiate != nullptr || op->send_ping.on_ack != nullptr) { - send_ping_locked(t, op->send_ping.on_initiate, op->send_ping.on_ack); - grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_APPLICATION_PING); + send_ping_locked(t.get(), op->send_ping.on_initiate, op->send_ping.on_ack); + grpc_chttp2_initiate_write(t.get(), + GRPC_CHTTP2_INITIATE_WRITE_APPLICATION_PING); } if (op->start_connectivity_watch != nullptr) { @@ -1863,14 +1898,12 @@ static void perform_transport_op_locked(void* stream_op, } if (!op->disconnect_with_error.ok()) { - send_goaway(t, op->disconnect_with_error, + send_goaway(t.get(), op->disconnect_with_error, /*immediate_disconnect_hint=*/true); - close_transport_locked(t, op->disconnect_with_error); + close_transport_locked(t.get(), op->disconnect_with_error); } grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_consumed, absl::OkStatus()); - - GRPC_CHTTP2_UNREF_TRANSPORT(t, "transport_op"); } static void perform_transport_op(grpc_transport* gt, grpc_transport_op* op) { @@ -1880,10 +1913,10 @@ static void perform_transport_op(grpc_transport* gt, grpc_transport_op* op) { grpc_transport_op_string(op).c_str()); } op->handler_private.extra_arg = gt; - GRPC_CHTTP2_REF_TRANSPORT(t, "transport_op"); - t->combiner->Run(GRPC_CLOSURE_INIT(&op->handler_private.closure, - perform_transport_op_locked, op, nullptr), - absl::OkStatus()); + t->Ref().release()->combiner->Run( + GRPC_CLOSURE_INIT(&op->handler_private.closure, + perform_transport_op_locked, op, nullptr), + absl::OkStatus()); } // @@ -2480,16 +2513,17 @@ static grpc_error_handle try_http_parsing(grpc_chttp2_transport* t) { return error; } -static void read_action(void* tp, grpc_error_handle error) { - grpc_chttp2_transport* t = static_cast(tp); - t->combiner->Run( - GRPC_CLOSURE_INIT(&t->read_action_locked, read_action_locked, t, nullptr), - error); +static void read_action(grpc_core::RefCountedPtr t, + grpc_error_handle error) { + auto* tp = t.get(); + tp->combiner->Run(grpc_core::InitTransportClosure( + std::move(t), &tp->read_action_locked), + error); } -static void read_action_locked(void* tp, grpc_error_handle error) { - grpc_chttp2_transport* t = static_cast(tp); - +static void read_action_locked( + grpc_core::RefCountedPtr t, + grpc_error_handle error) { grpc_error_handle err = error; if (!err.ok()) { err = grpc_error_set_int( @@ -2501,10 +2535,10 @@ static void read_action_locked(void* tp, grpc_error_handle error) { size_t i = 0; grpc_error_handle errors[3] = {error, absl::OkStatus(), absl::OkStatus()}; for (; i < t->read_buffer.count && errors[1] == absl::OkStatus(); i++) { - errors[1] = grpc_chttp2_perform_read(t, t->read_buffer.slices[i]); + errors[1] = grpc_chttp2_perform_read(t.get(), t->read_buffer.slices[i]); } if (errors[1] != absl::OkStatus()) { - errors[2] = try_http_parsing(t); + errors[2] = try_http_parsing(t.get()); error = GRPC_ERROR_CREATE_REFERENCING("Failed parsing HTTP/2", errors, GPR_ARRAY_SIZE(errors)); } @@ -2512,10 +2546,11 @@ static void read_action_locked(void* tp, grpc_error_handle error) { if (t->initial_window_update != 0) { if (t->initial_window_update > 0) { grpc_chttp2_stream* s; - while (grpc_chttp2_list_pop_stalled_by_stream(t, &s)) { - grpc_chttp2_mark_stream_writable(t, s); + while (grpc_chttp2_list_pop_stalled_by_stream(t.get(), &s)) { + grpc_chttp2_mark_stream_writable(t.get(), s); grpc_chttp2_initiate_write( - t, GRPC_CHTTP2_INITIATE_WRITE_FLOW_CONTROL_UNSTALLED_BY_SETTING); + t.get(), + GRPC_CHTTP2_INITIATE_WRITE_FLOW_CONTROL_UNSTALLED_BY_SETTING); } } t->initial_window_update = 0; @@ -2534,13 +2569,13 @@ static void read_action_locked(void* tp, grpc_error_handle error) { error = grpc_error_add_child(error, t->goaway_error); } - close_transport_locked(t, error); + close_transport_locked(t.get(), error); t->endpoint_reading = 0; } else if (t->closed_with_error.ok()) { keep_reading = true; // Since we have read a byte, reset the keepalive timer if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_WAITING) { - maybe_reset_keepalive_ping_timer_locked(t); + maybe_reset_keepalive_ping_timer_locked(t.get()); } } grpc_slice_buffer_reset_and_unref(&t->read_buffer); @@ -2552,45 +2587,48 @@ static void read_action_locked(void* tp, grpc_error_handle error) { gpr_log(GPR_INFO, "transport %p : Pausing reading due to too " "many unwritten SETTINGS ACK and RST_STREAM frames", - t)); + t.get())); } else { - continue_read_action_locked(t); + continue_read_action_locked(std::move(t)); } - } else { - GRPC_CHTTP2_UNREF_TRANSPORT(t, "reading_action"); } } -static void continue_read_action_locked(grpc_chttp2_transport* t) { +static void continue_read_action_locked( + grpc_core::RefCountedPtr t) { const bool urgent = !t->goaway_error.ok(); - GRPC_CLOSURE_INIT(&t->read_action_locked, read_action, t, - grpc_schedule_on_exec_ctx); - grpc_endpoint_read(t->ep, &t->read_buffer, &t->read_action_locked, urgent, - grpc_chttp2_min_read_progress_size(t)); + auto* tp = t.get(); + grpc_endpoint_read(tp->ep, &tp->read_buffer, + grpc_core::InitTransportClosure( + std::move(t), &tp->read_action_locked), + urgent, grpc_chttp2_min_read_progress_size(tp)); } // t is reffed prior to calling the first time, and once the callback chain // that kicks off finishes, it's unreffed -void schedule_bdp_ping_locked(grpc_chttp2_transport* t) { - t->flow_control.bdp_estimator()->SchedulePing(); - send_ping_locked( - t, - GRPC_CLOSURE_INIT(&t->start_bdp_ping_locked, start_bdp_ping, t, - grpc_schedule_on_exec_ctx), - GRPC_CLOSURE_INIT(&t->finish_bdp_ping_locked, finish_bdp_ping, t, - grpc_schedule_on_exec_ctx)); - grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_BDP_PING); -} - -static void start_bdp_ping(void* tp, grpc_error_handle error) { - grpc_chttp2_transport* t = static_cast(tp); - t->combiner->Run(GRPC_CLOSURE_INIT(&t->start_bdp_ping_locked, - start_bdp_ping_locked, t, nullptr), - error); -} - -static void start_bdp_ping_locked(void* tp, grpc_error_handle error) { - grpc_chttp2_transport* t = static_cast(tp); +void schedule_bdp_ping_locked( + grpc_core::RefCountedPtr t) { + auto* tp = t.get(); + tp->flow_control.bdp_estimator()->SchedulePing(); + send_ping_locked(tp, + grpc_core::InitTransportClosure( + tp->Ref(), &tp->start_bdp_ping_locked), + grpc_core::InitTransportClosure( + std::move(t), &tp->finish_bdp_ping_locked)); + grpc_chttp2_initiate_write(tp, GRPC_CHTTP2_INITIATE_WRITE_BDP_PING); +} + +static void start_bdp_ping(grpc_core::RefCountedPtr t, + grpc_error_handle error) { + grpc_chttp2_transport* tp = t.get(); + tp->combiner->Run(grpc_core::InitTransportClosure( + std::move(t), &tp->start_bdp_ping_locked), + error); +} + +static void start_bdp_ping_locked( + grpc_core::RefCountedPtr t, + grpc_error_handle error) { if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) { gpr_log(GPR_INFO, "%s: Start BDP ping err=%s", std::string(t->peer_string.as_string_view()).c_str(), @@ -2601,71 +2639,69 @@ static void start_bdp_ping_locked(void* tp, grpc_error_handle error) { } // Reset the keepalive ping timer if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_WAITING) { - maybe_reset_keepalive_ping_timer_locked(t); + maybe_reset_keepalive_ping_timer_locked(t.get()); } t->flow_control.bdp_estimator()->StartPing(); t->bdp_ping_started = true; } -static void finish_bdp_ping(void* tp, grpc_error_handle error) { - grpc_chttp2_transport* t = static_cast(tp); - t->combiner->Run(GRPC_CLOSURE_INIT(&t->finish_bdp_ping_locked, - finish_bdp_ping_locked, t, nullptr), - error); +static void finish_bdp_ping(grpc_core::RefCountedPtr t, + grpc_error_handle error) { + grpc_chttp2_transport* tp = t.get(); + tp->combiner->Run(grpc_core::InitTransportClosure( + std::move(t), &tp->finish_bdp_ping_locked), + error); } -static void finish_bdp_ping_locked(void* tp, grpc_error_handle error) { - grpc_chttp2_transport* t = static_cast(tp); +static void finish_bdp_ping_locked( + grpc_core::RefCountedPtr t, + grpc_error_handle error) { if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) { gpr_log(GPR_INFO, "%s: Complete BDP ping err=%s", std::string(t->peer_string.as_string_view()).c_str(), grpc_core::StatusToString(error).c_str()); } if (!error.ok() || !t->closed_with_error.ok()) { - GRPC_CHTTP2_UNREF_TRANSPORT(t, "bdp_ping"); return; } if (!t->bdp_ping_started) { // start_bdp_ping_locked has not been run yet. Schedule // finish_bdp_ping_locked to be run later. - t->combiner->Run(GRPC_CLOSURE_INIT(&t->finish_bdp_ping_locked, - finish_bdp_ping_locked, t, nullptr), - error); + finish_bdp_ping(std::move(t), std::move(error)); return; } t->bdp_ping_started = false; grpc_core::Timestamp next_ping = t->flow_control.bdp_estimator()->CompletePing(); - grpc_chttp2_act_on_flowctl_action(t->flow_control.PeriodicUpdate(), t, + grpc_chttp2_act_on_flowctl_action(t->flow_control.PeriodicUpdate(), t.get(), nullptr); GPR_ASSERT(!t->next_bdp_ping_timer_handle.has_value()); t->next_bdp_ping_timer_handle = t->event_engine->RunAfter(next_ping - grpc_core::Timestamp::Now(), [t] { grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; grpc_core::ExecCtx exec_ctx; - next_bdp_ping_timer_expired(t); + next_bdp_ping_timer_expired(t.get()); }); } static void next_bdp_ping_timer_expired(grpc_chttp2_transport* t) { t->combiner->Run( - GRPC_CLOSURE_INIT(&t->next_bdp_ping_timer_expired_locked, - next_bdp_ping_timer_expired_locked, t, nullptr), + grpc_core::InitTransportClosure( + t->Ref(), &t->next_bdp_ping_timer_expired_locked), absl::OkStatus()); } static void next_bdp_ping_timer_expired_locked( - void* tp, GRPC_UNUSED grpc_error_handle error) { + grpc_core::RefCountedPtr t, + GRPC_UNUSED grpc_error_handle error) { GPR_DEBUG_ASSERT(error.ok()); - grpc_chttp2_transport* t = static_cast(tp); GPR_ASSERT(t->next_bdp_ping_timer_handle.has_value()); t->next_bdp_ping_timer_handle.reset(); if (t->flow_control.bdp_estimator()->accumulator() == 0) { // Block the bdp ping till we receive more data. t->bdp_ping_blocked = true; - GRPC_CHTTP2_UNREF_TRANSPORT(t, "bdp_ping"); } else { - schedule_bdp_ping_locked(t); + schedule_bdp_ping_locked(std::move(t)); } } @@ -2716,16 +2752,18 @@ void grpc_chttp2_config_default_keepalive_args( grpc_core::Chttp2PingRatePolicy::SetDefaults(channel_args); } -static void init_keepalive_ping(grpc_chttp2_transport* t) { - t->combiner->Run(GRPC_CLOSURE_INIT(&t->init_keepalive_ping_locked, - init_keepalive_ping_locked, t, nullptr), - absl::OkStatus()); +static void init_keepalive_ping( + grpc_core::RefCountedPtr t) { + auto* tp = t.get(); + tp->combiner->Run(grpc_core::InitTransportClosure( + std::move(t), &tp->init_keepalive_ping_locked), + absl::OkStatus()); } -static void init_keepalive_ping_locked(void* arg, - GRPC_UNUSED grpc_error_handle error) { +static void init_keepalive_ping_locked( + grpc_core::RefCountedPtr t, + GRPC_UNUSED grpc_error_handle error) { GPR_DEBUG_ASSERT(error.ok()); - grpc_chttp2_transport* t = static_cast(arg); GPR_ASSERT(t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_WAITING); GPR_ASSERT(t->keepalive_ping_timer_handle.has_value()); t->keepalive_ping_timer_handle.reset(); @@ -2734,11 +2772,10 @@ static void init_keepalive_ping_locked(void* arg, } else { if (t->keepalive_permit_without_calls || !t->stream_map.empty()) { t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_PINGING; - GRPC_CHTTP2_REF_TRANSPORT(t, "keepalive ping end"); send_keepalive_ping_locked(t); - grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_KEEPALIVE_PING); + grpc_chttp2_initiate_write(t.get(), + GRPC_CHTTP2_INITIATE_WRITE_KEEPALIVE_PING); } else { - GRPC_CHTTP2_REF_TRANSPORT(t, "init keepalive ping"); t->keepalive_ping_timer_handle = t->event_engine->RunAfter(t->keepalive_time, [t] { grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; @@ -2747,18 +2784,21 @@ static void init_keepalive_ping_locked(void* arg, }); } } - GRPC_CHTTP2_UNREF_TRANSPORT(t, "init keepalive ping"); } -static void start_keepalive_ping(void* arg, grpc_error_handle error) { - grpc_chttp2_transport* t = static_cast(arg); - t->combiner->Run(GRPC_CLOSURE_INIT(&t->start_keepalive_ping_locked, - start_keepalive_ping_locked, t, nullptr), - error); +static void start_keepalive_ping( + grpc_core::RefCountedPtr t, + grpc_error_handle error) { + auto* tp = t.get(); + tp->combiner->Run( + grpc_core::InitTransportClosure( + std::move(t), &tp->start_keepalive_ping_locked), + error); } -static void start_keepalive_ping_locked(void* arg, grpc_error_handle error) { - grpc_chttp2_transport* t = static_cast(arg); +static void start_keepalive_ping_locked( + grpc_core::RefCountedPtr t, + grpc_error_handle error) { if (!error.ok()) { return; } @@ -2770,25 +2810,28 @@ static void start_keepalive_ping_locked(void* arg, grpc_error_handle error) { gpr_log(GPR_INFO, "%s: Start keepalive ping", std::string(t->peer_string.as_string_view()).c_str()); } - GRPC_CHTTP2_REF_TRANSPORT(t, "keepalive watchdog"); t->keepalive_watchdog_timer_handle = - t->event_engine->RunAfter(t->keepalive_timeout, [t] { + t->event_engine->RunAfter(t->keepalive_timeout, [t]() mutable { grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; grpc_core::ExecCtx exec_ctx; - keepalive_watchdog_fired(t); + keepalive_watchdog_fired(std::move(t)); }); t->keepalive_ping_started = true; } -static void finish_keepalive_ping(void* arg, grpc_error_handle error) { - grpc_chttp2_transport* t = static_cast(arg); - t->combiner->Run(GRPC_CLOSURE_INIT(&t->finish_keepalive_ping_locked, - finish_keepalive_ping_locked, t, nullptr), - error); +static void finish_keepalive_ping( + grpc_core::RefCountedPtr t, + grpc_error_handle error) { + auto* tp = t.get(); + tp->combiner->Run( + grpc_core::InitTransportClosure( + std::move(t), &tp->finish_keepalive_ping_locked), + error); } -static void finish_keepalive_ping_locked(void* arg, grpc_error_handle error) { - grpc_chttp2_transport* t = static_cast(arg); +static void finish_keepalive_ping_locked( + grpc_core::RefCountedPtr t, + grpc_error_handle error) { if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_PINGING) { if (error.ok()) { if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || @@ -2799,22 +2842,17 @@ static void finish_keepalive_ping_locked(void* arg, grpc_error_handle error) { if (!t->keepalive_ping_started) { // start_keepalive_ping_locked has not run yet. Reschedule // finish_keepalive_ping_locked for it to be run later. - t->combiner->Run( - GRPC_CLOSURE_INIT(&t->finish_keepalive_ping_locked, - finish_keepalive_ping_locked, t, nullptr), - error); + finish_keepalive_ping(std::move(t), std::move(error)); return; } t->keepalive_ping_started = false; t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_WAITING; if (t->keepalive_watchdog_timer_handle.has_value()) { if (t->event_engine->Cancel(*t->keepalive_watchdog_timer_handle)) { - GRPC_CHTTP2_UNREF_TRANSPORT(t, "keepalive watchdog"); t->keepalive_watchdog_timer_handle.reset(); } } GPR_ASSERT(!t->keepalive_ping_timer_handle.has_value()); - GRPC_CHTTP2_REF_TRANSPORT(t, "init keepalive ping"); t->keepalive_ping_timer_handle = t->event_engine->RunAfter(t->keepalive_time, [t] { grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; @@ -2823,20 +2861,21 @@ static void finish_keepalive_ping_locked(void* arg, grpc_error_handle error) { }); } } - GRPC_CHTTP2_UNREF_TRANSPORT(t, "keepalive ping end"); } -static void keepalive_watchdog_fired(grpc_chttp2_transport* t) { - t->combiner->Run( - GRPC_CLOSURE_INIT(&t->keepalive_watchdog_fired_locked, - keepalive_watchdog_fired_locked, t, nullptr), +static void keepalive_watchdog_fired( + grpc_core::RefCountedPtr t) { + auto* tp = t.get(); + tp->combiner->Run( + grpc_core::InitTransportClosure( + std::move(t), &tp->keepalive_watchdog_fired_locked), absl::OkStatus()); } static void keepalive_watchdog_fired_locked( - void* arg, GRPC_UNUSED grpc_error_handle error) { + grpc_core::RefCountedPtr t, + GRPC_UNUSED grpc_error_handle error) { GPR_DEBUG_ASSERT(error.ok()); - grpc_chttp2_transport* t = static_cast(arg); GPR_ASSERT(t->keepalive_watchdog_timer_handle.has_value()); t->keepalive_watchdog_timer_handle.reset(); if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_PINGING) { @@ -2844,9 +2883,10 @@ static void keepalive_watchdog_fired_locked( std::string(t->peer_string.as_string_view()).c_str()); t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_DYING; close_transport_locked( - t, grpc_error_set_int(GRPC_ERROR_CREATE("keepalive watchdog timeout"), - grpc_core::StatusIntProperty::kRpcStatus, - GRPC_STATUS_UNAVAILABLE)); + t.get(), + grpc_error_set_int(GRPC_ERROR_CREATE("keepalive watchdog timeout"), + grpc_core::StatusIntProperty::kRpcStatus, + GRPC_STATUS_UNAVAILABLE)); } else { // If keepalive_state is not PINGING, we consider it as an error. Maybe the // cancellation failed in finish_keepalive_ping_locked. Users have seen @@ -2854,7 +2894,6 @@ static void keepalive_watchdog_fired_locked( gpr_log(GPR_ERROR, "keepalive_ping_end state error: %d (expect: %d)", t->keepalive_state, GRPC_CHTTP2_KEEPALIVE_STATE_PINGING); } - GRPC_CHTTP2_UNREF_TRANSPORT(t, "keepalive watchdog"); } static void maybe_reset_keepalive_ping_timer_locked(grpc_chttp2_transport* t) { @@ -2867,11 +2906,11 @@ static void maybe_reset_keepalive_ping_timer_locked(grpc_chttp2_transport* t) { gpr_log(GPR_INFO, "%s: Keepalive ping cancelled. Resetting timer.", std::string(t->peer_string.as_string_view()).c_str()); } - t->keepalive_ping_timer_handle = - t->event_engine->RunAfter(t->keepalive_time, [t] { + t->keepalive_ping_timer_handle = t->event_engine->RunAfter( + t->keepalive_time, [t = t->Ref()]() mutable { grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; grpc_core::ExecCtx exec_ctx; - init_keepalive_ping(t); + init_keepalive_ping(std::move(t)); }); } } @@ -2914,18 +2953,17 @@ static void set_pollset_set(grpc_transport* gt, grpc_stream* /*gs*/, static void post_benign_reclaimer(grpc_chttp2_transport* t) { if (!t->benign_reclaimer_registered) { t->benign_reclaimer_registered = true; - GRPC_CHTTP2_REF_TRANSPORT(t, "benign_reclaimer"); t->memory_owner.PostReclaimer( grpc_core::ReclamationPass::kBenign, - [t](absl::optional sweep) { + [t = t->Ref()]( + absl::optional sweep) mutable { if (sweep.has_value()) { - GRPC_CLOSURE_INIT(&t->benign_reclaimer_locked, - benign_reclaimer_locked, t, - grpc_schedule_on_exec_ctx); - t->active_reclamation = std::move(*sweep); - t->combiner->Run(&t->benign_reclaimer_locked, absl::OkStatus()); - } else { - GRPC_CHTTP2_UNREF_TRANSPORT(t, "benign_reclaimer"); + auto* tp = t.get(); + tp->active_reclamation = std::move(*sweep); + tp->combiner->Run( + grpc_core::InitTransportClosure( + std::move(t), &tp->benign_reclaimer_locked), + absl::OkStatus()); } }); } @@ -2934,26 +2972,25 @@ static void post_benign_reclaimer(grpc_chttp2_transport* t) { static void post_destructive_reclaimer(grpc_chttp2_transport* t) { if (!t->destructive_reclaimer_registered) { t->destructive_reclaimer_registered = true; - GRPC_CHTTP2_REF_TRANSPORT(t, "destructive_reclaimer"); t->memory_owner.PostReclaimer( grpc_core::ReclamationPass::kDestructive, - [t](absl::optional sweep) { + [t = t->Ref()]( + absl::optional sweep) mutable { if (sweep.has_value()) { - GRPC_CLOSURE_INIT(&t->destructive_reclaimer_locked, - destructive_reclaimer_locked, t, - grpc_schedule_on_exec_ctx); - t->active_reclamation = std::move(*sweep); - t->combiner->Run(&t->destructive_reclaimer_locked, - absl::OkStatus()); - } else { - GRPC_CHTTP2_UNREF_TRANSPORT(t, "destructive_reclaimer"); + auto* tp = t.get(); + tp->active_reclamation = std::move(*sweep); + tp->combiner->Run( + grpc_core::InitTransportClosure( + std::move(t), &tp->destructive_reclaimer_locked), + absl::OkStatus()); } }); } } -static void benign_reclaimer_locked(void* arg, grpc_error_handle error) { - grpc_chttp2_transport* t = static_cast(arg); +static void benign_reclaimer_locked( + grpc_core::RefCountedPtr t, + grpc_error_handle error) { if (error.ok() && t->stream_map.empty()) { // Channel with no active streams: send a goaway to try and make it // disconnect cleanly @@ -2961,7 +2998,7 @@ static void benign_reclaimer_locked(void* arg, grpc_error_handle error) { gpr_log(GPR_INFO, "HTTP2: %s - send goaway to free memory", std::string(t->peer_string.as_string_view()).c_str()); } - send_goaway(t, + send_goaway(t.get(), grpc_error_set_int(GRPC_ERROR_CREATE("Buffers full"), grpc_core::StatusIntProperty::kHttp2Error, GRPC_HTTP2_ENHANCE_YOUR_CALM), @@ -2977,11 +3014,11 @@ static void benign_reclaimer_locked(void* arg, grpc_error_handle error) { if (error != absl::CancelledError()) { t->active_reclamation.Finish(); } - GRPC_CHTTP2_UNREF_TRANSPORT(t, "benign_reclaimer"); } -static void destructive_reclaimer_locked(void* arg, grpc_error_handle error) { - grpc_chttp2_transport* t = static_cast(arg); +static void destructive_reclaimer_locked( + grpc_core::RefCountedPtr t, + grpc_error_handle error) { t->destructive_reclaimer_registered = false; if (error.ok() && !t->stream_map.empty()) { // As stream_map is a hash map, this selects effectively a random stream. @@ -2991,7 +3028,7 @@ static void destructive_reclaimer_locked(void* arg, grpc_error_handle error) { std::string(t->peer_string.as_string_view()).c_str(), s->id); } grpc_chttp2_cancel_stream( - t, s, + t.get(), s, grpc_error_set_int(GRPC_ERROR_CREATE("Buffers full"), grpc_core::StatusIntProperty::kHttp2Error, GRPC_HTTP2_ENHANCE_YOUR_CALM)); @@ -3000,13 +3037,12 @@ static void destructive_reclaimer_locked(void* arg, grpc_error_handle error) { // there are more streams left, we can immediately post a new // reclaimer in case the resource quota needs to free more // memory - post_destructive_reclaimer(t); + post_destructive_reclaimer(t.get()); } } if (error != absl::CancelledError()) { t->active_reclamation.Finish(); } - GRPC_CHTTP2_UNREF_TRANSPORT(t, "destructive_reclaimer"); } // @@ -3100,17 +3136,15 @@ grpc_transport* grpc_create_chttp2_transport( void grpc_chttp2_transport_start_reading( grpc_transport* transport, grpc_slice_buffer* read_buffer, grpc_closure* notify_on_receive_settings, grpc_closure* notify_on_close) { - grpc_chttp2_transport* t = - reinterpret_cast(transport); - GRPC_CHTTP2_REF_TRANSPORT( - t, "reading_action"); // matches unref inside reading_action + auto t = reinterpret_cast(transport)->Ref(); if (read_buffer != nullptr) { grpc_slice_buffer_move_into(read_buffer, &t->read_buffer); gpr_free(read_buffer); } - t->combiner->Run( - grpc_core::NewClosure([t, notify_on_receive_settings, - notify_on_close](grpc_error_handle) { + auto* tp = t.get(); + tp->combiner->Run( + grpc_core::NewClosure([t = std::move(t), notify_on_receive_settings, + notify_on_close](grpc_error_handle) mutable { if (!t->closed_with_error.ok()) { if (notify_on_receive_settings != nullptr) { grpc_core::ExecCtx::Run(DEBUG_LOCATION, notify_on_receive_settings, @@ -3120,12 +3154,11 @@ void grpc_chttp2_transport_start_reading( grpc_core::ExecCtx::Run(DEBUG_LOCATION, notify_on_close, t->closed_with_error); } - GRPC_CHTTP2_UNREF_TRANSPORT(t, "reading_action"); return; } t->notify_on_receive_settings = notify_on_receive_settings; t->notify_on_close = notify_on_close; - read_action_locked(t, absl::OkStatus()); + read_action_locked(std::move(t), absl::OkStatus()); }), absl::OkStatus()); } diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h index 807a105ebda4f..5f67941c67b4e 100644 --- a/src/core/ext/transport/chttp2/transport/internal.h +++ b/src/core/ext/transport/chttp2/transport/internal.h @@ -245,6 +245,19 @@ struct grpc_chttp2_transport : public grpc_core::KeepsGrpcInitialized { grpc_endpoint* ep, bool is_client); ~grpc_chttp2_transport(); + // Make this be able to be contained in RefCountedPtr<> + // Can't yet make this derive from RefCounted because we need to keep + // `grpc_transport base` first. + // TODO(ctiller): Make a transport interface. + void IncrementRefCount() { refs.Ref(); } + void Unref() { + if (refs.Unref()) delete this; + } + grpc_core::RefCountedPtr Ref() { + IncrementRefCount(); + return grpc_core::RefCountedPtr(this); + } + grpc_transport base; // must be first grpc_core::RefCount refs; grpc_endpoint* ep; @@ -483,14 +496,8 @@ struct grpc_chttp2_stream { ~grpc_chttp2_stream(); void* context; - grpc_chttp2_transport* t; + const grpc_core::RefCountedPtr t; grpc_stream_refcount* refcount; - // Reffer is a 0-len structure, simply reffing `t` and `refcount` in its ctor - // before initializing the rest of the stream, to avoid cache misses. This - // field MUST be right after `t` and `refcount`. - struct Reffer { - explicit Reffer(grpc_chttp2_stream* s); - } reffer; grpc_closure destroy_stream; grpc_closure* destroy_stream_arg; @@ -736,36 +743,6 @@ void grpc_chttp2_stream_ref(grpc_chttp2_stream* s); void grpc_chttp2_stream_unref(grpc_chttp2_stream* s); #endif -#ifndef NDEBUG -#define GRPC_CHTTP2_REF_TRANSPORT(t, r) \ - grpc_chttp2_ref_transport(t, r, __FILE__, __LINE__) -#define GRPC_CHTTP2_UNREF_TRANSPORT(t, r) \ - grpc_chttp2_unref_transport(t, r, __FILE__, __LINE__) -inline void grpc_chttp2_unref_transport(grpc_chttp2_transport* t, - const char* reason, const char* file, - int line) { - if (t->refs.Unref(grpc_core::DebugLocation(file, line), reason)) { - delete t; - } -} -inline void grpc_chttp2_ref_transport(grpc_chttp2_transport* t, - const char* reason, const char* file, - int line) { - t->refs.Ref(grpc_core::DebugLocation(file, line), reason); -} -#else -#define GRPC_CHTTP2_REF_TRANSPORT(t, r) grpc_chttp2_ref_transport(t) -#define GRPC_CHTTP2_UNREF_TRANSPORT(t, r) grpc_chttp2_unref_transport(t) -inline void grpc_chttp2_unref_transport(grpc_chttp2_transport* t) { - if (t->refs.Unref()) { - delete t; - } -} -inline void grpc_chttp2_ref_transport(grpc_chttp2_transport* t) { - t->refs.Ref(); -} -#endif - void grpc_chttp2_ack_ping(grpc_chttp2_transport* t, uint64_t id); /// Sends GOAWAY with error code ENHANCE_YOUR_CALM and additional debug data @@ -804,9 +781,11 @@ void grpc_chttp2_config_default_keepalive_args(grpc_channel_args* args, void grpc_chttp2_config_default_keepalive_args( const grpc_core::ChannelArgs& channel_args, bool is_client); -void grpc_chttp2_retry_initiate_ping(grpc_chttp2_transport* t); +void grpc_chttp2_retry_initiate_ping( + grpc_core::RefCountedPtr t); -void schedule_bdp_ping_locked(grpc_chttp2_transport* t); +void schedule_bdp_ping_locked( + grpc_core::RefCountedPtr t); uint32_t grpc_chttp2_min_read_progress_size(grpc_chttp2_transport* t); diff --git a/src/core/ext/transport/chttp2/transport/parsing.cc b/src/core/ext/transport/chttp2/transport/parsing.cc index f5ed79108e94d..ff5bf80427c2a 100644 --- a/src/core/ext/transport/chttp2/transport/parsing.cc +++ b/src/core/ext/transport/chttp2/transport/parsing.cc @@ -510,8 +510,7 @@ static grpc_error_handle init_data_frame_parser(grpc_chttp2_transport* t) { if (bdp_est) { if (t->bdp_ping_blocked) { t->bdp_ping_blocked = false; - GRPC_CHTTP2_REF_TRANSPORT(t, "bdp_ping"); - schedule_bdp_ping_locked(t); + schedule_bdp_ping_locked(t->Ref()); } bdp_est->AddIncomingBytes(t->incoming_frame_size); } @@ -841,7 +840,7 @@ static const maybe_complete_func_type maybe_complete_funcs[] = { static void force_client_rst_stream(void* sp, grpc_error_handle /*error*/) { grpc_chttp2_stream* s = static_cast(sp); - grpc_chttp2_transport* t = s->t; + grpc_chttp2_transport* t = s->t.get(); if (!s->write_closed) { grpc_chttp2_add_rst_stream_to_next_write(t, s->id, GRPC_HTTP2_NO_ERROR, &s->stats.outgoing); diff --git a/src/core/ext/transport/chttp2/transport/writing.cc b/src/core/ext/transport/chttp2/transport/writing.cc index e949f410246e2..89aec5539d9bf 100644 --- a/src/core/ext/transport/chttp2/transport/writing.cc +++ b/src/core/ext/transport/chttp2/transport/writing.cc @@ -173,12 +173,11 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) { too_soon.wait.ToString().c_str()); } if (!t->delayed_ping_timer_handle.has_value()) { - GRPC_CHTTP2_REF_TRANSPORT(t, "retry_initiate_ping_locked"); - t->delayed_ping_timer_handle = - t->event_engine->RunAfter(too_soon.wait, [t] { + t->delayed_ping_timer_handle = t->event_engine->RunAfter( + too_soon.wait, [t = t->Ref()]() mutable { grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; grpc_core::ExecCtx exec_ctx; - grpc_chttp2_retry_initiate_ping(t); + grpc_chttp2_retry_initiate_ping(std::move(t)); }); } }); From 82e506c7b2f632eb8fcf9c5e6a9f4235ef19414d Mon Sep 17 00:00:00 2001 From: Xuan Wang Date: Fri, 28 Jul 2023 13:26:13 -0700 Subject: [PATCH 076/205] [python O11Y] Refactor census propagation flow. (#33561) Refactored OpenCensus context propagation flow, now propagation happens for each call and context will be automatically propagated from gRPC server to gRPC client. We're using `execution_context` in OpenCensus since the context is related to OpenCensus and it helps wrap `contextVar` for us. ### Testing * Added a new Bazel test case for context propagation. --- src/python/grpcio/grpc/_server.py | 1 - .../grpc_observability/_gcp_observability.py | 20 ++- .../observability/_observability_test.py | 149 +++++++++++++----- 3 files changed, 120 insertions(+), 50 deletions(-) diff --git a/src/python/grpcio/grpc/_server.py b/src/python/grpcio/grpc/_server.py index 84aae73b24620..425aff8c9558e 100644 --- a/src/python/grpcio/grpc/_server.py +++ b/src/python/grpcio/grpc/_server.py @@ -1258,7 +1258,6 @@ def _start(state: _ServerState) -> None: state.server.start() state.stage = _ServerStage.STARTED _request_call(state) - thread = threading.Thread(target=_serve, args=(state,)) thread.daemon = True thread.start() diff --git a/src/python/grpcio_observability/grpc_observability/_gcp_observability.py b/src/python/grpcio_observability/grpc_observability/_gcp_observability.py index b56f8b9b257db..d62653bcd58af 100644 --- a/src/python/grpcio_observability/grpc_observability/_gcp_observability.py +++ b/src/python/grpcio_observability/grpc_observability/_gcp_observability.py @@ -56,6 +56,8 @@ grpc.StatusCode.DATA_LOSS: "DATA_LOSS", } +GRPC_SPAN_CONTEXT = "grpc_span_context" + @dataclass class GcpObservabilityPythonConfig: @@ -165,11 +167,12 @@ def exit(self) -> None: def create_client_call_tracer( self, method_name: bytes ) -> ClientCallTracerCapsule: - current_span = execution_context.get_current_span() - if current_span: - # Propagate existing OC context - trace_id = current_span.context_tracer.trace_id.encode("utf8") - parent_span_id = current_span.span_id.encode("utf8") + grpc_span_context = execution_context.get_opencensus_attr( + GRPC_SPAN_CONTEXT + ) + if grpc_span_context: + trace_id = grpc_span_context.trace_id.encode("utf8") + parent_span_id = grpc_span_context.span_id.encode("utf8") capsule = _cyobservability.create_client_call_tracer( method_name, trace_id, parent_span_id ) @@ -197,10 +200,11 @@ def save_trace_context( trace_options = trace_options_module.TraceOptions(0) trace_options.set_enabled(is_sampled) span_context = span_context_module.SpanContext( - trace_id=trace_id, span_id=span_id, trace_options=trace_options + trace_id=trace_id, + span_id=span_id, + trace_options=trace_options, ) - current_tracer = execution_context.get_opencensus_tracer() - current_tracer.span_context = span_context + execution_context.set_opencensus_attr(GRPC_SPAN_CONTEXT, span_context) def record_rpc_latency( self, method: str, rpc_latency: float, status_code: grpc.StatusCode diff --git a/src/python/grpcio_tests/tests/observability/_observability_test.py b/src/python/grpcio_tests/tests/observability/_observability_test.py index df657934d45c5..f7b4fe21a5255 100644 --- a/src/python/grpcio_tests/tests/observability/_observability_test.py +++ b/src/python/grpcio_tests/tests/observability/_observability_test.py @@ -35,6 +35,8 @@ _STREAM_UNARY = "/test/StreamUnary" _STREAM_STREAM = "/test/StreamStream" STREAM_LENGTH = 5 +TRIGGER_RPC_METADATA = ("control", "trigger_rpc") +TRIGGER_RPC_TO_NEW_SERVER_METADATA = ("to_new_server", "") CONFIG_ENV_VAR_NAME = "GRPC_GCP_OBSERVABILITY_CONFIG" CONFIG_FILE_ENV_VAR_NAME = "GRPC_GCP_OBSERVABILITY_CONFIG_FILE" @@ -86,6 +88,19 @@ def export_tracing_data( def handle_unary_unary(request, servicer_context): + if TRIGGER_RPC_METADATA in servicer_context.invocation_metadata(): + for k, v in servicer_context.invocation_metadata(): + if "port" in k: + unary_unary_call(port=int(v)) + if "to_new_server" in k: + second_server = grpc.server( + futures.ThreadPoolExecutor(max_workers=10) + ) + second_server.add_generic_rpc_handlers((_GenericHandler(),)) + second_server_port = second_server.add_insecure_port("[::]:0") + second_server.start() + unary_unary_call(port=second_server_port) + second_server.stop(0) return _RESPONSE @@ -157,13 +172,57 @@ def testRecordUnaryUnary(self): exporter=self.test_exporter ): self._start_server() - self.unary_unary_call() + unary_unary_call(port=self._port) self.assertGreater(len(self.all_metric), 0) self.assertGreater(len(self.all_span), 0) self._validate_metrics(self.all_metric) self._validate_spans(self.all_span) + def testContextPropagationToSameServer(self): + # Sends two RPCs, one from gRPC client and the other from gRPC server: + # gRPC Client -> gRPC Server 1 -> gRPC Server 1 + # Verify that the trace_id was propagated to the 2nd RPC. + self._set_config_file(_VALID_CONFIG_TRACING_ONLY) + with grpc_observability.GCPOpenCensusObservability( + exporter=self.test_exporter + ): + port = self._start_server() + metadata = ( + TRIGGER_RPC_METADATA, + ("port", str(port)), + ) + unary_unary_call(port=port, metadata=metadata) + + # 2 of each for ["Recv", "Sent", "Attempt"] + self.assertEqual(len(self.all_span), 6) + trace_id = self.all_span[0].trace_id + for span in self.all_span: + self.assertEqual(span.trace_id, trace_id) + + def testContextPropagationToNewServer(self): + # Sends two RPCs, one from gRPC client and the other from gRPC server: + # gRPC Client -> gRPC Server 1 -> gRPC Server 2 + # Verify that the trace_id was propagated to the 2nd RPC. + # This test case is to make sure that the context from one thread can + # be propagated to different thread. + self._set_config_file(_VALID_CONFIG_TRACING_ONLY) + with grpc_observability.GCPOpenCensusObservability( + exporter=self.test_exporter + ): + port = self._start_server() + metadata = ( + TRIGGER_RPC_METADATA, + TRIGGER_RPC_TO_NEW_SERVER_METADATA, + ) + unary_unary_call(port=port, metadata=metadata) + + # 2 of each for ["Recv", "Sent", "Attempt"] + self.assertEqual(len(self.all_span), 6) + trace_id = self.all_span[0].trace_id + for span in self.all_span: + self.assertEqual(span.trace_id, trace_id) + def testThrowErrorWithoutConfig(self): with self.assertRaises(ValueError): with grpc_observability.GCPOpenCensusObservability( @@ -189,7 +248,7 @@ def testNoErrorAndDataWithEmptyConfig(self): exporter=self.test_exporter ): self._start_server() - self.unary_unary_call() + unary_unary_call(port=self._port) self.assertEqual(len(self.all_metric), 0) self.assertEqual(len(self.all_span), 0) @@ -208,7 +267,7 @@ def testRecordUnaryUnaryStatsOnly(self): exporter=self.test_exporter ): self._start_server() - self.unary_unary_call() + unary_unary_call(port=self._port) self.assertEqual(len(self.all_span), 0) self.assertGreater(len(self.all_metric), 0) @@ -220,7 +279,7 @@ def testRecordUnaryUnaryTracingOnly(self): exporter=self.test_exporter ): self._start_server() - self.unary_unary_call() + unary_unary_call(port=self._port) self.assertEqual(len(self.all_metric), 0) self.assertGreater(len(self.all_span), 0) @@ -232,7 +291,7 @@ def testRecordUnaryStream(self): exporter=self.test_exporter ): self._start_server() - self.unary_stream_call() + unary_stream_call(port=self._port) self.assertGreater(len(self.all_metric), 0) self.assertGreater(len(self.all_span), 0) @@ -245,7 +304,7 @@ def testRecordStreamUnary(self): exporter=self.test_exporter ): self._start_server() - self.stream_unary_call() + stream_unary_call(port=self._port) self.assertTrue(len(self.all_metric) > 0) self.assertTrue(len(self.all_span) > 0) @@ -258,7 +317,7 @@ def testRecordStreamStream(self): exporter=self.test_exporter ): self._start_server() - self.stream_stream_call() + stream_stream_call(port=self._port) self.assertGreater(len(self.all_metric), 0) self.assertGreater(len(self.all_span), 0) @@ -268,7 +327,7 @@ def testRecordStreamStream(self): def testNoRecordBeforeInit(self): self._set_config_file(_VALID_CONFIG_TRACING_STATS) self._start_server() - self.unary_unary_call() + unary_unary_call(port=self._port) self.assertEqual(len(self.all_metric), 0) self.assertEqual(len(self.all_span), 0) self._server.stop(0) @@ -277,7 +336,7 @@ def testNoRecordBeforeInit(self): exporter=self.test_exporter ): self._start_server() - self.unary_unary_call() + unary_unary_call(port=self._port) self.assertGreater(len(self.all_metric), 0) self.assertGreater(len(self.all_span), 0) @@ -290,7 +349,7 @@ def testNoRecordAfterExit(self): exporter=self.test_exporter ): self._start_server() - self.unary_unary_call() + unary_unary_call(port=self._port) self.assertGreater(len(self.all_metric), 0) self.assertGreater(len(self.all_span), 0) @@ -299,7 +358,7 @@ def testNoRecordAfterExit(self): self._validate_metrics(self.all_metric) self._validate_spans(self.all_span) - self.unary_unary_call() + unary_unary_call(port=self._port) self.assertEqual(len(self.all_metric), current_metric_len) self.assertEqual(len(self.all_span), current_spans_len) @@ -320,8 +379,7 @@ def testTraceSamplingRate(self): ): self._start_server() for _ in range(_CALLS): - self.unary_unary_call() - + unary_unary_call(port=self._port) self.assertEqual(len(self.all_metric), 0) self.assertGreaterEqual(len(self.all_span), _LOWER_BOUND) self.assertLessEqual(len(self.all_span), _HIGHER_BOUND) @@ -337,7 +395,7 @@ def testConfigFileOverEnvVar(self): exporter=self.test_exporter ): self._start_server() - self.unary_unary_call() + unary_unary_call(port=self._port) self.assertEqual(len(self.all_metric), 0) self.assertGreater(len(self.all_span), 0) @@ -350,38 +408,12 @@ def _set_config_file(self, config: Dict[str, Any]) -> None: f.write(json.dumps(config)) os.environ[CONFIG_FILE_ENV_VAR_NAME] = config_file_path - def unary_unary_call(self): - with grpc.insecure_channel(f"localhost:{self._port}") as channel: - multi_callable = channel.unary_unary(_UNARY_UNARY) - unused_response, call = multi_callable.with_call(_REQUEST) - - def unary_stream_call(self): - with grpc.insecure_channel(f"localhost:{self._port}") as channel: - multi_callable = channel.unary_stream(_UNARY_STREAM) - call = multi_callable(_REQUEST) - for _ in call: - pass - - def stream_unary_call(self): - with grpc.insecure_channel(f"localhost:{self._port}") as channel: - multi_callable = channel.stream_unary(_STREAM_UNARY) - unused_response, call = multi_callable.with_call( - iter([_REQUEST] * STREAM_LENGTH) - ) - - def stream_stream_call(self): - with grpc.insecure_channel(f"localhost:{self._port}") as channel: - multi_callable = channel.stream_stream(_STREAM_STREAM) - call = multi_callable(iter([_REQUEST] * STREAM_LENGTH)) - for _ in call: - pass - def _start_server(self) -> None: self._server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) self._server.add_generic_rpc_handlers((_GenericHandler(),)) self._port = self._server.add_insecure_port("[::]:0") - self._server.start() + return self._port def _validate_metrics( self, metrics: List[_observability.StatsData] @@ -413,6 +445,41 @@ def _validate_spans( self.assertTrue(prefix_exist) +def unary_unary_call(port, metadata=None): + with grpc.insecure_channel(f"localhost:{port}") as channel: + multi_callable = channel.unary_unary(_UNARY_UNARY) + if metadata: + unused_response, call = multi_callable.with_call( + _REQUEST, metadata=metadata + ) + else: + unused_response, call = multi_callable.with_call(_REQUEST) + + +def unary_stream_call(port): + with grpc.insecure_channel(f"localhost:{port}") as channel: + multi_callable = channel.unary_stream(_UNARY_STREAM) + call = multi_callable(_REQUEST) + for _ in call: + pass + + +def stream_unary_call(port): + with grpc.insecure_channel(f"localhost:{port}") as channel: + multi_callable = channel.stream_unary(_STREAM_UNARY) + unused_response, call = multi_callable.with_call( + iter([_REQUEST] * STREAM_LENGTH) + ) + + +def stream_stream_call(port): + with grpc.insecure_channel(f"localhost:{port}") as channel: + multi_callable = channel.stream_stream(_STREAM_STREAM) + call = multi_callable(iter([_REQUEST] * STREAM_LENGTH)) + for _ in call: + pass + + if __name__ == "__main__": logging.basicConfig() unittest.main(verbosity=2) From 8004254a535f3df3fbd2c728a922819a2b8c82cf Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 28 Jul 2023 15:01:24 -0700 Subject: [PATCH 077/205] [channel_args] Size optimizations (#33901) - Make `Value` a simple wrapper around `Pointer` and use some blessed vtables to distinguish strings vs ints vs actual pointers - this saves 8 bytes per value stored - introduce `RcString` as a lightweight container around an immutable string - this saves some bytes vs the shared_ptr approach we previously had, and importantly opens up the technique (via `RcStringValue`) to channel node keys also, which should increase sharing and consequently also decrease total memory usage --------- Co-authored-by: ctiller --- build_autogenerated.yaml | 2 - src/core/BUILD | 2 - src/core/lib/channel/channel_args.cc | 152 ++++++++++-------- src/core/lib/channel/channel_args.h | 130 +++++++++++++-- .../lib/compression/compression_internal.cc | 11 +- src/core/lib/gprpp/ref_counted.h | 4 +- 6 files changed, 205 insertions(+), 96 deletions(-) diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 49236f99ad5dd..4a8a34eec8efb 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -7076,9 +7076,7 @@ targets: - src/core/lib/event_engine/channel_args_endpoint_config.h - src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/dual_ref_counted.h - - src/core/lib/gprpp/match.h - src/core/lib/gprpp/orphanable.h - - src/core/lib/gprpp/overload.h - src/core/lib/gprpp/ref_counted.h - src/core/lib/gprpp/ref_counted_ptr.h - src/core/lib/gprpp/time.h diff --git a/src/core/BUILD b/src/core/BUILD index 14f615158b153..f1a323e6687f5 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -2624,7 +2624,6 @@ grpc_cc_library( "absl/strings", "absl/strings:str_format", "absl/types:optional", - "absl/types:variant", ], language = "c++", visibility = [ @@ -2634,7 +2633,6 @@ grpc_cc_library( "avl", "channel_stack_type", "dual_ref_counted", - "match", "ref_counted", "time", "useful", diff --git a/src/core/lib/channel/channel_args.cc b/src/core/lib/channel/channel_args.cc index 6a74d9b10445b..4496abad4b985 100644 --- a/src/core/lib/channel/channel_args.cc +++ b/src/core/lib/channel/channel_args.cc @@ -27,6 +27,9 @@ #include #include #include +#include +#include +#include #include #include "absl/strings/match.h" @@ -40,11 +43,47 @@ #include #include "src/core/lib/gpr/useful.h" -#include "src/core/lib/gprpp/crash.h" -#include "src/core/lib/gprpp/match.h" namespace grpc_core { +RefCountedPtr RcString::Make(absl::string_view src) { + void* p = gpr_malloc(sizeof(Header) + src.length() + 1); + return RefCountedPtr(new (p) RcString(src)); +} + +RcString::RcString(absl::string_view src) : header_{{}, src.length()} { + memcpy(payload_, src.data(), header_.length); + // Null terminate because we frequently need to convert to char* still to go + // back and forth to the old c-style api. + payload_[header_.length] = 0; +} + +void RcString::Destroy() { gpr_free(this); } + +const grpc_arg_pointer_vtable ChannelArgs::Value::int_vtable_{ + // copy + [](void* p) { return p; }, + // destroy + [](void*) {}, + // cmp + [](void* p1, void* p2) -> int { + return QsortCompare(reinterpret_cast(p1), + reinterpret_cast(p2)); + }, +}; + +const grpc_arg_pointer_vtable ChannelArgs::Value::string_vtable_{ + // copy + [](void* p) -> void* { return static_cast(p)->Ref().release(); }, + // destroy + [](void* p) { static_cast(p)->Unref(); }, + // cmp + [](void* p1, void* p2) -> int { + return QsortCompare(static_cast(p1)->as_string_view(), + static_cast(p2)->as_string_view()); + }, +}; + ChannelArgs::Pointer::Pointer(void* p, const grpc_arg_pointer_vtable* vtable) : p_(p), vtable_(vtable == nullptr ? EmptyVTable() : vtable) {} @@ -100,7 +139,7 @@ bool ChannelArgs::WantMinimalStack() const { return GetBool(GRPC_ARG_MINIMAL_STACK).value_or(false); } -ChannelArgs::ChannelArgs(AVL args) +ChannelArgs::ChannelArgs(AVL args) : args_(std::move(args)) {} ChannelArgs ChannelArgs::Set(grpc_arg arg) const { @@ -130,52 +169,22 @@ ChannelArgs ChannelArgs::FromC(const grpc_channel_args* args) { grpc_arg ChannelArgs::Value::MakeCArg(const char* name) const { char* c_name = const_cast(name); - return Match( - rep_, - [c_name](int i) { return grpc_channel_arg_integer_create(c_name, i); }, - [c_name](const std::shared_ptr& s) { - return grpc_channel_arg_string_create(c_name, - const_cast(s->c_str())); - }, - [c_name](const Pointer& p) { - return grpc_channel_arg_pointer_create(c_name, p.c_pointer(), - p.c_vtable()); - }); -} - -bool ChannelArgs::Value::operator<(const Value& rhs) const { - if (rhs.rep_.index() != rep_.index()) return rep_.index() < rhs.rep_.index(); - switch (rep_.index()) { - case 0: - return absl::get(rep_) < absl::get(rhs.rep_); - case 1: - return *absl::get>(rep_) < - *absl::get>(rhs.rep_); - case 2: - return absl::get(rep_) < absl::get(rhs.rep_); - default: - Crash("unreachable"); + if (rep_.c_vtable() == &int_vtable_) { + return grpc_channel_arg_integer_create( + c_name, reinterpret_cast(rep_.c_pointer())); } -} - -bool ChannelArgs::Value::operator==(const Value& rhs) const { - if (rhs.rep_.index() != rep_.index()) return false; - switch (rep_.index()) { - case 0: - return absl::get(rep_) == absl::get(rhs.rep_); - case 1: - return *absl::get>(rep_) == - *absl::get>(rhs.rep_); - case 2: - return absl::get(rep_) == absl::get(rhs.rep_); - default: - Crash("unreachable"); + if (rep_.c_vtable() == &string_vtable_) { + return grpc_channel_arg_string_create( + c_name, + const_cast(static_cast(rep_.c_pointer())->c_str())); } + return grpc_channel_arg_pointer_create(c_name, rep_.c_pointer(), + rep_.c_vtable()); } ChannelArgs::CPtr ChannelArgs::ToC() const { std::vector c_args; - args_.ForEach([&c_args](const std::string& key, const Value& value) { + args_.ForEach([&c_args](const RcStringValue& key, const Value& value) { c_args.push_back(value.MakeCArg(key.c_str())); }); return CPtr(static_cast( @@ -194,7 +203,7 @@ ChannelArgs ChannelArgs::Set(absl::string_view name, Value value) const { if (const auto* p = args_.Lookup(name)) { if (*p == value) return *this; // already have this value for this key } - return ChannelArgs(args_.Add(std::string(name), std::move(value))); + return ChannelArgs(args_.Add(RcStringValue(name), std::move(value))); } ChannelArgs ChannelArgs::Set(absl::string_view name, @@ -218,8 +227,8 @@ ChannelArgs ChannelArgs::Remove(absl::string_view name) const { ChannelArgs ChannelArgs::RemoveAllKeysWithPrefix( absl::string_view prefix) const { auto args = args_; - args_.ForEach([&args, prefix](const std::string& key, const Value&) { - if (absl::StartsWith(key, prefix)) args = args.Remove(key); + args_.ForEach([&](const RcStringValue& key, const Value&) { + if (absl::StartsWith(key.as_string_view(), prefix)) args = args.Remove(key); }); return ChannelArgs(std::move(args)); } @@ -227,9 +236,7 @@ ChannelArgs ChannelArgs::RemoveAllKeysWithPrefix( absl::optional ChannelArgs::GetInt(absl::string_view name) const { auto* v = Get(name); if (v == nullptr) return absl::nullopt; - const auto* i = v->GetIfInt(); - if (i == nullptr) return absl::nullopt; - return *i; + return v->GetIfInt(); } absl::optional ChannelArgs::GetDurationFromIntMillis( @@ -245,9 +252,9 @@ absl::optional ChannelArgs::GetString( absl::string_view name) const { auto* v = Get(name); if (v == nullptr) return absl::nullopt; - const auto* s = v->GetIfString(); + const auto s = v->GetIfString(); if (s == nullptr) return absl::nullopt; - return *s; + return s->as_string_view(); } absl::optional ChannelArgs::GetOwnedString( @@ -268,8 +275,8 @@ void* ChannelArgs::GetVoidPointer(absl::string_view name) const { absl::optional ChannelArgs::GetBool(absl::string_view name) const { auto* v = Get(name); if (v == nullptr) return absl::nullopt; - auto* i = v->GetIfInt(); - if (i == nullptr) { + auto i = v->GetIfInt(); + if (!i.has_value()) { gpr_log(GPR_ERROR, "%s ignored: it must be an integer", std::string(name).c_str()); return absl::nullopt; @@ -286,18 +293,22 @@ absl::optional ChannelArgs::GetBool(absl::string_view name) const { } } +std::string ChannelArgs::Value::ToString() const { + if (rep_.c_vtable() == &int_vtable_) { + return std::to_string(reinterpret_cast(rep_.c_pointer())); + } + if (rep_.c_vtable() == &string_vtable_) { + return std::string( + static_cast(rep_.c_pointer())->as_string_view()); + } + return absl::StrFormat("%p", rep_.c_pointer()); +} + std::string ChannelArgs::ToString() const { std::vector arg_strings; - args_.ForEach([&arg_strings](const std::string& key, const Value& value) { - std::string value_str; - if (auto* i = value.GetIfInt()) { - value_str = std::to_string(*i); - } else if (auto* s = value.GetIfString()) { - value_str = *s; - } else if (auto* p = value.GetIfPointer()) { - value_str = absl::StrFormat("%p", p->c_pointer()); - } - arg_strings.push_back(absl::StrCat(key, "=", value_str)); + args_.ForEach([&arg_strings](const RcStringValue& key, const Value& value) { + arg_strings.push_back( + absl::StrCat(key.as_string_view(), "=", value.ToString())); }); return absl::StrCat("{", absl::StrJoin(arg_strings, ", "), "}"); } @@ -306,24 +317,25 @@ ChannelArgs ChannelArgs::UnionWith(ChannelArgs other) const { if (args_.Empty()) return other; if (other.args_.Empty()) return *this; if (args_.Height() <= other.args_.Height()) { - args_.ForEach([&other](const std::string& key, const Value& value) { + args_.ForEach([&other](const RcStringValue& key, const Value& value) { other.args_ = other.args_.Add(key, value); }); return other; } else { auto result = *this; - other.args_.ForEach([&result](const std::string& key, const Value& value) { - if (result.args_.Lookup(key) == nullptr) { - result.args_ = result.args_.Add(key, value); - } - }); + other.args_.ForEach( + [&result](const RcStringValue& key, const Value& value) { + if (result.args_.Lookup(key) == nullptr) { + result.args_ = result.args_.Add(key, value); + } + }); return result; } } ChannelArgs ChannelArgs::FuzzingReferenceUnionWith(ChannelArgs other) const { // DO NOT OPTIMIZE THIS!! - args_.ForEach([&other](const std::string& key, const Value& value) { + args_.ForEach([&other](const RcStringValue& key, const Value& value) { other.args_ = other.args_.Add(key, value); }); return other; diff --git a/src/core/lib/channel/channel_args.h b/src/core/lib/channel/channel_args.h index 57d6f35e33534..676ca6066f8b0 100644 --- a/src/core/lib/channel/channel_args.h +++ b/src/core/lib/channel/channel_args.h @@ -22,6 +22,7 @@ #include #include +#include #include // IWYU pragma: keep #include @@ -33,7 +34,6 @@ #include "absl/meta/type_traits.h" #include "absl/strings/string_view.h" #include "absl/types/optional.h" -#include "absl/types/variant.h" #include #include @@ -220,6 +220,91 @@ struct GetObjectImpl::value, void>> { }; }; +// Immutable reference counted string +class RcString { + public: + static RefCountedPtr Make(absl::string_view src); + + RefCountedPtr Ref() { + IncrementRefCount(); + return RefCountedPtr(this); + } + void IncrementRefCount() { header_.rc.Ref(); } + void Unref() { + if (header_.rc.Unref()) Destroy(); + } + + absl::string_view as_string_view() const { + return absl::string_view(payload_, header_.length); + } + + char* c_str() { return payload_; } + + private: + explicit RcString(absl::string_view src); + void Destroy(); + + struct Header { + RefCount rc; + size_t length; + }; + Header header_; + char payload_[]; +}; + +// Wrapper around RefCountedPtr to give value semantics, especially to +// overloaded operators. +class RcStringValue { + public: + RcStringValue() : str_{} {} + explicit RcStringValue(absl::string_view str) : str_(RcString::Make(str)) {} + + absl::string_view as_string_view() const { + return str_ == nullptr ? absl::string_view() : str_->as_string_view(); + } + + const char* c_str() const { return str_ == nullptr ? "" : str_->c_str(); } + + private: + RefCountedPtr str_; +}; + +inline bool operator==(const RcStringValue& lhs, absl::string_view rhs) { + return lhs.as_string_view() == rhs; +} + +inline bool operator==(absl::string_view lhs, const RcStringValue& rhs) { + return lhs == rhs.as_string_view(); +} + +inline bool operator==(const RcStringValue& lhs, const RcStringValue& rhs) { + return lhs.as_string_view() == rhs.as_string_view(); +} + +inline bool operator<(const RcStringValue& lhs, absl::string_view rhs) { + return lhs.as_string_view() < rhs; +} + +inline bool operator<(absl::string_view lhs, const RcStringValue& rhs) { + return lhs < rhs.as_string_view(); +} + +inline bool operator<(const RcStringValue& lhs, const RcStringValue& rhs) { + return lhs.as_string_view() < rhs.as_string_view(); +} + +inline bool operator>(const RcStringValue& lhs, absl::string_view rhs) { + return lhs.as_string_view() > rhs; +} + +inline bool operator>(absl::string_view lhs, const RcStringValue& rhs) { + return lhs > rhs.as_string_view(); +} + +inline bool operator>(const RcStringValue& lhs, const RcStringValue& rhs) { + return lhs.as_string_view() > rhs.as_string_view(); +} + // Provide the canonical name for a type's channel arg key template struct ChannelArgNameTraits { @@ -283,32 +368,43 @@ class ChannelArgs { class Value { public: - explicit Value(int n) : rep_(n) {} + explicit Value(int n) : rep_(reinterpret_cast(n), &int_vtable_) {} explicit Value(std::string s) - : rep_(std::make_shared(std::move(s))) {} + : rep_(RcString::Make(s).release(), &string_vtable_) {} explicit Value(Pointer p) : rep_(std::move(p)) {} - const int* GetIfInt() const { return absl::get_if(&rep_); } - const std::string* GetIfString() const { - auto* p = absl::get_if>(&rep_); - if (p == nullptr) return nullptr; - return p->get(); + absl::optional GetIfInt() const { + if (rep_.c_vtable() != &int_vtable_) return absl::nullopt; + return reinterpret_cast(rep_.c_pointer()); + } + RefCountedPtr GetIfString() const { + if (rep_.c_vtable() != &string_vtable_) return nullptr; + return static_cast(rep_.c_pointer())->Ref(); + } + const Pointer* GetIfPointer() const { + if (rep_.c_vtable() == &int_vtable_) return nullptr; + if (rep_.c_vtable() == &string_vtable_) return nullptr; + return &rep_; } - const Pointer* GetIfPointer() const { return absl::get_if(&rep_); } + + std::string ToString() const; grpc_arg MakeCArg(const char* name) const; - bool operator<(const Value& rhs) const; - bool operator==(const Value& rhs) const; + bool operator<(const Value& rhs) const { return rep_ < rhs.rep_; } + bool operator==(const Value& rhs) const { return rep_ == rhs.rep_; } bool operator!=(const Value& rhs) const { return !this->operator==(rhs); } bool operator==(absl::string_view rhs) const { - auto* p = absl::get_if>(&rep_); - if (p == nullptr) return false; - return **p == rhs; + auto str = GetIfString(); + if (str == nullptr) return false; + return str->as_string_view() == rhs; } private: - absl::variant, Pointer> rep_; + static const grpc_arg_pointer_vtable int_vtable_; + static const grpc_arg_pointer_vtable string_vtable_; + + Pointer rep_; }; struct ChannelArgsDeleter { @@ -462,12 +558,12 @@ class ChannelArgs { std::string ToString() const; private: - explicit ChannelArgs(AVL args); + explicit ChannelArgs(AVL args); GRPC_MUST_USE_RESULT ChannelArgs Set(absl::string_view name, Value value) const; - AVL args_; + AVL args_; }; std::ostream& operator<<(std::ostream& out, const ChannelArgs& args); diff --git a/src/core/lib/compression/compression_internal.cc b/src/core/lib/compression/compression_internal.cc index 4871e46f70552..793e8969d872f 100644 --- a/src/core/lib/compression/compression_internal.cc +++ b/src/core/lib/compression/compression_internal.cc @@ -32,6 +32,7 @@ #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/debug/trace.h" #include "src/core/lib/gprpp/crash.h" +#include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/surface/api_trace.h" namespace grpc_core { @@ -227,11 +228,13 @@ absl::optional DefaultCompressionAlgorithmFromChannelArgs(const ChannelArgs& args) { auto* value = args.Get(GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM); if (value == nullptr) return absl::nullopt; - if (auto* p = value->GetIfInt()) { - return static_cast(*p); + auto ival = value->GetIfInt(); + if (ival.has_value()) { + return static_cast(*ival); } - if (auto* p = value->GetIfString()) { - return ParseCompressionAlgorithm(*p); + auto sval = value->GetIfString(); + if (sval != nullptr) { + return ParseCompressionAlgorithm(sval->as_string_view()); } return absl::nullopt; } diff --git a/src/core/lib/gprpp/ref_counted.h b/src/core/lib/gprpp/ref_counted.h index 66ef042489956..cdf692c5ce7df 100644 --- a/src/core/lib/gprpp/ref_counted.h +++ b/src/core/lib/gprpp/ref_counted.h @@ -45,12 +45,14 @@ class RefCount { public: using Value = intptr_t; + RefCount() : RefCount(1) {} + // `init` is the initial refcount stored in this object. // // `trace` is a string to be logged with trace events; if null, no // trace logging will be done. Tracing is a no-op in non-debug builds. explicit RefCount( - Value init = 1, + Value init, const char* #ifndef NDEBUG // Leave unnamed if NDEBUG to avoid unused parameter warning From ff905cf2b4e268b53b5582f35d70ea0831da8aea Mon Sep 17 00:00:00 2001 From: Larry Safran Date: Fri, 28 Jul 2023 23:22:53 +0000 Subject: [PATCH 078/205] [interop] Add grpc-java 1.57.0 to client_matrix.py (#33913) --- tools/interop_matrix/client_matrix.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/interop_matrix/client_matrix.py b/tools/interop_matrix/client_matrix.py index 303b3da49c46a..f348f41487134 100644 --- a/tools/interop_matrix/client_matrix.py +++ b/tools/interop_matrix/client_matrix.py @@ -424,6 +424,7 @@ def __init__(self, patch=[], runtimes=[], testcases_file=None): ("v1.54.0", ReleaseInfo()), ("v1.55.1", ReleaseInfo()), ("v1.56.0", ReleaseInfo()), + ("v1.57.0", ReleaseInfo()), ] ), "python": OrderedDict( From 9a6fc5c9a11c30ac736c22c30fdafbf2bf972360 Mon Sep 17 00:00:00 2001 From: Zach Reyes <39203661+zasweq@users.noreply.github.com> Date: Fri, 28 Jul 2023 20:48:18 -0400 Subject: [PATCH 079/205] [PSM Interop] Fix bootstrap generator interop test (#33893) This PR fixes the bootstrap generator interop test by making the node metadata flag dependent on version, which was causing a breakage previously as all bootstrap generator version's don't necessarily support the deexpiermentalized flag. --- .../framework/test_app/runners/k8s/k8s_xds_server_runner.py | 2 ++ .../kubernetes-manifests/server.deployment.yaml | 4 ++++ .../xds_k8s_test_driver/tests/bootstrap_generator_test.py | 1 + 3 files changed, 7 insertions(+) diff --git a/tools/run_tests/xds_k8s_test_driver/framework/test_app/runners/k8s/k8s_xds_server_runner.py b/tools/run_tests/xds_k8s_test_driver/framework/test_app/runners/k8s/k8s_xds_server_runner.py index 48f9799233e5f..14f1206f6168e 100644 --- a/tools/run_tests/xds_k8s_test_driver/framework/test_app/runners/k8s/k8s_xds_server_runner.py +++ b/tools/run_tests/xds_k8s_test_driver/framework/test_app/runners/k8s/k8s_xds_server_runner.py @@ -119,6 +119,7 @@ def run( # pylint: disable=arguments-differ,too-many-branches secure_mode: bool = False, replica_count: int = 1, log_to_stdout: bool = False, + bootstrap_version: Optional[str] = None, ) -> List[XdsTestServer]: if not maintenance_port: maintenance_port = self._get_default_maintenance_port(secure_mode) @@ -202,6 +203,7 @@ def run( # pylint: disable=arguments-differ,too-many-branches test_port=test_port, maintenance_port=maintenance_port, secure_mode=secure_mode, + bootstrap_version=bootstrap_version, ) pod_names = self._wait_deployment_pod_count( diff --git a/tools/run_tests/xds_k8s_test_driver/kubernetes-manifests/server.deployment.yaml b/tools/run_tests/xds_k8s_test_driver/kubernetes-manifests/server.deployment.yaml index 1faa927450425..0d6501a2daae4 100644 --- a/tools/run_tests/xds_k8s_test_driver/kubernetes-manifests/server.deployment.yaml +++ b/tools/run_tests/xds_k8s_test_driver/kubernetes-manifests/server.deployment.yaml @@ -65,7 +65,11 @@ spec: % if xds_server_uri: - "--xds-server-uri=${xds_server_uri}" % endif + % if bootstrap_version=="v0.11.0" or bootstrap_version=="v0.12.0": + - "--node-metadata-experimental=app=${namespace_name}-${deployment_name}" + % else: - "--node-metadata=app=${namespace_name}-${deployment_name}" + % endif resources: limits: cpu: 100m diff --git a/tools/run_tests/xds_k8s_test_driver/tests/bootstrap_generator_test.py b/tools/run_tests/xds_k8s_test_driver/tests/bootstrap_generator_test.py index 0c290a829002a..754b76a7093ea 100644 --- a/tools/run_tests/xds_k8s_test_driver/tests/bootstrap_generator_test.py +++ b/tools/run_tests/xds_k8s_test_driver/tests/bootstrap_generator_test.py @@ -205,6 +205,7 @@ def test_baseline_in_server_with_bootstrap_version(self, version, image): maintenance_port=self.server_maintenance_port, xds_host=self.server_xds_host, xds_port=self.server_xds_port, + bootstrap_version=version, ) # Load backends. From 12f12d64c433b4e0c6e45f8f78a7f77c0e20154d Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Mon, 31 Jul 2023 09:34:10 -0700 Subject: [PATCH 080/205] [benchmark] Add gRPC experiment support to the OSS benchmarks (#33909) This adds a new GKE benchmark job, which runs the set of "dashboard" scenarios for every gRPC experiment configured in the script. Results are published to BigQuery at `e2e_benchmarks.ci_cxx_experiment_results_${N}core.${experiment}` See https://github.com/grpc/grpc/pull/33907 for the scenario config. --- ...formance_gke_cxx_experiments_framework.cfg | 25 +++ ...rformance_gke_cxx_experiments_framework.sh | 143 ++++++++++++++++++ .../run_tests/performance/loadtest_config.py | 11 +- ...dtest_template_prebuilt_all_languages.yaml | 2 + 4 files changed, 180 insertions(+), 1 deletion(-) create mode 100644 tools/internal_ci/linux/grpc_e2e_performance_gke_cxx_experiments_framework.cfg create mode 100755 tools/internal_ci/linux/grpc_e2e_performance_gke_cxx_experiments_framework.sh diff --git a/tools/internal_ci/linux/grpc_e2e_performance_gke_cxx_experiments_framework.cfg b/tools/internal_ci/linux/grpc_e2e_performance_gke_cxx_experiments_framework.cfg new file mode 100644 index 0000000000000..f3b216e5a40f8 --- /dev/null +++ b/tools/internal_ci/linux/grpc_e2e_performance_gke_cxx_experiments_framework.cfg @@ -0,0 +1,25 @@ +# Copyright 2023 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Config file for the internal CI (in protobuf text format) + +# Location of the continuous shell script in repository. +build_file: "grpc/tools/internal_ci/linux/grpc_e2e_performance_gke_cxx_experiments_framework.sh" +timeout_mins: 720 +action { + define_artifacts { + regex: "**/*sponge_log.*" + regex: "**/github/grpc/runner/**" + } +} diff --git a/tools/internal_ci/linux/grpc_e2e_performance_gke_cxx_experiments_framework.sh b/tools/internal_ci/linux/grpc_e2e_performance_gke_cxx_experiments_framework.sh new file mode 100755 index 0000000000000..8cd8ccb834537 --- /dev/null +++ b/tools/internal_ci/linux/grpc_e2e_performance_gke_cxx_experiments_framework.sh @@ -0,0 +1,143 @@ +#!/usr/bin/env bash +# Copyright 2023 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -ex + +# Purpose: Run the C++ "dashboard" benchmarks for a set of gRPC-core experiments. +# +# To run the benchmarks, add your experiment to the set below. +GRPC_EXPERIMENTS=("event_engine_listener" "work_stealing") + +# Enter the gRPC repo root. +cd "$(dirname "$0")/../../.." + +source tools/internal_ci/helper_scripts/prepare_build_linux_rc + +# Environment variables to select repos and branches for various repos. +# You can edit these lines if you want to run from a fork. +GRPC_CORE_REPO=grpc/grpc +GRPC_CORE_GITREF=master +TEST_INFRA_REPO=grpc/test-infra +TEST_INFRA_GITREF=master + +# This is to ensure we can push and pull images from gcr.io. We do not +# necessarily need it to run load tests, but will need it when we employ +# pre-built images in the optimization. +gcloud auth configure-docker + +# Connect to benchmarks-prod2 cluster. +gcloud config set project grpc-testing +gcloud container clusters get-credentials benchmarks-prod2 \ + --zone us-central1-b --project grpc-testing + +# Set up environment variables. +LOAD_TEST_PREFIX="${KOKORO_BUILD_INITIATOR}" +# BEGIN differentiate experimental configuration from master configuration. +if [[ "${KOKORO_BUILD_INITIATOR%%-*}" == kokoro ]]; then + LOAD_TEST_PREFIX=kokoro +fi +# Use the "official" BQ tables so that the measurements will show up in the +# "official" public dashboard. +BIGQUERY_TABLE_8CORE=e2e_benchmark_cxx_experiments.results_8core +BIGQUERY_TABLE_32CORE=e2e_benchmark_cxx_experiments.results_32core +# END differentiate experimental configuration from master configuration. +CLOUD_LOGGING_URL="https://source.cloud.google.com/results/invocations/${KOKORO_BUILD_ID}" +PREBUILT_IMAGE_PREFIX="gcr.io/grpc-testing/e2etest/prebuilt/cxx_experiment/${LOAD_TEST_PREFIX}" +UNIQUE_IDENTIFIER="cxx-experiment-$(date +%Y%m%d%H%M%S)" +ROOT_DIRECTORY_OF_DOCKERFILES="../test-infra/containers/pre_built_workers/" +# Head of the workspace checked out by Kokoro. +GRPC_COMMIT="$(git show --format="%H" --no-patch)" +# Prebuilt workers for core languages are always built from grpc/grpc. +if [[ "${KOKORO_GITHUB_COMMIT_URL%/*}" == "https://github.com/grpc/grpc/commit" ]]; then + GRPC_CORE_COMMIT="${KOKORO_GIT_COMMIT}" +else + GRPC_CORE_COMMIT="$(git ls-remote -h "https://github.com/${GRPC_CORE_REPO}.git" "${GRPC_CORE_GITREF}" | cut -f1)" +fi + +# Kokoro jobs run on dedicated pools. +DRIVER_POOL=drivers-ci +WORKER_POOL_8CORE=workers-c2-8core-ci +# c2-standard-30 is the closest machine spec to 32 core there is +WORKER_POOL_32CORE=workers-c2-30core-ci +# Prefix for log URLs in cnsviewer. +LOG_URL_PREFIX="http://cnsviewer/placer/prod/home/kokoro-dedicated/build_artifacts/${KOKORO_BUILD_ARTIFACTS_SUBDIR}/github/grpc/" + +# Clone test-infra repository and build all tools. +mkdir ../test-infra +pushd ../test-infra +git clone "https://github.com/${TEST_INFRA_REPO}.git" . +git checkout "${TEST_INFRA_GITREF}" +make all-tools +popd + +declare -a loadtest_files=() + +# Build test configurations. +buildConfigs() { + local -r pool="$1" + local -r table="$2" + local -r experiment="$3" + shift 3 + tools/run_tests/performance/loadtest_config.py "$@" \ + -t ./tools/run_tests/performance/templates/loadtest_template_prebuilt_all_languages.yaml \ + -s driver_pool="${DRIVER_POOL}" -s driver_image= \ + -s client_pool="${pool}" -s server_pool="${pool}" \ + -s big_query_table="${table}_${experiment}" -s timeout_seconds=900 \ + -s prebuilt_image_prefix="${PREBUILT_IMAGE_PREFIX}" \ + -s prebuilt_image_tag="${UNIQUE_IDENTIFIER}" \ + -s grpc_experiment="${experiment}" \ + -a ci_buildNumber="${KOKORO_BUILD_NUMBER}" \ + -a ci_buildUrl="${CLOUD_LOGGING_URL}" \ + -a ci_jobName="${KOKORO_JOB_NAME}" \ + -a ci_gitCommit="${GRPC_COMMIT}" \ + -a ci_gitCommit_core="${GRPC_CORE_COMMIT}" \ + -a ci_gitActualCommit="${KOKORO_GIT_COMMIT}" \ + --prefix="${LOAD_TEST_PREFIX}" -u "${UNIQUE_IDENTIFIER}" -u "${pool}" \ + -a pool="${pool}" --category=dashboard \ + --allow_client_language=c++ --allow_server_language=c++ \ + --allow_server_language=node \ + -o "loadtest_with_prebuilt_workers_${pool}_${experiment}.yaml" + + loadtest_files+=(-i "loadtest_with_prebuilt_workers_${pool}_${experiment}.yaml") +} + +for experiment in "${GRPC_EXPERIMENTS[@]}"; do + buildConfigs "${WORKER_POOL_8CORE}" "${BIGQUERY_TABLE_8CORE}" "${experiment}" -l c++ + buildConfigs "${WORKER_POOL_32CORE}" "${BIGQUERY_TABLE_32CORE}" "${experiment}" -l c++ +done + +# Delete prebuilt images on exit. +deleteImages() { + echo "deleting images on exit" + ../test-infra/bin/delete_prebuilt_workers \ + -p "${PREBUILT_IMAGE_PREFIX}" \ + -t "${UNIQUE_IDENTIFIER}" +} +trap deleteImages EXIT + +# Build and push prebuilt images for running tests. +time ../test-infra/bin/prepare_prebuilt_workers \ + -l "cxx:${GRPC_CORE_REPO}:${GRPC_CORE_COMMIT}" \ + -p "${PREBUILT_IMAGE_PREFIX}" \ + -t "${UNIQUE_IDENTIFIER}" \ + -r "${ROOT_DIRECTORY_OF_DOCKERFILES}" + +# Run tests. +../test-infra/bin/runner \ + ${loadtest_files[@]} \ + -log-url-prefix "${LOG_URL_PREFIX}" \ + -polling-interval 5s \ + -delete-successful-tests \ + -c "${WORKER_POOL_8CORE}:2" -c "${WORKER_POOL_32CORE}:2" \ + -o "runner/sponge_log.xml" diff --git a/tools/run_tests/performance/loadtest_config.py b/tools/run_tests/performance/loadtest_config.py index 4c73c8f802d30..923ffc02e0cee 100755 --- a/tools/run_tests/performance/loadtest_config.py +++ b/tools/run_tests/performance/loadtest_config.py @@ -462,7 +462,15 @@ def main() -> None: ) argp.add_argument( "--category", - choices=["all", "inproc", "scalable", "smoketest", "sweep", "psm"], + choices=[ + "all", + "inproc", + "scalable", + "smoketest", + "sweep", + "psm", + "dashboard", + ], default="all", help="Select a category of tests to run.", ) @@ -529,6 +537,7 @@ def main() -> None: "DRIVER_PORT": "${DRIVER_PORT}", "KILL_AFTER": "${KILL_AFTER}", "POD_TIMEOUT": "${POD_TIMEOUT}", + "grpc_experiment": "", } # The user can override the ignored variables above by passing them in as diff --git a/tools/run_tests/performance/templates/loadtest_template_prebuilt_all_languages.yaml b/tools/run_tests/performance/templates/loadtest_template_prebuilt_all_languages.yaml index fcc8170a72df8..2b0a6bd358c76 100644 --- a/tools/run_tests/performance/templates/loadtest_template_prebuilt_all_languages.yaml +++ b/tools/run_tests/performance/templates/loadtest_template_prebuilt_all_languages.yaml @@ -46,6 +46,7 @@ spec: - args: - -c - | + GRPC_EXPERIMENTS="${grpc_experiment}" \ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \ /source/code/bazel-bin/test/cpp/qps/qps_worker \ --driver_port="${DRIVER_PORT}" @@ -194,6 +195,7 @@ spec: - args: - -c - | + GRPC_EXPERIMENTS="${grpc_experiment}" \ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \ /source/code/bazel-bin/test/cpp/qps/qps_worker \ --driver_port="${DRIVER_PORT}" --server_port=10010 From c5246fc05911c3f8a9deb81cb68daf4452765c3a Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Mon, 31 Jul 2023 09:37:14 -0700 Subject: [PATCH 081/205] [EventEngine] Enable the work_stealing experiment in debug builds (#33912) Over the past 5 days, this experiment has not introduced any new flakes, nor increased any flake rates. Let's enable it for debug builds. To prevent issues over the weekend, I plan to merge it next week, July 31st (with announcement). --- bazel/experiments.bzl | 12 ++++++--- src/core/lib/experiments/experiments.cc | 21 +++++++++++++--- src/core/lib/experiments/experiments.h | 33 ++++++++++++++++++++++--- src/core/lib/experiments/rollouts.yaml | 2 +- 4 files changed, 58 insertions(+), 10 deletions(-) diff --git a/bazel/experiments.bzl b/bazel/experiments.bzl index 914cd1f0fef01..1bd377317c355 100644 --- a/bazel/experiments.bzl +++ b/bazel/experiments.bzl @@ -29,7 +29,6 @@ EXPERIMENTS = { "promise_based_client_call", "promise_based_server_call", "unique_metadata_strings", - "work_stealing", ], "cpp_end2end_test": [ "promise_based_server_call", @@ -62,6 +61,9 @@ EXPERIMENTS = { ], }, "on": { + "core_end2end_test": [ + "work_stealing", + ], }, }, "ios": { @@ -76,7 +78,6 @@ EXPERIMENTS = { "promise_based_client_call", "promise_based_server_call", "unique_metadata_strings", - "work_stealing", ], "cpp_end2end_test": [ "promise_based_server_call", @@ -109,6 +110,9 @@ EXPERIMENTS = { ], }, "on": { + "core_end2end_test": [ + "work_stealing", + ], }, }, "posix": { @@ -127,7 +131,6 @@ EXPERIMENTS = { "promise_based_client_call", "promise_based_server_call", "unique_metadata_strings", - "work_stealing", ], "cpp_end2end_test": [ "promise_based_server_call", @@ -166,6 +169,9 @@ EXPERIMENTS = { ], }, "on": { + "core_end2end_test": [ + "work_stealing", + ], }, }, } diff --git a/src/core/lib/experiments/experiments.cc b/src/core/lib/experiments/experiments.cc index ca97b7ce0a51f..3d88430d9ab0b 100644 --- a/src/core/lib/experiments/experiments.cc +++ b/src/core/lib/experiments/experiments.cc @@ -97,6 +97,11 @@ const char* const description_keepalive_fix = "Allows overriding keepalive_permit_without_calls. Refer " "https://github.com/grpc/grpc/pull/33428 for more information."; const char* const additional_constraints_keepalive_fix = "{}"; +#ifdef NDEBUG +const bool kDefaultForDebugOnly = false; +#else +const bool kDefaultForDebugOnly = true; +#endif } // namespace namespace grpc_core { @@ -136,7 +141,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, @@ -228,6 +233,11 @@ const char* const description_keepalive_fix = "Allows overriding keepalive_permit_without_calls. Refer " "https://github.com/grpc/grpc/pull/33428 for more information."; const char* const additional_constraints_keepalive_fix = "{}"; +#ifdef NDEBUG +const bool kDefaultForDebugOnly = false; +#else +const bool kDefaultForDebugOnly = true; +#endif } // namespace namespace grpc_core { @@ -267,7 +277,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, @@ -359,6 +369,11 @@ const char* const description_keepalive_fix = "Allows overriding keepalive_permit_without_calls. Refer " "https://github.com/grpc/grpc/pull/33428 for more information."; const char* const additional_constraints_keepalive_fix = "{}"; +#ifdef NDEBUG +const bool kDefaultForDebugOnly = false; +#else +const bool kDefaultForDebugOnly = true; +#endif } // namespace namespace grpc_core { @@ -398,7 +413,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 f718267df7c11..c375a29c10932 100644 --- a/src/core/lib/experiments/experiments.h +++ b/src/core/lib/experiments/experiments.h @@ -75,7 +75,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; } @@ -99,7 +108,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; } @@ -123,7 +141,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 ced29a773c4be..dacf219bd7366 100644 --- a/src/core/lib/experiments/rollouts.yaml +++ b/src/core/lib/experiments/rollouts.yaml @@ -79,7 +79,7 @@ # implemented windows: broken - name: work_stealing - default: false + default: debug - name: client_privacy default: false - name: canary_client_privacy From b4cf62725e980fe74d3b0dd8f5045a2f9816e5f6 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 31 Jul 2023 09:57:13 -0700 Subject: [PATCH 082/205] [promises] Fix ordering problems shown up deploying experiment internally (#33920) --- src/core/lib/surface/call.cc | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/core/lib/surface/call.cc b/src/core/lib/surface/call.cc index cef87bec5cefe..2f77f780fac63 100644 --- a/src/core/lib/surface/call.cc +++ b/src/core/lib/surface/call.cc @@ -2227,6 +2227,10 @@ class PromiseBasedCall : public Call, } } + void set_failed_before_recv_message() { + failed_before_recv_message_.store(true, std::memory_order_relaxed); + } + private: union CompletionInfo { static constexpr uint32_t kOpFailed = 0x8000'0000u; @@ -2600,7 +2604,7 @@ void PromiseBasedCall::StartRecvMessage( "finishes: received end-of-stream with error", DebugTag().c_str()); } - failed_before_recv_message_.store(true); + set_failed_before_recv_message(); FailCompletion(completion); if (cancel_on_error) CancelWithError(absl::CancelledError()); *recv_message_ = nullptr; @@ -3244,11 +3248,13 @@ void ServerPromiseBasedCall::Finish(ServerMetadataHandle result) { channelz_node->RecordCallFailed(); } } + bool was_cancelled = result->get(GrpcCallWasCancelled()).value_or(true); if (recv_close_op_cancel_state_.CompleteCallWithCancelledSetTo( - result->get(GrpcCallWasCancelled()).value_or(true))) { + was_cancelled)) { FinishOpOnCompletion(&recv_close_completion_, PendingOp::kReceiveCloseOnServer); } + if (was_cancelled) set_failed_before_recv_message(); if (server_initial_metadata_ != nullptr) { server_initial_metadata_->Close(); } @@ -3324,7 +3330,10 @@ void ServerPromiseBasedCall::CommitBatch(const grpc_op* ops, size_t nops, [this, completion = AddOpToCompletion( completion, PendingOp::kSendInitialMetadata)](bool r) mutable { - if (!r) FailCompletion(completion); + if (!r) { + set_failed_before_recv_message(); + FailCompletion(completion); + } FinishOpOnCompletion(&completion, PendingOp::kSendInitialMetadata); }); @@ -3374,7 +3383,10 @@ void ServerPromiseBasedCall::CommitBatch(const grpc_op* ops, size_t nops, [this, completion = AddOpToCompletion( completion, PendingOp::kSendStatusFromServer)]( bool ok) mutable { - if (!ok) FailCompletion(completion); + if (!ok) { + set_failed_before_recv_message(); + FailCompletion(completion); + } FinishOpOnCompletion(&completion, PendingOp::kSendStatusFromServer); }); From 1138e3f83be0f638a41f745ee720c7df3c9fc190 Mon Sep 17 00:00:00 2001 From: Xuan Wang Date: Mon, 31 Jul 2023 09:58:33 -0700 Subject: [PATCH 083/205] [Documentation] Fix Python documentation CSS (#33908) Fix python documentation website sidebar. ### Before: Screenshot 2023-07-27 at 4 49 25 PM ### After: ![Screenshot 2023-07-28 at 1 04 01 PM](https://github.com/grpc/grpc/assets/24593237/c7cc16b6-926f-4c8b-bc54-6cedfebb62b4) --- doc/python/sphinx/_static/custom.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/python/sphinx/_static/custom.css b/doc/python/sphinx/_static/custom.css index d961c389b9e39..34a31a9926fb5 100644 --- a/doc/python/sphinx/_static/custom.css +++ b/doc/python/sphinx/_static/custom.css @@ -1,3 +1,8 @@ dl.field-list > dt { word-break: keep-all !important; } +.sphinxsidebar { + overflow-y: scroll; + top: 0; + bottom: 0; +} From f846e11519383d0a8ae367ff2b71092fea41a159 Mon Sep 17 00:00:00 2001 From: Paulo Castello da Costa Date: Mon, 31 Jul 2023 10:43:43 -0700 Subject: [PATCH 084/205] [Test] Clean up benchmarks python scripts. (#33919) Cleans up unnecessary imports. Adds file name when dumping contents to log. Makes `prometheus.py` executable. --- tools/run_tests/performance/bq_upload_result.py | 2 -- .../run_tests/performance/patch_scenario_results_schema.py | 5 ----- tools/run_tests/performance/prometheus.py | 7 +++++-- 3 files changed, 5 insertions(+), 9 deletions(-) mode change 100644 => 100755 tools/run_tests/performance/prometheus.py diff --git a/tools/run_tests/performance/bq_upload_result.py b/tools/run_tests/performance/bq_upload_result.py index cb734efb7281b..1e582a74f2206 100755 --- a/tools/run_tests/performance/bq_upload_result.py +++ b/tools/run_tests/performance/bq_upload_result.py @@ -15,8 +15,6 @@ # Uploads performance benchmark result file to bigquery. -from __future__ import print_function - import argparse import calendar import json diff --git a/tools/run_tests/performance/patch_scenario_results_schema.py b/tools/run_tests/performance/patch_scenario_results_schema.py index 44b23da6b4a1e..5291d246e5d8c 100755 --- a/tools/run_tests/performance/patch_scenario_results_schema.py +++ b/tools/run_tests/performance/patch_scenario_results_schema.py @@ -15,15 +15,10 @@ # Use to patch schema of existing scenario results tables (after adding fields). -from __future__ import print_function - import argparse -import calendar import json import os import sys -import time -import uuid gcp_utils_dir = os.path.abspath( os.path.join(os.path.dirname(__file__), "../../gcp/utils") diff --git a/tools/run_tests/performance/prometheus.py b/tools/run_tests/performance/prometheus.py old mode 100644 new mode 100755 index ced87fc47573e..2711dc91bceb2 --- a/tools/run_tests/performance/prometheus.py +++ b/tools/run_tests/performance/prometheus.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 - # Copyright 2022 The gRPC Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -320,7 +319,11 @@ def main() -> None: ) processed_data["testDurationSeconds"] = float(end_time) - float(start_time) - logging.debug(json.dumps(processed_data, sort_keys=True, indent=4)) + logging.debug( + "%s: %s", + args.export_file_name, + json.dumps(processed_data, sort_keys=True, indent=4), + ) with open(args.export_file_name, "w", encoding="utf8") as export_file: json.dump(processed_data, export_file, sort_keys=True, indent=4) From 78eb191da5e6428866f2fc1b7baa45cc4c3f4d5c Mon Sep 17 00:00:00 2001 From: Eugene Ostroukhov Date: Mon, 31 Jul 2023 11:30:45 -0700 Subject: [PATCH 085/205] [Interop Test] Use distroless for C++ xDS tests (#33925) This should drastically reduce number of vulnerabilities. Tested locally by running the test --- .../interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client | 4 ++-- .../interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client b/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client index 9feea3396d696..3b68c0e38344d 100644 --- a/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client +++ b/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client @@ -14,7 +14,7 @@ # Dockerfile for building //test/cpp/interop:xds_interop_client -FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc +FROM debian:11 RUN apt-get update -y && \ apt-get install -y \ @@ -32,7 +32,7 @@ COPY . . RUN tools/bazel build //test/cpp/interop:xds_interop_client RUN cp -rL /workdir/bazel-bin/test/cpp/interop/xds_interop_client /artifacts/ -FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc +FROM gcr.io/distroless/cc-debian11@sha256:b53fbf5f81f4a120a489fedff2092e6fcbeacf7863fce3e45d99cc58dc230ccc COPY --from=0 /artifacts ./ ENV GRPC_VERBOSITY="DEBUG" diff --git a/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server b/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server index 83c0e61a40d1a..d911e4fc8581a 100644 --- a/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server +++ b/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server @@ -14,7 +14,7 @@ # Dockerfile for building //test/cpp/interop:xds_interop_client -FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc +FROM debian:11 RUN apt-get update -y && \ apt-get install -y \ @@ -32,7 +32,7 @@ COPY . . RUN tools/bazel build //test/cpp/interop:xds_interop_server RUN cp -rL /workdir/bazel-bin/test/cpp/interop/xds_interop_server /artifacts/ -FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc +FROM gcr.io/distroless/cc-debian11@sha256:b53fbf5f81f4a120a489fedff2092e6fcbeacf7863fce3e45d99cc58dc230ccc COPY --from=0 /artifacts ./ ENV GRPC_VERBOSITY="DEBUG" From 98104bbc3c84d33c2b2c9750790d54259ec609f6 Mon Sep 17 00:00:00 2001 From: Vignesh Babu Date: Mon, 31 Jul 2023 11:35:32 -0700 Subject: [PATCH 086/205] [experiments] update experiments expiration (#33926) --- src/core/lib/experiments/experiments.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/lib/experiments/experiments.yaml b/src/core/lib/experiments/experiments.yaml index 99e62bcc84b63..5edc89594b806 100644 --- a/src/core/lib/experiments/experiments.yaml +++ b/src/core/lib/experiments/experiments.yaml @@ -39,12 +39,12 @@ TCP would not indicate completion of a read operation until a specified number of bytes have been read over the socket. Buffers are also allocated according to estimated RPC sizes. - expiry: 2023/08/01 + expiry: 2024/01/01 owner: vigneshbabu@google.com test_tags: ["endpoint_test", "flow_control_test"] - name: tcp_rcv_lowat description: Use SO_RCVLOWAT to avoid wakeups on the read path. - expiry: 2023/08/01 + expiry: 2024/01/01 owner: vigneshbabu@google.com test_tags: ["endpoint_test", "flow_control_test"] - name: peer_state_based_framing @@ -52,7 +52,7 @@ If set, the max sizes of frames sent to lower layers is controlled based on the peer's memory pressure which is reflected in its max http2 frame size. - expiry: 2023/08/01 + expiry: 2024/01/01 owner: vigneshbabu@google.com test_tags: ["flow_control_test"] - name: memory_pressure_controller @@ -101,17 +101,17 @@ test_tags: [census_test] - name: event_engine_listener description: Use EventEngine listeners instead of iomgr's grpc_tcp_server - expiry: 2023/10/01 + expiry: 2024/01/01 owner: vigneshbabu@google.com test_tags: ["core_end2end_test", "event_engine_listener_test"] - name: schedule_cancellation_over_write description: Allow cancellation op to be scheduled over a write - expiry: 2023/10/01 + expiry: 2024/01/01 owner: vigneshbabu@google.com test_tags: [] - name: trace_record_callops description: Enables tracing of call batch initiation and completion. - expiry: 2023/10/01 + expiry: 2024/01/01 owner: vigneshbabu@google.com test_tags: [] - name: event_engine_dns From 76203ba5891c8a4a67d8331b125cf7450a677b13 Mon Sep 17 00:00:00 2001 From: apolcyn Date: Mon, 31 Jul 2023 12:25:38 -0700 Subject: [PATCH 087/205] [c-ares DNS resolver] Fix file descriptor use-after-close bug when c-ares writes succeed but subsequent read fails (#33871) Normally, c-ares related fds are destroyed after all DNS resolution is finished in [this code path](https://github.com/grpc/grpc/blob/c82d31677aeea66c128a5b912ad87efcd5f74d67/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc#L210). Also there are some fds that c-ares may fail to open or write to initially, and c-ares will close them internally before grpc ever knows about them. But if: 1) c-ares opens a socket and successfully writes a request on it 2) then a subsequent read fails Then c-ares will close the fd in [this code path](https://github.com/c-ares/c-ares/blob/bad62225b7f6b278b92e8e85a255600b629ef517/src/lib/ares_process.c#L740), but gRPC will have a reference on the fd and will still use it afterwards. Fix here is to leverage the c-ares socket-override API to properly track fd ownership between c-ares and grpc. Related: internal issue b/292203138 --- CMakeLists.txt | 1 + build_autogenerated.yaml | 2 + .../dns/c_ares/grpc_ares_ev_driver_posix.cc | 112 +++++++++- .../resolver/dns/c_ares/grpc_ares_wrapper.cc | 5 + .../resolver/dns/c_ares/grpc_ares_wrapper.h | 3 + test/core/util/BUILD | 28 +++ .../util/socket_use_after_close_detector.cc | 199 ++++++++++++++++++ .../util/socket_use_after_close_detector.h | 56 +++++ test/cpp/naming/BUILD | 1 + test/cpp/naming/cancel_ares_query_test.cc | 149 +++++++------ .../generate_resolver_component_tests.bzl | 1 + test/cpp/naming/resolver_component_test.cc | 153 +------------- 12 files changed, 490 insertions(+), 220 deletions(-) create mode 100644 test/core/util/socket_use_after_close_detector.cc create mode 100644 test/core/util/socket_use_after_close_detector.h diff --git a/CMakeLists.txt b/CMakeLists.txt index fb8fda2c87950..0392d45656177 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7661,6 +7661,7 @@ if(gRPC_BUILD_TESTS) add_executable(cancel_ares_query_test test/core/end2end/cq_verifier.cc test/core/util/fake_udp_and_tcp_server.cc + test/core/util/socket_use_after_close_detector.cc test/cpp/naming/cancel_ares_query_test.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 4a8a34eec8efb..da1291c235383 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -5495,9 +5495,11 @@ targets: headers: - test/core/end2end/cq_verifier.h - test/core/util/fake_udp_and_tcp_server.h + - test/core/util/socket_use_after_close_detector.h src: - test/core/end2end/cq_verifier.cc - test/core/util/fake_udp_and_tcp_server.cc + - test/core/util/socket_use_after_close_detector.cc - test/cpp/naming/cancel_ares_query_test.cc deps: - grpc++_test_config diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc index 4f0813edccab3..7259e3e3b10c1 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc @@ -17,28 +17,36 @@ // #include -#include -#include - -#include "absl/base/thread_annotations.h" - -#include "src/core/lib/gprpp/sync.h" -#include "src/core/lib/iomgr/closure.h" -#include "src/core/lib/iomgr/error.h" -#include "src/core/lib/iomgr/iomgr_fwd.h" #include "src/core/lib/iomgr/port.h" + #if GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_ARES_EV_DRIVER) -#include +#include #include +#include +#include +#include + +#include +#include +#include +#include #include +#include "absl/base/thread_annotations.h" #include "absl/strings/str_cat.h" +#include + #include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h" #include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h" +#include "src/core/lib/gprpp/sync.h" +#include "src/core/lib/iomgr/closure.h" +#include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/ev_posix.h" +#include "src/core/lib/iomgr/iomgr_fwd.h" +#include "src/core/lib/iomgr/socket_utils_posix.h" namespace grpc_core { @@ -98,12 +106,94 @@ class GrpcPolledFdPosix : public GrpcPolledFd { class GrpcPolledFdFactoryPosix : public GrpcPolledFdFactory { public: + ~GrpcPolledFdFactoryPosix() override { + for (auto& fd : owned_fds_) { + close(fd); + } + } + GrpcPolledFd* NewGrpcPolledFdLocked( ares_socket_t as, grpc_pollset_set* driver_pollset_set) override { + auto insert_result = owned_fds_.insert(as); + GPR_ASSERT(insert_result.second); return new GrpcPolledFdPosix(as, driver_pollset_set); } - void ConfigureAresChannelLocked(ares_channel /*channel*/) override {} + void ConfigureAresChannelLocked(ares_channel channel) override { + ares_set_socket_functions(channel, &kSockFuncs, this); + ares_set_socket_configure_callback( + channel, &GrpcPolledFdFactoryPosix::ConfigureSocket, nullptr); + } + + private: + /// Overridden socket API for c-ares + static ares_socket_t Socket(int af, int type, int protocol, + void* /*user_data*/) { + return socket(af, type, protocol); + } + + /// Overridden connect API for c-ares + static int Connect(ares_socket_t as, const struct sockaddr* target, + ares_socklen_t target_len, void* /*user_data*/) { + return connect(as, target, target_len); + } + + /// Overridden writev API for c-ares + static ares_ssize_t WriteV(ares_socket_t as, const struct iovec* iov, + int iovec_count, void* /*user_data*/) { + return writev(as, iov, iovec_count); + } + + /// Overridden recvfrom API for c-ares + static ares_ssize_t RecvFrom(ares_socket_t as, void* data, size_t data_len, + int flags, struct sockaddr* from, + ares_socklen_t* from_len, void* /*user_data*/) { + return recvfrom(as, data, data_len, flags, from, from_len); + } + + /// Overridden close API for c-ares + static int Close(ares_socket_t as, void* user_data) { + GrpcPolledFdFactoryPosix* self = + static_cast(user_data); + if (self->owned_fds_.find(as) == self->owned_fds_.end()) { + // c-ares owns this fd, grpc has never seen it + return close(as); + } + return 0; + } + + /// Because we're using socket API overrides, c-ares won't + /// perform its typical configuration on the socket. See + /// https://github.com/c-ares/c-ares/blob/bad62225b7f6b278b92e8e85a255600b629ef517/src/lib/ares_process.c#L1018. + /// So we use the configure socket callback override and copy default + /// settings that c-ares would normally apply on posix platforms: + /// - non-blocking + /// - cloexec flag + /// - disable nagle */ + static int ConfigureSocket(ares_socket_t fd, int type, void* /*user_data*/) { + grpc_error_handle err; + err = grpc_set_socket_nonblocking(fd, true); + if (!err.ok()) return -1; + err = grpc_set_socket_cloexec(fd, true); + if (!err.ok()) return -1; + if (type == SOCK_STREAM) { + err = grpc_set_socket_low_latency(fd, true); + if (!err.ok()) return -1; + } + return 0; + } + + const struct ares_socket_functions kSockFuncs = { + &GrpcPolledFdFactoryPosix::Socket /* socket */, + &GrpcPolledFdFactoryPosix::Close /* close */, + &GrpcPolledFdFactoryPosix::Connect /* connect */, + &GrpcPolledFdFactoryPosix::RecvFrom /* recvfrom */, + &GrpcPolledFdFactoryPosix::WriteV /* writev */, + }; + + // fds that are used/owned by grpc - we (grpc) will close them rather than + // c-ares + std::unordered_set owned_fds_; }; std::unique_ptr NewGrpcPolledFdFactory(Mutex* /* mu */) { diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc index a088c114585b8..3032bfda7970a 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc @@ -515,6 +515,8 @@ static void noop_inject_channel_config(ares_channel* /*channel*/) {} void (*grpc_ares_test_only_inject_config)(ares_channel* channel) = noop_inject_channel_config; +bool g_grpc_ares_test_only_force_tcp = false; + grpc_error_handle grpc_ares_ev_driver_create_locked( grpc_ares_ev_driver** ev_driver, grpc_pollset_set* pollset_set, int query_timeout_ms, grpc_ares_request* request) @@ -523,6 +525,9 @@ grpc_error_handle grpc_ares_ev_driver_create_locked( ares_options opts; memset(&opts, 0, sizeof(opts)); opts.flags |= ARES_FLAG_STAYOPEN; + if (g_grpc_ares_test_only_force_tcp) { + opts.flags |= ARES_FLAG_USEVC; + } int status = ares_init_options(&(*ev_driver)->channel, &opts, ARES_OPT_FLAGS); grpc_ares_test_only_inject_config(&(*ev_driver)->channel); GRPC_CARES_TRACE_LOG("request:%p grpc_ares_ev_driver_create_locked", request); diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h index 69f52bc3df11b..5970e131cccfc 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h @@ -133,4 +133,7 @@ void grpc_cares_wrapper_address_sorting_sort( // Exposed in this header for C-core tests only extern void (*grpc_ares_test_only_inject_config)(ares_channel* channel); +// Exposed in this header for C-core tests only +extern bool g_grpc_ares_test_only_force_tcp; + #endif // GRPC_SRC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_WRAPPER_H diff --git a/test/core/util/BUILD b/test/core/util/BUILD index 581371b05f74f..bda52932689dc 100644 --- a/test/core/util/BUILD +++ b/test/core/util/BUILD @@ -363,6 +363,34 @@ grpc_cc_library( ], ) +grpc_cc_library( + name = "socket_use_after_close_detector", + srcs = ["socket_use_after_close_detector.cc"], + hdrs = ["socket_use_after_close_detector.h"], + external_deps = ["gtest"], + language = "C++", + deps = [ + "grpc_test_util", + "//:gpr", + "//:grpc", + "//src/core:grpc_sockaddr", + ], +) + +grpc_cc_library( + name = "socket_use_after_close_detector_unsecure", + srcs = ["socket_use_after_close_detector.cc"], + hdrs = ["socket_use_after_close_detector.h"], + external_deps = ["gtest"], + language = "C++", + deps = [ + "grpc_test_util_unsecure", + "//:gpr", + "//:grpc", + "//src/core:grpc_sockaddr", + ], +) + grpc_cc_library( name = "build", srcs = ["build.cc"], diff --git a/test/core/util/socket_use_after_close_detector.cc b/test/core/util/socket_use_after_close_detector.cc new file mode 100644 index 0000000000000..1deaa67831d03 --- /dev/null +++ b/test/core/util/socket_use_after_close_detector.cc @@ -0,0 +1,199 @@ +// +// +// Copyright 2017 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#include + +#include "test/core/util/socket_use_after_close_detector.h" + +#include +#include +#include + +// IWYU pragma: no_include +// IWYU pragma: no_include + +#include +#include +#include +#include +#include + +#include "gtest/gtest.h" + +#include + +#include "src/core/lib/iomgr/sockaddr.h" +#include "test/core/util/port.h" + +// TODO(unknown): pull in different headers when enabling this +// test on windows. Also set BAD_SOCKET_RETURN_VAL +// to INVALID_SOCKET on windows. +#ifdef GPR_WINDOWS +#include "src/core/lib/iomgr/socket_windows.h" +#include "src/core/lib/iomgr/tcp_windows.h" + +#define BAD_SOCKET_RETURN_VAL INVALID_SOCKET +#else +#define BAD_SOCKET_RETURN_VAL (-1) +#endif + +namespace { + +#ifdef GPR_WINDOWS +void OpenAndCloseSocketsStressLoop(int port, gpr_event* done_ev) { + sockaddr_in6 addr; + memset(&addr, 0, sizeof(addr)); + addr.sin6_family = AF_INET6; + addr.sin6_port = htons(port); + ((char*)&addr.sin6_addr)[15] = 1; + for (;;) { + if (gpr_event_get(done_ev)) { + return; + } + std::vector sockets; + for (size_t i = 0; i < 50; i++) { + SOCKET s = WSASocket(AF_INET6, SOCK_STREAM, IPPROTO_TCP, nullptr, 0, + WSA_FLAG_OVERLAPPED); + ASSERT_TRUE(s != BAD_SOCKET_RETURN_VAL) + << "Failed to create TCP ipv6 socket"; + char val = 1; + ASSERT_TRUE(setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) != + SOCKET_ERROR) + << "Failed to set socketopt reuseaddr. WSA error: " + + std::to_string(WSAGetLastError()); + ASSERT_TRUE(grpc_tcp_set_non_block(s) == absl::OkStatus()) + << "Failed to set socket non-blocking"; + ASSERT_TRUE(bind(s, (const sockaddr*)&addr, sizeof(addr)) != SOCKET_ERROR) + << "Failed to bind socket " + std::to_string(s) + + " to [::1]:" + std::to_string(port) + + ". WSA error: " + std::to_string(WSAGetLastError()); + ASSERT_TRUE(listen(s, 1) != SOCKET_ERROR) + << "Failed to listen on socket " + std::to_string(s) + + ". WSA error: " + std::to_string(WSAGetLastError()); + sockets.push_back(s); + } + // Do a non-blocking accept followed by a close on all of those sockets. + // Do this in a separate loop to try to induce a time window to hit races. + for (size_t i = 0; i < sockets.size(); i++) { + ASSERT_TRUE(accept(sockets[i], nullptr, nullptr) == INVALID_SOCKET) + << "Accept on phony socket unexpectedly accepted actual connection."; + ASSERT_TRUE(WSAGetLastError() == WSAEWOULDBLOCK) + << "OpenAndCloseSocketsStressLoop accept on socket " + + std::to_string(sockets[i]) + + " failed in " + "an unexpected way. " + "WSA error: " + + std::to_string(WSAGetLastError()) + + ". Socket use-after-close bugs are likely."; + ASSERT_TRUE(closesocket(sockets[i]) != SOCKET_ERROR) + << "Failed to close socket: " + std::to_string(sockets[i]) + + ". WSA error: " + std::to_string(WSAGetLastError()); + } + } + return; +} +#else +void OpenAndCloseSocketsStressLoop(int port, gpr_event* done_ev) { + // The goal of this loop is to catch socket + // "use after close" bugs within the c-ares resolver by acting + // like some separate thread doing I/O. + // It's goal is to try to hit race conditions whereby: + // 1) The c-ares resolver closes a socket. + // 2) This loop opens a socket with (coincidentally) the same handle. + // 3) the c-ares resolver mistakenly uses that same socket without + // realizing that its closed. + // 4) This loop performs an operation on that socket that should + // succeed but instead fails because of what the c-ares + // resolver did in the meantime. + sockaddr_in6 addr; + memset(&addr, 0, sizeof(addr)); + addr.sin6_family = AF_INET6; + addr.sin6_port = htons(port); + (reinterpret_cast(&addr.sin6_addr))[15] = 1; + for (;;) { + if (gpr_event_get(done_ev)) { + return; + } + std::vector sockets; + // First open a bunch of sockets, bind and listen + // '50' is an arbitrary number that, experimentally, + // has a good chance of catching bugs. + for (size_t i = 0; i < 50; i++) { + int s = socket(AF_INET6, SOCK_STREAM, 0); + int val = 1; + ASSERT_TRUE(setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &val, sizeof(val)) == + 0) + << "Failed to set socketopt reuseport"; + ASSERT_TRUE(setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) == + 0) + << "Failed to set socket reuseaddr"; + ASSERT_TRUE(fcntl(s, F_SETFL, O_NONBLOCK) == 0) + << "Failed to set socket non-blocking"; + ASSERT_TRUE(s != BAD_SOCKET_RETURN_VAL) + << "Failed to create TCP ipv6 socket"; + ASSERT_TRUE(bind(s, (const sockaddr*)&addr, sizeof(addr)) == 0) + << "Failed to bind socket " + std::to_string(s) + + " to [::1]:" + std::to_string(port) + + ". errno: " + std::to_string(errno); + ASSERT_TRUE(listen(s, 1) == 0) << "Failed to listen on socket " + + std::to_string(s) + + ". errno: " + std::to_string(errno); + sockets.push_back(s); + } + // Do a non-blocking accept followed by a close on all of those sockets. + // Do this in a separate loop to try to induce a time window to hit races. + for (size_t i = 0; i < sockets.size(); i++) { + if (accept(sockets[i], nullptr, nullptr)) { + // If e.g. a "shutdown" was called on this fd from another thread, + // then this accept call should fail with an unexpected error. + ASSERT_TRUE(errno == EAGAIN || errno == EWOULDBLOCK) + << "OpenAndCloseSocketsStressLoop accept on socket " + + std::to_string(sockets[i]) + + " failed in " + "an unexpected way. " + "errno: " + + std::to_string(errno) + + ". Socket use-after-close bugs are likely."; + } + ASSERT_TRUE(close(sockets[i]) == 0) + << "Failed to close socket: " + std::to_string(sockets[i]) + + ". errno: " + std::to_string(errno); + } + } +} +#endif + +} // namespace + +namespace grpc_core { +namespace testing { + +SocketUseAfterCloseDetector::SocketUseAfterCloseDetector() { + int port = grpc_pick_unused_port_or_die(); + gpr_event_init(&done_ev_); + thread_ = std::make_unique(OpenAndCloseSocketsStressLoop, port, + &done_ev_); +} + +SocketUseAfterCloseDetector::~SocketUseAfterCloseDetector() { + gpr_event_set(&done_ev_, reinterpret_cast(1)); + thread_->join(); +} + +} // namespace testing +} // namespace grpc_core diff --git a/test/core/util/socket_use_after_close_detector.h b/test/core/util/socket_use_after_close_detector.h new file mode 100644 index 0000000000000..37c6773b28a77 --- /dev/null +++ b/test/core/util/socket_use_after_close_detector.h @@ -0,0 +1,56 @@ +// +// +// Copyright 2017 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#ifndef GRPC_TEST_CORE_UTIL_SOCKET_USE_AFTER_CLOSE_DETECTOR_H +#define GRPC_TEST_CORE_UTIL_SOCKET_USE_AFTER_CLOSE_DETECTOR_H + +#include + +#include +#include + +#include + +namespace grpc_core { +namespace testing { + +// This class is meant to detect file descriptor use-after-close +// bugs occuring somewhere in the program while the object is in live. +// The implementation currently uses a background thread to open +// and close sockets in a loop, catching socket use-after-close bugs +// by watching them manifest as unexpected socket operation failures. +// +// Note: this will not give false positives but may give false negatives. +// That said this seems to be fairly reliable at finding use-after-close +// bugs, at least on linux, because of fd handles being quickly reused. +// For example this was able to catch the use-after-close bug from +// https://github.com/grpc/grpc/pull/33871 "almost every time". +class SocketUseAfterCloseDetector { + public: + SocketUseAfterCloseDetector(); + ~SocketUseAfterCloseDetector(); + + private: + std::unique_ptr thread_; + gpr_event done_ev_; +}; + +} // namespace testing +} // namespace grpc_core + +#endif // GRPC_TEST_CORE_UTIL_SOCKET_USE_AFTER_CLOSE_DETECTOR_H diff --git a/test/cpp/naming/BUILD b/test/cpp/naming/BUILD index 462c0c74e33bf..4c5a2a2e8b1e0 100644 --- a/test/cpp/naming/BUILD +++ b/test/cpp/naming/BUILD @@ -47,6 +47,7 @@ grpc_cc_test( "//test/core/end2end:cq_verifier", "//test/core/util:fake_udp_and_tcp_server", "//test/core/util:grpc_test_util", + "//test/core/util:socket_use_after_close_detector", "//test/cpp/util:test_config", "//test/cpp/util:test_util", ], diff --git a/test/cpp/naming/cancel_ares_query_test.cc b/test/cpp/naming/cancel_ares_query_test.cc index 1e2f6287941ff..187a206c0b0c4 100644 --- a/test/cpp/naming/cancel_ares_query_test.cc +++ b/test/cpp/naming/cancel_ares_query_test.cc @@ -33,6 +33,7 @@ #include #include +#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h" #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/config/config_vars.h" #include "src/core/lib/config/core_configuration.h" @@ -54,6 +55,7 @@ #include "test/core/util/cmdline.h" #include "test/core/util/fake_udp_and_tcp_server.h" #include "test/core/util/port.h" +#include "test/core/util/socket_use_after_close_detector.h" #include "test/core/util/test_config.h" #include "test/cpp/util/test_config.h" @@ -277,71 +279,23 @@ TEST_F(CancelDuringAresQuery, TestFdsAreDeletedFromPollsetSet) { grpc_pollset_set_destroy(fake_other_pollset_set); } -// Settings for TestCancelDuringActiveQuery test -typedef enum { - NONE, - SHORT, - ZERO, -} cancellation_test_query_timeout_setting; +std::string kFakeName = "dont-care-since-wont-be-resolved.test.com:1234"; void TestCancelDuringActiveQuery( - cancellation_test_query_timeout_setting query_timeout_setting) { - // Start up fake non responsive DNS server - grpc_core::testing::FakeUdpAndTcpServer fake_dns_server( - grpc_core::testing::FakeUdpAndTcpServer::AcceptMode:: - kWaitForClientToSendFirstBytes, - grpc_core::testing::FakeUdpAndTcpServer::CloseSocketUponCloseFromPeer); + grpc_status_code expected_status_code, + absl::string_view expected_error_message_substring, + gpr_timespec rpc_deadline, int dns_query_timeout_ms, + int fake_dns_server_port) { // Create a call that will try to use the fake DNS server - std::string name = "dont-care-since-wont-be-resolved.test.com:1234"; std::string client_target = - absl::StrFormat("dns://[::1]:%d/%s", fake_dns_server.port(), name); - gpr_log(GPR_DEBUG, "TestCancelActiveDNSQuery. query timeout setting: %d", - query_timeout_setting); + absl::StrFormat("dns://[::1]:%d/%s", fake_dns_server_port, kFakeName); grpc_channel_args* client_args = nullptr; - grpc_status_code expected_status_code = GRPC_STATUS_OK; - std::string expected_error_message_substring; - gpr_timespec rpc_deadline; - if (query_timeout_setting == NONE) { - // The RPC deadline should go off well before the DNS resolution - // timeout fires. - expected_status_code = GRPC_STATUS_DEADLINE_EXCEEDED; - // use default DNS resolution timeout (which is over one minute). - client_args = nullptr; - rpc_deadline = grpc_timeout_milliseconds_to_deadline(100); - } else if (query_timeout_setting == SHORT) { - // The DNS resolution timeout should fire well before the - // RPC's deadline expires. - expected_status_code = GRPC_STATUS_UNAVAILABLE; - if (grpc_core::IsEventEngineDnsEnabled()) { - expected_error_message_substring = - absl::StrCat("errors resolving ", name); - } else { - expected_error_message_substring = - absl::StrCat("DNS resolution failed for ", name); - } - grpc_arg arg; - arg.type = GRPC_ARG_INTEGER; - arg.key = const_cast(GRPC_ARG_DNS_ARES_QUERY_TIMEOUT_MS); - arg.value.integer = - 1; // Set this shorter than the call deadline so that it goes off. - client_args = grpc_channel_args_copy_and_add(nullptr, &arg, 1); - // Set the deadline high enough such that if we hit this and get - // a deadline exceeded status code, then we are confident that there's - // a bug causing cancellation of DNS resolutions to not happen in a timely - // manner. - rpc_deadline = grpc_timeout_seconds_to_deadline(10); - } else if (query_timeout_setting == ZERO) { - // The RPC deadline should go off well before the DNS resolution - // timeout fires. - expected_status_code = GRPC_STATUS_DEADLINE_EXCEEDED; + if (dns_query_timeout_ms >= 0) { grpc_arg arg; arg.type = GRPC_ARG_INTEGER; arg.key = const_cast(GRPC_ARG_DNS_ARES_QUERY_TIMEOUT_MS); - arg.value.integer = 0; // Set this to zero to disable query timeouts. + arg.value.integer = dns_query_timeout_ms; client_args = grpc_channel_args_copy_and_add(nullptr, &arg, 1); - rpc_deadline = grpc_timeout_milliseconds_to_deadline(100); - } else { - abort(); } grpc_channel_credentials* creds = grpc_insecure_credentials_create(); grpc_channel* client = @@ -413,19 +367,96 @@ void TestCancelDuringActiveQuery( TEST_F(CancelDuringAresQuery, TestHitDeadlineAndDestroyChannelDuringAresResolutionIsGraceful) { - TestCancelDuringActiveQuery(NONE /* don't set query timeouts */); + grpc_core::testing::SocketUseAfterCloseDetector + socket_use_after_close_detector; + grpc_core::testing::FakeUdpAndTcpServer fake_dns_server( + grpc_core::testing::FakeUdpAndTcpServer::AcceptMode:: + kWaitForClientToSendFirstBytes, + grpc_core::testing::FakeUdpAndTcpServer::CloseSocketUponCloseFromPeer); + grpc_status_code expected_status_code = GRPC_STATUS_DEADLINE_EXCEEDED; + // The RPC deadline should go off well before the DNS resolution + // timeout fires. + gpr_timespec rpc_deadline = grpc_timeout_milliseconds_to_deadline(100); + int dns_query_timeout_ms = -1; // don't set query timeout + TestCancelDuringActiveQuery( + expected_status_code, "" /* expected error message substring */, + rpc_deadline, dns_query_timeout_ms, fake_dns_server.port()); } TEST_F( CancelDuringAresQuery, TestHitDeadlineAndDestroyChannelDuringAresResolutionWithQueryTimeoutIsGraceful) { - TestCancelDuringActiveQuery(SHORT /* set short query timeout */); + grpc_core::testing::SocketUseAfterCloseDetector + socket_use_after_close_detector; + grpc_core::testing::FakeUdpAndTcpServer fake_dns_server( + grpc_core::testing::FakeUdpAndTcpServer::AcceptMode:: + kWaitForClientToSendFirstBytes, + grpc_core::testing::FakeUdpAndTcpServer::CloseSocketUponCloseFromPeer); + grpc_status_code expected_status_code = GRPC_STATUS_UNAVAILABLE; + std::string expected_error_message_substring; + if (grpc_core::IsEventEngineDnsEnabled()) { + expected_error_message_substring = + absl::StrCat("errors resolving ", kFakeName); + } else { + expected_error_message_substring = + absl::StrCat("DNS resolution failed for ", kFakeName); + } + // The DNS resolution timeout should fire well before the + // RPC's deadline expires. + gpr_timespec rpc_deadline = grpc_timeout_seconds_to_deadline(10); + int dns_query_timeout_ms = 1; + TestCancelDuringActiveQuery(expected_status_code, + expected_error_message_substring, rpc_deadline, + dns_query_timeout_ms, fake_dns_server.port()); } TEST_F( CancelDuringAresQuery, TestHitDeadlineAndDestroyChannelDuringAresResolutionWithZeroQueryTimeoutIsGraceful) { - TestCancelDuringActiveQuery(ZERO /* disable query timeouts */); + grpc_core::testing::SocketUseAfterCloseDetector + socket_use_after_close_detector; + grpc_core::testing::FakeUdpAndTcpServer fake_dns_server( + grpc_core::testing::FakeUdpAndTcpServer::AcceptMode:: + kWaitForClientToSendFirstBytes, + grpc_core::testing::FakeUdpAndTcpServer::CloseSocketUponCloseFromPeer); + grpc_status_code expected_status_code = GRPC_STATUS_DEADLINE_EXCEEDED; + // The RPC deadline should go off well before the DNS resolution + // timeout fires. + gpr_timespec rpc_deadline = grpc_timeout_milliseconds_to_deadline(100); + int dns_query_timeout_ms = 0; // disable query timeouts + TestCancelDuringActiveQuery( + expected_status_code, "" /* expected error message substring */, + rpc_deadline, dns_query_timeout_ms, fake_dns_server.port()); +} + +TEST_F(CancelDuringAresQuery, TestQueryFailsBecauseTcpServerClosesSocket) { + grpc_core::testing::SocketUseAfterCloseDetector + socket_use_after_close_detector; + // Use a fake TCP server that immediately closes the socket and causes + // c-ares to pick up a socket read error, while the previous socket + // connect/writes succeeded. Meanwhile, force c-ares to only use TCP. + // The goal is to hit a socket use-after-close bug described in + // https://github.com/grpc/grpc/pull/33871. + grpc_core::testing::FakeUdpAndTcpServer fake_dns_server( + grpc_core::testing::FakeUdpAndTcpServer::AcceptMode:: + kWaitForClientToSendFirstBytes, + grpc_core::testing::FakeUdpAndTcpServer:: + CloseSocketUponReceivingBytesFromPeer); + // TODO(yijiem): make this test work with the EE DNS resolver by supporting + // this test flag to force TCP in the EE DNS resolver. + if (grpc_core::IsEventEngineDnsEnabled()) return; + g_grpc_ares_test_only_force_tcp = true; + grpc_status_code expected_status_code = GRPC_STATUS_UNAVAILABLE; + std::string expected_error_message_substring = + absl::StrCat("DNS resolution failed for ", kFakeName); + // Don't really care about the deadline - we should quickly hit a DNS + // resolution failure. + gpr_timespec rpc_deadline = grpc_timeout_seconds_to_deadline(100); + int dns_query_timeout_ms = -1; // don't set query timeout + TestCancelDuringActiveQuery(expected_status_code, + expected_error_message_substring, rpc_deadline, + dns_query_timeout_ms, fake_dns_server.port()); + g_grpc_ares_test_only_force_tcp = false; } } // namespace diff --git a/test/cpp/naming/generate_resolver_component_tests.bzl b/test/cpp/naming/generate_resolver_component_tests.bzl index edd9c4e40e36a..a91bc32649b13 100755 --- a/test/cpp/naming/generate_resolver_component_tests.bzl +++ b/test/cpp/naming/generate_resolver_component_tests.bzl @@ -59,6 +59,7 @@ def generate_resolver_component_tests(): "//test/cpp/util:test_util%s" % unsecure_build_config_suffix, "//test/core/util:grpc_test_util%s" % unsecure_build_config_suffix, "//test/core/util:fake_udp_and_tcp_server%s" % unsecure_build_config_suffix, + "//test/core/util:socket_use_after_close_detector%s" % unsecure_build_config_suffix, "//:grpc++%s" % unsecure_build_config_suffix, "//:grpc%s" % unsecure_build_config_suffix, "//:gpr", diff --git a/test/cpp/naming/resolver_component_test.cc b/test/cpp/naming/resolver_component_test.cc index 7fe90b704e5bf..69a19c9d90fe5 100644 --- a/test/cpp/naming/resolver_component_test.cc +++ b/test/cpp/naming/resolver_component_test.cc @@ -64,23 +64,11 @@ #include "src/core/lib/resolver/server_address.h" #include "test/core/util/fake_udp_and_tcp_server.h" #include "test/core/util/port.h" +#include "test/core/util/socket_use_after_close_detector.h" #include "test/core/util/test_config.h" #include "test/cpp/util/subprocess.h" #include "test/cpp/util/test_config.h" -// TODO(unknown): pull in different headers when enabling this -// test on windows. Also set BAD_SOCKET_RETURN_VAL -// to INVALID_SOCKET on windows. -#ifdef GPR_WINDOWS -#include "src/core/lib/iomgr/sockaddr_windows.h" -#include "src/core/lib/iomgr/socket_windows.h" -#include "src/core/lib/iomgr/tcp_windows.h" -#define BAD_SOCKET_RETURN_VAL INVALID_SOCKET -#else -#include "src/core/lib/iomgr/sockaddr_posix.h" -#define BAD_SOCKET_RETURN_VAL (-1) -#endif - using ::grpc_event_engine::experimental::GetDefaultEventEngine; using std::vector; using testing::UnorderedElementsAreArray; @@ -303,134 +291,6 @@ void CheckLBPolicyResultLocked(const grpc_core::ChannelArgs channel_args, } } -#ifdef GPR_WINDOWS -void OpenAndCloseSocketsStressLoop(int phony_port, gpr_event* done_ev) { - sockaddr_in6 addr; - memset(&addr, 0, sizeof(addr)); - addr.sin6_family = AF_INET6; - addr.sin6_port = htons(phony_port); - ((char*)&addr.sin6_addr)[15] = 1; - for (;;) { - if (gpr_event_get(done_ev)) { - return; - } - std::vector sockets; - for (size_t i = 0; i < 50; i++) { - SOCKET s = WSASocket(AF_INET6, SOCK_STREAM, IPPROTO_TCP, nullptr, 0, - WSA_FLAG_OVERLAPPED); - ASSERT_TRUE(s != BAD_SOCKET_RETURN_VAL) - << "Failed to create TCP ipv6 socket"; - gpr_log(GPR_DEBUG, "Opened socket: %d", s); - char val = 1; - ASSERT_TRUE(setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) != - SOCKET_ERROR) - << "Failed to set socketopt reuseaddr. WSA error: " + - std::to_string(WSAGetLastError()); - ASSERT_TRUE(grpc_tcp_set_non_block(s) == absl::OkStatus()) - << "Failed to set socket non-blocking"; - ASSERT_TRUE(bind(s, (const sockaddr*)&addr, sizeof(addr)) != SOCKET_ERROR) - << "Failed to bind socket " + std::to_string(s) + - " to [::1]:" + std::to_string(phony_port) + - ". WSA error: " + std::to_string(WSAGetLastError()); - ASSERT_TRUE(listen(s, 1) != SOCKET_ERROR) - << "Failed to listen on socket " + std::to_string(s) + - ". WSA error: " + std::to_string(WSAGetLastError()); - sockets.push_back(s); - } - // Do a non-blocking accept followed by a close on all of those sockets. - // Do this in a separate loop to try to induce a time window to hit races. - for (size_t i = 0; i < sockets.size(); i++) { - gpr_log(GPR_DEBUG, "non-blocking accept then close on %d", sockets[i]); - ASSERT_TRUE(accept(sockets[i], nullptr, nullptr) == INVALID_SOCKET) - << "Accept on phony socket unexpectedly accepted actual connection."; - ASSERT_TRUE(WSAGetLastError() == WSAEWOULDBLOCK) - << "OpenAndCloseSocketsStressLoop accept on socket " + - std::to_string(sockets[i]) + - " failed in " - "an unexpected way. " - "WSA error: " + - std::to_string(WSAGetLastError()) + - ". Socket use-after-close bugs are likely."; - ASSERT_TRUE(closesocket(sockets[i]) != SOCKET_ERROR) - << "Failed to close socket: " + std::to_string(sockets[i]) + - ". WSA error: " + std::to_string(WSAGetLastError()); - } - } - return; -} -#else -void OpenAndCloseSocketsStressLoop(int phony_port, gpr_event* done_ev) { - // The goal of this loop is to catch socket - // "use after close" bugs within the c-ares resolver by acting - // like some separate thread doing I/O. - // It's goal is to try to hit race conditions whereby: - // 1) The c-ares resolver closes a socket. - // 2) This loop opens a socket with (coincidentally) the same handle. - // 3) the c-ares resolver mistakenly uses that same socket without - // realizing that its closed. - // 4) This loop performs an operation on that socket that should - // succeed but instead fails because of what the c-ares - // resolver did in the meantime. - sockaddr_in6 addr; - memset(&addr, 0, sizeof(addr)); - addr.sin6_family = AF_INET6; - addr.sin6_port = htons(phony_port); - (reinterpret_cast(&addr.sin6_addr))[15] = 1; - for (;;) { - if (gpr_event_get(done_ev)) { - return; - } - std::vector sockets; - // First open a bunch of sockets, bind and listen - // '50' is an arbitrary number that, experimentally, - // has a good chance of catching bugs. - for (size_t i = 0; i < 50; i++) { - int s = socket(AF_INET6, SOCK_STREAM, 0); - int val = 1; - ASSERT_TRUE(setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &val, sizeof(val)) == - 0) - << "Failed to set socketopt reuseport"; - ASSERT_TRUE(setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) == - 0) - << "Failed to set socket reuseaddr"; - ASSERT_TRUE(fcntl(s, F_SETFL, O_NONBLOCK) == 0) - << "Failed to set socket non-blocking"; - ASSERT_TRUE(s != BAD_SOCKET_RETURN_VAL) - << "Failed to create TCP ipv6 socket"; - gpr_log(GPR_DEBUG, "Opened fd: %d", s); - ASSERT_TRUE(bind(s, (const sockaddr*)&addr, sizeof(addr)) == 0) - << "Failed to bind socket " + std::to_string(s) + - " to [::1]:" + std::to_string(phony_port) + - ". errno: " + std::to_string(errno); - ASSERT_TRUE(listen(s, 1) == 0) << "Failed to listen on socket " + - std::to_string(s) + - ". errno: " + std::to_string(errno); - sockets.push_back(s); - } - // Do a non-blocking accept followed by a close on all of those sockets. - // Do this in a separate loop to try to induce a time window to hit races. - for (size_t i = 0; i < sockets.size(); i++) { - gpr_log(GPR_DEBUG, "non-blocking accept then close on %d", sockets[i]); - if (accept(sockets[i], nullptr, nullptr)) { - // If e.g. a "shutdown" was called on this fd from another thread, - // then this accept call should fail with an unexpected error. - ASSERT_TRUE(errno == EAGAIN || errno == EWOULDBLOCK) - << "OpenAndCloseSocketsStressLoop accept on socket " + - std::to_string(sockets[i]) + - " failed in " - "an unexpected way. " - "errno: " + - std::to_string(errno) + - ". Socket use-after-close bugs are likely."; - } - ASSERT_TRUE(close(sockets[i]) == 0) - << "Failed to close socket: " + std::to_string(sockets[i]) + - ". errno: " + std::to_string(errno); - } - } -} -#endif - class ResultHandler : public grpc_core::Resolver::ResultHandler { public: static std::unique_ptr Create( @@ -664,18 +524,11 @@ TEST(ResolverComponentTest, TestResolvesRelevantRecords) { } TEST(ResolverComponentTest, TestResolvesRelevantRecordsWithConcurrentFdStress) { - // Start up background stress thread - int phony_port = grpc_pick_unused_port_or_die(); - gpr_event done_ev; - gpr_event_init(&done_ev); - std::thread socket_stress_thread(OpenAndCloseSocketsStressLoop, phony_port, - &done_ev); + grpc_core::testing::SocketUseAfterCloseDetector + socket_use_after_close_detector; // Run the resolver test RunResolvesRelevantRecordsTest(ResultHandler::Create, grpc_core::ChannelArgs()); - // Shutdown and join stress thread - gpr_event_set(&done_ev, reinterpret_cast(1)); - socket_stress_thread.join(); } TEST(ResolverComponentTest, TestDoesntCrashOrHangWith1MsTimeout) { From 83256760049d46ef4465b524d7fd056f7bf60623 Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Mon, 31 Jul 2023 12:40:14 -0700 Subject: [PATCH 088/205] [benchmark] Remove GRPC_EXPERIMENTS from Loadtest config (#33924) Cleanup suggested in #33909 --- ...rformance_gke_cxx_experiments_framework.sh | 2 +- .../run_tests/performance/loadtest_config.py | 1 - ...dtest_template_prebuilt_all_languages.yaml | 2 - ...est_template_prebuilt_cxx_experiments.yaml | 55 +++++++++++++++++++ 4 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 tools/run_tests/performance/templates/loadtest_template_prebuilt_cxx_experiments.yaml diff --git a/tools/internal_ci/linux/grpc_e2e_performance_gke_cxx_experiments_framework.sh b/tools/internal_ci/linux/grpc_e2e_performance_gke_cxx_experiments_framework.sh index 8cd8ccb834537..d711ab2a6d71b 100755 --- a/tools/internal_ci/linux/grpc_e2e_performance_gke_cxx_experiments_framework.sh +++ b/tools/internal_ci/linux/grpc_e2e_performance_gke_cxx_experiments_framework.sh @@ -90,7 +90,7 @@ buildConfigs() { local -r experiment="$3" shift 3 tools/run_tests/performance/loadtest_config.py "$@" \ - -t ./tools/run_tests/performance/templates/loadtest_template_prebuilt_all_languages.yaml \ + -t ./tools/run_tests/performance/templates/loadtest_template_prebuilt_cxx_experiments.yaml \ -s driver_pool="${DRIVER_POOL}" -s driver_image= \ -s client_pool="${pool}" -s server_pool="${pool}" \ -s big_query_table="${table}_${experiment}" -s timeout_seconds=900 \ diff --git a/tools/run_tests/performance/loadtest_config.py b/tools/run_tests/performance/loadtest_config.py index 923ffc02e0cee..0f5bd80cd388e 100755 --- a/tools/run_tests/performance/loadtest_config.py +++ b/tools/run_tests/performance/loadtest_config.py @@ -537,7 +537,6 @@ def main() -> None: "DRIVER_PORT": "${DRIVER_PORT}", "KILL_AFTER": "${KILL_AFTER}", "POD_TIMEOUT": "${POD_TIMEOUT}", - "grpc_experiment": "", } # The user can override the ignored variables above by passing them in as diff --git a/tools/run_tests/performance/templates/loadtest_template_prebuilt_all_languages.yaml b/tools/run_tests/performance/templates/loadtest_template_prebuilt_all_languages.yaml index 2b0a6bd358c76..fcc8170a72df8 100644 --- a/tools/run_tests/performance/templates/loadtest_template_prebuilt_all_languages.yaml +++ b/tools/run_tests/performance/templates/loadtest_template_prebuilt_all_languages.yaml @@ -46,7 +46,6 @@ spec: - args: - -c - | - GRPC_EXPERIMENTS="${grpc_experiment}" \ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \ /source/code/bazel-bin/test/cpp/qps/qps_worker \ --driver_port="${DRIVER_PORT}" @@ -195,7 +194,6 @@ spec: - args: - -c - | - GRPC_EXPERIMENTS="${grpc_experiment}" \ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \ /source/code/bazel-bin/test/cpp/qps/qps_worker \ --driver_port="${DRIVER_PORT}" --server_port=10010 diff --git a/tools/run_tests/performance/templates/loadtest_template_prebuilt_cxx_experiments.yaml b/tools/run_tests/performance/templates/loadtest_template_prebuilt_cxx_experiments.yaml new file mode 100644 index 0000000000000..a6f628be4d27f --- /dev/null +++ b/tools/run_tests/performance/templates/loadtest_template_prebuilt_cxx_experiments.yaml @@ -0,0 +1,55 @@ +# Template generated from load test configurations by loadtest_template.py. +# +# Configuration templates contain client and server configurations for multiple +# languages, and may contain template substitution keys. These templates are +# used to generate load test configurations by selecting clients and servers for +# the required languages. The source files for template generation may be load +# test configurations or load test configuration templates. Load test +# configuration generation is performed by loadtest_config.py. See documentation +# below: +# https://github.com/grpc/grpc/blob/master/tools/run_tests/performance/README.md +apiVersion: e2etest.grpc.io/v1 +kind: LoadTest +metadata: + name: prebuilt_all_languages +spec: + clients: + - language: cxx + pool: ${client_pool} + run: + - args: + - -c + - | + GRPC_EXPERIMENTS="${grpc_experiment}" \ + timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \ + /source/code/bazel-bin/test/cpp/qps/qps_worker \ + --driver_port="${DRIVER_PORT}" + command: + - bash + image: ${prebuilt_image_prefix}/cxx:${prebuilt_image_tag} + name: main + driver: + language: cxx + pool: ${driver_pool} + run: + - image: ${driver_image} + name: main + results: + bigQueryTable: ${big_query_table} + servers: + - language: cxx + pool: ${server_pool} + run: + - args: + - -c + - | + GRPC_EXPERIMENTS="${grpc_experiment}" \ + timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \ + /source/code/bazel-bin/test/cpp/qps/qps_worker \ + --driver_port="${DRIVER_PORT}" --server_port=10010 + command: + - bash + image: ${prebuilt_image_prefix}/cxx:${prebuilt_image_tag} + name: main + timeoutSeconds: ${timeout_seconds} + ttlSeconds: 86400 From 9de738d9e502248ca04ad0b40324420490649b43 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 31 Jul 2023 15:18:42 -0700 Subject: [PATCH 089/205] [promises] Tweak shutdown errors to match existing semantics (#33929) There are internal tests that depend on these semantics very precisely. --- src/core/lib/surface/server.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc index 264d8e9ba1cfa..ea406774cab6f 100644 --- a/src/core/lib/surface/server.cc +++ b/src/core/lib/surface/server.cc @@ -535,7 +535,7 @@ class Server::AllocatingRequestMatcherBatch call_info.initial_metadata, call_info.details); return Immediate(MatchResult(server(), cq_idx(), rc)); } else { - return Immediate(absl::InternalError("Server shutdown")); + return Immediate(absl::CancelledError("Server shutdown")); } } @@ -590,7 +590,7 @@ class Server::AllocatingRequestMatcherRegistered call_info.deadline, call_info.optional_payload); return Immediate(MatchResult(server(), cq_idx(), rc)); } else { - return Immediate(absl::InternalError("Server shutdown")); + return Immediate(absl::CancelledError("Server shutdown")); } } @@ -1293,11 +1293,6 @@ ArenaPromise Server::ChannelData::MakeCallPromise( grpc_channel_element* elem, CallArgs call_args, NextPromiseFactory) { auto* chand = static_cast(elem->channel_data); auto* server = chand->server_.get(); - if (server->ShutdownCalled()) { - return [] { - return ServerMetadataFromStatus(absl::InternalError("Server shutdown")); - }; - } absl::optional path = call_args.client_initial_metadata->Take(HttpPathMetadata()); if (!path.has_value()) { From 010a59b7fdeba77835df57a0d0756d8e2b6e2f55 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Mon, 31 Jul 2023 15:28:56 -0700 Subject: [PATCH 090/205] [keepalive] Allow server side keepalive_permit_without_calls setting to be overridden (#33917) Need the ability to override server-side keepalive permit without calls default without affecting client-side settings. --- .../chttp2/transport/chttp2_transport.cc | 10 ++++++---- src/core/lib/experiments/experiments.cc | 18 ++++++++++++++++++ src/core/lib/experiments/experiments.h | 7 ++++++- src/core/lib/experiments/experiments.yaml | 8 ++++++++ src/core/lib/experiments/rollouts.yaml | 2 ++ .../chttp2/ping_configuration_test.cc | 1 + 6 files changed, 41 insertions(+), 5 deletions(-) diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index 092fb6b86ceee..c205ba5ab7ff4 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -398,16 +398,18 @@ static void read_channel_args(grpc_chttp2_transport* t, channel_args.GetDurationFromIntMillis(GRPC_ARG_KEEPALIVE_TIMEOUT_MS) .value_or(t->is_client ? g_default_client_keepalive_timeout : g_default_server_keepalive_timeout)); - if (grpc_core::IsKeepaliveFixEnabled()) { + if (t->is_client) { t->keepalive_permit_without_calls = channel_args.GetBool(GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS) - .value_or(t->is_client + .value_or(grpc_core::IsKeepaliveFixEnabled() ? g_default_client_keepalive_permit_without_calls - : g_default_server_keepalive_permit_without_calls); + : false); } else { t->keepalive_permit_without_calls = channel_args.GetBool(GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS) - .value_or(false); + .value_or(grpc_core::IsKeepaliveServerFixEnabled() + ? g_default_server_keepalive_permit_without_calls + : false); } // Only send the prefered rx frame size http2 setting if we are instructed diff --git a/src/core/lib/experiments/experiments.cc b/src/core/lib/experiments/experiments.cc index 3d88430d9ab0b..c7b177071d037 100644 --- a/src/core/lib/experiments/experiments.cc +++ b/src/core/lib/experiments/experiments.cc @@ -97,6 +97,10 @@ const char* const description_keepalive_fix = "Allows overriding keepalive_permit_without_calls. Refer " "https://github.com/grpc/grpc/pull/33428 for more information."; const char* const additional_constraints_keepalive_fix = "{}"; +const char* const description_keepalive_server_fix = + "Allows overriding keepalive_permit_without_calls for servers. Refer " + "https://github.com/grpc/grpc/pull/33917 for more information."; +const char* const additional_constraints_keepalive_server_fix = "{}"; #ifdef NDEBUG const bool kDefaultForDebugOnly = false; #else @@ -152,6 +156,8 @@ const ExperimentMetadata g_experiment_metadata[] = { additional_constraints_unique_metadata_strings, false, true}, {"keepalive_fix", description_keepalive_fix, additional_constraints_keepalive_fix, false, false}, + {"keepalive_server_fix", description_keepalive_server_fix, + additional_constraints_keepalive_server_fix, false, false}, }; } // namespace grpc_core @@ -233,6 +239,10 @@ const char* const description_keepalive_fix = "Allows overriding keepalive_permit_without_calls. Refer " "https://github.com/grpc/grpc/pull/33428 for more information."; const char* const additional_constraints_keepalive_fix = "{}"; +const char* const description_keepalive_server_fix = + "Allows overriding keepalive_permit_without_calls for servers. Refer " + "https://github.com/grpc/grpc/pull/33917 for more information."; +const char* const additional_constraints_keepalive_server_fix = "{}"; #ifdef NDEBUG const bool kDefaultForDebugOnly = false; #else @@ -288,6 +298,8 @@ const ExperimentMetadata g_experiment_metadata[] = { additional_constraints_unique_metadata_strings, false, true}, {"keepalive_fix", description_keepalive_fix, additional_constraints_keepalive_fix, false, false}, + {"keepalive_server_fix", description_keepalive_server_fix, + additional_constraints_keepalive_server_fix, false, false}, }; } // namespace grpc_core @@ -369,6 +381,10 @@ const char* const description_keepalive_fix = "Allows overriding keepalive_permit_without_calls. Refer " "https://github.com/grpc/grpc/pull/33428 for more information."; const char* const additional_constraints_keepalive_fix = "{}"; +const char* const description_keepalive_server_fix = + "Allows overriding keepalive_permit_without_calls for servers. Refer " + "https://github.com/grpc/grpc/pull/33917 for more information."; +const char* const additional_constraints_keepalive_server_fix = "{}"; #ifdef NDEBUG const bool kDefaultForDebugOnly = false; #else @@ -424,6 +440,8 @@ const ExperimentMetadata g_experiment_metadata[] = { additional_constraints_unique_metadata_strings, false, true}, {"keepalive_fix", description_keepalive_fix, additional_constraints_keepalive_fix, false, false}, + {"keepalive_server_fix", description_keepalive_server_fix, + additional_constraints_keepalive_server_fix, false, false}, }; } // namespace grpc_core diff --git a/src/core/lib/experiments/experiments.h b/src/core/lib/experiments/experiments.h index c375a29c10932..3ccdd6f19f04d 100644 --- a/src/core/lib/experiments/experiments.h +++ b/src/core/lib/experiments/experiments.h @@ -90,6 +90,7 @@ inline bool IsCanaryClientPrivacyEnabled() { return false; } inline bool IsServerPrivacyEnabled() { return false; } inline bool IsUniqueMetadataStringsEnabled() { return false; } inline bool IsKeepaliveFixEnabled() { return false; } +inline bool IsKeepaliveServerFixEnabled() { return false; } #elif defined(GPR_WINDOWS) inline bool IsTcpFrameSizeTuningEnabled() { return false; } @@ -123,6 +124,7 @@ inline bool IsCanaryClientPrivacyEnabled() { return false; } inline bool IsServerPrivacyEnabled() { return false; } inline bool IsUniqueMetadataStringsEnabled() { return false; } inline bool IsKeepaliveFixEnabled() { return false; } +inline bool IsKeepaliveServerFixEnabled() { return false; } #else inline bool IsTcpFrameSizeTuningEnabled() { return false; } @@ -156,6 +158,7 @@ inline bool IsCanaryClientPrivacyEnabled() { return false; } inline bool IsServerPrivacyEnabled() { return false; } inline bool IsUniqueMetadataStringsEnabled() { return false; } inline bool IsKeepaliveFixEnabled() { return false; } +inline bool IsKeepaliveServerFixEnabled() { return false; } #endif #else @@ -209,8 +212,10 @@ inline bool IsServerPrivacyEnabled() { return IsExperimentEnabled(18); } inline bool IsUniqueMetadataStringsEnabled() { return IsExperimentEnabled(19); } #define GRPC_EXPERIMENT_IS_INCLUDED_KEEPALIVE_FIX inline bool IsKeepaliveFixEnabled() { return IsExperimentEnabled(20); } +#define GRPC_EXPERIMENT_IS_INCLUDED_KEEPALIVE_SERVER_FIX +inline bool IsKeepaliveServerFixEnabled() { return IsExperimentEnabled(21); } -constexpr const size_t kNumExperiments = 21; +constexpr const size_t kNumExperiments = 22; extern const ExperimentMetadata g_experiment_metadata[kNumExperiments]; #endif diff --git a/src/core/lib/experiments/experiments.yaml b/src/core/lib/experiments/experiments.yaml index 5edc89594b806..dcca2fbaedb40 100644 --- a/src/core/lib/experiments/experiments.yaml +++ b/src/core/lib/experiments/experiments.yaml @@ -166,3 +166,11 @@ owner: yashkt@google.com test_tags: [] allow_in_fuzzing_config: false +- name: keepalive_server_fix + description: + Allows overriding keepalive_permit_without_calls for servers. + Refer https://github.com/grpc/grpc/pull/33917 for more information. + expiry: 2023/09/07 + owner: yashkt@google.com + test_tags: [] + allow_in_fuzzing_config: false diff --git a/src/core/lib/experiments/rollouts.yaml b/src/core/lib/experiments/rollouts.yaml index dacf219bd7366..910a6a768b27e 100644 --- a/src/core/lib/experiments/rollouts.yaml +++ b/src/core/lib/experiments/rollouts.yaml @@ -90,3 +90,5 @@ default: false - name: keepalive_fix default: false +- name: keepalive_server_fix + default: false diff --git a/test/core/transport/chttp2/ping_configuration_test.cc b/test/core/transport/chttp2/ping_configuration_test.cc index 5bc12bddaa069..4b8395e34dc5b 100644 --- a/test/core/transport/chttp2/ping_configuration_test.cc +++ b/test/core/transport/chttp2/ping_configuration_test.cc @@ -175,6 +175,7 @@ int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); grpc::testing::TestEnvironment env(&argc, argv); grpc_core::ForceEnableExperiment("keepalive_fix", true); + grpc_core::ForceEnableExperiment("keepalive_server_fix", true); grpc_init(); auto ret = RUN_ALL_TESTS(); grpc_shutdown(); From c73e743637a2598c2fbb4e6297c2818b5858f4f7 Mon Sep 17 00:00:00 2001 From: Eugene Ostroukhov Date: Mon, 31 Jul 2023 17:04:22 -0700 Subject: [PATCH 091/205] [python][interop] Use python:3.9-slim as a baseimage (#33931) These are officially maintained images with minimal packages needed for running Python --- .dockerignore | 6 ++++++ .../tests_py3_only/interop/Dockerfile.client | 17 ++++++----------- .../tests_py3_only/interop/Dockerfile.server | 17 ++++++----------- 3 files changed, 18 insertions(+), 22 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000000..8cd0034b50ce9 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +bazel-bin +bazel-grpc +bazel-out +build +.cache +.git diff --git a/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.client b/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.client index 6bd6d4ce8b3c2..7f8d6118bb654 100644 --- a/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.client +++ b/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.client @@ -1,11 +1,6 @@ -FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc +FROM python:3.9-slim -RUN apt-get update -y && \ - apt-get install -y \ - build-essential \ - clang \ - python3 \ - python3-dev +RUN apt-get update -y && apt-get upgrade -y && apt-get install -y build-essential clang WORKDIR /workdir @@ -16,13 +11,13 @@ COPY . . RUN tools/bazel build -c dbg //src/python/grpcio_tests/tests_py3_only/interop:xds_interop_client RUN cp -rL /workdir/bazel-bin/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_client* /artifacts/ -FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc +FROM python:3.9-slim + COPY --from=0 /artifacts ./ +RUN apt-get update -y && apt-get upgrade -y + ENV GRPC_VERBOSITY="DEBUG" ENV GRPC_TRACE="xds_client,xds_resolver,xds_cluster_manager_lb,cds_lb,xds_cluster_resolver_lb,priority_lb,xds_cluster_impl_lb,weighted_target_lb,ring_hash_lb,outlier_detection_lb" -RUN apt-get update -y && apt-get install -y python3 -RUN ln -s /usr/bin/python3 /usr/bin/python - ENTRYPOINT ["/xds_interop_client"] diff --git a/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.server b/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.server index bc63f4ecd9fa0..75cd9b51bc69d 100644 --- a/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.server +++ b/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.server @@ -1,11 +1,6 @@ -FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc +FROM python:3.9-slim -RUN apt-get update -y && \ - apt-get install -y \ - build-essential \ - clang \ - python3 \ - python3-dev +RUN apt-get update -y && apt-get upgrade -y && apt-get install -y build-essential clang WORKDIR /workdir @@ -16,13 +11,13 @@ COPY . . RUN tools/bazel build -c dbg //src/python/grpcio_tests/tests_py3_only/interop:xds_interop_server RUN cp -rL /workdir/bazel-bin/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_server* /artifacts/ -FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc +FROM python:3.9-slim + COPY --from=0 /artifacts ./ +RUN apt-get update -y && apt-get upgrade -y + ENV GRPC_VERBOSITY="DEBUG" ENV GRPC_TRACE="xds_client,xds_resolver,xds_cluster_manager_lb,cds_lb,xds_cluster_resolver_lb,priority_lb,xds_cluster_impl_lb,weighted_target_lb" -RUN apt-get update -y && apt-get install -y python3 -RUN ln -s /usr/bin/python3 /usr/bin/python - ENTRYPOINT ["/xds_interop_server"] From 9aca06d38a4c914a48d2ae697af5b4b7748472ab Mon Sep 17 00:00:00 2001 From: Alisha Nanda Date: Mon, 31 Jul 2023 17:48:41 -0700 Subject: [PATCH 092/205] Revert "[c-ares DNS resolver] Fix file descriptor use-after-close bug when c-ares writes succeed but subsequent read fails" (#33934) Reverts grpc/grpc#33871 due to build failures in google3. Co-authored-by: Yijie Ma --- CMakeLists.txt | 1 - build_autogenerated.yaml | 2 - .../dns/c_ares/grpc_ares_ev_driver_posix.cc | 112 +--------- .../resolver/dns/c_ares/grpc_ares_wrapper.cc | 5 - .../resolver/dns/c_ares/grpc_ares_wrapper.h | 3 - test/core/util/BUILD | 28 --- .../util/socket_use_after_close_detector.cc | 199 ------------------ .../util/socket_use_after_close_detector.h | 56 ----- test/cpp/naming/BUILD | 1 - test/cpp/naming/cancel_ares_query_test.cc | 149 ++++++------- .../generate_resolver_component_tests.bzl | 1 - test/cpp/naming/resolver_component_test.cc | 153 +++++++++++++- 12 files changed, 220 insertions(+), 490 deletions(-) delete mode 100644 test/core/util/socket_use_after_close_detector.cc delete mode 100644 test/core/util/socket_use_after_close_detector.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 0392d45656177..fb8fda2c87950 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7661,7 +7661,6 @@ if(gRPC_BUILD_TESTS) add_executable(cancel_ares_query_test test/core/end2end/cq_verifier.cc test/core/util/fake_udp_and_tcp_server.cc - test/core/util/socket_use_after_close_detector.cc test/cpp/naming/cancel_ares_query_test.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index da1291c235383..4a8a34eec8efb 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -5495,11 +5495,9 @@ targets: headers: - test/core/end2end/cq_verifier.h - test/core/util/fake_udp_and_tcp_server.h - - test/core/util/socket_use_after_close_detector.h src: - test/core/end2end/cq_verifier.cc - test/core/util/fake_udp_and_tcp_server.cc - - test/core/util/socket_use_after_close_detector.cc - test/cpp/naming/cancel_ares_query_test.cc deps: - grpc++_test_config diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc index 7259e3e3b10c1..4f0813edccab3 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc @@ -17,36 +17,28 @@ // #include -#include "src/core/lib/iomgr/port.h" +#include +#include + +#include "absl/base/thread_annotations.h" +#include "src/core/lib/gprpp/sync.h" +#include "src/core/lib/iomgr/closure.h" +#include "src/core/lib/iomgr/error.h" +#include "src/core/lib/iomgr/iomgr_fwd.h" +#include "src/core/lib/iomgr/port.h" #if GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_ARES_EV_DRIVER) -#include +#include #include -#include -#include -#include - -#include -#include -#include -#include #include -#include "absl/base/thread_annotations.h" #include "absl/strings/str_cat.h" -#include - #include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h" #include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h" -#include "src/core/lib/gprpp/sync.h" -#include "src/core/lib/iomgr/closure.h" -#include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/ev_posix.h" -#include "src/core/lib/iomgr/iomgr_fwd.h" -#include "src/core/lib/iomgr/socket_utils_posix.h" namespace grpc_core { @@ -106,94 +98,12 @@ class GrpcPolledFdPosix : public GrpcPolledFd { class GrpcPolledFdFactoryPosix : public GrpcPolledFdFactory { public: - ~GrpcPolledFdFactoryPosix() override { - for (auto& fd : owned_fds_) { - close(fd); - } - } - GrpcPolledFd* NewGrpcPolledFdLocked( ares_socket_t as, grpc_pollset_set* driver_pollset_set) override { - auto insert_result = owned_fds_.insert(as); - GPR_ASSERT(insert_result.second); return new GrpcPolledFdPosix(as, driver_pollset_set); } - void ConfigureAresChannelLocked(ares_channel channel) override { - ares_set_socket_functions(channel, &kSockFuncs, this); - ares_set_socket_configure_callback( - channel, &GrpcPolledFdFactoryPosix::ConfigureSocket, nullptr); - } - - private: - /// Overridden socket API for c-ares - static ares_socket_t Socket(int af, int type, int protocol, - void* /*user_data*/) { - return socket(af, type, protocol); - } - - /// Overridden connect API for c-ares - static int Connect(ares_socket_t as, const struct sockaddr* target, - ares_socklen_t target_len, void* /*user_data*/) { - return connect(as, target, target_len); - } - - /// Overridden writev API for c-ares - static ares_ssize_t WriteV(ares_socket_t as, const struct iovec* iov, - int iovec_count, void* /*user_data*/) { - return writev(as, iov, iovec_count); - } - - /// Overridden recvfrom API for c-ares - static ares_ssize_t RecvFrom(ares_socket_t as, void* data, size_t data_len, - int flags, struct sockaddr* from, - ares_socklen_t* from_len, void* /*user_data*/) { - return recvfrom(as, data, data_len, flags, from, from_len); - } - - /// Overridden close API for c-ares - static int Close(ares_socket_t as, void* user_data) { - GrpcPolledFdFactoryPosix* self = - static_cast(user_data); - if (self->owned_fds_.find(as) == self->owned_fds_.end()) { - // c-ares owns this fd, grpc has never seen it - return close(as); - } - return 0; - } - - /// Because we're using socket API overrides, c-ares won't - /// perform its typical configuration on the socket. See - /// https://github.com/c-ares/c-ares/blob/bad62225b7f6b278b92e8e85a255600b629ef517/src/lib/ares_process.c#L1018. - /// So we use the configure socket callback override and copy default - /// settings that c-ares would normally apply on posix platforms: - /// - non-blocking - /// - cloexec flag - /// - disable nagle */ - static int ConfigureSocket(ares_socket_t fd, int type, void* /*user_data*/) { - grpc_error_handle err; - err = grpc_set_socket_nonblocking(fd, true); - if (!err.ok()) return -1; - err = grpc_set_socket_cloexec(fd, true); - if (!err.ok()) return -1; - if (type == SOCK_STREAM) { - err = grpc_set_socket_low_latency(fd, true); - if (!err.ok()) return -1; - } - return 0; - } - - const struct ares_socket_functions kSockFuncs = { - &GrpcPolledFdFactoryPosix::Socket /* socket */, - &GrpcPolledFdFactoryPosix::Close /* close */, - &GrpcPolledFdFactoryPosix::Connect /* connect */, - &GrpcPolledFdFactoryPosix::RecvFrom /* recvfrom */, - &GrpcPolledFdFactoryPosix::WriteV /* writev */, - }; - - // fds that are used/owned by grpc - we (grpc) will close them rather than - // c-ares - std::unordered_set owned_fds_; + void ConfigureAresChannelLocked(ares_channel /*channel*/) override {} }; std::unique_ptr NewGrpcPolledFdFactory(Mutex* /* mu */) { diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc index 3032bfda7970a..a088c114585b8 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc @@ -515,8 +515,6 @@ static void noop_inject_channel_config(ares_channel* /*channel*/) {} void (*grpc_ares_test_only_inject_config)(ares_channel* channel) = noop_inject_channel_config; -bool g_grpc_ares_test_only_force_tcp = false; - grpc_error_handle grpc_ares_ev_driver_create_locked( grpc_ares_ev_driver** ev_driver, grpc_pollset_set* pollset_set, int query_timeout_ms, grpc_ares_request* request) @@ -525,9 +523,6 @@ grpc_error_handle grpc_ares_ev_driver_create_locked( ares_options opts; memset(&opts, 0, sizeof(opts)); opts.flags |= ARES_FLAG_STAYOPEN; - if (g_grpc_ares_test_only_force_tcp) { - opts.flags |= ARES_FLAG_USEVC; - } int status = ares_init_options(&(*ev_driver)->channel, &opts, ARES_OPT_FLAGS); grpc_ares_test_only_inject_config(&(*ev_driver)->channel); GRPC_CARES_TRACE_LOG("request:%p grpc_ares_ev_driver_create_locked", request); diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h index 5970e131cccfc..69f52bc3df11b 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h @@ -133,7 +133,4 @@ void grpc_cares_wrapper_address_sorting_sort( // Exposed in this header for C-core tests only extern void (*grpc_ares_test_only_inject_config)(ares_channel* channel); -// Exposed in this header for C-core tests only -extern bool g_grpc_ares_test_only_force_tcp; - #endif // GRPC_SRC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_WRAPPER_H diff --git a/test/core/util/BUILD b/test/core/util/BUILD index bda52932689dc..581371b05f74f 100644 --- a/test/core/util/BUILD +++ b/test/core/util/BUILD @@ -363,34 +363,6 @@ grpc_cc_library( ], ) -grpc_cc_library( - name = "socket_use_after_close_detector", - srcs = ["socket_use_after_close_detector.cc"], - hdrs = ["socket_use_after_close_detector.h"], - external_deps = ["gtest"], - language = "C++", - deps = [ - "grpc_test_util", - "//:gpr", - "//:grpc", - "//src/core:grpc_sockaddr", - ], -) - -grpc_cc_library( - name = "socket_use_after_close_detector_unsecure", - srcs = ["socket_use_after_close_detector.cc"], - hdrs = ["socket_use_after_close_detector.h"], - external_deps = ["gtest"], - language = "C++", - deps = [ - "grpc_test_util_unsecure", - "//:gpr", - "//:grpc", - "//src/core:grpc_sockaddr", - ], -) - grpc_cc_library( name = "build", srcs = ["build.cc"], diff --git a/test/core/util/socket_use_after_close_detector.cc b/test/core/util/socket_use_after_close_detector.cc deleted file mode 100644 index 1deaa67831d03..0000000000000 --- a/test/core/util/socket_use_after_close_detector.cc +++ /dev/null @@ -1,199 +0,0 @@ -// -// -// Copyright 2017 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// - -#include - -#include "test/core/util/socket_use_after_close_detector.h" - -#include -#include -#include - -// IWYU pragma: no_include -// IWYU pragma: no_include - -#include -#include -#include -#include -#include - -#include "gtest/gtest.h" - -#include - -#include "src/core/lib/iomgr/sockaddr.h" -#include "test/core/util/port.h" - -// TODO(unknown): pull in different headers when enabling this -// test on windows. Also set BAD_SOCKET_RETURN_VAL -// to INVALID_SOCKET on windows. -#ifdef GPR_WINDOWS -#include "src/core/lib/iomgr/socket_windows.h" -#include "src/core/lib/iomgr/tcp_windows.h" - -#define BAD_SOCKET_RETURN_VAL INVALID_SOCKET -#else -#define BAD_SOCKET_RETURN_VAL (-1) -#endif - -namespace { - -#ifdef GPR_WINDOWS -void OpenAndCloseSocketsStressLoop(int port, gpr_event* done_ev) { - sockaddr_in6 addr; - memset(&addr, 0, sizeof(addr)); - addr.sin6_family = AF_INET6; - addr.sin6_port = htons(port); - ((char*)&addr.sin6_addr)[15] = 1; - for (;;) { - if (gpr_event_get(done_ev)) { - return; - } - std::vector sockets; - for (size_t i = 0; i < 50; i++) { - SOCKET s = WSASocket(AF_INET6, SOCK_STREAM, IPPROTO_TCP, nullptr, 0, - WSA_FLAG_OVERLAPPED); - ASSERT_TRUE(s != BAD_SOCKET_RETURN_VAL) - << "Failed to create TCP ipv6 socket"; - char val = 1; - ASSERT_TRUE(setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) != - SOCKET_ERROR) - << "Failed to set socketopt reuseaddr. WSA error: " + - std::to_string(WSAGetLastError()); - ASSERT_TRUE(grpc_tcp_set_non_block(s) == absl::OkStatus()) - << "Failed to set socket non-blocking"; - ASSERT_TRUE(bind(s, (const sockaddr*)&addr, sizeof(addr)) != SOCKET_ERROR) - << "Failed to bind socket " + std::to_string(s) + - " to [::1]:" + std::to_string(port) + - ". WSA error: " + std::to_string(WSAGetLastError()); - ASSERT_TRUE(listen(s, 1) != SOCKET_ERROR) - << "Failed to listen on socket " + std::to_string(s) + - ". WSA error: " + std::to_string(WSAGetLastError()); - sockets.push_back(s); - } - // Do a non-blocking accept followed by a close on all of those sockets. - // Do this in a separate loop to try to induce a time window to hit races. - for (size_t i = 0; i < sockets.size(); i++) { - ASSERT_TRUE(accept(sockets[i], nullptr, nullptr) == INVALID_SOCKET) - << "Accept on phony socket unexpectedly accepted actual connection."; - ASSERT_TRUE(WSAGetLastError() == WSAEWOULDBLOCK) - << "OpenAndCloseSocketsStressLoop accept on socket " + - std::to_string(sockets[i]) + - " failed in " - "an unexpected way. " - "WSA error: " + - std::to_string(WSAGetLastError()) + - ". Socket use-after-close bugs are likely."; - ASSERT_TRUE(closesocket(sockets[i]) != SOCKET_ERROR) - << "Failed to close socket: " + std::to_string(sockets[i]) + - ". WSA error: " + std::to_string(WSAGetLastError()); - } - } - return; -} -#else -void OpenAndCloseSocketsStressLoop(int port, gpr_event* done_ev) { - // The goal of this loop is to catch socket - // "use after close" bugs within the c-ares resolver by acting - // like some separate thread doing I/O. - // It's goal is to try to hit race conditions whereby: - // 1) The c-ares resolver closes a socket. - // 2) This loop opens a socket with (coincidentally) the same handle. - // 3) the c-ares resolver mistakenly uses that same socket without - // realizing that its closed. - // 4) This loop performs an operation on that socket that should - // succeed but instead fails because of what the c-ares - // resolver did in the meantime. - sockaddr_in6 addr; - memset(&addr, 0, sizeof(addr)); - addr.sin6_family = AF_INET6; - addr.sin6_port = htons(port); - (reinterpret_cast(&addr.sin6_addr))[15] = 1; - for (;;) { - if (gpr_event_get(done_ev)) { - return; - } - std::vector sockets; - // First open a bunch of sockets, bind and listen - // '50' is an arbitrary number that, experimentally, - // has a good chance of catching bugs. - for (size_t i = 0; i < 50; i++) { - int s = socket(AF_INET6, SOCK_STREAM, 0); - int val = 1; - ASSERT_TRUE(setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &val, sizeof(val)) == - 0) - << "Failed to set socketopt reuseport"; - ASSERT_TRUE(setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) == - 0) - << "Failed to set socket reuseaddr"; - ASSERT_TRUE(fcntl(s, F_SETFL, O_NONBLOCK) == 0) - << "Failed to set socket non-blocking"; - ASSERT_TRUE(s != BAD_SOCKET_RETURN_VAL) - << "Failed to create TCP ipv6 socket"; - ASSERT_TRUE(bind(s, (const sockaddr*)&addr, sizeof(addr)) == 0) - << "Failed to bind socket " + std::to_string(s) + - " to [::1]:" + std::to_string(port) + - ". errno: " + std::to_string(errno); - ASSERT_TRUE(listen(s, 1) == 0) << "Failed to listen on socket " + - std::to_string(s) + - ". errno: " + std::to_string(errno); - sockets.push_back(s); - } - // Do a non-blocking accept followed by a close on all of those sockets. - // Do this in a separate loop to try to induce a time window to hit races. - for (size_t i = 0; i < sockets.size(); i++) { - if (accept(sockets[i], nullptr, nullptr)) { - // If e.g. a "shutdown" was called on this fd from another thread, - // then this accept call should fail with an unexpected error. - ASSERT_TRUE(errno == EAGAIN || errno == EWOULDBLOCK) - << "OpenAndCloseSocketsStressLoop accept on socket " + - std::to_string(sockets[i]) + - " failed in " - "an unexpected way. " - "errno: " + - std::to_string(errno) + - ". Socket use-after-close bugs are likely."; - } - ASSERT_TRUE(close(sockets[i]) == 0) - << "Failed to close socket: " + std::to_string(sockets[i]) + - ". errno: " + std::to_string(errno); - } - } -} -#endif - -} // namespace - -namespace grpc_core { -namespace testing { - -SocketUseAfterCloseDetector::SocketUseAfterCloseDetector() { - int port = grpc_pick_unused_port_or_die(); - gpr_event_init(&done_ev_); - thread_ = std::make_unique(OpenAndCloseSocketsStressLoop, port, - &done_ev_); -} - -SocketUseAfterCloseDetector::~SocketUseAfterCloseDetector() { - gpr_event_set(&done_ev_, reinterpret_cast(1)); - thread_->join(); -} - -} // namespace testing -} // namespace grpc_core diff --git a/test/core/util/socket_use_after_close_detector.h b/test/core/util/socket_use_after_close_detector.h deleted file mode 100644 index 37c6773b28a77..0000000000000 --- a/test/core/util/socket_use_after_close_detector.h +++ /dev/null @@ -1,56 +0,0 @@ -// -// -// Copyright 2017 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// - -#ifndef GRPC_TEST_CORE_UTIL_SOCKET_USE_AFTER_CLOSE_DETECTOR_H -#define GRPC_TEST_CORE_UTIL_SOCKET_USE_AFTER_CLOSE_DETECTOR_H - -#include - -#include -#include - -#include - -namespace grpc_core { -namespace testing { - -// This class is meant to detect file descriptor use-after-close -// bugs occuring somewhere in the program while the object is in live. -// The implementation currently uses a background thread to open -// and close sockets in a loop, catching socket use-after-close bugs -// by watching them manifest as unexpected socket operation failures. -// -// Note: this will not give false positives but may give false negatives. -// That said this seems to be fairly reliable at finding use-after-close -// bugs, at least on linux, because of fd handles being quickly reused. -// For example this was able to catch the use-after-close bug from -// https://github.com/grpc/grpc/pull/33871 "almost every time". -class SocketUseAfterCloseDetector { - public: - SocketUseAfterCloseDetector(); - ~SocketUseAfterCloseDetector(); - - private: - std::unique_ptr thread_; - gpr_event done_ev_; -}; - -} // namespace testing -} // namespace grpc_core - -#endif // GRPC_TEST_CORE_UTIL_SOCKET_USE_AFTER_CLOSE_DETECTOR_H diff --git a/test/cpp/naming/BUILD b/test/cpp/naming/BUILD index 4c5a2a2e8b1e0..462c0c74e33bf 100644 --- a/test/cpp/naming/BUILD +++ b/test/cpp/naming/BUILD @@ -47,7 +47,6 @@ grpc_cc_test( "//test/core/end2end:cq_verifier", "//test/core/util:fake_udp_and_tcp_server", "//test/core/util:grpc_test_util", - "//test/core/util:socket_use_after_close_detector", "//test/cpp/util:test_config", "//test/cpp/util:test_util", ], diff --git a/test/cpp/naming/cancel_ares_query_test.cc b/test/cpp/naming/cancel_ares_query_test.cc index 187a206c0b0c4..1e2f6287941ff 100644 --- a/test/cpp/naming/cancel_ares_query_test.cc +++ b/test/cpp/naming/cancel_ares_query_test.cc @@ -33,7 +33,6 @@ #include #include -#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h" #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/config/config_vars.h" #include "src/core/lib/config/core_configuration.h" @@ -55,7 +54,6 @@ #include "test/core/util/cmdline.h" #include "test/core/util/fake_udp_and_tcp_server.h" #include "test/core/util/port.h" -#include "test/core/util/socket_use_after_close_detector.h" #include "test/core/util/test_config.h" #include "test/cpp/util/test_config.h" @@ -279,23 +277,71 @@ TEST_F(CancelDuringAresQuery, TestFdsAreDeletedFromPollsetSet) { grpc_pollset_set_destroy(fake_other_pollset_set); } -std::string kFakeName = "dont-care-since-wont-be-resolved.test.com:1234"; +// Settings for TestCancelDuringActiveQuery test +typedef enum { + NONE, + SHORT, + ZERO, +} cancellation_test_query_timeout_setting; void TestCancelDuringActiveQuery( - grpc_status_code expected_status_code, - absl::string_view expected_error_message_substring, - gpr_timespec rpc_deadline, int dns_query_timeout_ms, - int fake_dns_server_port) { + cancellation_test_query_timeout_setting query_timeout_setting) { + // Start up fake non responsive DNS server + grpc_core::testing::FakeUdpAndTcpServer fake_dns_server( + grpc_core::testing::FakeUdpAndTcpServer::AcceptMode:: + kWaitForClientToSendFirstBytes, + grpc_core::testing::FakeUdpAndTcpServer::CloseSocketUponCloseFromPeer); // Create a call that will try to use the fake DNS server + std::string name = "dont-care-since-wont-be-resolved.test.com:1234"; std::string client_target = - absl::StrFormat("dns://[::1]:%d/%s", fake_dns_server_port, kFakeName); + absl::StrFormat("dns://[::1]:%d/%s", fake_dns_server.port(), name); + gpr_log(GPR_DEBUG, "TestCancelActiveDNSQuery. query timeout setting: %d", + query_timeout_setting); grpc_channel_args* client_args = nullptr; - if (dns_query_timeout_ms >= 0) { + grpc_status_code expected_status_code = GRPC_STATUS_OK; + std::string expected_error_message_substring; + gpr_timespec rpc_deadline; + if (query_timeout_setting == NONE) { + // The RPC deadline should go off well before the DNS resolution + // timeout fires. + expected_status_code = GRPC_STATUS_DEADLINE_EXCEEDED; + // use default DNS resolution timeout (which is over one minute). + client_args = nullptr; + rpc_deadline = grpc_timeout_milliseconds_to_deadline(100); + } else if (query_timeout_setting == SHORT) { + // The DNS resolution timeout should fire well before the + // RPC's deadline expires. + expected_status_code = GRPC_STATUS_UNAVAILABLE; + if (grpc_core::IsEventEngineDnsEnabled()) { + expected_error_message_substring = + absl::StrCat("errors resolving ", name); + } else { + expected_error_message_substring = + absl::StrCat("DNS resolution failed for ", name); + } + grpc_arg arg; + arg.type = GRPC_ARG_INTEGER; + arg.key = const_cast(GRPC_ARG_DNS_ARES_QUERY_TIMEOUT_MS); + arg.value.integer = + 1; // Set this shorter than the call deadline so that it goes off. + client_args = grpc_channel_args_copy_and_add(nullptr, &arg, 1); + // Set the deadline high enough such that if we hit this and get + // a deadline exceeded status code, then we are confident that there's + // a bug causing cancellation of DNS resolutions to not happen in a timely + // manner. + rpc_deadline = grpc_timeout_seconds_to_deadline(10); + } else if (query_timeout_setting == ZERO) { + // The RPC deadline should go off well before the DNS resolution + // timeout fires. + expected_status_code = GRPC_STATUS_DEADLINE_EXCEEDED; grpc_arg arg; arg.type = GRPC_ARG_INTEGER; arg.key = const_cast(GRPC_ARG_DNS_ARES_QUERY_TIMEOUT_MS); - arg.value.integer = dns_query_timeout_ms; + arg.value.integer = 0; // Set this to zero to disable query timeouts. client_args = grpc_channel_args_copy_and_add(nullptr, &arg, 1); + rpc_deadline = grpc_timeout_milliseconds_to_deadline(100); + } else { + abort(); } grpc_channel_credentials* creds = grpc_insecure_credentials_create(); grpc_channel* client = @@ -367,96 +413,19 @@ void TestCancelDuringActiveQuery( TEST_F(CancelDuringAresQuery, TestHitDeadlineAndDestroyChannelDuringAresResolutionIsGraceful) { - grpc_core::testing::SocketUseAfterCloseDetector - socket_use_after_close_detector; - grpc_core::testing::FakeUdpAndTcpServer fake_dns_server( - grpc_core::testing::FakeUdpAndTcpServer::AcceptMode:: - kWaitForClientToSendFirstBytes, - grpc_core::testing::FakeUdpAndTcpServer::CloseSocketUponCloseFromPeer); - grpc_status_code expected_status_code = GRPC_STATUS_DEADLINE_EXCEEDED; - // The RPC deadline should go off well before the DNS resolution - // timeout fires. - gpr_timespec rpc_deadline = grpc_timeout_milliseconds_to_deadline(100); - int dns_query_timeout_ms = -1; // don't set query timeout - TestCancelDuringActiveQuery( - expected_status_code, "" /* expected error message substring */, - rpc_deadline, dns_query_timeout_ms, fake_dns_server.port()); + TestCancelDuringActiveQuery(NONE /* don't set query timeouts */); } TEST_F( CancelDuringAresQuery, TestHitDeadlineAndDestroyChannelDuringAresResolutionWithQueryTimeoutIsGraceful) { - grpc_core::testing::SocketUseAfterCloseDetector - socket_use_after_close_detector; - grpc_core::testing::FakeUdpAndTcpServer fake_dns_server( - grpc_core::testing::FakeUdpAndTcpServer::AcceptMode:: - kWaitForClientToSendFirstBytes, - grpc_core::testing::FakeUdpAndTcpServer::CloseSocketUponCloseFromPeer); - grpc_status_code expected_status_code = GRPC_STATUS_UNAVAILABLE; - std::string expected_error_message_substring; - if (grpc_core::IsEventEngineDnsEnabled()) { - expected_error_message_substring = - absl::StrCat("errors resolving ", kFakeName); - } else { - expected_error_message_substring = - absl::StrCat("DNS resolution failed for ", kFakeName); - } - // The DNS resolution timeout should fire well before the - // RPC's deadline expires. - gpr_timespec rpc_deadline = grpc_timeout_seconds_to_deadline(10); - int dns_query_timeout_ms = 1; - TestCancelDuringActiveQuery(expected_status_code, - expected_error_message_substring, rpc_deadline, - dns_query_timeout_ms, fake_dns_server.port()); + TestCancelDuringActiveQuery(SHORT /* set short query timeout */); } TEST_F( CancelDuringAresQuery, TestHitDeadlineAndDestroyChannelDuringAresResolutionWithZeroQueryTimeoutIsGraceful) { - grpc_core::testing::SocketUseAfterCloseDetector - socket_use_after_close_detector; - grpc_core::testing::FakeUdpAndTcpServer fake_dns_server( - grpc_core::testing::FakeUdpAndTcpServer::AcceptMode:: - kWaitForClientToSendFirstBytes, - grpc_core::testing::FakeUdpAndTcpServer::CloseSocketUponCloseFromPeer); - grpc_status_code expected_status_code = GRPC_STATUS_DEADLINE_EXCEEDED; - // The RPC deadline should go off well before the DNS resolution - // timeout fires. - gpr_timespec rpc_deadline = grpc_timeout_milliseconds_to_deadline(100); - int dns_query_timeout_ms = 0; // disable query timeouts - TestCancelDuringActiveQuery( - expected_status_code, "" /* expected error message substring */, - rpc_deadline, dns_query_timeout_ms, fake_dns_server.port()); -} - -TEST_F(CancelDuringAresQuery, TestQueryFailsBecauseTcpServerClosesSocket) { - grpc_core::testing::SocketUseAfterCloseDetector - socket_use_after_close_detector; - // Use a fake TCP server that immediately closes the socket and causes - // c-ares to pick up a socket read error, while the previous socket - // connect/writes succeeded. Meanwhile, force c-ares to only use TCP. - // The goal is to hit a socket use-after-close bug described in - // https://github.com/grpc/grpc/pull/33871. - grpc_core::testing::FakeUdpAndTcpServer fake_dns_server( - grpc_core::testing::FakeUdpAndTcpServer::AcceptMode:: - kWaitForClientToSendFirstBytes, - grpc_core::testing::FakeUdpAndTcpServer:: - CloseSocketUponReceivingBytesFromPeer); - // TODO(yijiem): make this test work with the EE DNS resolver by supporting - // this test flag to force TCP in the EE DNS resolver. - if (grpc_core::IsEventEngineDnsEnabled()) return; - g_grpc_ares_test_only_force_tcp = true; - grpc_status_code expected_status_code = GRPC_STATUS_UNAVAILABLE; - std::string expected_error_message_substring = - absl::StrCat("DNS resolution failed for ", kFakeName); - // Don't really care about the deadline - we should quickly hit a DNS - // resolution failure. - gpr_timespec rpc_deadline = grpc_timeout_seconds_to_deadline(100); - int dns_query_timeout_ms = -1; // don't set query timeout - TestCancelDuringActiveQuery(expected_status_code, - expected_error_message_substring, rpc_deadline, - dns_query_timeout_ms, fake_dns_server.port()); - g_grpc_ares_test_only_force_tcp = false; + TestCancelDuringActiveQuery(ZERO /* disable query timeouts */); } } // namespace diff --git a/test/cpp/naming/generate_resolver_component_tests.bzl b/test/cpp/naming/generate_resolver_component_tests.bzl index a91bc32649b13..edd9c4e40e36a 100755 --- a/test/cpp/naming/generate_resolver_component_tests.bzl +++ b/test/cpp/naming/generate_resolver_component_tests.bzl @@ -59,7 +59,6 @@ def generate_resolver_component_tests(): "//test/cpp/util:test_util%s" % unsecure_build_config_suffix, "//test/core/util:grpc_test_util%s" % unsecure_build_config_suffix, "//test/core/util:fake_udp_and_tcp_server%s" % unsecure_build_config_suffix, - "//test/core/util:socket_use_after_close_detector%s" % unsecure_build_config_suffix, "//:grpc++%s" % unsecure_build_config_suffix, "//:grpc%s" % unsecure_build_config_suffix, "//:gpr", diff --git a/test/cpp/naming/resolver_component_test.cc b/test/cpp/naming/resolver_component_test.cc index 69a19c9d90fe5..7fe90b704e5bf 100644 --- a/test/cpp/naming/resolver_component_test.cc +++ b/test/cpp/naming/resolver_component_test.cc @@ -64,11 +64,23 @@ #include "src/core/lib/resolver/server_address.h" #include "test/core/util/fake_udp_and_tcp_server.h" #include "test/core/util/port.h" -#include "test/core/util/socket_use_after_close_detector.h" #include "test/core/util/test_config.h" #include "test/cpp/util/subprocess.h" #include "test/cpp/util/test_config.h" +// TODO(unknown): pull in different headers when enabling this +// test on windows. Also set BAD_SOCKET_RETURN_VAL +// to INVALID_SOCKET on windows. +#ifdef GPR_WINDOWS +#include "src/core/lib/iomgr/sockaddr_windows.h" +#include "src/core/lib/iomgr/socket_windows.h" +#include "src/core/lib/iomgr/tcp_windows.h" +#define BAD_SOCKET_RETURN_VAL INVALID_SOCKET +#else +#include "src/core/lib/iomgr/sockaddr_posix.h" +#define BAD_SOCKET_RETURN_VAL (-1) +#endif + using ::grpc_event_engine::experimental::GetDefaultEventEngine; using std::vector; using testing::UnorderedElementsAreArray; @@ -291,6 +303,134 @@ void CheckLBPolicyResultLocked(const grpc_core::ChannelArgs channel_args, } } +#ifdef GPR_WINDOWS +void OpenAndCloseSocketsStressLoop(int phony_port, gpr_event* done_ev) { + sockaddr_in6 addr; + memset(&addr, 0, sizeof(addr)); + addr.sin6_family = AF_INET6; + addr.sin6_port = htons(phony_port); + ((char*)&addr.sin6_addr)[15] = 1; + for (;;) { + if (gpr_event_get(done_ev)) { + return; + } + std::vector sockets; + for (size_t i = 0; i < 50; i++) { + SOCKET s = WSASocket(AF_INET6, SOCK_STREAM, IPPROTO_TCP, nullptr, 0, + WSA_FLAG_OVERLAPPED); + ASSERT_TRUE(s != BAD_SOCKET_RETURN_VAL) + << "Failed to create TCP ipv6 socket"; + gpr_log(GPR_DEBUG, "Opened socket: %d", s); + char val = 1; + ASSERT_TRUE(setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) != + SOCKET_ERROR) + << "Failed to set socketopt reuseaddr. WSA error: " + + std::to_string(WSAGetLastError()); + ASSERT_TRUE(grpc_tcp_set_non_block(s) == absl::OkStatus()) + << "Failed to set socket non-blocking"; + ASSERT_TRUE(bind(s, (const sockaddr*)&addr, sizeof(addr)) != SOCKET_ERROR) + << "Failed to bind socket " + std::to_string(s) + + " to [::1]:" + std::to_string(phony_port) + + ". WSA error: " + std::to_string(WSAGetLastError()); + ASSERT_TRUE(listen(s, 1) != SOCKET_ERROR) + << "Failed to listen on socket " + std::to_string(s) + + ". WSA error: " + std::to_string(WSAGetLastError()); + sockets.push_back(s); + } + // Do a non-blocking accept followed by a close on all of those sockets. + // Do this in a separate loop to try to induce a time window to hit races. + for (size_t i = 0; i < sockets.size(); i++) { + gpr_log(GPR_DEBUG, "non-blocking accept then close on %d", sockets[i]); + ASSERT_TRUE(accept(sockets[i], nullptr, nullptr) == INVALID_SOCKET) + << "Accept on phony socket unexpectedly accepted actual connection."; + ASSERT_TRUE(WSAGetLastError() == WSAEWOULDBLOCK) + << "OpenAndCloseSocketsStressLoop accept on socket " + + std::to_string(sockets[i]) + + " failed in " + "an unexpected way. " + "WSA error: " + + std::to_string(WSAGetLastError()) + + ". Socket use-after-close bugs are likely."; + ASSERT_TRUE(closesocket(sockets[i]) != SOCKET_ERROR) + << "Failed to close socket: " + std::to_string(sockets[i]) + + ". WSA error: " + std::to_string(WSAGetLastError()); + } + } + return; +} +#else +void OpenAndCloseSocketsStressLoop(int phony_port, gpr_event* done_ev) { + // The goal of this loop is to catch socket + // "use after close" bugs within the c-ares resolver by acting + // like some separate thread doing I/O. + // It's goal is to try to hit race conditions whereby: + // 1) The c-ares resolver closes a socket. + // 2) This loop opens a socket with (coincidentally) the same handle. + // 3) the c-ares resolver mistakenly uses that same socket without + // realizing that its closed. + // 4) This loop performs an operation on that socket that should + // succeed but instead fails because of what the c-ares + // resolver did in the meantime. + sockaddr_in6 addr; + memset(&addr, 0, sizeof(addr)); + addr.sin6_family = AF_INET6; + addr.sin6_port = htons(phony_port); + (reinterpret_cast(&addr.sin6_addr))[15] = 1; + for (;;) { + if (gpr_event_get(done_ev)) { + return; + } + std::vector sockets; + // First open a bunch of sockets, bind and listen + // '50' is an arbitrary number that, experimentally, + // has a good chance of catching bugs. + for (size_t i = 0; i < 50; i++) { + int s = socket(AF_INET6, SOCK_STREAM, 0); + int val = 1; + ASSERT_TRUE(setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &val, sizeof(val)) == + 0) + << "Failed to set socketopt reuseport"; + ASSERT_TRUE(setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) == + 0) + << "Failed to set socket reuseaddr"; + ASSERT_TRUE(fcntl(s, F_SETFL, O_NONBLOCK) == 0) + << "Failed to set socket non-blocking"; + ASSERT_TRUE(s != BAD_SOCKET_RETURN_VAL) + << "Failed to create TCP ipv6 socket"; + gpr_log(GPR_DEBUG, "Opened fd: %d", s); + ASSERT_TRUE(bind(s, (const sockaddr*)&addr, sizeof(addr)) == 0) + << "Failed to bind socket " + std::to_string(s) + + " to [::1]:" + std::to_string(phony_port) + + ". errno: " + std::to_string(errno); + ASSERT_TRUE(listen(s, 1) == 0) << "Failed to listen on socket " + + std::to_string(s) + + ". errno: " + std::to_string(errno); + sockets.push_back(s); + } + // Do a non-blocking accept followed by a close on all of those sockets. + // Do this in a separate loop to try to induce a time window to hit races. + for (size_t i = 0; i < sockets.size(); i++) { + gpr_log(GPR_DEBUG, "non-blocking accept then close on %d", sockets[i]); + if (accept(sockets[i], nullptr, nullptr)) { + // If e.g. a "shutdown" was called on this fd from another thread, + // then this accept call should fail with an unexpected error. + ASSERT_TRUE(errno == EAGAIN || errno == EWOULDBLOCK) + << "OpenAndCloseSocketsStressLoop accept on socket " + + std::to_string(sockets[i]) + + " failed in " + "an unexpected way. " + "errno: " + + std::to_string(errno) + + ". Socket use-after-close bugs are likely."; + } + ASSERT_TRUE(close(sockets[i]) == 0) + << "Failed to close socket: " + std::to_string(sockets[i]) + + ". errno: " + std::to_string(errno); + } + } +} +#endif + class ResultHandler : public grpc_core::Resolver::ResultHandler { public: static std::unique_ptr Create( @@ -524,11 +664,18 @@ TEST(ResolverComponentTest, TestResolvesRelevantRecords) { } TEST(ResolverComponentTest, TestResolvesRelevantRecordsWithConcurrentFdStress) { - grpc_core::testing::SocketUseAfterCloseDetector - socket_use_after_close_detector; + // Start up background stress thread + int phony_port = grpc_pick_unused_port_or_die(); + gpr_event done_ev; + gpr_event_init(&done_ev); + std::thread socket_stress_thread(OpenAndCloseSocketsStressLoop, phony_port, + &done_ev); // Run the resolver test RunResolvesRelevantRecordsTest(ResultHandler::Create, grpc_core::ChannelArgs()); + // Shutdown and join stress thread + gpr_event_set(&done_ev, reinterpret_cast(1)); + socket_stress_thread.join(); } TEST(ResolverComponentTest, TestDoesntCrashOrHangWith1MsTimeout) { From cd85d7edf294323201a0bb7ed107b7a94511685b Mon Sep 17 00:00:00 2001 From: Hannah Shi Date: Tue, 1 Aug 2023 08:49:05 -0700 Subject: [PATCH 093/205] [ObjC] dns service resolver for cf event engine (#33233) Implement DNS using dns service for iOS. Current limitation: 1. Using a custom name server is not supported. 2. Only supports `LookupHostname`. `LookupSRV` and `LookupTXT` are not implemented. 3. Not tested with single stack (ipv4 or ipv6) environment 4. ~Not tested with multiple ip records per stack~ manually tested with wsj.com 5. Not tested with multiple interface environment --- CMakeLists.txt | 9 +- Makefile | 2 + Package.swift | 2 + build_autogenerated.yaml | 16 +- config.m4 | 1 + config.w32 | 1 + gRPC-C++.podspec | 2 + gRPC-Core.podspec | 3 + grpc.gemspec | 2 + grpc.gyp | 3 + package.xml | 2 + src/core/BUILD | 8 +- .../lib/event_engine/cf_engine/cf_engine.cc | 12 +- .../cf_engine/dns_service_resolver.cc | 222 ++++++++++++++++++ .../cf_engine/dns_service_resolver.h | 117 +++++++++ src/objective-c/tests/BUILD | 1 + .../EventEngineTests/CFEventEngineTests.mm | 2 + src/python/grpcio/grpc_core_dependencies.py | 1 + test/core/event_engine/cf/cf_engine_test.cc | 211 +++++++++++++++++ test/core/event_engine/test_suite/BUILD | 2 + .../test_suite/cf_event_engine_test.cc | 4 +- .../event_engine/test_suite/tests/dns_test.cc | 4 + tools/doxygen/Doxyfile.c++.internal | 2 + tools/doxygen/Doxyfile.core.internal | 2 + 24 files changed, 623 insertions(+), 8 deletions(-) create mode 100644 src/core/lib/event_engine/cf_engine/dns_service_resolver.cc create mode 100644 src/core/lib/event_engine/cf_engine/dns_service_resolver.h diff --git a/CMakeLists.txt b/CMakeLists.txt index fb8fda2c87950..9b3a427c6f470 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2158,6 +2158,7 @@ add_library(grpc src/core/lib/event_engine/ares_resolver.cc src/core/lib/event_engine/cf_engine/cf_engine.cc src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc + src/core/lib/event_engine/cf_engine/dns_service_resolver.cc src/core/lib/event_engine/channel_args_endpoint_config.cc src/core/lib/event_engine/default_event_engine.cc src/core/lib/event_engine/default_event_engine_factory.cc @@ -2867,6 +2868,7 @@ add_library(grpc_unsecure src/core/lib/event_engine/ares_resolver.cc src/core/lib/event_engine/cf_engine/cf_engine.cc src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc + src/core/lib/event_engine/cf_engine/dns_service_resolver.cc src/core/lib/event_engine/channel_args_endpoint_config.cc src/core/lib/event_engine/default_event_engine.cc src/core/lib/event_engine/default_event_engine_factory.cc @@ -4405,6 +4407,7 @@ add_library(grpc_authorization_provider src/core/lib/event_engine/ares_resolver.cc src/core/lib/event_engine/cf_engine/cf_engine.cc src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc + src/core/lib/event_engine/cf_engine/dns_service_resolver.cc src/core/lib/event_engine/channel_args_endpoint_config.cc src/core/lib/event_engine/default_event_engine.cc src/core/lib/event_engine/default_event_engine_factory.cc @@ -8138,7 +8141,10 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/event_engine/test_suite/event_engine_test_framework.cc test/core/event_engine/test_suite/posix/oracle_event_engine_posix.cc test/core/event_engine/test_suite/tests/client_test.cc + test/core/event_engine/test_suite/tests/dns_test.cc test/core/event_engine/test_suite/tests/timer_test.cc + test/core/util/fake_udp_and_tcp_server.cc + test/cpp/util/get_grpc_test_runfile_dir.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc ) @@ -8168,7 +8174,7 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) ${_gRPC_ZLIB_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} grpc_unsecure - grpc_test_util + grpc++_test_util ) @@ -12444,6 +12450,7 @@ add_executable(frame_test src/core/lib/event_engine/ares_resolver.cc src/core/lib/event_engine/cf_engine/cf_engine.cc src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc + src/core/lib/event_engine/cf_engine/dns_service_resolver.cc src/core/lib/event_engine/channel_args_endpoint_config.cc src/core/lib/event_engine/default_event_engine.cc src/core/lib/event_engine/default_event_engine_factory.cc diff --git a/Makefile b/Makefile index f1a04b993b045..7e39779d5a1b8 100644 --- a/Makefile +++ b/Makefile @@ -1440,6 +1440,7 @@ LIBGRPC_SRC = \ src/core/lib/event_engine/ares_resolver.cc \ src/core/lib/event_engine/cf_engine/cf_engine.cc \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc \ + src/core/lib/event_engine/cf_engine/dns_service_resolver.cc \ src/core/lib/event_engine/channel_args_endpoint_config.cc \ src/core/lib/event_engine/default_event_engine.cc \ src/core/lib/event_engine/default_event_engine_factory.cc \ @@ -2002,6 +2003,7 @@ LIBGRPC_UNSECURE_SRC = \ src/core/lib/event_engine/ares_resolver.cc \ src/core/lib/event_engine/cf_engine/cf_engine.cc \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc \ + src/core/lib/event_engine/cf_engine/dns_service_resolver.cc \ src/core/lib/event_engine/channel_args_endpoint_config.cc \ src/core/lib/event_engine/default_event_engine.cc \ src/core/lib/event_engine/default_event_engine_factory.cc \ diff --git a/Package.swift b/Package.swift index b712cd822d941..56699d86e08c9 100644 --- a/Package.swift +++ b/Package.swift @@ -1069,6 +1069,8 @@ let package = Package( "src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc", "src/core/lib/event_engine/cf_engine/cfstream_endpoint.h", "src/core/lib/event_engine/cf_engine/cftype_unique_ref.h", + "src/core/lib/event_engine/cf_engine/dns_service_resolver.cc", + "src/core/lib/event_engine/cf_engine/dns_service_resolver.h", "src/core/lib/event_engine/channel_args_endpoint_config.cc", "src/core/lib/event_engine/channel_args_endpoint_config.h", "src/core/lib/event_engine/common_closures.h", diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 4a8a34eec8efb..e389a78d0b54f 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -687,6 +687,7 @@ libs: - src/core/lib/event_engine/cf_engine/cf_engine.h - src/core/lib/event_engine/cf_engine/cfstream_endpoint.h - src/core/lib/event_engine/cf_engine/cftype_unique_ref.h + - src/core/lib/event_engine/cf_engine/dns_service_resolver.h - src/core/lib/event_engine/channel_args_endpoint_config.h - src/core/lib/event_engine/common_closures.h - src/core/lib/event_engine/default_event_engine.h @@ -1501,6 +1502,7 @@ libs: - src/core/lib/event_engine/ares_resolver.cc - src/core/lib/event_engine/cf_engine/cf_engine.cc - src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc + - src/core/lib/event_engine/cf_engine/dns_service_resolver.cc - src/core/lib/event_engine/channel_args_endpoint_config.cc - src/core/lib/event_engine/default_event_engine.cc - src/core/lib/event_engine/default_event_engine_factory.cc @@ -2084,6 +2086,7 @@ libs: - src/core/lib/event_engine/cf_engine/cf_engine.h - src/core/lib/event_engine/cf_engine/cfstream_endpoint.h - src/core/lib/event_engine/cf_engine/cftype_unique_ref.h + - src/core/lib/event_engine/cf_engine/dns_service_resolver.h - src/core/lib/event_engine/channel_args_endpoint_config.h - src/core/lib/event_engine/common_closures.h - src/core/lib/event_engine/default_event_engine.h @@ -2505,6 +2508,7 @@ libs: - src/core/lib/event_engine/ares_resolver.cc - src/core/lib/event_engine/cf_engine/cf_engine.cc - src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc + - src/core/lib/event_engine/cf_engine/dns_service_resolver.cc - src/core/lib/event_engine/channel_args_endpoint_config.cc - src/core/lib/event_engine/default_event_engine.cc - src/core/lib/event_engine/default_event_engine_factory.cc @@ -3592,6 +3596,7 @@ libs: - src/core/lib/event_engine/cf_engine/cf_engine.h - src/core/lib/event_engine/cf_engine/cfstream_endpoint.h - src/core/lib/event_engine/cf_engine/cftype_unique_ref.h + - src/core/lib/event_engine/cf_engine/dns_service_resolver.h - src/core/lib/event_engine/channel_args_endpoint_config.h - src/core/lib/event_engine/common_closures.h - src/core/lib/event_engine/default_event_engine.h @@ -3892,6 +3897,7 @@ libs: - src/core/lib/event_engine/ares_resolver.cc - src/core/lib/event_engine/cf_engine/cf_engine.cc - src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc + - src/core/lib/event_engine/cf_engine/dns_service_resolver.cc - src/core/lib/event_engine/channel_args_endpoint_config.cc - src/core/lib/event_engine/default_event_engine.cc - src/core/lib/event_engine/default_event_engine_factory.cc @@ -5880,17 +5886,23 @@ targets: - test/core/event_engine/test_suite/event_engine_test_framework.h - test/core/event_engine/test_suite/posix/oracle_event_engine_posix.h - test/core/event_engine/test_suite/tests/client_test.h + - test/core/event_engine/test_suite/tests/dns_test.h - test/core/event_engine/test_suite/tests/timer_test.h + - test/core/util/fake_udp_and_tcp_server.h + - test/cpp/util/get_grpc_test_runfile_dir.h src: - test/core/event_engine/event_engine_test_utils.cc - test/core/event_engine/test_suite/cf_event_engine_test.cc - test/core/event_engine/test_suite/event_engine_test_framework.cc - test/core/event_engine/test_suite/posix/oracle_event_engine_posix.cc - test/core/event_engine/test_suite/tests/client_test.cc + - test/core/event_engine/test_suite/tests/dns_test.cc - test/core/event_engine/test_suite/tests/timer_test.cc + - test/core/util/fake_udp_and_tcp_server.cc + - test/cpp/util/get_grpc_test_runfile_dir.cc deps: - grpc_unsecure - - grpc_test_util + - grpc++_test_util platforms: - linux - posix @@ -8112,6 +8124,7 @@ targets: - src/core/lib/event_engine/cf_engine/cf_engine.h - src/core/lib/event_engine/cf_engine/cfstream_endpoint.h - src/core/lib/event_engine/cf_engine/cftype_unique_ref.h + - src/core/lib/event_engine/cf_engine/dns_service_resolver.h - src/core/lib/event_engine/channel_args_endpoint_config.h - src/core/lib/event_engine/common_closures.h - src/core/lib/event_engine/default_event_engine.h @@ -8394,6 +8407,7 @@ targets: - src/core/lib/event_engine/ares_resolver.cc - src/core/lib/event_engine/cf_engine/cf_engine.cc - src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc + - src/core/lib/event_engine/cf_engine/dns_service_resolver.cc - src/core/lib/event_engine/channel_args_endpoint_config.cc - src/core/lib/event_engine/default_event_engine.cc - src/core/lib/event_engine/default_event_engine_factory.cc diff --git a/config.m4 b/config.m4 index 7963168b68356..93a4b2c5b507a 100644 --- a/config.m4 +++ b/config.m4 @@ -522,6 +522,7 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/event_engine/ares_resolver.cc \ src/core/lib/event_engine/cf_engine/cf_engine.cc \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc \ + src/core/lib/event_engine/cf_engine/dns_service_resolver.cc \ src/core/lib/event_engine/channel_args_endpoint_config.cc \ src/core/lib/event_engine/default_event_engine.cc \ src/core/lib/event_engine/default_event_engine_factory.cc \ diff --git a/config.w32 b/config.w32 index e8412bdeb19c3..6de00278ef066 100644 --- a/config.w32 +++ b/config.w32 @@ -487,6 +487,7 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\event_engine\\ares_resolver.cc " + "src\\core\\lib\\event_engine\\cf_engine\\cf_engine.cc " + "src\\core\\lib\\event_engine\\cf_engine\\cfstream_endpoint.cc " + + "src\\core\\lib\\event_engine\\cf_engine\\dns_service_resolver.cc " + "src\\core\\lib\\event_engine\\channel_args_endpoint_config.cc " + "src\\core\\lib\\event_engine\\default_event_engine.cc " + "src\\core\\lib\\event_engine\\default_event_engine_factory.cc " + diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 0ff4a85975684..d95907385161e 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -758,6 +758,7 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/cf_engine/cf_engine.h', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.h', 'src/core/lib/event_engine/cf_engine/cftype_unique_ref.h', + 'src/core/lib/event_engine/cf_engine/dns_service_resolver.h', 'src/core/lib/event_engine/channel_args_endpoint_config.h', 'src/core/lib/event_engine/common_closures.h', 'src/core/lib/event_engine/default_event_engine.h', @@ -1807,6 +1808,7 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/cf_engine/cf_engine.h', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.h', 'src/core/lib/event_engine/cf_engine/cftype_unique_ref.h', + 'src/core/lib/event_engine/cf_engine/dns_service_resolver.h', 'src/core/lib/event_engine/channel_args_endpoint_config.h', 'src/core/lib/event_engine/common_closures.h', 'src/core/lib/event_engine/default_event_engine.h', diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 1f7ee059f5212..c6f4811efe8ca 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -1170,6 +1170,8 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.h', 'src/core/lib/event_engine/cf_engine/cftype_unique_ref.h', + 'src/core/lib/event_engine/cf_engine/dns_service_resolver.cc', + 'src/core/lib/event_engine/cf_engine/dns_service_resolver.h', 'src/core/lib/event_engine/channel_args_endpoint_config.cc', 'src/core/lib/event_engine/channel_args_endpoint_config.h', 'src/core/lib/event_engine/common_closures.h', @@ -2542,6 +2544,7 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/cf_engine/cf_engine.h', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.h', 'src/core/lib/event_engine/cf_engine/cftype_unique_ref.h', + 'src/core/lib/event_engine/cf_engine/dns_service_resolver.h', 'src/core/lib/event_engine/channel_args_endpoint_config.h', 'src/core/lib/event_engine/common_closures.h', 'src/core/lib/event_engine/default_event_engine.h', diff --git a/grpc.gemspec b/grpc.gemspec index 8eecc38bea735..d3d4df3b6cc74 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -1075,6 +1075,8 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc ) s.files += %w( src/core/lib/event_engine/cf_engine/cfstream_endpoint.h ) s.files += %w( src/core/lib/event_engine/cf_engine/cftype_unique_ref.h ) + s.files += %w( src/core/lib/event_engine/cf_engine/dns_service_resolver.cc ) + s.files += %w( src/core/lib/event_engine/cf_engine/dns_service_resolver.h ) s.files += %w( src/core/lib/event_engine/channel_args_endpoint_config.cc ) s.files += %w( src/core/lib/event_engine/channel_args_endpoint_config.h ) s.files += %w( src/core/lib/event_engine/common_closures.h ) diff --git a/grpc.gyp b/grpc.gyp index 9a53deff7e9aa..4ac488d26eaa8 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -744,6 +744,7 @@ 'src/core/lib/event_engine/ares_resolver.cc', 'src/core/lib/event_engine/cf_engine/cf_engine.cc', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc', + 'src/core/lib/event_engine/cf_engine/dns_service_resolver.cc', 'src/core/lib/event_engine/channel_args_endpoint_config.cc', 'src/core/lib/event_engine/default_event_engine.cc', 'src/core/lib/event_engine/default_event_engine_factory.cc', @@ -1245,6 +1246,7 @@ 'src/core/lib/event_engine/ares_resolver.cc', 'src/core/lib/event_engine/cf_engine/cf_engine.cc', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc', + 'src/core/lib/event_engine/cf_engine/dns_service_resolver.cc', 'src/core/lib/event_engine/channel_args_endpoint_config.cc', 'src/core/lib/event_engine/default_event_engine.cc', 'src/core/lib/event_engine/default_event_engine_factory.cc', @@ -1766,6 +1768,7 @@ 'src/core/lib/event_engine/ares_resolver.cc', 'src/core/lib/event_engine/cf_engine/cf_engine.cc', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc', + 'src/core/lib/event_engine/cf_engine/dns_service_resolver.cc', 'src/core/lib/event_engine/channel_args_endpoint_config.cc', 'src/core/lib/event_engine/default_event_engine.cc', 'src/core/lib/event_engine/default_event_engine_factory.cc', diff --git a/package.xml b/package.xml index 00f44d11922be..3a8afe9b3fda5 100644 --- a/package.xml +++ b/package.xml @@ -1057,6 +1057,8 @@ + + diff --git a/src/core/BUILD b/src/core/BUILD index f1a323e6687f5..68efe9d473727 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -2125,13 +2125,18 @@ grpc_cc_library( srcs = [ "lib/event_engine/cf_engine/cf_engine.cc", "lib/event_engine/cf_engine/cfstream_endpoint.cc", + "lib/event_engine/cf_engine/dns_service_resolver.cc", ], hdrs = [ "lib/event_engine/cf_engine/cf_engine.h", "lib/event_engine/cf_engine/cfstream_endpoint.h", "lib/event_engine/cf_engine/cftype_unique_ref.h", + "lib/event_engine/cf_engine/dns_service_resolver.h", + ], + external_deps = [ + "absl/container:flat_hash_map", + "absl/strings:str_format", ], - external_deps = ["absl/strings:str_format"], deps = [ "event_engine_common", "event_engine_tcp_socket_utils", @@ -2147,6 +2152,7 @@ grpc_cc_library( "strerror", "//:event_engine_base_hdrs", "//:gpr", + "//:parse_address", "//:ref_counted_ptr", "//:sockaddr_utils", ], diff --git a/src/core/lib/event_engine/cf_engine/cf_engine.cc b/src/core/lib/event_engine/cf_engine/cf_engine.cc index f835e64a21e8c..af0b7248d1992 100644 --- a/src/core/lib/event_engine/cf_engine/cf_engine.cc +++ b/src/core/lib/event_engine/cf_engine/cf_engine.cc @@ -22,6 +22,7 @@ #include "src/core/lib/event_engine/cf_engine/cf_engine.h" #include "src/core/lib/event_engine/cf_engine/cfstream_endpoint.h" +#include "src/core/lib/event_engine/cf_engine/dns_service_resolver.h" #include "src/core/lib/event_engine/posix_engine/timer_manager.h" #include "src/core/lib/event_engine/tcp_socket_utils.h" #include "src/core/lib/event_engine/thread_pool/thread_pool.h" @@ -156,9 +157,14 @@ bool CFEventEngine::CancelConnectInternal(ConnectionHandle handle, bool CFEventEngine::IsWorkerThread() { grpc_core::Crash("unimplemented"); } absl::StatusOr> -CFEventEngine::GetDNSResolver( - const DNSResolver::ResolverOptions& /* options */) { - grpc_core::Crash("unimplemented"); +CFEventEngine::GetDNSResolver(const DNSResolver::ResolverOptions& options) { + if (!options.dns_server.empty()) { + return absl::InvalidArgumentError( + "CFEventEngine does not support custom DNS servers"); + } + + return std::make_unique( + std::static_pointer_cast(shared_from_this())); } void CFEventEngine::Run(EventEngine::Closure* closure) { diff --git a/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc b/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc new file mode 100644 index 0000000000000..c19f9afe46349 --- /dev/null +++ b/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc @@ -0,0 +1,222 @@ +// Copyright 2023 The gRPC Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#ifdef GPR_APPLE + +#include "absl/strings/str_format.h" + +#include "src/core/lib/address_utils/parse_address.h" +#include "src/core/lib/event_engine/cf_engine/dns_service_resolver.h" +#include "src/core/lib/event_engine/posix_engine/lockfree_event.h" +#include "src/core/lib/event_engine/tcp_socket_utils.h" +#include "src/core/lib/event_engine/trace.h" +#include "src/core/lib/gprpp/host_port.h" + +namespace grpc_event_engine { +namespace experimental { + +void DNSServiceResolverImpl::LookupHostname( + EventEngine::DNSResolver::LookupHostnameCallback on_resolve, + absl::string_view name, absl::string_view default_port) { + GRPC_EVENT_ENGINE_DNS_TRACE( + "DNSServiceResolverImpl::LookupHostname: name: %.*s, default_port: %.*s, " + "this: %p", + static_cast(name.length()), name.data(), + static_cast(default_port.length()), default_port.data(), this); + + absl::string_view host; + absl::string_view port_string; + if (!grpc_core::SplitHostPort(name, &host, &port_string)) { + engine_->Run([on_resolve = std::move(on_resolve), + status = absl::InvalidArgumentError( + absl::StrCat("Unparseable name: ", name))]() mutable { + on_resolve(status); + }); + return; + } + GPR_ASSERT(!host.empty()); + if (port_string.empty()) { + if (default_port.empty()) { + engine_->Run([on_resolve = std::move(on_resolve), + status = absl::InvalidArgumentError(absl::StrFormat( + "No port in name %s or default_port argument", + name))]() mutable { on_resolve(std::move(status)); }); + return; + } + port_string = default_port; + } + + int port = 0; + if (port_string == "http") { + port = 80; + } else if (port_string == "https") { + port = 443; + } else if (!absl::SimpleAtoi(port_string, &port)) { + engine_->Run([on_resolve = std::move(on_resolve), + status = absl::InvalidArgumentError(absl::StrCat( + "Failed to parse port in name: ", name))]() mutable { + on_resolve(std::move(status)); + }); + return; + } + + // TODO(yijiem): Change this when refactoring code in + // src/core/lib/address_utils to use EventEngine::ResolvedAddress. + grpc_resolved_address addr; + const std::string hostport = grpc_core::JoinHostPort(host, port); + if (grpc_parse_ipv4_hostport(hostport.c_str(), &addr, + /*log_errors=*/false) || + grpc_parse_ipv6_hostport(hostport.c_str(), &addr, + /*log_errors=*/false)) { + // Early out if the target is an ipv4 or ipv6 literal. + std::vector result; + result.emplace_back(reinterpret_cast(addr.addr), addr.len); + engine_->Run([on_resolve = std::move(on_resolve), + result = std::move(result)]() mutable { + on_resolve(std::move(result)); + }); + return; + } + + DNSServiceRef sdRef; + auto host_string = std::string{host}; + auto error = DNSServiceGetAddrInfo( + &sdRef, kDNSServiceFlagsTimeout | kDNSServiceFlagsReturnIntermediates, 0, + kDNSServiceProtocol_IPv4 | kDNSServiceProtocol_IPv6, host_string.c_str(), + &DNSServiceResolverImpl::ResolveCallback, this /* do not Ref */); + + if (error != kDNSServiceErr_NoError) { + engine_->Run([on_resolve = std::move(on_resolve), + status = absl::UnknownError(absl::StrFormat( + "DNSServiceGetAddrInfo failed with error:%d", + error))]() mutable { on_resolve(std::move(status)); }); + return; + } + + grpc_core::ReleasableMutexLock lock(&request_mu_); + + error = DNSServiceSetDispatchQueue(sdRef, queue_); + if (error != kDNSServiceErr_NoError) { + engine_->Run([on_resolve = std::move(on_resolve), + status = absl::UnknownError(absl::StrFormat( + "DNSServiceSetDispatchQueue failed with error:%d", + error))]() mutable { on_resolve(std::move(status)); }); + return; + } + + requests_.try_emplace( + sdRef, DNSServiceRequest{ + std::move(on_resolve), static_cast(port), {}}); +} + +/* static */ +void DNSServiceResolverImpl::ResolveCallback( + DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, + DNSServiceErrorType errorCode, const char* hostname, + const struct sockaddr* address, uint32_t ttl, void* context) { + GRPC_EVENT_ENGINE_DNS_TRACE( + "DNSServiceResolverImpl::ResolveCallback: sdRef: %p, flags: %x, " + "interface: %d, errorCode: %d, hostname: %s, addressFamily: %d, ttl: " + "%d, " + "this: %p", + sdRef, flags, interfaceIndex, errorCode, hostname, address->sa_family, + ttl, context); + + // no need to increase refcount here, since ResolveCallback and Shutdown is + // called from the serial queue and it is guarenteed that it won't be called + // after the sdRef is deallocated + auto that = static_cast(context); + + grpc_core::ReleasableMutexLock lock(&that->request_mu_); + auto request_it = that->requests_.find(sdRef); + GPR_ASSERT(request_it != that->requests_.end()); + auto& request = request_it->second; + + if (errorCode != kDNSServiceErr_NoError && + errorCode != kDNSServiceErr_NoSuchRecord) { + request.on_resolve(absl::UnknownError(absl::StrFormat( + "address lookup failed for %s: errorCode: %d", hostname, errorCode))); + that->requests_.erase(request_it); + DNSServiceRefDeallocate(sdRef); + return; + } + + // set received ipv4 or ipv6 response, even for kDNSServiceErr_NoSuchRecord + if (address->sa_family == AF_INET) { + request.has_ipv4_response = true; + } else if (address->sa_family == AF_INET6) { + request.has_ipv6_response = true; + } + + // collect results if there is no error (not kDNSServiceErr_NoSuchRecord) + if (errorCode == kDNSServiceErr_NoError) { + request.result.emplace_back(address, address->sa_len); + auto& resolved_address = request.result.back(); + if (address->sa_family == AF_INET) { + (const_cast( + reinterpret_cast(resolved_address.address()))) + ->sin_port = htons(request.port); + } else if (address->sa_family == AF_INET6) { + (const_cast( + reinterpret_cast(resolved_address.address()))) + ->sin6_port = htons(request.port); + } + + GRPC_EVENT_ENGINE_DNS_TRACE( + "DNSServiceResolverImpl::ResolveCallback: " + "sdRef: %p, hostname: %s, addressPort: %s, this: %p", + sdRef, hostname, + ResolvedAddressToString(resolved_address).value_or("ERROR").c_str(), + context); + } + + if (!(flags & kDNSServiceFlagsMoreComing) && request.has_ipv4_response && + request.has_ipv6_response) { + if (request.result.empty()) { + request.on_resolve(absl::NotFoundError(absl::StrFormat( + "address lookup failed for %s: Domain name not found", hostname))); + } else { + request.on_resolve(std::move(request.result)); + } + that->requests_.erase(request_it); + DNSServiceRefDeallocate(sdRef); + } +} + +void DNSServiceResolverImpl::Shutdown() { + dispatch_async_f(queue_, Ref().release(), [](void* thatPtr) { + grpc_core::RefCountedPtr that{ + static_cast(thatPtr)}; + grpc_core::MutexLock lock(&that->request_mu_); + for (auto& kv : that->requests_) { + auto& sdRef = kv.first; + auto& request = kv.second; + GRPC_EVENT_ENGINE_DNS_TRACE( + "DNSServiceResolverImpl::Shutdown sdRef: %p, this: %p", sdRef, + thatPtr); + + request.on_resolve( + absl::CancelledError("DNSServiceResolverImpl::Shutdown")); + DNSServiceRefDeallocate(static_cast(sdRef)); + } + that->requests_.clear(); + }); +} + +} // namespace experimental +} // namespace grpc_event_engine + +#endif // GPR_APPLE diff --git a/src/core/lib/event_engine/cf_engine/dns_service_resolver.h b/src/core/lib/event_engine/cf_engine/dns_service_resolver.h new file mode 100644 index 0000000000000..00a55a3050025 --- /dev/null +++ b/src/core/lib/event_engine/cf_engine/dns_service_resolver.h @@ -0,0 +1,117 @@ +// Copyright 2023 The gRPC Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef GRPC_SRC_CORE_LIB_EVENT_ENGINE_CF_ENGINE_DNS_SERVICE_RESOLVER_H +#define GRPC_SRC_CORE_LIB_EVENT_ENGINE_CF_ENGINE_DNS_SERVICE_RESOLVER_H +#include + +#ifdef GPR_APPLE + +#include +#include + +#include "absl/container/flat_hash_map.h" + +#include + +#include "src/core/lib/event_engine/cf_engine/cf_engine.h" +#include "src/core/lib/gprpp/ref_counted.h" +#include "src/core/lib/gprpp/ref_counted_ptr.h" + +namespace grpc_event_engine { +namespace experimental { + +class DNSServiceResolverImpl + : public grpc_core::RefCounted { + struct DNSServiceRequest { + EventEngine::DNSResolver::LookupHostnameCallback on_resolve; + uint16_t port; + std::vector result; + bool has_ipv4_response = false; + bool has_ipv6_response = false; + }; + + public: + explicit DNSServiceResolverImpl(std::shared_ptr engine) + : engine_(std::move((engine))) {} + ~DNSServiceResolverImpl() override { + GPR_ASSERT(requests_.empty()); + dispatch_release(queue_); + } + + void Shutdown(); + + void LookupHostname( + EventEngine::DNSResolver::LookupHostnameCallback on_resolve, + absl::string_view name, absl::string_view default_port); + + private: + static void ResolveCallback(DNSServiceRef sdRef, DNSServiceFlags flags, + uint32_t interfaceIndex, + DNSServiceErrorType errorCode, + const char* hostname, + const struct sockaddr* address, uint32_t ttl, + void* context); + + private: + std::shared_ptr engine_; + // DNSServiceSetDispatchQueue requires a serial dispatch queue + dispatch_queue_t queue_ = + dispatch_queue_create("dns_service_resolver", nullptr); + grpc_core::Mutex request_mu_; + absl::flat_hash_map requests_ + ABSL_GUARDED_BY(request_mu_); +}; + +class DNSServiceResolver : public EventEngine::DNSResolver { + public: + explicit DNSServiceResolver(std::shared_ptr engine) + : engine_(std::move(engine)), + impl_(grpc_core::MakeRefCounted( + std::move((engine_)))) {} + + ~DNSServiceResolver() override { impl_->Shutdown(); } + + void LookupHostname( + EventEngine::DNSResolver::LookupHostnameCallback on_resolve, + absl::string_view name, absl::string_view default_port) override { + impl_->LookupHostname(std::move(on_resolve), name, default_port); + }; + + void LookupSRV(EventEngine::DNSResolver::LookupSRVCallback on_resolve, + absl::string_view /* name */) override { + engine_->Run([on_resolve = std::move(on_resolve)]() mutable { + on_resolve(absl::UnimplementedError( + "The DNS Service resolver does not support looking up SRV records")); + }); + } + + void LookupTXT(EventEngine::DNSResolver::LookupTXTCallback on_resolve, + absl::string_view /* name */) override { + engine_->Run([on_resolve = std::move(on_resolve)]() mutable { + on_resolve(absl::UnimplementedError( + "The DNS Service resolver does not support looking up TXT records")); + }); + } + + private: + std::shared_ptr engine_; + grpc_core::RefCountedPtr impl_; +}; + +} // namespace experimental +} // namespace grpc_event_engine + +#endif // GPR_APPLE + +#endif // GRPC_SRC_CORE_LIB_EVENT_ENGINE_CF_ENGINE_DNS_SERVICE_RESOLVER_H diff --git a/src/objective-c/tests/BUILD b/src/objective-c/tests/BUILD index 9eef39eaba667..bfbe19b773e57 100644 --- a/src/objective-c/tests/BUILD +++ b/src/objective-c/tests/BUILD @@ -341,6 +341,7 @@ grpc_objc_testing_library( "//src/core:cf_event_engine", "//test/core/event_engine/test_suite/posix:oracle_event_engine_posix", "//test/core/event_engine/test_suite/tests:client", + "//test/core/event_engine/test_suite/tests:dns", "//test/core/event_engine/test_suite/tests:timer", ], ) diff --git a/src/objective-c/tests/EventEngineTests/CFEventEngineTests.mm b/src/objective-c/tests/EventEngineTests/CFEventEngineTests.mm index 2f32a409314f6..9885918324698 100644 --- a/src/objective-c/tests/EventEngineTests/CFEventEngineTests.mm +++ b/src/objective-c/tests/EventEngineTests/CFEventEngineTests.mm @@ -24,6 +24,7 @@ #include "test/core/event_engine/test_suite/event_engine_test_framework.h" #include "test/core/event_engine/test_suite/posix/oracle_event_engine_posix.h" #include "test/core/event_engine/test_suite/tests/client_test.h" +#include "test/core/event_engine/test_suite/tests/dns_test.h" #include "test/core/event_engine/test_suite/tests/timer_test.h" #include "test/core/util/test_config.h" @@ -53,6 +54,7 @@ - (void)testAll { SetEventEngineFactories(factory, oracle_factory); grpc_event_engine::experimental::InitTimerTests(); grpc_event_engine::experimental::InitClientTests(); + grpc_event_engine::experimental::InitDNSTests(); // TODO(ctiller): EventEngine temporarily needs grpc to be initialized first // until we clear out the iomgr shutdown code. grpc_init(); diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 3a03e18ac0874..76fbcce089e00 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -496,6 +496,7 @@ 'src/core/lib/event_engine/ares_resolver.cc', 'src/core/lib/event_engine/cf_engine/cf_engine.cc', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc', + 'src/core/lib/event_engine/cf_engine/dns_service_resolver.cc', 'src/core/lib/event_engine/channel_args_endpoint_config.cc', 'src/core/lib/event_engine/default_event_engine.cc', 'src/core/lib/event_engine/default_event_engine_factory.cc', diff --git a/test/core/event_engine/cf/cf_engine_test.cc b/test/core/event_engine/cf/cf_engine_test.cc index f50b40f82fa76..ae9e540b35960 100644 --- a/test/core/event_engine/cf/cf_engine_test.cc +++ b/test/core/event_engine/cf/cf_engine_test.cc @@ -19,6 +19,8 @@ #include #include "absl/status/status.h" +#include "absl/strings/str_format.h" +#include "gmock/gmock.h" #include "gtest/gtest.h" #include @@ -80,6 +82,215 @@ TEST(CFEventEngineTest, TestConnectionCancelled) { client_signal.WaitForNotification(); } +namespace { +std::vector ResolvedAddressesToStrings( + const std::vector addresses) { + std::vector ip_strings; + std::transform(addresses.cbegin(), addresses.cend(), + std::back_inserter(ip_strings), [](auto const& address) { + return ResolvedAddressToString(address).value_or("ERROR"); + }); + return ip_strings; +} +} // namespace + +TEST(CFEventEngineTest, TestCreateDNSResolver) { + grpc_core::MemoryQuota memory_quota("cf_engine_test"); + auto cf_engine = std::make_shared(); + + EXPECT_TRUE(cf_engine->GetDNSResolver({}).status().ok()); + EXPECT_TRUE(cf_engine->GetDNSResolver({.dns_server = ""}).status().ok()); + EXPECT_EQ( + cf_engine->GetDNSResolver({.dns_server = "8.8.8.8"}).status().code(), + absl::StatusCode::kInvalidArgument); + EXPECT_EQ( + cf_engine->GetDNSResolver({.dns_server = "8.8.8.8:53"}).status().code(), + absl::StatusCode::kInvalidArgument); + EXPECT_EQ( + cf_engine->GetDNSResolver({.dns_server = "invalid"}).status().code(), + absl::StatusCode::kInvalidArgument); +} + +TEST(CFEventEngineTest, TestResolveLocalhost) { + grpc_core::Notification resolve_signal; + + auto cf_engine = std::make_shared(); + auto dns_resolver = cf_engine->GetDNSResolver({}); + + dns_resolver.value()->LookupHostname( + [&resolve_signal](auto result) { + EXPECT_TRUE(result.status().ok()); + EXPECT_THAT(ResolvedAddressesToStrings(result.value()), + testing::UnorderedElementsAre("127.0.0.1:80", "[::1]:80")); + + resolve_signal.Notify(); + }, + "localhost", "80"); + + resolve_signal.WaitForNotification(); +} + +TEST(CFEventEngineTest, TestResolveRemote) { + grpc_core::Notification resolve_signal; + + auto cf_engine = std::make_shared(); + auto dns_resolver = cf_engine->GetDNSResolver({}); + + dns_resolver.value()->LookupHostname( + [&resolve_signal](auto result) { + EXPECT_TRUE(result.status().ok()); + EXPECT_THAT(ResolvedAddressesToStrings(result.value()), + testing::UnorderedElementsAre("127.0.0.1:80", "[::1]:80")); + + resolve_signal.Notify(); + }, + "localtest.me:80", "443"); + + resolve_signal.WaitForNotification(); +} + +TEST(CFEventEngineTest, TestResolveIPv4Remote) { + grpc_core::Notification resolve_signal; + + auto cf_engine = std::make_shared(); + auto dns_resolver = cf_engine->GetDNSResolver({}); + + dns_resolver.value()->LookupHostname( + [&resolve_signal](auto result) { + EXPECT_TRUE(result.status().ok()); + EXPECT_THAT(ResolvedAddressesToStrings(result.value()), + testing::IsSubsetOf( + {"1.2.3.4:80", "[64:ff9b::102:304]:80" /*NAT64*/})); + + resolve_signal.Notify(); + }, + "1.2.3.4.nip.io:80", ""); + + resolve_signal.WaitForNotification(); +} + +TEST(CFEventEngineTest, TestResolveIPv6Remote) { + grpc_core::Notification resolve_signal; + + auto cf_engine = std::make_shared(); + auto dns_resolver = cf_engine->GetDNSResolver({}); + + dns_resolver.value()->LookupHostname( + [&resolve_signal](auto result) { + EXPECT_TRUE(result.status().ok()); + EXPECT_THAT( + ResolvedAddressesToStrings(result.value()), + testing::UnorderedElementsAre("[2607:f8b0:400a:801::1002]:80")); + + resolve_signal.Notify(); + }, + "2607-f8b0-400a-801--1002.sslip.io.", "80"); + + resolve_signal.WaitForNotification(); +} + +TEST(CFEventEngineTest, TestResolveIPv4Literal) { + grpc_core::Notification resolve_signal; + + auto cf_engine = std::make_shared(); + auto dns_resolver = cf_engine->GetDNSResolver({}); + + dns_resolver.value()->LookupHostname( + [&resolve_signal](auto result) { + EXPECT_TRUE(result.status().ok()); + EXPECT_THAT(ResolvedAddressesToStrings(result.value()), + testing::UnorderedElementsAre("1.2.3.4:443")); + + resolve_signal.Notify(); + }, + "1.2.3.4", "https"); + + resolve_signal.WaitForNotification(); +} + +TEST(CFEventEngineTest, TestResolveIPv6Literal) { + grpc_core::Notification resolve_signal; + + auto cf_engine = std::make_shared(); + auto dns_resolver = cf_engine->GetDNSResolver({}); + + dns_resolver.value()->LookupHostname( + [&resolve_signal](auto result) { + EXPECT_TRUE(result.status().ok()); + EXPECT_THAT( + ResolvedAddressesToStrings(result.value()), + testing::UnorderedElementsAre("[2607:f8b0:400a:801::1002]:443")); + + resolve_signal.Notify(); + }, + "[2607:f8b0:400a:801::1002]", "443"); + + resolve_signal.WaitForNotification(); +} + +TEST(CFEventEngineTest, TestResolveNoRecord) { + grpc_core::Notification resolve_signal; + auto cf_engine = std::make_shared(); + auto dns_resolver = std::move(cf_engine->GetDNSResolver({})).value(); + + dns_resolver->LookupHostname( + [&resolve_signal](auto result) { + EXPECT_EQ(result.status().code(), absl::StatusCode::kNotFound); + + resolve_signal.Notify(); + }, + "nonexisting-target.dns-test.event-engine.", "443"); + + resolve_signal.WaitForNotification(); +} + +TEST(CFEventEngineTest, TestResolveCanceled) { + grpc_core::Notification resolve_signal; + auto cf_engine = std::make_shared(); + auto dns_resolver = std::move(cf_engine->GetDNSResolver({})).value(); + + dns_resolver->LookupHostname( + [&resolve_signal](auto result) { + // query may have already finished before canceling, only verity the + // code if status is not ok + if (!result.status().ok()) { + EXPECT_EQ(result.status().code(), absl::StatusCode::kCancelled); + } + + resolve_signal.Notify(); + }, + "dont-care-since-wont-be-resolved.localtest.me", "443"); + + dns_resolver.reset(); + resolve_signal.WaitForNotification(); +} + +TEST(CFEventEngineTest, TestResolveMany) { + std::atomic times{10}; + grpc_core::Notification resolve_signal; + auto cf_engine = std::make_shared(); + auto dns_resolver = std::move(cf_engine->GetDNSResolver({})).value(); + + for (int i = times; i >= 1; --i) { + dns_resolver->LookupHostname( + [&resolve_signal, ×, i](auto result) { + EXPECT_TRUE(result.status().ok()); + EXPECT_THAT( + ResolvedAddressesToStrings(result.value()), + testing::IsSubsetOf( + {absl::StrFormat("100.0.0.%d:443", i), + absl::StrFormat("[64:ff9b::6400:%x]:443", i) /*NAT64*/})); + + if (--times == 0) { + resolve_signal.Notify(); + } + }, + absl::StrFormat("100.0.0.%d.nip.io", i), "443"); + } + + resolve_signal.WaitForNotification(); +} + } // namespace experimental } // namespace grpc_event_engine diff --git a/test/core/event_engine/test_suite/BUILD b/test/core/event_engine/test_suite/BUILD index cc485a4d9a269..48eee5e0bf590 100644 --- a/test/core/event_engine/test_suite/BUILD +++ b/test/core/event_engine/test_suite/BUILD @@ -96,6 +96,7 @@ grpc_cc_test( grpc_cc_test( name = "cf_event_engine_test", srcs = ["cf_event_engine_test.cc"], + copts = ["-DGRPC_IOS_EVENT_ENGINE_CLIENT=1"], tags = [ "no_linux", "no_windows", @@ -105,6 +106,7 @@ grpc_cc_test( "//src/core:cf_event_engine", "//test/core/event_engine/test_suite/posix:oracle_event_engine_posix", "//test/core/event_engine/test_suite/tests:client", + "//test/core/event_engine/test_suite/tests:dns", "//test/core/event_engine/test_suite/tests:timer", ], ) diff --git a/test/core/event_engine/test_suite/cf_event_engine_test.cc b/test/core/event_engine/test_suite/cf_event_engine_test.cc index 1d222514cb624..78241c45a5000 100644 --- a/test/core/event_engine/test_suite/cf_event_engine_test.cc +++ b/test/core/event_engine/test_suite/cf_event_engine_test.cc @@ -21,6 +21,7 @@ #include "test/core/event_engine/test_suite/event_engine_test_framework.h" #include "test/core/event_engine/test_suite/posix/oracle_event_engine_posix.h" #include "test/core/event_engine/test_suite/tests/client_test.h" +#include "test/core/event_engine/test_suite/tests/dns_test.h" #include "test/core/event_engine/test_suite/tests/timer_test.h" #include "test/core/util/test_config.h" @@ -37,8 +38,7 @@ int main(int argc, char** argv) { SetEventEngineFactories(factory, oracle_factory); grpc_event_engine::experimental::InitTimerTests(); grpc_event_engine::experimental::InitClientTests(); - // TODO(vigneshbabu): remove when the experiment is over - grpc_core::ForceEnableExperiment("event_engine_client", true); + grpc_event_engine::experimental::InitDNSTests(); // TODO(ctiller): EventEngine temporarily needs grpc to be initialized first // until we clear out the iomgr shutdown code. grpc_init(); diff --git a/test/core/event_engine/test_suite/tests/dns_test.cc b/test/core/event_engine/test_suite/tests/dns_test.cc index cbd48e26bc775..18e6ae5d345ab 100644 --- a/test/core/event_engine/test_suite/tests/dns_test.cc +++ b/test/core/event_engine/test_suite/tests/dns_test.cc @@ -194,6 +194,9 @@ class EventEngineDNSTest : public EventEngineTest { EventEngineDNSTest::DNSServer EventEngineDNSTest::dns_server_; +// TODO(hork): implement XFAIL for resolvers that don't support TXT or SRV +#ifndef GRPC_IOS_EVENT_ENGINE_CLIENT + TEST_F(EventEngineDNSTest, QueryNXHostname) { auto dns_resolver = CreateDefaultDNSResolver(); dns_resolver->LookupHostname( @@ -365,6 +368,7 @@ TEST_F(EventEngineDNSTest, TestCancelActiveDNSQuery) { dns_resolver.reset(); dns_resolver_signal_.WaitForNotification(); } +#endif // GRPC_IOS_EVENT_ENGINE_CLIENT #define EXPECT_SUCCESS() \ do { \ diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index ab7809664f8a2..637de7d22957e 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -2072,6 +2072,8 @@ src/core/lib/event_engine/cf_engine/cf_engine.h \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.h \ src/core/lib/event_engine/cf_engine/cftype_unique_ref.h \ +src/core/lib/event_engine/cf_engine/dns_service_resolver.cc \ +src/core/lib/event_engine/cf_engine/dns_service_resolver.h \ src/core/lib/event_engine/channel_args_endpoint_config.cc \ src/core/lib/event_engine/channel_args_endpoint_config.h \ src/core/lib/event_engine/common_closures.h \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index d5b0b9258ab8a..17607e9339a34 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -1850,6 +1850,8 @@ src/core/lib/event_engine/cf_engine/cf_engine.h \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.h \ src/core/lib/event_engine/cf_engine/cftype_unique_ref.h \ +src/core/lib/event_engine/cf_engine/dns_service_resolver.cc \ +src/core/lib/event_engine/cf_engine/dns_service_resolver.h \ src/core/lib/event_engine/channel_args_endpoint_config.cc \ src/core/lib/event_engine/channel_args_endpoint_config.h \ src/core/lib/event_engine/common_closures.h \ From f7fc3fbed4ed3f242e5b6cc1ed72183a8c0eda25 Mon Sep 17 00:00:00 2001 From: Alisha Nanda Date: Tue, 1 Aug 2023 11:06:14 -0700 Subject: [PATCH 094/205] [tracing] Add annotation with metadata sizes and limits (#33910) Only create annotation when call is sampled for cost reasons. --------- Co-authored-by: ananda1066 --- src/core/ext/transport/chaotic_good/frame.cc | 5 +- .../chttp2/transport/hpack_parser.cc | 67 +++++++++++++++++-- .../transport/chttp2/transport/hpack_parser.h | 9 ++- .../ext/transport/chttp2/transport/internal.h | 2 +- .../ext/transport/chttp2/transport/parsing.cc | 12 +++- src/core/lib/channel/call_tracer.h | 5 +- src/core/lib/channel/promise_based_filter.cc | 3 + src/cpp/ext/filters/census/client_filter.cc | 14 ++++ .../ext/filters/census/server_call_tracer.cc | 7 ++ .../grpc_observability/client_call_tracer.cc | 14 ++++ .../grpc_observability/server_call_tracer.cc | 7 ++ .../chttp2/hpack_parser_fuzzer_test.cc | 3 +- .../chttp2/hpack_parser_input_size_fuzzer.cc | 3 +- .../transport/chttp2/hpack_parser_test.cc | 3 +- .../transport/chttp2/hpack_sync_fuzzer.cc | 5 +- .../census/stats_plugin_end2end_test.cc | 47 +++++++++++++ test/cpp/microbenchmarks/bm_chttp2_hpack.cc | 3 +- 17 files changed, 190 insertions(+), 19 deletions(-) diff --git a/src/core/ext/transport/chaotic_good/frame.cc b/src/core/ext/transport/chaotic_good/frame.cc index 1989c278a2063..34b8a493e8c35 100644 --- a/src/core/ext/transport/chaotic_good/frame.cc +++ b/src/core/ext/transport/chaotic_good/frame.cc @@ -127,8 +127,9 @@ absl::StatusOr> ReadMetadata( : HPackParser::LogInfo::Type::kTrailers, is_client}); for (size_t i = 0; i < slices.Count(); i++) { - GRPC_RETURN_IF_ERROR( - parser->Parse(slices.c_slice_at(i), i == slices.Count() - 1)); + GRPC_RETURN_IF_ERROR(parser->Parse(slices.c_slice_at(i), + i == slices.Count() - 1, + /*call_tracer=*/nullptr)); } parser->FinishFrame(); return std::move(metadata); diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser.cc b/src/core/ext/transport/chttp2/transport/hpack_parser.cc index f8c72dd2bf891..3ca3e5c812135 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_parser.cc +++ b/src/core/ext/transport/chttp2/transport/hpack_parser.cc @@ -44,6 +44,7 @@ #include "src/core/ext/transport/chttp2/transport/hpack_constants.h" #include "src/core/ext/transport/chttp2/transport/hpack_parse_result.h" #include "src/core/ext/transport/chttp2/transport/hpack_parser_table.h" +#include "src/core/lib/channel/call_tracer.h" #include "src/core/lib/debug/stats.h" #include "src/core/lib/debug/stats_data.h" #include "src/core/lib/debug/trace.h" @@ -1069,6 +1070,55 @@ Slice HPackParser::String::Take() { GPR_UNREACHABLE_CODE(return Slice()); } +class HPackParser::MetadataSizeEncoder { + public: + explicit MetadataSizeEncoder(std::string& summary) : summary_(summary) {} + + void Encode(const Slice& key, const Slice& value) { + AddToSummary(key.as_string_view(), value.size()); + } + + template + void Encode(Key, const Value& value) { + AddToSummary(Key::key(), EncodedSizeOfKey(Key(), value)); + } + + private: + void AddToSummary(absl::string_view key, + size_t value_length) GPR_ATTRIBUTE_NOINLINE { + absl::StrAppend(&summary_, key, ":", + hpack_constants::SizeForEntry(key.size(), value_length), + ","); + } + std::string& summary_; +}; + +class HPackParser::MetadataSizesAnnotation + : public CallTracerAnnotationInterface::Annotation { + public: + MetadataSizesAnnotation(grpc_metadata_batch* metadata_buffer, + uint64_t soft_limit, uint64_t hard_limit) + : CallTracerAnnotationInterface::Annotation( + CallTracerAnnotationInterface::AnnotationType::kMetadataSizes), + metadata_buffer_(metadata_buffer), + soft_limit_(soft_limit), + hard_limit_(hard_limit) {} + + std::string ToString() const override { + std::string metadata_annotation = + absl::StrCat("gRPC metadata soft_limit:", soft_limit_, + ",hard_limit:", hard_limit_, ","); + MetadataSizeEncoder encoder(metadata_annotation); + metadata_buffer_->Encode(&encoder); + return metadata_annotation; + } + + private: + grpc_metadata_batch* metadata_buffer_; + uint64_t soft_limit_; + uint64_t hard_limit_; +}; + // PUBLIC INTERFACE HPackParser::HPackParser() = default; @@ -1093,7 +1143,9 @@ void HPackParser::BeginFrame(grpc_metadata_batch* metadata_buffer, log_info_ = log_info; } -grpc_error_handle HPackParser::Parse(const grpc_slice& slice, bool is_last) { +grpc_error_handle HPackParser::Parse( + const grpc_slice& slice, bool is_last, + CallTracerAnnotationInterface* call_tracer) { if (GPR_UNLIKELY(!unparsed_bytes_.empty())) { unparsed_bytes_.insert(unparsed_bytes_.end(), GRPC_SLICE_START_PTR(slice), GRPC_SLICE_END_PTR(slice)); @@ -1105,20 +1157,27 @@ grpc_error_handle HPackParser::Parse(const grpc_slice& slice, bool is_last) { std::vector buffer = std::move(unparsed_bytes_); return ParseInput(Input(nullptr, buffer.data(), buffer.data() + buffer.size(), state_.frame_error), - is_last); + is_last, call_tracer); } return ParseInput(Input(slice.refcount, GRPC_SLICE_START_PTR(slice), GRPC_SLICE_END_PTR(slice), state_.frame_error), - is_last); + is_last, call_tracer); } -grpc_error_handle HPackParser::ParseInput(Input input, bool is_last) { +grpc_error_handle HPackParser::ParseInput( + Input input, bool is_last, CallTracerAnnotationInterface* call_tracer) { ParseInputInner(&input); if (is_last && is_boundary()) { if (state_.metadata_early_detection.Reject(state_.frame_length)) { HandleMetadataSoftSizeLimitExceeded(&input); } global_stats().IncrementHttp2MetadataSize(state_.frame_length); + if (call_tracer != nullptr && metadata_buffer_ != nullptr) { + MetadataSizesAnnotation metadata_sizes_annotation( + metadata_buffer_, state_.metadata_early_detection.soft_limit(), + state_.metadata_early_detection.hard_limit()); + call_tracer->RecordAnnotation(metadata_sizes_annotation); + } if (!state_.frame_error.connection_error() && (input.eof_error() || state_.parse_state != ParseState::kTop)) { state_.frame_error = HpackParseResult::IncompleteHeaderAtBoundaryError(); diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser.h b/src/core/ext/transport/chttp2/transport/hpack_parser.h index 70ba2273def7c..fd1747f345257 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_parser.h +++ b/src/core/ext/transport/chttp2/transport/hpack_parser.h @@ -40,6 +40,7 @@ #include "src/core/ext/transport/chttp2/transport/hpack_parse_result.h" #include "src/core/ext/transport/chttp2/transport/hpack_parser_table.h" #include "src/core/lib/backoff/random_early_detection.h" +#include "src/core/lib/channel/call_tracer.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/slice/slice.h" #include "src/core/lib/slice/slice_refcount.h" @@ -99,7 +100,8 @@ class HPackParser { // Start throwing away any received headers after parsing them. void StopBufferingFrame() { metadata_buffer_ = nullptr; } // Parse one slice worth of data - grpc_error_handle Parse(const grpc_slice& slice, bool is_last); + grpc_error_handle Parse(const grpc_slice& slice, bool is_last, + CallTracerAnnotationInterface* call_tracer); // Reset state ready for the next BeginFrame void FinishFrame(); @@ -117,6 +119,8 @@ class HPackParser { // Helper classes: see implementation class Parser; class Input; + class MetadataSizeEncoder; + class MetadataSizesAnnotation; // Helper to parse a string and turn it into a slice with appropriate memory // management characteristics @@ -249,7 +253,8 @@ class HPackParser { absl::variant key; }; - grpc_error_handle ParseInput(Input input, bool is_last); + grpc_error_handle ParseInput(Input input, bool is_last, + CallTracerAnnotationInterface* call_tracer); void ParseInputInner(Input* input); GPR_ATTRIBUTE_NOINLINE void HandleMetadataSoftSizeLimitExceeded(Input* input); diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h index 5f67941c67b4e..760051697e2ad 100644 --- a/src/core/ext/transport/chttp2/transport/internal.h +++ b/src/core/ext/transport/chttp2/transport/internal.h @@ -495,7 +495,7 @@ struct grpc_chttp2_stream { const void* server_data, grpc_core::Arena* arena); ~grpc_chttp2_stream(); - void* context; + void* context = nullptr; const grpc_core::RefCountedPtr t; grpc_stream_refcount* refcount; diff --git a/src/core/ext/transport/chttp2/transport/parsing.cc b/src/core/ext/transport/chttp2/transport/parsing.cc index ff5bf80427c2a..b5ac509102326 100644 --- a/src/core/ext/transport/chttp2/transport/parsing.cc +++ b/src/core/ext/transport/chttp2/transport/parsing.cc @@ -48,7 +48,9 @@ #include "src/core/ext/transport/chttp2/transport/http_trace.h" #include "src/core/ext/transport/chttp2/transport/internal.h" #include "src/core/ext/transport/chttp2/transport/ping_rate_policy.h" +#include "src/core/lib/channel/call_tracer.h" #include "src/core/lib/channel/channelz.h" +#include "src/core/lib/channel/context.h" #include "src/core/lib/debug/trace.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/status_helper.h" @@ -856,10 +858,18 @@ grpc_error_handle grpc_chttp2_header_parser_parse(void* hpack_parser, const grpc_slice& slice, int is_last) { auto* parser = static_cast(hpack_parser); + grpc_core::CallTracerAnnotationInterface* call_tracer = nullptr; if (s != nullptr) { s->stats.incoming.header_bytes += GRPC_SLICE_LENGTH(slice); + + if (s->context != nullptr) { + call_tracer = static_cast( + static_cast( + s->context)[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE] + .value); + } } - grpc_error_handle error = parser->Parse(slice, is_last != 0); + grpc_error_handle error = parser->Parse(slice, is_last != 0, call_tracer); if (!error.ok()) { return error; } diff --git a/src/core/lib/channel/call_tracer.h b/src/core/lib/channel/call_tracer.h index 0e291a6a557ea..9015bd543b75c 100644 --- a/src/core/lib/channel/call_tracer.h +++ b/src/core/lib/channel/call_tracer.h @@ -51,6 +51,7 @@ class CallTracerAnnotationInterface { public: // Enum associated with types of Annotations. enum class AnnotationType { + kMetadataSizes, kDoNotUse_MustBeLast, }; @@ -60,9 +61,7 @@ class CallTracerAnnotationInterface { explicit Annotation(AnnotationType type) : type_(type) {} AnnotationType type() const { return type_; } virtual std::string ToString() const = 0; - - protected: - ~Annotation() {} + virtual ~Annotation() = default; private: const AnnotationType type_; diff --git a/src/core/lib/channel/promise_based_filter.cc b/src/core/lib/channel/promise_based_filter.cc index 84c8f3da28c8f..27f3e5bca8d9d 100644 --- a/src/core/lib/channel/promise_based_filter.cc +++ b/src/core/lib/channel/promise_based_filter.cc @@ -302,6 +302,9 @@ BaseCallData::Flusher::~Flusher() { gpr_log(GPR_INFO, "FLUSHER:forward batch: %s", grpc_transport_stream_op_batch_string(release_[0], false).c_str()); } + if (call_->call_context_ != nullptr && call_->call_context_->traced()) { + release_[0]->is_traced = true; + } grpc_call_next_op(call_->elem(), release_[0]); GRPC_CALL_STACK_UNREF(call_->call_stack(), "flusher"); } diff --git a/src/cpp/ext/filters/census/client_filter.cc b/src/cpp/ext/filters/census/client_filter.cc index aed4f4aa14c85..155e99fd46a1f 100644 --- a/src/cpp/ext/filters/census/client_filter.cc +++ b/src/cpp/ext/filters/census/client_filter.cc @@ -297,6 +297,13 @@ void OpenCensusCallTracer::OpenCensusCallAttemptTracer::RecordAnnotation( } switch (annotation.type()) { + case AnnotationType::kMetadataSizes: + // This annotation is expensive to create. We should only create it if the + // call is being sampled, not just recorded. + if (IsSampled()) { + context_.AddSpanAnnotation(annotation.ToString(), {}); + } + break; default: context_.AddSpanAnnotation(annotation.ToString(), {}); } @@ -381,6 +388,13 @@ void OpenCensusCallTracer::RecordAnnotation(const Annotation& annotation) { } switch (annotation.type()) { + case AnnotationType::kMetadataSizes: + // This annotation is expensive to create. We should only create it if the + // call is being sampled, not just recorded. + if (IsSampled()) { + context_.AddSpanAnnotation(annotation.ToString(), {}); + } + break; default: context_.AddSpanAnnotation(annotation.ToString(), {}); } diff --git a/src/cpp/ext/filters/census/server_call_tracer.cc b/src/cpp/ext/filters/census/server_call_tracer.cc index 9e6672259a650..4a6bb0ed480da 100644 --- a/src/cpp/ext/filters/census/server_call_tracer.cc +++ b/src/cpp/ext/filters/census/server_call_tracer.cc @@ -169,6 +169,13 @@ class OpenCensusServerCallTracer : public grpc_core::ServerCallTracer { } switch (annotation.type()) { + case AnnotationType::kMetadataSizes: + // This annotation is expensive to create. We should only create it if + // the call is being sampled, not just recorded. + if (IsSampled()) { + context_.AddSpanAnnotation(annotation.ToString(), {}); + } + break; default: context_.AddSpanAnnotation(annotation.ToString(), {}); } diff --git a/src/python/grpcio_observability/grpc_observability/client_call_tracer.cc b/src/python/grpcio_observability/grpc_observability/client_call_tracer.cc index 35b3eba2c7931..40b8b38531b64 100644 --- a/src/python/grpcio_observability/grpc_observability/client_call_tracer.cc +++ b/src/python/grpcio_observability/grpc_observability/client_call_tracer.cc @@ -69,6 +69,13 @@ void PythonOpenCensusCallTracer::RecordAnnotation( } switch (annotation.type()) { + case AnnotationType::kMetadataSizes: + // This annotation is expensive to create. We should only create it if + // the call is being sampled, not just recorded. + if (IsSampled()) { + context_.AddSpanAnnotation(annotation.ToString()); + } + break; default: context_.AddSpanAnnotation(annotation.ToString()); } @@ -302,6 +309,13 @@ void PythonOpenCensusCallTracer::PythonOpenCensusCallAttemptTracer:: } switch (annotation.type()) { + case AnnotationType::kMetadataSizes: + // This annotation is expensive to create. We should only create it if + // the call is being sampled, not just recorded. + if (IsSampled()) { + context_.AddSpanAnnotation(annotation.ToString()); + } + break; default: context_.AddSpanAnnotation(annotation.ToString()); } diff --git a/src/python/grpcio_observability/grpc_observability/server_call_tracer.cc b/src/python/grpcio_observability/grpc_observability/server_call_tracer.cc index bf347ce02e518..62ff0624b7c52 100644 --- a/src/python/grpcio_observability/grpc_observability/server_call_tracer.cc +++ b/src/python/grpcio_observability/grpc_observability/server_call_tracer.cc @@ -162,6 +162,13 @@ class PythonOpenCensusServerCallTracer : public grpc_core::ServerCallTracer { } switch (annotation.type()) { + case AnnotationType::kMetadataSizes: + // This annotation is expensive to create. We should only create it if + // the call is being sampled, not just recorded. + if (IsSampled()) { + context_.AddSpanAnnotation(annotation.ToString()); + } + break; default: context_.AddSpanAnnotation(annotation.ToString()); } diff --git a/test/core/transport/chttp2/hpack_parser_fuzzer_test.cc b/test/core/transport/chttp2/hpack_parser_fuzzer_test.cc index 987935db69126..f87d80794a847 100644 --- a/test/core/transport/chttp2/hpack_parser_fuzzer_test.cc +++ b/test/core/transport/chttp2/hpack_parser_fuzzer_test.cc @@ -116,7 +116,8 @@ DEFINE_PROTO_FUZZER(const hpack_parser_fuzzer::Msg& msg) { const auto& parse = frame.parse(idx); grpc_slice buffer = grpc_slice_from_copied_buffer(parse.data(), parse.size()); - auto err = parser->Parse(buffer, idx == frame.parse_size() - 1); + auto err = parser->Parse(buffer, idx == frame.parse_size() - 1, + /*call_tracer=*/nullptr); grpc_slice_unref(buffer); stop_buffering_ctr--; if (0 == stop_buffering_ctr) parser->StopBufferingFrame(); diff --git a/test/core/transport/chttp2/hpack_parser_input_size_fuzzer.cc b/test/core/transport/chttp2/hpack_parser_input_size_fuzzer.cc index a67529126b8ed..d83e5d9ff28b0 100644 --- a/test/core/transport/chttp2/hpack_parser_input_size_fuzzer.cc +++ b/test/core/transport/chttp2/hpack_parser_input_size_fuzzer.cc @@ -102,7 +102,8 @@ absl::StatusOr TestVector(grpc_slice_split_mode mode, absl::Status found_err; for (i = 0; i < nslices; i++) { ExecCtx exec_ctx; - auto err = parser.Parse(slices[i], i == nslices - 1); + auto err = + parser.Parse(slices[i], i == nslices - 1, /*call_tracer=*/nullptr); if (!err.ok()) { if (!IsStreamError(err)) return err; if (found_err.ok()) found_err = err; diff --git a/test/core/transport/chttp2/hpack_parser_test.cc b/test/core/transport/chttp2/hpack_parser_test.cc index df72bff161d5a..d7a72d01e3ca7 100644 --- a/test/core/transport/chttp2/hpack_parser_test.cc +++ b/test/core/transport/chttp2/hpack_parser_test.cc @@ -140,7 +140,8 @@ class ParseTest : public ::testing::TestWithParam { bool saw_error = false; for (i = 0; i < nslices; i++) { ExecCtx exec_ctx; - auto err = parser_->Parse(slices[i], i == nslices - 1); + auto err = + parser_->Parse(slices[i], i == nslices - 1, /*call_tracer=*/nullptr); if (!err.ok() && (flags & kFailureIsConnectionError) == 0) { EXPECT_TRUE(IsStreamError(err)) << err; } diff --git a/test/core/transport/chttp2/hpack_sync_fuzzer.cc b/test/core/transport/chttp2/hpack_sync_fuzzer.cc index 471c71bef7ed2..291f677514206 100644 --- a/test/core/transport/chttp2/hpack_sync_fuzzer.cc +++ b/test/core/transport/chttp2/hpack_sync_fuzzer.cc @@ -126,8 +126,9 @@ void FuzzOneInput(const hpack_sync_fuzzer::Msg& msg) { HPackParser::LogInfo{1, HPackParser::LogInfo::kHeaders, false}); std::vector> seen_errors; for (size_t i = 0; i < encode_output.Count(); i++) { - auto err = parser.Parse(encode_output.c_slice_at(i), - i == (encode_output.Count() - 1)); + auto err = + parser.Parse(encode_output.c_slice_at(i), + i == (encode_output.Count() - 1), /*call_tracer=*/nullptr); if (!err.ok()) { seen_errors.push_back(std::make_pair(i, err)); // If we get a connection error (i.e. not a stream error), stop parsing, diff --git a/test/cpp/ext/filters/census/stats_plugin_end2end_test.cc b/test/cpp/ext/filters/census/stats_plugin_end2end_test.cc index 679d3494ca210..689b28831edfe 100644 --- a/test/cpp/ext/filters/census/stats_plugin_end2end_test.cc +++ b/test/cpp/ext/filters/census/stats_plugin_end2end_test.cc @@ -631,6 +631,9 @@ bool IsAnnotationPresent( for (const auto& event : span->annotations().events()) { if (absl::StrContains(event.event().description(), annotation)) { return true; + } else if (::testing::Matches(::testing::ContainsRegex(annotation))( + event.event().description())) { + return true; } } return false; @@ -807,6 +810,50 @@ TEST_F(StatsPluginEnd2EndTest, TestMessageSizeWithCompressionAnnotations) { "Received decompressed message: 1026 bytes")); } +// Tests that the metadata size trace annotations are present. +TEST_F(StatsPluginEnd2EndTest, TestMetadataSizeAnnotations) { + { + // Client spans are ended when the ClientContext's destructor is invoked. + EchoRequest request; + EchoResponse response; + + grpc::ClientContext context; + ::opencensus::trace::AlwaysSampler always_sampler; + ::opencensus::trace::StartSpanOptions options; + options.sampler = &always_sampler; + auto sampling_span = + ::opencensus::trace::Span::StartSpan("sampling", nullptr, options); + grpc::CensusContext app_census_context("root", &sampling_span, + ::opencensus::tags::TagMap{}); + context.set_census_context( + reinterpret_cast(&app_census_context)); + context.AddMetadata(kExpectedTraceIdKey, + app_census_context.Span().context().trace_id().ToHex()); + traces_recorder_->StartRecording(); + grpc::Status status = stub_->Echo(&context, request, &response); + EXPECT_TRUE(status.ok()); + } + absl::SleepFor(absl::Milliseconds(500 * grpc_test_slowdown_factor())); + TestUtils::Flush(); + ::opencensus::trace::exporter::SpanExporterTestPeer::ExportForTesting(); + traces_recorder_->StopRecording(); + auto recorded_spans = traces_recorder_->GetAndClearSpans(); + // Check presence of metadata size annotations in client span. + auto sent_span_data = + GetSpanByName(recorded_spans, absl::StrCat("Sent.", client_method_name_)); + ASSERT_NE(sent_span_data, recorded_spans.end()); + EXPECT_TRUE(IsAnnotationPresent( + sent_span_data, + "gRPC metadata soft_limit:[0-9]{4,5},hard_limit:[0-9]{5},:status:[" + "0-9]{1,2},content-type:[0-9]{1,2},grpc-encoding:[0-" + "9]{1,2},grpc-accept-encoding:[0-9]{1,2},")); + EXPECT_TRUE(IsAnnotationPresent( + sent_span_data, + "gRPC metadata " + "soft_limit:[0-9]{4,5},hard_limit:[0-9]{5},grpc-status:[0-9]{1,2},grpc-" + "server-stats-bin:[0-9]{1,2},")); +} + // Test the working of GRPC_ARG_DISABLE_OBSERVABILITY. TEST_F(StatsPluginEnd2EndTest, TestObservabilityDisabledChannelArg) { { diff --git a/test/cpp/microbenchmarks/bm_chttp2_hpack.cc b/test/cpp/microbenchmarks/bm_chttp2_hpack.cc index f24810c5aa784..b512386655a5c 100644 --- a/test/cpp/microbenchmarks/bm_chttp2_hpack.cc +++ b/test/cpp/microbenchmarks/bm_chttp2_hpack.cc @@ -356,7 +356,8 @@ static void BM_HpackParserParseHeader(benchmark::State& state) { 1, grpc_core::HPackParser::LogInfo::kHeaders, false}); auto parse_vec = [&p](const std::vector& slices) { for (size_t i = 0; i < slices.size(); ++i) { - auto error = p.Parse(slices[i], i == slices.size() - 1); + auto error = + p.Parse(slices[i], i == slices.size() - 1, /*call_tracer=*/nullptr); GPR_ASSERT(error.ok()); } }; From 8aeb1e257e6a7c8efcab7d7427d3f6982a0b4471 Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Tue, 1 Aug 2023 12:31:41 -0700 Subject: [PATCH 095/205] [benchmark] Increase the C++ benchmarks' warmup times (#33941) The Core/C++ implementation needs more warmup time to scale the thread pool. --- .../run_tests/performance/scenario_config.py | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tools/run_tests/performance/scenario_config.py b/tools/run_tests/performance/scenario_config.py index 395c8df25e072..c199e571046f1 100644 --- a/tools/run_tests/performance/scenario_config.py +++ b/tools/run_tests/performance/scenario_config.py @@ -18,6 +18,7 @@ WARMUP_SECONDS = 5 JAVA_WARMUP_SECONDS = 15 # Java needs more warmup time for JIT to kick in. +CXX_WARMUP_SECONDS = 30 # Core needs more warmup time for the thread pool to scale appropriately. BENCHMARK_SECONDS = 30 SMOKETEST = "smoketest" @@ -278,6 +279,7 @@ def scenarios(self): secure=False, async_server_threads=1, categories=[PSM], + warmup_seconds=CXX_WARMUP_SECONDS, ) # TODO(ctiller): add 70% load latency test @@ -294,6 +296,7 @@ def scenarios(self): num_clients=1, secure=False, categories=[SWEEP], + warmup_seconds=CXX_WARMUP_SECONDS, ) yield _ping_pong_scenario( @@ -309,6 +312,7 @@ def scenarios(self): num_clients=1, secure=False, categories=[SWEEP], + warmup_seconds=CXX_WARMUP_SECONDS, ) # Scenario was added in https://github.com/grpc/grpc/pull/12987, but its purpose is unclear @@ -328,6 +332,7 @@ def scenarios(self): async_server_threads=16, server_threads_per_cq=1, categories=[SCALABLE], + warmup_seconds=CXX_WARMUP_SECONDS, ) for secure in [True, False]: @@ -346,6 +351,7 @@ def scenarios(self): categories=smoketest_categories + inproc_categories + [SCALABLE], + warmup_seconds=CXX_WARMUP_SECONDS, ) yield _ping_pong_scenario( @@ -362,6 +368,7 @@ def scenarios(self): categories=smoketest_categories + inproc_categories + [SCALABLE], + warmup_seconds=CXX_WARMUP_SECONDS, ) for mps in geometric_progression(10, 20, 10): @@ -379,6 +386,7 @@ def scenarios(self): categories=smoketest_categories + inproc_categories + [SCALABLE], + warmup_seconds=CXX_WARMUP_SECONDS, ) for mps in geometric_progression(1, 200, math.sqrt(10)): @@ -394,6 +402,7 @@ def scenarios(self): messages_per_stream=mps, minimal_stack=not secure, categories=[SWEEP], + warmup_seconds=CXX_WARMUP_SECONDS, ) yield _ping_pong_scenario( @@ -410,6 +419,7 @@ def scenarios(self): categories=inproc_categories + [SCALABLE], channels=1, outstanding=100, + warmup_seconds=CXX_WARMUP_SECONDS, ) yield _ping_pong_scenario( @@ -425,6 +435,7 @@ def scenarios(self): secure=secure, minimal_stack=not secure, categories=inproc_categories + [SCALABLE], + warmup_seconds=CXX_WARMUP_SECONDS, ) yield _ping_pong_scenario( @@ -438,6 +449,7 @@ def scenarios(self): client_threads_per_cq=1000000, server_threads_per_cq=1000000, categories=[SWEEP], + warmup_seconds=CXX_WARMUP_SECONDS, ) yield _ping_pong_scenario( @@ -451,6 +463,7 @@ def scenarios(self): client_threads_per_cq=1000000, server_threads_per_cq=1000000, categories=inproc_categories + [SCALABLE], + warmup_seconds=CXX_WARMUP_SECONDS, ) yield _ping_pong_scenario( @@ -463,6 +476,7 @@ def scenarios(self): client_threads_per_cq=1000000, server_threads_per_cq=1000000, categories=inproc_categories + [SCALABLE], + warmup_seconds=CXX_WARMUP_SECONDS, ) yield _ping_pong_scenario( @@ -476,6 +490,7 @@ def scenarios(self): minimal_stack=not secure, secure=secure, categories=[SWEEP], + warmup_seconds=CXX_WARMUP_SECONDS, ) yield _ping_pong_scenario( @@ -490,6 +505,7 @@ def scenarios(self): categories=smoketest_categories + inproc_categories + [SCALABLE], + warmup_seconds=CXX_WARMUP_SECONDS, ) yield _ping_pong_scenario( @@ -505,6 +521,7 @@ def scenarios(self): secure=secure, minimal_stack=not secure, categories=inproc_categories + [SCALABLE], + warmup_seconds=CXX_WARMUP_SECONDS, ) yield _ping_pong_scenario( @@ -517,6 +534,7 @@ def scenarios(self): secure=secure, minimal_stack=not secure, categories=[SWEEP], + warmup_seconds=CXX_WARMUP_SECONDS, ) yield _ping_pong_scenario( @@ -531,6 +549,7 @@ def scenarios(self): categories=smoketest_categories + inproc_categories + [SCALABLE, DASHBOARD], + warmup_seconds=CXX_WARMUP_SECONDS, ) for rpc_type in [ @@ -553,6 +572,7 @@ def scenarios(self): minimal_stack=not secure, secure=secure, categories=list(DEFAULT_CATEGORIES) + maybe_dashboard, + warmup_seconds=CXX_WARMUP_SECONDS, ) for size in geometric_progression( @@ -570,6 +590,7 @@ def scenarios(self): secure=secure, minimal_stack=not secure, categories=[SWEEP], + warmup_seconds=CXX_WARMUP_SECONDS, ) maybe_scalable = [SCALABLE] @@ -602,6 +623,7 @@ def scenarios(self): categories=inproc_categories + maybe_scalable + maybe_dashboard, + warmup_seconds=CXX_WARMUP_SECONDS, ) # TODO(vjpai): Re-enable this test. It has a lot of timeouts @@ -615,6 +637,7 @@ def scenarios(self): # unconstrained_client=synchronicity, # secure=secure, # categories=smoketest_categories+[SCALABLE], + # warmup_seconds=CXX_WARMUP_SECONDS, # resource_quota_size=500*1024) if rpc_type == "streaming": @@ -630,6 +653,7 @@ def scenarios(self): messages_per_stream=mps, minimal_stack=not secure, categories=inproc_categories + [SCALABLE], + warmup_seconds=CXX_WARMUP_SECONDS, ) for mps in geometric_progression(1, 200, math.sqrt(10)): @@ -644,6 +668,7 @@ def scenarios(self): messages_per_stream=mps, minimal_stack=not secure, categories=[SWEEP], + warmup_seconds=CXX_WARMUP_SECONDS, ) for channels in geometric_progression( @@ -674,6 +699,7 @@ def scenarios(self): categories=[SWEEP], channels=channels, outstanding=outstanding, + warmup_seconds=CXX_WARMUP_SECONDS, ) def __str__(self): From 13e75efeb364e39a56c59ac334531cdc32e7eb9e Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Tue, 1 Aug 2023 12:31:55 -0700 Subject: [PATCH 096/205] [benchmark] Add `event_engine_listener,work_stealing` benchmark (#33940) This enables both of the `event_engine_listener` and `work_stealing` experiments together, which we expect will have better performance. The benchmark-config-generation script required some light modification to support running multiple experiments at the same time. --- ...e2e_performance_gke_cxx_experiments_framework.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/internal_ci/linux/grpc_e2e_performance_gke_cxx_experiments_framework.sh b/tools/internal_ci/linux/grpc_e2e_performance_gke_cxx_experiments_framework.sh index d711ab2a6d71b..227821cca0a04 100755 --- a/tools/internal_ci/linux/grpc_e2e_performance_gke_cxx_experiments_framework.sh +++ b/tools/internal_ci/linux/grpc_e2e_performance_gke_cxx_experiments_framework.sh @@ -17,7 +17,7 @@ set -ex # Purpose: Run the C++ "dashboard" benchmarks for a set of gRPC-core experiments. # # To run the benchmarks, add your experiment to the set below. -GRPC_EXPERIMENTS=("event_engine_listener" "work_stealing") +GRPC_EXPERIMENTS=("event_engine_listener" "work_stealing" "event_engine_listener,work_stealing") # Enter the gRPC repo root. cd "$(dirname "$0")/../../.." @@ -86,14 +86,17 @@ declare -a loadtest_files=() # Build test configurations. buildConfigs() { local -r pool="$1" - local -r table="$2" + local -r base_table="$2" local -r experiment="$3" shift 3 + # Multiple experiments are delimited by `__` (two underscores) in BigQuery. + SANITIZED_EXPERIMENT="${experiment//,/__}" + OUTFILE="loadtest_with_prebuilt_workers_${pool}_${SANITIZED_EXPERIMENT}.yaml" tools/run_tests/performance/loadtest_config.py "$@" \ -t ./tools/run_tests/performance/templates/loadtest_template_prebuilt_cxx_experiments.yaml \ -s driver_pool="${DRIVER_POOL}" -s driver_image= \ -s client_pool="${pool}" -s server_pool="${pool}" \ - -s big_query_table="${table}_${experiment}" -s timeout_seconds=900 \ + -s big_query_table="${base_table}_${SANITIZED_EXPERIMENT}" -s timeout_seconds=900 \ -s prebuilt_image_prefix="${PREBUILT_IMAGE_PREFIX}" \ -s prebuilt_image_tag="${UNIQUE_IDENTIFIER}" \ -s grpc_experiment="${experiment}" \ @@ -107,9 +110,9 @@ buildConfigs() { -a pool="${pool}" --category=dashboard \ --allow_client_language=c++ --allow_server_language=c++ \ --allow_server_language=node \ - -o "loadtest_with_prebuilt_workers_${pool}_${experiment}.yaml" + -o "${OUTFILE}" - loadtest_files+=(-i "loadtest_with_prebuilt_workers_${pool}_${experiment}.yaml") + loadtest_files+=(-i "${OUTFILE}") } for experiment in "${GRPC_EXPERIMENTS[@]}"; do From e923706d6f41e888b356420cf140f86dced87911 Mon Sep 17 00:00:00 2001 From: apolcyn Date: Tue, 1 Aug 2023 14:45:45 -0700 Subject: [PATCH 097/205] [c-ares DNS resolver] Revert "Revert "[c-ares DNS resolver] Fix file descriptor use-after-close bug when c-ares writes succeed but subsequent read fails" (#33934)" (#33942) Rolls forward https://github.com/grpc/grpc/pull/33871 Second and third commits here fix internal build issues In particular, add a `// IWYU pragma: no_include ` since `ares.h` [includes that anyways](https://github.com/c-ares/c-ares/blob/bad62225b7f6b278b92e8e85a255600b629ef517/include/ares.h#L23) (and seems unlikely for that to change since it would be breaking) --- CMakeLists.txt | 1 + build_autogenerated.yaml | 2 + .../dns/c_ares/grpc_ares_ev_driver_posix.cc | 113 +++++++++- .../resolver/dns/c_ares/grpc_ares_wrapper.cc | 5 + .../resolver/dns/c_ares/grpc_ares_wrapper.h | 3 + test/core/util/BUILD | 30 +++ .../util/socket_use_after_close_detector.cc | 199 ++++++++++++++++++ .../util/socket_use_after_close_detector.h | 56 +++++ test/cpp/naming/BUILD | 1 + test/cpp/naming/cancel_ares_query_test.cc | 149 +++++++------ .../generate_resolver_component_tests.bzl | 1 + test/cpp/naming/resolver_component_test.cc | 153 +------------- 12 files changed, 493 insertions(+), 220 deletions(-) create mode 100644 test/core/util/socket_use_after_close_detector.cc create mode 100644 test/core/util/socket_use_after_close_detector.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b3a427c6f470..e2006b26891bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7664,6 +7664,7 @@ if(gRPC_BUILD_TESTS) add_executable(cancel_ares_query_test test/core/end2end/cq_verifier.cc test/core/util/fake_udp_and_tcp_server.cc + test/core/util/socket_use_after_close_detector.cc test/cpp/naming/cancel_ares_query_test.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index e389a78d0b54f..11b8392647699 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -5501,9 +5501,11 @@ targets: headers: - test/core/end2end/cq_verifier.h - test/core/util/fake_udp_and_tcp_server.h + - test/core/util/socket_use_after_close_detector.h src: - test/core/end2end/cq_verifier.cc - test/core/util/fake_udp_and_tcp_server.cc + - test/core/util/socket_use_after_close_detector.cc - test/cpp/naming/cancel_ares_query_test.cc deps: - grpc++_test_config diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc index 4f0813edccab3..79deb800fb89a 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc @@ -17,28 +17,37 @@ // #include -#include -#include - -#include "absl/base/thread_annotations.h" - -#include "src/core/lib/gprpp/sync.h" -#include "src/core/lib/iomgr/closure.h" -#include "src/core/lib/iomgr/error.h" -#include "src/core/lib/iomgr/iomgr_fwd.h" #include "src/core/lib/iomgr/port.h" + #if GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_ARES_EV_DRIVER) -#include +// IWYU pragma: no_include + #include +#include +#include +#include + +#include +#include +#include +#include #include +#include "absl/base/thread_annotations.h" #include "absl/strings/str_cat.h" +#include + #include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h" #include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h" +#include "src/core/lib/gprpp/sync.h" +#include "src/core/lib/iomgr/closure.h" +#include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/ev_posix.h" +#include "src/core/lib/iomgr/iomgr_fwd.h" +#include "src/core/lib/iomgr/socket_utils_posix.h" namespace grpc_core { @@ -98,12 +107,94 @@ class GrpcPolledFdPosix : public GrpcPolledFd { class GrpcPolledFdFactoryPosix : public GrpcPolledFdFactory { public: + ~GrpcPolledFdFactoryPosix() override { + for (auto& fd : owned_fds_) { + close(fd); + } + } + GrpcPolledFd* NewGrpcPolledFdLocked( ares_socket_t as, grpc_pollset_set* driver_pollset_set) override { + auto insert_result = owned_fds_.insert(as); + GPR_ASSERT(insert_result.second); return new GrpcPolledFdPosix(as, driver_pollset_set); } - void ConfigureAresChannelLocked(ares_channel /*channel*/) override {} + void ConfigureAresChannelLocked(ares_channel channel) override { + ares_set_socket_functions(channel, &kSockFuncs, this); + ares_set_socket_configure_callback( + channel, &GrpcPolledFdFactoryPosix::ConfigureSocket, nullptr); + } + + private: + /// Overridden socket API for c-ares + static ares_socket_t Socket(int af, int type, int protocol, + void* /*user_data*/) { + return socket(af, type, protocol); + } + + /// Overridden connect API for c-ares + static int Connect(ares_socket_t as, const struct sockaddr* target, + ares_socklen_t target_len, void* /*user_data*/) { + return connect(as, target, target_len); + } + + /// Overridden writev API for c-ares + static ares_ssize_t WriteV(ares_socket_t as, const struct iovec* iov, + int iovec_count, void* /*user_data*/) { + return writev(as, iov, iovec_count); + } + + /// Overridden recvfrom API for c-ares + static ares_ssize_t RecvFrom(ares_socket_t as, void* data, size_t data_len, + int flags, struct sockaddr* from, + ares_socklen_t* from_len, void* /*user_data*/) { + return recvfrom(as, data, data_len, flags, from, from_len); + } + + /// Overridden close API for c-ares + static int Close(ares_socket_t as, void* user_data) { + GrpcPolledFdFactoryPosix* self = + static_cast(user_data); + if (self->owned_fds_.find(as) == self->owned_fds_.end()) { + // c-ares owns this fd, grpc has never seen it + return close(as); + } + return 0; + } + + /// Because we're using socket API overrides, c-ares won't + /// perform its typical configuration on the socket. See + /// https://github.com/c-ares/c-ares/blob/bad62225b7f6b278b92e8e85a255600b629ef517/src/lib/ares_process.c#L1018. + /// So we use the configure socket callback override and copy default + /// settings that c-ares would normally apply on posix platforms: + /// - non-blocking + /// - cloexec flag + /// - disable nagle */ + static int ConfigureSocket(ares_socket_t fd, int type, void* /*user_data*/) { + grpc_error_handle err; + err = grpc_set_socket_nonblocking(fd, true); + if (!err.ok()) return -1; + err = grpc_set_socket_cloexec(fd, true); + if (!err.ok()) return -1; + if (type == SOCK_STREAM) { + err = grpc_set_socket_low_latency(fd, true); + if (!err.ok()) return -1; + } + return 0; + } + + const struct ares_socket_functions kSockFuncs = { + &GrpcPolledFdFactoryPosix::Socket /* socket */, + &GrpcPolledFdFactoryPosix::Close /* close */, + &GrpcPolledFdFactoryPosix::Connect /* connect */, + &GrpcPolledFdFactoryPosix::RecvFrom /* recvfrom */, + &GrpcPolledFdFactoryPosix::WriteV /* writev */, + }; + + // fds that are used/owned by grpc - we (grpc) will close them rather than + // c-ares + std::unordered_set owned_fds_; }; std::unique_ptr NewGrpcPolledFdFactory(Mutex* /* mu */) { diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc index a088c114585b8..3032bfda7970a 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc @@ -515,6 +515,8 @@ static void noop_inject_channel_config(ares_channel* /*channel*/) {} void (*grpc_ares_test_only_inject_config)(ares_channel* channel) = noop_inject_channel_config; +bool g_grpc_ares_test_only_force_tcp = false; + grpc_error_handle grpc_ares_ev_driver_create_locked( grpc_ares_ev_driver** ev_driver, grpc_pollset_set* pollset_set, int query_timeout_ms, grpc_ares_request* request) @@ -523,6 +525,9 @@ grpc_error_handle grpc_ares_ev_driver_create_locked( ares_options opts; memset(&opts, 0, sizeof(opts)); opts.flags |= ARES_FLAG_STAYOPEN; + if (g_grpc_ares_test_only_force_tcp) { + opts.flags |= ARES_FLAG_USEVC; + } int status = ares_init_options(&(*ev_driver)->channel, &opts, ARES_OPT_FLAGS); grpc_ares_test_only_inject_config(&(*ev_driver)->channel); GRPC_CARES_TRACE_LOG("request:%p grpc_ares_ev_driver_create_locked", request); diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h index 69f52bc3df11b..5970e131cccfc 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h @@ -133,4 +133,7 @@ void grpc_cares_wrapper_address_sorting_sort( // Exposed in this header for C-core tests only extern void (*grpc_ares_test_only_inject_config)(ares_channel* channel); +// Exposed in this header for C-core tests only +extern bool g_grpc_ares_test_only_force_tcp; + #endif // GRPC_SRC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_WRAPPER_H diff --git a/test/core/util/BUILD b/test/core/util/BUILD index 581371b05f74f..2b88fd11f5884 100644 --- a/test/core/util/BUILD +++ b/test/core/util/BUILD @@ -363,6 +363,36 @@ grpc_cc_library( ], ) +grpc_cc_library( + name = "socket_use_after_close_detector", + testonly = True, + srcs = ["socket_use_after_close_detector.cc"], + hdrs = ["socket_use_after_close_detector.h"], + external_deps = ["gtest"], + language = "C++", + deps = [ + "grpc_test_util", + "//:gpr", + "//:grpc", + "//src/core:grpc_sockaddr", + ], +) + +grpc_cc_library( + name = "socket_use_after_close_detector_unsecure", + testonly = True, + srcs = ["socket_use_after_close_detector.cc"], + hdrs = ["socket_use_after_close_detector.h"], + external_deps = ["gtest"], + language = "C++", + deps = [ + "grpc_test_util_unsecure", + "//:gpr", + "//:grpc", + "//src/core:grpc_sockaddr", + ], +) + grpc_cc_library( name = "build", srcs = ["build.cc"], diff --git a/test/core/util/socket_use_after_close_detector.cc b/test/core/util/socket_use_after_close_detector.cc new file mode 100644 index 0000000000000..1deaa67831d03 --- /dev/null +++ b/test/core/util/socket_use_after_close_detector.cc @@ -0,0 +1,199 @@ +// +// +// Copyright 2017 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#include + +#include "test/core/util/socket_use_after_close_detector.h" + +#include +#include +#include + +// IWYU pragma: no_include +// IWYU pragma: no_include + +#include +#include +#include +#include +#include + +#include "gtest/gtest.h" + +#include + +#include "src/core/lib/iomgr/sockaddr.h" +#include "test/core/util/port.h" + +// TODO(unknown): pull in different headers when enabling this +// test on windows. Also set BAD_SOCKET_RETURN_VAL +// to INVALID_SOCKET on windows. +#ifdef GPR_WINDOWS +#include "src/core/lib/iomgr/socket_windows.h" +#include "src/core/lib/iomgr/tcp_windows.h" + +#define BAD_SOCKET_RETURN_VAL INVALID_SOCKET +#else +#define BAD_SOCKET_RETURN_VAL (-1) +#endif + +namespace { + +#ifdef GPR_WINDOWS +void OpenAndCloseSocketsStressLoop(int port, gpr_event* done_ev) { + sockaddr_in6 addr; + memset(&addr, 0, sizeof(addr)); + addr.sin6_family = AF_INET6; + addr.sin6_port = htons(port); + ((char*)&addr.sin6_addr)[15] = 1; + for (;;) { + if (gpr_event_get(done_ev)) { + return; + } + std::vector sockets; + for (size_t i = 0; i < 50; i++) { + SOCKET s = WSASocket(AF_INET6, SOCK_STREAM, IPPROTO_TCP, nullptr, 0, + WSA_FLAG_OVERLAPPED); + ASSERT_TRUE(s != BAD_SOCKET_RETURN_VAL) + << "Failed to create TCP ipv6 socket"; + char val = 1; + ASSERT_TRUE(setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) != + SOCKET_ERROR) + << "Failed to set socketopt reuseaddr. WSA error: " + + std::to_string(WSAGetLastError()); + ASSERT_TRUE(grpc_tcp_set_non_block(s) == absl::OkStatus()) + << "Failed to set socket non-blocking"; + ASSERT_TRUE(bind(s, (const sockaddr*)&addr, sizeof(addr)) != SOCKET_ERROR) + << "Failed to bind socket " + std::to_string(s) + + " to [::1]:" + std::to_string(port) + + ". WSA error: " + std::to_string(WSAGetLastError()); + ASSERT_TRUE(listen(s, 1) != SOCKET_ERROR) + << "Failed to listen on socket " + std::to_string(s) + + ". WSA error: " + std::to_string(WSAGetLastError()); + sockets.push_back(s); + } + // Do a non-blocking accept followed by a close on all of those sockets. + // Do this in a separate loop to try to induce a time window to hit races. + for (size_t i = 0; i < sockets.size(); i++) { + ASSERT_TRUE(accept(sockets[i], nullptr, nullptr) == INVALID_SOCKET) + << "Accept on phony socket unexpectedly accepted actual connection."; + ASSERT_TRUE(WSAGetLastError() == WSAEWOULDBLOCK) + << "OpenAndCloseSocketsStressLoop accept on socket " + + std::to_string(sockets[i]) + + " failed in " + "an unexpected way. " + "WSA error: " + + std::to_string(WSAGetLastError()) + + ". Socket use-after-close bugs are likely."; + ASSERT_TRUE(closesocket(sockets[i]) != SOCKET_ERROR) + << "Failed to close socket: " + std::to_string(sockets[i]) + + ". WSA error: " + std::to_string(WSAGetLastError()); + } + } + return; +} +#else +void OpenAndCloseSocketsStressLoop(int port, gpr_event* done_ev) { + // The goal of this loop is to catch socket + // "use after close" bugs within the c-ares resolver by acting + // like some separate thread doing I/O. + // It's goal is to try to hit race conditions whereby: + // 1) The c-ares resolver closes a socket. + // 2) This loop opens a socket with (coincidentally) the same handle. + // 3) the c-ares resolver mistakenly uses that same socket without + // realizing that its closed. + // 4) This loop performs an operation on that socket that should + // succeed but instead fails because of what the c-ares + // resolver did in the meantime. + sockaddr_in6 addr; + memset(&addr, 0, sizeof(addr)); + addr.sin6_family = AF_INET6; + addr.sin6_port = htons(port); + (reinterpret_cast(&addr.sin6_addr))[15] = 1; + for (;;) { + if (gpr_event_get(done_ev)) { + return; + } + std::vector sockets; + // First open a bunch of sockets, bind and listen + // '50' is an arbitrary number that, experimentally, + // has a good chance of catching bugs. + for (size_t i = 0; i < 50; i++) { + int s = socket(AF_INET6, SOCK_STREAM, 0); + int val = 1; + ASSERT_TRUE(setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &val, sizeof(val)) == + 0) + << "Failed to set socketopt reuseport"; + ASSERT_TRUE(setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) == + 0) + << "Failed to set socket reuseaddr"; + ASSERT_TRUE(fcntl(s, F_SETFL, O_NONBLOCK) == 0) + << "Failed to set socket non-blocking"; + ASSERT_TRUE(s != BAD_SOCKET_RETURN_VAL) + << "Failed to create TCP ipv6 socket"; + ASSERT_TRUE(bind(s, (const sockaddr*)&addr, sizeof(addr)) == 0) + << "Failed to bind socket " + std::to_string(s) + + " to [::1]:" + std::to_string(port) + + ". errno: " + std::to_string(errno); + ASSERT_TRUE(listen(s, 1) == 0) << "Failed to listen on socket " + + std::to_string(s) + + ". errno: " + std::to_string(errno); + sockets.push_back(s); + } + // Do a non-blocking accept followed by a close on all of those sockets. + // Do this in a separate loop to try to induce a time window to hit races. + for (size_t i = 0; i < sockets.size(); i++) { + if (accept(sockets[i], nullptr, nullptr)) { + // If e.g. a "shutdown" was called on this fd from another thread, + // then this accept call should fail with an unexpected error. + ASSERT_TRUE(errno == EAGAIN || errno == EWOULDBLOCK) + << "OpenAndCloseSocketsStressLoop accept on socket " + + std::to_string(sockets[i]) + + " failed in " + "an unexpected way. " + "errno: " + + std::to_string(errno) + + ". Socket use-after-close bugs are likely."; + } + ASSERT_TRUE(close(sockets[i]) == 0) + << "Failed to close socket: " + std::to_string(sockets[i]) + + ". errno: " + std::to_string(errno); + } + } +} +#endif + +} // namespace + +namespace grpc_core { +namespace testing { + +SocketUseAfterCloseDetector::SocketUseAfterCloseDetector() { + int port = grpc_pick_unused_port_or_die(); + gpr_event_init(&done_ev_); + thread_ = std::make_unique(OpenAndCloseSocketsStressLoop, port, + &done_ev_); +} + +SocketUseAfterCloseDetector::~SocketUseAfterCloseDetector() { + gpr_event_set(&done_ev_, reinterpret_cast(1)); + thread_->join(); +} + +} // namespace testing +} // namespace grpc_core diff --git a/test/core/util/socket_use_after_close_detector.h b/test/core/util/socket_use_after_close_detector.h new file mode 100644 index 0000000000000..37c6773b28a77 --- /dev/null +++ b/test/core/util/socket_use_after_close_detector.h @@ -0,0 +1,56 @@ +// +// +// Copyright 2017 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#ifndef GRPC_TEST_CORE_UTIL_SOCKET_USE_AFTER_CLOSE_DETECTOR_H +#define GRPC_TEST_CORE_UTIL_SOCKET_USE_AFTER_CLOSE_DETECTOR_H + +#include + +#include +#include + +#include + +namespace grpc_core { +namespace testing { + +// This class is meant to detect file descriptor use-after-close +// bugs occuring somewhere in the program while the object is in live. +// The implementation currently uses a background thread to open +// and close sockets in a loop, catching socket use-after-close bugs +// by watching them manifest as unexpected socket operation failures. +// +// Note: this will not give false positives but may give false negatives. +// That said this seems to be fairly reliable at finding use-after-close +// bugs, at least on linux, because of fd handles being quickly reused. +// For example this was able to catch the use-after-close bug from +// https://github.com/grpc/grpc/pull/33871 "almost every time". +class SocketUseAfterCloseDetector { + public: + SocketUseAfterCloseDetector(); + ~SocketUseAfterCloseDetector(); + + private: + std::unique_ptr thread_; + gpr_event done_ev_; +}; + +} // namespace testing +} // namespace grpc_core + +#endif // GRPC_TEST_CORE_UTIL_SOCKET_USE_AFTER_CLOSE_DETECTOR_H diff --git a/test/cpp/naming/BUILD b/test/cpp/naming/BUILD index 462c0c74e33bf..4c5a2a2e8b1e0 100644 --- a/test/cpp/naming/BUILD +++ b/test/cpp/naming/BUILD @@ -47,6 +47,7 @@ grpc_cc_test( "//test/core/end2end:cq_verifier", "//test/core/util:fake_udp_and_tcp_server", "//test/core/util:grpc_test_util", + "//test/core/util:socket_use_after_close_detector", "//test/cpp/util:test_config", "//test/cpp/util:test_util", ], diff --git a/test/cpp/naming/cancel_ares_query_test.cc b/test/cpp/naming/cancel_ares_query_test.cc index 1e2f6287941ff..187a206c0b0c4 100644 --- a/test/cpp/naming/cancel_ares_query_test.cc +++ b/test/cpp/naming/cancel_ares_query_test.cc @@ -33,6 +33,7 @@ #include #include +#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h" #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/config/config_vars.h" #include "src/core/lib/config/core_configuration.h" @@ -54,6 +55,7 @@ #include "test/core/util/cmdline.h" #include "test/core/util/fake_udp_and_tcp_server.h" #include "test/core/util/port.h" +#include "test/core/util/socket_use_after_close_detector.h" #include "test/core/util/test_config.h" #include "test/cpp/util/test_config.h" @@ -277,71 +279,23 @@ TEST_F(CancelDuringAresQuery, TestFdsAreDeletedFromPollsetSet) { grpc_pollset_set_destroy(fake_other_pollset_set); } -// Settings for TestCancelDuringActiveQuery test -typedef enum { - NONE, - SHORT, - ZERO, -} cancellation_test_query_timeout_setting; +std::string kFakeName = "dont-care-since-wont-be-resolved.test.com:1234"; void TestCancelDuringActiveQuery( - cancellation_test_query_timeout_setting query_timeout_setting) { - // Start up fake non responsive DNS server - grpc_core::testing::FakeUdpAndTcpServer fake_dns_server( - grpc_core::testing::FakeUdpAndTcpServer::AcceptMode:: - kWaitForClientToSendFirstBytes, - grpc_core::testing::FakeUdpAndTcpServer::CloseSocketUponCloseFromPeer); + grpc_status_code expected_status_code, + absl::string_view expected_error_message_substring, + gpr_timespec rpc_deadline, int dns_query_timeout_ms, + int fake_dns_server_port) { // Create a call that will try to use the fake DNS server - std::string name = "dont-care-since-wont-be-resolved.test.com:1234"; std::string client_target = - absl::StrFormat("dns://[::1]:%d/%s", fake_dns_server.port(), name); - gpr_log(GPR_DEBUG, "TestCancelActiveDNSQuery. query timeout setting: %d", - query_timeout_setting); + absl::StrFormat("dns://[::1]:%d/%s", fake_dns_server_port, kFakeName); grpc_channel_args* client_args = nullptr; - grpc_status_code expected_status_code = GRPC_STATUS_OK; - std::string expected_error_message_substring; - gpr_timespec rpc_deadline; - if (query_timeout_setting == NONE) { - // The RPC deadline should go off well before the DNS resolution - // timeout fires. - expected_status_code = GRPC_STATUS_DEADLINE_EXCEEDED; - // use default DNS resolution timeout (which is over one minute). - client_args = nullptr; - rpc_deadline = grpc_timeout_milliseconds_to_deadline(100); - } else if (query_timeout_setting == SHORT) { - // The DNS resolution timeout should fire well before the - // RPC's deadline expires. - expected_status_code = GRPC_STATUS_UNAVAILABLE; - if (grpc_core::IsEventEngineDnsEnabled()) { - expected_error_message_substring = - absl::StrCat("errors resolving ", name); - } else { - expected_error_message_substring = - absl::StrCat("DNS resolution failed for ", name); - } - grpc_arg arg; - arg.type = GRPC_ARG_INTEGER; - arg.key = const_cast(GRPC_ARG_DNS_ARES_QUERY_TIMEOUT_MS); - arg.value.integer = - 1; // Set this shorter than the call deadline so that it goes off. - client_args = grpc_channel_args_copy_and_add(nullptr, &arg, 1); - // Set the deadline high enough such that if we hit this and get - // a deadline exceeded status code, then we are confident that there's - // a bug causing cancellation of DNS resolutions to not happen in a timely - // manner. - rpc_deadline = grpc_timeout_seconds_to_deadline(10); - } else if (query_timeout_setting == ZERO) { - // The RPC deadline should go off well before the DNS resolution - // timeout fires. - expected_status_code = GRPC_STATUS_DEADLINE_EXCEEDED; + if (dns_query_timeout_ms >= 0) { grpc_arg arg; arg.type = GRPC_ARG_INTEGER; arg.key = const_cast(GRPC_ARG_DNS_ARES_QUERY_TIMEOUT_MS); - arg.value.integer = 0; // Set this to zero to disable query timeouts. + arg.value.integer = dns_query_timeout_ms; client_args = grpc_channel_args_copy_and_add(nullptr, &arg, 1); - rpc_deadline = grpc_timeout_milliseconds_to_deadline(100); - } else { - abort(); } grpc_channel_credentials* creds = grpc_insecure_credentials_create(); grpc_channel* client = @@ -413,19 +367,96 @@ void TestCancelDuringActiveQuery( TEST_F(CancelDuringAresQuery, TestHitDeadlineAndDestroyChannelDuringAresResolutionIsGraceful) { - TestCancelDuringActiveQuery(NONE /* don't set query timeouts */); + grpc_core::testing::SocketUseAfterCloseDetector + socket_use_after_close_detector; + grpc_core::testing::FakeUdpAndTcpServer fake_dns_server( + grpc_core::testing::FakeUdpAndTcpServer::AcceptMode:: + kWaitForClientToSendFirstBytes, + grpc_core::testing::FakeUdpAndTcpServer::CloseSocketUponCloseFromPeer); + grpc_status_code expected_status_code = GRPC_STATUS_DEADLINE_EXCEEDED; + // The RPC deadline should go off well before the DNS resolution + // timeout fires. + gpr_timespec rpc_deadline = grpc_timeout_milliseconds_to_deadline(100); + int dns_query_timeout_ms = -1; // don't set query timeout + TestCancelDuringActiveQuery( + expected_status_code, "" /* expected error message substring */, + rpc_deadline, dns_query_timeout_ms, fake_dns_server.port()); } TEST_F( CancelDuringAresQuery, TestHitDeadlineAndDestroyChannelDuringAresResolutionWithQueryTimeoutIsGraceful) { - TestCancelDuringActiveQuery(SHORT /* set short query timeout */); + grpc_core::testing::SocketUseAfterCloseDetector + socket_use_after_close_detector; + grpc_core::testing::FakeUdpAndTcpServer fake_dns_server( + grpc_core::testing::FakeUdpAndTcpServer::AcceptMode:: + kWaitForClientToSendFirstBytes, + grpc_core::testing::FakeUdpAndTcpServer::CloseSocketUponCloseFromPeer); + grpc_status_code expected_status_code = GRPC_STATUS_UNAVAILABLE; + std::string expected_error_message_substring; + if (grpc_core::IsEventEngineDnsEnabled()) { + expected_error_message_substring = + absl::StrCat("errors resolving ", kFakeName); + } else { + expected_error_message_substring = + absl::StrCat("DNS resolution failed for ", kFakeName); + } + // The DNS resolution timeout should fire well before the + // RPC's deadline expires. + gpr_timespec rpc_deadline = grpc_timeout_seconds_to_deadline(10); + int dns_query_timeout_ms = 1; + TestCancelDuringActiveQuery(expected_status_code, + expected_error_message_substring, rpc_deadline, + dns_query_timeout_ms, fake_dns_server.port()); } TEST_F( CancelDuringAresQuery, TestHitDeadlineAndDestroyChannelDuringAresResolutionWithZeroQueryTimeoutIsGraceful) { - TestCancelDuringActiveQuery(ZERO /* disable query timeouts */); + grpc_core::testing::SocketUseAfterCloseDetector + socket_use_after_close_detector; + grpc_core::testing::FakeUdpAndTcpServer fake_dns_server( + grpc_core::testing::FakeUdpAndTcpServer::AcceptMode:: + kWaitForClientToSendFirstBytes, + grpc_core::testing::FakeUdpAndTcpServer::CloseSocketUponCloseFromPeer); + grpc_status_code expected_status_code = GRPC_STATUS_DEADLINE_EXCEEDED; + // The RPC deadline should go off well before the DNS resolution + // timeout fires. + gpr_timespec rpc_deadline = grpc_timeout_milliseconds_to_deadline(100); + int dns_query_timeout_ms = 0; // disable query timeouts + TestCancelDuringActiveQuery( + expected_status_code, "" /* expected error message substring */, + rpc_deadline, dns_query_timeout_ms, fake_dns_server.port()); +} + +TEST_F(CancelDuringAresQuery, TestQueryFailsBecauseTcpServerClosesSocket) { + grpc_core::testing::SocketUseAfterCloseDetector + socket_use_after_close_detector; + // Use a fake TCP server that immediately closes the socket and causes + // c-ares to pick up a socket read error, while the previous socket + // connect/writes succeeded. Meanwhile, force c-ares to only use TCP. + // The goal is to hit a socket use-after-close bug described in + // https://github.com/grpc/grpc/pull/33871. + grpc_core::testing::FakeUdpAndTcpServer fake_dns_server( + grpc_core::testing::FakeUdpAndTcpServer::AcceptMode:: + kWaitForClientToSendFirstBytes, + grpc_core::testing::FakeUdpAndTcpServer:: + CloseSocketUponReceivingBytesFromPeer); + // TODO(yijiem): make this test work with the EE DNS resolver by supporting + // this test flag to force TCP in the EE DNS resolver. + if (grpc_core::IsEventEngineDnsEnabled()) return; + g_grpc_ares_test_only_force_tcp = true; + grpc_status_code expected_status_code = GRPC_STATUS_UNAVAILABLE; + std::string expected_error_message_substring = + absl::StrCat("DNS resolution failed for ", kFakeName); + // Don't really care about the deadline - we should quickly hit a DNS + // resolution failure. + gpr_timespec rpc_deadline = grpc_timeout_seconds_to_deadline(100); + int dns_query_timeout_ms = -1; // don't set query timeout + TestCancelDuringActiveQuery(expected_status_code, + expected_error_message_substring, rpc_deadline, + dns_query_timeout_ms, fake_dns_server.port()); + g_grpc_ares_test_only_force_tcp = false; } } // namespace diff --git a/test/cpp/naming/generate_resolver_component_tests.bzl b/test/cpp/naming/generate_resolver_component_tests.bzl index edd9c4e40e36a..a91bc32649b13 100755 --- a/test/cpp/naming/generate_resolver_component_tests.bzl +++ b/test/cpp/naming/generate_resolver_component_tests.bzl @@ -59,6 +59,7 @@ def generate_resolver_component_tests(): "//test/cpp/util:test_util%s" % unsecure_build_config_suffix, "//test/core/util:grpc_test_util%s" % unsecure_build_config_suffix, "//test/core/util:fake_udp_and_tcp_server%s" % unsecure_build_config_suffix, + "//test/core/util:socket_use_after_close_detector%s" % unsecure_build_config_suffix, "//:grpc++%s" % unsecure_build_config_suffix, "//:grpc%s" % unsecure_build_config_suffix, "//:gpr", diff --git a/test/cpp/naming/resolver_component_test.cc b/test/cpp/naming/resolver_component_test.cc index 7fe90b704e5bf..69a19c9d90fe5 100644 --- a/test/cpp/naming/resolver_component_test.cc +++ b/test/cpp/naming/resolver_component_test.cc @@ -64,23 +64,11 @@ #include "src/core/lib/resolver/server_address.h" #include "test/core/util/fake_udp_and_tcp_server.h" #include "test/core/util/port.h" +#include "test/core/util/socket_use_after_close_detector.h" #include "test/core/util/test_config.h" #include "test/cpp/util/subprocess.h" #include "test/cpp/util/test_config.h" -// TODO(unknown): pull in different headers when enabling this -// test on windows. Also set BAD_SOCKET_RETURN_VAL -// to INVALID_SOCKET on windows. -#ifdef GPR_WINDOWS -#include "src/core/lib/iomgr/sockaddr_windows.h" -#include "src/core/lib/iomgr/socket_windows.h" -#include "src/core/lib/iomgr/tcp_windows.h" -#define BAD_SOCKET_RETURN_VAL INVALID_SOCKET -#else -#include "src/core/lib/iomgr/sockaddr_posix.h" -#define BAD_SOCKET_RETURN_VAL (-1) -#endif - using ::grpc_event_engine::experimental::GetDefaultEventEngine; using std::vector; using testing::UnorderedElementsAreArray; @@ -303,134 +291,6 @@ void CheckLBPolicyResultLocked(const grpc_core::ChannelArgs channel_args, } } -#ifdef GPR_WINDOWS -void OpenAndCloseSocketsStressLoop(int phony_port, gpr_event* done_ev) { - sockaddr_in6 addr; - memset(&addr, 0, sizeof(addr)); - addr.sin6_family = AF_INET6; - addr.sin6_port = htons(phony_port); - ((char*)&addr.sin6_addr)[15] = 1; - for (;;) { - if (gpr_event_get(done_ev)) { - return; - } - std::vector sockets; - for (size_t i = 0; i < 50; i++) { - SOCKET s = WSASocket(AF_INET6, SOCK_STREAM, IPPROTO_TCP, nullptr, 0, - WSA_FLAG_OVERLAPPED); - ASSERT_TRUE(s != BAD_SOCKET_RETURN_VAL) - << "Failed to create TCP ipv6 socket"; - gpr_log(GPR_DEBUG, "Opened socket: %d", s); - char val = 1; - ASSERT_TRUE(setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) != - SOCKET_ERROR) - << "Failed to set socketopt reuseaddr. WSA error: " + - std::to_string(WSAGetLastError()); - ASSERT_TRUE(grpc_tcp_set_non_block(s) == absl::OkStatus()) - << "Failed to set socket non-blocking"; - ASSERT_TRUE(bind(s, (const sockaddr*)&addr, sizeof(addr)) != SOCKET_ERROR) - << "Failed to bind socket " + std::to_string(s) + - " to [::1]:" + std::to_string(phony_port) + - ". WSA error: " + std::to_string(WSAGetLastError()); - ASSERT_TRUE(listen(s, 1) != SOCKET_ERROR) - << "Failed to listen on socket " + std::to_string(s) + - ". WSA error: " + std::to_string(WSAGetLastError()); - sockets.push_back(s); - } - // Do a non-blocking accept followed by a close on all of those sockets. - // Do this in a separate loop to try to induce a time window to hit races. - for (size_t i = 0; i < sockets.size(); i++) { - gpr_log(GPR_DEBUG, "non-blocking accept then close on %d", sockets[i]); - ASSERT_TRUE(accept(sockets[i], nullptr, nullptr) == INVALID_SOCKET) - << "Accept on phony socket unexpectedly accepted actual connection."; - ASSERT_TRUE(WSAGetLastError() == WSAEWOULDBLOCK) - << "OpenAndCloseSocketsStressLoop accept on socket " + - std::to_string(sockets[i]) + - " failed in " - "an unexpected way. " - "WSA error: " + - std::to_string(WSAGetLastError()) + - ". Socket use-after-close bugs are likely."; - ASSERT_TRUE(closesocket(sockets[i]) != SOCKET_ERROR) - << "Failed to close socket: " + std::to_string(sockets[i]) + - ". WSA error: " + std::to_string(WSAGetLastError()); - } - } - return; -} -#else -void OpenAndCloseSocketsStressLoop(int phony_port, gpr_event* done_ev) { - // The goal of this loop is to catch socket - // "use after close" bugs within the c-ares resolver by acting - // like some separate thread doing I/O. - // It's goal is to try to hit race conditions whereby: - // 1) The c-ares resolver closes a socket. - // 2) This loop opens a socket with (coincidentally) the same handle. - // 3) the c-ares resolver mistakenly uses that same socket without - // realizing that its closed. - // 4) This loop performs an operation on that socket that should - // succeed but instead fails because of what the c-ares - // resolver did in the meantime. - sockaddr_in6 addr; - memset(&addr, 0, sizeof(addr)); - addr.sin6_family = AF_INET6; - addr.sin6_port = htons(phony_port); - (reinterpret_cast(&addr.sin6_addr))[15] = 1; - for (;;) { - if (gpr_event_get(done_ev)) { - return; - } - std::vector sockets; - // First open a bunch of sockets, bind and listen - // '50' is an arbitrary number that, experimentally, - // has a good chance of catching bugs. - for (size_t i = 0; i < 50; i++) { - int s = socket(AF_INET6, SOCK_STREAM, 0); - int val = 1; - ASSERT_TRUE(setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &val, sizeof(val)) == - 0) - << "Failed to set socketopt reuseport"; - ASSERT_TRUE(setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) == - 0) - << "Failed to set socket reuseaddr"; - ASSERT_TRUE(fcntl(s, F_SETFL, O_NONBLOCK) == 0) - << "Failed to set socket non-blocking"; - ASSERT_TRUE(s != BAD_SOCKET_RETURN_VAL) - << "Failed to create TCP ipv6 socket"; - gpr_log(GPR_DEBUG, "Opened fd: %d", s); - ASSERT_TRUE(bind(s, (const sockaddr*)&addr, sizeof(addr)) == 0) - << "Failed to bind socket " + std::to_string(s) + - " to [::1]:" + std::to_string(phony_port) + - ". errno: " + std::to_string(errno); - ASSERT_TRUE(listen(s, 1) == 0) << "Failed to listen on socket " + - std::to_string(s) + - ". errno: " + std::to_string(errno); - sockets.push_back(s); - } - // Do a non-blocking accept followed by a close on all of those sockets. - // Do this in a separate loop to try to induce a time window to hit races. - for (size_t i = 0; i < sockets.size(); i++) { - gpr_log(GPR_DEBUG, "non-blocking accept then close on %d", sockets[i]); - if (accept(sockets[i], nullptr, nullptr)) { - // If e.g. a "shutdown" was called on this fd from another thread, - // then this accept call should fail with an unexpected error. - ASSERT_TRUE(errno == EAGAIN || errno == EWOULDBLOCK) - << "OpenAndCloseSocketsStressLoop accept on socket " + - std::to_string(sockets[i]) + - " failed in " - "an unexpected way. " - "errno: " + - std::to_string(errno) + - ". Socket use-after-close bugs are likely."; - } - ASSERT_TRUE(close(sockets[i]) == 0) - << "Failed to close socket: " + std::to_string(sockets[i]) + - ". errno: " + std::to_string(errno); - } - } -} -#endif - class ResultHandler : public grpc_core::Resolver::ResultHandler { public: static std::unique_ptr Create( @@ -664,18 +524,11 @@ TEST(ResolverComponentTest, TestResolvesRelevantRecords) { } TEST(ResolverComponentTest, TestResolvesRelevantRecordsWithConcurrentFdStress) { - // Start up background stress thread - int phony_port = grpc_pick_unused_port_or_die(); - gpr_event done_ev; - gpr_event_init(&done_ev); - std::thread socket_stress_thread(OpenAndCloseSocketsStressLoop, phony_port, - &done_ev); + grpc_core::testing::SocketUseAfterCloseDetector + socket_use_after_close_detector; // Run the resolver test RunResolvesRelevantRecordsTest(ResultHandler::Create, grpc_core::ChannelArgs()); - // Shutdown and join stress thread - gpr_event_set(&done_ev, reinterpret_cast(1)); - socket_stress_thread.join(); } TEST(ResolverComponentTest, TestDoesntCrashOrHangWith1MsTimeout) { From 19c5b18a5a016e4d9ffc402dd560cf94ab7a831e Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 1 Aug 2023 15:05:38 -0700 Subject: [PATCH 098/205] [promises] Correct use after free (#33943) --- src/core/lib/surface/server.cc | 67 +++++++++++++++++----------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc index ea406774cab6f..8cbf85cd93d6d 100644 --- a/src/core/lib/surface/server.cc +++ b/src/core/lib/surface/server.cc @@ -522,21 +522,14 @@ class Server::AllocatingRequestMatcherBatch ArenaPromise> MatchRequest( size_t /*start_request_queue_index*/) override { - const bool still_running = server()->ShutdownRefOnRequest(); - auto cleanup_ref = - absl::MakeCleanup([this] { server()->ShutdownUnrefOnRequest(); }); - if (still_running) { - BatchCallAllocation call_info = allocator_(); - GPR_ASSERT(server()->ValidateServerRequest( - cq(), static_cast(call_info.tag), nullptr, - nullptr) == GRPC_CALL_OK); - RequestedCall* rc = new RequestedCall( - static_cast(call_info.tag), call_info.cq, call_info.call, - call_info.initial_metadata, call_info.details); - return Immediate(MatchResult(server(), cq_idx(), rc)); - } else { - return Immediate(absl::CancelledError("Server shutdown")); - } + BatchCallAllocation call_info = allocator_(); + GPR_ASSERT(server()->ValidateServerRequest( + cq(), static_cast(call_info.tag), nullptr, nullptr) == + GRPC_CALL_OK); + RequestedCall* rc = new RequestedCall( + static_cast(call_info.tag), call_info.cq, call_info.call, + call_info.initial_metadata, call_info.details); + return Immediate(MatchResult(server(), cq_idx(), rc)); } private: @@ -576,22 +569,14 @@ class Server::AllocatingRequestMatcherRegistered ArenaPromise> MatchRequest( size_t /*start_request_queue_index*/) override { - const bool still_running = server()->ShutdownRefOnRequest(); - auto cleanup_ref = - absl::MakeCleanup([this] { server()->ShutdownUnrefOnRequest(); }); - if (still_running) { - RegisteredCallAllocation call_info = allocator_(); - GPR_ASSERT(server()->ValidateServerRequest( - cq(), call_info.tag, call_info.optional_payload, - registered_method_) == GRPC_CALL_OK); - RequestedCall* rc = - new RequestedCall(call_info.tag, call_info.cq, call_info.call, - call_info.initial_metadata, registered_method_, - call_info.deadline, call_info.optional_payload); - return Immediate(MatchResult(server(), cq_idx(), rc)); - } else { - return Immediate(absl::CancelledError("Server shutdown")); - } + RegisteredCallAllocation call_info = allocator_(); + GPR_ASSERT(server()->ValidateServerRequest( + cq(), call_info.tag, call_info.optional_payload, + registered_method_) == GRPC_CALL_OK); + RequestedCall* rc = new RequestedCall( + call_info.tag, call_info.cq, call_info.call, call_info.initial_metadata, + registered_method_, call_info.deadline, call_info.optional_payload); + return Immediate(MatchResult(server(), cq_idx(), rc)); } private: @@ -1289,12 +1274,24 @@ void Server::ChannelData::AcceptStream(void* arg, grpc_transport* /*transport*/, } } +namespace { +auto CancelledDueToServerShutdown() { + return [] { + return ServerMetadataFromStatus(absl::CancelledError("Server shutdown")); + }; +} +} // namespace + ArenaPromise Server::ChannelData::MakeCallPromise( grpc_channel_element* elem, CallArgs call_args, NextPromiseFactory) { auto* chand = static_cast(elem->channel_data); auto* server = chand->server_.get(); absl::optional path = call_args.client_initial_metadata->Take(HttpPathMetadata()); + if (server->ShutdownCalled()) return CancelledDueToServerShutdown(); + auto cleanup_ref = + absl::MakeCleanup([server] { server->ShutdownUnrefOnRequest(); }); + if (!server->ShutdownRefOnRequest()) return CancelledDueToServerShutdown(); if (!path.has_value()) { return [] { return ServerMetadataFromStatus( @@ -1334,9 +1331,13 @@ ArenaPromise Server::ChannelData::MakeCallPromise( } return TrySeq( std::move(maybe_read_first_message), - [matcher, chand](NextResult payload) { + [cleanup_ref = std::move(cleanup_ref), matcher, + chand](NextResult payload) mutable { return Map( - matcher->MatchRequest(chand->cq_idx()), + [cleanup_ref = std::move(cleanup_ref), + mr = matcher->MatchRequest(chand->cq_idx())]() mutable { + return mr(); + }, [payload = std::move(payload)]( absl::StatusOr mr) mutable -> absl::StatusOr Date: Tue, 1 Aug 2023 15:14:35 -0700 Subject: [PATCH 099/205] [Test] Added a new portability test with OpenSSL 3.0.9 (#33944) --- .../Dockerfile.template | 32 +++++ ...xx_debian12_openssl309_x64.current_version | 1 + .../cxx_debian12_openssl309_x64/Dockerfile | 125 ++++++++++++++++++ tools/run_tests/run_tests.py | 8 ++ tools/run_tests/run_tests_matrix.py | 1 + 5 files changed, 167 insertions(+) create mode 100644 templates/tools/dockerfile/test/cxx_debian12_openssl309_x64/Dockerfile.template create mode 100644 tools/dockerfile/test/cxx_debian12_openssl309_x64.current_version create mode 100644 tools/dockerfile/test/cxx_debian12_openssl309_x64/Dockerfile diff --git a/templates/tools/dockerfile/test/cxx_debian12_openssl309_x64/Dockerfile.template b/templates/tools/dockerfile/test/cxx_debian12_openssl309_x64/Dockerfile.template new file mode 100644 index 0000000000000..c58f80bc007c7 --- /dev/null +++ b/templates/tools/dockerfile/test/cxx_debian12_openssl309_x64/Dockerfile.template @@ -0,0 +1,32 @@ +%YAML 1.2 +--- | + # Copyright 2023 the gRPC authors. + # + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + + FROM debian:12 + + <%include file="../../apt_get_basic.include"/> + <%include file="../../run_tests_python_deps_pep668.include"/> + <%include file="../../cxx_test_deps.include"/> + <%include file="../../cxx_deps.include"/> + <%include file="../../cmake.include"/> + <%include file="../../ccache.include"/> + <%include file="../../run_tests_addons.include"/> + <%include file="../../git-jenkins.include"/> + + # Install openssl 3.0.9 + RUN apt-get update && apt-get install -y libssl-dev + + # Define the default command. + CMD ["bash"] diff --git a/tools/dockerfile/test/cxx_debian12_openssl309_x64.current_version b/tools/dockerfile/test/cxx_debian12_openssl309_x64.current_version new file mode 100644 index 0000000000000..ce7212f1c5cbc --- /dev/null +++ b/tools/dockerfile/test/cxx_debian12_openssl309_x64.current_version @@ -0,0 +1 @@ +us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_debian12_openssl309_x64:0d192c86a2e41e28059a972564b80237137458b7@sha256:e8878bf31f42f8af6a7f3b45d0cb79f29fc46c44721b4a8357a2070ab1f5b3e0 \ No newline at end of file diff --git a/tools/dockerfile/test/cxx_debian12_openssl309_x64/Dockerfile b/tools/dockerfile/test/cxx_debian12_openssl309_x64/Dockerfile new file mode 100644 index 0000000000000..5e3dea3830846 --- /dev/null +++ b/tools/dockerfile/test/cxx_debian12_openssl309_x64/Dockerfile @@ -0,0 +1,125 @@ +# Copyright 2023 the gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM debian:12 + +#================= +# Basic C core dependencies + +# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md +RUN apt-get update && apt-get install -y \ + build-essential \ + autoconf \ + libtool \ + pkg-config \ + && apt-get clean + +# GCC +RUN apt-get update && apt-get install -y \ + gcc \ + g++ \ + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y \ + libc6 \ + libc6-dbg \ + libc6-dev \ + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y \ + bzip2 \ + curl \ + dnsutils \ + git \ + lcov \ + make \ + strace \ + time \ + unzip \ + wget \ + zip \ + && apt-get clean + +#==================== +# run_tests.py python dependencies + +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) +RUN apt-get update && apt-get install -y \ + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +# Some newer distros that have already implemented PEP 668. Use of +# --break-system-packages is to workaround that. We should look into using +# virtualenv in Dockerfile though. +RUN python3 -m pip install --break-system-packages --upgrade pip==19.3.1 + +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 + +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + + +# Some cxx tests depend on the twisted package +RUN python3 -m pip install twisted + +#================= +# C++ dependencies +RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean + +#================= +# Install cmake +# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement. + +RUN apt-get update && apt-get install -y cmake && apt-get clean + +#================= +# Install ccache + +# Install ccache from source since ccache 3.x packaged with most linux distributions +# does not support Redis backend for caching. +RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \ + && tar -zxf ccache.tar.gz \ + && cd ccache-4.5.1 \ + && mkdir build && cd build \ + && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \ + && make -j4 && make install \ + && cd ../.. \ + && rm -rf ccache-4.5.1 ccache.tar.gz + + +RUN mkdir /var/local/jenkins + +#================= +# Setup git to access working directory across docker boundary + +RUN git config --global --add safe.directory /var/local/jenkins/grpc +RUN git config --global protocol.file.allow always + + +# Install openssl 3.0.9 +RUN apt-get update && apt-get install -y libssl-dev + +# Define the default command. +CMD ["bash"] diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 8634fa4455479..e83f5082f1fcb 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -566,6 +566,13 @@ def _compiler_options(self, use_docker, compiler): ) elif compiler == "gcc12": return ("gcc_12", ["-DCMAKE_CXX_STANDARD=20"]) + elif compiler == "gcc12_openssl309": + return ( + "debian12_openssl309", + [ + "-DgRPC_SSL_PROVIDER=package", + ], + ) elif compiler == "gcc_musl": return ("alpine", []) elif compiler == "clang6": @@ -1706,6 +1713,7 @@ def _build_and_run( "gcc10.2", "gcc10.2_openssl102", "gcc12", + "gcc12_openssl309", "gcc_musl", "clang6", "clang15", diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index 518c54762cfca..28f8320922557 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -357,6 +357,7 @@ def _create_portability_test_jobs( "gcc7", # 'gcc10.2_openssl102', // TODO(b/283304471): Enable this later "gcc12", + # "gcc12_openssl309", // TODO: Enable this later "gcc_musl", "clang6", "clang15", From 7f332ef69d6adae604f08122fc62c25c0f82c0ec Mon Sep 17 00:00:00 2001 From: Yijie Ma Date: Tue, 1 Aug 2023 15:34:42 -0700 Subject: [PATCH 100/205] [Deps] Update pyyaml to 6.0.1 for bazel build system (#33932) The previous version (`3.12`) is 7 years old and does not support the newest Python 3 versions. This causes issues to move certain test targets (which depends on `pyyaml`) to Python 3 when some CI environment (e.g. `arm64v8/debian:11`) does not have Python 2 installed. And in general, we should move away from Python 2. Thus, updated `pyyaml` to the latest version. This hopefully should also fix the `prod:grpc/core/master/linux/arm64/grpc_bazel_test_c_cpp` job breakage. --- bazel/grpc_deps.bzl | 8 ++++---- test/cpp/naming/utils/BUILD | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bazel/grpc_deps.bzl b/bazel/grpc_deps.bzl index ce0f40493d1db..395756ab4ad52 100644 --- a/bazel/grpc_deps.bzl +++ b/bazel/grpc_deps.bzl @@ -533,11 +533,11 @@ def grpc_test_only_deps(): if "com_github_yaml_pyyaml" not in native.existing_rules(): http_archive( name = "com_github_yaml_pyyaml", - sha256 = "6b4314b1b2051ddb9d4fcd1634e1fa9c1bb4012954273c9ff3ef689f6ec6c93e", - strip_prefix = "pyyaml-3.12", + sha256 = "e34d97db6d846f5e2ad51417fd646e7ce6a3a70726ccea2a857e0580a7155f39", + strip_prefix = "pyyaml-6.0.1", urls = [ - "https://storage.googleapis.com/grpc-bazel-mirror/github.com/yaml/pyyaml/archive/3.12.zip", - "https://github.com/yaml/pyyaml/archive/3.12.zip", + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/yaml/pyyaml/archive/6.0.1.zip", + "https://github.com/yaml/pyyaml/archive/6.0.1.zip", ], build_file = "@com_github_grpc_grpc//third_party:yaml.BUILD", ) diff --git a/test/cpp/naming/utils/BUILD b/test/cpp/naming/utils/BUILD index 6927a29bd1b41..37f497ffe2ada 100644 --- a/test/cpp/naming/utils/BUILD +++ b/test/cpp/naming/utils/BUILD @@ -32,6 +32,7 @@ grpc_py_binary( "twisted", "yaml", ], + python_version = "PY3", ) grpc_py_binary( @@ -41,16 +42,19 @@ grpc_py_binary( external_deps = [ "twisted", ], + python_version = "PY3", ) grpc_py_binary( name = "tcp_connect", testonly = True, srcs = ["tcp_connect.py"], + python_version = "PY3", ) grpc_py_binary( name = "health_check", testonly = True, srcs = ["health_check.py"], + python_version = "PY3", ) From 702e0cf918b3f13846c7d7af9058fa3ff58dd93c Mon Sep 17 00:00:00 2001 From: Paulo Castello da Costa Date: Tue, 1 Aug 2023 16:28:19 -0700 Subject: [PATCH 101/205] [benchmark] Write to master tables only for CI runs. (#33948) --- .../internal_ci/linux/grpc_e2e_performance_gke.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/internal_ci/linux/grpc_e2e_performance_gke.sh b/tools/internal_ci/linux/grpc_e2e_performance_gke.sh index 2c87a19453b91..1bd85eece4882 100755 --- a/tools/internal_ci/linux/grpc_e2e_performance_gke.sh +++ b/tools/internal_ci/linux/grpc_e2e_performance_gke.sh @@ -46,13 +46,16 @@ gcloud container clusters get-credentials benchmarks-prod2 \ # Set up environment variables. LOAD_TEST_PREFIX="${KOKORO_BUILD_INITIATOR}" # BEGIN differentiate experimental configuration from master configuration. -if [[ "${KOKORO_BUILD_INITIATOR%%-*}" == kokoro ]]; then - LOAD_TEST_PREFIX=kokoro +if [[ "${KOKORO_BUILD_INITIATOR%%-*}" == kokoro && "${KOKORO_GITHUB_COMMIT_URL%/*}" == "https://github.com/grpc/grpc/commit" ]]; then + # Use "official" BQ tables only for builds initiated by Kokoro and running + # from grpc/grpc. These results show up in the "official" public dashboard. + BIGQUERY_TABLE_8CORE=e2e_benchmarks.ci_master_results_8core + BIGQUERY_TABLE_32CORE=e2e_benchmarks.ci_master_results_32core +else + # Use experimental BQ tables otherwise. + BIGQUERY_TABLE_8CORE=e2e_benchmarks.experimental_results + BIGQUERY_TABLE_32CORE=e2e_benchmarks.experimental_results_32core fi -# Use the "official" BQ tables so that the measurements will show up in the -# "official" public dashboard. -BIGQUERY_TABLE_8CORE=e2e_benchmarks.ci_master_results_8core -BIGQUERY_TABLE_32CORE=e2e_benchmarks.ci_master_results_32core # END differentiate experimental configuration from master configuration. CLOUD_LOGGING_URL="https://source.cloud.google.com/results/invocations/${KOKORO_BUILD_ID}" PREBUILT_IMAGE_PREFIX="gcr.io/grpc-testing/e2etest/prebuilt/${LOAD_TEST_PREFIX}" From 860167a7d0ae8127e1361ab670b607e7b1962259 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Tue, 1 Aug 2023 16:37:31 -0700 Subject: [PATCH 102/205] [OTel] Add target on client-rpc metrics, and authority on server-rpc metrics (#33946) --- src/cpp/ext/otel/BUILD | 2 + src/cpp/ext/otel/otel_call_tracer.h | 7 +- src/cpp/ext/otel/otel_client_filter.cc | 33 ++-- src/cpp/ext/otel/otel_client_filter.h | 10 +- src/cpp/ext/otel/otel_plugin.cc | 4 + src/cpp/ext/otel/otel_plugin.h | 2 + src/cpp/ext/otel/otel_server_call_tracer.cc | 16 +- test/cpp/ext/otel/otel_plugin_test.cc | 168 +++++++++++++++++--- 8 files changed, 199 insertions(+), 43 deletions(-) diff --git a/src/cpp/ext/otel/BUILD b/src/cpp/ext/otel/BUILD index 1cd9c05501d56..d9fd4635bf114 100644 --- a/src/cpp/ext/otel/BUILD +++ b/src/cpp/ext/otel/BUILD @@ -50,6 +50,7 @@ grpc_cc_library( "absl/strings", "absl/strings:str_format", "absl/time", + "absl/types:optional", "otel/api", ], language = "c++", @@ -60,6 +61,7 @@ grpc_cc_library( "//:gpr", "//:gpr_platform", "//:grpc_base", + "//:grpc_client_channel", "//:legacy_context", "//src/core:arena", "//src/core:arena_promise", diff --git a/src/cpp/ext/otel/otel_call_tracer.h b/src/cpp/ext/otel/otel_call_tracer.h index 059c0bb352726..eb0e05352c118 100644 --- a/src/cpp/ext/otel/otel_call_tracer.h +++ b/src/cpp/ext/otel/otel_call_tracer.h @@ -40,6 +40,7 @@ #include "src/core/lib/slice/slice_buffer.h" #include "src/core/lib/transport/metadata_batch.h" #include "src/core/lib/transport/transport.h" +#include "src/cpp/ext/otel/otel_client_filter.h" namespace grpc { namespace internal { @@ -48,7 +49,7 @@ class OpenTelemetryCallTracer : public grpc_core::ClientCallTracer { public: class OpenTelemetryCallAttemptTracer : public CallAttemptTracer { public: - OpenTelemetryCallAttemptTracer(OpenTelemetryCallTracer* parent, + OpenTelemetryCallAttemptTracer(const OpenTelemetryCallTracer* parent, bool arena_allocated); std::string TraceId() override { @@ -94,7 +95,8 @@ class OpenTelemetryCallTracer : public grpc_core::ClientCallTracer { absl::Time start_time_; }; - explicit OpenTelemetryCallTracer(grpc_core::Slice path, + explicit OpenTelemetryCallTracer(OpenTelemetryClientFilter* parent, + grpc_core::Slice path, grpc_core::Arena* arena); ~OpenTelemetryCallTracer() override; @@ -119,6 +121,7 @@ class OpenTelemetryCallTracer : public grpc_core::ClientCallTracer { void RecordAnnotation(const Annotation& /*annotation*/) override; private: + const OpenTelemetryClientFilter* parent_; // Client method. grpc_core::Slice path_; absl::string_view method_; diff --git a/src/cpp/ext/otel/otel_client_filter.cc b/src/cpp/ext/otel/otel_client_filter.cc index 504d48616129d..42806dd5ad45e 100644 --- a/src/cpp/ext/otel/otel_client_filter.cc +++ b/src/cpp/ext/otel/otel_client_filter.cc @@ -33,12 +33,14 @@ #include "absl/strings/strip.h" #include "absl/time/clock.h" #include "absl/time/time.h" +#include "absl/types/optional.h" #include "opentelemetry/context/context.h" #include "opentelemetry/metrics/sync_instruments.h" #include #include +#include "src/core/ext/filters/client_channel/client_channel.h" #include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/channel/context.h" #include "src/core/lib/gprpp/sync.h" @@ -63,9 +65,9 @@ const grpc_channel_filter OpenTelemetryClientFilter::kFilter = "otel_client"); absl::StatusOr OpenTelemetryClientFilter::Create( - const grpc_core::ChannelArgs& /*args*/, - ChannelFilter::Args /*filter_args*/) { - return OpenTelemetryClientFilter(); + const grpc_core::ChannelArgs& args, ChannelFilter::Args /*filter_args*/) { + return OpenTelemetryClientFilter( + args.GetOwnedString(GRPC_ARG_SERVER_URI).value_or("")); } grpc_core::ArenaPromise @@ -75,10 +77,11 @@ OpenTelemetryClientFilter::MakeCallPromise( auto* path = call_args.client_initial_metadata->get_pointer( grpc_core::HttpPathMetadata()); auto* call_context = grpc_core::GetContext(); - auto* tracer = grpc_core::GetContext() - ->ManagedNew( - path != nullptr ? path->Ref() : grpc_core::Slice(), - grpc_core::GetContext()); + auto* tracer = + grpc_core::GetContext() + ->ManagedNew( + this, path != nullptr ? path->Ref() : grpc_core::Slice(), + grpc_core::GetContext()); GPR_DEBUG_ASSERT( call_context[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE].value == nullptr); @@ -92,7 +95,7 @@ OpenTelemetryClientFilter::MakeCallPromise( // OpenTelemetryCallTracer::OpenTelemetryCallAttemptTracer:: - OpenTelemetryCallAttemptTracer(OpenTelemetryCallTracer* parent, + OpenTelemetryCallAttemptTracer(const OpenTelemetryCallTracer* parent, bool arena_allocated) : parent_(parent), arena_allocated_(arena_allocated), @@ -100,7 +103,8 @@ OpenTelemetryCallTracer::OpenTelemetryCallAttemptTracer:: // TODO(yashykt): Figure out how to get this to work with absl::string_view if (OTelPluginState().client.attempt.started != nullptr) { OTelPluginState().client.attempt.started->Add( - 1, {{std::string(OTelMethodKey()), std::string(parent_->method_)}}); + 1, {{std::string(OTelMethodKey()), std::string(parent_->method_)}, + {std::string(OTelTargetKey()), parent_->parent_->target()}}); } } @@ -136,7 +140,8 @@ void OpenTelemetryCallTracer::OpenTelemetryCallAttemptTracer:: const grpc_transport_stream_stats* transport_stream_stats) { absl::InlinedVector, 2> attributes = { {std::string(OTelMethodKey()), std::string(parent_->method_)}, - {std::string(OTelStatusKey()), absl::StatusCodeToString(status.code())}}; + {std::string(OTelStatusKey()), absl::StatusCodeToString(status.code())}, + {std::string(OTelTargetKey()), parent_->parent_->target()}}; if (OTelPluginState().client.attempt.duration != nullptr) { OTelPluginState().client.attempt.duration->Record( absl::ToDoubleSeconds(absl::Now() - start_time_), attributes, @@ -186,9 +191,11 @@ void OpenTelemetryCallTracer::OpenTelemetryCallAttemptTracer::RecordAnnotation( // OpenTelemetryCallTracer // -OpenTelemetryCallTracer::OpenTelemetryCallTracer(grpc_core::Slice path, - grpc_core::Arena* arena) - : path_(std::move(path)), +OpenTelemetryCallTracer::OpenTelemetryCallTracer( + OpenTelemetryClientFilter* parent, grpc_core::Slice path, + grpc_core::Arena* arena) + : parent_(parent), + path_(std::move(path)), method_(absl::StripPrefix(path_.as_string_view(), "/")), arena_(arena) {} diff --git a/src/cpp/ext/otel/otel_client_filter.h b/src/cpp/ext/otel/otel_client_filter.h index a3c46643a763e..dbafb322ca0f2 100644 --- a/src/cpp/ext/otel/otel_client_filter.h +++ b/src/cpp/ext/otel/otel_client_filter.h @@ -21,6 +21,9 @@ #include +#include +#include + #include "absl/status/statusor.h" #include "src/core/lib/channel/channel_args.h" @@ -44,8 +47,13 @@ class OpenTelemetryClientFilter : public grpc_core::ChannelFilter { grpc_core::CallArgs call_args, grpc_core::NextPromiseFactory next_promise_factory) override; + const std::string& target() const { return target_; } + private: - explicit OpenTelemetryClientFilter() {} + explicit OpenTelemetryClientFilter(std::string target) + : target_(std::move(target)) {} + + std::string target_; }; } // namespace internal diff --git a/src/cpp/ext/otel/otel_plugin.cc b/src/cpp/ext/otel/otel_plugin.cc index 05f045861047e..b07b830662ac2 100644 --- a/src/cpp/ext/otel/otel_plugin.cc +++ b/src/cpp/ext/otel/otel_plugin.cc @@ -55,6 +55,10 @@ absl::string_view OTelMethodKey() { return "grpc.method"; } absl::string_view OTelStatusKey() { return "grpc.status"; } +absl::string_view OTelTargetKey() { return "grpc.target"; } + +absl::string_view OTelAuthorityKey() { return "grpc.authority"; } + absl::string_view OTelClientAttemptStartedInstrumentName() { return "grpc.client.attempt.started"; } diff --git a/src/cpp/ext/otel/otel_plugin.h b/src/cpp/ext/otel/otel_plugin.h index 1624d35d13427..f0af959e8d1e7 100644 --- a/src/cpp/ext/otel/otel_plugin.h +++ b/src/cpp/ext/otel/otel_plugin.h @@ -65,6 +65,8 @@ const struct OTelPluginState& OTelPluginState(); // Tags absl::string_view OTelMethodKey(); absl::string_view OTelStatusKey(); +absl::string_view OTelTargetKey(); +absl::string_view OTelAuthorityKey(); // Metrics absl::string_view OTelClientAttemptStartedInstrumentName(); diff --git a/src/cpp/ext/otel/otel_server_call_tracer.cc b/src/cpp/ext/otel/otel_server_call_tracer.cc index c4834179d248e..41728b23f9233 100644 --- a/src/cpp/ext/otel/otel_server_call_tracer.cc +++ b/src/cpp/ext/otel/otel_server_call_tracer.cc @@ -121,6 +121,7 @@ class OpenTelemetryServerCallTracer : public grpc_core::ServerCallTracer { private: grpc_core::Slice path_; absl::string_view method_; + std::string authority_; absl::Time start_time_; absl::Duration elapsed_time_; }; @@ -133,10 +134,20 @@ void OpenTelemetryServerCallTracer::RecordReceivedInitialMetadata( path_ = path->Ref(); } method_ = absl::StripPrefix(path_.as_string_view(), "/"); + const auto* authority = + recv_initial_metadata->get_pointer(grpc_core::HttpAuthorityMetadata()); + // Override with host metadata if authority is absent. + if (authority == nullptr) { + authority = recv_initial_metadata->get_pointer(grpc_core::HostMetadata()); + } + if (authority != nullptr) { + authority_ = std::string(authority->as_string_view()); + } // TODO(yashykt): Figure out how to get this to work with absl::string_view if (OTelPluginState().server.call.started != nullptr) { OTelPluginState().server.call.started->Add( - 1, {{std::string(OTelMethodKey()), std::string(method_)}}); + 1, {{std::string(OTelMethodKey()), std::string(method_)}, + {std::string(OTelAuthorityKey()), authority_}}); } } @@ -153,7 +164,8 @@ void OpenTelemetryServerCallTracer::RecordEnd( {std::string(OTelMethodKey()), std::string(method_)}, {std::string(OTelStatusKey()), absl::StatusCodeToString( - static_cast(final_info->final_status))}}; + static_cast(final_info->final_status))}, + {std::string(OTelAuthorityKey()), authority_}}; if (OTelPluginState().server.call.duration != nullptr) { OTelPluginState().server.call.duration->Record( absl::ToDoubleSeconds(elapsed_time_), attributes, diff --git a/test/cpp/ext/otel/otel_plugin_test.cc b/test/cpp/ext/otel/otel_plugin_test.cc index 4aa8ac3fa3230..8030b5a7f86ee 100644 --- a/test/cpp/ext/otel/otel_plugin_test.cc +++ b/test/cpp/ext/otel/otel_plugin_test.cc @@ -95,6 +95,7 @@ class OTelPluginEnd2EndTest : public ::testing::Test { ASSERT_NE(nullptr, server_); ASSERT_NE(0, port); server_address_ = absl::StrCat("localhost:", port); + canonical_server_address_ = absl::StrCat("dns:///", server_address_); stub_ = EchoTestService::NewStub(grpc::CreateChannel( server_address_, grpc::InsecureChannelCredentials())); @@ -119,16 +120,18 @@ class OTelPluginEnd2EndTest : public ::testing::Test { grpc::Status status = stub_->Echo(&context, request, &response); } - absl::flat_hash_map> + absl::flat_hash_map< + std::string, + std::vector> ReadCurrentMetricsData( absl::AnyInvocable< bool(const absl::flat_hash_map< std::string, - std::vector>&)> + std::vector>&)> continue_predicate) { - absl::flat_hash_map> + absl::flat_hash_map< + std::string, + std::vector> data; auto deadline = absl::Now() + absl::Seconds(5); do { @@ -139,7 +142,7 @@ class OTelPluginEnd2EndTest : public ::testing::Test { smd.metric_data_) { for (const opentelemetry::sdk::metrics::PointDataAttributes& dp : md.point_data_attr_) { - data[md.instrument_descriptor.name_].push_back(dp.point_data); + data[md.instrument_descriptor.name_].push_back(dp); } } } @@ -149,8 +152,10 @@ class OTelPluginEnd2EndTest : public ::testing::Test { return data; } + const absl::string_view kMethodName = "grpc.testing.EchoTestService/Echo"; std::shared_ptr reader_; std::string server_address_; + std::string canonical_server_address_; CallbackTestServiceImpl service_; std::unique_ptr server_; std::unique_ptr stub_; @@ -162,15 +167,26 @@ TEST_F(OTelPluginEnd2EndTest, ClientAttemptStarted) { const char* kMetricName = "grpc.client.attempt.started"; auto data = ReadCurrentMetricsData( [&](const absl::flat_hash_map< - std::string, std::vector>& + std::string, + std::vector>& data) { return !data.contains(kMetricName); }); ASSERT_EQ(data[kMetricName].size(), 1); auto point_data = absl::get_if( - &data[kMetricName][0]); + &data[kMetricName][0].point_data); ASSERT_NE(point_data, nullptr); auto client_started_value = absl::get_if(&point_data->value_); ASSERT_NE(client_started_value, nullptr); - ASSERT_EQ(*client_started_value, 1); + EXPECT_EQ(*client_started_value, 1); + const auto& attributes = data[kMetricName][0].attributes.GetAttributes(); + EXPECT_EQ(attributes.size(), 2); + const auto* method_value = + absl::get_if(&attributes.at("grpc.method")); + ASSERT_NE(method_value, nullptr); + EXPECT_EQ(*method_value, kMethodName); + const auto* target_value = + absl::get_if(&attributes.at("grpc.target")); + ASSERT_NE(target_value, nullptr); + EXPECT_EQ(*target_value, canonical_server_address_); } TEST_F(OTelPluginEnd2EndTest, ClientAttemptDuration) { @@ -179,14 +195,29 @@ TEST_F(OTelPluginEnd2EndTest, ClientAttemptDuration) { const char* kMetricName = "grpc.client.attempt.duration"; auto data = ReadCurrentMetricsData( [&](const absl::flat_hash_map< - std::string, std::vector>& + std::string, + std::vector>& data) { return !data.contains(kMetricName); }); ASSERT_EQ(data[kMetricName].size(), 1); auto point_data = absl::get_if( - &data[kMetricName][0]); + &data[kMetricName][0].point_data); ASSERT_NE(point_data, nullptr); ASSERT_EQ(point_data->count_, 1); + const auto& attributes = data[kMetricName][0].attributes.GetAttributes(); + EXPECT_EQ(attributes.size(), 3); + const auto* method_value = + absl::get_if(&attributes.at("grpc.method")); + ASSERT_NE(method_value, nullptr); + EXPECT_EQ(*method_value, kMethodName); + const auto* target_value = + absl::get_if(&attributes.at("grpc.target")); + ASSERT_NE(target_value, nullptr); + EXPECT_EQ(*target_value, canonical_server_address_); + const auto* status_value = + absl::get_if(&attributes.at("grpc.status")); + ASSERT_NE(status_value, nullptr); + EXPECT_EQ(*status_value, "OK"); } TEST_F(OTelPluginEnd2EndTest, ClientAttemptSentTotalCompressedMessageSize) { @@ -197,14 +228,29 @@ TEST_F(OTelPluginEnd2EndTest, ClientAttemptSentTotalCompressedMessageSize) { "grpc.client.attempt.sent_total_compressed_message_size"; auto data = ReadCurrentMetricsData( [&](const absl::flat_hash_map< - std::string, std::vector>& + std::string, + std::vector>& data) { return !data.contains(kMetricName); }); ASSERT_EQ(data[kMetricName].size(), 1); auto point_data = absl::get_if( - &data[kMetricName][0]); + &data[kMetricName][0].point_data); ASSERT_NE(point_data, nullptr); ASSERT_EQ(point_data->count_, 1); + const auto& attributes = data[kMetricName][0].attributes.GetAttributes(); + EXPECT_EQ(attributes.size(), 3); + const auto* method_value = + absl::get_if(&attributes.at("grpc.method")); + ASSERT_NE(method_value, nullptr); + EXPECT_EQ(*method_value, kMethodName); + const auto* target_value = + absl::get_if(&attributes.at("grpc.target")); + ASSERT_NE(target_value, nullptr); + EXPECT_EQ(*target_value, canonical_server_address_); + const auto* status_value = + absl::get_if(&attributes.at("grpc.status")); + ASSERT_NE(status_value, nullptr); + EXPECT_EQ(*status_value, "OK"); } TEST_F(OTelPluginEnd2EndTest, ClientAttemptRcvdTotalCompressedMessageSize) { @@ -215,14 +261,29 @@ TEST_F(OTelPluginEnd2EndTest, ClientAttemptRcvdTotalCompressedMessageSize) { "grpc.client.attempt.rcvd_total_compressed_message_size"; auto data = ReadCurrentMetricsData( [&](const absl::flat_hash_map< - std::string, std::vector>& + std::string, + std::vector>& data) { return !data.contains(kMetricName); }); ASSERT_EQ(data[kMetricName].size(), 1); auto point_data = absl::get_if( - &data[kMetricName][0]); + &data[kMetricName][0].point_data); ASSERT_NE(point_data, nullptr); ASSERT_EQ(point_data->count_, 1); + const auto& attributes = data[kMetricName][0].attributes.GetAttributes(); + EXPECT_EQ(attributes.size(), 3); + const auto* method_value = + absl::get_if(&attributes.at("grpc.method")); + ASSERT_NE(method_value, nullptr); + EXPECT_EQ(*method_value, kMethodName); + const auto* target_value = + absl::get_if(&attributes.at("grpc.target")); + ASSERT_NE(target_value, nullptr); + EXPECT_EQ(*target_value, canonical_server_address_); + const auto* status_value = + absl::get_if(&attributes.at("grpc.status")); + ASSERT_NE(status_value, nullptr); + EXPECT_EQ(*status_value, "OK"); } TEST_F(OTelPluginEnd2EndTest, ServerCallStarted) { @@ -231,15 +292,26 @@ TEST_F(OTelPluginEnd2EndTest, ServerCallStarted) { const char* kMetricName = "grpc.server.call.started"; auto data = ReadCurrentMetricsData( [&](const absl::flat_hash_map< - std::string, std::vector>& + std::string, + std::vector>& data) { return !data.contains(kMetricName); }); ASSERT_EQ(data[kMetricName].size(), 1); auto point_data = absl::get_if( - &data[kMetricName][0]); + &data[kMetricName][0].point_data); ASSERT_NE(point_data, nullptr); auto server_started_value = absl::get_if(&point_data->value_); ASSERT_NE(server_started_value, nullptr); ASSERT_EQ(*server_started_value, 1); + const auto& attributes = data[kMetricName][0].attributes.GetAttributes(); + EXPECT_EQ(attributes.size(), 2); + const auto* method_value = + absl::get_if(&attributes.at("grpc.method")); + ASSERT_NE(method_value, nullptr); + EXPECT_EQ(*method_value, kMethodName); + const auto* authority_value = + absl::get_if(&attributes.at("grpc.authority")); + ASSERT_NE(authority_value, nullptr); + EXPECT_EQ(*authority_value, server_address_); } TEST_F(OTelPluginEnd2EndTest, ServerCallDuration) { @@ -248,14 +320,29 @@ TEST_F(OTelPluginEnd2EndTest, ServerCallDuration) { const char* kMetricName = "grpc.server.call.duration"; auto data = ReadCurrentMetricsData( [&](const absl::flat_hash_map< - std::string, std::vector>& + std::string, + std::vector>& data) { return !data.contains(kMetricName); }); ASSERT_EQ(data[kMetricName].size(), 1); auto point_data = absl::get_if( - &data[kMetricName][0]); + &data[kMetricName][0].point_data); ASSERT_NE(point_data, nullptr); ASSERT_EQ(point_data->count_, 1); + const auto& attributes = data[kMetricName][0].attributes.GetAttributes(); + EXPECT_EQ(attributes.size(), 3); + const auto* method_value = + absl::get_if(&attributes.at("grpc.method")); + ASSERT_NE(method_value, nullptr); + EXPECT_EQ(*method_value, kMethodName); + const auto* authority_value = + absl::get_if(&attributes.at("grpc.authority")); + ASSERT_NE(authority_value, nullptr); + EXPECT_EQ(*authority_value, server_address_); + const auto* status_value = + absl::get_if(&attributes.at("grpc.status")); + ASSERT_NE(status_value, nullptr); + EXPECT_EQ(*status_value, "OK"); } TEST_F(OTelPluginEnd2EndTest, ServerCallSentTotalCompressedMessageSize) { @@ -266,14 +353,29 @@ TEST_F(OTelPluginEnd2EndTest, ServerCallSentTotalCompressedMessageSize) { "grpc.server.call.sent_total_compressed_message_size"; auto data = ReadCurrentMetricsData( [&](const absl::flat_hash_map< - std::string, std::vector>& + std::string, + std::vector>& data) { return !data.contains(kMetricName); }); ASSERT_EQ(data[kMetricName].size(), 1); auto point_data = absl::get_if( - &data[kMetricName][0]); + &data[kMetricName][0].point_data); ASSERT_NE(point_data, nullptr); EXPECT_EQ(point_data->count_, 1); + const auto& attributes = data[kMetricName][0].attributes.GetAttributes(); + EXPECT_EQ(attributes.size(), 3); + const auto* method_value = + absl::get_if(&attributes.at("grpc.method")); + ASSERT_NE(method_value, nullptr); + EXPECT_EQ(*method_value, kMethodName); + const auto* authority_value = + absl::get_if(&attributes.at("grpc.authority")); + ASSERT_NE(authority_value, nullptr); + EXPECT_EQ(*authority_value, server_address_); + const auto* status_value = + absl::get_if(&attributes.at("grpc.status")); + ASSERT_NE(status_value, nullptr); + EXPECT_EQ(*status_value, "OK"); } TEST_F(OTelPluginEnd2EndTest, ServerCallRcvdTotalCompressedMessageSize) { @@ -284,14 +386,29 @@ TEST_F(OTelPluginEnd2EndTest, ServerCallRcvdTotalCompressedMessageSize) { "grpc.server.call.rcvd_total_compressed_message_size"; auto data = ReadCurrentMetricsData( [&](const absl::flat_hash_map< - std::string, std::vector>& + std::string, + std::vector>& data) { return !data.contains(kMetricName); }); ASSERT_EQ(data[kMetricName].size(), 1); auto point_data = absl::get_if( - &data[kMetricName][0]); + &data[kMetricName][0].point_data); ASSERT_NE(point_data, nullptr); ASSERT_EQ(point_data->count_, 1); + const auto& attributes = data[kMetricName][0].attributes.GetAttributes(); + EXPECT_EQ(attributes.size(), 3); + const auto* method_value = + absl::get_if(&attributes.at("grpc.method")); + ASSERT_NE(method_value, nullptr); + EXPECT_EQ(*method_value, kMethodName); + const auto* authority_value = + absl::get_if(&attributes.at("grpc.authority")); + ASSERT_NE(authority_value, nullptr); + EXPECT_EQ(*authority_value, server_address_); + const auto* status_value = + absl::get_if(&attributes.at("grpc.status")); + ASSERT_NE(status_value, nullptr); + EXPECT_EQ(*status_value, "OK"); } // Make sure that things work with the global meter provider as well @@ -301,11 +418,12 @@ TEST_F(OTelPluginEnd2EndTest, UseGlobalMeterProvider) { const char* kMetricName = "grpc.client.attempt.started"; auto data = ReadCurrentMetricsData( [&](const absl::flat_hash_map< - std::string, std::vector>& + std::string, + std::vector>& data) { return !data.contains(kMetricName); }); ASSERT_EQ(data[kMetricName].size(), 1); auto point_data = absl::get_if( - &data[kMetricName][0]); + &data[kMetricName][0].point_data); ASSERT_NE(point_data, nullptr); auto client_started_value = absl::get_if(&point_data->value_); ASSERT_NE(client_started_value, nullptr); From 0747da86c7976be36a14df8ccab48661cda24e07 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 1 Aug 2023 16:42:18 -0700 Subject: [PATCH 103/205] [promises] Fix obscure validation bug (#33947) --- src/core/lib/surface/call.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/core/lib/surface/call.cc b/src/core/lib/surface/call.cc index 2f77f780fac63..ee81abf5231cd 100644 --- a/src/core/lib/surface/call.cc +++ b/src/core/lib/surface/call.cc @@ -1930,6 +1930,9 @@ void FilterStackCall::ContextSet(grpc_context_index elem, void* value, namespace { bool ValidateMetadata(size_t count, grpc_metadata* metadata) { + if (count > INT_MAX) { + return false; + } for (size_t i = 0; i < count; i++) { grpc_metadata* md = &metadata[i]; if (!GRPC_LOG_IF_ERROR("validate_metadata", @@ -3289,9 +3292,16 @@ grpc_call_error ServerPromiseBasedCall::ValidateBatch(const grpc_op* ops, return GRPC_CALL_ERROR_INVALID_FLAGS; } break; + case GRPC_OP_SEND_STATUS_FROM_SERVER: + if (op.flags != 0) return GRPC_CALL_ERROR_INVALID_FLAGS; + if (!ValidateMetadata( + op.data.send_status_from_server.trailing_metadata_count, + op.data.send_status_from_server.trailing_metadata)) { + return GRPC_CALL_ERROR_INVALID_METADATA; + } + break; case GRPC_OP_RECV_MESSAGE: case GRPC_OP_RECV_CLOSE_ON_SERVER: - case GRPC_OP_SEND_STATUS_FROM_SERVER: if (op.flags != 0) return GRPC_CALL_ERROR_INVALID_FLAGS; break; case GRPC_OP_RECV_INITIAL_METADATA: From 2b0a9d3916b3fd7787b35af46563552a37f9a3fb Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 2 Aug 2023 14:15:19 +0200 Subject: [PATCH 104/205] [bazel] Teach bazel how to run non-bazel test suites under docker locally and on RBE (#33707) Add "bazelified" non-bazel tests. See tools/bazelify_tests/README.md for the core idea. - add a bunch of test targets that run under docker and execute tests that correspond to `run_tests.py -l LANG ...` - many more tests can be added in the future - to enable running some of the C/C++ portability tests easily, added support for `--cmake_extra_configure_args` in run_tests.py (the change is fairly small). Example passing build that shows how test results are structured: https://source.cloud.google.com/results/invocations/21295351-a3e3-4be1-b6e9-aaf52195a044/targets --- .../bazel/test_single_bazel_version.sh | 3 + tools/bazelify_tests/BUILD | 51 ++++++ tools/bazelify_tests/README.md | 45 +++++ tools/bazelify_tests/build_defs.bzl | 103 ++++++++++++ .../dockerimage_current_versions.bzl | 117 +++++++++++++ ...nerate_dockerimage_current_versions_bzl.sh | 81 +++++++++ tools/bazelify_tests/grpc_repo_archive.sh | 122 ++++++++++++++ .../bazelify_tests/grpc_run_tests_py_test.sh | 54 ++++++ tools/bazelify_tests/test/BUILD | 158 ++++++++++++++++++ .../bazelify_tests/test/portability_tests.bzl | 91 ++++++++++ tools/bazelify_tests/workspace_status_cmd.sh | 36 ++++ tools/dockerfile/push_testing_images.sh | 9 + .../linux/grpc_bazel_rbe_nonbazel.cfg | 52 ++++++ .../pull_request/grpc_bazel_rbe_nonbazel.cfg | 47 ++++++ .../include/rbe_base_config.bazelrc | 3 + .../remote_build/linux_docker_sandbox.bazelrc | 45 +++++ tools/run_tests/run_tests.py | 24 ++- 17 files changed, 1038 insertions(+), 3 deletions(-) create mode 100644 tools/bazelify_tests/BUILD create mode 100644 tools/bazelify_tests/README.md create mode 100644 tools/bazelify_tests/build_defs.bzl create mode 100644 tools/bazelify_tests/dockerimage_current_versions.bzl create mode 100755 tools/bazelify_tests/generate_dockerimage_current_versions_bzl.sh create mode 100755 tools/bazelify_tests/grpc_repo_archive.sh create mode 100755 tools/bazelify_tests/grpc_run_tests_py_test.sh create mode 100644 tools/bazelify_tests/test/BUILD create mode 100644 tools/bazelify_tests/test/portability_tests.bzl create mode 100755 tools/bazelify_tests/workspace_status_cmd.sh create mode 100644 tools/internal_ci/linux/grpc_bazel_rbe_nonbazel.cfg create mode 100644 tools/internal_ci/linux/pull_request/grpc_bazel_rbe_nonbazel.cfg create mode 100644 tools/remote_build/linux_docker_sandbox.bazelrc diff --git a/test/distrib/bazel/test_single_bazel_version.sh b/test/distrib/bazel/test_single_bazel_version.sh index 66e3240b8ab1c..6d01430598d39 100755 --- a/test/distrib/bazel/test_single_bazel_version.sh +++ b/test/distrib/bazel/test_single_bazel_version.sh @@ -44,6 +44,9 @@ EXCLUDED_TARGETS=( # TODO(jtattermusch): add back once fixed "-//examples/android/binder/..." + + # Exclude bazelified tests as they contain some bazel hackery + "-//tools/bazelify_tests/..." ) TEST_DIRECTORIES=( diff --git a/tools/bazelify_tests/BUILD b/tools/bazelify_tests/BUILD new file mode 100644 index 0000000000000..a81d40f5b04dc --- /dev/null +++ b/tools/bazelify_tests/BUILD @@ -0,0 +1,51 @@ +# Copyright 2023 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("//bazel:grpc_build_system.bzl", "grpc_package") + +licenses(["notice"]) + +# TODO(jtattermusch): adjust the visibility +grpc_package( + name = "tools/bazelify_tests", + visibility = "public", +) + +exports_files([ + "grpc_run_tests_py_test.sh", + "grpc_build_artifact_task.sh", +]) + +genrule( + name = "grpc_repo_archive", + srcs = + [ + "grpc_repo_archive.sh", + ], + outs = [ + "grpc_repo_archive.tar.gz", + "grpc_repo_archive_with_submodules.tar.gz", + ], + cmd = "$(location grpc_repo_archive.sh) $(location grpc_repo_archive.tar.gz) $(location grpc_repo_archive_with_submodules.tar.gz)", + local = True, + stamp = 1, + tags = [ + "manual", + ], +) + +alias( + name = "grpc_repo_archive_with_submodules", + actual = ":grpc_repo_archive", +) diff --git a/tools/bazelify_tests/README.md b/tools/bazelify_tests/README.md new file mode 100644 index 0000000000000..fb14bbbf5a83b --- /dev/null +++ b/tools/bazelify_tests/README.md @@ -0,0 +1,45 @@ +# Non-Bazel native tests + +This directory contains logic that wraps builds and tests from the non-bazel realm to make them runnable under bazel. + +Examples: cmake builds, run_tests.py tests, artifacts, distribtests etc. + +NOTE: all tests and their setup under this directory are currently EXPERIMENTAL. + +## How it works + +The `//tools/bazelify_tests:repo_archive` target produces an archive that contains grpc at the current head with all its submodules. The rule uses a few tricks to achieve this: + +* Uses a workspace status command to obtain the commit SHAs of grpc and all submodules from the workspace. +* When running, it actually jailbreaks from the bazel execroot to access the bazel workspace and create the necessary archives. +* The produced archives are deterministic (they have the same checksum if neither grpc or its submodules have changed). +* The target is defined in such a way so that it behaves "reasonably" from bazel's perspective (always re-runs if commit SHAs have changed, can be cached if not). + +After grpc source code is archived, the "bazelified" tests basically depend on the archive and they run a script under a docker container. +The script unpacks the archived grpc code and creates a temporary workspace (under bazel's target execroot) and then performs the actions that are needed +(e.g. run the run_tests.py test harness, run cmake build etc). + +There are two ways the test targets can run under a docker container: + +* When running on RBE, all actions run under a docker container by definition. +* When running locally, bazel will start a docker container for each action when [docker sandbox](https://bazel.build/remote/sandbox) is used. + (Note that the docker sandbox currently [doesn't work on windows](https://github.com/bazelbuild/bazel/issues/19101)) + +In both cases, the docker image which is used for any given action is determined by the action's `exec_properties` and can be specified as a default +(e.g. by RBE toolchain or by setting `--experimental_docker_image` flag) or explicitly for each action. For most tests in this directory, +the test rules actually configure the `exec_properties` for you, based on selecting one of the gRPC's testing docker images. + +## Run tests on RBE + +``` +# "--genrule_strategy=remote,local" allows fallback to local execution if action doesn't support running remotely +# (required to be able to run the //tools/bazelify_tests:repo_archive target). +tools/bazel --bazelrc=tools/remote_build/linux.bazelrc test --genrule_strategy=remote,local --workspace_status_command=tools/bazelify_tests/workspace_status_cmd.sh //tools/bazelify_tests/test:basic_tests_linux +``` + +## Run tests locally under bazel's docker sandbox + +``` +tools/bazel --bazelrc=tools/remote_build/linux_docker_sandbox.bazelrc test --workspace_status_command=tools/bazelify_tests/workspace_status_cmd.sh //tools/bazelify_tests/test:basic_tests_linux +``` + diff --git a/tools/bazelify_tests/build_defs.bzl b/tools/bazelify_tests/build_defs.bzl new file mode 100644 index 0000000000000..ec5054e6ddf4b --- /dev/null +++ b/tools/bazelify_tests/build_defs.bzl @@ -0,0 +1,103 @@ +# Copyright 2023 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +Contains macros used for running bazelified tests. +""" + +load(":dockerimage_current_versions.bzl", "DOCKERIMAGE_CURRENT_VERSIONS") + +def grpc_run_tests_py_test(name, args = [], data = [], size = "medium", timeout = None, tags = [], exec_compatible_with = [], flaky = None, docker_image_version = None, use_login_shell = None, prepare_script = None): + """Execute an run_tests.py-harness style test under bazel. + + Args: + name: The name of the test. + args: The args to supply to the test binary. + data: Data dependencies. + size: The size of the test. + timeout: The test timeout. + tags: The tags for the test. + exec_compatible_with: A list of constraint values that must be + satisifed for the platform. + flaky: Whether this test is flaky. + docker_image_version: The docker .current_version file to use for docker containerization. + use_login_shell: If True, the run_tests.py command will run under a login shell. + prepare_script: Optional script that will be sourced before run_tests.py runs. + """ + + data = [ + "//tools/bazelify_tests:grpc_repo_archive_with_submodules.tar.gz", + ] + data + + args = [ + "$(location //tools/bazelify_tests:grpc_repo_archive_with_submodules.tar.gz)", + ] + args + + srcs = [ + "//tools/bazelify_tests:grpc_run_tests_py_test.sh", + ] + + env = {} + + if use_login_shell: + env["GRPC_RUNTESTS_USE_LOGIN_SHELL"] = "1" + + if prepare_script: + data = data + [prepare_script] + env["GRPC_RUNTESTS_PREPARE_SCRIPT"] = "$(location " + prepare_script + ")" + + # Enable ccache by default. This is important for speeding up the C++ cmake build, + # which isn't very efficient and tends to recompile some source files multiple times. + # Even though only the local disk cache is enabled (local to the docker container, + # so will be thrown away after the bazel actions finishes), ccache still speeds up + # the C++ build significantly. + # TODO(jtattermusch): find a cleaner way to toggle ccache for builds. + env["GRPC_BUILD_ENABLE_CCACHE"] = "true" + + # TODO(jtattermusch): use rbe_exec_properties helpers instead of manually specifying + # the properties, which is fragile. + exec_properties = { + "dockerNetwork": "standard", # TODO(jtattermusch): look into deactivating network for some actions + "label:workload": "misc", # always use a dedicated "misc" pool for running bazelified tests + "label:machine_size": "misc_large", # needed to override the default value of "small". + } + if docker_image_version: + image_spec = DOCKERIMAGE_CURRENT_VERSIONS.get(docker_image_version, None) + if not image_spec: + fail("Version info for docker image '%s' not found in dockerimage_current_versions.bzl" % docker_image_version) + exec_properties["container-image"] = image_spec + + # since the tests require special bazel args, only run them when explicitly requested + tags = ["manual"] + tags + + # TODO(jtattermusch): find a way to ensure that action can only run under docker sandbox or remotely + # to avoid running it outside of a docker container by accident. + + test_args = { + "name": name, + "srcs": srcs, + "tags": tags, + "args": args, + "flaky": flaky, + "data": data, + "size": size, + "env": env, + "timeout": timeout, + "exec_compatible_with": exec_compatible_with, + "exec_properties": exec_properties, + } + + native.sh_test( + **test_args + ) diff --git a/tools/bazelify_tests/dockerimage_current_versions.bzl b/tools/bazelify_tests/dockerimage_current_versions.bzl new file mode 100644 index 0000000000000..79147f8ea0804 --- /dev/null +++ b/tools/bazelify_tests/dockerimage_current_versions.bzl @@ -0,0 +1,117 @@ +# Copyright 2023 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +This file is generated by generate_dockerimage_current_versions_bzl.sh +It makes the info from testing docker image *.current_version files +accessible to bazel builds. +""" + +DOCKERIMAGE_CURRENT_VERSIONS = { + "third_party/rake-compiler-dock/rake_aarch64-linux.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/rake_aarch64-linux@sha256:61a46ab67972990aea77024817d29ca6fa43d2639fe4aaef9c30e031f84519a9", + "third_party/rake-compiler-dock/rake_arm64-darwin.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/rake_arm64-darwin@sha256:e0eb1f9f632fb18d4f244b7297d1a5e7cf60ae58e649ac5b2f8ac6266ea07128", + "third_party/rake-compiler-dock/rake_x64-mingw-ucrt.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/rake_x64-mingw-ucrt@sha256:63490b0000c6011a19983fef637efc69a2ae0f67b7a4e29cd36db53c881e908d", + "third_party/rake-compiler-dock/rake_x64-mingw32.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/rake_x64-mingw32@sha256:63ece6e9b336b7cbf66eaa0201505b0579ac06cd7802f19b44c3a816d5617c17", + "third_party/rake-compiler-dock/rake_x86-linux.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/rake_x86-linux@sha256:71e3afca0843bf7bd5da7fa04bff40ad976e76aa5867936166b30251d0a692d8", + "third_party/rake-compiler-dock/rake_x86-mingw32.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/rake_x86-mingw32@sha256:629be8f57e2d50b123584f2cfa00ff5b968cc2cc3b2a6b874acd07100a3eb96d", + "third_party/rake-compiler-dock/rake_x86_64-darwin.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/rake_x86_64-darwin@sha256:8dd11cad778d9fc01c3555a57254016f5db7227309d24f50a192a6db80d4a51c", + "third_party/rake-compiler-dock/rake_x86_64-linux.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/rake_x86_64-linux@sha256:9aa77587fa4d4c25c91d0ccca8eb806cf0738a4b67eb4b54d40324185658194e", + "tools/dockerfile/distribtest/cpp_debian10_aarch64_cross_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/cpp_debian10_aarch64_cross_x64@sha256:15eeafcd816cb32a0d44da22f654749352a92fec9626dc028b39948897d5bea3", + "tools/dockerfile/distribtest/cpp_debian10_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/cpp_debian10_x64@sha256:904e3db8521697768f94aa08230063b474246184e126f74a41b98a6f4aaf6a49", + "tools/dockerfile/distribtest/csharp_alpine_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_alpine_x64@sha256:d018105349fcabdc3aa0649c1381d840c613df6b442a53a751d7dc839a80d429", + "tools/dockerfile/distribtest/csharp_centos7_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_centos7_x64@sha256:ec715dd5fbd621789e7598c8d4ac346a7b4037b0cc83fbb29990dc8e4c1f1a13", + "tools/dockerfile/distribtest/csharp_debian10_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_debian10_x64@sha256:8c3838e731da70566adc6f989f2c29351fdb2f629e8797928699fff24b3a0938", + "tools/dockerfile/distribtest/csharp_dotnet31_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_dotnet31_x64@sha256:fee52df6064ff84bc9af644c2ea17ab579de3401e3a167d0d43383c24f0d500f", + "tools/dockerfile/distribtest/csharp_dotnet5_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_dotnet5_x64@sha256:408425cd74bb8b79a3b09a64ea6c54f6cdc0e757a3469f31effc017a7187e442", + "tools/dockerfile/distribtest/csharp_ubuntu1604_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_ubuntu1604_x64@sha256:e0f44406df14a28ce0a0f4e26c74c95f0fa5dddadf1fdbb2a3793b7c8ef8fa63", + "tools/dockerfile/distribtest/php7_debian10_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/php7_debian10_x64@sha256:e760a60f2dce2dada571d9b07447a9f99ffeeb366a309dbbb5dc0a43991c22dc", + "tools/dockerfile/distribtest/python_alpine_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_alpine_x64@sha256:699ac7b86199406fa27e88f30a1c623ef34ac33f6d9330fd13a6f6457ee4e19f", + "tools/dockerfile/distribtest/python_arch_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_arch_x64@sha256:2c1adadeb010e107132cf5137f32a2d18727796631245b110cc74f69c07502e1", + "tools/dockerfile/distribtest/python_buster_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_buster_x64@sha256:e501dc8e2f4ab9cd4382974759a879a27c065c8fed5327f538764298fc5c4972", + "tools/dockerfile/distribtest/python_buster_x86.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_buster_x86@sha256:185fbb174525d67b6146f4d233c804c589b0b57d783bb1bf95bc47cfe792754e", + "tools/dockerfile/distribtest/python_centos7_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_centos7_x64@sha256:39afaa687cb8516eef1621ed789326fdde2014fd3c81d11a1ded72f2d5285fe1", + "tools/dockerfile/distribtest/python_dev_alpine3.7_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_dev_alpine3.7_x64@sha256:7c08f67211a49eb72ad08c29de5c64a914c066d9c1670b712e717571b8d5c7e2", + "tools/dockerfile/distribtest/python_dev_arch_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_dev_arch_x64@sha256:29f179ef2083ee6addd57e90f58781fdc1cb5dc3dd3e228da1af38785b921f35", + "tools/dockerfile/distribtest/python_dev_buster_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_dev_buster_x64@sha256:e30d6efdeac24e5136cc169d503a239df22147bfb121d27feb1f87d58a8fe64e", + "tools/dockerfile/distribtest/python_dev_buster_x86.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_dev_buster_x86@sha256:179146fd5d5cc15846c6bf0284c2e261f383caf944559d2d9f7a5af0e0f7152d", + "tools/dockerfile/distribtest/python_dev_centos7_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_dev_centos7_x64@sha256:e6e9a1b23a0a543050db91e17d621aa899bad04308adaf961c11fa88ba941a95", + "tools/dockerfile/distribtest/python_dev_fedora34_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_dev_fedora34_x64@sha256:20bc3a6283a99407eb637b3cde1ff3e1288a1e21388a1dc385c2b4df5a1eb1c2", + "tools/dockerfile/distribtest/python_dev_ubuntu1604_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_dev_ubuntu1604_x64@sha256:167134c3a43e7d2608c893cc98a5066eae93c6af97ef5a1e69d643cbc7fefc43", + "tools/dockerfile/distribtest/python_dev_ubuntu1804_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_dev_ubuntu1804_x64@sha256:157a89cd6d0e69b89ac1975e0314aade556a35aafbaa5fe9f9890f90321d6c89", + "tools/dockerfile/distribtest/python_dev_ubuntu2004_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_dev_ubuntu2004_x64@sha256:91f0d88c43ec52ecd63f99acb424c88ff9a67fa046fae207a75e99bee37eef11", + "tools/dockerfile/distribtest/python_fedora34_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_fedora34_x64@sha256:5aa8e41d627ddd6bc10aae6b12d25ded90ba8554a63b279f43f44e0d6cf001dd", + "tools/dockerfile/distribtest/python_opensuse_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_opensuse_x64@sha256:da52566b078d10e537aa219e59641731a57e5dc7d17d6737f5e5a7d447acf5cc", + "tools/dockerfile/distribtest/python_python38_buster_aarch64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_python38_buster_aarch64@sha256:487b9af2ad1459ee2630694e61074d4ac525d4f90b2bdb026dbf6f77fb3e9878", + "tools/dockerfile/distribtest/python_ubuntu1604_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_ubuntu1604_x64@sha256:44a821a9f5431122c2e239ba35cf181c2fde84a5d866e8add338599565881492", + "tools/dockerfile/distribtest/python_ubuntu1804_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_ubuntu1804_x64@sha256:edcd5f342d77ad9129cc0a0e6988b47b144815e7a93091d5b45e850111eefbcf", + "tools/dockerfile/distribtest/python_ubuntu2004_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_ubuntu2004_x64@sha256:342e9dc23b674ad256b220745745be818708a1baa25a2690f0d4f777e28a22a3", + "tools/dockerfile/distribtest/ruby_centos7_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_centos7_x64@sha256:4d529b984b78ca179086f7f9b416605e2d9a96ca0a28a71f4421bb5ffdc18f96", + "tools/dockerfile/distribtest/ruby_debian10_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian10_x64@sha256:1298c39c950b2a48261555b6cff1ae66230a5020f100d3b381759285f0caf84e", + "tools/dockerfile/distribtest/ruby_debian10_x64_ruby_2_6.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian10_x64_ruby_2_6@sha256:3ef9a84a77276f2ccaca3c97336573f76ed02719645e4bb67ccdf1f33da99fc8", + "tools/dockerfile/distribtest/ruby_debian10_x64_ruby_2_7.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian10_x64_ruby_2_7@sha256:5ee26ad3abe2683c9a8ee03987ab0ae63f50793c3d3f5e4be6e6cbacb4556fcf", + "tools/dockerfile/distribtest/ruby_debian10_x64_ruby_3_0.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian10_x64_ruby_3_0@sha256:9190da90a2a95eca1370cef64dcba7ddee9f59cc7487093da6711c1280a0b0f9", + "tools/dockerfile/distribtest/ruby_ubuntu1604_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_ubuntu1604_x64@sha256:e0276968184a6c1e16de4e6afbbd469df91b27e40d061340841c76e864fdcb50", + "tools/dockerfile/distribtest/ruby_ubuntu1804_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_ubuntu1804_x64@sha256:d38b3dd34cffc027e9a1bf82bc7ace75b8a9829c2d04d5cf7cc8323655edd27a", + "tools/dockerfile/grpc_artifact_centos6_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_centos6_x64@sha256:3285047265ea2b7c5d4df4c769b2d05f56288d947c75e16d27ae2dee693f791b", + "tools/dockerfile/grpc_artifact_centos6_x86.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_centos6_x86@sha256:19783239da92208f0f39cf563529cd02e889920497ef81c60d20391fa998af62", + "tools/dockerfile/grpc_artifact_protoc_aarch64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_protoc_aarch64@sha256:1a3957f32e81259e6f3c602bd67feb132ebc5a5f23e9cb0bf63ba34b91185982", + "tools/dockerfile/grpc_artifact_python_linux_armv7.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_linux_armv7@sha256:4f817dece74bbdc7c4fccdc9b0a25cefb9101781a60bf0bb827e533e79f9b1f2", + "tools/dockerfile/grpc_artifact_python_manylinux2014_aarch64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_manylinux2014_aarch64@sha256:d56ea4394ea5ea9d09f940d1dba31e6196a8e919f60c6a4966a9192faa997f11", + "tools/dockerfile/grpc_artifact_python_manylinux2014_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_manylinux2014_x64@sha256:67ab746e6da576606ebf41ad81027ad897544445fb93d5d5ca5f9d9b5428ec84", + "tools/dockerfile/grpc_artifact_python_manylinux2014_x86.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_manylinux2014_x86@sha256:993a963ac3985f8634951e1573d34e24b3868dfff3ad4ae4875dd2c47b73224f", + "tools/dockerfile/grpc_artifact_python_musllinux_1_1_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_musllinux_1_1_x64@sha256:09bf18cc793d55cfc48d8e88b8b6e6914e9df2b35ec417fe77a4e20bfa251df7", + "tools/dockerfile/grpc_artifact_python_musllinux_1_1_x86.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_musllinux_1_1_x86@sha256:0512449e7d218c7687eb447701c8c6a33153a722722b76b2423ec58440a027de", + "tools/dockerfile/interoptest/grpc_interop_aspnetcore.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_aspnetcore@sha256:8e2e732e78724a8382c340dca72e7653c5f82c251a3110fa2874cc00ba538878", + "tools/dockerfile/interoptest/grpc_interop_cxx.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_cxx@sha256:a69a1ed729137c3ea347f0a3488524573285be7832dd74cec830db57b61a9b8c", + "tools/dockerfile/interoptest/grpc_interop_dart.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_dart@sha256:5e335005b27709f0882c5723affafa55094bd27a0cda7ce91c718deed157f2bb", + "tools/dockerfile/interoptest/grpc_interop_go.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_go@sha256:889e7ff34399a5e16af87940d1eaa239e56da307f7faca3f8f1d28379c2e3df3", + "tools/dockerfile/interoptest/grpc_interop_go1.11.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_go1.11@sha256:29cde59287843a3208c0cabeaf430cf813846a738c8a1b9692e68b54bbbdcc2d", + "tools/dockerfile/interoptest/grpc_interop_go1.16.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_go1.16@sha256:d5b2b0c02e7a8196fea704196a8221994983c22eece2ac2324e095e8972a957f", + "tools/dockerfile/interoptest/grpc_interop_go1.19.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_go1.19@sha256:889e7ff34399a5e16af87940d1eaa239e56da307f7faca3f8f1d28379c2e3df3", + "tools/dockerfile/interoptest/grpc_interop_go1.8.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_go1.8@sha256:7830a301b37539252c592b9cd7fa30a6142d0afc717a05fc8d2b82c74fb45efe", + "tools/dockerfile/interoptest/grpc_interop_http2.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_http2@sha256:e3f247d8038374848fadf7215b841e3575c0b2a4217feb503a79b8004b164c5a", + "tools/dockerfile/interoptest/grpc_interop_java.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_java@sha256:d9210764071662ba2f377dafcaff4b743f41e4dff1876dd47df7b1c6950f88af", + "tools/dockerfile/interoptest/grpc_interop_node.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_node@sha256:337e9995563e4f569b4daf843d0a2af0619e086481ce3ba3f888434eb2ddc28b", + "tools/dockerfile/interoptest/grpc_interop_nodepurejs.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_nodepurejs@sha256:9061077a17eb6f2306af563ed85c12630480f6d6ce15919d67ef5567dbab559e", + "tools/dockerfile/interoptest/grpc_interop_php7.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_php7@sha256:09f4b895117c81506c423360b617917d06d3f7f0b78e4cca25eaec547ba6991e", + "tools/dockerfile/interoptest/grpc_interop_python.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_python@sha256:fef1247f8256be2b9841331e7d21b0046da21a4a6d34a62addb36f62124725cf", + "tools/dockerfile/interoptest/grpc_interop_pythonasyncio.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_pythonasyncio@sha256:bd4cdc8a71ef339193e178ce20d2b47a0b2aa25fc86c0b5740b9d86a2d4a0caa", + "tools/dockerfile/interoptest/grpc_interop_ruby.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_ruby@sha256:0de52450b29cf91365e623b020cd97722c307510ba1813bee09264e0a49acdbc", + "tools/dockerfile/interoptest/lb_interop_fake_servers.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/lb_interop_fake_servers@sha256:b89a51dd9147e1293f50ee64dd719fce5929ca7894d3770a3d80dbdecb99fd52", + "tools/dockerfile/test/android_ndk.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/android_ndk@sha256:2bddf36ae504968b35f97e4a6c9b74864473689e84049675c30afb70f868d897", + "tools/dockerfile/test/bazel.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/bazel@sha256:1118150d9d9479787165fff49f660a3dc633f1c57604305460172fc1916aa022", + "tools/dockerfile/test/bazel_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/bazel_arm64@sha256:dd4a71e2852faf24b45e21445331f400bb278c83f6ad6d7d89d43c9ac564d529", + "tools/dockerfile/test/binder_transport_apk.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/binder_transport_apk@sha256:85341f035e44601a93d16ff5b9b5810a0da313af03e2a76cf4135144633e0bab", + "tools/dockerfile/test/csharp_debian11_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_debian11_arm64@sha256:e1345c81aaab856eab0635ddbe612294bee9ee38d4938d3434eab277de6029b8", + "tools/dockerfile/test/csharp_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_debian11_x64@sha256:a38ffe41c25486ad0624f54b4a5fa11e74772a06f537c553b3ae3944511ef348", + "tools/dockerfile/test/cxx_alpine_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_alpine_x64@sha256:61fc7408e1171d9470bdd6920cc9da34e31fc43115b80f0fb6f7b9669ba6e366", + "tools/dockerfile/test/cxx_clang_15_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_clang_15_x64@sha256:aaac47bdeccfcf43331963a75df6a377923c69d1b57ea076c2072b140e00af65", + "tools/dockerfile/test/cxx_clang_6_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_clang_6_x64@sha256:79ecf682702190564c41289ffe00d4e6f80c104807cca324340349e84288ad99", + "tools/dockerfile/test/cxx_debian11_openssl102_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_debian11_openssl102_x64@sha256:8552c41ecca59e32cb3079981cce0b2993a443f1730562a7f19a172ab29f1b2d", + "tools/dockerfile/test/cxx_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_debian11_x64@sha256:f4d2b360e8a49d95e8e92971566674a06015427c2488a841b3386feb41d2ff22", + "tools/dockerfile/test/cxx_debian11_x86.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_debian11_x86@sha256:77a0be06797567ad9e4924bb5f1a523cd23555af0518a1525fc4a940d60d035c", + "tools/dockerfile/test/cxx_debian12_openssl309_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_debian12_openssl309_x64@sha256:e8878bf31f42f8af6a7f3b45d0cb79f29fc46c44721b4a8357a2070ab1f5b3e0", + "tools/dockerfile/test/cxx_gcc_12_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_gcc_12_x64@sha256:ca86af6cb592b4426585a67c7fe58d9925a6e5413801ab45831cd268102c4211", + "tools/dockerfile/test/cxx_gcc_7_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_gcc_7_x64@sha256:7d1af94c7329b6b09f6266a56380c0690a31e9121abc89cb8a57820e0f6eb3bb", + "tools/dockerfile/test/php73_zts_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/php73_zts_debian11_x64@sha256:db46a738bf187ffcabbd278a716930c87f90dec2599349c5a52937f9a17e96f8", + "tools/dockerfile/test/php7_debian11_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/php7_debian11_arm64@sha256:444e25f9e3a89c2438e4d5e6f3904c5a1f4d1fb961f8456333ebe3e36e301a4e", + "tools/dockerfile/test/php7_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/php7_debian11_x64@sha256:018d422abf144fc93e9027fd994f7d6aab453fffbe4a669d622dd3d1c1fe9ee7", + "tools/dockerfile/test/python_alpine_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_alpine_x64@sha256:d10159225ae25276b7ae7bfc4230150e4b0a8ce7be833d904bdd4ecdfdc91c6e", + "tools/dockerfile/test/python_debian11_default_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_arm64@sha256:868cfb50e465f086b75bb65a7fab6d15b1edefabcd8c1826340acefb6ea1737f", + "tools/dockerfile/test/python_debian11_default_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_x64@sha256:4f29e539941d22b7abb911f9b6b3101ff5c7c4fb75585bfe3b7389251ea6be1d", + "tools/dockerfile/test/rbe_ubuntu2004.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/rbe_ubuntu2004@sha256:d3951aeadf43e3bee6adc5b86d26cdaf0b9d1b5baf790d7b2530d1c197adc9f8", + "tools/dockerfile/test/ruby_debian11_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_arm64@sha256:9503d80a40555aba4dd531b64354ad8036c6b37e162c93e7994ca23d89bc7d41", + "tools/dockerfile/test/ruby_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_x64@sha256:3f01369c3e5707fa63007820b30461b9e32a4b729d81cb92d19669d7966a8584", + "tools/dockerfile/test/sanity.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/sanity@sha256:189e07d8503aa15344e3c8f565783659c3e2edc5b8ca455ec427de1e29ef4504", +} diff --git a/tools/bazelify_tests/generate_dockerimage_current_versions_bzl.sh b/tools/bazelify_tests/generate_dockerimage_current_versions_bzl.sh new file mode 100755 index 0000000000000..ab5eee8923ba8 --- /dev/null +++ b/tools/bazelify_tests/generate_dockerimage_current_versions_bzl.sh @@ -0,0 +1,81 @@ +#!/bin/bash +# Copyright 2023 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Generates dockerimage_current_versions.bzl file from the .current_version +# files found throughout the repository. + +set -e + +cd $(dirname $0)/../.. + +OUTPUT_FILE=tools/bazelify_tests/dockerimage_current_versions.bzl +if [ "${CHECK_MODE}" != "" ] +then + # generate into temporary file instead + ORIG_FILE="${OUTPUT_FILE}" + OUTPUT_FILE="$(mktemp)" +fi + +# Generate license header and module docstring. +cat >"${OUTPUT_FILE}" << EOF +# Copyright 2023 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +This file is generated by generate_dockerimage_current_versions_bzl.sh +It makes the info from testing docker image *.current_version files +accessible to bazel builds. +""" + +EOF + +echo "DOCKERIMAGE_CURRENT_VERSIONS = {" >>"${OUTPUT_FILE}" + +for current_version_file in $(find tools/ third_party/rake-compiler-dock -name '*.current_version' | LC_ALL=C sort) +do + # Remove the docker image tag and only keep the SHA256 digest for the dockerimage. + # For some reason, bazel's "container-image" exec property doesn't accept image spec + # with both tag and SHA256 digest. + echo " \"${current_version_file}\": \"docker://$(cat ${current_version_file} | sed 's/:[a-f0-9]*@sha256/@sha256/')\"," >>"${OUTPUT_FILE}" +done + +echo "}" >>"${OUTPUT_FILE}" + +if [ "${CHECK_MODE}" != "" ] +then + echo "Checking that ${ORIG_FILE} is up-to-date." + diff "${OUTPUT_FILE}" "${ORIG_FILE}" || CHECK_FAILED=true + + if [ "${CHECK_FAILED}" != "" ] + then + echo "CHECK FAILED: Generated file ${ORIG_FILE} is out of date and needs to be regenerated." + exit 1 + else + echo "${ORIG_FILE} is up-to-date." + fi +else + echo "Generated ${OUTPUT_FILE}" +fi diff --git a/tools/bazelify_tests/grpc_repo_archive.sh b/tools/bazelify_tests/grpc_repo_archive.sh new file mode 100755 index 0000000000000..2f716ebe80d3d --- /dev/null +++ b/tools/bazelify_tests/grpc_repo_archive.sh @@ -0,0 +1,122 @@ +#!/bin/bash +# Copyright 2023 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e + +ARCHIVE_WO_SUBMODULES="$1" +ARCHIVE_WITH_SUBMODULES="$2" +export ARCHIVES_DIR="$(pwd)/archives" + +export ARCHIVE_FORMAT=tar + +mkdir -p "${ARCHIVES_DIR}" +rm -rf "${ARCHIVES_DIR}"/* + +# TODO(jtattermusch): This script is currently only tested on linux. +# Nothing prevents it from working on other systems in principle, +# but more work is needed. + +# HACK: To be able to collect all grpc source files as an archive +# we need to break from bazel's "sandbox" to be able to read files +# from the original bazel workspace (which in our case is the grpc repository root) +# This action runs with the "standalone" (a.k.a) local strategy, +# so path to the original bazel workspace from where this was invoked +# can be obtained by resolving the link that points to one of the +# source files. +# 1. find first component of the relative path to this script +# 2. resolve the symlink (it will point to same dir in the workspace) +# 3. one level up is the root of the original bazel workspace +FIRST_PATH_COMPONENT="$(echo $0 | sed 's|/.*||')" +ORIGINAL_BAZEL_WORKSPACE_ROOT="$(dirname $(readlink ${FIRST_PATH_COMPONENT}))" + +# extract STABLE_GIT_COMMIT from stable-status.txt +GRPC_GIT_COMMIT_FROM_STABLE_STATUS=$(grep ^STABLE_GRPC_GIT_COMMIT bazel-out/stable-status.txt | cut -d' ' -f2) + +if [ "${GRPC_GIT_COMMIT_FROM_STABLE_STATUS}" == "" ] +then + echo "Failed to obtain info about gRPC git commit from the bazel workspace. Make sure you invoke bazel with --workspace_status_command=tools/bazelify_tests/workspace_status_cmd.sh" >&2 + exit 1 +fi + +GRPC_UNCOMMITED_PATCH_CHECKSUM_FROM_STABLE_STATUS=$(grep ^STABLE_GRPC_UNCOMMITED_PATCH_CHECKSUM bazel-out/stable-status.txt | cut -d' ' -f2) +GRPC_GIT_WORKSPACE_DIRTY_FROM_STABLE_STATUS=$(grep ^STABLE_GRPC_GIT_WORKSPACE_DIRTY bazel-out/stable-status.txt | cut -d' ' -f2) + +pushd ${ORIGINAL_BAZEL_WORKSPACE_ROOT} >/dev/null + +if [ "${GRPC_GIT_COMMIT_FROM_STABLE_STATUS}" != "$(git rev-parse HEAD)" ] +then + echo "Info about gRPC commit from stable-status.txt doesn't match the commit at which the workspace root is." >&2 + echo "This is unexpected and giving up early is better than risking to end up with bogus results." >&2 + exit 1 +fi + +mkdir -p ${ARCHIVES_DIR}/grpc +git archive --format="${ARCHIVE_FORMAT}" HEAD >"${ARCHIVES_DIR}/grpc/$(git rev-parse HEAD).${ARCHIVE_FORMAT}" + +if [ "${GRPC_UNCOMMITED_PATCH_CHECKSUM_FROM_STABLE_STATUS}" != "" ] +then + git diff HEAD >"${ARCHIVES_DIR}/grpc/grpc_uncommited_${GRPC_UNCOMMITED_PATCH_CHECKSUM_FROM_STABLE_STATUS}.patch" + # check that the actual checksum of the patch file is what we expect it to be + echo "${GRPC_UNCOMMITED_PATCH_CHECKSUM_FROM_STABLE_STATUS} ${ARCHIVES_DIR}/grpc/grpc_uncommited_${GRPC_UNCOMMITED_PATCH_CHECKSUM_FROM_STABLE_STATUS}.patch" | sha256sum --quiet --check +fi + +# produce archive for each submodule +git submodule --quiet foreach 'git_commit="$(git rev-parse HEAD)"; mkdir -p ${ARCHIVES_DIR}/${name}; git archive --format=${ARCHIVE_FORMAT} HEAD >${ARCHIVES_DIR}/${name}/${git_commit}.${ARCHIVE_FORMAT}' + +popd >/dev/null + +# Extract grpc +mkdir grpc +tar -xopf "${ARCHIVES_DIR}/grpc/${GRPC_GIT_COMMIT_FROM_STABLE_STATUS}.${ARCHIVE_FORMAT}" -C grpc + +# apply the patch +if [ "${GRPC_UNCOMMITED_PATCH_CHECKSUM_FROM_STABLE_STATUS}" != "" ] +then + pushd grpc >/dev/null + patch --quiet -p1 <"${ARCHIVES_DIR}/grpc/grpc_uncommited_${GRPC_UNCOMMITED_PATCH_CHECKSUM_FROM_STABLE_STATUS}.patch" + popd >/dev/null +fi + +# The archive produced need to be deterministic/stable. +# Passing the following args to tar should be enough to make them so. +# See https://reproducible-builds.org/docs/archives/ +DETERMINISTIC_TAR_ARGS=( + --sort=name + # use a fixed mtime timestamp for all files (2015-01-01 00:00Z works just fine) + --mtime="@1420070400" + --owner=0 + --group=0 + --numeric-owner + --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime +) + +# create archive without submodules first +tar "${DETERMINISTIC_TAR_ARGS[@]}" -czf ${ARCHIVE_WO_SUBMODULES} grpc + +SUBMODULE_ARCHIVE_LIST="$(grep 'STABLE_GRPC_SUBMODULE_ARCHIVES ' bazel-out/stable-status.txt | sed 's/^STABLE_GRPC_SUBMODULE_ARCHIVES //')" +# TODO(jtattermusch): handle spaces in submodule directory path +for submodule_archive in ${SUBMODULE_ARCHIVE_LIST} +do + archive_subdir="grpc/$(dirname ${submodule_archive})" + mkdir -p $archive_subdir + # Extract submodule archive under the correct subdirectory in grpc + tar -xopf "${ARCHIVES_DIR}/${submodule_archive}.${ARCHIVE_FORMAT}" -C $archive_subdir +done + +# create archive with everything +tar "${DETERMINISTIC_TAR_ARGS[@]}" -czf ${ARCHIVE_WITH_SUBMODULES} grpc + +# Cleanup intermediate files we created +rm -rf "${ARCHIVES_DIR}" grpc diff --git a/tools/bazelify_tests/grpc_run_tests_py_test.sh b/tools/bazelify_tests/grpc_run_tests_py_test.sh new file mode 100755 index 0000000000000..695bcaf4601b1 --- /dev/null +++ b/tools/bazelify_tests/grpc_run_tests_py_test.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# Copyright 2023 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -ex + +if [ "${GRPC_RUNTESTS_USE_LOGIN_SHELL}" != "" ] +then + unset GRPC_RUNTESTS_USE_LOGIN_SHELL + # respawn the entire script using login shell + exec bash -l "$0" "$@" +fi + +ARCHIVE_WITH_SUBMODULES="$1" +shift + +# The JUnit XML report file generated by run_tests.py is compatible with +# the report format accepted by bazel as the result for tests target. +REPORT_XML_FILE="${XML_OUTPUT_FILE}" +# Create report suite name from the last component of the bazel target's name. +REPORT_SUITE_NAME="$(echo ${TEST_TARGET} | sed 's|^.*[:/]||')" + +# Extract grpc repo archive +tar -xopf ${ARCHIVE_WITH_SUBMODULES} +cd grpc + +if [ "${GRPC_RUNTESTS_PREPARE_SCRIPT}" != "" ] +then + source "../${GRPC_RUNTESTS_PREPARE_SCRIPT}" +fi + +python3 tools/run_tests/run_tests.py -t -j "$(nproc)" -x "${REPORT_XML_FILE}" --report_suite_name "${REPORT_SUITE_NAME}" "$@" || FAILED="true" + +if [ -x "$(command -v ccache)" ] +then + ccache --show-stats || true +fi + +if [ "$FAILED" != "" ] +then + exit 1 +fi + diff --git a/tools/bazelify_tests/test/BUILD b/tools/bazelify_tests/test/BUILD new file mode 100644 index 0000000000000..5aedb1b20e667 --- /dev/null +++ b/tools/bazelify_tests/test/BUILD @@ -0,0 +1,158 @@ +# Copyright 2023 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("//bazel:grpc_build_system.bzl", "grpc_package") +load("//tools/bazelify_tests:build_defs.bzl", "grpc_run_tests_py_test") +load(":portability_tests.bzl", "generate_run_tests_portability_tests") + +licenses(["notice"]) + +grpc_package(name = "tools/bazelify_tests/test") + +generate_run_tests_portability_tests(name = "portability_tests_linux") + +# C/C++ +grpc_run_tests_py_test( + name = "runtests_c_linux_dbg", + size = "enormous", + args = [ + "-l c -c dbg", + ], + docker_image_version = "tools/dockerfile/test/cxx_debian11_x64.current_version", +) + +grpc_run_tests_py_test( + name = "runtests_c_linux_opt", + size = "enormous", + args = [ + "-l c -c opt", + ], + docker_image_version = "tools/dockerfile/test/cxx_debian11_x64.current_version", +) + +grpc_run_tests_py_test( + name = "runtests_cpp_linux_dbg_build_only", + size = "enormous", + args = [ + "-l c++ -c dbg --build_only", + ], + docker_image_version = "tools/dockerfile/test/cxx_debian11_x64.current_version", +) + +grpc_run_tests_py_test( + name = "runtests_cpp_linux_opt_build_only", + size = "enormous", + args = [ + "-l c++ -c opt --build_only", + ], + docker_image_version = "tools/dockerfile/test/cxx_debian11_x64.current_version", +) + +# TODO(jtattermusch): Reintroduce ruby tests once they pass. +# # Ruby +# grpc_run_tests_py_test( +# name = "runtests_ruby_linux_dbg", +# size = "enormous", +# args = [ +# "-l ruby -c dbg", +# ], +# docker_image_version = "tools/dockerfile/test/ruby_debian11_x64.current_version", +# prepare_script = ":prepare_ruby.sh", +# use_login_shell = True, # ruby's docker image uses RVM which wierdly requires login shell +# ) + +# grpc_run_tests_py_test( +# name = "runtests_ruby_linux_opt", +# size = "enormous", +# args = [ +# "-l ruby -c opt", +# ], +# docker_image_version = "tools/dockerfile/test/ruby_debian11_x64.current_version", +# prepare_script = ":prepare_ruby.sh", +# use_login_shell = True, # ruby's docker image uses RVM which wierdly requires login shell +# ) + +# PHP +grpc_run_tests_py_test( + name = "runtests_php_linux_dbg", + size = "enormous", + args = [ + "-l php7 -c dbg", + ], + docker_image_version = "tools/dockerfile/test/php7_debian11_x64.current_version", +) + +grpc_run_tests_py_test( + name = "runtests_php_linux_opt", + size = "enormous", + args = [ + "-l php7 -c opt", + ], + docker_image_version = "tools/dockerfile/test/php7_debian11_x64.current_version", +) + +# TODO(jtattermusch): Reintroduce python tests once they pass. +# # Python +# grpc_run_tests_py_test( +# name = "runtests_python_linux_opt", +# size = "enormous", +# args = [ +# "-l python -c opt", +# ], +# docker_image_version = "tools/dockerfile/test/python_debian11_default_x64.current_version", +# ) + +# C# +grpc_run_tests_py_test( + name = "runtests_csharp_linux_dbg", + size = "enormous", + args = [ + "-l csharp -c dbg", + ], + docker_image_version = "tools/dockerfile/test/csharp_debian11_x64.current_version", +) + +grpc_run_tests_py_test( + name = "runtests_csharp_linux_opt", + size = "enormous", + args = [ + "-l csharp -c opt", + ], + docker_image_version = "tools/dockerfile/test/csharp_debian11_x64.current_version", +) + +test_suite( + name = "basic_tests_linux", + tests = [ + ":runtests_c_linux_dbg", + ":runtests_c_linux_opt", + ":runtests_cpp_linux_dbg_build_only", + ":runtests_cpp_linux_opt_build_only", + ":runtests_csharp_linux_dbg", + ":runtests_csharp_linux_opt", + ":runtests_php_linux_dbg", + ":runtests_php_linux_opt", + #":runtests_python_linux_opt", + #":runtests_ruby_linux_dbg", + #":runtests_ruby_linux_opt", + ], +) + +test_suite( + name = "all_tests_linux", + tests = [ + ":basic_tests_linux", + ":portability_tests_linux", + ], +) diff --git a/tools/bazelify_tests/test/portability_tests.bzl b/tools/bazelify_tests/test/portability_tests.bzl new file mode 100644 index 0000000000000..21cc04c2ee0b7 --- /dev/null +++ b/tools/bazelify_tests/test/portability_tests.bzl @@ -0,0 +1,91 @@ +# Copyright 2023 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +Generates portability tests. +""" + +load("//tools/bazelify_tests:build_defs.bzl", "grpc_run_tests_py_test") + +def _safe_language_name(name): + """Character '+' isn't allowed in bazel target name""" + return name.replace("+", "p") + +def generate_run_tests_portability_tests(name): + """Generates run_tests_py portability test targets. + + Args: + name: Name of the test suite that will be generated. + """ + test_names = [] + + # portability C x86 + grpc_run_tests_py_test( + name = "runtests_c_linux_dbg_x86", + args = ["-l c -c dbg"], + docker_image_version = "tools/dockerfile/test/cxx_debian11_x86.current_version", + size = "enormous", + ) + test_names.append("runtests_c_linux_dbg_x86") + + # C and C++ with no-exceptions on Linux + for language in ["c", "c++"]: + test_name = "runtests_%s_linux_dbg_noexcept_build_only" % _safe_language_name(language) + grpc_run_tests_py_test( + name = test_name, + args = ["-l %s --config noexcept --build_only" % language], + docker_image_version = "tools/dockerfile/test/cxx_debian11_x64.current_version", + size = "enormous", + ) + test_names.append(test_name) + + # C and C++ under different compilers + for language in ["c", "c++"]: + compiler_configs = [ + # TODO(b/283304471): Add 'gcc10.2_openssl102' once possible + ["gcc_7", "", "tools/dockerfile/test/cxx_gcc_7_x64.current_version"], + ["gcc_12", "--cmake_configure_extra_args=-DCMAKE_CXX_STANDARD=20", "tools/dockerfile/test/cxx_gcc_12_x64.current_version"], + # TODO(jtattermusch): Re-enable once the build can finish in reasonable time (looks like ccache is not being used?) + #["gcc_musl", "", "tools/dockerfile/test/cxx_alpine_x64.current_version"], + ["clang_6", "--cmake_configure_extra_args=-DCMAKE_C_COMPILER=clang --cmake_configure_extra_args=-DCMAKE_CXX_COMPILER=clang++", "tools/dockerfile/test/cxx_clang_6_x64.current_version"], + ["clang_15", "--cmake_configure_extra_args=-DCMAKE_C_COMPILER=clang --cmake_configure_extra_args=-DCMAKE_CXX_COMPILER=clang++", "tools/dockerfile/test/cxx_clang_15_x64.current_version"], + ] + + for compiler_name, args, docker_image_version in compiler_configs: + test_name = "runtests_%s_linux_dbg_%s_build_only" % (_safe_language_name(language), compiler_name) + grpc_run_tests_py_test( + name = test_name, + args = ["-l %s -c dbg %s --build_only" % (language, args)], + docker_image_version = docker_image_version, + size = "enormous", + ) + test_names.append(test_name) + + # TODO(jtattermusch): Reintroduce the test once it passes. + # Python on alpine + #grpc_run_tests_py_test( + # name = "runtests_python_linux_dbg_alpine", + # args = [ + # "-l python -c dbg --compiler python_alpine", + # ], + # docker_image_version = "tools/dockerfile/test/python_alpine_x64.current_version", + # size = "enormous", + #) + #test_names.append("runtests_python_linux_dbg_alpine") + + # Generate test suite that allows easily running all portability tests. + native.test_suite( + name = name, + tests = [(":%s" % test_name) for test_name in test_names], + ) diff --git a/tools/bazelify_tests/workspace_status_cmd.sh b/tools/bazelify_tests/workspace_status_cmd.sh new file mode 100755 index 0000000000000..83bafd2140a1c --- /dev/null +++ b/tools/bazelify_tests/workspace_status_cmd.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# Copyright 2023 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e + +GRPC_GIT_COMMIT="$(git rev-parse HEAD)" +echo "STABLE_GRPC_GIT_COMMIT ${GRPC_GIT_COMMIT}" + +# produce a value that has name and commit for every submodule +echo -n 'STABLE_GRPC_SUBMODULE_ARCHIVES' +git submodule --quiet foreach 'git_commit="$(git rev-parse HEAD)"; echo -n " ${name}/${git_commit}"'; echo "" + +# set info about whether the git workspace is clean/dirty and checksum of git patch +if [ "$(git status --porcelain)" == "" ] +then + echo "STABLE_GRPC_GIT_WORKSPACE_DIRTY false" +else + echo "STABLE_GRPC_GIT_WORKSPACE_DIRTY true" + echo "STABLE_GRPC_UNCOMMITED_PATCH_CHECKSUM $(git diff HEAD | sha256sum | cut -f1 -d' ')" +fi + +# Since only --workspace_status_command is allowed by bazel, also include +# status from the "default" workspace status command. +tools/remote_build/workspace_status_kokoro.sh diff --git a/tools/dockerfile/push_testing_images.sh b/tools/dockerfile/push_testing_images.sh index f922a59fcc00f..8c136b46ba07b 100755 --- a/tools/dockerfile/push_testing_images.sh +++ b/tools/dockerfile/push_testing_images.sh @@ -208,6 +208,15 @@ do fi done +if [ "${CHECK_MODE}" != "" ] +then + # Check that dockerimage_current_versions.bzl is up to date. + CHECK_MODE="${CHECK_MODE}" tools/bazelify_tests/generate_dockerimage_current_versions_bzl.sh || CHECK_FAILED=true +else + # Regenerate dockerimage_current_versions.bzl + tools/bazelify_tests/generate_dockerimage_current_versions_bzl.sh +fi + if [ "${CHECK_FAILED}" != "" ] then echo "ERROR: Some checks have failed." diff --git a/tools/internal_ci/linux/grpc_bazel_rbe_nonbazel.cfg b/tools/internal_ci/linux/grpc_bazel_rbe_nonbazel.cfg new file mode 100644 index 0000000000000..8bafa25acaccd --- /dev/null +++ b/tools/internal_ci/linux/grpc_bazel_rbe_nonbazel.cfg @@ -0,0 +1,52 @@ +# Copyright 2023 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Config file for the internal CI (in protobuf text format) + +# Location of the continuous shell script in repository. +build_file: "grpc/tools/internal_ci/linux/grpc_bazel_rbe.sh" +timeout_mins: 90 +action { + define_artifacts { + regex: "**/*sponge_log.*" + regex: "github/grpc/reports/**" + } +} + +gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key" + +bazel_setting { + # In order for Kokoro to recognize this as a bazel build and publish the bazel resultstore link, + # the bazel_setting section needs to be present and "upsalite_frontend_address" needs to be + # set. The rest of configuration from bazel_setting is unused (we configure everything when bazel + # command is invoked). + upsalite_frontend_address: "https://source.cloud.google.com" +} + +env_vars { + # flags will be passed to bazel invocation + key: "BAZEL_FLAGS" + value: "--genrule_strategy=remote,local --workspace_status_command=tools/bazelify_tests/workspace_status_cmd.sh --cache_test_results=no" +} + +env_vars { + # tests to run by the bazel invocation + key: "BAZEL_TESTS" + value: "//tools/bazelify_tests/test:all_tests_linux" +} + +env_vars { + key: "UPLOAD_TEST_RESULTS" + value: "true" +} diff --git a/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_nonbazel.cfg b/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_nonbazel.cfg new file mode 100644 index 0000000000000..e4eac5a4bffe0 --- /dev/null +++ b/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_nonbazel.cfg @@ -0,0 +1,47 @@ +# Copyright 2023 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Config file for the internal CI (in protobuf text format) + +# Location of the continuous shell script in repository. +build_file: "grpc/tools/internal_ci/linux/grpc_bazel_rbe.sh" +timeout_mins: 90 +action { + define_artifacts { + regex: "**/*sponge_log.*" + regex: "github/grpc/reports/**" + } +} + +gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key" + +bazel_setting { + # In order for Kokoro to recognize this as a bazel build and publish the bazel resultstore link, + # the bazel_setting section needs to be present and "upsalite_frontend_address" needs to be + # set. The rest of configuration from bazel_setting is unused (we configure everything when bazel + # command is invoked). + upsalite_frontend_address: "https://source.cloud.google.com" +} + +env_vars { + # flags will be passed to bazel invocation + key: "BAZEL_FLAGS" + value: "--genrule_strategy=remote,local --workspace_status_command=tools/bazelify_tests/workspace_status_cmd.sh" +} + +env_vars { + # tests to run by the bazel invocation + key: "BAZEL_TESTS" + value: "//tools/bazelify_tests/test:all_tests_linux" +} diff --git a/tools/remote_build/include/rbe_base_config.bazelrc b/tools/remote_build/include/rbe_base_config.bazelrc index a7fc8c152b5e6..0f98d28e32a7c 100644 --- a/tools/remote_build/include/rbe_base_config.bazelrc +++ b/tools/remote_build/include/rbe_base_config.bazelrc @@ -41,3 +41,6 @@ build --bes_backend=grpcs://buildeventservice.googleapis.com build --bes_timeout=600s build --bes_results_url="https://source.cloud.google.com/results/invocations/" build --bes_instance_name=grpc-testing + +# Avoid timeouts for actions that don't write output for long time (See b/143346671 and b/143134296) +build --grpc_keepalive_time=10m diff --git a/tools/remote_build/linux_docker_sandbox.bazelrc b/tools/remote_build/linux_docker_sandbox.bazelrc new file mode 100644 index 0000000000000..cb27ec26d9227 --- /dev/null +++ b/tools/remote_build/linux_docker_sandbox.bazelrc @@ -0,0 +1,45 @@ +#@IgnoreInspection BashAddShebang +# Copyright 2023 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# bazelrc file for running gRPC tests in a docker sandbox to help +# with debugging issues with RBE. +# TODO(jtattermusch): Settings in this file are currently EXPERIMENTAL. Use +# at your own risk. + +# TODO(jtattermusch): Consider including some configuration settings from +# tools/remote_build/include/rbe_remote_execution.bazelrc + +build --experimental_docker_verbose +build --experimental_enable_docker_sandbox + +build --spawn_strategy=docker +build --strategy=Javac=docker +build --strategy=Closure=docker +build --genrule_strategy=docker + +# Next section is linux-specific RBE configuration +build --crosstool_top=//third_party/toolchains:rbe_linux_default_toolchain_suite +build --extra_toolchains=//third_party/toolchains:rbe_linux_default_cc_toolchain +# Use custom execution platforms defined in third_party/toolchains +build --extra_execution_platforms=//third_party/toolchains:rbe_linux_default_platform +build --host_platform=//third_party/toolchains:rbe_linux_default_platform +build --platforms=//third_party/toolchains:rbe_linux_default_platform + +# we assume the default bazel RBE build is on linux, +# so filter out stuff that should not be built or run there. +build --test_tag_filters=-no_linux +build --build_tag_filters=-no_linux + +import %workspace%/tools/remote_build/include/test_config_common.bazelrc diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index e83f5082f1fcb..70ba620420686 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -305,7 +305,9 @@ def configure(self, config, args): print("should never reach here.") sys.exit(1) - self._cmake_configure_extra_args = [] + self._cmake_configure_extra_args = list( + self.args.cmake_configure_extra_args + ) self._cmake_generator_windows = cmake_generator # required to pass as cmake "-A" configuration for VS builds (but not for Ninja) self._cmake_architecture_windows = ( @@ -329,7 +331,11 @@ def configure(self, config, args): ( self._docker_distro, self._cmake_configure_extra_args, - ) = self._compiler_options(self.args.use_docker, self.args.compiler) + ) = self._compiler_options( + self.args.use_docker, + self.args.compiler, + self.args.cmake_configure_extra_args, + ) if self.args.arch == "x86": # disable boringssl asm optimizations when on x86 @@ -544,8 +550,14 @@ def _clang_cmake_configure_extra_args(self, version_suffix=""): "-DCMAKE_CXX_COMPILER=clang++%s" % version_suffix, ] - def _compiler_options(self, use_docker, compiler): + def _compiler_options( + self, use_docker, compiler, cmake_configure_extra_args + ): """Returns docker distro and cmake configure args to use for given compiler.""" + if cmake_configure_extra_args: + # only allow specifying extra cmake args for "vanilla" compiler + _check_compiler(compiler, ["default", "cmake"]) + return ("nonexistent_docker_distro", cmake_configure_extra_args) if not use_docker and not _is_use_docker_child(): # if not running under docker, we cannot ensure the right compiler version will be used, # so we only allow the non-specific choices. @@ -1824,6 +1836,12 @@ def _build_and_run( nargs="?", help="Upload test results to a specified BQ table.", ) +argp.add_argument( + "--cmake_configure_extra_args", + default=[], + nargs="+", + help="Extra arguments that will be passed to the cmake configure command. Only works for C/C++.", +) args = argp.parse_args() flaky_tests = set() From 113b092eb823d1e6ee390ee4a1c4a9a14b23fd26 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Wed, 2 Aug 2023 07:14:36 -0700 Subject: [PATCH 105/205] [boringssl] Simplify BoringSSL assembly build (#33700) ~~NB: I haven't tested this at all and am hoping the CI will tell me where I've (undoubtedly) messed something up.~~ Edit: looks like CI is now clear! BoringSSL's gas-compatible assembly files, like its C files, are now wrapped with preprocessor ifdefs to capture which platforms each file should be enabled on. This means that, provided the platform can process .S files it all (i.e. not Windows), we no longer need to detect the exact CPU architecture in the build. Switch gRPC's build to take advantage of this. I've retained BUILD_OVERRIDE_BORING_SSL_ASM_PLATFORM, on the off chance anyone is using it to cross-compile between Windows and non-Windows, though I doubt that works particularly well. As part of this, restore assembly optimizations in a few places where they were seemingly disabled for issues relating to this: - https://github.com/grpc/grpc/pull/31747 had to disable the assembly, because at the time assembly required the library be built differently for each architecture and then stitched back together. This should now work. - tools/run_tests/run_tests.py disabled x86 assembly due to some issues with CMAKE_SYSTEM_PROCESSOR in a Docker image. This too should now be moot. --- setup.py | 19 ++++++------------- tools/run_tests/artifacts/artifact_targets.py | 1 - tools/run_tests/run_tests.py | 5 ----- 3 files changed, 6 insertions(+), 19 deletions(-) diff --git a/setup.py b/setup.py index 1948a4160b379..4e4d9cfe4d692 100644 --- a/setup.py +++ b/setup.py @@ -413,19 +413,12 @@ def _quote_build_define(argument): if BUILD_OVERRIDE_BORING_SSL_ASM_PLATFORM else util.get_platform() ) - LINUX_X86_64 = "linux-x86_64" - LINUX_ARM = "linux-arm" - LINUX_AARCH64 = "linux-aarch64" - if LINUX_X86_64 == boringssl_asm_platform: - asm_key = "crypto_linux_x86_64" - elif LINUX_ARM == boringssl_asm_platform: - asm_key = "crypto_linux_arm" - elif LINUX_AARCH64 == boringssl_asm_platform: - asm_key = "crypto_linux_aarch64" - elif "mac" in boringssl_asm_platform and "x86_64" in boringssl_asm_platform: - asm_key = "crypto_apple_x86_64" - elif "mac" in boringssl_asm_platform and "arm64" in boringssl_asm_platform: - asm_key = "crypto_apple_aarch64" + # BoringSSL's gas-compatible assembly files are all internally conditioned + # by the preprocessor. Provided the platform has a gas-compatible assembler + # (i.e. not Windows), we can include the assembly files and let BoringSSL + # decide which ones should and shouldn't be used for the build. + if not boringssl_asm_platform.startswith("win"): + asm_key = "crypto_asm" else: print( "ASM Builds for BoringSSL currently not supported on:", diff --git a/tools/run_tests/artifacts/artifact_targets.py b/tools/run_tests/artifacts/artifact_targets.py index 2c5b4f5d8ff66..657577c47d295 100644 --- a/tools/run_tests/artifacts/artifact_targets.py +++ b/tools/run_tests/artifacts/artifact_targets.py @@ -143,7 +143,6 @@ def build_jobspec(self, inner_jobs=None): if self.platform == "macos": environ["ARCHFLAGS"] = "-arch arm64 -arch x86_64" environ["GRPC_UNIVERSAL2_REPAIR"] = "true" - environ["GRPC_BUILD_WITH_BORING_SSL_ASM"] = "false" if self.platform == "linux_extra": # Crosscompilation build for armv7 (e.g. Raspberry Pi) diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 70ba620420686..1ba01a44f19b1 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -337,11 +337,6 @@ def configure(self, config, args): self.args.cmake_configure_extra_args, ) - if self.args.arch == "x86": - # disable boringssl asm optimizations when on x86 - # see https://github.com/grpc/grpc/blob/b5b8578b3f8b4a9ce61ed6677e19d546e43c5c68/tools/run_tests/artifacts/artifact_targets.py#L253 - self._cmake_configure_extra_args.append("-DOPENSSL_NO_ASM=ON") - def test_specs(self): out = [] binaries = get_c_tests(self.args.travis, self.test_lang) From b8829239b8112237d0064a90b841a7ddc97b73eb Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 2 Aug 2023 07:20:30 -0700 Subject: [PATCH 106/205] [arena] Use malloc for pooled allocations (#33927) There's *very* little difference in cost for a pooled arena allocation and a tcmalloc allocation - but the pooled allocation causes memory stranding for call lifetime, whereas the tcmalloc allocation allows that to be shared between calls - leading to a much lower overall cost. --------- Co-authored-by: ctiller --- src/core/BUILD | 4 ---- src/core/lib/resource_quota/arena.cc | 2 ++ src/core/lib/resource_quota/arena.h | 14 ++++++++------ .../lib/security/transport/client_auth_filter.cc | 11 +++++++---- test/core/resource_quota/arena_test.cc | 6 ++++++ 5 files changed, 23 insertions(+), 14 deletions(-) diff --git a/src/core/BUILD b/src/core/BUILD index 68efe9d473727..6b90243d253b8 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -1124,10 +1124,6 @@ grpc_cc_library( hdrs = [ "lib/resource_quota/arena.h", ], - external_deps = [ - "absl/meta:type_traits", - "absl/utility", - ], visibility = [ "@grpc:alt_grpc_base_legacy", ], diff --git a/src/core/lib/resource_quota/arena.cc b/src/core/lib/resource_quota/arena.cc index d37ef4264908c..332bdc4c85c85 100644 --- a/src/core/lib/resource_quota/arena.cc +++ b/src/core/lib/resource_quota/arena.cc @@ -121,6 +121,7 @@ void Arena::ManagedNewObject::Link(std::atomic* head) { } } +#ifndef GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC void* Arena::AllocPooled(size_t obj_size, size_t alloc_size, std::atomic* head) { // ABA mitigation: @@ -177,5 +178,6 @@ void Arena::FreePooled(void* p, std::atomic* head) { node->next, node, std::memory_order_acq_rel, std::memory_order_relaxed)) { } } +#endif } // namespace grpc_core diff --git a/src/core/lib/resource_quota/arena.h b/src/core/lib/resource_quota/arena.h index 1dcb530243e17..9a072458ea088 100644 --- a/src/core/lib/resource_quota/arena.h +++ b/src/core/lib/resource_quota/arena.h @@ -30,14 +30,10 @@ #include #include -#include +#include #include -#include #include -#include "absl/meta/type_traits.h" -#include "absl/utility/utility.h" - #include #include "src/core/lib/gpr/alloc.h" @@ -45,13 +41,14 @@ #include "src/core/lib/promise/context.h" #include "src/core/lib/resource_quota/memory_quota.h" -// #define GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC +#define GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC // #define GRPC_ARENA_TRACE_POOLED_ALLOCATIONS namespace grpc_core { namespace arena_detail { +#ifndef GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC struct PoolAndSize { size_t alloc_size; size_t pool_index; @@ -113,16 +110,19 @@ PoolAndSize ChoosePoolForAllocationSize( size_t n, absl::integer_sequence) { return ChoosePoolForAllocationSizeImpl<0, kBucketSizes...>::Fn(n); } +#endif } // namespace arena_detail class Arena { +#ifndef GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC // Selected pool sizes. // How to tune: see tools/codegen/core/optimize_arena_pool_sizes.py using PoolSizes = absl::integer_sequence; struct FreePoolNode { FreePoolNode* next; }; +#endif public: // Create an arena, with \a initial_size bytes in the first allocated buffer. @@ -372,9 +372,11 @@ class Arena { void* AllocZone(size_t size); +#ifndef GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC void* AllocPooled(size_t obj_size, size_t alloc_size, std::atomic* head); static void FreePooled(void* p, std::atomic* head); +#endif void TracePoolAlloc(size_t size, void* ptr) { (void)size; diff --git a/src/core/lib/security/transport/client_auth_filter.cc b/src/core/lib/security/transport/client_auth_filter.cc index 8094ff429a518..57d10f9a0b775 100644 --- a/src/core/lib/security/transport/client_auth_filter.cc +++ b/src/core/lib/security/transport/client_auth_filter.cc @@ -196,10 +196,13 @@ ArenaPromise ClientAuthFilter::MakeCallPromise( if (host == nullptr) { return next_promise_factory(std::move(call_args)); } - return TrySeq(args_.security_connector->CheckCallHost( - host->as_string_view(), args_.auth_context.get()), - GetCallCredsMetadata(std::move(call_args)), - next_promise_factory); + return TrySeq( + args_.security_connector->CheckCallHost(host->as_string_view(), + args_.auth_context.get()), + [this, call_args = std::move(call_args)]() mutable { + return GetCallCredsMetadata(std::move(call_args)); + }, + next_promise_factory); } absl::StatusOr ClientAuthFilter::Create( diff --git a/test/core/resource_quota/arena_test.cc b/test/core/resource_quota/arena_test.cc index 665364305f3b8..1e35a105f6baa 100644 --- a/test/core/resource_quota/arena_test.cc +++ b/test/core/resource_quota/arena_test.cc @@ -191,6 +191,7 @@ bool IsScribbled(Int* ints, int n, int offset) { return true; } +#ifndef GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC TEST_F(ArenaTest, PooledObjectsArePooled) { struct TestObj { char a[100]; @@ -208,6 +209,7 @@ TEST_F(ArenaTest, PooledObjectsArePooled) { Scribble(obj->a, 100, 2); EXPECT_TRUE(IsScribbled(obj->a, 100, 2)); } +#endif TEST_F(ArenaTest, CreateManyObjects) { struct TestObj { @@ -238,7 +240,11 @@ TEST_F(ArenaTest, CreateManyObjectsWithDestructors) { TEST_F(ArenaTest, CreatePoolArray) { auto arena = MakeScopedArena(1024, &memory_allocator_); auto p = arena->MakePooledArray(1024); +#ifndef GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC EXPECT_FALSE(p.get_deleter().has_freelist()); +#else + EXPECT_TRUE(p.get_deleter().has_freelist()); +#endif p = arena->MakePooledArray(5); EXPECT_TRUE(p.get_deleter().has_freelist()); Scribble(p.get(), 5, 1); From daa89145ca38283007c0970353213c99e61f77e8 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 2 Aug 2023 08:22:17 -0700 Subject: [PATCH 107/205] Revert "[arena] Use malloc for pooled allocations" (#33960) Reverts grpc/grpc#33927 --- src/core/BUILD | 4 ++++ src/core/lib/resource_quota/arena.cc | 2 -- src/core/lib/resource_quota/arena.h | 14 ++++++-------- .../lib/security/transport/client_auth_filter.cc | 11 ++++------- test/core/resource_quota/arena_test.cc | 6 ------ 5 files changed, 14 insertions(+), 23 deletions(-) diff --git a/src/core/BUILD b/src/core/BUILD index 6b90243d253b8..68efe9d473727 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -1124,6 +1124,10 @@ grpc_cc_library( hdrs = [ "lib/resource_quota/arena.h", ], + external_deps = [ + "absl/meta:type_traits", + "absl/utility", + ], visibility = [ "@grpc:alt_grpc_base_legacy", ], diff --git a/src/core/lib/resource_quota/arena.cc b/src/core/lib/resource_quota/arena.cc index 332bdc4c85c85..d37ef4264908c 100644 --- a/src/core/lib/resource_quota/arena.cc +++ b/src/core/lib/resource_quota/arena.cc @@ -121,7 +121,6 @@ void Arena::ManagedNewObject::Link(std::atomic* head) { } } -#ifndef GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC void* Arena::AllocPooled(size_t obj_size, size_t alloc_size, std::atomic* head) { // ABA mitigation: @@ -178,6 +177,5 @@ void Arena::FreePooled(void* p, std::atomic* head) { node->next, node, std::memory_order_acq_rel, std::memory_order_relaxed)) { } } -#endif } // namespace grpc_core diff --git a/src/core/lib/resource_quota/arena.h b/src/core/lib/resource_quota/arena.h index 9a072458ea088..1dcb530243e17 100644 --- a/src/core/lib/resource_quota/arena.h +++ b/src/core/lib/resource_quota/arena.h @@ -30,10 +30,14 @@ #include #include -#include +#include #include +#include #include +#include "absl/meta/type_traits.h" +#include "absl/utility/utility.h" + #include #include "src/core/lib/gpr/alloc.h" @@ -41,14 +45,13 @@ #include "src/core/lib/promise/context.h" #include "src/core/lib/resource_quota/memory_quota.h" -#define GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC +// #define GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC // #define GRPC_ARENA_TRACE_POOLED_ALLOCATIONS namespace grpc_core { namespace arena_detail { -#ifndef GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC struct PoolAndSize { size_t alloc_size; size_t pool_index; @@ -110,19 +113,16 @@ PoolAndSize ChoosePoolForAllocationSize( size_t n, absl::integer_sequence) { return ChoosePoolForAllocationSizeImpl<0, kBucketSizes...>::Fn(n); } -#endif } // namespace arena_detail class Arena { -#ifndef GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC // Selected pool sizes. // How to tune: see tools/codegen/core/optimize_arena_pool_sizes.py using PoolSizes = absl::integer_sequence; struct FreePoolNode { FreePoolNode* next; }; -#endif public: // Create an arena, with \a initial_size bytes in the first allocated buffer. @@ -372,11 +372,9 @@ class Arena { void* AllocZone(size_t size); -#ifndef GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC void* AllocPooled(size_t obj_size, size_t alloc_size, std::atomic* head); static void FreePooled(void* p, std::atomic* head); -#endif void TracePoolAlloc(size_t size, void* ptr) { (void)size; diff --git a/src/core/lib/security/transport/client_auth_filter.cc b/src/core/lib/security/transport/client_auth_filter.cc index 57d10f9a0b775..8094ff429a518 100644 --- a/src/core/lib/security/transport/client_auth_filter.cc +++ b/src/core/lib/security/transport/client_auth_filter.cc @@ -196,13 +196,10 @@ ArenaPromise ClientAuthFilter::MakeCallPromise( if (host == nullptr) { return next_promise_factory(std::move(call_args)); } - return TrySeq( - args_.security_connector->CheckCallHost(host->as_string_view(), - args_.auth_context.get()), - [this, call_args = std::move(call_args)]() mutable { - return GetCallCredsMetadata(std::move(call_args)); - }, - next_promise_factory); + return TrySeq(args_.security_connector->CheckCallHost( + host->as_string_view(), args_.auth_context.get()), + GetCallCredsMetadata(std::move(call_args)), + next_promise_factory); } absl::StatusOr ClientAuthFilter::Create( diff --git a/test/core/resource_quota/arena_test.cc b/test/core/resource_quota/arena_test.cc index 1e35a105f6baa..665364305f3b8 100644 --- a/test/core/resource_quota/arena_test.cc +++ b/test/core/resource_quota/arena_test.cc @@ -191,7 +191,6 @@ bool IsScribbled(Int* ints, int n, int offset) { return true; } -#ifndef GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC TEST_F(ArenaTest, PooledObjectsArePooled) { struct TestObj { char a[100]; @@ -209,7 +208,6 @@ TEST_F(ArenaTest, PooledObjectsArePooled) { Scribble(obj->a, 100, 2); EXPECT_TRUE(IsScribbled(obj->a, 100, 2)); } -#endif TEST_F(ArenaTest, CreateManyObjects) { struct TestObj { @@ -240,11 +238,7 @@ TEST_F(ArenaTest, CreateManyObjectsWithDestructors) { TEST_F(ArenaTest, CreatePoolArray) { auto arena = MakeScopedArena(1024, &memory_allocator_); auto p = arena->MakePooledArray(1024); -#ifndef GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC EXPECT_FALSE(p.get_deleter().has_freelist()); -#else - EXPECT_TRUE(p.get_deleter().has_freelist()); -#endif p = arena->MakePooledArray(5); EXPECT_TRUE(p.get_deleter().has_freelist()); Scribble(p.get(), 5, 1); From 91e7f223d3b1dbfa29ba5be78f971a2bf03d8136 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 2 Aug 2023 09:53:45 -0700 Subject: [PATCH 108/205] [server] Remove `Notification` from shutdown path (#33953) I'm fairly certain that this path should be non-blocking (and making it so makes the promise based code far more tractable). This moves the blocking behavior into the blocking server_cc.cc function that calls `grpc_server_shutdown_and_notify` instead of in that non-blocking function. --------- Co-authored-by: ctiller --- BUILD | 1 - src/core/lib/surface/server.cc | 8 +------- src/core/lib/surface/server.h | 16 +--------------- src/cpp/server/server_cc.cc | 2 ++ test/cpp/end2end/client_lb_end2end_test.cc | 1 + 5 files changed, 5 insertions(+), 23 deletions(-) diff --git a/BUILD b/BUILD index 37f59e2115c19..1b1a4ef5081dd 100644 --- a/BUILD +++ b/BUILD @@ -1577,7 +1577,6 @@ grpc_cc_library( "//src/core:memory_quota", "//src/core:metadata_compression_traits", "//src/core:no_destruct", - "//src/core:notification", "//src/core:packed_table", "//src/core:per_cpu", "//src/core:pipe", diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc index 8cbf85cd93d6d..a1d87eded0c4b 100644 --- a/src/core/lib/surface/server.cc +++ b/src/core/lib/surface/server.cc @@ -940,7 +940,6 @@ void DonePublishedShutdown(void* /*done_arg*/, grpc_cq_completion* storage) { // connection is NOT closed until the server is done with all those calls. // -- Once there are no more calls in progress, the channel is closed. void Server::ShutdownAndNotify(grpc_completion_queue* cq, void* tag) { - Notification* await_requests = nullptr; ChannelBroadcaster broadcaster; { // Wait for startup to be finished. Locks mu_global. @@ -966,12 +965,7 @@ void Server::ShutdownAndNotify(grpc_completion_queue* cq, void* tag) { MutexLock lock(&mu_call_); KillPendingWorkLocked(GRPC_ERROR_CREATE("Server Shutdown")); } - await_requests = ShutdownUnrefOnShutdownCall(); - } - // We expect no new requests but there can still be requests in-flight. - // Wait for them to complete before proceeding. - if (await_requests != nullptr) { - await_requests->WaitForNotification(); + ShutdownUnrefOnShutdownCall(); } StopListening(); broadcaster.BroadcastShutdown(/*send_goaway=*/true, absl::OkStatus()); diff --git a/src/core/lib/surface/server.h b/src/core/lib/surface/server.h index ac4624c66b562..fc102945d34f4 100644 --- a/src/core/lib/surface/server.h +++ b/src/core/lib/surface/server.h @@ -36,7 +36,6 @@ #include #include -#include #include #include "src/core/lib/channel/channel_args.h" @@ -46,7 +45,6 @@ #include "src/core/lib/debug/trace.h" #include "src/core/lib/gprpp/cpp_impl_of.h" #include "src/core/lib/gprpp/dual_ref_counted.h" -#include "src/core/lib/gprpp/notification.h" #include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/sync.h" @@ -411,24 +409,13 @@ class Server : public InternallyRefCounted, if (shutdown_refs_.fetch_sub(2, std::memory_order_acq_rel) == 2) { MutexLock lock(&mu_global_); MaybeFinishShutdown(); - // The last request in-flight during shutdown is now complete. - if (requests_complete_ != nullptr) { - GPR_ASSERT(!requests_complete_->HasBeenNotified()); - requests_complete_->Notify(); - } } } - // Returns a notification pointer to wait on if there are requests in-flight, - // or null. - GRPC_MUST_USE_RESULT Notification* ShutdownUnrefOnShutdownCall() - ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_global_) { + void ShutdownUnrefOnShutdownCall() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_global_) { if (shutdown_refs_.fetch_sub(1, std::memory_order_acq_rel) == 1) { // There is no request in-flight. MaybeFinishShutdown(); - return nullptr; } - requests_complete_ = std::make_unique(); - return requests_complete_.get(); } bool ShutdownCalled() const { @@ -479,7 +466,6 @@ class Server : public InternallyRefCounted, std::atomic shutdown_refs_{1}; bool shutdown_published_ ABSL_GUARDED_BY(mu_global_) = false; std::vector shutdown_tags_ ABSL_GUARDED_BY(mu_global_); - std::unique_ptr requests_complete_ ABSL_GUARDED_BY(mu_global_); std::list channels_; diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc index ad40fb29eeb03..fbf8311b740dd 100644 --- a/src/cpp/server/server_cc.cc +++ b/src/cpp/server/server_cc.cc @@ -1266,6 +1266,8 @@ void Server::ShutdownInternal(gpr_timespec deadline) { // shutdown. We should force a shutdown now by cancelling all inflight calls if (status == grpc::CompletionQueue::NextStatus::TIMEOUT) { grpc_server_cancel_all_calls(server_); + status = + shutdown_cq.AsyncNext(&tag, &ok, gpr_inf_future(GPR_CLOCK_MONOTONIC)); } // Else in case of SHUTDOWN or GOT_EVENT, it means that the server has // successfully shutdown diff --git a/test/cpp/end2end/client_lb_end2end_test.cc b/test/cpp/end2end/client_lb_end2end_test.cc index 63ee73045aab1..34911222d0b21 100644 --- a/test/cpp/end2end/client_lb_end2end_test.cc +++ b/test/cpp/end2end/client_lb_end2end_test.cc @@ -59,6 +59,7 @@ #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/env.h" +#include "src/core/lib/gprpp/notification.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/time.h" #include "src/core/lib/iomgr/tcp_client.h" From 48f455a9a0c79ed7dc5f2fb2ecce20d48341ee57 Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Wed, 2 Aug 2023 10:08:06 -0700 Subject: [PATCH 109/205] Revert "[ObjC] dns service resolver for cf event engine" (#33964) Reverts grpc/grpc#33233. This is failing 100% of builds https://source.cloud.google.com/results/invocations/248656d3-15ac-4d42-a2f8-6bec5c411e67/targets --- CMakeLists.txt | 9 +- Makefile | 2 - Package.swift | 2 - build_autogenerated.yaml | 16 +- config.m4 | 1 - config.w32 | 1 - gRPC-C++.podspec | 2 - gRPC-Core.podspec | 3 - grpc.gemspec | 2 - grpc.gyp | 3 - package.xml | 2 - src/core/BUILD | 8 +- .../lib/event_engine/cf_engine/cf_engine.cc | 12 +- .../cf_engine/dns_service_resolver.cc | 222 ------------------ .../cf_engine/dns_service_resolver.h | 117 --------- src/objective-c/tests/BUILD | 1 - .../EventEngineTests/CFEventEngineTests.mm | 2 - src/python/grpcio/grpc_core_dependencies.py | 1 - test/core/event_engine/cf/cf_engine_test.cc | 211 ----------------- test/core/event_engine/test_suite/BUILD | 2 - .../test_suite/cf_event_engine_test.cc | 4 +- .../event_engine/test_suite/tests/dns_test.cc | 4 - tools/doxygen/Doxyfile.c++.internal | 2 - tools/doxygen/Doxyfile.core.internal | 2 - 24 files changed, 8 insertions(+), 623 deletions(-) delete mode 100644 src/core/lib/event_engine/cf_engine/dns_service_resolver.cc delete mode 100644 src/core/lib/event_engine/cf_engine/dns_service_resolver.h diff --git a/CMakeLists.txt b/CMakeLists.txt index e2006b26891bf..0392d45656177 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2158,7 +2158,6 @@ add_library(grpc src/core/lib/event_engine/ares_resolver.cc src/core/lib/event_engine/cf_engine/cf_engine.cc src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc - src/core/lib/event_engine/cf_engine/dns_service_resolver.cc src/core/lib/event_engine/channel_args_endpoint_config.cc src/core/lib/event_engine/default_event_engine.cc src/core/lib/event_engine/default_event_engine_factory.cc @@ -2868,7 +2867,6 @@ add_library(grpc_unsecure src/core/lib/event_engine/ares_resolver.cc src/core/lib/event_engine/cf_engine/cf_engine.cc src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc - src/core/lib/event_engine/cf_engine/dns_service_resolver.cc src/core/lib/event_engine/channel_args_endpoint_config.cc src/core/lib/event_engine/default_event_engine.cc src/core/lib/event_engine/default_event_engine_factory.cc @@ -4407,7 +4405,6 @@ add_library(grpc_authorization_provider src/core/lib/event_engine/ares_resolver.cc src/core/lib/event_engine/cf_engine/cf_engine.cc src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc - src/core/lib/event_engine/cf_engine/dns_service_resolver.cc src/core/lib/event_engine/channel_args_endpoint_config.cc src/core/lib/event_engine/default_event_engine.cc src/core/lib/event_engine/default_event_engine_factory.cc @@ -8142,10 +8139,7 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/event_engine/test_suite/event_engine_test_framework.cc test/core/event_engine/test_suite/posix/oracle_event_engine_posix.cc test/core/event_engine/test_suite/tests/client_test.cc - test/core/event_engine/test_suite/tests/dns_test.cc test/core/event_engine/test_suite/tests/timer_test.cc - test/core/util/fake_udp_and_tcp_server.cc - test/cpp/util/get_grpc_test_runfile_dir.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc ) @@ -8175,7 +8169,7 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) ${_gRPC_ZLIB_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} grpc_unsecure - grpc++_test_util + grpc_test_util ) @@ -12451,7 +12445,6 @@ add_executable(frame_test src/core/lib/event_engine/ares_resolver.cc src/core/lib/event_engine/cf_engine/cf_engine.cc src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc - src/core/lib/event_engine/cf_engine/dns_service_resolver.cc src/core/lib/event_engine/channel_args_endpoint_config.cc src/core/lib/event_engine/default_event_engine.cc src/core/lib/event_engine/default_event_engine_factory.cc diff --git a/Makefile b/Makefile index 7e39779d5a1b8..f1a04b993b045 100644 --- a/Makefile +++ b/Makefile @@ -1440,7 +1440,6 @@ LIBGRPC_SRC = \ src/core/lib/event_engine/ares_resolver.cc \ src/core/lib/event_engine/cf_engine/cf_engine.cc \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc \ - src/core/lib/event_engine/cf_engine/dns_service_resolver.cc \ src/core/lib/event_engine/channel_args_endpoint_config.cc \ src/core/lib/event_engine/default_event_engine.cc \ src/core/lib/event_engine/default_event_engine_factory.cc \ @@ -2003,7 +2002,6 @@ LIBGRPC_UNSECURE_SRC = \ src/core/lib/event_engine/ares_resolver.cc \ src/core/lib/event_engine/cf_engine/cf_engine.cc \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc \ - src/core/lib/event_engine/cf_engine/dns_service_resolver.cc \ src/core/lib/event_engine/channel_args_endpoint_config.cc \ src/core/lib/event_engine/default_event_engine.cc \ src/core/lib/event_engine/default_event_engine_factory.cc \ diff --git a/Package.swift b/Package.swift index 56699d86e08c9..b712cd822d941 100644 --- a/Package.swift +++ b/Package.swift @@ -1069,8 +1069,6 @@ let package = Package( "src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc", "src/core/lib/event_engine/cf_engine/cfstream_endpoint.h", "src/core/lib/event_engine/cf_engine/cftype_unique_ref.h", - "src/core/lib/event_engine/cf_engine/dns_service_resolver.cc", - "src/core/lib/event_engine/cf_engine/dns_service_resolver.h", "src/core/lib/event_engine/channel_args_endpoint_config.cc", "src/core/lib/event_engine/channel_args_endpoint_config.h", "src/core/lib/event_engine/common_closures.h", diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 11b8392647699..da1291c235383 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -687,7 +687,6 @@ libs: - src/core/lib/event_engine/cf_engine/cf_engine.h - src/core/lib/event_engine/cf_engine/cfstream_endpoint.h - src/core/lib/event_engine/cf_engine/cftype_unique_ref.h - - src/core/lib/event_engine/cf_engine/dns_service_resolver.h - src/core/lib/event_engine/channel_args_endpoint_config.h - src/core/lib/event_engine/common_closures.h - src/core/lib/event_engine/default_event_engine.h @@ -1502,7 +1501,6 @@ libs: - src/core/lib/event_engine/ares_resolver.cc - src/core/lib/event_engine/cf_engine/cf_engine.cc - src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc - - src/core/lib/event_engine/cf_engine/dns_service_resolver.cc - src/core/lib/event_engine/channel_args_endpoint_config.cc - src/core/lib/event_engine/default_event_engine.cc - src/core/lib/event_engine/default_event_engine_factory.cc @@ -2086,7 +2084,6 @@ libs: - src/core/lib/event_engine/cf_engine/cf_engine.h - src/core/lib/event_engine/cf_engine/cfstream_endpoint.h - src/core/lib/event_engine/cf_engine/cftype_unique_ref.h - - src/core/lib/event_engine/cf_engine/dns_service_resolver.h - src/core/lib/event_engine/channel_args_endpoint_config.h - src/core/lib/event_engine/common_closures.h - src/core/lib/event_engine/default_event_engine.h @@ -2508,7 +2505,6 @@ libs: - src/core/lib/event_engine/ares_resolver.cc - src/core/lib/event_engine/cf_engine/cf_engine.cc - src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc - - src/core/lib/event_engine/cf_engine/dns_service_resolver.cc - src/core/lib/event_engine/channel_args_endpoint_config.cc - src/core/lib/event_engine/default_event_engine.cc - src/core/lib/event_engine/default_event_engine_factory.cc @@ -3596,7 +3592,6 @@ libs: - src/core/lib/event_engine/cf_engine/cf_engine.h - src/core/lib/event_engine/cf_engine/cfstream_endpoint.h - src/core/lib/event_engine/cf_engine/cftype_unique_ref.h - - src/core/lib/event_engine/cf_engine/dns_service_resolver.h - src/core/lib/event_engine/channel_args_endpoint_config.h - src/core/lib/event_engine/common_closures.h - src/core/lib/event_engine/default_event_engine.h @@ -3897,7 +3892,6 @@ libs: - src/core/lib/event_engine/ares_resolver.cc - src/core/lib/event_engine/cf_engine/cf_engine.cc - src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc - - src/core/lib/event_engine/cf_engine/dns_service_resolver.cc - src/core/lib/event_engine/channel_args_endpoint_config.cc - src/core/lib/event_engine/default_event_engine.cc - src/core/lib/event_engine/default_event_engine_factory.cc @@ -5888,23 +5882,17 @@ targets: - test/core/event_engine/test_suite/event_engine_test_framework.h - test/core/event_engine/test_suite/posix/oracle_event_engine_posix.h - test/core/event_engine/test_suite/tests/client_test.h - - test/core/event_engine/test_suite/tests/dns_test.h - test/core/event_engine/test_suite/tests/timer_test.h - - test/core/util/fake_udp_and_tcp_server.h - - test/cpp/util/get_grpc_test_runfile_dir.h src: - test/core/event_engine/event_engine_test_utils.cc - test/core/event_engine/test_suite/cf_event_engine_test.cc - test/core/event_engine/test_suite/event_engine_test_framework.cc - test/core/event_engine/test_suite/posix/oracle_event_engine_posix.cc - test/core/event_engine/test_suite/tests/client_test.cc - - test/core/event_engine/test_suite/tests/dns_test.cc - test/core/event_engine/test_suite/tests/timer_test.cc - - test/core/util/fake_udp_and_tcp_server.cc - - test/cpp/util/get_grpc_test_runfile_dir.cc deps: - grpc_unsecure - - grpc++_test_util + - grpc_test_util platforms: - linux - posix @@ -8126,7 +8114,6 @@ targets: - src/core/lib/event_engine/cf_engine/cf_engine.h - src/core/lib/event_engine/cf_engine/cfstream_endpoint.h - src/core/lib/event_engine/cf_engine/cftype_unique_ref.h - - src/core/lib/event_engine/cf_engine/dns_service_resolver.h - src/core/lib/event_engine/channel_args_endpoint_config.h - src/core/lib/event_engine/common_closures.h - src/core/lib/event_engine/default_event_engine.h @@ -8409,7 +8396,6 @@ targets: - src/core/lib/event_engine/ares_resolver.cc - src/core/lib/event_engine/cf_engine/cf_engine.cc - src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc - - src/core/lib/event_engine/cf_engine/dns_service_resolver.cc - src/core/lib/event_engine/channel_args_endpoint_config.cc - src/core/lib/event_engine/default_event_engine.cc - src/core/lib/event_engine/default_event_engine_factory.cc diff --git a/config.m4 b/config.m4 index 93a4b2c5b507a..7963168b68356 100644 --- a/config.m4 +++ b/config.m4 @@ -522,7 +522,6 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/event_engine/ares_resolver.cc \ src/core/lib/event_engine/cf_engine/cf_engine.cc \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc \ - src/core/lib/event_engine/cf_engine/dns_service_resolver.cc \ src/core/lib/event_engine/channel_args_endpoint_config.cc \ src/core/lib/event_engine/default_event_engine.cc \ src/core/lib/event_engine/default_event_engine_factory.cc \ diff --git a/config.w32 b/config.w32 index 6de00278ef066..e8412bdeb19c3 100644 --- a/config.w32 +++ b/config.w32 @@ -487,7 +487,6 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\event_engine\\ares_resolver.cc " + "src\\core\\lib\\event_engine\\cf_engine\\cf_engine.cc " + "src\\core\\lib\\event_engine\\cf_engine\\cfstream_endpoint.cc " + - "src\\core\\lib\\event_engine\\cf_engine\\dns_service_resolver.cc " + "src\\core\\lib\\event_engine\\channel_args_endpoint_config.cc " + "src\\core\\lib\\event_engine\\default_event_engine.cc " + "src\\core\\lib\\event_engine\\default_event_engine_factory.cc " + diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index d95907385161e..0ff4a85975684 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -758,7 +758,6 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/cf_engine/cf_engine.h', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.h', 'src/core/lib/event_engine/cf_engine/cftype_unique_ref.h', - 'src/core/lib/event_engine/cf_engine/dns_service_resolver.h', 'src/core/lib/event_engine/channel_args_endpoint_config.h', 'src/core/lib/event_engine/common_closures.h', 'src/core/lib/event_engine/default_event_engine.h', @@ -1808,7 +1807,6 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/cf_engine/cf_engine.h', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.h', 'src/core/lib/event_engine/cf_engine/cftype_unique_ref.h', - 'src/core/lib/event_engine/cf_engine/dns_service_resolver.h', 'src/core/lib/event_engine/channel_args_endpoint_config.h', 'src/core/lib/event_engine/common_closures.h', 'src/core/lib/event_engine/default_event_engine.h', diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index c6f4811efe8ca..1f7ee059f5212 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -1170,8 +1170,6 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.h', 'src/core/lib/event_engine/cf_engine/cftype_unique_ref.h', - 'src/core/lib/event_engine/cf_engine/dns_service_resolver.cc', - 'src/core/lib/event_engine/cf_engine/dns_service_resolver.h', 'src/core/lib/event_engine/channel_args_endpoint_config.cc', 'src/core/lib/event_engine/channel_args_endpoint_config.h', 'src/core/lib/event_engine/common_closures.h', @@ -2544,7 +2542,6 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/cf_engine/cf_engine.h', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.h', 'src/core/lib/event_engine/cf_engine/cftype_unique_ref.h', - 'src/core/lib/event_engine/cf_engine/dns_service_resolver.h', 'src/core/lib/event_engine/channel_args_endpoint_config.h', 'src/core/lib/event_engine/common_closures.h', 'src/core/lib/event_engine/default_event_engine.h', diff --git a/grpc.gemspec b/grpc.gemspec index d3d4df3b6cc74..8eecc38bea735 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -1075,8 +1075,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc ) s.files += %w( src/core/lib/event_engine/cf_engine/cfstream_endpoint.h ) s.files += %w( src/core/lib/event_engine/cf_engine/cftype_unique_ref.h ) - s.files += %w( src/core/lib/event_engine/cf_engine/dns_service_resolver.cc ) - s.files += %w( src/core/lib/event_engine/cf_engine/dns_service_resolver.h ) s.files += %w( src/core/lib/event_engine/channel_args_endpoint_config.cc ) s.files += %w( src/core/lib/event_engine/channel_args_endpoint_config.h ) s.files += %w( src/core/lib/event_engine/common_closures.h ) diff --git a/grpc.gyp b/grpc.gyp index 4ac488d26eaa8..9a53deff7e9aa 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -744,7 +744,6 @@ 'src/core/lib/event_engine/ares_resolver.cc', 'src/core/lib/event_engine/cf_engine/cf_engine.cc', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc', - 'src/core/lib/event_engine/cf_engine/dns_service_resolver.cc', 'src/core/lib/event_engine/channel_args_endpoint_config.cc', 'src/core/lib/event_engine/default_event_engine.cc', 'src/core/lib/event_engine/default_event_engine_factory.cc', @@ -1246,7 +1245,6 @@ 'src/core/lib/event_engine/ares_resolver.cc', 'src/core/lib/event_engine/cf_engine/cf_engine.cc', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc', - 'src/core/lib/event_engine/cf_engine/dns_service_resolver.cc', 'src/core/lib/event_engine/channel_args_endpoint_config.cc', 'src/core/lib/event_engine/default_event_engine.cc', 'src/core/lib/event_engine/default_event_engine_factory.cc', @@ -1768,7 +1766,6 @@ 'src/core/lib/event_engine/ares_resolver.cc', 'src/core/lib/event_engine/cf_engine/cf_engine.cc', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc', - 'src/core/lib/event_engine/cf_engine/dns_service_resolver.cc', 'src/core/lib/event_engine/channel_args_endpoint_config.cc', 'src/core/lib/event_engine/default_event_engine.cc', 'src/core/lib/event_engine/default_event_engine_factory.cc', diff --git a/package.xml b/package.xml index 3a8afe9b3fda5..00f44d11922be 100644 --- a/package.xml +++ b/package.xml @@ -1057,8 +1057,6 @@ - - diff --git a/src/core/BUILD b/src/core/BUILD index 68efe9d473727..f1a323e6687f5 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -2125,18 +2125,13 @@ grpc_cc_library( srcs = [ "lib/event_engine/cf_engine/cf_engine.cc", "lib/event_engine/cf_engine/cfstream_endpoint.cc", - "lib/event_engine/cf_engine/dns_service_resolver.cc", ], hdrs = [ "lib/event_engine/cf_engine/cf_engine.h", "lib/event_engine/cf_engine/cfstream_endpoint.h", "lib/event_engine/cf_engine/cftype_unique_ref.h", - "lib/event_engine/cf_engine/dns_service_resolver.h", - ], - external_deps = [ - "absl/container:flat_hash_map", - "absl/strings:str_format", ], + external_deps = ["absl/strings:str_format"], deps = [ "event_engine_common", "event_engine_tcp_socket_utils", @@ -2152,7 +2147,6 @@ grpc_cc_library( "strerror", "//:event_engine_base_hdrs", "//:gpr", - "//:parse_address", "//:ref_counted_ptr", "//:sockaddr_utils", ], diff --git a/src/core/lib/event_engine/cf_engine/cf_engine.cc b/src/core/lib/event_engine/cf_engine/cf_engine.cc index af0b7248d1992..f835e64a21e8c 100644 --- a/src/core/lib/event_engine/cf_engine/cf_engine.cc +++ b/src/core/lib/event_engine/cf_engine/cf_engine.cc @@ -22,7 +22,6 @@ #include "src/core/lib/event_engine/cf_engine/cf_engine.h" #include "src/core/lib/event_engine/cf_engine/cfstream_endpoint.h" -#include "src/core/lib/event_engine/cf_engine/dns_service_resolver.h" #include "src/core/lib/event_engine/posix_engine/timer_manager.h" #include "src/core/lib/event_engine/tcp_socket_utils.h" #include "src/core/lib/event_engine/thread_pool/thread_pool.h" @@ -157,14 +156,9 @@ bool CFEventEngine::CancelConnectInternal(ConnectionHandle handle, bool CFEventEngine::IsWorkerThread() { grpc_core::Crash("unimplemented"); } absl::StatusOr> -CFEventEngine::GetDNSResolver(const DNSResolver::ResolverOptions& options) { - if (!options.dns_server.empty()) { - return absl::InvalidArgumentError( - "CFEventEngine does not support custom DNS servers"); - } - - return std::make_unique( - std::static_pointer_cast(shared_from_this())); +CFEventEngine::GetDNSResolver( + const DNSResolver::ResolverOptions& /* options */) { + grpc_core::Crash("unimplemented"); } void CFEventEngine::Run(EventEngine::Closure* closure) { diff --git a/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc b/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc deleted file mode 100644 index c19f9afe46349..0000000000000 --- a/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc +++ /dev/null @@ -1,222 +0,0 @@ -// Copyright 2023 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include - -#ifdef GPR_APPLE - -#include "absl/strings/str_format.h" - -#include "src/core/lib/address_utils/parse_address.h" -#include "src/core/lib/event_engine/cf_engine/dns_service_resolver.h" -#include "src/core/lib/event_engine/posix_engine/lockfree_event.h" -#include "src/core/lib/event_engine/tcp_socket_utils.h" -#include "src/core/lib/event_engine/trace.h" -#include "src/core/lib/gprpp/host_port.h" - -namespace grpc_event_engine { -namespace experimental { - -void DNSServiceResolverImpl::LookupHostname( - EventEngine::DNSResolver::LookupHostnameCallback on_resolve, - absl::string_view name, absl::string_view default_port) { - GRPC_EVENT_ENGINE_DNS_TRACE( - "DNSServiceResolverImpl::LookupHostname: name: %.*s, default_port: %.*s, " - "this: %p", - static_cast(name.length()), name.data(), - static_cast(default_port.length()), default_port.data(), this); - - absl::string_view host; - absl::string_view port_string; - if (!grpc_core::SplitHostPort(name, &host, &port_string)) { - engine_->Run([on_resolve = std::move(on_resolve), - status = absl::InvalidArgumentError( - absl::StrCat("Unparseable name: ", name))]() mutable { - on_resolve(status); - }); - return; - } - GPR_ASSERT(!host.empty()); - if (port_string.empty()) { - if (default_port.empty()) { - engine_->Run([on_resolve = std::move(on_resolve), - status = absl::InvalidArgumentError(absl::StrFormat( - "No port in name %s or default_port argument", - name))]() mutable { on_resolve(std::move(status)); }); - return; - } - port_string = default_port; - } - - int port = 0; - if (port_string == "http") { - port = 80; - } else if (port_string == "https") { - port = 443; - } else if (!absl::SimpleAtoi(port_string, &port)) { - engine_->Run([on_resolve = std::move(on_resolve), - status = absl::InvalidArgumentError(absl::StrCat( - "Failed to parse port in name: ", name))]() mutable { - on_resolve(std::move(status)); - }); - return; - } - - // TODO(yijiem): Change this when refactoring code in - // src/core/lib/address_utils to use EventEngine::ResolvedAddress. - grpc_resolved_address addr; - const std::string hostport = grpc_core::JoinHostPort(host, port); - if (grpc_parse_ipv4_hostport(hostport.c_str(), &addr, - /*log_errors=*/false) || - grpc_parse_ipv6_hostport(hostport.c_str(), &addr, - /*log_errors=*/false)) { - // Early out if the target is an ipv4 or ipv6 literal. - std::vector result; - result.emplace_back(reinterpret_cast(addr.addr), addr.len); - engine_->Run([on_resolve = std::move(on_resolve), - result = std::move(result)]() mutable { - on_resolve(std::move(result)); - }); - return; - } - - DNSServiceRef sdRef; - auto host_string = std::string{host}; - auto error = DNSServiceGetAddrInfo( - &sdRef, kDNSServiceFlagsTimeout | kDNSServiceFlagsReturnIntermediates, 0, - kDNSServiceProtocol_IPv4 | kDNSServiceProtocol_IPv6, host_string.c_str(), - &DNSServiceResolverImpl::ResolveCallback, this /* do not Ref */); - - if (error != kDNSServiceErr_NoError) { - engine_->Run([on_resolve = std::move(on_resolve), - status = absl::UnknownError(absl::StrFormat( - "DNSServiceGetAddrInfo failed with error:%d", - error))]() mutable { on_resolve(std::move(status)); }); - return; - } - - grpc_core::ReleasableMutexLock lock(&request_mu_); - - error = DNSServiceSetDispatchQueue(sdRef, queue_); - if (error != kDNSServiceErr_NoError) { - engine_->Run([on_resolve = std::move(on_resolve), - status = absl::UnknownError(absl::StrFormat( - "DNSServiceSetDispatchQueue failed with error:%d", - error))]() mutable { on_resolve(std::move(status)); }); - return; - } - - requests_.try_emplace( - sdRef, DNSServiceRequest{ - std::move(on_resolve), static_cast(port), {}}); -} - -/* static */ -void DNSServiceResolverImpl::ResolveCallback( - DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, - DNSServiceErrorType errorCode, const char* hostname, - const struct sockaddr* address, uint32_t ttl, void* context) { - GRPC_EVENT_ENGINE_DNS_TRACE( - "DNSServiceResolverImpl::ResolveCallback: sdRef: %p, flags: %x, " - "interface: %d, errorCode: %d, hostname: %s, addressFamily: %d, ttl: " - "%d, " - "this: %p", - sdRef, flags, interfaceIndex, errorCode, hostname, address->sa_family, - ttl, context); - - // no need to increase refcount here, since ResolveCallback and Shutdown is - // called from the serial queue and it is guarenteed that it won't be called - // after the sdRef is deallocated - auto that = static_cast(context); - - grpc_core::ReleasableMutexLock lock(&that->request_mu_); - auto request_it = that->requests_.find(sdRef); - GPR_ASSERT(request_it != that->requests_.end()); - auto& request = request_it->second; - - if (errorCode != kDNSServiceErr_NoError && - errorCode != kDNSServiceErr_NoSuchRecord) { - request.on_resolve(absl::UnknownError(absl::StrFormat( - "address lookup failed for %s: errorCode: %d", hostname, errorCode))); - that->requests_.erase(request_it); - DNSServiceRefDeallocate(sdRef); - return; - } - - // set received ipv4 or ipv6 response, even for kDNSServiceErr_NoSuchRecord - if (address->sa_family == AF_INET) { - request.has_ipv4_response = true; - } else if (address->sa_family == AF_INET6) { - request.has_ipv6_response = true; - } - - // collect results if there is no error (not kDNSServiceErr_NoSuchRecord) - if (errorCode == kDNSServiceErr_NoError) { - request.result.emplace_back(address, address->sa_len); - auto& resolved_address = request.result.back(); - if (address->sa_family == AF_INET) { - (const_cast( - reinterpret_cast(resolved_address.address()))) - ->sin_port = htons(request.port); - } else if (address->sa_family == AF_INET6) { - (const_cast( - reinterpret_cast(resolved_address.address()))) - ->sin6_port = htons(request.port); - } - - GRPC_EVENT_ENGINE_DNS_TRACE( - "DNSServiceResolverImpl::ResolveCallback: " - "sdRef: %p, hostname: %s, addressPort: %s, this: %p", - sdRef, hostname, - ResolvedAddressToString(resolved_address).value_or("ERROR").c_str(), - context); - } - - if (!(flags & kDNSServiceFlagsMoreComing) && request.has_ipv4_response && - request.has_ipv6_response) { - if (request.result.empty()) { - request.on_resolve(absl::NotFoundError(absl::StrFormat( - "address lookup failed for %s: Domain name not found", hostname))); - } else { - request.on_resolve(std::move(request.result)); - } - that->requests_.erase(request_it); - DNSServiceRefDeallocate(sdRef); - } -} - -void DNSServiceResolverImpl::Shutdown() { - dispatch_async_f(queue_, Ref().release(), [](void* thatPtr) { - grpc_core::RefCountedPtr that{ - static_cast(thatPtr)}; - grpc_core::MutexLock lock(&that->request_mu_); - for (auto& kv : that->requests_) { - auto& sdRef = kv.first; - auto& request = kv.second; - GRPC_EVENT_ENGINE_DNS_TRACE( - "DNSServiceResolverImpl::Shutdown sdRef: %p, this: %p", sdRef, - thatPtr); - - request.on_resolve( - absl::CancelledError("DNSServiceResolverImpl::Shutdown")); - DNSServiceRefDeallocate(static_cast(sdRef)); - } - that->requests_.clear(); - }); -} - -} // namespace experimental -} // namespace grpc_event_engine - -#endif // GPR_APPLE diff --git a/src/core/lib/event_engine/cf_engine/dns_service_resolver.h b/src/core/lib/event_engine/cf_engine/dns_service_resolver.h deleted file mode 100644 index 00a55a3050025..0000000000000 --- a/src/core/lib/event_engine/cf_engine/dns_service_resolver.h +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2023 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -#ifndef GRPC_SRC_CORE_LIB_EVENT_ENGINE_CF_ENGINE_DNS_SERVICE_RESOLVER_H -#define GRPC_SRC_CORE_LIB_EVENT_ENGINE_CF_ENGINE_DNS_SERVICE_RESOLVER_H -#include - -#ifdef GPR_APPLE - -#include -#include - -#include "absl/container/flat_hash_map.h" - -#include - -#include "src/core/lib/event_engine/cf_engine/cf_engine.h" -#include "src/core/lib/gprpp/ref_counted.h" -#include "src/core/lib/gprpp/ref_counted_ptr.h" - -namespace grpc_event_engine { -namespace experimental { - -class DNSServiceResolverImpl - : public grpc_core::RefCounted { - struct DNSServiceRequest { - EventEngine::DNSResolver::LookupHostnameCallback on_resolve; - uint16_t port; - std::vector result; - bool has_ipv4_response = false; - bool has_ipv6_response = false; - }; - - public: - explicit DNSServiceResolverImpl(std::shared_ptr engine) - : engine_(std::move((engine))) {} - ~DNSServiceResolverImpl() override { - GPR_ASSERT(requests_.empty()); - dispatch_release(queue_); - } - - void Shutdown(); - - void LookupHostname( - EventEngine::DNSResolver::LookupHostnameCallback on_resolve, - absl::string_view name, absl::string_view default_port); - - private: - static void ResolveCallback(DNSServiceRef sdRef, DNSServiceFlags flags, - uint32_t interfaceIndex, - DNSServiceErrorType errorCode, - const char* hostname, - const struct sockaddr* address, uint32_t ttl, - void* context); - - private: - std::shared_ptr engine_; - // DNSServiceSetDispatchQueue requires a serial dispatch queue - dispatch_queue_t queue_ = - dispatch_queue_create("dns_service_resolver", nullptr); - grpc_core::Mutex request_mu_; - absl::flat_hash_map requests_ - ABSL_GUARDED_BY(request_mu_); -}; - -class DNSServiceResolver : public EventEngine::DNSResolver { - public: - explicit DNSServiceResolver(std::shared_ptr engine) - : engine_(std::move(engine)), - impl_(grpc_core::MakeRefCounted( - std::move((engine_)))) {} - - ~DNSServiceResolver() override { impl_->Shutdown(); } - - void LookupHostname( - EventEngine::DNSResolver::LookupHostnameCallback on_resolve, - absl::string_view name, absl::string_view default_port) override { - impl_->LookupHostname(std::move(on_resolve), name, default_port); - }; - - void LookupSRV(EventEngine::DNSResolver::LookupSRVCallback on_resolve, - absl::string_view /* name */) override { - engine_->Run([on_resolve = std::move(on_resolve)]() mutable { - on_resolve(absl::UnimplementedError( - "The DNS Service resolver does not support looking up SRV records")); - }); - } - - void LookupTXT(EventEngine::DNSResolver::LookupTXTCallback on_resolve, - absl::string_view /* name */) override { - engine_->Run([on_resolve = std::move(on_resolve)]() mutable { - on_resolve(absl::UnimplementedError( - "The DNS Service resolver does not support looking up TXT records")); - }); - } - - private: - std::shared_ptr engine_; - grpc_core::RefCountedPtr impl_; -}; - -} // namespace experimental -} // namespace grpc_event_engine - -#endif // GPR_APPLE - -#endif // GRPC_SRC_CORE_LIB_EVENT_ENGINE_CF_ENGINE_DNS_SERVICE_RESOLVER_H diff --git a/src/objective-c/tests/BUILD b/src/objective-c/tests/BUILD index bfbe19b773e57..9eef39eaba667 100644 --- a/src/objective-c/tests/BUILD +++ b/src/objective-c/tests/BUILD @@ -341,7 +341,6 @@ grpc_objc_testing_library( "//src/core:cf_event_engine", "//test/core/event_engine/test_suite/posix:oracle_event_engine_posix", "//test/core/event_engine/test_suite/tests:client", - "//test/core/event_engine/test_suite/tests:dns", "//test/core/event_engine/test_suite/tests:timer", ], ) diff --git a/src/objective-c/tests/EventEngineTests/CFEventEngineTests.mm b/src/objective-c/tests/EventEngineTests/CFEventEngineTests.mm index 9885918324698..2f32a409314f6 100644 --- a/src/objective-c/tests/EventEngineTests/CFEventEngineTests.mm +++ b/src/objective-c/tests/EventEngineTests/CFEventEngineTests.mm @@ -24,7 +24,6 @@ #include "test/core/event_engine/test_suite/event_engine_test_framework.h" #include "test/core/event_engine/test_suite/posix/oracle_event_engine_posix.h" #include "test/core/event_engine/test_suite/tests/client_test.h" -#include "test/core/event_engine/test_suite/tests/dns_test.h" #include "test/core/event_engine/test_suite/tests/timer_test.h" #include "test/core/util/test_config.h" @@ -54,7 +53,6 @@ - (void)testAll { SetEventEngineFactories(factory, oracle_factory); grpc_event_engine::experimental::InitTimerTests(); grpc_event_engine::experimental::InitClientTests(); - grpc_event_engine::experimental::InitDNSTests(); // TODO(ctiller): EventEngine temporarily needs grpc to be initialized first // until we clear out the iomgr shutdown code. grpc_init(); diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 76fbcce089e00..3a03e18ac0874 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -496,7 +496,6 @@ 'src/core/lib/event_engine/ares_resolver.cc', 'src/core/lib/event_engine/cf_engine/cf_engine.cc', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc', - 'src/core/lib/event_engine/cf_engine/dns_service_resolver.cc', 'src/core/lib/event_engine/channel_args_endpoint_config.cc', 'src/core/lib/event_engine/default_event_engine.cc', 'src/core/lib/event_engine/default_event_engine_factory.cc', diff --git a/test/core/event_engine/cf/cf_engine_test.cc b/test/core/event_engine/cf/cf_engine_test.cc index ae9e540b35960..f50b40f82fa76 100644 --- a/test/core/event_engine/cf/cf_engine_test.cc +++ b/test/core/event_engine/cf/cf_engine_test.cc @@ -19,8 +19,6 @@ #include #include "absl/status/status.h" -#include "absl/strings/str_format.h" -#include "gmock/gmock.h" #include "gtest/gtest.h" #include @@ -82,215 +80,6 @@ TEST(CFEventEngineTest, TestConnectionCancelled) { client_signal.WaitForNotification(); } -namespace { -std::vector ResolvedAddressesToStrings( - const std::vector addresses) { - std::vector ip_strings; - std::transform(addresses.cbegin(), addresses.cend(), - std::back_inserter(ip_strings), [](auto const& address) { - return ResolvedAddressToString(address).value_or("ERROR"); - }); - return ip_strings; -} -} // namespace - -TEST(CFEventEngineTest, TestCreateDNSResolver) { - grpc_core::MemoryQuota memory_quota("cf_engine_test"); - auto cf_engine = std::make_shared(); - - EXPECT_TRUE(cf_engine->GetDNSResolver({}).status().ok()); - EXPECT_TRUE(cf_engine->GetDNSResolver({.dns_server = ""}).status().ok()); - EXPECT_EQ( - cf_engine->GetDNSResolver({.dns_server = "8.8.8.8"}).status().code(), - absl::StatusCode::kInvalidArgument); - EXPECT_EQ( - cf_engine->GetDNSResolver({.dns_server = "8.8.8.8:53"}).status().code(), - absl::StatusCode::kInvalidArgument); - EXPECT_EQ( - cf_engine->GetDNSResolver({.dns_server = "invalid"}).status().code(), - absl::StatusCode::kInvalidArgument); -} - -TEST(CFEventEngineTest, TestResolveLocalhost) { - grpc_core::Notification resolve_signal; - - auto cf_engine = std::make_shared(); - auto dns_resolver = cf_engine->GetDNSResolver({}); - - dns_resolver.value()->LookupHostname( - [&resolve_signal](auto result) { - EXPECT_TRUE(result.status().ok()); - EXPECT_THAT(ResolvedAddressesToStrings(result.value()), - testing::UnorderedElementsAre("127.0.0.1:80", "[::1]:80")); - - resolve_signal.Notify(); - }, - "localhost", "80"); - - resolve_signal.WaitForNotification(); -} - -TEST(CFEventEngineTest, TestResolveRemote) { - grpc_core::Notification resolve_signal; - - auto cf_engine = std::make_shared(); - auto dns_resolver = cf_engine->GetDNSResolver({}); - - dns_resolver.value()->LookupHostname( - [&resolve_signal](auto result) { - EXPECT_TRUE(result.status().ok()); - EXPECT_THAT(ResolvedAddressesToStrings(result.value()), - testing::UnorderedElementsAre("127.0.0.1:80", "[::1]:80")); - - resolve_signal.Notify(); - }, - "localtest.me:80", "443"); - - resolve_signal.WaitForNotification(); -} - -TEST(CFEventEngineTest, TestResolveIPv4Remote) { - grpc_core::Notification resolve_signal; - - auto cf_engine = std::make_shared(); - auto dns_resolver = cf_engine->GetDNSResolver({}); - - dns_resolver.value()->LookupHostname( - [&resolve_signal](auto result) { - EXPECT_TRUE(result.status().ok()); - EXPECT_THAT(ResolvedAddressesToStrings(result.value()), - testing::IsSubsetOf( - {"1.2.3.4:80", "[64:ff9b::102:304]:80" /*NAT64*/})); - - resolve_signal.Notify(); - }, - "1.2.3.4.nip.io:80", ""); - - resolve_signal.WaitForNotification(); -} - -TEST(CFEventEngineTest, TestResolveIPv6Remote) { - grpc_core::Notification resolve_signal; - - auto cf_engine = std::make_shared(); - auto dns_resolver = cf_engine->GetDNSResolver({}); - - dns_resolver.value()->LookupHostname( - [&resolve_signal](auto result) { - EXPECT_TRUE(result.status().ok()); - EXPECT_THAT( - ResolvedAddressesToStrings(result.value()), - testing::UnorderedElementsAre("[2607:f8b0:400a:801::1002]:80")); - - resolve_signal.Notify(); - }, - "2607-f8b0-400a-801--1002.sslip.io.", "80"); - - resolve_signal.WaitForNotification(); -} - -TEST(CFEventEngineTest, TestResolveIPv4Literal) { - grpc_core::Notification resolve_signal; - - auto cf_engine = std::make_shared(); - auto dns_resolver = cf_engine->GetDNSResolver({}); - - dns_resolver.value()->LookupHostname( - [&resolve_signal](auto result) { - EXPECT_TRUE(result.status().ok()); - EXPECT_THAT(ResolvedAddressesToStrings(result.value()), - testing::UnorderedElementsAre("1.2.3.4:443")); - - resolve_signal.Notify(); - }, - "1.2.3.4", "https"); - - resolve_signal.WaitForNotification(); -} - -TEST(CFEventEngineTest, TestResolveIPv6Literal) { - grpc_core::Notification resolve_signal; - - auto cf_engine = std::make_shared(); - auto dns_resolver = cf_engine->GetDNSResolver({}); - - dns_resolver.value()->LookupHostname( - [&resolve_signal](auto result) { - EXPECT_TRUE(result.status().ok()); - EXPECT_THAT( - ResolvedAddressesToStrings(result.value()), - testing::UnorderedElementsAre("[2607:f8b0:400a:801::1002]:443")); - - resolve_signal.Notify(); - }, - "[2607:f8b0:400a:801::1002]", "443"); - - resolve_signal.WaitForNotification(); -} - -TEST(CFEventEngineTest, TestResolveNoRecord) { - grpc_core::Notification resolve_signal; - auto cf_engine = std::make_shared(); - auto dns_resolver = std::move(cf_engine->GetDNSResolver({})).value(); - - dns_resolver->LookupHostname( - [&resolve_signal](auto result) { - EXPECT_EQ(result.status().code(), absl::StatusCode::kNotFound); - - resolve_signal.Notify(); - }, - "nonexisting-target.dns-test.event-engine.", "443"); - - resolve_signal.WaitForNotification(); -} - -TEST(CFEventEngineTest, TestResolveCanceled) { - grpc_core::Notification resolve_signal; - auto cf_engine = std::make_shared(); - auto dns_resolver = std::move(cf_engine->GetDNSResolver({})).value(); - - dns_resolver->LookupHostname( - [&resolve_signal](auto result) { - // query may have already finished before canceling, only verity the - // code if status is not ok - if (!result.status().ok()) { - EXPECT_EQ(result.status().code(), absl::StatusCode::kCancelled); - } - - resolve_signal.Notify(); - }, - "dont-care-since-wont-be-resolved.localtest.me", "443"); - - dns_resolver.reset(); - resolve_signal.WaitForNotification(); -} - -TEST(CFEventEngineTest, TestResolveMany) { - std::atomic times{10}; - grpc_core::Notification resolve_signal; - auto cf_engine = std::make_shared(); - auto dns_resolver = std::move(cf_engine->GetDNSResolver({})).value(); - - for (int i = times; i >= 1; --i) { - dns_resolver->LookupHostname( - [&resolve_signal, ×, i](auto result) { - EXPECT_TRUE(result.status().ok()); - EXPECT_THAT( - ResolvedAddressesToStrings(result.value()), - testing::IsSubsetOf( - {absl::StrFormat("100.0.0.%d:443", i), - absl::StrFormat("[64:ff9b::6400:%x]:443", i) /*NAT64*/})); - - if (--times == 0) { - resolve_signal.Notify(); - } - }, - absl::StrFormat("100.0.0.%d.nip.io", i), "443"); - } - - resolve_signal.WaitForNotification(); -} - } // namespace experimental } // namespace grpc_event_engine diff --git a/test/core/event_engine/test_suite/BUILD b/test/core/event_engine/test_suite/BUILD index 48eee5e0bf590..cc485a4d9a269 100644 --- a/test/core/event_engine/test_suite/BUILD +++ b/test/core/event_engine/test_suite/BUILD @@ -96,7 +96,6 @@ grpc_cc_test( grpc_cc_test( name = "cf_event_engine_test", srcs = ["cf_event_engine_test.cc"], - copts = ["-DGRPC_IOS_EVENT_ENGINE_CLIENT=1"], tags = [ "no_linux", "no_windows", @@ -106,7 +105,6 @@ grpc_cc_test( "//src/core:cf_event_engine", "//test/core/event_engine/test_suite/posix:oracle_event_engine_posix", "//test/core/event_engine/test_suite/tests:client", - "//test/core/event_engine/test_suite/tests:dns", "//test/core/event_engine/test_suite/tests:timer", ], ) diff --git a/test/core/event_engine/test_suite/cf_event_engine_test.cc b/test/core/event_engine/test_suite/cf_event_engine_test.cc index 78241c45a5000..1d222514cb624 100644 --- a/test/core/event_engine/test_suite/cf_event_engine_test.cc +++ b/test/core/event_engine/test_suite/cf_event_engine_test.cc @@ -21,7 +21,6 @@ #include "test/core/event_engine/test_suite/event_engine_test_framework.h" #include "test/core/event_engine/test_suite/posix/oracle_event_engine_posix.h" #include "test/core/event_engine/test_suite/tests/client_test.h" -#include "test/core/event_engine/test_suite/tests/dns_test.h" #include "test/core/event_engine/test_suite/tests/timer_test.h" #include "test/core/util/test_config.h" @@ -38,7 +37,8 @@ int main(int argc, char** argv) { SetEventEngineFactories(factory, oracle_factory); grpc_event_engine::experimental::InitTimerTests(); grpc_event_engine::experimental::InitClientTests(); - grpc_event_engine::experimental::InitDNSTests(); + // TODO(vigneshbabu): remove when the experiment is over + grpc_core::ForceEnableExperiment("event_engine_client", true); // TODO(ctiller): EventEngine temporarily needs grpc to be initialized first // until we clear out the iomgr shutdown code. grpc_init(); diff --git a/test/core/event_engine/test_suite/tests/dns_test.cc b/test/core/event_engine/test_suite/tests/dns_test.cc index 18e6ae5d345ab..cbd48e26bc775 100644 --- a/test/core/event_engine/test_suite/tests/dns_test.cc +++ b/test/core/event_engine/test_suite/tests/dns_test.cc @@ -194,9 +194,6 @@ class EventEngineDNSTest : public EventEngineTest { EventEngineDNSTest::DNSServer EventEngineDNSTest::dns_server_; -// TODO(hork): implement XFAIL for resolvers that don't support TXT or SRV -#ifndef GRPC_IOS_EVENT_ENGINE_CLIENT - TEST_F(EventEngineDNSTest, QueryNXHostname) { auto dns_resolver = CreateDefaultDNSResolver(); dns_resolver->LookupHostname( @@ -368,7 +365,6 @@ TEST_F(EventEngineDNSTest, TestCancelActiveDNSQuery) { dns_resolver.reset(); dns_resolver_signal_.WaitForNotification(); } -#endif // GRPC_IOS_EVENT_ENGINE_CLIENT #define EXPECT_SUCCESS() \ do { \ diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 637de7d22957e..ab7809664f8a2 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -2072,8 +2072,6 @@ src/core/lib/event_engine/cf_engine/cf_engine.h \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.h \ src/core/lib/event_engine/cf_engine/cftype_unique_ref.h \ -src/core/lib/event_engine/cf_engine/dns_service_resolver.cc \ -src/core/lib/event_engine/cf_engine/dns_service_resolver.h \ src/core/lib/event_engine/channel_args_endpoint_config.cc \ src/core/lib/event_engine/channel_args_endpoint_config.h \ src/core/lib/event_engine/common_closures.h \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 17607e9339a34..d5b0b9258ab8a 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -1850,8 +1850,6 @@ src/core/lib/event_engine/cf_engine/cf_engine.h \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.h \ src/core/lib/event_engine/cf_engine/cftype_unique_ref.h \ -src/core/lib/event_engine/cf_engine/dns_service_resolver.cc \ -src/core/lib/event_engine/cf_engine/dns_service_resolver.h \ src/core/lib/event_engine/channel_args_endpoint_config.cc \ src/core/lib/event_engine/channel_args_endpoint_config.h \ src/core/lib/event_engine/common_closures.h \ From 8d3b06ca7c8e269051e1d38838e7bfe0d48f0cce Mon Sep 17 00:00:00 2001 From: Paulo Castello da Costa Date: Wed, 2 Aug 2023 11:59:34 -0700 Subject: [PATCH 110/205] [benchmark] Add node benchmarks to experimental job. (#33963) --- .../linux/grpc_e2e_performance_gke_experiment.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/internal_ci/linux/grpc_e2e_performance_gke_experiment.sh b/tools/internal_ci/linux/grpc_e2e_performance_gke_experiment.sh index f2081364bb33a..aa2622593d69a 100755 --- a/tools/internal_ci/linux/grpc_e2e_performance_gke_experiment.sh +++ b/tools/internal_ci/linux/grpc_e2e_performance_gke_experiment.sh @@ -30,6 +30,8 @@ GRPC_GO_REPO=grpc/grpc-go GRPC_GO_GITREF=master GRPC_JAVA_REPO=grpc/grpc-java GRPC_JAVA_GITREF=master +GRPC_NODE_REPO=grpc/grpc-node +GRPC_NODE_GITREF=master TEST_INFRA_REPO=grpc/test-infra TEST_INFRA_GITREF=master @@ -68,6 +70,7 @@ fi GRPC_DOTNET_COMMIT="$(git ls-remote "https://github.com/${GRPC_DOTNET_REPO}.git" "${GRPC_DOTNET_GITREF}" | cut -f1)" GRPC_GO_COMMIT="$(git ls-remote "https://github.com/${GRPC_GO_REPO}.git" "${GRPC_GO_GITREF}" | cut -f1)" GRPC_JAVA_COMMIT="$(git ls-remote "https://github.com/${GRPC_JAVA_REPO}.git" "${GRPC_JAVA_GITREF}" | cut -f1)" +GRPC_NODE_COMMIT="$(git ls-remote "https://github.com/${GRPC_NODE_REPO}.git" "${GRPC_NODE_GITREF}" | cut -f1)" # Kokoro jobs run on dedicated pools. DRIVER_POOL=drivers-ci WORKER_POOL_8CORE=workers-c2-8core-ci @@ -137,6 +140,10 @@ configLangArgs8core+=( -l java ) configLangArgs32core+=( -l java ) runnerLangArgs+=( -l "java:${GRPC_JAVA_REPO}:${GRPC_JAVA_COMMIT}" ) +# node +configLangArgs8core+=( -l node_purejs ) # 8-core only. +runnerLangArgs+=( -l "node:${GRPC_NODE_REPO}:${GRPC_NODE_COMMIT}" ) + # python configLangArgs8core+=( -l python ) # 8-core only. runnerLangArgs+=( -l "python:${GRPC_CORE_REPO}:${GRPC_CORE_COMMIT}" ) From c79c1bf90fab612a442d467f905a96149e833f29 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 2 Aug 2023 12:39:57 -0700 Subject: [PATCH 111/205] [arena] Reland using malloc for pooled allocations (#33961) --- src/core/BUILD | 4 -- src/core/lib/resource_quota/arena.cc | 2 + src/core/lib/resource_quota/arena.h | 50 ++++++++++++++++--- .../security/transport/client_auth_filter.cc | 11 ++-- test/core/resource_quota/arena_test.cc | 6 +++ 5 files changed, 57 insertions(+), 16 deletions(-) diff --git a/src/core/BUILD b/src/core/BUILD index f1a323e6687f5..9a7a2c179a77b 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -1124,10 +1124,6 @@ grpc_cc_library( hdrs = [ "lib/resource_quota/arena.h", ], - external_deps = [ - "absl/meta:type_traits", - "absl/utility", - ], visibility = [ "@grpc:alt_grpc_base_legacy", ], diff --git a/src/core/lib/resource_quota/arena.cc b/src/core/lib/resource_quota/arena.cc index d37ef4264908c..332bdc4c85c85 100644 --- a/src/core/lib/resource_quota/arena.cc +++ b/src/core/lib/resource_quota/arena.cc @@ -121,6 +121,7 @@ void Arena::ManagedNewObject::Link(std::atomic* head) { } } +#ifndef GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC void* Arena::AllocPooled(size_t obj_size, size_t alloc_size, std::atomic* head) { // ABA mitigation: @@ -177,5 +178,6 @@ void Arena::FreePooled(void* p, std::atomic* head) { node->next, node, std::memory_order_acq_rel, std::memory_order_relaxed)) { } } +#endif } // namespace grpc_core diff --git a/src/core/lib/resource_quota/arena.h b/src/core/lib/resource_quota/arena.h index 1dcb530243e17..9c0c812d4c397 100644 --- a/src/core/lib/resource_quota/arena.h +++ b/src/core/lib/resource_quota/arena.h @@ -30,14 +30,10 @@ #include #include -#include +#include #include -#include #include -#include "absl/meta/type_traits.h" -#include "absl/utility/utility.h" - #include #include "src/core/lib/gpr/alloc.h" @@ -45,13 +41,14 @@ #include "src/core/lib/promise/context.h" #include "src/core/lib/resource_quota/memory_quota.h" -// #define GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC +#define GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC // #define GRPC_ARENA_TRACE_POOLED_ALLOCATIONS namespace grpc_core { namespace arena_detail { +#ifndef GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC struct PoolAndSize { size_t alloc_size; size_t pool_index; @@ -113,16 +110,29 @@ PoolAndSize ChoosePoolForAllocationSize( size_t n, absl::integer_sequence) { return ChoosePoolForAllocationSizeImpl<0, kBucketSizes...>::Fn(n); } +#else +template +struct IfArray { + using Result = A; +}; + +template +struct IfArray { + using Result = B; +}; +#endif } // namespace arena_detail class Arena { +#ifndef GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC // Selected pool sizes. // How to tune: see tools/codegen/core/optimize_arena_pool_sizes.py using PoolSizes = absl::integer_sequence; struct FreePoolNode { FreePoolNode* next; }; +#endif public: // Create an arena, with \a initial_size bytes in the first allocated buffer. @@ -291,8 +301,30 @@ class Arena { bool delete_ = true; }; + class ArrayPooledDeleter { + public: + ArrayPooledDeleter() = default; + explicit ArrayPooledDeleter(std::nullptr_t) : delete_(false) {} + template + void operator()(T* p) { + // TODO(ctiller): promise based filter hijacks ownership of some pointers + // to make them appear as PoolPtr without really transferring ownership, + // by setting the arena to nullptr. + // This is a transitional hack and should be removed once promise based + // filter is removed. + if (delete_) delete[] p; + } + + bool has_freelist() const { return delete_; } + + private: + bool delete_ = true; + }; + template - using PoolPtr = std::unique_ptr; + using PoolPtr = + std::unique_ptr::Result>; // Make a unique_ptr to T that is allocated from the arena. // When the pointer is released, the memory may be reused for other @@ -314,7 +346,7 @@ class Arena { // arena size. template PoolPtr MakePooledArray(size_t n) { - return PoolPtr(new T[n], PooledDeleter()); + return PoolPtr(new T[n], ArrayPooledDeleter()); } // Like MakePooled, but with manual memory management. @@ -372,9 +404,11 @@ class Arena { void* AllocZone(size_t size); +#ifndef GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC void* AllocPooled(size_t obj_size, size_t alloc_size, std::atomic* head); static void FreePooled(void* p, std::atomic* head); +#endif void TracePoolAlloc(size_t size, void* ptr) { (void)size; diff --git a/src/core/lib/security/transport/client_auth_filter.cc b/src/core/lib/security/transport/client_auth_filter.cc index 8094ff429a518..57d10f9a0b775 100644 --- a/src/core/lib/security/transport/client_auth_filter.cc +++ b/src/core/lib/security/transport/client_auth_filter.cc @@ -196,10 +196,13 @@ ArenaPromise ClientAuthFilter::MakeCallPromise( if (host == nullptr) { return next_promise_factory(std::move(call_args)); } - return TrySeq(args_.security_connector->CheckCallHost( - host->as_string_view(), args_.auth_context.get()), - GetCallCredsMetadata(std::move(call_args)), - next_promise_factory); + return TrySeq( + args_.security_connector->CheckCallHost(host->as_string_view(), + args_.auth_context.get()), + [this, call_args = std::move(call_args)]() mutable { + return GetCallCredsMetadata(std::move(call_args)); + }, + next_promise_factory); } absl::StatusOr ClientAuthFilter::Create( diff --git a/test/core/resource_quota/arena_test.cc b/test/core/resource_quota/arena_test.cc index 665364305f3b8..1e35a105f6baa 100644 --- a/test/core/resource_quota/arena_test.cc +++ b/test/core/resource_quota/arena_test.cc @@ -191,6 +191,7 @@ bool IsScribbled(Int* ints, int n, int offset) { return true; } +#ifndef GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC TEST_F(ArenaTest, PooledObjectsArePooled) { struct TestObj { char a[100]; @@ -208,6 +209,7 @@ TEST_F(ArenaTest, PooledObjectsArePooled) { Scribble(obj->a, 100, 2); EXPECT_TRUE(IsScribbled(obj->a, 100, 2)); } +#endif TEST_F(ArenaTest, CreateManyObjects) { struct TestObj { @@ -238,7 +240,11 @@ TEST_F(ArenaTest, CreateManyObjectsWithDestructors) { TEST_F(ArenaTest, CreatePoolArray) { auto arena = MakeScopedArena(1024, &memory_allocator_); auto p = arena->MakePooledArray(1024); +#ifndef GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC EXPECT_FALSE(p.get_deleter().has_freelist()); +#else + EXPECT_TRUE(p.get_deleter().has_freelist()); +#endif p = arena->MakePooledArray(5); EXPECT_TRUE(p.get_deleter().has_freelist()); Scribble(p.get(), 5, 1); From f10a8e3418e51230b0af86e880f82c8325a68abe Mon Sep 17 00:00:00 2001 From: Mario Jones Vimal Date: Wed, 2 Aug 2023 13:19:08 -0700 Subject: [PATCH 112/205] [core/gpr] move subprocess to gpr (#33870) Move subprocess util to gpr. Add support for communication with the subprocess. This is required to support authentication using an executable. --- BUILD | 20 ++ CMakeLists.txt | 162 +---------- build_autogenerated.yaml | 243 +--------------- grpc.gyp | 6 +- .../util => src/core/lib/gpr}/subprocess.h | 15 +- src/core/lib/gpr/subprocess_posix.cc | 266 ++++++++++++++++++ .../core/lib/gpr}/subprocess_windows.cc | 2 +- test/core/bad_ssl/bad_ssl_test.cc | 2 +- test/core/bad_ssl/generate_tests.bzl | 1 + test/core/event_engine/test_suite/tests/BUILD | 1 + test/core/http/BUILD | 3 + test/core/http/httpcli_test.cc | 2 +- test/core/http/httpcli_test_util.cc | 2 +- test/core/http/httpcli_test_util.h | 2 +- test/core/http/httpscli_test.cc | 2 +- test/core/memory_usage/BUILD | 2 + test/core/memory_usage/memory_usage_test.cc | 2 +- test/core/util/BUILD | 3 - test/core/util/subprocess_posix.cc | 101 ------- test/cpp/util/BUILD | 2 + test/cpp/util/subprocess.cc | 2 +- 21 files changed, 337 insertions(+), 504 deletions(-) rename {test/core/util => src/core/lib/gpr}/subprocess.h (68%) create mode 100644 src/core/lib/gpr/subprocess_posix.cc rename {test/core/util => src/core/lib/gpr}/subprocess_windows.cc (98%) delete mode 100644 test/core/util/subprocess_posix.cc diff --git a/BUILD b/BUILD index 1b1a4ef5081dd..a1a9c395447c8 100644 --- a/BUILD +++ b/BUILD @@ -4000,6 +4000,26 @@ grpc_cc_library( ], ) +grpc_cc_library( + name = "subprocess", + srcs = [ + "//src/core:lib/gpr/subprocess_posix.cc", + "//src/core:lib/gpr/subprocess_windows.cc", + ], + hdrs = [ + "//src/core:lib/gpr/subprocess.h", + ], + external_deps = [ + "absl/strings", + "absl/types:span", + ], + deps = [ + "gpr", + "//src/core:strerror", + "//src/core:tchar", + ], +) + # TODO(yashykt): Remove the UPB definitions from here once they are no longer needed ### UPB Targets diff --git a/CMakeLists.txt b/CMakeLists.txt index 0392d45656177..f2b7f516196ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3281,8 +3281,6 @@ add_library(benchmark_helpers test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc test/cpp/microbenchmarks/helpers.cc ) @@ -4000,6 +3998,8 @@ endif() if(gRPC_BUILD_TESTS) add_library(grpc++_test_util + src/core/lib/gpr/subprocess_posix.cc + src/core/lib/gpr/subprocess_windows.cc test/core/end2end/data/client_certs.cc test/core/end2end/data/server1_cert.cc test/core/end2end/data/server1_key.cc @@ -4013,8 +4013,6 @@ add_library(grpc++_test_util test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc test/cpp/util/byte_buffer_proto_helper.cc test/cpp/util/create_test_channel.cc @@ -5035,8 +5033,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc ) target_compile_features(fd_conservation_posix_test PUBLIC cxx_std_14) @@ -5172,8 +5168,6 @@ add_executable(test_core_iomgr_timer_list_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc ) target_compile_features(test_core_iomgr_timer_list_test PUBLIC cxx_std_14) @@ -5287,6 +5281,8 @@ if(gRPC_BUILD_TESTS) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_executable(address_sorting_test_unsecure + src/core/lib/gpr/subprocess_posix.cc + src/core/lib/gpr/subprocess_windows.cc test/core/util/cmdline.cc test/core/util/fuzzer_util.cc test/core/util/grpc_profiler.cc @@ -5296,8 +5292,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc test/cpp/naming/address_sorting_test.cc test/cpp/util/byte_buffer_proto_helper.cc @@ -5409,8 +5403,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc test/cpp/common/alarm_test.cc third_party/googletest/googletest/src/gtest-all.cc @@ -5853,8 +5845,6 @@ add_executable(alts_security_connector_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -6189,8 +6179,6 @@ add_executable(auth_context_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -6275,8 +6263,6 @@ add_executable(authorization_matchers_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -6401,8 +6387,6 @@ add_executable(aws_request_signer_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -6601,6 +6585,8 @@ if(gRPC_BUILD_TESTS) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_executable(bad_ssl_alpn_test + src/core/lib/gpr/subprocess_posix.cc + src/core/lib/gpr/subprocess_windows.cc test/core/bad_ssl/bad_ssl_test.cc test/core/end2end/cq_verifier.cc test/core/util/cmdline.cc @@ -6612,8 +6598,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -6653,6 +6637,8 @@ if(gRPC_BUILD_TESTS) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_executable(bad_ssl_cert_test + src/core/lib/gpr/subprocess_posix.cc + src/core/lib/gpr/subprocess_windows.cc test/core/bad_ssl/bad_ssl_test.cc test/core/end2end/cq_verifier.cc test/core/util/cmdline.cc @@ -6664,8 +6650,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -7221,8 +7205,6 @@ add_executable(buffer_list_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -7981,8 +7963,6 @@ add_executable(cel_authorization_engine_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -8317,8 +8297,6 @@ add_executable(channel_creds_registry_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -8614,8 +8592,6 @@ add_executable(check_gcp_environment_linux_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -8663,8 +8639,6 @@ add_executable(check_gcp_environment_windows_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -9306,8 +9280,6 @@ add_executable(cmdline_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -9432,8 +9404,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -9756,8 +9726,6 @@ add_executable(connectivity_state_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -10819,8 +10787,6 @@ add_executable(endpoint_pair_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -10956,8 +10922,6 @@ add_executable(error_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -11005,8 +10969,6 @@ add_executable(error_utils_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -11054,8 +11016,6 @@ add_executable(evaluate_args_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -11624,8 +11584,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -12281,8 +12239,6 @@ add_executable(format_request_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -12966,8 +12922,6 @@ add_executable(grpc_alts_credentials_options_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -13053,8 +13007,6 @@ add_executable(grpc_authorization_engine_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -13102,8 +13054,6 @@ add_executable(grpc_authorization_policy_provider_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -13463,8 +13413,6 @@ add_executable(grpc_ipv6_loopback_available_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -13722,8 +13670,6 @@ add_executable(grpc_tls_certificate_distributor_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -13771,8 +13717,6 @@ add_executable(grpc_tls_certificate_provider_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -13820,8 +13764,6 @@ add_executable(grpc_tls_certificate_verifier_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -13869,8 +13811,6 @@ add_executable(grpc_tls_credentials_options_comparator_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -13918,8 +13858,6 @@ add_executable(grpc_tls_credentials_options_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -14524,8 +14462,6 @@ add_executable(histogram_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -14610,8 +14546,6 @@ add_executable(hpack_encoder_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -14659,8 +14593,6 @@ add_executable(hpack_parser_table_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -14708,8 +14640,6 @@ add_executable(hpack_parser_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -15220,8 +15150,6 @@ add_executable(insecure_security_connector_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -15729,8 +15657,6 @@ add_executable(json_token_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -15778,8 +15704,6 @@ add_executable(jwt_verifier_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -16384,8 +16308,6 @@ add_executable(matchers_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -16755,8 +16677,6 @@ add_executable(message_compress_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -16841,8 +16761,6 @@ add_executable(metadata_map_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -17933,8 +17851,6 @@ add_executable(parser_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -18198,8 +18114,6 @@ add_executable(pid_controller_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -18247,8 +18161,6 @@ add_executable(ping_abuse_policy_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -18296,8 +18208,6 @@ add_executable(ping_configuration_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -18393,8 +18303,6 @@ add_executable(ping_rate_policy_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -19523,8 +19431,6 @@ add_executable(rbac_translator_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -19831,8 +19737,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -19883,8 +19787,6 @@ add_executable(resolve_address_using_ares_resolver_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -19934,8 +19836,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -19986,8 +19886,6 @@ add_executable(resolve_address_using_native_resolver_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -22094,8 +21992,6 @@ add_executable(secure_endpoint_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -22143,8 +22039,6 @@ add_executable(security_connector_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -22342,8 +22236,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc test/cpp/server/server_builder_test.cc third_party/googletest/googletest/src/gtest-all.cc @@ -22410,8 +22302,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc test/cpp/server/server_builder_with_socket_mutator_test.cc third_party/googletest/googletest/src/gtest-all.cc @@ -22822,8 +22712,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc test/cpp/server/server_request_call_test.cc third_party/googletest/googletest/src/gtest-all.cc @@ -23094,8 +22982,6 @@ add_executable(settings_timeout_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -23708,8 +23594,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -23831,8 +23715,6 @@ add_executable(ssl_credentials_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -24111,8 +23993,6 @@ add_executable(status_conversion_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -24236,8 +24116,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -24431,8 +24309,6 @@ add_executable(streams_not_seen_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -24592,8 +24468,6 @@ add_executable(system_roots_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -24683,8 +24557,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -24774,8 +24646,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -24825,8 +24695,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -25250,8 +25118,6 @@ add_executable(test_core_iomgr_load_file_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -25299,8 +25165,6 @@ add_executable(test_core_iomgr_timer_heap_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -25348,8 +25212,6 @@ add_executable(test_core_security_credentials_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -25957,8 +25819,6 @@ add_executable(timeout_encoding_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -26173,8 +26033,6 @@ add_executable(tls_security_connector_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -27489,8 +27347,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc test/cpp/performance/writes_per_rpc_test.cc third_party/googletest/googletest/src/gtest-all.cc @@ -28511,8 +28367,6 @@ add_executable(xds_credentials_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index da1291c235383..5b8542b7b9ca9 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -2773,7 +2773,6 @@ libs: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h - test/cpp/microbenchmarks/fullstack_context_mutators.h - test/cpp/microbenchmarks/fullstack_fixtures.h @@ -2792,8 +2791,6 @@ libs: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc - test/cpp/microbenchmarks/helpers.cc deps: @@ -3182,6 +3179,7 @@ libs: language: c++ public_headers: [] headers: + - src/core/lib/gpr/subprocess.h - test/core/end2end/data/ssl_test_data.h - test/core/util/cmdline.h - test/core/util/evaluate_args_test_util.h @@ -3194,7 +3192,6 @@ libs: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h - test/cpp/util/byte_buffer_proto_helper.h - test/cpp/util/create_test_channel.h @@ -3202,6 +3199,8 @@ libs: - test/cpp/util/subprocess.h - test/cpp/util/test_credentials_provider.h src: + - src/core/lib/gpr/subprocess_posix.cc + - src/core/lib/gpr/subprocess_windows.cc - test/core/end2end/data/client_certs.cc - test/core/end2end/data/server1_cert.cc - test/core/end2end/data/server1_key.cc @@ -3215,8 +3214,6 @@ libs: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc - test/cpp/util/byte_buffer_proto_helper.cc - test/cpp/util/create_test_channel.cc @@ -4198,7 +4195,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/fd_conservation_posix_test.cc @@ -4211,8 +4207,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -4274,7 +4268,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/timer_list_test.cc @@ -4287,8 +4280,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -4348,6 +4339,7 @@ targets: build: test language: c++ headers: + - src/core/lib/gpr/subprocess.h - test/core/util/cmdline.h - test/core/util/evaluate_args_test_util.h - test/core/util/fuzzer_util.h @@ -4359,12 +4351,13 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h - test/cpp/util/byte_buffer_proto_helper.h - test/cpp/util/string_ref_helper.h - test/cpp/util/subprocess.h src: + - src/core/lib/gpr/subprocess_posix.cc + - src/core/lib/gpr/subprocess_windows.cc - test/core/util/cmdline.cc - test/core/util/fuzzer_util.cc - test/core/util/grpc_profiler.cc @@ -4374,8 +4367,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc - test/cpp/naming/address_sorting_test.cc - test/cpp/util/byte_buffer_proto_helper.cc @@ -4423,7 +4414,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/util/cmdline.cc @@ -4435,8 +4425,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc - test/cpp/common/alarm_test.cc deps: @@ -4582,7 +4570,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/alts_security_connector_test.cc @@ -4595,8 +4582,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -4695,7 +4680,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/auth_context_test.cc @@ -4708,8 +4692,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -4740,7 +4722,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/authorization_matchers_test.cc @@ -4753,8 +4734,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -4800,7 +4779,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/aws_request_signer_test.cc @@ -4813,8 +4791,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -4889,6 +4865,7 @@ targets: build: test language: c++ headers: + - src/core/lib/gpr/subprocess.h - test/core/end2end/cq_verifier.h - test/core/util/cmdline.h - test/core/util/evaluate_args_test_util.h @@ -4901,9 +4878,10 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: + - src/core/lib/gpr/subprocess_posix.cc + - src/core/lib/gpr/subprocess_windows.cc - test/core/bad_ssl/bad_ssl_test.cc - test/core/end2end/cq_verifier.cc - test/core/util/cmdline.cc @@ -4915,8 +4893,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -4929,6 +4905,7 @@ targets: build: test language: c++ headers: + - src/core/lib/gpr/subprocess.h - test/core/end2end/cq_verifier.h - test/core/util/cmdline.h - test/core/util/evaluate_args_test_util.h @@ -4941,9 +4918,10 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: + - src/core/lib/gpr/subprocess_posix.cc + - src/core/lib/gpr/subprocess_windows.cc - test/core/bad_ssl/bad_ssl_test.cc - test/core/end2end/cq_verifier.cc - test/core/util/cmdline.cc @@ -4955,8 +4933,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -5230,7 +5206,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/buffer_list_test.cc @@ -5243,8 +5218,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -5734,7 +5707,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c @@ -5836,8 +5808,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -5950,7 +5920,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/channel_creds_registry_test.cc @@ -5963,8 +5932,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -6054,7 +6021,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/check_gcp_environment_linux_test.cc @@ -6067,8 +6033,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -6088,7 +6052,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/check_gcp_environment_windows_test.cc @@ -6101,8 +6064,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -6406,7 +6367,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/util/cmdline.cc @@ -6419,8 +6379,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -6464,7 +6422,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/combiner_test.cc @@ -6477,8 +6434,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -6601,7 +6556,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/connectivity_state_test.cc @@ -6614,8 +6568,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -7111,7 +7063,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/endpoint_pair_test.cc @@ -7125,8 +7076,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -7170,7 +7119,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/endpoint_tests.cc @@ -7184,8 +7132,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -7206,7 +7152,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/error_utils_test.cc @@ -7219,8 +7164,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -7240,7 +7183,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/evaluate_args_test.cc @@ -7253,8 +7195,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -7557,7 +7497,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/fd_posix_test.cc @@ -7570,8 +7509,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -8008,7 +7945,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/end2end/data/client_certs.cc @@ -8025,8 +7961,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -8728,7 +8662,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/grpc_alts_credentials_options_test.cc @@ -8741,8 +8674,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -8772,7 +8703,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/grpc_authorization_engine_test.cc @@ -8786,8 +8716,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -8807,7 +8735,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/grpc_authorization_policy_provider_test.cc @@ -8820,8 +8747,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_authorization_provider @@ -8955,7 +8880,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/grpc_ipv6_loopback_available_test.cc @@ -8968,8 +8892,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9029,7 +8951,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/grpc_tls_certificate_distributor_test.cc @@ -9042,8 +8963,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9063,7 +8982,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/grpc_tls_certificate_provider_test.cc @@ -9076,8 +8994,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9097,7 +9013,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/grpc_tls_certificate_verifier_test.cc @@ -9110,8 +9025,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9131,7 +9044,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/grpc_tls_credentials_options_comparator_test.cc @@ -9144,8 +9056,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9165,7 +9075,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/grpc_tls_credentials_options_test.cc @@ -9178,8 +9087,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9422,7 +9329,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/util/cmdline.cc @@ -9435,8 +9341,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9467,7 +9371,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/chttp2/hpack_encoder_test.cc @@ -9480,8 +9383,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9502,7 +9403,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/chttp2/hpack_parser_table_test.cc @@ -9515,8 +9415,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9537,7 +9435,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/chttp2/hpack_parser_test.cc @@ -9550,8 +9447,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9740,7 +9635,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/insecure_security_connector_test.cc @@ -9753,8 +9647,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -10016,7 +9908,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/json_token_test.cc @@ -10029,8 +9920,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -10051,7 +9940,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/jwt_verifier_test.cc @@ -10064,8 +9952,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -10410,7 +10296,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/matchers/matchers_test.cc @@ -10423,8 +10308,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -10623,7 +10506,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/compression/message_compress_test.cc @@ -10636,8 +10518,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -10667,7 +10547,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/metadata_map_test.cc @@ -10680,8 +10559,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -11086,7 +10963,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/end2end/data/client_certs.cc @@ -11103,8 +10979,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -11244,7 +11118,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/pid_controller_test.cc @@ -11257,8 +11130,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -11278,7 +11149,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/chttp2/ping_abuse_policy_test.cc @@ -11291,8 +11161,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -11313,7 +11181,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/chttp2/ping_configuration_test.cc @@ -11326,8 +11193,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -11383,7 +11248,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/chttp2/ping_rate_policy_test.cc @@ -11396,8 +11260,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -11857,7 +11719,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/rbac_translator_test.cc @@ -11870,8 +11731,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_authorization_provider @@ -12028,7 +11887,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/resolve_address_posix_test.cc @@ -12041,8 +11899,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - absl/flags:parse @@ -12070,7 +11926,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/resolve_address_test.cc @@ -12084,8 +11939,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -12106,7 +11959,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/resolve_address_posix_test.cc @@ -12119,8 +11971,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - absl/flags:parse @@ -12148,7 +11998,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/resolve_address_test.cc @@ -12162,8 +12011,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -13518,7 +13365,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/endpoint_tests.cc @@ -13532,8 +13378,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -13553,7 +13397,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/security_connector_test.cc @@ -13566,8 +13409,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -13630,7 +13471,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - src/proto/grpc/testing/echo.proto @@ -13646,8 +13486,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc - test/cpp/server/server_builder_test.cc deps: @@ -13673,7 +13511,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - src/proto/grpc/testing/echo.proto @@ -13689,8 +13526,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc - test/cpp/server/server_builder_with_socket_mutator_test.cc deps: @@ -13833,7 +13668,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - src/proto/grpc/testing/echo.proto @@ -13849,8 +13683,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc - test/cpp/server/server_request_call_test.cc deps: @@ -13960,7 +13792,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/chttp2/settings_timeout_test.cc @@ -13973,8 +13804,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14267,7 +14096,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/socket_utils_test.cc @@ -14280,8 +14108,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14326,7 +14152,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/ssl_credentials_test.cc @@ -14339,8 +14164,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14435,7 +14258,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/status_conversion_test.cc @@ -14448,8 +14270,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14491,7 +14311,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/end2end/cq_verifier.cc @@ -14505,8 +14324,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14593,7 +14410,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/end2end/cq_verifier.cc @@ -14607,8 +14423,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14659,7 +14473,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/system_roots_test.cc @@ -14672,8 +14485,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14710,7 +14521,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/tcp_client_posix_test.cc @@ -14723,8 +14533,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14763,7 +14571,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/endpoint_tests.cc @@ -14777,8 +14584,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14801,7 +14606,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/tcp_server_posix_test.cc @@ -14814,8 +14618,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -15001,7 +14803,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/load_file_test.cc @@ -15014,8 +14815,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -15036,7 +14835,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/timer_heap_test.cc @@ -15049,8 +14847,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -15071,7 +14867,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/credentials_test.cc @@ -15084,8 +14879,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -15285,7 +15078,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/timeout_encoding_test.cc @@ -15298,8 +15090,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -15366,7 +15156,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/tls_security_connector_test.cc @@ -15379,8 +15168,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -16091,7 +15878,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - src/proto/grpc/testing/echo.proto @@ -16107,8 +15893,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc - test/cpp/performance/writes_per_rpc_test.cc deps: @@ -16450,7 +16234,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/xds_credentials_test.cc @@ -16463,8 +16246,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util diff --git a/grpc.gyp b/grpc.gyp index 9a53deff7e9aa..38b14acf97392 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -1504,8 +1504,6 @@ 'test/core/util/passthru_endpoint.cc', 'test/core/util/resolve_localhost_ip46.cc', 'test/core/util/slice_splitter.cc', - 'test/core/util/subprocess_posix.cc', - 'test/core/util/subprocess_windows.cc', 'test/core/util/tracer_util.cc', 'test/cpp/microbenchmarks/helpers.cc', ], @@ -1646,6 +1644,8 @@ 'grpc_test_util', ], 'sources': [ + 'src/core/lib/gpr/subprocess_posix.cc', + 'src/core/lib/gpr/subprocess_windows.cc', 'test/core/end2end/data/client_certs.cc', 'test/core/end2end/data/server1_cert.cc', 'test/core/end2end/data/server1_key.cc', @@ -1659,8 +1659,6 @@ 'test/core/util/passthru_endpoint.cc', 'test/core/util/resolve_localhost_ip46.cc', 'test/core/util/slice_splitter.cc', - 'test/core/util/subprocess_posix.cc', - 'test/core/util/subprocess_windows.cc', 'test/core/util/tracer_util.cc', 'test/cpp/util/byte_buffer_proto_helper.cc', 'test/cpp/util/create_test_channel.cc', diff --git a/test/core/util/subprocess.h b/src/core/lib/gpr/subprocess.h similarity index 68% rename from test/core/util/subprocess.h rename to src/core/lib/gpr/subprocess.h index a46be258516b0..71d4796fde6f2 100644 --- a/test/core/util/subprocess.h +++ b/src/core/lib/gpr/subprocess.h @@ -16,17 +16,26 @@ // // -#ifndef GRPC_TEST_CORE_UTIL_SUBPROCESS_H -#define GRPC_TEST_CORE_UTIL_SUBPROCESS_H +#ifndef GRPC_SRC_CORE_LIB_GPR_SUBPROCESS_H +#define GRPC_SRC_CORE_LIB_GPR_SUBPROCESS_H #include +#include + typedef struct gpr_subprocess gpr_subprocess; /// .exe on windows, empty on unices const char* gpr_subprocess_binary_extension(); gpr_subprocess* gpr_subprocess_create(int argc, const char** argv); + +gpr_subprocess* gpr_subprocess_create_with_envp(int argc, const char** argv, + int envc, const char** envp); + +// communicate to the subprocess via stdin, stdout and stderr +bool gpr_subprocess_communicate(gpr_subprocess* p, std::string& input_data, + std::string* output_data, std::string* error); /// if subprocess has not been joined, kill it void gpr_subprocess_destroy(gpr_subprocess* p); /// returns exit status; can be called at most once @@ -34,4 +43,4 @@ int gpr_subprocess_join(gpr_subprocess* p); void gpr_subprocess_interrupt(gpr_subprocess* p); int gpr_subprocess_get_process_id(gpr_subprocess* p); -#endif // GRPC_TEST_CORE_UTIL_SUBPROCESS_H +#endif // GRPC_SRC_CORE_LIB_GPR_SUBPROCESS_H diff --git a/src/core/lib/gpr/subprocess_posix.cc b/src/core/lib/gpr/subprocess_posix.cc new file mode 100644 index 0000000000000..b482c440da77d --- /dev/null +++ b/src/core/lib/gpr/subprocess_posix.cc @@ -0,0 +1,266 @@ +// +// +// Copyright 2015 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#include + +#ifdef GPR_POSIX_SUBPROCESS + +#include +#include +#include +#include +#include + +#include + +#include "absl/strings/substitute.h" + +#include +#include + +#include "src/core/lib/gpr/subprocess.h" +#include "src/core/lib/gprpp/memory.h" +#include "src/core/lib/gprpp/strerror.h" + +struct gpr_subprocess { + int pid; + bool joined; + int child_stdin_; + int child_stdout_; +}; + +const char* gpr_subprocess_binary_extension() { return ""; } + +gpr_subprocess* gpr_subprocess_create(int argc, const char** argv) { + gpr_subprocess* r; + int pid; + char** exec_args; + int stdin_pipe[2]; + int stdout_pipe[2]; + int p0 = pipe(stdin_pipe); + int p1 = pipe(stdout_pipe); + GPR_ASSERT(p0 != -1); + GPR_ASSERT(p1 != -1); + pid = fork(); + if (pid == -1) { + return nullptr; + } else if (pid == 0) { + dup2(stdin_pipe[0], STDIN_FILENO); + dup2(stdout_pipe[1], STDOUT_FILENO); + close(stdin_pipe[0]); + close(stdin_pipe[1]); + close(stdout_pipe[0]); + close(stdout_pipe[1]); + exec_args = static_cast( + gpr_malloc((static_cast(argc) + 1) * sizeof(char*))); + memcpy(exec_args, argv, static_cast(argc) * sizeof(char*)); + exec_args[argc] = nullptr; + execv(exec_args[0], exec_args); + // if we reach here, an error has occurred + gpr_log(GPR_ERROR, "execv '%s' failed: %s", exec_args[0], + grpc_core::StrError(errno).c_str()); + _exit(1); + } else { + r = grpc_core::Zalloc(); + r->pid = pid; + close(stdin_pipe[0]); + close(stdout_pipe[1]); + r->child_stdin_ = stdin_pipe[1]; + r->child_stdout_ = stdout_pipe[0]; + return r; + } +} + +gpr_subprocess* gpr_subprocess_create_with_envp(int argc, const char** argv, + int envc, const char** envp) { + gpr_subprocess* r; + int pid; + char **exec_args, **envp_args; + int stdin_pipe[2]; + int stdout_pipe[2]; + int p0 = pipe(stdin_pipe); + int p1 = pipe(stdout_pipe); + GPR_ASSERT(p0 != -1); + GPR_ASSERT(p1 != -1); + pid = fork(); + if (pid == -1) { + return nullptr; + } else if (pid == 0) { + dup2(stdin_pipe[0], STDIN_FILENO); + dup2(stdout_pipe[1], STDOUT_FILENO); + close(stdin_pipe[0]); + close(stdin_pipe[1]); + close(stdout_pipe[0]); + close(stdout_pipe[1]); + exec_args = static_cast( + gpr_malloc((static_cast(argc) + 1) * sizeof(char*))); + memcpy(exec_args, argv, static_cast(argc) * sizeof(char*)); + exec_args[argc] = nullptr; + envp_args = static_cast( + gpr_malloc((static_cast(envc) + 1) * sizeof(char*))); + memcpy(envp_args, envp, static_cast(envc) * sizeof(char*)); + envp_args[envc] = nullptr; + execve(exec_args[0], exec_args, envp_args); + // if we reach here, an error has occurred + gpr_log(GPR_ERROR, "execvpe '%s' failed: %s", exec_args[0], + grpc_core::StrError(errno).c_str()); + _exit(1); + } else { + r = grpc_core::Zalloc(); + r->pid = pid; + close(stdin_pipe[0]); + close(stdout_pipe[1]); + r->child_stdin_ = stdin_pipe[1]; + r->child_stdout_ = stdout_pipe[0]; + return r; + } +} + +bool gpr_subprocess_communicate(gpr_subprocess* p, std::string& input_data, + std::string* output_data, std::string* error) { + typedef void SignalHandler(int); + + // Make sure SIGPIPE is disabled so that if the child dies it doesn't kill us. + SignalHandler* old_pipe_handler = signal(SIGPIPE, SIG_IGN); + + int input_pos = 0; + int max_fd = std::max(p->child_stdin_, p->child_stdout_); + + while (p->child_stdout_ != -1) { + fd_set read_fds; + fd_set write_fds; + FD_ZERO(&read_fds); + FD_ZERO(&write_fds); + if (p->child_stdout_ != -1) { + FD_SET(p->child_stdout_, &read_fds); + } + if (p->child_stdin_ != -1) { + FD_SET(p->child_stdin_, &write_fds); + } + + if (select(max_fd + 1, &read_fds, &write_fds, nullptr, nullptr) < 0) { + if (errno == EINTR) { + // Interrupted by signal. Try again. + continue; + } else { + std::cerr << "select: " << strerror(errno) << std::endl; + GPR_ASSERT(0); + } + } + + if (p->child_stdin_ != -1 && FD_ISSET(p->child_stdin_, &write_fds)) { + int n = write(p->child_stdin_, input_data.data() + input_pos, + input_data.size() - input_pos); + if (n < 0) { + // Child closed pipe. Presumably it will report an error later. + // Pretend we're done for now. + input_pos = input_data.size(); + } else { + input_pos += n; + } + + if (input_pos == static_cast(input_data.size())) { + // We're done writing. Close. + close(p->child_stdin_); + p->child_stdin_ = -1; + } + } + + if (p->child_stdout_ != -1 && FD_ISSET(p->child_stdout_, &read_fds)) { + char buffer[4096]; + int n = read(p->child_stdout_, buffer, sizeof(buffer)); + + if (n > 0) { + output_data->append(buffer, static_cast(n)); + } else { + // We're done reading. Close. + close(p->child_stdout_); + p->child_stdout_ = -1; + } + } + } + + if (p->child_stdin_ != -1) { + // Child did not finish reading input before it closed the output. + // Presumably it exited with an error. + close(p->child_stdin_); + p->child_stdin_ = -1; + } + + int status; + while (waitpid(p->pid, &status, 0) == -1) { + if (errno != EINTR) { + std::cerr << "waitpid: " << strerror(errno) << std::endl; + GPR_ASSERT(0); + } + } + + // Restore SIGPIPE handling. + signal(SIGPIPE, old_pipe_handler); + + if (WIFEXITED(status)) { + if (WEXITSTATUS(status) != 0) { + int error_code = WEXITSTATUS(status); + *error = + absl::Substitute("Plugin failed with status code $0.", error_code); + return false; + } + } else if (WIFSIGNALED(status)) { + int signal = WTERMSIG(status); + *error = absl::Substitute("Plugin killed by signal $0.", signal); + return false; + } else { + *error = "Neither WEXITSTATUS nor WTERMSIG is true?"; + return false; + } + + return true; +} + +void gpr_subprocess_destroy(gpr_subprocess* p) { + if (!p->joined) { + kill(p->pid, SIGKILL); + gpr_subprocess_join(p); + } + gpr_free(p); +} + +int gpr_subprocess_join(gpr_subprocess* p) { + int status; +retry: + if (waitpid(p->pid, &status, 0) == -1) { + if (errno == EINTR) { + goto retry; + } + gpr_log(GPR_ERROR, "waitpid failed for pid %d: %s", p->pid, + grpc_core::StrError(errno).c_str()); + return -1; + } + p->joined = true; + return status; +} + +void gpr_subprocess_interrupt(gpr_subprocess* p) { + if (!p->joined) { + kill(p->pid, SIGINT); + } +} + +int gpr_subprocess_get_process_id(gpr_subprocess* p) { return p->pid; } + +#endif // GPR_POSIX_SUBPROCESS diff --git a/test/core/util/subprocess_windows.cc b/src/core/lib/gpr/subprocess_windows.cc similarity index 98% rename from test/core/util/subprocess_windows.cc rename to src/core/lib/gpr/subprocess_windows.cc index b639b3ef737c7..3efadd2a9b082 100644 --- a/test/core/util/subprocess_windows.cc +++ b/src/core/lib/gpr/subprocess_windows.cc @@ -31,9 +31,9 @@ #include #include "src/core/lib/gpr/string.h" +#include "src/core/lib/gpr/subprocess.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/tchar.h" -#include "test/core/util/subprocess.h" struct gpr_subprocess { PROCESS_INFORMATION pi; diff --git a/test/core/bad_ssl/bad_ssl_test.cc b/test/core/bad_ssl/bad_ssl_test.cc index 51d5a95b63f9d..5faa7b7bc5a00 100644 --- a/test/core/bad_ssl/bad_ssl_test.cc +++ b/test/core/bad_ssl/bad_ssl_test.cc @@ -32,11 +32,11 @@ #include #include +#include "src/core/lib/gpr/subprocess.h" #include "src/core/lib/gprpp/env.h" #include "src/core/lib/gprpp/host_port.h" #include "test/core/end2end/cq_verifier.h" #include "test/core/util/port.h" -#include "test/core/util/subprocess.h" #include "test/core/util/test_config.h" static void run_test(const char* target, size_t nops) { diff --git a/test/core/bad_ssl/generate_tests.bzl b/test/core/bad_ssl/generate_tests.bzl index f2f3fcab93e4d..ecce282765afc 100755 --- a/test/core/bad_ssl/generate_tests.bzl +++ b/test/core/bad_ssl/generate_tests.bzl @@ -61,6 +61,7 @@ def grpc_bad_ssl_tests(): "//test/core/util:grpc_test_util_base", "//:gpr", "//:grpc", + "//:subprocess", "//test/core/end2end:cq_verifier", ], tags = ["no_windows"], diff --git a/test/core/event_engine/test_suite/tests/BUILD b/test/core/event_engine/test_suite/tests/BUILD index ef297860a97d9..4c187e2c5d4f4 100644 --- a/test/core/event_engine/test_suite/tests/BUILD +++ b/test/core/event_engine/test_suite/tests/BUILD @@ -68,6 +68,7 @@ grpc_cc_library( "address_sorting", ], deps = [ + "//:subprocess", "//src/core:env", "//test/core/event_engine:event_engine_test_utils", "//test/core/event_engine/test_suite:event_engine_test_framework", diff --git a/test/core/http/BUILD b/test/core/http/BUILD index 965a7a84ca99d..2495cfb1cbd3d 100644 --- a/test/core/http/BUILD +++ b/test/core/http/BUILD @@ -68,6 +68,7 @@ grpc_cc_library( hdrs = ["httpcli_test_util.h"], deps = [ "//:gpr", + "//:subprocess", "//test/core/end2end:ssl_test_data", "//test/core/util:grpc_test_util", "//test/core/util:grpc_test_util_base", @@ -90,6 +91,7 @@ grpc_cc_test( ":httpcli_test_util", "//:gpr", "//:grpc", + "//:subprocess", "//test/core/end2end:ssl_test_data", "//test/core/util:fake_udp_and_tcp_server", "//test/core/util:grpc_test_util", @@ -103,6 +105,7 @@ grpc_cc_test( data = [ "python_wrapper.sh", "test_server.py", + "//:subprocess", "//src/core/tsi/test_creds:ca.pem", "//src/core/tsi/test_creds:server1.key", "//src/core/tsi/test_creds:server1.pem", diff --git a/test/core/http/httpcli_test.cc b/test/core/http/httpcli_test.cc index 519e7fd3aaf49..98fc2c934fddf 100644 --- a/test/core/http/httpcli_test.cc +++ b/test/core/http/httpcli_test.cc @@ -44,6 +44,7 @@ #include #include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h" +#include "src/core/lib/gpr/subprocess.h" #include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/gprpp/time.h" #include "src/core/lib/gprpp/time_util.h" @@ -53,7 +54,6 @@ #include "test/core/http/httpcli_test_util.h" #include "test/core/util/fake_udp_and_tcp_server.h" #include "test/core/util/port.h" -#include "test/core/util/subprocess.h" #include "test/core/util/test_config.h" namespace { diff --git a/test/core/http/httpcli_test_util.cc b/test/core/http/httpcli_test_util.cc index 763413cc3733f..5381fb03dd380 100644 --- a/test/core/http/httpcli_test_util.cc +++ b/test/core/http/httpcli_test_util.cc @@ -32,8 +32,8 @@ #include #include "src/core/lib/config/config_vars.h" +#include "src/core/lib/gpr/subprocess.h" #include "test/core/util/port.h" -#include "test/core/util/subprocess.h" namespace grpc_core { namespace testing { diff --git a/test/core/http/httpcli_test_util.h b/test/core/http/httpcli_test_util.h index e1ecebe792620..6007a4be203b7 100644 --- a/test/core/http/httpcli_test_util.h +++ b/test/core/http/httpcli_test_util.h @@ -19,7 +19,7 @@ #include -#include "test/core/util/subprocess.h" +#include "src/core/lib/gpr/subprocess.h" namespace grpc_core { namespace testing { diff --git a/test/core/http/httpscli_test.cc b/test/core/http/httpscli_test.cc index 281ccda42698a..35da8634f7efb 100644 --- a/test/core/http/httpscli_test.cc +++ b/test/core/http/httpscli_test.cc @@ -42,6 +42,7 @@ #include #include "src/core/lib/channel/channel_args.h" +#include "src/core/lib/gpr/subprocess.h" #include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/gprpp/sync.h" @@ -60,7 +61,6 @@ #include "src/core/lib/uri/uri_parser.h" #include "test/core/http/httpcli_test_util.h" #include "test/core/util/fake_udp_and_tcp_server.h" -#include "test/core/util/subprocess.h" #include "test/core/util/test_config.h" namespace { diff --git a/test/core/memory_usage/BUILD b/test/core/memory_usage/BUILD index 41aab426c182a..cfc2880b688db 100644 --- a/test/core/memory_usage/BUILD +++ b/test/core/memory_usage/BUILD @@ -159,6 +159,7 @@ grpc_cc_test( deps = [ "//:gpr", "//:grpc", + "//:subprocess", "//test/core/util:grpc_test_util", "//test/core/util:grpc_test_util_base", ], @@ -178,6 +179,7 @@ grpc_cc_binary( deps = [ "//:gpr", "//:grpc", + "//:subprocess", "//test/core/util:grpc_test_util", "//test/core/util:grpc_test_util_base", ], diff --git a/test/core/memory_usage/memory_usage_test.cc b/test/core/memory_usage/memory_usage_test.cc index 671539654bee8..0c2c9ee2b7306 100644 --- a/test/core/memory_usage/memory_usage_test.cc +++ b/test/core/memory_usage/memory_usage_test.cc @@ -37,9 +37,9 @@ #include #include "src/core/lib/config/config_vars.h" +#include "src/core/lib/gpr/subprocess.h" #include "src/core/lib/gprpp/host_port.h" #include "test/core/util/port.h" -#include "test/core/util/subprocess.h" #include "test/core/util/test_config.h" ABSL_FLAG(std::string, benchmark_names, "call,channel", diff --git a/test/core/util/BUILD b/test/core/util/BUILD index 2b88fd11f5884..e520da58a06a1 100644 --- a/test/core/util/BUILD +++ b/test/core/util/BUILD @@ -59,8 +59,6 @@ grpc_cc_library( "passthru_endpoint.cc", "resolve_localhost_ip46.cc", "slice_splitter.cc", - "subprocess_posix.cc", - "subprocess_windows.cc", "tracer_util.cc", ], hdrs = [ @@ -75,7 +73,6 @@ grpc_cc_library( "passthru_endpoint.h", "resolve_localhost_ip46.h", "slice_splitter.h", - "subprocess.h", "tracer_util.h", ], external_deps = [ diff --git a/test/core/util/subprocess_posix.cc b/test/core/util/subprocess_posix.cc deleted file mode 100644 index 1b97df0d26d66..0000000000000 --- a/test/core/util/subprocess_posix.cc +++ /dev/null @@ -1,101 +0,0 @@ -// -// -// Copyright 2015 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// - -#include - -#include - -#ifdef GPR_POSIX_SUBPROCESS - -#include -#include -#include -#include -#include - -#include -#include - -#include "src/core/lib/gprpp/memory.h" -#include "src/core/lib/gprpp/strerror.h" -#include "test/core/util/subprocess.h" - -struct gpr_subprocess { - int pid; - bool joined; -}; - -const char* gpr_subprocess_binary_extension() { return ""; } - -gpr_subprocess* gpr_subprocess_create(int argc, const char** argv) { - gpr_subprocess* r; - int pid; - char** exec_args; - - pid = fork(); - if (pid == -1) { - return nullptr; - } else if (pid == 0) { - exec_args = static_cast( - gpr_malloc((static_cast(argc) + 1) * sizeof(char*))); - memcpy(exec_args, argv, static_cast(argc) * sizeof(char*)); - exec_args[argc] = nullptr; - execv(exec_args[0], exec_args); - // if we reach here, an error has occurred - gpr_log(GPR_ERROR, "execv '%s' failed: %s", exec_args[0], - grpc_core::StrError(errno).c_str()); - _exit(1); - } else { - r = grpc_core::Zalloc(); - r->pid = pid; - return r; - } -} - -void gpr_subprocess_destroy(gpr_subprocess* p) { - if (!p->joined) { - kill(p->pid, SIGKILL); - gpr_subprocess_join(p); - } - gpr_free(p); -} - -int gpr_subprocess_join(gpr_subprocess* p) { - int status; -retry: - if (waitpid(p->pid, &status, 0) == -1) { - if (errno == EINTR) { - goto retry; - } - gpr_log(GPR_ERROR, "waitpid failed for pid %d: %s", p->pid, - grpc_core::StrError(errno).c_str()); - return -1; - } - p->joined = true; - return status; -} - -void gpr_subprocess_interrupt(gpr_subprocess* p) { - if (!p->joined) { - kill(p->pid, SIGINT); - } -} - -int gpr_subprocess_get_process_id(gpr_subprocess* p) { return p->pid; } - -#endif // GPR_POSIX_SUBPROCESS diff --git a/test/cpp/util/BUILD b/test/cpp/util/BUILD index d8aed93aa50fe..e4b98dc1ec28a 100644 --- a/test/cpp/util/BUILD +++ b/test/cpp/util/BUILD @@ -80,6 +80,7 @@ grpc_cc_library( ], deps = [ "//:grpc++", + "//:subprocess", "//test/core/end2end:ssl_test_data", "//test/core/util:grpc_test_util", "//test/core/util:grpc_test_util_base", @@ -114,6 +115,7 @@ grpc_cc_library( ], deps = [ "//:grpc++_unsecure", + "//:subprocess", "//test/core/util:grpc_test_util_base", "//test/core/util:grpc_test_util_unsecure", ], diff --git a/test/cpp/util/subprocess.cc b/test/cpp/util/subprocess.cc index 1cd7fbd44a40e..2f0c9cd03b209 100644 --- a/test/cpp/util/subprocess.cc +++ b/test/cpp/util/subprocess.cc @@ -20,7 +20,7 @@ #include -#include "test/core/util/subprocess.h" +#include "src/core/lib/gpr/subprocess.h" namespace grpc { From e0b51886be667c191a93885c98102872aa2b922f Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 2 Aug 2023 13:38:14 -0700 Subject: [PATCH 113/205] [binder] Ensure flags are filled in by transport (#33966) --- src/core/ext/transport/binder/transport/binder_transport.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/ext/transport/binder/transport/binder_transport.cc b/src/core/ext/transport/binder/transport/binder_transport.cc index 0420e96b18445..ce27943d24844 100644 --- a/src/core/ext/transport/binder/transport/binder_transport.cc +++ b/src/core/ext/transport/binder/transport/binder_transport.cc @@ -505,6 +505,9 @@ static void perform_stream_op_locked(void* stream_op, gbs->recv_message = op->payload->recv_message.recv_message; gbs->call_failed_before_recv_message = op->payload->recv_message.call_failed_before_recv_message; + if (op->payload->recv_message.flags != nullptr) { + *op->payload->recv_message.flags = 0; + } GRPC_BINDER_STREAM_REF(gbs, "recv_message"); gbt->transport_stream_receiver->RegisterRecvMessage( tx_code, [tx_code, gbs, gbt](absl::StatusOr message) { From 7e63a2f3820e8857572aed246f398ce2d8193049 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Wed, 2 Aug 2023 16:23:01 -0700 Subject: [PATCH 114/205] [GSM] Some initial structure (#33952) --- src/cpp/ext/gsm/BUILD | 52 +++++++++++++++ src/cpp/ext/gsm/gsm_observability.cc | 59 +++++++++++++++++ src/cpp/ext/gsm/gsm_observability.h | 64 +++++++++++++++++++ test/cpp/ext/gsm/BUILD | 41 ++++++++++++ test/cpp/ext/gsm/gsm_observability_test.cc | 43 +++++++++++++ .../extract_metadata_from_bazel_xml.py | 5 +- tools/distrib/fix_build_deps.py | 3 +- tools/distrib/iwyu.sh | 1 + 8 files changed, 266 insertions(+), 2 deletions(-) create mode 100644 src/cpp/ext/gsm/BUILD create mode 100644 src/cpp/ext/gsm/gsm_observability.cc create mode 100644 src/cpp/ext/gsm/gsm_observability.h create mode 100644 test/cpp/ext/gsm/BUILD create mode 100644 test/cpp/ext/gsm/gsm_observability_test.cc diff --git a/src/cpp/ext/gsm/BUILD b/src/cpp/ext/gsm/BUILD new file mode 100644 index 0000000000000..658c7cebc88e4 --- /dev/null +++ b/src/cpp/ext/gsm/BUILD @@ -0,0 +1,52 @@ +# gRPC Bazel BUILD file. +# +# Copyright 2023 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load( + "//bazel:grpc_build_system.bzl", + "grpc_cc_library", +) + +licenses(["reciprocal"]) + +package( + default_visibility = ["//visibility:public"], + features = [ + "layering_check", + ], +) + +grpc_cc_library( + name = "gsm_observability", + srcs = [ + "gsm_observability.cc", + ], + hdrs = [ + "gsm_observability.h", + ], + external_deps = [ + "absl/container:flat_hash_set", + "absl/status", + "absl/status:statusor", + "absl/strings", + "otel/sdk/src/metrics", + ], + language = "c++", + visibility = ["//:__subpackages__"], + deps = [ + "//:gpr_platform", + "//src/cpp/ext/otel:otel_plugin", + ], +) diff --git a/src/cpp/ext/gsm/gsm_observability.cc b/src/cpp/ext/gsm/gsm_observability.cc new file mode 100644 index 0000000000000..370c2b446d6b2 --- /dev/null +++ b/src/cpp/ext/gsm/gsm_observability.cc @@ -0,0 +1,59 @@ +// +// +// Copyright 2023 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#include + +#include "src/cpp/ext/gsm/gsm_observability.h" + +#include "absl/status/status.h" + +#include "src/cpp/ext/otel/otel_plugin.h" + +namespace grpc { +namespace internal { + +// +// GsmCustomObservabilityBuilder +// + +GsmCustomObservabilityBuilder& GsmCustomObservabilityBuilder::SetMeterProvider( + std::shared_ptr + meter_provider) { + builder_.SetMeterProvider(meter_provider); + return *this; +} + +GsmCustomObservabilityBuilder& GsmCustomObservabilityBuilder::EnableMetrics( + const absl::flat_hash_set& metric_names) { + builder_.EnableMetrics(metric_names); + return *this; +} + +GsmCustomObservabilityBuilder& GsmCustomObservabilityBuilder::DisableMetrics( + const absl::flat_hash_set& metric_names) { + builder_.DisableMetrics(metric_names); + return *this; +} + +absl::StatusOr +GsmCustomObservabilityBuilder::BuildAndRegister() { + return absl::UnimplementedError("Not Implemented"); +} + +} // namespace internal +} // namespace grpc diff --git a/src/cpp/ext/gsm/gsm_observability.h b/src/cpp/ext/gsm/gsm_observability.h new file mode 100644 index 0000000000000..812ed2452b8e1 --- /dev/null +++ b/src/cpp/ext/gsm/gsm_observability.h @@ -0,0 +1,64 @@ +// +// +// Copyright 2023 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#ifndef GRPC_SRC_CPP_EXT_GSM_GSM_OBSERVABILITY_H +#define GRPC_SRC_CPP_EXT_GSM_GSM_OBSERVABILITY_H + +#include + +#include + +#include "absl/container/flat_hash_set.h" +#include "absl/status/statusor.h" +#include "absl/strings/string_view.h" +#include "opentelemetry/sdk/metrics/meter_provider.h" + +#include "src/cpp/ext/otel/otel_plugin.h" + +namespace grpc { +namespace internal { + +class GsmObservability {}; + +class GsmCustomObservabilityBuilder { + public: + // TODO(yashykt): Should this take the SDK or the API MeterProvider? Benefit + // of SDK MeterProvider - Can explicitly set histogram bucket boundaries, but + // in the next iteration of the API, we would have it there as well. + GsmCustomObservabilityBuilder& SetMeterProvider( + std::shared_ptr + meter_provider); + // Enable metrics in \a metric_names + GsmCustomObservabilityBuilder& EnableMetrics( + const absl::flat_hash_set& metric_names); + // Disable metrics in \a metric_names + GsmCustomObservabilityBuilder& DisableMetrics( + const absl::flat_hash_set& metric_names); + // Builds the GsmObservability plugin. The return status shows whether + // GsmObservability was successfully enabled or not. TODO(): Is the + // GsmObservability object useful? + absl::StatusOr BuildAndRegister(); + + private: + OpenTelemetryPluginBuilder builder_; +}; + +} // namespace internal +} // namespace grpc + +#endif // GRPC_SRC_CPP_EXT_GSM_GSM_OBSERVABILITY_H diff --git a/test/cpp/ext/gsm/BUILD b/test/cpp/ext/gsm/BUILD new file mode 100644 index 0000000000000..fc96886fc5881 --- /dev/null +++ b/test/cpp/ext/gsm/BUILD @@ -0,0 +1,41 @@ +# Copyright 2023 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_package") + +licenses(["notice"]) + +grpc_package( + name = "test/cpp/ext/gsm", + visibility = "tests", +) + +grpc_cc_test( + name = "gsm_observability_test", + srcs = [ + "gsm_observability_test.cc", + ], + external_deps = [ + "gtest", + "otel/sdk/src/metrics", + ], + language = "C++", + tags = [ + ], + deps = [ + "//:grpc++", + "//src/cpp/ext/gsm:gsm_observability", + "//test/core/util:grpc_test_util", + ], +) diff --git a/test/cpp/ext/gsm/gsm_observability_test.cc b/test/cpp/ext/gsm/gsm_observability_test.cc new file mode 100644 index 0000000000000..2530149d0ded9 --- /dev/null +++ b/test/cpp/ext/gsm/gsm_observability_test.cc @@ -0,0 +1,43 @@ +// +// +// Copyright 2023 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#include "src/cpp/ext/gsm/gsm_observability.h" + +#include "gtest/gtest.h" + +#include "test/core/util/test_config.h" + +namespace grpc { +namespace testing { +namespace { + +TEST(GsmCustomObservabilityBuilderTest, Basic) { + EXPECT_EQ( + internal::GsmCustomObservabilityBuilder().BuildAndRegister().status(), + absl::UnimplementedError("Not Implemented")); +} + +} // namespace +} // namespace testing +} // namespace grpc + +int main(int argc, char** argv) { + grpc::testing::TestEnvironment env(&argc, argv); + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/tools/buildgen/extract_metadata_from_bazel_xml.py b/tools/buildgen/extract_metadata_from_bazel_xml.py index 55b1dd467db50..348a81c2bbaaa 100755 --- a/tools/buildgen/extract_metadata_from_bazel_xml.py +++ b/tools/buildgen/extract_metadata_from_bazel_xml.py @@ -738,7 +738,10 @@ def _exclude_unwanted_cc_tests(tests: List[str]) -> List[str]: # we have not added otel dependency outside of bazel tests = [ - test for test in tests if not test.startswith("test/cpp/ext/otel:") + test + for test in tests + if not test.startswith("test/cpp/ext/otel:") + and not test.startswith("test/cpp/ext/gsm:") ] # missing opencensus/stats/stats.h diff --git a/tools/distrib/fix_build_deps.py b/tools/distrib/fix_build_deps.py index 5350fade9fb90..7511ca232fd4c 100755 --- a/tools/distrib/fix_build_deps.py +++ b/tools/distrib/fix_build_deps.py @@ -100,7 +100,7 @@ "opentelemetry/metrics/sync_instruments.h": "otel/api", "opentelemetry/nostd/shared_ptr.h": "otel/api", "opentelemetry/nostd/unique_ptr.h": "otel/api", - "sdk/include/opentelemetry/sdk/metrics/meter_provider.h": "otel/sdk/src/metrics", + "opentelemetry/sdk/metrics/meter_provider.h": "otel/sdk/src/metrics", "ares.h": "cares", "fuzztest/fuzztest.h": ["fuzztest", "fuzztest_main"], "google/api/monitored_resource.pb.h": ( @@ -379,6 +379,7 @@ def score_best(proposed, existing): "", "src/core", "src/cpp/ext/gcp", + "src/cpp/ext/gsm", "src/cpp/ext/otel", "test/core/backoff", "test/core/experiments", diff --git a/tools/distrib/iwyu.sh b/tools/distrib/iwyu.sh index 11ade96b7520e..bf7e65cfb6c1e 100755 --- a/tools/distrib/iwyu.sh +++ b/tools/distrib/iwyu.sh @@ -32,6 +32,7 @@ tools/distrib/gen_compilation_database.py \ --dedup_targets \ "//:*" \ "//src/core/..." \ + "//src/cpp/ext/gsm/..." \ "//src/cpp/ext/otel/..." \ "//src/compiler/..." \ "//test/core/..." \ From 5325b65d84cffb235b0cc50738466418b0556c6c Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 2 Aug 2023 20:40:12 -0700 Subject: [PATCH 115/205] Revert "[core/gpr] move subprocess to gpr" (#33972) Reverts grpc/grpc#33870 - since it breaks memory usage tooling. --- BUILD | 20 -- CMakeLists.txt | 162 ++++++++++- build_autogenerated.yaml | 243 +++++++++++++++- grpc.gyp | 6 +- src/core/lib/gpr/subprocess_posix.cc | 266 ------------------ test/core/bad_ssl/bad_ssl_test.cc | 2 +- test/core/bad_ssl/generate_tests.bzl | 1 - test/core/event_engine/test_suite/tests/BUILD | 1 - test/core/http/BUILD | 3 - test/core/http/httpcli_test.cc | 2 +- test/core/http/httpcli_test_util.cc | 2 +- test/core/http/httpcli_test_util.h | 2 +- test/core/http/httpscli_test.cc | 2 +- test/core/memory_usage/BUILD | 2 - test/core/memory_usage/memory_usage_test.cc | 2 +- test/core/util/BUILD | 3 + .../lib/gpr => test/core/util}/subprocess.h | 15 +- test/core/util/subprocess_posix.cc | 101 +++++++ .../core/util}/subprocess_windows.cc | 2 +- test/cpp/util/BUILD | 2 - test/cpp/util/subprocess.cc | 2 +- 21 files changed, 504 insertions(+), 337 deletions(-) delete mode 100644 src/core/lib/gpr/subprocess_posix.cc rename {src/core/lib/gpr => test/core/util}/subprocess.h (68%) create mode 100644 test/core/util/subprocess_posix.cc rename {src/core/lib/gpr => test/core/util}/subprocess_windows.cc (98%) diff --git a/BUILD b/BUILD index a1a9c395447c8..1b1a4ef5081dd 100644 --- a/BUILD +++ b/BUILD @@ -4000,26 +4000,6 @@ grpc_cc_library( ], ) -grpc_cc_library( - name = "subprocess", - srcs = [ - "//src/core:lib/gpr/subprocess_posix.cc", - "//src/core:lib/gpr/subprocess_windows.cc", - ], - hdrs = [ - "//src/core:lib/gpr/subprocess.h", - ], - external_deps = [ - "absl/strings", - "absl/types:span", - ], - deps = [ - "gpr", - "//src/core:strerror", - "//src/core:tchar", - ], -) - # TODO(yashykt): Remove the UPB definitions from here once they are no longer needed ### UPB Targets diff --git a/CMakeLists.txt b/CMakeLists.txt index f2b7f516196ae..0392d45656177 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3281,6 +3281,8 @@ add_library(benchmark_helpers test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc test/cpp/microbenchmarks/helpers.cc ) @@ -3998,8 +4000,6 @@ endif() if(gRPC_BUILD_TESTS) add_library(grpc++_test_util - src/core/lib/gpr/subprocess_posix.cc - src/core/lib/gpr/subprocess_windows.cc test/core/end2end/data/client_certs.cc test/core/end2end/data/server1_cert.cc test/core/end2end/data/server1_key.cc @@ -4013,6 +4013,8 @@ add_library(grpc++_test_util test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc test/cpp/util/byte_buffer_proto_helper.cc test/cpp/util/create_test_channel.cc @@ -5033,6 +5035,8 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc ) target_compile_features(fd_conservation_posix_test PUBLIC cxx_std_14) @@ -5168,6 +5172,8 @@ add_executable(test_core_iomgr_timer_list_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc ) target_compile_features(test_core_iomgr_timer_list_test PUBLIC cxx_std_14) @@ -5281,8 +5287,6 @@ if(gRPC_BUILD_TESTS) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_executable(address_sorting_test_unsecure - src/core/lib/gpr/subprocess_posix.cc - src/core/lib/gpr/subprocess_windows.cc test/core/util/cmdline.cc test/core/util/fuzzer_util.cc test/core/util/grpc_profiler.cc @@ -5292,6 +5296,8 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc test/cpp/naming/address_sorting_test.cc test/cpp/util/byte_buffer_proto_helper.cc @@ -5403,6 +5409,8 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc test/cpp/common/alarm_test.cc third_party/googletest/googletest/src/gtest-all.cc @@ -5845,6 +5853,8 @@ add_executable(alts_security_connector_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -6179,6 +6189,8 @@ add_executable(auth_context_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -6263,6 +6275,8 @@ add_executable(authorization_matchers_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -6387,6 +6401,8 @@ add_executable(aws_request_signer_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -6585,8 +6601,6 @@ if(gRPC_BUILD_TESTS) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_executable(bad_ssl_alpn_test - src/core/lib/gpr/subprocess_posix.cc - src/core/lib/gpr/subprocess_windows.cc test/core/bad_ssl/bad_ssl_test.cc test/core/end2end/cq_verifier.cc test/core/util/cmdline.cc @@ -6598,6 +6612,8 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -6637,8 +6653,6 @@ if(gRPC_BUILD_TESTS) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_executable(bad_ssl_cert_test - src/core/lib/gpr/subprocess_posix.cc - src/core/lib/gpr/subprocess_windows.cc test/core/bad_ssl/bad_ssl_test.cc test/core/end2end/cq_verifier.cc test/core/util/cmdline.cc @@ -6650,6 +6664,8 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -7205,6 +7221,8 @@ add_executable(buffer_list_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -7963,6 +7981,8 @@ add_executable(cel_authorization_engine_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -8297,6 +8317,8 @@ add_executable(channel_creds_registry_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -8592,6 +8614,8 @@ add_executable(check_gcp_environment_linux_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -8639,6 +8663,8 @@ add_executable(check_gcp_environment_windows_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -9280,6 +9306,8 @@ add_executable(cmdline_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -9404,6 +9432,8 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -9726,6 +9756,8 @@ add_executable(connectivity_state_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -10787,6 +10819,8 @@ add_executable(endpoint_pair_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -10922,6 +10956,8 @@ add_executable(error_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -10969,6 +11005,8 @@ add_executable(error_utils_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -11016,6 +11054,8 @@ add_executable(evaluate_args_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -11584,6 +11624,8 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -12239,6 +12281,8 @@ add_executable(format_request_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -12922,6 +12966,8 @@ add_executable(grpc_alts_credentials_options_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -13007,6 +13053,8 @@ add_executable(grpc_authorization_engine_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -13054,6 +13102,8 @@ add_executable(grpc_authorization_policy_provider_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -13413,6 +13463,8 @@ add_executable(grpc_ipv6_loopback_available_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -13670,6 +13722,8 @@ add_executable(grpc_tls_certificate_distributor_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -13717,6 +13771,8 @@ add_executable(grpc_tls_certificate_provider_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -13764,6 +13820,8 @@ add_executable(grpc_tls_certificate_verifier_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -13811,6 +13869,8 @@ add_executable(grpc_tls_credentials_options_comparator_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -13858,6 +13918,8 @@ add_executable(grpc_tls_credentials_options_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -14462,6 +14524,8 @@ add_executable(histogram_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -14546,6 +14610,8 @@ add_executable(hpack_encoder_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -14593,6 +14659,8 @@ add_executable(hpack_parser_table_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -14640,6 +14708,8 @@ add_executable(hpack_parser_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -15150,6 +15220,8 @@ add_executable(insecure_security_connector_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -15657,6 +15729,8 @@ add_executable(json_token_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -15704,6 +15778,8 @@ add_executable(jwt_verifier_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -16308,6 +16384,8 @@ add_executable(matchers_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -16677,6 +16755,8 @@ add_executable(message_compress_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -16761,6 +16841,8 @@ add_executable(metadata_map_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -17851,6 +17933,8 @@ add_executable(parser_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -18114,6 +18198,8 @@ add_executable(pid_controller_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -18161,6 +18247,8 @@ add_executable(ping_abuse_policy_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -18208,6 +18296,8 @@ add_executable(ping_configuration_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -18303,6 +18393,8 @@ add_executable(ping_rate_policy_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -19431,6 +19523,8 @@ add_executable(rbac_translator_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -19737,6 +19831,8 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -19787,6 +19883,8 @@ add_executable(resolve_address_using_ares_resolver_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -19836,6 +19934,8 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -19886,6 +19986,8 @@ add_executable(resolve_address_using_native_resolver_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -21992,6 +22094,8 @@ add_executable(secure_endpoint_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -22039,6 +22143,8 @@ add_executable(security_connector_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -22236,6 +22342,8 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc test/cpp/server/server_builder_test.cc third_party/googletest/googletest/src/gtest-all.cc @@ -22302,6 +22410,8 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc test/cpp/server/server_builder_with_socket_mutator_test.cc third_party/googletest/googletest/src/gtest-all.cc @@ -22712,6 +22822,8 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc test/cpp/server/server_request_call_test.cc third_party/googletest/googletest/src/gtest-all.cc @@ -22982,6 +23094,8 @@ add_executable(settings_timeout_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -23594,6 +23708,8 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -23715,6 +23831,8 @@ add_executable(ssl_credentials_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -23993,6 +24111,8 @@ add_executable(status_conversion_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -24116,6 +24236,8 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -24309,6 +24431,8 @@ add_executable(streams_not_seen_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -24468,6 +24592,8 @@ add_executable(system_roots_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -24557,6 +24683,8 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -24646,6 +24774,8 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -24695,6 +24825,8 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -25118,6 +25250,8 @@ add_executable(test_core_iomgr_load_file_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -25165,6 +25299,8 @@ add_executable(test_core_iomgr_timer_heap_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -25212,6 +25348,8 @@ add_executable(test_core_security_credentials_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -25819,6 +25957,8 @@ add_executable(timeout_encoding_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -26033,6 +26173,8 @@ add_executable(tls_security_connector_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -27347,6 +27489,8 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc test/cpp/performance/writes_per_rpc_test.cc third_party/googletest/googletest/src/gtest-all.cc @@ -28367,6 +28511,8 @@ add_executable(xds_credentials_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc + test/core/util/subprocess_posix.cc + test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 5b8542b7b9ca9..da1291c235383 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -2773,6 +2773,7 @@ libs: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h - test/cpp/microbenchmarks/fullstack_context_mutators.h - test/cpp/microbenchmarks/fullstack_fixtures.h @@ -2791,6 +2792,8 @@ libs: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc - test/cpp/microbenchmarks/helpers.cc deps: @@ -3179,7 +3182,6 @@ libs: language: c++ public_headers: [] headers: - - src/core/lib/gpr/subprocess.h - test/core/end2end/data/ssl_test_data.h - test/core/util/cmdline.h - test/core/util/evaluate_args_test_util.h @@ -3192,6 +3194,7 @@ libs: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h - test/cpp/util/byte_buffer_proto_helper.h - test/cpp/util/create_test_channel.h @@ -3199,8 +3202,6 @@ libs: - test/cpp/util/subprocess.h - test/cpp/util/test_credentials_provider.h src: - - src/core/lib/gpr/subprocess_posix.cc - - src/core/lib/gpr/subprocess_windows.cc - test/core/end2end/data/client_certs.cc - test/core/end2end/data/server1_cert.cc - test/core/end2end/data/server1_key.cc @@ -3214,6 +3215,8 @@ libs: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc - test/cpp/util/byte_buffer_proto_helper.cc - test/cpp/util/create_test_channel.cc @@ -4195,6 +4198,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/fd_conservation_posix_test.cc @@ -4207,6 +4211,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -4268,6 +4274,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/timer_list_test.cc @@ -4280,6 +4287,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -4339,7 +4348,6 @@ targets: build: test language: c++ headers: - - src/core/lib/gpr/subprocess.h - test/core/util/cmdline.h - test/core/util/evaluate_args_test_util.h - test/core/util/fuzzer_util.h @@ -4351,13 +4359,12 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h - test/cpp/util/byte_buffer_proto_helper.h - test/cpp/util/string_ref_helper.h - test/cpp/util/subprocess.h src: - - src/core/lib/gpr/subprocess_posix.cc - - src/core/lib/gpr/subprocess_windows.cc - test/core/util/cmdline.cc - test/core/util/fuzzer_util.cc - test/core/util/grpc_profiler.cc @@ -4367,6 +4374,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc - test/cpp/naming/address_sorting_test.cc - test/cpp/util/byte_buffer_proto_helper.cc @@ -4414,6 +4423,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/util/cmdline.cc @@ -4425,6 +4435,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc - test/cpp/common/alarm_test.cc deps: @@ -4570,6 +4582,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/alts_security_connector_test.cc @@ -4582,6 +4595,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -4680,6 +4695,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/auth_context_test.cc @@ -4692,6 +4708,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -4722,6 +4740,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/authorization_matchers_test.cc @@ -4734,6 +4753,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -4779,6 +4800,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/aws_request_signer_test.cc @@ -4791,6 +4813,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -4865,7 +4889,6 @@ targets: build: test language: c++ headers: - - src/core/lib/gpr/subprocess.h - test/core/end2end/cq_verifier.h - test/core/util/cmdline.h - test/core/util/evaluate_args_test_util.h @@ -4878,10 +4901,9 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - - src/core/lib/gpr/subprocess_posix.cc - - src/core/lib/gpr/subprocess_windows.cc - test/core/bad_ssl/bad_ssl_test.cc - test/core/end2end/cq_verifier.cc - test/core/util/cmdline.cc @@ -4893,6 +4915,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -4905,7 +4929,6 @@ targets: build: test language: c++ headers: - - src/core/lib/gpr/subprocess.h - test/core/end2end/cq_verifier.h - test/core/util/cmdline.h - test/core/util/evaluate_args_test_util.h @@ -4918,10 +4941,9 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - - src/core/lib/gpr/subprocess_posix.cc - - src/core/lib/gpr/subprocess_windows.cc - test/core/bad_ssl/bad_ssl_test.cc - test/core/end2end/cq_verifier.cc - test/core/util/cmdline.cc @@ -4933,6 +4955,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -5206,6 +5230,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/buffer_list_test.cc @@ -5218,6 +5243,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -5707,6 +5734,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c @@ -5808,6 +5836,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -5920,6 +5950,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/channel_creds_registry_test.cc @@ -5932,6 +5963,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -6021,6 +6054,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/check_gcp_environment_linux_test.cc @@ -6033,6 +6067,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -6052,6 +6088,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/check_gcp_environment_windows_test.cc @@ -6064,6 +6101,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -6367,6 +6406,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/util/cmdline.cc @@ -6379,6 +6419,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -6422,6 +6464,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/combiner_test.cc @@ -6434,6 +6477,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -6556,6 +6601,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/connectivity_state_test.cc @@ -6568,6 +6614,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -7063,6 +7111,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/endpoint_pair_test.cc @@ -7076,6 +7125,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -7119,6 +7170,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/endpoint_tests.cc @@ -7132,6 +7184,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -7152,6 +7206,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/error_utils_test.cc @@ -7164,6 +7219,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -7183,6 +7240,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/evaluate_args_test.cc @@ -7195,6 +7253,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -7497,6 +7557,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/fd_posix_test.cc @@ -7509,6 +7570,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -7945,6 +8008,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/end2end/data/client_certs.cc @@ -7961,6 +8025,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -8662,6 +8728,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/grpc_alts_credentials_options_test.cc @@ -8674,6 +8741,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -8703,6 +8772,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/grpc_authorization_engine_test.cc @@ -8716,6 +8786,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -8735,6 +8807,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/grpc_authorization_policy_provider_test.cc @@ -8747,6 +8820,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_authorization_provider @@ -8880,6 +8955,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/grpc_ipv6_loopback_available_test.cc @@ -8892,6 +8968,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -8951,6 +9029,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/grpc_tls_certificate_distributor_test.cc @@ -8963,6 +9042,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -8982,6 +9063,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/grpc_tls_certificate_provider_test.cc @@ -8994,6 +9076,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9013,6 +9097,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/grpc_tls_certificate_verifier_test.cc @@ -9025,6 +9110,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9044,6 +9131,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/grpc_tls_credentials_options_comparator_test.cc @@ -9056,6 +9144,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9075,6 +9165,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/grpc_tls_credentials_options_test.cc @@ -9087,6 +9178,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9329,6 +9422,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/util/cmdline.cc @@ -9341,6 +9435,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9371,6 +9467,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/chttp2/hpack_encoder_test.cc @@ -9383,6 +9480,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9403,6 +9502,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/chttp2/hpack_parser_table_test.cc @@ -9415,6 +9515,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9435,6 +9537,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/chttp2/hpack_parser_test.cc @@ -9447,6 +9550,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9635,6 +9740,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/insecure_security_connector_test.cc @@ -9647,6 +9753,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9908,6 +10016,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/json_token_test.cc @@ -9920,6 +10029,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9940,6 +10051,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/jwt_verifier_test.cc @@ -9952,6 +10064,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -10296,6 +10410,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/matchers/matchers_test.cc @@ -10308,6 +10423,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -10506,6 +10623,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/compression/message_compress_test.cc @@ -10518,6 +10636,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -10547,6 +10667,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/metadata_map_test.cc @@ -10559,6 +10680,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -10963,6 +11086,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/end2end/data/client_certs.cc @@ -10979,6 +11103,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -11118,6 +11244,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/pid_controller_test.cc @@ -11130,6 +11257,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -11149,6 +11278,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/chttp2/ping_abuse_policy_test.cc @@ -11161,6 +11291,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -11181,6 +11313,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/chttp2/ping_configuration_test.cc @@ -11193,6 +11326,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -11248,6 +11383,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/chttp2/ping_rate_policy_test.cc @@ -11260,6 +11396,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -11719,6 +11857,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/rbac_translator_test.cc @@ -11731,6 +11870,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_authorization_provider @@ -11887,6 +12028,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/resolve_address_posix_test.cc @@ -11899,6 +12041,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - absl/flags:parse @@ -11926,6 +12070,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/resolve_address_test.cc @@ -11939,6 +12084,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -11959,6 +12106,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/resolve_address_posix_test.cc @@ -11971,6 +12119,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - absl/flags:parse @@ -11998,6 +12148,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/resolve_address_test.cc @@ -12011,6 +12162,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -13365,6 +13518,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/endpoint_tests.cc @@ -13378,6 +13532,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -13397,6 +13553,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/security_connector_test.cc @@ -13409,6 +13566,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -13471,6 +13630,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - src/proto/grpc/testing/echo.proto @@ -13486,6 +13646,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc - test/cpp/server/server_builder_test.cc deps: @@ -13511,6 +13673,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - src/proto/grpc/testing/echo.proto @@ -13526,6 +13689,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc - test/cpp/server/server_builder_with_socket_mutator_test.cc deps: @@ -13668,6 +13833,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - src/proto/grpc/testing/echo.proto @@ -13683,6 +13849,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc - test/cpp/server/server_request_call_test.cc deps: @@ -13792,6 +13960,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/chttp2/settings_timeout_test.cc @@ -13804,6 +13973,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14096,6 +14267,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/socket_utils_test.cc @@ -14108,6 +14280,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14152,6 +14326,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/ssl_credentials_test.cc @@ -14164,6 +14339,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14258,6 +14435,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/status_conversion_test.cc @@ -14270,6 +14448,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14311,6 +14491,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/end2end/cq_verifier.cc @@ -14324,6 +14505,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14410,6 +14593,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/end2end/cq_verifier.cc @@ -14423,6 +14607,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14473,6 +14659,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/system_roots_test.cc @@ -14485,6 +14672,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14521,6 +14710,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/tcp_client_posix_test.cc @@ -14533,6 +14723,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14571,6 +14763,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/endpoint_tests.cc @@ -14584,6 +14777,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14606,6 +14801,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/tcp_server_posix_test.cc @@ -14618,6 +14814,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14803,6 +15001,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/load_file_test.cc @@ -14815,6 +15014,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14835,6 +15036,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/timer_heap_test.cc @@ -14847,6 +15049,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14867,6 +15071,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/credentials_test.cc @@ -14879,6 +15084,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -15078,6 +15285,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/timeout_encoding_test.cc @@ -15090,6 +15298,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -15156,6 +15366,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/tls_security_connector_test.cc @@ -15168,6 +15379,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -15878,6 +16091,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - src/proto/grpc/testing/echo.proto @@ -15893,6 +16107,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc - test/cpp/performance/writes_per_rpc_test.cc deps: @@ -16234,6 +16450,7 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h + - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/xds_credentials_test.cc @@ -16246,6 +16463,8 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc + - test/core/util/subprocess_posix.cc + - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util diff --git a/grpc.gyp b/grpc.gyp index 38b14acf97392..9a53deff7e9aa 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -1504,6 +1504,8 @@ 'test/core/util/passthru_endpoint.cc', 'test/core/util/resolve_localhost_ip46.cc', 'test/core/util/slice_splitter.cc', + 'test/core/util/subprocess_posix.cc', + 'test/core/util/subprocess_windows.cc', 'test/core/util/tracer_util.cc', 'test/cpp/microbenchmarks/helpers.cc', ], @@ -1644,8 +1646,6 @@ 'grpc_test_util', ], 'sources': [ - 'src/core/lib/gpr/subprocess_posix.cc', - 'src/core/lib/gpr/subprocess_windows.cc', 'test/core/end2end/data/client_certs.cc', 'test/core/end2end/data/server1_cert.cc', 'test/core/end2end/data/server1_key.cc', @@ -1659,6 +1659,8 @@ 'test/core/util/passthru_endpoint.cc', 'test/core/util/resolve_localhost_ip46.cc', 'test/core/util/slice_splitter.cc', + 'test/core/util/subprocess_posix.cc', + 'test/core/util/subprocess_windows.cc', 'test/core/util/tracer_util.cc', 'test/cpp/util/byte_buffer_proto_helper.cc', 'test/cpp/util/create_test_channel.cc', diff --git a/src/core/lib/gpr/subprocess_posix.cc b/src/core/lib/gpr/subprocess_posix.cc deleted file mode 100644 index b482c440da77d..0000000000000 --- a/src/core/lib/gpr/subprocess_posix.cc +++ /dev/null @@ -1,266 +0,0 @@ -// -// -// Copyright 2015 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// - -#include - -#ifdef GPR_POSIX_SUBPROCESS - -#include -#include -#include -#include -#include - -#include - -#include "absl/strings/substitute.h" - -#include -#include - -#include "src/core/lib/gpr/subprocess.h" -#include "src/core/lib/gprpp/memory.h" -#include "src/core/lib/gprpp/strerror.h" - -struct gpr_subprocess { - int pid; - bool joined; - int child_stdin_; - int child_stdout_; -}; - -const char* gpr_subprocess_binary_extension() { return ""; } - -gpr_subprocess* gpr_subprocess_create(int argc, const char** argv) { - gpr_subprocess* r; - int pid; - char** exec_args; - int stdin_pipe[2]; - int stdout_pipe[2]; - int p0 = pipe(stdin_pipe); - int p1 = pipe(stdout_pipe); - GPR_ASSERT(p0 != -1); - GPR_ASSERT(p1 != -1); - pid = fork(); - if (pid == -1) { - return nullptr; - } else if (pid == 0) { - dup2(stdin_pipe[0], STDIN_FILENO); - dup2(stdout_pipe[1], STDOUT_FILENO); - close(stdin_pipe[0]); - close(stdin_pipe[1]); - close(stdout_pipe[0]); - close(stdout_pipe[1]); - exec_args = static_cast( - gpr_malloc((static_cast(argc) + 1) * sizeof(char*))); - memcpy(exec_args, argv, static_cast(argc) * sizeof(char*)); - exec_args[argc] = nullptr; - execv(exec_args[0], exec_args); - // if we reach here, an error has occurred - gpr_log(GPR_ERROR, "execv '%s' failed: %s", exec_args[0], - grpc_core::StrError(errno).c_str()); - _exit(1); - } else { - r = grpc_core::Zalloc(); - r->pid = pid; - close(stdin_pipe[0]); - close(stdout_pipe[1]); - r->child_stdin_ = stdin_pipe[1]; - r->child_stdout_ = stdout_pipe[0]; - return r; - } -} - -gpr_subprocess* gpr_subprocess_create_with_envp(int argc, const char** argv, - int envc, const char** envp) { - gpr_subprocess* r; - int pid; - char **exec_args, **envp_args; - int stdin_pipe[2]; - int stdout_pipe[2]; - int p0 = pipe(stdin_pipe); - int p1 = pipe(stdout_pipe); - GPR_ASSERT(p0 != -1); - GPR_ASSERT(p1 != -1); - pid = fork(); - if (pid == -1) { - return nullptr; - } else if (pid == 0) { - dup2(stdin_pipe[0], STDIN_FILENO); - dup2(stdout_pipe[1], STDOUT_FILENO); - close(stdin_pipe[0]); - close(stdin_pipe[1]); - close(stdout_pipe[0]); - close(stdout_pipe[1]); - exec_args = static_cast( - gpr_malloc((static_cast(argc) + 1) * sizeof(char*))); - memcpy(exec_args, argv, static_cast(argc) * sizeof(char*)); - exec_args[argc] = nullptr; - envp_args = static_cast( - gpr_malloc((static_cast(envc) + 1) * sizeof(char*))); - memcpy(envp_args, envp, static_cast(envc) * sizeof(char*)); - envp_args[envc] = nullptr; - execve(exec_args[0], exec_args, envp_args); - // if we reach here, an error has occurred - gpr_log(GPR_ERROR, "execvpe '%s' failed: %s", exec_args[0], - grpc_core::StrError(errno).c_str()); - _exit(1); - } else { - r = grpc_core::Zalloc(); - r->pid = pid; - close(stdin_pipe[0]); - close(stdout_pipe[1]); - r->child_stdin_ = stdin_pipe[1]; - r->child_stdout_ = stdout_pipe[0]; - return r; - } -} - -bool gpr_subprocess_communicate(gpr_subprocess* p, std::string& input_data, - std::string* output_data, std::string* error) { - typedef void SignalHandler(int); - - // Make sure SIGPIPE is disabled so that if the child dies it doesn't kill us. - SignalHandler* old_pipe_handler = signal(SIGPIPE, SIG_IGN); - - int input_pos = 0; - int max_fd = std::max(p->child_stdin_, p->child_stdout_); - - while (p->child_stdout_ != -1) { - fd_set read_fds; - fd_set write_fds; - FD_ZERO(&read_fds); - FD_ZERO(&write_fds); - if (p->child_stdout_ != -1) { - FD_SET(p->child_stdout_, &read_fds); - } - if (p->child_stdin_ != -1) { - FD_SET(p->child_stdin_, &write_fds); - } - - if (select(max_fd + 1, &read_fds, &write_fds, nullptr, nullptr) < 0) { - if (errno == EINTR) { - // Interrupted by signal. Try again. - continue; - } else { - std::cerr << "select: " << strerror(errno) << std::endl; - GPR_ASSERT(0); - } - } - - if (p->child_stdin_ != -1 && FD_ISSET(p->child_stdin_, &write_fds)) { - int n = write(p->child_stdin_, input_data.data() + input_pos, - input_data.size() - input_pos); - if (n < 0) { - // Child closed pipe. Presumably it will report an error later. - // Pretend we're done for now. - input_pos = input_data.size(); - } else { - input_pos += n; - } - - if (input_pos == static_cast(input_data.size())) { - // We're done writing. Close. - close(p->child_stdin_); - p->child_stdin_ = -1; - } - } - - if (p->child_stdout_ != -1 && FD_ISSET(p->child_stdout_, &read_fds)) { - char buffer[4096]; - int n = read(p->child_stdout_, buffer, sizeof(buffer)); - - if (n > 0) { - output_data->append(buffer, static_cast(n)); - } else { - // We're done reading. Close. - close(p->child_stdout_); - p->child_stdout_ = -1; - } - } - } - - if (p->child_stdin_ != -1) { - // Child did not finish reading input before it closed the output. - // Presumably it exited with an error. - close(p->child_stdin_); - p->child_stdin_ = -1; - } - - int status; - while (waitpid(p->pid, &status, 0) == -1) { - if (errno != EINTR) { - std::cerr << "waitpid: " << strerror(errno) << std::endl; - GPR_ASSERT(0); - } - } - - // Restore SIGPIPE handling. - signal(SIGPIPE, old_pipe_handler); - - if (WIFEXITED(status)) { - if (WEXITSTATUS(status) != 0) { - int error_code = WEXITSTATUS(status); - *error = - absl::Substitute("Plugin failed with status code $0.", error_code); - return false; - } - } else if (WIFSIGNALED(status)) { - int signal = WTERMSIG(status); - *error = absl::Substitute("Plugin killed by signal $0.", signal); - return false; - } else { - *error = "Neither WEXITSTATUS nor WTERMSIG is true?"; - return false; - } - - return true; -} - -void gpr_subprocess_destroy(gpr_subprocess* p) { - if (!p->joined) { - kill(p->pid, SIGKILL); - gpr_subprocess_join(p); - } - gpr_free(p); -} - -int gpr_subprocess_join(gpr_subprocess* p) { - int status; -retry: - if (waitpid(p->pid, &status, 0) == -1) { - if (errno == EINTR) { - goto retry; - } - gpr_log(GPR_ERROR, "waitpid failed for pid %d: %s", p->pid, - grpc_core::StrError(errno).c_str()); - return -1; - } - p->joined = true; - return status; -} - -void gpr_subprocess_interrupt(gpr_subprocess* p) { - if (!p->joined) { - kill(p->pid, SIGINT); - } -} - -int gpr_subprocess_get_process_id(gpr_subprocess* p) { return p->pid; } - -#endif // GPR_POSIX_SUBPROCESS diff --git a/test/core/bad_ssl/bad_ssl_test.cc b/test/core/bad_ssl/bad_ssl_test.cc index 5faa7b7bc5a00..51d5a95b63f9d 100644 --- a/test/core/bad_ssl/bad_ssl_test.cc +++ b/test/core/bad_ssl/bad_ssl_test.cc @@ -32,11 +32,11 @@ #include #include -#include "src/core/lib/gpr/subprocess.h" #include "src/core/lib/gprpp/env.h" #include "src/core/lib/gprpp/host_port.h" #include "test/core/end2end/cq_verifier.h" #include "test/core/util/port.h" +#include "test/core/util/subprocess.h" #include "test/core/util/test_config.h" static void run_test(const char* target, size_t nops) { diff --git a/test/core/bad_ssl/generate_tests.bzl b/test/core/bad_ssl/generate_tests.bzl index ecce282765afc..f2f3fcab93e4d 100755 --- a/test/core/bad_ssl/generate_tests.bzl +++ b/test/core/bad_ssl/generate_tests.bzl @@ -61,7 +61,6 @@ def grpc_bad_ssl_tests(): "//test/core/util:grpc_test_util_base", "//:gpr", "//:grpc", - "//:subprocess", "//test/core/end2end:cq_verifier", ], tags = ["no_windows"], diff --git a/test/core/event_engine/test_suite/tests/BUILD b/test/core/event_engine/test_suite/tests/BUILD index 4c187e2c5d4f4..ef297860a97d9 100644 --- a/test/core/event_engine/test_suite/tests/BUILD +++ b/test/core/event_engine/test_suite/tests/BUILD @@ -68,7 +68,6 @@ grpc_cc_library( "address_sorting", ], deps = [ - "//:subprocess", "//src/core:env", "//test/core/event_engine:event_engine_test_utils", "//test/core/event_engine/test_suite:event_engine_test_framework", diff --git a/test/core/http/BUILD b/test/core/http/BUILD index 2495cfb1cbd3d..965a7a84ca99d 100644 --- a/test/core/http/BUILD +++ b/test/core/http/BUILD @@ -68,7 +68,6 @@ grpc_cc_library( hdrs = ["httpcli_test_util.h"], deps = [ "//:gpr", - "//:subprocess", "//test/core/end2end:ssl_test_data", "//test/core/util:grpc_test_util", "//test/core/util:grpc_test_util_base", @@ -91,7 +90,6 @@ grpc_cc_test( ":httpcli_test_util", "//:gpr", "//:grpc", - "//:subprocess", "//test/core/end2end:ssl_test_data", "//test/core/util:fake_udp_and_tcp_server", "//test/core/util:grpc_test_util", @@ -105,7 +103,6 @@ grpc_cc_test( data = [ "python_wrapper.sh", "test_server.py", - "//:subprocess", "//src/core/tsi/test_creds:ca.pem", "//src/core/tsi/test_creds:server1.key", "//src/core/tsi/test_creds:server1.pem", diff --git a/test/core/http/httpcli_test.cc b/test/core/http/httpcli_test.cc index 98fc2c934fddf..519e7fd3aaf49 100644 --- a/test/core/http/httpcli_test.cc +++ b/test/core/http/httpcli_test.cc @@ -44,7 +44,6 @@ #include #include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h" -#include "src/core/lib/gpr/subprocess.h" #include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/gprpp/time.h" #include "src/core/lib/gprpp/time_util.h" @@ -54,6 +53,7 @@ #include "test/core/http/httpcli_test_util.h" #include "test/core/util/fake_udp_and_tcp_server.h" #include "test/core/util/port.h" +#include "test/core/util/subprocess.h" #include "test/core/util/test_config.h" namespace { diff --git a/test/core/http/httpcli_test_util.cc b/test/core/http/httpcli_test_util.cc index 5381fb03dd380..763413cc3733f 100644 --- a/test/core/http/httpcli_test_util.cc +++ b/test/core/http/httpcli_test_util.cc @@ -32,8 +32,8 @@ #include #include "src/core/lib/config/config_vars.h" -#include "src/core/lib/gpr/subprocess.h" #include "test/core/util/port.h" +#include "test/core/util/subprocess.h" namespace grpc_core { namespace testing { diff --git a/test/core/http/httpcli_test_util.h b/test/core/http/httpcli_test_util.h index 6007a4be203b7..e1ecebe792620 100644 --- a/test/core/http/httpcli_test_util.h +++ b/test/core/http/httpcli_test_util.h @@ -19,7 +19,7 @@ #include -#include "src/core/lib/gpr/subprocess.h" +#include "test/core/util/subprocess.h" namespace grpc_core { namespace testing { diff --git a/test/core/http/httpscli_test.cc b/test/core/http/httpscli_test.cc index 35da8634f7efb..281ccda42698a 100644 --- a/test/core/http/httpscli_test.cc +++ b/test/core/http/httpscli_test.cc @@ -42,7 +42,6 @@ #include #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/subprocess.h" #include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/gprpp/sync.h" @@ -61,6 +60,7 @@ #include "src/core/lib/uri/uri_parser.h" #include "test/core/http/httpcli_test_util.h" #include "test/core/util/fake_udp_and_tcp_server.h" +#include "test/core/util/subprocess.h" #include "test/core/util/test_config.h" namespace { diff --git a/test/core/memory_usage/BUILD b/test/core/memory_usage/BUILD index cfc2880b688db..41aab426c182a 100644 --- a/test/core/memory_usage/BUILD +++ b/test/core/memory_usage/BUILD @@ -159,7 +159,6 @@ grpc_cc_test( deps = [ "//:gpr", "//:grpc", - "//:subprocess", "//test/core/util:grpc_test_util", "//test/core/util:grpc_test_util_base", ], @@ -179,7 +178,6 @@ grpc_cc_binary( deps = [ "//:gpr", "//:grpc", - "//:subprocess", "//test/core/util:grpc_test_util", "//test/core/util:grpc_test_util_base", ], diff --git a/test/core/memory_usage/memory_usage_test.cc b/test/core/memory_usage/memory_usage_test.cc index 0c2c9ee2b7306..671539654bee8 100644 --- a/test/core/memory_usage/memory_usage_test.cc +++ b/test/core/memory_usage/memory_usage_test.cc @@ -37,9 +37,9 @@ #include #include "src/core/lib/config/config_vars.h" -#include "src/core/lib/gpr/subprocess.h" #include "src/core/lib/gprpp/host_port.h" #include "test/core/util/port.h" +#include "test/core/util/subprocess.h" #include "test/core/util/test_config.h" ABSL_FLAG(std::string, benchmark_names, "call,channel", diff --git a/test/core/util/BUILD b/test/core/util/BUILD index e520da58a06a1..2b88fd11f5884 100644 --- a/test/core/util/BUILD +++ b/test/core/util/BUILD @@ -59,6 +59,8 @@ grpc_cc_library( "passthru_endpoint.cc", "resolve_localhost_ip46.cc", "slice_splitter.cc", + "subprocess_posix.cc", + "subprocess_windows.cc", "tracer_util.cc", ], hdrs = [ @@ -73,6 +75,7 @@ grpc_cc_library( "passthru_endpoint.h", "resolve_localhost_ip46.h", "slice_splitter.h", + "subprocess.h", "tracer_util.h", ], external_deps = [ diff --git a/src/core/lib/gpr/subprocess.h b/test/core/util/subprocess.h similarity index 68% rename from src/core/lib/gpr/subprocess.h rename to test/core/util/subprocess.h index 71d4796fde6f2..a46be258516b0 100644 --- a/src/core/lib/gpr/subprocess.h +++ b/test/core/util/subprocess.h @@ -16,26 +16,17 @@ // // -#ifndef GRPC_SRC_CORE_LIB_GPR_SUBPROCESS_H -#define GRPC_SRC_CORE_LIB_GPR_SUBPROCESS_H +#ifndef GRPC_TEST_CORE_UTIL_SUBPROCESS_H +#define GRPC_TEST_CORE_UTIL_SUBPROCESS_H #include -#include - typedef struct gpr_subprocess gpr_subprocess; /// .exe on windows, empty on unices const char* gpr_subprocess_binary_extension(); gpr_subprocess* gpr_subprocess_create(int argc, const char** argv); - -gpr_subprocess* gpr_subprocess_create_with_envp(int argc, const char** argv, - int envc, const char** envp); - -// communicate to the subprocess via stdin, stdout and stderr -bool gpr_subprocess_communicate(gpr_subprocess* p, std::string& input_data, - std::string* output_data, std::string* error); /// if subprocess has not been joined, kill it void gpr_subprocess_destroy(gpr_subprocess* p); /// returns exit status; can be called at most once @@ -43,4 +34,4 @@ int gpr_subprocess_join(gpr_subprocess* p); void gpr_subprocess_interrupt(gpr_subprocess* p); int gpr_subprocess_get_process_id(gpr_subprocess* p); -#endif // GRPC_SRC_CORE_LIB_GPR_SUBPROCESS_H +#endif // GRPC_TEST_CORE_UTIL_SUBPROCESS_H diff --git a/test/core/util/subprocess_posix.cc b/test/core/util/subprocess_posix.cc new file mode 100644 index 0000000000000..1b97df0d26d66 --- /dev/null +++ b/test/core/util/subprocess_posix.cc @@ -0,0 +1,101 @@ +// +// +// Copyright 2015 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#include + +#include + +#ifdef GPR_POSIX_SUBPROCESS + +#include +#include +#include +#include +#include + +#include +#include + +#include "src/core/lib/gprpp/memory.h" +#include "src/core/lib/gprpp/strerror.h" +#include "test/core/util/subprocess.h" + +struct gpr_subprocess { + int pid; + bool joined; +}; + +const char* gpr_subprocess_binary_extension() { return ""; } + +gpr_subprocess* gpr_subprocess_create(int argc, const char** argv) { + gpr_subprocess* r; + int pid; + char** exec_args; + + pid = fork(); + if (pid == -1) { + return nullptr; + } else if (pid == 0) { + exec_args = static_cast( + gpr_malloc((static_cast(argc) + 1) * sizeof(char*))); + memcpy(exec_args, argv, static_cast(argc) * sizeof(char*)); + exec_args[argc] = nullptr; + execv(exec_args[0], exec_args); + // if we reach here, an error has occurred + gpr_log(GPR_ERROR, "execv '%s' failed: %s", exec_args[0], + grpc_core::StrError(errno).c_str()); + _exit(1); + } else { + r = grpc_core::Zalloc(); + r->pid = pid; + return r; + } +} + +void gpr_subprocess_destroy(gpr_subprocess* p) { + if (!p->joined) { + kill(p->pid, SIGKILL); + gpr_subprocess_join(p); + } + gpr_free(p); +} + +int gpr_subprocess_join(gpr_subprocess* p) { + int status; +retry: + if (waitpid(p->pid, &status, 0) == -1) { + if (errno == EINTR) { + goto retry; + } + gpr_log(GPR_ERROR, "waitpid failed for pid %d: %s", p->pid, + grpc_core::StrError(errno).c_str()); + return -1; + } + p->joined = true; + return status; +} + +void gpr_subprocess_interrupt(gpr_subprocess* p) { + if (!p->joined) { + kill(p->pid, SIGINT); + } +} + +int gpr_subprocess_get_process_id(gpr_subprocess* p) { return p->pid; } + +#endif // GPR_POSIX_SUBPROCESS diff --git a/src/core/lib/gpr/subprocess_windows.cc b/test/core/util/subprocess_windows.cc similarity index 98% rename from src/core/lib/gpr/subprocess_windows.cc rename to test/core/util/subprocess_windows.cc index 3efadd2a9b082..b639b3ef737c7 100644 --- a/src/core/lib/gpr/subprocess_windows.cc +++ b/test/core/util/subprocess_windows.cc @@ -31,9 +31,9 @@ #include #include "src/core/lib/gpr/string.h" -#include "src/core/lib/gpr/subprocess.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/tchar.h" +#include "test/core/util/subprocess.h" struct gpr_subprocess { PROCESS_INFORMATION pi; diff --git a/test/cpp/util/BUILD b/test/cpp/util/BUILD index e4b98dc1ec28a..d8aed93aa50fe 100644 --- a/test/cpp/util/BUILD +++ b/test/cpp/util/BUILD @@ -80,7 +80,6 @@ grpc_cc_library( ], deps = [ "//:grpc++", - "//:subprocess", "//test/core/end2end:ssl_test_data", "//test/core/util:grpc_test_util", "//test/core/util:grpc_test_util_base", @@ -115,7 +114,6 @@ grpc_cc_library( ], deps = [ "//:grpc++_unsecure", - "//:subprocess", "//test/core/util:grpc_test_util_base", "//test/core/util:grpc_test_util_unsecure", ], diff --git a/test/cpp/util/subprocess.cc b/test/cpp/util/subprocess.cc index 2f0c9cd03b209..1cd7fbd44a40e 100644 --- a/test/cpp/util/subprocess.cc +++ b/test/cpp/util/subprocess.cc @@ -20,7 +20,7 @@ #include -#include "src/core/lib/gpr/subprocess.h" +#include "test/core/util/subprocess.h" namespace grpc { From f1e1832b3969b8c3c17073b27da6ceb7017811e4 Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Wed, 2 Aug 2023 21:57:10 -0700 Subject: [PATCH 116/205] [bug] Fix race in EventEngine shim logging (#33973) Fixes b/294124240. We could get clever and keep the peeraddr in the log, but the wrapper address should be sufficient to tie things together. --- src/core/lib/iomgr/event_engine_shims/endpoint.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/lib/iomgr/event_engine_shims/endpoint.cc b/src/core/lib/iomgr/event_engine_shims/endpoint.cc index ae9004f11b6ef..7474ee3d6f825 100644 --- a/src/core/lib/iomgr/event_engine_shims/endpoint.cc +++ b/src/core/lib/iomgr/event_engine_shims/endpoint.cc @@ -119,8 +119,7 @@ class EventEngineEndpointWrapper { read_buffer->~SliceBuffer(); if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { size_t i; - gpr_log(GPR_INFO, "TCP: %p READ (peer=%s) error=%s", eeep_->wrapper, - std::string(eeep_->wrapper->PeerAddress()).c_str(), + gpr_log(GPR_INFO, "TCP: %p READ error=%s", eeep_->wrapper, status.ToString().c_str()); if (gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) { for (i = 0; i < pending_read_buffer_->count; i++) { From c0a99ee0c919d02a8933efef86ee8aac30aa1109 Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Wed, 2 Aug 2023 23:15:29 -0700 Subject: [PATCH 117/205] [EventEngine][Windows] Fix trace log use-after-free (#33975) Identified as a low-rate flake via manual RBE tests with all EE logging enabled. --- src/core/lib/event_engine/windows/windows_endpoint.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/lib/event_engine/windows/windows_endpoint.cc b/src/core/lib/event_engine/windows/windows_endpoint.cc index 05971bebdbdab..85cd968e8bce8 100644 --- a/src/core/lib/event_engine/windows/windows_endpoint.cc +++ b/src/core/lib/event_engine/windows/windows_endpoint.cc @@ -284,6 +284,7 @@ void WindowsEndpoint::HandleWriteClosure::Prime( void WindowsEndpoint::HandleReadClosure::Run() { // Deletes the shared_ptr when this closure returns + // Note that the endpoint may have already been destroyed. auto io_state = std::move(io_state_); GRPC_EVENT_ENGINE_ENDPOINT_TRACE("WindowsEndpoint::%p Handling Read Event", io_state->endpoint); @@ -297,10 +298,8 @@ void WindowsEndpoint::HandleReadClosure::Run() { if (result.bytes_transferred == 0) { // Either the endpoint is shut down or we've seen the end of the stream if (grpc_event_engine_endpoint_data_trace.enabled()) { - DumpSliceBuffer( - buffer_, absl::StrFormat("WindowsEndpoint::%p READ (peer=%s)", - io_state->endpoint, - io_state->endpoint->peer_address_string_)); + DumpSliceBuffer(buffer_, absl::StrFormat("WindowsEndpoint::%p READ", + io_state->endpoint)); } status = absl::UnavailableError("End of TCP stream"); grpc_core::StatusSetInt(&status, grpc_core::StatusIntProperty::kRpcStatus, From 671453faa5002d6f738c183e17137c5f56120782 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 3 Aug 2023 15:45:45 +0200 Subject: [PATCH 118/205] [bazel] Disable flaky bazelified run_tests.py tests (#33978) Most runs of these tests currently fail. Disabling them for now before I get a chance to investigate what's causing the failures. Example failures: https://source.cloud.google.com/results/invocations/9916fe8e-0fe1-4c33-a885-79a41e69c9fe https://source.cloud.google.com/results/invocations/9251a25c-0758-421d-84bd-12379f9cf10c --- tools/bazelify_tests/test/BUILD | 3 ++- tools/bazelify_tests/test/portability_tests.bzl | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/bazelify_tests/test/BUILD b/tools/bazelify_tests/test/BUILD index 5aedb1b20e667..a6eac298bed2d 100644 --- a/tools/bazelify_tests/test/BUILD +++ b/tools/bazelify_tests/test/BUILD @@ -141,7 +141,8 @@ test_suite( ":runtests_cpp_linux_opt_build_only", ":runtests_csharp_linux_dbg", ":runtests_csharp_linux_opt", - ":runtests_php_linux_dbg", + # TODO(jtattermusch): reenable the test once not flaky anymore + #":runtests_php_linux_dbg", ":runtests_php_linux_opt", #":runtests_python_linux_opt", #":runtests_ruby_linux_dbg", diff --git a/tools/bazelify_tests/test/portability_tests.bzl b/tools/bazelify_tests/test/portability_tests.bzl index 21cc04c2ee0b7..26afa9e5bea07 100644 --- a/tools/bazelify_tests/test/portability_tests.bzl +++ b/tools/bazelify_tests/test/portability_tests.bzl @@ -55,7 +55,8 @@ def generate_run_tests_portability_tests(name): compiler_configs = [ # TODO(b/283304471): Add 'gcc10.2_openssl102' once possible ["gcc_7", "", "tools/dockerfile/test/cxx_gcc_7_x64.current_version"], - ["gcc_12", "--cmake_configure_extra_args=-DCMAKE_CXX_STANDARD=20", "tools/dockerfile/test/cxx_gcc_12_x64.current_version"], + # TODO(jtattermusch): re-enable once not flaky anymore + #["gcc_12", "--cmake_configure_extra_args=-DCMAKE_CXX_STANDARD=20", "tools/dockerfile/test/cxx_gcc_12_x64.current_version"], # TODO(jtattermusch): Re-enable once the build can finish in reasonable time (looks like ccache is not being used?) #["gcc_musl", "", "tools/dockerfile/test/cxx_alpine_x64.current_version"], ["clang_6", "--cmake_configure_extra_args=-DCMAKE_C_COMPILER=clang --cmake_configure_extra_args=-DCMAKE_CXX_COMPILER=clang++", "tools/dockerfile/test/cxx_clang_6_x64.current_version"], From 2feb821eb5fb60024092bb950f1ecf8452782aa9 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 3 Aug 2023 11:49:52 -0700 Subject: [PATCH 119/205] [promises] Enable promise-based calls on server side for OSS build (#33945) --- bazel/experiments.bzl | 60 ++++++++++++------------- src/core/lib/experiments/experiments.cc | 6 +-- src/core/lib/experiments/experiments.h | 9 ++-- src/core/lib/experiments/rollouts.yaml | 2 +- 4 files changed, 40 insertions(+), 37 deletions(-) diff --git a/bazel/experiments.bzl b/bazel/experiments.bzl index 1bd377317c355..ae4e15060a594 100644 --- a/bazel/experiments.bzl +++ b/bazel/experiments.bzl @@ -27,12 +27,8 @@ EXPERIMENTS = { "core_end2end_test": [ "event_engine_listener", "promise_based_client_call", - "promise_based_server_call", "unique_metadata_strings", ], - "cpp_end2end_test": [ - "promise_based_server_call", - ], "endpoint_test": [ "tcp_frame_size_tuning", "tcp_rcv_lowat", @@ -48,22 +44,26 @@ EXPERIMENTS = { "lame_client_test": [ "promise_based_client_call", ], - "logging_test": [ - "promise_based_server_call", - ], "resource_quota_test": [ "free_large_allocator", "memory_pressure_controller", "unconstrained_max_quota_buffer_size", ], - "xds_end2end_test": [ - "promise_based_server_call", - ], }, "on": { "core_end2end_test": [ + "promise_based_server_call", "work_stealing", ], + "cpp_end2end_test": [ + "promise_based_server_call", + ], + "logging_test": [ + "promise_based_server_call", + ], + "xds_end2end_test": [ + "promise_based_server_call", + ], }, }, "ios": { @@ -76,12 +76,8 @@ EXPERIMENTS = { "core_end2end_test": [ "event_engine_listener", "promise_based_client_call", - "promise_based_server_call", "unique_metadata_strings", ], - "cpp_end2end_test": [ - "promise_based_server_call", - ], "endpoint_test": [ "tcp_frame_size_tuning", "tcp_rcv_lowat", @@ -97,22 +93,26 @@ EXPERIMENTS = { "lame_client_test": [ "promise_based_client_call", ], - "logging_test": [ - "promise_based_server_call", - ], "resource_quota_test": [ "free_large_allocator", "memory_pressure_controller", "unconstrained_max_quota_buffer_size", ], - "xds_end2end_test": [ - "promise_based_server_call", - ], }, "on": { "core_end2end_test": [ + "promise_based_server_call", "work_stealing", ], + "cpp_end2end_test": [ + "promise_based_server_call", + ], + "logging_test": [ + "promise_based_server_call", + ], + "xds_end2end_test": [ + "promise_based_server_call", + ], }, }, "posix": { @@ -129,12 +129,8 @@ EXPERIMENTS = { "event_engine_client", "event_engine_listener", "promise_based_client_call", - "promise_based_server_call", "unique_metadata_strings", ], - "cpp_end2end_test": [ - "promise_based_server_call", - ], "endpoint_test": [ "tcp_frame_size_tuning", "tcp_rcv_lowat", @@ -153,9 +149,6 @@ EXPERIMENTS = { "lame_client_test": [ "promise_based_client_call", ], - "logging_test": [ - "promise_based_server_call", - ], "resolver_component_tests_runner_invoker": [ "event_engine_dns", ], @@ -164,14 +157,21 @@ EXPERIMENTS = { "memory_pressure_controller", "unconstrained_max_quota_buffer_size", ], - "xds_end2end_test": [ - "promise_based_server_call", - ], }, "on": { "core_end2end_test": [ + "promise_based_server_call", "work_stealing", ], + "cpp_end2end_test": [ + "promise_based_server_call", + ], + "logging_test": [ + "promise_based_server_call", + ], + "xds_end2end_test": [ + "promise_based_server_call", + ], }, }, } diff --git a/src/core/lib/experiments/experiments.cc b/src/core/lib/experiments/experiments.cc index c7b177071d037..db1f587bc9355 100644 --- a/src/core/lib/experiments/experiments.cc +++ b/src/core/lib/experiments/experiments.cc @@ -131,7 +131,7 @@ const ExperimentMetadata g_experiment_metadata[] = { {"free_large_allocator", description_free_large_allocator, additional_constraints_free_large_allocator, false, true}, {"promise_based_server_call", description_promise_based_server_call, - additional_constraints_promise_based_server_call, false, true}, + additional_constraints_promise_based_server_call, true, true}, {"transport_supplies_client_latency", description_transport_supplies_client_latency, additional_constraints_transport_supplies_client_latency, false, true}, @@ -273,7 +273,7 @@ const ExperimentMetadata g_experiment_metadata[] = { {"free_large_allocator", description_free_large_allocator, additional_constraints_free_large_allocator, false, true}, {"promise_based_server_call", description_promise_based_server_call, - additional_constraints_promise_based_server_call, false, true}, + additional_constraints_promise_based_server_call, true, true}, {"transport_supplies_client_latency", description_transport_supplies_client_latency, additional_constraints_transport_supplies_client_latency, false, true}, @@ -415,7 +415,7 @@ const ExperimentMetadata g_experiment_metadata[] = { {"free_large_allocator", description_free_large_allocator, additional_constraints_free_large_allocator, false, true}, {"promise_based_server_call", description_promise_based_server_call, - additional_constraints_promise_based_server_call, false, true}, + additional_constraints_promise_based_server_call, true, true}, {"transport_supplies_client_latency", description_transport_supplies_client_latency, additional_constraints_transport_supplies_client_latency, false, true}, diff --git a/src/core/lib/experiments/experiments.h b/src/core/lib/experiments/experiments.h index 3ccdd6f19f04d..998d0a3b0ce36 100644 --- a/src/core/lib/experiments/experiments.h +++ b/src/core/lib/experiments/experiments.h @@ -69,7 +69,8 @@ inline bool IsEventEngineClientEnabled() { return false; } inline bool IsMonitoringExperimentEnabled() { return true; } inline bool IsPromiseBasedClientCallEnabled() { return false; } inline bool IsFreeLargeAllocatorEnabled() { return false; } -inline bool IsPromiseBasedServerCallEnabled() { return false; } +#define GRPC_EXPERIMENT_IS_INCLUDED_PROMISE_BASED_SERVER_CALL +inline bool IsPromiseBasedServerCallEnabled() { return true; } inline bool IsTransportSuppliesClientLatencyEnabled() { return false; } inline bool IsEventEngineListenerEnabled() { return false; } inline bool IsScheduleCancellationOverWriteEnabled() { return false; } @@ -103,7 +104,8 @@ inline bool IsEventEngineClientEnabled() { return false; } inline bool IsMonitoringExperimentEnabled() { return true; } inline bool IsPromiseBasedClientCallEnabled() { return false; } inline bool IsFreeLargeAllocatorEnabled() { return false; } -inline bool IsPromiseBasedServerCallEnabled() { return false; } +#define GRPC_EXPERIMENT_IS_INCLUDED_PROMISE_BASED_SERVER_CALL +inline bool IsPromiseBasedServerCallEnabled() { return true; } inline bool IsTransportSuppliesClientLatencyEnabled() { return false; } inline bool IsEventEngineListenerEnabled() { return false; } inline bool IsScheduleCancellationOverWriteEnabled() { return false; } @@ -137,7 +139,8 @@ inline bool IsEventEngineClientEnabled() { return false; } inline bool IsMonitoringExperimentEnabled() { return true; } inline bool IsPromiseBasedClientCallEnabled() { return false; } inline bool IsFreeLargeAllocatorEnabled() { return false; } -inline bool IsPromiseBasedServerCallEnabled() { return false; } +#define GRPC_EXPERIMENT_IS_INCLUDED_PROMISE_BASED_SERVER_CALL +inline bool IsPromiseBasedServerCallEnabled() { return true; } inline bool IsTransportSuppliesClientLatencyEnabled() { return false; } inline bool IsEventEngineListenerEnabled() { return false; } inline bool IsScheduleCancellationOverWriteEnabled() { return false; } diff --git a/src/core/lib/experiments/rollouts.yaml b/src/core/lib/experiments/rollouts.yaml index 910a6a768b27e..b0d547ccd01f0 100644 --- a/src/core/lib/experiments/rollouts.yaml +++ b/src/core/lib/experiments/rollouts.yaml @@ -61,7 +61,7 @@ - name: free_large_allocator default: false - name: promise_based_server_call - default: false + default: true - name: transport_supplies_client_latency default: false - name: event_engine_listener From 30c68edfcb63400dbadeff931ea1c31c98aaea9e Mon Sep 17 00:00:00 2001 From: Eugene Ostroukhov Date: Thu, 3 Aug 2023 13:05:48 -0700 Subject: [PATCH 120/205] [Interop Test] Rollback image changes (#33979) Fixes build issues --- .dockerignore | 6 ------ .../tests_py3_only/interop/Dockerfile.client | 17 +++++++++++------ .../tests_py3_only/interop/Dockerfile.server | 17 +++++++++++------ .../grpc_interop_cxx_xds/Dockerfile.xds_client | 4 ++-- .../grpc_interop_cxx_xds/Dockerfile.xds_server | 4 ++-- 5 files changed, 26 insertions(+), 22 deletions(-) delete mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 8cd0034b50ce9..0000000000000 --- a/.dockerignore +++ /dev/null @@ -1,6 +0,0 @@ -bazel-bin -bazel-grpc -bazel-out -build -.cache -.git diff --git a/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.client b/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.client index 7f8d6118bb654..6bd6d4ce8b3c2 100644 --- a/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.client +++ b/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.client @@ -1,6 +1,11 @@ -FROM python:3.9-slim +FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc -RUN apt-get update -y && apt-get upgrade -y && apt-get install -y build-essential clang +RUN apt-get update -y && \ + apt-get install -y \ + build-essential \ + clang \ + python3 \ + python3-dev WORKDIR /workdir @@ -11,13 +16,13 @@ COPY . . RUN tools/bazel build -c dbg //src/python/grpcio_tests/tests_py3_only/interop:xds_interop_client RUN cp -rL /workdir/bazel-bin/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_client* /artifacts/ -FROM python:3.9-slim - +FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc COPY --from=0 /artifacts ./ -RUN apt-get update -y && apt-get upgrade -y - ENV GRPC_VERBOSITY="DEBUG" ENV GRPC_TRACE="xds_client,xds_resolver,xds_cluster_manager_lb,cds_lb,xds_cluster_resolver_lb,priority_lb,xds_cluster_impl_lb,weighted_target_lb,ring_hash_lb,outlier_detection_lb" +RUN apt-get update -y && apt-get install -y python3 +RUN ln -s /usr/bin/python3 /usr/bin/python + ENTRYPOINT ["/xds_interop_client"] diff --git a/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.server b/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.server index 75cd9b51bc69d..bc63f4ecd9fa0 100644 --- a/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.server +++ b/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.server @@ -1,6 +1,11 @@ -FROM python:3.9-slim +FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc -RUN apt-get update -y && apt-get upgrade -y && apt-get install -y build-essential clang +RUN apt-get update -y && \ + apt-get install -y \ + build-essential \ + clang \ + python3 \ + python3-dev WORKDIR /workdir @@ -11,13 +16,13 @@ COPY . . RUN tools/bazel build -c dbg //src/python/grpcio_tests/tests_py3_only/interop:xds_interop_server RUN cp -rL /workdir/bazel-bin/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_server* /artifacts/ -FROM python:3.9-slim - +FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc COPY --from=0 /artifacts ./ -RUN apt-get update -y && apt-get upgrade -y - ENV GRPC_VERBOSITY="DEBUG" ENV GRPC_TRACE="xds_client,xds_resolver,xds_cluster_manager_lb,cds_lb,xds_cluster_resolver_lb,priority_lb,xds_cluster_impl_lb,weighted_target_lb" +RUN apt-get update -y && apt-get install -y python3 +RUN ln -s /usr/bin/python3 /usr/bin/python + ENTRYPOINT ["/xds_interop_server"] diff --git a/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client b/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client index 3b68c0e38344d..9feea3396d696 100644 --- a/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client +++ b/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client @@ -14,7 +14,7 @@ # Dockerfile for building //test/cpp/interop:xds_interop_client -FROM debian:11 +FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc RUN apt-get update -y && \ apt-get install -y \ @@ -32,7 +32,7 @@ COPY . . RUN tools/bazel build //test/cpp/interop:xds_interop_client RUN cp -rL /workdir/bazel-bin/test/cpp/interop/xds_interop_client /artifacts/ -FROM gcr.io/distroless/cc-debian11@sha256:b53fbf5f81f4a120a489fedff2092e6fcbeacf7863fce3e45d99cc58dc230ccc +FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc COPY --from=0 /artifacts ./ ENV GRPC_VERBOSITY="DEBUG" diff --git a/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server b/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server index d911e4fc8581a..83c0e61a40d1a 100644 --- a/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server +++ b/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server @@ -14,7 +14,7 @@ # Dockerfile for building //test/cpp/interop:xds_interop_client -FROM debian:11 +FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc RUN apt-get update -y && \ apt-get install -y \ @@ -32,7 +32,7 @@ COPY . . RUN tools/bazel build //test/cpp/interop:xds_interop_server RUN cp -rL /workdir/bazel-bin/test/cpp/interop/xds_interop_server /artifacts/ -FROM gcr.io/distroless/cc-debian11@sha256:b53fbf5f81f4a120a489fedff2092e6fcbeacf7863fce3e45d99cc58dc230ccc +FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc COPY --from=0 /artifacts ./ ENV GRPC_VERBOSITY="DEBUG" From 0616c8b838029a79312127efc3683b2dfb22f0e2 Mon Sep 17 00:00:00 2001 From: Vignesh Babu Date: Thu, 3 Aug 2023 13:14:21 -0700 Subject: [PATCH 121/205] [xds] Regex fix in test (#33981) --- test/cpp/end2end/xds/xds_end2end_test_lib.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/cpp/end2end/xds/xds_end2end_test_lib.cc b/test/cpp/end2end/xds/xds_end2end_test_lib.cc index 145f1f201ef39..bdb85129adfec 100644 --- a/test/cpp/end2end/xds/xds_end2end_test_lib.cc +++ b/test/cpp/end2end/xds/xds_end2end_test_lib.cc @@ -1052,6 +1052,8 @@ std::string XdsEnd2endTest::MakeConnectionFailureRegex( "(UNKNOWN|UNAVAILABLE): (ipv6:%5B::1%5D|ipv4:127.0.0.1):[0-9]+: " "(Failed to connect to remote host: )?" "(Connection refused|Connection reset by peer|" + "recvmsg:Connection reset by peer|" + "getsockopt\\(SO\\_ERROR\\): Connection reset by peer|" "Socket closed|FD shutdown)"); } From 1c39493d96566ae929be88e0cf349d70ce3bc225 Mon Sep 17 00:00:00 2001 From: Eugene Ostroukhov Date: Thu, 3 Aug 2023 14:57:41 -0700 Subject: [PATCH 122/205] [Interop test] Install curl (#33982) Curl is required to install Bazel during the build. This also unifies all build images to use Python base image. --- .dockerignore | 6 ++++++ .../tests_py3_only/interop/Dockerfile.client | 12 ++++-------- .../tests_py3_only/interop/Dockerfile.server | 12 ++++-------- .../grpc_interop_cxx_xds/Dockerfile.xds_client | 11 +++-------- .../grpc_interop_cxx_xds/Dockerfile.xds_server | 12 ++++-------- 5 files changed, 21 insertions(+), 32 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000000..8cd0034b50ce9 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +bazel-bin +bazel-grpc +bazel-out +build +.cache +.git diff --git a/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.client b/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.client index 6bd6d4ce8b3c2..3722c13624aa8 100644 --- a/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.client +++ b/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.client @@ -1,11 +1,6 @@ -FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc +FROM python:3.9-slim-bullseye -RUN apt-get update -y && \ - apt-get install -y \ - build-essential \ - clang \ - python3 \ - python3-dev +RUN apt-get update -y && apt-get upgrade -y && apt-get install -y build-essential clang curl WORKDIR /workdir @@ -16,7 +11,8 @@ COPY . . RUN tools/bazel build -c dbg //src/python/grpcio_tests/tests_py3_only/interop:xds_interop_client RUN cp -rL /workdir/bazel-bin/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_client* /artifacts/ -FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc +FROM python:3.9-slim-bullseye + COPY --from=0 /artifacts ./ ENV GRPC_VERBOSITY="DEBUG" diff --git a/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.server b/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.server index bc63f4ecd9fa0..d6e719f5452e5 100644 --- a/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.server +++ b/src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.server @@ -1,11 +1,6 @@ -FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc +FROM python:3.9-slim-bullseye -RUN apt-get update -y && \ - apt-get install -y \ - build-essential \ - clang \ - python3 \ - python3-dev +RUN apt-get update -y && apt-get upgrade -y && apt-get install -y build-essential clang curl WORKDIR /workdir @@ -16,7 +11,8 @@ COPY . . RUN tools/bazel build -c dbg //src/python/grpcio_tests/tests_py3_only/interop:xds_interop_server RUN cp -rL /workdir/bazel-bin/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_server* /artifacts/ -FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc +FROM python:3.9-slim-bullseye + COPY --from=0 /artifacts ./ ENV GRPC_VERBOSITY="DEBUG" diff --git a/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client b/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client index 9feea3396d696..a420c0cfb093c 100644 --- a/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client +++ b/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client @@ -14,14 +14,9 @@ # Dockerfile for building //test/cpp/interop:xds_interop_client -FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc +FROM python:3.9-slim-bullseye -RUN apt-get update -y && \ - apt-get install -y \ - build-essential \ - clang \ - python3 \ - python3-dev +RUN apt-get update -y && apt-get upgrade -y && apt-get install -y build-essential clang curl WORKDIR /workdir @@ -32,7 +27,7 @@ COPY . . RUN tools/bazel build //test/cpp/interop:xds_interop_client RUN cp -rL /workdir/bazel-bin/test/cpp/interop/xds_interop_client /artifacts/ -FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc +FROM python:3.9-slim-bullseye COPY --from=0 /artifacts ./ ENV GRPC_VERBOSITY="DEBUG" diff --git a/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server b/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server index 83c0e61a40d1a..c4c729f55528a 100644 --- a/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server +++ b/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server @@ -14,14 +14,9 @@ # Dockerfile for building //test/cpp/interop:xds_interop_client -FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc +FROM python:3.9-slim-bullseye -RUN apt-get update -y && \ - apt-get install -y \ - build-essential \ - clang \ - python3 \ - python3-dev +RUN apt-get update -y && apt-get upgrade -y && apt-get install -y build-essential clang curl WORKDIR /workdir @@ -32,7 +27,8 @@ COPY . . RUN tools/bazel build //test/cpp/interop:xds_interop_server RUN cp -rL /workdir/bazel-bin/test/cpp/interop/xds_interop_server /artifacts/ -FROM phusion/baseimage:master@sha256:e757fe8c7adcb9f798c0eb9dfff31bbf7d91538a1002031d7cdf3e5bf9cf71fc +FROM python:3.9-slim-bullseye + COPY --from=0 /artifacts ./ ENV GRPC_VERBOSITY="DEBUG" From 6468b8a74f57bb0ae836980ccf71d76182ffc1da Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Thu, 3 Aug 2023 15:29:05 -0700 Subject: [PATCH 123/205] [interop] Add grpc-java 1.57.1 to client_matrix.py (#33967) --- tools/interop_matrix/client_matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/interop_matrix/client_matrix.py b/tools/interop_matrix/client_matrix.py index f348f41487134..6c3aa53888250 100644 --- a/tools/interop_matrix/client_matrix.py +++ b/tools/interop_matrix/client_matrix.py @@ -424,7 +424,7 @@ def __init__(self, patch=[], runtimes=[], testcases_file=None): ("v1.54.0", ReleaseInfo()), ("v1.55.1", ReleaseInfo()), ("v1.56.0", ReleaseInfo()), - ("v1.57.0", ReleaseInfo()), + ("v1.57.1", ReleaseInfo()), ] ), "python": OrderedDict( From 60c1701f87cacf359aa1ad785728549eeef1a4b0 Mon Sep 17 00:00:00 2001 From: Yijie Ma Date: Thu, 3 Aug 2023 20:41:59 -0700 Subject: [PATCH 124/205] [Fork] Kick the EE PollPoller in prefork (#33916) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And add some trace points. This does not solve [go/event-engine-forkable-prefork-deadlock](http://go/event-engine-forkable-prefork-deadlock), but is a necessary step. So ¯\\_(ツ)_/¯. --- CMakeLists.txt | 2 ++ build_autogenerated.yaml | 3 ++ src/core/BUILD | 2 ++ src/core/lib/event_engine/forkable.cc | 16 ++++++++++- src/core/lib/event_engine/forkable.h | 15 ++++++++++ .../posix_engine/ev_poll_posix.cc | 28 +++++++++++++++++-- .../event_engine/posix_engine/ev_poll_posix.h | 11 +++++++- 7 files changed, 72 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0392d45656177..c0e5a3fb9e97c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12229,6 +12229,7 @@ endif() if(gRPC_BUILD_TESTS) add_executable(forkable_test + src/core/lib/debug/trace.cc src/core/lib/event_engine/forkable.cc test/core/event_engine/forkable_test.cc third_party/googletest/googletest/src/gtest-all.cc @@ -12259,6 +12260,7 @@ target_link_libraries(forkable_test ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ZLIB_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} + absl::statusor gpr ) diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index da1291c235383..82e6d6438c70c 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -7985,11 +7985,14 @@ targets: build: test language: c++ headers: + - src/core/lib/debug/trace.h - src/core/lib/event_engine/forkable.h src: + - src/core/lib/debug/trace.cc - src/core/lib/event_engine/forkable.cc - test/core/event_engine/forkable_test.cc deps: + - absl/status:statusor - gpr - name: format_request_test gtest: true diff --git a/src/core/BUILD b/src/core/BUILD index 9a7a2c179a77b..cda8d1c32ee04 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -1386,6 +1386,7 @@ grpc_cc_library( "//:config_vars", "//:gpr", "//:gpr_platform", + "//:grpc_trace", ], ) @@ -1742,6 +1743,7 @@ grpc_cc_library( "common_event_engine_closures", "event_engine_poller", "event_engine_time_util", + "forkable", "iomgr_port", "posix_event_engine_closure", "posix_event_engine_event_poller", diff --git a/src/core/lib/event_engine/forkable.cc b/src/core/lib/event_engine/forkable.cc index 4906084d274ec..57f60577d1078 100644 --- a/src/core/lib/event_engine/forkable.cc +++ b/src/core/lib/event_engine/forkable.cc @@ -35,6 +35,8 @@ namespace grpc_event_engine { namespace experimental { +grpc_core::TraceFlag grpc_trace_fork(false, "fork"); + namespace { grpc_core::NoDestruct g_mu; bool g_registered ABSL_GUARDED_BY(g_mu){false}; @@ -58,41 +60,52 @@ void RegisterForkHandlers() { grpc_core::MutexLock lock(g_mu.get()); if (!std::exchange(g_registered, true)) { #ifdef GRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK + GRPC_FORK_TRACE_LOG_STRING("RegisterForkHandlers"); pthread_atfork(PrepareFork, PostforkParent, PostforkChild); #endif } } -}; +} void PrepareFork() { if (IsForkEnabled()) { + GRPC_FORK_TRACE_LOG_STRING("PrepareFork"); grpc_core::MutexLock lock(g_mu.get()); for (auto forkable_iter = g_forkables->rbegin(); forkable_iter != g_forkables->rend(); ++forkable_iter) { (*forkable_iter)->PrepareFork(); } + GRPC_FORK_TRACE_LOG_STRING("PrepareFork finished"); } } + void PostforkParent() { if (IsForkEnabled()) { + GRPC_FORK_TRACE_LOG_STRING("PostforkParent"); grpc_core::MutexLock lock(g_mu.get()); for (auto* forkable : *g_forkables) { + GRPC_FORK_TRACE_LOG("Calling PostforkParent for forkable::%p", forkable); forkable->PostforkParent(); } + GRPC_FORK_TRACE_LOG_STRING("PostforkParent finished"); } } void PostforkChild() { if (IsForkEnabled()) { + GRPC_FORK_TRACE_LOG_STRING("PostforkChild"); grpc_core::MutexLock lock(g_mu.get()); for (auto* forkable : *g_forkables) { + GRPC_FORK_TRACE_LOG("Calling PostforkChild for forkable::%p", forkable); forkable->PostforkChild(); } + GRPC_FORK_TRACE_LOG_STRING("PostforkChild finished"); } } void ManageForkable(Forkable* forkable) { if (IsForkEnabled()) { + GRPC_FORK_TRACE_LOG("Manage forkable::%p", forkable); grpc_core::MutexLock lock(g_mu.get()); g_forkables->push_back(forkable); } @@ -100,6 +113,7 @@ void ManageForkable(Forkable* forkable) { void StopManagingForkable(Forkable* forkable) { if (IsForkEnabled()) { + GRPC_FORK_TRACE_LOG("Stop managing forkable::%p", forkable); grpc_core::MutexLock lock(g_mu.get()); auto iter = std::find(g_forkables->begin(), g_forkables->end(), forkable); GPR_ASSERT(iter != g_forkables->end()); diff --git a/src/core/lib/event_engine/forkable.h b/src/core/lib/event_engine/forkable.h index 17fed628e1538..c585a8309881e 100644 --- a/src/core/lib/event_engine/forkable.h +++ b/src/core/lib/event_engine/forkable.h @@ -16,9 +16,24 @@ #include +#include + +#include "src/core/lib/debug/trace.h" + namespace grpc_event_engine { namespace experimental { +extern grpc_core::TraceFlag grpc_trace_fork; + +#define GRPC_FORK_TRACE_LOG(format, ...) \ + do { \ + if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_fork)) { \ + gpr_log(GPR_DEBUG, "[fork] " format, __VA_ARGS__); \ + } \ + } while (0) + +#define GRPC_FORK_TRACE_LOG_STRING(format) GRPC_FORK_TRACE_LOG("%s", format) + // Register fork handlers with the system, enabling fork support. // // This provides pthread-based support for fork events. Any objects that diff --git a/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc b/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc index fdb4ed09becc3..56fd15c26f0d7 100644 --- a/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +++ b/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc @@ -316,7 +316,7 @@ void ResetEventManagerOnFork() { while (!fork_poller_list.empty()) { PollPoller* poller = fork_poller_list.front(); fork_poller_list.pop_front(); - delete poller; + poller->Close(); } gpr_mu_unlock(&fork_fd_list_mu); InitPollPollerPosix(); @@ -566,6 +566,9 @@ bool PollEventHandle::EndPollLocked(bool got_read, bool got_write) { void PollPoller::KickExternal(bool ext) { grpc_core::MutexLock lock(&mu_); + if (closed_) { + return; + } if (was_kicked_) { if (ext) { was_kicked_ext_ = true; @@ -610,7 +613,8 @@ PollPoller::PollPoller(Scheduler* scheduler) was_kicked_(false), was_kicked_ext_(false), num_poll_handles_(0), - poll_handles_list_head_(nullptr) { + poll_handles_list_head_(nullptr), + closed_(false) { wakeup_fd_ = *CreateWakeupFd(); GPR_ASSERT(wakeup_fd_ != nullptr); ForkPollerListAddPoller(this); @@ -622,7 +626,8 @@ PollPoller::PollPoller(Scheduler* scheduler, bool use_phony_poll) was_kicked_(false), was_kicked_ext_(false), num_poll_handles_(0), - poll_handles_list_head_(nullptr) { + poll_handles_list_head_(nullptr), + closed_(false) { wakeup_fd_ = *CreateWakeupFd(); GPR_ASSERT(wakeup_fd_ != nullptr); ForkPollerListAddPoller(this); @@ -829,6 +834,17 @@ void PollPoller::Shutdown() { Unref(); } +void PollPoller::PrepareFork() { Kick(); } +// TODO(vigneshbabu): implement +void PollPoller::PostforkParent() {} +// TODO(vigneshbabu): implement +void PollPoller::PostforkChild() {} + +void PollPoller::Close() { + grpc_core::MutexLock lock(&mu_); + closed_ = true; +} + PollPoller* MakePollPoller(Scheduler* scheduler, bool use_phony_poll) { static bool kPollPollerSupported = InitPollPollerPosix(); if (kPollPollerSupported) { @@ -875,6 +891,12 @@ PollPoller* MakePollPoller(Scheduler* /*scheduler*/, return nullptr; } +void PollPoller::PrepareFork() { grpc_core::Crash("unimplemented"); } +void PollPoller::PostforkParent() { grpc_core::Crash("unimplemented"); } +void PollPoller::PostforkChild() { grpc_core::Crash("unimplemented"); } + +void PollPoller::Close() { grpc_core::Crash("unimplemented"); } + void PollPoller::KickExternal(bool /*ext*/) { grpc_core::Crash("unimplemented"); } diff --git a/src/core/lib/event_engine/posix_engine/ev_poll_posix.h b/src/core/lib/event_engine/posix_engine/ev_poll_posix.h index dac37ea130de0..582991b7c7afc 100644 --- a/src/core/lib/event_engine/posix_engine/ev_poll_posix.h +++ b/src/core/lib/event_engine/posix_engine/ev_poll_posix.h @@ -27,6 +27,7 @@ #include +#include "src/core/lib/event_engine/forkable.h" #include "src/core/lib/event_engine/poller.h" #include "src/core/lib/event_engine/posix_engine/event_poller.h" #include "src/core/lib/event_engine/posix_engine/wakeup_fd_posix.h" @@ -38,7 +39,7 @@ namespace experimental { class PollEventHandle; // Definition of poll based poller. -class PollPoller : public PosixEventPoller { +class PollPoller : public PosixEventPoller, public Forkable { public: explicit PollPoller(Scheduler* scheduler); PollPoller(Scheduler* scheduler, bool use_phony_poll); @@ -54,6 +55,13 @@ class PollPoller : public PosixEventPoller { bool CanTrackErrors() const override { return false; } ~PollPoller() override; + // Forkable + void PrepareFork() override; + void PostforkParent() override; + void PostforkChild() override; + + void Close(); + private: void Ref() { ref_count_.fetch_add(1, std::memory_order_relaxed); } void Unref() { @@ -83,6 +91,7 @@ class PollPoller : public PosixEventPoller { int num_poll_handles_ ABSL_GUARDED_BY(mu_); PollEventHandle* poll_handles_list_head_ ABSL_GUARDED_BY(mu_) = nullptr; std::unique_ptr wakeup_fd_; + bool closed_ ABSL_GUARDED_BY(mu_); }; // Return an instance of a poll based poller tied to the specified scheduler. From 1f05719c5618b379a559e2286f274e70198043c3 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 4 Aug 2023 12:35:30 -0700 Subject: [PATCH 125/205] [end2end] Ensure deterministic ordering of tests (#33984) This doesn't matter for gtest (it does its own sorting later), but for the fuzzers this will probably save a bit of churn in the corpus and lead to faster discovery of interesting cases. --- test/core/end2end/end2end_tests.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/core/end2end/end2end_tests.cc b/test/core/end2end/end2end_tests.cc index 7500feb0181a8..6c15e1f0d3c2b 100644 --- a/test/core/end2end/end2end_tests.cc +++ b/test/core/end2end/end2end_tests.cc @@ -20,6 +20,7 @@ #include "test/core/end2end/end2end_tests.h" #include +#include #include "absl/memory/memory.h" #include "absl/random/random.h" @@ -370,6 +371,11 @@ std::vector KeysFrom(const Map& map) { std::vector CoreEnd2endTestRegistry::AllTests() { std::vector tests; + // Sort inputs to ensure outputs are deterministic + for (auto& suite_configs : suites_) { + std::sort(suite_configs.second.begin(), suite_configs.second.end(), + [](const auto* a, const auto* b) { return a->name < b->name; }); + } for (const auto& suite_configs : suites_) { if (suite_configs.second.empty()) { CrashWithStdio( From a70f8a80d2a0e58da9d5c09807f82491d1617444 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Fri, 4 Aug 2023 13:15:25 -0700 Subject: [PATCH 126/205] [CallTracer] Allow registering multiple call tracers on a call context (#33928) This PR adds in delegating call tracers that work like so - If this is the first call tracer that is being added onto the call context, just add it as earlier. If this is the second call tracer that is being added onto the call context, create a delegating call tracer that contains a list of call tracers (including the first call tracer). Any more call tracers added, just get added to the list of tracers in the delegating call tracer. (This is not yet used other than through tests.) --- CMakeLists.txt | 38 ++++ build_autogenerated.yaml | 10 + src/core/lib/channel/call_tracer.cc | 289 ++++++++++++++++++++++++++ src/core/lib/channel/call_tracer.h | 16 ++ test/core/channel/BUILD | 13 ++ test/core/channel/call_tracer_test.cc | 230 ++++++++++++++++++++ tools/run_tests/generated/tests.json | 24 +++ 7 files changed, 620 insertions(+) create mode 100644 test/core/channel/call_tracer_test.cc diff --git a/CMakeLists.txt b/CMakeLists.txt index c0e5a3fb9e97c..dc941c0820cc2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -862,6 +862,7 @@ if(gRPC_BUILD_TESTS) add_dependencies(buildtests_cxx call_creds_test) add_dependencies(buildtests_cxx call_finalization_test) add_dependencies(buildtests_cxx call_host_override_test) + add_dependencies(buildtests_cxx call_tracer_test) add_dependencies(buildtests_cxx cancel_after_accept_test) add_dependencies(buildtests_cxx cancel_after_client_done_test) add_dependencies(buildtests_cxx cancel_after_invoke_test) @@ -7463,6 +7464,43 @@ target_link_libraries(call_host_override_test ) +endif() +if(gRPC_BUILD_TESTS) + +add_executable(call_tracer_test + test/core/channel/call_tracer_test.cc + third_party/googletest/googletest/src/gtest-all.cc + third_party/googletest/googlemock/src/gmock-all.cc +) +target_compile_features(call_tracer_test PUBLIC cxx_std_14) +target_include_directories(call_tracer_test + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + ${_gRPC_RE2_INCLUDE_DIR} + ${_gRPC_SSL_INCLUDE_DIR} + ${_gRPC_UPB_GENERATED_DIR} + ${_gRPC_UPB_GRPC_GENERATED_DIR} + ${_gRPC_UPB_INCLUDE_DIR} + ${_gRPC_XXHASH_INCLUDE_DIR} + ${_gRPC_ZLIB_INCLUDE_DIR} + third_party/googletest/googletest/include + third_party/googletest/googletest + third_party/googletest/googlemock/include + third_party/googletest/googlemock + ${_gRPC_PROTO_GENS_DIR} +) + +target_link_libraries(call_tracer_test + ${_gRPC_BASELIB_LIBRARIES} + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ZLIB_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + grpc_test_util +) + + endif() if(gRPC_BUILD_TESTS) diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 82e6d6438c70c..607b4493de8a5 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -5348,6 +5348,16 @@ targets: - grpc_authorization_provider - grpc_unsecure - grpc_test_util +- name: call_tracer_test + gtest: true + build: test + language: c++ + headers: [] + src: + - test/core/channel/call_tracer_test.cc + deps: + - grpc_test_util + uses_polling: false - name: cancel_after_accept_test gtest: true build: test diff --git a/src/core/lib/channel/call_tracer.cc b/src/core/lib/channel/call_tracer.cc index e6dd42e57ed03..ae1e477b5f11b 100644 --- a/src/core/lib/channel/call_tracer.cc +++ b/src/core/lib/channel/call_tracer.cc @@ -20,6 +20,14 @@ #include "src/core/lib/channel/call_tracer.h" +#include +#include +#include + +#include + +#include "src/core/lib/promise/context.h" + namespace grpc_core { // @@ -27,6 +35,7 @@ namespace grpc_core { // namespace { + ServerCallTracerFactory* g_server_call_tracer_factory_ = nullptr; const char* kServerCallTracerFactoryChannelArgName = @@ -48,4 +57,284 @@ absl::string_view ServerCallTracerFactory::ChannelArgName() { return kServerCallTracerFactoryChannelArgName; } +class DelegatingClientCallTracer : public ClientCallTracer { + public: + class DelegatingClientCallAttemptTracer + : public ClientCallTracer::CallAttemptTracer { + public: + explicit DelegatingClientCallAttemptTracer( + std::vector tracers) + : tracers_(std::move(tracers)) { + GPR_DEBUG_ASSERT(!tracers_.empty()); + } + ~DelegatingClientCallAttemptTracer() override {} + void RecordSendInitialMetadata( + grpc_metadata_batch* send_initial_metadata) override { + for (auto* tracer : tracers_) { + tracer->RecordSendInitialMetadata(send_initial_metadata); + } + } + void RecordSendTrailingMetadata( + grpc_metadata_batch* send_trailing_metadata) override { + for (auto* tracer : tracers_) { + tracer->RecordSendTrailingMetadata(send_trailing_metadata); + } + } + void RecordSendMessage(const SliceBuffer& send_message) override { + for (auto* tracer : tracers_) { + tracer->RecordSendMessage(send_message); + } + } + void RecordSendCompressedMessage( + const SliceBuffer& send_compressed_message) override { + for (auto* tracer : tracers_) { + tracer->RecordSendCompressedMessage(send_compressed_message); + } + } + void RecordReceivedInitialMetadata( + grpc_metadata_batch* recv_initial_metadata) override { + for (auto* tracer : tracers_) { + tracer->RecordReceivedInitialMetadata(recv_initial_metadata); + } + } + void RecordReceivedMessage(const SliceBuffer& recv_message) override { + for (auto* tracer : tracers_) { + tracer->RecordReceivedMessage(recv_message); + } + } + void RecordReceivedDecompressedMessage( + const SliceBuffer& recv_decompressed_message) override { + for (auto* tracer : tracers_) { + tracer->RecordReceivedDecompressedMessage(recv_decompressed_message); + } + } + void RecordCancel(grpc_error_handle cancel_error) override { + for (auto* tracer : tracers_) { + tracer->RecordCancel(cancel_error); + } + } + void RecordReceivedTrailingMetadata( + absl::Status status, grpc_metadata_batch* recv_trailing_metadata, + const grpc_transport_stream_stats* transport_stream_stats) override { + for (auto* tracer : tracers_) { + tracer->RecordReceivedTrailingMetadata(status, recv_trailing_metadata, + transport_stream_stats); + } + } + void RecordEnd(const gpr_timespec& latency) override { + for (auto* tracer : tracers_) { + tracer->RecordEnd(latency); + } + } + void RecordAnnotation(absl::string_view annotation) override { + for (auto* tracer : tracers_) { + tracer->RecordAnnotation(annotation); + } + } + void RecordAnnotation(const Annotation& annotation) override { + for (auto* tracer : tracers_) { + tracer->RecordAnnotation(annotation); + } + } + std::string TraceId() override { return tracers_[0]->TraceId(); } + std::string SpanId() override { return tracers_[0]->SpanId(); } + bool IsSampled() override { return tracers_[0]->IsSampled(); } + bool IsDelegatingTracer() override { return true; } + + private: + // There is no additional synchronization needed since filters/interceptors + // will be adding call tracers to the context and these are already + // synchronized through promises/call combiners (single promise running per + // call at any moment). + std::vector tracers_; + }; + explicit DelegatingClientCallTracer(ClientCallTracer* tracer) + : tracers_{tracer} {} + ~DelegatingClientCallTracer() override {} + CallAttemptTracer* StartNewAttempt(bool is_transparent_retry) override { + std::vector attempt_tracers; + attempt_tracers.reserve(tracers_.size()); + for (auto* tracer : tracers_) { + auto* attempt_tracer = tracer->StartNewAttempt(is_transparent_retry); + GPR_DEBUG_ASSERT(attempt_tracer != nullptr); + attempt_tracers.push_back(attempt_tracer); + } + return GetContext()->ManagedNew( + std::move(attempt_tracers)); + } + + void RecordAnnotation(absl::string_view annotation) override { + for (auto* tracer : tracers_) { + tracer->RecordAnnotation(annotation); + } + } + void RecordAnnotation(const Annotation& annotation) override { + for (auto* tracer : tracers_) { + tracer->RecordAnnotation(annotation); + } + } + std::string TraceId() override { return tracers_[0]->TraceId(); } + std::string SpanId() override { return tracers_[0]->SpanId(); } + bool IsSampled() override { return tracers_[0]->IsSampled(); } + bool IsDelegatingTracer() override { return true; } + + // There is no additional synchronization needed since filters/interceptors + // will be adding call tracers to the context and these are already + // synchronized through promises/call combiners (single promise running per + // call at any moment). + void AddTracer(ClientCallTracer* tracer) { tracers_.push_back(tracer); } + + private: + std::vector tracers_; +}; + +class DelegatingServerCallTracer : public ServerCallTracer { + public: + explicit DelegatingServerCallTracer(ServerCallTracer* tracer) + : tracers_{tracer} {} + ~DelegatingServerCallTracer() override {} + void RecordSendInitialMetadata( + grpc_metadata_batch* send_initial_metadata) override { + for (auto* tracer : tracers_) { + tracer->RecordSendInitialMetadata(send_initial_metadata); + } + } + void RecordSendTrailingMetadata( + grpc_metadata_batch* send_trailing_metadata) override { + for (auto* tracer : tracers_) { + tracer->RecordSendTrailingMetadata(send_trailing_metadata); + } + } + void RecordSendMessage(const SliceBuffer& send_message) override { + for (auto* tracer : tracers_) { + tracer->RecordSendMessage(send_message); + } + } + void RecordSendCompressedMessage( + const SliceBuffer& send_compressed_message) override { + for (auto* tracer : tracers_) { + tracer->RecordSendCompressedMessage(send_compressed_message); + } + } + void RecordReceivedInitialMetadata( + grpc_metadata_batch* recv_initial_metadata) override { + for (auto* tracer : tracers_) { + tracer->RecordReceivedInitialMetadata(recv_initial_metadata); + } + } + void RecordReceivedMessage(const SliceBuffer& recv_message) override { + for (auto* tracer : tracers_) { + tracer->RecordReceivedMessage(recv_message); + } + } + void RecordReceivedDecompressedMessage( + const SliceBuffer& recv_decompressed_message) override { + for (auto* tracer : tracers_) { + tracer->RecordReceivedDecompressedMessage(recv_decompressed_message); + } + } + void RecordCancel(grpc_error_handle cancel_error) override { + for (auto* tracer : tracers_) { + tracer->RecordCancel(cancel_error); + } + } + void RecordReceivedTrailingMetadata( + grpc_metadata_batch* recv_trailing_metadata) override { + for (auto* tracer : tracers_) { + tracer->RecordReceivedTrailingMetadata(recv_trailing_metadata); + } + } + void RecordEnd(const grpc_call_final_info* final_info) override { + for (auto* tracer : tracers_) { + tracer->RecordEnd(final_info); + } + } + void RecordAnnotation(absl::string_view annotation) override { + for (auto* tracer : tracers_) { + tracer->RecordAnnotation(annotation); + } + } + void RecordAnnotation(const Annotation& annotation) override { + for (auto* tracer : tracers_) { + tracer->RecordAnnotation(annotation); + } + } + std::string TraceId() override { return tracers_[0]->TraceId(); } + std::string SpanId() override { return tracers_[0]->SpanId(); } + bool IsSampled() override { return tracers_[0]->IsSampled(); } + bool IsDelegatingTracer() override { return true; } + + void AddTracer(ServerCallTracer* tracer) { tracers_.push_back(tracer); } + + private: + // The ServerCallTracerFilter will be responsible for making sure that the + // tracers are added in a thread-safe manner. It is imagined that the filter + // will just invoke the factories in the server call tracer factory list + // sequentially, removing the need for any synchronization. + std::vector tracers_; +}; + +void AddClientCallTracerToContext(grpc_call_context_element* call_context, + ClientCallTracer* tracer) { + if (call_context[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE].value == + nullptr) { + // This is the first call tracer. Set it directly. + call_context[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE].value = tracer; + call_context[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE].destroy = + nullptr; + } else { + // There was already a call tracer present. + auto* orig_tracer = static_cast( + call_context[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE].value); + if (orig_tracer->IsDelegatingTracer()) { + // We already created a delegating tracer. Just add the new tracer to the + // list. + static_cast(orig_tracer)->AddTracer(tracer); + } else { + // Create a new delegating tracer and add the first tracer and the new + // tracer to the list. + auto* delegating_tracer = + GetContext()->ManagedNew( + orig_tracer); + call_context[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE].value = + delegating_tracer; + delegating_tracer->AddTracer(tracer); + } + } +} + +void AddServerCallTracerToContext(grpc_call_context_element* call_context, + ServerCallTracer* tracer) { + GPR_DEBUG_ASSERT( + call_context[GRPC_CONTEXT_CALL_TRACER].value == + call_context[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE].value); + if (call_context[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE].value == + nullptr) { + // This is the first call tracer. Set it directly. + call_context[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE].value = tracer; + call_context[GRPC_CONTEXT_CALL_TRACER].value = tracer; + call_context[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE].destroy = + nullptr; + } else { + // There was already a call tracer present. + auto* orig_tracer = static_cast( + call_context[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE].value); + if (orig_tracer->IsDelegatingTracer()) { + // We already created a delegating tracer. Just add the new tracer to the + // list. + static_cast(orig_tracer)->AddTracer(tracer); + } else { + // Create a new delegating tracer and add the first tracer and the new + // tracer to the list. + auto* delegating_tracer = + GetContext()->ManagedNew( + orig_tracer); + call_context[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE].value = + delegating_tracer; + call_context[GRPC_CONTEXT_CALL_TRACER].value = delegating_tracer; + delegating_tracer->AddTracer(tracer); + } + } +} + } // namespace grpc_core diff --git a/src/core/lib/channel/call_tracer.h b/src/core/lib/channel/call_tracer.h index 9015bd543b75c..9fb10e67711de 100644 --- a/src/core/lib/channel/call_tracer.h +++ b/src/core/lib/channel/call_tracer.h @@ -30,6 +30,7 @@ #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_stack.h" +#include "src/core/lib/channel/context.h" #include "src/core/lib/config/core_configuration.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/resource_quota/arena.h" @@ -76,6 +77,10 @@ class CallTracerAnnotationInterface { virtual std::string TraceId() = 0; virtual std::string SpanId() = 0; virtual bool IsSampled() = 0; + // Indicates whether this tracer is a delegating tracer or not. + // `DelegatingClientCallTracer`, `DelegatingClientCallAttemptTracer` and + // `DelegatingServerCallTracer` are the only delegating call tracers. + virtual bool IsDelegatingTracer() { return false; } }; // The base class for CallAttemptTracer and ServerCallTracer. @@ -180,6 +185,17 @@ class ServerCallTracerFactory { void RegisterServerCallTracerFilter(CoreConfiguration::Builder* builder); +// Convenience functions to add call tracers to a call context. Allows setting +// multiple call tracers to a single call. It is only valid to add client call +// tracers before the client_channel filter sees the send_initial_metadata op. +void AddClientCallTracerToContext(grpc_call_context_element* call_context, + ClientCallTracer* tracer); + +// TODO(yashykt): We want server call tracers to be registered through the +// ServerCallTracerFactory, which has yet to be made into a list. +void AddServerCallTracerToContext(grpc_call_context_element* call_context, + ServerCallTracer* tracer); + } // namespace grpc_core #endif // GRPC_SRC_CORE_LIB_CHANNEL_CALL_TRACER_H diff --git a/test/core/channel/BUILD b/test/core/channel/BUILD index 9fa2ffc6bdde7..87c7768127b02 100644 --- a/test/core/channel/BUILD +++ b/test/core/channel/BUILD @@ -18,6 +18,19 @@ grpc_package(name = "test/core/channel") licenses(["notice"]) +grpc_cc_test( + name = "call_tracer_test", + srcs = ["call_tracer_test.cc"], + external_deps = ["gtest"], + language = "C++", + uses_event_engine = False, + uses_polling = False, + deps = [ + "//:grpc", + "//test/core/util:grpc_test_util", + ], +) + grpc_cc_test( name = "channel_args_test", srcs = ["channel_args_test.cc"], diff --git a/test/core/channel/call_tracer_test.cc b/test/core/channel/call_tracer_test.cc new file mode 100644 index 0000000000000..ceb6cb5ee459a --- /dev/null +++ b/test/core/channel/call_tracer_test.cc @@ -0,0 +1,230 @@ +// +// +// Copyright 2023 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#include "src/core/lib/channel/call_tracer.h" + +#include +#include +#include + +#include "gtest/gtest.h" + +#include +#include + +#include "src/core/lib/gprpp/ref_counted_ptr.h" +#include "src/core/lib/promise/context.h" +#include "src/core/lib/resource_quota/memory_quota.h" +#include "src/core/lib/resource_quota/resource_quota.h" +#include "test/core/util/test_config.h" + +namespace grpc_core { +namespace { + +class FakeClientCallTracer : public ClientCallTracer { + public: + class FakeClientCallAttemptTracer + : public ClientCallTracer::CallAttemptTracer { + public: + explicit FakeClientCallAttemptTracer( + std::vector* annotation_logger) + : annotation_logger_(annotation_logger) {} + ~FakeClientCallAttemptTracer() override {} + void RecordSendInitialMetadata( + grpc_metadata_batch* /*send_initial_metadata*/) override {} + void RecordSendTrailingMetadata( + grpc_metadata_batch* /*send_trailing_metadata*/) override {} + void RecordSendMessage(const SliceBuffer& /*send_message*/) override {} + void RecordSendCompressedMessage( + const SliceBuffer& /*send_compressed_message*/) override {} + void RecordReceivedInitialMetadata( + grpc_metadata_batch* /*recv_initial_metadata*/) override {} + void RecordReceivedMessage(const SliceBuffer& /*recv_message*/) override {} + void RecordReceivedDecompressedMessage( + const SliceBuffer& /*recv_decompressed_message*/) override {} + void RecordCancel(grpc_error_handle /*cancel_error*/) override {} + void RecordReceivedTrailingMetadata( + absl::Status /*status*/, + grpc_metadata_batch* /*recv_trailing_metadata*/, + const grpc_transport_stream_stats* /*transport_stream_stats*/) + override {} + void RecordEnd(const gpr_timespec& /*latency*/) override { delete this; } + void RecordAnnotation(absl::string_view annotation) override { + annotation_logger_->push_back(std::string(annotation)); + } + void RecordAnnotation(const Annotation& /*annotation*/) override {} + std::string TraceId() override { return ""; } + std::string SpanId() override { return ""; } + bool IsSampled() override { return false; } + + private: + std::vector* annotation_logger_; + }; + + explicit FakeClientCallTracer(std::vector* annotation_logger) + : annotation_logger_(annotation_logger) {} + ~FakeClientCallTracer() override {} + CallAttemptTracer* StartNewAttempt(bool /*is_transparent_retry*/) override { + return GetContext()->ManagedNew( + annotation_logger_); + } + + void RecordAnnotation(absl::string_view annotation) override { + annotation_logger_->push_back(std::string(annotation)); + } + void RecordAnnotation(const Annotation& /*annotation*/) override {} + std::string TraceId() override { return ""; } + std::string SpanId() override { return ""; } + bool IsSampled() override { return false; } + + private: + std::vector* annotation_logger_; +}; + +class FakeServerCallTracer : public ServerCallTracer { + public: + explicit FakeServerCallTracer(std::vector* annotation_logger) + : annotation_logger_(annotation_logger) {} + ~FakeServerCallTracer() override {} + void RecordSendInitialMetadata( + grpc_metadata_batch* /*send_initial_metadata*/) override {} + void RecordSendTrailingMetadata( + grpc_metadata_batch* /*send_trailing_metadata*/) override {} + void RecordSendMessage(const SliceBuffer& /*send_message*/) override {} + void RecordSendCompressedMessage( + const SliceBuffer& /*send_compressed_message*/) override {} + void RecordReceivedInitialMetadata( + grpc_metadata_batch* /*recv_initial_metadata*/) override {} + void RecordReceivedMessage(const SliceBuffer& /*recv_message*/) override {} + void RecordReceivedDecompressedMessage( + const SliceBuffer& /*recv_decompressed_message*/) override {} + void RecordCancel(grpc_error_handle /*cancel_error*/) override {} + void RecordReceivedTrailingMetadata( + grpc_metadata_batch* /*recv_trailing_metadata*/) override {} + void RecordEnd(const grpc_call_final_info* /*final_info*/) override {} + void RecordAnnotation(absl::string_view annotation) override { + annotation_logger_->push_back(std::string(annotation)); + } + void RecordAnnotation(const Annotation& /*annotation*/) override {} + std::string TraceId() override { return ""; } + std::string SpanId() override { return ""; } + bool IsSampled() override { return false; } + + private: + std::vector* annotation_logger_; +}; + +class CallTracerTest : public ::testing::Test { + protected: + void SetUp() override { + memory_allocator_ = new MemoryAllocator( + ResourceQuota::Default()->memory_quota()->CreateMemoryAllocator( + "test")); + arena_ = Arena::Create(1024, memory_allocator_); + } + + void TearDown() override { + arena_->Destroy(); + delete memory_allocator_; + } + + MemoryAllocator* memory_allocator_ = nullptr; + Arena* arena_ = nullptr; + grpc_call_context_element context_[GRPC_CONTEXT_COUNT] = {}; + std::vector annotation_logger_; +}; + +TEST_F(CallTracerTest, BasicClientCallTracer) { + FakeClientCallTracer client_call_tracer(&annotation_logger_); + AddClientCallTracerToContext(context_, &client_call_tracer); + static_cast( + context_[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE].value) + ->RecordAnnotation("Test"); + EXPECT_EQ(annotation_logger_, std::vector{"Test"}); +} + +TEST_F(CallTracerTest, MultipleClientCallTracers) { + promise_detail::Context arena_ctx(arena_); + FakeClientCallTracer client_call_tracer1(&annotation_logger_); + FakeClientCallTracer client_call_tracer2(&annotation_logger_); + FakeClientCallTracer client_call_tracer3(&annotation_logger_); + AddClientCallTracerToContext(context_, &client_call_tracer1); + AddClientCallTracerToContext(context_, &client_call_tracer2); + AddClientCallTracerToContext(context_, &client_call_tracer3); + static_cast( + context_[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE].value) + ->RecordAnnotation("Test"); + EXPECT_EQ(annotation_logger_, + std::vector({"Test", "Test", "Test"})); +} + +TEST_F(CallTracerTest, MultipleClientCallAttemptTracers) { + promise_detail::Context arena_ctx(arena_); + FakeClientCallTracer client_call_tracer1(&annotation_logger_); + FakeClientCallTracer client_call_tracer2(&annotation_logger_); + FakeClientCallTracer client_call_tracer3(&annotation_logger_); + AddClientCallTracerToContext(context_, &client_call_tracer1); + AddClientCallTracerToContext(context_, &client_call_tracer2); + AddClientCallTracerToContext(context_, &client_call_tracer3); + auto* attempt_tracer = + static_cast( + context_[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE].value) + ->StartNewAttempt(true /* is_transparent_retry */); + attempt_tracer->RecordAnnotation("Test"); + EXPECT_EQ(annotation_logger_, + std::vector({"Test", "Test", "Test"})); +} + +TEST_F(CallTracerTest, BasicServerCallTracerTest) { + FakeServerCallTracer server_call_tracer(&annotation_logger_); + AddServerCallTracerToContext(context_, &server_call_tracer); + static_cast( + context_[GRPC_CONTEXT_CALL_TRACER].value) + ->RecordAnnotation("Test"); + static_cast( + context_[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE].value) + ->RecordAnnotation("Test"); + EXPECT_EQ(annotation_logger_, std::vector({"Test", "Test"})); +} + +TEST_F(CallTracerTest, MultipleServerCallTracers) { + promise_detail::Context arena_ctx(arena_); + FakeServerCallTracer server_call_tracer1(&annotation_logger_); + FakeServerCallTracer server_call_tracer2(&annotation_logger_); + FakeServerCallTracer server_call_tracer3(&annotation_logger_); + AddServerCallTracerToContext(context_, &server_call_tracer1); + AddServerCallTracerToContext(context_, &server_call_tracer2); + AddServerCallTracerToContext(context_, &server_call_tracer3); + static_cast( + context_[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE].value) + ->RecordAnnotation("Test"); + EXPECT_EQ(annotation_logger_, + std::vector({"Test", "Test", "Test"})); +} + +} // namespace +} // namespace grpc_core + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + grpc::testing::TestEnvironment env(&argc, argv); + grpc_init(); + auto r = RUN_ALL_TESTS(); + grpc_shutdown(); + return r; +} diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index 04210d5b1c9d4..92eba7d4b901f 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -1301,6 +1301,30 @@ ], "uses_polling": true }, + { + "args": [], + "benchmark": false, + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": true, + "language": "c++", + "name": "call_tracer_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "uses_polling": false + }, { "args": [], "benchmark": false, From 862e6d0346744df37b56448da97f84bceb97ffa0 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 4 Aug 2023 13:26:38 -0700 Subject: [PATCH 127/205] [fuzzing] Increase deadline, fix b/292258333 (#33877) --- ...ry_send_recv_batch_fuzzer-5154706632540160 | 1797 +++++++++++++++++ .../end2end/tests/retry_send_recv_batch.cc | 2 +- 2 files changed, 1798 insertions(+), 1 deletion(-) create mode 100644 test/core/end2end/end2end_test_corpus/retry_send_recv_batch/clusterfuzz-testcase-minimized-retry_send_recv_batch_fuzzer-5154706632540160 diff --git a/test/core/end2end/end2end_test_corpus/retry_send_recv_batch/clusterfuzz-testcase-minimized-retry_send_recv_batch_fuzzer-5154706632540160 b/test/core/end2end/end2end_test_corpus/retry_send_recv_batch/clusterfuzz-testcase-minimized-retry_send_recv_batch_fuzzer-5154706632540160 new file mode 100644 index 0000000000000..8a727808a9230 --- /dev/null +++ b/test/core/end2end/end2end_test_corpus/retry_send_recv_batch/clusterfuzz-testcase-minimized-retry_send_recv_batch_fuzzer-5154706632540160 @@ -0,0 +1,1797 @@ +test_id: 2049 +event_engine_actions { + run_delay: 0 + run_delay: 2449958197289549828 + run_delay: 9223372002495037439 + run_delay: 2634022912 + run_delay: 2449958197289549824 + run_delay: 31653240701452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 0 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958199437033472 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 1 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 232 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 26341452288 + run_delay: 9223372036854775807 + run_delay: 232 + run_delay: 2449958197289549824 + run_delay: 2634022912 + run_delay: 9223372036854775807 + run_delay: 8031325510485147648 + assign_ports: 0 + assign_ports: 1694498816 + assign_ports: 2201157632 + connections { + write_size: 0 + write_size: 989855754 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 6619136 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 28521 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 16776960 + write_size: 0 + write_size: 620756992 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 788529152 + write_size: 0 + write_size: 0 + write_size: 0 + } + connections { + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 32 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 1886680168 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 989855754 + write_size: 4 + write_size: 16 + write_size: 0 + write_size: 4 + write_size: 0 + write_size: 16 + write_size: 4 + write_size: 32 + write_size: 32 + write_size: 0 + write_size: 32 + write_size: 0 + write_size: 32 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 32 + write_size: 32 + write_size: 0 + write_size: 0 + } +} diff --git a/test/core/end2end/tests/retry_send_recv_batch.cc b/test/core/end2end/tests/retry_send_recv_batch.cc index 95ede4b54cc28..01e488cf36c93 100644 --- a/test/core/end2end/tests/retry_send_recv_batch.cc +++ b/test/core/end2end/tests/retry_send_recv_batch.cc @@ -49,7 +49,7 @@ CORE_END2END_TEST(RetryTest, RetrySendRecvBatch) { " } ]\n" "}")); auto c = - NewClientCall("/service/method").Timeout(Duration::Seconds(5)).Create(); + NewClientCall("/service/method").Timeout(Duration::Minutes(1)).Create(); // Client starts batch with send_initial_metadata and recv_initial_metadata. IncomingMetadata server_initial_metadata; c.NewBatch(1).SendInitialMetadata({}).RecvInitialMetadata( From c9fe64c409f743a29fe8eb82350cb920acd74e5d Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 4 Aug 2023 13:34:22 -0700 Subject: [PATCH 128/205] Revert "[promises] Enable promise-based calls on server side for OSS build" (#33989) Reverts grpc/grpc#33945 --- bazel/experiments.bzl | 60 ++++++++++++------------- src/core/lib/experiments/experiments.cc | 6 +-- src/core/lib/experiments/experiments.h | 9 ++-- src/core/lib/experiments/rollouts.yaml | 2 +- 4 files changed, 37 insertions(+), 40 deletions(-) diff --git a/bazel/experiments.bzl b/bazel/experiments.bzl index ae4e15060a594..1bd377317c355 100644 --- a/bazel/experiments.bzl +++ b/bazel/experiments.bzl @@ -27,8 +27,12 @@ EXPERIMENTS = { "core_end2end_test": [ "event_engine_listener", "promise_based_client_call", + "promise_based_server_call", "unique_metadata_strings", ], + "cpp_end2end_test": [ + "promise_based_server_call", + ], "endpoint_test": [ "tcp_frame_size_tuning", "tcp_rcv_lowat", @@ -44,26 +48,22 @@ EXPERIMENTS = { "lame_client_test": [ "promise_based_client_call", ], + "logging_test": [ + "promise_based_server_call", + ], "resource_quota_test": [ "free_large_allocator", "memory_pressure_controller", "unconstrained_max_quota_buffer_size", ], + "xds_end2end_test": [ + "promise_based_server_call", + ], }, "on": { "core_end2end_test": [ - "promise_based_server_call", "work_stealing", ], - "cpp_end2end_test": [ - "promise_based_server_call", - ], - "logging_test": [ - "promise_based_server_call", - ], - "xds_end2end_test": [ - "promise_based_server_call", - ], }, }, "ios": { @@ -76,8 +76,12 @@ EXPERIMENTS = { "core_end2end_test": [ "event_engine_listener", "promise_based_client_call", + "promise_based_server_call", "unique_metadata_strings", ], + "cpp_end2end_test": [ + "promise_based_server_call", + ], "endpoint_test": [ "tcp_frame_size_tuning", "tcp_rcv_lowat", @@ -93,26 +97,22 @@ EXPERIMENTS = { "lame_client_test": [ "promise_based_client_call", ], + "logging_test": [ + "promise_based_server_call", + ], "resource_quota_test": [ "free_large_allocator", "memory_pressure_controller", "unconstrained_max_quota_buffer_size", ], + "xds_end2end_test": [ + "promise_based_server_call", + ], }, "on": { "core_end2end_test": [ - "promise_based_server_call", "work_stealing", ], - "cpp_end2end_test": [ - "promise_based_server_call", - ], - "logging_test": [ - "promise_based_server_call", - ], - "xds_end2end_test": [ - "promise_based_server_call", - ], }, }, "posix": { @@ -129,8 +129,12 @@ EXPERIMENTS = { "event_engine_client", "event_engine_listener", "promise_based_client_call", + "promise_based_server_call", "unique_metadata_strings", ], + "cpp_end2end_test": [ + "promise_based_server_call", + ], "endpoint_test": [ "tcp_frame_size_tuning", "tcp_rcv_lowat", @@ -149,6 +153,9 @@ EXPERIMENTS = { "lame_client_test": [ "promise_based_client_call", ], + "logging_test": [ + "promise_based_server_call", + ], "resolver_component_tests_runner_invoker": [ "event_engine_dns", ], @@ -157,21 +164,14 @@ EXPERIMENTS = { "memory_pressure_controller", "unconstrained_max_quota_buffer_size", ], + "xds_end2end_test": [ + "promise_based_server_call", + ], }, "on": { "core_end2end_test": [ - "promise_based_server_call", "work_stealing", ], - "cpp_end2end_test": [ - "promise_based_server_call", - ], - "logging_test": [ - "promise_based_server_call", - ], - "xds_end2end_test": [ - "promise_based_server_call", - ], }, }, } diff --git a/src/core/lib/experiments/experiments.cc b/src/core/lib/experiments/experiments.cc index db1f587bc9355..c7b177071d037 100644 --- a/src/core/lib/experiments/experiments.cc +++ b/src/core/lib/experiments/experiments.cc @@ -131,7 +131,7 @@ const ExperimentMetadata g_experiment_metadata[] = { {"free_large_allocator", description_free_large_allocator, additional_constraints_free_large_allocator, false, true}, {"promise_based_server_call", description_promise_based_server_call, - additional_constraints_promise_based_server_call, true, true}, + additional_constraints_promise_based_server_call, false, true}, {"transport_supplies_client_latency", description_transport_supplies_client_latency, additional_constraints_transport_supplies_client_latency, false, true}, @@ -273,7 +273,7 @@ const ExperimentMetadata g_experiment_metadata[] = { {"free_large_allocator", description_free_large_allocator, additional_constraints_free_large_allocator, false, true}, {"promise_based_server_call", description_promise_based_server_call, - additional_constraints_promise_based_server_call, true, true}, + additional_constraints_promise_based_server_call, false, true}, {"transport_supplies_client_latency", description_transport_supplies_client_latency, additional_constraints_transport_supplies_client_latency, false, true}, @@ -415,7 +415,7 @@ const ExperimentMetadata g_experiment_metadata[] = { {"free_large_allocator", description_free_large_allocator, additional_constraints_free_large_allocator, false, true}, {"promise_based_server_call", description_promise_based_server_call, - additional_constraints_promise_based_server_call, true, true}, + additional_constraints_promise_based_server_call, false, true}, {"transport_supplies_client_latency", description_transport_supplies_client_latency, additional_constraints_transport_supplies_client_latency, false, true}, diff --git a/src/core/lib/experiments/experiments.h b/src/core/lib/experiments/experiments.h index 998d0a3b0ce36..3ccdd6f19f04d 100644 --- a/src/core/lib/experiments/experiments.h +++ b/src/core/lib/experiments/experiments.h @@ -69,8 +69,7 @@ inline bool IsEventEngineClientEnabled() { return false; } inline bool IsMonitoringExperimentEnabled() { return true; } inline bool IsPromiseBasedClientCallEnabled() { return false; } inline bool IsFreeLargeAllocatorEnabled() { return false; } -#define GRPC_EXPERIMENT_IS_INCLUDED_PROMISE_BASED_SERVER_CALL -inline bool IsPromiseBasedServerCallEnabled() { return true; } +inline bool IsPromiseBasedServerCallEnabled() { return false; } inline bool IsTransportSuppliesClientLatencyEnabled() { return false; } inline bool IsEventEngineListenerEnabled() { return false; } inline bool IsScheduleCancellationOverWriteEnabled() { return false; } @@ -104,8 +103,7 @@ inline bool IsEventEngineClientEnabled() { return false; } inline bool IsMonitoringExperimentEnabled() { return true; } inline bool IsPromiseBasedClientCallEnabled() { return false; } inline bool IsFreeLargeAllocatorEnabled() { return false; } -#define GRPC_EXPERIMENT_IS_INCLUDED_PROMISE_BASED_SERVER_CALL -inline bool IsPromiseBasedServerCallEnabled() { return true; } +inline bool IsPromiseBasedServerCallEnabled() { return false; } inline bool IsTransportSuppliesClientLatencyEnabled() { return false; } inline bool IsEventEngineListenerEnabled() { return false; } inline bool IsScheduleCancellationOverWriteEnabled() { return false; } @@ -139,8 +137,7 @@ inline bool IsEventEngineClientEnabled() { return false; } inline bool IsMonitoringExperimentEnabled() { return true; } inline bool IsPromiseBasedClientCallEnabled() { return false; } inline bool IsFreeLargeAllocatorEnabled() { return false; } -#define GRPC_EXPERIMENT_IS_INCLUDED_PROMISE_BASED_SERVER_CALL -inline bool IsPromiseBasedServerCallEnabled() { return true; } +inline bool IsPromiseBasedServerCallEnabled() { return false; } inline bool IsTransportSuppliesClientLatencyEnabled() { return false; } inline bool IsEventEngineListenerEnabled() { return false; } inline bool IsScheduleCancellationOverWriteEnabled() { return false; } diff --git a/src/core/lib/experiments/rollouts.yaml b/src/core/lib/experiments/rollouts.yaml index b0d547ccd01f0..910a6a768b27e 100644 --- a/src/core/lib/experiments/rollouts.yaml +++ b/src/core/lib/experiments/rollouts.yaml @@ -61,7 +61,7 @@ - name: free_large_allocator default: false - name: promise_based_server_call - default: true + default: false - name: transport_supplies_client_latency default: false - name: event_engine_listener From 239a5fce2dae58c93a1c3eaead991270c1d229c6 Mon Sep 17 00:00:00 2001 From: Hannah Shi Date: Fri, 4 Aug 2023 15:51:42 -0700 Subject: [PATCH 129/205] [ObjC] dns service resolver for cf event engine (#33971) re-submit of #33233 with refactored tests 1. split ios event engine tests to client tests (require oracle engine) and unit test 2. disable dns server setup in [dns_test.cc](https://github.com/grpc/grpc/blob/master/test/core/event_engine/test_suite/tests/dns_test.cc#L127) for ios test, this is what's caused the revert. 3. disable dns_test in cf_event_engine_test for MacOS --- CMakeLists.txt | 4 + Makefile | 2 + Package.swift | 2 + build_autogenerated.yaml | 8 + config.m4 | 1 + config.w32 | 1 + gRPC-C++.podspec | 2 + gRPC-Core.podspec | 3 + grpc.gemspec | 2 + grpc.gyp | 3 + package.xml | 2 + src/core/BUILD | 8 +- .../lib/event_engine/cf_engine/cf_engine.cc | 12 +- .../cf_engine/dns_service_resolver.cc | 229 ++++++++++++++++++ .../cf_engine/dns_service_resolver.h | 117 +++++++++ src/objective-c/tests/BUILD | 24 +- ...neTests.mm => CFEventEngineClientTests.mm} | 2 - .../CFEventEngineUnitTests.mm | 61 +++++ src/python/grpcio/grpc_core_dependencies.py | 1 + test/core/event_engine/cf/BUILD | 24 +- test/core/event_engine/cf/cf_engine_test.cc | 211 ++++++++++++++++ test/core/event_engine/test_suite/BUILD | 1 + .../test_suite/cf_event_engine_test.cc | 2 - .../event_engine/test_suite/tests/dns_test.cc | 8 + tools/doxygen/Doxyfile.c++.internal | 2 + tools/doxygen/Doxyfile.core.internal | 2 + .../internal_ci/macos/grpc_objc_bazel_test.sh | 4 +- 27 files changed, 724 insertions(+), 14 deletions(-) create mode 100644 src/core/lib/event_engine/cf_engine/dns_service_resolver.cc create mode 100644 src/core/lib/event_engine/cf_engine/dns_service_resolver.h rename src/objective-c/tests/EventEngineTests/{CFEventEngineTests.mm => CFEventEngineClientTests.mm} (94%) create mode 100644 src/objective-c/tests/EventEngineTests/CFEventEngineUnitTests.mm diff --git a/CMakeLists.txt b/CMakeLists.txt index dc941c0820cc2..5ad4e0c981a88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2159,6 +2159,7 @@ add_library(grpc src/core/lib/event_engine/ares_resolver.cc src/core/lib/event_engine/cf_engine/cf_engine.cc src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc + src/core/lib/event_engine/cf_engine/dns_service_resolver.cc src/core/lib/event_engine/channel_args_endpoint_config.cc src/core/lib/event_engine/default_event_engine.cc src/core/lib/event_engine/default_event_engine_factory.cc @@ -2868,6 +2869,7 @@ add_library(grpc_unsecure src/core/lib/event_engine/ares_resolver.cc src/core/lib/event_engine/cf_engine/cf_engine.cc src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc + src/core/lib/event_engine/cf_engine/dns_service_resolver.cc src/core/lib/event_engine/channel_args_endpoint_config.cc src/core/lib/event_engine/default_event_engine.cc src/core/lib/event_engine/default_event_engine_factory.cc @@ -4406,6 +4408,7 @@ add_library(grpc_authorization_provider src/core/lib/event_engine/ares_resolver.cc src/core/lib/event_engine/cf_engine/cf_engine.cc src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc + src/core/lib/event_engine/cf_engine/dns_service_resolver.cc src/core/lib/event_engine/channel_args_endpoint_config.cc src/core/lib/event_engine/default_event_engine.cc src/core/lib/event_engine/default_event_engine_factory.cc @@ -12485,6 +12488,7 @@ add_executable(frame_test src/core/lib/event_engine/ares_resolver.cc src/core/lib/event_engine/cf_engine/cf_engine.cc src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc + src/core/lib/event_engine/cf_engine/dns_service_resolver.cc src/core/lib/event_engine/channel_args_endpoint_config.cc src/core/lib/event_engine/default_event_engine.cc src/core/lib/event_engine/default_event_engine_factory.cc diff --git a/Makefile b/Makefile index f1a04b993b045..7e39779d5a1b8 100644 --- a/Makefile +++ b/Makefile @@ -1440,6 +1440,7 @@ LIBGRPC_SRC = \ src/core/lib/event_engine/ares_resolver.cc \ src/core/lib/event_engine/cf_engine/cf_engine.cc \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc \ + src/core/lib/event_engine/cf_engine/dns_service_resolver.cc \ src/core/lib/event_engine/channel_args_endpoint_config.cc \ src/core/lib/event_engine/default_event_engine.cc \ src/core/lib/event_engine/default_event_engine_factory.cc \ @@ -2002,6 +2003,7 @@ LIBGRPC_UNSECURE_SRC = \ src/core/lib/event_engine/ares_resolver.cc \ src/core/lib/event_engine/cf_engine/cf_engine.cc \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc \ + src/core/lib/event_engine/cf_engine/dns_service_resolver.cc \ src/core/lib/event_engine/channel_args_endpoint_config.cc \ src/core/lib/event_engine/default_event_engine.cc \ src/core/lib/event_engine/default_event_engine_factory.cc \ diff --git a/Package.swift b/Package.swift index b712cd822d941..56699d86e08c9 100644 --- a/Package.swift +++ b/Package.swift @@ -1069,6 +1069,8 @@ let package = Package( "src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc", "src/core/lib/event_engine/cf_engine/cfstream_endpoint.h", "src/core/lib/event_engine/cf_engine/cftype_unique_ref.h", + "src/core/lib/event_engine/cf_engine/dns_service_resolver.cc", + "src/core/lib/event_engine/cf_engine/dns_service_resolver.h", "src/core/lib/event_engine/channel_args_endpoint_config.cc", "src/core/lib/event_engine/channel_args_endpoint_config.h", "src/core/lib/event_engine/common_closures.h", diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 607b4493de8a5..93759c1d0a871 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -687,6 +687,7 @@ libs: - src/core/lib/event_engine/cf_engine/cf_engine.h - src/core/lib/event_engine/cf_engine/cfstream_endpoint.h - src/core/lib/event_engine/cf_engine/cftype_unique_ref.h + - src/core/lib/event_engine/cf_engine/dns_service_resolver.h - src/core/lib/event_engine/channel_args_endpoint_config.h - src/core/lib/event_engine/common_closures.h - src/core/lib/event_engine/default_event_engine.h @@ -1501,6 +1502,7 @@ libs: - src/core/lib/event_engine/ares_resolver.cc - src/core/lib/event_engine/cf_engine/cf_engine.cc - src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc + - src/core/lib/event_engine/cf_engine/dns_service_resolver.cc - src/core/lib/event_engine/channel_args_endpoint_config.cc - src/core/lib/event_engine/default_event_engine.cc - src/core/lib/event_engine/default_event_engine_factory.cc @@ -2084,6 +2086,7 @@ libs: - src/core/lib/event_engine/cf_engine/cf_engine.h - src/core/lib/event_engine/cf_engine/cfstream_endpoint.h - src/core/lib/event_engine/cf_engine/cftype_unique_ref.h + - src/core/lib/event_engine/cf_engine/dns_service_resolver.h - src/core/lib/event_engine/channel_args_endpoint_config.h - src/core/lib/event_engine/common_closures.h - src/core/lib/event_engine/default_event_engine.h @@ -2505,6 +2508,7 @@ libs: - src/core/lib/event_engine/ares_resolver.cc - src/core/lib/event_engine/cf_engine/cf_engine.cc - src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc + - src/core/lib/event_engine/cf_engine/dns_service_resolver.cc - src/core/lib/event_engine/channel_args_endpoint_config.cc - src/core/lib/event_engine/default_event_engine.cc - src/core/lib/event_engine/default_event_engine_factory.cc @@ -3592,6 +3596,7 @@ libs: - src/core/lib/event_engine/cf_engine/cf_engine.h - src/core/lib/event_engine/cf_engine/cfstream_endpoint.h - src/core/lib/event_engine/cf_engine/cftype_unique_ref.h + - src/core/lib/event_engine/cf_engine/dns_service_resolver.h - src/core/lib/event_engine/channel_args_endpoint_config.h - src/core/lib/event_engine/common_closures.h - src/core/lib/event_engine/default_event_engine.h @@ -3892,6 +3897,7 @@ libs: - src/core/lib/event_engine/ares_resolver.cc - src/core/lib/event_engine/cf_engine/cf_engine.cc - src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc + - src/core/lib/event_engine/cf_engine/dns_service_resolver.cc - src/core/lib/event_engine/channel_args_endpoint_config.cc - src/core/lib/event_engine/default_event_engine.cc - src/core/lib/event_engine/default_event_engine_factory.cc @@ -8127,6 +8133,7 @@ targets: - src/core/lib/event_engine/cf_engine/cf_engine.h - src/core/lib/event_engine/cf_engine/cfstream_endpoint.h - src/core/lib/event_engine/cf_engine/cftype_unique_ref.h + - src/core/lib/event_engine/cf_engine/dns_service_resolver.h - src/core/lib/event_engine/channel_args_endpoint_config.h - src/core/lib/event_engine/common_closures.h - src/core/lib/event_engine/default_event_engine.h @@ -8409,6 +8416,7 @@ targets: - src/core/lib/event_engine/ares_resolver.cc - src/core/lib/event_engine/cf_engine/cf_engine.cc - src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc + - src/core/lib/event_engine/cf_engine/dns_service_resolver.cc - src/core/lib/event_engine/channel_args_endpoint_config.cc - src/core/lib/event_engine/default_event_engine.cc - src/core/lib/event_engine/default_event_engine_factory.cc diff --git a/config.m4 b/config.m4 index 7963168b68356..93a4b2c5b507a 100644 --- a/config.m4 +++ b/config.m4 @@ -522,6 +522,7 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/event_engine/ares_resolver.cc \ src/core/lib/event_engine/cf_engine/cf_engine.cc \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc \ + src/core/lib/event_engine/cf_engine/dns_service_resolver.cc \ src/core/lib/event_engine/channel_args_endpoint_config.cc \ src/core/lib/event_engine/default_event_engine.cc \ src/core/lib/event_engine/default_event_engine_factory.cc \ diff --git a/config.w32 b/config.w32 index e8412bdeb19c3..6de00278ef066 100644 --- a/config.w32 +++ b/config.w32 @@ -487,6 +487,7 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\event_engine\\ares_resolver.cc " + "src\\core\\lib\\event_engine\\cf_engine\\cf_engine.cc " + "src\\core\\lib\\event_engine\\cf_engine\\cfstream_endpoint.cc " + + "src\\core\\lib\\event_engine\\cf_engine\\dns_service_resolver.cc " + "src\\core\\lib\\event_engine\\channel_args_endpoint_config.cc " + "src\\core\\lib\\event_engine\\default_event_engine.cc " + "src\\core\\lib\\event_engine\\default_event_engine_factory.cc " + diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 0ff4a85975684..d95907385161e 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -758,6 +758,7 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/cf_engine/cf_engine.h', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.h', 'src/core/lib/event_engine/cf_engine/cftype_unique_ref.h', + 'src/core/lib/event_engine/cf_engine/dns_service_resolver.h', 'src/core/lib/event_engine/channel_args_endpoint_config.h', 'src/core/lib/event_engine/common_closures.h', 'src/core/lib/event_engine/default_event_engine.h', @@ -1807,6 +1808,7 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/cf_engine/cf_engine.h', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.h', 'src/core/lib/event_engine/cf_engine/cftype_unique_ref.h', + 'src/core/lib/event_engine/cf_engine/dns_service_resolver.h', 'src/core/lib/event_engine/channel_args_endpoint_config.h', 'src/core/lib/event_engine/common_closures.h', 'src/core/lib/event_engine/default_event_engine.h', diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 1f7ee059f5212..c6f4811efe8ca 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -1170,6 +1170,8 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.h', 'src/core/lib/event_engine/cf_engine/cftype_unique_ref.h', + 'src/core/lib/event_engine/cf_engine/dns_service_resolver.cc', + 'src/core/lib/event_engine/cf_engine/dns_service_resolver.h', 'src/core/lib/event_engine/channel_args_endpoint_config.cc', 'src/core/lib/event_engine/channel_args_endpoint_config.h', 'src/core/lib/event_engine/common_closures.h', @@ -2542,6 +2544,7 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/cf_engine/cf_engine.h', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.h', 'src/core/lib/event_engine/cf_engine/cftype_unique_ref.h', + 'src/core/lib/event_engine/cf_engine/dns_service_resolver.h', 'src/core/lib/event_engine/channel_args_endpoint_config.h', 'src/core/lib/event_engine/common_closures.h', 'src/core/lib/event_engine/default_event_engine.h', diff --git a/grpc.gemspec b/grpc.gemspec index 8eecc38bea735..d3d4df3b6cc74 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -1075,6 +1075,8 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc ) s.files += %w( src/core/lib/event_engine/cf_engine/cfstream_endpoint.h ) s.files += %w( src/core/lib/event_engine/cf_engine/cftype_unique_ref.h ) + s.files += %w( src/core/lib/event_engine/cf_engine/dns_service_resolver.cc ) + s.files += %w( src/core/lib/event_engine/cf_engine/dns_service_resolver.h ) s.files += %w( src/core/lib/event_engine/channel_args_endpoint_config.cc ) s.files += %w( src/core/lib/event_engine/channel_args_endpoint_config.h ) s.files += %w( src/core/lib/event_engine/common_closures.h ) diff --git a/grpc.gyp b/grpc.gyp index 9a53deff7e9aa..4ac488d26eaa8 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -744,6 +744,7 @@ 'src/core/lib/event_engine/ares_resolver.cc', 'src/core/lib/event_engine/cf_engine/cf_engine.cc', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc', + 'src/core/lib/event_engine/cf_engine/dns_service_resolver.cc', 'src/core/lib/event_engine/channel_args_endpoint_config.cc', 'src/core/lib/event_engine/default_event_engine.cc', 'src/core/lib/event_engine/default_event_engine_factory.cc', @@ -1245,6 +1246,7 @@ 'src/core/lib/event_engine/ares_resolver.cc', 'src/core/lib/event_engine/cf_engine/cf_engine.cc', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc', + 'src/core/lib/event_engine/cf_engine/dns_service_resolver.cc', 'src/core/lib/event_engine/channel_args_endpoint_config.cc', 'src/core/lib/event_engine/default_event_engine.cc', 'src/core/lib/event_engine/default_event_engine_factory.cc', @@ -1766,6 +1768,7 @@ 'src/core/lib/event_engine/ares_resolver.cc', 'src/core/lib/event_engine/cf_engine/cf_engine.cc', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc', + 'src/core/lib/event_engine/cf_engine/dns_service_resolver.cc', 'src/core/lib/event_engine/channel_args_endpoint_config.cc', 'src/core/lib/event_engine/default_event_engine.cc', 'src/core/lib/event_engine/default_event_engine_factory.cc', diff --git a/package.xml b/package.xml index 00f44d11922be..3a8afe9b3fda5 100644 --- a/package.xml +++ b/package.xml @@ -1057,6 +1057,8 @@ + + diff --git a/src/core/BUILD b/src/core/BUILD index cda8d1c32ee04..cf94603020d85 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -2123,13 +2123,18 @@ grpc_cc_library( srcs = [ "lib/event_engine/cf_engine/cf_engine.cc", "lib/event_engine/cf_engine/cfstream_endpoint.cc", + "lib/event_engine/cf_engine/dns_service_resolver.cc", ], hdrs = [ "lib/event_engine/cf_engine/cf_engine.h", "lib/event_engine/cf_engine/cfstream_endpoint.h", "lib/event_engine/cf_engine/cftype_unique_ref.h", + "lib/event_engine/cf_engine/dns_service_resolver.h", + ], + external_deps = [ + "absl/container:flat_hash_map", + "absl/strings:str_format", ], - external_deps = ["absl/strings:str_format"], deps = [ "event_engine_common", "event_engine_tcp_socket_utils", @@ -2145,6 +2150,7 @@ grpc_cc_library( "strerror", "//:event_engine_base_hdrs", "//:gpr", + "//:parse_address", "//:ref_counted_ptr", "//:sockaddr_utils", ], diff --git a/src/core/lib/event_engine/cf_engine/cf_engine.cc b/src/core/lib/event_engine/cf_engine/cf_engine.cc index f835e64a21e8c..af0b7248d1992 100644 --- a/src/core/lib/event_engine/cf_engine/cf_engine.cc +++ b/src/core/lib/event_engine/cf_engine/cf_engine.cc @@ -22,6 +22,7 @@ #include "src/core/lib/event_engine/cf_engine/cf_engine.h" #include "src/core/lib/event_engine/cf_engine/cfstream_endpoint.h" +#include "src/core/lib/event_engine/cf_engine/dns_service_resolver.h" #include "src/core/lib/event_engine/posix_engine/timer_manager.h" #include "src/core/lib/event_engine/tcp_socket_utils.h" #include "src/core/lib/event_engine/thread_pool/thread_pool.h" @@ -156,9 +157,14 @@ bool CFEventEngine::CancelConnectInternal(ConnectionHandle handle, bool CFEventEngine::IsWorkerThread() { grpc_core::Crash("unimplemented"); } absl::StatusOr> -CFEventEngine::GetDNSResolver( - const DNSResolver::ResolverOptions& /* options */) { - grpc_core::Crash("unimplemented"); +CFEventEngine::GetDNSResolver(const DNSResolver::ResolverOptions& options) { + if (!options.dns_server.empty()) { + return absl::InvalidArgumentError( + "CFEventEngine does not support custom DNS servers"); + } + + return std::make_unique( + std::static_pointer_cast(shared_from_this())); } void CFEventEngine::Run(EventEngine::Closure* closure) { diff --git a/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc b/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc new file mode 100644 index 0000000000000..6e30f478ffc66 --- /dev/null +++ b/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc @@ -0,0 +1,229 @@ +// Copyright 2023 The gRPC Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#ifdef GPR_APPLE + +#include "absl/strings/str_format.h" + +#include "src/core/lib/address_utils/parse_address.h" +#include "src/core/lib/event_engine/cf_engine/dns_service_resolver.h" +#include "src/core/lib/event_engine/posix_engine/lockfree_event.h" +#include "src/core/lib/event_engine/tcp_socket_utils.h" +#include "src/core/lib/event_engine/trace.h" +#include "src/core/lib/gprpp/host_port.h" + +namespace grpc_event_engine { +namespace experimental { + +void DNSServiceResolverImpl::LookupHostname( + EventEngine::DNSResolver::LookupHostnameCallback on_resolve, + absl::string_view name, absl::string_view default_port) { + GRPC_EVENT_ENGINE_DNS_TRACE( + "DNSServiceResolverImpl::LookupHostname: name: %.*s, default_port: %.*s, " + "this: %p", + static_cast(name.length()), name.data(), + static_cast(default_port.length()), default_port.data(), this); + + absl::string_view host; + absl::string_view port_string; + if (!grpc_core::SplitHostPort(name, &host, &port_string)) { + engine_->Run([on_resolve = std::move(on_resolve), + status = absl::InvalidArgumentError( + absl::StrCat("Unparseable name: ", name))]() mutable { + on_resolve(status); + }); + return; + } + GPR_ASSERT(!host.empty()); + if (port_string.empty()) { + if (default_port.empty()) { + engine_->Run([on_resolve = std::move(on_resolve), + status = absl::InvalidArgumentError(absl::StrFormat( + "No port in name %s or default_port argument", + name))]() mutable { on_resolve(std::move(status)); }); + return; + } + port_string = default_port; + } + + int port = 0; + if (port_string == "http") { + port = 80; + } else if (port_string == "https") { + port = 443; + } else if (!absl::SimpleAtoi(port_string, &port)) { + engine_->Run([on_resolve = std::move(on_resolve), + status = absl::InvalidArgumentError(absl::StrCat( + "Failed to parse port in name: ", name))]() mutable { + on_resolve(std::move(status)); + }); + return; + } + + // TODO(yijiem): Change this when refactoring code in + // src/core/lib/address_utils to use EventEngine::ResolvedAddress. + grpc_resolved_address addr; + const std::string hostport = grpc_core::JoinHostPort(host, port); + if (grpc_parse_ipv4_hostport(hostport.c_str(), &addr, + /*log_errors=*/false) || + grpc_parse_ipv6_hostport(hostport.c_str(), &addr, + /*log_errors=*/false)) { + // Early out if the target is an ipv4 or ipv6 literal, otherwise dns service + // responses with kDNSServiceErr_NoSuchRecord + std::vector result; + result.emplace_back(reinterpret_cast(addr.addr), addr.len); + engine_->Run([on_resolve = std::move(on_resolve), + result = std::move(result)]() mutable { + on_resolve(std::move(result)); + }); + return; + } + + DNSServiceRef sdRef; + auto host_string = std::string{host}; + auto error = DNSServiceGetAddrInfo( + &sdRef, kDNSServiceFlagsTimeout | kDNSServiceFlagsReturnIntermediates, 0, + kDNSServiceProtocol_IPv4 | kDNSServiceProtocol_IPv6, host_string.c_str(), + &DNSServiceResolverImpl::ResolveCallback, this /* do not Ref */); + + if (error != kDNSServiceErr_NoError) { + engine_->Run([on_resolve = std::move(on_resolve), + status = absl::UnknownError(absl::StrFormat( + "DNSServiceGetAddrInfo failed with error:%d", + error))]() mutable { on_resolve(std::move(status)); }); + return; + } + + grpc_core::ReleasableMutexLock lock(&request_mu_); + + error = DNSServiceSetDispatchQueue(sdRef, queue_); + if (error != kDNSServiceErr_NoError) { + engine_->Run([on_resolve = std::move(on_resolve), + status = absl::UnknownError(absl::StrFormat( + "DNSServiceSetDispatchQueue failed with error:%d", + error))]() mutable { on_resolve(std::move(status)); }); + return; + } + + requests_.try_emplace( + sdRef, DNSServiceRequest{ + std::move(on_resolve), static_cast(port), {}}); +} + +/* static */ +void DNSServiceResolverImpl::ResolveCallback( + DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, + DNSServiceErrorType errorCode, const char* hostname, + const struct sockaddr* address, uint32_t ttl, void* context) { + GRPC_EVENT_ENGINE_DNS_TRACE( + "DNSServiceResolverImpl::ResolveCallback: sdRef: %p, flags: %x, " + "interface: %d, errorCode: %d, hostname: %s, addressFamily: %d, ttl: " + "%d, " + "this: %p", + sdRef, flags, interfaceIndex, errorCode, hostname, address->sa_family, + ttl, context); + + // no need to increase refcount here, since ResolveCallback and Shutdown is + // called from the serial queue and it is guarenteed that it won't be called + // after the sdRef is deallocated + auto that = static_cast(context); + + grpc_core::ReleasableMutexLock lock(&that->request_mu_); + auto request_it = that->requests_.find(sdRef); + GPR_ASSERT(request_it != that->requests_.end()); + auto& request = request_it->second; + + if (errorCode != kDNSServiceErr_NoError && + errorCode != kDNSServiceErr_NoSuchRecord) { + request.on_resolve(absl::UnknownError(absl::StrFormat( + "address lookup failed for %s: errorCode: %d", hostname, errorCode))); + that->requests_.erase(request_it); + DNSServiceRefDeallocate(sdRef); + return; + } + + // set received ipv4 or ipv6 response, even for kDNSServiceErr_NoSuchRecord to + // mark that the response for the stack is received, it is possible that the + // one stack receives some results and the other stack gets + // kDNSServiceErr_NoSuchRecord error. + if (address->sa_family == AF_INET) { + request.has_ipv4_response = true; + } else if (address->sa_family == AF_INET6) { + request.has_ipv6_response = true; + } + + // collect results if there is no error (not kDNSServiceErr_NoSuchRecord) + if (errorCode == kDNSServiceErr_NoError) { + request.result.emplace_back(address, address->sa_len); + auto& resolved_address = request.result.back(); + if (address->sa_family == AF_INET) { + (const_cast( + reinterpret_cast(resolved_address.address()))) + ->sin_port = htons(request.port); + } else if (address->sa_family == AF_INET6) { + (const_cast( + reinterpret_cast(resolved_address.address()))) + ->sin6_port = htons(request.port); + } + + GRPC_EVENT_ENGINE_DNS_TRACE( + "DNSServiceResolverImpl::ResolveCallback: " + "sdRef: %p, hostname: %s, addressPort: %s, this: %p", + sdRef, hostname, + ResolvedAddressToString(resolved_address).value_or("ERROR").c_str(), + context); + } + + // received both ipv4 and ipv6 responses, and no more responses (e.g. multiple + // IP addresses for a domain name) are coming, finish `LookupHostname` resolve + // with the collected results. + if (!(flags & kDNSServiceFlagsMoreComing) && request.has_ipv4_response && + request.has_ipv6_response) { + if (request.result.empty()) { + request.on_resolve(absl::NotFoundError(absl::StrFormat( + "address lookup failed for %s: Domain name not found", hostname))); + } else { + request.on_resolve(std::move(request.result)); + } + that->requests_.erase(request_it); + DNSServiceRefDeallocate(sdRef); + } +} + +void DNSServiceResolverImpl::Shutdown() { + dispatch_async_f(queue_, Ref().release(), [](void* thatPtr) { + grpc_core::RefCountedPtr that{ + static_cast(thatPtr)}; + grpc_core::MutexLock lock(&that->request_mu_); + for (auto& kv : that->requests_) { + auto& sdRef = kv.first; + auto& request = kv.second; + GRPC_EVENT_ENGINE_DNS_TRACE( + "DNSServiceResolverImpl::Shutdown sdRef: %p, this: %p", sdRef, + thatPtr); + + request.on_resolve( + absl::CancelledError("DNSServiceResolverImpl::Shutdown")); + DNSServiceRefDeallocate(static_cast(sdRef)); + } + that->requests_.clear(); + }); +} + +} // namespace experimental +} // namespace grpc_event_engine + +#endif // GPR_APPLE diff --git a/src/core/lib/event_engine/cf_engine/dns_service_resolver.h b/src/core/lib/event_engine/cf_engine/dns_service_resolver.h new file mode 100644 index 0000000000000..00a55a3050025 --- /dev/null +++ b/src/core/lib/event_engine/cf_engine/dns_service_resolver.h @@ -0,0 +1,117 @@ +// Copyright 2023 The gRPC Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef GRPC_SRC_CORE_LIB_EVENT_ENGINE_CF_ENGINE_DNS_SERVICE_RESOLVER_H +#define GRPC_SRC_CORE_LIB_EVENT_ENGINE_CF_ENGINE_DNS_SERVICE_RESOLVER_H +#include + +#ifdef GPR_APPLE + +#include +#include + +#include "absl/container/flat_hash_map.h" + +#include + +#include "src/core/lib/event_engine/cf_engine/cf_engine.h" +#include "src/core/lib/gprpp/ref_counted.h" +#include "src/core/lib/gprpp/ref_counted_ptr.h" + +namespace grpc_event_engine { +namespace experimental { + +class DNSServiceResolverImpl + : public grpc_core::RefCounted { + struct DNSServiceRequest { + EventEngine::DNSResolver::LookupHostnameCallback on_resolve; + uint16_t port; + std::vector result; + bool has_ipv4_response = false; + bool has_ipv6_response = false; + }; + + public: + explicit DNSServiceResolverImpl(std::shared_ptr engine) + : engine_(std::move((engine))) {} + ~DNSServiceResolverImpl() override { + GPR_ASSERT(requests_.empty()); + dispatch_release(queue_); + } + + void Shutdown(); + + void LookupHostname( + EventEngine::DNSResolver::LookupHostnameCallback on_resolve, + absl::string_view name, absl::string_view default_port); + + private: + static void ResolveCallback(DNSServiceRef sdRef, DNSServiceFlags flags, + uint32_t interfaceIndex, + DNSServiceErrorType errorCode, + const char* hostname, + const struct sockaddr* address, uint32_t ttl, + void* context); + + private: + std::shared_ptr engine_; + // DNSServiceSetDispatchQueue requires a serial dispatch queue + dispatch_queue_t queue_ = + dispatch_queue_create("dns_service_resolver", nullptr); + grpc_core::Mutex request_mu_; + absl::flat_hash_map requests_ + ABSL_GUARDED_BY(request_mu_); +}; + +class DNSServiceResolver : public EventEngine::DNSResolver { + public: + explicit DNSServiceResolver(std::shared_ptr engine) + : engine_(std::move(engine)), + impl_(grpc_core::MakeRefCounted( + std::move((engine_)))) {} + + ~DNSServiceResolver() override { impl_->Shutdown(); } + + void LookupHostname( + EventEngine::DNSResolver::LookupHostnameCallback on_resolve, + absl::string_view name, absl::string_view default_port) override { + impl_->LookupHostname(std::move(on_resolve), name, default_port); + }; + + void LookupSRV(EventEngine::DNSResolver::LookupSRVCallback on_resolve, + absl::string_view /* name */) override { + engine_->Run([on_resolve = std::move(on_resolve)]() mutable { + on_resolve(absl::UnimplementedError( + "The DNS Service resolver does not support looking up SRV records")); + }); + } + + void LookupTXT(EventEngine::DNSResolver::LookupTXTCallback on_resolve, + absl::string_view /* name */) override { + engine_->Run([on_resolve = std::move(on_resolve)]() mutable { + on_resolve(absl::UnimplementedError( + "The DNS Service resolver does not support looking up TXT records")); + }); + } + + private: + std::shared_ptr engine_; + grpc_core::RefCountedPtr impl_; +}; + +} // namespace experimental +} // namespace grpc_event_engine + +#endif // GPR_APPLE + +#endif // GRPC_SRC_CORE_LIB_EVENT_ENGINE_CF_ENGINE_DNS_SERVICE_RESOLVER_H diff --git a/src/objective-c/tests/BUILD b/src/objective-c/tests/BUILD index 9eef39eaba667..d5544d6cdf2c7 100644 --- a/src/objective-c/tests/BUILD +++ b/src/objective-c/tests/BUILD @@ -334,20 +334,36 @@ grpc_objc_ios_unit_test( ) grpc_objc_testing_library( - name = "EventEngineTests-lib", - srcs = glob(["EventEngineTests/*.mm"]), + name = "EventEngineClientTests-lib", + srcs = ["EventEngineTests/CFEventEngineClientTests.mm"], # defines = ["GRPC_IOS_EVENT_ENGINE_CLIENT=1"], deps = [ "//src/core:cf_event_engine", "//test/core/event_engine/test_suite/posix:oracle_event_engine_posix", "//test/core/event_engine/test_suite/tests:client", + ], +) + +grpc_objc_testing_library( + name = "EventEngineUnitTests-lib", + srcs = ["EventEngineTests/CFEventEngineUnitTests.mm"], + defines = ["GRPC_IOS_EVENT_ENGINE_CLIENT=1"], + deps = [ + "//src/core:cf_event_engine", + "//test/core/event_engine/cf:cf_engine_unit_test_lib", + "//test/core/event_engine/test_suite/tests:dns", "//test/core/event_engine/test_suite/tests:timer", ], ) grpc_objc_ios_unit_test( - name = "EventEngineTests", - deps = [":EventEngineTests-lib"], + name = "EventEngineClientTests", + deps = [":EventEngineClientTests-lib"], +) + +grpc_objc_ios_unit_test( + name = "EventEngineUnitTests", + deps = [":EventEngineUnitTests-lib"], ) # Note that bazel currently doesn't support running tvos_unit_test diff --git a/src/objective-c/tests/EventEngineTests/CFEventEngineTests.mm b/src/objective-c/tests/EventEngineTests/CFEventEngineClientTests.mm similarity index 94% rename from src/objective-c/tests/EventEngineTests/CFEventEngineTests.mm rename to src/objective-c/tests/EventEngineTests/CFEventEngineClientTests.mm index 2f32a409314f6..c5a4e1c9cefd1 100644 --- a/src/objective-c/tests/EventEngineTests/CFEventEngineTests.mm +++ b/src/objective-c/tests/EventEngineTests/CFEventEngineClientTests.mm @@ -24,7 +24,6 @@ #include "test/core/event_engine/test_suite/event_engine_test_framework.h" #include "test/core/event_engine/test_suite/posix/oracle_event_engine_posix.h" #include "test/core/event_engine/test_suite/tests/client_test.h" -#include "test/core/event_engine/test_suite/tests/timer_test.h" #include "test/core/util/test_config.h" @interface EventEngineTimerTests : XCTestCase @@ -51,7 +50,6 @@ - (void)testAll { return std::make_unique(); }; SetEventEngineFactories(factory, oracle_factory); - grpc_event_engine::experimental::InitTimerTests(); grpc_event_engine::experimental::InitClientTests(); // TODO(ctiller): EventEngine temporarily needs grpc to be initialized first // until we clear out the iomgr shutdown code. diff --git a/src/objective-c/tests/EventEngineTests/CFEventEngineUnitTests.mm b/src/objective-c/tests/EventEngineTests/CFEventEngineUnitTests.mm new file mode 100644 index 0000000000000..d81b25aa8c3e9 --- /dev/null +++ b/src/objective-c/tests/EventEngineTests/CFEventEngineUnitTests.mm @@ -0,0 +1,61 @@ +/* + * + * Copyright 2023 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import + +#include + +#include "src/core/lib/event_engine/cf_engine/cf_engine.h" +#include "test/core/event_engine/test_suite/event_engine_test_framework.h" +#include "test/core/event_engine/test_suite/tests/dns_test.h" +#include "test/core/event_engine/test_suite/tests/timer_test.h" +#include "test/core/util/test_config.h" + +@interface EventEngineTimerTests : XCTestCase +@end + +@implementation EventEngineTimerTests + +- (void)testAll { + NSArray *arguments = [NSProcessInfo processInfo].arguments; + int argc = (int)arguments.count; + char **argv = static_cast(alloca((sizeof(char *) * (argc + 1)))); + for (int index = 0; index < argc; index++) { + argv[index] = const_cast([arguments[index] UTF8String]); + } + argv[argc] = NULL; + + testing::InitGoogleTest(&argc, (char **)argv); + grpc::testing::TestEnvironment env(&argc, (char **)argv); + + auto factory = []() { + return std::make_unique(); + }; + SetEventEngineFactories(factory, nullptr); + grpc_event_engine::experimental::InitTimerTests(); + grpc_event_engine::experimental::InitDNSTests(); + // TODO(ctiller): EventEngine temporarily needs grpc to be initialized first + // until we clear out the iomgr shutdown code. + grpc_init(); + int r = RUN_ALL_TESTS(); + grpc_shutdown(); + + XCTAssertEqual(r, 0); +} + +@end diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 3a03e18ac0874..76fbcce089e00 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -496,6 +496,7 @@ 'src/core/lib/event_engine/ares_resolver.cc', 'src/core/lib/event_engine/cf_engine/cf_engine.cc', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc', + 'src/core/lib/event_engine/cf_engine/dns_service_resolver.cc', 'src/core/lib/event_engine/channel_args_endpoint_config.cc', 'src/core/lib/event_engine/default_event_engine.cc', 'src/core/lib/event_engine/default_event_engine_factory.cc', diff --git a/test/core/event_engine/cf/BUILD b/test/core/event_engine/cf/BUILD index 9bc735bc860c4..244df0d886002 100644 --- a/test/core/event_engine/cf/BUILD +++ b/test/core/event_engine/cf/BUILD @@ -12,10 +12,32 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//bazel:grpc_build_system.bzl", "grpc_cc_test") +load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test") licenses(["notice"]) +grpc_cc_library( + name = "cf_engine_unit_test_lib", + testonly = True, + srcs = ["cf_engine_test.cc"], + external_deps = ["gtest"], + language = "C++", + tags = [ + "no_linux", + "no_windows", + ], + visibility = [ + "//src/objective-c/tests:__subpackages__", + "//test:__subpackages__", + ], + deps = [ + "//:gpr_platform", + "//src/core:cf_event_engine", + "//test/core/util:grpc_test_util", + ], + alwayslink = 1, +) + grpc_cc_test( name = "cf_engine_test", timeout = "short", diff --git a/test/core/event_engine/cf/cf_engine_test.cc b/test/core/event_engine/cf/cf_engine_test.cc index f50b40f82fa76..ae9e540b35960 100644 --- a/test/core/event_engine/cf/cf_engine_test.cc +++ b/test/core/event_engine/cf/cf_engine_test.cc @@ -19,6 +19,8 @@ #include #include "absl/status/status.h" +#include "absl/strings/str_format.h" +#include "gmock/gmock.h" #include "gtest/gtest.h" #include @@ -80,6 +82,215 @@ TEST(CFEventEngineTest, TestConnectionCancelled) { client_signal.WaitForNotification(); } +namespace { +std::vector ResolvedAddressesToStrings( + const std::vector addresses) { + std::vector ip_strings; + std::transform(addresses.cbegin(), addresses.cend(), + std::back_inserter(ip_strings), [](auto const& address) { + return ResolvedAddressToString(address).value_or("ERROR"); + }); + return ip_strings; +} +} // namespace + +TEST(CFEventEngineTest, TestCreateDNSResolver) { + grpc_core::MemoryQuota memory_quota("cf_engine_test"); + auto cf_engine = std::make_shared(); + + EXPECT_TRUE(cf_engine->GetDNSResolver({}).status().ok()); + EXPECT_TRUE(cf_engine->GetDNSResolver({.dns_server = ""}).status().ok()); + EXPECT_EQ( + cf_engine->GetDNSResolver({.dns_server = "8.8.8.8"}).status().code(), + absl::StatusCode::kInvalidArgument); + EXPECT_EQ( + cf_engine->GetDNSResolver({.dns_server = "8.8.8.8:53"}).status().code(), + absl::StatusCode::kInvalidArgument); + EXPECT_EQ( + cf_engine->GetDNSResolver({.dns_server = "invalid"}).status().code(), + absl::StatusCode::kInvalidArgument); +} + +TEST(CFEventEngineTest, TestResolveLocalhost) { + grpc_core::Notification resolve_signal; + + auto cf_engine = std::make_shared(); + auto dns_resolver = cf_engine->GetDNSResolver({}); + + dns_resolver.value()->LookupHostname( + [&resolve_signal](auto result) { + EXPECT_TRUE(result.status().ok()); + EXPECT_THAT(ResolvedAddressesToStrings(result.value()), + testing::UnorderedElementsAre("127.0.0.1:80", "[::1]:80")); + + resolve_signal.Notify(); + }, + "localhost", "80"); + + resolve_signal.WaitForNotification(); +} + +TEST(CFEventEngineTest, TestResolveRemote) { + grpc_core::Notification resolve_signal; + + auto cf_engine = std::make_shared(); + auto dns_resolver = cf_engine->GetDNSResolver({}); + + dns_resolver.value()->LookupHostname( + [&resolve_signal](auto result) { + EXPECT_TRUE(result.status().ok()); + EXPECT_THAT(ResolvedAddressesToStrings(result.value()), + testing::UnorderedElementsAre("127.0.0.1:80", "[::1]:80")); + + resolve_signal.Notify(); + }, + "localtest.me:80", "443"); + + resolve_signal.WaitForNotification(); +} + +TEST(CFEventEngineTest, TestResolveIPv4Remote) { + grpc_core::Notification resolve_signal; + + auto cf_engine = std::make_shared(); + auto dns_resolver = cf_engine->GetDNSResolver({}); + + dns_resolver.value()->LookupHostname( + [&resolve_signal](auto result) { + EXPECT_TRUE(result.status().ok()); + EXPECT_THAT(ResolvedAddressesToStrings(result.value()), + testing::IsSubsetOf( + {"1.2.3.4:80", "[64:ff9b::102:304]:80" /*NAT64*/})); + + resolve_signal.Notify(); + }, + "1.2.3.4.nip.io:80", ""); + + resolve_signal.WaitForNotification(); +} + +TEST(CFEventEngineTest, TestResolveIPv6Remote) { + grpc_core::Notification resolve_signal; + + auto cf_engine = std::make_shared(); + auto dns_resolver = cf_engine->GetDNSResolver({}); + + dns_resolver.value()->LookupHostname( + [&resolve_signal](auto result) { + EXPECT_TRUE(result.status().ok()); + EXPECT_THAT( + ResolvedAddressesToStrings(result.value()), + testing::UnorderedElementsAre("[2607:f8b0:400a:801::1002]:80")); + + resolve_signal.Notify(); + }, + "2607-f8b0-400a-801--1002.sslip.io.", "80"); + + resolve_signal.WaitForNotification(); +} + +TEST(CFEventEngineTest, TestResolveIPv4Literal) { + grpc_core::Notification resolve_signal; + + auto cf_engine = std::make_shared(); + auto dns_resolver = cf_engine->GetDNSResolver({}); + + dns_resolver.value()->LookupHostname( + [&resolve_signal](auto result) { + EXPECT_TRUE(result.status().ok()); + EXPECT_THAT(ResolvedAddressesToStrings(result.value()), + testing::UnorderedElementsAre("1.2.3.4:443")); + + resolve_signal.Notify(); + }, + "1.2.3.4", "https"); + + resolve_signal.WaitForNotification(); +} + +TEST(CFEventEngineTest, TestResolveIPv6Literal) { + grpc_core::Notification resolve_signal; + + auto cf_engine = std::make_shared(); + auto dns_resolver = cf_engine->GetDNSResolver({}); + + dns_resolver.value()->LookupHostname( + [&resolve_signal](auto result) { + EXPECT_TRUE(result.status().ok()); + EXPECT_THAT( + ResolvedAddressesToStrings(result.value()), + testing::UnorderedElementsAre("[2607:f8b0:400a:801::1002]:443")); + + resolve_signal.Notify(); + }, + "[2607:f8b0:400a:801::1002]", "443"); + + resolve_signal.WaitForNotification(); +} + +TEST(CFEventEngineTest, TestResolveNoRecord) { + grpc_core::Notification resolve_signal; + auto cf_engine = std::make_shared(); + auto dns_resolver = std::move(cf_engine->GetDNSResolver({})).value(); + + dns_resolver->LookupHostname( + [&resolve_signal](auto result) { + EXPECT_EQ(result.status().code(), absl::StatusCode::kNotFound); + + resolve_signal.Notify(); + }, + "nonexisting-target.dns-test.event-engine.", "443"); + + resolve_signal.WaitForNotification(); +} + +TEST(CFEventEngineTest, TestResolveCanceled) { + grpc_core::Notification resolve_signal; + auto cf_engine = std::make_shared(); + auto dns_resolver = std::move(cf_engine->GetDNSResolver({})).value(); + + dns_resolver->LookupHostname( + [&resolve_signal](auto result) { + // query may have already finished before canceling, only verity the + // code if status is not ok + if (!result.status().ok()) { + EXPECT_EQ(result.status().code(), absl::StatusCode::kCancelled); + } + + resolve_signal.Notify(); + }, + "dont-care-since-wont-be-resolved.localtest.me", "443"); + + dns_resolver.reset(); + resolve_signal.WaitForNotification(); +} + +TEST(CFEventEngineTest, TestResolveMany) { + std::atomic times{10}; + grpc_core::Notification resolve_signal; + auto cf_engine = std::make_shared(); + auto dns_resolver = std::move(cf_engine->GetDNSResolver({})).value(); + + for (int i = times; i >= 1; --i) { + dns_resolver->LookupHostname( + [&resolve_signal, ×, i](auto result) { + EXPECT_TRUE(result.status().ok()); + EXPECT_THAT( + ResolvedAddressesToStrings(result.value()), + testing::IsSubsetOf( + {absl::StrFormat("100.0.0.%d:443", i), + absl::StrFormat("[64:ff9b::6400:%x]:443", i) /*NAT64*/})); + + if (--times == 0) { + resolve_signal.Notify(); + } + }, + absl::StrFormat("100.0.0.%d.nip.io", i), "443"); + } + + resolve_signal.WaitForNotification(); +} + } // namespace experimental } // namespace grpc_event_engine diff --git a/test/core/event_engine/test_suite/BUILD b/test/core/event_engine/test_suite/BUILD index cc485a4d9a269..385aa7bb6a2b2 100644 --- a/test/core/event_engine/test_suite/BUILD +++ b/test/core/event_engine/test_suite/BUILD @@ -96,6 +96,7 @@ grpc_cc_test( grpc_cc_test( name = "cf_event_engine_test", srcs = ["cf_event_engine_test.cc"], + copts = ["-DGRPC_IOS_EVENT_ENGINE_CLIENT=1"], tags = [ "no_linux", "no_windows", diff --git a/test/core/event_engine/test_suite/cf_event_engine_test.cc b/test/core/event_engine/test_suite/cf_event_engine_test.cc index 1d222514cb624..8372e448358e5 100644 --- a/test/core/event_engine/test_suite/cf_event_engine_test.cc +++ b/test/core/event_engine/test_suite/cf_event_engine_test.cc @@ -37,8 +37,6 @@ int main(int argc, char** argv) { SetEventEngineFactories(factory, oracle_factory); grpc_event_engine::experimental::InitTimerTests(); grpc_event_engine::experimental::InitClientTests(); - // TODO(vigneshbabu): remove when the experiment is over - grpc_core::ForceEnableExperiment("event_engine_client", true); // TODO(ctiller): EventEngine temporarily needs grpc to be initialized first // until we clear out the iomgr shutdown code. grpc_init(); diff --git a/test/core/event_engine/test_suite/tests/dns_test.cc b/test/core/event_engine/test_suite/tests/dns_test.cc index cbd48e26bc775..5149959c82b14 100644 --- a/test/core/event_engine/test_suite/tests/dns_test.cc +++ b/test/core/event_engine/test_suite/tests/dns_test.cc @@ -102,6 +102,7 @@ MATCHER(StatusCodeEq, "") { class EventEngineDNSTest : public EventEngineTest { protected: static void SetUpTestSuite() { +#ifndef GRPC_IOS_EVENT_ENGINE_CLIENT std::string test_records_path = kDNSTestRecordGroupsYamlPath; std::string dns_server_path = kDNSServerRelPath; std::string dns_resolver_path = kDNSResolverRelPath; @@ -143,12 +144,15 @@ class EventEngineDNSTest : public EventEngineTest { int status = health_check.Join(); // TODO(yijiem): make this portable for Windows ASSERT_TRUE(WIFEXITED(status) && WEXITSTATUS(status) == 0); +#endif // GRPC_IOS_EVENT_ENGINE_CLIENT } static void TearDownTestSuite() { +#ifndef GRPC_IOS_EVENT_ENGINE_CLIENT dns_server_.server_process->Interrupt(); dns_server_.server_process->Join(); delete dns_server_.server_process; +#endif // GRPC_IOS_EVENT_ENGINE_CLIENT } std::unique_ptr CreateDefaultDNSResolver() { @@ -194,6 +198,9 @@ class EventEngineDNSTest : public EventEngineTest { EventEngineDNSTest::DNSServer EventEngineDNSTest::dns_server_; +// TODO(hork): implement XFAIL for resolvers that don't support TXT or SRV +#ifndef GRPC_IOS_EVENT_ENGINE_CLIENT + TEST_F(EventEngineDNSTest, QueryNXHostname) { auto dns_resolver = CreateDefaultDNSResolver(); dns_resolver->LookupHostname( @@ -365,6 +372,7 @@ TEST_F(EventEngineDNSTest, TestCancelActiveDNSQuery) { dns_resolver.reset(); dns_resolver_signal_.WaitForNotification(); } +#endif // GRPC_IOS_EVENT_ENGINE_CLIENT #define EXPECT_SUCCESS() \ do { \ diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index ab7809664f8a2..637de7d22957e 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -2072,6 +2072,8 @@ src/core/lib/event_engine/cf_engine/cf_engine.h \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.h \ src/core/lib/event_engine/cf_engine/cftype_unique_ref.h \ +src/core/lib/event_engine/cf_engine/dns_service_resolver.cc \ +src/core/lib/event_engine/cf_engine/dns_service_resolver.h \ src/core/lib/event_engine/channel_args_endpoint_config.cc \ src/core/lib/event_engine/channel_args_endpoint_config.h \ src/core/lib/event_engine/common_closures.h \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index d5b0b9258ab8a..17607e9339a34 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -1850,6 +1850,8 @@ src/core/lib/event_engine/cf_engine/cf_engine.h \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.h \ src/core/lib/event_engine/cf_engine/cftype_unique_ref.h \ +src/core/lib/event_engine/cf_engine/dns_service_resolver.cc \ +src/core/lib/event_engine/cf_engine/dns_service_resolver.h \ src/core/lib/event_engine/channel_args_endpoint_config.cc \ src/core/lib/event_engine/channel_args_endpoint_config.h \ src/core/lib/event_engine/common_closures.h \ diff --git a/tools/internal_ci/macos/grpc_objc_bazel_test.sh b/tools/internal_ci/macos/grpc_objc_bazel_test.sh index 3ed4556dd9987..fc82aee4acabb 100644 --- a/tools/internal_ci/macos/grpc_objc_bazel_test.sh +++ b/tools/internal_ci/macos/grpc_objc_bazel_test.sh @@ -61,7 +61,8 @@ TEST_TARGETS=( #//src/objective-c/tests:CronetTests #//src/objective-c/tests:PerfTests //src/objective-c/tests:CFStreamTests - //src/objective-c/tests:EventEngineTests + # Needs oracle engine, which doesn't work with GRPC_IOS_EVENT_ENGINE_CLIENT=1 + //src/objective-c/tests:EventEngineClientTests //src/objective-c/tests:tvtests_build_test # codegen plugin tests //src/objective-c/tests:objc_codegen_plugin_test @@ -128,6 +129,7 @@ EVENT_ENGINE_TEST_TARGETS=( //src/objective-c/tests:InteropTestsRemote //src/objective-c/tests:MacTests //src/objective-c/tests:UnitTests + //src/objective-c/tests:EventEngineUnitTests //src/objective-c/tests:tvtests_build_test ) From e35db43c07f27cc13ec061520da1ed185f36abd4 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 4 Aug 2023 18:40:17 -0700 Subject: [PATCH 130/205] [event-engine] remove locking from address cache (#33988) Solves the use-after-free we had been seeing --- .../lib/iomgr/event_engine_shims/endpoint.cc | 26 +++++-------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/src/core/lib/iomgr/event_engine_shims/endpoint.cc b/src/core/lib/iomgr/event_engine_shims/endpoint.cc index 7474ee3d6f825..20b6a158494bb 100644 --- a/src/core/lib/iomgr/event_engine_shims/endpoint.cc +++ b/src/core/lib/iomgr/event_engine_shims/endpoint.cc @@ -74,15 +74,9 @@ class EventEngineEndpointWrapper { return fd_; } - absl::string_view PeerAddress() { - grpc_core::MutexLock lock(&mu_); - return peer_address_; - } + absl::string_view PeerAddress() { return peer_address_; } - absl::string_view LocalAddress() { - grpc_core::MutexLock lock(&mu_); - return local_address_; - } + absl::string_view LocalAddress() { return local_address_; } void Ref() { refs_.fetch_add(1, std::memory_order_relaxed); } void Unref() { @@ -269,8 +263,6 @@ class EventEngineEndpointWrapper { { grpc_core::MutexLock lock(&mu_); fd_ = -1; - local_address_ = ""; - peer_address_ = ""; } endpoint_.reset(); // For the Ref taken in TriggerShutdown @@ -285,8 +277,10 @@ class EventEngineEndpointWrapper { grpc_closure* pending_read_cb_; grpc_closure* pending_write_cb_; grpc_slice_buffer* pending_read_buffer_; - std::string peer_address_; - std::string local_address_; + const std::string peer_address_{ + ResolvedAddressToURI(endpoint_->GetPeerAddress()).value_or("")}; + const std::string local_address_{ + ResolvedAddressToURI(endpoint_->GetLocalAddress()).value_or("")}; int fd_{-1}; }; @@ -412,14 +406,6 @@ EventEngineEndpointWrapper::EventEngineEndpointWrapper( eeep_(std::make_unique()) { eeep_->base.vtable = &grpc_event_engine_endpoint_vtable; eeep_->wrapper = this; - auto local_addr = ResolvedAddressToURI(endpoint_->GetLocalAddress()); - if (local_addr.ok()) { - local_address_ = *local_addr; - } - auto peer_addr = ResolvedAddressToURI(endpoint_->GetPeerAddress()); - if (peer_addr.ok()) { - peer_address_ = *peer_addr; - } if (EventEngineSupportsFd()) { fd_ = reinterpret_cast(endpoint_.get()) ->GetWrappedFd(); From cb235a3e22c36236e9aa92e69398e8c3d15e3043 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 7 Aug 2023 16:14:17 +0200 Subject: [PATCH 131/205] [bazel] Add bazelified run_tests.py tests for ruby and python (#33959) Context: https://github.com/grpc/grpc/pull/33707 Add python and ruby tests. Both required a few fixes so I wanted to add them separately from https://github.com/grpc/grpc/pull/33707 Manual run of all the tests: https://source.cloud.google.com/results/invocations/24c7b6ed-a8b3-4367-a4bf-8828919a9340 --- .../dockerfile/passwordless_sudo.include | 6 ++ templates/tools/dockerfile/ruby_deps.include | 3 +- .../Dockerfile.template | 3 + .../Dockerfile.template | 3 + .../ruby_debian11_x64/Dockerfile.template | 1 + .../dockerimage_current_versions.bzl | 10 +-- tools/bazelify_tests/test/BUILD | 70 +++++++++---------- .../bazelify_tests/test/portability_tests.bzl | 19 +++-- tools/bazelify_tests/test/prepare_ruby.sh | 18 +++++ .../grpc_interop_ruby.current_version | 2 +- .../interoptest/grpc_interop_ruby/Dockerfile | 3 +- ...hon_debian11_default_arm64.current_version | 2 +- .../python_debian11_default_arm64/Dockerfile | 3 + ...ython_debian11_default_x64.current_version | 2 +- .../python_debian11_default_x64/Dockerfile | 3 + .../test/ruby_debian11_arm64.current_version | 2 +- .../test/ruby_debian11_arm64/Dockerfile | 3 +- .../test/ruby_debian11_x64.current_version | 2 +- .../test/ruby_debian11_x64/Dockerfile | 10 ++- tools/run_tests/helper_scripts/build_ruby.sh | 2 +- 20 files changed, 106 insertions(+), 61 deletions(-) create mode 100644 templates/tools/dockerfile/passwordless_sudo.include create mode 100755 tools/bazelify_tests/test/prepare_ruby.sh diff --git a/templates/tools/dockerfile/passwordless_sudo.include b/templates/tools/dockerfile/passwordless_sudo.include new file mode 100644 index 0000000000000..ee9fc2e425231 --- /dev/null +++ b/templates/tools/dockerfile/passwordless_sudo.include @@ -0,0 +1,6 @@ +# Passwordless sudo for all users +# Bazel docker sandbox and bazel RBE run scripts under docker +# as a regular user, but sometimes we need to be +# able to do something with root privileges. +RUN apt-get update && apt-get install -y sudo && apt-get clean +RUN echo 'ALL ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers diff --git a/templates/tools/dockerfile/ruby_deps.include b/templates/tools/dockerfile/ruby_deps.include index b4a24bfb3807d..a57130f9bcca8 100644 --- a/templates/tools/dockerfile/ruby_deps.include +++ b/templates/tools/dockerfile/ruby_deps.include @@ -8,7 +8,8 @@ RUN \curl -sSL https://get.rvm.io | bash -s stable # Install Ruby 2.7 RUN apt-get update && apt-get install -y procps && apt-get clean -RUN /bin/bash -l -c "rvm install ruby-2.7" +# "--disable-binary" is a workaround for https://github.com/rvm/rvm/issues/4975 +RUN /bin/bash -l -c "rvm install ruby-2.7 --disable-binary" RUN /bin/bash -l -c "rvm use --default ruby-2.7" RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc" RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" diff --git a/templates/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile.template b/templates/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile.template index ca6873105b783..26ae79b66d4d5 100644 --- a/templates/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile.template +++ b/templates/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile.template @@ -25,6 +25,9 @@ # for Python test coverage reporting RUN python3.9 -m pip install coverage + # six is required by the run_tests.py test harness + RUN python3.9 -m pip install six + <%include file="../../gcp_api_libraries.include"/> <%include file="../../cmake.include"/> diff --git a/templates/tools/dockerfile/test/python_debian11_default_x64/Dockerfile.template b/templates/tools/dockerfile/test/python_debian11_default_x64/Dockerfile.template index 9a420cf267d8b..eee2289d13419 100644 --- a/templates/tools/dockerfile/test/python_debian11_default_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/python_debian11_default_x64/Dockerfile.template @@ -31,6 +31,9 @@ # for Python test coverage reporting RUN python3.9 -m pip install coverage + # six is required by the run_tests.py test harness + RUN python3.9 -m pip install six + <%include file="../../gcp_api_libraries.include"/> <%include file="../../cmake.include"/> diff --git a/templates/tools/dockerfile/test/ruby_debian11_x64/Dockerfile.template b/templates/tools/dockerfile/test/ruby_debian11_x64/Dockerfile.template index 52da8d5416fcd..9d24d767888a0 100644 --- a/templates/tools/dockerfile/test/ruby_debian11_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/ruby_debian11_x64/Dockerfile.template @@ -23,6 +23,7 @@ <%include file="../../ccache.include"/> <%include file="../../run_tests_addons.include"/> <%include file="../../xds_interop_deps.include"/> + <%include file="../../passwordless_sudo.include"/> # Define the default command. CMD ["bash"] diff --git a/tools/bazelify_tests/dockerimage_current_versions.bzl b/tools/bazelify_tests/dockerimage_current_versions.bzl index 79147f8ea0804..074aeef5f6fc5 100644 --- a/tools/bazelify_tests/dockerimage_current_versions.bzl +++ b/tools/bazelify_tests/dockerimage_current_versions.bzl @@ -87,7 +87,7 @@ DOCKERIMAGE_CURRENT_VERSIONS = { "tools/dockerfile/interoptest/grpc_interop_php7.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_php7@sha256:09f4b895117c81506c423360b617917d06d3f7f0b78e4cca25eaec547ba6991e", "tools/dockerfile/interoptest/grpc_interop_python.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_python@sha256:fef1247f8256be2b9841331e7d21b0046da21a4a6d34a62addb36f62124725cf", "tools/dockerfile/interoptest/grpc_interop_pythonasyncio.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_pythonasyncio@sha256:bd4cdc8a71ef339193e178ce20d2b47a0b2aa25fc86c0b5740b9d86a2d4a0caa", - "tools/dockerfile/interoptest/grpc_interop_ruby.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_ruby@sha256:0de52450b29cf91365e623b020cd97722c307510ba1813bee09264e0a49acdbc", + "tools/dockerfile/interoptest/grpc_interop_ruby.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_ruby@sha256:596678dac1d736eae7fecd5fe718efcfd3dc637fe8adf626db86be7c7727b68b", "tools/dockerfile/interoptest/lb_interop_fake_servers.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/lb_interop_fake_servers@sha256:b89a51dd9147e1293f50ee64dd719fce5929ca7894d3770a3d80dbdecb99fd52", "tools/dockerfile/test/android_ndk.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/android_ndk@sha256:2bddf36ae504968b35f97e4a6c9b74864473689e84049675c30afb70f868d897", "tools/dockerfile/test/bazel.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/bazel@sha256:1118150d9d9479787165fff49f660a3dc633f1c57604305460172fc1916aa022", @@ -108,10 +108,10 @@ DOCKERIMAGE_CURRENT_VERSIONS = { "tools/dockerfile/test/php7_debian11_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/php7_debian11_arm64@sha256:444e25f9e3a89c2438e4d5e6f3904c5a1f4d1fb961f8456333ebe3e36e301a4e", "tools/dockerfile/test/php7_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/php7_debian11_x64@sha256:018d422abf144fc93e9027fd994f7d6aab453fffbe4a669d622dd3d1c1fe9ee7", "tools/dockerfile/test/python_alpine_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_alpine_x64@sha256:d10159225ae25276b7ae7bfc4230150e4b0a8ce7be833d904bdd4ecdfdc91c6e", - "tools/dockerfile/test/python_debian11_default_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_arm64@sha256:868cfb50e465f086b75bb65a7fab6d15b1edefabcd8c1826340acefb6ea1737f", - "tools/dockerfile/test/python_debian11_default_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_x64@sha256:4f29e539941d22b7abb911f9b6b3101ff5c7c4fb75585bfe3b7389251ea6be1d", + "tools/dockerfile/test/python_debian11_default_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_arm64@sha256:b2b35321d91caa50ec25fd6eb5160afdd04c58ef18ac4d2a62b19177bbc6d00e", + "tools/dockerfile/test/python_debian11_default_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_x64@sha256:5e9278a10a8c338963fa258213910fc0dead6bac91110256c1a0a344e0ade58f", "tools/dockerfile/test/rbe_ubuntu2004.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/rbe_ubuntu2004@sha256:d3951aeadf43e3bee6adc5b86d26cdaf0b9d1b5baf790d7b2530d1c197adc9f8", - "tools/dockerfile/test/ruby_debian11_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_arm64@sha256:9503d80a40555aba4dd531b64354ad8036c6b37e162c93e7994ca23d89bc7d41", - "tools/dockerfile/test/ruby_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_x64@sha256:3f01369c3e5707fa63007820b30461b9e32a4b729d81cb92d19669d7966a8584", + "tools/dockerfile/test/ruby_debian11_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_arm64@sha256:c4901beb737a6aed3969c7bc601cd441488e5283a6abfabb80210c1bd2f5cd19", + "tools/dockerfile/test/ruby_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_x64@sha256:f30272c98928898b42903aa1a08fb0d769c8dc7b6173231a778c8c001b904219", "tools/dockerfile/test/sanity.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/sanity@sha256:189e07d8503aa15344e3c8f565783659c3e2edc5b8ca455ec427de1e29ef4504", } diff --git a/tools/bazelify_tests/test/BUILD b/tools/bazelify_tests/test/BUILD index a6eac298bed2d..bfdea29390542 100644 --- a/tools/bazelify_tests/test/BUILD +++ b/tools/bazelify_tests/test/BUILD @@ -59,29 +59,28 @@ grpc_run_tests_py_test( docker_image_version = "tools/dockerfile/test/cxx_debian11_x64.current_version", ) -# TODO(jtattermusch): Reintroduce ruby tests once they pass. -# # Ruby -# grpc_run_tests_py_test( -# name = "runtests_ruby_linux_dbg", -# size = "enormous", -# args = [ -# "-l ruby -c dbg", -# ], -# docker_image_version = "tools/dockerfile/test/ruby_debian11_x64.current_version", -# prepare_script = ":prepare_ruby.sh", -# use_login_shell = True, # ruby's docker image uses RVM which wierdly requires login shell -# ) - -# grpc_run_tests_py_test( -# name = "runtests_ruby_linux_opt", -# size = "enormous", -# args = [ -# "-l ruby -c opt", -# ], -# docker_image_version = "tools/dockerfile/test/ruby_debian11_x64.current_version", -# prepare_script = ":prepare_ruby.sh", -# use_login_shell = True, # ruby's docker image uses RVM which wierdly requires login shell -# ) +# Ruby +grpc_run_tests_py_test( + name = "runtests_ruby_linux_dbg", + size = "enormous", + args = [ + "-l ruby -c dbg", + ], + docker_image_version = "tools/dockerfile/test/ruby_debian11_x64.current_version", + prepare_script = ":prepare_ruby.sh", + use_login_shell = True, # ruby's docker image uses RVM which wierdly requires login shell +) + +grpc_run_tests_py_test( + name = "runtests_ruby_linux_opt", + size = "enormous", + args = [ + "-l ruby -c opt", + ], + docker_image_version = "tools/dockerfile/test/ruby_debian11_x64.current_version", + prepare_script = ":prepare_ruby.sh", + use_login_shell = True, # ruby's docker image uses RVM which wierdly requires login shell +) # PHP grpc_run_tests_py_test( @@ -102,16 +101,15 @@ grpc_run_tests_py_test( docker_image_version = "tools/dockerfile/test/php7_debian11_x64.current_version", ) -# TODO(jtattermusch): Reintroduce python tests once they pass. -# # Python -# grpc_run_tests_py_test( -# name = "runtests_python_linux_opt", -# size = "enormous", -# args = [ -# "-l python -c opt", -# ], -# docker_image_version = "tools/dockerfile/test/python_debian11_default_x64.current_version", -# ) +# Python +grpc_run_tests_py_test( + name = "runtests_python_linux_opt", + size = "enormous", + args = [ + "-l python -c opt", + ], + docker_image_version = "tools/dockerfile/test/python_debian11_default_x64.current_version", +) # C# grpc_run_tests_py_test( @@ -144,9 +142,9 @@ test_suite( # TODO(jtattermusch): reenable the test once not flaky anymore #":runtests_php_linux_dbg", ":runtests_php_linux_opt", - #":runtests_python_linux_opt", - #":runtests_ruby_linux_dbg", - #":runtests_ruby_linux_opt", + ":runtests_python_linux_opt", + ":runtests_ruby_linux_dbg", + ":runtests_ruby_linux_opt", ], ) diff --git a/tools/bazelify_tests/test/portability_tests.bzl b/tools/bazelify_tests/test/portability_tests.bzl index 26afa9e5bea07..4acc7d729dcc6 100644 --- a/tools/bazelify_tests/test/portability_tests.bzl +++ b/tools/bazelify_tests/test/portability_tests.bzl @@ -73,17 +73,16 @@ def generate_run_tests_portability_tests(name): ) test_names.append(test_name) - # TODO(jtattermusch): Reintroduce the test once it passes. # Python on alpine - #grpc_run_tests_py_test( - # name = "runtests_python_linux_dbg_alpine", - # args = [ - # "-l python -c dbg --compiler python_alpine", - # ], - # docker_image_version = "tools/dockerfile/test/python_alpine_x64.current_version", - # size = "enormous", - #) - #test_names.append("runtests_python_linux_dbg_alpine") + grpc_run_tests_py_test( + name = "runtests_python_linux_dbg_alpine", + args = [ + "-l python -c dbg --compiler python_alpine", + ], + docker_image_version = "tools/dockerfile/test/python_alpine_x64.current_version", + size = "enormous", + ) + test_names.append("runtests_python_linux_dbg_alpine") # Generate test suite that allows easily running all portability tests. native.test_suite( diff --git a/tools/bazelify_tests/test/prepare_ruby.sh b/tools/bazelify_tests/test/prepare_ruby.sh new file mode 100755 index 0000000000000..a5baed7c039f7 --- /dev/null +++ b/tools/bazelify_tests/test/prepare_ruby.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# Copyright 2023 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# make sure /usr/local/rvm is writable by ruby when running under docker as non-root +sudo chown -R "$(id -u)" /usr/local/rvm + diff --git a/tools/dockerfile/interoptest/grpc_interop_ruby.current_version b/tools/dockerfile/interoptest/grpc_interop_ruby.current_version index d6b0402208771..9f6dbb4e59b6f 100644 --- a/tools/dockerfile/interoptest/grpc_interop_ruby.current_version +++ b/tools/dockerfile/interoptest/grpc_interop_ruby.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_ruby:4abe304d586e1bc862cb85e9ac5e9c7b2f7ae73c@sha256:0de52450b29cf91365e623b020cd97722c307510ba1813bee09264e0a49acdbc \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_ruby:a6f7413e822f23ea4b696afe916714ba3df5175c@sha256:596678dac1d736eae7fecd5fe718efcfd3dc637fe8adf626db86be7c7727b68b \ No newline at end of file diff --git a/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile index afae01d7b33c2..be4f96fa1f320 100644 --- a/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile @@ -88,7 +88,8 @@ RUN \curl -sSL https://get.rvm.io | bash -s stable # Install Ruby 2.7 RUN apt-get update && apt-get install -y procps && apt-get clean -RUN /bin/bash -l -c "rvm install ruby-2.7" +# "--disable-binary" is a workaround for https://github.com/rvm/rvm/issues/4975 +RUN /bin/bash -l -c "rvm install ruby-2.7 --disable-binary" RUN /bin/bash -l -c "rvm use --default ruby-2.7" RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc" RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" diff --git a/tools/dockerfile/test/python_debian11_default_arm64.current_version b/tools/dockerfile/test/python_debian11_default_arm64.current_version index 9b169fc51aca1..a634823cee2c2 100644 --- a/tools/dockerfile/test/python_debian11_default_arm64.current_version +++ b/tools/dockerfile/test/python_debian11_default_arm64.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_arm64:faff3d19982d4a3f479a4d9633d28028834bc4df@sha256:868cfb50e465f086b75bb65a7fab6d15b1edefabcd8c1826340acefb6ea1737f \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_arm64:cd3c1ca8dd1ff0e3496d603904d7d5d51ab8b1b8@sha256:b2b35321d91caa50ec25fd6eb5160afdd04c58ef18ac4d2a62b19177bbc6d00e \ No newline at end of file diff --git a/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile b/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile index 977de6aa99441..a331f21cb1cd9 100644 --- a/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile +++ b/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile @@ -63,6 +63,9 @@ RUN apt-get update && apt-get install -y python3.9 python3.9-dev python3-pip # for Python test coverage reporting RUN python3.9 -m pip install coverage +# six is required by the run_tests.py test harness +RUN python3.9 -m pip install six + # Google Cloud Platform API libraries # These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 diff --git a/tools/dockerfile/test/python_debian11_default_x64.current_version b/tools/dockerfile/test/python_debian11_default_x64.current_version index 4a8cfedcf8d40..1b90c45d7d658 100644 --- a/tools/dockerfile/test/python_debian11_default_x64.current_version +++ b/tools/dockerfile/test/python_debian11_default_x64.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_x64:31ceb004af0498642b186d28e5c6411b974c2c04@sha256:4f29e539941d22b7abb911f9b6b3101ff5c7c4fb75585bfe3b7389251ea6be1d \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_x64:14e1a18ec5d6bb304cfed659d4b4d5360b13b52c@sha256:5e9278a10a8c338963fa258213910fc0dead6bac91110256c1a0a344e0ade58f \ No newline at end of file diff --git a/tools/dockerfile/test/python_debian11_default_x64/Dockerfile b/tools/dockerfile/test/python_debian11_default_x64/Dockerfile index 582c7ca2f99d8..c2359ff9b9793 100644 --- a/tools/dockerfile/test/python_debian11_default_x64/Dockerfile +++ b/tools/dockerfile/test/python_debian11_default_x64/Dockerfile @@ -170,6 +170,9 @@ RUN apt-get update && apt-get install -y python3.9 python3.9-dev python3-pip # for Python test coverage reporting RUN python3.9 -m pip install coverage +# six is required by the run_tests.py test harness +RUN python3.9 -m pip install six + # Google Cloud Platform API libraries # These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 diff --git a/tools/dockerfile/test/ruby_debian11_arm64.current_version b/tools/dockerfile/test/ruby_debian11_arm64.current_version index 986d9ffefcf79..50940710a97e1 100644 --- a/tools/dockerfile/test/ruby_debian11_arm64.current_version +++ b/tools/dockerfile/test/ruby_debian11_arm64.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_arm64:215df896c707f55c3092a64afc4075c7a408b516@sha256:9503d80a40555aba4dd531b64354ad8036c6b37e162c93e7994ca23d89bc7d41 \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_arm64:cb472b623590186bc1d6e996cccb6fbb094e7e3a@sha256:c4901beb737a6aed3969c7bc601cd441488e5283a6abfabb80210c1bd2f5cd19 \ No newline at end of file diff --git a/tools/dockerfile/test/ruby_debian11_arm64/Dockerfile b/tools/dockerfile/test/ruby_debian11_arm64/Dockerfile index 65ea471b746f3..0189fc26798a0 100644 --- a/tools/dockerfile/test/ruby_debian11_arm64/Dockerfile +++ b/tools/dockerfile/test/ruby_debian11_arm64/Dockerfile @@ -88,7 +88,8 @@ RUN \curl -sSL https://get.rvm.io | bash -s stable # Install Ruby 2.7 RUN apt-get update && apt-get install -y procps && apt-get clean -RUN /bin/bash -l -c "rvm install ruby-2.7" +# "--disable-binary" is a workaround for https://github.com/rvm/rvm/issues/4975 +RUN /bin/bash -l -c "rvm install ruby-2.7 --disable-binary" RUN /bin/bash -l -c "rvm use --default ruby-2.7" RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc" RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" diff --git a/tools/dockerfile/test/ruby_debian11_x64.current_version b/tools/dockerfile/test/ruby_debian11_x64.current_version index 2f52045af70a8..a52d3b64bedbc 100644 --- a/tools/dockerfile/test/ruby_debian11_x64.current_version +++ b/tools/dockerfile/test/ruby_debian11_x64.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_x64:05ff6c04182addf087f77b2515992e98b9c7a171@sha256:3f01369c3e5707fa63007820b30461b9e32a4b729d81cb92d19669d7966a8584 \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_x64:b697ef647022cc3a14350ded1e01a52dfd9b8cf3@sha256:f30272c98928898b42903aa1a08fb0d769c8dc7b6173231a778c8c001b904219 \ No newline at end of file diff --git a/tools/dockerfile/test/ruby_debian11_x64/Dockerfile b/tools/dockerfile/test/ruby_debian11_x64/Dockerfile index eab09a00f3021..a354804d71a5a 100644 --- a/tools/dockerfile/test/ruby_debian11_x64/Dockerfile +++ b/tools/dockerfile/test/ruby_debian11_x64/Dockerfile @@ -88,7 +88,8 @@ RUN \curl -sSL https://get.rvm.io | bash -s stable # Install Ruby 2.7 RUN apt-get update && apt-get install -y procps && apt-get clean -RUN /bin/bash -l -c "rvm install ruby-2.7" +# "--disable-binary" is a workaround for https://github.com/rvm/rvm/issues/4975 +RUN /bin/bash -l -c "rvm install ruby-2.7 --disable-binary" RUN /bin/bash -l -c "rvm use --default ruby-2.7" RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc" RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" @@ -121,6 +122,13 @@ RUN mkdir /var/local/jenkins # Required by XDS interop test harness. RUN python3 -m pip install virtualenv==16.7.9 +# Passwordless sudo for all users +# Bazel docker sandbox and bazel RBE run scripts under docker +# as a regular user, but sometimes we need to be +# able to do something with root privileges. +RUN apt-get update && apt-get install -y sudo && apt-get clean +RUN echo 'ALL ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + # Define the default command. CMD ["bash"] diff --git a/tools/run_tests/helper_scripts/build_ruby.sh b/tools/run_tests/helper_scripts/build_ruby.sh index 3b86381786af3..cbf7a3cb191ab 100755 --- a/tools/run_tests/helper_scripts/build_ruby.sh +++ b/tools/run_tests/helper_scripts/build_ruby.sh @@ -45,4 +45,4 @@ popd # unbreak subsequent make builds by restoring zconf.h (previously renamed by cmake build) # see https://github.com/madler/zlib/issues/133 -(cd third_party/zlib; git checkout zconf.h) +(cd third_party/zlib; git checkout zconf.h || cp zconf.h.included zconf.h) From b7237cb65876ab17b189468e04c10aefbc2f9314 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Mon, 7 Aug 2023 12:26:49 -0700 Subject: [PATCH 132/205] [PSM Interop] Add bootstrap generator test (#33833) Based on https://github.com/grpc/grpc-go/pull/6463 --- tools/internal_ci/linux/grpc_xds_k8s_lb.cfg | 2 +- tools/internal_ci/linux/grpc_xds_k8s_lb.sh | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/internal_ci/linux/grpc_xds_k8s_lb.cfg b/tools/internal_ci/linux/grpc_xds_k8s_lb.cfg index 2bfb18d56f1cd..3ba9db6be9e93 100644 --- a/tools/internal_ci/linux/grpc_xds_k8s_lb.cfg +++ b/tools/internal_ci/linux/grpc_xds_k8s_lb.cfg @@ -16,7 +16,7 @@ # Location of the continuous shell script in repository. build_file: "grpc/tools/internal_ci/linux/grpc_xds_k8s_lb.sh" -timeout_mins: 180 +timeout_mins: 240 action { define_artifacts { regex: "artifacts/**/*sponge_log.xml" diff --git a/tools/internal_ci/linux/grpc_xds_k8s_lb.sh b/tools/internal_ci/linux/grpc_xds_k8s_lb.sh index adc3c87488ab3..78dc6f3c26a4e 100755 --- a/tools/internal_ci/linux/grpc_xds_k8s_lb.sh +++ b/tools/internal_ci/linux/grpc_xds_k8s_lb.sh @@ -180,6 +180,9 @@ main() { "remove_neg_test" "round_robin_test" ) + if [[ "${TESTING_VERSION}" =~ "master" ]]; then + test_suites+=('bootstrap_generator_test') + fi for test in "${test_suites[@]}"; do run_test $test || (( ++failed_tests )) done From 08659ad1c30d9f7c4e926d2dc2512aead6f932f5 Mon Sep 17 00:00:00 2001 From: Xuan Wang Date: Mon, 7 Aug 2023 12:43:55 -0700 Subject: [PATCH 133/205] Revert "[bazel] Add bazelified run_tests.py tests for ruby and python" (#33999) Reverts grpc/grpc#33959 --- .../dockerfile/passwordless_sudo.include | 6 -- templates/tools/dockerfile/ruby_deps.include | 3 +- .../Dockerfile.template | 3 - .../Dockerfile.template | 3 - .../ruby_debian11_x64/Dockerfile.template | 1 - .../dockerimage_current_versions.bzl | 10 +-- tools/bazelify_tests/test/BUILD | 70 ++++++++++--------- .../bazelify_tests/test/portability_tests.bzl | 19 ++--- tools/bazelify_tests/test/prepare_ruby.sh | 18 ----- .../grpc_interop_ruby.current_version | 2 +- .../interoptest/grpc_interop_ruby/Dockerfile | 3 +- ...hon_debian11_default_arm64.current_version | 2 +- .../python_debian11_default_arm64/Dockerfile | 3 - ...ython_debian11_default_x64.current_version | 2 +- .../python_debian11_default_x64/Dockerfile | 3 - .../test/ruby_debian11_arm64.current_version | 2 +- .../test/ruby_debian11_arm64/Dockerfile | 3 +- .../test/ruby_debian11_x64.current_version | 2 +- .../test/ruby_debian11_x64/Dockerfile | 10 +-- tools/run_tests/helper_scripts/build_ruby.sh | 2 +- 20 files changed, 61 insertions(+), 106 deletions(-) delete mode 100644 templates/tools/dockerfile/passwordless_sudo.include delete mode 100755 tools/bazelify_tests/test/prepare_ruby.sh diff --git a/templates/tools/dockerfile/passwordless_sudo.include b/templates/tools/dockerfile/passwordless_sudo.include deleted file mode 100644 index ee9fc2e425231..0000000000000 --- a/templates/tools/dockerfile/passwordless_sudo.include +++ /dev/null @@ -1,6 +0,0 @@ -# Passwordless sudo for all users -# Bazel docker sandbox and bazel RBE run scripts under docker -# as a regular user, but sometimes we need to be -# able to do something with root privileges. -RUN apt-get update && apt-get install -y sudo && apt-get clean -RUN echo 'ALL ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers diff --git a/templates/tools/dockerfile/ruby_deps.include b/templates/tools/dockerfile/ruby_deps.include index a57130f9bcca8..b4a24bfb3807d 100644 --- a/templates/tools/dockerfile/ruby_deps.include +++ b/templates/tools/dockerfile/ruby_deps.include @@ -8,8 +8,7 @@ RUN \curl -sSL https://get.rvm.io | bash -s stable # Install Ruby 2.7 RUN apt-get update && apt-get install -y procps && apt-get clean -# "--disable-binary" is a workaround for https://github.com/rvm/rvm/issues/4975 -RUN /bin/bash -l -c "rvm install ruby-2.7 --disable-binary" +RUN /bin/bash -l -c "rvm install ruby-2.7" RUN /bin/bash -l -c "rvm use --default ruby-2.7" RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc" RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" diff --git a/templates/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile.template b/templates/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile.template index 26ae79b66d4d5..ca6873105b783 100644 --- a/templates/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile.template +++ b/templates/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile.template @@ -25,9 +25,6 @@ # for Python test coverage reporting RUN python3.9 -m pip install coverage - # six is required by the run_tests.py test harness - RUN python3.9 -m pip install six - <%include file="../../gcp_api_libraries.include"/> <%include file="../../cmake.include"/> diff --git a/templates/tools/dockerfile/test/python_debian11_default_x64/Dockerfile.template b/templates/tools/dockerfile/test/python_debian11_default_x64/Dockerfile.template index eee2289d13419..9a420cf267d8b 100644 --- a/templates/tools/dockerfile/test/python_debian11_default_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/python_debian11_default_x64/Dockerfile.template @@ -31,9 +31,6 @@ # for Python test coverage reporting RUN python3.9 -m pip install coverage - # six is required by the run_tests.py test harness - RUN python3.9 -m pip install six - <%include file="../../gcp_api_libraries.include"/> <%include file="../../cmake.include"/> diff --git a/templates/tools/dockerfile/test/ruby_debian11_x64/Dockerfile.template b/templates/tools/dockerfile/test/ruby_debian11_x64/Dockerfile.template index 9d24d767888a0..52da8d5416fcd 100644 --- a/templates/tools/dockerfile/test/ruby_debian11_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/ruby_debian11_x64/Dockerfile.template @@ -23,7 +23,6 @@ <%include file="../../ccache.include"/> <%include file="../../run_tests_addons.include"/> <%include file="../../xds_interop_deps.include"/> - <%include file="../../passwordless_sudo.include"/> # Define the default command. CMD ["bash"] diff --git a/tools/bazelify_tests/dockerimage_current_versions.bzl b/tools/bazelify_tests/dockerimage_current_versions.bzl index 074aeef5f6fc5..79147f8ea0804 100644 --- a/tools/bazelify_tests/dockerimage_current_versions.bzl +++ b/tools/bazelify_tests/dockerimage_current_versions.bzl @@ -87,7 +87,7 @@ DOCKERIMAGE_CURRENT_VERSIONS = { "tools/dockerfile/interoptest/grpc_interop_php7.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_php7@sha256:09f4b895117c81506c423360b617917d06d3f7f0b78e4cca25eaec547ba6991e", "tools/dockerfile/interoptest/grpc_interop_python.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_python@sha256:fef1247f8256be2b9841331e7d21b0046da21a4a6d34a62addb36f62124725cf", "tools/dockerfile/interoptest/grpc_interop_pythonasyncio.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_pythonasyncio@sha256:bd4cdc8a71ef339193e178ce20d2b47a0b2aa25fc86c0b5740b9d86a2d4a0caa", - "tools/dockerfile/interoptest/grpc_interop_ruby.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_ruby@sha256:596678dac1d736eae7fecd5fe718efcfd3dc637fe8adf626db86be7c7727b68b", + "tools/dockerfile/interoptest/grpc_interop_ruby.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_ruby@sha256:0de52450b29cf91365e623b020cd97722c307510ba1813bee09264e0a49acdbc", "tools/dockerfile/interoptest/lb_interop_fake_servers.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/lb_interop_fake_servers@sha256:b89a51dd9147e1293f50ee64dd719fce5929ca7894d3770a3d80dbdecb99fd52", "tools/dockerfile/test/android_ndk.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/android_ndk@sha256:2bddf36ae504968b35f97e4a6c9b74864473689e84049675c30afb70f868d897", "tools/dockerfile/test/bazel.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/bazel@sha256:1118150d9d9479787165fff49f660a3dc633f1c57604305460172fc1916aa022", @@ -108,10 +108,10 @@ DOCKERIMAGE_CURRENT_VERSIONS = { "tools/dockerfile/test/php7_debian11_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/php7_debian11_arm64@sha256:444e25f9e3a89c2438e4d5e6f3904c5a1f4d1fb961f8456333ebe3e36e301a4e", "tools/dockerfile/test/php7_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/php7_debian11_x64@sha256:018d422abf144fc93e9027fd994f7d6aab453fffbe4a669d622dd3d1c1fe9ee7", "tools/dockerfile/test/python_alpine_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_alpine_x64@sha256:d10159225ae25276b7ae7bfc4230150e4b0a8ce7be833d904bdd4ecdfdc91c6e", - "tools/dockerfile/test/python_debian11_default_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_arm64@sha256:b2b35321d91caa50ec25fd6eb5160afdd04c58ef18ac4d2a62b19177bbc6d00e", - "tools/dockerfile/test/python_debian11_default_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_x64@sha256:5e9278a10a8c338963fa258213910fc0dead6bac91110256c1a0a344e0ade58f", + "tools/dockerfile/test/python_debian11_default_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_arm64@sha256:868cfb50e465f086b75bb65a7fab6d15b1edefabcd8c1826340acefb6ea1737f", + "tools/dockerfile/test/python_debian11_default_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_x64@sha256:4f29e539941d22b7abb911f9b6b3101ff5c7c4fb75585bfe3b7389251ea6be1d", "tools/dockerfile/test/rbe_ubuntu2004.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/rbe_ubuntu2004@sha256:d3951aeadf43e3bee6adc5b86d26cdaf0b9d1b5baf790d7b2530d1c197adc9f8", - "tools/dockerfile/test/ruby_debian11_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_arm64@sha256:c4901beb737a6aed3969c7bc601cd441488e5283a6abfabb80210c1bd2f5cd19", - "tools/dockerfile/test/ruby_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_x64@sha256:f30272c98928898b42903aa1a08fb0d769c8dc7b6173231a778c8c001b904219", + "tools/dockerfile/test/ruby_debian11_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_arm64@sha256:9503d80a40555aba4dd531b64354ad8036c6b37e162c93e7994ca23d89bc7d41", + "tools/dockerfile/test/ruby_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_x64@sha256:3f01369c3e5707fa63007820b30461b9e32a4b729d81cb92d19669d7966a8584", "tools/dockerfile/test/sanity.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/sanity@sha256:189e07d8503aa15344e3c8f565783659c3e2edc5b8ca455ec427de1e29ef4504", } diff --git a/tools/bazelify_tests/test/BUILD b/tools/bazelify_tests/test/BUILD index bfdea29390542..a6eac298bed2d 100644 --- a/tools/bazelify_tests/test/BUILD +++ b/tools/bazelify_tests/test/BUILD @@ -59,28 +59,29 @@ grpc_run_tests_py_test( docker_image_version = "tools/dockerfile/test/cxx_debian11_x64.current_version", ) -# Ruby -grpc_run_tests_py_test( - name = "runtests_ruby_linux_dbg", - size = "enormous", - args = [ - "-l ruby -c dbg", - ], - docker_image_version = "tools/dockerfile/test/ruby_debian11_x64.current_version", - prepare_script = ":prepare_ruby.sh", - use_login_shell = True, # ruby's docker image uses RVM which wierdly requires login shell -) - -grpc_run_tests_py_test( - name = "runtests_ruby_linux_opt", - size = "enormous", - args = [ - "-l ruby -c opt", - ], - docker_image_version = "tools/dockerfile/test/ruby_debian11_x64.current_version", - prepare_script = ":prepare_ruby.sh", - use_login_shell = True, # ruby's docker image uses RVM which wierdly requires login shell -) +# TODO(jtattermusch): Reintroduce ruby tests once they pass. +# # Ruby +# grpc_run_tests_py_test( +# name = "runtests_ruby_linux_dbg", +# size = "enormous", +# args = [ +# "-l ruby -c dbg", +# ], +# docker_image_version = "tools/dockerfile/test/ruby_debian11_x64.current_version", +# prepare_script = ":prepare_ruby.sh", +# use_login_shell = True, # ruby's docker image uses RVM which wierdly requires login shell +# ) + +# grpc_run_tests_py_test( +# name = "runtests_ruby_linux_opt", +# size = "enormous", +# args = [ +# "-l ruby -c opt", +# ], +# docker_image_version = "tools/dockerfile/test/ruby_debian11_x64.current_version", +# prepare_script = ":prepare_ruby.sh", +# use_login_shell = True, # ruby's docker image uses RVM which wierdly requires login shell +# ) # PHP grpc_run_tests_py_test( @@ -101,15 +102,16 @@ grpc_run_tests_py_test( docker_image_version = "tools/dockerfile/test/php7_debian11_x64.current_version", ) -# Python -grpc_run_tests_py_test( - name = "runtests_python_linux_opt", - size = "enormous", - args = [ - "-l python -c opt", - ], - docker_image_version = "tools/dockerfile/test/python_debian11_default_x64.current_version", -) +# TODO(jtattermusch): Reintroduce python tests once they pass. +# # Python +# grpc_run_tests_py_test( +# name = "runtests_python_linux_opt", +# size = "enormous", +# args = [ +# "-l python -c opt", +# ], +# docker_image_version = "tools/dockerfile/test/python_debian11_default_x64.current_version", +# ) # C# grpc_run_tests_py_test( @@ -142,9 +144,9 @@ test_suite( # TODO(jtattermusch): reenable the test once not flaky anymore #":runtests_php_linux_dbg", ":runtests_php_linux_opt", - ":runtests_python_linux_opt", - ":runtests_ruby_linux_dbg", - ":runtests_ruby_linux_opt", + #":runtests_python_linux_opt", + #":runtests_ruby_linux_dbg", + #":runtests_ruby_linux_opt", ], ) diff --git a/tools/bazelify_tests/test/portability_tests.bzl b/tools/bazelify_tests/test/portability_tests.bzl index 4acc7d729dcc6..26afa9e5bea07 100644 --- a/tools/bazelify_tests/test/portability_tests.bzl +++ b/tools/bazelify_tests/test/portability_tests.bzl @@ -73,16 +73,17 @@ def generate_run_tests_portability_tests(name): ) test_names.append(test_name) + # TODO(jtattermusch): Reintroduce the test once it passes. # Python on alpine - grpc_run_tests_py_test( - name = "runtests_python_linux_dbg_alpine", - args = [ - "-l python -c dbg --compiler python_alpine", - ], - docker_image_version = "tools/dockerfile/test/python_alpine_x64.current_version", - size = "enormous", - ) - test_names.append("runtests_python_linux_dbg_alpine") + #grpc_run_tests_py_test( + # name = "runtests_python_linux_dbg_alpine", + # args = [ + # "-l python -c dbg --compiler python_alpine", + # ], + # docker_image_version = "tools/dockerfile/test/python_alpine_x64.current_version", + # size = "enormous", + #) + #test_names.append("runtests_python_linux_dbg_alpine") # Generate test suite that allows easily running all portability tests. native.test_suite( diff --git a/tools/bazelify_tests/test/prepare_ruby.sh b/tools/bazelify_tests/test/prepare_ruby.sh deleted file mode 100755 index a5baed7c039f7..0000000000000 --- a/tools/bazelify_tests/test/prepare_ruby.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# Copyright 2023 The gRPC Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# make sure /usr/local/rvm is writable by ruby when running under docker as non-root -sudo chown -R "$(id -u)" /usr/local/rvm - diff --git a/tools/dockerfile/interoptest/grpc_interop_ruby.current_version b/tools/dockerfile/interoptest/grpc_interop_ruby.current_version index 9f6dbb4e59b6f..d6b0402208771 100644 --- a/tools/dockerfile/interoptest/grpc_interop_ruby.current_version +++ b/tools/dockerfile/interoptest/grpc_interop_ruby.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_ruby:a6f7413e822f23ea4b696afe916714ba3df5175c@sha256:596678dac1d736eae7fecd5fe718efcfd3dc637fe8adf626db86be7c7727b68b \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_ruby:4abe304d586e1bc862cb85e9ac5e9c7b2f7ae73c@sha256:0de52450b29cf91365e623b020cd97722c307510ba1813bee09264e0a49acdbc \ No newline at end of file diff --git a/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile index be4f96fa1f320..afae01d7b33c2 100644 --- a/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile @@ -88,8 +88,7 @@ RUN \curl -sSL https://get.rvm.io | bash -s stable # Install Ruby 2.7 RUN apt-get update && apt-get install -y procps && apt-get clean -# "--disable-binary" is a workaround for https://github.com/rvm/rvm/issues/4975 -RUN /bin/bash -l -c "rvm install ruby-2.7 --disable-binary" +RUN /bin/bash -l -c "rvm install ruby-2.7" RUN /bin/bash -l -c "rvm use --default ruby-2.7" RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc" RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" diff --git a/tools/dockerfile/test/python_debian11_default_arm64.current_version b/tools/dockerfile/test/python_debian11_default_arm64.current_version index a634823cee2c2..9b169fc51aca1 100644 --- a/tools/dockerfile/test/python_debian11_default_arm64.current_version +++ b/tools/dockerfile/test/python_debian11_default_arm64.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_arm64:cd3c1ca8dd1ff0e3496d603904d7d5d51ab8b1b8@sha256:b2b35321d91caa50ec25fd6eb5160afdd04c58ef18ac4d2a62b19177bbc6d00e \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_arm64:faff3d19982d4a3f479a4d9633d28028834bc4df@sha256:868cfb50e465f086b75bb65a7fab6d15b1edefabcd8c1826340acefb6ea1737f \ No newline at end of file diff --git a/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile b/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile index a331f21cb1cd9..977de6aa99441 100644 --- a/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile +++ b/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile @@ -63,9 +63,6 @@ RUN apt-get update && apt-get install -y python3.9 python3.9-dev python3-pip # for Python test coverage reporting RUN python3.9 -m pip install coverage -# six is required by the run_tests.py test harness -RUN python3.9 -m pip install six - # Google Cloud Platform API libraries # These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 diff --git a/tools/dockerfile/test/python_debian11_default_x64.current_version b/tools/dockerfile/test/python_debian11_default_x64.current_version index 1b90c45d7d658..4a8cfedcf8d40 100644 --- a/tools/dockerfile/test/python_debian11_default_x64.current_version +++ b/tools/dockerfile/test/python_debian11_default_x64.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_x64:14e1a18ec5d6bb304cfed659d4b4d5360b13b52c@sha256:5e9278a10a8c338963fa258213910fc0dead6bac91110256c1a0a344e0ade58f \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_x64:31ceb004af0498642b186d28e5c6411b974c2c04@sha256:4f29e539941d22b7abb911f9b6b3101ff5c7c4fb75585bfe3b7389251ea6be1d \ No newline at end of file diff --git a/tools/dockerfile/test/python_debian11_default_x64/Dockerfile b/tools/dockerfile/test/python_debian11_default_x64/Dockerfile index c2359ff9b9793..582c7ca2f99d8 100644 --- a/tools/dockerfile/test/python_debian11_default_x64/Dockerfile +++ b/tools/dockerfile/test/python_debian11_default_x64/Dockerfile @@ -170,9 +170,6 @@ RUN apt-get update && apt-get install -y python3.9 python3.9-dev python3-pip # for Python test coverage reporting RUN python3.9 -m pip install coverage -# six is required by the run_tests.py test harness -RUN python3.9 -m pip install six - # Google Cloud Platform API libraries # These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 diff --git a/tools/dockerfile/test/ruby_debian11_arm64.current_version b/tools/dockerfile/test/ruby_debian11_arm64.current_version index 50940710a97e1..986d9ffefcf79 100644 --- a/tools/dockerfile/test/ruby_debian11_arm64.current_version +++ b/tools/dockerfile/test/ruby_debian11_arm64.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_arm64:cb472b623590186bc1d6e996cccb6fbb094e7e3a@sha256:c4901beb737a6aed3969c7bc601cd441488e5283a6abfabb80210c1bd2f5cd19 \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_arm64:215df896c707f55c3092a64afc4075c7a408b516@sha256:9503d80a40555aba4dd531b64354ad8036c6b37e162c93e7994ca23d89bc7d41 \ No newline at end of file diff --git a/tools/dockerfile/test/ruby_debian11_arm64/Dockerfile b/tools/dockerfile/test/ruby_debian11_arm64/Dockerfile index 0189fc26798a0..65ea471b746f3 100644 --- a/tools/dockerfile/test/ruby_debian11_arm64/Dockerfile +++ b/tools/dockerfile/test/ruby_debian11_arm64/Dockerfile @@ -88,8 +88,7 @@ RUN \curl -sSL https://get.rvm.io | bash -s stable # Install Ruby 2.7 RUN apt-get update && apt-get install -y procps && apt-get clean -# "--disable-binary" is a workaround for https://github.com/rvm/rvm/issues/4975 -RUN /bin/bash -l -c "rvm install ruby-2.7 --disable-binary" +RUN /bin/bash -l -c "rvm install ruby-2.7" RUN /bin/bash -l -c "rvm use --default ruby-2.7" RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc" RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" diff --git a/tools/dockerfile/test/ruby_debian11_x64.current_version b/tools/dockerfile/test/ruby_debian11_x64.current_version index a52d3b64bedbc..2f52045af70a8 100644 --- a/tools/dockerfile/test/ruby_debian11_x64.current_version +++ b/tools/dockerfile/test/ruby_debian11_x64.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_x64:b697ef647022cc3a14350ded1e01a52dfd9b8cf3@sha256:f30272c98928898b42903aa1a08fb0d769c8dc7b6173231a778c8c001b904219 \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_x64:05ff6c04182addf087f77b2515992e98b9c7a171@sha256:3f01369c3e5707fa63007820b30461b9e32a4b729d81cb92d19669d7966a8584 \ No newline at end of file diff --git a/tools/dockerfile/test/ruby_debian11_x64/Dockerfile b/tools/dockerfile/test/ruby_debian11_x64/Dockerfile index a354804d71a5a..eab09a00f3021 100644 --- a/tools/dockerfile/test/ruby_debian11_x64/Dockerfile +++ b/tools/dockerfile/test/ruby_debian11_x64/Dockerfile @@ -88,8 +88,7 @@ RUN \curl -sSL https://get.rvm.io | bash -s stable # Install Ruby 2.7 RUN apt-get update && apt-get install -y procps && apt-get clean -# "--disable-binary" is a workaround for https://github.com/rvm/rvm/issues/4975 -RUN /bin/bash -l -c "rvm install ruby-2.7 --disable-binary" +RUN /bin/bash -l -c "rvm install ruby-2.7" RUN /bin/bash -l -c "rvm use --default ruby-2.7" RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc" RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" @@ -122,13 +121,6 @@ RUN mkdir /var/local/jenkins # Required by XDS interop test harness. RUN python3 -m pip install virtualenv==16.7.9 -# Passwordless sudo for all users -# Bazel docker sandbox and bazel RBE run scripts under docker -# as a regular user, but sometimes we need to be -# able to do something with root privileges. -RUN apt-get update && apt-get install -y sudo && apt-get clean -RUN echo 'ALL ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers - # Define the default command. CMD ["bash"] diff --git a/tools/run_tests/helper_scripts/build_ruby.sh b/tools/run_tests/helper_scripts/build_ruby.sh index cbf7a3cb191ab..3b86381786af3 100755 --- a/tools/run_tests/helper_scripts/build_ruby.sh +++ b/tools/run_tests/helper_scripts/build_ruby.sh @@ -45,4 +45,4 @@ popd # unbreak subsequent make builds by restoring zconf.h (previously renamed by cmake build) # see https://github.com/madler/zlib/issues/133 -(cd third_party/zlib; git checkout zconf.h || cp zconf.h.included zconf.h) +(cd third_party/zlib; git checkout zconf.h) From 1c0f5d32a0da2083a150e5e719d7d5dfdc621eb4 Mon Sep 17 00:00:00 2001 From: Mario Jones Vimal Date: Mon, 7 Aug 2023 12:53:00 -0700 Subject: [PATCH 134/205] [core/gpr] Move subprocess to gpr and add subprocess creation using execve (#33983) Move subprocess util to gpr. Add support for communication with the subprocess. This is required to support authentication using an executable. --- BUILD | 20 ++ CMakeLists.txt | 162 +---------- build_autogenerated.yaml | 243 +---------------- grpc.gyp | 6 +- .../util => src/core/lib/gpr}/subprocess.h | 15 +- src/core/lib/gpr/subprocess_posix.cc | 252 ++++++++++++++++++ .../core/lib/gpr}/subprocess_windows.cc | 2 +- test/core/bad_ssl/bad_ssl_test.cc | 2 +- test/core/bad_ssl/generate_tests.bzl | 1 + test/core/event_engine/test_suite/tests/BUILD | 1 + test/core/http/BUILD | 3 + test/core/http/httpcli_test.cc | 2 +- test/core/http/httpcli_test_util.cc | 2 +- test/core/http/httpcli_test_util.h | 2 +- test/core/http/httpscli_test.cc | 2 +- test/core/memory_usage/BUILD | 2 + test/core/memory_usage/memory_usage_test.cc | 2 +- test/core/util/BUILD | 3 - test/core/util/subprocess_posix.cc | 101 ------- test/cpp/util/BUILD | 2 + test/cpp/util/subprocess.cc | 2 +- 21 files changed, 323 insertions(+), 504 deletions(-) rename {test/core/util => src/core/lib/gpr}/subprocess.h (68%) create mode 100644 src/core/lib/gpr/subprocess_posix.cc rename {test/core/util => src/core/lib/gpr}/subprocess_windows.cc (98%) delete mode 100644 test/core/util/subprocess_posix.cc diff --git a/BUILD b/BUILD index 1b1a4ef5081dd..a1a9c395447c8 100644 --- a/BUILD +++ b/BUILD @@ -4000,6 +4000,26 @@ grpc_cc_library( ], ) +grpc_cc_library( + name = "subprocess", + srcs = [ + "//src/core:lib/gpr/subprocess_posix.cc", + "//src/core:lib/gpr/subprocess_windows.cc", + ], + hdrs = [ + "//src/core:lib/gpr/subprocess.h", + ], + external_deps = [ + "absl/strings", + "absl/types:span", + ], + deps = [ + "gpr", + "//src/core:strerror", + "//src/core:tchar", + ], +) + # TODO(yashykt): Remove the UPB definitions from here once they are no longer needed ### UPB Targets diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ad4e0c981a88..ba2dbfd31860c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3284,8 +3284,6 @@ add_library(benchmark_helpers test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc test/cpp/microbenchmarks/helpers.cc ) @@ -4003,6 +4001,8 @@ endif() if(gRPC_BUILD_TESTS) add_library(grpc++_test_util + src/core/lib/gpr/subprocess_posix.cc + src/core/lib/gpr/subprocess_windows.cc test/core/end2end/data/client_certs.cc test/core/end2end/data/server1_cert.cc test/core/end2end/data/server1_key.cc @@ -4016,8 +4016,6 @@ add_library(grpc++_test_util test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc test/cpp/util/byte_buffer_proto_helper.cc test/cpp/util/create_test_channel.cc @@ -5039,8 +5037,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc ) target_compile_features(fd_conservation_posix_test PUBLIC cxx_std_14) @@ -5176,8 +5172,6 @@ add_executable(test_core_iomgr_timer_list_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc ) target_compile_features(test_core_iomgr_timer_list_test PUBLIC cxx_std_14) @@ -5291,6 +5285,8 @@ if(gRPC_BUILD_TESTS) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_executable(address_sorting_test_unsecure + src/core/lib/gpr/subprocess_posix.cc + src/core/lib/gpr/subprocess_windows.cc test/core/util/cmdline.cc test/core/util/fuzzer_util.cc test/core/util/grpc_profiler.cc @@ -5300,8 +5296,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc test/cpp/naming/address_sorting_test.cc test/cpp/util/byte_buffer_proto_helper.cc @@ -5413,8 +5407,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc test/cpp/common/alarm_test.cc third_party/googletest/googletest/src/gtest-all.cc @@ -5857,8 +5849,6 @@ add_executable(alts_security_connector_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -6193,8 +6183,6 @@ add_executable(auth_context_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -6279,8 +6267,6 @@ add_executable(authorization_matchers_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -6405,8 +6391,6 @@ add_executable(aws_request_signer_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -6605,6 +6589,8 @@ if(gRPC_BUILD_TESTS) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_executable(bad_ssl_alpn_test + src/core/lib/gpr/subprocess_posix.cc + src/core/lib/gpr/subprocess_windows.cc test/core/bad_ssl/bad_ssl_test.cc test/core/end2end/cq_verifier.cc test/core/util/cmdline.cc @@ -6616,8 +6602,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -6657,6 +6641,8 @@ if(gRPC_BUILD_TESTS) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_executable(bad_ssl_cert_test + src/core/lib/gpr/subprocess_posix.cc + src/core/lib/gpr/subprocess_windows.cc test/core/bad_ssl/bad_ssl_test.cc test/core/end2end/cq_verifier.cc test/core/util/cmdline.cc @@ -6668,8 +6654,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -7225,8 +7209,6 @@ add_executable(buffer_list_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -8022,8 +8004,6 @@ add_executable(cel_authorization_engine_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -8358,8 +8338,6 @@ add_executable(channel_creds_registry_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -8655,8 +8633,6 @@ add_executable(check_gcp_environment_linux_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -8704,8 +8680,6 @@ add_executable(check_gcp_environment_windows_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -9347,8 +9321,6 @@ add_executable(cmdline_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -9473,8 +9445,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -9797,8 +9767,6 @@ add_executable(connectivity_state_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -10860,8 +10828,6 @@ add_executable(endpoint_pair_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -10997,8 +10963,6 @@ add_executable(error_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -11046,8 +11010,6 @@ add_executable(error_utils_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -11095,8 +11057,6 @@ add_executable(evaluate_args_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -11665,8 +11625,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -12324,8 +12282,6 @@ add_executable(format_request_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -13010,8 +12966,6 @@ add_executable(grpc_alts_credentials_options_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -13097,8 +13051,6 @@ add_executable(grpc_authorization_engine_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -13146,8 +13098,6 @@ add_executable(grpc_authorization_policy_provider_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -13507,8 +13457,6 @@ add_executable(grpc_ipv6_loopback_available_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -13766,8 +13714,6 @@ add_executable(grpc_tls_certificate_distributor_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -13815,8 +13761,6 @@ add_executable(grpc_tls_certificate_provider_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -13864,8 +13808,6 @@ add_executable(grpc_tls_certificate_verifier_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -13913,8 +13855,6 @@ add_executable(grpc_tls_credentials_options_comparator_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -13962,8 +13902,6 @@ add_executable(grpc_tls_credentials_options_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -14568,8 +14506,6 @@ add_executable(histogram_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -14654,8 +14590,6 @@ add_executable(hpack_encoder_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -14703,8 +14637,6 @@ add_executable(hpack_parser_table_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -14752,8 +14684,6 @@ add_executable(hpack_parser_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -15264,8 +15194,6 @@ add_executable(insecure_security_connector_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -15773,8 +15701,6 @@ add_executable(json_token_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -15822,8 +15748,6 @@ add_executable(jwt_verifier_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -16428,8 +16352,6 @@ add_executable(matchers_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -16799,8 +16721,6 @@ add_executable(message_compress_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -16885,8 +16805,6 @@ add_executable(metadata_map_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -17977,8 +17895,6 @@ add_executable(parser_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -18242,8 +18158,6 @@ add_executable(pid_controller_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -18291,8 +18205,6 @@ add_executable(ping_abuse_policy_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -18340,8 +18252,6 @@ add_executable(ping_configuration_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -18437,8 +18347,6 @@ add_executable(ping_rate_policy_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -19567,8 +19475,6 @@ add_executable(rbac_translator_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -19875,8 +19781,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -19927,8 +19831,6 @@ add_executable(resolve_address_using_ares_resolver_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -19978,8 +19880,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -20030,8 +19930,6 @@ add_executable(resolve_address_using_native_resolver_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -22138,8 +22036,6 @@ add_executable(secure_endpoint_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -22187,8 +22083,6 @@ add_executable(security_connector_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -22386,8 +22280,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc test/cpp/server/server_builder_test.cc third_party/googletest/googletest/src/gtest-all.cc @@ -22454,8 +22346,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc test/cpp/server/server_builder_with_socket_mutator_test.cc third_party/googletest/googletest/src/gtest-all.cc @@ -22866,8 +22756,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc test/cpp/server/server_request_call_test.cc third_party/googletest/googletest/src/gtest-all.cc @@ -23138,8 +23026,6 @@ add_executable(settings_timeout_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -23752,8 +23638,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -23875,8 +23759,6 @@ add_executable(ssl_credentials_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -24155,8 +24037,6 @@ add_executable(status_conversion_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -24280,8 +24160,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -24475,8 +24353,6 @@ add_executable(streams_not_seen_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -24636,8 +24512,6 @@ add_executable(system_roots_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -24727,8 +24601,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -24818,8 +24690,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -24869,8 +24739,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -25294,8 +25162,6 @@ add_executable(test_core_iomgr_load_file_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -25343,8 +25209,6 @@ add_executable(test_core_iomgr_timer_heap_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -25392,8 +25256,6 @@ add_executable(test_core_security_credentials_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -26001,8 +25863,6 @@ add_executable(timeout_encoding_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -26217,8 +26077,6 @@ add_executable(tls_security_connector_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc @@ -27533,8 +27391,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc test/cpp/performance/writes_per_rpc_test.cc third_party/googletest/googletest/src/gtest-all.cc @@ -28555,8 +28411,6 @@ add_executable(xds_credentials_test test/core/util/passthru_endpoint.cc test/core/util/resolve_localhost_ip46.cc test/core/util/slice_splitter.cc - test/core/util/subprocess_posix.cc - test/core/util/subprocess_windows.cc test/core/util/tracer_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 93759c1d0a871..9d86bc8ece325 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -2777,7 +2777,6 @@ libs: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h - test/cpp/microbenchmarks/fullstack_context_mutators.h - test/cpp/microbenchmarks/fullstack_fixtures.h @@ -2796,8 +2795,6 @@ libs: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc - test/cpp/microbenchmarks/helpers.cc deps: @@ -3186,6 +3183,7 @@ libs: language: c++ public_headers: [] headers: + - src/core/lib/gpr/subprocess.h - test/core/end2end/data/ssl_test_data.h - test/core/util/cmdline.h - test/core/util/evaluate_args_test_util.h @@ -3198,7 +3196,6 @@ libs: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h - test/cpp/util/byte_buffer_proto_helper.h - test/cpp/util/create_test_channel.h @@ -3206,6 +3203,8 @@ libs: - test/cpp/util/subprocess.h - test/cpp/util/test_credentials_provider.h src: + - src/core/lib/gpr/subprocess_posix.cc + - src/core/lib/gpr/subprocess_windows.cc - test/core/end2end/data/client_certs.cc - test/core/end2end/data/server1_cert.cc - test/core/end2end/data/server1_key.cc @@ -3219,8 +3218,6 @@ libs: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc - test/cpp/util/byte_buffer_proto_helper.cc - test/cpp/util/create_test_channel.cc @@ -4204,7 +4201,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/fd_conservation_posix_test.cc @@ -4217,8 +4213,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -4280,7 +4274,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/timer_list_test.cc @@ -4293,8 +4286,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -4354,6 +4345,7 @@ targets: build: test language: c++ headers: + - src/core/lib/gpr/subprocess.h - test/core/util/cmdline.h - test/core/util/evaluate_args_test_util.h - test/core/util/fuzzer_util.h @@ -4365,12 +4357,13 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h - test/cpp/util/byte_buffer_proto_helper.h - test/cpp/util/string_ref_helper.h - test/cpp/util/subprocess.h src: + - src/core/lib/gpr/subprocess_posix.cc + - src/core/lib/gpr/subprocess_windows.cc - test/core/util/cmdline.cc - test/core/util/fuzzer_util.cc - test/core/util/grpc_profiler.cc @@ -4380,8 +4373,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc - test/cpp/naming/address_sorting_test.cc - test/cpp/util/byte_buffer_proto_helper.cc @@ -4429,7 +4420,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/util/cmdline.cc @@ -4441,8 +4431,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc - test/cpp/common/alarm_test.cc deps: @@ -4588,7 +4576,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/alts_security_connector_test.cc @@ -4601,8 +4588,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -4701,7 +4686,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/auth_context_test.cc @@ -4714,8 +4698,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -4746,7 +4728,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/authorization_matchers_test.cc @@ -4759,8 +4740,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -4806,7 +4785,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/aws_request_signer_test.cc @@ -4819,8 +4797,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -4895,6 +4871,7 @@ targets: build: test language: c++ headers: + - src/core/lib/gpr/subprocess.h - test/core/end2end/cq_verifier.h - test/core/util/cmdline.h - test/core/util/evaluate_args_test_util.h @@ -4907,9 +4884,10 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: + - src/core/lib/gpr/subprocess_posix.cc + - src/core/lib/gpr/subprocess_windows.cc - test/core/bad_ssl/bad_ssl_test.cc - test/core/end2end/cq_verifier.cc - test/core/util/cmdline.cc @@ -4921,8 +4899,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -4935,6 +4911,7 @@ targets: build: test language: c++ headers: + - src/core/lib/gpr/subprocess.h - test/core/end2end/cq_verifier.h - test/core/util/cmdline.h - test/core/util/evaluate_args_test_util.h @@ -4947,9 +4924,10 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: + - src/core/lib/gpr/subprocess_posix.cc + - src/core/lib/gpr/subprocess_windows.cc - test/core/bad_ssl/bad_ssl_test.cc - test/core/end2end/cq_verifier.cc - test/core/util/cmdline.cc @@ -4961,8 +4939,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -5236,7 +5212,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/buffer_list_test.cc @@ -5249,8 +5224,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -5750,7 +5723,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c @@ -5852,8 +5824,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -5966,7 +5936,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/channel_creds_registry_test.cc @@ -5979,8 +5948,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -6070,7 +6037,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/check_gcp_environment_linux_test.cc @@ -6083,8 +6049,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -6104,7 +6068,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/check_gcp_environment_windows_test.cc @@ -6117,8 +6080,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -6422,7 +6383,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/util/cmdline.cc @@ -6435,8 +6395,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -6480,7 +6438,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/combiner_test.cc @@ -6493,8 +6450,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -6617,7 +6572,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/connectivity_state_test.cc @@ -6630,8 +6584,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -7127,7 +7079,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/endpoint_pair_test.cc @@ -7141,8 +7092,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -7186,7 +7135,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/endpoint_tests.cc @@ -7200,8 +7148,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -7222,7 +7168,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/error_utils_test.cc @@ -7235,8 +7180,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -7256,7 +7199,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/evaluate_args_test.cc @@ -7269,8 +7211,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -7573,7 +7513,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/fd_posix_test.cc @@ -7586,8 +7525,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -8027,7 +7964,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/end2end/data/client_certs.cc @@ -8044,8 +7980,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -8749,7 +8683,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/grpc_alts_credentials_options_test.cc @@ -8762,8 +8695,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -8793,7 +8724,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/grpc_authorization_engine_test.cc @@ -8807,8 +8737,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -8828,7 +8756,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/grpc_authorization_policy_provider_test.cc @@ -8841,8 +8768,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_authorization_provider @@ -8976,7 +8901,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/grpc_ipv6_loopback_available_test.cc @@ -8989,8 +8913,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9050,7 +8972,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/grpc_tls_certificate_distributor_test.cc @@ -9063,8 +8984,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9084,7 +9003,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/grpc_tls_certificate_provider_test.cc @@ -9097,8 +9015,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9118,7 +9034,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/grpc_tls_certificate_verifier_test.cc @@ -9131,8 +9046,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9152,7 +9065,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/grpc_tls_credentials_options_comparator_test.cc @@ -9165,8 +9077,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9186,7 +9096,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/grpc_tls_credentials_options_test.cc @@ -9199,8 +9108,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9443,7 +9350,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/util/cmdline.cc @@ -9456,8 +9362,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9488,7 +9392,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/chttp2/hpack_encoder_test.cc @@ -9501,8 +9404,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9523,7 +9424,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/chttp2/hpack_parser_table_test.cc @@ -9536,8 +9436,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9558,7 +9456,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/chttp2/hpack_parser_test.cc @@ -9571,8 +9468,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -9761,7 +9656,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/insecure_security_connector_test.cc @@ -9774,8 +9668,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -10037,7 +9929,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/json_token_test.cc @@ -10050,8 +9941,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -10072,7 +9961,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/jwt_verifier_test.cc @@ -10085,8 +9973,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -10431,7 +10317,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/matchers/matchers_test.cc @@ -10444,8 +10329,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -10644,7 +10527,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/compression/message_compress_test.cc @@ -10657,8 +10539,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -10688,7 +10568,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/metadata_map_test.cc @@ -10701,8 +10580,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -11107,7 +10984,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/end2end/data/client_certs.cc @@ -11124,8 +11000,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -11265,7 +11139,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/pid_controller_test.cc @@ -11278,8 +11151,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -11299,7 +11170,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/chttp2/ping_abuse_policy_test.cc @@ -11312,8 +11182,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -11334,7 +11202,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/chttp2/ping_configuration_test.cc @@ -11347,8 +11214,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -11404,7 +11269,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/chttp2/ping_rate_policy_test.cc @@ -11417,8 +11281,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -11878,7 +11740,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/rbac_translator_test.cc @@ -11891,8 +11752,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_authorization_provider @@ -12049,7 +11908,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/resolve_address_posix_test.cc @@ -12062,8 +11920,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - absl/flags:parse @@ -12091,7 +11947,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/resolve_address_test.cc @@ -12105,8 +11960,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -12127,7 +11980,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/resolve_address_posix_test.cc @@ -12140,8 +11992,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - absl/flags:parse @@ -12169,7 +12019,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/resolve_address_test.cc @@ -12183,8 +12032,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -13539,7 +13386,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/endpoint_tests.cc @@ -13553,8 +13399,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -13574,7 +13418,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/security_connector_test.cc @@ -13587,8 +13430,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -13651,7 +13492,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - src/proto/grpc/testing/echo.proto @@ -13667,8 +13507,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc - test/cpp/server/server_builder_test.cc deps: @@ -13694,7 +13532,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - src/proto/grpc/testing/echo.proto @@ -13710,8 +13547,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc - test/cpp/server/server_builder_with_socket_mutator_test.cc deps: @@ -13854,7 +13689,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - src/proto/grpc/testing/echo.proto @@ -13870,8 +13704,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc - test/cpp/server/server_request_call_test.cc deps: @@ -13981,7 +13813,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/chttp2/settings_timeout_test.cc @@ -13994,8 +13825,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14288,7 +14117,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/socket_utils_test.cc @@ -14301,8 +14129,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14347,7 +14173,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/ssl_credentials_test.cc @@ -14360,8 +14185,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14456,7 +14279,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/status_conversion_test.cc @@ -14469,8 +14291,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14512,7 +14332,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/end2end/cq_verifier.cc @@ -14526,8 +14345,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14614,7 +14431,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/end2end/cq_verifier.cc @@ -14628,8 +14444,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14680,7 +14494,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/system_roots_test.cc @@ -14693,8 +14506,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14731,7 +14542,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/tcp_client_posix_test.cc @@ -14744,8 +14554,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14784,7 +14592,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/endpoint_tests.cc @@ -14798,8 +14605,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -14822,7 +14627,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/tcp_server_posix_test.cc @@ -14835,8 +14639,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -15022,7 +14824,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/load_file_test.cc @@ -15035,8 +14836,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -15057,7 +14856,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/iomgr/timer_heap_test.cc @@ -15070,8 +14868,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -15092,7 +14888,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/credentials_test.cc @@ -15105,8 +14900,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -15306,7 +15099,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/transport/timeout_encoding_test.cc @@ -15319,8 +15111,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -15387,7 +15177,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/tls_security_connector_test.cc @@ -15400,8 +15189,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util @@ -16112,7 +15899,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - src/proto/grpc/testing/echo.proto @@ -16128,8 +15914,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc - test/cpp/performance/writes_per_rpc_test.cc deps: @@ -16471,7 +16255,6 @@ targets: - test/core/util/passthru_endpoint.h - test/core/util/resolve_localhost_ip46.h - test/core/util/slice_splitter.h - - test/core/util/subprocess.h - test/core/util/tracer_util.h src: - test/core/security/xds_credentials_test.cc @@ -16484,8 +16267,6 @@ targets: - test/core/util/passthru_endpoint.cc - test/core/util/resolve_localhost_ip46.cc - test/core/util/slice_splitter.cc - - test/core/util/subprocess_posix.cc - - test/core/util/subprocess_windows.cc - test/core/util/tracer_util.cc deps: - grpc_test_util diff --git a/grpc.gyp b/grpc.gyp index 4ac488d26eaa8..05ca749063ce7 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -1506,8 +1506,6 @@ 'test/core/util/passthru_endpoint.cc', 'test/core/util/resolve_localhost_ip46.cc', 'test/core/util/slice_splitter.cc', - 'test/core/util/subprocess_posix.cc', - 'test/core/util/subprocess_windows.cc', 'test/core/util/tracer_util.cc', 'test/cpp/microbenchmarks/helpers.cc', ], @@ -1648,6 +1646,8 @@ 'grpc_test_util', ], 'sources': [ + 'src/core/lib/gpr/subprocess_posix.cc', + 'src/core/lib/gpr/subprocess_windows.cc', 'test/core/end2end/data/client_certs.cc', 'test/core/end2end/data/server1_cert.cc', 'test/core/end2end/data/server1_key.cc', @@ -1661,8 +1661,6 @@ 'test/core/util/passthru_endpoint.cc', 'test/core/util/resolve_localhost_ip46.cc', 'test/core/util/slice_splitter.cc', - 'test/core/util/subprocess_posix.cc', - 'test/core/util/subprocess_windows.cc', 'test/core/util/tracer_util.cc', 'test/cpp/util/byte_buffer_proto_helper.cc', 'test/cpp/util/create_test_channel.cc', diff --git a/test/core/util/subprocess.h b/src/core/lib/gpr/subprocess.h similarity index 68% rename from test/core/util/subprocess.h rename to src/core/lib/gpr/subprocess.h index a46be258516b0..71d4796fde6f2 100644 --- a/test/core/util/subprocess.h +++ b/src/core/lib/gpr/subprocess.h @@ -16,17 +16,26 @@ // // -#ifndef GRPC_TEST_CORE_UTIL_SUBPROCESS_H -#define GRPC_TEST_CORE_UTIL_SUBPROCESS_H +#ifndef GRPC_SRC_CORE_LIB_GPR_SUBPROCESS_H +#define GRPC_SRC_CORE_LIB_GPR_SUBPROCESS_H #include +#include + typedef struct gpr_subprocess gpr_subprocess; /// .exe on windows, empty on unices const char* gpr_subprocess_binary_extension(); gpr_subprocess* gpr_subprocess_create(int argc, const char** argv); + +gpr_subprocess* gpr_subprocess_create_with_envp(int argc, const char** argv, + int envc, const char** envp); + +// communicate to the subprocess via stdin, stdout and stderr +bool gpr_subprocess_communicate(gpr_subprocess* p, std::string& input_data, + std::string* output_data, std::string* error); /// if subprocess has not been joined, kill it void gpr_subprocess_destroy(gpr_subprocess* p); /// returns exit status; can be called at most once @@ -34,4 +43,4 @@ int gpr_subprocess_join(gpr_subprocess* p); void gpr_subprocess_interrupt(gpr_subprocess* p); int gpr_subprocess_get_process_id(gpr_subprocess* p); -#endif // GRPC_TEST_CORE_UTIL_SUBPROCESS_H +#endif // GRPC_SRC_CORE_LIB_GPR_SUBPROCESS_H diff --git a/src/core/lib/gpr/subprocess_posix.cc b/src/core/lib/gpr/subprocess_posix.cc new file mode 100644 index 0000000000000..5444bd822011b --- /dev/null +++ b/src/core/lib/gpr/subprocess_posix.cc @@ -0,0 +1,252 @@ +// +// +// Copyright 2015 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#include + +#ifdef GPR_POSIX_SUBPROCESS + +#include +#include +#include +#include +#include + +#include + +#include "absl/strings/substitute.h" + +#include +#include + +#include "src/core/lib/gpr/subprocess.h" +#include "src/core/lib/gprpp/memory.h" +#include "src/core/lib/gprpp/strerror.h" + +struct gpr_subprocess { + int pid; + bool joined; + int child_stdin_; + int child_stdout_; +}; + +const char* gpr_subprocess_binary_extension() { return ""; } + +gpr_subprocess* gpr_subprocess_create(int argc, const char** argv) { + gpr_subprocess* r; + int pid; + char** exec_args; + pid = fork(); + if (pid == -1) { + return nullptr; + } else if (pid == 0) { + exec_args = static_cast( + gpr_malloc((static_cast(argc) + 1) * sizeof(char*))); + memcpy(exec_args, argv, static_cast(argc) * sizeof(char*)); + exec_args[argc] = nullptr; + execv(exec_args[0], exec_args); + // if we reach here, an error has occurred + gpr_log(GPR_ERROR, "execv '%s' failed: %s", exec_args[0], + grpc_core::StrError(errno).c_str()); + _exit(1); + } else { + r = grpc_core::Zalloc(); + r->pid = pid; + r->child_stdin_ = -1; + r->child_stdout_ = -1; + return r; + } +} + +gpr_subprocess* gpr_subprocess_create_with_envp(int argc, const char** argv, + int envc, const char** envp) { + gpr_subprocess* r; + int pid; + char **exec_args, **envp_args; + int stdin_pipe[2]; + int stdout_pipe[2]; + int p0 = pipe(stdin_pipe); + int p1 = pipe(stdout_pipe); + GPR_ASSERT(p0 != -1); + GPR_ASSERT(p1 != -1); + pid = fork(); + if (pid == -1) { + return nullptr; + } else if (pid == 0) { + dup2(stdin_pipe[0], STDIN_FILENO); + dup2(stdout_pipe[1], STDOUT_FILENO); + close(stdin_pipe[0]); + close(stdin_pipe[1]); + close(stdout_pipe[0]); + close(stdout_pipe[1]); + exec_args = static_cast( + gpr_malloc((static_cast(argc) + 1) * sizeof(char*))); + memcpy(exec_args, argv, static_cast(argc) * sizeof(char*)); + exec_args[argc] = nullptr; + envp_args = static_cast( + gpr_malloc((static_cast(envc) + 1) * sizeof(char*))); + memcpy(envp_args, envp, static_cast(envc) * sizeof(char*)); + envp_args[envc] = nullptr; + execve(exec_args[0], exec_args, envp_args); + // if we reach here, an error has occurred + gpr_log(GPR_ERROR, "execvpe '%s' failed: %s", exec_args[0], + grpc_core::StrError(errno).c_str()); + _exit(1); + } else { + r = grpc_core::Zalloc(); + r->pid = pid; + close(stdin_pipe[0]); + close(stdout_pipe[1]); + r->child_stdin_ = stdin_pipe[1]; + r->child_stdout_ = stdout_pipe[0]; + return r; + } +} + +bool gpr_subprocess_communicate(gpr_subprocess* p, std::string& input_data, + std::string* output_data, std::string* error) { + typedef void SignalHandler(int); + + // Make sure SIGPIPE is disabled so that if the child dies it doesn't kill us. + SignalHandler* old_pipe_handler = signal(SIGPIPE, SIG_IGN); + + int input_pos = 0; + int max_fd = std::max(p->child_stdin_, p->child_stdout_); + + while (p->child_stdout_ != -1) { + fd_set read_fds; + fd_set write_fds; + FD_ZERO(&read_fds); + FD_ZERO(&write_fds); + if (p->child_stdout_ != -1) { + FD_SET(p->child_stdout_, &read_fds); + } + if (p->child_stdin_ != -1) { + FD_SET(p->child_stdin_, &write_fds); + } + + if (select(max_fd + 1, &read_fds, &write_fds, nullptr, nullptr) < 0) { + if (errno == EINTR) { + // Interrupted by signal. Try again. + continue; + } else { + std::cerr << "select: " << strerror(errno) << std::endl; + GPR_ASSERT(0); + } + } + + if (p->child_stdin_ != -1 && FD_ISSET(p->child_stdin_, &write_fds)) { + int n = write(p->child_stdin_, input_data.data() + input_pos, + input_data.size() - input_pos); + if (n < 0) { + // Child closed pipe. Presumably it will report an error later. + // Pretend we're done for now. + input_pos = input_data.size(); + } else { + input_pos += n; + } + + if (input_pos == static_cast(input_data.size())) { + // We're done writing. Close. + close(p->child_stdin_); + p->child_stdin_ = -1; + } + } + + if (p->child_stdout_ != -1 && FD_ISSET(p->child_stdout_, &read_fds)) { + char buffer[4096]; + int n = read(p->child_stdout_, buffer, sizeof(buffer)); + + if (n > 0) { + output_data->append(buffer, static_cast(n)); + } else { + // We're done reading. Close. + close(p->child_stdout_); + p->child_stdout_ = -1; + } + } + } + + if (p->child_stdin_ != -1) { + // Child did not finish reading input before it closed the output. + // Presumably it exited with an error. + close(p->child_stdin_); + p->child_stdin_ = -1; + } + + int status; + while (waitpid(p->pid, &status, 0) == -1) { + if (errno != EINTR) { + std::cerr << "waitpid: " << strerror(errno) << std::endl; + GPR_ASSERT(0); + } + } + + // Restore SIGPIPE handling. + signal(SIGPIPE, old_pipe_handler); + + if (WIFEXITED(status)) { + if (WEXITSTATUS(status) != 0) { + int error_code = WEXITSTATUS(status); + *error = + absl::Substitute("Plugin failed with status code $0.", error_code); + return false; + } + } else if (WIFSIGNALED(status)) { + int signal = WTERMSIG(status); + *error = absl::Substitute("Plugin killed by signal $0.", signal); + return false; + } else { + *error = "Neither WEXITSTATUS nor WTERMSIG is true?"; + return false; + } + + return true; +} + +void gpr_subprocess_destroy(gpr_subprocess* p) { + if (!p->joined) { + kill(p->pid, SIGKILL); + gpr_subprocess_join(p); + } + gpr_free(p); +} + +int gpr_subprocess_join(gpr_subprocess* p) { + int status; +retry: + if (waitpid(p->pid, &status, 0) == -1) { + if (errno == EINTR) { + goto retry; + } + gpr_log(GPR_ERROR, "waitpid failed for pid %d: %s", p->pid, + grpc_core::StrError(errno).c_str()); + return -1; + } + p->joined = true; + return status; +} + +void gpr_subprocess_interrupt(gpr_subprocess* p) { + if (!p->joined) { + kill(p->pid, SIGINT); + } +} + +int gpr_subprocess_get_process_id(gpr_subprocess* p) { return p->pid; } + +#endif // GPR_POSIX_SUBPROCESS diff --git a/test/core/util/subprocess_windows.cc b/src/core/lib/gpr/subprocess_windows.cc similarity index 98% rename from test/core/util/subprocess_windows.cc rename to src/core/lib/gpr/subprocess_windows.cc index b639b3ef737c7..3efadd2a9b082 100644 --- a/test/core/util/subprocess_windows.cc +++ b/src/core/lib/gpr/subprocess_windows.cc @@ -31,9 +31,9 @@ #include #include "src/core/lib/gpr/string.h" +#include "src/core/lib/gpr/subprocess.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/tchar.h" -#include "test/core/util/subprocess.h" struct gpr_subprocess { PROCESS_INFORMATION pi; diff --git a/test/core/bad_ssl/bad_ssl_test.cc b/test/core/bad_ssl/bad_ssl_test.cc index 51d5a95b63f9d..5faa7b7bc5a00 100644 --- a/test/core/bad_ssl/bad_ssl_test.cc +++ b/test/core/bad_ssl/bad_ssl_test.cc @@ -32,11 +32,11 @@ #include #include +#include "src/core/lib/gpr/subprocess.h" #include "src/core/lib/gprpp/env.h" #include "src/core/lib/gprpp/host_port.h" #include "test/core/end2end/cq_verifier.h" #include "test/core/util/port.h" -#include "test/core/util/subprocess.h" #include "test/core/util/test_config.h" static void run_test(const char* target, size_t nops) { diff --git a/test/core/bad_ssl/generate_tests.bzl b/test/core/bad_ssl/generate_tests.bzl index f2f3fcab93e4d..ecce282765afc 100755 --- a/test/core/bad_ssl/generate_tests.bzl +++ b/test/core/bad_ssl/generate_tests.bzl @@ -61,6 +61,7 @@ def grpc_bad_ssl_tests(): "//test/core/util:grpc_test_util_base", "//:gpr", "//:grpc", + "//:subprocess", "//test/core/end2end:cq_verifier", ], tags = ["no_windows"], diff --git a/test/core/event_engine/test_suite/tests/BUILD b/test/core/event_engine/test_suite/tests/BUILD index ef297860a97d9..4c187e2c5d4f4 100644 --- a/test/core/event_engine/test_suite/tests/BUILD +++ b/test/core/event_engine/test_suite/tests/BUILD @@ -68,6 +68,7 @@ grpc_cc_library( "address_sorting", ], deps = [ + "//:subprocess", "//src/core:env", "//test/core/event_engine:event_engine_test_utils", "//test/core/event_engine/test_suite:event_engine_test_framework", diff --git a/test/core/http/BUILD b/test/core/http/BUILD index 965a7a84ca99d..2495cfb1cbd3d 100644 --- a/test/core/http/BUILD +++ b/test/core/http/BUILD @@ -68,6 +68,7 @@ grpc_cc_library( hdrs = ["httpcli_test_util.h"], deps = [ "//:gpr", + "//:subprocess", "//test/core/end2end:ssl_test_data", "//test/core/util:grpc_test_util", "//test/core/util:grpc_test_util_base", @@ -90,6 +91,7 @@ grpc_cc_test( ":httpcli_test_util", "//:gpr", "//:grpc", + "//:subprocess", "//test/core/end2end:ssl_test_data", "//test/core/util:fake_udp_and_tcp_server", "//test/core/util:grpc_test_util", @@ -103,6 +105,7 @@ grpc_cc_test( data = [ "python_wrapper.sh", "test_server.py", + "//:subprocess", "//src/core/tsi/test_creds:ca.pem", "//src/core/tsi/test_creds:server1.key", "//src/core/tsi/test_creds:server1.pem", diff --git a/test/core/http/httpcli_test.cc b/test/core/http/httpcli_test.cc index 519e7fd3aaf49..98fc2c934fddf 100644 --- a/test/core/http/httpcli_test.cc +++ b/test/core/http/httpcli_test.cc @@ -44,6 +44,7 @@ #include #include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h" +#include "src/core/lib/gpr/subprocess.h" #include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/gprpp/time.h" #include "src/core/lib/gprpp/time_util.h" @@ -53,7 +54,6 @@ #include "test/core/http/httpcli_test_util.h" #include "test/core/util/fake_udp_and_tcp_server.h" #include "test/core/util/port.h" -#include "test/core/util/subprocess.h" #include "test/core/util/test_config.h" namespace { diff --git a/test/core/http/httpcli_test_util.cc b/test/core/http/httpcli_test_util.cc index 763413cc3733f..5381fb03dd380 100644 --- a/test/core/http/httpcli_test_util.cc +++ b/test/core/http/httpcli_test_util.cc @@ -32,8 +32,8 @@ #include #include "src/core/lib/config/config_vars.h" +#include "src/core/lib/gpr/subprocess.h" #include "test/core/util/port.h" -#include "test/core/util/subprocess.h" namespace grpc_core { namespace testing { diff --git a/test/core/http/httpcli_test_util.h b/test/core/http/httpcli_test_util.h index e1ecebe792620..6007a4be203b7 100644 --- a/test/core/http/httpcli_test_util.h +++ b/test/core/http/httpcli_test_util.h @@ -19,7 +19,7 @@ #include -#include "test/core/util/subprocess.h" +#include "src/core/lib/gpr/subprocess.h" namespace grpc_core { namespace testing { diff --git a/test/core/http/httpscli_test.cc b/test/core/http/httpscli_test.cc index 281ccda42698a..35da8634f7efb 100644 --- a/test/core/http/httpscli_test.cc +++ b/test/core/http/httpscli_test.cc @@ -42,6 +42,7 @@ #include #include "src/core/lib/channel/channel_args.h" +#include "src/core/lib/gpr/subprocess.h" #include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/gprpp/sync.h" @@ -60,7 +61,6 @@ #include "src/core/lib/uri/uri_parser.h" #include "test/core/http/httpcli_test_util.h" #include "test/core/util/fake_udp_and_tcp_server.h" -#include "test/core/util/subprocess.h" #include "test/core/util/test_config.h" namespace { diff --git a/test/core/memory_usage/BUILD b/test/core/memory_usage/BUILD index 41aab426c182a..cfc2880b688db 100644 --- a/test/core/memory_usage/BUILD +++ b/test/core/memory_usage/BUILD @@ -159,6 +159,7 @@ grpc_cc_test( deps = [ "//:gpr", "//:grpc", + "//:subprocess", "//test/core/util:grpc_test_util", "//test/core/util:grpc_test_util_base", ], @@ -178,6 +179,7 @@ grpc_cc_binary( deps = [ "//:gpr", "//:grpc", + "//:subprocess", "//test/core/util:grpc_test_util", "//test/core/util:grpc_test_util_base", ], diff --git a/test/core/memory_usage/memory_usage_test.cc b/test/core/memory_usage/memory_usage_test.cc index 671539654bee8..0c2c9ee2b7306 100644 --- a/test/core/memory_usage/memory_usage_test.cc +++ b/test/core/memory_usage/memory_usage_test.cc @@ -37,9 +37,9 @@ #include #include "src/core/lib/config/config_vars.h" +#include "src/core/lib/gpr/subprocess.h" #include "src/core/lib/gprpp/host_port.h" #include "test/core/util/port.h" -#include "test/core/util/subprocess.h" #include "test/core/util/test_config.h" ABSL_FLAG(std::string, benchmark_names, "call,channel", diff --git a/test/core/util/BUILD b/test/core/util/BUILD index 2b88fd11f5884..e520da58a06a1 100644 --- a/test/core/util/BUILD +++ b/test/core/util/BUILD @@ -59,8 +59,6 @@ grpc_cc_library( "passthru_endpoint.cc", "resolve_localhost_ip46.cc", "slice_splitter.cc", - "subprocess_posix.cc", - "subprocess_windows.cc", "tracer_util.cc", ], hdrs = [ @@ -75,7 +73,6 @@ grpc_cc_library( "passthru_endpoint.h", "resolve_localhost_ip46.h", "slice_splitter.h", - "subprocess.h", "tracer_util.h", ], external_deps = [ diff --git a/test/core/util/subprocess_posix.cc b/test/core/util/subprocess_posix.cc deleted file mode 100644 index 1b97df0d26d66..0000000000000 --- a/test/core/util/subprocess_posix.cc +++ /dev/null @@ -1,101 +0,0 @@ -// -// -// Copyright 2015 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// - -#include - -#include - -#ifdef GPR_POSIX_SUBPROCESS - -#include -#include -#include -#include -#include - -#include -#include - -#include "src/core/lib/gprpp/memory.h" -#include "src/core/lib/gprpp/strerror.h" -#include "test/core/util/subprocess.h" - -struct gpr_subprocess { - int pid; - bool joined; -}; - -const char* gpr_subprocess_binary_extension() { return ""; } - -gpr_subprocess* gpr_subprocess_create(int argc, const char** argv) { - gpr_subprocess* r; - int pid; - char** exec_args; - - pid = fork(); - if (pid == -1) { - return nullptr; - } else if (pid == 0) { - exec_args = static_cast( - gpr_malloc((static_cast(argc) + 1) * sizeof(char*))); - memcpy(exec_args, argv, static_cast(argc) * sizeof(char*)); - exec_args[argc] = nullptr; - execv(exec_args[0], exec_args); - // if we reach here, an error has occurred - gpr_log(GPR_ERROR, "execv '%s' failed: %s", exec_args[0], - grpc_core::StrError(errno).c_str()); - _exit(1); - } else { - r = grpc_core::Zalloc(); - r->pid = pid; - return r; - } -} - -void gpr_subprocess_destroy(gpr_subprocess* p) { - if (!p->joined) { - kill(p->pid, SIGKILL); - gpr_subprocess_join(p); - } - gpr_free(p); -} - -int gpr_subprocess_join(gpr_subprocess* p) { - int status; -retry: - if (waitpid(p->pid, &status, 0) == -1) { - if (errno == EINTR) { - goto retry; - } - gpr_log(GPR_ERROR, "waitpid failed for pid %d: %s", p->pid, - grpc_core::StrError(errno).c_str()); - return -1; - } - p->joined = true; - return status; -} - -void gpr_subprocess_interrupt(gpr_subprocess* p) { - if (!p->joined) { - kill(p->pid, SIGINT); - } -} - -int gpr_subprocess_get_process_id(gpr_subprocess* p) { return p->pid; } - -#endif // GPR_POSIX_SUBPROCESS diff --git a/test/cpp/util/BUILD b/test/cpp/util/BUILD index d8aed93aa50fe..e4b98dc1ec28a 100644 --- a/test/cpp/util/BUILD +++ b/test/cpp/util/BUILD @@ -80,6 +80,7 @@ grpc_cc_library( ], deps = [ "//:grpc++", + "//:subprocess", "//test/core/end2end:ssl_test_data", "//test/core/util:grpc_test_util", "//test/core/util:grpc_test_util_base", @@ -114,6 +115,7 @@ grpc_cc_library( ], deps = [ "//:grpc++_unsecure", + "//:subprocess", "//test/core/util:grpc_test_util_base", "//test/core/util:grpc_test_util_unsecure", ], diff --git a/test/cpp/util/subprocess.cc b/test/cpp/util/subprocess.cc index 1cd7fbd44a40e..2f0c9cd03b209 100644 --- a/test/cpp/util/subprocess.cc +++ b/test/cpp/util/subprocess.cc @@ -20,7 +20,7 @@ #include -#include "test/core/util/subprocess.h" +#include "src/core/lib/gpr/subprocess.h" namespace grpc { From bc41f18beb45999849bdf90818d3b544fcb2b064 Mon Sep 17 00:00:00 2001 From: Sergii Tkachenko Date: Mon, 7 Aug 2023 19:42:12 -0400 Subject: [PATCH 135/205] [PSM Interop] Print the hint for the triager on blanket errors (#33898) This clearly indicates which errors are "blanket" errors and are not a root cause on their own. This also moves the debug info with the last known status of an object the framework was waiting for, but bailed out due to a timeout. Previously it was printed as the last error message in the test, and this PR prints it after the stack trace that caused the test failure. In addition, I added a similar debug information to the "wait for NEGs to become healthy". Now it prints the statuses of unhealthy backends To achieve that, I mimicked upcoming [PEP 678](https://peps.python.org/pep-0678/) Exception notes feature. When we're upgrade to py11, we'll be able to remove `add_note()` methods, and get the same functionality for free. --- .../xds_k8s_test_driver/framework/errors.py | 58 +++++++++++++++ .../framework/helpers/retryers.py | 33 +++++++-- .../framework/infrastructure/gcp/compute.py | 63 +++++++++++++++-- .../framework/infrastructure/k8s.py | 70 +++++++++---------- .../infrastructure/traffic_director.py | 15 ++-- .../xds_k8s_test_driver/framework/rpc/grpc.py | 8 +-- .../framework/test_app/client_app.py | 65 +++++++++++++---- 7 files changed, 242 insertions(+), 70 deletions(-) create mode 100644 tools/run_tests/xds_k8s_test_driver/framework/errors.py diff --git a/tools/run_tests/xds_k8s_test_driver/framework/errors.py b/tools/run_tests/xds_k8s_test_driver/framework/errors.py new file mode 100644 index 0000000000000..6b067384c9c1e --- /dev/null +++ b/tools/run_tests/xds_k8s_test_driver/framework/errors.py @@ -0,0 +1,58 @@ +# Copyright 2023 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +from typing import Any + + +# TODO(sergiitk): All custom error classes should extend this. +class FrameworkError(Exception): + """Base error class for framework errors.""" + + message: str + kwargs: dict[str, Any] + note: str = "" + + def __init__(self, message: str, *args, **kwargs): + self.message = message + # Exception only stores args. + self.kwargs = kwargs + # Pass to the Exception as if message is in **args. + super().__init__(*[message, *args]) + + # TODO(sergiitk): Remove in py3.11, this will be built-in. See PEP 678. + def add_note(self, note: str): + self.note = note + + def __str__(self): + return self.message if not self.note else f"{self.message}\n{self.note}" + + @classmethod + def note_blanket_error(cls, reason: str) -> str: + return f""" +Reason: {reason} +{'#' * 80} +# IMPORTANT: This is not a root cause. This is an indication that +# _something_ -- literally _anything_ -- has gone wrong in the xDS flow. +# It is _your_ responsibility to look through the interop client and/or +# server logs to determine what exactly went wrong. +{'#' * 80} +""" + + @classmethod + def note_blanket_error_info_below( + cls, reason: str, *, info_below: str + ) -> str: + return ( + f"{cls.note_blanket_error(reason)}" + f"# Please inspect the information below:\n{info_below}" + ) diff --git a/tools/run_tests/xds_k8s_test_driver/framework/helpers/retryers.py b/tools/run_tests/xds_k8s_test_driver/framework/helpers/retryers.py index 15990b79e1e09..9f16733c3f121 100644 --- a/tools/run_tests/xds_k8s_test_driver/framework/helpers/retryers.py +++ b/tools/run_tests/xds_k8s_test_driver/framework/helpers/retryers.py @@ -217,6 +217,12 @@ def log_it(retry_state): class RetryError(tenacity.RetryError): + # Note: framework.errors.FrameworkError could be used as a mixin, + # but this would rely too much on tenacity.RetryError to not change. + + last_attempt: tenacity.Future + note: str = "" + def __init__( self, retry_state, @@ -225,7 +231,9 @@ def __init__( attempts: int = 0, check_result: Optional[CheckResultFn] = None, ): - super().__init__(retry_state.outcome) + last_attempt: tenacity.Future = retry_state.outcome + super().__init__(last_attempt) + callback_name = tenacity_utils.get_callback_name(retry_state.fn) self.message = f"Retry error calling {callback_name}:" if timeout: @@ -237,16 +245,29 @@ def __init__( self.message += "." - if retry_state.outcome.failed: - ex = retry_state.outcome.exception() - self.message += f" Last exception: {type(ex).__name__}: {ex}" + if last_attempt.failed: + err = last_attempt.exception() + self.message += f" Last exception: {type(err).__name__}: {err}" elif check_result: self.message += " Check result callback returned False." def result(self, *, default=None): return ( - default if self.last_attempt.failed else self.last_attempt.result() + self.last_attempt.result() + if not self.last_attempt.failed + else default ) + def exception(self, *, default=None): + return ( + self.last_attempt.exception() + if self.last_attempt.failed + else default + ) + + # TODO(sergiitk): Remove in py3.11, this will be built-in. See PEP 678. + def add_note(self, note: str): + self.note = note + def __str__(self): - return self.message + return self.message if not self.note else f"{self.message}\n{self.note}" diff --git a/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/compute.py b/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/compute.py index 5492cb5198605..11df42ef9ce30 100644 --- a/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/compute.py +++ b/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/compute.py @@ -20,6 +20,7 @@ from googleapiclient import discovery import googleapiclient.errors +import framework.errors from framework.helpers import retryers from framework.infrastructure import gcp @@ -347,7 +348,7 @@ def wait_for_network_endpoint_group( check_result=lambda neg: neg and neg.get("size", 0) > 0, ) network_endpoint_group = retryer( - self._retry_network_endpoint_group_ready, name, zone + self._retry_load_network_endpoint_group, name, zone ) # TODO(sergiitk): dataclass return self.ZonalGcpResource( @@ -356,7 +357,7 @@ def wait_for_network_endpoint_group( zone, ) - def _retry_network_endpoint_group_ready(self, name: str, zone: str): + def _retry_load_network_endpoint_group(self, name: str, zone: str): try: neg = self.get_network_endpoint_group(name, zone) logger.debug( @@ -392,14 +393,66 @@ def wait_for_backends_healthy_status( *, timeout_sec: int = _WAIT_FOR_BACKEND_SEC, wait_sec: int = _WAIT_FOR_BACKEND_SLEEP_SEC, - ): + ) -> None: + if not backends: + raise ValueError("The list of backends to wait on is empty") + + timeout = datetime.timedelta(seconds=timeout_sec) retryer = retryers.constant_retryer( wait_fixed=datetime.timedelta(seconds=wait_sec), - timeout=datetime.timedelta(seconds=timeout_sec), + timeout=timeout, check_result=lambda result: result, ) pending = set(backends) - retryer(self._retry_backends_health, backend_service, pending) + try: + retryer(self._retry_backends_health, backend_service, pending) + except retryers.RetryError as retry_err: + unhealthy_backends: str = ",".join( + [backend.name for backend in pending] + ) + + # Attempt to load backend health info for better debug info. + try: + unhealthy = [] + # Everything left in pending was unhealthy on the last retry. + for backend in pending: + # It's possible the health status has changed since we + # gave up retrying, but this should be very rare. + health_status = self.get_backend_service_backend_health( + backend_service, + backend, + ) + unhealthy.append(health_status) + + # Override the plain list of unhealthy backend name with + # the one showing the latest backend statuses. + unhealthy_backends = "\n".join( + [ + self.resource_pretty_format(unhealthy_backend) + for unhealthy_backend in unhealthy + ] + ) + except Exception as error: # noqa pylint: disable=broad-except + logger.debug( + "Couldn't load backend health info, plain list name" + "will be printed instead. Error: %r", + error, + ) + + retry_err.add_note( + framework.errors.FrameworkError.note_blanket_error_info_below( + "One or several NEGs (Network Endpoint Groups) didn't" + " report HEALTHY status within expected timeout.", + info_below=( + f"Timeout {timeout} (h:mm:ss) waiting for backend" + f" service '{backend_service.name}' to report all NEGs" + " in the HEALTHY status:" + f" {[backend.name for backend in backends]}." + f"\nUnhealthy backends:\n{unhealthy_backends}" + ), + ) + ) + raise def _retry_backends_health( self, backend_service: GcpResource, pending: Set[ZonalGcpResource] diff --git a/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/k8s.py b/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/k8s.py index 2b39c3e98c9ea..1f06d9d83f75e 100644 --- a/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/k8s.py +++ b/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/k8s.py @@ -27,6 +27,7 @@ import urllib3.exceptions import yaml +import framework.errors from framework.helpers import retryers import framework.helpers.highlighter from framework.infrastructure.k8s_internal import k8s_log_collector @@ -414,15 +415,14 @@ def wait_for_service_neg( ) try: retryer(self.get_service, name) - except retryers.RetryError as e: - logger.error( - ( - "Timeout %s (h:mm:ss) waiting for service %s to report NEG " - "status. Last service status:\n%s" + except retryers.RetryError as retry_err: + framework.errors.FrameworkError.note_blanket_error_info_below( + "A k8s service wasn't assigned a NEG (Network Endpoint Group).", + info_below=( + f"Timeout {timeout} (h:mm:ss) waiting for service {name}" + f" to report NEG status. Last service status:\n" + f"{self._pretty_format_status(retry_err.result())}" ), - timeout, - name, - self._pretty_format_status(e.result()), ) raise @@ -474,16 +474,15 @@ def wait_for_deployment_available_replicas( ) try: retryer(self.get_deployment, name) - except retryers.RetryError as e: - logger.error( - ( - "Timeout %s (h:mm:ss) waiting for deployment %s to report" - " %i replicas available. Last status:\n%s" + except retryers.RetryError as retry_err: + framework.errors.FrameworkError.note_blanket_error_info_below( + "The deployment didn't report one or several pods available" + " (ready for at least minReadySeconds).", + info_below=( + f"Timeout {timeout} (h:mm:ss) waiting for deployment {name}" + f" to report {count} replicas available. Last status:\n" + f"{self._pretty_format_status(retry_err.result())}" ), - timeout, - name, - count, - self._pretty_format_status(e.result()), ) raise @@ -503,17 +502,15 @@ def wait_for_deployment_replica_count( ) try: retryer(self.list_deployment_pods, deployment) - except retryers.RetryError as e: - result = e.result(default=[]) - logger.error( - ( - "Timeout %s (h:mm:ss) waiting for pod count %i, got: %i. " - "Pod statuses:\n%s" + except retryers.RetryError as retry_err: + result = retry_err.result(default=[]) + framework.errors.FrameworkError.note_blanket_error_info_below( + "The deployment was unable to initialize one or several pods.", + info_below=( + f"Timeout {timeout} (h:mm:ss) waiting for pod count" + f" {count}, got: {len(result)}. Pod statuses:\n" + f"{self._pretty_format_statuses(result)}" ), - timeout, - count, - len(result), - self._pretty_format_statuses(result), ) raise @@ -557,15 +554,16 @@ def wait_for_pod_started( ) try: retryer(self.get_pod, pod_name) - except retryers.RetryError as e: - logger.error( - ( - "Timeout %s (h:mm:ss) waiting for pod %s to start. " - "Pod status:\n%s" - ), - timeout, - pod_name, - self._pretty_format_status(e.result()), + except retryers.RetryError as retry_err: + retry_err.add_note( + framework.errors.FrameworkError.note_blanket_error_info_below( + "The pod didn't start within expected timeout.", + info_below=( + f"Timeout {timeout} (h:mm:ss) waiting for pod" + f" {pod_name} to start. Pod status:\n" + f"{self._pretty_format_status(retry_err.result())}" + ), + ) ) raise diff --git a/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/traffic_director.py b/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/traffic_director.py index 2bc9d11716b22..c3c5d6815c5c5 100644 --- a/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/traffic_director.py +++ b/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/traffic_director.py @@ -243,6 +243,12 @@ def delete_backend_service(self, force=False): def backend_service_add_neg_backends( self, name, zones, max_rate_per_endpoint: Optional[int] = None ): + self.backend_service_load_neg_backends(name, zones) + if not self.backends: + raise ValueError("Unexpected: no backends were loaded.") + self.backend_service_patch_backends(max_rate_per_endpoint) + + def backend_service_load_neg_backends(self, name, zones): logger.info("Waiting for Network Endpoint Groups to load endpoints.") for zone in zones: backend = self.compute.wait_for_network_endpoint_group(name, zone) @@ -250,7 +256,6 @@ def backend_service_add_neg_backends( 'Loaded NEG "%s" in zone %s', backend.name, backend.zone ) self.backends.add(backend) - self.backend_service_patch_backends(max_rate_per_endpoint) def backend_service_remove_neg_backends(self, name, zones): logger.info("Waiting for Network Endpoint Groups to load endpoints.") @@ -282,10 +287,10 @@ def backend_service_remove_all_backends(self): self.compute.backend_service_remove_all_backends(self.backend_service) def wait_for_backends_healthy_status(self): - logger.debug( - "Waiting for Backend Service %s to report all backends healthy %r", - self.backend_service, - self.backends, + logger.info( + "Waiting for Backend Service %s to report all backends healthy: %r", + self.backend_service.name, + [backend.name for backend in self.backends], ) self.compute.wait_for_backends_healthy_status( self.backend_service, self.backends diff --git a/tools/run_tests/xds_k8s_test_driver/framework/rpc/grpc.py b/tools/run_tests/xds_k8s_test_driver/framework/rpc/grpc.py index d58ab5b8cd1b8..1f6f7483ddd12 100644 --- a/tools/run_tests/xds_k8s_test_driver/framework/rpc/grpc.py +++ b/tools/run_tests/xds_k8s_test_driver/framework/rpc/grpc.py @@ -19,6 +19,8 @@ import google.protobuf.message import grpc +import framework.errors + logger = logging.getLogger(__name__) # Type aliases @@ -84,13 +86,9 @@ def _log_rpc_request(self, rpc, req, call_kwargs, log_level=logging.DEBUG): class GrpcApp: channels: Dict[int, grpc.Channel] - class NotFound(Exception): + class NotFound(framework.errors.FrameworkError): """Requested resource not found""" - def __init__(self, message): - self.message = message - super().__init__(message) - def __init__(self, rpc_host): self.rpc_host = rpc_host # Cache gRPC channels per port diff --git a/tools/run_tests/xds_k8s_test_driver/framework/test_app/client_app.py b/tools/run_tests/xds_k8s_test_driver/framework/test_app/client_app.py index 073f9de61be7d..a232e41cd749c 100644 --- a/tools/run_tests/xds_k8s_test_driver/framework/test_app/client_app.py +++ b/tools/run_tests/xds_k8s_test_driver/framework/test_app/client_app.py @@ -19,6 +19,7 @@ import logging from typing import Iterable, List, Optional +import framework.errors from framework.helpers import retryers import framework.rpc from framework.rpc import grpc_channelz @@ -128,7 +129,18 @@ def wait_for_active_server_channel(self) -> _ChannelzChannel: Raises: GrpcApp.NotFound: If the channel never transitioned to READY. """ - return self.wait_for_server_channel_state(_ChannelzChannelState.READY) + try: + return self.wait_for_server_channel_state( + _ChannelzChannelState.READY + ) + except retryers.RetryError as retry_err: + if isinstance(retry_err.exception(), self.ChannelNotFound): + retry_err.add_note( + framework.errors.FrameworkError.note_blanket_error( + "The client couldn't connect to the server." + ) + ) + raise def get_active_server_channel_socket(self) -> _ChannelzSocket: channel = self.find_server_channel_with_state( @@ -207,7 +219,7 @@ def wait_for_server_channel_state( def find_server_channel_with_state( self, - state: _ChannelzChannelState, + expected_state: _ChannelzChannelState, *, rpc_deadline: Optional[_timedelta] = None, check_subchannel=True, @@ -216,25 +228,28 @@ def find_server_channel_with_state( if rpc_deadline is not None: rpc_params["deadline_sec"] = rpc_deadline.total_seconds() - for channel in self.get_server_channels(**rpc_params): + expected_state_name: str = _ChannelzChannelState.Name(expected_state) + target: str = self.server_target + + for channel in self.get_server_channels(target, **rpc_params): channel_state: _ChannelzChannelState = channel.data.state.state logger.info( "[%s] Server channel: %s", self.hostname, _ChannelzServiceClient.channel_repr(channel), ) - if channel_state is state: + if channel_state is expected_state: if check_subchannel: # When requested, check if the channel has at least # one subchannel in the requested state. try: subchannel = self.find_subchannel_with_state( - channel, state, **rpc_params + channel, expected_state, **rpc_params ) logger.info( "[%s] Found subchannel in state %s: %s", self.hostname, - _ChannelzChannelState.Name(state), + expected_state_name, _ChannelzServiceClient.subchannel_repr(subchannel), ) except self.NotFound as e: @@ -243,15 +258,18 @@ def find_server_channel_with_state( continue return channel - raise self.NotFound( - f"[{self.hostname}] Client has no " - f"{_ChannelzChannelState.Name(state)} channel with the server" + raise self.ChannelNotFound( + f"[{self.hostname}] Client has no" + f" {expected_state_name} channel with server {target}", + src=self.hostname, + dst=target, + expected_state=expected_state, ) - def get_server_channels(self, **kwargs) -> Iterable[_ChannelzChannel]: - return self.channelz.find_channels_for_target( - self.server_target, **kwargs - ) + def get_server_channels( + self, server_target: str, **kwargs + ) -> Iterable[_ChannelzChannel]: + return self.channelz.find_channels_for_target(server_target, **kwargs) def find_subchannel_with_state( self, channel: _ChannelzChannel, state: _ChannelzChannelState, **kwargs @@ -280,3 +298,24 @@ def find_subchannels_with_state( if subchannel.data.state.state is state: subchannels.append(subchannel) return subchannels + + class ChannelNotFound(framework.rpc.grpc.GrpcApp.NotFound): + """Channel with expected status not found""" + + src: str + dst: str + expected_state: object + + def __init__( + self, + message: str, + *, + src: str, + dst: str, + expected_state: _ChannelzChannelState, + **kwargs, + ): + self.src = src + self.dst = dst + self.expected_state = expected_state + super().__init__(message, src, dst, expected_state, **kwargs) From 18be986e3b80061fae5576d228011f85d0d296a0 Mon Sep 17 00:00:00 2001 From: Eugene Ostroukhov Date: Mon, 7 Aug 2023 19:26:30 -0700 Subject: [PATCH 136/205] [XDS Interop] Move XdsStatsWatcher to a separate file. (#34000) This will help with introducing test coverage as the logic becomes more complex. --- CMakeLists.txt | 74 ++++++++ build_autogenerated.yaml | 28 +++ test/cpp/interop/BUILD | 27 +++ test/cpp/interop/xds_interop_client.cc | 188 ++++----------------- test/cpp/interop/xds_stats_watcher.cc | 118 +++++++++++++ test/cpp/interop/xds_stats_watcher.h | 104 ++++++++++++ test/cpp/interop/xds_stats_watcher_test.cc | 71 ++++++++ tools/run_tests/generated/tests.json | 24 +++ 8 files changed, 475 insertions(+), 159 deletions(-) create mode 100644 test/cpp/interop/xds_stats_watcher.cc create mode 100644 test/cpp/interop/xds_stats_watcher.h create mode 100644 test/cpp/interop/xds_stats_watcher_test.cc diff --git a/CMakeLists.txt b/CMakeLists.txt index ba2dbfd31860c..5b5e57d76ab55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1456,6 +1456,7 @@ if(gRPC_BUILD_TESTS) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_dependencies(buildtests_cxx xds_routing_end2end_test) endif() + add_dependencies(buildtests_cxx xds_stats_watcher_test) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_dependencies(buildtests_cxx xds_wrr_end2end_test) endif() @@ -29205,6 +29206,7 @@ add_executable(xds_interop_client src/cpp/server/csds/csds.cc test/cpp/interop/rpc_behavior_lb_policy.cc test/cpp/interop/xds_interop_client.cc + test/cpp/interop/xds_stats_watcher.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc ) @@ -30888,6 +30890,78 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) endif() +endif() +if(gRPC_BUILD_TESTS) + +add_executable(xds_stats_watcher_test + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/empty.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/empty.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/empty.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/empty.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/messages.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/messages.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/messages.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/messages.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/test.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/test.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/test.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/test.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/base.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/base.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/base.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/base.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/config_dump.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/config_dump.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/config_dump.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/config_dump.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/csds.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/csds.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/csds.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/csds.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/percent.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/percent.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/percent.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/percent.grpc.pb.h + src/cpp/server/admin/admin_services.cc + src/cpp/server/csds/csds.cc + test/cpp/interop/rpc_behavior_lb_policy.cc + test/cpp/interop/xds_stats_watcher.cc + test/cpp/interop/xds_stats_watcher_test.cc + third_party/googletest/googletest/src/gtest-all.cc + third_party/googletest/googlemock/src/gmock-all.cc +) +target_compile_features(xds_stats_watcher_test PUBLIC cxx_std_14) +target_include_directories(xds_stats_watcher_test + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + ${_gRPC_RE2_INCLUDE_DIR} + ${_gRPC_SSL_INCLUDE_DIR} + ${_gRPC_UPB_GENERATED_DIR} + ${_gRPC_UPB_GRPC_GENERATED_DIR} + ${_gRPC_UPB_INCLUDE_DIR} + ${_gRPC_XXHASH_INCLUDE_DIR} + ${_gRPC_ZLIB_INCLUDE_DIR} + third_party/googletest/googletest/include + third_party/googletest/googletest + third_party/googletest/googlemock/include + third_party/googletest/googlemock + ${_gRPC_PROTO_GENS_DIR} +) + +target_link_libraries(xds_stats_watcher_test + ${_gRPC_BASELIB_LIBRARIES} + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ZLIB_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + grpc++_reflection + grpcpp_channelz + grpc_test_util + grpc++_test_config +) + + endif() if(gRPC_BUILD_TESTS) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 9d86bc8ece325..a21e36895b197 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -16514,6 +16514,7 @@ targets: headers: - src/cpp/server/csds/csds.h - test/cpp/interop/rpc_behavior_lb_policy.h + - test/cpp/interop/xds_stats_watcher.h src: - src/proto/grpc/testing/empty.proto - src/proto/grpc/testing/messages.proto @@ -16526,6 +16527,7 @@ targets: - src/cpp/server/csds/csds.cc - test/cpp/interop/rpc_behavior_lb_policy.cc - test/cpp/interop/xds_interop_client.cc + - test/cpp/interop/xds_stats_watcher.cc deps: - grpc++_reflection - grpcpp_channelz @@ -17077,6 +17079,32 @@ targets: - linux - posix - mac +- name: xds_stats_watcher_test + gtest: true + build: test + language: c++ + headers: + - src/cpp/server/csds/csds.h + - test/cpp/interop/rpc_behavior_lb_policy.h + - test/cpp/interop/xds_stats_watcher.h + src: + - src/proto/grpc/testing/empty.proto + - src/proto/grpc/testing/messages.proto + - src/proto/grpc/testing/test.proto + - src/proto/grpc/testing/xds/v3/base.proto + - src/proto/grpc/testing/xds/v3/config_dump.proto + - src/proto/grpc/testing/xds/v3/csds.proto + - src/proto/grpc/testing/xds/v3/percent.proto + - src/cpp/server/admin/admin_services.cc + - src/cpp/server/csds/csds.cc + - test/cpp/interop/rpc_behavior_lb_policy.cc + - test/cpp/interop/xds_stats_watcher.cc + - test/cpp/interop/xds_stats_watcher_test.cc + deps: + - grpc++_reflection + - grpcpp_channelz + - grpc_test_util + - grpc++_test_config - name: xds_wrr_end2end_test gtest: true build: test diff --git a/test/cpp/interop/BUILD b/test/cpp/interop/BUILD index cbb716f183820..c1f31ad2a6b30 100644 --- a/test/cpp/interop/BUILD +++ b/test/cpp/interop/BUILD @@ -235,6 +235,32 @@ sh_test( tags = ["no_windows"], ) +grpc_cc_library( + name = "xds_stats_watcher", + srcs = ["xds_stats_watcher.cc"], + hdrs = ["xds_stats_watcher.h"], + deps = [ + ":rpc_behavior_lb_policy", + "//:grpc++", + "//:grpc++_reflection", + "//:grpcpp_admin", + "//src/proto/grpc/testing:empty_proto", + "//src/proto/grpc/testing:messages_proto", + "//src/proto/grpc/testing:test_proto", + "//test/core/util:grpc_test_util", + "//test/cpp/util:test_config", + ], +) + +grpc_cc_test( + name = "xds_stats_watcher_test", + srcs = [ + "xds_stats_watcher_test.cc", + ], + external_deps = ["gtest"], + deps = [":xds_stats_watcher"], +) + grpc_cc_binary( name = "xds_interop_client", srcs = [ @@ -245,6 +271,7 @@ grpc_cc_binary( ], deps = [ ":rpc_behavior_lb_policy", + ":xds_stats_watcher", "//:grpc++", "//:grpc++_reflection", "//:grpcpp_admin", diff --git a/test/cpp/interop/xds_interop_client.cc b/test/cpp/interop/xds_interop_client.cc index ecb3519860e05..e8df4a40b2185 100644 --- a/test/cpp/interop/xds_interop_client.cc +++ b/test/cpp/interop/xds_interop_client.cc @@ -46,6 +46,7 @@ #include "src/proto/grpc/testing/test.grpc.pb.h" #include "test/core/util/test_config.h" #include "test/cpp/interop/rpc_behavior_lb_policy.h" +#include "test/cpp/interop/xds_stats_watcher.h" #include "test/cpp/util/test_config.h" ABSL_FLAG(bool, fail_on_failed_rpc, false, @@ -75,8 +76,8 @@ using grpc::Server; using grpc::ServerBuilder; using grpc::ServerContext; using grpc::Status; +using grpc::testing::AsyncClientCallResult; using grpc::testing::ClientConfigureRequest; -using grpc::testing::ClientConfigureRequest_RpcType_Name; using grpc::testing::ClientConfigureResponse; using grpc::testing::Empty; using grpc::testing::LoadBalancerAccumulatedStatsRequest; @@ -86,25 +87,22 @@ using grpc::testing::LoadBalancerStatsResponse; using grpc::testing::LoadBalancerStatsService; using grpc::testing::SimpleRequest; using grpc::testing::SimpleResponse; +using grpc::testing::StatsWatchers; using grpc::testing::TestService; +using grpc::testing::XdsStatsWatcher; using grpc::testing::XdsUpdateClientConfigureService; -class XdsStatsWatcher; - -struct StatsWatchers { - // Unique ID for each outgoing RPC - int global_request_id = 0; - // Unique ID for each outgoing RPC by RPC method type - std::map global_request_id_by_type; - // Stores a set of watchers that should be notified upon outgoing RPC - // completion - std::set watchers; - // Global watcher for accumululated stats. - XdsStatsWatcher* global_watcher; - // Mutex for global_request_id and watchers - std::mutex mu; +struct AsyncClientCall { + ClientContext context; + std::unique_ptr> empty_response_reader; + std::unique_ptr> + simple_response_reader; + + AsyncClientCallResult result; }; -// Whether at least one RPC has succeeded, indicating xDS resolution completed. + +// Whether at least one RPC has succeeded, indicating xDS resolution +// completed. std::atomic one_rpc_succeeded(false); // RPC configuration detailing how RPC should be sent. struct RpcConfig { @@ -118,135 +116,6 @@ struct RpcConfigurationsQueue { // Mutex for rpc_configs_queue std::mutex mu_rpc_configs_queue; }; -struct AsyncClientCall { - Empty empty_response; - SimpleResponse simple_response; - ClientContext context; - Status status; - int saved_request_id; - ClientConfigureRequest::RpcType rpc_type; - std::unique_ptr> empty_response_reader; - std::unique_ptr> - simple_response_reader; -}; - -/// Records the remote peer distribution for a given range of RPCs. -class XdsStatsWatcher { - public: - XdsStatsWatcher(int start_id, int end_id) - : start_id_(start_id), end_id_(end_id), rpcs_needed_(end_id - start_id) {} - - // Upon the completion of an RPC, we will look at the request_id, the - // rpc_type, and the peer the RPC was sent to in order to count - // this RPC into the right stats bin. - void RpcCompleted(AsyncClientCall* call, const std::string& peer) { - // We count RPCs for global watcher or if the request_id falls into the - // watcher's interested range of request ids. - if ((start_id_ == 0 && end_id_ == 0) || - (start_id_ <= call->saved_request_id && - call->saved_request_id < end_id_)) { - { - std::lock_guard lock(m_); - if (peer.empty()) { - no_remote_peer_++; - ++no_remote_peer_by_type_[call->rpc_type]; - } else { - // RPC is counted into both per-peer bin and per-method-per-peer bin. - rpcs_by_peer_[peer]++; - rpcs_by_type_[call->rpc_type][peer]++; - } - rpcs_needed_--; - // Report accumulated stats. - auto& stats_per_method = *accumulated_stats_.mutable_stats_per_method(); - auto& method_stat = - stats_per_method[ClientConfigureRequest_RpcType_Name( - call->rpc_type)]; - auto& result = *method_stat.mutable_result(); - grpc_status_code code = - static_cast(call->status.error_code()); - auto& num_rpcs = result[code]; - ++num_rpcs; - auto rpcs_started = method_stat.rpcs_started(); - method_stat.set_rpcs_started(++rpcs_started); - } - cv_.notify_one(); - } - } - - void WaitForRpcStatsResponse(LoadBalancerStatsResponse* response, - int timeout_sec) { - std::unique_lock lock(m_); - cv_.wait_for(lock, std::chrono::seconds(timeout_sec), - [this] { return rpcs_needed_ == 0; }); - response->mutable_rpcs_by_peer()->insert(rpcs_by_peer_.begin(), - rpcs_by_peer_.end()); - auto& response_rpcs_by_method = *response->mutable_rpcs_by_method(); - for (const auto& rpc_by_type : rpcs_by_type_) { - std::string method_name; - if (rpc_by_type.first == ClientConfigureRequest::EMPTY_CALL) { - method_name = "EmptyCall"; - } else if (rpc_by_type.first == ClientConfigureRequest::UNARY_CALL) { - method_name = "UnaryCall"; - } else { - GPR_ASSERT(0); - } - // TODO(@donnadionne): When the test runner changes to accept EMPTY_CALL - // and UNARY_CALL we will just use the name of the enum instead of the - // method_name variable. - auto& response_rpc_by_method = response_rpcs_by_method[method_name]; - auto& response_rpcs_by_peer = - *response_rpc_by_method.mutable_rpcs_by_peer(); - for (const auto& rpc_by_peer : rpc_by_type.second) { - auto& response_rpc_by_peer = response_rpcs_by_peer[rpc_by_peer.first]; - response_rpc_by_peer = rpc_by_peer.second; - } - } - response->set_num_failures(no_remote_peer_ + rpcs_needed_); - } - - void GetCurrentRpcStats(LoadBalancerAccumulatedStatsResponse* response, - StatsWatchers* stats_watchers) { - std::unique_lock lock(m_); - response->CopyFrom(accumulated_stats_); - // TODO(@donnadionne): delete deprecated stats below when the test is no - // longer using them. - auto& response_rpcs_started_by_method = - *response->mutable_num_rpcs_started_by_method(); - auto& response_rpcs_succeeded_by_method = - *response->mutable_num_rpcs_succeeded_by_method(); - auto& response_rpcs_failed_by_method = - *response->mutable_num_rpcs_failed_by_method(); - for (const auto& rpc_by_type : rpcs_by_type_) { - auto total_succeeded = 0; - for (const auto& rpc_by_peer : rpc_by_type.second) { - total_succeeded += rpc_by_peer.second; - } - response_rpcs_succeeded_by_method[ClientConfigureRequest_RpcType_Name( - rpc_by_type.first)] = total_succeeded; - response_rpcs_started_by_method[ClientConfigureRequest_RpcType_Name( - rpc_by_type.first)] = - stats_watchers->global_request_id_by_type[rpc_by_type.first]; - response_rpcs_failed_by_method[ClientConfigureRequest_RpcType_Name( - rpc_by_type.first)] = no_remote_peer_by_type_[rpc_by_type.first]; - } - } - - private: - int start_id_; - int end_id_; - int rpcs_needed_; - int no_remote_peer_ = 0; - std::map no_remote_peer_by_type_; - // A map of stats keyed by peer name. - std::map rpcs_by_peer_; - // A two-level map of stats keyed at top level by RPC method and second level - // by peer name. - std::map> rpcs_by_type_; - // Storing accumulated stats in the response proto format. - LoadBalancerAccumulatedStatsResponse accumulated_stats_; - std::mutex m_; - std::condition_variable cv_; -}; class TestClient { public: @@ -278,13 +147,13 @@ class TestClient { } } call->context.set_deadline(deadline); - call->saved_request_id = saved_request_id; - call->rpc_type = ClientConfigureRequest::UNARY_CALL; + call->result.saved_request_id = saved_request_id; + call->result.rpc_type = ClientConfigureRequest::UNARY_CALL; call->simple_response_reader = stub_->PrepareAsyncUnaryCall( &call->context, SimpleRequest::default_instance(), &cq_); call->simple_response_reader->StartCall(); - call->simple_response_reader->Finish(&call->simple_response, &call->status, - call); + call->simple_response_reader->Finish(&call->result.simple_response, + &call->result.status, call); } void AsyncEmptyCall(const RpcConfig& config) { @@ -311,13 +180,13 @@ class TestClient { } } call->context.set_deadline(deadline); - call->saved_request_id = saved_request_id; - call->rpc_type = ClientConfigureRequest::EMPTY_CALL; + call->result.saved_request_id = saved_request_id; + call->result.rpc_type = ClientConfigureRequest::EMPTY_CALL; call->empty_response_reader = stub_->PrepareAsyncEmptyCall( &call->context, Empty::default_instance(), &cq_); call->empty_response_reader->StartCall(); - call->empty_response_reader->Finish(&call->empty_response, &call->status, - call); + call->empty_response_reader->Finish(&call->result.empty_response, + &call->result.status, call); } void AsyncCompleteRpc() { @@ -335,17 +204,17 @@ class TestClient { metadata_hostname != call->context.GetServerInitialMetadata().end() ? std::string(metadata_hostname->second.data(), metadata_hostname->second.length()) - : call->simple_response.hostname(); + : call->result.simple_response.hostname(); for (auto watcher : stats_watchers_->watchers) { - watcher->RpcCompleted(call, hostname); + watcher->RpcCompleted(call->result, hostname); } } if (!RpcStatusCheckSuccess(call)) { if (absl::GetFlag(FLAGS_print_response) || absl::GetFlag(FLAGS_fail_on_failed_rpc)) { - std::cout << "RPC failed: " << call->status.error_code() << ": " - << call->status.error_message() << std::endl; + std::cout << "RPC failed: " << call->result.status.error_code() + << ": " << call->result.status.error_message() << std::endl; } if (absl::GetFlag(FLAGS_fail_on_failed_rpc) && one_rpc_succeeded.load()) { @@ -360,7 +229,7 @@ class TestClient { call->context.GetServerInitialMetadata().end() ? std::string(metadata_hostname->second.data(), metadata_hostname->second.length()) - : call->simple_response.hostname(); + : call->result.simple_response.hostname(); std::cout << "Greeting: Hello world, this is " << hostname << ", from " << call->context.peer() << std::endl; } @@ -377,7 +246,8 @@ class TestClient { grpc_status_code code; GPR_ASSERT(grpc_status_code_from_string( absl::GetFlag(FLAGS_expect_status).c_str(), &code)); - return code == static_cast(call->status.error_code()); + return code == + static_cast(call->result.status.error_code()); } std::unique_ptr stub_; diff --git a/test/cpp/interop/xds_stats_watcher.cc b/test/cpp/interop/xds_stats_watcher.cc new file mode 100644 index 0000000000000..e6b1f80908e32 --- /dev/null +++ b/test/cpp/interop/xds_stats_watcher.cc @@ -0,0 +1,118 @@ +// Copyright 2023 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "test/cpp/interop/xds_stats_watcher.h" + +#include + +namespace grpc { +namespace testing { + +XdsStatsWatcher::XdsStatsWatcher(int start_id, int end_id) + : start_id_(start_id), end_id_(end_id), rpcs_needed_(end_id - start_id) {} + +void XdsStatsWatcher::RpcCompleted(const AsyncClientCallResult& call, + const std::string& peer) { + // We count RPCs for global watcher or if the request_id falls into the + // watcher's interested range of request ids. + if ((start_id_ == 0 && end_id_ == 0) || + (start_id_ <= call.saved_request_id && call.saved_request_id < end_id_)) { + { + std::lock_guard lock(m_); + if (peer.empty()) { + no_remote_peer_++; + ++no_remote_peer_by_type_[call.rpc_type]; + } else { + // RPC is counted into both per-peer bin and per-method-per-peer bin. + rpcs_by_peer_[peer]++; + rpcs_by_type_[call.rpc_type][peer]++; + } + rpcs_needed_--; + // Report accumulated stats. + auto& stats_per_method = *accumulated_stats_.mutable_stats_per_method(); + auto& method_stat = + stats_per_method[ClientConfigureRequest_RpcType_Name(call.rpc_type)]; + auto& result = *method_stat.mutable_result(); + grpc_status_code code = + static_cast(call.status.error_code()); + auto& num_rpcs = result[code]; + ++num_rpcs; + auto rpcs_started = method_stat.rpcs_started(); + method_stat.set_rpcs_started(++rpcs_started); + } + cv_.notify_one(); + } +} + +void XdsStatsWatcher::WaitForRpcStatsResponse( + LoadBalancerStatsResponse* response, int timeout_sec) { + std::unique_lock lock(m_); + cv_.wait_for(lock, std::chrono::seconds(timeout_sec), + [this] { return rpcs_needed_ == 0; }); + response->mutable_rpcs_by_peer()->insert(rpcs_by_peer_.begin(), + rpcs_by_peer_.end()); + auto& response_rpcs_by_method = *response->mutable_rpcs_by_method(); + for (const auto& rpc_by_type : rpcs_by_type_) { + std::string method_name; + if (rpc_by_type.first == ClientConfigureRequest::EMPTY_CALL) { + method_name = "EmptyCall"; + } else if (rpc_by_type.first == ClientConfigureRequest::UNARY_CALL) { + method_name = "UnaryCall"; + } else { + GPR_ASSERT(0); + } + // TODO(@donnadionne): When the test runner changes to accept EMPTY_CALL + // and UNARY_CALL we will just use the name of the enum instead of the + // method_name variable. + auto& response_rpc_by_method = response_rpcs_by_method[method_name]; + auto& response_rpcs_by_peer = + *response_rpc_by_method.mutable_rpcs_by_peer(); + for (const auto& rpc_by_peer : rpc_by_type.second) { + auto& response_rpc_by_peer = response_rpcs_by_peer[rpc_by_peer.first]; + response_rpc_by_peer = rpc_by_peer.second; + } + } + response->set_num_failures(no_remote_peer_ + rpcs_needed_); +} + +void XdsStatsWatcher::GetCurrentRpcStats( + LoadBalancerAccumulatedStatsResponse* response, + StatsWatchers* stats_watchers) { + std::unique_lock lock(m_); + response->CopyFrom(accumulated_stats_); + // TODO(@donnadionne): delete deprecated stats below when the test is no + // longer using them. + auto& response_rpcs_started_by_method = + *response->mutable_num_rpcs_started_by_method(); + auto& response_rpcs_succeeded_by_method = + *response->mutable_num_rpcs_succeeded_by_method(); + auto& response_rpcs_failed_by_method = + *response->mutable_num_rpcs_failed_by_method(); + for (const auto& rpc_by_type : rpcs_by_type_) { + auto total_succeeded = 0; + for (const auto& rpc_by_peer : rpc_by_type.second) { + total_succeeded += rpc_by_peer.second; + } + response_rpcs_succeeded_by_method[ClientConfigureRequest_RpcType_Name( + rpc_by_type.first)] = total_succeeded; + response_rpcs_started_by_method[ClientConfigureRequest_RpcType_Name( + rpc_by_type.first)] = + stats_watchers->global_request_id_by_type[rpc_by_type.first]; + response_rpcs_failed_by_method[ClientConfigureRequest_RpcType_Name( + rpc_by_type.first)] = no_remote_peer_by_type_[rpc_by_type.first]; + } +} + +} // namespace testing +} // namespace grpc diff --git a/test/cpp/interop/xds_stats_watcher.h b/test/cpp/interop/xds_stats_watcher.h new file mode 100644 index 0000000000000..a5917104f2b85 --- /dev/null +++ b/test/cpp/interop/xds_stats_watcher.h @@ -0,0 +1,104 @@ +// +// +// Copyright 2023 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#ifndef GRPC_TEST_CPP_INTEROP_XDS_STATS_WATCHER_H +#define GRPC_TEST_CPP_INTEROP_XDS_STATS_WATCHER_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "absl/status/status.h" + +#include + +#include "src/proto/grpc/testing/empty.pb.h" +#include "src/proto/grpc/testing/messages.pb.h" + +namespace grpc { +namespace testing { + +class XdsStatsWatcher; + +struct AsyncClientCallResult { + Empty empty_response; + SimpleResponse simple_response; + Status status; + int saved_request_id; + ClientConfigureRequest::RpcType rpc_type; +}; + +struct StatsWatchers { + // Unique ID for each outgoing RPC + int global_request_id = 0; + // Unique ID for each outgoing RPC by RPC method type + std::map global_request_id_by_type; + // Stores a set of watchers that should be notified upon outgoing RPC + // completion + std::set watchers; + // Global watcher for accumululated stats. + XdsStatsWatcher* global_watcher; + // Mutex for global_request_id and watchers + std::mutex mu; +}; + +/// Records the remote peer distribution for a given range of RPCs. +class XdsStatsWatcher { + public: + XdsStatsWatcher(int start_id, int end_id); + + // Upon the completion of an RPC, we will look at the request_id, the + // rpc_type, and the peer the RPC was sent to in order to count + // this RPC into the right stats bin. + void RpcCompleted(const AsyncClientCallResult& call, const std::string& peer); + + void WaitForRpcStatsResponse(LoadBalancerStatsResponse* response, + int timeout_sec); + + void GetCurrentRpcStats(LoadBalancerAccumulatedStatsResponse* response, + StatsWatchers* stats_watchers); + + private: + int start_id_; + int end_id_; + int rpcs_needed_; + int no_remote_peer_ = 0; + std::map no_remote_peer_by_type_; + // A map of stats keyed by peer name. + std::map rpcs_by_peer_; + // A two-level map of stats keyed at top level by RPC method and second level + // by peer name. + std::map> rpcs_by_type_; + // Storing accumulated stats in the response proto format. + LoadBalancerAccumulatedStatsResponse accumulated_stats_; + std::mutex m_; + std::condition_variable cv_; +}; + +} // namespace testing +} // namespace grpc + +#endif // GRPC_TEST_CPP_INTEROP_XDS_STATS_WATCHER_H diff --git a/test/cpp/interop/xds_stats_watcher_test.cc b/test/cpp/interop/xds_stats_watcher_test.cc new file mode 100644 index 0000000000000..63967095e7f4a --- /dev/null +++ b/test/cpp/interop/xds_stats_watcher_test.cc @@ -0,0 +1,71 @@ +// +// Copyright 2023 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#include "test/cpp/interop/xds_stats_watcher.h" + +#include +#include + +#include +#include + +#include + +#include "test/core/util/test_config.h" + +namespace grpc { +namespace testing { +namespace { +AsyncClientCallResult BuildCallResult(int saved_request_id) { + AsyncClientCallResult result; + result.saved_request_id = saved_request_id; + result.rpc_type = ClientConfigureRequest::UNARY_CALL; + return result; +} + +TEST(XdsStatsWatcherTest, CollectsMetadata) { + XdsStatsWatcher watcher(0, 3); + watcher.RpcCompleted(BuildCallResult(0), "peer1"); + watcher.RpcCompleted(BuildCallResult(1), "peer1"); + watcher.RpcCompleted(BuildCallResult(2), "peer2"); + LoadBalancerStatsResponse lb_response; + watcher.WaitForRpcStatsResponse(&lb_response, 1); + EXPECT_EQ( + (std::multimap(lb_response.rpcs_by_peer().begin(), + lb_response.rpcs_by_peer().end())), + (std::multimap({{"peer1", 2}, {"peer2", 1}}))); + EXPECT_EQ(lb_response.rpcs_by_method_size(), 1); + auto rpcs = lb_response.rpcs_by_method().find("UnaryCall"); + EXPECT_NE(rpcs, lb_response.rpcs_by_method().end()); + std::multimap by_peer( + rpcs->second.rpcs_by_peer().begin(), rpcs->second.rpcs_by_peer().end()); + EXPECT_EQ( + by_peer, + (std::multimap({{"peer1", 2}, {"peer2", 1}}))); +} + +} // namespace +} // namespace testing +} // namespace grpc + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + grpc::testing::TestEnvironment env(&argc, argv); + grpc_init(); + auto result = RUN_ALL_TESTS(); + grpc_shutdown(); + return result; +} diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index 92eba7d4b901f..3c9d7bd047024 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -11505,6 +11505,30 @@ ], "uses_polling": false }, + { + "args": [], + "benchmark": false, + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": true, + "language": "c++", + "name": "xds_stats_watcher_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "uses_polling": true + }, { "args": [], "benchmark": false, From 65e8e04b6c9cf00dcdfeb619c947578a9eda448e Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 8 Aug 2023 09:50:00 -0700 Subject: [PATCH 137/205] [tcp] Add some safety conditions for memory allocation (#34003) It looks like we're seeing a rare crash in the TCP read code, around buffering for the next read. Unclear as yet whether this is due to `memory_pressure_controller` rollout or not - see b/294609692, b/294854129. This change just adds some safety checks to try and ensure we never get into the bad state - but it's unclear to me as yet how we do reach that state. --- src/core/lib/iomgr/tcp_posix.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/lib/iomgr/tcp_posix.cc b/src/core/lib/iomgr/tcp_posix.cc index 4664d1a10d257..035f9426f6285 100644 --- a/src/core/lib/iomgr/tcp_posix.cc +++ b/src/core/lib/iomgr/tcp_posix.cc @@ -1057,7 +1057,7 @@ static void maybe_make_read_slices(grpc_tcp* tcp) static const int kBigAlloc = 64 * 1024; static const int kSmallAlloc = 8 * 1024; if (tcp->incoming_buffer->length < - static_cast(tcp->min_progress_size)) { + std::max(tcp->min_progress_size, 1)) { size_t allocate_length = tcp->min_progress_size; const size_t target_length = static_cast(tcp->target_length); // If memory pressure is low and we think there will be more than @@ -1067,8 +1067,8 @@ static void maybe_make_read_slices(grpc_tcp* tcp) if (low_memory_pressure && target_length > allocate_length) { allocate_length = target_length; } - int extra_wanted = - allocate_length - static_cast(tcp->incoming_buffer->length); + int extra_wanted = std::max( + 1, allocate_length - static_cast(tcp->incoming_buffer->length)); if (extra_wanted >= (low_memory_pressure ? kSmallAlloc * 3 / 2 : kBigAlloc)) { while (extra_wanted > 0) { From b235f20f472fd276cc0299bff9c9a4e5d924400d Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 8 Aug 2023 10:56:11 -0700 Subject: [PATCH 138/205] [promises] Make Sleep promise movable (#33997) I have a cool optimization in mind for promises - but it requires that we can move them after polling, which is a contract change. I'm going to work through the set of primitives we have in the coming weeks and change that contract to enable the optimization. --------- Co-authored-by: ctiller --- src/core/lib/promise/sleep.h | 15 +++++---------- test/core/promise/BUILD | 1 + test/core/promise/sleep_test.cc | 1 + 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/core/lib/promise/sleep.h b/src/core/lib/promise/sleep.h index 5fe735f27bf4d..7f3a9685230d4 100644 --- a/src/core/lib/promise/sleep.h +++ b/src/core/lib/promise/sleep.h @@ -18,11 +18,11 @@ #include #include +#include #include "absl/status/status.h" #include -#include #include "src/core/lib/gprpp/time.h" #include "src/core/lib/promise/activity.h" @@ -38,17 +38,12 @@ class Sleep final { Sleep(const Sleep&) = delete; Sleep& operator=(const Sleep&) = delete; - Sleep(Sleep&& other) noexcept : deadline_(other.deadline_) { - // Promises can be moved only until they're polled, and since we only create - // the closure when first polled we can assume it's nullptr here. - GPR_DEBUG_ASSERT(other.closure_ == nullptr); - }; + Sleep(Sleep&& other) noexcept + : deadline_(other.deadline_), + closure_(std::exchange(other.closure_, nullptr)) {} Sleep& operator=(Sleep&& other) noexcept { - // Promises can be moved only until they're polled, and since we only create - // the closure when first polled we can assume it's nullptr here. - GPR_DEBUG_ASSERT(closure_ == nullptr); - GPR_DEBUG_ASSERT(other.closure_ == nullptr); deadline_ = other.deadline_; + std::swap(closure_, other.closure_); return *this; }; diff --git a/test/core/promise/BUILD b/test/core/promise/BUILD index f34b1d68b4c02..620c40a2c6583 100644 --- a/test/core/promise/BUILD +++ b/test/core/promise/BUILD @@ -501,6 +501,7 @@ grpc_cc_test( deps = [ "test_wakeup_schedulers", "//:exec_ctx", + "//:gpr", "//:grpc", "//src/core:default_event_engine", "//src/core:exec_ctx_wakeup_scheduler", diff --git a/test/core/promise/sleep_test.cc b/test/core/promise/sleep_test.cc index 197f596633696..ac8abcec64f34 100644 --- a/test/core/promise/sleep_test.cc +++ b/test/core/promise/sleep_test.cc @@ -24,6 +24,7 @@ #include "gtest/gtest.h" #include +#include #include "src/core/lib/event_engine/default_event_engine.h" #include "src/core/lib/gprpp/notification.h" From a5f11219828e7e3df6cb106320dd902c38f07144 Mon Sep 17 00:00:00 2001 From: Luwei Ge Date: Tue, 8 Aug 2023 12:23:52 -0700 Subject: [PATCH 139/205] [xDS] Remove filter name from GenerateServiceConfig (#33915) We decided to not populate `policy_name` with the HTTP filter name in xDS case. So removing it from `GenerateServiceConfig`. This will be consistent across languages. The gRFC [PR](https://github.com/grpc/proposal/pull/346) has been updated. --- .../rbac/rbac_service_config_parser.cc | 11 ++--- src/core/ext/xds/xds_http_fault_filter.cc | 3 +- src/core/ext/xds/xds_http_fault_filter.h | 3 +- src/core/ext/xds/xds_http_filters.h | 6 +-- src/core/ext/xds/xds_http_rbac_filter.cc | 11 ++--- src/core/ext/xds/xds_http_rbac_filter.h | 3 +- .../xds/xds_http_stateful_session_filter.cc | 3 +- .../xds/xds_http_stateful_session_filter.h | 3 +- src/core/ext/xds/xds_routing.cc | 4 +- .../lib/security/authorization/rbac_policy.h | 2 +- .../rbac/rbac_service_config_parser_test.cc | 48 +++---------------- test/core/xds/xds_http_filters_test.cc | 21 ++++---- test/cpp/end2end/xds/xds_end2end_test.cc | 34 +++++-------- 13 files changed, 42 insertions(+), 110 deletions(-) diff --git a/src/core/ext/filters/rbac/rbac_service_config_parser.cc b/src/core/ext/filters/rbac/rbac_service_config_parser.cc index 91f0ed7e4f813..f7264b3fe0a38 100644 --- a/src/core/ext/filters/rbac/rbac_service_config_parser.cc +++ b/src/core/ext/filters/rbac/rbac_service_config_parser.cc @@ -215,12 +215,11 @@ struct RbacConfig { Rules(Rules&&) = default; Rules& operator=(Rules&&) = default; - Rbac TakeAsRbac(std::string name); + Rbac TakeAsRbac(); static const JsonLoaderInterface* JsonLoader(const JsonArgs&); void JsonPostLoad(const Json&, const JsonArgs&, ValidationErrors* errors); }; - std::string name; absl::optional rules; Rbac TakeAsRbac(); @@ -773,9 +772,8 @@ void RbacConfig::RbacPolicy::Rules::AuditLogger::JsonPostLoad( // RbacConfig::RbacPolicy::Rules // -Rbac RbacConfig::RbacPolicy::Rules::TakeAsRbac(std::string name) { +Rbac RbacConfig::RbacPolicy::Rules::TakeAsRbac() { Rbac rbac; - rbac.name = std::move(name); rbac.action = static_cast(action); rbac.audit_condition = audit_condition; for (auto& p : policies) { @@ -849,15 +847,14 @@ Rbac RbacConfig::RbacPolicy::TakeAsRbac() { if (!rules.has_value()) { // No enforcing to be applied. An empty deny policy with an empty map // is equivalent to no enforcing. - return Rbac(std::move(name), Rbac::Action::kDeny, {}); + return Rbac("", Rbac::Action::kDeny, {}); } - return rules->TakeAsRbac(std::move(name)); + return rules->TakeAsRbac(); } const JsonLoaderInterface* RbacConfig::RbacPolicy::JsonLoader(const JsonArgs&) { static const auto* loader = JsonObjectLoader() .OptionalField("rules", &RbacPolicy::rules) - .Field("filter_name", &RbacPolicy::name) .Finish(); return loader; } diff --git a/src/core/ext/xds/xds_http_fault_filter.cc b/src/core/ext/xds/xds_http_fault_filter.cc index 1950ca812ccd0..4c460daef584f 100644 --- a/src/core/ext/xds/xds_http_fault_filter.cc +++ b/src/core/ext/xds/xds_http_fault_filter.cc @@ -227,8 +227,7 @@ ChannelArgs XdsHttpFaultFilter::ModifyChannelArgs( absl::StatusOr XdsHttpFaultFilter::GenerateServiceConfig( const FilterConfig& hcm_filter_config, - const FilterConfig* filter_config_override, - absl::string_view /*filter_name*/) const { + const FilterConfig* filter_config_override) const { Json policy_json = filter_config_override != nullptr ? filter_config_override->config : hcm_filter_config.config; diff --git a/src/core/ext/xds/xds_http_fault_filter.h b/src/core/ext/xds/xds_http_fault_filter.h index f2dd3555dc0a2..690d89eb684d9 100644 --- a/src/core/ext/xds/xds_http_fault_filter.h +++ b/src/core/ext/xds/xds_http_fault_filter.h @@ -48,8 +48,7 @@ class XdsHttpFaultFilter : public XdsHttpFilterImpl { ChannelArgs ModifyChannelArgs(const ChannelArgs& args) const override; absl::StatusOr GenerateServiceConfig( const FilterConfig& hcm_filter_config, - const FilterConfig* filter_config_override, - absl::string_view filter_name) const override; + const FilterConfig* filter_config_override) const override; bool IsSupportedOnClients() const override { return true; } bool IsSupportedOnServers() const override { return false; } }; diff --git a/src/core/ext/xds/xds_http_filters.h b/src/core/ext/xds/xds_http_filters.h index 26d73cd764e37..b99f12bd4f9ca 100644 --- a/src/core/ext/xds/xds_http_filters.h +++ b/src/core/ext/xds/xds_http_filters.h @@ -112,8 +112,7 @@ class XdsHttpFilterImpl { // there is no override in any of those locations. virtual absl::StatusOr GenerateServiceConfig( const FilterConfig& hcm_filter_config, - const FilterConfig* filter_config_override, - absl::string_view filter_name) const = 0; + const FilterConfig* filter_config_override) const = 0; // Returns true if the filter is supported on clients; false otherwise virtual bool IsSupportedOnClients() const = 0; @@ -139,8 +138,7 @@ class XdsHttpRouterFilter : public XdsHttpFilterImpl { const grpc_channel_filter* channel_filter() const override { return nullptr; } absl::StatusOr GenerateServiceConfig( const FilterConfig& /*hcm_filter_config*/, - const FilterConfig* /*filter_config_override*/, - absl::string_view /*filter_name*/) const override { + const FilterConfig* /*filter_config_override*/) const override { // This will never be called, since channel_filter() returns null. return absl::UnimplementedError("router filter should never be called"); } diff --git a/src/core/ext/xds/xds_http_rbac_filter.cc b/src/core/ext/xds/xds_http_rbac_filter.cc index f7bde62b5747d..ed107c37a370d 100644 --- a/src/core/ext/xds/xds_http_rbac_filter.cc +++ b/src/core/ext/xds/xds_http_rbac_filter.cc @@ -575,17 +575,12 @@ ChannelArgs XdsHttpRbacFilter::ModifyChannelArgs( absl::StatusOr XdsHttpRbacFilter::GenerateServiceConfig( const FilterConfig& hcm_filter_config, - const FilterConfig* filter_config_override, - absl::string_view filter_name) const { + const FilterConfig* filter_config_override) const { const Json& policy_json = filter_config_override != nullptr ? filter_config_override->config : hcm_filter_config.config; - auto json_object = policy_json.object(); - json_object.emplace("filter_name", - Json::FromString(std::string(filter_name))); - // The policy JSON may be empty other than the filter name, that's allowed. - return ServiceConfigJsonEntry{"rbacPolicy", - JsonDump(Json::FromObject(json_object))}; + // The policy JSON may be empty and that's allowed. + return ServiceConfigJsonEntry{"rbacPolicy", JsonDump(policy_json)}; } } // namespace grpc_core diff --git a/src/core/ext/xds/xds_http_rbac_filter.h b/src/core/ext/xds/xds_http_rbac_filter.h index 74c71f3cb9367..c066521658ae6 100644 --- a/src/core/ext/xds/xds_http_rbac_filter.h +++ b/src/core/ext/xds/xds_http_rbac_filter.h @@ -48,8 +48,7 @@ class XdsHttpRbacFilter : public XdsHttpFilterImpl { ChannelArgs ModifyChannelArgs(const ChannelArgs& args) const override; absl::StatusOr GenerateServiceConfig( const FilterConfig& hcm_filter_config, - const FilterConfig* filter_config_override, - absl::string_view filter_name) const override; + const FilterConfig* filter_config_override) const override; bool IsSupportedOnClients() const override { return false; } bool IsSupportedOnServers() const override { return true; } }; diff --git a/src/core/ext/xds/xds_http_stateful_session_filter.cc b/src/core/ext/xds/xds_http_stateful_session_filter.cc index 85526a98d7e02..f58152b4e461d 100644 --- a/src/core/ext/xds/xds_http_stateful_session_filter.cc +++ b/src/core/ext/xds/xds_http_stateful_session_filter.cc @@ -211,8 +211,7 @@ ChannelArgs XdsHttpStatefulSessionFilter::ModifyChannelArgs( absl::StatusOr XdsHttpStatefulSessionFilter::GenerateServiceConfig( const FilterConfig& hcm_filter_config, - const FilterConfig* filter_config_override, - absl::string_view /*filter_name*/) const { + const FilterConfig* filter_config_override) const { const Json& config = filter_config_override != nullptr ? filter_config_override->config : hcm_filter_config.config; diff --git a/src/core/ext/xds/xds_http_stateful_session_filter.h b/src/core/ext/xds/xds_http_stateful_session_filter.h index 71a2fab20a2d1..4fe68e57bc8c9 100644 --- a/src/core/ext/xds/xds_http_stateful_session_filter.h +++ b/src/core/ext/xds/xds_http_stateful_session_filter.h @@ -48,8 +48,7 @@ class XdsHttpStatefulSessionFilter : public XdsHttpFilterImpl { ChannelArgs ModifyChannelArgs(const ChannelArgs& args) const override; absl::StatusOr GenerateServiceConfig( const FilterConfig& hcm_filter_config, - const FilterConfig* filter_config_override, - absl::string_view filter_name) const override; + const FilterConfig* filter_config_override) const override; bool IsSupportedOnClients() const override { return true; } bool IsSupportedOnServers() const override { return false; } }; diff --git a/src/core/ext/xds/xds_routing.cc b/src/core/ext/xds/xds_routing.cc index 5d56b2bf93487..e59d6b9d50ebe 100644 --- a/src/core/ext/xds/xds_routing.cc +++ b/src/core/ext/xds/xds_routing.cc @@ -248,8 +248,8 @@ XdsRouting::GeneratePerHTTPFilterConfigs( FindFilterConfigOverride(http_filter.name, vhost, route, cluster_weight); // Generate service config for filter. - auto method_config_field = filter_impl->GenerateServiceConfig( - http_filter.config, config_override, http_filter.name); + auto method_config_field = + filter_impl->GenerateServiceConfig(http_filter.config, config_override); if (!method_config_field.ok()) { return absl::FailedPreconditionError(absl::StrCat( "failed to generate method config for HTTP filter ", http_filter.name, diff --git a/src/core/lib/security/authorization/rbac_policy.h b/src/core/lib/security/authorization/rbac_policy.h index 0901288f5726d..0ee9de16cc1e7 100644 --- a/src/core/lib/security/authorization/rbac_policy.h +++ b/src/core/lib/security/authorization/rbac_policy.h @@ -179,7 +179,7 @@ struct Rbac { std::string ToString() const; - // The authorization policy name or the HTTP RBAC filter name. + // The authorization policy name or empty string in xDS case. std::string name; Action action; diff --git a/test/core/ext/filters/rbac/rbac_service_config_parser_test.cc b/test/core/ext/filters/rbac/rbac_service_config_parser_test.cc index 78374d0ff5829..9961d7fb1d91c 100644 --- a/test/core/ext/filters/rbac/rbac_service_config_parser_test.cc +++ b/test/core/ext/filters/rbac/rbac_service_config_parser_test.cc @@ -99,29 +99,7 @@ class RbacServiceConfigParsingTest : public ::testing::Test { std::map logger_configs_; }; -// Filter name is required in RBAC policy. -TEST_F(RbacServiceConfigParsingTest, EmptyRbacPolicy) { - const char* test_json = - "{\n" - " \"methodConfig\": [ {\n" - " \"name\": [\n" - " {}\n" - " ],\n" - " \"rbacPolicy\": [ {\n" - " } ]" - " } ]\n" - "}"; - ChannelArgs args = ChannelArgs().Set(GRPC_ARG_PARSE_RBAC_METHOD_CONFIG, 1); - auto service_config = ServiceConfigImpl::Create(args, test_json); - EXPECT_EQ(service_config.status().code(), absl::StatusCode::kInvalidArgument); - EXPECT_EQ(service_config.status().message(), - "errors validating service config: [" - "field:methodConfig[0].rbacPolicy[0].filter_name error:field not " - "present]") - << service_config.status(); -} - -// Test basic parsing of RBAC policy +// Test parsing of an empty RBAC policy TEST_F(RbacServiceConfigParsingTest, RbacPolicyWithoutRules) { const char* test_json = "{\n" @@ -129,7 +107,7 @@ TEST_F(RbacServiceConfigParsingTest, RbacPolicyWithoutRules) { " \"name\": [\n" " {}\n" " ],\n" - " \"rbacPolicy\": [ {\"filter_name\": \"rbac\"} ]\n" + " \"rbacPolicy\": [ {} ]\n" " } ]\n" "}"; ChannelArgs args = ChannelArgs().Set(GRPC_ARG_PARSE_RBAC_METHOD_CONFIG, 1); @@ -201,9 +179,9 @@ TEST_F(RbacServiceConfigParsingTest, MultipleRbacPolicies) { " {}\n" " ],\n" " \"rbacPolicy\": [\n" - " { \"filter_name\": \"rbac-1\" },\n" - " { \"filter_name\": \"rbac-2\" },\n" - " { \"filter_name\": \"rbac-3\" }\n" + " {},\n" + " {},\n" + " {}\n" " ]" " } ]\n" "}"; @@ -250,7 +228,7 @@ TEST_F(RbacServiceConfigParsingTest, BadRulesType) { " \"name\": [\n" " {}\n" " ],\n" - " \"rbacPolicy\": [{\"filter_name\": \"rbac\", \"rules\":1}]\n" + " \"rbacPolicy\": [{\"rules\":1}]\n" " } ]\n" "}"; ChannelArgs args = ChannelArgs().Set(GRPC_ARG_PARSE_RBAC_METHOD_CONFIG, 1); @@ -270,7 +248,6 @@ TEST_F(RbacServiceConfigParsingTest, BadActionAndPolicyType) { " {}\n" " ],\n" " \"rbacPolicy\": [{\n" - " \"filter_name\": \"rbac\",\n" " \"rules\":{\n" " \"action\":{},\n" " \"policies\":123\n" @@ -298,7 +275,6 @@ TEST_F(RbacServiceConfigParsingTest, MissingPermissionAndPrincipals) { " {}\n" " ],\n" " \"rbacPolicy\": [{\n" - " \"filter_name\": \"rbac\",\n" " \"rules\":{\n" " \"action\":1,\n" " \"policies\":{\n" @@ -329,7 +305,6 @@ TEST_F(RbacServiceConfigParsingTest, EmptyPrincipalAndPermission) { " {}\n" " ],\n" " \"rbacPolicy\": [{\n" - " \"filter_name\": \"rbac\",\n" " \"rules\":{\n" " \"action\":1,\n" " \"policies\":{\n" @@ -362,7 +337,6 @@ TEST_F(RbacServiceConfigParsingTest, VariousPermissionsAndPrincipalsTypes) { " {}\n" " ],\n" " \"rbacPolicy\": [{\n" - " \"filter_name\": \"rbac\",\n" " \"rules\":{\n" " \"action\":1,\n" " \"policies\":{\n" @@ -420,7 +394,6 @@ TEST_F(RbacServiceConfigParsingTest, VariousPermissionsAndPrincipalsBadTypes) { " {}\n" " ],\n" " \"rbacPolicy\": [{\n" - " \"filter_name\": \"rbac\",\n" " \"rules\":{\n" " \"action\":1,\n" " \"policies\":{\n" @@ -515,7 +488,6 @@ TEST_F(RbacServiceConfigParsingTest, HeaderMatcherVariousTypes) { " {}\n" " ],\n" " \"rbacPolicy\": [{\n" - " \"filter_name\": \"rbac\",\n" " \"rules\":{\n" " \"action\":1,\n" " \"policies\":{\n" @@ -560,7 +532,6 @@ TEST_F(RbacServiceConfigParsingTest, HeaderMatcherBadTypes) { " {}\n" " ],\n" " \"rbacPolicy\": [{\n" - " \"filter_name\": \"rbac\",\n" " \"rules\":{\n" " \"action\":1,\n" " \"policies\":{\n" @@ -617,7 +588,6 @@ TEST_F(RbacServiceConfigParsingTest, StringMatcherVariousTypes) { " {}\n" " ],\n" " \"rbacPolicy\": [{\n" - " \"filter_name\": \"rbac\",\n" " \"rules\":{\n" " \"action\":1,\n" " \"policies\":{\n" @@ -659,7 +629,6 @@ TEST_F(RbacServiceConfigParsingTest, StringMatcherBadTypes) { " {}\n" " ],\n" " \"rbacPolicy\": [{\n" - " \"filter_name\": \"rbac\",\n" " \"rules\":{\n" " \"action\":1,\n" " \"policies\":{\n" @@ -715,7 +684,6 @@ TEST_F(RbacServiceConfigParsingTest, AuditConditionOnDenyWithMultipleLoggers) { " {}\n" " ],\n" " \"rbacPolicy\": [ {\n" - " \"filter_name\": \"rbac\",\n" " \"rules\":{\n" " \"action\":1,\n" " \"audit_condition\":1,\n" @@ -760,7 +728,6 @@ TEST_F(RbacServiceConfigParsingTest, BadAuditLoggerConfig) { " {}\n" " ],\n" " \"rbacPolicy\": [ {\n" - " \"filter_name\": \"rbac\",\n" " \"rules\":{\n" " \"action\":1,\n" " \"audit_condition\":1,\n" @@ -791,7 +758,6 @@ TEST_F(RbacServiceConfigParsingTest, UnknownAuditLoggerConfig) { " {}\n" " ],\n" " \"rbacPolicy\": [ {\n" - " \"filter_name\": \"rbac\",\n" " \"rules\":{\n" " \"action\":1,\n" " \"audit_condition\":1,\n" @@ -822,7 +788,6 @@ TEST_F(RbacServiceConfigParsingTest, BadAuditConditionAndLoggersTypes) { " {}\n" " ],\n" " \"rbacPolicy\": [ {\n" - " \"filter_name\": \"rbac\",\n" " \"rules\":{\n" " \"action\":1,\n" " \"audit_condition\":{},\n" @@ -851,7 +816,6 @@ TEST_F(RbacServiceConfigParsingTest, BadAuditConditionEnum) { " {}\n" " ],\n" " \"rbacPolicy\": [ {\n" - " \"filter_name\": \"rbac\",\n" " \"rules\":{\n" " \"action\":1,\n" " \"audit_condition\":100\n" diff --git a/test/core/xds/xds_http_filters_test.cc b/test/core/xds/xds_http_filters_test.cc index 18d9b9701c482..ff40ac2e29d6a 100644 --- a/test/core/xds/xds_http_filters_test.cc +++ b/test/core/xds/xds_http_filters_test.cc @@ -305,8 +305,7 @@ TEST_F(XdsFaultInjectionFilterTest, ModifyChannelArgs) { TEST_F(XdsFaultInjectionFilterTest, GenerateServiceConfigTopLevelConfig) { XdsHttpFilterImpl::FilterConfig config; config.config = Json::FromObject({{"foo", Json::FromString("bar")}}); - auto service_config = - filter_->GenerateServiceConfig(config, nullptr, /*filter_name=*/""); + auto service_config = filter_->GenerateServiceConfig(config, nullptr); ASSERT_TRUE(service_config.ok()) << service_config.status(); EXPECT_EQ(service_config->service_config_field_name, "faultInjectionPolicy"); EXPECT_EQ(service_config->element, "{\"foo\":\"bar\"}"); @@ -318,8 +317,8 @@ TEST_F(XdsFaultInjectionFilterTest, GenerateServiceConfigOverrideConfig) { XdsHttpFilterImpl::FilterConfig override_config; override_config.config = Json::FromObject({{"baz", Json::FromString("quux")}}); - auto service_config = filter_->GenerateServiceConfig( - top_config, &override_config, /*filter_name=*/""); + auto service_config = + filter_->GenerateServiceConfig(top_config, &override_config); ASSERT_TRUE(service_config.ok()) << service_config.status(); EXPECT_EQ(service_config->service_config_field_name, "faultInjectionPolicy"); EXPECT_EQ(service_config->element, "{\"baz\":\"quux\"}"); @@ -599,13 +598,11 @@ TEST_F(XdsRbacFilterTest, GenerateServiceConfig) { XdsHttpFilterImpl::FilterConfig hcm_config = { filter_->ConfigProtoName(), Json::FromObject({{"name", Json::FromString("foo")}})}; - auto config = filter_->GenerateServiceConfig(hcm_config, nullptr, "rbac"); + auto config = filter_->GenerateServiceConfig(hcm_config, nullptr); ASSERT_TRUE(config.ok()) << config.status(); EXPECT_EQ(config->service_config_field_name, "rbacPolicy"); - EXPECT_EQ( - config->element, - JsonDump(Json::FromObject({{"name", Json::FromString("foo")}, - {"filter_name", Json::FromString("rbac")}}))); + EXPECT_EQ(config->element, + JsonDump(Json::FromObject({{"name", Json::FromString("foo")}}))); } // For the RBAC filter, the override config is a superset of the @@ -1169,8 +1166,7 @@ TEST_F(XdsStatefulSessionFilterTest, GenerateServiceConfigNoOverride) { XdsHttpFilterImpl::FilterConfig hcm_config = { filter_->ConfigProtoName(), Json::FromObject({{"name", Json::FromString("foo")}})}; - auto config = - filter_->GenerateServiceConfig(hcm_config, nullptr, /*filter_name=*/""); + auto config = filter_->GenerateServiceConfig(hcm_config, nullptr); ASSERT_TRUE(config.ok()) << config.status(); EXPECT_EQ(config->service_config_field_name, "stateful_session"); EXPECT_EQ(config->element, @@ -1184,8 +1180,7 @@ TEST_F(XdsStatefulSessionFilterTest, GenerateServiceConfigWithOverride) { XdsHttpFilterImpl::FilterConfig override_config = { filter_->OverrideConfigProtoName(), Json::FromObject({{"name", Json::FromString("bar")}})}; - auto config = filter_->GenerateServiceConfig(hcm_config, &override_config, - /*filter_name=*/""); + auto config = filter_->GenerateServiceConfig(hcm_config, &override_config); ASSERT_TRUE(config.ok()) << config.status(); EXPECT_EQ(config->service_config_field_name, "stateful_session"); EXPECT_EQ(config->element, diff --git a/test/cpp/end2end/xds/xds_end2end_test.cc b/test/cpp/end2end/xds/xds_end2end_test.cc index 695c00542ad1c..660b5e14e0ee9 100644 --- a/test/cpp/end2end/xds/xds_end2end_test.cc +++ b/test/cpp/end2end/xds/xds_end2end_test.cc @@ -2882,20 +2882,11 @@ TEST_P(XdsRbacTestWithActionPermutations, grpc::StatusCode::PERMISSION_DENIED); // If the second rbac denies the rpc, only one log from the first rbac. // Otherwise, all three rbacs log. - std::vector expected = { + std::vector expected( + GetParam().rbac_action() != RBAC_Action_DENY ? 3 : 1, "{\"authorized\":true,\"matched_rule\":\"policy\"," - "\"policy_name\":\"rbac1\",\"principal\":\"\",\"rpc_" - "method\":\"/grpc.testing.EchoTestService/Echo\"}"}; - if (GetParam().rbac_action() != RBAC_Action_DENY) { - expected.push_back( - "{\"authorized\":true,\"matched_rule\":\"policy\"," - "\"policy_name\":\"rbac2\",\"principal\":\"\",\"rpc_" - "method\":\"/grpc.testing.EchoTestService/Echo\"}"); - expected.push_back( - "{\"authorized\":true,\"matched_rule\":\"policy\"," - "\"policy_name\":\"rbac3\",\"principal\":\"\",\"rpc_" - "method\":\"/grpc.testing.EchoTestService/Echo\"}"); - } + "\"policy_name\":\"\",\"principal\":\"\",\"rpc_" + "method\":\"/grpc.testing.EchoTestService/Echo\"}"); EXPECT_THAT(audit_logs_, ::testing::ElementsAreArray(expected)); } @@ -2941,7 +2932,7 @@ TEST_P(XdsRbacTestWithActionPermutations, MultipleRbacPoliciesWithAuditOnDeny) { if (GetParam().rbac_action() == RBAC_Action_DENY) { expected.push_back( "{\"authorized\":false,\"matched_rule\":\"policy\",\"policy_name\":" - "\"rbac2\",\"principal\":\"\",\"rpc_method\":\"/" + "\"\",\"principal\":\"\",\"rpc_method\":\"/" "grpc.testing.EchoTestService/Echo\"}"); } EXPECT_THAT(audit_logs_, ::testing::ElementsAreArray(expected)); @@ -2989,21 +2980,18 @@ TEST_P(XdsRbacTestWithActionPermutations, // all rbacs log. std::vector expected = { "{\"authorized\":true,\"matched_rule\":\"policy\",\"policy_name\":" - "\"rbac1\",\"principal\":\"\",\"rpc_method\":\"/" + "\"\",\"principal\":\"\",\"rpc_method\":\"/" "grpc.testing.EchoTestService/Echo\"}"}; if (GetParam().rbac_action() == RBAC_Action_DENY) { expected.push_back( "{\"authorized\":false,\"matched_rule\":\"policy\",\"policy_name\":" - "\"rbac2\",\"principal\":\"\",\"rpc_method\":\"/" + "\"\",\"principal\":\"\",\"rpc_method\":\"/" "grpc.testing.EchoTestService/Echo\"}"); } else { - expected.push_back( - "{\"authorized\":true,\"matched_rule\":\"policy\",\"policy_name\":" - "\"rbac2\",\"principal\":\"\",\"rpc_method\":\"/" - "grpc.testing.EchoTestService/Echo\"}"); - expected.push_back( + expected = std::vector( + 3, "{\"authorized\":true,\"matched_rule\":\"policy\",\"policy_name\":" - "\"rbac3\",\"principal\":\"\",\"rpc_method\":\"/" + "\"\",\"principal\":\"\",\"rpc_method\":\"/" "grpc.testing.EchoTestService/Echo\"}"); } EXPECT_THAT(audit_logs_, ::testing::ElementsAreArray(expected)); @@ -3084,7 +3072,7 @@ TEST_P(XdsRbacTestWithActionAndAuditConditionPermutations, MultipleLoggers) { EXPECT_THAT(audit_logs_, ::testing::ElementsAre(absl::StrFormat( "{\"authorized\":%s,\"matched_rule\":\"policy\"," - "\"policy_name\":\"rbac1\",\"principal\":\"\"," + "\"policy_name\":\"\",\"principal\":\"\"," "\"rpc_" "method\":\"/grpc.testing.EchoTestService/Echo\"}", action == RBAC_Action_DENY ? "false" : "true"))); From ad9e8f45eb81bf40d98e5291a2c850407f8f7213 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 8 Aug 2023 13:12:50 -0700 Subject: [PATCH 140/205] [end2end] Fix fuzzer found crash (#34004) Fixes b/293789128 --- ...alive_timeout_fuzzer-6432818156601344.test | 1424 +++++++++++++++++ test/core/end2end/tests/keepalive_timeout.cc | 2 +- 2 files changed, 1425 insertions(+), 1 deletion(-) create mode 100644 test/core/end2end/end2end_test_corpus/keepalive_timeout/clusterfuzz-testcase-minimized-keepalive_timeout_fuzzer-6432818156601344.test diff --git a/test/core/end2end/end2end_test_corpus/keepalive_timeout/clusterfuzz-testcase-minimized-keepalive_timeout_fuzzer-6432818156601344.test b/test/core/end2end/end2end_test_corpus/keepalive_timeout/clusterfuzz-testcase-minimized-keepalive_timeout_fuzzer-6432818156601344.test new file mode 100644 index 0000000000000..55a6c2173683b --- /dev/null +++ b/test/core/end2end/end2end_test_corpus/keepalive_timeout/clusterfuzz-testcase-minimized-keepalive_timeout_fuzzer-6432818156601344.test @@ -0,0 +1,1424 @@ +test_id: 34 +event_engine_actions { + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 2882303761517117745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 281470681743360 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 9339723 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 127 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 127 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711744 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711746 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 1000001 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 2882303761517117745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 281470681743360 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 9339723 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 1000001 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711872 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711744 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 28823037 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711746 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 1 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + run_delay: 288230376151711745 + assign_ports: 3 + connections { + write_size: 40 + write_size: 40 + write_size: 40 + write_size: 40 + write_size: 40 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 11 + write_size: 0 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 1392508928 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 0 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 0 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 29696 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 0 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 67 + write_size: 3 + write_size: 3 + write_size: 7759107 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 40 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 0 + write_size: 3 + write_size: 3 + write_size: 43 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 1048576 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 255 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 2147483647 + write_size: 3 + write_size: 232 + write_size: 3 + write_size: 40 + write_size: 2147483648 + write_size: 111657 + } + connections { + write_size: 40 + write_size: 40 + write_size: 40 + write_size: 40 + write_size: 40 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 0 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 0 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 1392508928 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 0 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 0 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 29696 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 67 + write_size: 3 + write_size: 3 + write_size: 131 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 40 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 0 + write_size: 3 + write_size: 3 + write_size: 43 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 1048576 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 255 + write_size: 3 + write_size: 3 + write_size: 3 + write_size: 2147483647 + write_size: 3 + write_size: 232 + write_size: 3 + write_size: 40 + write_size: 2147483648 + write_size: 111657 + } + connections { + write_size: 0 + } +} +config_vars { + verbosity: "zzzz" + stacktrace_minloglevel: "\016\006\000\000" +} diff --git a/test/core/end2end/tests/keepalive_timeout.cc b/test/core/end2end/tests/keepalive_timeout.cc index 751ca3cb00d86..482d823d207e9 100644 --- a/test/core/end2end/tests/keepalive_timeout.cc +++ b/test/core/end2end/tests/keepalive_timeout.cc @@ -40,7 +40,7 @@ CORE_END2END_TEST(Http2SingleHopTest, KeepaliveTimeout) { .Set(GRPC_ARG_KEEPALIVE_TIME_MS, 10) .Set(GRPC_ARG_KEEPALIVE_TIMEOUT_MS, 0) .Set(GRPC_ARG_HTTP2_BDP_PROBE, false)); - auto c = NewClientCall("/foo").Timeout(Duration::Seconds(5)).Create(); + auto c = NewClientCall("/foo").Timeout(Duration::Minutes(1)).Create(); IncomingMetadata server_initial_metadata; IncomingStatusOnClient server_status; c.NewBatch(1) From 8e18f1c1df7052965af7a4b0ec9fba0d8c20cb2c Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 8 Aug 2023 15:18:04 -0700 Subject: [PATCH 141/205] [fuzzer] Fix another deadline exceeded case (#34014) --- ...ed-call_creds_fuzzer-4602121020309504.test | 2900 +++++++++++++++++ test/core/end2end/tests/call_creds.cc | 8 +- 2 files changed, 2904 insertions(+), 4 deletions(-) create mode 100644 test/core/end2end/end2end_test_corpus/call_creds/clusterfuzz-testcase-minimized-call_creds_fuzzer-4602121020309504.test diff --git a/test/core/end2end/end2end_test_corpus/call_creds/clusterfuzz-testcase-minimized-call_creds_fuzzer-4602121020309504.test b/test/core/end2end/end2end_test_corpus/call_creds/clusterfuzz-testcase-minimized-call_creds_fuzzer-4602121020309504.test new file mode 100644 index 0000000000000..3237326aed502 --- /dev/null +++ b/test/core/end2end/end2end_test_corpus/call_creds/clusterfuzz-testcase-minimized-call_creds_fuzzer-4602121020309504.test @@ -0,0 +1,2900 @@ +test_id: 94 +event_engine_actions { + run_delay: 16776960 + run_delay: 1744830464 + run_delay: 92233715884105728 + run_delay: 576460752303423488 + run_delay: 576460752326292140 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 0 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 0 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 0 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 0 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 1 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 65536 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 0 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 0 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 32769 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 34359738368 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 3488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303422589 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 360287970189639681 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 10 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 127 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 0 + run_delay: 576460752303423488 + run_delay: 576460752303423645 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 576460752303423488 + run_delay: 63232 + run_delay: 1744830464 + connections { + write_size: 9 + write_size: 16384 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 33554433 + write_size: 0 + write_size: 0 + write_size: 6648832 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 9 + write_size: 779252851 + } + connections { + write_size: 9 + write_size: 16384 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 6648832 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 1 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 7 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 9 + write_size: 9 + write_size: 779252851 + } +} diff --git a/test/core/end2end/tests/call_creds.cc b/test/core/end2end/tests/call_creds.cc index 15f9529deec80..780d069a7dd61 100644 --- a/test/core/end2end/tests/call_creds.cc +++ b/test/core/end2end/tests/call_creds.cc @@ -62,7 +62,7 @@ void PrintAuthContext(bool is_client, const grpc_auth_context* ctx) { void TestRequestResponseWithPayloadAndCallCreds(CoreEnd2endTest& test, bool use_secure_call_creds) { - auto c = test.NewClientCall("/foo").Timeout(Duration::Seconds(5)).Create(); + auto c = test.NewClientCall("/foo").Timeout(Duration::Minutes(1)).Create(); grpc_call_credentials* creds; if (use_secure_call_creds) { creds = @@ -119,7 +119,7 @@ void TestRequestResponseWithPayloadAndCallCreds(CoreEnd2endTest& test, void TestRequestResponseWithPayloadAndOverriddenCallCreds( CoreEnd2endTest& test, bool use_secure_call_creds) { - auto c = test.NewClientCall("/foo").Timeout(Duration::Seconds(5)).Create(); + auto c = test.NewClientCall("/foo").Timeout(Duration::Minutes(1)).Create(); grpc_call_credentials* creds; if (use_secure_call_creds) { creds = @@ -185,7 +185,7 @@ void TestRequestResponseWithPayloadAndOverriddenCallCreds( void TestRequestResponseWithPayloadAndDeletedCallCreds( CoreEnd2endTest& test, bool use_secure_call_creds) { - auto c = test.NewClientCall("/foo").Timeout(Duration::Seconds(5)).Create(); + auto c = test.NewClientCall("/foo").Timeout(Duration::Minutes(1)).Create(); grpc_call_credentials* creds; if (use_secure_call_creds) { creds = @@ -242,7 +242,7 @@ CORE_END2END_TEST(PerCallCredsOnInsecureTest, RequestWithServerRejectingClientCreds) { InitClient(ChannelArgs()); InitServer(ChannelArgs().Set(FAIL_AUTH_CHECK_SERVER_ARG_NAME, true)); - auto c = NewClientCall("/foo").Timeout(Duration::Seconds(10)).Create(); + auto c = NewClientCall("/foo").Timeout(Duration::Minutes(1)).Create(); auto* creds = grpc_md_only_test_credentials_create(fake_md_key, fake_md_value); EXPECT_NE(creds, nullptr); From 3eca1888953cd9a3e0255fb1d392ed96cf51b291 Mon Sep 17 00:00:00 2001 From: Paulo Castello da Costa Date: Tue, 8 Aug 2023 17:55:56 -0700 Subject: [PATCH 142/205] [benchmark] Delete references to `node_purejs`. (#33970) There is only one supported implementation for performance benchmarks, so the name is unified to `node` (previously `node_purejs`). --- .../grpc_e2e_performance_gke_experiment.sh | 3 +- tools/run_tests/performance/README.md | 10 ++-- .../performance/build_performance.sh | 2 +- .../run_tests/performance/loadtest_config.py | 4 -- .../performance/loadtest_examples.sh | 4 -- .../run_tests/performance/scenario_config.py | 48 +++++-------------- tools/run_tests/run_performance_tests.py | 7 +-- 7 files changed, 22 insertions(+), 56 deletions(-) diff --git a/tools/internal_ci/linux/grpc_e2e_performance_gke_experiment.sh b/tools/internal_ci/linux/grpc_e2e_performance_gke_experiment.sh index aa2622593d69a..fc9fa238cb1c0 100755 --- a/tools/internal_ci/linux/grpc_e2e_performance_gke_experiment.sh +++ b/tools/internal_ci/linux/grpc_e2e_performance_gke_experiment.sh @@ -111,7 +111,6 @@ buildConfigs() { --prefix="${LOAD_TEST_PREFIX}" -u "${UNIQUE_IDENTIFIER}" -u "${pool}" \ -a pool="${pool}" --category=scalable \ --allow_client_language=c++ --allow_server_language=c++ \ - --allow_server_language=node \ -o "loadtest_with_prebuilt_workers_${pool}.yaml" } @@ -141,7 +140,7 @@ configLangArgs32core+=( -l java ) runnerLangArgs+=( -l "java:${GRPC_JAVA_REPO}:${GRPC_JAVA_COMMIT}" ) # node -configLangArgs8core+=( -l node_purejs ) # 8-core only. +configLangArgs8core+=( -l node ) # 8-core only. runnerLangArgs+=( -l "node:${GRPC_NODE_REPO}:${GRPC_NODE_COMMIT}" ) # python diff --git a/tools/run_tests/performance/README.md b/tools/run_tests/performance/README.md index ecf02842de09d..aa5aa1565d272 100644 --- a/tools/run_tests/performance/README.md +++ b/tools/run_tests/performance/README.md @@ -34,24 +34,26 @@ The following example counts scenarios in the `scalable` category: $ ./tools/run_tests/performance/scenario_config_exporter.py --count_scenarios --category=scalable Scenario count for all languages (category: scalable): Count Language Client Server Categories - 77 c++ scalable + 56 c++ scalable 19 python_asyncio scalable 16 java scalable 12 go scalable - 12 node node scalable - 12 node_purejs node scalable + 12 node scalable 9 csharp scalable + 9 dotnet scalable 7 python scalable 5 ruby scalable 4 csharp c++ scalable + 4 dotnet c++ scalable 4 php7 c++ scalable 4 php7_protobuf_c c++ scalable 3 python_asyncio c++ scalable 2 ruby c++ scalable 2 python c++ scalable 1 csharp c++ scalable + 1 dotnet c++ scalable - 189 total scenarios (category: scalable) + 170 total scenarios (category: scalable) ``` Client and server languages are only set for cross-language scenarios, where the diff --git a/tools/run_tests/performance/build_performance.sh b/tools/run_tests/performance/build_performance.sh index 4bf2186b26b9f..25b5f113d0c58 100755 --- a/tools/run_tests/performance/build_performance.sh +++ b/tools/run_tests/performance/build_performance.sh @@ -66,7 +66,7 @@ do # See https://github.com/grpc/grpc/issues/11581 (cd third_party/zlib; git checkout zconf.h) ;; - "node"|"node_purejs") + "node") tools/run_tests/performance/build_performance_node.sh ;; "python") diff --git a/tools/run_tests/performance/loadtest_config.py b/tools/run_tests/performance/loadtest_config.py index 0f5bd80cd388e..5ad1085c15175 100755 --- a/tools/run_tests/performance/loadtest_config.py +++ b/tools/run_tests/performance/loadtest_config.py @@ -47,10 +47,6 @@ def safe_name(language: str) -> str: """Returns a name that is safe to use in labels and file names.""" - # The language "node_purejs" differs from "node" only in the scenarios - # covered, so it is treated the same as "node". - if language == "node_purejs": - return scenario_config.LANGUAGES["node"].safename return scenario_config.LANGUAGES[language].safename diff --git a/tools/run_tests/performance/loadtest_examples.sh b/tools/run_tests/performance/loadtest_examples.sh index 271c8e456b569..4e7eb7c3ca08a 100755 --- a/tools/run_tests/performance/loadtest_examples.sh +++ b/tools/run_tests/performance/loadtest_examples.sh @@ -105,7 +105,6 @@ basic_example() { -s client_pool= -s server_pool= -s big_query_table= \ -s timeout_seconds=900 --prefix=examples -u basic -r "^${scenario}$" \ --allow_client_language=c++ --allow_server_language=c++ \ - --allow_server_language=node \ -o "${outputdir}/${outputfile}" echo "Created example: ${outputdir}/${outputfile}" } @@ -127,7 +126,6 @@ prebuilt_example() { -s prebuilt_image_tag="\${prebuilt_image_tag}" --prefix=examples -u prebuilt \ -a pool="\${workers_pool}" -r "^${scenario}$" \ --allow_client_language=c++ --allow_server_language=c++ \ - --allow_server_language=node \ -o "${outputdir}/${outputfile}" echo "Created example: ${outputdir}/${outputfile}" } @@ -150,7 +148,6 @@ psm_basic_example() { -s timeout_seconds=900 --prefix=psm-examples -u "${uniquifier}" -r "^${scenario}$" \ -a enablePrometheus=true \ --allow_client_language=c++ --allow_server_language=c++ \ - --allow_server_language=node \ --client_channels=8 \ --category=psm \ --server_threads=16 \ @@ -181,7 +178,6 @@ psm_prebuilt_example() { -a pool="\${workers_pool}" \ -a enablePrometheus=true \ --allow_client_language=c++ --allow_server_language=c++ \ - --allow_server_language=node \ --client_channels=8 \ --category=psm \ --server_threads=16 \ diff --git a/tools/run_tests/performance/scenario_config.py b/tools/run_tests/performance/scenario_config.py index c199e571046f1..1bbc7618693d4 100644 --- a/tools/run_tests/performance/scenario_config.py +++ b/tools/run_tests/performance/scenario_config.py @@ -1659,12 +1659,8 @@ def __str__(self): class NodeLanguage(Language): - def __init__(self, node_purejs=False): - super().__init__() - self.node_purejs = node_purejs - def worker_cmdline(self): - fixture = "native_js" if self.node_purejs else "native_native" + fixture = "js_js" return [ "tools/run_tests/performance/run_worker_node.sh", fixture, @@ -1672,20 +1668,14 @@ def worker_cmdline(self): ] def worker_port_offset(self): - if self.node_purejs: - return 1100 - return 1000 + return 1100 def scenarios(self): - node_implementation = "node_purejs" if self.node_purejs else "node" - yield _ping_pong_scenario( - "%s_to_node_protobuf_async_unary_5000rpcs_1KB_psm" - % (node_implementation), + "node_to_node_protobuf_async_unary_5000rpcs_1KB_psm", rpc_type="UNARY", client_type="ASYNC_CLIENT", server_type="ASYNC_SERVER", - server_language="node", req_size=1024, resp_size=1024, outstanding=5000, @@ -1701,12 +1691,10 @@ def scenarios(self): smoketest_categories = ([SMOKETEST] if secure else []) + [SCALABLE] yield _ping_pong_scenario( - "%s_to_node_generic_async_streaming_ping_pong_%s" - % (node_implementation, secstr), + "node_to_node_generic_async_streaming_ping_pong_%s" % secstr, rpc_type="STREAMING", client_type="ASYNC_CLIENT", server_type="ASYNC_GENERIC_SERVER", - server_language="node", use_generic_payload=True, async_server_threads=1, secure=secure, @@ -1714,59 +1702,52 @@ def scenarios(self): ) yield _ping_pong_scenario( - "%s_to_node_protobuf_async_streaming_ping_pong_%s" - % (node_implementation, secstr), + "node_to_node_protobuf_async_streaming_ping_pong_%s" % secstr, rpc_type="STREAMING", client_type="ASYNC_CLIENT", server_type="ASYNC_SERVER", - server_language="node", async_server_threads=1, secure=secure, ) yield _ping_pong_scenario( - "%s_to_node_protobuf_async_unary_ping_pong_%s" - % (node_implementation, secstr), + "node_to_node_protobuf_async_unary_ping_pong_%s" % secstr, rpc_type="UNARY", client_type="ASYNC_CLIENT", server_type="ASYNC_SERVER", - server_language="node", async_server_threads=1, secure=secure, categories=smoketest_categories, ) yield _ping_pong_scenario( - "%s_to_node_protobuf_async_unary_qps_unconstrained_%s" - % (node_implementation, secstr), + "node_to_node_protobuf_async_unary_qps_unconstrained_%s" + % secstr, rpc_type="UNARY", client_type="ASYNC_CLIENT", server_type="ASYNC_SERVER", - server_language="node", unconstrained_client="async", secure=secure, categories=smoketest_categories + [SCALABLE], ) yield _ping_pong_scenario( - "%s_to_node_protobuf_async_streaming_qps_unconstrained_%s" - % (node_implementation, secstr), + "node_to_node_protobuf_async_streaming_qps_unconstrained_%s" + % secstr, rpc_type="STREAMING", client_type="ASYNC_CLIENT", server_type="ASYNC_SERVER", - server_language="node", unconstrained_client="async", secure=secure, categories=[SCALABLE], ) yield _ping_pong_scenario( - "%s_to_node_generic_async_streaming_qps_unconstrained_%s" - % (node_implementation, secstr), + "node_to_node_generic_async_streaming_qps_unconstrained_%s" + % secstr, rpc_type="STREAMING", client_type="ASYNC_CLIENT", server_type="ASYNC_GENERIC_SERVER", - server_language="node", unconstrained_client="async", use_generic_payload=True, secure=secure, @@ -1776,8 +1757,6 @@ def scenarios(self): # TODO(murgatroid99): add scenarios node vs C++ def __str__(self): - if self.node_purejs: - return "node_purejs" return "node" @@ -1792,6 +1771,5 @@ def __str__(self): "python": PythonLanguage(), "python_asyncio": PythonAsyncIOLanguage(), "go": GoLanguage(), - "node": NodeLanguage(), - "node_purejs": NodeLanguage(node_purejs=True), + "node": NodeLanguage(), # 'node' means 'node_purejs'. } diff --git a/tools/run_tests/run_performance_tests.py b/tools/run_tests/run_performance_tests.py index 606d26778e3dc..808bc0a30bf84 100755 --- a/tools/run_tests/run_performance_tests.py +++ b/tools/run_tests/run_performance_tests.py @@ -20,16 +20,11 @@ import collections import itertools import json -import multiprocessing import os import pipes import re -import subprocess import sys -import tempfile import time -import traceback -import uuid import six @@ -216,7 +211,7 @@ def archive_repo(languages): cmdline.append("../grpc-java") if "go" in languages: cmdline.append("../grpc-go") - if "node" in languages or "node_purejs" in languages: + if "node" in languages: cmdline.append("../grpc-node") archive_job = jobset.JobSpec( From b1aaf190d703a6cb6fe300979af66aee32bdf18c Mon Sep 17 00:00:00 2001 From: Paulo Castello da Costa Date: Tue, 8 Aug 2023 17:56:26 -0700 Subject: [PATCH 143/205] [benchmark] Add node benchmarks to main job. (#33976) Experimental job is passing after adding node benchmarks: https://github.com/grpc/grpc/pull/33963. Adding node benchmarks to the main kokoro job. --- tools/internal_ci/linux/grpc_e2e_performance_gke.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/internal_ci/linux/grpc_e2e_performance_gke.sh b/tools/internal_ci/linux/grpc_e2e_performance_gke.sh index 1bd85eece4882..fdaa2a4e9c7be 100755 --- a/tools/internal_ci/linux/grpc_e2e_performance_gke.sh +++ b/tools/internal_ci/linux/grpc_e2e_performance_gke.sh @@ -30,6 +30,8 @@ GRPC_GO_REPO=grpc/grpc-go GRPC_GO_GITREF=master GRPC_JAVA_REPO=grpc/grpc-java GRPC_JAVA_GITREF=master +GRPC_NODE_REPO=grpc/grpc-node +GRPC_NODE_GITREF=master TEST_INFRA_REPO=grpc/test-infra TEST_INFRA_GITREF=master @@ -73,6 +75,7 @@ fi GRPC_DOTNET_COMMIT="$(git ls-remote "https://github.com/${GRPC_DOTNET_REPO}.git" "${GRPC_DOTNET_GITREF}" | cut -f1)" GRPC_GO_COMMIT="$(git ls-remote "https://github.com/${GRPC_GO_REPO}.git" "${GRPC_GO_GITREF}" | cut -f1)" GRPC_JAVA_COMMIT="$(git ls-remote "https://github.com/${GRPC_JAVA_REPO}.git" "${GRPC_JAVA_GITREF}" | cut -f1)" +GRPC_NODE_COMMIT="$(git ls-remote "https://github.com/${GRPC_NODE_REPO}.git" "${GRPC_NODE_GITREF}" | cut -f1)" # Kokoro jobs run on dedicated pools. DRIVER_POOL=drivers-ci WORKER_POOL_8CORE=workers-c2-8core-ci @@ -142,6 +145,10 @@ configLangArgs8core+=( -l java ) configLangArgs32core+=( -l java ) runnerLangArgs+=( -l "java:${GRPC_JAVA_REPO}:${GRPC_JAVA_COMMIT}" ) +# node +configLangArgs8core+=( -l node ) # 8-core only. +runnerLangArgs+=( -l "node:${GRPC_NODE_REPO}:${GRPC_NODE_COMMIT}" ) + # python configLangArgs8core+=( -l python ) # 8-core only. runnerLangArgs+=( -l "python:${GRPC_CORE_REPO}:${GRPC_CORE_COMMIT}" ) From 5ad0bfc7c7e5fe7270389a75a9dde41b4d4ab292 Mon Sep 17 00:00:00 2001 From: Sergii Tkachenko Date: Wed, 9 Aug 2023 14:04:53 -0400 Subject: [PATCH 144/205] [PSM Interop] Bump pip kubernetes to 27.2 (#34017) I was hoping this would solve the issue with `DeprecationWarning: HTTPResponse.getheaders() is deprecated`, but it didn't. Anyway, we should be updating this from time to time. Changelog: https://github.com/kubernetes-client/python/blob/release-27.0/CHANGELOG.md The client library changes from `25.3.0` to `27.2.0` are minimal. The majority of the changelog is API updates pulled from k8s upstream. --- tools/run_tests/xds_k8s_test_driver/requirements.lock | 2 +- tools/run_tests/xds_k8s_test_driver/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/run_tests/xds_k8s_test_driver/requirements.lock b/tools/run_tests/xds_k8s_test_driver/requirements.lock index ec250a9ba19e8..3795027a910f2 100644 --- a/tools/run_tests/xds_k8s_test_driver/requirements.lock +++ b/tools/run_tests/xds_k8s_test_driver/requirements.lock @@ -7,7 +7,7 @@ grpcio==1.51.1 grpcio-health-checking==1.48.2 grpcio-tools==1.48.2 grpcio-channelz==1.48.2 -kubernetes==25.3.0 +kubernetes==27.2.0 six==1.16.0 tenacity==6.3.1 packaging==21.3 diff --git a/tools/run_tests/xds_k8s_test_driver/requirements.txt b/tools/run_tests/xds_k8s_test_driver/requirements.txt index 1f3122055ca44..0527864fd9e29 100644 --- a/tools/run_tests/xds_k8s_test_driver/requirements.txt +++ b/tools/run_tests/xds_k8s_test_driver/requirements.txt @@ -7,7 +7,7 @@ grpcio~=1.34 grpcio-health-checking~=1.34 grpcio-tools~=1.34 grpcio-channelz~=1.34 -kubernetes~=25.0 +kubernetes~=27.2 six~=1.13 tenacity~=6.2 packaging~=21.3 From 2e2f5c9ba68073ce86d13976060f5a70cd18ceb2 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 9 Aug 2023 11:08:25 -0700 Subject: [PATCH 145/205] [fuzzer] Fix another deadline exceeded case (#34015) --- ..._recv_message_fuzzer-5727190958276608.test | 870 ++++++++++++++++++ test/core/end2end/tests/retry_recv_message.cc | 2 +- 2 files changed, 871 insertions(+), 1 deletion(-) create mode 100644 test/core/end2end/end2end_test_corpus/retry_recv_message/clusterfuzz-testcase-minimized-retry_recv_message_fuzzer-5727190958276608.test diff --git a/test/core/end2end/end2end_test_corpus/retry_recv_message/clusterfuzz-testcase-minimized-retry_recv_message_fuzzer-5727190958276608.test b/test/core/end2end/end2end_test_corpus/retry_recv_message/clusterfuzz-testcase-minimized-retry_recv_message_fuzzer-5727190958276608.test new file mode 100644 index 0000000000000..99053054cb725 --- /dev/null +++ b/test/core/end2end/end2end_test_corpus/retry_recv_message/clusterfuzz-testcase-minimized-retry_recv_message_fuzzer-5727190958276608.test @@ -0,0 +1,870 @@ +test_id: 55 +event_engine_actions { + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 1 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 29554928389193728 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 3328 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 0 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834579968 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 5583457484834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 3328 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834579968 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 55834574848 + run_delay: 7602334 + connections { + write_size: 0 + write_size: 93 + write_size: 64 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 32768 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 262144 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 249 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 55 + write_size: 0 + write_size: 0 + write_size: 2 + write_size: 536879104 + write_size: 0 + } + connections { + write_size: 52 + write_size: 0 + write_size: 93 + write_size: 64 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 32768 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 262144 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 249 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 2 + write_size: 0 + } +} diff --git a/test/core/end2end/tests/retry_recv_message.cc b/test/core/end2end/tests/retry_recv_message.cc index cee5ddfa81d16..bf231e59e3dad 100644 --- a/test/core/end2end/tests/retry_recv_message.cc +++ b/test/core/end2end/tests/retry_recv_message.cc @@ -52,7 +52,7 @@ CORE_END2END_TEST(RetryTest, RetryRecvMessage) { " } ]\n" "}")); auto c = - NewClientCall("/service/method").Timeout(Duration::Seconds(5)).Create(); + NewClientCall("/service/method").Timeout(Duration::Minutes(1)).Create(); EXPECT_NE(c.GetPeer(), absl::nullopt); IncomingMessage server_message; IncomingMetadata server_initial_metadata; From 6fadb994ef6f927f541a6b8954b143a29a90eb43 Mon Sep 17 00:00:00 2001 From: Eugene Ostroukhov Date: Wed, 9 Aug 2023 14:16:12 -0700 Subject: [PATCH 146/205] [PSM Interop] Report per-RPC metadata if requested. (#33939) --- .clang-format | 4 ++ src/proto/grpc/testing/messages.proto | 22 ++++++- test/cpp/interop/xds_interop_client.cc | 25 ++++--- test/cpp/interop/xds_stats_watcher.cc | 51 +++++++++++--- test/cpp/interop/xds_stats_watcher.h | 14 ++-- test/cpp/interop/xds_stats_watcher_test.cc | 77 ++++++++++++++++------ 6 files changed, 147 insertions(+), 46 deletions(-) diff --git a/.clang-format b/.clang-format index 608eea1405663..64387e9e51527 100644 --- a/.clang-format +++ b/.clang-format @@ -46,4 +46,8 @@ Language: ObjC BasedOnStyle: Google ColumnLimit: 100 ObjCBlockIndentWidth: 2 +--- +Language: Proto +BasedOnStyle: Google +ColumnLimit: 100 ... diff --git a/src/proto/grpc/testing/messages.proto b/src/proto/grpc/testing/messages.proto index 33d07f47fddef..d948ef6a929ce 100644 --- a/src/proto/grpc/testing/messages.proto +++ b/src/proto/grpc/testing/messages.proto @@ -103,9 +103,6 @@ message SimpleRequest { // If set the server should record this metrics report data for the current RPC. TestOrcaReport orca_per_query_report = 11; - - // If set the server should update this metrics report data at the OOB server. - TestOrcaReport orca_oob_report = 12; } // Unary response, as configured by the request. @@ -210,9 +207,26 @@ message LoadBalancerStatsRequest { int32 num_rpcs = 1; // If num_rpcs have not completed within timeout_sec, return partial results. int32 timeout_sec = 2; + // response header+trailer we want the values of + repeated string metadata_keys = 3; } message LoadBalancerStatsResponse { + message MetadataEntry { + string key = 1; + string value = 2; + } + message RpcMetadata { + // metadata values for each rpc for the keys specified in + // LoadBalancerStatsRequest.metadata_keys. + // metadata keys and values are returned exactly as was recieved + // from the server. + repeated MetadataEntry metadata = 1; + } + message MetadataByPeer { + // List of RpcMetadata in for each RPC with a given peer + repeated RpcMetadata rpc_metadata = 1; + } message RpcsByPeer { // The number of completed RPCs for each peer. map rpcs_by_peer = 1; @@ -222,6 +236,8 @@ message LoadBalancerStatsResponse { // The number of RPCs that failed to record a remote peer. int32 num_failures = 2; map rpcs_by_method = 3; + // All the metadata of all RPCs for each peer. + map metadatas_by_peer = 4; } // Request for retrieving a test client's accumulated stats. diff --git a/test/cpp/interop/xds_interop_client.cc b/test/cpp/interop/xds_interop_client.cc index e8df4a40b2185..1f6cf9b8332b3 100644 --- a/test/cpp/interop/xds_interop_client.cc +++ b/test/cpp/interop/xds_interop_client.cc @@ -21,16 +21,19 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include "absl/algorithm/container.h" #include "absl/flags/flag.h" #include "absl/strings/str_split.h" +#include "google/protobuf/repeated_ptr_field.h" #include #include @@ -206,7 +209,8 @@ class TestClient { metadata_hostname->second.length()) : call->result.simple_response.hostname(); for (auto watcher : stats_watchers_->watchers) { - watcher->RpcCompleted(call->result, hostname); + watcher->RpcCompleted(call->result, hostname, + call->context.GetServerInitialMetadata()); } } @@ -265,20 +269,22 @@ class LoadBalancerStatsServiceImpl : public LoadBalancerStatsService::Service { LoadBalancerStatsResponse* response) override { int start_id; int end_id; - XdsStatsWatcher* watcher; + std::unique_ptr watcher; { std::lock_guard lock(stats_watchers_->mu); start_id = stats_watchers_->global_request_id + 1; end_id = start_id + request->num_rpcs(); - watcher = new XdsStatsWatcher(start_id, end_id); - stats_watchers_->watchers.insert(watcher); + watcher = std::make_unique( + start_id, end_id, + std::vector(request->metadata_keys().begin(), + request->metadata_keys().end())); + stats_watchers_->watchers.insert(watcher.get()); } - watcher->WaitForRpcStatsResponse(response, request->timeout_sec()); + *response = watcher->WaitForRpcStatsResponse(request->timeout_sec()); { std::lock_guard lock(stats_watchers_->mu); - stats_watchers_->watchers.erase(watcher); + stats_watchers_->watchers.erase(watcher.get()); } - delete watcher; return Status::OK; } @@ -356,8 +362,7 @@ void RunTestLoop(std::chrono::duration duration_per_query, std::vector configs; while (true) { { - std::lock_guard lockk( - rpc_configs_queue->mu_rpc_configs_queue); + std::lock_guard lock(rpc_configs_queue->mu_rpc_configs_queue); if (!rpc_configs_queue->rpc_configs_queue.empty()) { configs = std::move(rpc_configs_queue->rpc_configs_queue.front()); rpc_configs_queue->rpc_configs_queue.pop_front(); @@ -464,7 +469,7 @@ int main(int argc, char** argv) { { std::lock_guard lock(stats_watchers.mu); - stats_watchers.global_watcher = new XdsStatsWatcher(0, 0); + stats_watchers.global_watcher = new XdsStatsWatcher(0, 0, {}); stats_watchers.watchers.insert(stats_watchers.global_watcher); } diff --git a/test/cpp/interop/xds_stats_watcher.cc b/test/cpp/interop/xds_stats_watcher.cc index e6b1f80908e32..1a5dec9063f0c 100644 --- a/test/cpp/interop/xds_stats_watcher.cc +++ b/test/cpp/interop/xds_stats_watcher.cc @@ -19,11 +19,36 @@ namespace grpc { namespace testing { -XdsStatsWatcher::XdsStatsWatcher(int start_id, int end_id) - : start_id_(start_id), end_id_(end_id), rpcs_needed_(end_id - start_id) {} +namespace { -void XdsStatsWatcher::RpcCompleted(const AsyncClientCallResult& call, - const std::string& peer) { +LoadBalancerStatsResponse::RpcMetadata BuildRpcMetadata( + absl::Span metadata_keys, + const std::multimap& initial_metadata) { + LoadBalancerStatsResponse::RpcMetadata rpc_metadata; + for (const auto& key : metadata_keys) { + auto matching = initial_metadata.equal_range(key); + for (auto value = matching.first; value != matching.second; ++value) { + auto entry = rpc_metadata.add_metadata(); + entry->set_key(key); + entry->set_value( + absl::string_view(value->second.data(), value->second.length())); + } + } + return rpc_metadata; +} + +} // namespace + +XdsStatsWatcher::XdsStatsWatcher(int start_id, int end_id, + absl::Span metadata_keys) + : start_id_(start_id), + end_id_(end_id), + rpcs_needed_(end_id - start_id), + metadata_keys_(metadata_keys.begin(), metadata_keys.end()) {} + +void XdsStatsWatcher::RpcCompleted( + const AsyncClientCallResult& call, const std::string& peer, + const std::multimap& initial_metadata) { // We count RPCs for global watcher or if the request_id falls into the // watcher's interested range of request ids. if ((start_id_ == 0 && end_id_ == 0) || @@ -37,6 +62,8 @@ void XdsStatsWatcher::RpcCompleted(const AsyncClientCallResult& call, // RPC is counted into both per-peer bin and per-method-per-peer bin. rpcs_by_peer_[peer]++; rpcs_by_type_[call.rpc_type][peer]++; + *metadata_by_peer_[peer].add_rpc_metadata() = + BuildRpcMetadata(metadata_keys_, initial_metadata); } rpcs_needed_--; // Report accumulated stats. @@ -55,14 +82,17 @@ void XdsStatsWatcher::RpcCompleted(const AsyncClientCallResult& call, } } -void XdsStatsWatcher::WaitForRpcStatsResponse( - LoadBalancerStatsResponse* response, int timeout_sec) { +LoadBalancerStatsResponse XdsStatsWatcher::WaitForRpcStatsResponse( + int timeout_sec) { + LoadBalancerStatsResponse response; std::unique_lock lock(m_); cv_.wait_for(lock, std::chrono::seconds(timeout_sec), [this] { return rpcs_needed_ == 0; }); - response->mutable_rpcs_by_peer()->insert(rpcs_by_peer_.begin(), - rpcs_by_peer_.end()); - auto& response_rpcs_by_method = *response->mutable_rpcs_by_method(); + response.mutable_rpcs_by_peer()->insert(rpcs_by_peer_.begin(), + rpcs_by_peer_.end()); + response.mutable_metadatas_by_peer()->insert(metadata_by_peer_.begin(), + metadata_by_peer_.end()); + auto& response_rpcs_by_method = *response.mutable_rpcs_by_method(); for (const auto& rpc_by_type : rpcs_by_type_) { std::string method_name; if (rpc_by_type.first == ClientConfigureRequest::EMPTY_CALL) { @@ -83,7 +113,8 @@ void XdsStatsWatcher::WaitForRpcStatsResponse( response_rpc_by_peer = rpc_by_peer.second; } } - response->set_num_failures(no_remote_peer_ + rpcs_needed_); + response.set_num_failures(no_remote_peer_ + rpcs_needed_); + return response; } void XdsStatsWatcher::GetCurrentRpcStats( diff --git a/test/cpp/interop/xds_stats_watcher.h b/test/cpp/interop/xds_stats_watcher.h index a5917104f2b85..6bce6e64fdb5b 100644 --- a/test/cpp/interop/xds_stats_watcher.h +++ b/test/cpp/interop/xds_stats_watcher.h @@ -32,6 +32,7 @@ #include #include "absl/status/status.h" +#include "absl/types/span.h" #include @@ -68,15 +69,17 @@ struct StatsWatchers { /// Records the remote peer distribution for a given range of RPCs. class XdsStatsWatcher { public: - XdsStatsWatcher(int start_id, int end_id); + XdsStatsWatcher(int start_id, int end_id, + absl::Span metadata_keys); // Upon the completion of an RPC, we will look at the request_id, the // rpc_type, and the peer the RPC was sent to in order to count // this RPC into the right stats bin. - void RpcCompleted(const AsyncClientCallResult& call, const std::string& peer); + void RpcCompleted(const AsyncClientCallResult& call, const std::string& peer, + const std::multimap& + initial_metadata); - void WaitForRpcStatsResponse(LoadBalancerStatsResponse* response, - int timeout_sec); + LoadBalancerStatsResponse WaitForRpcStatsResponse(int timeout_sec); void GetCurrentRpcStats(LoadBalancerAccumulatedStatsResponse* response, StatsWatchers* stats_watchers); @@ -96,6 +99,9 @@ class XdsStatsWatcher { LoadBalancerAccumulatedStatsResponse accumulated_stats_; std::mutex m_; std::condition_variable cv_; + std::vector metadata_keys_; + std::map + metadata_by_peer_; }; } // namespace testing diff --git a/test/cpp/interop/xds_stats_watcher_test.cc b/test/cpp/interop/xds_stats_watcher_test.cc index 63967095e7f4a..4340a51b2d9b3 100644 --- a/test/cpp/interop/xds_stats_watcher_test.cc +++ b/test/cpp/interop/xds_stats_watcher_test.cc @@ -29,6 +29,7 @@ namespace grpc { namespace testing { namespace { + AsyncClientCallResult BuildCallResult(int saved_request_id) { AsyncClientCallResult result; result.saved_request_id = saved_request_id; @@ -36,25 +37,63 @@ AsyncClientCallResult BuildCallResult(int saved_request_id) { return result; } -TEST(XdsStatsWatcherTest, CollectsMetadata) { - XdsStatsWatcher watcher(0, 3); - watcher.RpcCompleted(BuildCallResult(0), "peer1"); - watcher.RpcCompleted(BuildCallResult(1), "peer1"); - watcher.RpcCompleted(BuildCallResult(2), "peer2"); - LoadBalancerStatsResponse lb_response; - watcher.WaitForRpcStatsResponse(&lb_response, 1); - EXPECT_EQ( - (std::multimap(lb_response.rpcs_by_peer().begin(), - lb_response.rpcs_by_peer().end())), - (std::multimap({{"peer1", 2}, {"peer2", 1}}))); - EXPECT_EQ(lb_response.rpcs_by_method_size(), 1); - auto rpcs = lb_response.rpcs_by_method().find("UnaryCall"); - EXPECT_NE(rpcs, lb_response.rpcs_by_method().end()); - std::multimap by_peer( - rpcs->second.rpcs_by_peer().begin(), rpcs->second.rpcs_by_peer().end()); - EXPECT_EQ( - by_peer, - (std::multimap({{"peer1", 2}, {"peer2", 1}}))); +LoadBalancerStatsResponse::MetadataByPeer BuildMetadatas( + const std::initializer_list< + std::initializer_list>>& values) { + LoadBalancerStatsResponse::MetadataByPeer metadata_by_peer; + for (const auto& per_rpc : values) { + auto rpc_metadata = metadata_by_peer.add_rpc_metadata(); + for (const auto& key_value : per_rpc) { + auto entry = rpc_metadata->add_metadata(); + entry->set_key(key_value.first); + entry->set_value(key_value.second); + } + } + return metadata_by_peer; +} + +TEST(XdsStatsWatcherTest, WaitForRpcStatsResponse) { + // "k3" will be ignored + XdsStatsWatcher watcher(0, 3, {"k1", "k2"}); + watcher.RpcCompleted(BuildCallResult(0), "peer1", + {{"k1", "v1"}, {"k2", "v2"}, {"k3", "v3"}}); + watcher.RpcCompleted(BuildCallResult(1), "peer1", {{"k1", "v4"}}); + watcher.RpcCompleted(BuildCallResult(2), "peer2", + {{"k1", "v5"}, {"k2", "v6"}, {"k3", "v7"}}); + LoadBalancerStatsResponse expected; + expected.mutable_rpcs_by_peer()->insert({{"peer1", 2}, {"peer2", 1}}); + expected.mutable_metadatas_by_peer()->insert({ + {"peer1", BuildMetadatas({{{"k1", "v1"}, {"k2", "v2"}}, {{"k1", "v4"}}})}, + {"peer2", BuildMetadatas({{{"k1", "v5"}, {"k2", "v6"}}})}, + }); + (*expected.mutable_rpcs_by_method())["UnaryCall"] + .mutable_rpcs_by_peer() + ->insert({{"peer1", 2}, {"peer2", 1}}); + EXPECT_EQ(watcher.WaitForRpcStatsResponse(0).DebugString(), + expected.DebugString()); +} + +TEST(XdsStatsWatcherTest, WaitForRpcStatsResponseIgnoresMetadata) { + XdsStatsWatcher watcher(0, 3, {}); + // RPC had metadata - but watcher should ignore it + watcher.RpcCompleted(BuildCallResult(0), "peer1", + {{"k1", "v1"}, {"k2", "v2"}, {"k3", "v3"}}); + // No metadata came with RPC + watcher.RpcCompleted(BuildCallResult(1), "peer1", {}); + watcher.RpcCompleted(BuildCallResult(2), "peer2", + {{"k1", "v5"}, {"k2", "v6"}, {"k3", "v7"}}); + LoadBalancerStatsResponse expected; + expected.mutable_rpcs_by_peer()->insert({{"peer1", 2}, {"peer2", 1}}); + // There will still be an empty metadata collection for each RPC + expected.mutable_metadatas_by_peer()->insert({ + {"peer1", BuildMetadatas({{}, {}})}, + {"peer2", BuildMetadatas({{}})}, + }); + (*expected.mutable_rpcs_by_method())["UnaryCall"] + .mutable_rpcs_by_peer() + ->insert({{"peer1", 2}, {"peer2", 1}}); + EXPECT_EQ(watcher.WaitForRpcStatsResponse(0).DebugString(), + expected.DebugString()); } } // namespace From e076acd96bf87982f53ffd319fcff13b85cedfad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Aug 2023 14:31:57 -0700 Subject: [PATCH 147/205] [dependencies] Bump certifi from 2017.4.17 to 2023.7.22 (#33855) Bumps [certifi](https://github.com/certifi/python-certifi) from 2017.4.17 to 2023.7.22.
Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=certifi&package-manager=pip&previous-version=2017.4.17&new-version=2023.7.22)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/grpc/grpc/network/alerts).
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements.bazel.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.bazel.txt b/requirements.bazel.txt index b42c8f63bd768..851dbd15a38da 100644 --- a/requirements.bazel.txt +++ b/requirements.bazel.txt @@ -7,7 +7,7 @@ oauth2client==4.1.0 requests==2.25.1 urllib3==1.26.5 chardet==3.0.4 -certifi==2017.4.17 +certifi==2023.7.22 idna==2.7 gevent==22.08.0 zope.event==4.5.0 From df9ec2b0f0e368cf2a1e3017ae92a68b0674f177 Mon Sep 17 00:00:00 2001 From: Sparkling Diva <30467496+SilverBzH@users.noreply.github.com> Date: Wed, 9 Aug 2023 14:32:33 -0700 Subject: [PATCH 148/205] [Aio] use timeout instead of deadline for intercepted call creation (#33951) Intercepted call class expect a timeout as parameters but a deadline is provided instead. Only the UnaryUnary class is correctly created with a timeout while the others remains with the deadlines. This commit fix the instanciation of the other ones. --- src/python/grpcio/grpc/aio/_channel.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/python/grpcio/grpc/aio/_channel.py b/src/python/grpcio/grpc/aio/_channel.py index 19c263c41f4d8..7e818a15c6c87 100644 --- a/src/python/grpcio/grpc/aio/_channel.py +++ b/src/python/grpcio/grpc/aio/_channel.py @@ -188,12 +188,11 @@ def __call__( compression: Optional[grpc.Compression] = None, ) -> _base_call.UnaryStreamCall[RequestType, ResponseType]: metadata = self._init_metadata(metadata, compression) - deadline = _timeout_to_deadline(timeout) if not self._interceptors: call = UnaryStreamCall( request, - deadline, + _timeout_to_deadline(timeout), metadata, credentials, wait_for_ready, @@ -207,7 +206,7 @@ def __call__( call = InterceptedUnaryStreamCall( self._interceptors, request, - deadline, + timeout, metadata, credentials, wait_for_ready, @@ -234,12 +233,11 @@ def __call__( compression: Optional[grpc.Compression] = None, ) -> _base_call.StreamUnaryCall: metadata = self._init_metadata(metadata, compression) - deadline = _timeout_to_deadline(timeout) if not self._interceptors: call = StreamUnaryCall( request_iterator, - deadline, + _timeout_to_deadline(timeout), metadata, credentials, wait_for_ready, @@ -253,7 +251,7 @@ def __call__( call = InterceptedStreamUnaryCall( self._interceptors, request_iterator, - deadline, + timeout, metadata, credentials, wait_for_ready, @@ -280,12 +278,11 @@ def __call__( compression: Optional[grpc.Compression] = None, ) -> _base_call.StreamStreamCall: metadata = self._init_metadata(metadata, compression) - deadline = _timeout_to_deadline(timeout) if not self._interceptors: call = StreamStreamCall( request_iterator, - deadline, + _timeout_to_deadline(timeout), metadata, credentials, wait_for_ready, @@ -299,7 +296,7 @@ def __call__( call = InterceptedStreamStreamCall( self._interceptors, request_iterator, - deadline, + timeout, metadata, credentials, wait_for_ready, From fc9a1ccaedd4bad6d4e0389d33f16d0d01d0c108 Mon Sep 17 00:00:00 2001 From: Eugene Ostroukhov Date: Wed, 9 Aug 2023 16:23:12 -0700 Subject: [PATCH 149/205] [PSM Interop] Revert "Report per-RPC metadata if requested. (#33939)" (#34028) This reverts commit 6fadb994ef6f927f541a6b8954b143a29a90eb43. --- .clang-format | 4 -- src/proto/grpc/testing/messages.proto | 22 +------ test/cpp/interop/xds_interop_client.cc | 25 +++---- test/cpp/interop/xds_stats_watcher.cc | 51 +++----------- test/cpp/interop/xds_stats_watcher.h | 14 ++-- test/cpp/interop/xds_stats_watcher_test.cc | 77 ++++++---------------- 6 files changed, 46 insertions(+), 147 deletions(-) diff --git a/.clang-format b/.clang-format index 64387e9e51527..608eea1405663 100644 --- a/.clang-format +++ b/.clang-format @@ -46,8 +46,4 @@ Language: ObjC BasedOnStyle: Google ColumnLimit: 100 ObjCBlockIndentWidth: 2 ---- -Language: Proto -BasedOnStyle: Google -ColumnLimit: 100 ... diff --git a/src/proto/grpc/testing/messages.proto b/src/proto/grpc/testing/messages.proto index d948ef6a929ce..33d07f47fddef 100644 --- a/src/proto/grpc/testing/messages.proto +++ b/src/proto/grpc/testing/messages.proto @@ -103,6 +103,9 @@ message SimpleRequest { // If set the server should record this metrics report data for the current RPC. TestOrcaReport orca_per_query_report = 11; + + // If set the server should update this metrics report data at the OOB server. + TestOrcaReport orca_oob_report = 12; } // Unary response, as configured by the request. @@ -207,26 +210,9 @@ message LoadBalancerStatsRequest { int32 num_rpcs = 1; // If num_rpcs have not completed within timeout_sec, return partial results. int32 timeout_sec = 2; - // response header+trailer we want the values of - repeated string metadata_keys = 3; } message LoadBalancerStatsResponse { - message MetadataEntry { - string key = 1; - string value = 2; - } - message RpcMetadata { - // metadata values for each rpc for the keys specified in - // LoadBalancerStatsRequest.metadata_keys. - // metadata keys and values are returned exactly as was recieved - // from the server. - repeated MetadataEntry metadata = 1; - } - message MetadataByPeer { - // List of RpcMetadata in for each RPC with a given peer - repeated RpcMetadata rpc_metadata = 1; - } message RpcsByPeer { // The number of completed RPCs for each peer. map rpcs_by_peer = 1; @@ -236,8 +222,6 @@ message LoadBalancerStatsResponse { // The number of RPCs that failed to record a remote peer. int32 num_failures = 2; map rpcs_by_method = 3; - // All the metadata of all RPCs for each peer. - map metadatas_by_peer = 4; } // Request for retrieving a test client's accumulated stats. diff --git a/test/cpp/interop/xds_interop_client.cc b/test/cpp/interop/xds_interop_client.cc index 1f6cf9b8332b3..e8df4a40b2185 100644 --- a/test/cpp/interop/xds_interop_client.cc +++ b/test/cpp/interop/xds_interop_client.cc @@ -21,19 +21,16 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include "absl/algorithm/container.h" #include "absl/flags/flag.h" #include "absl/strings/str_split.h" -#include "google/protobuf/repeated_ptr_field.h" #include #include @@ -209,8 +206,7 @@ class TestClient { metadata_hostname->second.length()) : call->result.simple_response.hostname(); for (auto watcher : stats_watchers_->watchers) { - watcher->RpcCompleted(call->result, hostname, - call->context.GetServerInitialMetadata()); + watcher->RpcCompleted(call->result, hostname); } } @@ -269,22 +265,20 @@ class LoadBalancerStatsServiceImpl : public LoadBalancerStatsService::Service { LoadBalancerStatsResponse* response) override { int start_id; int end_id; - std::unique_ptr watcher; + XdsStatsWatcher* watcher; { std::lock_guard lock(stats_watchers_->mu); start_id = stats_watchers_->global_request_id + 1; end_id = start_id + request->num_rpcs(); - watcher = std::make_unique( - start_id, end_id, - std::vector(request->metadata_keys().begin(), - request->metadata_keys().end())); - stats_watchers_->watchers.insert(watcher.get()); + watcher = new XdsStatsWatcher(start_id, end_id); + stats_watchers_->watchers.insert(watcher); } - *response = watcher->WaitForRpcStatsResponse(request->timeout_sec()); + watcher->WaitForRpcStatsResponse(response, request->timeout_sec()); { std::lock_guard lock(stats_watchers_->mu); - stats_watchers_->watchers.erase(watcher.get()); + stats_watchers_->watchers.erase(watcher); } + delete watcher; return Status::OK; } @@ -362,7 +356,8 @@ void RunTestLoop(std::chrono::duration duration_per_query, std::vector configs; while (true) { { - std::lock_guard lock(rpc_configs_queue->mu_rpc_configs_queue); + std::lock_guard lockk( + rpc_configs_queue->mu_rpc_configs_queue); if (!rpc_configs_queue->rpc_configs_queue.empty()) { configs = std::move(rpc_configs_queue->rpc_configs_queue.front()); rpc_configs_queue->rpc_configs_queue.pop_front(); @@ -469,7 +464,7 @@ int main(int argc, char** argv) { { std::lock_guard lock(stats_watchers.mu); - stats_watchers.global_watcher = new XdsStatsWatcher(0, 0, {}); + stats_watchers.global_watcher = new XdsStatsWatcher(0, 0); stats_watchers.watchers.insert(stats_watchers.global_watcher); } diff --git a/test/cpp/interop/xds_stats_watcher.cc b/test/cpp/interop/xds_stats_watcher.cc index 1a5dec9063f0c..e6b1f80908e32 100644 --- a/test/cpp/interop/xds_stats_watcher.cc +++ b/test/cpp/interop/xds_stats_watcher.cc @@ -19,36 +19,11 @@ namespace grpc { namespace testing { -namespace { +XdsStatsWatcher::XdsStatsWatcher(int start_id, int end_id) + : start_id_(start_id), end_id_(end_id), rpcs_needed_(end_id - start_id) {} -LoadBalancerStatsResponse::RpcMetadata BuildRpcMetadata( - absl::Span metadata_keys, - const std::multimap& initial_metadata) { - LoadBalancerStatsResponse::RpcMetadata rpc_metadata; - for (const auto& key : metadata_keys) { - auto matching = initial_metadata.equal_range(key); - for (auto value = matching.first; value != matching.second; ++value) { - auto entry = rpc_metadata.add_metadata(); - entry->set_key(key); - entry->set_value( - absl::string_view(value->second.data(), value->second.length())); - } - } - return rpc_metadata; -} - -} // namespace - -XdsStatsWatcher::XdsStatsWatcher(int start_id, int end_id, - absl::Span metadata_keys) - : start_id_(start_id), - end_id_(end_id), - rpcs_needed_(end_id - start_id), - metadata_keys_(metadata_keys.begin(), metadata_keys.end()) {} - -void XdsStatsWatcher::RpcCompleted( - const AsyncClientCallResult& call, const std::string& peer, - const std::multimap& initial_metadata) { +void XdsStatsWatcher::RpcCompleted(const AsyncClientCallResult& call, + const std::string& peer) { // We count RPCs for global watcher or if the request_id falls into the // watcher's interested range of request ids. if ((start_id_ == 0 && end_id_ == 0) || @@ -62,8 +37,6 @@ void XdsStatsWatcher::RpcCompleted( // RPC is counted into both per-peer bin and per-method-per-peer bin. rpcs_by_peer_[peer]++; rpcs_by_type_[call.rpc_type][peer]++; - *metadata_by_peer_[peer].add_rpc_metadata() = - BuildRpcMetadata(metadata_keys_, initial_metadata); } rpcs_needed_--; // Report accumulated stats. @@ -82,17 +55,14 @@ void XdsStatsWatcher::RpcCompleted( } } -LoadBalancerStatsResponse XdsStatsWatcher::WaitForRpcStatsResponse( - int timeout_sec) { - LoadBalancerStatsResponse response; +void XdsStatsWatcher::WaitForRpcStatsResponse( + LoadBalancerStatsResponse* response, int timeout_sec) { std::unique_lock lock(m_); cv_.wait_for(lock, std::chrono::seconds(timeout_sec), [this] { return rpcs_needed_ == 0; }); - response.mutable_rpcs_by_peer()->insert(rpcs_by_peer_.begin(), - rpcs_by_peer_.end()); - response.mutable_metadatas_by_peer()->insert(metadata_by_peer_.begin(), - metadata_by_peer_.end()); - auto& response_rpcs_by_method = *response.mutable_rpcs_by_method(); + response->mutable_rpcs_by_peer()->insert(rpcs_by_peer_.begin(), + rpcs_by_peer_.end()); + auto& response_rpcs_by_method = *response->mutable_rpcs_by_method(); for (const auto& rpc_by_type : rpcs_by_type_) { std::string method_name; if (rpc_by_type.first == ClientConfigureRequest::EMPTY_CALL) { @@ -113,8 +83,7 @@ LoadBalancerStatsResponse XdsStatsWatcher::WaitForRpcStatsResponse( response_rpc_by_peer = rpc_by_peer.second; } } - response.set_num_failures(no_remote_peer_ + rpcs_needed_); - return response; + response->set_num_failures(no_remote_peer_ + rpcs_needed_); } void XdsStatsWatcher::GetCurrentRpcStats( diff --git a/test/cpp/interop/xds_stats_watcher.h b/test/cpp/interop/xds_stats_watcher.h index 6bce6e64fdb5b..a5917104f2b85 100644 --- a/test/cpp/interop/xds_stats_watcher.h +++ b/test/cpp/interop/xds_stats_watcher.h @@ -32,7 +32,6 @@ #include #include "absl/status/status.h" -#include "absl/types/span.h" #include @@ -69,17 +68,15 @@ struct StatsWatchers { /// Records the remote peer distribution for a given range of RPCs. class XdsStatsWatcher { public: - XdsStatsWatcher(int start_id, int end_id, - absl::Span metadata_keys); + XdsStatsWatcher(int start_id, int end_id); // Upon the completion of an RPC, we will look at the request_id, the // rpc_type, and the peer the RPC was sent to in order to count // this RPC into the right stats bin. - void RpcCompleted(const AsyncClientCallResult& call, const std::string& peer, - const std::multimap& - initial_metadata); + void RpcCompleted(const AsyncClientCallResult& call, const std::string& peer); - LoadBalancerStatsResponse WaitForRpcStatsResponse(int timeout_sec); + void WaitForRpcStatsResponse(LoadBalancerStatsResponse* response, + int timeout_sec); void GetCurrentRpcStats(LoadBalancerAccumulatedStatsResponse* response, StatsWatchers* stats_watchers); @@ -99,9 +96,6 @@ class XdsStatsWatcher { LoadBalancerAccumulatedStatsResponse accumulated_stats_; std::mutex m_; std::condition_variable cv_; - std::vector metadata_keys_; - std::map - metadata_by_peer_; }; } // namespace testing diff --git a/test/cpp/interop/xds_stats_watcher_test.cc b/test/cpp/interop/xds_stats_watcher_test.cc index 4340a51b2d9b3..63967095e7f4a 100644 --- a/test/cpp/interop/xds_stats_watcher_test.cc +++ b/test/cpp/interop/xds_stats_watcher_test.cc @@ -29,7 +29,6 @@ namespace grpc { namespace testing { namespace { - AsyncClientCallResult BuildCallResult(int saved_request_id) { AsyncClientCallResult result; result.saved_request_id = saved_request_id; @@ -37,63 +36,25 @@ AsyncClientCallResult BuildCallResult(int saved_request_id) { return result; } -LoadBalancerStatsResponse::MetadataByPeer BuildMetadatas( - const std::initializer_list< - std::initializer_list>>& values) { - LoadBalancerStatsResponse::MetadataByPeer metadata_by_peer; - for (const auto& per_rpc : values) { - auto rpc_metadata = metadata_by_peer.add_rpc_metadata(); - for (const auto& key_value : per_rpc) { - auto entry = rpc_metadata->add_metadata(); - entry->set_key(key_value.first); - entry->set_value(key_value.second); - } - } - return metadata_by_peer; -} - -TEST(XdsStatsWatcherTest, WaitForRpcStatsResponse) { - // "k3" will be ignored - XdsStatsWatcher watcher(0, 3, {"k1", "k2"}); - watcher.RpcCompleted(BuildCallResult(0), "peer1", - {{"k1", "v1"}, {"k2", "v2"}, {"k3", "v3"}}); - watcher.RpcCompleted(BuildCallResult(1), "peer1", {{"k1", "v4"}}); - watcher.RpcCompleted(BuildCallResult(2), "peer2", - {{"k1", "v5"}, {"k2", "v6"}, {"k3", "v7"}}); - LoadBalancerStatsResponse expected; - expected.mutable_rpcs_by_peer()->insert({{"peer1", 2}, {"peer2", 1}}); - expected.mutable_metadatas_by_peer()->insert({ - {"peer1", BuildMetadatas({{{"k1", "v1"}, {"k2", "v2"}}, {{"k1", "v4"}}})}, - {"peer2", BuildMetadatas({{{"k1", "v5"}, {"k2", "v6"}}})}, - }); - (*expected.mutable_rpcs_by_method())["UnaryCall"] - .mutable_rpcs_by_peer() - ->insert({{"peer1", 2}, {"peer2", 1}}); - EXPECT_EQ(watcher.WaitForRpcStatsResponse(0).DebugString(), - expected.DebugString()); -} - -TEST(XdsStatsWatcherTest, WaitForRpcStatsResponseIgnoresMetadata) { - XdsStatsWatcher watcher(0, 3, {}); - // RPC had metadata - but watcher should ignore it - watcher.RpcCompleted(BuildCallResult(0), "peer1", - {{"k1", "v1"}, {"k2", "v2"}, {"k3", "v3"}}); - // No metadata came with RPC - watcher.RpcCompleted(BuildCallResult(1), "peer1", {}); - watcher.RpcCompleted(BuildCallResult(2), "peer2", - {{"k1", "v5"}, {"k2", "v6"}, {"k3", "v7"}}); - LoadBalancerStatsResponse expected; - expected.mutable_rpcs_by_peer()->insert({{"peer1", 2}, {"peer2", 1}}); - // There will still be an empty metadata collection for each RPC - expected.mutable_metadatas_by_peer()->insert({ - {"peer1", BuildMetadatas({{}, {}})}, - {"peer2", BuildMetadatas({{}})}, - }); - (*expected.mutable_rpcs_by_method())["UnaryCall"] - .mutable_rpcs_by_peer() - ->insert({{"peer1", 2}, {"peer2", 1}}); - EXPECT_EQ(watcher.WaitForRpcStatsResponse(0).DebugString(), - expected.DebugString()); +TEST(XdsStatsWatcherTest, CollectsMetadata) { + XdsStatsWatcher watcher(0, 3); + watcher.RpcCompleted(BuildCallResult(0), "peer1"); + watcher.RpcCompleted(BuildCallResult(1), "peer1"); + watcher.RpcCompleted(BuildCallResult(2), "peer2"); + LoadBalancerStatsResponse lb_response; + watcher.WaitForRpcStatsResponse(&lb_response, 1); + EXPECT_EQ( + (std::multimap(lb_response.rpcs_by_peer().begin(), + lb_response.rpcs_by_peer().end())), + (std::multimap({{"peer1", 2}, {"peer2", 1}}))); + EXPECT_EQ(lb_response.rpcs_by_method_size(), 1); + auto rpcs = lb_response.rpcs_by_method().find("UnaryCall"); + EXPECT_NE(rpcs, lb_response.rpcs_by_method().end()); + std::multimap by_peer( + rpcs->second.rpcs_by_peer().begin(), rpcs->second.rpcs_by_peer().end()); + EXPECT_EQ( + by_peer, + (std::multimap({{"peer1", 2}, {"peer2", 1}}))); } } // namespace From b4a39a22302dc2985334cf3013ae28d5bc31cba9 Mon Sep 17 00:00:00 2001 From: alto-ruby <122473768+alto-ruby@users.noreply.github.com> Date: Wed, 9 Aug 2023 16:52:39 -0700 Subject: [PATCH 150/205] [Ruby] add special status msg interop test (#33990) fixes #24176 ``` ./tools/run_tests/run_interop_tests.py -l ruby -s c++ --use_docker No module named 'apiclient' Seen --use_docker flag, will run interop tests under docker. IMPORTANT: The changes you are testing need to be locally committed because only the committed changes in the current branch will be copied to the docker environment. START: Building interop docker images. PASSED: build_docker_ruby [time=479.4sec, retries=0:0] PASSED: build_docker_c++ [time=686.0sec, retries=0:0] SUCCESS: All docker images built successfully. START: interop_server_c++ PASSED: cloud_to_cloud:ruby:c++_server:cancel_after_begin:tls [time=0.9sec, retries=0:0] PASSED: cloud_to_cloud:ruby:c++_server:empty_unary:tls [time=1.0sec, retries=0:0] PASSED: cloud_to_cloud:ruby:c++_server:empty_stream:tls [time=1.0sec, retries=0:0] PASSED: cloud_to_cloud:ruby:c++_server:cancel_after_first_response:tls [time=1.0sec, retries=0:0] PASSED: cloud_to_cloud:ruby:c++_server:ping_pong:tls [time=1.0sec, retries=0:0] PASSED: cloud_to_cloud:ruby:c++_server:server_streaming:tls [time=1.0sec, retries=0:0] PASSED: cloud_to_cloud:ruby:c++_server:client_streaming:tls [time=1.0sec, retries=0:0] PASSED: cloud_to_cloud:ruby:c++_server:large_unary:tls [time=1.0sec, retries=0:0] PASSED: cloud_to_cloud:ruby:c++_server:status_code_and_message:tls [time=0.8sec, retries=0:0] PASSED: cloud_to_cloud:ruby:c++_server:unimplemented_method:tls [time=0.8sec, retries=0:0] PASSED: cloud_to_cloud:ruby:c++_server:custom_metadata:tls [time=0.9sec, retries=0:0] PASSED: cloud_to_cloud:ruby:c++_server:unimplemented_service:tls [time=0.8sec, retries=0:0] PASSED: cloud_to_cloud:ruby:c++_server:client_compressed_streaming:tls [time=0.8sec, retries=0:0] PASSED: cloud_to_cloud:ruby:c++_server:special_status_message:tls [time=0.8sec, retries=0:0] PASSED: cloud_to_cloud:ruby:c++_server:client_compressed_unary:tls [time=0.8sec, retries=0:0] PASSED: cloud_to_cloud:ruby:c++_server:timeout_on_sleeping_server:tls [time=1.8sec, retries=0:0] SUCCESS: All tests passed ``` --- src/ruby/pb/test/client.rb | 16 ++++++++++++++++ tools/run_tests/run_interop_tests.py | 1 - 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/ruby/pb/test/client.rb b/src/ruby/pb/test/client.rb index 03f3d9001aabf..213e477958c3a 100755 --- a/src/ruby/pb/test/client.rb +++ b/src/ruby/pb/test/client.rb @@ -649,6 +649,22 @@ def custom_metadata end + def special_status_message + code = GRPC::Core::StatusCodes::UNKNOWN + message = "\t\ntest with whitespace\r\nand Unicode BMP ☺ and non-BMP 😈\t\n" + req = SimpleRequest.new( + response_status: EchoStatus.new(code: code, message: message)) + begin + resp = @stub.unary_call(req) + fail AssertionError, "GRPC::Unknown should have been raised." + rescue GRPC::Unknown => e + if e.details.force_encoding("UTF-8") != message + fail AssertionError, + "Expected message #{message}. Received: #{e.details}" + end + end + end + def all all_methods = NamedTests.instance_methods(false).map(&:to_s) all_methods.each do |m| diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py index 05c4ebcebf75a..8a2dde46e7291 100755 --- a/tools/run_tests/run_interop_tests.py +++ b/tools/run_tests/run_interop_tests.py @@ -555,7 +555,6 @@ def unimplemented_test_cases(self): return ( _SKIP_SERVER_COMPRESSION + _SKIP_DATA_FRAME_PADDING - + _SKIP_SPECIAL_STATUS_MESSAGE + _SKIP_GOOGLE_DEFAULT_CREDS + _SKIP_COMPUTE_ENGINE_CHANNEL_CREDS + _ORCA_TEST_CASES From f3419f8373ae1501cc8ccceef8e36022a07d3f11 Mon Sep 17 00:00:00 2001 From: alto-ruby <122473768+alto-ruby@users.noreply.github.com> Date: Wed, 9 Aug 2023 16:56:07 -0700 Subject: [PATCH 151/205] [Ruby] set metadata_sent after call success (#33998) fixes #25373 --- src/ruby/lib/grpc/generic/active_call.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/ruby/lib/grpc/generic/active_call.rb b/src/ruby/lib/grpc/generic/active_call.rb index b2373a8d8e94d..af85ae8b7467a 100644 --- a/src/ruby/lib/grpc/generic/active_call.rb +++ b/src/ruby/lib/grpc/generic/active_call.rb @@ -232,17 +232,16 @@ def read_unary_request def server_unary_response(req, trailing_metadata: {}, code: Core::StatusCodes::OK, details: 'OK') ops = {} + ops[SEND_MESSAGE] = @marshal.call(req) + ops[SEND_STATUS_FROM_SERVER] = Struct::Status.new( + code, details, trailing_metadata) + ops[RECV_CLOSE_ON_SERVER] = nil + @send_initial_md_mutex.synchronize do ops[SEND_INITIAL_METADATA] = @metadata_to_send unless @metadata_sent @metadata_sent = true end - payload = @marshal.call(req) - ops[SEND_MESSAGE] = payload - ops[SEND_STATUS_FROM_SERVER] = Struct::Status.new( - code, details, trailing_metadata) - ops[RECV_CLOSE_ON_SERVER] = nil - @call.run_batch(ops) set_output_stream_done end From 5eb227936eb460f47de77b83fc08a0964268e10c Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 10 Aug 2023 09:02:48 +0200 Subject: [PATCH 152/205] [bazel] Add more bazelified tests (#34005) - some cleanup - add bazel distribtests (to run the existing test_single_bazel_version.sh locally under a docker container created by RBE). - add c++ distribtests - rename `grpc_run_tests_py_test` macro to `grpc_run_tests_harness_test` - as requested previously to avoid confusion with `*_py_test` rules --- tools/bazelify_tests/BUILD | 5 +- tools/bazelify_tests/build_defs.bzl | 140 +++++++++++++----- .../grpc_run_bazel_distribtest_test.sh | 36 +++++ .../grpc_run_cpp_distribtest_test.sh | 34 +++++ ...test.sh => grpc_run_tests_harness_test.sh} | 0 tools/bazelify_tests/test/BUILD | 114 ++++++++++++-- .../bazelify_tests/test/portability_tests.bzl | 10 +- 7 files changed, 286 insertions(+), 53 deletions(-) create mode 100755 tools/bazelify_tests/grpc_run_bazel_distribtest_test.sh create mode 100755 tools/bazelify_tests/grpc_run_cpp_distribtest_test.sh rename tools/bazelify_tests/{grpc_run_tests_py_test.sh => grpc_run_tests_harness_test.sh} (100%) diff --git a/tools/bazelify_tests/BUILD b/tools/bazelify_tests/BUILD index a81d40f5b04dc..e2542760ca367 100644 --- a/tools/bazelify_tests/BUILD +++ b/tools/bazelify_tests/BUILD @@ -23,8 +23,9 @@ grpc_package( ) exports_files([ - "grpc_run_tests_py_test.sh", - "grpc_build_artifact_task.sh", + "grpc_run_tests_harness_test.sh", + "grpc_run_bazel_distribtest_test.sh", + "grpc_run_cpp_distribtest_test.sh", ]) genrule( diff --git a/tools/bazelify_tests/build_defs.bzl b/tools/bazelify_tests/build_defs.bzl index ec5054e6ddf4b..3a21773ba7ef6 100644 --- a/tools/bazelify_tests/build_defs.bzl +++ b/tools/bazelify_tests/build_defs.bzl @@ -17,8 +17,53 @@ Contains macros used for running bazelified tests. """ load(":dockerimage_current_versions.bzl", "DOCKERIMAGE_CURRENT_VERSIONS") +load("@bazel_toolchains//rules/exec_properties:exec_properties.bzl", "create_rbe_exec_properties_dict") -def grpc_run_tests_py_test(name, args = [], data = [], size = "medium", timeout = None, tags = [], exec_compatible_with = [], flaky = None, docker_image_version = None, use_login_shell = None, prepare_script = None): +def _dockerized_sh_test(name, srcs = [], args = [], data = [], size = "medium", timeout = None, tags = [], exec_compatible_with = [], flaky = None, docker_image_version = None, docker_run_as_root = False, env = {}): + """Runs sh_test under docker either via RBE or via docker sandbox.""" + if docker_image_version: + image_spec = DOCKERIMAGE_CURRENT_VERSIONS.get(docker_image_version, None) + if not image_spec: + fail("Version info for docker image '%s' not found in dockerimage_current_versions.bzl" % docker_image_version) + else: + fail("docker_image_version attribute not set for dockerized test '%s'" % name) + + exec_properties = create_rbe_exec_properties_dict( + labels = { + "workload": "misc", + "machine_size": "misc_large", + }, + docker_network = "standard", + container_image = image_spec, + # TODO(jtattermusch): note that docker sandbox doesn't currently support "docker_run_as_root" + docker_run_as_root = docker_run_as_root, + ) + + # since the tests require special bazel args, only run them when explicitly requested + tags = ["manual"] + tags + + # TODO(jtattermusch): find a way to ensure that action can only run under docker sandbox or remotely + # to avoid running it outside of a docker container by accident. + + test_args = { + "name": name, + "srcs": srcs, + "tags": tags, + "args": args, + "flaky": flaky, + "data": data, + "size": size, + "env": env, + "timeout": timeout, + "exec_compatible_with": exec_compatible_with, + "exec_properties": exec_properties, + } + + native.sh_test( + **test_args + ) + +def grpc_run_tests_harness_test(name, args = [], data = [], size = "medium", timeout = None, tags = [], exec_compatible_with = [], flaky = None, docker_image_version = None, use_login_shell = None, prepare_script = None): """Execute an run_tests.py-harness style test under bazel. Args: @@ -45,7 +90,7 @@ def grpc_run_tests_py_test(name, args = [], data = [], size = "medium", timeout ] + args srcs = [ - "//tools/bazelify_tests:grpc_run_tests_py_test.sh", + "//tools/bazelify_tests:grpc_run_tests_harness_test.sh", ] env = {} @@ -65,39 +110,66 @@ def grpc_run_tests_py_test(name, args = [], data = [], size = "medium", timeout # TODO(jtattermusch): find a cleaner way to toggle ccache for builds. env["GRPC_BUILD_ENABLE_CCACHE"] = "true" - # TODO(jtattermusch): use rbe_exec_properties helpers instead of manually specifying - # the properties, which is fragile. - exec_properties = { - "dockerNetwork": "standard", # TODO(jtattermusch): look into deactivating network for some actions - "label:workload": "misc", # always use a dedicated "misc" pool for running bazelified tests - "label:machine_size": "misc_large", # needed to override the default value of "small". - } - if docker_image_version: - image_spec = DOCKERIMAGE_CURRENT_VERSIONS.get(docker_image_version, None) - if not image_spec: - fail("Version info for docker image '%s' not found in dockerimage_current_versions.bzl" % docker_image_version) - exec_properties["container-image"] = image_spec + _dockerized_sh_test(name = name, srcs = srcs, args = args, data = data, size = size, timeout = timeout, tags = tags, exec_compatible_with = exec_compatible_with, flaky = flaky, docker_image_version = docker_image_version, env = env) - # since the tests require special bazel args, only run them when explicitly requested - tags = ["manual"] + tags +def grpc_run_bazel_distribtest_test(name, args = [], data = [], size = "medium", timeout = None, tags = [], exec_compatible_with = [], flaky = None, docker_image_version = None): + """Execute bazel distribtest under bazel (an entire bazel build/test will run in a container as a single bazel action) - # TODO(jtattermusch): find a way to ensure that action can only run under docker sandbox or remotely - # to avoid running it outside of a docker container by accident. + Args: + name: The name of the test. + args: The args to supply to the test binary. + data: Data dependencies. + size: The size of the test. + timeout: The test timeout. + tags: The tags for the test. + exec_compatible_with: A list of constraint values that must be + satisifed for the platform. + flaky: Whether this test is flaky. + docker_image_version: The docker .current_version file to use for docker containerization. + """ - test_args = { - "name": name, - "srcs": srcs, - "tags": tags, - "args": args, - "flaky": flaky, - "data": data, - "size": size, - "env": env, - "timeout": timeout, - "exec_compatible_with": exec_compatible_with, - "exec_properties": exec_properties, - } + data = [ + "//tools/bazelify_tests:grpc_repo_archive_with_submodules.tar.gz", + ] + data - native.sh_test( - **test_args - ) + args = [ + "$(location //tools/bazelify_tests:grpc_repo_archive_with_submodules.tar.gz)", + ] + args + + srcs = [ + "//tools/bazelify_tests:grpc_run_bazel_distribtest_test.sh", + ] + env = {} + _dockerized_sh_test(name = name, srcs = srcs, args = args, data = data, size = size, timeout = timeout, tags = tags, exec_compatible_with = exec_compatible_with, flaky = flaky, docker_image_version = docker_image_version, env = env) + +def grpc_run_cpp_distribtest_test(name, args = [], data = [], size = "medium", timeout = None, tags = [], exec_compatible_with = [], flaky = None, docker_image_version = None): + """Execute an C++ distribtest under bazel. + + Args: + name: The name of the test. + args: The args to supply to the test binary. + data: Data dependencies. + size: The size of the test. + timeout: The test timeout. + tags: The tags for the test. + exec_compatible_with: A list of constraint values that must be + satisifed for the platform. + flaky: Whether this test is flaky. + docker_image_version: The docker .current_version file to use for docker containerization. + """ + + data = [ + "//tools/bazelify_tests:grpc_repo_archive_with_submodules.tar.gz", + ] + data + + args = [ + "$(location //tools/bazelify_tests:grpc_repo_archive_with_submodules.tar.gz)", + ] + args + + srcs = [ + "//tools/bazelify_tests:grpc_run_cpp_distribtest_test.sh", + ] + + # TODO(jtattermusch): revisit running docker as root (but currently some distribtests need to install stuff inside the docker container) + env = {} + _dockerized_sh_test(name = name, srcs = srcs, args = args, data = data, size = size, timeout = timeout, tags = tags, exec_compatible_with = exec_compatible_with, flaky = flaky, docker_image_version = docker_image_version, env = env, docker_run_as_root = True) diff --git a/tools/bazelify_tests/grpc_run_bazel_distribtest_test.sh b/tools/bazelify_tests/grpc_run_bazel_distribtest_test.sh new file mode 100755 index 0000000000000..68e68211785f5 --- /dev/null +++ b/tools/bazelify_tests/grpc_run_bazel_distribtest_test.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# Copyright 2023 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -ex + +ARCHIVE_WITH_SUBMODULES="$1" +shift + +# The JUnit XML report file generated by run_tests.py is compatible with +# the report format accepted by bazel as the result for tests target. +REPORT_XML_FILE="${XML_OUTPUT_FILE}" +# Create report suite name from the last component of the bazel target's name. +REPORT_SUITE_NAME="$(echo ${TEST_TARGET} | sed 's|^.*[:/]||')" + +# Extract grpc repo archive +tar -xopf ${ARCHIVE_WITH_SUBMODULES} +cd grpc + +# Remove the override the "do not detect toolchain" setting that was set +# by the from .bazelrc configuration for the remote build. +# TODO(jtattermusch): find a better solution to avoid breaking toolchain detection. +export BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=0 + +exec test/distrib/bazel/test_single_bazel_version.sh "$@" diff --git a/tools/bazelify_tests/grpc_run_cpp_distribtest_test.sh b/tools/bazelify_tests/grpc_run_cpp_distribtest_test.sh new file mode 100755 index 0000000000000..393fea8cf308b --- /dev/null +++ b/tools/bazelify_tests/grpc_run_cpp_distribtest_test.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Copyright 2023 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -ex + +ARCHIVE_WITH_SUBMODULES="$1" +shift + +# The JUnit XML report file generated by run_tests.py is compatible with +# the report format accepted by bazel as the result for tests target. +REPORT_XML_FILE="${XML_OUTPUT_FILE}" +# Create report suite name from the last component of the bazel target's name. +REPORT_SUITE_NAME="$(echo ${TEST_TARGET} | sed 's|^.*[:/]||')" + +# Extract grpc repo archive +tar -xopf ${ARCHIVE_WITH_SUBMODULES} +cd grpc + +# TODO(jtattermusch): adjust GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS for faster build. + +# Run distribtest script passed as args +"$@" diff --git a/tools/bazelify_tests/grpc_run_tests_py_test.sh b/tools/bazelify_tests/grpc_run_tests_harness_test.sh similarity index 100% rename from tools/bazelify_tests/grpc_run_tests_py_test.sh rename to tools/bazelify_tests/grpc_run_tests_harness_test.sh diff --git a/tools/bazelify_tests/test/BUILD b/tools/bazelify_tests/test/BUILD index a6eac298bed2d..1d5072088920f 100644 --- a/tools/bazelify_tests/test/BUILD +++ b/tools/bazelify_tests/test/BUILD @@ -13,7 +13,7 @@ # limitations under the License. load("//bazel:grpc_build_system.bzl", "grpc_package") -load("//tools/bazelify_tests:build_defs.bzl", "grpc_run_tests_py_test") +load("//tools/bazelify_tests:build_defs.bzl", "grpc_run_bazel_distribtest_test", "grpc_run_cpp_distribtest_test", "grpc_run_tests_harness_test") load(":portability_tests.bzl", "generate_run_tests_portability_tests") licenses(["notice"]) @@ -23,7 +23,7 @@ grpc_package(name = "tools/bazelify_tests/test") generate_run_tests_portability_tests(name = "portability_tests_linux") # C/C++ -grpc_run_tests_py_test( +grpc_run_tests_harness_test( name = "runtests_c_linux_dbg", size = "enormous", args = [ @@ -32,7 +32,7 @@ grpc_run_tests_py_test( docker_image_version = "tools/dockerfile/test/cxx_debian11_x64.current_version", ) -grpc_run_tests_py_test( +grpc_run_tests_harness_test( name = "runtests_c_linux_opt", size = "enormous", args = [ @@ -41,7 +41,7 @@ grpc_run_tests_py_test( docker_image_version = "tools/dockerfile/test/cxx_debian11_x64.current_version", ) -grpc_run_tests_py_test( +grpc_run_tests_harness_test( name = "runtests_cpp_linux_dbg_build_only", size = "enormous", args = [ @@ -50,7 +50,7 @@ grpc_run_tests_py_test( docker_image_version = "tools/dockerfile/test/cxx_debian11_x64.current_version", ) -grpc_run_tests_py_test( +grpc_run_tests_harness_test( name = "runtests_cpp_linux_opt_build_only", size = "enormous", args = [ @@ -61,7 +61,7 @@ grpc_run_tests_py_test( # TODO(jtattermusch): Reintroduce ruby tests once they pass. # # Ruby -# grpc_run_tests_py_test( +# grpc_run_tests_harness_test( # name = "runtests_ruby_linux_dbg", # size = "enormous", # args = [ @@ -72,7 +72,7 @@ grpc_run_tests_py_test( # use_login_shell = True, # ruby's docker image uses RVM which wierdly requires login shell # ) -# grpc_run_tests_py_test( +# grpc_run_tests_harness_test( # name = "runtests_ruby_linux_opt", # size = "enormous", # args = [ @@ -84,7 +84,7 @@ grpc_run_tests_py_test( # ) # PHP -grpc_run_tests_py_test( +grpc_run_tests_harness_test( name = "runtests_php_linux_dbg", size = "enormous", args = [ @@ -93,7 +93,7 @@ grpc_run_tests_py_test( docker_image_version = "tools/dockerfile/test/php7_debian11_x64.current_version", ) -grpc_run_tests_py_test( +grpc_run_tests_harness_test( name = "runtests_php_linux_opt", size = "enormous", args = [ @@ -104,7 +104,7 @@ grpc_run_tests_py_test( # TODO(jtattermusch): Reintroduce python tests once they pass. # # Python -# grpc_run_tests_py_test( +# grpc_run_tests_harness_test( # name = "runtests_python_linux_opt", # size = "enormous", # args = [ @@ -114,7 +114,7 @@ grpc_run_tests_py_test( # ) # C# -grpc_run_tests_py_test( +grpc_run_tests_harness_test( name = "runtests_csharp_linux_dbg", size = "enormous", args = [ @@ -123,7 +123,7 @@ grpc_run_tests_py_test( docker_image_version = "tools/dockerfile/test/csharp_debian11_x64.current_version", ) -grpc_run_tests_py_test( +grpc_run_tests_harness_test( name = "runtests_csharp_linux_opt", size = "enormous", args = [ @@ -150,10 +150,100 @@ test_suite( ], ) +# TODO(jtattermusch): Reintroduce the test once it passes. +# grpc_run_cpp_distribtest_test( +# name = "cpp_distribtest_cmake_linux", +# size = "enormous", +# args = ["test/distrib/cpp/run_distrib_test_cmake.sh"], +# docker_image_version = "tools/dockerfile/distribtest/cpp_debian10_x64.current_version", +# ) + +grpc_run_cpp_distribtest_test( + name = "cpp_distribtest_cmake_as_submodule_linux", + size = "enormous", + args = ["test/distrib/cpp/run_distrib_test_cmake_as_submodule.sh"], + docker_image_version = "tools/dockerfile/distribtest/cpp_debian10_x64.current_version", +) + +grpc_run_cpp_distribtest_test( + name = "cpp_distribtest_cmake_as_externalproject_linux", + size = "enormous", + args = ["test/distrib/cpp/run_distrib_test_cmake_as_externalproject.sh"], + docker_image_version = "tools/dockerfile/distribtest/cpp_debian10_x64.current_version", +) + +grpc_run_cpp_distribtest_test( + name = "cpp_distribtest_cmake_fetchcontent_linux", + size = "enormous", + args = ["test/distrib/cpp/run_distrib_test_cmake_fetchcontent.sh"], + docker_image_version = "tools/dockerfile/distribtest/cpp_debian10_x64.current_version", +) + +grpc_run_cpp_distribtest_test( + name = "cpp_distribtest_cmake_module_install_linux", + size = "enormous", + args = ["test/distrib/cpp/run_distrib_test_cmake_module_install.sh"], + docker_image_version = "tools/dockerfile/distribtest/cpp_debian10_x64.current_version", +) + +# TODO(jtattermusch): Reintroduce the test once it passes. +# grpc_run_cpp_distribtest_test( +# name = "cpp_distribtest_cmake_pkgconfig_linux", +# size = "enormous", +# args = ["test/distrib/cpp/run_distrib_test_cmake_pkgconfig.sh"], +# docker_image_version = "tools/dockerfile/distribtest/cpp_debian10_x64.current_version", +# ) + +grpc_run_cpp_distribtest_test( + name = "cpp_distribtest_cmake_aarch64_cross_linux", + size = "enormous", + args = ["test/distrib/cpp/run_distrib_test_cmake_aarch64_cross.sh"], + docker_image_version = "tools/dockerfile/distribtest/cpp_debian10_aarch64_cross_x64.current_version", +) + +test_suite( + name = "cpp_distribtests_linux", + tests = [ + ":cpp_distribtest_cmake_aarch64_cross_linux", + ":cpp_distribtest_cmake_as_externalproject_linux", + ":cpp_distribtest_cmake_as_submodule_linux", + ":cpp_distribtest_cmake_fetchcontent_linux", + #":cpp_distribtest_cmake_linux", + ":cpp_distribtest_cmake_module_install_linux", + #":cpp_distribtest_cmake_pkgconfig_linux", + ], +) + +# TODO(jtattermusch): load supported versions from //bazel/supported_versions.txt +grpc_run_bazel_distribtest_test( + name = "bazel_distribtest_5.4.1", + size = "enormous", + args = ["5.4.1"], + docker_image_version = "tools/dockerfile/test/bazel.current_version", +) + +# TODO(jtattermusch): load supported versions from //bazel/supported_versions.txt +grpc_run_bazel_distribtest_test( + name = "bazel_distribtest_6.1.2", + size = "enormous", + args = ["6.1.2"], + docker_image_version = "tools/dockerfile/test/bazel.current_version", +) + +test_suite( + name = "bazel_distribtests_linux", + tests = [ + ":bazel_distribtest_5.4.1", + ":bazel_distribtest_6.1.2", + ], +) + test_suite( name = "all_tests_linux", tests = [ ":basic_tests_linux", + ":bazel_distribtests_linux", + ":cpp_distribtests_linux", ":portability_tests_linux", ], ) diff --git a/tools/bazelify_tests/test/portability_tests.bzl b/tools/bazelify_tests/test/portability_tests.bzl index 26afa9e5bea07..b6e1e6680cd65 100644 --- a/tools/bazelify_tests/test/portability_tests.bzl +++ b/tools/bazelify_tests/test/portability_tests.bzl @@ -16,7 +16,7 @@ Generates portability tests. """ -load("//tools/bazelify_tests:build_defs.bzl", "grpc_run_tests_py_test") +load("//tools/bazelify_tests:build_defs.bzl", "grpc_run_tests_harness_test") def _safe_language_name(name): """Character '+' isn't allowed in bazel target name""" @@ -31,7 +31,7 @@ def generate_run_tests_portability_tests(name): test_names = [] # portability C x86 - grpc_run_tests_py_test( + grpc_run_tests_harness_test( name = "runtests_c_linux_dbg_x86", args = ["-l c -c dbg"], docker_image_version = "tools/dockerfile/test/cxx_debian11_x86.current_version", @@ -42,7 +42,7 @@ def generate_run_tests_portability_tests(name): # C and C++ with no-exceptions on Linux for language in ["c", "c++"]: test_name = "runtests_%s_linux_dbg_noexcept_build_only" % _safe_language_name(language) - grpc_run_tests_py_test( + grpc_run_tests_harness_test( name = test_name, args = ["-l %s --config noexcept --build_only" % language], docker_image_version = "tools/dockerfile/test/cxx_debian11_x64.current_version", @@ -65,7 +65,7 @@ def generate_run_tests_portability_tests(name): for compiler_name, args, docker_image_version in compiler_configs: test_name = "runtests_%s_linux_dbg_%s_build_only" % (_safe_language_name(language), compiler_name) - grpc_run_tests_py_test( + grpc_run_tests_harness_test( name = test_name, args = ["-l %s -c dbg %s --build_only" % (language, args)], docker_image_version = docker_image_version, @@ -75,7 +75,7 @@ def generate_run_tests_portability_tests(name): # TODO(jtattermusch): Reintroduce the test once it passes. # Python on alpine - #grpc_run_tests_py_test( + #grpc_run_tests_harness_test( # name = "runtests_python_linux_dbg_alpine", # args = [ # "-l python -c dbg --compiler python_alpine", From a329b5ef84fdcaa47363f06a53bf3c8834942ef6 Mon Sep 17 00:00:00 2001 From: Xuan Wang Date: Thu, 10 Aug 2023 08:49:25 -0700 Subject: [PATCH 153/205] [PSM Interop] Change the log message from Client pods to Client container (#34029) --- .../xds_k8s_test_driver/framework/xds_k8s_testcase.py | 4 ++-- .../xds_k8s_test_driver/framework/xds_url_map_testcase.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/run_tests/xds_k8s_test_driver/framework/xds_k8s_testcase.py b/tools/run_tests/xds_k8s_test_driver/framework/xds_k8s_testcase.py index bf8e312ce5125..bae651a642354 100644 --- a/tools/run_tests/xds_k8s_test_driver/framework/xds_k8s_testcase.py +++ b/tools/run_tests/xds_k8s_test_driver/framework/xds_k8s_testcase.py @@ -670,7 +670,7 @@ def tearDown(self): client_restarts, 0, msg=( - "Client pods unexpectedly restarted" + "Client container unexpectedly restarted" f" {client_restarts} times during test. In most cases, this" " is caused by the test client app crash." ), @@ -679,7 +679,7 @@ def tearDown(self): server_restarts, 0, msg=( - "Server pods unexpectedly restarted" + "Server container unexpectedly restarted" f" {server_restarts} times during test. In most cases, this" " is caused by the test client app crash." ), diff --git a/tools/run_tests/xds_k8s_test_driver/framework/xds_url_map_testcase.py b/tools/run_tests/xds_k8s_test_driver/framework/xds_url_map_testcase.py index efa513ce14b4c..6fa1c1d5884ca 100644 --- a/tools/run_tests/xds_k8s_test_driver/framework/xds_url_map_testcase.py +++ b/tools/run_tests/xds_k8s_test_driver/framework/xds_url_map_testcase.py @@ -436,7 +436,7 @@ def cleanupAfterTests(cls): # Fail if any of the pods restarted. error_msg = ( - "Client pods unexpectedly restarted" + "Client container unexpectedly restarted" f" {client_restarts} times during test." " In most cases, this is caused by the test client app crash." ) From 66f60aa763ce3f9f5af0e9082753ead81103bcaa Mon Sep 17 00:00:00 2001 From: Mohan Li <67390330+mohanli-ml@users.noreply.github.com> Date: Thu, 10 Aug 2023 09:34:27 -0700 Subject: [PATCH 154/205] [test] Allow set request/response size in interop soak test (#34010) Internal bug: b/289109827 --- test/cpp/interop/client.cc | 16 ++++++++++++-- test/cpp/interop/interop_client.cc | 27 ++++++++++++++--------- test/cpp/interop/interop_client.h | 13 +++++++---- test/cpp/interop/observability_client.cc | 16 ++++++++++++-- test/cpp/interop/xds_federation_client.cc | 16 ++++++++++++-- 5 files changed, 68 insertions(+), 20 deletions(-) diff --git a/test/cpp/interop/client.cc b/test/cpp/interop/client.cc index cf3ada95b03d7..b9edd471ad9fd 100644 --- a/test/cpp/interop/client.cc +++ b/test/cpp/interop/client.cc @@ -120,6 +120,14 @@ ABSL_FLAG(int32_t, soak_min_time_ms_between_rpcs, 0, ABSL_FLAG(int32_t, iteration_interval, 10, "The interval in seconds between rpcs. This is used by " "long_connection test"); +ABSL_FLAG( + int32_t, soak_request_size, 271828, + "The request size in a soak RPC. " + "The default value is set based on the interop large unary test case."); +ABSL_FLAG( + int32_t, soak_response_size, 314159, + "The response size in a soak RPC. " + "The default value is set based on the interop large unary test case."); ABSL_FLAG(std::string, additional_metadata, "", "Additional metadata to send in each request, as a " "semicolon-separated list of key:value pairs."); @@ -312,14 +320,18 @@ int main(int argc, char** argv) { absl::GetFlag(FLAGS_soak_max_failures), absl::GetFlag(FLAGS_soak_per_iteration_max_acceptable_latency_ms), absl::GetFlag(FLAGS_soak_min_time_ms_between_rpcs), - absl::GetFlag(FLAGS_soak_overall_timeout_seconds)); + absl::GetFlag(FLAGS_soak_overall_timeout_seconds), + absl::GetFlag(FLAGS_soak_request_size), + absl::GetFlag(FLAGS_soak_response_size)); actions["rpc_soak"] = std::bind( &grpc::testing::InteropClient::DoRpcSoakTest, &client, absl::GetFlag(FLAGS_server_host), absl::GetFlag(FLAGS_soak_iterations), absl::GetFlag(FLAGS_soak_max_failures), absl::GetFlag(FLAGS_soak_per_iteration_max_acceptable_latency_ms), absl::GetFlag(FLAGS_soak_min_time_ms_between_rpcs), - absl::GetFlag(FLAGS_soak_overall_timeout_seconds)); + absl::GetFlag(FLAGS_soak_overall_timeout_seconds), + absl::GetFlag(FLAGS_soak_request_size), + absl::GetFlag(FLAGS_soak_response_size)); actions["long_lived_channel"] = std::bind(&grpc::testing::InteropClient::DoLongLivedChannelTest, &client, absl::GetFlag(FLAGS_soak_iterations), diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc index 229cb62e05f87..04bc8022d27bd 100644 --- a/test/cpp/interop/interop_client.cc +++ b/test/cpp/interop/interop_client.cc @@ -1185,7 +1185,8 @@ bool InteropClient::DoCustomMetadata() { std::tuple InteropClient::PerformOneSoakTestIteration( const bool reset_channel, - const int32_t max_acceptable_per_iteration_latency_ms) { + const int32_t max_acceptable_per_iteration_latency_ms, + const int32_t request_size, const int32_t response_size) { gpr_timespec start = gpr_now(GPR_CLOCK_MONOTONIC); SimpleRequest request; SimpleResponse response; @@ -1194,9 +1195,9 @@ InteropClient::PerformOneSoakTestIteration( // debugging easier when looking at failure results. ClientContext context; InteropClientContextInspector inspector(context); - request.set_response_size(kLargeResponseSize); - std::string payload(kLargeRequestSize, '\0'); - request.mutable_payload()->set_body(payload.c_str(), kLargeRequestSize); + request.set_response_size(response_size); + std::string payload(request_size, '\0'); + request.mutable_payload()->set_body(payload.c_str(), request_size); if (reset_channel) { serviceStub_.ResetChannel(); } @@ -1222,7 +1223,8 @@ void InteropClient::PerformSoakTest( const int32_t soak_iterations, const int32_t max_failures, const int32_t max_acceptable_per_iteration_latency_ms, const int32_t min_time_ms_between_rpcs, - const int32_t overall_timeout_seconds) { + const int32_t overall_timeout_seconds, const int32_t request_size, + const int32_t response_size) { std::vector> results; grpc_histogram* latencies_ms_histogram = grpc_histogram_create( 1 /* resolution */, @@ -1240,7 +1242,8 @@ void InteropClient::PerformSoakTest( gpr_now(GPR_CLOCK_MONOTONIC), gpr_time_from_millis(min_time_ms_between_rpcs, GPR_TIMESPAN)); auto result = PerformOneSoakTestIteration( - reset_channel_per_iteration, max_acceptable_per_iteration_latency_ms); + reset_channel_per_iteration, max_acceptable_per_iteration_latency_ms, + request_size, response_size); bool success = std::get<0>(result); int32_t elapsed_ms = std::get<1>(result); std::string debug_string = std::get<2>(result); @@ -1318,13 +1321,15 @@ void InteropClient::PerformSoakTest( bool InteropClient::DoRpcSoakTest( const std::string& server_uri, int32_t soak_iterations, int32_t max_failures, int64_t max_acceptable_per_iteration_latency_ms, - int32_t soak_min_time_ms_between_rpcs, int32_t overall_timeout_seconds) { + int32_t soak_min_time_ms_between_rpcs, int32_t overall_timeout_seconds, + int32_t request_size, int32_t response_size) { gpr_log(GPR_DEBUG, "Sending %d RPCs...", soak_iterations); GPR_ASSERT(soak_iterations > 0); PerformSoakTest(server_uri, false /* reset channel per iteration */, soak_iterations, max_failures, max_acceptable_per_iteration_latency_ms, - soak_min_time_ms_between_rpcs, overall_timeout_seconds); + soak_min_time_ms_between_rpcs, overall_timeout_seconds, + request_size, response_size); gpr_log(GPR_DEBUG, "rpc_soak test done."); return true; } @@ -1332,14 +1337,16 @@ bool InteropClient::DoRpcSoakTest( bool InteropClient::DoChannelSoakTest( const std::string& server_uri, int32_t soak_iterations, int32_t max_failures, int64_t max_acceptable_per_iteration_latency_ms, - int32_t soak_min_time_ms_between_rpcs, int32_t overall_timeout_seconds) { + int32_t soak_min_time_ms_between_rpcs, int32_t overall_timeout_seconds, + int32_t request_size, int32_t response_size) { gpr_log(GPR_DEBUG, "Sending %d RPCs, tearing down the channel each time...", soak_iterations); GPR_ASSERT(soak_iterations > 0); PerformSoakTest(server_uri, true /* reset channel per iteration */, soak_iterations, max_failures, max_acceptable_per_iteration_latency_ms, - soak_min_time_ms_between_rpcs, overall_timeout_seconds); + soak_min_time_ms_between_rpcs, overall_timeout_seconds, + request_size, response_size); gpr_log(GPR_DEBUG, "channel_soak test done."); return true; } diff --git a/test/cpp/interop/interop_client.h b/test/cpp/interop/interop_client.h index ed504deb7dc1c..cfebf466678a8 100644 --- a/test/cpp/interop/interop_client.h +++ b/test/cpp/interop/interop_client.h @@ -19,6 +19,7 @@ #ifndef GRPC_TEST_CPP_INTEROP_INTEROP_CLIENT_H #define GRPC_TEST_CPP_INTEROP_INTEROP_CLIENT_H +#include #include #include @@ -86,12 +87,14 @@ class InteropClient { int32_t max_failures, int64_t max_acceptable_per_iteration_latency_ms, int32_t soak_min_time_ms_between_rpcs, - int32_t overall_timeout_seconds); + int32_t overall_timeout_seconds, int32_t request_size, + int32_t response_size); bool DoRpcSoakTest(const std::string& server_uri, int32_t soak_iterations, int32_t max_failures, int64_t max_acceptable_per_iteration_latency_ms, int32_t soak_min_time_ms_between_rpcs, - int32_t overall_timeout_seconds); + int32_t overall_timeout_seconds, int32_t request_size, + int32_t response_size); bool DoLongLivedChannelTest(int32_t soak_iterations, int32_t iteration_interval); @@ -146,7 +149,8 @@ class InteropClient { std::tuple PerformOneSoakTestIteration( const bool reset_channel, - const int32_t max_acceptable_per_iteration_latency_ms); + const int32_t max_acceptable_per_iteration_latency_ms, + const int32_t request_size, const int32_t response_size); void PerformSoakTest(const std::string& server_uri, const bool reset_channel_per_iteration, @@ -154,7 +158,8 @@ class InteropClient { const int32_t max_failures, const int32_t max_acceptable_per_iteration_latency_ms, const int32_t min_time_ms_between_rpcs, - const int32_t overall_timeout_seconds); + const int32_t overall_timeout_seconds, + const int32_t request_size, const int32_t response_size); ServiceStub serviceStub_; /// If true, abort() is not called for transient failures diff --git a/test/cpp/interop/observability_client.cc b/test/cpp/interop/observability_client.cc index a37e4ab1fd5f2..6ea521742a790 100644 --- a/test/cpp/interop/observability_client.cc +++ b/test/cpp/interop/observability_client.cc @@ -116,6 +116,14 @@ ABSL_FLAG(int32_t, soak_overall_timeout_seconds, 0, ABSL_FLAG(int32_t, soak_min_time_ms_between_rpcs, 0, "The minimum time in milliseconds between consecutive RPCs in a " "soak test (rpc_soak or channel_soak), useful for limiting QPS"); +ABSL_FLAG( + int32_t, soak_request_size, 271828, + "The request size in a soak RPC. " + "The default value is set based on the interop large unary test case."); +ABSL_FLAG( + int32_t, soak_response_size, 314159, + "The response size in a soak RPC. " + "The default value is set based on the interop large unary test case."); ABSL_FLAG(int32_t, iteration_interval, 10, "The interval in seconds between rpcs. This is used by " "long_connection test"); @@ -319,14 +327,18 @@ int main(int argc, char** argv) { absl::GetFlag(FLAGS_soak_max_failures), absl::GetFlag(FLAGS_soak_per_iteration_max_acceptable_latency_ms), absl::GetFlag(FLAGS_soak_min_time_ms_between_rpcs), - absl::GetFlag(FLAGS_soak_overall_timeout_seconds)); + absl::GetFlag(FLAGS_soak_overall_timeout_seconds), + absl::GetFlag(FLAGS_soak_request_size), + absl::GetFlag(FLAGS_soak_response_size)); actions["rpc_soak"] = std::bind( &grpc::testing::InteropClient::DoRpcSoakTest, &client, absl::GetFlag(FLAGS_server_host), absl::GetFlag(FLAGS_soak_iterations), absl::GetFlag(FLAGS_soak_max_failures), absl::GetFlag(FLAGS_soak_per_iteration_max_acceptable_latency_ms), absl::GetFlag(FLAGS_soak_min_time_ms_between_rpcs), - absl::GetFlag(FLAGS_soak_overall_timeout_seconds)); + absl::GetFlag(FLAGS_soak_overall_timeout_seconds), + absl::GetFlag(FLAGS_soak_request_size), + absl::GetFlag(FLAGS_soak_response_size)); actions["long_lived_channel"] = std::bind(&grpc::testing::InteropClient::DoLongLivedChannelTest, &client, absl::GetFlag(FLAGS_soak_iterations), diff --git a/test/cpp/interop/xds_federation_client.cc b/test/cpp/interop/xds_federation_client.cc index 1a0dd63118c82..d66d76648c59e 100644 --- a/test/cpp/interop/xds_federation_client.cc +++ b/test/cpp/interop/xds_federation_client.cc @@ -56,6 +56,14 @@ ABSL_FLAG( ABSL_FLAG(int32_t, soak_min_time_ms_between_rpcs, 0, "The minimum time in milliseconds between consecutive RPCs in a soak " "test (rpc_soak or channel_soak), useful for limiting QPS"); +ABSL_FLAG( + int32_t, soak_request_size, 271828, + "The request size in a soak RPC. " + "The default value is set based on the interop large unary test case."); +ABSL_FLAG( + int32_t, soak_response_size, 314159, + "The response size in a soak RPCi. " + "The default value is set based on the interop large unary test case."); ABSL_FLAG(std::string, test_case, "rpc_soak", "Configure different test cases. Valid options are: " "rpc_soak: sends --soak_iterations large_unary RPCs; " @@ -99,14 +107,18 @@ int main(int argc, char** argv) { absl::GetFlag(FLAGS_soak_max_failures), absl::GetFlag(FLAGS_soak_per_iteration_max_acceptable_latency_ms), absl::GetFlag(FLAGS_soak_min_time_ms_between_rpcs), - absl::GetFlag(FLAGS_soak_overall_timeout_seconds)); + absl::GetFlag(FLAGS_soak_overall_timeout_seconds), + absl::GetFlag(FLAGS_soak_request_size), + absl::GetFlag(FLAGS_soak_response_size)); } else if (test_case == "channel_soak") { client.DoChannelSoakTest( uris[i], absl::GetFlag(FLAGS_soak_iterations), absl::GetFlag(FLAGS_soak_max_failures), absl::GetFlag(FLAGS_soak_per_iteration_max_acceptable_latency_ms), absl::GetFlag(FLAGS_soak_min_time_ms_between_rpcs), - absl::GetFlag(FLAGS_soak_overall_timeout_seconds)); + absl::GetFlag(FLAGS_soak_overall_timeout_seconds), + absl::GetFlag(FLAGS_soak_request_size), + absl::GetFlag(FLAGS_soak_response_size)); } else { gpr_log(GPR_ERROR, "Invalid test case, must be either rpc_soak or channel_soak"); From 54651a71682c52917acab1110fe55bc6a07bd0f3 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 10 Aug 2023 09:40:13 -0700 Subject: [PATCH 155/205] [promises] New `Seq`, `TrySeq` implementation (#33991) Our current implementation of `Seq`, `TrySeq` leverage some complicated template stuff to work, which makes them hard to maintain. I've been thinking about ways to simplify that for some time and had something like this in mind - using a code generator that's at least a little more understandable to code generate most of the complexity into a file that is checkable. Concurrently - I have a cool optimization in mind - but it requires that we can move promises after polling, which is a contract change. I'm going to work through the set of primitives we have in the coming weeks and change that contract to enable the optimization. --------- Co-authored-by: ctiller --- BUILD | 2 - CMakeLists.txt | 6 - Package.swift | 2 +- build_autogenerated.yaml | 34 +- gRPC-C++.podspec | 4 +- gRPC-Core.podspec | 4 +- grpc.gemspec | 2 +- package.xml | 2 +- src/core/BUILD | 24 +- .../channel_idle/channel_idle_filter.cc | 1 + src/core/lib/channel/connected_channel.cc | 1 - src/core/lib/channel/promise_based_filter.cc | 2 +- src/core/lib/promise/detail/basic_seq.h | 373 +-- src/core/lib/promise/detail/seq_state.h | 2076 +++++++++++++++++ src/core/lib/promise/seq.h | 21 +- src/core/lib/promise/try_seq.h | 36 +- src/core/lib/resource_quota/memory_quota.cc | 1 - .../security/transport/client_auth_filter.cc | 2 +- .../security/transport/server_auth_filter.cc | 2 + src/core/lib/surface/call.cc | 1 - src/core/lib/surface/server.cc | 2 +- test/core/filters/filter_test.cc | 2 +- test/core/promise/BUILD | 3 - test/core/promise/for_each_test.cc | 1 - test/core/promise/loop_test.cc | 3 +- test/core/promise/map_pipe_test.cc | 1 - test/core/promise/promise_fuzzer.cc | 2 + test/core/promise/seq_test.cc | 2 + test/core/promise/try_seq_metadata_test.cc | 2 + test/core/promise/try_seq_test.cc | 1 + tools/codegen/core/gen_seq.py | 271 +++ tools/doxygen/Doxyfile.c++.internal | 2 +- tools/doxygen/Doxyfile.core.internal | 2 +- 33 files changed, 2457 insertions(+), 433 deletions(-) create mode 100644 src/core/lib/promise/detail/seq_state.h create mode 100755 tools/codegen/core/gen_seq.py diff --git a/BUILD b/BUILD index a1a9c395447c8..c7a7e844c43c6 100644 --- a/BUILD +++ b/BUILD @@ -1534,7 +1534,6 @@ grpc_cc_library( "//src/core:arena", "//src/core:arena_promise", "//src/core:atomic_utils", - "//src/core:basic_seq", "//src/core:bitset", "//src/core:cancel_callback", "//src/core:channel_args", @@ -1799,7 +1798,6 @@ grpc_cc_library( "//src/core:activity", "//src/core:arena", "//src/core:arena_promise", - "//src/core:basic_seq", "//src/core:channel_args", "//src/core:channel_fwd", "//src/core:closure", diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b5e57d76ab55..3e281c5c56166 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8777,7 +8777,6 @@ target_link_libraries(chunked_vector_test absl::hash absl::type_traits absl::statusor - absl::utility gpr upb ) @@ -12110,7 +12109,6 @@ target_link_libraries(flow_control_test absl::hash absl::type_traits absl::statusor - absl::utility gpr upb ) @@ -15292,7 +15290,6 @@ target_link_libraries(interceptor_list_test absl::hash absl::type_traits absl::statusor - absl::utility gpr upb ) @@ -16227,7 +16224,6 @@ target_link_libraries(loop_test ${_gRPC_ALLTARGETS_LIBRARIES} absl::type_traits absl::statusor - absl::utility gpr ) @@ -22151,7 +22147,6 @@ target_link_libraries(seq_test ${_gRPC_ZLIB_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} absl::type_traits - absl::utility gpr ) @@ -26523,7 +26518,6 @@ target_link_libraries(try_seq_test ${_gRPC_ALLTARGETS_LIBRARIES} absl::type_traits absl::statusor - absl::utility gpr ) diff --git a/Package.swift b/Package.swift index 56699d86e08c9..afeb98b7f1cc2 100644 --- a/Package.swift +++ b/Package.swift @@ -1447,8 +1447,8 @@ let package = Package( "src/core/lib/promise/detail/basic_seq.h", "src/core/lib/promise/detail/promise_factory.h", "src/core/lib/promise/detail/promise_like.h", + "src/core/lib/promise/detail/seq_state.h", "src/core/lib/promise/detail/status.h", - "src/core/lib/promise/detail/switch.h", "src/core/lib/promise/exec_ctx_wakeup_scheduler.h", "src/core/lib/promise/for_each.h", "src/core/lib/promise/if.h", diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index a21e36895b197..e780ca50f6d77 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -857,8 +857,8 @@ libs: - src/core/lib/promise/detail/basic_seq.h - src/core/lib/promise/detail/promise_factory.h - src/core/lib/promise/detail/promise_like.h + - src/core/lib/promise/detail/seq_state.h - src/core/lib/promise/detail/status.h - - src/core/lib/promise/detail/switch.h - src/core/lib/promise/exec_ctx_wakeup_scheduler.h - src/core/lib/promise/for_each.h - src/core/lib/promise/if.h @@ -2253,8 +2253,8 @@ libs: - src/core/lib/promise/detail/basic_seq.h - src/core/lib/promise/detail/promise_factory.h - src/core/lib/promise/detail/promise_like.h + - src/core/lib/promise/detail/seq_state.h - src/core/lib/promise/detail/status.h - - src/core/lib/promise/detail/switch.h - src/core/lib/promise/exec_ctx_wakeup_scheduler.h - src/core/lib/promise/for_each.h - src/core/lib/promise/if.h @@ -3754,8 +3754,8 @@ libs: - src/core/lib/promise/detail/basic_seq.h - src/core/lib/promise/detail/promise_factory.h - src/core/lib/promise/detail/promise_like.h + - src/core/lib/promise/detail/seq_state.h - src/core/lib/promise/detail/status.h - - src/core/lib/promise/detail/switch.h - src/core/lib/promise/exec_ctx_wakeup_scheduler.h - src/core/lib/promise/for_each.h - src/core/lib/promise/if.h @@ -4307,8 +4307,8 @@ targets: - src/core/lib/promise/detail/basic_seq.h - src/core/lib/promise/detail/promise_factory.h - src/core/lib/promise/detail/promise_like.h + - src/core/lib/promise/detail/seq_state.h - src/core/lib/promise/detail/status.h - - src/core/lib/promise/detail/switch.h - src/core/lib/promise/join.h - src/core/lib/promise/poll.h - src/core/lib/promise/promise.h @@ -6115,8 +6115,8 @@ targets: - src/core/lib/promise/detail/basic_seq.h - src/core/lib/promise/detail/promise_factory.h - src/core/lib/promise/detail/promise_like.h + - src/core/lib/promise/detail/seq_state.h - src/core/lib/promise/detail/status.h - - src/core/lib/promise/detail/switch.h - src/core/lib/promise/exec_ctx_wakeup_scheduler.h - src/core/lib/promise/loop.h - src/core/lib/promise/map.h @@ -6167,7 +6167,6 @@ targets: - absl/hash:hash - absl/meta:type_traits - absl/status:statusor - - absl/utility:utility - gpr - upb uses_polling: false @@ -7761,8 +7760,8 @@ targets: - src/core/lib/promise/detail/basic_seq.h - src/core/lib/promise/detail/promise_factory.h - src/core/lib/promise/detail/promise_like.h + - src/core/lib/promise/detail/seq_state.h - src/core/lib/promise/detail/status.h - - src/core/lib/promise/detail/switch.h - src/core/lib/promise/exec_ctx_wakeup_scheduler.h - src/core/lib/promise/loop.h - src/core/lib/promise/map.h @@ -7818,7 +7817,6 @@ targets: - absl/hash:hash - absl/meta:type_traits - absl/status:statusor - - absl/utility:utility - gpr - upb uses_polling: false @@ -7854,8 +7852,8 @@ targets: - src/core/lib/promise/detail/basic_seq.h - src/core/lib/promise/detail/promise_factory.h - src/core/lib/promise/detail/promise_like.h + - src/core/lib/promise/detail/seq_state.h - src/core/lib/promise/detail/status.h - - src/core/lib/promise/detail/switch.h - src/core/lib/promise/exec_ctx_wakeup_scheduler.h - src/core/lib/promise/for_each.h - src/core/lib/promise/if.h @@ -8226,8 +8224,8 @@ targets: - src/core/lib/promise/detail/basic_seq.h - src/core/lib/promise/detail/promise_factory.h - src/core/lib/promise/detail/promise_like.h + - src/core/lib/promise/detail/seq_state.h - src/core/lib/promise/detail/status.h - - src/core/lib/promise/detail/switch.h - src/core/lib/promise/exec_ctx_wakeup_scheduler.h - src/core/lib/promise/for_each.h - src/core/lib/promise/if.h @@ -9702,8 +9700,8 @@ targets: - src/core/lib/promise/detail/basic_seq.h - src/core/lib/promise/detail/promise_factory.h - src/core/lib/promise/detail/promise_like.h + - src/core/lib/promise/detail/seq_state.h - src/core/lib/promise/detail/status.h - - src/core/lib/promise/detail/switch.h - src/core/lib/promise/exec_ctx_wakeup_scheduler.h - src/core/lib/promise/interceptor_list.h - src/core/lib/promise/loop.h @@ -9758,7 +9756,6 @@ targets: - absl/hash:hash - absl/meta:type_traits - absl/status:statusor - - absl/utility:utility - gpr - upb uses_polling: false @@ -10075,8 +10072,8 @@ targets: - src/core/lib/promise/detail/basic_seq.h - src/core/lib/promise/detail/promise_factory.h - src/core/lib/promise/detail/promise_like.h + - src/core/lib/promise/detail/seq_state.h - src/core/lib/promise/detail/status.h - - src/core/lib/promise/detail/switch.h - src/core/lib/promise/join.h - src/core/lib/promise/latch.h - src/core/lib/promise/poll.h @@ -10179,7 +10176,7 @@ targets: - src/core/lib/promise/detail/basic_seq.h - src/core/lib/promise/detail/promise_factory.h - src/core/lib/promise/detail/promise_like.h - - src/core/lib/promise/detail/switch.h + - src/core/lib/promise/detail/seq_state.h - src/core/lib/promise/loop.h - src/core/lib/promise/poll.h - src/core/lib/promise/seq.h @@ -10188,7 +10185,6 @@ targets: deps: - absl/meta:type_traits - absl/status:statusor - - absl/utility:utility - gpr uses_polling: false - name: map_pipe_test @@ -10223,8 +10219,8 @@ targets: - src/core/lib/promise/detail/basic_seq.h - src/core/lib/promise/detail/promise_factory.h - src/core/lib/promise/detail/promise_like.h + - src/core/lib/promise/detail/seq_state.h - src/core/lib/promise/detail/status.h - - src/core/lib/promise/detail/switch.h - src/core/lib/promise/exec_ctx_wakeup_scheduler.h - src/core/lib/promise/for_each.h - src/core/lib/promise/if.h @@ -13441,14 +13437,13 @@ targets: - src/core/lib/promise/detail/basic_seq.h - src/core/lib/promise/detail/promise_factory.h - src/core/lib/promise/detail/promise_like.h - - src/core/lib/promise/detail/switch.h + - src/core/lib/promise/detail/seq_state.h - src/core/lib/promise/poll.h - src/core/lib/promise/seq.h src: - test/core/promise/seq_test.cc deps: - absl/meta:type_traits - - absl/utility:utility - gpr uses_polling: false - name: sequential_connectivity_test @@ -15414,8 +15409,8 @@ targets: - src/core/lib/promise/detail/basic_seq.h - src/core/lib/promise/detail/promise_factory.h - src/core/lib/promise/detail/promise_like.h + - src/core/lib/promise/detail/seq_state.h - src/core/lib/promise/detail/status.h - - src/core/lib/promise/detail/switch.h - src/core/lib/promise/poll.h - src/core/lib/promise/try_seq.h src: @@ -15423,7 +15418,6 @@ targets: deps: - absl/meta:type_traits - absl/status:statusor - - absl/utility:utility - gpr uses_polling: false - name: unique_type_name_test diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index d95907385161e..a9ad7359874d6 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -951,8 +951,8 @@ Pod::Spec.new do |s| 'src/core/lib/promise/detail/basic_seq.h', 'src/core/lib/promise/detail/promise_factory.h', 'src/core/lib/promise/detail/promise_like.h', + 'src/core/lib/promise/detail/seq_state.h', 'src/core/lib/promise/detail/status.h', - 'src/core/lib/promise/detail/switch.h', 'src/core/lib/promise/exec_ctx_wakeup_scheduler.h', 'src/core/lib/promise/for_each.h', 'src/core/lib/promise/if.h', @@ -2001,8 +2001,8 @@ Pod::Spec.new do |s| 'src/core/lib/promise/detail/basic_seq.h', 'src/core/lib/promise/detail/promise_factory.h', 'src/core/lib/promise/detail/promise_like.h', + 'src/core/lib/promise/detail/seq_state.h', 'src/core/lib/promise/detail/status.h', - 'src/core/lib/promise/detail/switch.h', 'src/core/lib/promise/exec_ctx_wakeup_scheduler.h', 'src/core/lib/promise/for_each.h', 'src/core/lib/promise/if.h', diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index c6f4811efe8ca..8a59d4bd0aefc 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -1548,8 +1548,8 @@ Pod::Spec.new do |s| 'src/core/lib/promise/detail/basic_seq.h', 'src/core/lib/promise/detail/promise_factory.h', 'src/core/lib/promise/detail/promise_like.h', + 'src/core/lib/promise/detail/seq_state.h', 'src/core/lib/promise/detail/status.h', - 'src/core/lib/promise/detail/switch.h', 'src/core/lib/promise/exec_ctx_wakeup_scheduler.h', 'src/core/lib/promise/for_each.h', 'src/core/lib/promise/if.h', @@ -2737,8 +2737,8 @@ Pod::Spec.new do |s| 'src/core/lib/promise/detail/basic_seq.h', 'src/core/lib/promise/detail/promise_factory.h', 'src/core/lib/promise/detail/promise_like.h', + 'src/core/lib/promise/detail/seq_state.h', 'src/core/lib/promise/detail/status.h', - 'src/core/lib/promise/detail/switch.h', 'src/core/lib/promise/exec_ctx_wakeup_scheduler.h', 'src/core/lib/promise/for_each.h', 'src/core/lib/promise/if.h', diff --git a/grpc.gemspec b/grpc.gemspec index d3d4df3b6cc74..c14953000cb2d 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -1453,8 +1453,8 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/promise/detail/basic_seq.h ) s.files += %w( src/core/lib/promise/detail/promise_factory.h ) s.files += %w( src/core/lib/promise/detail/promise_like.h ) + s.files += %w( src/core/lib/promise/detail/seq_state.h ) s.files += %w( src/core/lib/promise/detail/status.h ) - s.files += %w( src/core/lib/promise/detail/switch.h ) s.files += %w( src/core/lib/promise/exec_ctx_wakeup_scheduler.h ) s.files += %w( src/core/lib/promise/for_each.h ) s.files += %w( src/core/lib/promise/if.h ) diff --git a/package.xml b/package.xml index 3a8afe9b3fda5..e0cd73dc3834b 100644 --- a/package.xml +++ b/package.xml @@ -1435,8 +1435,8 @@ + - diff --git a/src/core/BUILD b/src/core/BUILD index cf94603020d85..b6c7590a4fd47 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -665,21 +665,30 @@ grpc_cc_library( grpc_cc_library( name = "basic_seq", - external_deps = [ - "absl/meta:type_traits", - "absl/utility", - ], language = "c++", public_hdrs = [ "lib/promise/detail/basic_seq.h", ], + deps = [ + "construct_destruct", + "poll", + "//:gpr_platform", + ], +) + +grpc_cc_library( + name = "seq_state", + external_deps = ["absl/base:core_headers"], + language = "c++", + public_hdrs = [ + "lib/promise/detail/seq_state.h", + ], deps = [ "construct_destruct", "poll", "promise_factory", "promise_like", - "switch", - "//:gpr_platform", + "//:gpr", ], ) @@ -693,6 +702,7 @@ grpc_cc_library( "basic_seq", "poll", "promise_like", + "seq_state", "//:gpr_platform", ], ) @@ -713,6 +723,7 @@ grpc_cc_library( "poll", "promise_like", "promise_status", + "seq_state", "//:gpr_platform", ], ) @@ -1080,7 +1091,6 @@ grpc_cc_library( ], deps = [ "activity", - "basic_seq", "event_engine_memory_allocator", "exec_ctx_wakeup_scheduler", "experiments", diff --git a/src/core/ext/filters/channel_idle/channel_idle_filter.cc b/src/core/ext/filters/channel_idle/channel_idle_filter.cc index 34601e5e3a0a2..5a7d98efc4774 100644 --- a/src/core/ext/filters/channel_idle/channel_idle_filter.cc +++ b/src/core/ext/filters/channel_idle/channel_idle_filter.cc @@ -19,6 +19,7 @@ #include "src/core/ext/filters/channel_idle/channel_idle_filter.h" +#include #include #include diff --git a/src/core/lib/channel/connected_channel.cc b/src/core/lib/channel/connected_channel.cc index 83dcb93845b7a..29f0924b665ef 100644 --- a/src/core/lib/channel/connected_channel.cc +++ b/src/core/lib/channel/connected_channel.cc @@ -57,7 +57,6 @@ #include "src/core/lib/promise/activity.h" #include "src/core/lib/promise/arena_promise.h" #include "src/core/lib/promise/context.h" -#include "src/core/lib/promise/detail/basic_seq.h" #include "src/core/lib/promise/detail/status.h" #include "src/core/lib/promise/for_each.h" #include "src/core/lib/promise/if.h" diff --git a/src/core/lib/channel/promise_based_filter.cc b/src/core/lib/channel/promise_based_filter.cc index 27f3e5bca8d9d..f81bcc08ca218 100644 --- a/src/core/lib/channel/promise_based_filter.cc +++ b/src/core/lib/channel/promise_based_filter.cc @@ -38,7 +38,7 @@ #include "src/core/lib/gprpp/manual_constructor.h" #include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/iomgr/error.h" -#include "src/core/lib/promise/detail/basic_seq.h" +#include "src/core/lib/promise/seq.h" #include "src/core/lib/slice/slice.h" extern grpc_core::TraceFlag grpc_trace_channel; diff --git a/src/core/lib/promise/detail/basic_seq.h b/src/core/lib/promise/detail/basic_seq.h index 3ebb251a96125..663609d41928f 100644 --- a/src/core/lib/promise/detail/basic_seq.h +++ b/src/core/lib/promise/detail/basic_seq.h @@ -17,384 +17,13 @@ #include -#include -#include -#include -#include -#include - -#include "absl/meta/type_traits.h" -#include "absl/utility/utility.h" - #include "src/core/lib/gprpp/construct_destruct.h" -#include "src/core/lib/promise/detail/promise_factory.h" -#include "src/core/lib/promise/detail/promise_like.h" -#include "src/core/lib/promise/detail/switch.h" #include "src/core/lib/promise/poll.h" namespace grpc_core { namespace promise_detail { -// Helper for SeqState to evaluate some common types to all partial -// specializations. -template