aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.clang-tidy6
-rw-r--r--CMakeLists.txt45
-rw-r--r--Makefile48
-rw-r--r--bazel/grpc_build_system.bzl3
-rw-r--r--include/grpc/impl/codegen/grpc_types.h2
-rw-r--r--include/grpcpp/impl/codegen/server_interface.h29
-rw-r--r--include/grpcpp/server_builder.h2
-rw-r--r--src/compiler/csharp_generator.cc3
-rw-r--r--src/core/ext/filters/client_channel/http_proxy.cc13
-rw-r--r--src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc63
-rw-r--r--src/core/ext/filters/deadline/deadline_filter.cc5
-rw-r--r--src/core/ext/filters/load_reporting/server_load_reporting_filter.cc4
-rw-r--r--src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc2
-rw-r--r--src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc5
-rw-r--r--src/core/lib/iomgr/cfstream_handle.cc4
-rw-r--r--src/core/lib/iomgr/endpoint_pair_posix.cc4
-rw-r--r--src/core/lib/iomgr/ev_epoll1_linux.cc45
-rw-r--r--src/core/lib/iomgr/ev_epollex_linux.cc55
-rw-r--r--src/core/lib/iomgr/ev_epollsig_linux.cc68
-rw-r--r--src/core/lib/iomgr/ev_poll_posix.cc14
-rw-r--r--src/core/lib/iomgr/ev_posix.cc26
-rw-r--r--src/core/lib/iomgr/ev_posix.h24
-rw-r--r--src/core/lib/iomgr/tcp_client_cfstream.cc14
-rw-r--r--src/core/lib/iomgr/tcp_client_posix.cc8
-rw-r--r--src/core/lib/iomgr/tcp_posix.cc2
-rw-r--r--src/core/lib/iomgr/tcp_server_posix.cc6
-rw-r--r--src/core/lib/iomgr/tcp_server_utils_posix_common.cc2
-rw-r--r--src/core/lib/iomgr/udp_server.cc5
-rw-r--r--src/csharp/Grpc.Core.Testing/TestCalls.cs2
-rwxr-xr-xsrc/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj2
-rw-r--r--src/csharp/Grpc.Examples.Tests/MathClientMockableTest.cs101
-rw-r--r--src/csharp/Grpc.Examples.Tests/MathServiceImplTestabilityTest.cs47
-rw-r--r--src/csharp/Grpc.Examples/MathGrpc.cs24
-rw-r--r--src/csharp/Grpc.HealthCheck/HealthGrpc.cs8
-rw-r--r--src/csharp/Grpc.IntegrationTesting/BenchmarkServiceGrpc.cs24
-rw-r--r--src/csharp/Grpc.IntegrationTesting/GeneratedClientTest.cs23
-rwxr-xr-xsrc/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj1
-rw-r--r--src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs14
-rw-r--r--src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioServiceGrpc.cs8
-rw-r--r--src/csharp/Grpc.IntegrationTesting/TestGrpc.cs66
-rw-r--r--src/csharp/Grpc.IntegrationTesting/WorkerServiceGrpc.cs30
-rw-r--r--src/csharp/Grpc.Reflection/ReflectionGrpc.cs8
-rw-r--r--src/csharp/tests.json4
-rw-r--r--src/objective-c/GRPCClient/GRPCCall.m5
-rw-r--r--src/objective-c/GRPCClient/private/GRPCHost.m23
-rw-r--r--src/objective-c/tests/Connectivity/ConnectivityTestingApp.xcodeproj/project.pbxproj17
-rw-r--r--src/objective-c/tests/Connectivity/ConnectivityTestingApp/ViewController.m2
-rw-r--r--src/objective-c/tests/Connectivity/Podfile6
-rw-r--r--src/objective-c/tests/GRPCClientTests.m3
-rw-r--r--src/python/grpcio/grpc/__init__.py8
-rw-r--r--src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pxd.pxi (renamed from src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pxd)0
-rw-r--r--src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pyx.pxi (renamed from src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pyx)0
-rw-r--r--src/python/grpcio/grpc/_cython/cygrpc.pxd2
-rw-r--r--src/python/grpcio/grpc/_cython/cygrpc.pyx2
-rw-r--r--src/python/grpcio/grpc/_server.py19
-rw-r--r--src/python/grpcio_tests/tests/tests.json1
-rw-r--r--src/python/grpcio_tests/tests/unit/_server_test.py52
-rw-r--r--test/core/avl/avl_test.cc3361
-rw-r--r--test/core/iomgr/BUILD1
-rw-r--r--test/core/iomgr/ev_epollsig_linux_test.cc10
-rw-r--r--test/core/iomgr/fd_posix_test.cc16
-rw-r--r--test/core/iomgr/pollset_set_test.cc5
-rw-r--r--test/core/iomgr/tcp_posix_test.cc20
-rw-r--r--test/core/transport/status_conversion_test.cc25
-rw-r--r--test/cpp/microbenchmarks/bm_pollset.cc8
-rw-r--r--test/cpp/naming/BUILD18
-rw-r--r--test/cpp/naming/cancel_ares_query_test.cc289
-rwxr-xr-xtest/cpp/naming/gen_build_yaml.py19
-rw-r--r--test/cpp/naming/resolver_component_test.cc116
-rwxr-xr-xtools/distrib/run_clang_tidy.py8
-rw-r--r--tools/run_tests/generated/sources_and_headers.json20
-rw-r--r--tools/run_tests/generated/tests.json22
-rw-r--r--tools/run_tests/python_utils/upload_rbe_results.py2
-rw-r--r--tools/run_tests/python_utils/upload_test_results.py11
74 files changed, 1269 insertions, 3691 deletions
diff --git a/.clang-tidy b/.clang-tidy
new file mode 100644
index 0000000000..b8f74e973f
--- /dev/null
+++ b/.clang-tidy
@@ -0,0 +1,6 @@
+---
+Checks: 'modernize-use-nullptr,google-build-namespaces,google-build-explicit-make-pair,readability-function-size'
+WarningsAsErrors: 'modernize-use-nullptr,google-build-namespaces,google-build-explicit-make-pair,readability-function-size'
+CheckOptions:
+ - key: readability-function-size.StatementThreshold
+ value: '450'
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f9028e19b3..6562de1a6b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -664,6 +664,9 @@ endif()
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx address_sorting_test)
endif()
+if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
+add_dependencies(buildtests_cxx cancel_ares_query_test)
+endif()
add_custom_target(buildtests
DEPENDS buildtests_c buildtests_cxx)
@@ -16190,6 +16193,48 @@ target_link_libraries(address_sorting_test
endif()
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
+if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
+
+add_executable(cancel_ares_query_test
+ test/cpp/naming/cancel_ares_query_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+
+target_include_directories(cancel_ares_query_test
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
+ PRIVATE ${_gRPC_SSL_INCLUDE_DIR}
+ PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR}
+ PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR}
+ PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR}
+ PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
+ PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
+ PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE third_party/googletest/googletest/include
+ PRIVATE third_party/googletest/googletest
+ PRIVATE third_party/googletest/googlemock/include
+ PRIVATE third_party/googletest/googlemock
+ PRIVATE ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(cancel_ares_query_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc++_test_util
+ grpc_test_util
+ gpr_test_util
+ grpc++
+ grpc
+ gpr
+ grpc++_test_config
+ ${_gRPC_GFLAGS_LIBRARIES}
+)
+
+endif()
+endif (gRPC_BUILD_TESTS)
+if (gRPC_BUILD_TESTS)
add_executable(alts_credentials_fuzzer_one_entry
test/core/security/alts_credentials_fuzzer.cc
diff --git a/Makefile b/Makefile
index 36f79b92ef..9876b6094f 100644
--- a/Makefile
+++ b/Makefile
@@ -1314,6 +1314,7 @@ resolver_component_tests_runner_invoker_unsecure: $(BINDIR)/$(CONFIG)/resolver_c
resolver_component_tests_runner_invoker: $(BINDIR)/$(CONFIG)/resolver_component_tests_runner_invoker
address_sorting_test_unsecure: $(BINDIR)/$(CONFIG)/address_sorting_test_unsecure
address_sorting_test: $(BINDIR)/$(CONFIG)/address_sorting_test
+cancel_ares_query_test: $(BINDIR)/$(CONFIG)/cancel_ares_query_test
alts_credentials_fuzzer_one_entry: $(BINDIR)/$(CONFIG)/alts_credentials_fuzzer_one_entry
api_fuzzer_one_entry: $(BINDIR)/$(CONFIG)/api_fuzzer_one_entry
client_fuzzer_one_entry: $(BINDIR)/$(CONFIG)/client_fuzzer_one_entry
@@ -1751,6 +1752,7 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/resolver_component_tests_runner_invoker \
$(BINDIR)/$(CONFIG)/address_sorting_test_unsecure \
$(BINDIR)/$(CONFIG)/address_sorting_test \
+ $(BINDIR)/$(CONFIG)/cancel_ares_query_test \
else
buildtests_cxx: privatelibs_cxx \
@@ -1875,6 +1877,7 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/resolver_component_tests_runner_invoker \
$(BINDIR)/$(CONFIG)/address_sorting_test_unsecure \
$(BINDIR)/$(CONFIG)/address_sorting_test \
+ $(BINDIR)/$(CONFIG)/cancel_ares_query_test \
endif
@@ -2360,6 +2363,8 @@ test_cxx: buildtests_cxx
$(Q) $(BINDIR)/$(CONFIG)/address_sorting_test_unsecure || ( echo test address_sorting_test_unsecure failed ; exit 1 )
$(E) "[RUN] Testing address_sorting_test"
$(Q) $(BINDIR)/$(CONFIG)/address_sorting_test || ( echo test address_sorting_test failed ; exit 1 )
+ $(E) "[RUN] Testing cancel_ares_query_test"
+ $(Q) $(BINDIR)/$(CONFIG)/cancel_ares_query_test || ( echo test cancel_ares_query_test failed ; exit 1 )
flaky_test_cxx: buildtests_cxx
@@ -23687,6 +23692,49 @@ endif
endif
+CANCEL_ARES_QUERY_TEST_SRC = \
+ test/cpp/naming/cancel_ares_query_test.cc \
+
+CANCEL_ARES_QUERY_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(CANCEL_ARES_QUERY_TEST_SRC))))
+ifeq ($(NO_SECURE),true)
+
+# You can't build secure targets if you don't have OpenSSL.
+
+$(BINDIR)/$(CONFIG)/cancel_ares_query_test: openssl_dep_error
+
+else
+
+
+
+
+ifeq ($(NO_PROTOBUF),true)
+
+# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+.
+
+$(BINDIR)/$(CONFIG)/cancel_ares_query_test: protobuf_dep_error
+
+else
+
+$(BINDIR)/$(CONFIG)/cancel_ares_query_test: $(PROTOBUF_DEP) $(CANCEL_ARES_QUERY_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
+ $(E) "[LD] Linking $@"
+ $(Q) mkdir -p `dirname $@`
+ $(Q) $(LDXX) $(LDFLAGS) $(CANCEL_ARES_QUERY_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/cancel_ares_query_test
+
+endif
+
+endif
+
+$(OBJDIR)/$(CONFIG)/test/cpp/naming/cancel_ares_query_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
+
+deps_cancel_ares_query_test: $(CANCEL_ARES_QUERY_TEST_OBJS:.o=.dep)
+
+ifneq ($(NO_SECURE),true)
+ifneq ($(NO_DEPS),true)
+-include $(CANCEL_ARES_QUERY_TEST_OBJS:.o=.dep)
+endif
+endif
+
+
ALTS_CREDENTIALS_FUZZER_ONE_ENTRY_SRC = \
test/core/security/alts_credentials_fuzzer.cc \
test/core/util/one_corpus_entry_fuzzer.cc \
diff --git a/bazel/grpc_build_system.bzl b/bazel/grpc_build_system.bzl
index a682d89ec9..0a1edeb31c 100644
--- a/bazel/grpc_build_system.bzl
+++ b/bazel/grpc_build_system.bzl
@@ -108,7 +108,7 @@ def grpc_proto_library(name, srcs = [], deps = [], well_known_protos = False,
generate_mocks = generate_mocks,
)
-def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data = [], uses_polling = True, language = "C++", size = "medium", timeout = "moderate"):
+def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data = [], uses_polling = True, language = "C++", size = "medium", timeout = "moderate", tags = []):
copts = []
if language.upper() == "C":
copts = if_not_windows(["-std=c99"])
@@ -138,6 +138,7 @@ def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data
poller,
'$(location %s)' % name,
] + args['args'],
+ tags = tags,
)
else:
native.cc_test(**args)
diff --git a/include/grpc/impl/codegen/grpc_types.h b/include/grpc/impl/codegen/grpc_types.h
index 9329c61bf2..a5961857c1 100644
--- a/include/grpc/impl/codegen/grpc_types.h
+++ b/include/grpc/impl/codegen/grpc_types.h
@@ -336,6 +336,8 @@ typedef struct {
/** 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"
/** \} */
/** Result of a grpc call. If the caller satisfies the prerequisites of a
diff --git a/include/grpcpp/impl/codegen/server_interface.h b/include/grpcpp/impl/codegen/server_interface.h
index cf330ac352..237991cde6 100644
--- a/include/grpcpp/impl/codegen/server_interface.h
+++ b/include/grpcpp/impl/codegen/server_interface.h
@@ -49,12 +49,35 @@ class ServerInterface : public internal::CallHook {
public:
virtual ~ServerInterface() {}
- /// Shutdown the server, blocking until all rpc processing finishes.
- /// Forcefully terminate pending calls after \a deadline expires.
+ /// \a Shutdown does the following things:
+ ///
+ /// 1. Shutdown the server: deactivate all listening ports, mark it in
+ /// "shutdown mode" so that further call Request's or incoming RPC matches
+ /// are no longer allowed. Also return all Request'ed-but-not-yet-active
+ /// calls as failed (!ok). This refers to calls that have been requested
+ /// at the server by the server-side library or application code but that
+ /// have not yet been matched to incoming RPCs from the client. Note that
+ /// this would even include default calls added automatically by the gRPC
+ /// C++ API without the user's input (e.g., "Unimplemented RPC method")
+ ///
+ /// 2. Block until all rpc method handlers invoked automatically by the sync
+ /// API finish.
+ ///
+ /// 3. If all pending calls complete (and all their operations are
+ /// retrieved by Next) before \a deadline expires, this finishes
+ /// gracefully. Otherwise, forcefully cancel all pending calls associated
+ /// with the server after \a deadline expires. In the case of the sync API,
+ /// if the RPC function for a streaming call has already been started and
+ /// takes a week to complete, the RPC function won't be forcefully
+ /// terminated (since that would leave state corrupt and incomplete) and
+ /// the method handler will just keep running (which will prevent the
+ /// server from completing the "join" operation that it needs to do at
+ /// shutdown time).
///
/// All completion queue associated with the server (for example, for async
/// serving) must be shutdown *after* this method has returned:
/// See \a ServerBuilder::AddCompletionQueue for details.
+ /// They must also be drained (by repeated Next) after being shutdown.
///
/// \param deadline How long to wait until pending rpcs are forcefully
/// terminated.
@@ -63,7 +86,7 @@ class ServerInterface : public internal::CallHook {
ShutdownInternal(TimePoint<T>(deadline).raw_time());
}
- /// Shutdown the server, waiting for all rpc processing to finish.
+ /// Shutdown the server without a deadline and forced cancellation.
///
/// All completion queue associated with the server (for example, for async
/// serving) must be shutdown *after* this method has returned:
diff --git a/include/grpcpp/server_builder.h b/include/grpcpp/server_builder.h
index 4c8dcf4916..d1454d4b44 100644
--- a/include/grpcpp/server_builder.h
+++ b/include/grpcpp/server_builder.h
@@ -144,12 +144,14 @@ class ServerBuilder {
// Fine control knobs
/// Set max receive message size in bytes.
+ /// The default is GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH.
ServerBuilder& SetMaxReceiveMessageSize(int max_receive_message_size) {
max_receive_message_size_ = max_receive_message_size;
return *this;
}
/// Set max send message size in bytes.
+ /// The default is GRPC_DEFAULT_MAX_SEND_MESSAGE_LENGTH.
ServerBuilder& SetMaxSendMessageSize(int max_send_message_size) {
max_send_message_size_ = max_send_message_size;
return *this;
diff --git a/src/compiler/csharp_generator.cc b/src/compiler/csharp_generator.cc
index 1c51f6da94..a923ce8e38 100644
--- a/src/compiler/csharp_generator.cc
+++ b/src/compiler/csharp_generator.cc
@@ -202,7 +202,8 @@ std::string GetCSharpMethodType(MethodType method_type) {
std::string GetServiceNameFieldName() { return "__ServiceName"; }
std::string GetMarshallerFieldName(const Descriptor* message) {
- return "__Marshaller_" + message->name();
+ return "__Marshaller_" +
+ grpc_generator::StringReplace(message->full_name(), ".", "_", true);
}
std::string GetMethodFieldName(const MethodDescriptor* method) {
diff --git a/src/core/ext/filters/client_channel/http_proxy.cc b/src/core/ext/filters/client_channel/http_proxy.cc
index 29a6c0e367..9baccd8628 100644
--- a/src/core/ext/filters/client_channel/http_proxy.cc
+++ b/src/core/ext/filters/client_channel/http_proxy.cc
@@ -83,11 +83,24 @@ done:
return proxy_name;
}
+/**
+ * Checks the value of GRPC_ARG_ENABLE_HTTP_PROXY to determine if http_proxy
+ * should be used.
+ */
+bool http_proxy_enabled(const grpc_channel_args* args) {
+ const grpc_arg* arg =
+ grpc_channel_args_find(args, GRPC_ARG_ENABLE_HTTP_PROXY);
+ return grpc_channel_arg_get_bool(arg, true);
+}
+
static bool proxy_mapper_map_name(grpc_proxy_mapper* mapper,
const char* server_uri,
const grpc_channel_args* args,
char** name_to_resolve,
grpc_channel_args** new_args) {
+ if (!http_proxy_enabled(args)) {
+ return false;
+ }
char* user_cred = nullptr;
*name_to_resolve = get_http_proxy_server(&user_cred);
if (*name_to_resolve == nullptr) return false;
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 ebe2c4c41c..f496e9694d 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
@@ -21,6 +21,7 @@
#if GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_ARES_EV_DRIVER)
#include <ares.h>
+#include <string.h>
#include <sys/ioctl.h>
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h"
@@ -55,8 +56,8 @@ typedef struct fd_node {
bool readable_registered;
/** if the writable closure has been registered */
bool writable_registered;
- /** if the fd is being shut down */
- bool shutting_down;
+ /** if the fd has been shutdown yet from grpc iomgr perspective */
+ bool already_shutdown;
} fd_node;
struct grpc_ares_ev_driver {
@@ -101,25 +102,20 @@ static void fd_node_destroy(fd_node* fdn) {
gpr_log(GPR_DEBUG, "delete fd: %d", grpc_fd_wrapped_fd(fdn->fd));
GPR_ASSERT(!fdn->readable_registered);
GPR_ASSERT(!fdn->writable_registered);
+ GPR_ASSERT(fdn->already_shutdown);
gpr_mu_destroy(&fdn->mu);
/* c-ares library has closed the fd inside grpc_fd. This fd may be picked up
immediately by another thread, and should not be closed by the following
grpc_fd_orphan. */
- grpc_fd_orphan(fdn->fd, nullptr, nullptr, true /* already_closed */,
- "c-ares query finished");
+ int dummy_release_fd;
+ grpc_fd_orphan(fdn->fd, nullptr, &dummy_release_fd, "c-ares query finished");
gpr_free(fdn);
}
-static void fd_node_shutdown(fd_node* fdn) {
- gpr_mu_lock(&fdn->mu);
- fdn->shutting_down = true;
- if (!fdn->readable_registered && !fdn->writable_registered) {
- gpr_mu_unlock(&fdn->mu);
- fd_node_destroy(fdn);
- } else {
- grpc_fd_shutdown(
- fdn->fd, GRPC_ERROR_CREATE_FROM_STATIC_STRING("c-ares fd shutdown"));
- gpr_mu_unlock(&fdn->mu);
+static void fd_node_shutdown_locked(fd_node* fdn, const char* reason) {
+ if (!fdn->already_shutdown) {
+ fdn->already_shutdown = true;
+ grpc_fd_shutdown(fdn->fd, GRPC_ERROR_CREATE_FROM_STATIC_STRING(reason));
}
}
@@ -127,7 +123,10 @@ grpc_error* grpc_ares_ev_driver_create(grpc_ares_ev_driver** ev_driver,
grpc_pollset_set* pollset_set) {
*ev_driver = static_cast<grpc_ares_ev_driver*>(
gpr_malloc(sizeof(grpc_ares_ev_driver)));
- int status = ares_init(&(*ev_driver)->channel);
+ ares_options opts;
+ memset(&opts, 0, sizeof(opts));
+ opts.flags |= ARES_FLAG_STAYOPEN;
+ int status = ares_init_options(&(*ev_driver)->channel, &opts, ARES_OPT_FLAGS);
gpr_log(GPR_DEBUG, "grpc_ares_ev_driver_create");
if (status != ARES_SUCCESS) {
char* err_msg;
@@ -164,8 +163,9 @@ void grpc_ares_ev_driver_shutdown(grpc_ares_ev_driver* ev_driver) {
ev_driver->shutting_down = true;
fd_node* fn = ev_driver->fds;
while (fn != nullptr) {
- grpc_fd_shutdown(fn->fd, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "grpc_ares_ev_driver_shutdown"));
+ gpr_mu_lock(&fn->mu);
+ fd_node_shutdown_locked(fn, "grpc_ares_ev_driver_shutdown");
+ gpr_mu_unlock(&fn->mu);
fn = fn->next;
}
gpr_mu_unlock(&ev_driver->mu);
@@ -202,14 +202,7 @@ static void on_readable_cb(void* arg, grpc_error* error) {
gpr_mu_lock(&fdn->mu);
const int fd = grpc_fd_wrapped_fd(fdn->fd);
fdn->readable_registered = false;
- if (fdn->shutting_down && !fdn->writable_registered) {
- gpr_mu_unlock(&fdn->mu);
- fd_node_destroy(fdn);
- grpc_ares_ev_driver_unref(ev_driver);
- return;
- }
gpr_mu_unlock(&fdn->mu);
-
gpr_log(GPR_DEBUG, "readable on %d", fd);
if (error == GRPC_ERROR_NONE) {
do {
@@ -236,14 +229,7 @@ static void on_writable_cb(void* arg, grpc_error* error) {
gpr_mu_lock(&fdn->mu);
const int fd = grpc_fd_wrapped_fd(fdn->fd);
fdn->writable_registered = false;
- if (fdn->shutting_down && !fdn->readable_registered) {
- gpr_mu_unlock(&fdn->mu);
- fd_node_destroy(fdn);
- grpc_ares_ev_driver_unref(ev_driver);
- return;
- }
gpr_mu_unlock(&fdn->mu);
-
gpr_log(GPR_DEBUG, "writable on %d", fd);
if (error == GRPC_ERROR_NONE) {
ares_process_fd(ev_driver->channel, ARES_SOCKET_BAD, fd);
@@ -284,11 +270,11 @@ static void grpc_ares_notify_on_event_locked(grpc_ares_ev_driver* ev_driver) {
gpr_asprintf(&fd_name, "ares_ev_driver-%" PRIuPTR, i);
fdn = static_cast<fd_node*>(gpr_malloc(sizeof(fd_node)));
gpr_log(GPR_DEBUG, "new fd: %d", socks[i]);
- fdn->fd = grpc_fd_create(socks[i], fd_name);
+ fdn->fd = grpc_fd_create(socks[i], fd_name, false);
fdn->ev_driver = ev_driver;
fdn->readable_registered = false;
fdn->writable_registered = false;
- fdn->shutting_down = false;
+ fdn->already_shutdown = false;
gpr_mu_init(&fdn->mu);
GRPC_CLOSURE_INIT(&fdn->read_closure, on_readable_cb, fdn,
grpc_schedule_on_exec_ctx);
@@ -329,7 +315,16 @@ static void grpc_ares_notify_on_event_locked(grpc_ares_ev_driver* ev_driver) {
while (ev_driver->fds != nullptr) {
fd_node* cur = ev_driver->fds;
ev_driver->fds = ev_driver->fds->next;
- fd_node_shutdown(cur);
+ gpr_mu_lock(&cur->mu);
+ fd_node_shutdown_locked(cur, "c-ares fd shutdown");
+ if (!cur->readable_registered && !cur->writable_registered) {
+ gpr_mu_unlock(&cur->mu);
+ fd_node_destroy(cur);
+ } else {
+ cur->next = new_list;
+ new_list = cur;
+ gpr_mu_unlock(&cur->mu);
+ }
}
ev_driver->fds = new_list;
// If the ev driver has no working fd, all the tasks are done.
diff --git a/src/core/ext/filters/deadline/deadline_filter.cc b/src/core/ext/filters/deadline/deadline_filter.cc
index 27d3eac8d6..e0a41a3637 100644
--- a/src/core/ext/filters/deadline/deadline_filter.cc
+++ b/src/core/ext/filters/deadline/deadline_filter.cc
@@ -289,11 +289,10 @@ static void client_start_transport_stream_op_batch(
static void recv_initial_metadata_ready(void* arg, grpc_error* error) {
grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
server_call_data* calld = static_cast<server_call_data*>(elem->call_data);
- // Get deadline from metadata and start the timer if needed.
start_timer_if_needed(elem, calld->recv_initial_metadata->deadline);
// Invoke the next callback.
- calld->next_recv_initial_metadata_ready->cb(
- calld->next_recv_initial_metadata_ready->cb_arg, error);
+ GRPC_CLOSURE_RUN(calld->next_recv_initial_metadata_ready,
+ GRPC_ERROR_REF(error));
}
// Method for starting a call op for server filter.
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 0d349e2a89..a8f70333b2 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
@@ -82,9 +82,7 @@ static void on_initial_md_ready(void* user_data, grpc_error* err) {
} else {
GRPC_ERROR_REF(err);
}
- calld->ops_recv_initial_metadata_ready->cb(
- calld->ops_recv_initial_metadata_ready->cb_arg, err);
- GRPC_ERROR_UNREF(err);
+ GRPC_CLOSURE_RUN(calld->ops_recv_initial_metadata_ready, err);
}
/* Constructor for call_data */
diff --git a/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc b/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
index b95c9dae53..dfed824cd5 100644
--- a/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
+++ b/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
@@ -50,7 +50,7 @@ grpc_channel* grpc_insecure_channel_create_from_fd(
GPR_ASSERT(fcntl(fd, F_SETFL, flags | O_NONBLOCK) == 0);
grpc_endpoint* client = grpc_tcp_client_create_from_fd(
- grpc_fd_create(fd, "client"), args, "fd-client");
+ grpc_fd_create(fd, "client", false), args, "fd-client");
grpc_transport* transport =
grpc_create_chttp2_transport(final_args, client, true);
diff --git a/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc b/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
index 371e463814..a0228785ee 100644
--- a/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
+++ b/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
@@ -43,8 +43,9 @@ void grpc_server_add_insecure_channel_from_fd(grpc_server* server,
char* name;
gpr_asprintf(&name, "fd:%d", fd);
- grpc_endpoint* server_endpoint = grpc_tcp_create(
- grpc_fd_create(fd, name), grpc_server_get_channel_args(server), name);
+ grpc_endpoint* server_endpoint =
+ grpc_tcp_create(grpc_fd_create(fd, name, false),
+ grpc_server_get_channel_args(server), name);
gpr_free(name);
diff --git a/src/core/lib/iomgr/cfstream_handle.cc b/src/core/lib/iomgr/cfstream_handle.cc
index 30f4e65632..827fd24831 100644
--- a/src/core/lib/iomgr/cfstream_handle.cc
+++ b/src/core/lib/iomgr/cfstream_handle.cc
@@ -116,7 +116,9 @@ CFStreamHandle::CFStreamHandle(CFReadStreamRef read_stream,
open_event_.InitEvent();
read_event_.InitEvent();
write_event_.InitEvent();
- CFStreamClientContext ctx = {0, static_cast<void*>(this), nil, nil, nil};
+ CFStreamClientContext ctx = {0, static_cast<void*>(this),
+ CFStreamHandle::Retain, CFStreamHandle::Release,
+ nil};
CFReadStreamSetClient(
read_stream,
kCFStreamEventOpenCompleted | kCFStreamEventHasBytesAvailable |
diff --git a/src/core/lib/iomgr/endpoint_pair_posix.cc b/src/core/lib/iomgr/endpoint_pair_posix.cc
index 49850ab3a1..5c5c246f99 100644
--- a/src/core/lib/iomgr/endpoint_pair_posix.cc
+++ b/src/core/lib/iomgr/endpoint_pair_posix.cc
@@ -59,11 +59,11 @@ grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(const char* name,
grpc_core::ExecCtx exec_ctx;
gpr_asprintf(&final_name, "%s:client", name);
- p.client = grpc_tcp_create(grpc_fd_create(sv[1], final_name), args,
+ p.client = grpc_tcp_create(grpc_fd_create(sv[1], final_name, false), args,
"socketpair-server");
gpr_free(final_name);
gpr_asprintf(&final_name, "%s:server", name);
- p.server = grpc_tcp_create(grpc_fd_create(sv[0], final_name), args,
+ p.server = grpc_tcp_create(grpc_fd_create(sv[0], final_name, false), args,
"socketpair-client");
gpr_free(final_name);
diff --git a/src/core/lib/iomgr/ev_epoll1_linux.cc b/src/core/lib/iomgr/ev_epoll1_linux.cc
index cf839619cd..86a0243d2e 100644
--- a/src/core/lib/iomgr/ev_epoll1_linux.cc
+++ b/src/core/lib/iomgr/ev_epoll1_linux.cc
@@ -136,6 +136,7 @@ struct grpc_fd {
grpc_core::ManualConstructor<grpc_core::LockfreeEvent> read_closure;
grpc_core::ManualConstructor<grpc_core::LockfreeEvent> write_closure;
+ grpc_core::ManualConstructor<grpc_core::LockfreeEvent> error_closure;
struct grpc_fd* freelist_next;
@@ -272,7 +273,7 @@ static void fd_global_shutdown(void) {
gpr_mu_destroy(&fd_freelist_mu);
}
-static grpc_fd* fd_create(int fd, const char* name) {
+static grpc_fd* fd_create(int fd, const char* name, bool track_err) {
grpc_fd* new_fd = nullptr;
gpr_mu_lock(&fd_freelist_mu);
@@ -286,11 +287,12 @@ static grpc_fd* fd_create(int fd, const char* name) {
new_fd = static_cast<grpc_fd*>(gpr_malloc(sizeof(grpc_fd)));
new_fd->read_closure.Init();
new_fd->write_closure.Init();
+ new_fd->error_closure.Init();
}
-
new_fd->fd = fd;
new_fd->read_closure->InitEvent();
new_fd->write_closure->InitEvent();
+ new_fd->error_closure->InitEvent();
gpr_atm_no_barrier_store(&new_fd->read_notifier_pollset, (gpr_atm)NULL);
new_fd->freelist_next = nullptr;
@@ -307,7 +309,13 @@ static grpc_fd* fd_create(int fd, const char* name) {
struct epoll_event ev;
ev.events = static_cast<uint32_t>(EPOLLIN | EPOLLOUT | EPOLLET);
- ev.data.ptr = new_fd;
+ /* Use the least significant bit of ev.data.ptr to store track_err. We expect
+ * the addresses to be word aligned. We need to store track_err to avoid
+ * synchronization issues when accessing it after receiving an event.
+ * Accessing fd would be a data race there because the fd might have been
+ * returned to the free list at that point. */
+ ev.data.ptr = reinterpret_cast<void*>(reinterpret_cast<intptr_t>(new_fd) |
+ (track_err ? 1 : 0));
if (epoll_ctl(g_epoll_set.epfd, EPOLL_CTL_ADD, fd, &ev) != 0) {
gpr_log(GPR_ERROR, "epoll_ctl failed: %s", strerror(errno));
}
@@ -327,6 +335,7 @@ static void fd_shutdown_internal(grpc_fd* fd, grpc_error* why,
shutdown(fd->fd, SHUT_RDWR);
}
fd->write_closure->SetShutdown(GRPC_ERROR_REF(why));
+ fd->error_closure->SetShutdown(GRPC_ERROR_REF(why));
}
GRPC_ERROR_UNREF(why);
}
@@ -337,7 +346,7 @@ static void fd_shutdown(grpc_fd* fd, grpc_error* why) {
}
static void fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
- bool already_closed, const char* reason) {
+ const char* reason) {
grpc_error* error = GRPC_ERROR_NONE;
bool is_release_fd = (release_fd != nullptr);
@@ -350,7 +359,7 @@ static void fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
descriptor fd->fd (but we still own the grpc_fd structure). */
if (is_release_fd) {
*release_fd = fd->fd;
- } else if (!already_closed) {
+ } else {
close(fd->fd);
}
@@ -359,6 +368,7 @@ static void fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
grpc_iomgr_unregister_object(&fd->iomgr_object);
fd->read_closure->DestroyEvent();
fd->write_closure->DestroyEvent();
+ fd->error_closure->DestroyEvent();
gpr_mu_lock(&fd_freelist_mu);
fd->freelist_next = fd_freelist;
@@ -383,6 +393,10 @@ static void fd_notify_on_write(grpc_fd* fd, grpc_closure* closure) {
fd->write_closure->NotifyOn(closure);
}
+static void fd_notify_on_error(grpc_fd* fd, grpc_closure* closure) {
+ fd->error_closure->NotifyOn(closure);
+}
+
static void fd_become_readable(grpc_fd* fd, grpc_pollset* notifier) {
fd->read_closure->SetReady();
/* Use release store to match with acquire load in fd_get_read_notifier */
@@ -391,6 +405,8 @@ static void fd_become_readable(grpc_fd* fd, grpc_pollset* notifier) {
static void fd_become_writable(grpc_fd* fd) { fd->write_closure->SetReady(); }
+static void fd_has_errors(grpc_fd* fd) { fd->error_closure->SetReady(); }
+
/*******************************************************************************
* Pollset Definitions
*/
@@ -611,16 +627,25 @@ static grpc_error* process_epoll_events(grpc_pollset* pollset) {
append_error(&error, grpc_wakeup_fd_consume_wakeup(&global_wakeup_fd),
err_desc);
} else {
- grpc_fd* fd = static_cast<grpc_fd*>(data_ptr);
- bool cancel = (ev->events & (EPOLLERR | EPOLLHUP)) != 0;
+ grpc_fd* fd = reinterpret_cast<grpc_fd*>(
+ reinterpret_cast<intptr_t>(data_ptr) & ~static_cast<intptr_t>(1));
+ bool track_err =
+ reinterpret_cast<intptr_t>(data_ptr) & static_cast<intptr_t>(1);
+ bool cancel = (ev->events & EPOLLHUP) != 0;
+ bool error = (ev->events & EPOLLERR) != 0;
bool read_ev = (ev->events & (EPOLLIN | EPOLLPRI)) != 0;
bool write_ev = (ev->events & EPOLLOUT) != 0;
+ bool err_fallback = error && !track_err;
+
+ if (error && !err_fallback) {
+ fd_has_errors(fd);
+ }
- if (read_ev || cancel) {
+ if (read_ev || cancel || err_fallback) {
fd_become_readable(fd, pollset);
}
- if (write_ev || cancel) {
+ if (write_ev || cancel || err_fallback) {
fd_become_writable(fd);
}
}
@@ -1183,6 +1208,7 @@ static void shutdown_engine(void) {
static const grpc_event_engine_vtable vtable = {
sizeof(grpc_pollset),
+ true,
fd_create,
fd_wrapped_fd,
@@ -1190,6 +1216,7 @@ static const grpc_event_engine_vtable vtable = {
fd_shutdown,
fd_notify_on_read,
fd_notify_on_write,
+ fd_notify_on_error,
fd_is_shutdown,
fd_get_read_notifier_pollset,
diff --git a/src/core/lib/iomgr/ev_epollex_linux.cc b/src/core/lib/iomgr/ev_epollex_linux.cc
index 7903297fc6..111b62171b 100644
--- a/src/core/lib/iomgr/ev_epollex_linux.cc
+++ b/src/core/lib/iomgr/ev_epollex_linux.cc
@@ -175,6 +175,7 @@ struct grpc_fd {
grpc_core::ManualConstructor<grpc_core::LockfreeEvent> read_closure;
grpc_core::ManualConstructor<grpc_core::LockfreeEvent> write_closure;
+ grpc_core::ManualConstructor<grpc_core::LockfreeEvent> error_closure;
struct grpc_fd* freelist_next;
grpc_closure* on_done_closure;
@@ -184,6 +185,9 @@ struct grpc_fd {
gpr_atm read_notifier_pollset;
grpc_iomgr_object iomgr_object;
+
+ /* Do we need to track EPOLLERR events separately? */
+ bool track_err;
};
static void fd_global_init(void);
@@ -309,6 +313,7 @@ static void fd_destroy(void* arg, grpc_error* error) {
fd->read_closure->DestroyEvent();
fd->write_closure->DestroyEvent();
+ fd->error_closure->DestroyEvent();
gpr_mu_unlock(&fd_freelist_mu);
}
@@ -348,7 +353,7 @@ static void fd_global_shutdown(void) {
gpr_mu_destroy(&fd_freelist_mu);
}
-static grpc_fd* fd_create(int fd, const char* name) {
+static grpc_fd* fd_create(int fd, const char* name, bool track_err) {
grpc_fd* new_fd = nullptr;
gpr_mu_lock(&fd_freelist_mu);
@@ -362,6 +367,7 @@ static grpc_fd* fd_create(int fd, const char* name) {
new_fd = static_cast<grpc_fd*>(gpr_malloc(sizeof(grpc_fd)));
new_fd->read_closure.Init();
new_fd->write_closure.Init();
+ new_fd->error_closure.Init();
}
gpr_mu_init(&new_fd->pollable_mu);
@@ -369,9 +375,11 @@ static grpc_fd* fd_create(int fd, const char* name) {
new_fd->pollable_obj = nullptr;
gpr_atm_rel_store(&new_fd->refst, (gpr_atm)1);
new_fd->fd = fd;
+ new_fd->track_err = track_err;
new_fd->salt = gpr_atm_no_barrier_fetch_add(&g_fd_salt, 1);
new_fd->read_closure->InitEvent();
new_fd->write_closure->InitEvent();
+ new_fd->error_closure->InitEvent();
gpr_atm_no_barrier_store(&new_fd->read_notifier_pollset, (gpr_atm)NULL);
new_fd->freelist_next = nullptr;
@@ -395,8 +403,8 @@ static int fd_wrapped_fd(grpc_fd* fd) {
}
static void fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
- bool already_closed, const char* reason) {
- bool is_fd_closed = already_closed;
+ const char* reason) {
+ bool is_fd_closed = false;
gpr_mu_lock(&fd->orphan_mu);
@@ -406,7 +414,7 @@ static void fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
descriptor fd->fd (but we still own the grpc_fd structure). */
if (release_fd != nullptr) {
*release_fd = fd->fd;
- } else if (!is_fd_closed) {
+ } else {
close(fd->fd);
is_fd_closed = true;
}
@@ -438,8 +446,14 @@ static bool fd_is_shutdown(grpc_fd* fd) {
/* Might be called multiple times */
static void fd_shutdown(grpc_fd* fd, grpc_error* why) {
if (fd->read_closure->SetShutdown(GRPC_ERROR_REF(why))) {
- shutdown(fd->fd, SHUT_RDWR);
+ if (shutdown(fd->fd, SHUT_RDWR)) {
+ if (errno != ENOTCONN) {
+ gpr_log(GPR_ERROR, "Error shutting down fd %d. errno: %d",
+ grpc_fd_wrapped_fd(fd), errno);
+ }
+ }
fd->write_closure->SetShutdown(GRPC_ERROR_REF(why));
+ fd->error_closure->SetShutdown(GRPC_ERROR_REF(why));
}
GRPC_ERROR_UNREF(why);
}
@@ -452,6 +466,10 @@ static void fd_notify_on_write(grpc_fd* fd, grpc_closure* closure) {
fd->write_closure->NotifyOn(closure);
}
+static void fd_notify_on_error(grpc_fd* fd, grpc_closure* closure) {
+ fd->error_closure->NotifyOn(closure);
+}
+
/*******************************************************************************
* Pollable Definitions
*/
@@ -579,7 +597,12 @@ static grpc_error* pollable_add_fd(pollable* p, grpc_fd* fd) {
struct epoll_event ev_fd;
ev_fd.events =
static_cast<uint32_t>(EPOLLET | EPOLLIN | EPOLLOUT | EPOLLEXCLUSIVE);
- ev_fd.data.ptr = fd;
+ /* Use the second least significant bit of ev_fd.data.ptr to store track_err
+ * to avoid synchronization issues when accessing it after receiving an event.
+ * Accessing fd would be a data race there because the fd might have been
+ * returned to the free list at that point. */
+ ev_fd.data.ptr = reinterpret_cast<void*>(reinterpret_cast<intptr_t>(fd) |
+ (fd->track_err ? 2 : 0));
GRPC_STATS_INC_SYSCALL_EPOLL_CTL();
if (epoll_ctl(epfd, EPOLL_CTL_ADD, fd->fd, &ev_fd) != 0) {
switch (errno) {
@@ -780,6 +803,8 @@ static void fd_become_readable(grpc_fd* fd, grpc_pollset* notifier) {
static void fd_become_writable(grpc_fd* fd) { fd->write_closure->SetReady(); }
+static void fd_has_errors(grpc_fd* fd) { fd->error_closure->SetReady(); }
+
static grpc_error* fd_get_or_become_pollable(grpc_fd* fd, pollable** p) {
gpr_mu_lock(&fd->pollable_mu);
grpc_error* error = GRPC_ERROR_NONE;
@@ -848,20 +873,28 @@ static grpc_error* pollable_process_events(grpc_pollset* pollset,
(intptr_t)data_ptr)),
err_desc);
} else {
- grpc_fd* fd = static_cast<grpc_fd*>(data_ptr);
- bool cancel = (ev->events & (EPOLLERR | EPOLLHUP)) != 0;
+ grpc_fd* fd =
+ reinterpret_cast<grpc_fd*>(reinterpret_cast<intptr_t>(data_ptr) & ~2);
+ bool track_err = reinterpret_cast<intptr_t>(data_ptr) & 2;
+ bool cancel = (ev->events & EPOLLHUP) != 0;
+ bool error = (ev->events & EPOLLERR) != 0;
bool read_ev = (ev->events & (EPOLLIN | EPOLLPRI)) != 0;
bool write_ev = (ev->events & EPOLLOUT) != 0;
+ bool err_fallback = error && !track_err;
+
if (grpc_polling_trace.enabled()) {
gpr_log(GPR_INFO,
"PS:%p got fd %p: cancel=%d read=%d "
"write=%d",
pollset, fd, cancel, read_ev, write_ev);
}
- if (read_ev || cancel) {
+ if (error && !err_fallback) {
+ fd_has_errors(fd);
+ }
+ if (read_ev || cancel || err_fallback) {
fd_become_readable(fd, pollset);
}
- if (write_ev || cancel) {
+ if (write_ev || cancel || err_fallback) {
fd_become_writable(fd);
}
}
@@ -1503,6 +1536,7 @@ static void shutdown_engine(void) {
static const grpc_event_engine_vtable vtable = {
sizeof(grpc_pollset),
+ true,
fd_create,
fd_wrapped_fd,
@@ -1510,6 +1544,7 @@ static const grpc_event_engine_vtable vtable = {
fd_shutdown,
fd_notify_on_read,
fd_notify_on_write,
+ fd_notify_on_error,
fd_is_shutdown,
fd_get_read_notifier_pollset,
diff --git a/src/core/lib/iomgr/ev_epollsig_linux.cc b/src/core/lib/iomgr/ev_epollsig_linux.cc
index a144817a83..2189801c18 100644
--- a/src/core/lib/iomgr/ev_epollsig_linux.cc
+++ b/src/core/lib/iomgr/ev_epollsig_linux.cc
@@ -132,6 +132,7 @@ struct grpc_fd {
grpc_core::ManualConstructor<grpc_core::LockfreeEvent> read_closure;
grpc_core::ManualConstructor<grpc_core::LockfreeEvent> write_closure;
+ grpc_core::ManualConstructor<grpc_core::LockfreeEvent> error_closure;
struct grpc_fd* freelist_next;
grpc_closure* on_done_closure;
@@ -141,6 +142,9 @@ struct grpc_fd {
gpr_atm read_notifier_pollset;
grpc_iomgr_object iomgr_object;
+
+ /* Do we need to track EPOLLERR events separately? */
+ bool track_err;
};
/* Reference counting for fds */
@@ -352,7 +356,10 @@ static void polling_island_add_fds_locked(polling_island* pi, grpc_fd** fds,
for (i = 0; i < fd_count; i++) {
ev.events = static_cast<uint32_t>(EPOLLIN | EPOLLOUT | EPOLLET);
- ev.data.ptr = fds[i];
+ /* Use the least significant bit of ev.data.ptr to store track_err to avoid
+ * synchronization issues when accessing it after receiving an event */
+ ev.data.ptr = reinterpret_cast<void*>(reinterpret_cast<intptr_t>(fds[i]) |
+ (fds[i]->track_err ? 1 : 0));
err = epoll_ctl(pi->epoll_fd, EPOLL_CTL_ADD, fds[i]->fd, &ev);
if (err < 0) {
@@ -435,7 +442,6 @@ static void polling_island_remove_all_fds_locked(polling_island* pi,
/* The caller is expected to hold pi->mu lock before calling this function */
static void polling_island_remove_fd_locked(polling_island* pi, grpc_fd* fd,
- bool is_fd_closed,
grpc_error** error) {
int err;
size_t i;
@@ -444,16 +450,14 @@ static void polling_island_remove_fd_locked(polling_island* pi, grpc_fd* fd,
/* If fd is already closed, then it would have been automatically been removed
from the epoll set */
- if (!is_fd_closed) {
- err = epoll_ctl(pi->epoll_fd, EPOLL_CTL_DEL, fd->fd, nullptr);
- if (err < 0 && errno != ENOENT) {
- gpr_asprintf(
- &err_msg,
- "epoll_ctl (epoll_fd: %d) del fd: %d failed with error: %d (%s)",
- pi->epoll_fd, fd->fd, errno, strerror(errno));
- append_error(error, GRPC_OS_ERROR(errno, err_msg), err_desc);
- gpr_free(err_msg);
- }
+ err = epoll_ctl(pi->epoll_fd, EPOLL_CTL_DEL, fd->fd, nullptr);
+ if (err < 0 && errno != ENOENT) {
+ gpr_asprintf(
+ &err_msg,
+ "epoll_ctl (epoll_fd: %d) del fd: %d failed with error: %d (%s)",
+ pi->epoll_fd, fd->fd, errno, strerror(errno));
+ append_error(error, GRPC_OS_ERROR(errno, err_msg), err_desc);
+ gpr_free(err_msg);
}
for (i = 0; i < pi->fd_cnt; i++) {
@@ -769,6 +773,7 @@ static void unref_by(grpc_fd* fd, int n) {
fd->read_closure->DestroyEvent();
fd->write_closure->DestroyEvent();
+ fd->error_closure->DestroyEvent();
gpr_mu_unlock(&fd_freelist_mu);
} else {
@@ -806,7 +811,7 @@ static void fd_global_shutdown(void) {
gpr_mu_destroy(&fd_freelist_mu);
}
-static grpc_fd* fd_create(int fd, const char* name) {
+static grpc_fd* fd_create(int fd, const char* name, bool track_err) {
grpc_fd* new_fd = nullptr;
gpr_mu_lock(&fd_freelist_mu);
@@ -821,6 +826,7 @@ static grpc_fd* fd_create(int fd, const char* name) {
gpr_mu_init(&new_fd->po.mu);
new_fd->read_closure.Init();
new_fd->write_closure.Init();
+ new_fd->error_closure.Init();
}
/* Note: It is not really needed to get the new_fd->po.mu lock here. If this
@@ -837,6 +843,8 @@ static grpc_fd* fd_create(int fd, const char* name) {
new_fd->orphaned = false;
new_fd->read_closure->InitEvent();
new_fd->write_closure->InitEvent();
+ new_fd->error_closure->InitEvent();
+ new_fd->track_err = track_err;
gpr_atm_no_barrier_store(&new_fd->read_notifier_pollset, (gpr_atm)NULL);
new_fd->freelist_next = nullptr;
@@ -863,7 +871,7 @@ static int fd_wrapped_fd(grpc_fd* fd) {
}
static void fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
- bool already_closed, const char* reason) {
+ const char* reason) {
grpc_error* error = GRPC_ERROR_NONE;
polling_island* unref_pi = nullptr;
@@ -884,7 +892,7 @@ static void fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
before doing this.) */
if (fd->po.pi != nullptr) {
polling_island* pi_latest = polling_island_lock(fd->po.pi);
- polling_island_remove_fd_locked(pi_latest, fd, already_closed, &error);
+ polling_island_remove_fd_locked(pi_latest, fd, &error);
gpr_mu_unlock(&pi_latest->mu);
unref_pi = fd->po.pi;
@@ -933,6 +941,7 @@ static void fd_shutdown(grpc_fd* fd, grpc_error* why) {
if (fd->read_closure->SetShutdown(GRPC_ERROR_REF(why))) {
shutdown(fd->fd, SHUT_RDWR);
fd->write_closure->SetShutdown(GRPC_ERROR_REF(why));
+ fd->error_closure->SetShutdown(GRPC_ERROR_REF(why));
}
GRPC_ERROR_UNREF(why);
}
@@ -945,6 +954,10 @@ static void fd_notify_on_write(grpc_fd* fd, grpc_closure* closure) {
fd->write_closure->NotifyOn(closure);
}
+static void fd_notify_on_error(grpc_fd* fd, grpc_closure* closure) {
+ fd->error_closure->NotifyOn(closure);
+}
+
/*******************************************************************************
* Pollset Definitions
*/
@@ -1116,6 +1129,8 @@ static void fd_become_readable(grpc_fd* fd, grpc_pollset* notifier) {
static void fd_become_writable(grpc_fd* fd) { fd->write_closure->SetReady(); }
+static void fd_has_errors(grpc_fd* fd) { fd->error_closure->SetReady(); }
+
static void pollset_release_polling_island(grpc_pollset* ps,
const char* reason) {
if (ps->po.pi != nullptr) {
@@ -1254,14 +1269,23 @@ static void pollset_work_and_unlock(grpc_pollset* pollset,
to the function pollset_work_and_unlock() will pick up the correct
epoll_fd */
} else {
- grpc_fd* fd = static_cast<grpc_fd*>(data_ptr);
- int cancel = ep_ev[i].events & (EPOLLERR | EPOLLHUP);
- int read_ev = ep_ev[i].events & (EPOLLIN | EPOLLPRI);
- int write_ev = ep_ev[i].events & EPOLLOUT;
- if (read_ev || cancel) {
+ grpc_fd* fd = reinterpret_cast<grpc_fd*>(
+ reinterpret_cast<intptr_t>(data_ptr) & ~static_cast<intptr_t>(1));
+ bool track_err =
+ reinterpret_cast<intptr_t>(data_ptr) & ~static_cast<intptr_t>(1);
+ bool cancel = (ep_ev[i].events & EPOLLHUP) != 0;
+ bool error = (ep_ev[i].events & EPOLLERR) != 0;
+ bool read_ev = (ep_ev[i].events & (EPOLLIN | EPOLLPRI)) != 0;
+ bool write_ev = (ep_ev[i].events & EPOLLOUT) != 0;
+ bool err_fallback = error && !track_err;
+
+ if (error && !err_fallback) {
+ fd_has_errors(fd);
+ }
+ if (read_ev || cancel || err_fallback) {
fd_become_readable(fd, pollset);
}
- if (write_ev || cancel) {
+ if (write_ev || cancel || err_fallback) {
fd_become_writable(fd);
}
}
@@ -1634,6 +1658,7 @@ static void shutdown_engine(void) {
static const grpc_event_engine_vtable vtable = {
sizeof(grpc_pollset),
+ true,
fd_create,
fd_wrapped_fd,
@@ -1641,6 +1666,7 @@ static const grpc_event_engine_vtable vtable = {
fd_shutdown,
fd_notify_on_read,
fd_notify_on_write,
+ fd_notify_on_error,
fd_is_shutdown,
fd_get_read_notifier_pollset,
diff --git a/src/core/lib/iomgr/ev_poll_posix.cc b/src/core/lib/iomgr/ev_poll_posix.cc
index 70958ed562..c9c09881a2 100644
--- a/src/core/lib/iomgr/ev_poll_posix.cc
+++ b/src/core/lib/iomgr/ev_poll_posix.cc
@@ -330,7 +330,8 @@ static void unref_by(grpc_fd* fd, int n) {
}
}
-static grpc_fd* fd_create(int fd, const char* name) {
+static grpc_fd* fd_create(int fd, const char* name, bool track_err) {
+ GPR_DEBUG_ASSERT(track_err == false);
grpc_fd* r = static_cast<grpc_fd*>(gpr_malloc(sizeof(*r)));
gpr_mu_init(&r->mu);
gpr_atm_rel_store(&r->refst, 1);
@@ -424,14 +425,12 @@ static int fd_wrapped_fd(grpc_fd* fd) {
}
static void fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
- bool already_closed, const char* reason) {
+ const char* reason) {
fd->on_done_closure = on_done;
fd->released = release_fd != nullptr;
if (release_fd != nullptr) {
*release_fd = fd->fd;
fd->released = true;
- } else if (already_closed) {
- fd->released = true;
}
gpr_mu_lock(&fd->mu);
REF_BY(fd, 1, reason); /* remove active status, but keep referenced */
@@ -553,6 +552,11 @@ static void fd_notify_on_write(grpc_fd* fd, grpc_closure* closure) {
gpr_mu_unlock(&fd->mu);
}
+static void fd_notify_on_error(grpc_fd* fd, grpc_closure* closure) {
+ gpr_log(GPR_ERROR, "Polling engine does not support tracking errors.");
+ abort();
+}
+
static uint32_t fd_begin_poll(grpc_fd* fd, grpc_pollset* pollset,
grpc_pollset_worker* worker, uint32_t read_mask,
uint32_t write_mask, grpc_fd_watcher* watcher) {
@@ -1710,6 +1714,7 @@ static void shutdown_engine(void) {
static const grpc_event_engine_vtable vtable = {
sizeof(grpc_pollset),
+ false,
fd_create,
fd_wrapped_fd,
@@ -1717,6 +1722,7 @@ static const grpc_event_engine_vtable vtable = {
fd_shutdown,
fd_notify_on_read,
fd_notify_on_write,
+ fd_notify_on_error,
fd_is_shutdown,
fd_get_read_notifier_pollset,
diff --git a/src/core/lib/iomgr/ev_posix.cc b/src/core/lib/iomgr/ev_posix.cc
index 6b7eca0afa..1139b3273a 100644
--- a/src/core/lib/iomgr/ev_posix.cc
+++ b/src/core/lib/iomgr/ev_posix.cc
@@ -193,10 +193,15 @@ void grpc_event_engine_shutdown(void) {
g_event_engine = nullptr;
}
-grpc_fd* grpc_fd_create(int fd, const char* name) {
- GRPC_POLLING_API_TRACE("fd_create(%d, %s)", fd, name);
- GRPC_FD_TRACE("fd_create(%d, %s)", fd, name);
- return g_event_engine->fd_create(fd, name);
+bool grpc_event_engine_can_track_errors(void) {
+ return g_event_engine->can_track_err;
+}
+
+grpc_fd* grpc_fd_create(int fd, const char* name, bool track_err) {
+ GRPC_POLLING_API_TRACE("fd_create(%d, %s, %d)", fd, name, track_err);
+ GRPC_FD_TRACE("fd_create(%d, %s, %d)", fd, name, track_err);
+ GPR_DEBUG_ASSERT(!track_err || g_event_engine->can_track_err);
+ return g_event_engine->fd_create(fd, name, track_err);
}
int grpc_fd_wrapped_fd(grpc_fd* fd) {
@@ -204,13 +209,12 @@ int grpc_fd_wrapped_fd(grpc_fd* fd) {
}
void grpc_fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
- bool already_closed, const char* reason) {
- GRPC_POLLING_API_TRACE("fd_orphan(%d, %p, %p, %d, %s)",
- grpc_fd_wrapped_fd(fd), on_done, release_fd,
- already_closed, reason);
+ const char* reason) {
+ GRPC_POLLING_API_TRACE("fd_orphan(%d, %p, %p, %s)", grpc_fd_wrapped_fd(fd),
+ on_done, release_fd, reason);
GRPC_FD_TRACE("grpc_fd_orphan, fd:%d closed", grpc_fd_wrapped_fd(fd));
- g_event_engine->fd_orphan(fd, on_done, release_fd, already_closed, reason);
+ g_event_engine->fd_orphan(fd, on_done, release_fd, reason);
}
void grpc_fd_shutdown(grpc_fd* fd, grpc_error* why) {
@@ -231,6 +235,10 @@ void grpc_fd_notify_on_write(grpc_fd* fd, grpc_closure* closure) {
g_event_engine->fd_notify_on_write(fd, closure);
}
+void grpc_fd_notify_on_error(grpc_fd* fd, grpc_closure* closure) {
+ g_event_engine->fd_notify_on_error(fd, closure);
+}
+
static size_t pollset_size(void) { return g_event_engine->pollset_size; }
static void pollset_init(grpc_pollset* pollset, gpr_mu** mu) {
diff --git a/src/core/lib/iomgr/ev_posix.h b/src/core/lib/iomgr/ev_posix.h
index 82cbce9a7b..b4c17fc80d 100644
--- a/src/core/lib/iomgr/ev_posix.h
+++ b/src/core/lib/iomgr/ev_posix.h
@@ -41,14 +41,16 @@ typedef struct grpc_fd grpc_fd;
typedef struct grpc_event_engine_vtable {
size_t pollset_size;
+ bool can_track_err;
- grpc_fd* (*fd_create)(int fd, const char* name);
+ grpc_fd* (*fd_create)(int fd, const char* name, bool track_err);
int (*fd_wrapped_fd)(grpc_fd* fd);
void (*fd_orphan)(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
- bool already_closed, const char* reason);
+ const char* reason);
void (*fd_shutdown)(grpc_fd* fd, grpc_error* why);
void (*fd_notify_on_read)(grpc_fd* fd, grpc_closure* closure);
void (*fd_notify_on_write)(grpc_fd* fd, grpc_closure* closure);
+ void (*fd_notify_on_error)(grpc_fd* fd, grpc_closure* closure);
bool (*fd_is_shutdown)(grpc_fd* fd);
grpc_pollset* (*fd_get_read_notifier_pollset)(grpc_fd* fd);
@@ -84,10 +86,20 @@ void grpc_event_engine_shutdown(void);
/* Return the name of the poll strategy */
const char* grpc_get_poll_strategy_name();
+/* Returns true if polling engine can track errors separately, false otherwise.
+ * If this is true, fd can be created with track_err set. After this, error
+ * events will be reported using fd_notify_on_error. If it is not set, errors
+ * will continue to be reported through fd_notify_on_read and
+ * fd_notify_on_write.
+ */
+bool grpc_event_engine_can_track_errors();
+
/* Create a wrapped file descriptor.
Requires fd is a non-blocking file descriptor.
+ \a track_err if true means that error events would be tracked separately
+ using grpc_fd_notify_on_error. Currently, valid only for linux systems.
This takes ownership of closing fd. */
-grpc_fd* grpc_fd_create(int fd, const char* name);
+grpc_fd* grpc_fd_create(int fd, const char* name, bool track_err);
/* Return the wrapped fd, or -1 if it has been released or closed. */
int grpc_fd_wrapped_fd(grpc_fd* fd);
@@ -100,7 +112,7 @@ int grpc_fd_wrapped_fd(grpc_fd* fd);
notify_on_write.
MUST NOT be called with a pollset lock taken */
void grpc_fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
- bool already_closed, const char* reason);
+ const char* reason);
/* Has grpc_fd_shutdown been called on an fd? */
bool grpc_fd_is_shutdown(grpc_fd* fd);
@@ -126,6 +138,10 @@ void grpc_fd_notify_on_read(grpc_fd* fd, grpc_closure* closure);
/* Exactly the same semantics as above, except based on writable events. */
void grpc_fd_notify_on_write(grpc_fd* fd, grpc_closure* closure);
+/* Exactly the same semantics as above, except based on error events. track_err
+ * needs to have been set on grpc_fd_create */
+void grpc_fd_notify_on_error(grpc_fd* fd, grpc_closure* closure);
+
/* Return the read notifier pollset from the fd */
grpc_pollset* grpc_fd_get_read_notifier_pollset(grpc_fd* fd);
diff --git a/src/core/lib/iomgr/tcp_client_cfstream.cc b/src/core/lib/iomgr/tcp_client_cfstream.cc
index ffed3bbef6..5acea91792 100644
--- a/src/core/lib/iomgr/tcp_client_cfstream.cc
+++ b/src/core/lib/iomgr/tcp_client_cfstream.cc
@@ -52,7 +52,7 @@ typedef struct CFStreamConnect {
CFReadStreamRef read_stream;
CFWriteStreamRef write_stream;
- CFStreamHandle* stream_sync;
+ CFStreamHandle* stream_handle;
grpc_timer alarm;
grpc_closure on_alarm;
@@ -71,7 +71,7 @@ typedef struct CFStreamConnect {
static void CFStreamConnectCleanup(CFStreamConnect* connect) {
grpc_resource_quota_unref_internal(connect->resource_quota);
- CFSTREAM_HANDLE_UNREF(connect->stream_sync, "async connect clean up");
+ CFSTREAM_HANDLE_UNREF(connect->stream_handle, "async connect clean up");
CFRelease(connect->read_stream);
CFRelease(connect->write_stream);
gpr_mu_destroy(&connect->mu);
@@ -131,7 +131,7 @@ static void OnOpen(void* arg, grpc_error* error) {
if (error == GRPC_ERROR_NONE) {
*endpoint = grpc_cfstream_endpoint_create(
connect->read_stream, connect->write_stream, connect->addr_name,
- connect->resource_quota, connect->stream_sync);
+ connect->resource_quota, connect->stream_handle);
}
} else {
GRPC_ERROR_REF(error);
@@ -170,8 +170,8 @@ static void CFStreamClientConnect(grpc_closure* closure, grpc_endpoint** ep,
gpr_mu_init(&connect->mu);
if (grpc_tcp_trace.enabled()) {
- gpr_log(GPR_DEBUG, "CLIENT_CONNECT: %s: asynchronously connecting",
- connect->addr_name);
+ gpr_log(GPR_DEBUG, "CLIENT_CONNECT: %p, %s: asynchronously connecting",
+ connect, connect->addr_name);
}
grpc_resource_quota* resource_quota = grpc_resource_quota_create(NULL);
@@ -197,11 +197,11 @@ static void CFStreamClientConnect(grpc_closure* closure, grpc_endpoint** ep,
CFRelease(host);
connect->read_stream = read_stream;
connect->write_stream = write_stream;
- connect->stream_sync =
+ connect->stream_handle =
CFStreamHandle::CreateStreamHandle(read_stream, write_stream);
GRPC_CLOSURE_INIT(&connect->on_open, OnOpen, static_cast<void*>(connect),
grpc_schedule_on_exec_ctx);
- connect->stream_sync->NotifyOnOpen(&connect->on_open);
+ connect->stream_handle->NotifyOnOpen(&connect->on_open);
GRPC_CLOSURE_INIT(&connect->on_alarm, OnAlarm, connect,
grpc_schedule_on_exec_ctx);
gpr_mu_lock(&connect->mu);
diff --git a/src/core/lib/iomgr/tcp_client_posix.cc b/src/core/lib/iomgr/tcp_client_posix.cc
index 39da7f1637..296ee74311 100644
--- a/src/core/lib/iomgr/tcp_client_posix.cc
+++ b/src/core/lib/iomgr/tcp_client_posix.cc
@@ -211,8 +211,7 @@ static void on_writable(void* acp, grpc_error* error) {
finish:
if (fd != nullptr) {
grpc_pollset_set_del_fd(ac->interested_parties, fd);
- grpc_fd_orphan(fd, nullptr, nullptr, false /* already_closed */,
- "tcp_client_orphan");
+ grpc_fd_orphan(fd, nullptr, nullptr, "tcp_client_orphan");
fd = nullptr;
}
done = (--ac->refs == 0);
@@ -280,7 +279,7 @@ grpc_error* grpc_tcp_client_prepare_fd(const grpc_channel_args* channel_args,
}
addr_str = grpc_sockaddr_to_uri(mapped_addr);
gpr_asprintf(&name, "tcp-client:%s", addr_str);
- *fdobj = grpc_fd_create(fd, name);
+ *fdobj = grpc_fd_create(fd, name, false);
gpr_free(name);
gpr_free(addr_str);
return GRPC_ERROR_NONE;
@@ -305,8 +304,7 @@ void grpc_tcp_client_create_from_prepared_fd(
return;
}
if (errno != EWOULDBLOCK && errno != EINPROGRESS) {
- grpc_fd_orphan(fdobj, nullptr, nullptr, false /* already_closed */,
- "tcp_client_connect_error");
+ grpc_fd_orphan(fdobj, nullptr, nullptr, "tcp_client_connect_error");
GRPC_CLOSURE_SCHED(closure, GRPC_OS_ERROR(errno, "connect"));
return;
}
diff --git a/src/core/lib/iomgr/tcp_posix.cc b/src/core/lib/iomgr/tcp_posix.cc
index 43d545846d..9df2e206b2 100644
--- a/src/core/lib/iomgr/tcp_posix.cc
+++ b/src/core/lib/iomgr/tcp_posix.cc
@@ -297,7 +297,7 @@ static void tcp_shutdown(grpc_endpoint* ep, grpc_error* why) {
static void tcp_free(grpc_tcp* tcp) {
grpc_fd_orphan(tcp->em_fd, tcp->release_fd_cb, tcp->release_fd,
- false /* already_closed */, "tcp_unref_orphan");
+ "tcp_unref_orphan");
grpc_slice_buffer_destroy_internal(&tcp->last_read_buffer);
grpc_resource_user_unref(tcp->resource_user);
gpr_free(tcp->peer_string);
diff --git a/src/core/lib/iomgr/tcp_server_posix.cc b/src/core/lib/iomgr/tcp_server_posix.cc
index 0a5caca906..8ddf684fea 100644
--- a/src/core/lib/iomgr/tcp_server_posix.cc
+++ b/src/core/lib/iomgr/tcp_server_posix.cc
@@ -150,7 +150,7 @@ static void deactivated_all_ports(grpc_tcp_server* s) {
GRPC_CLOSURE_INIT(&sp->destroyed_closure, destroyed_port, s,
grpc_schedule_on_exec_ctx);
grpc_fd_orphan(sp->emfd, &sp->destroyed_closure, nullptr,
- false /* already_closed */, "tcp_listener_shutdown");
+ "tcp_listener_shutdown");
}
gpr_mu_unlock(&s->mu);
} else {
@@ -226,7 +226,7 @@ static void on_read(void* arg, grpc_error* err) {
gpr_log(GPR_INFO, "SERVER_CONNECT: incoming connection: %s", addr_str);
}
- grpc_fd* fdobj = grpc_fd_create(fd, name);
+ grpc_fd* fdobj = grpc_fd_create(fd, name, false);
read_notifier_pollset =
sp->server->pollsets[static_cast<size_t>(gpr_atm_no_barrier_fetch_add(
@@ -362,7 +362,7 @@ static grpc_error* clone_port(grpc_tcp_listener* listener, unsigned count) {
listener->sibling = sp;
sp->server = listener->server;
sp->fd = fd;
- sp->emfd = grpc_fd_create(fd, name);
+ sp->emfd = grpc_fd_create(fd, name, false);
memcpy(&sp->addr, &listener->addr, sizeof(grpc_resolved_address));
sp->port = port;
sp->port_index = listener->port_index;
diff --git a/src/core/lib/iomgr/tcp_server_utils_posix_common.cc b/src/core/lib/iomgr/tcp_server_utils_posix_common.cc
index 73afa15e65..b9f8145572 100644
--- a/src/core/lib/iomgr/tcp_server_utils_posix_common.cc
+++ b/src/core/lib/iomgr/tcp_server_utils_posix_common.cc
@@ -105,7 +105,7 @@ static grpc_error* add_socket_to_server(grpc_tcp_server* s, int fd,
s->tail = sp;
sp->server = s;
sp->fd = fd;
- sp->emfd = grpc_fd_create(fd, name);
+ sp->emfd = grpc_fd_create(fd, name, false);
memcpy(&sp->addr, addr, sizeof(grpc_resolved_address));
sp->port = port;
sp->port_index = port_index;
diff --git a/src/core/lib/iomgr/udp_server.cc b/src/core/lib/iomgr/udp_server.cc
index 51d17eb174..bdb2d0e764 100644
--- a/src/core/lib/iomgr/udp_server.cc
+++ b/src/core/lib/iomgr/udp_server.cc
@@ -152,7 +152,7 @@ GrpcUdpListener::GrpcUdpListener(grpc_udp_server* server, int fd,
grpc_sockaddr_to_string(&addr_str, addr, 1);
gpr_asprintf(&name, "udp-server-listener:%s", addr_str);
gpr_free(addr_str);
- emfd_ = grpc_fd_create(fd, name);
+ emfd_ = grpc_fd_create(fd, name, false);
memcpy(&addr_, addr, sizeof(grpc_resolved_address));
GPR_ASSERT(emfd_);
gpr_free(name);
@@ -300,8 +300,7 @@ void GrpcUdpListener::OrphanFd() {
grpc_schedule_on_exec_ctx);
/* Because at this point, all listening sockets have been shutdown already, no
* need to call OnFdAboutToOrphan() to notify the handler again. */
- grpc_fd_orphan(emfd_, &destroyed_closure_, nullptr,
- false /* already_closed */, "udp_listener_shutdown");
+ grpc_fd_orphan(emfd_, &destroyed_closure_, nullptr, "udp_listener_shutdown");
}
void grpc_udp_server_destroy(grpc_udp_server* s, grpc_closure* on_done) {
diff --git a/src/csharp/Grpc.Core.Testing/TestCalls.cs b/src/csharp/Grpc.Core.Testing/TestCalls.cs
index ac29a8b974..8c76781bbe 100644
--- a/src/csharp/Grpc.Core.Testing/TestCalls.cs
+++ b/src/csharp/Grpc.Core.Testing/TestCalls.cs
@@ -65,7 +65,7 @@ namespace Grpc.Core.Testing
/// Creates a test double for <c>AsyncDuplexStreamingCall</c>. Only for testing.
/// Note: experimental API that can change or be removed without any prior notice.
/// </summary>
- public static AsyncDuplexStreamingCall<TRequest, TResponse> AsyncDuplexStreamingCall<TResponse, TRequest>(
+ public static AsyncDuplexStreamingCall<TRequest, TResponse> AsyncDuplexStreamingCall<TRequest, TResponse>(
IClientStreamWriter<TRequest> requestStream, IAsyncStreamReader<TResponse> responseStream,
Task<Metadata> responseHeadersAsync, Func<Status> getStatusFunc,
Func<Metadata> getTrailersFunc, Action disposeAction)
diff --git a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj
index 3ccc9adfaf..d2cc5bbc65 100755
--- a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj
+++ b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj
@@ -13,11 +13,13 @@
<ItemGroup>
<ProjectReference Include="../Grpc.Examples/Grpc.Examples.csproj" />
+ <ProjectReference Include="../Grpc.Core.Testing/Grpc.Core.Testing.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="NUnit" Version="3.6.0" />
<PackageReference Include="NUnitLite" Version="3.6.0" />
+ <PackageReference Include="Moq" Version="4.8.2" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
diff --git a/src/csharp/Grpc.Examples.Tests/MathClientMockableTest.cs b/src/csharp/Grpc.Examples.Tests/MathClientMockableTest.cs
new file mode 100644
index 0000000000..6ed7b0a937
--- /dev/null
+++ b/src/csharp/Grpc.Examples.Tests/MathClientMockableTest.cs
@@ -0,0 +1,101 @@
+#region Copyright notice and license
+
+// Copyright 2018 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.
+
+#endregion
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Grpc.Core;
+using Grpc.Core.Testing;
+using NUnit.Framework;
+
+namespace Math.Tests
+{
+ /// <summary>
+ /// Demonstrates how to mock method stubs for all method types in a generated client.
+ /// </summary>
+ public class MathClientMockableTest
+ {
+ [Test]
+ public void ClientBaseBlockingUnaryCallCanBeMocked()
+ {
+ var mockClient = new Moq.Mock<Math.MathClient>();
+
+ var expected = new DivReply();
+ mockClient.Setup(m => m.Div(Moq.It.IsAny<DivArgs>(), null, null, CancellationToken.None)).Returns(expected);
+ Assert.AreSame(expected, mockClient.Object.Div(new DivArgs()));
+ }
+
+ [Test]
+ public void ClientBaseBlockingUnaryCallWithCallOptionsCallCanBeMocked()
+ {
+ var mockClient = new Moq.Mock<Math.MathClient>();
+
+ var expected = new DivReply();
+ mockClient.Setup(m => m.Div(Moq.It.IsAny<DivArgs>(), Moq.It.IsAny<CallOptions>())).Returns(expected);
+ Assert.AreSame(expected, mockClient.Object.Div(new DivArgs(), new CallOptions()));
+ }
+
+ [Test]
+ public void ClientBaseAsyncUnaryCallCanBeMocked()
+ {
+ var mockClient = new Moq.Mock<Math.MathClient>();
+
+ // Use a factory method provided by Grpc.Core.Testing.TestCalls to create an instance of a call.
+ var fakeCall = TestCalls.AsyncUnaryCall<DivReply>(Task.FromResult(new DivReply()), Task.FromResult(new Metadata()), () => Status.DefaultSuccess, () => new Metadata(), () => { });
+ mockClient.Setup(m => m.DivAsync(Moq.It.IsAny<DivArgs>(), null, null, CancellationToken.None)).Returns(fakeCall);
+ Assert.AreSame(fakeCall, mockClient.Object.DivAsync(new DivArgs()));
+ }
+
+ [Test]
+ public void ClientBaseClientStreamingCallCanBeMocked()
+ {
+ var mockClient = new Moq.Mock<Math.MathClient>();
+ var mockRequestStream = new Moq.Mock<IClientStreamWriter<Num>>();
+
+ // Use a factory method provided by Grpc.Core.Testing.TestCalls to create an instance of a call.
+ var fakeCall = TestCalls.AsyncClientStreamingCall<Num, Num>(mockRequestStream.Object, Task.FromResult(new Num()), Task.FromResult(new Metadata()), () => Status.DefaultSuccess, () => new Metadata(), () => { });
+ mockClient.Setup(m => m.Sum(null, null, CancellationToken.None)).Returns(fakeCall);
+ Assert.AreSame(fakeCall, mockClient.Object.Sum());
+ }
+
+ [Test]
+ public void ClientBaseServerStreamingCallCanBeMocked()
+ {
+ var mockClient = new Moq.Mock<Math.MathClient>();
+ var mockResponseStream = new Moq.Mock<IAsyncStreamReader<Num>>();
+
+ // Use a factory method provided by Grpc.Core.Testing.TestCalls to create an instance of a call.
+ var fakeCall = TestCalls.AsyncServerStreamingCall<Num>(mockResponseStream.Object, Task.FromResult(new Metadata()), () => Status.DefaultSuccess, () => new Metadata(), () => { });
+ mockClient.Setup(m => m.Fib(Moq.It.IsAny<FibArgs>(), null, null, CancellationToken.None)).Returns(fakeCall);
+ Assert.AreSame(fakeCall, mockClient.Object.Fib(new FibArgs()));
+ }
+
+ [Test]
+ public void ClientBaseDuplexStreamingCallCanBeMocked()
+ {
+ var mockClient = new Moq.Mock<Math.MathClient>();
+ var mockRequestStream = new Moq.Mock<IClientStreamWriter<DivArgs>>();
+ var mockResponseStream = new Moq.Mock<IAsyncStreamReader<DivReply>>();
+
+ // Use a factory method provided by Grpc.Core.Testing.TestCalls to create an instance of a call.
+ var fakeCall = TestCalls.AsyncDuplexStreamingCall<DivArgs, DivReply>(mockRequestStream.Object, mockResponseStream.Object, Task.FromResult(new Metadata()), () => Status.DefaultSuccess, () => new Metadata(), () => { });
+ mockClient.Setup(m => m.DivMany(null, null, CancellationToken.None)).Returns(fakeCall);
+ Assert.AreSame(fakeCall, mockClient.Object.DivMany());
+ }
+ }
+}
diff --git a/src/csharp/Grpc.Examples.Tests/MathServiceImplTestabilityTest.cs b/src/csharp/Grpc.Examples.Tests/MathServiceImplTestabilityTest.cs
new file mode 100644
index 0000000000..7c5fb94408
--- /dev/null
+++ b/src/csharp/Grpc.Examples.Tests/MathServiceImplTestabilityTest.cs
@@ -0,0 +1,47 @@
+#region Copyright notice and license
+
+// Copyright 2018 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.
+
+#endregion
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Grpc.Core;
+using Grpc.Core.Testing;
+using Grpc.Core.Utils;
+using NUnit.Framework;
+
+namespace Math.Tests
+{
+ /// <summary>
+ /// Demonstrates how to unit test implementations of generated server stubs.
+ /// </summary>
+ public class MathServiceImplTestabilityTest
+ {
+ [Test]
+ public async Task ServerCallImplIsTestable()
+ {
+ var mathImpl = new MathServiceImpl();
+
+ // Use a factory method provided by Grpc.Core.Testing.TestServerCallContext to create an instance of server call context.
+ // This allows testing even those server-side implementations that rely on the contents of ServerCallContext.
+ var fakeServerCallContext = TestServerCallContext.Create("fooMethod", null, DateTime.UtcNow.AddHours(1), new Metadata(), CancellationToken.None, "127.0.0.1", null, null, (metadata) => TaskUtils.CompletedTask, () => new WriteOptions(), (writeOptions) => { });
+ var response = await mathImpl.Div(new DivArgs { Dividend = 10, Divisor = 2 }, fakeServerCallContext);
+ Assert.AreEqual(5, response.Quotient);
+ Assert.AreEqual(0, response.Remainder);
+ }
+ }
+}
diff --git a/src/csharp/Grpc.Examples/MathGrpc.cs b/src/csharp/Grpc.Examples/MathGrpc.cs
index a4739da81d..9578bb4d81 100644
--- a/src/csharp/Grpc.Examples/MathGrpc.cs
+++ b/src/csharp/Grpc.Examples/MathGrpc.cs
@@ -27,38 +27,38 @@ namespace Math {
{
static readonly string __ServiceName = "math.Math";
- static readonly grpc::Marshaller<global::Math.DivArgs> __Marshaller_DivArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.DivArgs.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Math.DivReply> __Marshaller_DivReply = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.DivReply.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Math.FibArgs> __Marshaller_FibArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.FibArgs.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Math.Num> __Marshaller_Num = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.Num.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Math.DivArgs> __Marshaller_math_DivArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.DivArgs.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Math.DivReply> __Marshaller_math_DivReply = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.DivReply.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Math.FibArgs> __Marshaller_math_FibArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.FibArgs.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Math.Num> __Marshaller_math_Num = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.Num.Parser.ParseFrom);
static readonly grpc::Method<global::Math.DivArgs, global::Math.DivReply> __Method_Div = new grpc::Method<global::Math.DivArgs, global::Math.DivReply>(
grpc::MethodType.Unary,
__ServiceName,
"Div",
- __Marshaller_DivArgs,
- __Marshaller_DivReply);
+ __Marshaller_math_DivArgs,
+ __Marshaller_math_DivReply);
static readonly grpc::Method<global::Math.DivArgs, global::Math.DivReply> __Method_DivMany = new grpc::Method<global::Math.DivArgs, global::Math.DivReply>(
grpc::MethodType.DuplexStreaming,
__ServiceName,
"DivMany",
- __Marshaller_DivArgs,
- __Marshaller_DivReply);
+ __Marshaller_math_DivArgs,
+ __Marshaller_math_DivReply);
static readonly grpc::Method<global::Math.FibArgs, global::Math.Num> __Method_Fib = new grpc::Method<global::Math.FibArgs, global::Math.Num>(
grpc::MethodType.ServerStreaming,
__ServiceName,
"Fib",
- __Marshaller_FibArgs,
- __Marshaller_Num);
+ __Marshaller_math_FibArgs,
+ __Marshaller_math_Num);
static readonly grpc::Method<global::Math.Num, global::Math.Num> __Method_Sum = new grpc::Method<global::Math.Num, global::Math.Num>(
grpc::MethodType.ClientStreaming,
__ServiceName,
"Sum",
- __Marshaller_Num,
- __Marshaller_Num);
+ __Marshaller_math_Num,
+ __Marshaller_math_Num);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
diff --git a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs
index ebd890e48d..5e79c04d2a 100644
--- a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs
+++ b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs
@@ -30,15 +30,15 @@ namespace Grpc.Health.V1 {
{
static readonly string __ServiceName = "grpc.health.v1.Health";
- static readonly grpc::Marshaller<global::Grpc.Health.V1.HealthCheckRequest> __Marshaller_HealthCheckRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1.HealthCheckRequest.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Health.V1.HealthCheckResponse> __Marshaller_HealthCheckResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1.HealthCheckResponse.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Health.V1.HealthCheckRequest> __Marshaller_grpc_health_v1_HealthCheckRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1.HealthCheckRequest.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Health.V1.HealthCheckResponse> __Marshaller_grpc_health_v1_HealthCheckResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1.HealthCheckResponse.Parser.ParseFrom);
static readonly grpc::Method<global::Grpc.Health.V1.HealthCheckRequest, global::Grpc.Health.V1.HealthCheckResponse> __Method_Check = new grpc::Method<global::Grpc.Health.V1.HealthCheckRequest, global::Grpc.Health.V1.HealthCheckResponse>(
grpc::MethodType.Unary,
__ServiceName,
"Check",
- __Marshaller_HealthCheckRequest,
- __Marshaller_HealthCheckResponse);
+ __Marshaller_grpc_health_v1_HealthCheckRequest,
+ __Marshaller_grpc_health_v1_HealthCheckResponse);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
diff --git a/src/csharp/Grpc.IntegrationTesting/BenchmarkServiceGrpc.cs b/src/csharp/Grpc.IntegrationTesting/BenchmarkServiceGrpc.cs
index e2a4b93cef..b5738593f2 100644
--- a/src/csharp/Grpc.IntegrationTesting/BenchmarkServiceGrpc.cs
+++ b/src/csharp/Grpc.IntegrationTesting/BenchmarkServiceGrpc.cs
@@ -29,43 +29,43 @@ namespace Grpc.Testing {
{
static readonly string __ServiceName = "grpc.testing.BenchmarkService";
- static readonly grpc::Marshaller<global::Grpc.Testing.SimpleRequest> __Marshaller_SimpleRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.SimpleResponse> __Marshaller_SimpleResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.SimpleRequest> __Marshaller_grpc_testing_SimpleRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.SimpleResponse> __Marshaller_grpc_testing_SimpleResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom);
static readonly grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_UnaryCall = new grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
grpc::MethodType.Unary,
__ServiceName,
"UnaryCall",
- __Marshaller_SimpleRequest,
- __Marshaller_SimpleResponse);
+ __Marshaller_grpc_testing_SimpleRequest,
+ __Marshaller_grpc_testing_SimpleResponse);
static readonly grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_StreamingCall = new grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
grpc::MethodType.DuplexStreaming,
__ServiceName,
"StreamingCall",
- __Marshaller_SimpleRequest,
- __Marshaller_SimpleResponse);
+ __Marshaller_grpc_testing_SimpleRequest,
+ __Marshaller_grpc_testing_SimpleResponse);
static readonly grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_StreamingFromClient = new grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
grpc::MethodType.ClientStreaming,
__ServiceName,
"StreamingFromClient",
- __Marshaller_SimpleRequest,
- __Marshaller_SimpleResponse);
+ __Marshaller_grpc_testing_SimpleRequest,
+ __Marshaller_grpc_testing_SimpleResponse);
static readonly grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_StreamingFromServer = new grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
grpc::MethodType.ServerStreaming,
__ServiceName,
"StreamingFromServer",
- __Marshaller_SimpleRequest,
- __Marshaller_SimpleResponse);
+ __Marshaller_grpc_testing_SimpleRequest,
+ __Marshaller_grpc_testing_SimpleResponse);
static readonly grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_StreamingBothWays = new grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
grpc::MethodType.DuplexStreaming,
__ServiceName,
"StreamingBothWays",
- __Marshaller_SimpleRequest,
- __Marshaller_SimpleResponse);
+ __Marshaller_grpc_testing_SimpleRequest,
+ __Marshaller_grpc_testing_SimpleResponse);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
diff --git a/src/csharp/Grpc.IntegrationTesting/GeneratedClientTest.cs b/src/csharp/Grpc.IntegrationTesting/GeneratedClientTest.cs
index 2462606879..c8bcb7a93f 100644
--- a/src/csharp/Grpc.IntegrationTesting/GeneratedClientTest.cs
+++ b/src/csharp/Grpc.IntegrationTesting/GeneratedClientTest.cs
@@ -34,29 +34,6 @@ namespace Grpc.IntegrationTesting
TestService.TestServiceClient unimplementedClient = new UnimplementedTestServiceClient();
[Test]
- public void ExpandedParamOverloadCanBeMocked()
- {
- var expected = new SimpleResponse();
-
- var mockClient = new Moq.Mock<TestService.TestServiceClient>();
- // mocking is relatively clumsy because one needs to specify value for all the optional params.
- mockClient.Setup(m => m.UnaryCall(Moq.It.IsAny<SimpleRequest>(), null, null, CancellationToken.None)).Returns(expected);
-
- Assert.AreSame(expected, mockClient.Object.UnaryCall(new SimpleRequest()));
- }
-
- [Test]
- public void CallOptionsOverloadCanBeMocked()
- {
- var expected = new SimpleResponse();
-
- var mockClient = new Moq.Mock<TestService.TestServiceClient>();
- mockClient.Setup(m => m.UnaryCall(Moq.It.IsAny<SimpleRequest>(), Moq.It.IsAny<CallOptions>())).Returns(expected);
-
- Assert.AreSame(expected, mockClient.Object.UnaryCall(new SimpleRequest(), new CallOptions()));
- }
-
- [Test]
public void DefaultMethodStubThrows_UnaryCall()
{
Assert.Throws(typeof(NotImplementedException), () => unimplementedClient.UnaryCall(new SimpleRequest()));
diff --git a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj
index ba2107a576..e4f36d8810 100755
--- a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj
+++ b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj
@@ -19,7 +19,6 @@
<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="$(GoogleProtobufVersion)" />
<PackageReference Include="CommandLineParser" Version="2.1.1-beta" />
- <PackageReference Include="Moq" Version="4.8.2" />
<PackageReference Include="NUnit" Version="3.6.0" />
<PackageReference Include="NUnitLite" Version="3.6.0" />
</ItemGroup>
diff --git a/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs b/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs
index e8c566e167..9f16f41ac1 100644
--- a/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs
+++ b/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs
@@ -33,23 +33,23 @@ namespace Grpc.Testing {
{
static readonly string __ServiceName = "grpc.testing.MetricsService";
- static readonly grpc::Marshaller<global::Grpc.Testing.EmptyMessage> __Marshaller_EmptyMessage = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.EmptyMessage.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.GaugeResponse> __Marshaller_GaugeResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.GaugeResponse.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.GaugeRequest> __Marshaller_GaugeRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.GaugeRequest.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.EmptyMessage> __Marshaller_grpc_testing_EmptyMessage = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.EmptyMessage.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.GaugeResponse> __Marshaller_grpc_testing_GaugeResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.GaugeResponse.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.GaugeRequest> __Marshaller_grpc_testing_GaugeRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.GaugeRequest.Parser.ParseFrom);
static readonly grpc::Method<global::Grpc.Testing.EmptyMessage, global::Grpc.Testing.GaugeResponse> __Method_GetAllGauges = new grpc::Method<global::Grpc.Testing.EmptyMessage, global::Grpc.Testing.GaugeResponse>(
grpc::MethodType.ServerStreaming,
__ServiceName,
"GetAllGauges",
- __Marshaller_EmptyMessage,
- __Marshaller_GaugeResponse);
+ __Marshaller_grpc_testing_EmptyMessage,
+ __Marshaller_grpc_testing_GaugeResponse);
static readonly grpc::Method<global::Grpc.Testing.GaugeRequest, global::Grpc.Testing.GaugeResponse> __Method_GetGauge = new grpc::Method<global::Grpc.Testing.GaugeRequest, global::Grpc.Testing.GaugeResponse>(
grpc::MethodType.Unary,
__ServiceName,
"GetGauge",
- __Marshaller_GaugeRequest,
- __Marshaller_GaugeResponse);
+ __Marshaller_grpc_testing_GaugeRequest,
+ __Marshaller_grpc_testing_GaugeResponse);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
diff --git a/src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioServiceGrpc.cs b/src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioServiceGrpc.cs
index 60a3890f21..1da0548cb4 100644
--- a/src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioServiceGrpc.cs
+++ b/src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioServiceGrpc.cs
@@ -29,15 +29,15 @@ namespace Grpc.Testing {
{
static readonly string __ServiceName = "grpc.testing.ReportQpsScenarioService";
- static readonly grpc::Marshaller<global::Grpc.Testing.ScenarioResult> __Marshaller_ScenarioResult = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ScenarioResult.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.Void> __Marshaller_Void = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Void.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.ScenarioResult> __Marshaller_grpc_testing_ScenarioResult = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ScenarioResult.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.Void> __Marshaller_grpc_testing_Void = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Void.Parser.ParseFrom);
static readonly grpc::Method<global::Grpc.Testing.ScenarioResult, global::Grpc.Testing.Void> __Method_ReportScenario = new grpc::Method<global::Grpc.Testing.ScenarioResult, global::Grpc.Testing.Void>(
grpc::MethodType.Unary,
__ServiceName,
"ReportScenario",
- __Marshaller_ScenarioResult,
- __Marshaller_Void);
+ __Marshaller_grpc_testing_ScenarioResult,
+ __Marshaller_grpc_testing_Void);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
diff --git a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs
index aec4ce7be7..2176916b43 100644
--- a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs
+++ b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs
@@ -34,69 +34,69 @@ namespace Grpc.Testing {
{
static readonly string __ServiceName = "grpc.testing.TestService";
- static readonly grpc::Marshaller<global::Grpc.Testing.Empty> __Marshaller_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.SimpleRequest> __Marshaller_SimpleRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.SimpleResponse> __Marshaller_SimpleResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.StreamingOutputCallRequest> __Marshaller_StreamingOutputCallRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingOutputCallRequest.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.StreamingOutputCallResponse> __Marshaller_StreamingOutputCallResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingOutputCallResponse.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.StreamingInputCallRequest> __Marshaller_StreamingInputCallRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingInputCallRequest.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.StreamingInputCallResponse> __Marshaller_StreamingInputCallResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingInputCallResponse.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.Empty> __Marshaller_grpc_testing_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.SimpleRequest> __Marshaller_grpc_testing_SimpleRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.SimpleResponse> __Marshaller_grpc_testing_SimpleResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.StreamingOutputCallRequest> __Marshaller_grpc_testing_StreamingOutputCallRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingOutputCallRequest.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.StreamingOutputCallResponse> __Marshaller_grpc_testing_StreamingOutputCallResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingOutputCallResponse.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.StreamingInputCallRequest> __Marshaller_grpc_testing_StreamingInputCallRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingInputCallRequest.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.StreamingInputCallResponse> __Marshaller_grpc_testing_StreamingInputCallResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingInputCallResponse.Parser.ParseFrom);
static readonly grpc::Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty> __Method_EmptyCall = new grpc::Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty>(
grpc::MethodType.Unary,
__ServiceName,
"EmptyCall",
- __Marshaller_Empty,
- __Marshaller_Empty);
+ __Marshaller_grpc_testing_Empty,
+ __Marshaller_grpc_testing_Empty);
static readonly grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_UnaryCall = new grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
grpc::MethodType.Unary,
__ServiceName,
"UnaryCall",
- __Marshaller_SimpleRequest,
- __Marshaller_SimpleResponse);
+ __Marshaller_grpc_testing_SimpleRequest,
+ __Marshaller_grpc_testing_SimpleResponse);
static readonly grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_CacheableUnaryCall = new grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
grpc::MethodType.Unary,
__ServiceName,
"CacheableUnaryCall",
- __Marshaller_SimpleRequest,
- __Marshaller_SimpleResponse);
+ __Marshaller_grpc_testing_SimpleRequest,
+ __Marshaller_grpc_testing_SimpleResponse);
static readonly grpc::Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> __Method_StreamingOutputCall = new grpc::Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse>(
grpc::MethodType.ServerStreaming,
__ServiceName,
"StreamingOutputCall",
- __Marshaller_StreamingOutputCallRequest,
- __Marshaller_StreamingOutputCallResponse);
+ __Marshaller_grpc_testing_StreamingOutputCallRequest,
+ __Marshaller_grpc_testing_StreamingOutputCallResponse);
static readonly grpc::Method<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse> __Method_StreamingInputCall = new grpc::Method<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse>(
grpc::MethodType.ClientStreaming,
__ServiceName,
"StreamingInputCall",
- __Marshaller_StreamingInputCallRequest,
- __Marshaller_StreamingInputCallResponse);
+ __Marshaller_grpc_testing_StreamingInputCallRequest,
+ __Marshaller_grpc_testing_StreamingInputCallResponse);
static readonly grpc::Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> __Method_FullDuplexCall = new grpc::Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse>(
grpc::MethodType.DuplexStreaming,
__ServiceName,
"FullDuplexCall",
- __Marshaller_StreamingOutputCallRequest,
- __Marshaller_StreamingOutputCallResponse);
+ __Marshaller_grpc_testing_StreamingOutputCallRequest,
+ __Marshaller_grpc_testing_StreamingOutputCallResponse);
static readonly grpc::Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> __Method_HalfDuplexCall = new grpc::Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse>(
grpc::MethodType.DuplexStreaming,
__ServiceName,
"HalfDuplexCall",
- __Marshaller_StreamingOutputCallRequest,
- __Marshaller_StreamingOutputCallResponse);
+ __Marshaller_grpc_testing_StreamingOutputCallRequest,
+ __Marshaller_grpc_testing_StreamingOutputCallResponse);
static readonly grpc::Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty> __Method_UnimplementedCall = new grpc::Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty>(
grpc::MethodType.Unary,
__ServiceName,
"UnimplementedCall",
- __Marshaller_Empty,
- __Marshaller_Empty);
+ __Marshaller_grpc_testing_Empty,
+ __Marshaller_grpc_testing_Empty);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
@@ -548,14 +548,14 @@ namespace Grpc.Testing {
{
static readonly string __ServiceName = "grpc.testing.UnimplementedService";
- static readonly grpc::Marshaller<global::Grpc.Testing.Empty> __Marshaller_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.Empty> __Marshaller_grpc_testing_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom);
static readonly grpc::Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty> __Method_UnimplementedCall = new grpc::Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty>(
grpc::MethodType.Unary,
__ServiceName,
"UnimplementedCall",
- __Marshaller_Empty,
- __Marshaller_Empty);
+ __Marshaller_grpc_testing_Empty,
+ __Marshaller_grpc_testing_Empty);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
@@ -669,23 +669,23 @@ namespace Grpc.Testing {
{
static readonly string __ServiceName = "grpc.testing.ReconnectService";
- static readonly grpc::Marshaller<global::Grpc.Testing.ReconnectParams> __Marshaller_ReconnectParams = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ReconnectParams.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.Empty> __Marshaller_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.ReconnectInfo> __Marshaller_ReconnectInfo = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ReconnectInfo.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.ReconnectParams> __Marshaller_grpc_testing_ReconnectParams = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ReconnectParams.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.Empty> __Marshaller_grpc_testing_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.ReconnectInfo> __Marshaller_grpc_testing_ReconnectInfo = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ReconnectInfo.Parser.ParseFrom);
static readonly grpc::Method<global::Grpc.Testing.ReconnectParams, global::Grpc.Testing.Empty> __Method_Start = new grpc::Method<global::Grpc.Testing.ReconnectParams, global::Grpc.Testing.Empty>(
grpc::MethodType.Unary,
__ServiceName,
"Start",
- __Marshaller_ReconnectParams,
- __Marshaller_Empty);
+ __Marshaller_grpc_testing_ReconnectParams,
+ __Marshaller_grpc_testing_Empty);
static readonly grpc::Method<global::Grpc.Testing.Empty, global::Grpc.Testing.ReconnectInfo> __Method_Stop = new grpc::Method<global::Grpc.Testing.Empty, global::Grpc.Testing.ReconnectInfo>(
grpc::MethodType.Unary,
__ServiceName,
"Stop",
- __Marshaller_Empty,
- __Marshaller_ReconnectInfo);
+ __Marshaller_grpc_testing_Empty,
+ __Marshaller_grpc_testing_ReconnectInfo);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
diff --git a/src/csharp/Grpc.IntegrationTesting/WorkerServiceGrpc.cs b/src/csharp/Grpc.IntegrationTesting/WorkerServiceGrpc.cs
index 85f2cfd871..b9e8f91231 100644
--- a/src/csharp/Grpc.IntegrationTesting/WorkerServiceGrpc.cs
+++ b/src/csharp/Grpc.IntegrationTesting/WorkerServiceGrpc.cs
@@ -29,41 +29,41 @@ namespace Grpc.Testing {
{
static readonly string __ServiceName = "grpc.testing.WorkerService";
- static readonly grpc::Marshaller<global::Grpc.Testing.ServerArgs> __Marshaller_ServerArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerArgs.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.ServerStatus> __Marshaller_ServerStatus = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerStatus.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.ClientArgs> __Marshaller_ClientArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientArgs.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.ClientStatus> __Marshaller_ClientStatus = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientStatus.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.CoreRequest> __Marshaller_CoreRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreRequest.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.CoreResponse> __Marshaller_CoreResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreResponse.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.Void> __Marshaller_Void = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Void.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.ServerArgs> __Marshaller_grpc_testing_ServerArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerArgs.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.ServerStatus> __Marshaller_grpc_testing_ServerStatus = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerStatus.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.ClientArgs> __Marshaller_grpc_testing_ClientArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientArgs.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.ClientStatus> __Marshaller_grpc_testing_ClientStatus = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientStatus.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.CoreRequest> __Marshaller_grpc_testing_CoreRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreRequest.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.CoreResponse> __Marshaller_grpc_testing_CoreResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreResponse.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.Void> __Marshaller_grpc_testing_Void = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Void.Parser.ParseFrom);
static readonly grpc::Method<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> __Method_RunServer = new grpc::Method<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus>(
grpc::MethodType.DuplexStreaming,
__ServiceName,
"RunServer",
- __Marshaller_ServerArgs,
- __Marshaller_ServerStatus);
+ __Marshaller_grpc_testing_ServerArgs,
+ __Marshaller_grpc_testing_ServerStatus);
static readonly grpc::Method<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> __Method_RunClient = new grpc::Method<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus>(
grpc::MethodType.DuplexStreaming,
__ServiceName,
"RunClient",
- __Marshaller_ClientArgs,
- __Marshaller_ClientStatus);
+ __Marshaller_grpc_testing_ClientArgs,
+ __Marshaller_grpc_testing_ClientStatus);
static readonly grpc::Method<global::Grpc.Testing.CoreRequest, global::Grpc.Testing.CoreResponse> __Method_CoreCount = new grpc::Method<global::Grpc.Testing.CoreRequest, global::Grpc.Testing.CoreResponse>(
grpc::MethodType.Unary,
__ServiceName,
"CoreCount",
- __Marshaller_CoreRequest,
- __Marshaller_CoreResponse);
+ __Marshaller_grpc_testing_CoreRequest,
+ __Marshaller_grpc_testing_CoreResponse);
static readonly grpc::Method<global::Grpc.Testing.Void, global::Grpc.Testing.Void> __Method_QuitWorker = new grpc::Method<global::Grpc.Testing.Void, global::Grpc.Testing.Void>(
grpc::MethodType.Unary,
__ServiceName,
"QuitWorker",
- __Marshaller_Void,
- __Marshaller_Void);
+ __Marshaller_grpc_testing_Void,
+ __Marshaller_grpc_testing_Void);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
diff --git a/src/csharp/Grpc.Reflection/ReflectionGrpc.cs b/src/csharp/Grpc.Reflection/ReflectionGrpc.cs
index 387c9fb52f..c00075b7c6 100644
--- a/src/csharp/Grpc.Reflection/ReflectionGrpc.cs
+++ b/src/csharp/Grpc.Reflection/ReflectionGrpc.cs
@@ -29,15 +29,15 @@ namespace Grpc.Reflection.V1Alpha {
{
static readonly string __ServiceName = "grpc.reflection.v1alpha.ServerReflection";
- static readonly grpc::Marshaller<global::Grpc.Reflection.V1Alpha.ServerReflectionRequest> __Marshaller_ServerReflectionRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Reflection.V1Alpha.ServerReflectionRequest.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Reflection.V1Alpha.ServerReflectionResponse> __Marshaller_ServerReflectionResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Reflection.V1Alpha.ServerReflectionResponse.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Reflection.V1Alpha.ServerReflectionRequest> __Marshaller_grpc_reflection_v1alpha_ServerReflectionRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Reflection.V1Alpha.ServerReflectionRequest.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Reflection.V1Alpha.ServerReflectionResponse> __Marshaller_grpc_reflection_v1alpha_ServerReflectionResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Reflection.V1Alpha.ServerReflectionResponse.Parser.ParseFrom);
static readonly grpc::Method<global::Grpc.Reflection.V1Alpha.ServerReflectionRequest, global::Grpc.Reflection.V1Alpha.ServerReflectionResponse> __Method_ServerReflectionInfo = new grpc::Method<global::Grpc.Reflection.V1Alpha.ServerReflectionRequest, global::Grpc.Reflection.V1Alpha.ServerReflectionResponse>(
grpc::MethodType.DuplexStreaming,
__ServiceName,
"ServerReflectionInfo",
- __Marshaller_ServerReflectionRequest,
- __Marshaller_ServerReflectionResponse);
+ __Marshaller_grpc_reflection_v1alpha_ServerReflectionRequest,
+ __Marshaller_grpc_reflection_v1alpha_ServerReflectionResponse);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
diff --git a/src/csharp/tests.json b/src/csharp/tests.json
index 60f67ff3c9..c2f243fe0a 100644
--- a/src/csharp/tests.json
+++ b/src/csharp/tests.json
@@ -41,7 +41,9 @@
"Grpc.Core.Tests.UserAgentStringTest"
],
"Grpc.Examples.Tests": [
- "Math.Tests.MathClientServerTest"
+ "Math.Tests.MathClientMockableTest",
+ "Math.Tests.MathClientServerTest",
+ "Math.Tests.MathServiceImplTestabilityTest"
],
"Grpc.HealthCheck.Tests": [
"Grpc.HealthCheck.Tests.HealthClientServerTest",
diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m
index 5b48d06158..9783b06440 100644
--- a/src/objective-c/GRPCClient/GRPCCall.m
+++ b/src/objective-c/GRPCClient/GRPCCall.m
@@ -206,8 +206,9 @@ static NSString *const kBearerPrefix = @"Bearer ";
} else {
[_responseWriteable enqueueSuccessfulCompletion];
}
-
+#ifndef GRPC_CFSTREAM
[GRPCConnectivityMonitor unregisterObserver:self];
+#endif
// If the call isn't retained anywhere else, it can be deallocated now.
_retainSelf = nil;
@@ -462,7 +463,9 @@ static NSString *const kBearerPrefix = @"Bearer ";
[self sendHeaders:_requestHeaders];
[self invokeCall];
+#ifndef GRPC_CFSTREAM
[GRPCConnectivityMonitor registerObserver:self selector:@selector(connectivityChanged:)];
+#endif
}
- (void)startWithWriteable:(id<GRXWriteable>)writeable {
diff --git a/src/objective-c/GRPCClient/private/GRPCHost.m b/src/objective-c/GRPCClient/private/GRPCHost.m
index bd5fd94118..f4b933751f 100644
--- a/src/objective-c/GRPCClient/private/GRPCHost.m
+++ b/src/objective-c/GRPCClient/private/GRPCHost.m
@@ -49,7 +49,9 @@ static NSMutableDictionary *kHostCache;
if (_channelCreds != nil) {
grpc_channel_credentials_release(_channelCreds);
}
+#ifndef GRPC_CFSTREAM
[GRPCConnectivityMonitor unregisterObserver:self];
+#endif
}
// Default initializer.
@@ -84,7 +86,9 @@ static NSMutableDictionary *kHostCache;
kHostCache[address] = self;
_compressAlgorithm = GRPC_COMPRESS_NONE;
}
+#ifndef GRPC_CFSTREAM
[GRPCConnectivityMonitor registerObserver:self selector:@selector(connectivityChange:)];
+#endif
}
return self;
}
@@ -125,6 +129,14 @@ static NSMutableDictionary *kHostCache;
completionQueue:queue];
}
+- (NSData *)nullTerminatedDataWithString:(NSString *)string {
+ // dataUsingEncoding: does not return a null-terminated string.
+ NSData *data = [string dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
+ NSMutableData *nullTerminated = [NSMutableData dataWithData:data];
+ [nullTerminated appendBytes:"\0" length:1];
+ return nullTerminated;
+}
+
- (BOOL)setTLSPEMRootCerts:(nullable NSString *)pemRootCerts
withPrivateKey:(nullable NSString *)pemPrivateKey
withCertChain:(nullable NSString *)pemCertChain
@@ -146,13 +158,12 @@ static NSMutableDictionary *kHostCache;
kDefaultRootsError = error;
return;
}
- kDefaultRootsASCII =
- [contentInUTF8 dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
+ kDefaultRootsASCII = [self nullTerminatedDataWithString:contentInUTF8];
});
NSData *rootsASCII;
if (pemRootCerts != nil) {
- rootsASCII = [pemRootCerts dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
+ rootsASCII = [self nullTerminatedDataWithString:pemRootCerts];
} else {
if (kDefaultRootsASCII == nil) {
if (errorPtr) {
@@ -175,10 +186,8 @@ static NSMutableDictionary *kHostCache;
creds = grpc_ssl_credentials_create(rootsASCII.bytes, NULL, NULL);
} else {
grpc_ssl_pem_key_cert_pair key_cert_pair;
- NSData *privateKeyASCII =
- [pemPrivateKey dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
- NSData *certChainASCII =
- [pemCertChain dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
+ NSData *privateKeyASCII = [self nullTerminatedDataWithString:pemPrivateKey];
+ NSData *certChainASCII = [self nullTerminatedDataWithString:pemCertChain];
key_cert_pair.private_key = privateKeyASCII.bytes;
key_cert_pair.cert_chain = certChainASCII.bytes;
creds = grpc_ssl_credentials_create(rootsASCII.bytes, &key_cert_pair, NULL);
diff --git a/src/objective-c/tests/Connectivity/ConnectivityTestingApp.xcodeproj/project.pbxproj b/src/objective-c/tests/Connectivity/ConnectivityTestingApp.xcodeproj/project.pbxproj
index 6a4c3519d6..7a03f9b41a 100644
--- a/src/objective-c/tests/Connectivity/ConnectivityTestingApp.xcodeproj/project.pbxproj
+++ b/src/objective-c/tests/Connectivity/ConnectivityTestingApp.xcodeproj/project.pbxproj
@@ -99,7 +99,6 @@
5EC49F8D2043E46B00ED189A /* Sources */,
5EC49F8E2043E46B00ED189A /* Frameworks */,
5EC49F8F2043E46B00ED189A /* Resources */,
- 9F67C72B6B6BAF2781078886 /* [CP] Embed Pods Frameworks */,
735516C793AF7394FBB83B7F /* [CP] Copy Pods Resources */,
);
buildRules = (
@@ -194,21 +193,6 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
- 9F67C72B6B6BAF2781078886 /* [CP] Embed Pods Frameworks */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- name = "[CP] Embed Pods Frameworks";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ConnectivityTestingApp/Pods-ConnectivityTestingApp-frameworks.sh\"\n";
- showEnvVarsInLog = 0;
- };
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -284,6 +268,7 @@
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
+ "GRPC_CFSTREAM=1",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
diff --git a/src/objective-c/tests/Connectivity/ConnectivityTestingApp/ViewController.m b/src/objective-c/tests/Connectivity/ConnectivityTestingApp/ViewController.m
index 88780e39f0..3c77fe2f2c 100644
--- a/src/objective-c/tests/Connectivity/ConnectivityTestingApp/ViewController.m
+++ b/src/objective-c/tests/Connectivity/ConnectivityTestingApp/ViewController.m
@@ -35,7 +35,9 @@ NSString *host = @"grpc-test.sandbox.googleapis.com";
- (void)viewDidLoad {
[super viewDidLoad];
+#ifndef GRPC_CFSTREAM
[GRPCConnectivityMonitor registerObserver:self selector:@selector(reachabilityChanged:)];
+#endif
}
- (void)reachabilityChanged:(NSNotification *)note {
diff --git a/src/objective-c/tests/Connectivity/Podfile b/src/objective-c/tests/Connectivity/Podfile
index cdbc6dde59..c7127b3e78 100644
--- a/src/objective-c/tests/Connectivity/Podfile
+++ b/src/objective-c/tests/Connectivity/Podfile
@@ -5,9 +5,9 @@ platform :ios, '8.0'
GRPC_LOCAL_SRC = '../../../..'
target 'ConnectivityTestingApp' do
- pod 'gRPC', :path => GRPC_LOCAL_SRC
- pod 'gRPC-Core', :path => GRPC_LOCAL_SRC
- pod 'gRPC-ProtoRPC', :path => GRPC_LOCAL_SRC
+ pod 'gRPC/CFStream', :path => GRPC_LOCAL_SRC
+ pod 'gRPC-Core/CFStream-Implementation', :path => GRPC_LOCAL_SRC
+ pod 'gRPC-ProtoRPC/CFStream', :path => GRPC_LOCAL_SRC
pod 'gRPC-RxLibrary', :path => GRPC_LOCAL_SRC
pod 'Protobuf', :path => "#{GRPC_LOCAL_SRC}/third_party/protobuf"
pod 'BoringSSL', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c"
diff --git a/src/objective-c/tests/GRPCClientTests.m b/src/objective-c/tests/GRPCClientTests.m
index 5cd0231db7..d9186561c3 100644
--- a/src/objective-c/tests/GRPCClientTests.m
+++ b/src/objective-c/tests/GRPCClientTests.m
@@ -525,7 +525,8 @@ static GRPCProtoMethod *kFullDuplexCallMethod;
- (void)testErrorCode {
int port = [self findFreePort];
NSString *const kDummyAddress = [NSString stringWithFormat:@"localhost:%d", port];
- __weak XCTestExpectation *completion = [self expectationWithDescription:@"Empty RPC completed."];
+ __weak XCTestExpectation *completion =
+ [self expectationWithDescription:@"Received correct error code."];
GRPCCall *call = [[GRPCCall alloc] initWithHost:kDummyAddress
path:kEmptyCallMethod.HTTPPath
diff --git a/src/python/grpcio/grpc/__init__.py b/src/python/grpcio/grpc/__init__.py
index d1477fbeb5..996d075446 100644
--- a/src/python/grpcio/grpc/__init__.py
+++ b/src/python/grpcio/grpc/__init__.py
@@ -1656,9 +1656,11 @@ def server(thread_pool,
A Server object.
"""
from grpc import _server # pylint: disable=cyclic-import
- return _server.Server(thread_pool, () if handlers is None else handlers, ()
- if interceptors is None else interceptors, () if
- options is None else options, maximum_concurrent_rpcs)
+ return _server.create_server(thread_pool, ()
+ if handlers is None else handlers, ()
+ if interceptors is None else interceptors, ()
+ if options is None else options,
+ maximum_concurrent_rpcs)
################################### __all__ #################################
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pxd b/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pxd.pxi
index f5688d08cd..f5688d08cd 100644
--- a/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pxd
+++ b/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pxd.pxi
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pyx b/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pyx.pxi
index f9a1b2856d..f9a1b2856d 100644
--- a/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pyx
+++ b/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pyx.pxi
diff --git a/src/python/grpcio/grpc/_cython/cygrpc.pxd b/src/python/grpcio/grpc/_cython/cygrpc.pxd
index c8ace7c3cc..e33c01c28f 100644
--- a/src/python/grpcio/grpc/_cython/cygrpc.pxd
+++ b/src/python/grpcio/grpc/_cython/cygrpc.pxd
@@ -29,4 +29,4 @@ include "_cygrpc/server.pxd.pxi"
include "_cygrpc/tag.pxd.pxi"
include "_cygrpc/time.pxd.pxi"
-include "_cygrpc/grpc_gevent.pxd"
+include "_cygrpc/grpc_gevent.pxd.pxi"
diff --git a/src/python/grpcio/grpc/_cython/cygrpc.pyx b/src/python/grpcio/grpc/_cython/cygrpc.pyx
index f5f08fc983..fb16fb16bf 100644
--- a/src/python/grpcio/grpc/_cython/cygrpc.pyx
+++ b/src/python/grpcio/grpc/_cython/cygrpc.pyx
@@ -36,7 +36,7 @@ include "_cygrpc/server.pyx.pxi"
include "_cygrpc/tag.pyx.pxi"
include "_cygrpc/time.pyx.pxi"
-include "_cygrpc/grpc_gevent.pyx"
+include "_cygrpc/grpc_gevent.pyx.pxi"
#
# initialize gRPC
diff --git a/src/python/grpcio/grpc/_server.py b/src/python/grpcio/grpc/_server.py
index 2761022f21..7276a7fd90 100644
--- a/src/python/grpcio/grpc/_server.py
+++ b/src/python/grpcio/grpc/_server.py
@@ -789,7 +789,16 @@ def _start(state):
thread.start()
-class Server(grpc.Server):
+def _validate_generic_rpc_handlers(generic_rpc_handlers):
+ for generic_rpc_handler in generic_rpc_handlers:
+ service_attribute = getattr(generic_rpc_handler, 'service', None)
+ if service_attribute is None:
+ raise AttributeError(
+ '"{}" must conform to grpc.GenericRpcHandler type but does '
+ 'not have "service" method!'.format(generic_rpc_handler))
+
+
+class _Server(grpc.Server):
# pylint: disable=too-many-arguments
def __init__(self, thread_pool, generic_handlers, interceptors, options,
@@ -802,6 +811,7 @@ class Server(grpc.Server):
thread_pool, maximum_concurrent_rpcs)
def add_generic_rpc_handlers(self, generic_rpc_handlers):
+ _validate_generic_rpc_handlers(generic_rpc_handlers)
_add_generic_handlers(self._state, generic_rpc_handlers)
def add_insecure_port(self, address):
@@ -819,3 +829,10 @@ class Server(grpc.Server):
def __del__(self):
_stop(self._state, None)
+
+
+def create_server(thread_pool, generic_rpc_handlers, interceptors, options,
+ maximum_concurrent_rpcs):
+ _validate_generic_rpc_handlers(generic_rpc_handlers)
+ return _Server(thread_pool, generic_rpc_handlers, interceptors, options,
+ maximum_concurrent_rpcs)
diff --git a/src/python/grpcio_tests/tests/tests.json b/src/python/grpcio_tests/tests/tests.json
index 65460a9540..ebc41c63f0 100644
--- a/src/python/grpcio_tests/tests/tests.json
+++ b/src/python/grpcio_tests/tests/tests.json
@@ -53,6 +53,7 @@
"unit._server_ssl_cert_config_test.ServerSSLCertReloadTestCertConfigReuse",
"unit._server_ssl_cert_config_test.ServerSSLCertReloadTestWithClientAuth",
"unit._server_ssl_cert_config_test.ServerSSLCertReloadTestWithoutClientAuth",
+ "unit._server_test.ServerTest",
"unit._session_cache_test.SSLSessionCacheTest",
"unit.beta._beta_features_test.BetaFeaturesTest",
"unit.beta._beta_features_test.ContextManagementAndLifecycleTest",
diff --git a/src/python/grpcio_tests/tests/unit/_server_test.py b/src/python/grpcio_tests/tests/unit/_server_test.py
new file mode 100644
index 0000000000..acf4a17921
--- /dev/null
+++ b/src/python/grpcio_tests/tests/unit/_server_test.py
@@ -0,0 +1,52 @@
+# Copyright 2018 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 concurrent import futures
+import unittest
+
+import grpc
+
+
+class _ActualGenericRpcHandler(grpc.GenericRpcHandler):
+
+ def service(self, handler_call_details):
+ return None
+
+
+class ServerTest(unittest.TestCase):
+
+ def test_not_a_generic_rpc_handler_at_construction(self):
+ with self.assertRaises(AttributeError) as exception_context:
+ grpc.server(
+ futures.ThreadPoolExecutor(max_workers=5),
+ handlers=[
+ _ActualGenericRpcHandler(),
+ object(),
+ ])
+ self.assertIn('grpc.GenericRpcHandler',
+ str(exception_context.exception))
+
+ def test_not_a_generic_rpc_handler_after_construction(self):
+ server = grpc.server(futures.ThreadPoolExecutor(max_workers=5))
+ with self.assertRaises(AttributeError) as exception_context:
+ server.add_generic_rpc_handlers([
+ _ActualGenericRpcHandler(),
+ object(),
+ ])
+ self.assertIn('grpc.GenericRpcHandler',
+ str(exception_context.exception))
+
+
+if __name__ == '__main__':
+ unittest.main(verbosity=2)
diff --git a/test/core/avl/avl_test.cc b/test/core/avl/avl_test.cc
index ecebe833b3..01002fec72 100644
--- a/test/core/avl/avl_test.cc
+++ b/test/core/avl/avl_test.cc
@@ -241,3365 +241,6 @@ static void test_badcase1(void) {
grpc_avl_unref(avl, nullptr);
}
-static void test_badcase2(void) {
- grpc_avl avl;
-
- gpr_log(GPR_DEBUG, "test_badcase2");
-
- avl = grpc_avl_create(&int_int_vtable);
- avl = grpc_avl_add(avl, box(288), box(1), nullptr);
- avl = remove_int(avl, 415);
- avl = grpc_avl_add(avl, box(953), box(3), nullptr);
- avl = grpc_avl_add(avl, box(101), box(4), nullptr);
- avl = grpc_avl_add(avl, box(516), box(5), nullptr);
- avl = grpc_avl_add(avl, box(547), box(6), nullptr);
- avl = grpc_avl_add(avl, box(467), box(7), nullptr);
- avl = grpc_avl_add(avl, box(793), box(8), nullptr);
- avl = remove_int(avl, 190);
- avl = grpc_avl_add(avl, box(687), box(10), nullptr);
- avl = grpc_avl_add(avl, box(242), box(11), nullptr);
- avl = grpc_avl_add(avl, box(142), box(12), nullptr);
- avl = remove_int(avl, 705);
- avl = remove_int(avl, 578);
- avl = remove_int(avl, 767);
- avl = remove_int(avl, 183);
- avl = grpc_avl_add(avl, box(950), box(17), nullptr);
- avl = grpc_avl_add(avl, box(622), box(18), nullptr);
- avl = remove_int(avl, 513);
- avl = remove_int(avl, 429);
- avl = grpc_avl_add(avl, box(205), box(21), nullptr);
- avl = remove_int(avl, 663);
- avl = remove_int(avl, 953);
- avl = remove_int(avl, 892);
- avl = grpc_avl_add(avl, box(236), box(25), nullptr);
- avl = remove_int(avl, 982);
- avl = remove_int(avl, 201);
- avl = remove_int(avl, 684);
- avl = grpc_avl_add(avl, box(572), box(29), nullptr);
- avl = remove_int(avl, 817);
- avl = grpc_avl_add(avl, box(970), box(31), nullptr);
- avl = remove_int(avl, 347);
- avl = remove_int(avl, 574);
- avl = grpc_avl_add(avl, box(752), box(34), nullptr);
- avl = grpc_avl_add(avl, box(670), box(35), nullptr);
- avl = grpc_avl_add(avl, box(69), box(36), nullptr);
- avl = remove_int(avl, 111);
- avl = remove_int(avl, 523);
- avl = grpc_avl_add(avl, box(141), box(39), nullptr);
- avl = remove_int(avl, 159);
- avl = grpc_avl_add(avl, box(947), box(41), nullptr);
- avl = grpc_avl_add(avl, box(855), box(42), nullptr);
- avl = remove_int(avl, 218);
- avl = remove_int(avl, 6);
- avl = grpc_avl_add(avl, box(753), box(45), nullptr);
- avl = remove_int(avl, 82);
- avl = remove_int(avl, 799);
- avl = grpc_avl_add(avl, box(572), box(48), nullptr);
- avl = remove_int(avl, 376);
- avl = remove_int(avl, 413);
- avl = grpc_avl_add(avl, box(458), box(51), nullptr);
- avl = remove_int(avl, 897);
- avl = grpc_avl_add(avl, box(191), box(53), nullptr);
- avl = grpc_avl_add(avl, box(609), box(54), nullptr);
- avl = remove_int(avl, 787);
- avl = remove_int(avl, 710);
- avl = remove_int(avl, 886);
- avl = remove_int(avl, 835);
- avl = remove_int(avl, 33);
- avl = grpc_avl_add(avl, box(871), box(60), nullptr);
- avl = remove_int(avl, 641);
- avl = grpc_avl_add(avl, box(462), box(62), nullptr);
- avl = remove_int(avl, 359);
- avl = remove_int(avl, 767);
- avl = grpc_avl_add(avl, box(310), box(65), nullptr);
- avl = remove_int(avl, 757);
- avl = remove_int(avl, 639);
- avl = remove_int(avl, 314);
- avl = grpc_avl_add(avl, box(2), box(69), nullptr);
- avl = remove_int(avl, 138);
- avl = grpc_avl_add(avl, box(669), box(71), nullptr);
- avl = remove_int(avl, 477);
- avl = grpc_avl_add(avl, box(366), box(73), nullptr);
- avl = grpc_avl_add(avl, box(612), box(74), nullptr);
- avl = grpc_avl_add(avl, box(106), box(75), nullptr);
- avl = remove_int(avl, 161);
- avl = grpc_avl_add(avl, box(388), box(77), nullptr);
- avl = grpc_avl_add(avl, box(141), box(78), nullptr);
- avl = remove_int(avl, 633);
- avl = remove_int(avl, 459);
- avl = grpc_avl_add(avl, box(40), box(81), nullptr);
- avl = remove_int(avl, 689);
- avl = grpc_avl_add(avl, box(823), box(83), nullptr);
- avl = remove_int(avl, 485);
- avl = grpc_avl_add(avl, box(903), box(85), nullptr);
- avl = grpc_avl_add(avl, box(592), box(86), nullptr);
- avl = remove_int(avl, 448);
- avl = grpc_avl_add(avl, box(56), box(88), nullptr);
- avl = remove_int(avl, 333);
- avl = grpc_avl_add(avl, box(189), box(90), nullptr);
- avl = grpc_avl_add(avl, box(103), box(91), nullptr);
- avl = remove_int(avl, 164);
- avl = remove_int(avl, 974);
- avl = grpc_avl_add(avl, box(215), box(94), nullptr);
- avl = remove_int(avl, 189);
- avl = remove_int(avl, 504);
- avl = grpc_avl_add(avl, box(868), box(97), nullptr);
- avl = remove_int(avl, 909);
- avl = remove_int(avl, 148);
- avl = remove_int(avl, 469);
- avl = grpc_avl_add(avl, box(994), box(101), nullptr);
- avl = grpc_avl_add(avl, box(576), box(102), nullptr);
- avl = remove_int(avl, 82);
- avl = remove_int(avl, 209);
- avl = grpc_avl_add(avl, box(276), box(105), nullptr);
- avl = remove_int(avl, 856);
- avl = grpc_avl_add(avl, box(750), box(107), nullptr);
- avl = remove_int(avl, 871);
- avl = grpc_avl_add(avl, box(301), box(109), nullptr);
- avl = remove_int(avl, 260);
- avl = remove_int(avl, 737);
- avl = remove_int(avl, 719);
- avl = grpc_avl_add(avl, box(933), box(113), nullptr);
- avl = grpc_avl_add(avl, box(225), box(114), nullptr);
- avl = grpc_avl_add(avl, box(975), box(115), nullptr);
- avl = grpc_avl_add(avl, box(86), box(116), nullptr);
- avl = remove_int(avl, 732);
- avl = grpc_avl_add(avl, box(340), box(118), nullptr);
- avl = grpc_avl_add(avl, box(271), box(119), nullptr);
- avl = remove_int(avl, 206);
- avl = grpc_avl_add(avl, box(949), box(121), nullptr);
- avl = grpc_avl_add(avl, box(927), box(122), nullptr);
- avl = grpc_avl_add(avl, box(34), box(123), nullptr);
- avl = grpc_avl_add(avl, box(351), box(124), nullptr);
- avl = remove_int(avl, 836);
- avl = grpc_avl_add(avl, box(825), box(126), nullptr);
- avl = grpc_avl_add(avl, box(352), box(127), nullptr);
- avl = remove_int(avl, 107);
- avl = remove_int(avl, 101);
- avl = grpc_avl_add(avl, box(320), box(130), nullptr);
- avl = grpc_avl_add(avl, box(3), box(131), nullptr);
- avl = remove_int(avl, 998);
- avl = remove_int(avl, 44);
- avl = grpc_avl_add(avl, box(525), box(134), nullptr);
- avl = grpc_avl_add(avl, box(864), box(135), nullptr);
- avl = grpc_avl_add(avl, box(863), box(136), nullptr);
- avl = remove_int(avl, 770);
- avl = grpc_avl_add(avl, box(440), box(138), nullptr);
- avl = remove_int(avl, 516);
- avl = grpc_avl_add(avl, box(116), box(140), nullptr);
- avl = remove_int(avl, 380);
- avl = grpc_avl_add(avl, box(878), box(142), nullptr);
- avl = remove_int(avl, 439);
- avl = grpc_avl_add(avl, box(994), box(144), nullptr);
- avl = remove_int(avl, 294);
- avl = remove_int(avl, 593);
- avl = grpc_avl_add(avl, box(696), box(147), nullptr);
- avl = remove_int(avl, 8);
- avl = grpc_avl_add(avl, box(881), box(149), nullptr);
- avl = remove_int(avl, 32);
- avl = remove_int(avl, 242);
- avl = grpc_avl_add(avl, box(487), box(152), nullptr);
- avl = grpc_avl_add(avl, box(637), box(153), nullptr);
- avl = grpc_avl_add(avl, box(793), box(154), nullptr);
- avl = grpc_avl_add(avl, box(696), box(155), nullptr);
- avl = remove_int(avl, 458);
- avl = grpc_avl_add(avl, box(828), box(157), nullptr);
- avl = remove_int(avl, 784);
- avl = remove_int(avl, 274);
- avl = grpc_avl_add(avl, box(783), box(160), nullptr);
- avl = remove_int(avl, 21);
- avl = grpc_avl_add(avl, box(866), box(162), nullptr);
- avl = remove_int(avl, 919);
- avl = grpc_avl_add(avl, box(435), box(164), nullptr);
- avl = remove_int(avl, 385);
- avl = grpc_avl_add(avl, box(475), box(166), nullptr);
- avl = remove_int(avl, 339);
- avl = grpc_avl_add(avl, box(615), box(168), nullptr);
- avl = remove_int(avl, 866);
- avl = remove_int(avl, 82);
- avl = remove_int(avl, 271);
- avl = grpc_avl_add(avl, box(590), box(172), nullptr);
- avl = grpc_avl_add(avl, box(852), box(173), nullptr);
- avl = remove_int(avl, 318);
- avl = remove_int(avl, 82);
- avl = grpc_avl_add(avl, box(672), box(176), nullptr);
- avl = remove_int(avl, 430);
- avl = grpc_avl_add(avl, box(821), box(178), nullptr);
- avl = grpc_avl_add(avl, box(365), box(179), nullptr);
- avl = remove_int(avl, 78);
- avl = grpc_avl_add(avl, box(700), box(181), nullptr);
- avl = grpc_avl_add(avl, box(353), box(182), nullptr);
- avl = remove_int(avl, 492);
- avl = grpc_avl_add(avl, box(991), box(184), nullptr);
- avl = remove_int(avl, 330);
- avl = grpc_avl_add(avl, box(873), box(186), nullptr);
- avl = remove_int(avl, 589);
- avl = grpc_avl_add(avl, box(676), box(188), nullptr);
- avl = grpc_avl_add(avl, box(790), box(189), nullptr);
- avl = remove_int(avl, 521);
- avl = remove_int(avl, 47);
- avl = grpc_avl_add(avl, box(976), box(192), nullptr);
- avl = grpc_avl_add(avl, box(683), box(193), nullptr);
- avl = remove_int(avl, 803);
- avl = remove_int(avl, 1006);
- avl = grpc_avl_add(avl, box(775), box(196), nullptr);
- avl = grpc_avl_add(avl, box(411), box(197), nullptr);
- avl = grpc_avl_add(avl, box(697), box(198), nullptr);
- avl = remove_int(avl, 50);
- avl = grpc_avl_add(avl, box(213), box(200), nullptr);
- avl = remove_int(avl, 714);
- avl = grpc_avl_add(avl, box(981), box(202), nullptr);
- avl = grpc_avl_add(avl, box(502), box(203), nullptr);
- avl = grpc_avl_add(avl, box(697), box(204), nullptr);
- avl = grpc_avl_add(avl, box(603), box(205), nullptr);
- avl = grpc_avl_add(avl, box(117), box(206), nullptr);
- avl = remove_int(avl, 363);
- avl = grpc_avl_add(avl, box(104), box(208), nullptr);
- avl = remove_int(avl, 842);
- avl = grpc_avl_add(avl, box(48), box(210), nullptr);
- avl = remove_int(avl, 764);
- avl = grpc_avl_add(avl, box(482), box(212), nullptr);
- avl = grpc_avl_add(avl, box(928), box(213), nullptr);
- avl = grpc_avl_add(avl, box(30), box(214), nullptr);
- avl = grpc_avl_add(avl, box(820), box(215), nullptr);
- avl = grpc_avl_add(avl, box(334), box(216), nullptr);
- avl = remove_int(avl, 306);
- avl = grpc_avl_add(avl, box(789), box(218), nullptr);
- avl = remove_int(avl, 924);
- avl = grpc_avl_add(avl, box(53), box(220), nullptr);
- avl = remove_int(avl, 657);
- avl = grpc_avl_add(avl, box(130), box(222), nullptr);
- avl = grpc_avl_add(avl, box(239), box(223), nullptr);
- avl = remove_int(avl, 20);
- avl = grpc_avl_add(avl, box(117), box(225), nullptr);
- avl = remove_int(avl, 882);
- avl = remove_int(avl, 891);
- avl = grpc_avl_add(avl, box(9), box(228), nullptr);
- avl = grpc_avl_add(avl, box(496), box(229), nullptr);
- avl = grpc_avl_add(avl, box(750), box(230), nullptr);
- avl = grpc_avl_add(avl, box(283), box(231), nullptr);
- avl = grpc_avl_add(avl, box(802), box(232), nullptr);
- avl = remove_int(avl, 352);
- avl = grpc_avl_add(avl, box(374), box(234), nullptr);
- avl = grpc_avl_add(avl, box(6), box(235), nullptr);
- avl = grpc_avl_add(avl, box(756), box(236), nullptr);
- avl = grpc_avl_add(avl, box(597), box(237), nullptr);
- avl = grpc_avl_add(avl, box(661), box(238), nullptr);
- avl = remove_int(avl, 96);
- avl = grpc_avl_add(avl, box(894), box(240), nullptr);
- avl = remove_int(avl, 749);
- avl = grpc_avl_add(avl, box(71), box(242), nullptr);
- avl = remove_int(avl, 68);
- avl = grpc_avl_add(avl, box(388), box(244), nullptr);
- avl = remove_int(avl, 119);
- avl = remove_int(avl, 856);
- avl = grpc_avl_add(avl, box(176), box(247), nullptr);
- avl = grpc_avl_add(avl, box(993), box(248), nullptr);
- avl = remove_int(avl, 178);
- avl = remove_int(avl, 781);
- avl = remove_int(avl, 771);
- avl = remove_int(avl, 848);
- avl = remove_int(avl, 376);
- avl = remove_int(avl, 157);
- avl = remove_int(avl, 142);
- avl = remove_int(avl, 686);
- avl = grpc_avl_add(avl, box(779), box(257), nullptr);
- avl = grpc_avl_add(avl, box(484), box(258), nullptr);
- avl = remove_int(avl, 837);
- avl = grpc_avl_add(avl, box(388), box(260), nullptr);
- avl = remove_int(avl, 987);
- avl = grpc_avl_add(avl, box(336), box(262), nullptr);
- avl = remove_int(avl, 855);
- avl = grpc_avl_add(avl, box(668), box(264), nullptr);
- avl = remove_int(avl, 648);
- avl = grpc_avl_add(avl, box(193), box(266), nullptr);
- avl = remove_int(avl, 939);
- avl = grpc_avl_add(avl, box(740), box(268), nullptr);
- avl = grpc_avl_add(avl, box(503), box(269), nullptr);
- avl = grpc_avl_add(avl, box(765), box(270), nullptr);
- avl = remove_int(avl, 924);
- avl = remove_int(avl, 513);
- avl = grpc_avl_add(avl, box(161), box(273), nullptr);
- avl = grpc_avl_add(avl, box(502), box(274), nullptr);
- avl = grpc_avl_add(avl, box(846), box(275), nullptr);
- avl = remove_int(avl, 931);
- avl = grpc_avl_add(avl, box(87), box(277), nullptr);
- avl = grpc_avl_add(avl, box(949), box(278), nullptr);
- avl = grpc_avl_add(avl, box(548), box(279), nullptr);
- avl = grpc_avl_add(avl, box(951), box(280), nullptr);
- avl = remove_int(avl, 1018);
- avl = remove_int(avl, 568);
- avl = grpc_avl_add(avl, box(138), box(283), nullptr);
- avl = grpc_avl_add(avl, box(202), box(284), nullptr);
- avl = grpc_avl_add(avl, box(157), box(285), nullptr);
- avl = grpc_avl_add(avl, box(264), box(286), nullptr);
- avl = grpc_avl_add(avl, box(370), box(287), nullptr);
- avl = remove_int(avl, 736);
- avl = remove_int(avl, 751);
- avl = remove_int(avl, 506);
- avl = remove_int(avl, 81);
- avl = remove_int(avl, 358);
- avl = remove_int(avl, 657);
- avl = remove_int(avl, 86);
- avl = grpc_avl_add(avl, box(876), box(295), nullptr);
- avl = remove_int(avl, 354);
- avl = grpc_avl_add(avl, box(134), box(297), nullptr);
- avl = remove_int(avl, 781);
- avl = remove_int(avl, 183);
- avl = grpc_avl_add(avl, box(914), box(300), nullptr);
- avl = remove_int(avl, 926);
- avl = remove_int(avl, 398);
- avl = remove_int(avl, 932);
- avl = remove_int(avl, 804);
- avl = remove_int(avl, 326);
- avl = grpc_avl_add(avl, box(208), box(306), nullptr);
- avl = grpc_avl_add(avl, box(699), box(307), nullptr);
- avl = remove_int(avl, 576);
- avl = remove_int(avl, 850);
- avl = remove_int(avl, 514);
- avl = remove_int(avl, 676);
- avl = remove_int(avl, 549);
- avl = remove_int(avl, 767);
- avl = grpc_avl_add(avl, box(58), box(314), nullptr);
- avl = grpc_avl_add(avl, box(265), box(315), nullptr);
- avl = grpc_avl_add(avl, box(268), box(316), nullptr);
- avl = grpc_avl_add(avl, box(103), box(317), nullptr);
- avl = grpc_avl_add(avl, box(440), box(318), nullptr);
- avl = remove_int(avl, 777);
- avl = grpc_avl_add(avl, box(670), box(320), nullptr);
- avl = remove_int(avl, 506);
- avl = remove_int(avl, 487);
- avl = grpc_avl_add(avl, box(421), box(323), nullptr);
- avl = remove_int(avl, 514);
- avl = grpc_avl_add(avl, box(701), box(325), nullptr);
- avl = remove_int(avl, 949);
- avl = remove_int(avl, 872);
- avl = remove_int(avl, 139);
- avl = grpc_avl_add(avl, box(781), box(329), nullptr);
- avl = grpc_avl_add(avl, box(543), box(330), nullptr);
- avl = grpc_avl_add(avl, box(147), box(331), nullptr);
- avl = remove_int(avl, 190);
- avl = grpc_avl_add(avl, box(453), box(333), nullptr);
- avl = remove_int(avl, 262);
- avl = remove_int(avl, 850);
- avl = remove_int(avl, 286);
- avl = remove_int(avl, 787);
- avl = grpc_avl_add(avl, box(514), box(338), nullptr);
- avl = remove_int(avl, 812);
- avl = grpc_avl_add(avl, box(431), box(340), nullptr);
- avl = grpc_avl_add(avl, box(8), box(341), nullptr);
- avl = remove_int(avl, 843);
- avl = grpc_avl_add(avl, box(831), box(343), nullptr);
- avl = remove_int(avl, 472);
- avl = remove_int(avl, 157);
- avl = grpc_avl_add(avl, box(612), box(346), nullptr);
- avl = grpc_avl_add(avl, box(802), box(347), nullptr);
- avl = remove_int(avl, 554);
- avl = grpc_avl_add(avl, box(409), box(349), nullptr);
- avl = grpc_avl_add(avl, box(439), box(350), nullptr);
- avl = grpc_avl_add(avl, box(725), box(351), nullptr);
- avl = grpc_avl_add(avl, box(568), box(352), nullptr);
- avl = remove_int(avl, 475);
- avl = remove_int(avl, 672);
- avl = remove_int(avl, 62);
- avl = remove_int(avl, 753);
- avl = grpc_avl_add(avl, box(435), box(357), nullptr);
- avl = grpc_avl_add(avl, box(950), box(358), nullptr);
- avl = grpc_avl_add(avl, box(532), box(359), nullptr);
- avl = grpc_avl_add(avl, box(832), box(360), nullptr);
- avl = remove_int(avl, 390);
- avl = grpc_avl_add(avl, box(993), box(362), nullptr);
- avl = remove_int(avl, 198);
- avl = remove_int(avl, 401);
- avl = grpc_avl_add(avl, box(316), box(365), nullptr);
- avl = remove_int(avl, 843);
- avl = grpc_avl_add(avl, box(541), box(367), nullptr);
- avl = grpc_avl_add(avl, box(505), box(368), nullptr);
- avl = remove_int(avl, 445);
- avl = remove_int(avl, 256);
- avl = grpc_avl_add(avl, box(232), box(371), nullptr);
- avl = remove_int(avl, 577);
- avl = remove_int(avl, 558);
- avl = grpc_avl_add(avl, box(910), box(374), nullptr);
- avl = remove_int(avl, 902);
- avl = remove_int(avl, 755);
- avl = remove_int(avl, 114);
- avl = remove_int(avl, 438);
- avl = remove_int(avl, 224);
- avl = grpc_avl_add(avl, box(920), box(380), nullptr);
- avl = grpc_avl_add(avl, box(655), box(381), nullptr);
- avl = remove_int(avl, 557);
- avl = remove_int(avl, 102);
- avl = remove_int(avl, 165);
- avl = grpc_avl_add(avl, box(191), box(385), nullptr);
- avl = remove_int(avl, 30);
- avl = grpc_avl_add(avl, box(406), box(387), nullptr);
- avl = grpc_avl_add(avl, box(66), box(388), nullptr);
- avl = grpc_avl_add(avl, box(87), box(389), nullptr);
- avl = remove_int(avl, 7);
- avl = remove_int(avl, 671);
- avl = grpc_avl_add(avl, box(234), box(392), nullptr);
- avl = remove_int(avl, 463);
- avl = grpc_avl_add(avl, box(75), box(394), nullptr);
- avl = grpc_avl_add(avl, box(487), box(395), nullptr);
- avl = remove_int(avl, 203);
- avl = grpc_avl_add(avl, box(711), box(397), nullptr);
- avl = remove_int(avl, 291);
- avl = remove_int(avl, 798);
- avl = remove_int(avl, 337);
- avl = grpc_avl_add(avl, box(877), box(401), nullptr);
- avl = grpc_avl_add(avl, box(388), box(402), nullptr);
- avl = remove_int(avl, 975);
- avl = grpc_avl_add(avl, box(200), box(404), nullptr);
- avl = grpc_avl_add(avl, box(408), box(405), nullptr);
- avl = grpc_avl_add(avl, box(3), box(406), nullptr);
- avl = grpc_avl_add(avl, box(971), box(407), nullptr);
- avl = remove_int(avl, 841);
- avl = remove_int(avl, 910);
- avl = remove_int(avl, 74);
- avl = remove_int(avl, 888);
- avl = grpc_avl_add(avl, box(492), box(412), nullptr);
- avl = remove_int(avl, 14);
- avl = remove_int(avl, 364);
- avl = grpc_avl_add(avl, box(215), box(415), nullptr);
- avl = remove_int(avl, 778);
- avl = remove_int(avl, 45);
- avl = grpc_avl_add(avl, box(328), box(418), nullptr);
- avl = grpc_avl_add(avl, box(597), box(419), nullptr);
- avl = remove_int(avl, 34);
- avl = grpc_avl_add(avl, box(736), box(421), nullptr);
- avl = remove_int(avl, 37);
- avl = grpc_avl_add(avl, box(275), box(423), nullptr);
- avl = grpc_avl_add(avl, box(70), box(424), nullptr);
- avl = grpc_avl_add(avl, box(771), box(425), nullptr);
- avl = remove_int(avl, 536);
- avl = remove_int(avl, 421);
- avl = grpc_avl_add(avl, box(186), box(428), nullptr);
- avl = grpc_avl_add(avl, box(788), box(429), nullptr);
- avl = grpc_avl_add(avl, box(224), box(430), nullptr);
- avl = remove_int(avl, 228);
- avl = grpc_avl_add(avl, box(48), box(432), nullptr);
- avl = grpc_avl_add(avl, box(120), box(433), nullptr);
- avl = grpc_avl_add(avl, box(269), box(434), nullptr);
- avl = grpc_avl_add(avl, box(904), box(435), nullptr);
- avl = remove_int(avl, 699);
- avl = grpc_avl_add(avl, box(340), box(437), nullptr);
- avl = remove_int(avl, 276);
- avl = grpc_avl_add(avl, box(591), box(439), nullptr);
- avl = grpc_avl_add(avl, box(778), box(440), nullptr);
- avl = remove_int(avl, 490);
- avl = remove_int(avl, 973);
- avl = grpc_avl_add(avl, box(294), box(443), nullptr);
- avl = grpc_avl_add(avl, box(323), box(444), nullptr);
- avl = remove_int(avl, 685);
- avl = grpc_avl_add(avl, box(38), box(446), nullptr);
- avl = grpc_avl_add(avl, box(525), box(447), nullptr);
- avl = remove_int(avl, 162);
- avl = grpc_avl_add(avl, box(462), box(449), nullptr);
- avl = grpc_avl_add(avl, box(340), box(450), nullptr);
- avl = remove_int(avl, 734);
- avl = remove_int(avl, 959);
- avl = grpc_avl_add(avl, box(752), box(453), nullptr);
- avl = grpc_avl_add(avl, box(667), box(454), nullptr);
- avl = remove_int(avl, 558);
- avl = remove_int(avl, 657);
- avl = grpc_avl_add(avl, box(711), box(457), nullptr);
- avl = remove_int(avl, 937);
- avl = grpc_avl_add(avl, box(741), box(459), nullptr);
- avl = grpc_avl_add(avl, box(40), box(460), nullptr);
- avl = remove_int(avl, 784);
- avl = grpc_avl_add(avl, box(292), box(462), nullptr);
- avl = remove_int(avl, 164);
- avl = remove_int(avl, 931);
- avl = remove_int(avl, 886);
- avl = grpc_avl_add(avl, box(968), box(466), nullptr);
- avl = remove_int(avl, 263);
- avl = grpc_avl_add(avl, box(647), box(468), nullptr);
- avl = grpc_avl_add(avl, box(92), box(469), nullptr);
- avl = remove_int(avl, 310);
- avl = grpc_avl_add(avl, box(711), box(471), nullptr);
- avl = grpc_avl_add(avl, box(675), box(472), nullptr);
- avl = remove_int(avl, 549);
- avl = grpc_avl_add(avl, box(380), box(474), nullptr);
- avl = remove_int(avl, 825);
- avl = grpc_avl_add(avl, box(668), box(476), nullptr);
- avl = remove_int(avl, 498);
- avl = grpc_avl_add(avl, box(870), box(478), nullptr);
- avl = grpc_avl_add(avl, box(391), box(479), nullptr);
- avl = grpc_avl_add(avl, box(264), box(480), nullptr);
- avl = remove_int(avl, 1);
- avl = remove_int(avl, 849);
- avl = remove_int(avl, 88);
- avl = remove_int(avl, 255);
- avl = remove_int(avl, 763);
- avl = remove_int(avl, 831);
- avl = grpc_avl_add(avl, box(508), box(487), nullptr);
- avl = remove_int(avl, 849);
- avl = remove_int(avl, 47);
- avl = grpc_avl_add(avl, box(299), box(490), nullptr);
- avl = remove_int(avl, 625);
- avl = remove_int(avl, 433);
- avl = remove_int(avl, 904);
- avl = remove_int(avl, 761);
- avl = grpc_avl_add(avl, box(33), box(495), nullptr);
- avl = grpc_avl_add(avl, box(524), box(496), nullptr);
- avl = remove_int(avl, 210);
- avl = remove_int(avl, 299);
- avl = grpc_avl_add(avl, box(823), box(499), nullptr);
- avl = remove_int(avl, 479);
- avl = remove_int(avl, 96);
- avl = remove_int(avl, 1013);
- avl = grpc_avl_add(avl, box(768), box(503), nullptr);
- avl = remove_int(avl, 638);
- avl = remove_int(avl, 20);
- avl = grpc_avl_add(avl, box(663), box(506), nullptr);
- avl = remove_int(avl, 882);
- avl = grpc_avl_add(avl, box(745), box(508), nullptr);
- avl = remove_int(avl, 352);
- avl = grpc_avl_add(avl, box(10), box(510), nullptr);
- avl = remove_int(avl, 484);
- avl = grpc_avl_add(avl, box(420), box(512), nullptr);
- avl = grpc_avl_add(avl, box(884), box(513), nullptr);
- avl = grpc_avl_add(avl, box(993), box(514), nullptr);
- avl = grpc_avl_add(avl, box(251), box(515), nullptr);
- avl = remove_int(avl, 222);
- avl = grpc_avl_add(avl, box(734), box(517), nullptr);
- avl = grpc_avl_add(avl, box(952), box(518), nullptr);
- avl = remove_int(avl, 26);
- avl = remove_int(avl, 270);
- avl = remove_int(avl, 481);
- avl = remove_int(avl, 693);
- avl = remove_int(avl, 1006);
- avl = grpc_avl_add(avl, box(77), box(524), nullptr);
- avl = remove_int(avl, 897);
- avl = grpc_avl_add(avl, box(719), box(526), nullptr);
- avl = grpc_avl_add(avl, box(622), box(527), nullptr);
- avl = remove_int(avl, 28);
- avl = remove_int(avl, 836);
- avl = remove_int(avl, 142);
- avl = grpc_avl_add(avl, box(445), box(531), nullptr);
- avl = grpc_avl_add(avl, box(410), box(532), nullptr);
- avl = remove_int(avl, 575);
- avl = grpc_avl_add(avl, box(634), box(534), nullptr);
- avl = grpc_avl_add(avl, box(906), box(535), nullptr);
- avl = remove_int(avl, 649);
- avl = grpc_avl_add(avl, box(813), box(537), nullptr);
- avl = remove_int(avl, 702);
- avl = remove_int(avl, 732);
- avl = grpc_avl_add(avl, box(105), box(540), nullptr);
- avl = grpc_avl_add(avl, box(867), box(541), nullptr);
- avl = remove_int(avl, 964);
- avl = remove_int(avl, 941);
- avl = grpc_avl_add(avl, box(947), box(544), nullptr);
- avl = remove_int(avl, 990);
- avl = grpc_avl_add(avl, box(816), box(546), nullptr);
- avl = remove_int(avl, 429);
- avl = remove_int(avl, 567);
- avl = remove_int(avl, 541);
- avl = remove_int(avl, 583);
- avl = grpc_avl_add(avl, box(57), box(551), nullptr);
- avl = grpc_avl_add(avl, box(786), box(552), nullptr);
- avl = grpc_avl_add(avl, box(526), box(553), nullptr);
- avl = remove_int(avl, 642);
- avl = remove_int(avl, 220);
- avl = remove_int(avl, 840);
- avl = remove_int(avl, 548);
- avl = grpc_avl_add(avl, box(528), box(558), nullptr);
- avl = grpc_avl_add(avl, box(749), box(559), nullptr);
- avl = grpc_avl_add(avl, box(194), box(560), nullptr);
- avl = remove_int(avl, 517);
- avl = grpc_avl_add(avl, box(102), box(562), nullptr);
- avl = remove_int(avl, 189);
- avl = grpc_avl_add(avl, box(927), box(564), nullptr);
- avl = remove_int(avl, 846);
- avl = remove_int(avl, 130);
- avl = grpc_avl_add(avl, box(694), box(567), nullptr);
- avl = remove_int(avl, 750);
- avl = grpc_avl_add(avl, box(357), box(569), nullptr);
- avl = remove_int(avl, 431);
- avl = remove_int(avl, 91);
- avl = grpc_avl_add(avl, box(640), box(572), nullptr);
- avl = remove_int(avl, 4);
- avl = grpc_avl_add(avl, box(81), box(574), nullptr);
- avl = grpc_avl_add(avl, box(595), box(575), nullptr);
- avl = remove_int(avl, 444);
- avl = remove_int(avl, 262);
- avl = remove_int(avl, 11);
- avl = grpc_avl_add(avl, box(192), box(579), nullptr);
- avl = grpc_avl_add(avl, box(158), box(580), nullptr);
- avl = remove_int(avl, 401);
- avl = remove_int(avl, 918);
- avl = grpc_avl_add(avl, box(180), box(583), nullptr);
- avl = remove_int(avl, 268);
- avl = grpc_avl_add(avl, box(1012), box(585), nullptr);
- avl = grpc_avl_add(avl, box(90), box(586), nullptr);
- avl = grpc_avl_add(avl, box(946), box(587), nullptr);
- avl = remove_int(avl, 719);
- avl = grpc_avl_add(avl, box(874), box(589), nullptr);
- avl = grpc_avl_add(avl, box(679), box(590), nullptr);
- avl = remove_int(avl, 53);
- avl = remove_int(avl, 534);
- avl = grpc_avl_add(avl, box(646), box(593), nullptr);
- avl = grpc_avl_add(avl, box(767), box(594), nullptr);
- avl = grpc_avl_add(avl, box(460), box(595), nullptr);
- avl = grpc_avl_add(avl, box(852), box(596), nullptr);
- avl = grpc_avl_add(avl, box(189), box(597), nullptr);
- avl = remove_int(avl, 932);
- avl = remove_int(avl, 366);
- avl = remove_int(avl, 907);
- avl = grpc_avl_add(avl, box(875), box(601), nullptr);
- avl = grpc_avl_add(avl, box(434), box(602), nullptr);
- avl = grpc_avl_add(avl, box(704), box(603), nullptr);
- avl = grpc_avl_add(avl, box(724), box(604), nullptr);
- avl = grpc_avl_add(avl, box(930), box(605), nullptr);
- avl = grpc_avl_add(avl, box(1000), box(606), nullptr);
- avl = remove_int(avl, 479);
- avl = grpc_avl_add(avl, box(275), box(608), nullptr);
- avl = remove_int(avl, 32);
- avl = grpc_avl_add(avl, box(939), box(610), nullptr);
- avl = remove_int(avl, 943);
- avl = remove_int(avl, 329);
- avl = grpc_avl_add(avl, box(490), box(613), nullptr);
- avl = remove_int(avl, 477);
- avl = remove_int(avl, 414);
- avl = remove_int(avl, 187);
- avl = remove_int(avl, 334);
- avl = grpc_avl_add(avl, box(40), box(618), nullptr);
- avl = remove_int(avl, 751);
- avl = grpc_avl_add(avl, box(568), box(620), nullptr);
- avl = grpc_avl_add(avl, box(120), box(621), nullptr);
- avl = grpc_avl_add(avl, box(617), box(622), nullptr);
- avl = grpc_avl_add(avl, box(32), box(623), nullptr);
- avl = remove_int(avl, 701);
- avl = grpc_avl_add(avl, box(910), box(625), nullptr);
- avl = remove_int(avl, 557);
- avl = remove_int(avl, 361);
- avl = remove_int(avl, 937);
- avl = remove_int(avl, 100);
- avl = remove_int(avl, 684);
- avl = grpc_avl_add(avl, box(751), box(631), nullptr);
- avl = remove_int(avl, 781);
- avl = remove_int(avl, 469);
- avl = remove_int(avl, 75);
- avl = remove_int(avl, 561);
- avl = grpc_avl_add(avl, box(854), box(636), nullptr);
- avl = remove_int(avl, 164);
- avl = remove_int(avl, 258);
- avl = remove_int(avl, 315);
- avl = remove_int(avl, 261);
- avl = grpc_avl_add(avl, box(552), box(641), nullptr);
- avl = grpc_avl_add(avl, box(6), box(642), nullptr);
- avl = grpc_avl_add(avl, box(680), box(643), nullptr);
- avl = remove_int(avl, 741);
- avl = remove_int(avl, 309);
- avl = remove_int(avl, 272);
- avl = grpc_avl_add(avl, box(249), box(647), nullptr);
- avl = remove_int(avl, 97);
- avl = remove_int(avl, 850);
- avl = grpc_avl_add(avl, box(915), box(650), nullptr);
- avl = grpc_avl_add(avl, box(816), box(651), nullptr);
- avl = grpc_avl_add(avl, box(45), box(652), nullptr);
- avl = grpc_avl_add(avl, box(168), box(653), nullptr);
- avl = remove_int(avl, 153);
- avl = remove_int(avl, 239);
- avl = grpc_avl_add(avl, box(684), box(656), nullptr);
- avl = grpc_avl_add(avl, box(208), box(657), nullptr);
- avl = grpc_avl_add(avl, box(681), box(658), nullptr);
- avl = grpc_avl_add(avl, box(609), box(659), nullptr);
- avl = grpc_avl_add(avl, box(645), box(660), nullptr);
- avl = remove_int(avl, 799);
- avl = grpc_avl_add(avl, box(955), box(662), nullptr);
- avl = grpc_avl_add(avl, box(946), box(663), nullptr);
- avl = grpc_avl_add(avl, box(744), box(664), nullptr);
- avl = grpc_avl_add(avl, box(201), box(665), nullptr);
- avl = grpc_avl_add(avl, box(136), box(666), nullptr);
- avl = remove_int(avl, 357);
- avl = grpc_avl_add(avl, box(974), box(668), nullptr);
- avl = remove_int(avl, 485);
- avl = grpc_avl_add(avl, box(1009), box(670), nullptr);
- avl = grpc_avl_add(avl, box(517), box(671), nullptr);
- avl = remove_int(avl, 491);
- avl = grpc_avl_add(avl, box(336), box(673), nullptr);
- avl = grpc_avl_add(avl, box(589), box(674), nullptr);
- avl = remove_int(avl, 546);
- avl = remove_int(avl, 840);
- avl = remove_int(avl, 104);
- avl = remove_int(avl, 347);
- avl = grpc_avl_add(avl, box(801), box(679), nullptr);
- avl = remove_int(avl, 799);
- avl = remove_int(avl, 702);
- avl = remove_int(avl, 996);
- avl = remove_int(avl, 93);
- avl = grpc_avl_add(avl, box(561), box(684), nullptr);
- avl = grpc_avl_add(avl, box(25), box(685), nullptr);
- avl = remove_int(avl, 278);
- avl = grpc_avl_add(avl, box(191), box(687), nullptr);
- avl = remove_int(avl, 243);
- avl = remove_int(avl, 918);
- avl = remove_int(avl, 449);
- avl = grpc_avl_add(avl, box(19), box(691), nullptr);
- avl = grpc_avl_add(avl, box(762), box(692), nullptr);
- avl = grpc_avl_add(avl, box(13), box(693), nullptr);
- avl = grpc_avl_add(avl, box(151), box(694), nullptr);
- avl = grpc_avl_add(avl, box(152), box(695), nullptr);
- avl = grpc_avl_add(avl, box(793), box(696), nullptr);
- avl = remove_int(avl, 862);
- avl = remove_int(avl, 890);
- avl = grpc_avl_add(avl, box(687), box(699), nullptr);
- avl = grpc_avl_add(avl, box(509), box(700), nullptr);
- avl = grpc_avl_add(avl, box(973), box(701), nullptr);
- avl = remove_int(avl, 230);
- avl = grpc_avl_add(avl, box(532), box(703), nullptr);
- avl = remove_int(avl, 668);
- avl = grpc_avl_add(avl, box(281), box(705), nullptr);
- avl = grpc_avl_add(avl, box(867), box(706), nullptr);
- avl = grpc_avl_add(avl, box(359), box(707), nullptr);
- avl = remove_int(avl, 425);
- avl = grpc_avl_add(avl, box(691), box(709), nullptr);
- avl = grpc_avl_add(avl, box(163), box(710), nullptr);
- avl = grpc_avl_add(avl, box(502), box(711), nullptr);
- avl = remove_int(avl, 674);
- avl = grpc_avl_add(avl, box(697), box(713), nullptr);
- avl = remove_int(avl, 271);
- avl = grpc_avl_add(avl, box(968), box(715), nullptr);
- avl = grpc_avl_add(avl, box(48), box(716), nullptr);
- avl = remove_int(avl, 543);
- avl = grpc_avl_add(avl, box(35), box(718), nullptr);
- avl = grpc_avl_add(avl, box(751), box(719), nullptr);
- avl = grpc_avl_add(avl, box(478), box(720), nullptr);
- avl = remove_int(avl, 797);
- avl = remove_int(avl, 309);
- avl = grpc_avl_add(avl, box(927), box(723), nullptr);
- avl = remove_int(avl, 504);
- avl = grpc_avl_add(avl, box(286), box(725), nullptr);
- avl = grpc_avl_add(avl, box(413), box(726), nullptr);
- avl = grpc_avl_add(avl, box(599), box(727), nullptr);
- avl = remove_int(avl, 105);
- avl = remove_int(avl, 605);
- avl = grpc_avl_add(avl, box(632), box(730), nullptr);
- avl = grpc_avl_add(avl, box(133), box(731), nullptr);
- avl = remove_int(avl, 443);
- avl = grpc_avl_add(avl, box(958), box(733), nullptr);
- avl = grpc_avl_add(avl, box(729), box(734), nullptr);
- avl = remove_int(avl, 158);
- avl = grpc_avl_add(avl, box(694), box(736), nullptr);
- avl = grpc_avl_add(avl, box(505), box(737), nullptr);
- avl = remove_int(avl, 63);
- avl = remove_int(avl, 714);
- avl = grpc_avl_add(avl, box(1002), box(740), nullptr);
- avl = remove_int(avl, 211);
- avl = grpc_avl_add(avl, box(765), box(742), nullptr);
- avl = grpc_avl_add(avl, box(455), box(743), nullptr);
- avl = remove_int(avl, 59);
- avl = remove_int(avl, 224);
- avl = grpc_avl_add(avl, box(586), box(746), nullptr);
- avl = grpc_avl_add(avl, box(348), box(747), nullptr);
- avl = remove_int(avl, 10);
- avl = remove_int(avl, 484);
- avl = grpc_avl_add(avl, box(968), box(750), nullptr);
- avl = grpc_avl_add(avl, box(923), box(751), nullptr);
- avl = remove_int(avl, 573);
- avl = remove_int(avl, 617);
- avl = grpc_avl_add(avl, box(812), box(754), nullptr);
- avl = grpc_avl_add(avl, box(179), box(755), nullptr);
- avl = remove_int(avl, 284);
- avl = remove_int(avl, 157);
- avl = remove_int(avl, 177);
- avl = remove_int(avl, 896);
- avl = grpc_avl_add(avl, box(649), box(760), nullptr);
- avl = grpc_avl_add(avl, box(927), box(761), nullptr);
- avl = grpc_avl_add(avl, box(454), box(762), nullptr);
- avl = grpc_avl_add(avl, box(217), box(763), nullptr);
- avl = remove_int(avl, 534);
- avl = grpc_avl_add(avl, box(180), box(765), nullptr);
- avl = grpc_avl_add(avl, box(319), box(766), nullptr);
- avl = remove_int(avl, 92);
- avl = grpc_avl_add(avl, box(483), box(768), nullptr);
- avl = remove_int(avl, 504);
- avl = remove_int(avl, 1017);
- avl = remove_int(avl, 37);
- avl = remove_int(avl, 50);
- avl = grpc_avl_add(avl, box(302), box(773), nullptr);
- avl = remove_int(avl, 807);
- avl = grpc_avl_add(avl, box(463), box(775), nullptr);
- avl = grpc_avl_add(avl, box(271), box(776), nullptr);
- avl = grpc_avl_add(avl, box(644), box(777), nullptr);
- avl = remove_int(avl, 618);
- avl = grpc_avl_add(avl, box(166), box(779), nullptr);
- avl = grpc_avl_add(avl, box(538), box(780), nullptr);
- avl = remove_int(avl, 606);
- avl = grpc_avl_add(avl, box(425), box(782), nullptr);
- avl = remove_int(avl, 725);
- avl = remove_int(avl, 383);
- avl = grpc_avl_add(avl, box(155), box(785), nullptr);
- avl = remove_int(avl, 889);
- avl = grpc_avl_add(avl, box(653), box(787), nullptr);
- avl = remove_int(avl, 386);
- avl = grpc_avl_add(avl, box(142), box(789), nullptr);
- avl = remove_int(avl, 107);
- avl = remove_int(avl, 603);
- avl = remove_int(avl, 971);
- avl = grpc_avl_add(avl, box(80), box(793), nullptr);
- avl = grpc_avl_add(avl, box(61), box(794), nullptr);
- avl = grpc_avl_add(avl, box(693), box(795), nullptr);
- avl = grpc_avl_add(avl, box(592), box(796), nullptr);
- avl = grpc_avl_add(avl, box(433), box(797), nullptr);
- avl = grpc_avl_add(avl, box(973), box(798), nullptr);
- avl = remove_int(avl, 901);
- avl = remove_int(avl, 340);
- avl = remove_int(avl, 709);
- avl = grpc_avl_add(avl, box(224), box(802), nullptr);
- avl = remove_int(avl, 120);
- avl = remove_int(avl, 271);
- avl = grpc_avl_add(avl, box(780), box(805), nullptr);
- avl = grpc_avl_add(avl, box(867), box(806), nullptr);
- avl = grpc_avl_add(avl, box(756), box(807), nullptr);
- avl = grpc_avl_add(avl, box(583), box(808), nullptr);
- avl = grpc_avl_add(avl, box(356), box(809), nullptr);
- avl = grpc_avl_add(avl, box(58), box(810), nullptr);
- avl = remove_int(avl, 219);
- avl = grpc_avl_add(avl, box(301), box(812), nullptr);
- avl = remove_int(avl, 643);
- avl = remove_int(avl, 787);
- avl = remove_int(avl, 583);
- avl = remove_int(avl, 552);
- avl = remove_int(avl, 308);
- avl = remove_int(avl, 608);
- avl = remove_int(avl, 363);
- avl = remove_int(avl, 690);
- avl = grpc_avl_add(avl, box(233), box(821), nullptr);
- avl = grpc_avl_add(avl, box(479), box(822), nullptr);
- avl = grpc_avl_add(avl, box(323), box(823), nullptr);
- avl = grpc_avl_add(avl, box(802), box(824), nullptr);
- avl = remove_int(avl, 682);
- avl = remove_int(avl, 705);
- avl = remove_int(avl, 487);
- avl = grpc_avl_add(avl, box(530), box(828), nullptr);
- avl = grpc_avl_add(avl, box(232), box(829), nullptr);
- avl = remove_int(avl, 627);
- avl = grpc_avl_add(avl, box(396), box(831), nullptr);
- avl = grpc_avl_add(avl, box(61), box(832), nullptr);
- avl = grpc_avl_add(avl, box(932), box(833), nullptr);
- avl = grpc_avl_add(avl, box(108), box(834), nullptr);
- avl = grpc_avl_add(avl, box(524), box(835), nullptr);
- avl = remove_int(avl, 390);
- avl = remove_int(avl, 307);
- avl = grpc_avl_add(avl, box(722), box(838), nullptr);
- avl = grpc_avl_add(avl, box(907), box(839), nullptr);
- avl = remove_int(avl, 286);
- avl = remove_int(avl, 337);
- avl = remove_int(avl, 443);
- avl = grpc_avl_add(avl, box(973), box(843), nullptr);
- avl = remove_int(avl, 930);
- avl = remove_int(avl, 242);
- avl = grpc_avl_add(avl, box(997), box(846), nullptr);
- avl = grpc_avl_add(avl, box(689), box(847), nullptr);
- avl = remove_int(avl, 318);
- avl = grpc_avl_add(avl, box(703), box(849), nullptr);
- avl = grpc_avl_add(avl, box(868), box(850), nullptr);
- avl = grpc_avl_add(avl, box(200), box(851), nullptr);
- avl = grpc_avl_add(avl, box(960), box(852), nullptr);
- avl = grpc_avl_add(avl, box(80), box(853), nullptr);
- avl = remove_int(avl, 113);
- avl = grpc_avl_add(avl, box(135), box(855), nullptr);
- avl = remove_int(avl, 529);
- avl = grpc_avl_add(avl, box(366), box(857), nullptr);
- avl = remove_int(avl, 272);
- avl = grpc_avl_add(avl, box(921), box(859), nullptr);
- avl = remove_int(avl, 497);
- avl = grpc_avl_add(avl, box(712), box(861), nullptr);
- avl = remove_int(avl, 777);
- avl = remove_int(avl, 505);
- avl = remove_int(avl, 974);
- avl = remove_int(avl, 497);
- avl = grpc_avl_add(avl, box(388), box(866), nullptr);
- avl = grpc_avl_add(avl, box(29), box(867), nullptr);
- avl = grpc_avl_add(avl, box(180), box(868), nullptr);
- avl = grpc_avl_add(avl, box(983), box(869), nullptr);
- avl = grpc_avl_add(avl, box(72), box(870), nullptr);
- avl = grpc_avl_add(avl, box(693), box(871), nullptr);
- avl = grpc_avl_add(avl, box(567), box(872), nullptr);
- avl = remove_int(avl, 549);
- avl = remove_int(avl, 351);
- avl = grpc_avl_add(avl, box(1019), box(875), nullptr);
- avl = remove_int(avl, 585);
- avl = remove_int(avl, 294);
- avl = remove_int(avl, 61);
- avl = grpc_avl_add(avl, box(409), box(879), nullptr);
- avl = grpc_avl_add(avl, box(984), box(880), nullptr);
- avl = grpc_avl_add(avl, box(830), box(881), nullptr);
- avl = remove_int(avl, 579);
- avl = grpc_avl_add(avl, box(672), box(883), nullptr);
- avl = remove_int(avl, 968);
-
- grpc_avl_unref(avl, nullptr);
-}
-
-static void test_badcase3(void) {
- grpc_avl avl;
-
- gpr_log(GPR_DEBUG, "test_badcase3");
-
- avl = grpc_avl_create(&int_int_vtable);
- avl = remove_int(avl, 624);
- avl = grpc_avl_add(avl, box(59), box(2), nullptr);
- avl = grpc_avl_add(avl, box(494), box(3), nullptr);
- avl = grpc_avl_add(avl, box(226), box(4), nullptr);
- avl = remove_int(avl, 524);
- avl = grpc_avl_add(avl, box(540), box(6), nullptr);
- avl = remove_int(avl, 1008);
- avl = grpc_avl_add(avl, box(502), box(8), nullptr);
- avl = remove_int(avl, 267);
- avl = remove_int(avl, 764);
- avl = remove_int(avl, 443);
- avl = grpc_avl_add(avl, box(8), box(12), nullptr);
- avl = remove_int(avl, 291);
- avl = remove_int(avl, 796);
- avl = remove_int(avl, 1002);
- avl = grpc_avl_add(avl, box(778), box(16), nullptr);
- avl = remove_int(avl, 621);
- avl = remove_int(avl, 891);
- avl = remove_int(avl, 880);
- avl = grpc_avl_add(avl, box(197), box(20), nullptr);
- avl = grpc_avl_add(avl, box(441), box(21), nullptr);
- avl = grpc_avl_add(avl, box(719), box(22), nullptr);
- avl = remove_int(avl, 109);
- avl = grpc_avl_add(avl, box(458), box(24), nullptr);
- avl = remove_int(avl, 86);
- avl = grpc_avl_add(avl, box(897), box(26), nullptr);
- avl = grpc_avl_add(avl, box(997), box(27), nullptr);
- avl = remove_int(avl, 235);
- avl = remove_int(avl, 425);
- avl = remove_int(avl, 186);
- avl = grpc_avl_add(avl, box(887), box(31), nullptr);
- avl = grpc_avl_add(avl, box(1005), box(32), nullptr);
- avl = grpc_avl_add(avl, box(778), box(33), nullptr);
- avl = grpc_avl_add(avl, box(575), box(34), nullptr);
- avl = remove_int(avl, 966);
- avl = remove_int(avl, 1015);
- avl = grpc_avl_add(avl, box(486), box(37), nullptr);
- avl = grpc_avl_add(avl, box(809), box(38), nullptr);
- avl = grpc_avl_add(avl, box(907), box(39), nullptr);
- avl = grpc_avl_add(avl, box(971), box(40), nullptr);
- avl = remove_int(avl, 441);
- avl = remove_int(avl, 498);
- avl = grpc_avl_add(avl, box(727), box(43), nullptr);
- avl = remove_int(avl, 679);
- avl = remove_int(avl, 740);
- avl = remove_int(avl, 532);
- avl = grpc_avl_add(avl, box(805), box(47), nullptr);
- avl = remove_int(avl, 64);
- avl = grpc_avl_add(avl, box(362), box(49), nullptr);
- avl = grpc_avl_add(avl, box(170), box(50), nullptr);
- avl = grpc_avl_add(avl, box(389), box(51), nullptr);
- avl = grpc_avl_add(avl, box(689), box(52), nullptr);
- avl = remove_int(avl, 871);
- avl = grpc_avl_add(avl, box(447), box(54), nullptr);
- avl = remove_int(avl, 718);
- avl = grpc_avl_add(avl, box(724), box(56), nullptr);
- avl = remove_int(avl, 215);
- avl = grpc_avl_add(avl, box(550), box(58), nullptr);
- avl = remove_int(avl, 932);
- avl = grpc_avl_add(avl, box(47), box(60), nullptr);
- avl = remove_int(avl, 46);
- avl = remove_int(avl, 229);
- avl = grpc_avl_add(avl, box(68), box(63), nullptr);
- avl = grpc_avl_add(avl, box(387), box(64), nullptr);
- avl = remove_int(avl, 933);
- avl = remove_int(avl, 736);
- avl = remove_int(avl, 719);
- avl = grpc_avl_add(avl, box(150), box(68), nullptr);
- avl = remove_int(avl, 875);
- avl = remove_int(avl, 298);
- avl = grpc_avl_add(avl, box(991), box(71), nullptr);
- avl = remove_int(avl, 705);
- avl = grpc_avl_add(avl, box(197), box(73), nullptr);
- avl = grpc_avl_add(avl, box(101), box(74), nullptr);
- avl = remove_int(avl, 436);
- avl = grpc_avl_add(avl, box(755), box(76), nullptr);
- avl = grpc_avl_add(avl, box(727), box(77), nullptr);
- avl = remove_int(avl, 309);
- avl = remove_int(avl, 253);
- avl = grpc_avl_add(avl, box(203), box(80), nullptr);
- avl = remove_int(avl, 231);
- avl = grpc_avl_add(avl, box(461), box(82), nullptr);
- avl = remove_int(avl, 316);
- avl = remove_int(avl, 493);
- avl = grpc_avl_add(avl, box(184), box(85), nullptr);
- avl = remove_int(avl, 737);
- avl = grpc_avl_add(avl, box(790), box(87), nullptr);
- avl = grpc_avl_add(avl, box(335), box(88), nullptr);
- avl = remove_int(avl, 649);
- avl = grpc_avl_add(avl, box(69), box(90), nullptr);
- avl = remove_int(avl, 585);
- avl = remove_int(avl, 543);
- avl = grpc_avl_add(avl, box(784), box(93), nullptr);
- avl = grpc_avl_add(avl, box(60), box(94), nullptr);
- avl = grpc_avl_add(avl, box(525), box(95), nullptr);
- avl = grpc_avl_add(avl, box(177), box(96), nullptr);
- avl = grpc_avl_add(avl, box(178), box(97), nullptr);
- avl = grpc_avl_add(avl, box(683), box(98), nullptr);
- avl = grpc_avl_add(avl, box(226), box(99), nullptr);
- avl = grpc_avl_add(avl, box(662), box(100), nullptr);
- avl = remove_int(avl, 944);
- avl = grpc_avl_add(avl, box(562), box(102), nullptr);
- avl = grpc_avl_add(avl, box(793), box(103), nullptr);
- avl = remove_int(avl, 673);
- avl = grpc_avl_add(avl, box(310), box(105), nullptr);
- avl = remove_int(avl, 479);
- avl = remove_int(avl, 543);
- avl = remove_int(avl, 159);
- avl = remove_int(avl, 850);
- avl = grpc_avl_add(avl, box(318), box(110), nullptr);
- avl = grpc_avl_add(avl, box(483), box(111), nullptr);
- avl = grpc_avl_add(avl, box(84), box(112), nullptr);
- avl = remove_int(avl, 109);
- avl = grpc_avl_add(avl, box(132), box(114), nullptr);
- avl = grpc_avl_add(avl, box(920), box(115), nullptr);
- avl = remove_int(avl, 746);
- avl = grpc_avl_add(avl, box(145), box(117), nullptr);
- avl = grpc_avl_add(avl, box(526), box(118), nullptr);
- avl = remove_int(avl, 158);
- avl = grpc_avl_add(avl, box(332), box(120), nullptr);
- avl = grpc_avl_add(avl, box(918), box(121), nullptr);
- avl = remove_int(avl, 339);
- avl = grpc_avl_add(avl, box(809), box(123), nullptr);
- avl = grpc_avl_add(avl, box(742), box(124), nullptr);
- avl = grpc_avl_add(avl, box(718), box(125), nullptr);
- avl = remove_int(avl, 988);
- avl = remove_int(avl, 531);
- avl = remove_int(avl, 840);
- avl = grpc_avl_add(avl, box(816), box(129), nullptr);
- avl = grpc_avl_add(avl, box(976), box(130), nullptr);
- avl = remove_int(avl, 743);
- avl = remove_int(avl, 528);
- avl = remove_int(avl, 982);
- avl = grpc_avl_add(avl, box(803), box(134), nullptr);
- avl = grpc_avl_add(avl, box(205), box(135), nullptr);
- avl = grpc_avl_add(avl, box(584), box(136), nullptr);
- avl = remove_int(avl, 923);
- avl = remove_int(avl, 538);
- avl = remove_int(avl, 398);
- avl = remove_int(avl, 320);
- avl = remove_int(avl, 292);
- avl = grpc_avl_add(avl, box(270), box(142), nullptr);
- avl = grpc_avl_add(avl, box(333), box(143), nullptr);
- avl = remove_int(avl, 439);
- avl = grpc_avl_add(avl, box(35), box(145), nullptr);
- avl = grpc_avl_add(avl, box(837), box(146), nullptr);
- avl = remove_int(avl, 65);
- avl = remove_int(avl, 642);
- avl = remove_int(avl, 371);
- avl = remove_int(avl, 140);
- avl = remove_int(avl, 533);
- avl = remove_int(avl, 676);
- avl = grpc_avl_add(avl, box(624), box(153), nullptr);
- avl = grpc_avl_add(avl, box(116), box(154), nullptr);
- avl = grpc_avl_add(avl, box(446), box(155), nullptr);
- avl = remove_int(avl, 91);
- avl = remove_int(avl, 721);
- avl = remove_int(avl, 537);
- avl = grpc_avl_add(avl, box(448), box(159), nullptr);
- avl = remove_int(avl, 155);
- avl = remove_int(avl, 344);
- avl = remove_int(avl, 237);
- avl = grpc_avl_add(avl, box(309), box(163), nullptr);
- avl = grpc_avl_add(avl, box(434), box(164), nullptr);
- avl = grpc_avl_add(avl, box(277), box(165), nullptr);
- avl = remove_int(avl, 233);
- avl = grpc_avl_add(avl, box(275), box(167), nullptr);
- avl = grpc_avl_add(avl, box(218), box(168), nullptr);
- avl = grpc_avl_add(avl, box(76), box(169), nullptr);
- avl = grpc_avl_add(avl, box(898), box(170), nullptr);
- avl = remove_int(avl, 771);
- avl = grpc_avl_add(avl, box(237), box(172), nullptr);
- avl = remove_int(avl, 327);
- avl = grpc_avl_add(avl, box(499), box(174), nullptr);
- avl = remove_int(avl, 727);
- avl = remove_int(avl, 234);
- avl = remove_int(avl, 623);
- avl = remove_int(avl, 458);
- avl = remove_int(avl, 326);
- avl = remove_int(avl, 589);
- avl = grpc_avl_add(avl, box(442), box(181), nullptr);
- avl = remove_int(avl, 389);
- avl = grpc_avl_add(avl, box(708), box(183), nullptr);
- avl = grpc_avl_add(avl, box(594), box(184), nullptr);
- avl = grpc_avl_add(avl, box(942), box(185), nullptr);
- avl = grpc_avl_add(avl, box(282), box(186), nullptr);
- avl = remove_int(avl, 434);
- avl = remove_int(avl, 134);
- avl = remove_int(avl, 270);
- avl = remove_int(avl, 512);
- avl = remove_int(avl, 265);
- avl = remove_int(avl, 21);
- avl = remove_int(avl, 193);
- avl = remove_int(avl, 797);
- avl = remove_int(avl, 347);
- avl = grpc_avl_add(avl, box(99), box(196), nullptr);
- avl = grpc_avl_add(avl, box(161), box(197), nullptr);
- avl = remove_int(avl, 484);
- avl = grpc_avl_add(avl, box(72), box(199), nullptr);
- avl = remove_int(avl, 629);
- avl = grpc_avl_add(avl, box(522), box(201), nullptr);
- avl = remove_int(avl, 679);
- avl = grpc_avl_add(avl, box(407), box(203), nullptr);
- avl = remove_int(avl, 693);
- avl = grpc_avl_add(avl, box(424), box(205), nullptr);
- avl = grpc_avl_add(avl, box(651), box(206), nullptr);
- avl = grpc_avl_add(avl, box(927), box(207), nullptr);
- avl = remove_int(avl, 553);
- avl = grpc_avl_add(avl, box(128), box(209), nullptr);
- avl = grpc_avl_add(avl, box(616), box(210), nullptr);
- avl = grpc_avl_add(avl, box(690), box(211), nullptr);
- avl = remove_int(avl, 241);
- avl = remove_int(avl, 179);
- avl = grpc_avl_add(avl, box(697), box(214), nullptr);
- avl = remove_int(avl, 779);
- avl = grpc_avl_add(avl, box(241), box(216), nullptr);
- avl = remove_int(avl, 190);
- avl = remove_int(avl, 210);
- avl = grpc_avl_add(avl, box(711), box(219), nullptr);
- avl = remove_int(avl, 251);
- avl = remove_int(avl, 61);
- avl = grpc_avl_add(avl, box(800), box(222), nullptr);
- avl = remove_int(avl, 551);
- avl = grpc_avl_add(avl, box(61), box(224), nullptr);
- avl = grpc_avl_add(avl, box(656), box(225), nullptr);
- avl = remove_int(avl, 130);
- avl = remove_int(avl, 368);
- avl = remove_int(avl, 150);
- avl = remove_int(avl, 73);
- avl = grpc_avl_add(avl, box(799), box(230), nullptr);
- avl = grpc_avl_add(avl, box(125), box(231), nullptr);
- avl = remove_int(avl, 107);
- avl = grpc_avl_add(avl, box(938), box(233), nullptr);
- avl = grpc_avl_add(avl, box(914), box(234), nullptr);
- avl = grpc_avl_add(avl, box(197), box(235), nullptr);
- avl = remove_int(avl, 736);
- avl = grpc_avl_add(avl, box(20), box(237), nullptr);
- avl = remove_int(avl, 224);
- avl = remove_int(avl, 841);
- avl = grpc_avl_add(avl, box(226), box(240), nullptr);
- avl = remove_int(avl, 963);
- avl = remove_int(avl, 796);
- avl = remove_int(avl, 728);
- avl = grpc_avl_add(avl, box(855), box(244), nullptr);
- avl = grpc_avl_add(avl, box(769), box(245), nullptr);
- avl = grpc_avl_add(avl, box(631), box(246), nullptr);
- avl = remove_int(avl, 648);
- avl = grpc_avl_add(avl, box(187), box(248), nullptr);
- avl = grpc_avl_add(avl, box(31), box(249), nullptr);
- avl = remove_int(avl, 163);
- avl = grpc_avl_add(avl, box(218), box(251), nullptr);
- avl = grpc_avl_add(avl, box(488), box(252), nullptr);
- avl = grpc_avl_add(avl, box(387), box(253), nullptr);
- avl = grpc_avl_add(avl, box(809), box(254), nullptr);
- avl = grpc_avl_add(avl, box(997), box(255), nullptr);
- avl = remove_int(avl, 678);
- avl = grpc_avl_add(avl, box(368), box(257), nullptr);
- avl = grpc_avl_add(avl, box(220), box(258), nullptr);
- avl = grpc_avl_add(avl, box(373), box(259), nullptr);
- avl = remove_int(avl, 874);
- avl = remove_int(avl, 682);
- avl = remove_int(avl, 1014);
- avl = remove_int(avl, 195);
- avl = grpc_avl_add(avl, box(868), box(264), nullptr);
- avl = remove_int(avl, 254);
- avl = remove_int(avl, 456);
- avl = grpc_avl_add(avl, box(906), box(267), nullptr);
- avl = remove_int(avl, 711);
- avl = grpc_avl_add(avl, box(632), box(269), nullptr);
- avl = remove_int(avl, 474);
- avl = grpc_avl_add(avl, box(508), box(271), nullptr);
- avl = grpc_avl_add(avl, box(518), box(272), nullptr);
- avl = remove_int(avl, 579);
- avl = remove_int(avl, 948);
- avl = grpc_avl_add(avl, box(789), box(275), nullptr);
- avl = grpc_avl_add(avl, box(48), box(276), nullptr);
- avl = grpc_avl_add(avl, box(256), box(277), nullptr);
- avl = grpc_avl_add(avl, box(754), box(278), nullptr);
- avl = remove_int(avl, 215);
- avl = grpc_avl_add(avl, box(679), box(280), nullptr);
- avl = grpc_avl_add(avl, box(606), box(281), nullptr);
- avl = remove_int(avl, 941);
- avl = remove_int(avl, 31);
- avl = grpc_avl_add(avl, box(758), box(284), nullptr);
- avl = remove_int(avl, 101);
- avl = grpc_avl_add(avl, box(244), box(286), nullptr);
- avl = grpc_avl_add(avl, box(337), box(287), nullptr);
- avl = grpc_avl_add(avl, box(461), box(288), nullptr);
- avl = remove_int(avl, 476);
- avl = grpc_avl_add(avl, box(845), box(290), nullptr);
- avl = remove_int(avl, 160);
- avl = grpc_avl_add(avl, box(690), box(292), nullptr);
- avl = remove_int(avl, 931);
- avl = grpc_avl_add(avl, box(869), box(294), nullptr);
- avl = grpc_avl_add(avl, box(1019), box(295), nullptr);
- avl = remove_int(avl, 591);
- avl = remove_int(avl, 635);
- avl = remove_int(avl, 67);
- avl = grpc_avl_add(avl, box(113), box(299), nullptr);
- avl = remove_int(avl, 305);
- avl = grpc_avl_add(avl, box(10), box(301), nullptr);
- avl = remove_int(avl, 823);
- avl = remove_int(avl, 288);
- avl = remove_int(avl, 239);
- avl = grpc_avl_add(avl, box(646), box(305), nullptr);
- avl = grpc_avl_add(avl, box(1006), box(306), nullptr);
- avl = grpc_avl_add(avl, box(954), box(307), nullptr);
- avl = grpc_avl_add(avl, box(199), box(308), nullptr);
- avl = grpc_avl_add(avl, box(69), box(309), nullptr);
- avl = grpc_avl_add(avl, box(984), box(310), nullptr);
- avl = remove_int(avl, 568);
- avl = remove_int(avl, 666);
- avl = remove_int(avl, 37);
- avl = grpc_avl_add(avl, box(845), box(314), nullptr);
- avl = remove_int(avl, 535);
- avl = remove_int(avl, 365);
- avl = remove_int(avl, 676);
- avl = remove_int(avl, 892);
- avl = remove_int(avl, 425);
- avl = remove_int(avl, 704);
- avl = remove_int(avl, 168);
- avl = grpc_avl_add(avl, box(853), box(322), nullptr);
- avl = grpc_avl_add(avl, box(335), box(323), nullptr);
- avl = grpc_avl_add(avl, box(961), box(324), nullptr);
- avl = grpc_avl_add(avl, box(73), box(325), nullptr);
- avl = remove_int(avl, 469);
- avl = grpc_avl_add(avl, box(449), box(327), nullptr);
- avl = remove_int(avl, 821);
- avl = grpc_avl_add(avl, box(845), box(329), nullptr);
- avl = remove_int(avl, 637);
- avl = grpc_avl_add(avl, box(769), box(331), nullptr);
- avl = grpc_avl_add(avl, box(901), box(332), nullptr);
- avl = remove_int(avl, 142);
- avl = remove_int(avl, 361);
- avl = remove_int(avl, 876);
- avl = grpc_avl_add(avl, box(614), box(336), nullptr);
- avl = grpc_avl_add(avl, box(729), box(337), nullptr);
- avl = remove_int(avl, 120);
- avl = remove_int(avl, 473);
- avl = remove_int(avl, 445);
- avl = grpc_avl_add(avl, box(978), box(341), nullptr);
- avl = grpc_avl_add(avl, box(164), box(342), nullptr);
- avl = grpc_avl_add(avl, box(1), box(343), nullptr);
- avl = remove_int(avl, 890);
- avl = grpc_avl_add(avl, box(605), box(345), nullptr);
- avl = grpc_avl_add(avl, box(178), box(346), nullptr);
- avl = grpc_avl_add(avl, box(481), box(347), nullptr);
- avl = grpc_avl_add(avl, box(772), box(348), nullptr);
- avl = remove_int(avl, 824);
- avl = remove_int(avl, 167);
- avl = remove_int(avl, 151);
- avl = grpc_avl_add(avl, box(698), box(352), nullptr);
- avl = grpc_avl_add(avl, box(202), box(353), nullptr);
- avl = grpc_avl_add(avl, box(921), box(354), nullptr);
- avl = grpc_avl_add(avl, box(875), box(355), nullptr);
- avl = remove_int(avl, 197);
- avl = remove_int(avl, 232);
- avl = grpc_avl_add(avl, box(209), box(358), nullptr);
- avl = remove_int(avl, 324);
- avl = remove_int(avl, 56);
- avl = remove_int(avl, 579);
- avl = remove_int(avl, 255);
- avl = remove_int(avl, 290);
- avl = grpc_avl_add(avl, box(661), box(364), nullptr);
- avl = grpc_avl_add(avl, box(113), box(365), nullptr);
- avl = remove_int(avl, 767);
- avl = grpc_avl_add(avl, box(586), box(367), nullptr);
- avl = grpc_avl_add(avl, box(121), box(368), nullptr);
- avl = remove_int(avl, 235);
- avl = remove_int(avl, 439);
- avl = remove_int(avl, 360);
- avl = grpc_avl_add(avl, box(916), box(372), nullptr);
- avl = remove_int(avl, 999);
- avl = grpc_avl_add(avl, box(825), box(374), nullptr);
- avl = grpc_avl_add(avl, box(177), box(375), nullptr);
- avl = remove_int(avl, 204);
- avl = remove_int(avl, 92);
- avl = grpc_avl_add(avl, box(794), box(378), nullptr);
- avl = grpc_avl_add(avl, box(463), box(379), nullptr);
- avl = grpc_avl_add(avl, box(472), box(380), nullptr);
- avl = remove_int(avl, 235);
- avl = grpc_avl_add(avl, box(840), box(382), nullptr);
- avl = remove_int(avl, 657);
- avl = grpc_avl_add(avl, box(586), box(384), nullptr);
- avl = grpc_avl_add(avl, box(979), box(385), nullptr);
- avl = remove_int(avl, 979);
- avl = grpc_avl_add(avl, box(639), box(387), nullptr);
- avl = remove_int(avl, 907);
- avl = remove_int(avl, 973);
- avl = grpc_avl_add(avl, box(913), box(390), nullptr);
- avl = grpc_avl_add(avl, box(566), box(391), nullptr);
- avl = grpc_avl_add(avl, box(883), box(392), nullptr);
- avl = grpc_avl_add(avl, box(552), box(393), nullptr);
- avl = grpc_avl_add(avl, box(16), box(394), nullptr);
- avl = remove_int(avl, 60);
- avl = grpc_avl_add(avl, box(567), box(396), nullptr);
- avl = grpc_avl_add(avl, box(705), box(397), nullptr);
- avl = grpc_avl_add(avl, box(94), box(398), nullptr);
- avl = remove_int(avl, 321);
- avl = grpc_avl_add(avl, box(207), box(400), nullptr);
- avl = grpc_avl_add(avl, box(682), box(401), nullptr);
- avl = grpc_avl_add(avl, box(592), box(402), nullptr);
- avl = grpc_avl_add(avl, box(10), box(403), nullptr);
- avl = remove_int(avl, 911);
- avl = remove_int(avl, 161);
- avl = grpc_avl_add(avl, box(86), box(406), nullptr);
- avl = remove_int(avl, 893);
- avl = remove_int(avl, 362);
- avl = grpc_avl_add(avl, box(599), box(409), nullptr);
- avl = remove_int(avl, 413);
- avl = grpc_avl_add(avl, box(867), box(411), nullptr);
- avl = remove_int(avl, 955);
- avl = grpc_avl_add(avl, box(341), box(413), nullptr);
- avl = grpc_avl_add(avl, box(887), box(414), nullptr);
- avl = remove_int(avl, 706);
- avl = grpc_avl_add(avl, box(939), box(416), nullptr);
- avl = remove_int(avl, 233);
- avl = remove_int(avl, 662);
- avl = remove_int(avl, 984);
- avl = remove_int(avl, 203);
- avl = grpc_avl_add(avl, box(326), box(421), nullptr);
- avl = remove_int(avl, 848);
- avl = grpc_avl_add(avl, box(235), box(423), nullptr);
- avl = remove_int(avl, 617);
- avl = grpc_avl_add(avl, box(565), box(425), nullptr);
- avl = remove_int(avl, 469);
- avl = grpc_avl_add(avl, box(988), box(427), nullptr);
- avl = remove_int(avl, 957);
- avl = grpc_avl_add(avl, box(426), box(429), nullptr);
- avl = remove_int(avl, 967);
- avl = grpc_avl_add(avl, box(890), box(431), nullptr);
- avl = grpc_avl_add(avl, box(473), box(432), nullptr);
- avl = remove_int(avl, 367);
- avl = remove_int(avl, 344);
- avl = remove_int(avl, 660);
- avl = remove_int(avl, 448);
- avl = remove_int(avl, 837);
- avl = remove_int(avl, 158);
- avl = grpc_avl_add(avl, box(459), box(439), nullptr);
- avl = remove_int(avl, 882);
- avl = remove_int(avl, 782);
- avl = grpc_avl_add(avl, box(408), box(442), nullptr);
- avl = grpc_avl_add(avl, box(728), box(443), nullptr);
- avl = remove_int(avl, 27);
- avl = grpc_avl_add(avl, box(137), box(445), nullptr);
- avl = grpc_avl_add(avl, box(239), box(446), nullptr);
- avl = remove_int(avl, 854);
- avl = grpc_avl_add(avl, box(104), box(448), nullptr);
- avl = grpc_avl_add(avl, box(823), box(449), nullptr);
- avl = grpc_avl_add(avl, box(524), box(450), nullptr);
- avl = grpc_avl_add(avl, box(995), box(451), nullptr);
- avl = remove_int(avl, 422);
- avl = remove_int(avl, 220);
- avl = grpc_avl_add(avl, box(856), box(454), nullptr);
- avl = remove_int(avl, 332);
- avl = grpc_avl_add(avl, box(679), box(456), nullptr);
- avl = remove_int(avl, 18);
- avl = grpc_avl_add(avl, box(837), box(458), nullptr);
- avl = remove_int(avl, 405);
- avl = remove_int(avl, 877);
- avl = remove_int(avl, 835);
- avl = grpc_avl_add(avl, box(547), box(462), nullptr);
- avl = remove_int(avl, 805);
- avl = remove_int(avl, 862);
- avl = grpc_avl_add(avl, box(75), box(465), nullptr);
- avl = remove_int(avl, 41);
- avl = grpc_avl_add(avl, box(310), box(467), nullptr);
- avl = remove_int(avl, 855);
- avl = grpc_avl_add(avl, box(20), box(469), nullptr);
- avl = remove_int(avl, 186);
- avl = remove_int(avl, 378);
- avl = remove_int(avl, 442);
- avl = remove_int(avl, 930);
- avl = grpc_avl_add(avl, box(118), box(474), nullptr);
- avl = grpc_avl_add(avl, box(96), box(475), nullptr);
- avl = remove_int(avl, 854);
- avl = grpc_avl_add(avl, box(65), box(477), nullptr);
- avl = grpc_avl_add(avl, box(573), box(478), nullptr);
- avl = grpc_avl_add(avl, box(4), box(479), nullptr);
- avl = grpc_avl_add(avl, box(451), box(480), nullptr);
- avl = grpc_avl_add(avl, box(774), box(481), nullptr);
- avl = grpc_avl_add(avl, box(126), box(482), nullptr);
- avl = remove_int(avl, 956);
- avl = remove_int(avl, 591);
- avl = remove_int(avl, 644);
- avl = grpc_avl_add(avl, box(304), box(486), nullptr);
- avl = remove_int(avl, 620);
- avl = remove_int(avl, 394);
- avl = grpc_avl_add(avl, box(1002), box(489), nullptr);
- avl = grpc_avl_add(avl, box(837), box(490), nullptr);
- avl = remove_int(avl, 485);
- avl = grpc_avl_add(avl, box(1005), box(492), nullptr);
- avl = remove_int(avl, 21);
- avl = grpc_avl_add(avl, box(396), box(494), nullptr);
- avl = remove_int(avl, 966);
- avl = grpc_avl_add(avl, box(105), box(496), nullptr);
- avl = grpc_avl_add(avl, box(316), box(497), nullptr);
- avl = remove_int(avl, 776);
- avl = grpc_avl_add(avl, box(188), box(499), nullptr);
- avl = remove_int(avl, 200);
- avl = grpc_avl_add(avl, box(98), box(501), nullptr);
- avl = grpc_avl_add(avl, box(831), box(502), nullptr);
- avl = grpc_avl_add(avl, box(227), box(503), nullptr);
- avl = grpc_avl_add(avl, box(220), box(504), nullptr);
- avl = remove_int(avl, 715);
- avl = remove_int(avl, 279);
- avl = grpc_avl_add(avl, box(701), box(507), nullptr);
- avl = grpc_avl_add(avl, box(726), box(508), nullptr);
- avl = grpc_avl_add(avl, box(815), box(509), nullptr);
- avl = grpc_avl_add(avl, box(749), box(510), nullptr);
- avl = remove_int(avl, 946);
- avl = remove_int(avl, 449);
- avl = remove_int(avl, 62);
- avl = remove_int(avl, 487);
- avl = grpc_avl_add(avl, box(545), box(515), nullptr);
- avl = remove_int(avl, 59);
- avl = grpc_avl_add(avl, box(168), box(517), nullptr);
- avl = remove_int(avl, 337);
- avl = grpc_avl_add(avl, box(69), box(519), nullptr);
- avl = remove_int(avl, 600);
- avl = grpc_avl_add(avl, box(591), box(521), nullptr);
- avl = grpc_avl_add(avl, box(960), box(522), nullptr);
- avl = grpc_avl_add(avl, box(116), box(523), nullptr);
- avl = remove_int(avl, 991);
- avl = grpc_avl_add(avl, box(760), box(525), nullptr);
- avl = grpc_avl_add(avl, box(664), box(526), nullptr);
- avl = grpc_avl_add(avl, box(547), box(527), nullptr);
- avl = remove_int(avl, 922);
- avl = grpc_avl_add(avl, box(290), box(529), nullptr);
- avl = grpc_avl_add(avl, box(859), box(530), nullptr);
- avl = grpc_avl_add(avl, box(49), box(531), nullptr);
- avl = remove_int(avl, 455);
- avl = remove_int(avl, 786);
- avl = grpc_avl_add(avl, box(613), box(534), nullptr);
- avl = grpc_avl_add(avl, box(326), box(535), nullptr);
- avl = remove_int(avl, 615);
- avl = grpc_avl_add(avl, box(45), box(537), nullptr);
- avl = grpc_avl_add(avl, box(162), box(538), nullptr);
- avl = grpc_avl_add(avl, box(189), box(539), nullptr);
- avl = remove_int(avl, 68);
- avl = remove_int(avl, 846);
- avl = grpc_avl_add(avl, box(608), box(542), nullptr);
- avl = remove_int(avl, 821);
- avl = grpc_avl_add(avl, box(978), box(544), nullptr);
- avl = grpc_avl_add(avl, box(892), box(545), nullptr);
- avl = remove_int(avl, 924);
- avl = grpc_avl_add(avl, box(708), box(547), nullptr);
- avl = remove_int(avl, 135);
- avl = remove_int(avl, 124);
- avl = grpc_avl_add(avl, box(301), box(550), nullptr);
- avl = grpc_avl_add(avl, box(939), box(551), nullptr);
- avl = grpc_avl_add(avl, box(344), box(552), nullptr);
- avl = remove_int(avl, 443);
- avl = remove_int(avl, 122);
- avl = grpc_avl_add(avl, box(636), box(555), nullptr);
- avl = remove_int(avl, 558);
- avl = grpc_avl_add(avl, box(923), box(557), nullptr);
- avl = remove_int(avl, 827);
- avl = grpc_avl_add(avl, box(649), box(559), nullptr);
- avl = grpc_avl_add(avl, box(808), box(560), nullptr);
- avl = remove_int(avl, 570);
- avl = remove_int(avl, 434);
- avl = grpc_avl_add(avl, box(40), box(563), nullptr);
- avl = grpc_avl_add(avl, box(725), box(564), nullptr);
- avl = remove_int(avl, 295);
- avl = remove_int(avl, 615);
- avl = remove_int(avl, 919);
- avl = remove_int(avl, 170);
- avl = remove_int(avl, 442);
- avl = remove_int(avl, 971);
- avl = grpc_avl_add(avl, box(483), box(571), nullptr);
- avl = grpc_avl_add(avl, box(512), box(572), nullptr);
- avl = remove_int(avl, 648);
- avl = remove_int(avl, 78);
- avl = remove_int(avl, 72);
- avl = remove_int(avl, 790);
- avl = remove_int(avl, 571);
- avl = grpc_avl_add(avl, box(898), box(578), nullptr);
- avl = remove_int(avl, 770);
- avl = remove_int(avl, 776);
- avl = grpc_avl_add(avl, box(602), box(581), nullptr);
- avl = remove_int(avl, 251);
- avl = grpc_avl_add(avl, box(303), box(583), nullptr);
- avl = remove_int(avl, 837);
- avl = grpc_avl_add(avl, box(714), box(585), nullptr);
- avl = remove_int(avl, 800);
- avl = grpc_avl_add(avl, box(266), box(587), nullptr);
- avl = grpc_avl_add(avl, box(555), box(588), nullptr);
- avl = remove_int(avl, 604);
- avl = remove_int(avl, 163);
- avl = remove_int(avl, 497);
- avl = grpc_avl_add(avl, box(296), box(592), nullptr);
- avl = remove_int(avl, 129);
- avl = grpc_avl_add(avl, box(656), box(594), nullptr);
- avl = remove_int(avl, 769);
- avl = remove_int(avl, 941);
- avl = grpc_avl_add(avl, box(775), box(597), nullptr);
- avl = grpc_avl_add(avl, box(846), box(598), nullptr);
- avl = remove_int(avl, 591);
- avl = remove_int(avl, 801);
- avl = remove_int(avl, 419);
- avl = remove_int(avl, 455);
- avl = grpc_avl_add(avl, box(866), box(603), nullptr);
- avl = grpc_avl_add(avl, box(575), box(604), nullptr);
- avl = grpc_avl_add(avl, box(620), box(605), nullptr);
- avl = remove_int(avl, 100);
- avl = remove_int(avl, 667);
- avl = grpc_avl_add(avl, box(138), box(608), nullptr);
- avl = grpc_avl_add(avl, box(566), box(609), nullptr);
- avl = grpc_avl_add(avl, box(673), box(610), nullptr);
- avl = grpc_avl_add(avl, box(178), box(611), nullptr);
- avl = remove_int(avl, 659);
- avl = grpc_avl_add(avl, box(759), box(613), nullptr);
- avl = grpc_avl_add(avl, box(1008), box(614), nullptr);
- avl = remove_int(avl, 116);
- avl = grpc_avl_add(avl, box(608), box(616), nullptr);
- avl = grpc_avl_add(avl, box(339), box(617), nullptr);
- avl = grpc_avl_add(avl, box(197), box(618), nullptr);
- avl = remove_int(avl, 25);
- avl = remove_int(avl, 628);
- avl = grpc_avl_add(avl, box(487), box(621), nullptr);
- avl = remove_int(avl, 739);
- avl = remove_int(avl, 100);
- avl = remove_int(avl, 928);
- avl = grpc_avl_add(avl, box(647), box(625), nullptr);
- avl = remove_int(avl, 978);
- avl = remove_int(avl, 143);
- avl = remove_int(avl, 755);
- avl = grpc_avl_add(avl, box(71), box(629), nullptr);
- avl = remove_int(avl, 205);
- avl = grpc_avl_add(avl, box(501), box(631), nullptr);
- avl = remove_int(avl, 723);
- avl = remove_int(avl, 852);
- avl = remove_int(avl, 1021);
- avl = remove_int(avl, 670);
- avl = remove_int(avl, 500);
- avl = grpc_avl_add(avl, box(330), box(637), nullptr);
- avl = remove_int(avl, 264);
- avl = grpc_avl_add(avl, box(69), box(639), nullptr);
- avl = remove_int(avl, 73);
- avl = grpc_avl_add(avl, box(745), box(641), nullptr);
- avl = remove_int(avl, 518);
- avl = remove_int(avl, 641);
- avl = remove_int(avl, 768);
- avl = grpc_avl_add(avl, box(988), box(645), nullptr);
- avl = grpc_avl_add(avl, box(899), box(646), nullptr);
- avl = remove_int(avl, 763);
- avl = remove_int(avl, 281);
- avl = remove_int(avl, 496);
- avl = grpc_avl_add(avl, box(445), box(650), nullptr);
- avl = remove_int(avl, 905);
- avl = grpc_avl_add(avl, box(275), box(652), nullptr);
- avl = grpc_avl_add(avl, box(137), box(653), nullptr);
- avl = remove_int(avl, 642);
- avl = grpc_avl_add(avl, box(708), box(655), nullptr);
- avl = remove_int(avl, 922);
- avl = grpc_avl_add(avl, box(743), box(657), nullptr);
- avl = remove_int(avl, 295);
- avl = remove_int(avl, 665);
- avl = remove_int(avl, 48);
- avl = grpc_avl_add(avl, box(1012), box(661), nullptr);
- avl = remove_int(avl, 71);
- avl = remove_int(avl, 523);
- avl = grpc_avl_add(avl, box(319), box(664), nullptr);
- avl = remove_int(avl, 632);
- avl = grpc_avl_add(avl, box(137), box(666), nullptr);
- avl = grpc_avl_add(avl, box(686), box(667), nullptr);
- avl = grpc_avl_add(avl, box(724), box(668), nullptr);
- avl = grpc_avl_add(avl, box(952), box(669), nullptr);
- avl = grpc_avl_add(avl, box(5), box(670), nullptr);
- avl = remove_int(avl, 35);
- avl = grpc_avl_add(avl, box(43), box(672), nullptr);
- avl = grpc_avl_add(avl, box(320), box(673), nullptr);
- avl = grpc_avl_add(avl, box(115), box(674), nullptr);
- avl = remove_int(avl, 377);
- avl = remove_int(avl, 591);
- avl = remove_int(avl, 87);
- avl = remove_int(avl, 93);
- avl = grpc_avl_add(avl, box(1016), box(679), nullptr);
- avl = grpc_avl_add(avl, box(605), box(680), nullptr);
- avl = grpc_avl_add(avl, box(152), box(681), nullptr);
- avl = grpc_avl_add(avl, box(113), box(682), nullptr);
- avl = remove_int(avl, 131);
- avl = remove_int(avl, 637);
- avl = grpc_avl_add(avl, box(156), box(685), nullptr);
- avl = remove_int(avl, 696);
- avl = grpc_avl_add(avl, box(546), box(687), nullptr);
- avl = remove_int(avl, 970);
- avl = remove_int(avl, 53);
- avl = remove_int(avl, 827);
- avl = remove_int(avl, 224);
- avl = remove_int(avl, 796);
- avl = remove_int(avl, 34);
- avl = remove_int(avl, 922);
- avl = remove_int(avl, 277);
- avl = remove_int(avl, 650);
- avl = remove_int(avl, 222);
- avl = remove_int(avl, 244);
- avl = remove_int(avl, 576);
- avl = remove_int(avl, 413);
- avl = grpc_avl_add(avl, box(500), box(701), nullptr);
- avl = remove_int(avl, 924);
- avl = grpc_avl_add(avl, box(825), box(703), nullptr);
- avl = remove_int(avl, 888);
- avl = remove_int(avl, 931);
- avl = grpc_avl_add(avl, box(285), box(706), nullptr);
- avl = remove_int(avl, 62);
- avl = remove_int(avl, 444);
- avl = remove_int(avl, 946);
- avl = grpc_avl_add(avl, box(122), box(710), nullptr);
- avl = grpc_avl_add(avl, box(846), box(711), nullptr);
- avl = remove_int(avl, 628);
- avl = grpc_avl_add(avl, box(511), box(713), nullptr);
- avl = grpc_avl_add(avl, box(398), box(714), nullptr);
- avl = remove_int(avl, 730);
- avl = grpc_avl_add(avl, box(797), box(716), nullptr);
- avl = remove_int(avl, 897);
- avl = remove_int(avl, 228);
- avl = remove_int(avl, 544);
- avl = remove_int(avl, 552);
- avl = remove_int(avl, 783);
- avl = remove_int(avl, 583);
- avl = remove_int(avl, 894);
- avl = remove_int(avl, 942);
- avl = grpc_avl_add(avl, box(346), box(725), nullptr);
- avl = grpc_avl_add(avl, box(1015), box(726), nullptr);
- avl = remove_int(avl, 813);
- avl = grpc_avl_add(avl, box(213), box(728), nullptr);
- avl = remove_int(avl, 468);
- avl = remove_int(avl, 365);
- avl = remove_int(avl, 399);
- avl = grpc_avl_add(avl, box(380), box(732), nullptr);
- avl = remove_int(avl, 835);
- avl = remove_int(avl, 970);
- avl = grpc_avl_add(avl, box(700), box(735), nullptr);
- avl = grpc_avl_add(avl, box(807), box(736), nullptr);
- avl = remove_int(avl, 312);
- avl = remove_int(avl, 282);
- avl = remove_int(avl, 370);
- avl = remove_int(avl, 999);
- avl = remove_int(avl, 241);
- avl = remove_int(avl, 884);
- avl = grpc_avl_add(avl, box(587), box(743), nullptr);
- avl = grpc_avl_add(avl, box(332), box(744), nullptr);
- avl = remove_int(avl, 686);
- avl = remove_int(avl, 206);
- avl = remove_int(avl, 835);
- avl = grpc_avl_add(avl, box(334), box(748), nullptr);
- avl = remove_int(avl, 171);
- avl = grpc_avl_add(avl, box(1002), box(750), nullptr);
- avl = grpc_avl_add(avl, box(779), box(751), nullptr);
- avl = grpc_avl_add(avl, box(307), box(752), nullptr);
- avl = grpc_avl_add(avl, box(127), box(753), nullptr);
- avl = grpc_avl_add(avl, box(251), box(754), nullptr);
- avl = remove_int(avl, 790);
- avl = remove_int(avl, 189);
- avl = remove_int(avl, 193);
- avl = remove_int(avl, 38);
- avl = remove_int(avl, 124);
- avl = grpc_avl_add(avl, box(812), box(760), nullptr);
- avl = remove_int(avl, 43);
- avl = grpc_avl_add(avl, box(871), box(762), nullptr);
- avl = grpc_avl_add(avl, box(580), box(763), nullptr);
- avl = remove_int(avl, 501);
- avl = remove_int(avl, 462);
- avl = remove_int(avl, 599);
- avl = grpc_avl_add(avl, box(240), box(767), nullptr);
- avl = grpc_avl_add(avl, box(285), box(768), nullptr);
- avl = grpc_avl_add(avl, box(472), box(769), nullptr);
- avl = remove_int(avl, 865);
- avl = remove_int(avl, 763);
- avl = remove_int(avl, 245);
- avl = remove_int(avl, 80);
- avl = remove_int(avl, 713);
- avl = remove_int(avl, 654);
- avl = remove_int(avl, 1014);
- avl = grpc_avl_add(avl, box(495), box(777), nullptr);
- avl = grpc_avl_add(avl, box(552), box(778), nullptr);
- avl = remove_int(avl, 19);
- avl = remove_int(avl, 803);
- avl = grpc_avl_add(avl, box(508), box(781), nullptr);
- avl = remove_int(avl, 699);
- avl = remove_int(avl, 260);
- avl = remove_int(avl, 92);
- avl = remove_int(avl, 497);
- avl = grpc_avl_add(avl, box(970), box(786), nullptr);
- avl = remove_int(avl, 987);
- avl = remove_int(avl, 168);
- avl = remove_int(avl, 476);
- avl = remove_int(avl, 248);
- avl = grpc_avl_add(avl, box(358), box(791), nullptr);
- avl = remove_int(avl, 804);
- avl = remove_int(avl, 77);
- avl = remove_int(avl, 905);
- avl = remove_int(avl, 362);
- avl = grpc_avl_add(avl, box(578), box(796), nullptr);
- avl = remove_int(avl, 38);
- avl = remove_int(avl, 595);
- avl = grpc_avl_add(avl, box(213), box(799), nullptr);
- avl = remove_int(avl, 7);
- avl = remove_int(avl, 620);
- avl = grpc_avl_add(avl, box(946), box(802), nullptr);
- avl = remove_int(avl, 145);
- avl = grpc_avl_add(avl, box(628), box(804), nullptr);
- avl = remove_int(avl, 972);
- avl = grpc_avl_add(avl, box(728), box(806), nullptr);
- avl = remove_int(avl, 91);
- avl = grpc_avl_add(avl, box(136), box(808), nullptr);
- avl = grpc_avl_add(avl, box(841), box(809), nullptr);
- avl = grpc_avl_add(avl, box(265), box(810), nullptr);
- avl = grpc_avl_add(avl, box(701), box(811), nullptr);
- avl = grpc_avl_add(avl, box(27), box(812), nullptr);
- avl = remove_int(avl, 72);
- avl = remove_int(avl, 14);
- avl = grpc_avl_add(avl, box(286), box(815), nullptr);
- avl = remove_int(avl, 996);
- avl = remove_int(avl, 998);
- avl = grpc_avl_add(avl, box(466), box(818), nullptr);
- avl = remove_int(avl, 1009);
- avl = remove_int(avl, 741);
- avl = remove_int(avl, 947);
- avl = remove_int(avl, 241);
- avl = remove_int(avl, 954);
- avl = remove_int(avl, 183);
- avl = remove_int(avl, 395);
- avl = remove_int(avl, 951);
- avl = grpc_avl_add(avl, box(267), box(827), nullptr);
- avl = remove_int(avl, 812);
- avl = grpc_avl_add(avl, box(577), box(829), nullptr);
- avl = remove_int(avl, 624);
- avl = remove_int(avl, 847);
- avl = remove_int(avl, 745);
- avl = grpc_avl_add(avl, box(491), box(833), nullptr);
- avl = grpc_avl_add(avl, box(941), box(834), nullptr);
- avl = remove_int(avl, 258);
- avl = grpc_avl_add(avl, box(410), box(836), nullptr);
- avl = grpc_avl_add(avl, box(80), box(837), nullptr);
- avl = grpc_avl_add(avl, box(196), box(838), nullptr);
- avl = grpc_avl_add(avl, box(5), box(839), nullptr);
- avl = remove_int(avl, 782);
- avl = grpc_avl_add(avl, box(827), box(841), nullptr);
- avl = remove_int(avl, 472);
- avl = remove_int(avl, 664);
- avl = grpc_avl_add(avl, box(409), box(844), nullptr);
- avl = grpc_avl_add(avl, box(62), box(845), nullptr);
- avl = remove_int(avl, 56);
- avl = remove_int(avl, 606);
- avl = remove_int(avl, 707);
- avl = remove_int(avl, 989);
- avl = remove_int(avl, 549);
- avl = remove_int(avl, 259);
- avl = grpc_avl_add(avl, box(405), box(852), nullptr);
- avl = remove_int(avl, 587);
- avl = remove_int(avl, 350);
- avl = grpc_avl_add(avl, box(980), box(855), nullptr);
- avl = grpc_avl_add(avl, box(992), box(856), nullptr);
- avl = grpc_avl_add(avl, box(818), box(857), nullptr);
- avl = remove_int(avl, 853);
- avl = remove_int(avl, 701);
- avl = grpc_avl_add(avl, box(675), box(860), nullptr);
- avl = remove_int(avl, 248);
- avl = remove_int(avl, 649);
- avl = grpc_avl_add(avl, box(508), box(863), nullptr);
- avl = remove_int(avl, 927);
- avl = grpc_avl_add(avl, box(957), box(865), nullptr);
- avl = grpc_avl_add(avl, box(698), box(866), nullptr);
- avl = grpc_avl_add(avl, box(388), box(867), nullptr);
- avl = grpc_avl_add(avl, box(532), box(868), nullptr);
- avl = grpc_avl_add(avl, box(681), box(869), nullptr);
- avl = remove_int(avl, 544);
- avl = remove_int(avl, 991);
- avl = remove_int(avl, 397);
- avl = grpc_avl_add(avl, box(954), box(873), nullptr);
- avl = grpc_avl_add(avl, box(219), box(874), nullptr);
- avl = grpc_avl_add(avl, box(465), box(875), nullptr);
- avl = remove_int(avl, 371);
- avl = grpc_avl_add(avl, box(601), box(877), nullptr);
- avl = grpc_avl_add(avl, box(543), box(878), nullptr);
- avl = remove_int(avl, 329);
- avl = grpc_avl_add(avl, box(560), box(880), nullptr);
- avl = remove_int(avl, 898);
- avl = grpc_avl_add(avl, box(455), box(882), nullptr);
- avl = remove_int(avl, 313);
- avl = grpc_avl_add(avl, box(215), box(884), nullptr);
- avl = remove_int(avl, 846);
- avl = grpc_avl_add(avl, box(608), box(886), nullptr);
- avl = remove_int(avl, 248);
- avl = grpc_avl_add(avl, box(575), box(888), nullptr);
- avl = remove_int(avl, 207);
- avl = remove_int(avl, 810);
- avl = remove_int(avl, 665);
- avl = remove_int(avl, 361);
- avl = grpc_avl_add(avl, box(154), box(893), nullptr);
- avl = grpc_avl_add(avl, box(329), box(894), nullptr);
- avl = grpc_avl_add(avl, box(326), box(895), nullptr);
- avl = remove_int(avl, 746);
- avl = remove_int(avl, 99);
- avl = grpc_avl_add(avl, box(464), box(898), nullptr);
- avl = grpc_avl_add(avl, box(141), box(899), nullptr);
- avl = remove_int(avl, 383);
- avl = grpc_avl_add(avl, box(414), box(901), nullptr);
- avl = grpc_avl_add(avl, box(777), box(902), nullptr);
- avl = remove_int(avl, 972);
- avl = remove_int(avl, 841);
- avl = remove_int(avl, 100);
- avl = grpc_avl_add(avl, box(828), box(906), nullptr);
- avl = remove_int(avl, 785);
- avl = grpc_avl_add(avl, box(1008), box(908), nullptr);
- avl = grpc_avl_add(avl, box(46), box(909), nullptr);
- avl = remove_int(avl, 399);
- avl = grpc_avl_add(avl, box(178), box(911), nullptr);
- avl = grpc_avl_add(avl, box(573), box(912), nullptr);
- avl = remove_int(avl, 299);
- avl = grpc_avl_add(avl, box(690), box(914), nullptr);
- avl = grpc_avl_add(avl, box(692), box(915), nullptr);
- avl = remove_int(avl, 404);
- avl = remove_int(avl, 16);
- avl = remove_int(avl, 746);
- avl = remove_int(avl, 486);
- avl = remove_int(avl, 119);
- avl = grpc_avl_add(avl, box(167), box(921), nullptr);
- avl = remove_int(avl, 328);
- avl = grpc_avl_add(avl, box(89), box(923), nullptr);
- avl = remove_int(avl, 867);
- avl = remove_int(avl, 626);
- avl = remove_int(avl, 507);
- avl = grpc_avl_add(avl, box(365), box(927), nullptr);
- avl = grpc_avl_add(avl, box(58), box(928), nullptr);
- avl = grpc_avl_add(avl, box(70), box(929), nullptr);
- avl = remove_int(avl, 81);
- avl = remove_int(avl, 797);
- avl = grpc_avl_add(avl, box(846), box(932), nullptr);
- avl = remove_int(avl, 642);
- avl = grpc_avl_add(avl, box(777), box(934), nullptr);
- avl = remove_int(avl, 107);
- avl = grpc_avl_add(avl, box(691), box(936), nullptr);
- avl = grpc_avl_add(avl, box(820), box(937), nullptr);
- avl = grpc_avl_add(avl, box(202), box(938), nullptr);
- avl = grpc_avl_add(avl, box(308), box(939), nullptr);
- avl = grpc_avl_add(avl, box(20), box(940), nullptr);
- avl = remove_int(avl, 289);
- avl = grpc_avl_add(avl, box(714), box(942), nullptr);
- avl = grpc_avl_add(avl, box(584), box(943), nullptr);
- avl = remove_int(avl, 294);
- avl = grpc_avl_add(avl, box(496), box(945), nullptr);
- avl = grpc_avl_add(avl, box(394), box(946), nullptr);
- avl = grpc_avl_add(avl, box(860), box(947), nullptr);
- avl = grpc_avl_add(avl, box(58), box(948), nullptr);
- avl = remove_int(avl, 784);
- avl = remove_int(avl, 584);
- avl = remove_int(avl, 708);
- avl = grpc_avl_add(avl, box(142), box(952), nullptr);
- avl = grpc_avl_add(avl, box(247), box(953), nullptr);
- avl = grpc_avl_add(avl, box(389), box(954), nullptr);
- avl = remove_int(avl, 390);
- avl = grpc_avl_add(avl, box(465), box(956), nullptr);
- avl = grpc_avl_add(avl, box(936), box(957), nullptr);
- avl = grpc_avl_add(avl, box(309), box(958), nullptr);
- avl = remove_int(avl, 928);
- avl = remove_int(avl, 128);
- avl = remove_int(avl, 979);
- avl = remove_int(avl, 670);
- avl = remove_int(avl, 738);
- avl = remove_int(avl, 271);
- avl = remove_int(avl, 540);
- avl = grpc_avl_add(avl, box(365), box(966), nullptr);
- avl = remove_int(avl, 82);
- avl = grpc_avl_add(avl, box(728), box(968), nullptr);
- avl = remove_int(avl, 852);
- avl = grpc_avl_add(avl, box(884), box(970), nullptr);
- avl = grpc_avl_add(avl, box(502), box(971), nullptr);
- avl = remove_int(avl, 898);
- avl = remove_int(avl, 481);
- avl = grpc_avl_add(avl, box(911), box(974), nullptr);
- avl = remove_int(avl, 787);
- avl = remove_int(avl, 785);
- avl = remove_int(avl, 537);
- avl = remove_int(avl, 535);
- avl = remove_int(avl, 136);
- avl = remove_int(avl, 749);
- avl = remove_int(avl, 637);
- avl = remove_int(avl, 900);
- avl = grpc_avl_add(avl, box(598), box(983), nullptr);
- avl = remove_int(avl, 25);
- avl = remove_int(avl, 697);
- avl = grpc_avl_add(avl, box(645), box(986), nullptr);
- avl = grpc_avl_add(avl, box(211), box(987), nullptr);
- avl = grpc_avl_add(avl, box(589), box(988), nullptr);
- avl = remove_int(avl, 702);
- avl = grpc_avl_add(avl, box(53), box(990), nullptr);
- avl = remove_int(avl, 492);
- avl = remove_int(avl, 185);
- avl = remove_int(avl, 246);
- avl = remove_int(avl, 257);
- avl = remove_int(avl, 502);
- avl = remove_int(avl, 34);
- avl = grpc_avl_add(avl, box(74), box(997), nullptr);
- avl = grpc_avl_add(avl, box(834), box(998), nullptr);
- avl = grpc_avl_add(avl, box(514), box(999), nullptr);
- avl = grpc_avl_add(avl, box(75), box(1000), nullptr);
- avl = remove_int(avl, 745);
- avl = grpc_avl_add(avl, box(362), box(1002), nullptr);
- avl = remove_int(avl, 215);
- avl = grpc_avl_add(avl, box(624), box(1004), nullptr);
- avl = remove_int(avl, 404);
- avl = remove_int(avl, 359);
- avl = remove_int(avl, 491);
- avl = grpc_avl_add(avl, box(903), box(1008), nullptr);
- avl = grpc_avl_add(avl, box(240), box(1009), nullptr);
- avl = remove_int(avl, 95);
- avl = grpc_avl_add(avl, box(119), box(1011), nullptr);
- avl = grpc_avl_add(avl, box(857), box(1012), nullptr);
- avl = remove_int(avl, 39);
- avl = remove_int(avl, 866);
- avl = grpc_avl_add(avl, box(503), box(1015), nullptr);
- avl = grpc_avl_add(avl, box(740), box(1016), nullptr);
- avl = remove_int(avl, 637);
- avl = remove_int(avl, 156);
- avl = remove_int(avl, 6);
- avl = remove_int(avl, 745);
- avl = remove_int(avl, 433);
- avl = remove_int(avl, 283);
- avl = grpc_avl_add(avl, box(625), box(1023), nullptr);
- avl = remove_int(avl, 638);
- avl = grpc_avl_add(avl, box(299), box(1025), nullptr);
- avl = grpc_avl_add(avl, box(584), box(1026), nullptr);
- avl = remove_int(avl, 863);
- avl = grpc_avl_add(avl, box(612), box(1028), nullptr);
- avl = grpc_avl_add(avl, box(62), box(1029), nullptr);
- avl = grpc_avl_add(avl, box(432), box(1030), nullptr);
- avl = remove_int(avl, 371);
- avl = remove_int(avl, 790);
- avl = remove_int(avl, 227);
- avl = remove_int(avl, 836);
- avl = grpc_avl_add(avl, box(703), box(1035), nullptr);
- avl = grpc_avl_add(avl, box(644), box(1036), nullptr);
- avl = remove_int(avl, 638);
- avl = grpc_avl_add(avl, box(13), box(1038), nullptr);
- avl = remove_int(avl, 66);
- avl = remove_int(avl, 82);
- avl = grpc_avl_add(avl, box(362), box(1041), nullptr);
- avl = grpc_avl_add(avl, box(783), box(1042), nullptr);
- avl = remove_int(avl, 60);
- avl = grpc_avl_add(avl, box(80), box(1044), nullptr);
- avl = grpc_avl_add(avl, box(825), box(1045), nullptr);
- avl = grpc_avl_add(avl, box(688), box(1046), nullptr);
- avl = grpc_avl_add(avl, box(662), box(1047), nullptr);
- avl = remove_int(avl, 156);
- avl = remove_int(avl, 376);
- avl = remove_int(avl, 99);
- avl = grpc_avl_add(avl, box(526), box(1051), nullptr);
- avl = grpc_avl_add(avl, box(168), box(1052), nullptr);
- avl = remove_int(avl, 646);
- avl = remove_int(avl, 380);
- avl = remove_int(avl, 833);
- avl = grpc_avl_add(avl, box(53), box(1056), nullptr);
- avl = remove_int(avl, 105);
- avl = grpc_avl_add(avl, box(373), box(1058), nullptr);
- avl = grpc_avl_add(avl, box(184), box(1059), nullptr);
- avl = remove_int(avl, 288);
- avl = grpc_avl_add(avl, box(966), box(1061), nullptr);
- avl = remove_int(avl, 158);
- avl = grpc_avl_add(avl, box(406), box(1063), nullptr);
- avl = remove_int(avl, 470);
- avl = grpc_avl_add(avl, box(283), box(1065), nullptr);
- avl = grpc_avl_add(avl, box(838), box(1066), nullptr);
- avl = grpc_avl_add(avl, box(288), box(1067), nullptr);
- avl = grpc_avl_add(avl, box(950), box(1068), nullptr);
- avl = grpc_avl_add(avl, box(163), box(1069), nullptr);
- avl = remove_int(avl, 623);
- avl = remove_int(avl, 769);
- avl = grpc_avl_add(avl, box(144), box(1072), nullptr);
- avl = grpc_avl_add(avl, box(489), box(1073), nullptr);
- avl = remove_int(avl, 15);
- avl = grpc_avl_add(avl, box(971), box(1075), nullptr);
- avl = remove_int(avl, 660);
- avl = grpc_avl_add(avl, box(255), box(1077), nullptr);
- avl = remove_int(avl, 494);
- avl = grpc_avl_add(avl, box(109), box(1079), nullptr);
- avl = grpc_avl_add(avl, box(420), box(1080), nullptr);
- avl = grpc_avl_add(avl, box(509), box(1081), nullptr);
- avl = remove_int(avl, 178);
- avl = grpc_avl_add(avl, box(216), box(1083), nullptr);
- avl = grpc_avl_add(avl, box(707), box(1084), nullptr);
- avl = grpc_avl_add(avl, box(411), box(1085), nullptr);
- avl = grpc_avl_add(avl, box(352), box(1086), nullptr);
- avl = remove_int(avl, 983);
- avl = grpc_avl_add(avl, box(6), box(1088), nullptr);
- avl = grpc_avl_add(avl, box(1014), box(1089), nullptr);
- avl = remove_int(avl, 98);
- avl = remove_int(avl, 325);
- avl = grpc_avl_add(avl, box(851), box(1092), nullptr);
- avl = remove_int(avl, 553);
- avl = grpc_avl_add(avl, box(218), box(1094), nullptr);
- avl = grpc_avl_add(avl, box(261), box(1095), nullptr);
- avl = remove_int(avl, 31);
- avl = grpc_avl_add(avl, box(872), box(1097), nullptr);
- avl = remove_int(avl, 543);
- avl = remove_int(avl, 314);
- avl = remove_int(avl, 443);
- avl = grpc_avl_add(avl, box(533), box(1101), nullptr);
- avl = remove_int(avl, 881);
- avl = remove_int(avl, 269);
- avl = remove_int(avl, 940);
- avl = remove_int(avl, 909);
- avl = remove_int(avl, 197);
- avl = remove_int(avl, 773);
- avl = remove_int(avl, 790);
- avl = remove_int(avl, 345);
- avl = grpc_avl_add(avl, box(965), box(1110), nullptr);
- avl = remove_int(avl, 622);
- avl = grpc_avl_add(avl, box(352), box(1112), nullptr);
- avl = remove_int(avl, 182);
- avl = grpc_avl_add(avl, box(534), box(1114), nullptr);
- avl = grpc_avl_add(avl, box(97), box(1115), nullptr);
- avl = grpc_avl_add(avl, box(198), box(1116), nullptr);
- avl = remove_int(avl, 750);
- avl = grpc_avl_add(avl, box(98), box(1118), nullptr);
- avl = remove_int(avl, 943);
- avl = grpc_avl_add(avl, box(254), box(1120), nullptr);
- avl = grpc_avl_add(avl, box(30), box(1121), nullptr);
- avl = remove_int(avl, 14);
- avl = remove_int(avl, 475);
- avl = remove_int(avl, 82);
- avl = grpc_avl_add(avl, box(789), box(1125), nullptr);
- avl = grpc_avl_add(avl, box(402), box(1126), nullptr);
- avl = remove_int(avl, 1019);
- avl = grpc_avl_add(avl, box(858), box(1128), nullptr);
- avl = grpc_avl_add(avl, box(625), box(1129), nullptr);
- avl = remove_int(avl, 675);
- avl = remove_int(avl, 323);
- avl = grpc_avl_add(avl, box(329), box(1132), nullptr);
- avl = remove_int(avl, 929);
- avl = remove_int(avl, 44);
- avl = grpc_avl_add(avl, box(443), box(1135), nullptr);
- avl = grpc_avl_add(avl, box(653), box(1136), nullptr);
- avl = grpc_avl_add(avl, box(750), box(1137), nullptr);
- avl = grpc_avl_add(avl, box(252), box(1138), nullptr);
- avl = grpc_avl_add(avl, box(449), box(1139), nullptr);
- avl = remove_int(avl, 1022);
- avl = remove_int(avl, 357);
- avl = remove_int(avl, 602);
- avl = remove_int(avl, 131);
- avl = grpc_avl_add(avl, box(531), box(1144), nullptr);
- avl = remove_int(avl, 806);
- avl = grpc_avl_add(avl, box(455), box(1146), nullptr);
- avl = remove_int(avl, 31);
- avl = grpc_avl_add(avl, box(154), box(1148), nullptr);
- avl = grpc_avl_add(avl, box(189), box(1149), nullptr);
- avl = remove_int(avl, 786);
- avl = grpc_avl_add(avl, box(496), box(1151), nullptr);
- avl = grpc_avl_add(avl, box(81), box(1152), nullptr);
- avl = grpc_avl_add(avl, box(59), box(1153), nullptr);
- avl = remove_int(avl, 424);
- avl = remove_int(avl, 668);
- avl = grpc_avl_add(avl, box(723), box(1156), nullptr);
- avl = grpc_avl_add(avl, box(822), box(1157), nullptr);
- avl = grpc_avl_add(avl, box(354), box(1158), nullptr);
- avl = remove_int(avl, 738);
- avl = grpc_avl_add(avl, box(686), box(1160), nullptr);
- avl = grpc_avl_add(avl, box(43), box(1161), nullptr);
- avl = grpc_avl_add(avl, box(625), box(1162), nullptr);
- avl = grpc_avl_add(avl, box(902), box(1163), nullptr);
- avl = grpc_avl_add(avl, box(12), box(1164), nullptr);
- avl = grpc_avl_add(avl, box(977), box(1165), nullptr);
- avl = grpc_avl_add(avl, box(699), box(1166), nullptr);
- avl = grpc_avl_add(avl, box(189), box(1167), nullptr);
- avl = remove_int(avl, 672);
- avl = remove_int(avl, 90);
- avl = remove_int(avl, 757);
- avl = remove_int(avl, 494);
- avl = grpc_avl_add(avl, box(759), box(1172), nullptr);
- avl = remove_int(avl, 758);
- avl = remove_int(avl, 222);
- avl = grpc_avl_add(avl, box(975), box(1175), nullptr);
- avl = remove_int(avl, 993);
- avl = grpc_avl_add(avl, box(2), box(1177), nullptr);
- avl = grpc_avl_add(avl, box(70), box(1178), nullptr);
- avl = remove_int(avl, 350);
- avl = remove_int(avl, 972);
- avl = remove_int(avl, 880);
- avl = grpc_avl_add(avl, box(753), box(1182), nullptr);
- avl = remove_int(avl, 404);
- avl = grpc_avl_add(avl, box(294), box(1184), nullptr);
- avl = remove_int(avl, 474);
- avl = grpc_avl_add(avl, box(228), box(1186), nullptr);
- avl = grpc_avl_add(avl, box(484), box(1187), nullptr);
- avl = remove_int(avl, 238);
- avl = remove_int(avl, 53);
- avl = remove_int(avl, 691);
- avl = grpc_avl_add(avl, box(345), box(1191), nullptr);
- avl = remove_int(avl, 0);
- avl = grpc_avl_add(avl, box(230), box(1193), nullptr);
- avl = remove_int(avl, 227);
- avl = remove_int(avl, 152);
- avl = grpc_avl_add(avl, box(884), box(1196), nullptr);
- avl = remove_int(avl, 823);
- avl = remove_int(avl, 53);
- avl = grpc_avl_add(avl, box(1015), box(1199), nullptr);
- avl = grpc_avl_add(avl, box(697), box(1200), nullptr);
- avl = grpc_avl_add(avl, box(376), box(1201), nullptr);
- avl = remove_int(avl, 411);
- avl = grpc_avl_add(avl, box(888), box(1203), nullptr);
- avl = remove_int(avl, 55);
- avl = grpc_avl_add(avl, box(85), box(1205), nullptr);
- avl = remove_int(avl, 947);
- avl = remove_int(avl, 382);
- avl = remove_int(avl, 777);
- avl = grpc_avl_add(avl, box(1017), box(1209), nullptr);
- avl = grpc_avl_add(avl, box(169), box(1210), nullptr);
- avl = grpc_avl_add(avl, box(156), box(1211), nullptr);
- avl = remove_int(avl, 153);
- avl = remove_int(avl, 642);
- avl = remove_int(avl, 158);
- avl = grpc_avl_add(avl, box(554), box(1215), nullptr);
- avl = grpc_avl_add(avl, box(76), box(1216), nullptr);
- avl = grpc_avl_add(avl, box(756), box(1217), nullptr);
- avl = remove_int(avl, 767);
- avl = remove_int(avl, 112);
- avl = remove_int(avl, 539);
- avl = remove_int(avl, 544);
- avl = remove_int(avl, 628);
- avl = remove_int(avl, 385);
- avl = remove_int(avl, 514);
- avl = remove_int(avl, 362);
- avl = grpc_avl_add(avl, box(523), box(1226), nullptr);
- avl = grpc_avl_add(avl, box(712), box(1227), nullptr);
- avl = grpc_avl_add(avl, box(474), box(1228), nullptr);
- avl = grpc_avl_add(avl, box(882), box(1229), nullptr);
- avl = grpc_avl_add(avl, box(965), box(1230), nullptr);
- avl = remove_int(avl, 464);
- avl = grpc_avl_add(avl, box(319), box(1232), nullptr);
- avl = grpc_avl_add(avl, box(504), box(1233), nullptr);
- avl = remove_int(avl, 818);
- avl = grpc_avl_add(avl, box(884), box(1235), nullptr);
- avl = grpc_avl_add(avl, box(813), box(1236), nullptr);
- avl = grpc_avl_add(avl, box(795), box(1237), nullptr);
- avl = remove_int(avl, 306);
- avl = grpc_avl_add(avl, box(799), box(1239), nullptr);
- avl = remove_int(avl, 534);
- avl = grpc_avl_add(avl, box(480), box(1241), nullptr);
- avl = grpc_avl_add(avl, box(656), box(1242), nullptr);
- avl = grpc_avl_add(avl, box(709), box(1243), nullptr);
- avl = grpc_avl_add(avl, box(500), box(1244), nullptr);
- avl = remove_int(avl, 740);
- avl = grpc_avl_add(avl, box(980), box(1246), nullptr);
- avl = grpc_avl_add(avl, box(458), box(1247), nullptr);
- avl = remove_int(avl, 377);
- avl = remove_int(avl, 338);
- avl = grpc_avl_add(avl, box(554), box(1250), nullptr);
- avl = grpc_avl_add(avl, box(504), box(1251), nullptr);
- avl = grpc_avl_add(avl, box(603), box(1252), nullptr);
- avl = grpc_avl_add(avl, box(761), box(1253), nullptr);
- avl = remove_int(avl, 431);
- avl = grpc_avl_add(avl, box(707), box(1255), nullptr);
- avl = grpc_avl_add(avl, box(673), box(1256), nullptr);
- avl = remove_int(avl, 998);
- avl = remove_int(avl, 332);
- avl = remove_int(avl, 413);
- avl = remove_int(avl, 227);
- avl = remove_int(avl, 249);
- avl = remove_int(avl, 309);
- avl = remove_int(avl, 459);
- avl = grpc_avl_add(avl, box(645), box(1264), nullptr);
- avl = remove_int(avl, 858);
- avl = remove_int(avl, 997);
- avl = grpc_avl_add(avl, box(519), box(1267), nullptr);
- avl = remove_int(avl, 614);
- avl = remove_int(avl, 462);
- avl = remove_int(avl, 792);
- avl = grpc_avl_add(avl, box(987), box(1271), nullptr);
- avl = grpc_avl_add(avl, box(309), box(1272), nullptr);
- avl = remove_int(avl, 747);
- avl = grpc_avl_add(avl, box(621), box(1274), nullptr);
- avl = grpc_avl_add(avl, box(450), box(1275), nullptr);
- avl = remove_int(avl, 265);
- avl = remove_int(avl, 8);
- avl = remove_int(avl, 383);
- avl = grpc_avl_add(avl, box(238), box(1279), nullptr);
- avl = remove_int(avl, 241);
- avl = grpc_avl_add(avl, box(180), box(1281), nullptr);
- avl = grpc_avl_add(avl, box(411), box(1282), nullptr);
- avl = grpc_avl_add(avl, box(791), box(1283), nullptr);
- avl = grpc_avl_add(avl, box(955), box(1284), nullptr);
- avl = remove_int(avl, 24);
- avl = remove_int(avl, 375);
- avl = grpc_avl_add(avl, box(140), box(1287), nullptr);
- avl = remove_int(avl, 949);
- avl = grpc_avl_add(avl, box(301), box(1289), nullptr);
- avl = grpc_avl_add(avl, box(0), box(1290), nullptr);
- avl = remove_int(avl, 371);
- avl = remove_int(avl, 427);
- avl = remove_int(avl, 841);
- avl = remove_int(avl, 847);
- avl = grpc_avl_add(avl, box(814), box(1295), nullptr);
- avl = grpc_avl_add(avl, box(127), box(1296), nullptr);
- avl = grpc_avl_add(avl, box(279), box(1297), nullptr);
- avl = remove_int(avl, 669);
- avl = remove_int(avl, 541);
- avl = remove_int(avl, 275);
- avl = remove_int(avl, 299);
- avl = remove_int(avl, 552);
- avl = grpc_avl_add(avl, box(310), box(1303), nullptr);
- avl = grpc_avl_add(avl, box(304), box(1304), nullptr);
- avl = grpc_avl_add(avl, box(1), box(1305), nullptr);
- avl = grpc_avl_add(avl, box(339), box(1306), nullptr);
- avl = remove_int(avl, 570);
- avl = remove_int(avl, 752);
- avl = remove_int(avl, 552);
- avl = remove_int(avl, 442);
- avl = remove_int(avl, 639);
- avl = grpc_avl_add(avl, box(313), box(1312), nullptr);
- avl = remove_int(avl, 85);
- avl = grpc_avl_add(avl, box(964), box(1314), nullptr);
- avl = grpc_avl_add(avl, box(559), box(1315), nullptr);
- avl = remove_int(avl, 167);
- avl = grpc_avl_add(avl, box(866), box(1317), nullptr);
- avl = remove_int(avl, 275);
- avl = grpc_avl_add(avl, box(173), box(1319), nullptr);
- avl = grpc_avl_add(avl, box(765), box(1320), nullptr);
- avl = remove_int(avl, 883);
- avl = grpc_avl_add(avl, box(547), box(1322), nullptr);
- avl = grpc_avl_add(avl, box(847), box(1323), nullptr);
- avl = remove_int(avl, 817);
- avl = remove_int(avl, 850);
- avl = remove_int(avl, 718);
- avl = grpc_avl_add(avl, box(806), box(1327), nullptr);
- avl = grpc_avl_add(avl, box(360), box(1328), nullptr);
- avl = remove_int(avl, 991);
- avl = grpc_avl_add(avl, box(493), box(1330), nullptr);
- avl = remove_int(avl, 516);
- avl = grpc_avl_add(avl, box(361), box(1332), nullptr);
- avl = remove_int(avl, 355);
- avl = grpc_avl_add(avl, box(512), box(1334), nullptr);
- avl = grpc_avl_add(avl, box(191), box(1335), nullptr);
- avl = remove_int(avl, 703);
- avl = grpc_avl_add(avl, box(333), box(1337), nullptr);
- avl = remove_int(avl, 481);
- avl = grpc_avl_add(avl, box(501), box(1339), nullptr);
- avl = remove_int(avl, 532);
- avl = remove_int(avl, 510);
- avl = grpc_avl_add(avl, box(793), box(1342), nullptr);
- avl = grpc_avl_add(avl, box(234), box(1343), nullptr);
- avl = remove_int(avl, 159);
- avl = remove_int(avl, 429);
- avl = remove_int(avl, 728);
- avl = remove_int(avl, 288);
- avl = grpc_avl_add(avl, box(281), box(1348), nullptr);
- avl = grpc_avl_add(avl, box(702), box(1349), nullptr);
- avl = grpc_avl_add(avl, box(149), box(1350), nullptr);
- avl = remove_int(avl, 22);
- avl = remove_int(avl, 944);
- avl = remove_int(avl, 55);
- avl = remove_int(avl, 512);
- avl = remove_int(avl, 676);
- avl = remove_int(avl, 884);
- avl = grpc_avl_add(avl, box(246), box(1357), nullptr);
- avl = grpc_avl_add(avl, box(455), box(1358), nullptr);
- avl = remove_int(avl, 782);
- avl = remove_int(avl, 682);
- avl = grpc_avl_add(avl, box(243), box(1361), nullptr);
- avl = grpc_avl_add(avl, box(109), box(1362), nullptr);
- avl = grpc_avl_add(avl, box(452), box(1363), nullptr);
- avl = remove_int(avl, 151);
- avl = grpc_avl_add(avl, box(159), box(1365), nullptr);
- avl = remove_int(avl, 1023);
- avl = grpc_avl_add(avl, box(129), box(1367), nullptr);
- avl = grpc_avl_add(avl, box(537), box(1368), nullptr);
- avl = remove_int(avl, 321);
- avl = grpc_avl_add(avl, box(740), box(1370), nullptr);
- avl = remove_int(avl, 45);
- avl = remove_int(avl, 136);
- avl = grpc_avl_add(avl, box(229), box(1373), nullptr);
- avl = remove_int(avl, 772);
- avl = grpc_avl_add(avl, box(181), box(1375), nullptr);
- avl = remove_int(avl, 175);
- avl = grpc_avl_add(avl, box(817), box(1377), nullptr);
- avl = remove_int(avl, 956);
- avl = grpc_avl_add(avl, box(675), box(1379), nullptr);
- avl = grpc_avl_add(avl, box(375), box(1380), nullptr);
- avl = remove_int(avl, 384);
- avl = grpc_avl_add(avl, box(1016), box(1382), nullptr);
- avl = remove_int(avl, 295);
- avl = remove_int(avl, 697);
- avl = remove_int(avl, 554);
- avl = remove_int(avl, 590);
- avl = remove_int(avl, 1014);
- avl = grpc_avl_add(avl, box(890), box(1388), nullptr);
- avl = grpc_avl_add(avl, box(293), box(1389), nullptr);
- avl = remove_int(avl, 207);
- avl = remove_int(avl, 46);
- avl = grpc_avl_add(avl, box(899), box(1392), nullptr);
- avl = grpc_avl_add(avl, box(666), box(1393), nullptr);
- avl = grpc_avl_add(avl, box(85), box(1394), nullptr);
- avl = grpc_avl_add(avl, box(914), box(1395), nullptr);
- avl = grpc_avl_add(avl, box(128), box(1396), nullptr);
- avl = grpc_avl_add(avl, box(835), box(1397), nullptr);
- avl = grpc_avl_add(avl, box(787), box(1398), nullptr);
- avl = grpc_avl_add(avl, box(649), box(1399), nullptr);
- avl = grpc_avl_add(avl, box(723), box(1400), nullptr);
- avl = remove_int(avl, 874);
- avl = grpc_avl_add(avl, box(778), box(1402), nullptr);
- avl = grpc_avl_add(avl, box(1015), box(1403), nullptr);
- avl = grpc_avl_add(avl, box(59), box(1404), nullptr);
- avl = grpc_avl_add(avl, box(259), box(1405), nullptr);
- avl = grpc_avl_add(avl, box(758), box(1406), nullptr);
- avl = remove_int(avl, 648);
- avl = grpc_avl_add(avl, box(145), box(1408), nullptr);
- avl = grpc_avl_add(avl, box(440), box(1409), nullptr);
- avl = remove_int(avl, 608);
- avl = remove_int(avl, 690);
- avl = grpc_avl_add(avl, box(605), box(1412), nullptr);
- avl = remove_int(avl, 856);
- avl = remove_int(avl, 608);
- avl = grpc_avl_add(avl, box(829), box(1415), nullptr);
- avl = grpc_avl_add(avl, box(660), box(1416), nullptr);
- avl = remove_int(avl, 596);
- avl = grpc_avl_add(avl, box(519), box(1418), nullptr);
- avl = grpc_avl_add(avl, box(35), box(1419), nullptr);
- avl = grpc_avl_add(avl, box(871), box(1420), nullptr);
- avl = remove_int(avl, 845);
- avl = grpc_avl_add(avl, box(600), box(1422), nullptr);
- avl = grpc_avl_add(avl, box(215), box(1423), nullptr);
- avl = remove_int(avl, 761);
- avl = grpc_avl_add(avl, box(975), box(1425), nullptr);
- avl = remove_int(avl, 987);
- avl = grpc_avl_add(avl, box(58), box(1427), nullptr);
- avl = remove_int(avl, 119);
- avl = grpc_avl_add(avl, box(937), box(1429), nullptr);
- avl = grpc_avl_add(avl, box(372), box(1430), nullptr);
- avl = grpc_avl_add(avl, box(11), box(1431), nullptr);
- avl = grpc_avl_add(avl, box(398), box(1432), nullptr);
- avl = grpc_avl_add(avl, box(423), box(1433), nullptr);
- avl = remove_int(avl, 171);
- avl = grpc_avl_add(avl, box(473), box(1435), nullptr);
- avl = remove_int(avl, 752);
- avl = remove_int(avl, 625);
- avl = remove_int(avl, 764);
- avl = remove_int(avl, 49);
- avl = grpc_avl_add(avl, box(472), box(1440), nullptr);
- avl = remove_int(avl, 847);
- avl = remove_int(avl, 642);
- avl = remove_int(avl, 1004);
- avl = remove_int(avl, 795);
- avl = remove_int(avl, 465);
- avl = grpc_avl_add(avl, box(636), box(1446), nullptr);
- avl = remove_int(avl, 152);
- avl = grpc_avl_add(avl, box(61), box(1448), nullptr);
- avl = remove_int(avl, 929);
- avl = remove_int(avl, 9);
- avl = grpc_avl_add(avl, box(251), box(1451), nullptr);
- avl = grpc_avl_add(avl, box(672), box(1452), nullptr);
- avl = grpc_avl_add(avl, box(66), box(1453), nullptr);
- avl = remove_int(avl, 693);
- avl = remove_int(avl, 914);
- avl = remove_int(avl, 116);
- avl = remove_int(avl, 577);
- avl = grpc_avl_add(avl, box(618), box(1458), nullptr);
- avl = grpc_avl_add(avl, box(495), box(1459), nullptr);
- avl = remove_int(avl, 450);
- avl = grpc_avl_add(avl, box(533), box(1461), nullptr);
- avl = grpc_avl_add(avl, box(414), box(1462), nullptr);
- avl = remove_int(avl, 74);
- avl = remove_int(avl, 236);
- avl = grpc_avl_add(avl, box(707), box(1465), nullptr);
- avl = grpc_avl_add(avl, box(357), box(1466), nullptr);
- avl = grpc_avl_add(avl, box(1007), box(1467), nullptr);
- avl = grpc_avl_add(avl, box(811), box(1468), nullptr);
- avl = grpc_avl_add(avl, box(418), box(1469), nullptr);
- avl = grpc_avl_add(avl, box(164), box(1470), nullptr);
- avl = grpc_avl_add(avl, box(622), box(1471), nullptr);
- avl = remove_int(avl, 22);
- avl = remove_int(avl, 14);
- avl = remove_int(avl, 732);
- avl = remove_int(avl, 7);
- avl = remove_int(avl, 447);
- avl = grpc_avl_add(avl, box(221), box(1477), nullptr);
- avl = grpc_avl_add(avl, box(202), box(1478), nullptr);
- avl = grpc_avl_add(avl, box(312), box(1479), nullptr);
- avl = remove_int(avl, 274);
- avl = grpc_avl_add(avl, box(684), box(1481), nullptr);
- avl = grpc_avl_add(avl, box(954), box(1482), nullptr);
- avl = grpc_avl_add(avl, box(637), box(1483), nullptr);
- avl = remove_int(avl, 716);
- avl = grpc_avl_add(avl, box(198), box(1485), nullptr);
- avl = remove_int(avl, 340);
- avl = remove_int(avl, 137);
- avl = remove_int(avl, 995);
- avl = remove_int(avl, 1004);
- avl = grpc_avl_add(avl, box(661), box(1490), nullptr);
- avl = grpc_avl_add(avl, box(862), box(1491), nullptr);
- avl = remove_int(avl, 527);
- avl = grpc_avl_add(avl, box(945), box(1493), nullptr);
- avl = remove_int(avl, 355);
- avl = remove_int(avl, 144);
- avl = grpc_avl_add(avl, box(229), box(1496), nullptr);
- avl = grpc_avl_add(avl, box(237), box(1497), nullptr);
- avl = remove_int(avl, 471);
- avl = remove_int(avl, 901);
- avl = grpc_avl_add(avl, box(905), box(1500), nullptr);
- avl = remove_int(avl, 19);
- avl = remove_int(avl, 896);
- avl = remove_int(avl, 585);
- avl = remove_int(avl, 308);
- avl = grpc_avl_add(avl, box(547), box(1505), nullptr);
- avl = grpc_avl_add(avl, box(552), box(1506), nullptr);
- avl = grpc_avl_add(avl, box(30), box(1507), nullptr);
- avl = grpc_avl_add(avl, box(445), box(1508), nullptr);
- avl = remove_int(avl, 785);
- avl = remove_int(avl, 185);
- avl = grpc_avl_add(avl, box(405), box(1511), nullptr);
- avl = grpc_avl_add(avl, box(733), box(1512), nullptr);
- avl = grpc_avl_add(avl, box(573), box(1513), nullptr);
- avl = grpc_avl_add(avl, box(492), box(1514), nullptr);
- avl = grpc_avl_add(avl, box(343), box(1515), nullptr);
- avl = grpc_avl_add(avl, box(527), box(1516), nullptr);
- avl = grpc_avl_add(avl, box(596), box(1517), nullptr);
- avl = grpc_avl_add(avl, box(519), box(1518), nullptr);
- avl = remove_int(avl, 243);
- avl = remove_int(avl, 722);
- avl = grpc_avl_add(avl, box(772), box(1521), nullptr);
- avl = remove_int(avl, 152);
- avl = remove_int(avl, 305);
- avl = grpc_avl_add(avl, box(754), box(1524), nullptr);
- avl = grpc_avl_add(avl, box(373), box(1525), nullptr);
- avl = remove_int(avl, 995);
- avl = grpc_avl_add(avl, box(329), box(1527), nullptr);
- avl = remove_int(avl, 397);
- avl = grpc_avl_add(avl, box(884), box(1529), nullptr);
- avl = remove_int(avl, 329);
- avl = remove_int(avl, 240);
- avl = grpc_avl_add(avl, box(566), box(1532), nullptr);
- avl = grpc_avl_add(avl, box(232), box(1533), nullptr);
- avl = remove_int(avl, 993);
- avl = grpc_avl_add(avl, box(888), box(1535), nullptr);
- avl = remove_int(avl, 242);
- avl = grpc_avl_add(avl, box(941), box(1537), nullptr);
- avl = remove_int(avl, 415);
- avl = grpc_avl_add(avl, box(992), box(1539), nullptr);
- avl = remove_int(avl, 289);
- avl = grpc_avl_add(avl, box(60), box(1541), nullptr);
- avl = grpc_avl_add(avl, box(97), box(1542), nullptr);
- avl = remove_int(avl, 965);
- avl = remove_int(avl, 267);
- avl = remove_int(avl, 360);
- avl = grpc_avl_add(avl, box(5), box(1546), nullptr);
- avl = remove_int(avl, 429);
- avl = grpc_avl_add(avl, box(412), box(1548), nullptr);
- avl = remove_int(avl, 632);
- avl = remove_int(avl, 113);
- avl = grpc_avl_add(avl, box(48), box(1551), nullptr);
- avl = grpc_avl_add(avl, box(108), box(1552), nullptr);
- avl = grpc_avl_add(avl, box(750), box(1553), nullptr);
- avl = remove_int(avl, 188);
- avl = grpc_avl_add(avl, box(668), box(1555), nullptr);
- avl = remove_int(avl, 37);
- avl = remove_int(avl, 737);
- avl = grpc_avl_add(avl, box(93), box(1558), nullptr);
- avl = grpc_avl_add(avl, box(628), box(1559), nullptr);
- avl = grpc_avl_add(avl, box(480), box(1560), nullptr);
- avl = remove_int(avl, 958);
- avl = remove_int(avl, 565);
- avl = remove_int(avl, 32);
- avl = remove_int(avl, 1);
- avl = remove_int(avl, 335);
- avl = grpc_avl_add(avl, box(136), box(1566), nullptr);
- avl = grpc_avl_add(avl, box(469), box(1567), nullptr);
- avl = remove_int(avl, 349);
- avl = grpc_avl_add(avl, box(768), box(1569), nullptr);
- avl = grpc_avl_add(avl, box(915), box(1570), nullptr);
- avl = remove_int(avl, 1014);
- avl = grpc_avl_add(avl, box(117), box(1572), nullptr);
- avl = remove_int(avl, 62);
- avl = grpc_avl_add(avl, box(382), box(1574), nullptr);
- avl = remove_int(avl, 571);
- avl = grpc_avl_add(avl, box(655), box(1576), nullptr);
- avl = grpc_avl_add(avl, box(323), box(1577), nullptr);
- avl = remove_int(avl, 869);
- avl = remove_int(avl, 151);
- avl = grpc_avl_add(avl, box(1019), box(1580), nullptr);
- avl = grpc_avl_add(avl, box(984), box(1581), nullptr);
- avl = grpc_avl_add(avl, box(870), box(1582), nullptr);
- avl = grpc_avl_add(avl, box(376), box(1583), nullptr);
- avl = remove_int(avl, 625);
- avl = grpc_avl_add(avl, box(733), box(1585), nullptr);
- avl = remove_int(avl, 532);
- avl = remove_int(avl, 444);
- avl = grpc_avl_add(avl, box(428), box(1588), nullptr);
- avl = grpc_avl_add(avl, box(860), box(1589), nullptr);
- avl = grpc_avl_add(avl, box(173), box(1590), nullptr);
- avl = remove_int(avl, 649);
- avl = remove_int(avl, 913);
- avl = remove_int(avl, 1);
- avl = remove_int(avl, 304);
- avl = grpc_avl_add(avl, box(604), box(1595), nullptr);
- avl = grpc_avl_add(avl, box(639), box(1596), nullptr);
- avl = remove_int(avl, 431);
- avl = grpc_avl_add(avl, box(993), box(1598), nullptr);
- avl = remove_int(avl, 681);
- avl = remove_int(avl, 927);
- avl = grpc_avl_add(avl, box(87), box(1601), nullptr);
- avl = grpc_avl_add(avl, box(91), box(1602), nullptr);
- avl = remove_int(avl, 61);
- avl = remove_int(avl, 14);
- avl = remove_int(avl, 305);
- avl = remove_int(avl, 304);
- avl = remove_int(avl, 1016);
- avl = grpc_avl_add(avl, box(903), box(1608), nullptr);
- avl = grpc_avl_add(avl, box(951), box(1609), nullptr);
- avl = grpc_avl_add(avl, box(146), box(1610), nullptr);
- avl = grpc_avl_add(avl, box(482), box(1611), nullptr);
- avl = grpc_avl_add(avl, box(71), box(1612), nullptr);
- avl = remove_int(avl, 246);
- avl = remove_int(avl, 696);
- avl = grpc_avl_add(avl, box(636), box(1615), nullptr);
- avl = grpc_avl_add(avl, box(295), box(1616), nullptr);
- avl = remove_int(avl, 11);
- avl = remove_int(avl, 231);
- avl = grpc_avl_add(avl, box(905), box(1619), nullptr);
- avl = grpc_avl_add(avl, box(993), box(1620), nullptr);
- avl = grpc_avl_add(avl, box(433), box(1621), nullptr);
- avl = grpc_avl_add(avl, box(117), box(1622), nullptr);
- avl = grpc_avl_add(avl, box(467), box(1623), nullptr);
- avl = remove_int(avl, 419);
- avl = grpc_avl_add(avl, box(179), box(1625), nullptr);
- avl = remove_int(avl, 926);
- avl = remove_int(avl, 326);
- avl = grpc_avl_add(avl, box(551), box(1628), nullptr);
- avl = remove_int(avl, 14);
- avl = remove_int(avl, 476);
- avl = remove_int(avl, 823);
- avl = grpc_avl_add(avl, box(350), box(1632), nullptr);
- avl = grpc_avl_add(avl, box(133), box(1633), nullptr);
- avl = remove_int(avl, 906);
- avl = grpc_avl_add(avl, box(827), box(1635), nullptr);
- avl = grpc_avl_add(avl, box(201), box(1636), nullptr);
- avl = remove_int(avl, 124);
- avl = remove_int(avl, 662);
- avl = grpc_avl_add(avl, box(314), box(1639), nullptr);
- avl = grpc_avl_add(avl, box(986), box(1640), nullptr);
- avl = grpc_avl_add(avl, box(622), box(1641), nullptr);
- avl = remove_int(avl, 130);
- avl = grpc_avl_add(avl, box(861), box(1643), nullptr);
- avl = remove_int(avl, 497);
- avl = remove_int(avl, 905);
- avl = grpc_avl_add(avl, box(502), box(1646), nullptr);
- avl = remove_int(avl, 721);
- avl = grpc_avl_add(avl, box(514), box(1648), nullptr);
- avl = grpc_avl_add(avl, box(410), box(1649), nullptr);
- avl = remove_int(avl, 869);
- avl = remove_int(avl, 247);
- avl = grpc_avl_add(avl, box(450), box(1652), nullptr);
- avl = remove_int(avl, 364);
- avl = grpc_avl_add(avl, box(963), box(1654), nullptr);
- avl = grpc_avl_add(avl, box(146), box(1655), nullptr);
- avl = remove_int(avl, 147);
- avl = remove_int(avl, 789);
- avl = grpc_avl_add(avl, box(693), box(1658), nullptr);
- avl = grpc_avl_add(avl, box(959), box(1659), nullptr);
- avl = remove_int(avl, 478);
- avl = grpc_avl_add(avl, box(116), box(1661), nullptr);
- avl = grpc_avl_add(avl, box(520), box(1662), nullptr);
- avl = grpc_avl_add(avl, box(809), box(1663), nullptr);
- avl = grpc_avl_add(avl, box(667), box(1664), nullptr);
- avl = grpc_avl_add(avl, box(406), box(1665), nullptr);
- avl = remove_int(avl, 409);
- avl = grpc_avl_add(avl, box(558), box(1667), nullptr);
- avl = grpc_avl_add(avl, box(0), box(1668), nullptr);
- avl = grpc_avl_add(avl, box(948), box(1669), nullptr);
- avl = grpc_avl_add(avl, box(576), box(1670), nullptr);
- avl = remove_int(avl, 864);
- avl = remove_int(avl, 840);
- avl = remove_int(avl, 1001);
- avl = grpc_avl_add(avl, box(232), box(1674), nullptr);
- avl = remove_int(avl, 676);
- avl = remove_int(avl, 752);
- avl = remove_int(avl, 667);
- avl = remove_int(avl, 605);
- avl = grpc_avl_add(avl, box(258), box(1679), nullptr);
- avl = grpc_avl_add(avl, box(648), box(1680), nullptr);
- avl = grpc_avl_add(avl, box(761), box(1681), nullptr);
- avl = remove_int(avl, 293);
- avl = remove_int(avl, 893);
- avl = grpc_avl_add(avl, box(194), box(1684), nullptr);
- avl = remove_int(avl, 233);
- avl = grpc_avl_add(avl, box(888), box(1686), nullptr);
- avl = remove_int(avl, 470);
- avl = remove_int(avl, 703);
- avl = remove_int(avl, 190);
- avl = remove_int(avl, 359);
- avl = grpc_avl_add(avl, box(621), box(1691), nullptr);
- avl = remove_int(avl, 634);
- avl = remove_int(avl, 335);
- avl = grpc_avl_add(avl, box(718), box(1694), nullptr);
- avl = grpc_avl_add(avl, box(463), box(1695), nullptr);
- avl = grpc_avl_add(avl, box(233), box(1696), nullptr);
- avl = remove_int(avl, 376);
- avl = remove_int(avl, 496);
- avl = remove_int(avl, 819);
- avl = remove_int(avl, 38);
- avl = remove_int(avl, 436);
- avl = remove_int(avl, 102);
- avl = grpc_avl_add(avl, box(607), box(1703), nullptr);
- avl = remove_int(avl, 329);
- avl = grpc_avl_add(avl, box(716), box(1705), nullptr);
- avl = remove_int(avl, 639);
- avl = remove_int(avl, 775);
- avl = remove_int(avl, 578);
- avl = remove_int(avl, 464);
- avl = remove_int(avl, 679);
- avl = remove_int(avl, 615);
- avl = remove_int(avl, 104);
- avl = grpc_avl_add(avl, box(414), box(1713), nullptr);
- avl = grpc_avl_add(avl, box(212), box(1714), nullptr);
- avl = grpc_avl_add(avl, box(266), box(1715), nullptr);
- avl = grpc_avl_add(avl, box(238), box(1716), nullptr);
- avl = remove_int(avl, 153);
- avl = grpc_avl_add(avl, box(585), box(1718), nullptr);
- avl = remove_int(avl, 121);
- avl = grpc_avl_add(avl, box(534), box(1720), nullptr);
- avl = remove_int(avl, 579);
- avl = grpc_avl_add(avl, box(127), box(1722), nullptr);
- avl = grpc_avl_add(avl, box(399), box(1723), nullptr);
- avl = remove_int(avl, 417);
- avl = grpc_avl_add(avl, box(978), box(1725), nullptr);
- avl = grpc_avl_add(avl, box(768), box(1726), nullptr);
- avl = remove_int(avl, 985);
- avl = grpc_avl_add(avl, box(536), box(1728), nullptr);
- avl = grpc_avl_add(avl, box(449), box(1729), nullptr);
- avl = grpc_avl_add(avl, box(586), box(1730), nullptr);
- avl = remove_int(avl, 998);
- avl = remove_int(avl, 394);
- avl = remove_int(avl, 141);
- avl = grpc_avl_add(avl, box(889), box(1734), nullptr);
- avl = grpc_avl_add(avl, box(871), box(1735), nullptr);
- avl = grpc_avl_add(avl, box(76), box(1736), nullptr);
- avl = grpc_avl_add(avl, box(549), box(1737), nullptr);
- avl = grpc_avl_add(avl, box(757), box(1738), nullptr);
- avl = remove_int(avl, 908);
- avl = grpc_avl_add(avl, box(789), box(1740), nullptr);
- avl = remove_int(avl, 224);
- avl = grpc_avl_add(avl, box(407), box(1742), nullptr);
- avl = grpc_avl_add(avl, box(381), box(1743), nullptr);
- avl = grpc_avl_add(avl, box(561), box(1744), nullptr);
- avl = grpc_avl_add(avl, box(667), box(1745), nullptr);
- avl = grpc_avl_add(avl, box(522), box(1746), nullptr);
- avl = grpc_avl_add(avl, box(948), box(1747), nullptr);
- avl = remove_int(avl, 770);
- avl = grpc_avl_add(avl, box(872), box(1749), nullptr);
- avl = grpc_avl_add(avl, box(327), box(1750), nullptr);
- avl = remove_int(avl, 10);
- avl = grpc_avl_add(avl, box(122), box(1752), nullptr);
- avl = remove_int(avl, 606);
- avl = grpc_avl_add(avl, box(485), box(1754), nullptr);
- avl = remove_int(avl, 6);
- avl = grpc_avl_add(avl, box(329), box(1756), nullptr);
- avl = grpc_avl_add(avl, box(783), box(1757), nullptr);
- avl = remove_int(avl, 416);
- avl = grpc_avl_add(avl, box(656), box(1759), nullptr);
- avl = grpc_avl_add(avl, box(971), box(1760), nullptr);
- avl = grpc_avl_add(avl, box(77), box(1761), nullptr);
- avl = grpc_avl_add(avl, box(942), box(1762), nullptr);
- avl = remove_int(avl, 361);
- avl = grpc_avl_add(avl, box(66), box(1764), nullptr);
- avl = grpc_avl_add(avl, box(299), box(1765), nullptr);
- avl = grpc_avl_add(avl, box(929), box(1766), nullptr);
- avl = grpc_avl_add(avl, box(797), box(1767), nullptr);
- avl = remove_int(avl, 869);
- avl = remove_int(avl, 907);
- avl = grpc_avl_add(avl, box(870), box(1770), nullptr);
- avl = remove_int(avl, 580);
- avl = remove_int(avl, 120);
- avl = grpc_avl_add(avl, box(913), box(1773), nullptr);
- avl = remove_int(avl, 480);
- avl = grpc_avl_add(avl, box(489), box(1775), nullptr);
- avl = remove_int(avl, 845);
- avl = grpc_avl_add(avl, box(896), box(1777), nullptr);
- avl = remove_int(avl, 567);
- avl = remove_int(avl, 427);
- avl = grpc_avl_add(avl, box(443), box(1780), nullptr);
- avl = grpc_avl_add(avl, box(3), box(1781), nullptr);
- avl = remove_int(avl, 12);
- avl = grpc_avl_add(avl, box(376), box(1783), nullptr);
- avl = grpc_avl_add(avl, box(155), box(1784), nullptr);
- avl = grpc_avl_add(avl, box(188), box(1785), nullptr);
- avl = grpc_avl_add(avl, box(149), box(1786), nullptr);
- avl = grpc_avl_add(avl, box(178), box(1787), nullptr);
- avl = remove_int(avl, 84);
- avl = grpc_avl_add(avl, box(805), box(1789), nullptr);
- avl = grpc_avl_add(avl, box(612), box(1790), nullptr);
- avl = remove_int(avl, 991);
- avl = grpc_avl_add(avl, box(837), box(1792), nullptr);
- avl = remove_int(avl, 173);
- avl = remove_int(avl, 72);
- avl = grpc_avl_add(avl, box(1014), box(1795), nullptr);
- avl = remove_int(avl, 303);
- avl = grpc_avl_add(avl, box(865), box(1797), nullptr);
- avl = grpc_avl_add(avl, box(793), box(1798), nullptr);
- avl = remove_int(avl, 173);
- avl = remove_int(avl, 477);
- avl = grpc_avl_add(avl, box(950), box(1801), nullptr);
- avl = grpc_avl_add(avl, box(105), box(1802), nullptr);
- avl = grpc_avl_add(avl, box(895), box(1803), nullptr);
- avl = grpc_avl_add(avl, box(171), box(1804), nullptr);
- avl = grpc_avl_add(avl, box(753), box(1805), nullptr);
- avl = grpc_avl_add(avl, box(946), box(1806), nullptr);
- avl = remove_int(avl, 194);
- avl = remove_int(avl, 559);
- avl = remove_int(avl, 116);
- avl = grpc_avl_add(avl, box(968), box(1810), nullptr);
- avl = remove_int(avl, 124);
- avl = remove_int(avl, 99);
- avl = grpc_avl_add(avl, box(563), box(1813), nullptr);
- avl = remove_int(avl, 182);
- avl = grpc_avl_add(avl, box(816), box(1815), nullptr);
- avl = remove_int(avl, 73);
- avl = remove_int(avl, 261);
- avl = grpc_avl_add(avl, box(847), box(1818), nullptr);
- avl = grpc_avl_add(avl, box(368), box(1819), nullptr);
- avl = grpc_avl_add(avl, box(808), box(1820), nullptr);
- avl = grpc_avl_add(avl, box(779), box(1821), nullptr);
- avl = remove_int(avl, 818);
- avl = grpc_avl_add(avl, box(466), box(1823), nullptr);
- avl = remove_int(avl, 316);
- avl = grpc_avl_add(avl, box(986), box(1825), nullptr);
- avl = grpc_avl_add(avl, box(688), box(1826), nullptr);
- avl = grpc_avl_add(avl, box(509), box(1827), nullptr);
- avl = grpc_avl_add(avl, box(51), box(1828), nullptr);
- avl = remove_int(avl, 655);
- avl = remove_int(avl, 785);
- avl = remove_int(avl, 893);
- avl = grpc_avl_add(avl, box(167), box(1832), nullptr);
- avl = remove_int(avl, 13);
- avl = remove_int(avl, 263);
- avl = grpc_avl_add(avl, box(1009), box(1835), nullptr);
- avl = remove_int(avl, 480);
- avl = remove_int(avl, 778);
- avl = remove_int(avl, 713);
- avl = remove_int(avl, 628);
- avl = grpc_avl_add(avl, box(803), box(1840), nullptr);
- avl = remove_int(avl, 267);
- avl = grpc_avl_add(avl, box(676), box(1842), nullptr);
- avl = grpc_avl_add(avl, box(231), box(1843), nullptr);
- avl = grpc_avl_add(avl, box(824), box(1844), nullptr);
- avl = remove_int(avl, 961);
- avl = grpc_avl_add(avl, box(311), box(1846), nullptr);
- avl = grpc_avl_add(avl, box(420), box(1847), nullptr);
- avl = grpc_avl_add(avl, box(960), box(1848), nullptr);
- avl = grpc_avl_add(avl, box(468), box(1849), nullptr);
- avl = grpc_avl_add(avl, box(815), box(1850), nullptr);
- avl = remove_int(avl, 247);
- avl = remove_int(avl, 194);
- avl = grpc_avl_add(avl, box(546), box(1853), nullptr);
- avl = remove_int(avl, 222);
- avl = remove_int(avl, 914);
- avl = remove_int(avl, 741);
- avl = grpc_avl_add(avl, box(470), box(1857), nullptr);
- avl = grpc_avl_add(avl, box(933), box(1858), nullptr);
- avl = grpc_avl_add(avl, box(97), box(1859), nullptr);
- avl = remove_int(avl, 564);
- avl = remove_int(avl, 295);
- avl = grpc_avl_add(avl, box(864), box(1862), nullptr);
- avl = remove_int(avl, 329);
- avl = grpc_avl_add(avl, box(124), box(1864), nullptr);
- avl = grpc_avl_add(avl, box(1000), box(1865), nullptr);
- avl = grpc_avl_add(avl, box(228), box(1866), nullptr);
- avl = grpc_avl_add(avl, box(187), box(1867), nullptr);
- avl = remove_int(avl, 224);
- avl = remove_int(avl, 306);
- avl = remove_int(avl, 884);
- avl = grpc_avl_add(avl, box(449), box(1871), nullptr);
- avl = grpc_avl_add(avl, box(353), box(1872), nullptr);
- avl = grpc_avl_add(avl, box(994), box(1873), nullptr);
- avl = grpc_avl_add(avl, box(596), box(1874), nullptr);
- avl = grpc_avl_add(avl, box(996), box(1875), nullptr);
- avl = grpc_avl_add(avl, box(101), box(1876), nullptr);
- avl = grpc_avl_add(avl, box(1012), box(1877), nullptr);
- avl = grpc_avl_add(avl, box(982), box(1878), nullptr);
- avl = grpc_avl_add(avl, box(742), box(1879), nullptr);
- avl = remove_int(avl, 92);
- avl = remove_int(avl, 1022);
- avl = grpc_avl_add(avl, box(941), box(1882), nullptr);
- avl = remove_int(avl, 742);
- avl = remove_int(avl, 919);
- avl = grpc_avl_add(avl, box(588), box(1885), nullptr);
- avl = remove_int(avl, 221);
- avl = grpc_avl_add(avl, box(356), box(1887), nullptr);
- avl = grpc_avl_add(avl, box(932), box(1888), nullptr);
- avl = remove_int(avl, 837);
- avl = grpc_avl_add(avl, box(394), box(1890), nullptr);
- avl = grpc_avl_add(avl, box(642), box(1891), nullptr);
- avl = grpc_avl_add(avl, box(52), box(1892), nullptr);
- avl = grpc_avl_add(avl, box(437), box(1893), nullptr);
- avl = grpc_avl_add(avl, box(948), box(1894), nullptr);
- avl = grpc_avl_add(avl, box(93), box(1895), nullptr);
- avl = remove_int(avl, 873);
- avl = remove_int(avl, 336);
- avl = remove_int(avl, 277);
- avl = remove_int(avl, 932);
- avl = grpc_avl_add(avl, box(80), box(1900), nullptr);
- avl = grpc_avl_add(avl, box(952), box(1901), nullptr);
- avl = grpc_avl_add(avl, box(510), box(1902), nullptr);
- avl = remove_int(avl, 876);
- avl = remove_int(avl, 612);
- avl = grpc_avl_add(avl, box(923), box(1905), nullptr);
- avl = grpc_avl_add(avl, box(475), box(1906), nullptr);
- avl = remove_int(avl, 478);
- avl = remove_int(avl, 148);
- avl = grpc_avl_add(avl, box(538), box(1909), nullptr);
- avl = remove_int(avl, 47);
- avl = grpc_avl_add(avl, box(89), box(1911), nullptr);
- avl = remove_int(avl, 723);
- avl = grpc_avl_add(avl, box(687), box(1913), nullptr);
- avl = grpc_avl_add(avl, box(480), box(1914), nullptr);
- avl = grpc_avl_add(avl, box(149), box(1915), nullptr);
- avl = remove_int(avl, 68);
- avl = remove_int(avl, 862);
- avl = remove_int(avl, 363);
- avl = grpc_avl_add(avl, box(996), box(1919), nullptr);
- avl = remove_int(avl, 380);
- avl = grpc_avl_add(avl, box(957), box(1921), nullptr);
- avl = remove_int(avl, 413);
- avl = grpc_avl_add(avl, box(360), box(1923), nullptr);
- avl = grpc_avl_add(avl, box(304), box(1924), nullptr);
- avl = grpc_avl_add(avl, box(634), box(1925), nullptr);
- avl = grpc_avl_add(avl, box(506), box(1926), nullptr);
- avl = remove_int(avl, 248);
- avl = grpc_avl_add(avl, box(124), box(1928), nullptr);
- avl = grpc_avl_add(avl, box(181), box(1929), nullptr);
- avl = remove_int(avl, 507);
- avl = grpc_avl_add(avl, box(141), box(1931), nullptr);
- avl = remove_int(avl, 409);
- avl = remove_int(avl, 129);
- avl = remove_int(avl, 694);
- avl = remove_int(avl, 723);
- avl = grpc_avl_add(avl, box(998), box(1936), nullptr);
- avl = grpc_avl_add(avl, box(906), box(1937), nullptr);
- avl = grpc_avl_add(avl, box(44), box(1938), nullptr);
- avl = remove_int(avl, 949);
- avl = remove_int(avl, 117);
- avl = grpc_avl_add(avl, box(700), box(1941), nullptr);
- avl = grpc_avl_add(avl, box(258), box(1942), nullptr);
- avl = remove_int(avl, 828);
- avl = grpc_avl_add(avl, box(860), box(1944), nullptr);
- avl = grpc_avl_add(avl, box(987), box(1945), nullptr);
- avl = grpc_avl_add(avl, box(316), box(1946), nullptr);
- avl = grpc_avl_add(avl, box(919), box(1947), nullptr);
- avl = remove_int(avl, 84);
- avl = grpc_avl_add(avl, box(473), box(1949), nullptr);
- avl = remove_int(avl, 127);
- avl = remove_int(avl, 829);
- avl = remove_int(avl, 829);
- avl = grpc_avl_add(avl, box(488), box(1953), nullptr);
- avl = grpc_avl_add(avl, box(954), box(1954), nullptr);
- avl = remove_int(avl, 198);
- avl = remove_int(avl, 972);
- avl = remove_int(avl, 670);
- avl = grpc_avl_add(avl, box(822), box(1958), nullptr);
- avl = remove_int(avl, 589);
- avl = remove_int(avl, 459);
- avl = grpc_avl_add(avl, box(1003), box(1961), nullptr);
- avl = grpc_avl_add(avl, box(657), box(1962), nullptr);
- avl = grpc_avl_add(avl, box(477), box(1963), nullptr);
- avl = grpc_avl_add(avl, box(923), box(1964), nullptr);
- avl = remove_int(avl, 496);
- avl = remove_int(avl, 99);
- avl = grpc_avl_add(avl, box(127), box(1967), nullptr);
- avl = grpc_avl_add(avl, box(1013), box(1968), nullptr);
- avl = grpc_avl_add(avl, box(778), box(1969), nullptr);
- avl = remove_int(avl, 5);
- avl = remove_int(avl, 990);
- avl = remove_int(avl, 850);
- avl = remove_int(avl, 160);
- avl = remove_int(avl, 86);
- avl = grpc_avl_add(avl, box(283), box(1975), nullptr);
- avl = remove_int(avl, 278);
- avl = remove_int(avl, 297);
- avl = remove_int(avl, 137);
- avl = remove_int(avl, 653);
- avl = grpc_avl_add(avl, box(702), box(1980), nullptr);
- avl = remove_int(avl, 63);
- avl = remove_int(avl, 427);
- avl = remove_int(avl, 706);
- avl = remove_int(avl, 806);
- avl = grpc_avl_add(avl, box(335), box(1985), nullptr);
- avl = grpc_avl_add(avl, box(412), box(1986), nullptr);
- avl = remove_int(avl, 766);
- avl = remove_int(avl, 937);
- avl = remove_int(avl, 886);
- avl = remove_int(avl, 652);
- avl = grpc_avl_add(avl, box(545), box(1991), nullptr);
- avl = grpc_avl_add(avl, box(408), box(1992), nullptr);
- avl = grpc_avl_add(avl, box(841), box(1993), nullptr);
- avl = remove_int(avl, 593);
- avl = grpc_avl_add(avl, box(582), box(1995), nullptr);
- avl = grpc_avl_add(avl, box(597), box(1996), nullptr);
- avl = remove_int(avl, 49);
- avl = remove_int(avl, 835);
- avl = grpc_avl_add(avl, box(417), box(1999), nullptr);
- avl = grpc_avl_add(avl, box(191), box(2000), nullptr);
- avl = remove_int(avl, 406);
- avl = grpc_avl_add(avl, box(30), box(2002), nullptr);
- avl = remove_int(avl, 841);
- avl = remove_int(avl, 50);
- avl = grpc_avl_add(avl, box(967), box(2005), nullptr);
- avl = grpc_avl_add(avl, box(849), box(2006), nullptr);
- avl = remove_int(avl, 608);
- avl = grpc_avl_add(avl, box(306), box(2008), nullptr);
- avl = remove_int(avl, 779);
- avl = grpc_avl_add(avl, box(897), box(2010), nullptr);
- avl = grpc_avl_add(avl, box(147), box(2011), nullptr);
- avl = remove_int(avl, 982);
- avl = grpc_avl_add(avl, box(470), box(2013), nullptr);
- avl = remove_int(avl, 951);
- avl = grpc_avl_add(avl, box(388), box(2015), nullptr);
- avl = remove_int(avl, 616);
- avl = remove_int(avl, 721);
- avl = remove_int(avl, 942);
- avl = remove_int(avl, 589);
- avl = grpc_avl_add(avl, box(218), box(2020), nullptr);
- avl = remove_int(avl, 671);
- avl = grpc_avl_add(avl, box(1020), box(2022), nullptr);
- avl = remove_int(avl, 277);
- avl = grpc_avl_add(avl, box(681), box(2024), nullptr);
- avl = grpc_avl_add(avl, box(179), box(2025), nullptr);
- avl = grpc_avl_add(avl, box(370), box(2026), nullptr);
- avl = grpc_avl_add(avl, box(0), box(2027), nullptr);
- avl = remove_int(avl, 523);
- avl = grpc_avl_add(avl, box(99), box(2029), nullptr);
- avl = grpc_avl_add(avl, box(334), box(2030), nullptr);
- avl = grpc_avl_add(avl, box(569), box(2031), nullptr);
- avl = grpc_avl_add(avl, box(257), box(2032), nullptr);
- avl = remove_int(avl, 572);
- avl = grpc_avl_add(avl, box(805), box(2034), nullptr);
- avl = grpc_avl_add(avl, box(143), box(2035), nullptr);
- avl = grpc_avl_add(avl, box(670), box(2036), nullptr);
- avl = remove_int(avl, 42);
- avl = grpc_avl_add(avl, box(46), box(2038), nullptr);
- avl = remove_int(avl, 970);
- avl = grpc_avl_add(avl, box(353), box(2040), nullptr);
- avl = remove_int(avl, 258);
- avl = grpc_avl_add(avl, box(451), box(2042), nullptr);
- avl = grpc_avl_add(avl, box(28), box(2043), nullptr);
- avl = grpc_avl_add(avl, box(729), box(2044), nullptr);
- avl = grpc_avl_add(avl, box(401), box(2045), nullptr);
- avl = grpc_avl_add(avl, box(614), box(2046), nullptr);
- avl = remove_int(avl, 990);
- avl = remove_int(avl, 212);
- avl = remove_int(avl, 22);
- avl = remove_int(avl, 677);
- avl = grpc_avl_add(avl, box(1016), box(2051), nullptr);
- avl = grpc_avl_add(avl, box(980), box(2052), nullptr);
- avl = grpc_avl_add(avl, box(990), box(2053), nullptr);
- avl = grpc_avl_add(avl, box(355), box(2054), nullptr);
- avl = remove_int(avl, 730);
- avl = remove_int(avl, 37);
- avl = grpc_avl_add(avl, box(407), box(2057), nullptr);
- avl = grpc_avl_add(avl, box(222), box(2058), nullptr);
- avl = grpc_avl_add(avl, box(439), box(2059), nullptr);
- avl = grpc_avl_add(avl, box(563), box(2060), nullptr);
- avl = remove_int(avl, 992);
- avl = remove_int(avl, 786);
- avl = grpc_avl_add(avl, box(1), box(2063), nullptr);
- avl = grpc_avl_add(avl, box(473), box(2064), nullptr);
- avl = grpc_avl_add(avl, box(992), box(2065), nullptr);
- avl = remove_int(avl, 190);
- avl = remove_int(avl, 450);
- avl = remove_int(avl, 1020);
- avl = remove_int(avl, 149);
- avl = grpc_avl_add(avl, box(329), box(2070), nullptr);
- avl = grpc_avl_add(avl, box(35), box(2071), nullptr);
- avl = remove_int(avl, 843);
- avl = grpc_avl_add(avl, box(855), box(2073), nullptr);
- avl = remove_int(avl, 878);
- avl = grpc_avl_add(avl, box(993), box(2075), nullptr);
- avl = grpc_avl_add(avl, box(87), box(2076), nullptr);
- avl = grpc_avl_add(avl, box(572), box(2077), nullptr);
- avl = remove_int(avl, 896);
- avl = grpc_avl_add(avl, box(849), box(2079), nullptr);
- avl = remove_int(avl, 597);
- avl = grpc_avl_add(avl, box(472), box(2081), nullptr);
- avl = remove_int(avl, 778);
- avl = remove_int(avl, 934);
- avl = remove_int(avl, 314);
- avl = grpc_avl_add(avl, box(101), box(2085), nullptr);
- avl = remove_int(avl, 938);
- avl = remove_int(avl, 1010);
- avl = grpc_avl_add(avl, box(579), box(2088), nullptr);
- avl = remove_int(avl, 798);
- avl = remove_int(avl, 88);
- avl = grpc_avl_add(avl, box(851), box(2091), nullptr);
- avl = remove_int(avl, 705);
- avl = grpc_avl_add(avl, box(26), box(2093), nullptr);
- avl = remove_int(avl, 973);
- avl = grpc_avl_add(avl, box(923), box(2095), nullptr);
- avl = remove_int(avl, 668);
- avl = grpc_avl_add(avl, box(310), box(2097), nullptr);
- avl = grpc_avl_add(avl, box(269), box(2098), nullptr);
- avl = remove_int(avl, 173);
- avl = grpc_avl_add(avl, box(279), box(2100), nullptr);
- avl = remove_int(avl, 203);
- avl = grpc_avl_add(avl, box(411), box(2102), nullptr);
- avl = remove_int(avl, 950);
- avl = grpc_avl_add(avl, box(6), box(2104), nullptr);
- avl = remove_int(avl, 400);
- avl = remove_int(avl, 468);
- avl = remove_int(avl, 271);
- avl = grpc_avl_add(avl, box(627), box(2108), nullptr);
- avl = remove_int(avl, 727);
- avl = remove_int(avl, 148);
- avl = remove_int(avl, 98);
- avl = remove_int(avl, 997);
- avl = remove_int(avl, 215);
- avl = remove_int(avl, 628);
- avl = remove_int(avl, 826);
- avl = remove_int(avl, 664);
- avl = grpc_avl_add(avl, box(76), box(2117), nullptr);
- avl = remove_int(avl, 194);
- avl = remove_int(avl, 18);
- avl = grpc_avl_add(avl, box(727), box(2120), nullptr);
- avl = remove_int(avl, 295);
- avl = grpc_avl_add(avl, box(645), box(2122), nullptr);
- avl = remove_int(avl, 321);
- avl = remove_int(avl, 863);
- avl = grpc_avl_add(avl, box(824), box(2125), nullptr);
- avl = grpc_avl_add(avl, box(651), box(2126), nullptr);
- avl = grpc_avl_add(avl, box(804), box(2127), nullptr);
- avl = remove_int(avl, 307);
- avl = grpc_avl_add(avl, box(867), box(2129), nullptr);
- avl = remove_int(avl, 384);
- avl = grpc_avl_add(avl, box(819), box(2131), nullptr);
- avl = remove_int(avl, 674);
- avl = grpc_avl_add(avl, box(76), box(2133), nullptr);
- avl = remove_int(avl, 898);
- avl = grpc_avl_add(avl, box(45), box(2135), nullptr);
- avl = grpc_avl_add(avl, box(512), box(2136), nullptr);
- avl = remove_int(avl, 773);
- avl = remove_int(avl, 907);
- avl = remove_int(avl, 382);
- avl = remove_int(avl, 95);
- avl = remove_int(avl, 734);
- avl = remove_int(avl, 81);
- avl = grpc_avl_add(avl, box(348), box(2143), nullptr);
- avl = remove_int(avl, 509);
- avl = remove_int(avl, 301);
- avl = grpc_avl_add(avl, box(861), box(2146), nullptr);
- avl = grpc_avl_add(avl, box(918), box(2147), nullptr);
- avl = remove_int(avl, 992);
- avl = grpc_avl_add(avl, box(356), box(2149), nullptr);
- avl = remove_int(avl, 64);
- avl = remove_int(avl, 444);
- avl = remove_int(avl, 741);
- avl = grpc_avl_add(avl, box(710), box(2153), nullptr);
- avl = grpc_avl_add(avl, box(264), box(2154), nullptr);
- avl = remove_int(avl, 347);
- avl = remove_int(avl, 250);
- avl = grpc_avl_add(avl, box(82), box(2157), nullptr);
- avl = grpc_avl_add(avl, box(571), box(2158), nullptr);
- avl = remove_int(avl, 721);
- avl = remove_int(avl, 622);
- avl = grpc_avl_add(avl, box(950), box(2161), nullptr);
- avl = grpc_avl_add(avl, box(94), box(2162), nullptr);
- avl = remove_int(avl, 970);
- avl = grpc_avl_add(avl, box(815), box(2164), nullptr);
- avl = remove_int(avl, 930);
- avl = remove_int(avl, 703);
- avl = grpc_avl_add(avl, box(432), box(2167), nullptr);
- avl = remove_int(avl, 544);
- avl = grpc_avl_add(avl, box(21), box(2169), nullptr);
- avl = grpc_avl_add(avl, box(186), box(2170), nullptr);
- avl = remove_int(avl, 143);
- avl = grpc_avl_add(avl, box(425), box(2172), nullptr);
- avl = remove_int(avl, 769);
- avl = grpc_avl_add(avl, box(656), box(2174), nullptr);
- avl = remove_int(avl, 29);
- avl = grpc_avl_add(avl, box(464), box(2176), nullptr);
- avl = remove_int(avl, 713);
- avl = grpc_avl_add(avl, box(800), box(2178), nullptr);
- avl = remove_int(avl, 621);
- avl = grpc_avl_add(avl, box(962), box(2180), nullptr);
- avl = remove_int(avl, 448);
- avl = grpc_avl_add(avl, box(878), box(2182), nullptr);
- avl = remove_int(avl, 39);
- avl = remove_int(avl, 999);
- avl = grpc_avl_add(avl, box(182), box(2185), nullptr);
- avl = grpc_avl_add(avl, box(429), box(2186), nullptr);
- avl = grpc_avl_add(avl, box(598), box(2187), nullptr);
- avl = remove_int(avl, 551);
- avl = grpc_avl_add(avl, box(827), box(2189), nullptr);
- avl = grpc_avl_add(avl, box(809), box(2190), nullptr);
- avl = remove_int(avl, 438);
- avl = remove_int(avl, 811);
- avl = grpc_avl_add(avl, box(808), box(2193), nullptr);
- avl = grpc_avl_add(avl, box(788), box(2194), nullptr);
- avl = remove_int(avl, 156);
- avl = grpc_avl_add(avl, box(933), box(2196), nullptr);
- avl = grpc_avl_add(avl, box(344), box(2197), nullptr);
- avl = remove_int(avl, 460);
- avl = grpc_avl_add(avl, box(161), box(2199), nullptr);
- avl = grpc_avl_add(avl, box(444), box(2200), nullptr);
- avl = remove_int(avl, 597);
- avl = remove_int(avl, 668);
- avl = grpc_avl_add(avl, box(703), box(2203), nullptr);
- avl = remove_int(avl, 515);
- avl = grpc_avl_add(avl, box(380), box(2205), nullptr);
- avl = grpc_avl_add(avl, box(338), box(2206), nullptr);
- avl = remove_int(avl, 550);
- avl = remove_int(avl, 946);
- avl = remove_int(avl, 714);
- avl = remove_int(avl, 739);
- avl = grpc_avl_add(avl, box(413), box(2211), nullptr);
- avl = remove_int(avl, 450);
- avl = grpc_avl_add(avl, box(411), box(2213), nullptr);
- avl = grpc_avl_add(avl, box(117), box(2214), nullptr);
- avl = grpc_avl_add(avl, box(322), box(2215), nullptr);
- avl = grpc_avl_add(avl, box(915), box(2216), nullptr);
- avl = grpc_avl_add(avl, box(410), box(2217), nullptr);
- avl = grpc_avl_add(avl, box(66), box(2218), nullptr);
- avl = remove_int(avl, 756);
- avl = remove_int(avl, 596);
- avl = grpc_avl_add(avl, box(882), box(2221), nullptr);
- avl = grpc_avl_add(avl, box(930), box(2222), nullptr);
- avl = grpc_avl_add(avl, box(36), box(2223), nullptr);
- avl = remove_int(avl, 742);
- avl = grpc_avl_add(avl, box(539), box(2225), nullptr);
- avl = grpc_avl_add(avl, box(596), box(2226), nullptr);
- avl = remove_int(avl, 82);
- avl = remove_int(avl, 686);
- avl = remove_int(avl, 933);
- avl = remove_int(avl, 42);
- avl = remove_int(avl, 340);
- avl = grpc_avl_add(avl, box(126), box(2232), nullptr);
- avl = grpc_avl_add(avl, box(493), box(2233), nullptr);
- avl = grpc_avl_add(avl, box(839), box(2234), nullptr);
- avl = remove_int(avl, 774);
- avl = grpc_avl_add(avl, box(337), box(2236), nullptr);
- avl = remove_int(avl, 322);
- avl = grpc_avl_add(avl, box(16), box(2238), nullptr);
- avl = remove_int(avl, 73);
- avl = remove_int(avl, 85);
- avl = remove_int(avl, 191);
- avl = remove_int(avl, 541);
- avl = grpc_avl_add(avl, box(704), box(2243), nullptr);
- avl = remove_int(avl, 767);
- avl = remove_int(avl, 1006);
- avl = remove_int(avl, 844);
- avl = remove_int(avl, 742);
- avl = grpc_avl_add(avl, box(48), box(2248), nullptr);
- avl = grpc_avl_add(avl, box(138), box(2249), nullptr);
- avl = grpc_avl_add(avl, box(437), box(2250), nullptr);
- avl = grpc_avl_add(avl, box(275), box(2251), nullptr);
- avl = remove_int(avl, 520);
- avl = grpc_avl_add(avl, box(1019), box(2253), nullptr);
- avl = remove_int(avl, 955);
- avl = grpc_avl_add(avl, box(270), box(2255), nullptr);
- avl = remove_int(avl, 680);
- avl = remove_int(avl, 698);
- avl = grpc_avl_add(avl, box(735), box(2258), nullptr);
- avl = grpc_avl_add(avl, box(400), box(2259), nullptr);
- avl = remove_int(avl, 991);
- avl = grpc_avl_add(avl, box(263), box(2261), nullptr);
- avl = remove_int(avl, 704);
- avl = grpc_avl_add(avl, box(757), box(2263), nullptr);
- avl = remove_int(avl, 194);
- avl = remove_int(avl, 616);
- avl = remove_int(avl, 784);
- avl = grpc_avl_add(avl, box(382), box(2267), nullptr);
- avl = grpc_avl_add(avl, box(464), box(2268), nullptr);
- avl = grpc_avl_add(avl, box(817), box(2269), nullptr);
- avl = remove_int(avl, 445);
- avl = grpc_avl_add(avl, box(412), box(2271), nullptr);
- avl = remove_int(avl, 525);
- avl = grpc_avl_add(avl, box(299), box(2273), nullptr);
- avl = grpc_avl_add(avl, box(464), box(2274), nullptr);
- avl = grpc_avl_add(avl, box(715), box(2275), nullptr);
- avl = remove_int(avl, 58);
- avl = remove_int(avl, 218);
- avl = grpc_avl_add(avl, box(961), box(2278), nullptr);
- avl = grpc_avl_add(avl, box(491), box(2279), nullptr);
- avl = remove_int(avl, 846);
- avl = grpc_avl_add(avl, box(762), box(2281), nullptr);
- avl = remove_int(avl, 974);
- avl = remove_int(avl, 887);
- avl = grpc_avl_add(avl, box(498), box(2284), nullptr);
- avl = remove_int(avl, 810);
- avl = remove_int(avl, 743);
- avl = remove_int(avl, 22);
- avl = remove_int(avl, 284);
- avl = grpc_avl_add(avl, box(482), box(2289), nullptr);
- avl = grpc_avl_add(avl, box(1021), box(2290), nullptr);
- avl = remove_int(avl, 155);
- avl = remove_int(avl, 128);
- avl = grpc_avl_add(avl, box(819), box(2293), nullptr);
- avl = grpc_avl_add(avl, box(324), box(2294), nullptr);
- avl = remove_int(avl, 196);
- avl = remove_int(avl, 370);
- avl = remove_int(avl, 753);
- avl = remove_int(avl, 56);
- avl = remove_int(avl, 735);
- avl = grpc_avl_add(avl, box(272), box(2300), nullptr);
- avl = grpc_avl_add(avl, box(474), box(2301), nullptr);
- avl = grpc_avl_add(avl, box(719), box(2302), nullptr);
- avl = grpc_avl_add(avl, box(236), box(2303), nullptr);
- avl = remove_int(avl, 818);
- avl = grpc_avl_add(avl, box(727), box(2305), nullptr);
- avl = remove_int(avl, 892);
- avl = remove_int(avl, 871);
- avl = remove_int(avl, 231);
- avl = grpc_avl_add(avl, box(62), box(2309), nullptr);
- avl = grpc_avl_add(avl, box(953), box(2310), nullptr);
- avl = remove_int(avl, 701);
- avl = grpc_avl_add(avl, box(193), box(2312), nullptr);
- avl = remove_int(avl, 619);
- avl = remove_int(avl, 22);
- avl = remove_int(avl, 804);
- avl = remove_int(avl, 851);
- avl = grpc_avl_add(avl, box(286), box(2317), nullptr);
- avl = grpc_avl_add(avl, box(751), box(2318), nullptr);
- avl = remove_int(avl, 525);
- avl = grpc_avl_add(avl, box(217), box(2320), nullptr);
- avl = remove_int(avl, 336);
- avl = grpc_avl_add(avl, box(86), box(2322), nullptr);
- avl = grpc_avl_add(avl, box(81), box(2323), nullptr);
- avl = grpc_avl_add(avl, box(850), box(2324), nullptr);
- avl = remove_int(avl, 872);
- avl = grpc_avl_add(avl, box(402), box(2326), nullptr);
- avl = grpc_avl_add(avl, box(54), box(2327), nullptr);
- avl = grpc_avl_add(avl, box(980), box(2328), nullptr);
- avl = grpc_avl_add(avl, box(845), box(2329), nullptr);
- avl = remove_int(avl, 1004);
- avl = remove_int(avl, 273);
- avl = remove_int(avl, 879);
- avl = grpc_avl_add(avl, box(354), box(2333), nullptr);
- avl = grpc_avl_add(avl, box(58), box(2334), nullptr);
- avl = grpc_avl_add(avl, box(127), box(2335), nullptr);
- avl = remove_int(avl, 84);
- avl = grpc_avl_add(avl, box(360), box(2337), nullptr);
- avl = remove_int(avl, 648);
- avl = remove_int(avl, 488);
- avl = remove_int(avl, 585);
- avl = remove_int(avl, 230);
- avl = grpc_avl_add(avl, box(887), box(2342), nullptr);
- avl = remove_int(avl, 558);
- avl = remove_int(avl, 958);
- avl = grpc_avl_add(avl, box(822), box(2345), nullptr);
- avl = remove_int(avl, 1004);
- avl = remove_int(avl, 747);
- avl = grpc_avl_add(avl, box(631), box(2348), nullptr);
- avl = grpc_avl_add(avl, box(442), box(2349), nullptr);
- avl = remove_int(avl, 957);
- avl = remove_int(avl, 964);
- avl = grpc_avl_add(avl, box(10), box(2352), nullptr);
- avl = remove_int(avl, 189);
- avl = grpc_avl_add(avl, box(742), box(2354), nullptr);
- avl = remove_int(avl, 108);
- avl = grpc_avl_add(avl, box(1014), box(2356), nullptr);
- avl = remove_int(avl, 266);
- avl = remove_int(avl, 623);
- avl = remove_int(avl, 697);
- avl = grpc_avl_add(avl, box(180), box(2360), nullptr);
- avl = remove_int(avl, 472);
- avl = grpc_avl_add(avl, box(567), box(2362), nullptr);
- avl = remove_int(avl, 1020);
- avl = remove_int(avl, 273);
- avl = grpc_avl_add(avl, box(864), box(2365), nullptr);
- avl = grpc_avl_add(avl, box(1009), box(2366), nullptr);
- avl = remove_int(avl, 224);
- avl = remove_int(avl, 81);
- avl = grpc_avl_add(avl, box(653), box(2369), nullptr);
- avl = remove_int(avl, 67);
- avl = remove_int(avl, 102);
- avl = remove_int(avl, 76);
- avl = remove_int(avl, 935);
- avl = remove_int(avl, 169);
- avl = remove_int(avl, 232);
- avl = remove_int(avl, 79);
- avl = grpc_avl_add(avl, box(509), box(2377), nullptr);
- avl = remove_int(avl, 900);
- avl = remove_int(avl, 822);
- avl = remove_int(avl, 945);
- avl = remove_int(avl, 356);
- avl = grpc_avl_add(avl, box(443), box(2382), nullptr);
- avl = grpc_avl_add(avl, box(925), box(2383), nullptr);
- avl = remove_int(avl, 994);
- avl = remove_int(avl, 324);
- avl = grpc_avl_add(avl, box(291), box(2386), nullptr);
- avl = remove_int(avl, 94);
- avl = remove_int(avl, 795);
- avl = remove_int(avl, 42);
- avl = grpc_avl_add(avl, box(613), box(2390), nullptr);
- avl = remove_int(avl, 289);
- avl = grpc_avl_add(avl, box(980), box(2392), nullptr);
- avl = remove_int(avl, 316);
- avl = grpc_avl_add(avl, box(281), box(2394), nullptr);
- avl = grpc_avl_add(avl, box(1006), box(2395), nullptr);
- avl = remove_int(avl, 776);
- avl = grpc_avl_add(avl, box(108), box(2397), nullptr);
- avl = grpc_avl_add(avl, box(918), box(2398), nullptr);
- avl = remove_int(avl, 721);
- avl = remove_int(avl, 563);
- avl = grpc_avl_add(avl, box(925), box(2401), nullptr);
- avl = remove_int(avl, 448);
- avl = remove_int(avl, 198);
- avl = remove_int(avl, 1);
- avl = grpc_avl_add(avl, box(160), box(2405), nullptr);
- avl = remove_int(avl, 515);
- avl = grpc_avl_add(avl, box(284), box(2407), nullptr);
- avl = grpc_avl_add(avl, box(225), box(2408), nullptr);
- avl = remove_int(avl, 304);
- avl = grpc_avl_add(avl, box(714), box(2410), nullptr);
- avl = grpc_avl_add(avl, box(708), box(2411), nullptr);
- avl = grpc_avl_add(avl, box(624), box(2412), nullptr);
- avl = remove_int(avl, 662);
- avl = remove_int(avl, 825);
- avl = remove_int(avl, 383);
- avl = remove_int(avl, 381);
- avl = grpc_avl_add(avl, box(194), box(2417), nullptr);
- avl = remove_int(avl, 280);
- avl = remove_int(avl, 25);
- avl = remove_int(avl, 633);
- avl = grpc_avl_add(avl, box(897), box(2421), nullptr);
- avl = remove_int(avl, 636);
- avl = remove_int(avl, 596);
- avl = remove_int(avl, 757);
- avl = remove_int(avl, 343);
- avl = remove_int(avl, 162);
- avl = remove_int(avl, 913);
- avl = remove_int(avl, 843);
- avl = remove_int(avl, 280);
- avl = remove_int(avl, 911);
- avl = grpc_avl_add(avl, box(1008), box(2431), nullptr);
- avl = remove_int(avl, 948);
- avl = remove_int(avl, 74);
- avl = remove_int(avl, 571);
- avl = grpc_avl_add(avl, box(486), box(2435), nullptr);
- avl = grpc_avl_add(avl, box(285), box(2436), nullptr);
- avl = remove_int(avl, 304);
- avl = remove_int(avl, 516);
- avl = grpc_avl_add(avl, box(758), box(2439), nullptr);
- avl = grpc_avl_add(avl, box(776), box(2440), nullptr);
- avl = remove_int(avl, 696);
- avl = grpc_avl_add(avl, box(104), box(2442), nullptr);
- avl = grpc_avl_add(avl, box(700), box(2443), nullptr);
- avl = grpc_avl_add(avl, box(114), box(2444), nullptr);
- avl = grpc_avl_add(avl, box(567), box(2445), nullptr);
- avl = remove_int(avl, 620);
- avl = grpc_avl_add(avl, box(270), box(2447), nullptr);
- avl = remove_int(avl, 730);
- avl = grpc_avl_add(avl, box(749), box(2449), nullptr);
- avl = grpc_avl_add(avl, box(443), box(2450), nullptr);
- avl = remove_int(avl, 457);
- avl = grpc_avl_add(avl, box(571), box(2452), nullptr);
- avl = grpc_avl_add(avl, box(626), box(2453), nullptr);
- avl = remove_int(avl, 638);
- avl = remove_int(avl, 313);
-
- grpc_avl_unref(avl, nullptr);
-}
-
static void test_stress(int amount_of_stress) {
int added[1024];
int i, j;
@@ -3653,8 +294,6 @@ int main(int argc, char* argv[]) {
test_replace();
test_remove();
test_badcase1();
- test_badcase2();
- test_badcase3();
test_stress(10);
return 0;
diff --git a/test/core/iomgr/BUILD b/test/core/iomgr/BUILD
index 349a06d578..bbf0815e6f 100644
--- a/test/core/iomgr/BUILD
+++ b/test/core/iomgr/BUILD
@@ -227,6 +227,7 @@ grpc_cc_test(
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
+ tags = ["manual"], # TODO(adelez): Remove once this works on Foundry.
)
grpc_cc_test(
diff --git a/test/core/iomgr/ev_epollsig_linux_test.cc b/test/core/iomgr/ev_epollsig_linux_test.cc
index c3ba6d7c14..28c9dd408c 100644
--- a/test/core/iomgr/ev_epollsig_linux_test.cc
+++ b/test/core/iomgr/ev_epollsig_linux_test.cc
@@ -66,7 +66,7 @@ static void test_fd_init(test_fd* tfds, int* fds, int num_fds) {
for (i = 0; i < num_fds; i++) {
tfds[i].inner_fd = fds[i];
- tfds[i].fd = grpc_fd_create(fds[i], "test_fd");
+ tfds[i].fd = grpc_fd_create(fds[i], "test_fd", false);
}
}
@@ -79,8 +79,7 @@ static void test_fd_cleanup(test_fd* tfds, int num_fds) {
GRPC_ERROR_CREATE_FROM_STATIC_STRING("test_fd_cleanup"));
grpc_core::ExecCtx::Get()->Flush();
- grpc_fd_orphan(tfds[i].fd, nullptr, &release_fd, false /* already_closed */,
- "test_fd_cleanup");
+ grpc_fd_orphan(tfds[i].fd, nullptr, &release_fd, "test_fd_cleanup");
grpc_core::ExecCtx::Get()->Flush();
GPR_ASSERT(release_fd == tfds[i].inner_fd);
@@ -267,7 +266,7 @@ static void test_threading(void) {
grpc_wakeup_fd fd;
GPR_ASSERT(GRPC_LOG_IF_ERROR("wakeup_fd_init", grpc_wakeup_fd_init(&fd)));
shared.wakeup_fd = &fd;
- shared.wakeup_desc = grpc_fd_create(fd.read_fd, "wakeup");
+ shared.wakeup_desc = grpc_fd_create(fd.read_fd, "wakeup", false);
shared.wakeups = 0;
{
grpc_core::ExecCtx exec_ctx;
@@ -287,8 +286,7 @@ static void test_threading(void) {
{
grpc_core::ExecCtx exec_ctx;
grpc_fd_shutdown(shared.wakeup_desc, GRPC_ERROR_CANCELLED);
- grpc_fd_orphan(shared.wakeup_desc, nullptr, nullptr,
- false /* already_closed */, "done");
+ grpc_fd_orphan(shared.wakeup_desc, nullptr, nullptr, "done");
grpc_pollset_shutdown(shared.pollset,
GRPC_CLOSURE_CREATE(destroy_pollset, shared.pollset,
grpc_schedule_on_exec_ctx));
diff --git a/test/core/iomgr/fd_posix_test.cc b/test/core/iomgr/fd_posix_test.cc
index b81c73b2c0..4ea2389bbd 100644
--- a/test/core/iomgr/fd_posix_test.cc
+++ b/test/core/iomgr/fd_posix_test.cc
@@ -115,7 +115,7 @@ static void session_shutdown_cb(void* arg, /*session */
bool success) {
session* se = static_cast<session*>(arg);
server* sv = se->sv;
- grpc_fd_orphan(se->em_fd, nullptr, nullptr, false /* already_closed */, "a");
+ grpc_fd_orphan(se->em_fd, nullptr, nullptr, "a");
gpr_free(se);
/* Start to shutdown listen fd. */
grpc_fd_shutdown(sv->em_fd,
@@ -171,7 +171,7 @@ static void session_read_cb(void* arg, /*session */
static void listen_shutdown_cb(void* arg /*server */, int success) {
server* sv = static_cast<server*>(arg);
- grpc_fd_orphan(sv->em_fd, nullptr, nullptr, false /* already_closed */, "b");
+ grpc_fd_orphan(sv->em_fd, nullptr, nullptr, "b");
gpr_mu_lock(g_mu);
sv->done = 1;
@@ -204,7 +204,7 @@ static void listen_cb(void* arg, /*=sv_arg*/
fcntl(fd, F_SETFL, flags | O_NONBLOCK);
se = static_cast<session*>(gpr_malloc(sizeof(*se)));
se->sv = sv;
- se->em_fd = grpc_fd_create(fd, "listener");
+ se->em_fd = grpc_fd_create(fd, "listener", false);
grpc_pollset_add_fd(g_pollset, se->em_fd);
GRPC_CLOSURE_INIT(&se->session_read_closure, session_read_cb, se,
grpc_schedule_on_exec_ctx);
@@ -233,7 +233,7 @@ static int server_start(server* sv) {
port = ntohs(sin.sin_port);
GPR_ASSERT(listen(fd, MAX_NUM_FD) == 0);
- sv->em_fd = grpc_fd_create(fd, "server");
+ sv->em_fd = grpc_fd_create(fd, "server", false);
grpc_pollset_add_fd(g_pollset, sv->em_fd);
/* Register to be interested in reading from listen_fd. */
GRPC_CLOSURE_INIT(&sv->listen_closure, listen_cb, sv,
@@ -289,7 +289,7 @@ static void client_init(client* cl) {
/* Called when a client upload session is ready to shutdown. */
static void client_session_shutdown_cb(void* arg /*client */, int success) {
client* cl = static_cast<client*>(arg);
- grpc_fd_orphan(cl->em_fd, nullptr, nullptr, false /* already_closed */, "c");
+ grpc_fd_orphan(cl->em_fd, nullptr, nullptr, "c");
cl->done = 1;
GPR_ASSERT(
GRPC_LOG_IF_ERROR("pollset_kick", grpc_pollset_kick(g_pollset, nullptr)));
@@ -353,7 +353,7 @@ static void client_start(client* cl, int port) {
}
}
- cl->em_fd = grpc_fd_create(fd, "client");
+ cl->em_fd = grpc_fd_create(fd, "client", false);
grpc_pollset_add_fd(g_pollset, cl->em_fd);
client_session_write(cl, GRPC_ERROR_NONE);
@@ -454,7 +454,7 @@ static void test_grpc_fd_change(void) {
flags = fcntl(sv[1], F_GETFL, 0);
GPR_ASSERT(fcntl(sv[1], F_SETFL, flags | O_NONBLOCK) == 0);
- em_fd = grpc_fd_create(sv[0], "test_grpc_fd_change");
+ em_fd = grpc_fd_create(sv[0], "test_grpc_fd_change", false);
grpc_pollset_add_fd(g_pollset, em_fd);
/* Register the first callback, then make its FD readable */
@@ -502,7 +502,7 @@ static void test_grpc_fd_change(void) {
GPR_ASSERT(b.cb_that_ran == second_read_callback);
gpr_mu_unlock(g_mu);
- grpc_fd_orphan(em_fd, nullptr, nullptr, false /* already_closed */, "d");
+ grpc_fd_orphan(em_fd, nullptr, nullptr, "d");
destroy_change_data(&a);
destroy_change_data(&b);
diff --git a/test/core/iomgr/pollset_set_test.cc b/test/core/iomgr/pollset_set_test.cc
index 0dc75a5f3f..1aae1daa02 100644
--- a/test/core/iomgr/pollset_set_test.cc
+++ b/test/core/iomgr/pollset_set_test.cc
@@ -118,7 +118,7 @@ static void init_test_fds(test_fd* tfds, const int num_fds) {
for (int i = 0; i < num_fds; i++) {
GPR_ASSERT(GRPC_ERROR_NONE == grpc_wakeup_fd_init(&tfds[i].wakeup_fd));
tfds[i].fd = grpc_fd_create(GRPC_WAKEUP_FD_GET_READ_FD(&tfds[i].wakeup_fd),
- "test_fd");
+ "test_fd", false);
reset_test_fd(&tfds[i]);
}
}
@@ -136,8 +136,7 @@ static void cleanup_test_fds(test_fd* tfds, const int num_fds) {
* grpc_wakeup_fd and we would like to destroy it ourselves (by calling
* grpc_wakeup_fd_destroy). To prevent grpc_fd from calling close() on the
* underlying fd, call it with a non-NULL 'release_fd' parameter */
- grpc_fd_orphan(tfds[i].fd, nullptr, &release_fd, false /* already_closed */,
- "test_fd_cleanup");
+ grpc_fd_orphan(tfds[i].fd, nullptr, &release_fd, "test_fd_cleanup");
grpc_core::ExecCtx::Get()->Flush();
grpc_wakeup_fd_destroy(&tfds[i].wakeup_fd);
diff --git a/test/core/iomgr/tcp_posix_test.cc b/test/core/iomgr/tcp_posix_test.cc
index f4df6fca23..3e87831e44 100644
--- a/test/core/iomgr/tcp_posix_test.cc
+++ b/test/core/iomgr/tcp_posix_test.cc
@@ -176,7 +176,8 @@ static void read_test(size_t num_bytes, size_t slice_size) {
a[0].type = GRPC_ARG_INTEGER,
a[0].value.integer = static_cast<int>(slice_size);
grpc_channel_args args = {GPR_ARRAY_SIZE(a), a};
- ep = grpc_tcp_create(grpc_fd_create(sv[1], "read_test"), &args, "test");
+ ep =
+ grpc_tcp_create(grpc_fd_create(sv[1], "read_test", false), &args, "test");
grpc_endpoint_add_to_pollset(ep, g_pollset);
written_bytes = fill_socket_partial(sv[0], num_bytes);
@@ -226,7 +227,8 @@ static void large_read_test(size_t slice_size) {
a[0].type = GRPC_ARG_INTEGER;
a[0].value.integer = static_cast<int>(slice_size);
grpc_channel_args args = {GPR_ARRAY_SIZE(a), a};
- ep = grpc_tcp_create(grpc_fd_create(sv[1], "large_read_test"), &args, "test");
+ ep = grpc_tcp_create(grpc_fd_create(sv[1], "large_read_test", false), &args,
+ "test");
grpc_endpoint_add_to_pollset(ep, g_pollset);
written_bytes = fill_socket(sv[0]);
@@ -365,7 +367,8 @@ static void write_test(size_t num_bytes, size_t slice_size) {
a[0].type = GRPC_ARG_INTEGER,
a[0].value.integer = static_cast<int>(slice_size);
grpc_channel_args args = {GPR_ARRAY_SIZE(a), a};
- ep = grpc_tcp_create(grpc_fd_create(sv[1], "write_test"), &args, "test");
+ ep = grpc_tcp_create(grpc_fd_create(sv[1], "write_test", false), &args,
+ "test");
grpc_endpoint_add_to_pollset(ep, g_pollset);
state.ep = ep;
@@ -433,7 +436,8 @@ static void release_fd_test(size_t num_bytes, size_t slice_size) {
a[0].type = GRPC_ARG_INTEGER;
a[0].value.integer = static_cast<int>(slice_size);
grpc_channel_args args = {GPR_ARRAY_SIZE(a), a};
- ep = grpc_tcp_create(grpc_fd_create(sv[1], "read_test"), &args, "test");
+ ep =
+ grpc_tcp_create(grpc_fd_create(sv[1], "read_test", false), &args, "test");
GPR_ASSERT(grpc_tcp_fd(ep) == sv[1] && sv[1] >= 0);
grpc_endpoint_add_to_pollset(ep, g_pollset);
@@ -522,10 +526,10 @@ static grpc_endpoint_test_fixture create_fixture_tcp_socketpair(
a[0].type = GRPC_ARG_INTEGER;
a[0].value.integer = static_cast<int>(slice_size);
grpc_channel_args args = {GPR_ARRAY_SIZE(a), a};
- f.client_ep =
- grpc_tcp_create(grpc_fd_create(sv[0], "fixture:client"), &args, "test");
- f.server_ep =
- grpc_tcp_create(grpc_fd_create(sv[1], "fixture:server"), &args, "test");
+ f.client_ep = grpc_tcp_create(grpc_fd_create(sv[0], "fixture:client", false),
+ &args, "test");
+ f.server_ep = grpc_tcp_create(grpc_fd_create(sv[1], "fixture:server", false),
+ &args, "test");
grpc_resource_quota_unref_internal(resource_quota);
grpc_endpoint_add_to_pollset(f.client_ep, g_pollset);
grpc_endpoint_add_to_pollset(f.server_ep, g_pollset);
diff --git a/test/core/transport/status_conversion_test.cc b/test/core/transport/status_conversion_test.cc
index 1ed6ccfba6..f7b3c62a40 100644
--- a/test/core/transport/status_conversion_test.cc
+++ b/test/core/transport/status_conversion_test.cc
@@ -33,12 +33,7 @@
#define HTTP2_STATUS_TO_GRPC_STATUS(a, b) \
GPR_ASSERT(grpc_http2_status_to_grpc_status(a) == (b))
-int main(int argc, char** argv) {
- int i;
-
- grpc_test_init(argc, argv);
- grpc_init();
-
+static void test_grpc_status_to_http2_error() {
GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_OK, GRPC_HTTP2_NO_ERROR);
GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_CANCELLED, GRPC_HTTP2_CANCEL);
GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_UNKNOWN, GRPC_HTTP2_INTERNAL_ERROR);
@@ -65,7 +60,9 @@ int main(int argc, char** argv) {
GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_UNAVAILABLE,
GRPC_HTTP2_REFUSED_STREAM);
GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_DATA_LOSS, GRPC_HTTP2_INTERNAL_ERROR);
+}
+static void test_grpc_status_to_http2_status() {
GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_OK, 200);
GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_CANCELLED, 200);
GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_UNKNOWN, 200);
@@ -83,7 +80,9 @@ int main(int argc, char** argv) {
GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_INTERNAL, 200);
GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_UNAVAILABLE, 200);
GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_DATA_LOSS, 200);
+}
+static void test_http2_error_to_grpc_status() {
const grpc_millis before_deadline = GRPC_MILLIS_INF_FUTURE;
HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_NO_ERROR, before_deadline,
GRPC_STATUS_INTERNAL);
@@ -144,7 +143,9 @@ int main(int argc, char** argv) {
GRPC_STATUS_RESOURCE_EXHAUSTED);
HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_INADEQUATE_SECURITY, after_deadline,
GRPC_STATUS_PERMISSION_DENIED);
+}
+static void test_http2_status_to_grpc_status() {
HTTP2_STATUS_TO_GRPC_STATUS(200, GRPC_STATUS_OK);
HTTP2_STATUS_TO_GRPC_STATUS(400, GRPC_STATUS_INVALID_ARGUMENT);
HTTP2_STATUS_TO_GRPC_STATUS(401, GRPC_STATUS_UNAUTHENTICATED);
@@ -157,6 +158,18 @@ int main(int argc, char** argv) {
HTTP2_STATUS_TO_GRPC_STATUS(500, GRPC_STATUS_UNKNOWN);
HTTP2_STATUS_TO_GRPC_STATUS(503, GRPC_STATUS_UNAVAILABLE);
HTTP2_STATUS_TO_GRPC_STATUS(504, GRPC_STATUS_DEADLINE_EXCEEDED);
+}
+
+int main(int argc, char** argv) {
+ int i;
+
+ grpc_test_init(argc, argv);
+ grpc_init();
+
+ test_grpc_status_to_http2_error();
+ test_grpc_status_to_http2_status();
+ test_http2_error_to_grpc_status();
+ test_http2_status_to_grpc_status();
/* check all status values can be converted */
for (i = 0; i <= 999; i++) {
diff --git a/test/cpp/microbenchmarks/bm_pollset.cc b/test/cpp/microbenchmarks/bm_pollset.cc
index bcb68ff229..050c7f7c17 100644
--- a/test/cpp/microbenchmarks/bm_pollset.cc
+++ b/test/cpp/microbenchmarks/bm_pollset.cc
@@ -141,12 +141,12 @@ static void BM_PollAddFd(benchmark::State& state) {
grpc_wakeup_fd wakeup_fd;
GPR_ASSERT(
GRPC_LOG_IF_ERROR("wakeup_fd_init", grpc_wakeup_fd_init(&wakeup_fd)));
- grpc_fd* fd = grpc_fd_create(wakeup_fd.read_fd, "xxx");
+ grpc_fd* fd = grpc_fd_create(wakeup_fd.read_fd, "xxx", false);
while (state.KeepRunning()) {
grpc_pollset_add_fd(ps, fd);
grpc_core::ExecCtx::Get()->Flush();
}
- grpc_fd_orphan(fd, nullptr, nullptr, false /* already_closed */, "xxx");
+ grpc_fd_orphan(fd, nullptr, nullptr, "xxx");
grpc_closure shutdown_ps_closure;
GRPC_CLOSURE_INIT(&shutdown_ps_closure, shutdown_ps, ps,
grpc_schedule_on_exec_ctx);
@@ -222,7 +222,7 @@ static void BM_SingleThreadPollOneFd(benchmark::State& state) {
grpc_core::ExecCtx exec_ctx;
grpc_wakeup_fd wakeup_fd;
GRPC_ERROR_UNREF(grpc_wakeup_fd_init(&wakeup_fd));
- grpc_fd* wakeup = grpc_fd_create(wakeup_fd.read_fd, "wakeup_read");
+ grpc_fd* wakeup = grpc_fd_create(wakeup_fd.read_fd, "wakeup_read", false);
grpc_pollset_add_fd(ps, wakeup);
bool done = false;
Closure* continue_closure = MakeClosure(
@@ -242,7 +242,7 @@ static void BM_SingleThreadPollOneFd(benchmark::State& state) {
while (!done) {
GRPC_ERROR_UNREF(grpc_pollset_work(ps, nullptr, GRPC_MILLIS_INF_FUTURE));
}
- grpc_fd_orphan(wakeup, nullptr, nullptr, false /* already_closed */, "done");
+ grpc_fd_orphan(wakeup, nullptr, nullptr, "done");
wakeup_fd.read_fd = 0;
grpc_closure shutdown_ps_closure;
GRPC_CLOSURE_INIT(&shutdown_ps_closure, shutdown_ps, ps,
diff --git a/test/cpp/naming/BUILD b/test/cpp/naming/BUILD
index fa0b216f8f..2925e8fbcf 100644
--- a/test/cpp/naming/BUILD
+++ b/test/cpp/naming/BUILD
@@ -22,7 +22,7 @@ package(
licenses(["notice"]) # Apache v2
-load("//bazel:grpc_build_system.bzl", "grpc_py_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_py_binary", "grpc_cc_test")
load(":generate_resolver_component_tests.bzl", "generate_resolver_component_tests")
@@ -35,4 +35,20 @@ grpc_py_binary(
testonly = True,
)
+grpc_cc_test(
+ name = "cancel_ares_query_test",
+ srcs = ["cancel_ares_query_test.cc"],
+ external_deps = ["gmock"],
+ deps = [
+ "//test/cpp/util:test_util",
+ "//test/core/util:grpc_test_util",
+ "//test/core/util:gpr_test_util",
+ "//:grpc++",
+ "//:grpc",
+ "//:gpr",
+ "//test/cpp/util:test_config",
+ "//test/core/end2end:cq_verifier",
+ ],
+)
+
generate_resolver_component_tests()
diff --git a/test/cpp/naming/cancel_ares_query_test.cc b/test/cpp/naming/cancel_ares_query_test.cc
new file mode 100644
index 0000000000..11cdc0b774
--- /dev/null
+++ b/test/cpp/naming/cancel_ares_query_test.cc
@@ -0,0 +1,289 @@
+/*
+ *
+ * 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 <stdio.h>
+#include <string.h>
+
+#include <gflags/gflags.h>
+#include <gmock/gmock.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include "include/grpc/support/string_util.h"
+#include "src/core/ext/filters/client_channel/resolver.h"
+#include "src/core/ext/filters/client_channel/resolver_registry.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/debug/stats.h"
+#include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gpr/host_port.h"
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/gprpp/orphanable.h"
+#include "src/core/lib/gprpp/thd.h"
+#include "src/core/lib/iomgr/combiner.h"
+#include "src/core/lib/iomgr/pollset.h"
+#include "src/core/lib/iomgr/pollset_set.h"
+#include "test/core/end2end/cq_verifier.h"
+#include "test/core/util/cmdline.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+// TODO: pull in different headers when enabling this
+// test on windows. Also set BAD_SOCKET_RETURN_VAL
+// to INVALID_SOCKET on windows.
+#include "src/core/lib/iomgr/sockaddr_posix.h"
+#define BAD_SOCKET_RETURN_VAL -1
+
+namespace {
+
+void* Tag(intptr_t t) { return (void*)t; }
+
+gpr_timespec FiveSecondsFromNow(void) {
+ return grpc_timeout_seconds_to_deadline(5);
+}
+
+void DrainCq(grpc_completion_queue* cq) {
+ grpc_event ev;
+ do {
+ ev = grpc_completion_queue_next(cq, FiveSecondsFromNow(), nullptr);
+ } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+void EndTest(grpc_channel* client, grpc_completion_queue* cq) {
+ grpc_channel_destroy(client);
+ grpc_completion_queue_shutdown(cq);
+ DrainCq(cq);
+ grpc_completion_queue_destroy(cq);
+}
+
+class FakeNonResponsiveDNSServer {
+ public:
+ FakeNonResponsiveDNSServer(int port) {
+ socket_ = socket(AF_INET6, SOCK_DGRAM, 0);
+ if (socket_ == BAD_SOCKET_RETURN_VAL) {
+ gpr_log(GPR_DEBUG, "Failed to create UDP ipv6 socket");
+ abort();
+ }
+ sockaddr_in6 addr;
+ memset(&addr, 0, sizeof(addr));
+ addr.sin6_family = AF_INET6;
+ addr.sin6_port = htons(port);
+ ((char*)&addr.sin6_addr)[15] = 1;
+ if (bind(socket_, (const sockaddr*)&addr, sizeof(addr)) != 0) {
+ gpr_log(GPR_DEBUG, "Failed to bind UDP ipv6 socket to [::1]:%d", port);
+ abort();
+ }
+ }
+ ~FakeNonResponsiveDNSServer() { close(socket_); }
+
+ private:
+ int socket_;
+};
+
+struct ArgsStruct {
+ gpr_atm done_atm;
+ gpr_mu* mu;
+ grpc_pollset* pollset;
+ grpc_pollset_set* pollset_set;
+ grpc_combiner* lock;
+ grpc_channel_args* channel_args;
+};
+
+void ArgsInit(ArgsStruct* args) {
+ args->pollset = (grpc_pollset*)gpr_zalloc(grpc_pollset_size());
+ grpc_pollset_init(args->pollset, &args->mu);
+ args->pollset_set = grpc_pollset_set_create();
+ grpc_pollset_set_add_pollset(args->pollset_set, args->pollset);
+ args->lock = grpc_combiner_create();
+ gpr_atm_rel_store(&args->done_atm, 0);
+ args->channel_args = nullptr;
+}
+
+void DoNothing(void* arg, grpc_error* error) {}
+
+void ArgsFinish(ArgsStruct* args) {
+ grpc_pollset_set_del_pollset(args->pollset_set, args->pollset);
+ grpc_pollset_set_destroy(args->pollset_set);
+ grpc_closure DoNothing_cb;
+ GRPC_CLOSURE_INIT(&DoNothing_cb, DoNothing, nullptr,
+ grpc_schedule_on_exec_ctx);
+ grpc_pollset_shutdown(args->pollset, &DoNothing_cb);
+ // exec_ctx needs to be flushed before calling grpc_pollset_destroy()
+ grpc_channel_args_destroy(args->channel_args);
+ grpc_core::ExecCtx::Get()->Flush();
+ grpc_pollset_destroy(args->pollset);
+ gpr_free(args->pollset);
+ GRPC_COMBINER_UNREF(args->lock, nullptr);
+}
+
+void PollPollsetUntilRequestDone(ArgsStruct* args) {
+ while (true) {
+ bool done = gpr_atm_acq_load(&args->done_atm) != 0;
+ if (done) {
+ break;
+ }
+ grpc_pollset_worker* worker = nullptr;
+ grpc_core::ExecCtx exec_ctx;
+ gpr_mu_lock(args->mu);
+ GRPC_LOG_IF_ERROR(
+ "pollset_work",
+ grpc_pollset_work(args->pollset, &worker,
+ grpc_timespec_to_millis_round_up(
+ gpr_inf_future(GPR_CLOCK_REALTIME))));
+ gpr_mu_unlock(args->mu);
+ }
+}
+
+void CheckResolverResultAssertFailureLocked(void* arg, grpc_error* error) {
+ EXPECT_NE(error, GRPC_ERROR_NONE);
+ ArgsStruct* args = static_cast<ArgsStruct*>(arg);
+ gpr_atm_rel_store(&args->done_atm, 1);
+ gpr_mu_lock(args->mu);
+ GRPC_LOG_IF_ERROR("pollset_kick", grpc_pollset_kick(args->pollset, nullptr));
+ gpr_mu_unlock(args->mu);
+}
+
+TEST(CancelDuringAresQuery, TestCancelActiveDNSQuery) {
+ grpc_core::ExecCtx exec_ctx;
+ ArgsStruct args;
+ ArgsInit(&args);
+ int fake_dns_port = grpc_pick_unused_port_or_die();
+ FakeNonResponsiveDNSServer fake_dns_server(fake_dns_port);
+ char* client_target;
+ GPR_ASSERT(gpr_asprintf(
+ &client_target,
+ "dns://[::1]:%d/dont-care-since-wont-be-resolved.test.com:1234",
+ fake_dns_port));
+ // create resolver and resolve
+ grpc_core::OrphanablePtr<grpc_core::Resolver> resolver =
+ grpc_core::ResolverRegistry::CreateResolver(client_target, nullptr,
+ args.pollset_set, args.lock);
+ gpr_free(client_target);
+ grpc_closure on_resolver_result_changed;
+ GRPC_CLOSURE_INIT(&on_resolver_result_changed,
+ CheckResolverResultAssertFailureLocked, (void*)&args,
+ grpc_combiner_scheduler(args.lock));
+ resolver->NextLocked(&args.channel_args, &on_resolver_result_changed);
+ // Without resetting and causing resolver shutdown, the
+ // PollPollsetUntilRequestDone call should never finish.
+ resolver.reset();
+ grpc_core::ExecCtx::Get()->Flush();
+ PollPollsetUntilRequestDone(&args);
+ ArgsFinish(&args);
+}
+
+TEST(CancelDuringAresQuery,
+ TestHitDeadlineAndDestroyChannelDuringAresResolutionIsGraceful) {
+ // Start up fake non responsive DNS server
+ int fake_dns_port = grpc_pick_unused_port_or_die();
+ FakeNonResponsiveDNSServer fake_dns_server(fake_dns_port);
+ // Create a call that will try to use the fake DNS server
+ char* client_target = nullptr;
+ GPR_ASSERT(gpr_asprintf(
+ &client_target,
+ "dns://[::1]:%d/dont-care-since-wont-be-resolved.test.com:1234",
+ fake_dns_port));
+ grpc_channel* client =
+ grpc_insecure_channel_create(client_target,
+ /* client_args */ nullptr, nullptr);
+ gpr_free(client_target);
+ grpc_completion_queue* cq = grpc_completion_queue_create_for_next(nullptr);
+ cq_verifier* cqv = cq_verifier_create(cq);
+ gpr_timespec deadline = grpc_timeout_milliseconds_to_deadline(10);
+ grpc_call* call = grpc_channel_create_call(
+ client, nullptr, GRPC_PROPAGATE_DEFAULTS, cq,
+ grpc_slice_from_static_string("/foo"), nullptr, deadline, nullptr);
+ GPR_ASSERT(call);
+ grpc_metadata_array initial_metadata_recv;
+ grpc_metadata_array trailing_metadata_recv;
+ grpc_metadata_array request_metadata_recv;
+ grpc_metadata_array_init(&initial_metadata_recv);
+ grpc_metadata_array_init(&trailing_metadata_recv);
+ grpc_metadata_array_init(&request_metadata_recv);
+ grpc_call_details call_details;
+ grpc_call_details_init(&call_details);
+ grpc_status_code status;
+ const char* error_string;
+ grpc_slice details;
+ // Set ops for client the request
+ grpc_op ops_base[6];
+ memset(ops_base, 0, sizeof(ops_base));
+ grpc_op* op = ops_base;
+ op->op = GRPC_OP_SEND_INITIAL_METADATA;
+ op->data.send_initial_metadata.count = 0;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ op->op = GRPC_OP_RECV_INITIAL_METADATA;
+ op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+ op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+ op->data.recv_status_on_client.status = &status;
+ op->data.recv_status_on_client.status_details = &details;
+ op->data.recv_status_on_client.error_string = &error_string;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ // Run the call and sanity check it failed as expected
+ grpc_call_error error = grpc_call_start_batch(
+ call, ops_base, static_cast<size_t>(op - ops_base), Tag(1), nullptr);
+ EXPECT_EQ(GRPC_CALL_OK, error);
+ CQ_EXPECT_COMPLETION(cqv, Tag(1), 1);
+ cq_verify(cqv);
+ EXPECT_EQ(status, GRPC_STATUS_DEADLINE_EXCEEDED);
+ // Teardown
+ grpc_slice_unref(details);
+ gpr_free((void*)error_string);
+ grpc_metadata_array_destroy(&initial_metadata_recv);
+ grpc_metadata_array_destroy(&trailing_metadata_recv);
+ grpc_metadata_array_destroy(&request_metadata_recv);
+ grpc_call_details_destroy(&call_details);
+ grpc_call_unref(call);
+ cq_verifier_destroy(cqv);
+ EndTest(client, cq);
+}
+
+} // namespace
+
+int main(int argc, char** argv) {
+ grpc_test_init(argc, argv);
+ ::testing::InitGoogleTest(&argc, argv);
+ gpr_setenv("GRPC_DNS_RESOLVER", "ares");
+ // Sanity check the time that it takes to run the test
+ // including the teardown time (the teardown
+ // part of the test involves cancelling the DNS query,
+ // which is the main point of interest for this test).
+ gpr_timespec overall_deadline = grpc_timeout_seconds_to_deadline(4);
+ grpc_init();
+ auto result = RUN_ALL_TESTS();
+ grpc_shutdown();
+ if (gpr_time_cmp(gpr_now(GPR_CLOCK_MONOTONIC), overall_deadline) > 0) {
+ gpr_log(GPR_ERROR, "Test took too long");
+ abort();
+ }
+ return result;
+}
diff --git a/test/cpp/naming/gen_build_yaml.py b/test/cpp/naming/gen_build_yaml.py
index a0767b21cf..baa6512f62 100755
--- a/test/cpp/naming/gen_build_yaml.py
+++ b/test/cpp/naming/gen_build_yaml.py
@@ -121,6 +121,25 @@ def main():
'grpc++_test_config',
],
} for unsecure_build_config_suffix in ['_unsecure', '']
+ ] + [
+ {
+ 'name': 'cancel_ares_query_test',
+ 'build': 'test',
+ 'language': 'c++',
+ 'gtest': True,
+ 'run': True,
+ 'src': ['test/cpp/naming/cancel_ares_query_test.cc'],
+ 'platforms': ['linux', 'posix', 'mac'],
+ 'deps': [
+ 'grpc++_test_util',
+ 'grpc_test_util',
+ 'gpr_test_util',
+ 'grpc++',
+ 'grpc',
+ 'gpr',
+ 'grpc++_test_config',
+ ],
+ },
]
}
diff --git a/test/cpp/naming/resolver_component_test.cc b/test/cpp/naming/resolver_component_test.cc
index f4be064305..07ddfd30ee 100644
--- a/test/cpp/naming/resolver_component_test.cc
+++ b/test/cpp/naming/resolver_component_test.cc
@@ -22,10 +22,14 @@
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
+
#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
#include <gflags/gflags.h>
#include <gmock/gmock.h>
+#include <thread>
#include <vector>
#include "test/cpp/util/subprocess.h"
@@ -48,6 +52,12 @@
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
+// TODO: pull in different headers when enabling this
+// test on windows. Also set BAD_SOCKET_RETURN_VAL
+// to INVALID_SOCKET on windows.
+#include "src/core/lib/iomgr/sockaddr_posix.h"
+#define BAD_SOCKET_RETURN_VAL -1
+
using grpc::SubProcess;
using std::vector;
using testing::UnorderedElementsAreArray;
@@ -231,7 +241,79 @@ void CheckLBPolicyResultLocked(grpc_channel_args* channel_args,
}
}
+void OpenAndCloseSocketsStressLoop(int dummy_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(dummy_port);
+ ((char*)&addr.sin6_addr)[15] = 1;
+ for (;;) {
+ if (gpr_event_get(done_ev)) {
+ return;
+ }
+ std::vector<int> 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(dummy_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);
+ }
+ }
+}
+
void CheckResolverResultLocked(void* argsp, grpc_error* err) {
+ EXPECT_EQ(err, GRPC_ERROR_NONE);
ArgsStruct* args = (ArgsStruct*)argsp;
grpc_channel_args* channel_args = args->channel_args;
const grpc_arg* channel_arg =
@@ -271,7 +353,17 @@ void CheckResolverResultLocked(void* argsp, grpc_error* err) {
gpr_mu_unlock(args->mu);
}
-TEST(ResolverComponentTest, TestResolvesRelevantRecords) {
+void CheckResolvedWithoutErrorLocked(void* argsp, grpc_error* err) {
+ EXPECT_EQ(err, GRPC_ERROR_NONE);
+ ArgsStruct* args = (ArgsStruct*)argsp;
+ gpr_atm_rel_store(&args->done_atm, 1);
+ gpr_mu_lock(args->mu);
+ GRPC_LOG_IF_ERROR("pollset_kick", grpc_pollset_kick(args->pollset, nullptr));
+ gpr_mu_unlock(args->mu);
+}
+
+void RunResolvesRelevantRecordsTest(void (*OnDoneLocked)(void* arg,
+ grpc_error* error)) {
grpc_core::ExecCtx exec_ctx;
ArgsStruct args;
ArgsInit(&args);
@@ -289,14 +381,32 @@ TEST(ResolverComponentTest, TestResolvesRelevantRecords) {
args.pollset_set, args.lock);
gpr_free(whole_uri);
grpc_closure on_resolver_result_changed;
- GRPC_CLOSURE_INIT(&on_resolver_result_changed, CheckResolverResultLocked,
- (void*)&args, grpc_combiner_scheduler(args.lock));
+ GRPC_CLOSURE_INIT(&on_resolver_result_changed, OnDoneLocked, (void*)&args,
+ grpc_combiner_scheduler(args.lock));
resolver->NextLocked(&args.channel_args, &on_resolver_result_changed);
grpc_core::ExecCtx::Get()->Flush();
PollPollsetUntilRequestDone(&args);
ArgsFinish(&args);
}
+TEST(ResolverComponentTest, TestResolvesRelevantRecords) {
+ RunResolvesRelevantRecordsTest(CheckResolverResultLocked);
+}
+
+TEST(ResolverComponentTest, TestResolvesRelevantRecordsWithConcurrentFdStress) {
+ // Start up background stress thread
+ int dummy_port = grpc_pick_unused_port_or_die();
+ gpr_event done_ev;
+ gpr_event_init(&done_ev);
+ std::thread socket_stress_thread(OpenAndCloseSocketsStressLoop, dummy_port,
+ &done_ev);
+ // Run the resolver test
+ RunResolvesRelevantRecordsTest(CheckResolvedWithoutErrorLocked);
+ // Shutdown and join stress thread
+ gpr_event_set(&done_ev, (void*)1);
+ socket_stress_thread.join();
+}
+
} // namespace
int main(int argc, char** argv) {
diff --git a/tools/distrib/run_clang_tidy.py b/tools/distrib/run_clang_tidy.py
index 337e6b43c8..7ad1c160ba 100755
--- a/tools/distrib/run_clang_tidy.py
+++ b/tools/distrib/run_clang_tidy.py
@@ -24,12 +24,6 @@ sys.path.append(
os.path.dirname(sys.argv[0]), '..', 'run_tests', 'python_utils'))
import jobset
-GRPC_CHECKS = [
- 'modernize-use-nullptr',
- 'google-build-namespaces',
- 'google-build-explicit-make-pair',
-]
-
extra_args = [
'-x',
'c++',
@@ -57,8 +51,6 @@ args = argp.parse_args()
cmdline = [
clang_tidy,
- '--checks=-*,%s' % ','.join(GRPC_CHECKS),
- '--warnings-as-errors=%s' % ','.join(GRPC_CHECKS)
] + ['--extra-arg-before=%s' % arg for arg in extra_args]
if args.fix:
diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json
index 585f68140a..4b5f7d51ea 100644
--- a/tools/run_tests/generated/sources_and_headers.json
+++ b/tools/run_tests/generated/sources_and_headers.json
@@ -6546,6 +6546,26 @@
"gpr",
"gpr_test_util",
"grpc",
+ "grpc++",
+ "grpc++_test_config",
+ "grpc++_test_util",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "is_filegroup": false,
+ "language": "c++",
+ "name": "cancel_ares_query_test",
+ "src": [
+ "test/cpp/naming/cancel_ares_query_test.cc"
+ ],
+ "third_party": false,
+ "type": "target"
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
"grpc_test_util"
],
"headers": [],
diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json
index 902ddbf257..f1276fdb2e 100644
--- a/tools/run_tests/generated/tests.json
+++ b/tools/run_tests/generated/tests.json
@@ -5640,6 +5640,28 @@
},
{
"args": [],
+ "benchmark": false,
+ "ci_platforms": [
+ "linux",
+ "mac",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [],
+ "flaky": false,
+ "gtest": true,
+ "language": "c++",
+ "name": "cancel_ares_query_test",
+ "platforms": [
+ "linux",
+ "mac",
+ "posix"
+ ],
+ "uses_polling": true
+ },
+ {
+ "args": [],
"boringssl": true,
"ci_platforms": [
"linux",
diff --git a/tools/run_tests/python_utils/upload_rbe_results.py b/tools/run_tests/python_utils/upload_rbe_results.py
index a2dd0bc39d..7236227f7c 100644
--- a/tools/run_tests/python_utils/upload_rbe_results.py
+++ b/tools/run_tests/python_utils/upload_rbe_results.py
@@ -125,7 +125,7 @@ def _get_resultstore_data(api_key, invocation_id):
if __name__ == "__main__":
- # Arguments are necessary if running in a non-Kokoro envrionment.
+ # Arguments are necessary if running in a non-Kokoro environment.
argp = argparse.ArgumentParser(description='Upload RBE results.')
argp.add_argument('--api_key', default='', type=str)
argp.add_argument('--invocation_id', default='', type=str)
diff --git a/tools/run_tests/python_utils/upload_test_results.py b/tools/run_tests/python_utils/upload_test_results.py
index 09dcd57ad4..63fa38b678 100644
--- a/tools/run_tests/python_utils/upload_test_results.py
+++ b/tools/run_tests/python_utils/upload_test_results.py
@@ -163,6 +163,7 @@ def upload_interop_results_to_bq(resultset, bq_table, args):
expiration_ms=_EXPIRATION_MS)
for shortname, results in six.iteritems(resultset):
+ bq_rows = []
for result in results:
test_results = {}
_get_build_metadata(test_results)
@@ -175,11 +176,15 @@ def upload_interop_results_to_bq(resultset, bq_table, args):
test_results['test_case'] = shortname.split(':')[3]
test_results['timestamp'] = time.strftime('%Y-%m-%d %H:%M:%S')
row = big_query_utils.make_row(str(uuid.uuid4()), test_results)
- # TODO(jtattermusch): rows are inserted one by one, very inefficient
+ bq_rows.append(row)
+
+ # BigQuery sometimes fails with large uploads, so batch 1,000 rows at a time.
+ for i in range((len(bq_rows) / 1000) + 1):
max_retries = 3
for attempt in range(max_retries):
- if big_query_utils.insert_rows(bq, _PROJECT_ID, _DATASET_ID,
- bq_table, [row]):
+ if big_query_utils.insert_rows(
+ bq, _PROJECT_ID, _DATASET_ID, bq_table,
+ bq_rows[i * 1000:(i + 1) * 1000]):
break
else:
if attempt < max_retries - 1: