diff options
121 files changed, 2333 insertions, 3994 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' @@ -72,6 +72,13 @@ disable= # TODO(https://github.com/grpc/grpc/issues/261): Maybe we could have # this one if we extracted just a few more helper functions... too-many-nested-blocks, - # NOTE(nathaniel): I have disputed the premise of this inspection from - # the beginning and will continue to do so until it goes away for good. + # TODO(https://github.com/grpc/grpc/issues/261): Disable unnecessary + # super-init requirement for abstract class implementations for now. + super-init-not-called, + # NOTE(nathaniel): A single statement that always returns program + # control is better than two statements the first of which sometimes + # returns program control and the second of which always returns + # program control. Probably generally, but definitely in the cases of + # if:/else: and for:/else:. useless-else-on-loop, + no-else-return, diff --git a/.pylintrc-tests b/.pylintrc-tests index b358b2c4a0..ebe9d507cd 100644 --- a/.pylintrc-tests +++ b/.pylintrc-tests @@ -103,6 +103,13 @@ disable= # TODO(https://github.com/grpc/grpc/issues/261): Maybe we could have # this one if we extracted just a few more helper functions... too-many-nested-blocks, - # NOTE(nathaniel): I have disputed the premise of this inspection from - # the beginning and will continue to do so until it goes away for good. + # TODO(https://github.com/grpc/grpc/issues/261): Disable unnecessary + # super-init requirement for abstract class implementations for now. + super-init-not-called, + # NOTE(nathaniel): A single statement that always returns program + # control is better than two statements the first of which sometimes + # returns program control and the second of which always returns + # program control. Probably generally, but definitely in the cases of + # if:/else: and for:/else:. useless-else-on-loop, + no-else-return, diff --git a/CMakeLists.txt b/CMakeLists.txt index 53100e938e..9f532b047d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5301,6 +5301,7 @@ add_library(end2end_tests test/core/end2end/tests/max_message_length.cc test/core/end2end/tests/negative_deadline.cc test/core/end2end/tests/network_status_change.cc + test/core/end2end/tests/no_error_on_hotpath.cc test/core/end2end/tests/no_logging.cc test/core/end2end/tests/no_op.cc test/core/end2end/tests/payload.cc @@ -5419,6 +5420,7 @@ add_library(end2end_nosec_tests test/core/end2end/tests/max_message_length.cc test/core/end2end/tests/negative_deadline.cc test/core/end2end/tests/network_status_change.cc + test/core/end2end/tests/no_error_on_hotpath.cc test/core/end2end/tests/no_logging.cc test/core/end2end/tests/no_op.cc test/core/end2end/tests/payload.cc @@ -9996,6 +9996,7 @@ LIBEND2END_TESTS_SRC = \ test/core/end2end/tests/max_message_length.cc \ test/core/end2end/tests/negative_deadline.cc \ test/core/end2end/tests/network_status_change.cc \ + test/core/end2end/tests/no_error_on_hotpath.cc \ test/core/end2end/tests/no_logging.cc \ test/core/end2end/tests/no_op.cc \ test/core/end2end/tests/payload.cc \ @@ -10112,6 +10113,7 @@ LIBEND2END_NOSEC_TESTS_SRC = \ test/core/end2end/tests/max_message_length.cc \ test/core/end2end/tests/negative_deadline.cc \ test/core/end2end/tests/network_status_change.cc \ + test/core/end2end/tests/no_error_on_hotpath.cc \ test/core/end2end/tests/no_logging.cc \ test/core/end2end/tests/no_op.cc \ test/core/end2end/tests/payload.cc \ diff --git a/bazel/grpc_build_system.bzl b/bazel/grpc_build_system.bzl index 095b1596c8..a56db77d75 100644 --- a/bazel/grpc_build_system.bzl +++ b/bazel/grpc_build_system.bzl @@ -110,7 +110,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"]) @@ -140,6 +140,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/gRPC-Core.podspec b/gRPC-Core.podspec index 5a111c2d3f..a4d62a76c6 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -1216,6 +1216,7 @@ Pod::Spec.new do |s| 'test/core/end2end/tests/max_message_length.cc', 'test/core/end2end/tests/negative_deadline.cc', 'test/core/end2end/tests/network_status_change.cc', + 'test/core/end2end/tests/no_error_on_hotpath.cc', 'test/core/end2end/tests/no_logging.cc', 'test/core/end2end/tests/no_op.cc', 'test/core/end2end/tests/payload.cc', @@ -2630,6 +2630,7 @@ 'test/core/end2end/tests/max_message_length.cc', 'test/core/end2end/tests/negative_deadline.cc', 'test/core/end2end/tests/network_status_change.cc', + 'test/core/end2end/tests/no_error_on_hotpath.cc', 'test/core/end2end/tests/no_logging.cc', 'test/core/end2end/tests/no_op.cc', 'test/core/end2end/tests/payload.cc', @@ -2720,6 +2721,7 @@ 'test/core/end2end/tests/max_message_length.cc', 'test/core/end2end/tests/negative_deadline.cc', 'test/core/end2end/tests/network_status_change.cc', + 'test/core/end2end/tests/no_error_on_hotpath.cc', 'test/core/end2end/tests/no_logging.cc', 'test/core/end2end/tests/no_op.cc', 'test/core/end2end/tests/payload.cc', diff --git a/include/grpcpp/impl/codegen/call.h b/include/grpcpp/impl/codegen/call.h index 28cc4a9e20..e324f6b14d 100644 --- a/include/grpcpp/impl/codegen/call.h +++ b/include/grpcpp/impl/codegen/call.h @@ -573,10 +573,13 @@ class CallOpClientRecvStatus { binary_error_details = grpc::string(iter->second.begin(), iter->second.length()); } - *recv_status_ = Status(static_cast<StatusCode>(status_code_), - grpc::string(GRPC_SLICE_START_PTR(error_message_), - GRPC_SLICE_END_PTR(error_message_)), - binary_error_details); + *recv_status_ = + Status(static_cast<StatusCode>(status_code_), + GRPC_SLICE_IS_EMPTY(error_message_) + ? grpc::string() + : grpc::string(GRPC_SLICE_START_PTR(error_message_), + GRPC_SLICE_END_PTR(error_message_)), + binary_error_details); client_context_->set_debug_error_string( debug_error_string_ != nullptr ? debug_error_string_ : ""); g_core_codegen_interface->grpc_slice_unref(error_message_); 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/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 07f2e2efba..151865cea7 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 @@ -276,7 +276,7 @@ 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; 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/error.cc b/src/core/lib/iomgr/error.cc index 4088cf612e..90ed34da11 100644 --- a/src/core/lib/iomgr/error.cc +++ b/src/core/lib/iomgr/error.cc @@ -312,6 +312,12 @@ static void internal_add_error(grpc_error** err, grpc_error* new_err) { // It is very common to include and extra int and string in an error #define SURPLUS_CAPACITY (2 * SLOTS_PER_INT + SLOTS_PER_TIME) +static bool g_error_creation_allowed = true; + +void grpc_disable_error_creation() { g_error_creation_allowed = false; } + +void grpc_enable_error_creation() { g_error_creation_allowed = true; } + grpc_error* grpc_error_create(const char* file, int line, grpc_slice desc, grpc_error** referencing, size_t num_referencing) { @@ -326,6 +332,12 @@ grpc_error* grpc_error_create(const char* file, int line, grpc_slice desc, return GRPC_ERROR_OOM; } #ifndef NDEBUG + if (!g_error_creation_allowed) { + gpr_log(GPR_ERROR, + "Error creation occurred when error creation was disabled [%s:%d]", + file, line); + abort(); + } if (grpc_trace_error_refcount.enabled()) { gpr_log(GPR_DEBUG, "%p create [%s:%d]", err, file, line); } diff --git a/src/core/lib/iomgr/error.h b/src/core/lib/iomgr/error.h index f8cae4da82..27c4d22fd1 100644 --- a/src/core/lib/iomgr/error.h +++ b/src/core/lib/iomgr/error.h @@ -123,6 +123,11 @@ typedef enum { #define GRPC_ERROR_OOM ((grpc_error*)2) #define GRPC_ERROR_CANCELLED ((grpc_error*)4) +// debug only toggles that allow for a sanity to check that ensures we will +// never create any errors in the per-RPC hotpath. +void grpc_disable_error_creation(); +void grpc_enable_error_creation(); + const char* grpc_error_string(grpc_error* error); /// Create an error - but use GRPC_ERROR_CREATE instead diff --git a/src/core/lib/iomgr/ev_epoll1_linux.cc b/src/core/lib/iomgr/ev_epoll1_linux.cc index cf839619cd..98ab974057 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); } @@ -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 993ea9480e..e9b74c6b64 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; @@ -445,6 +453,7 @@ static void fd_shutdown(grpc_fd* fd, grpc_error* why) { } } fd->write_closure->SetShutdown(GRPC_ERROR_REF(why)); + fd->error_closure->SetShutdown(GRPC_ERROR_REF(why)); } GRPC_ERROR_UNREF(why); } @@ -457,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 */ @@ -584,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) { @@ -785,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; @@ -853,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); } } @@ -1508,6 +1536,7 @@ static void shutdown_engine(void) { static const grpc_event_engine_vtable vtable = { sizeof(grpc_pollset), + true, fd_create, fd_wrapped_fd, @@ -1515,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..20512e31ac 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) { @@ -769,6 +776,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 +814,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 +829,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 +846,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; @@ -933,6 +944,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 +957,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 +1132,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 +1272,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 +1661,7 @@ static void shutdown_engine(void) { static const grpc_event_engine_vtable vtable = { sizeof(grpc_pollset), + true, fd_create, fd_wrapped_fd, @@ -1641,6 +1669,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..df6b0e1e89 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); @@ -553,6 +554,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 +1716,7 @@ static void shutdown_engine(void) { static const grpc_event_engine_vtable vtable = { sizeof(grpc_pollset), + false, fd_create, fd_wrapped_fd, @@ -1717,6 +1724,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..82b21df7ba 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) { @@ -231,6 +236,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..e3996ce365 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); 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); @@ -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..71e08f1230 100644 --- a/src/core/lib/iomgr/tcp_client_posix.cc +++ b/src/core/lib/iomgr/tcp_client_posix.cc @@ -280,7 +280,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; diff --git a/src/core/lib/iomgr/tcp_server_posix.cc b/src/core/lib/iomgr/tcp_server_posix.cc index 0a5caca906..ce18ff99e6 100644 --- a/src/core/lib/iomgr/tcp_server_posix.cc +++ b/src/core/lib/iomgr/tcp_server_posix.cc @@ -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..99368020d4 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); 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/examples/Sample/Sample.xcodeproj/project.pbxproj b/src/objective-c/examples/Sample/Sample.xcodeproj/project.pbxproj index ab7159cda2..cdd1c6c8f7 100644 --- a/src/objective-c/examples/Sample/Sample.xcodeproj/project.pbxproj +++ b/src/objective-c/examples/Sample/Sample.xcodeproj/project.pbxproj @@ -325,6 +325,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Sample/Info.plist; + LD_GENERATE_MAP_FILE = YES; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.grpc.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -337,6 +338,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Sample/Info.plist; + LD_GENERATE_MAP_FILE = YES; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.grpc.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/src/objective-c/examples/Sample/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme b/src/objective-c/examples/Sample/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme index d399e22e46..e356ea22a6 100644 --- a/src/objective-c/examples/Sample/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme +++ b/src/objective-c/examples/Sample/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme @@ -42,7 +42,7 @@ </AdditionalOptions> </TestAction> <LaunchAction - buildConfiguration = "Debug" + buildConfiguration = "Release" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" launchStyle = "0" 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/objective-c/tests/analyze_link_map.py b/src/objective-c/tests/analyze_link_map.py deleted file mode 100755 index 48e3441087..0000000000 --- a/src/objective-c/tests/analyze_link_map.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/python -# Copyright 2018 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This script analyzes link map file generated by Xcode. It calculates and -# prints out the sizes of each dependent library and the total sizes of the -# symbols. -# The script takes one parameter, which is the path to the link map file. - -import sys -import re - -table_tag = {} -state = "start" - -table_stats_symbol = {} -table_stats_dead = {} -section_total_size = 0 -symbol_total_size = 0 - - -file_import = sys.argv[1] -lines = list(open(file_import)) -for line in lines: - line_stripped = line[:-1] - if "# Object files:" == line_stripped: - state = "object" - continue - elif "# Sections:" == line_stripped: - state = "section" - continue - elif "# Symbols:" == line_stripped: - state = "symbol" - continue - elif "# Dead Stripped Symbols:" == line_stripped: - state = "dead" - continue - - if state == "object": - segs = re.search('(\[ *[0-9]*\]) (.*)', line_stripped) - table_tag[segs.group(1)] = segs.group(2) - - if state == "section": - if len(line_stripped) == 0 or line_stripped[0] == '#': - continue - segs = re.search('^(.+?)\s+(.+?)\s+.*', line_stripped) - section_total_size += int(segs.group(2), 16) - - if state == "symbol": - if len(line_stripped) == 0 or line_stripped[0] == '#': - continue - segs = re.search('^.+?\s+(.+?)\s+(\[.+?\]).*', line_stripped) - target = table_tag[segs.group(2)] - target_stripped = re.search('^(.*?)(\(.+?\))?$', target).group(1) - size = int(segs.group(1), 16) - if not target_stripped in table_stats_symbol: - table_stats_symbol[target_stripped] = 0 - table_stats_symbol[target_stripped] += size - -print("Sections total size: %d" % section_total_size) - -for target in table_stats_symbol: - print(target) - print(table_stats_symbol[target]) - symbol_total_size += table_stats_symbol[target] - -print("Symbols total size: %d" % symbol_total_size) diff --git a/src/objective-c/tests/build_one_example.sh b/src/objective-c/tests/build_one_example.sh index 985d55f3cc..1eace541e6 100755 --- a/src/objective-c/tests/build_one_example.sh +++ b/src/objective-c/tests/build_one_example.sh @@ -42,6 +42,9 @@ xcodebuild \ build \ -workspace *.xcworkspace \ -scheme $SCHEME \ - -destination name="iPhone 6" \ + -destination generic/platform=iOS \ + -derivedDataPath Build \ + CODE_SIGN_IDENTITY="" \ + CODE_SIGNING_REQUIRED=NO \ | egrep -v "$XCODEBUILD_FILTER" \ | egrep -v "^$" - diff --git a/src/proto/grpc/testing/messages.proto b/src/proto/grpc/testing/messages.proto index 0b8c15711e..7b1b7286dc 100644 --- a/src/proto/grpc/testing/messages.proto +++ b/src/proto/grpc/testing/messages.proto @@ -27,7 +27,6 @@ message BoolValue { bool value = 1; } -// DEPRECATED, don't use. To be removed shortly. // The type of payload that should be returned. enum PayloadType { // Compressable text format. @@ -36,7 +35,6 @@ enum PayloadType { // A block of data, to simply increase gRPC message size. message Payload { - // DEPRECATED, don't use. To be removed shortly. // The type of data in body. PayloadType type = 1; // Primary contents of payload. @@ -52,7 +50,6 @@ message EchoStatus { // Unary request. message SimpleRequest { - // DEPRECATED, don't use. To be removed shortly. // Desired payload type in the response from the server. // If response_type is RANDOM, server randomly chooses one from other formats. PayloadType response_type = 1; @@ -131,7 +128,6 @@ message ResponseParameters { // Server-streaming request. message StreamingOutputCallRequest { - // DEPRECATED, don't use. To be removed shortly. // Desired payload type in the response from the server. // If response_type is RANDOM, the payload from each response in the stream // might be of different types. This is to simulate a mixed type of payload diff --git a/src/python/grpcio/grpc/__init__.py b/src/python/grpcio/grpc/__init__.py index 0f31119467..996d075446 100644 --- a/src/python/grpcio/grpc/__init__.py +++ b/src/python/grpcio/grpc/__init__.py @@ -1482,7 +1482,7 @@ def ssl_server_credentials(private_key_certificate_chain_pairs, A ServerCredentials for use with an SSL-enabled Server. Typically, this object is an argument to add_secure_port() method during server setup. """ - if len(private_key_certificate_chain_pairs) == 0: + if not private_key_certificate_chain_pairs: raise ValueError( 'At least one private key-certificate chain pair is required!') elif require_client_auth and root_certificates is None: @@ -1512,15 +1512,15 @@ def ssl_server_certificate_configuration(private_key_certificate_chain_pairs, A ServerCertificateConfiguration that can be returned in the certificate configuration fetching callback. """ - if len(private_key_certificate_chain_pairs) == 0: - raise ValueError( - 'At least one private key-certificate chain pair is required!') - else: + if private_key_certificate_chain_pairs: return ServerCertificateConfiguration( _cygrpc.server_certificate_config_ssl(root_certificates, [ _cygrpc.SslPemKeyCertPair(key, pem) for key, pem in private_key_certificate_chain_pairs ])) + else: + raise ValueError( + 'At least one private key-certificate chain pair is required!') def dynamic_ssl_server_credentials(initial_certificate_configuration, @@ -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/_channel.py b/src/python/grpcio/grpc/_channel.py index 9fe946b2d5..e9246991df 100644 --- a/src/python/grpcio/grpc/_channel.py +++ b/src/python/grpcio/grpc/_channel.py @@ -192,7 +192,7 @@ def _consume_request_iterator(request_iterator, state, call, request_serializer, with state.condition: if state.code is None and not state.cancelled: if serialized_request is None: - code = grpc.StatusCode.INTERNAL # pylint: disable=redefined-variable-type + code = grpc.StatusCode.INTERNAL details = 'Exception serializing request!' call.cancel( _common.STATUS_CODE_TO_CYGRPC_STATUS_CODE[code], @@ -813,10 +813,7 @@ def _poll_connectivity(state, channel, initial_try_to_connect): _common.CYGRPC_CONNECTIVITY_STATE_TO_CHANNEL_CONNECTIVITY[ connectivity]) if not state.delivering: - # NOTE(nathaniel): The field is only ever used as a - # sequence so it's fine that both lists and tuples are - # assigned to it. - callbacks = _deliveries(state) # pylint: disable=redefined-variable-type + callbacks = _deliveries(state) if callbacks: _spawn_delivery(state, callbacks) diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi index 7e9ea33ca0..8d73215247 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi @@ -57,6 +57,11 @@ cdef class ChannelCredentials: cdef grpc_channel_credentials *c_credentials +cdef class SSLSessionCacheLRU: + + cdef grpc_ssl_session_cache *_cache + + cdef class SSLChannelCredentials(ChannelCredentials): cdef readonly object _pem_root_certificates diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi index dff9097bf9..f4ccfbc016 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi @@ -17,6 +17,9 @@ cimport cpython import grpc import threading +from libc.stdint cimport uintptr_t + + def _spawn_callback_in_thread(cb_func, args): threading.Thread(target=cb_func, args=args).start() @@ -29,6 +32,7 @@ def set_async_callback_func(callback_func): def _spawn_callback_async(callback, args): async_callback_func(callback, args) + cdef class CallCredentials: cdef grpc_call_credentials *c(self): @@ -107,6 +111,21 @@ cdef class ChannelCredentials: raise NotImplementedError() +cdef class SSLSessionCacheLRU: + + def __cinit__(self, capacity): + grpc_init() + self._cache = grpc_ssl_session_cache_create_lru(capacity) + + def __int__(self): + return <uintptr_t>self._cache + + def __dealloc__(self): + if self._cache != NULL: + grpc_ssl_session_cache_destroy(self._cache) + grpc_shutdown() + + cdef class SSLChannelCredentials(ChannelCredentials): def __cinit__(self, pem_root_certificates, private_key, certificate_chain): diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi index 2d6c900c54..cfefeaf938 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi @@ -131,6 +131,7 @@ cdef extern from "grpc/grpc.h": const char *GRPC_ARG_PRIMARY_USER_AGENT_STRING const char *GRPC_ARG_SECONDARY_USER_AGENT_STRING const char *GRPC_SSL_TARGET_NAME_OVERRIDE_ARG + const char *GRPC_SSL_SESSION_CACHE_ARG const char *GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM const char *GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL const char *GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET @@ -452,8 +453,16 @@ cdef extern from "grpc/grpc_security.h": # We don't care about the internals (and in fact don't know them) pass + + ctypedef struct grpc_ssl_session_cache: + # We don't care about the internals (and in fact don't know them) + pass + ctypedef void (*grpc_ssl_roots_override_callback)(char **pem_root_certs) + grpc_ssl_session_cache *grpc_ssl_session_cache_create_lru(size_t capacity) + void grpc_ssl_session_cache_destroy(grpc_ssl_session_cache* cache) + void grpc_set_ssl_roots_override_callback( grpc_ssl_roots_override_callback cb) nogil 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/records.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi index ecd991685f..37b98ebbdb 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi @@ -51,6 +51,7 @@ class ChannelArgKey: default_authority = GRPC_ARG_DEFAULT_AUTHORITY primary_user_agent_string = GRPC_ARG_PRIMARY_USER_AGENT_STRING secondary_user_agent_string = GRPC_ARG_SECONDARY_USER_AGENT_STRING + ssl_session_cache = GRPC_SSL_SESSION_CACHE_ARG ssl_target_name_override = GRPC_SSL_TARGET_NAME_OVERRIDE_ARG 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/_interceptor.py b/src/python/grpcio/grpc/_interceptor.py index f465e35a9c..6b7a912a94 100644 --- a/src/python/grpcio/grpc/_interceptor.py +++ b/src/python/grpcio/grpc/_interceptor.py @@ -100,6 +100,12 @@ class _LocalFailure(grpc.RpcError, grpc.Future, grpc.Call): def cancelled(self): return False + def is_active(self): + return False + + def time_remaining(self): + return None + def running(self): return False @@ -115,6 +121,9 @@ class _LocalFailure(grpc.RpcError, grpc.Future, grpc.Call): def traceback(self, ignored_timeout=None): return self._traceback + def add_callback(self, callback): + return False + def add_done_callback(self, fn): fn(self) @@ -288,11 +297,11 @@ class _Channel(grpc.Channel): self._channel = channel self._interceptor = interceptor - def subscribe(self, *args, **kwargs): - self._channel.subscribe(*args, **kwargs) + def subscribe(self, callback, try_to_connect=False): + self._channel.subscribe(callback, try_to_connect=try_to_connect) - def unsubscribe(self, *args, **kwargs): - self._channel.unsubscribe(*args, **kwargs) + def unsubscribe(self, callback): + self._channel.unsubscribe(callback) def unary_unary(self, method, diff --git a/src/python/grpcio/grpc/_server.py b/src/python/grpcio/grpc/_server.py index d12a2421cd..7276a7fd90 100644 --- a/src/python/grpcio/grpc/_server.py +++ b/src/python/grpcio/grpc/_server.py @@ -330,6 +330,8 @@ class _RequestIterator(object): self._state.request = None return request + raise AssertionError() # should never run + def _next(self): with self._state.condition: self._raise_or_start_receive_message() @@ -787,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, @@ -800,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): @@ -817,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/grpc/_utilities.py b/src/python/grpcio/grpc/_utilities.py index 25bd1ceae2..d90b34bcbd 100644 --- a/src/python/grpcio/grpc/_utilities.py +++ b/src/python/grpcio/grpc/_utilities.py @@ -116,6 +116,8 @@ class _ChannelReadyFuture(grpc.Future): callable_util.call_logging_exceptions( done_callback, _DONE_CALLBACK_EXCEPTION_LOG_MESSAGE, self) + return True + def cancelled(self): with self._condition: return self._cancelled diff --git a/src/python/grpcio/grpc/beta/_server_adaptations.py b/src/python/grpcio/grpc/beta/_server_adaptations.py index ccafec8951..80ac65b649 100644 --- a/src/python/grpcio/grpc/beta/_server_adaptations.py +++ b/src/python/grpcio/grpc/beta/_server_adaptations.py @@ -305,6 +305,7 @@ def _simple_method_handler(implementation, request_deserializer, response_serializer, None, None, None, _adapt_stream_stream_event( implementation.stream_stream_event)) + raise ValueError() def _flatten_method_pair_map(method_pair_map): diff --git a/src/python/grpcio/grpc/beta/utilities.py b/src/python/grpcio/grpc/beta/utilities.py index b5d8aac71a..fe3ce606c9 100644 --- a/src/python/grpcio/grpc/beta/utilities.py +++ b/src/python/grpcio/grpc/beta/utilities.py @@ -85,6 +85,8 @@ class _ChannelReadyFuture(future.Future): callable_util.call_logging_exceptions( done_callback, _DONE_CALLBACK_EXCEPTION_LOG_MESSAGE, self) + return True + def cancelled(self): with self._condition: return self._cancelled diff --git a/src/python/grpcio/grpc/experimental/session_cache.py b/src/python/grpcio/grpc/experimental/session_cache.py new file mode 100644 index 0000000000..5c55f7c327 --- /dev/null +++ b/src/python/grpcio/grpc/experimental/session_cache.py @@ -0,0 +1,45 @@ +# Copyright 2018 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. +"""gRPC's APIs for TLS Session Resumption support""" + +from grpc._cython import cygrpc as _cygrpc + + +def ssl_session_cache_lru(capacity): + """Creates an SSLSessionCache with LRU replacement policy + + Args: + capacity: Size of the cache + + Returns: + An SSLSessionCache with LRU replacement policy that can be passed as a value for + the grpc.ssl_session_cache option to a grpc.Channel. SSL session caches are used + to store session tickets, which clients can present to resume previous TLS sessions + with a server. + """ + return SSLSessionCache(_cygrpc.SSLSessionCacheLRU(capacity)) + + +class SSLSessionCache(object): + """An encapsulation of a session cache used for TLS session resumption. + + Instances of this class can be passed to a Channel as values for the + grpc.ssl_session_cache option + """ + + def __init__(self, cache): + self._cache = cache + + def __int__(self): + return int(self._cache) diff --git a/src/python/grpcio/grpc/framework/foundation/stream_util.py b/src/python/grpcio/grpc/framework/foundation/stream_util.py index ed0448aa08..1faaf29bd7 100644 --- a/src/python/grpcio/grpc/framework/foundation/stream_util.py +++ b/src/python/grpcio/grpc/framework/foundation/stream_util.py @@ -47,10 +47,10 @@ class IterableConsumer(stream.Consumer): self._values = [] self._active = True - def consume(self, stock_reply): + def consume(self, value): with self._condition: if self._active: - self._values.append(stock_reply) + self._values.append(value) self._condition.notify() def terminate(self): @@ -58,10 +58,10 @@ class IterableConsumer(stream.Consumer): self._active = False self._condition.notify() - def consume_and_terminate(self, stock_reply): + def consume_and_terminate(self, value): with self._condition: if self._active: - self._values.append(stock_reply) + self._values.append(value) self._active = False self._condition.notify() diff --git a/src/python/grpcio_testing/grpc_testing/__init__.py b/src/python/grpcio_testing/grpc_testing/__init__.py index e87d0ffc96..65fdd1b8ca 100644 --- a/src/python/grpcio_testing/grpc_testing/__init__.py +++ b/src/python/grpcio_testing/grpc_testing/__init__.py @@ -14,9 +14,9 @@ """Objects for use in testing gRPC Python-using application code.""" import abc +import six from google.protobuf import descriptor -import six import grpc diff --git a/src/python/grpcio_testing/grpc_testing/_server/_handler.py b/src/python/grpcio_testing/grpc_testing/_server/_handler.py index d4f50f6863..0e3404b0d0 100644 --- a/src/python/grpcio_testing/grpc_testing/_server/_handler.py +++ b/src/python/grpcio_testing/grpc_testing/_server/_handler.py @@ -105,10 +105,10 @@ class _Handler(Handler): self._expiration_future.cancel() self._condition.notify_all() - def add_termination_callback(self, termination_callback): + def add_termination_callback(self, callback): with self._condition: if self._code is None: - self._termination_callbacks.append(termination_callback) + self._termination_callbacks.append(callback) return True else: return False diff --git a/src/python/grpcio_tests/tests/_loader.py b/src/python/grpcio_tests/tests/_loader.py index be0af64646..80c107aa8e 100644 --- a/src/python/grpcio_tests/tests/_loader.py +++ b/src/python/grpcio_tests/tests/_loader.py @@ -48,12 +48,13 @@ class Loader(object): # measure unnecessarily suffers) coverage_context = coverage.Coverage(data_suffix=True) coverage_context.start() - modules = [importlib.import_module(name) for name in names] - for module in modules: - self.visit_module(module) - for module in modules: + imported_modules = tuple( + importlib.import_module(name) for name in names) + for imported_module in imported_modules: + self.visit_module(imported_module) + for imported_module in imported_modules: try: - package_paths = module.__path__ + package_paths = imported_module.__path__ except AttributeError: continue self.walk_packages(package_paths) diff --git a/src/python/grpcio_tests/tests/_result.py b/src/python/grpcio_tests/tests/_result.py index b105f18e78..e5378b7ea3 100644 --- a/src/python/grpcio_tests/tests/_result.py +++ b/src/python/grpcio_tests/tests/_result.py @@ -144,10 +144,6 @@ class AugmentedResult(unittest.TestResult): super(AugmentedResult, self).startTestRun() self.cases = dict() - def stopTestRun(self): - """See unittest.TestResult.stopTestRun.""" - super(AugmentedResult, self).stopTestRun() - def startTest(self, test): """See unittest.TestResult.startTest.""" super(AugmentedResult, self).startTest(test) @@ -155,19 +151,19 @@ class AugmentedResult(unittest.TestResult): self.cases[case_id] = CaseResult( id=case_id, name=test.id(), kind=CaseResult.Kind.RUNNING) - def addError(self, test, error): + def addError(self, test, err): """See unittest.TestResult.addError.""" - super(AugmentedResult, self).addError(test, error) + super(AugmentedResult, self).addError(test, err) case_id = self.id_map(test) self.cases[case_id] = self.cases[case_id].updated( - kind=CaseResult.Kind.ERROR, traceback=error) + kind=CaseResult.Kind.ERROR, traceback=err) - def addFailure(self, test, error): + def addFailure(self, test, err): """See unittest.TestResult.addFailure.""" - super(AugmentedResult, self).addFailure(test, error) + super(AugmentedResult, self).addFailure(test, err) case_id = self.id_map(test) self.cases[case_id] = self.cases[case_id].updated( - kind=CaseResult.Kind.FAILURE, traceback=error) + kind=CaseResult.Kind.FAILURE, traceback=err) def addSuccess(self, test): """See unittest.TestResult.addSuccess.""" @@ -183,12 +179,12 @@ class AugmentedResult(unittest.TestResult): self.cases[case_id] = self.cases[case_id].updated( kind=CaseResult.Kind.SKIP, skip_reason=reason) - def addExpectedFailure(self, test, error): + def addExpectedFailure(self, test, err): """See unittest.TestResult.addExpectedFailure.""" - super(AugmentedResult, self).addExpectedFailure(test, error) + super(AugmentedResult, self).addExpectedFailure(test, err) case_id = self.id_map(test) self.cases[case_id] = self.cases[case_id].updated( - kind=CaseResult.Kind.EXPECTED_FAILURE, traceback=error) + kind=CaseResult.Kind.EXPECTED_FAILURE, traceback=err) def addUnexpectedSuccess(self, test): """See unittest.TestResult.addUnexpectedSuccess.""" @@ -249,13 +245,6 @@ class CoverageResult(AugmentedResult): self.coverage_context.save() self.coverage_context = None - def stopTestRun(self): - """See unittest.TestResult.stopTestRun.""" - super(CoverageResult, self).stopTestRun() - # TODO(atash): Dig deeper into why the following line fails to properly - # combine coverage data from the Cython plugin. - #coverage.Coverage().combine() - class _Colors(object): """Namespaced constants for terminal color magic numbers.""" @@ -295,16 +284,16 @@ class TerminalResult(CoverageResult): self.out.write(summary(self)) self.out.flush() - def addError(self, test, error): + def addError(self, test, err): """See unittest.TestResult.addError.""" - super(TerminalResult, self).addError(test, error) + super(TerminalResult, self).addError(test, err) self.out.write( _Colors.FAIL + 'ERROR {}\n'.format(test.id()) + _Colors.END) self.out.flush() - def addFailure(self, test, error): + def addFailure(self, test, err): """See unittest.TestResult.addFailure.""" - super(TerminalResult, self).addFailure(test, error) + super(TerminalResult, self).addFailure(test, err) self.out.write( _Colors.FAIL + 'FAILURE {}\n'.format(test.id()) + _Colors.END) self.out.flush() @@ -323,9 +312,9 @@ class TerminalResult(CoverageResult): _Colors.INFO + 'SKIP {}\n'.format(test.id()) + _Colors.END) self.out.flush() - def addExpectedFailure(self, test, error): + def addExpectedFailure(self, test, err): """See unittest.TestResult.addExpectedFailure.""" - super(TerminalResult, self).addExpectedFailure(test, error) + super(TerminalResult, self).addExpectedFailure(test, err) self.out.write( _Colors.INFO + 'FAILURE_OK {}\n'.format(test.id()) + _Colors.END) self.out.flush() diff --git a/src/python/grpcio_tests/tests/interop/methods.py b/src/python/grpcio_tests/tests/interop/methods.py index b728ffd704..cda15a68a3 100644 --- a/src/python/grpcio_tests/tests/interop/methods.py +++ b/src/python/grpcio_tests/tests/interop/methods.py @@ -144,8 +144,8 @@ def _large_unary_common_behavior(stub, fill_username, fill_oauth_scope, def _empty_unary(stub): response = stub.EmptyCall(empty_pb2.Empty()) if not isinstance(response, empty_pb2.Empty): - raise TypeError('response is of type "%s", not empty_pb2.Empty!', - type(response)) + raise TypeError( + 'response is of type "%s", not empty_pb2.Empty!' % type(response)) def _large_unary(stub): diff --git a/src/python/grpcio_tests/tests/tests.json b/src/python/grpcio_tests/tests/tests.json index 0d94426413..ebc41c63f0 100644 --- a/src/python/grpcio_tests/tests/tests.json +++ b/src/python/grpcio_tests/tests/tests.json @@ -53,6 +53,8 @@ "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", "unit.beta._connectivity_channel_test.ConnectivityStatesTest", diff --git a/src/python/grpcio_tests/tests/unit/_auth_context_test.py b/src/python/grpcio_tests/tests/unit/_auth_context_test.py index 8c1a30e032..d174051070 100644 --- a/src/python/grpcio_tests/tests/unit/_auth_context_test.py +++ b/src/python/grpcio_tests/tests/unit/_auth_context_test.py @@ -18,6 +18,7 @@ import unittest import grpc from grpc import _channel +from grpc.experimental import session_cache import six from tests.unit import test_common @@ -140,6 +141,50 @@ class AuthContextTest(unittest.TestCase): self.assertSequenceEqual([b'*.test.google.com'], auth_ctx['x509_common_name']) + def _do_one_shot_client_rpc(self, channel_creds, channel_options, port, + expect_ssl_session_reused): + channel = grpc.secure_channel( + 'localhost:{}'.format(port), channel_creds, options=channel_options) + response = channel.unary_unary(_UNARY_UNARY)(_REQUEST) + auth_data = pickle.loads(response) + self.assertEqual(expect_ssl_session_reused, + auth_data[_AUTH_CTX]['ssl_session_reused']) + channel.close() + + def testSessionResumption(self): + # Set up a secure server + handler = grpc.method_handlers_generic_handler('test', { + 'UnaryUnary': + grpc.unary_unary_rpc_method_handler(handle_unary_unary) + }) + server = test_common.test_server() + server.add_generic_rpc_handlers((handler,)) + server_cred = grpc.ssl_server_credentials(_SERVER_CERTS) + port = server.add_secure_port('[::]:0', server_cred) + server.start() + + # Create a cache for TLS session tickets + cache = session_cache.ssl_session_cache_lru(1) + channel_creds = grpc.ssl_channel_credentials( + root_certificates=_TEST_ROOT_CERTIFICATES) + channel_options = _PROPERTY_OPTIONS + ( + ('grpc.ssl_session_cache', cache),) + + # Initial connection has no session to resume + self._do_one_shot_client_rpc( + channel_creds, + channel_options, + port, + expect_ssl_session_reused=[b'false']) + + # Subsequent connections resume sessions + self._do_one_shot_client_rpc( + channel_creds, + channel_options, + port, + expect_ssl_session_reused=[b'true']) + server.stop(None) + if __name__ == '__main__': unittest.main(verbosity=2) diff --git a/src/python/grpcio_tests/tests/unit/_junkdrawer/__init__.py b/src/python/grpcio_tests/tests/unit/_junkdrawer/__init__.py deleted file mode 100644 index 5fb4f3c3cf..0000000000 --- a/src/python/grpcio_tests/tests/unit/_junkdrawer/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2015 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. diff --git a/src/python/grpcio_tests/tests/unit/_junkdrawer/stock_pb2.py b/src/python/grpcio_tests/tests/unit/_junkdrawer/stock_pb2.py deleted file mode 100644 index 2bf1e1cc0d..0000000000 --- a/src/python/grpcio_tests/tests/unit/_junkdrawer/stock_pb2.py +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright 2015 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# TODO(nathaniel): Remove this from source control after having made -# generation from the stock.proto source part of GRPC's build-and-test -# process. - -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: stock.proto - -import sys -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode('latin1')) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -from google.protobuf import descriptor_pb2 -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - -DESCRIPTOR = _descriptor.FileDescriptor( - name='stock.proto', - package='stock', - serialized_pb=_b( - '\n\x0bstock.proto\x12\x05stock\">\n\x0cStockRequest\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\x1e\n\x13num_trades_to_watch\x18\x02 \x01(\x05:\x01\x30\"+\n\nStockReply\x12\r\n\x05price\x18\x01 \x01(\x02\x12\x0e\n\x06symbol\x18\x02 \x01(\t2\x96\x02\n\x05Stock\x12=\n\x11GetLastTradePrice\x12\x13.stock.StockRequest\x1a\x11.stock.StockReply\"\x00\x12I\n\x19GetLastTradePriceMultiple\x12\x13.stock.StockRequest\x1a\x11.stock.StockReply\"\x00(\x01\x30\x01\x12?\n\x11WatchFutureTrades\x12\x13.stock.StockRequest\x1a\x11.stock.StockReply\"\x00\x30\x01\x12\x42\n\x14GetHighestTradePrice\x12\x13.stock.StockRequest\x1a\x11.stock.StockReply\"\x00(\x01' - )) -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -_STOCKREQUEST = _descriptor.Descriptor( - name='StockRequest', - full_name='stock.StockRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='symbol', - full_name='stock.StockRequest.symbol', - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode('utf-8'), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='num_trades_to_watch', - full_name='stock.StockRequest.num_trades_to_watch', - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=True, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - options=None), - ], - extensions=[], - nested_types=[], - enum_types=[], - options=None, - is_extendable=False, - extension_ranges=[], - oneofs=[], - serialized_start=22, - serialized_end=84,) - -_STOCKREPLY = _descriptor.Descriptor( - name='StockReply', - full_name='stock.StockReply', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='price', - full_name='stock.StockReply.price', - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='symbol', - full_name='stock.StockReply.symbol', - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode('utf-8'), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - options=None), - ], - extensions=[], - nested_types=[], - enum_types=[], - options=None, - is_extendable=False, - extension_ranges=[], - oneofs=[], - serialized_start=86, - serialized_end=129,) - -DESCRIPTOR.message_types_by_name['StockRequest'] = _STOCKREQUEST -DESCRIPTOR.message_types_by_name['StockReply'] = _STOCKREPLY - -StockRequest = _reflection.GeneratedProtocolMessageType( - 'StockRequest', - (_message.Message,), - dict( - DESCRIPTOR=_STOCKREQUEST, - __module__='stock_pb2' - # @@protoc_insertion_point(class_scope:stock.StockRequest) - )) -_sym_db.RegisterMessage(StockRequest) - -StockReply = _reflection.GeneratedProtocolMessageType( - 'StockReply', - (_message.Message,), - dict( - DESCRIPTOR=_STOCKREPLY, - __module__='stock_pb2' - # @@protoc_insertion_point(class_scope:stock.StockReply) - )) -_sym_db.RegisterMessage(StockReply) - -# @@protoc_insertion_point(module_scope) 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/src/python/grpcio_tests/tests/unit/_session_cache_test.py b/src/python/grpcio_tests/tests/unit/_session_cache_test.py new file mode 100644 index 0000000000..b4e4670fa7 --- /dev/null +++ b/src/python/grpcio_tests/tests/unit/_session_cache_test.py @@ -0,0 +1,145 @@ +# Copyright 2018 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. +"""Tests experimental TLS Session Resumption API""" + +import pickle +import unittest + +import grpc +from grpc import _channel +from grpc.experimental import session_cache + +from tests.unit import test_common +from tests.unit import resources + +_REQUEST = b'\x00\x00\x00' +_RESPONSE = b'\x00\x00\x00' + +_UNARY_UNARY = '/test/UnaryUnary' + +_SERVER_HOST_OVERRIDE = 'foo.test.google.fr' +_ID = 'id' +_ID_KEY = 'id_key' +_AUTH_CTX = 'auth_ctx' + +_PRIVATE_KEY = resources.private_key() +_CERTIFICATE_CHAIN = resources.certificate_chain() +_TEST_ROOT_CERTIFICATES = resources.test_root_certificates() +_SERVER_CERTS = ((_PRIVATE_KEY, _CERTIFICATE_CHAIN),) +_PROPERTY_OPTIONS = (( + 'grpc.ssl_target_name_override', + _SERVER_HOST_OVERRIDE, +),) + + +def handle_unary_unary(request, servicer_context): + return pickle.dumps({ + _ID: servicer_context.peer_identities(), + _ID_KEY: servicer_context.peer_identity_key(), + _AUTH_CTX: servicer_context.auth_context() + }) + + +def start_secure_server(): + handler = grpc.method_handlers_generic_handler('test', { + 'UnaryUnary': + grpc.unary_unary_rpc_method_handler(handle_unary_unary) + }) + server = test_common.test_server() + server.add_generic_rpc_handlers((handler,)) + server_cred = grpc.ssl_server_credentials(_SERVER_CERTS) + port = server.add_secure_port('[::]:0', server_cred) + server.start() + + return server, port + + +class SSLSessionCacheTest(unittest.TestCase): + + def _do_one_shot_client_rpc(self, channel_creds, channel_options, port, + expect_ssl_session_reused): + channel = grpc.secure_channel( + 'localhost:{}'.format(port), channel_creds, options=channel_options) + response = channel.unary_unary(_UNARY_UNARY)(_REQUEST) + auth_data = pickle.loads(response) + self.assertEqual(expect_ssl_session_reused, + auth_data[_AUTH_CTX]['ssl_session_reused']) + channel.close() + + def testSSLSessionCacheLRU(self): + server_1, port_1 = start_secure_server() + + cache = session_cache.ssl_session_cache_lru(1) + channel_creds = grpc.ssl_channel_credentials( + root_certificates=_TEST_ROOT_CERTIFICATES) + channel_options = _PROPERTY_OPTIONS + ( + ('grpc.ssl_session_cache', cache),) + + # Initial connection has no session to resume + self._do_one_shot_client_rpc( + channel_creds, + channel_options, + port_1, + expect_ssl_session_reused=[b'false']) + + # Connection to server_1 resumes from initial session + self._do_one_shot_client_rpc( + channel_creds, + channel_options, + port_1, + expect_ssl_session_reused=[b'true']) + + # Connection to a different server with the same name overwrites the cache entry + server_2, port_2 = start_secure_server() + self._do_one_shot_client_rpc( + channel_creds, + channel_options, + port_2, + expect_ssl_session_reused=[b'false']) + self._do_one_shot_client_rpc( + channel_creds, + channel_options, + port_2, + expect_ssl_session_reused=[b'true']) + server_2.stop(None) + + # Connection to server_1 now falls back to full TLS handshake + self._do_one_shot_client_rpc( + channel_creds, + channel_options, + port_1, + expect_ssl_session_reused=[b'false']) + + # Re-creating server_1 causes old sessions to become invalid + server_1.stop(None) + server_1, port_1 = start_secure_server() + + # Old sessions should no longer be valid + self._do_one_shot_client_rpc( + channel_creds, + channel_options, + port_1, + expect_ssl_session_reused=[b'false']) + + # Resumption should work for subsequent connections + self._do_one_shot_client_rpc( + channel_creds, + channel_options, + port_1, + expect_ssl_session_reused=[b'true']) + server_1.stop(None) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/templates/test/cpp/naming/resolver_component_tests_defs.include b/templates/test/cpp/naming/resolver_component_tests_defs.include index c3c3b68672..bc981dc83e 100644 --- a/templates/test/cpp/naming/resolver_component_tests_defs.include +++ b/templates/test/cpp/naming/resolver_component_tests_defs.include @@ -58,7 +58,7 @@ def wait_until_dns_server_is_up(args, test_runner_log('Health check: attempt to connect to DNS server over TCP.') tcp_connect_subprocess = subprocess.Popen([ args.tcp_connect_bin_path, - '--server_host', '::1', + '--server_host', '127.0.0.1', '--server_port', str(args.dns_server_port), '--timeout', str(1)]) tcp_connect_subprocess.communicate() @@ -68,7 +68,7 @@ def wait_until_dns_server_is_up(args, dns_resolver_subprocess = subprocess.Popen([ args.dns_resolver_bin_path, '--qname', 'health-check-local-dns-server-is-alive.resolver-tests.grpctestingexp', - '--server_host', '::1', + '--server_host', '127.0.0.1', '--server_port', str(args.dns_server_port)], stdout=subprocess.PIPE) dns_resolver_stdout, _ = dns_resolver_subprocess.communicate() @@ -125,7 +125,7 @@ current_test_subprocess = subprocess.Popen([\ \ % endfor - '--local_dns_server_address', '[::1]:%d' % args.dns_server_port])\ + '--local_dns_server_address', '127.0.0.1:%d' % args.dns_server_port])\ current_test_subprocess.communicate()\ 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/end2end/end2end_nosec_tests.cc b/test/core/end2end/end2end_nosec_tests.cc index 59eb643a93..a70128254a 100644 --- a/test/core/end2end/end2end_nosec_tests.cc +++ b/test/core/end2end/end2end_nosec_tests.cc @@ -100,6 +100,8 @@ extern void negative_deadline(grpc_end2end_test_config config); extern void negative_deadline_pre_init(void); extern void network_status_change(grpc_end2end_test_config config); extern void network_status_change_pre_init(void); +extern void no_error_on_hotpath(grpc_end2end_test_config config); +extern void no_error_on_hotpath_pre_init(void); extern void no_logging(grpc_end2end_test_config config); extern void no_logging_pre_init(void); extern void no_op(grpc_end2end_test_config config); @@ -222,6 +224,7 @@ void grpc_end2end_tests_pre_init(void) { max_message_length_pre_init(); negative_deadline_pre_init(); network_status_change_pre_init(); + no_error_on_hotpath_pre_init(); no_logging_pre_init(); no_op_pre_init(); payload_pre_init(); @@ -307,6 +310,7 @@ void grpc_end2end_tests(int argc, char **argv, max_message_length(config); negative_deadline(config); network_status_change(config); + no_error_on_hotpath(config); no_logging(config); no_op(config); payload(config); @@ -492,6 +496,10 @@ void grpc_end2end_tests(int argc, char **argv, network_status_change(config); continue; } + if (0 == strcmp("no_error_on_hotpath", argv[i])) { + no_error_on_hotpath(config); + continue; + } if (0 == strcmp("no_logging", argv[i])) { no_logging(config); continue; diff --git a/test/core/end2end/end2end_tests.cc b/test/core/end2end/end2end_tests.cc index 9f164b4ead..bf75dd4579 100644 --- a/test/core/end2end/end2end_tests.cc +++ b/test/core/end2end/end2end_tests.cc @@ -102,6 +102,8 @@ extern void negative_deadline(grpc_end2end_test_config config); extern void negative_deadline_pre_init(void); extern void network_status_change(grpc_end2end_test_config config); extern void network_status_change_pre_init(void); +extern void no_error_on_hotpath(grpc_end2end_test_config config); +extern void no_error_on_hotpath_pre_init(void); extern void no_logging(grpc_end2end_test_config config); extern void no_logging_pre_init(void); extern void no_op(grpc_end2end_test_config config); @@ -225,6 +227,7 @@ void grpc_end2end_tests_pre_init(void) { max_message_length_pre_init(); negative_deadline_pre_init(); network_status_change_pre_init(); + no_error_on_hotpath_pre_init(); no_logging_pre_init(); no_op_pre_init(); payload_pre_init(); @@ -311,6 +314,7 @@ void grpc_end2end_tests(int argc, char **argv, max_message_length(config); negative_deadline(config); network_status_change(config); + no_error_on_hotpath(config); no_logging(config); no_op(config); payload(config); @@ -500,6 +504,10 @@ void grpc_end2end_tests(int argc, char **argv, network_status_change(config); continue; } + if (0 == strcmp("no_error_on_hotpath", argv[i])) { + no_error_on_hotpath(config); + continue; + } if (0 == strcmp("no_logging", argv[i])) { no_logging(config); continue; diff --git a/test/core/end2end/gen_build_yaml.py b/test/core/end2end/gen_build_yaml.py index c355fc24b5..1851214191 100755 --- a/test/core/end2end/gen_build_yaml.py +++ b/test/core/end2end/gen_build_yaml.py @@ -138,6 +138,7 @@ END2END_TESTS = { 'max_message_length': default_test_options._replace(cpu_cost=LOWCPU), 'negative_deadline': default_test_options, 'network_status_change': default_test_options._replace(cpu_cost=LOWCPU), + 'no_error_on_hotpath': default_test_options._replace(proxyable=False), 'no_logging': default_test_options._replace(traceable=False), 'no_op': default_test_options, 'payload': default_test_options, diff --git a/test/core/end2end/generate_tests.bzl b/test/core/end2end/generate_tests.bzl index 11fc576165..706f4fa86d 100755 --- a/test/core/end2end/generate_tests.bzl +++ b/test/core/end2end/generate_tests.bzl @@ -134,6 +134,7 @@ END2END_TESTS = { 'max_message_length': test_options(), 'negative_deadline': test_options(), 'network_status_change': test_options(), + 'no_error_on_hotpath': test_options(proxyable=False), 'no_logging': test_options(traceable=False), 'no_op': test_options(), 'payload': test_options(), diff --git a/test/core/end2end/tests/no_error_on_hotpath.cc b/test/core/end2end/tests/no_error_on_hotpath.cc new file mode 100644 index 0000000000..7afadf7d3a --- /dev/null +++ b/test/core/end2end/tests/no_error_on_hotpath.cc @@ -0,0 +1,246 @@ +/* + * + * Copyright 2016 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "test/core/end2end/end2end_tests.h" + +#include <stdio.h> +#include <string.h> + +#include <grpc/byte_buffer.h> +#include <grpc/grpc.h> +#include <grpc/support/alloc.h> +#include <grpc/support/log.h> +#include <grpc/support/string_util.h> +#include <grpc/support/time.h> +#include "src/core/lib/gpr/string.h" +#include "src/core/lib/iomgr/error.h" +#include "test/core/end2end/cq_verifier.h" + +static void* tag(intptr_t t) { return (void*)t; } + +static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { + grpc_end2end_test_fixture f; + gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); + f = config.create_fixture(client_args, server_args); + config.init_server(&f, server_args); + config.init_client(&f, client_args); + return f; +} + +static gpr_timespec n_seconds_from_now(int n) { + return grpc_timeout_seconds_to_deadline(n); +} + +static gpr_timespec five_seconds_from_now(void) { + return n_seconds_from_now(5); +} + +static void drain_cq(grpc_completion_queue* cq) { + grpc_event ev; + do { + ev = grpc_completion_queue_next(cq, five_seconds_from_now(), nullptr); + } while (ev.type != GRPC_QUEUE_SHUTDOWN); +} + +static void shutdown_server(grpc_end2end_test_fixture* f) { + if (!f->server) return; + grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), + grpc_timeout_seconds_to_deadline(5), + nullptr) + .type == GRPC_OP_COMPLETE); + grpc_server_destroy(f->server); + f->server = nullptr; +} + +static void shutdown_client(grpc_end2end_test_fixture* f) { + if (!f->client) return; + grpc_channel_destroy(f->client); + f->client = nullptr; +} + +static void end_test(grpc_end2end_test_fixture* f) { + shutdown_server(f); + shutdown_client(f); + + grpc_completion_queue_shutdown(f->cq); + drain_cq(f->cq); + grpc_completion_queue_destroy(f->cq); + grpc_completion_queue_destroy(f->shutdown_cq); +} + +static void simple_request_body(grpc_end2end_test_config config, + grpc_end2end_test_fixture f) { + grpc_call* c; + grpc_call* s; + cq_verifier* cqv = cq_verifier_create(f.cq); + grpc_op ops[6]; + grpc_op* op; + grpc_metadata_array initial_metadata_recv; + grpc_metadata_array trailing_metadata_recv; + grpc_metadata_array request_metadata_recv; + grpc_call_details call_details; + grpc_status_code status; + grpc_call_error error; + grpc_slice details; + int was_cancelled = 2; + char* peer; + + gpr_timespec deadline = five_seconds_from_now(); + c = grpc_channel_create_call(f.client, nullptr, GRPC_PROPAGATE_DEFAULTS, f.cq, + grpc_slice_from_static_string("/foo"), nullptr, + deadline, nullptr); + GPR_ASSERT(c); + + peer = grpc_call_get_peer(c); + GPR_ASSERT(peer != nullptr); + gpr_free(peer); + + grpc_metadata_array_init(&initial_metadata_recv); + grpc_metadata_array_init(&trailing_metadata_recv); + grpc_metadata_array_init(&request_metadata_recv); + grpc_call_details_init(&call_details); + + memset(ops, 0, sizeof(ops)); + op = ops; + 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->flags = 0; + op->reserved = nullptr; + op++; + error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), + nullptr); + GPR_ASSERT(GRPC_CALL_OK == error); + + error = + grpc_server_request_call(f.server, &s, &call_details, + &request_metadata_recv, f.cq, f.cq, tag(101)); + GPR_ASSERT(GRPC_CALL_OK == error); + CQ_EXPECT_COMPLETION(cqv, tag(101), 1); + cq_verify(cqv); + + peer = grpc_call_get_peer(s); + GPR_ASSERT(peer != nullptr); + gpr_free(peer); + peer = grpc_call_get_peer(c); + GPR_ASSERT(peer != nullptr); + gpr_free(peer); + + memset(ops, 0, sizeof(ops)); + op = ops; + 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_STATUS_FROM_SERVER; + op->data.send_status_from_server.trailing_metadata_count = 0; + op->data.send_status_from_server.status = GRPC_STATUS_OK; + op->data.send_status_from_server.status_details = nullptr; + op->flags = 0; + op->reserved = nullptr; + op++; + op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; + op->data.recv_close_on_server.cancelled = &was_cancelled; + op->flags = 0; + op->reserved = nullptr; + op++; + error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), + nullptr); + GPR_ASSERT(GRPC_CALL_OK == error); + + CQ_EXPECT_COMPLETION(cqv, tag(102), 1); + CQ_EXPECT_COMPLETION(cqv, tag(1), 1); + cq_verify(cqv); + + GPR_ASSERT(status == GRPC_STATUS_OK); + GPR_ASSERT(GRPC_SLICE_LENGTH(details) == 0); + GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo")); + GPR_ASSERT(0 == call_details.flags); + GPR_ASSERT(was_cancelled == 0); + + grpc_slice_unref(details); + 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(c); + grpc_call_unref(s); + + cq_verifier_destroy(cqv); +} + +static void test_no_error_on_hotpath_one_request( + grpc_end2end_test_config config) { + grpc_end2end_test_fixture f; + + f = begin_test(config, "test_invoke_simple_request_with_no_error_logging", + nullptr, nullptr); + // First RPC is not considered the hotpath, since there are lots of things to + // set up. + simple_request_body(config, f); + grpc_disable_error_creation(); + simple_request_body(config, f); + grpc_enable_error_creation(); + end_test(&f); + config.tear_down_data(&f); +} + +static void test_no_error_on_hotpath_10_requests( + grpc_end2end_test_config config) { + int i; + grpc_end2end_test_fixture f = begin_test( + config, "test_no_error_on_hotpath_in_one_request", nullptr, nullptr); + // First RPC is not considered the hotpath, since there are lots of things to + // set up. + simple_request_body(config, f); + grpc_disable_error_creation(); + for (i = 0; i < 10; i++) { + simple_request_body(config, f); + } + grpc_enable_error_creation(); + end_test(&f); + config.tear_down_data(&f); +} + +void no_error_on_hotpath(grpc_end2end_test_config config) { + test_no_error_on_hotpath_one_request(config); + test_no_error_on_hotpath_10_requests(config); +} + +void no_error_on_hotpath_pre_init(void) {} 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..ac10494631 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); } } @@ -267,7 +267,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; diff --git a/test/core/iomgr/fd_posix_test.cc b/test/core/iomgr/fd_posix_test.cc index b81c73b2c0..4a625dd906 100644 --- a/test/core/iomgr/fd_posix_test.cc +++ b/test/core/iomgr/fd_posix_test.cc @@ -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, @@ -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 */ diff --git a/test/core/iomgr/pollset_set_test.cc b/test/core/iomgr/pollset_set_test.cc index 0dc75a5f3f..e2e63b2918 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]); } } 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/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index 60238e930d..3c1d48cc1e 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -1209,8 +1209,13 @@ TEST_P(End2endTest, ExpectErrorTest) { std::vector<ErrorStatus> expected_status; expected_status.emplace_back(); expected_status.back().set_code(13); // INTERNAL + // No Error message or details + + expected_status.emplace_back(); + expected_status.back().set_code(13); // INTERNAL expected_status.back().set_error_message("text error message"); expected_status.back().set_binary_error_details("text error details"); + expected_status.emplace_back(); expected_status.back().set_code(13); // INTERNAL expected_status.back().set_error_message("text error message"); diff --git a/test/cpp/microbenchmarks/bm_pollset.cc b/test/cpp/microbenchmarks/bm_pollset.cc index bcb68ff229..a4383b83cb 100644 --- a/test/cpp/microbenchmarks/bm_pollset.cc +++ b/test/cpp/microbenchmarks/bm_pollset.cc @@ -141,7 +141,7 @@ 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(); @@ -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( diff --git a/test/cpp/naming/gen_build_yaml.py b/test/cpp/naming/gen_build_yaml.py index eb2c01e7ad..baa6512f62 100755 --- a/test/cpp/naming/gen_build_yaml.py +++ b/test/cpp/naming/gen_build_yaml.py @@ -22,6 +22,7 @@ import collections import hashlib import json +_LOCAL_DNS_SERVER_ADDRESS = '127.0.0.1:15353' def _append_zone_name(name, zone_name): return '%s.%s' % (name, zone_name) diff --git a/test/cpp/naming/resolver_component_tests_runner.py b/test/cpp/naming/resolver_component_tests_runner.py index d4d904b9a8..69386ebeb0 100755 --- a/test/cpp/naming/resolver_component_tests_runner.py +++ b/test/cpp/naming/resolver_component_tests_runner.py @@ -58,7 +58,7 @@ def wait_until_dns_server_is_up(args, test_runner_log('Health check: attempt to connect to DNS server over TCP.') tcp_connect_subprocess = subprocess.Popen([ args.tcp_connect_bin_path, - '--server_host', '::1', + '--server_host', '127.0.0.1', '--server_port', str(args.dns_server_port), '--timeout', str(1)]) tcp_connect_subprocess.communicate() @@ -68,7 +68,7 @@ def wait_until_dns_server_is_up(args, dns_resolver_subprocess = subprocess.Popen([ args.dns_resolver_bin_path, '--qname', 'health-check-local-dns-server-is-alive.resolver-tests.grpctestingexp', - '--server_host', '::1', + '--server_host', '127.0.0.1', '--server_port', str(args.dns_server_port)], stdout=subprocess.PIPE) dns_resolver_stdout, _ = dns_resolver_subprocess.communicate() @@ -119,7 +119,7 @@ current_test_subprocess = subprocess.Popen([ '--expected_addrs', '1.2.3.4:1234,True', '--expected_chosen_service_config', '', '--expected_lb_policy', '', - '--local_dns_server_address', '[::1]:%d' % args.dns_server_port]) + '--local_dns_server_address', '127.0.0.1:%d' % args.dns_server_port]) current_test_subprocess.communicate() if current_test_subprocess.returncode != 0: num_test_failures += 1 @@ -131,7 +131,7 @@ current_test_subprocess = subprocess.Popen([ '--expected_addrs', '1.2.3.5:1234,True;1.2.3.6:1234,True;1.2.3.7:1234,True', '--expected_chosen_service_config', '', '--expected_lb_policy', '', - '--local_dns_server_address', '[::1]:%d' % args.dns_server_port]) + '--local_dns_server_address', '127.0.0.1:%d' % args.dns_server_port]) current_test_subprocess.communicate() if current_test_subprocess.returncode != 0: num_test_failures += 1 @@ -143,7 +143,7 @@ current_test_subprocess = subprocess.Popen([ '--expected_addrs', '[2607:f8b0:400a:801::1001]:1234,True', '--expected_chosen_service_config', '', '--expected_lb_policy', '', - '--local_dns_server_address', '[::1]:%d' % args.dns_server_port]) + '--local_dns_server_address', '127.0.0.1:%d' % args.dns_server_port]) current_test_subprocess.communicate() if current_test_subprocess.returncode != 0: num_test_failures += 1 @@ -155,7 +155,7 @@ current_test_subprocess = subprocess.Popen([ '--expected_addrs', '[2607:f8b0:400a:801::1002]:1234,True;[2607:f8b0:400a:801::1003]:1234,True;[2607:f8b0:400a:801::1004]:1234,True', '--expected_chosen_service_config', '', '--expected_lb_policy', '', - '--local_dns_server_address', '[::1]:%d' % args.dns_server_port]) + '--local_dns_server_address', '127.0.0.1:%d' % args.dns_server_port]) current_test_subprocess.communicate() if current_test_subprocess.returncode != 0: num_test_failures += 1 @@ -167,7 +167,7 @@ current_test_subprocess = subprocess.Popen([ '--expected_addrs', '1.2.3.4:1234,True', '--expected_chosen_service_config', '{"loadBalancingPolicy":"round_robin","methodConfig":[{"name":[{"method":"Foo","service":"SimpleService","waitForReady":true}]}]}', '--expected_lb_policy', 'round_robin', - '--local_dns_server_address', '[::1]:%d' % args.dns_server_port]) + '--local_dns_server_address', '127.0.0.1:%d' % args.dns_server_port]) current_test_subprocess.communicate() if current_test_subprocess.returncode != 0: num_test_failures += 1 @@ -179,7 +179,7 @@ current_test_subprocess = subprocess.Popen([ '--expected_addrs', '1.2.3.4:443,False', '--expected_chosen_service_config', '{"loadBalancingPolicy":"round_robin","methodConfig":[{"name":[{"method":"Foo","service":"NoSrvSimpleService","waitForReady":true}]}]}', '--expected_lb_policy', 'round_robin', - '--local_dns_server_address', '[::1]:%d' % args.dns_server_port]) + '--local_dns_server_address', '127.0.0.1:%d' % args.dns_server_port]) current_test_subprocess.communicate() if current_test_subprocess.returncode != 0: num_test_failures += 1 @@ -191,7 +191,7 @@ current_test_subprocess = subprocess.Popen([ '--expected_addrs', '1.2.3.4:443,False', '--expected_chosen_service_config', '', '--expected_lb_policy', '', - '--local_dns_server_address', '[::1]:%d' % args.dns_server_port]) + '--local_dns_server_address', '127.0.0.1:%d' % args.dns_server_port]) current_test_subprocess.communicate() if current_test_subprocess.returncode != 0: num_test_failures += 1 @@ -203,7 +203,7 @@ current_test_subprocess = subprocess.Popen([ '--expected_addrs', '1.2.3.4:443,False', '--expected_chosen_service_config', '', '--expected_lb_policy', '', - '--local_dns_server_address', '[::1]:%d' % args.dns_server_port]) + '--local_dns_server_address', '127.0.0.1:%d' % args.dns_server_port]) current_test_subprocess.communicate() if current_test_subprocess.returncode != 0: num_test_failures += 1 @@ -215,7 +215,7 @@ current_test_subprocess = subprocess.Popen([ '--expected_addrs', '1.2.3.4:443,False', '--expected_chosen_service_config', '{"loadBalancingPolicy":"round_robin","methodConfig":[{"name":[{"method":"Foo","service":"CppService","waitForReady":true}]}]}', '--expected_lb_policy', 'round_robin', - '--local_dns_server_address', '[::1]:%d' % args.dns_server_port]) + '--local_dns_server_address', '127.0.0.1:%d' % args.dns_server_port]) current_test_subprocess.communicate() if current_test_subprocess.returncode != 0: num_test_failures += 1 @@ -227,7 +227,7 @@ current_test_subprocess = subprocess.Popen([ '--expected_addrs', '1.2.3.4:443,False', '--expected_chosen_service_config', '{"loadBalancingPolicy":"round_robin","methodConfig":[{"name":[{"method":"Foo","service":"AlwaysPickedService","waitForReady":true}]}]}', '--expected_lb_policy', 'round_robin', - '--local_dns_server_address', '[::1]:%d' % args.dns_server_port]) + '--local_dns_server_address', '127.0.0.1:%d' % args.dns_server_port]) current_test_subprocess.communicate() if current_test_subprocess.returncode != 0: num_test_failures += 1 @@ -239,7 +239,7 @@ current_test_subprocess = subprocess.Popen([ '--expected_addrs', '1.2.3.4:1234,True;1.2.3.4:443,False', '--expected_chosen_service_config', '', '--expected_lb_policy', '', - '--local_dns_server_address', '[::1]:%d' % args.dns_server_port]) + '--local_dns_server_address', '127.0.0.1:%d' % args.dns_server_port]) current_test_subprocess.communicate() if current_test_subprocess.returncode != 0: num_test_failures += 1 @@ -251,7 +251,7 @@ current_test_subprocess = subprocess.Popen([ '--expected_addrs', '[2607:f8b0:400a:801::1002]:1234,True;[2607:f8b0:400a:801::1002]:443,False', '--expected_chosen_service_config', '', '--expected_lb_policy', '', - '--local_dns_server_address', '[::1]:%d' % args.dns_server_port]) + '--local_dns_server_address', '127.0.0.1:%d' % args.dns_server_port]) current_test_subprocess.communicate() if current_test_subprocess.returncode != 0: num_test_failures += 1 @@ -263,7 +263,7 @@ current_test_subprocess = subprocess.Popen([ '--expected_addrs', '1.2.3.4:443,False', '--expected_chosen_service_config', '{"loadBalancingPolicy":"round_robin","methodConfig":[{"name":[{"method":"Foo","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooTwo","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooThree","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooFour","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooFive","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooSix","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooSeven","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooEight","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooNine","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooTen","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooEleven","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooTwelve","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooTwelve","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooTwelve","service":"SimpleService","waitForReady":true}]},{"name":[{"method":"FooTwelve","service":"SimpleService","waitForReady":true}]}]}', '--expected_lb_policy', '', - '--local_dns_server_address', '[::1]:%d' % args.dns_server_port]) + '--local_dns_server_address', '127.0.0.1:%d' % args.dns_server_port]) current_test_subprocess.communicate() if current_test_subprocess.returncode != 0: num_test_failures += 1 diff --git a/test/cpp/naming/utils/dns_resolver.py b/test/cpp/naming/utils/dns_resolver.py index 21e37562db..74f4ca2351 100755 --- a/test/cpp/naming/utils/dns_resolver.py +++ b/test/cpp/naming/utils/dns_resolver.py @@ -25,7 +25,7 @@ import twisted.internet.reactor as reactor def main(): argp = argparse.ArgumentParser(description='Make DNS queries for A records') - argp.add_argument('-s', '--server_host', default='::1', type=str, + argp.add_argument('-s', '--server_host', default='127.0.0.1', type=str, help='Host for DNS server to listen on for TCP and UDP.') argp.add_argument('-p', '--server_port', default=53, type=int, help='Port that the DNS server is listening on.') diff --git a/test/cpp/naming/utils/dns_server.py b/test/cpp/naming/utils/dns_server.py index e198dd132d..1e8e2e3287 100755 --- a/test/cpp/naming/utils/dns_server.py +++ b/test/cpp/naming/utils/dns_server.py @@ -103,11 +103,11 @@ def start_local_dns_server(args): server = twisted.names.server.DNSServerFactory( authorities=[test_domain_com], verbose=2) server.noisy = 2 - twisted.internet.reactor.listenTCP(args.port, server, interface='::1') + twisted.internet.reactor.listenTCP(args.port, server) dns_proto = twisted.names.dns.DNSDatagramProtocol(server) dns_proto.noisy = 2 - twisted.internet.reactor.listenUDP(args.port, dns_proto, interface='::1') - print('starting local dns server on [::1]:%s' % args.port) + twisted.internet.reactor.listenUDP(args.port, dns_proto) + print('starting local dns server on 127.0.0.1:%s' % args.port) print('starting twisted.internet.reactor') twisted.internet.reactor.suggestThreadPoolSize(1) twisted.internet.reactor.run() diff --git a/test/cpp/util/grpc_tool.cc b/test/cpp/util/grpc_tool.cc index 195b6bd304..840ca07d2b 100644 --- a/test/cpp/util/grpc_tool.cc +++ b/test/cpp/util/grpc_tool.cc @@ -471,17 +471,26 @@ bool GrpcTool::CallMethod(int argc, const char** argv, std::shared_ptr<grpc::Channel> channel = grpc::CreateChannel(server_address, cred.GetCredentials()); - parser.reset(new grpc::testing::ProtoFileParser( - FLAGS_remotedb ? channel : nullptr, FLAGS_proto_path, FLAGS_protofiles)); + if (!FLAGS_binary_input || !FLAGS_binary_output) { + parser.reset( + new grpc::testing::ProtoFileParser(FLAGS_remotedb ? channel : nullptr, + FLAGS_proto_path, FLAGS_protofiles)); + if (parser->HasError()) { + fprintf( + stderr, + "Failed to find remote reflection service and local proto files.\n"); + return false; + } + } if (FLAGS_binary_input) { formatted_method_name = method_name; } else { formatted_method_name = parser->GetFormattedMethodName(method_name); - } - - if (parser->HasError()) { - return false; + if (parser->HasError()) { + fprintf(stderr, "Failed to find method %s in proto files.\n", + method_name.c_str()); + } } if (argc == 3) { @@ -711,6 +720,7 @@ bool GrpcTool::CallMethod(int argc, const char** argv, serialized_request_proto = parser->GetSerializedProtoFromMethod( method_name, request_text, true /* is_request */); if (parser->HasError()) { + fprintf(stderr, "Failed to parse request.\n"); return false; } } @@ -735,6 +745,7 @@ bool GrpcTool::CallMethod(int argc, const char** argv, serialized_response_proto = parser->GetTextFormatFromMethod( method_name, serialized_response_proto, false /* is_request */); if (parser->HasError()) { + fprintf(stderr, "Failed to parse response.\n"); return false; } } @@ -814,6 +825,9 @@ bool GrpcTool::ParseMessage(int argc, const char** argv, new grpc::testing::ProtoFileParser(FLAGS_remotedb ? channel : nullptr, FLAGS_proto_path, FLAGS_protofiles)); if (parser->HasError()) { + fprintf( + stderr, + "Failed to find remote reflection service and local proto files.\n"); return false; } } @@ -824,6 +838,7 @@ bool GrpcTool::ParseMessage(int argc, const char** argv, serialized_request_proto = parser->GetSerializedProtoFromMessageType(type_name, message_text); if (parser->HasError()) { + fprintf(stderr, "Failed to serialize the message.\n"); return false; } } @@ -834,6 +849,7 @@ bool GrpcTool::ParseMessage(int argc, const char** argv, grpc::string output_text = parser->GetTextFormatFromMessageType( type_name, serialized_request_proto); if (parser->HasError()) { + fprintf(stderr, "Failed to deserialize the message.\n"); return false; } output_ss << output_text << std::endl; diff --git a/test/distrib/csharp/DistribTest/packages.config b/test/distrib/csharp/DistribTest/packages.config index 84be8f76b5..3cb2c46bcf 100644 --- a/test/distrib/csharp/DistribTest/packages.config +++ b/test/distrib/csharp/DistribTest/packages.config @@ -6,6 +6,7 @@ <package id="Grpc" version="__GRPC_NUGET_VERSION__" targetFramework="net45" /> <package id="Grpc.Auth" version="__GRPC_NUGET_VERSION__" targetFramework="net45" /> <package id="Grpc.Core" version="__GRPC_NUGET_VERSION__" targetFramework="net45" /> + <package id="Grpc.Tools" version="__GRPC_NUGET_VERSION__" targetFramework="net45" /> <package id="System.Interactive.Async" version="3.0.0" targetFramework="net45" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" /> </packages>
\ No newline at end of file diff --git a/test/distrib/csharp/run_distrib_test.sh b/test/distrib/csharp/run_distrib_test.sh index eee24d0e57..f9371410e7 100755 --- a/test/distrib/csharp/run_distrib_test.sh +++ b/test/distrib/csharp/run_distrib_test.sh @@ -26,3 +26,6 @@ nuget restore xbuild DistribTest.sln mono DistribTest/bin/Debug/DistribTest.exe + +# test that codegen work +test_codegen/test_codegen.sh diff --git a/test/distrib/csharp/test_codegen/test_codegen.sh b/test/distrib/csharp/test_codegen/test_codegen.sh new file mode 100755 index 0000000000..fa101889f6 --- /dev/null +++ b/test/distrib/csharp/test_codegen/test_codegen.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# 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. + +set -ex + +cd "$(dirname "$0")" + +ls -lR "../packages/Grpc.Tools.__GRPC_NUGET_VERSION__/tools" + +PLATFORM_ARCH=linux_x64 +if [ "$(uname)" == "Darwin" ] +then + PLATFORM_ARCH=macosx_x64 +elif [ "$(getconf LONG_BIT)" == "32" ] +then + PLATFORM_ARCH=linux_x86 +fi + +PROTOC=../packages/Grpc.Tools.__GRPC_NUGET_VERSION__/tools/${PLATFORM_ARCH}/protoc +PLUGIN=../packages/Grpc.Tools.__GRPC_NUGET_VERSION__/tools/${PLATFORM_ARCH}/grpc_csharp_plugin + +"${PROTOC}" --plugin="protoc-gen-grpc=${PLUGIN}" --csharp_out=. --grpc_out=. -I . testcodegen.proto + +ls ./*.cs + +echo 'Code generation works.' diff --git a/test/distrib/csharp/test_codegen/testcodegen.proto b/test/distrib/csharp/test_codegen/testcodegen.proto new file mode 100644 index 0000000000..5c228b81db --- /dev/null +++ b/test/distrib/csharp/test_codegen/testcodegen.proto @@ -0,0 +1,29 @@ +// 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. + +syntax = "proto3"; + +package testcodegen; + +service Greeter { + rpc SayHello (HelloRequest) returns (HelloReply) {} +} + +message HelloRequest { + string name = 1; +} + +message HelloReply { + string message = 1; +} diff --git a/test/distrib/csharp/update_version.sh b/test/distrib/csharp/update_version.sh index 9759cc5648..0e47ed3abd 100755 --- a/test/distrib/csharp/update_version.sh +++ b/test/distrib/csharp/update_version.sh @@ -28,4 +28,4 @@ then fi # Replaces version placeholder with value provided as first argument. -sed -ibak "s/__GRPC_NUGET_VERSION__/${CSHARP_VERSION}/g" DistribTest/packages.config DistribTest/DistribTest.csproj DistribTest/DistribTestDotNet.csproj +sed -ibak "s/__GRPC_NUGET_VERSION__/${CSHARP_VERSION}/g" DistribTest/packages.config DistribTest/DistribTest.csproj DistribTest/DistribTestDotNet.csproj test_codegen/test_codegen.sh diff --git a/tools/distrib/pylint_code.sh b/tools/distrib/pylint_code.sh index 013b6660eb..82a818cce5 100755 --- a/tools/distrib/pylint_code.sh +++ b/tools/distrib/pylint_code.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2017 gRPC authors. +# Copyright 2017 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. @@ -35,14 +35,15 @@ python -m virtualenv $VIRTUALENV PYTHON=$VIRTUALENV/bin/python $PYTHON -m pip install --upgrade pip==10.0.1 -$PYTHON -m pip install pylint==1.6.5 +$PYTHON -m pip install pylint==1.9.2 +EXIT=0 for dir in "${DIRS[@]}"; do - $PYTHON -m pylint --rcfile=.pylintrc -rn "$dir" || exit $? + $PYTHON -m pylint --rcfile=.pylintrc -rn "$dir" || EXIT=1 done for dir in "${TEST_DIRS[@]}"; do - $PYTHON -m pylint --rcfile=.pylintrc-tests -rn "$dir" || exit $? + $PYTHON -m pylint --rcfile=.pylintrc-tests -rn "$dir" || EXIT=1 done -exit 0 +exit $EXIT 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/dockerfile/distribtest/csharp_centos7_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_centos7_x64/Dockerfile index 088635b0ea..3e1faafdc0 100644 --- a/tools/dockerfile/distribtest/csharp_centos7_x64/Dockerfile +++ b/tools/dockerfile/distribtest/csharp_centos7_x64/Dockerfile @@ -14,21 +14,11 @@ FROM centos:7 -RUN rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" -RUN yum-config-manager --add-repo http://download.mono-project.com/repo/centos/ +RUN rpm --import "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" +RUN curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo -RUN yum install -y mono +RUN yum install -y mono-devel -RUN yum install -y unzip - -# --nogpgcheck because nuget-2.12 package is not signed. -RUN yum install -y nuget --nogpgcheck +RUN yum install -y nuget -# Help mono correctly locate libMonoPosixHelper.so -# as a workaround for issue https://bugzilla.xamarin.com/show_bug.cgi?id=42820 -# The error message you'll get without this workaround: -# ``` -# WARNING: /usr/lib/libMonoPosixHelper.so -# WARNING: Unable to read package from path 'Grpc.1.1.0-dev.nupkg'. -# ``` -RUN cp /usr/lib64/libMonoPosixHelper.so /usr/lib/ +RUN yum install -y unzip diff --git a/tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile index 02ec4c278a..03fb7a5343 100644 --- a/tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile +++ b/tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile @@ -14,14 +14,13 @@ FROM debian:jessie +RUN apt-get update && apt-get install -y apt-transport-https && apt-get clean + RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF -RUN echo "deb http://download.mono-project.com/repo/debian jessie main" | tee /etc/apt/sources.list.d/mono-official.list -RUN echo "deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list -RUN echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list +RUN echo "deb https://download.mono-project.com/repo/debian stable-jessie main" | tee /etc/apt/sources.list.d/mono-official-stable.list RUN apt-get update && apt-get install -y \ mono-devel \ - ca-certificates-mono \ nuget \ && apt-get clean diff --git a/tools/dockerfile/distribtest/csharp_jessie_x86/Dockerfile b/tools/dockerfile/distribtest/csharp_jessie_x86/Dockerfile index 758f314572..f2fa61a691 100644 --- a/tools/dockerfile/distribtest/csharp_jessie_x86/Dockerfile +++ b/tools/dockerfile/distribtest/csharp_jessie_x86/Dockerfile @@ -14,14 +14,13 @@ FROM 32bit/debian:jessie +RUN apt-get update && apt-get install -y apt-transport-https && apt-get clean + RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF -RUN echo "deb http://download.mono-project.com/repo/debian jessie main" | tee /etc/apt/sources.list.d/mono-official.list -RUN echo "deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list -RUN echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list +RUN echo "deb https://download.mono-project.com/repo/debian stable-jessie main" | tee /etc/apt/sources.list.d/mono-official-stable.list RUN apt-get update && apt-get install -y \ mono-devel \ - ca-certificates-mono \ nuget \ && apt-get clean diff --git a/tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile index 10279c5925..3edc31e170 100644 --- a/tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile +++ b/tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile @@ -14,15 +14,17 @@ FROM ubuntu:14.04 -RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF -RUN echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list +RUN apt-get update && apt-get install -y apt-transport-https && apt-get clean + +RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF +RUN echo "deb https://download.mono-project.com/repo/ubuntu stable-trusty main" | tee /etc/apt/sources.list.d/mono-official-stable.list RUN apt-get update && apt-get install -y \ mono-devel \ - ca-certificates-mono \ - nuget + nuget \ + && apt-get clean -RUN apt-get update && apt-get install -y unzip +RUN apt-get update && apt-get install -y unzip && apt-get clean # Install dotnet CLI RUN apt-get install -y apt-transport-https diff --git a/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile index 0f40f18e38..1a58f9784b 100644 --- a/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile +++ b/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile @@ -14,19 +14,14 @@ FROM ubuntu:16.04 +RUN apt-get update && apt-get install -y apt-transport-https && apt-get clean + +RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF +RUN echo "deb https://download.mono-project.com/repo/ubuntu stable-xenial main" | tee /etc/apt/sources.list.d/mono-official-stable.list + RUN apt-get update && apt-get install -y \ mono-devel \ - ca-certificates-mono \ nuget \ && apt-get clean -# make sure we have nuget 2.12+ (in case there's an older cached docker image) -RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF -RUN echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list -RUN apt-get update && apt-get install -y nuget && apt-get clean - -# Prevent "Error: SendFailure (Error writing headers)" when fetching nuget packages -# See https://github.com/tianon/docker-brew-ubuntu-core/issues/86 -RUN apt-get update && apt-get install -y tzdata && apt-get clean - RUN apt-get update && apt-get install -y unzip && apt-get clean diff --git a/tools/dockerfile/distribtest/csharp_wheezy_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_wheezy_x64/Dockerfile deleted file mode 100644 index fb9c82c92b..0000000000 --- a/tools/dockerfile/distribtest/csharp_wheezy_x64/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2015 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM mono:4.4.2.11 - -# make sure we have nuget 2.12+ (in case there's an older cached docker image) -RUN apt-get update && apt-get install -y nuget - -RUN apt-get update && apt-get install -y unzip diff --git a/tools/profiling/ios_bin/binary_diff.py b/tools/profiling/ios_bin/binary_diff.py new file mode 100755 index 0000000000..6d5ae65e46 --- /dev/null +++ b/tools/profiling/ios_bin/binary_diff.py @@ -0,0 +1,127 @@ +#!/usr/bin/env python2.7 +# +# Copyright 2018 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import argparse +import glob +import multiprocessing +import os +import shutil +import subprocess +import sys +from parse_link_map import parse_link_map + +sys.path.append( + os.path.join( + os.path.dirname(sys.argv[0]), '..', '..', 'run_tests', 'python_utils')) +import comment_on_pr + +size_labels = ('Core', 'ObjC', 'BoringSSL', 'Protobuf', 'Total') + +argp = argparse.ArgumentParser( + description='Binary size diff of gRPC Objective-C sample') + +argp.add_argument( + '-d', + '--diff_base', + type=str, + help='Commit or branch to compare the current one to') + +args = argp.parse_args() + + +def dir_size(dir): + total = 0 + for dirpath, dirnames, filenames in os.walk(dir): + for f in filenames: + fp = os.path.join(dirpath, f) + total += os.stat(fp).st_size + return total + + +def get_size(where, frameworks): + build_dir = 'src/objective-c/examples/Sample/Build-%s/' % where + if not frameworks: + link_map_filename = 'Build/Intermediates.noindex/Sample.build/Release-iphoneos/Sample.build/Sample-LinkMap-normal-arm64.txt' + return parse_link_map(build_dir + link_map_filename) + else: + framework_dir = 'Build/Products/Release-iphoneos/Sample.app/Frameworks/' + boringssl_size = dir_size( + build_dir + framework_dir + 'openssl.framework') + core_size = dir_size(build_dir + framework_dir + 'grpc.framework') + objc_size = dir_size(build_dir + framework_dir + 'GRPCClient.framework') + \ + dir_size(build_dir + framework_dir + 'RxLibrary.framework') + \ + dir_size(build_dir + framework_dir + 'ProtoRPC.framework') + protobuf_size = dir_size( + build_dir + framework_dir + 'Protobuf.framework') + app_size = dir_size( + build_dir + 'Build/Products/Release-iphoneos/Sample.app') + return core_size, objc_size, boringssl_size, protobuf_size, app_size + + +def build(where, frameworks): + shutil.rmtree( + 'src/objective-c/examples/Sample/Build-%s' % where, ignore_errors=True) + subprocess.check_call( + 'CONFIG=opt EXAMPLE_PATH=src/objective-c/examples/Sample SCHEME=Sample FRAMEWORKS=%s ./build_one_example.sh' + % ('YES' if frameworks else 'NO'), + shell=True, + cwd='src/objective-c/tests') + os.rename('src/objective-c/examples/Sample/Build', + 'src/objective-c/examples/Sample/Build-%s' % where) + + +text = '' +for frameworks in [False, True]: + build('new', frameworks) + new_size = get_size('new', frameworks) + old_size = None + + if args.diff_base: + old = 'old' + where_am_i = subprocess.check_output( + ['git', 'rev-parse', '--abbrev-ref', 'HEAD']).strip() + subprocess.check_call(['git', 'checkout', '--', '.']) + subprocess.check_call(['git', 'checkout', args.diff_base]) + subprocess.check_call(['git', 'submodule', 'update']) + try: + build('old', frameworks) + old_size = get_size('old', frameworks) + finally: + subprocess.check_call(['git', 'checkout', '--', '.']) + subprocess.check_call(['git', 'checkout', where_am_i]) + subprocess.check_call(['git', 'submodule', 'update']) + + text += ('****************FRAMEWORKS*****************\n' + if frameworks else '******************STATIC*******************\n') + row_format = "{:>10}{:>15}{:>15}" + '\n' + text += row_format.format('New size', '', 'Old size') + for i in range(0, len(size_labels)): + if old_size == None: + diff_sign = ' ' + elif new_size[i] == old_size[i]: + diff_sign = ' (=)' + elif new_size[i] > old_size[i]: + diff_sign = ' (>)' + else: + diff_sign = ' (<)' + text += ('\n' if i == len(size_labels) - 1 else '') + row_format.format( + '{:,}'.format(new_size[i]), size_labels[i] + diff_sign, + '{:,}'.format(old_size[i]) if old_size != None else '') + text += '\n' + +print text + +comment_on_pr.comment_on_pr('```\n%s\n```' % text) diff --git a/tools/profiling/ios_bin/parse_link_map.py b/tools/profiling/ios_bin/parse_link_map.py new file mode 100755 index 0000000000..eaa1d6e060 --- /dev/null +++ b/tools/profiling/ios_bin/parse_link_map.py @@ -0,0 +1,104 @@ +#!/usr/bin/python +# Copyright 2018 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This script analyzes link map file generated by Xcode. It calculates and +# prints out the sizes of each dependent library and the total sizes of the +# symbols. +# The script takes one parameter, which is the path to the link map file. + +import sys +import re + + +def parse_link_map(filename): + table_tag = {} + state = "start" + + table_stats_symbol = {} + table_stats_dead = {} + section_total_size = 0 + symbol_total_size = 0 + + boringssl_size = 0 + core_size = 0 + objc_size = 0 + protobuf_size = 0 + + lines = list(open(filename)) + for line in lines: + line_stripped = line[:-1] + if "# Object files:" == line_stripped: + state = "object" + continue + elif "# Sections:" == line_stripped: + state = "section" + continue + elif "# Symbols:" == line_stripped: + state = "symbol" + continue + elif "# Dead Stripped Symbols:" == line_stripped: + state = "dead" + continue + + if state == "object": + segs = re.search('(\[ *[0-9]*\]) (.*)', line_stripped) + table_tag[segs.group(1)] = segs.group(2) + + if state == "section": + if len(line_stripped) == 0 or line_stripped[0] == '#': + continue + segs = re.search('^(.+?)\s+(.+?)\s+.*', line_stripped) + section_total_size += int(segs.group(2), 16) + + if state == "symbol": + if len(line_stripped) == 0 or line_stripped[0] == '#': + continue + segs = re.search('^.+?\s+(.+?)\s+(\[.+?\]).*', line_stripped) + target = table_tag[segs.group(2)] + target_stripped = re.search('^(.*?)(\(.+?\))?$', target).group(1) + size = int(segs.group(1), 16) + if not target_stripped in table_stats_symbol: + table_stats_symbol[target_stripped] = 0 + table_stats_symbol[target_stripped] += size + if 'BoringSSL' in target_stripped: + boringssl_size += size + elif 'libgRPC-Core' in target_stripped: + core_size += size + elif 'libgRPC-RxLibrary' in target_stripped or \ + 'libgRPC' in target_stripped or \ + 'libgRPC-ProtoLibrary' in target_stripped: + objc_size += size + elif 'libProtobuf' in target_stripped: + protobuf_size += size + + for target in table_stats_symbol: + symbol_total_size += table_stats_symbol[target] + + return core_size, objc_size, boringssl_size, protobuf_size, symbol_total_size + + +def main(): + filename = sys.argv[1] + core_size, objc_size, boringssl_size, protobuf_size, total_size = parse_link_map( + filename) + print('Core size:{:,}'.format(core_size)) + print('ObjC size:{:,}'.format(objc_size)) + print('BoringSSL size:{:,}'.format(boringssl_size)) + print('Protobuf size:{:,}\n'.format(protobuf_size)) + print('Total size:{:,}'.format(total_size)) + + +if __name__ == "__main__": + main() diff --git a/tools/run_tests/artifacts/distribtest_targets.py b/tools/run_tests/artifacts/distribtest_targets.py index 213325439e..e02f4bffcd 100644 --- a/tools/run_tests/artifacts/distribtest_targets.py +++ b/tools/run_tests/artifacts/distribtest_targets.py @@ -303,7 +303,6 @@ def targets(): CppDistribTest('linux', 'x64', 'jessie', 'cmake_as_submodule'), CppDistribTest('windows', 'x86', testcase='cmake'), CppDistribTest('windows', 'x86', testcase='cmake_as_externalproject'), - CSharpDistribTest('linux', 'x64', 'wheezy'), CSharpDistribTest('linux', 'x64', 'jessie'), CSharpDistribTest('linux', 'x86', 'jessie'), CSharpDistribTest('linux', 'x64', 'centos7'), diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index ae7c65dc45..4b5f7d51ea 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -8766,6 +8766,7 @@ "test/core/end2end/tests/max_message_length.cc", "test/core/end2end/tests/negative_deadline.cc", "test/core/end2end/tests/network_status_change.cc", + "test/core/end2end/tests/no_error_on_hotpath.cc", "test/core/end2end/tests/no_logging.cc", "test/core/end2end/tests/no_op.cc", "test/core/end2end/tests/payload.cc", @@ -8865,6 +8866,7 @@ "test/core/end2end/tests/max_message_length.cc", "test/core/end2end/tests/negative_deadline.cc", "test/core/end2end/tests/network_status_change.cc", + "test/core/end2end/tests/no_error_on_hotpath.cc", "test/core/end2end/tests/no_logging.cc", "test/core/end2end/tests/no_op.cc", "test/core/end2end/tests/payload.cc", diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index 6128f36b07..f1276fdb2e 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -7820,6 +7820,29 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_census_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -9572,6 +9595,29 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_compress_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -11265,6 +11311,28 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "windows", + "linux", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_fakesec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -12835,6 +12903,29 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_fd_test", + "platforms": [ + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -14173,6 +14264,29 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_full_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -15777,6 +15891,25 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -17346,6 +17479,29 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_op" ], "ci_platforms": [ @@ -19075,6 +19231,29 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_full+workarounds_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -20859,6 +21038,30 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "windows", + "linux", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_http_proxy_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -22675,6 +22878,29 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_load_reporting_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -24459,6 +24685,30 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "windows", + "linux", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_oauth2_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -27315,6 +27565,30 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "windows", + "linux", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_sockpair_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -28539,6 +28813,30 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "windows", + "linux", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_sockpair+trace_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_op" ], "ci_platforms": [ @@ -29799,6 +30097,32 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "windows", + "linux", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [ + "msan" + ], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_sockpair_1byte_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -31177,6 +31501,29 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_ssl_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -34055,6 +34402,29 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_uds_test", + "platforms": [ + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -35527,6 +35897,29 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "inproc_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -36727,6 +37120,29 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_census_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -38456,6 +38872,29 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_compress_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -40020,6 +40459,29 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_fd_nosec_test", + "platforms": [ + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -41335,6 +41797,29 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_full_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -42920,6 +43405,25 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -44466,6 +44970,29 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_op" ], "ci_platforms": [ @@ -46172,6 +46699,29 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_full+workarounds_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -47932,6 +48482,30 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "windows", + "linux", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_http_proxy_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -49725,6 +50299,29 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_load_reporting_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -52493,6 +53090,30 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "windows", + "linux", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_sockpair_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -53693,6 +54314,30 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "windows", + "linux", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_sockpair+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_op" ], "ci_platforms": [ @@ -54927,6 +55572,32 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "windows", + "linux", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [ + "msan" + ], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_sockpair_1byte_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -56232,6 +56903,29 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_uds_nosec_test", + "platforms": [ + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ @@ -57681,6 +58375,29 @@ }, { "args": [ + "no_error_on_hotpath" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "inproc_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ "no_logging" ], "ci_platforms": [ 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: |