diff --git a/.gitignore b/.gitignore index 5e38f5fa01b..ad3ec64ab5a 100644 --- a/.gitignore +++ b/.gitignore @@ -118,13 +118,3 @@ gdb.txt # ctags file tags - -# perf data -perf.data -perf.data.old - -# bm_diff -bm_diff_new/ -bm_diff_old/ -bm_*.json - diff --git a/BUILD b/BUILD index a919a6328a5..4087216a5d1 100644 --- a/BUILD +++ b/BUILD @@ -35,15 +35,14 @@ exports_files(["LICENSE"]) package(default_visibility = ["//visibility:public"]) -load("//bazel:grpc_build_system.bzl", "grpc_cc_library", - "grpc_proto_plugin", "grpc_cc_libraries") +load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_proto_plugin") # This should be updated along with build.yaml g_stands_for = "gentle" -core_version = "3.0.0-dev" +core_version = "3.0.0-pre1" -version = "1.4.0-dev" +version = "1.3.0-pre1" grpc_cc_library( name = "gpr", @@ -54,45 +53,30 @@ grpc_cc_library( ], ) -grpc_cc_libraries( - name_list = ["grpc", "grpc_unsecure",], +grpc_cc_library( + name = "grpc", srcs = [ "src/core/lib/surface/init.c", - ], - additional_src_list = [ - [ - "src/core/plugin_registry/grpc_plugin_registry.c", - ], - [ - "src/core/lib/surface/init_unsecure.c", - "src/core/plugin_registry/grpc_unsecure_plugin_registry.c", - ], + "src/core/plugin_registry/grpc_plugin_registry.c", ], language = "c", standalone = True, deps = [ "census", "grpc_base", + "grpc_lb_policy_grpclb_secure", "grpc_lb_policy_pick_first", "grpc_lb_policy_round_robin", "grpc_load_reporting", "grpc_max_age_filter", + "grpc_resolver_dns_ares", "grpc_resolver_dns_native", "grpc_resolver_sockaddr", + "grpc_secure", "grpc_transport_chttp2_client_insecure", + "grpc_transport_chttp2_client_secure", "grpc_transport_chttp2_server_insecure", - "grpc_message_size_filter", - "grpc_deadline_filter", - ], - additional_dep_list = [ - [ - "grpc_secure", - "grpc_resolver_dns_ares", - "grpc_lb_policy_grpclb_secure", - "grpc_transport_chttp2_client_secure", - "grpc_transport_chttp2_server_secure", - ], - [], + "grpc_transport_chttp2_server_secure", ], ) @@ -107,7 +91,30 @@ grpc_cc_library( "grpc_base", "grpc_transport_chttp2_client_secure", "grpc_transport_cronet_client_secure", - "grpc_http_filters", + ], +) + +grpc_cc_library( + name = "grpc_unsecure", + srcs = [ + "src/core/lib/surface/init.c", + "src/core/lib/surface/init_unsecure.c", + "src/core/plugin_registry/grpc_unsecure_plugin_registry.c", + ], + language = "c", + standalone = True, + deps = [ + "census", + "grpc_base", + "grpc_lb_policy_grpclb", + "grpc_lb_policy_pick_first", + "grpc_lb_policy_round_robin", + "grpc_load_reporting", + "grpc_max_age_filter", + "grpc_resolver_dns_native", + "grpc_resolver_sockaddr", + "grpc_transport_chttp2_client_insecure", + "grpc_transport_chttp2_server_insecure", ], ) @@ -151,7 +158,7 @@ grpc_cc_library( standalone = True, deps = [ "gpr", - "grpc++_base_unsecure", + "grpc++_base", "grpc++_codegen_base", "grpc++_codegen_base_src", "grpc_unsecure", @@ -444,10 +451,15 @@ grpc_cc_library( "src/core/lib/channel/channel_args.c", "src/core/lib/channel/channel_stack.c", "src/core/lib/channel/channel_stack_builder.c", + "src/core/lib/channel/compress_filter.c", "src/core/lib/channel/connected_channel.c", + "src/core/lib/channel/deadline_filter.c", "src/core/lib/channel/handshaker.c", "src/core/lib/channel/handshaker_factory.c", "src/core/lib/channel/handshaker_registry.c", + "src/core/lib/channel/http_client_filter.c", + "src/core/lib/channel/http_server_filter.c", + "src/core/lib/channel/message_size_filter.c", "src/core/lib/compression/compression.c", "src/core/lib/compression/message_compress.c", "src/core/lib/debug/trace.c", @@ -566,11 +578,16 @@ grpc_cc_library( "src/core/lib/channel/channel_args.h", "src/core/lib/channel/channel_stack.h", "src/core/lib/channel/channel_stack_builder.h", + "src/core/lib/channel/compress_filter.h", "src/core/lib/channel/connected_channel.h", "src/core/lib/channel/context.h", + "src/core/lib/channel/deadline_filter.h", "src/core/lib/channel/handshaker.h", "src/core/lib/channel/handshaker_factory.h", "src/core/lib/channel/handshaker_registry.h", + "src/core/lib/channel/http_client_filter.h", + "src/core/lib/channel/http_server_filter.h", + "src/core/lib/channel/message_size_filter.h", "src/core/lib/compression/algorithm_metadata.h", "src/core/lib/compression/message_compress.h", "src/core/lib/debug/trace.h", @@ -739,7 +756,6 @@ grpc_cc_library( language = "c", deps = [ "grpc_base", - "grpc_deadline_filter", ], ) @@ -757,53 +773,6 @@ grpc_cc_library( ], ) -grpc_cc_library( - name = "grpc_deadline_filter", - srcs = [ - "src/core/ext/filters/deadline/deadline_filter.c", - ], - hdrs = [ - "src/core/ext/filters/deadline/deadline_filter.h", - ], - language = "c", - deps = [ - "grpc_base", - ], -) - -grpc_cc_library( - name = "grpc_message_size_filter", - srcs = [ - "src/core/ext/filters/message_size/message_size_filter.c", - ], - hdrs = [ - "src/core/ext/filters/message_size/message_size_filter.h", - ], - language = "c", - deps = [ - "grpc_base", - ], -) - -grpc_cc_library( - name = "grpc_http_filters", - hdrs = [ - "src/core/ext/filters/http/message_compress/message_compress_filter.h", - "src/core/ext/filters/http/client/http_client_filter.h", - "src/core/ext/filters/http/server/http_server_filter.h", - ], - srcs = [ - "src/core/ext/filters/http/message_compress/message_compress_filter.c", - "src/core/ext/filters/http/client/http_client_filter.c", - "src/core/ext/filters/http/server/http_server_filter.c", - "src/core/ext/filters/http/http_filters_plugin.c" - ], - language = "c", - deps = [ - "grpc_base", - ], -) - grpc_cc_library( name = "grpc_codegen", language = "c", @@ -1066,7 +1035,6 @@ grpc_cc_library( deps = [ "grpc_base", "grpc_transport_chttp2_alpn", - "grpc_http_filters", ], ) @@ -1219,12 +1187,8 @@ grpc_cc_library( ], ) -grpc_cc_libraries( - name_list = ["grpc++_base", "grpc++_base_unsecure"], - additional_dep_list = [ - ["grpc", ], - ["grpc_unsecure", ], - ], +grpc_cc_library( + name = "grpc++_base", srcs = [ "src/cpp/client/channel_cc.cc", "src/cpp/client/client_context.cc", @@ -1259,7 +1223,7 @@ grpc_cc_libraries( "src/cpp/util/status.cc", "src/cpp/util/string_ref.cc", "src/cpp/util/time_cc.cc", - ], + ], hdrs = [ "src/cpp/client/create_channel_internal.h", "src/cpp/common/channel_filter.h", @@ -1268,7 +1232,7 @@ grpc_cc_libraries( "src/cpp/server/health/health.pb.h", "src/cpp/server/thread_pool_interface.h", "src/cpp/thread_manager/thread_manager.h", - ], + ], language = "c++", public_hdrs = [ "include/grpc++/alarm.h", @@ -1318,8 +1282,9 @@ grpc_cc_libraries( "include/grpc++/support/stub_options.h", "include/grpc++/support/sync_stream.h", "include/grpc++/support/time.h", - ], + ], deps = [ + "grpc", "grpc++_codegen_base", ], ) @@ -1353,6 +1318,7 @@ grpc_cc_library( "include/grpc++/impl/codegen/slice.h", "include/grpc++/impl/codegen/status.h", "include/grpc++/impl/codegen/status_code_enum.h", + "include/grpc++/impl/codegen/status_helper.h", "include/grpc++/impl/codegen/string_ref.h", "include/grpc++/impl/codegen/stub_options.h", "include/grpc++/impl/codegen/sync_stream.h", diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d7662031d1..81dba56b9ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,7 +39,7 @@ cmake_minimum_required(VERSION 2.8) set(PACKAGE_NAME "grpc") -set(PACKAGE_VERSION "1.4.0-dev") +set(PACKAGE_VERSION "1.3.0-pre1") set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/") @@ -269,10 +269,8 @@ if(NOT MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") endif() -if(_gRPC_PLATFORM_MAC) - set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} m pthread) -elseif(UNIX) - set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} rt m pthread) +if(UNIX) + set(_gRPC_ALLTARGETS_LIBRARIES dl rt m pthread) endif() if(WIN32 AND MSVC) @@ -393,7 +391,6 @@ add_dependencies(buildtests_c error_test) if(_gRPC_PLATFORM_LINUX) add_dependencies(buildtests_c ev_epoll_linux_test) endif() -add_dependencies(buildtests_c fake_resolver_test) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_dependencies(buildtests_c fd_conservation_posix_test) endif() @@ -474,7 +471,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_dependencies(buildtests_c memory_profile_test) endif() add_dependencies(buildtests_c message_compress_test) -add_dependencies(buildtests_c minimal_stack_is_minimal_test) add_dependencies(buildtests_c mlog_test) add_dependencies(buildtests_c multiple_server_queues_test) add_dependencies(buildtests_c murmur_hash_test) @@ -495,7 +491,6 @@ add_dependencies(buildtests_c sequential_connectivity_test) add_dependencies(buildtests_c server_chttp2_test) add_dependencies(buildtests_c server_test) add_dependencies(buildtests_c slice_buffer_test) -add_dependencies(buildtests_c slice_hash_table_test) add_dependencies(buildtests_c slice_string_helpers_test) add_dependencies(buildtests_c slice_test) add_dependencies(buildtests_c sockaddr_resolver_test) @@ -918,10 +913,15 @@ add_library(grpc src/core/lib/channel/channel_args.c src/core/lib/channel/channel_stack.c src/core/lib/channel/channel_stack_builder.c + src/core/lib/channel/compress_filter.c src/core/lib/channel/connected_channel.c + src/core/lib/channel/deadline_filter.c src/core/lib/channel/handshaker.c src/core/lib/channel/handshaker_factory.c src/core/lib/channel/handshaker_registry.c + src/core/lib/channel/http_client_filter.c + src/core/lib/channel/http_server_filter.c + src/core/lib/channel/message_size_filter.c src/core/lib/compression/compression.c src/core/lib/compression/message_compress.c src/core/lib/debug/trace.c @@ -1058,10 +1058,6 @@ add_library(grpc src/core/ext/transport/chttp2/transport/varint.c src/core/ext/transport/chttp2/transport/writing.c src/core/ext/transport/chttp2/alpn/alpn.c - src/core/ext/filters/http/client/http_client_filter.c - src/core/ext/filters/http/http_filters_plugin.c - src/core/ext/filters/http/message_compress/message_compress_filter.c - src/core/ext/filters/http/server/http_server_filter.c src/core/lib/http/httpcli_security_connector.c src/core/lib/security/context/security_context.c src/core/lib/security/credentials/composite/composite_credentials.c @@ -1111,7 +1107,6 @@ add_library(grpc src/core/ext/filters/client_channel/subchannel.c src/core/ext/filters/client_channel/subchannel_index.c src/core/ext/filters/client_channel/uri_parser.c - src/core/ext/filters/deadline/deadline_filter.c src/core/ext/transport/chttp2/client/chttp2_connector.c src/core/ext/transport/chttp2/server/insecure/server_chttp2.c src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c @@ -1148,7 +1143,6 @@ add_library(grpc src/core/ext/census/trace_context.c src/core/ext/census/tracing.c src/core/ext/filters/max_age/max_age_filter.c - src/core/ext/filters/message_size/message_size_filter.c src/core/plugin_registry/grpc_plugin_registry.c ) @@ -1243,10 +1237,15 @@ add_library(grpc_cronet src/core/lib/channel/channel_args.c src/core/lib/channel/channel_stack.c src/core/lib/channel/channel_stack_builder.c + src/core/lib/channel/compress_filter.c src/core/lib/channel/connected_channel.c + src/core/lib/channel/deadline_filter.c src/core/lib/channel/handshaker.c src/core/lib/channel/handshaker_factory.c src/core/lib/channel/handshaker_registry.c + src/core/lib/channel/http_client_filter.c + src/core/lib/channel/http_server_filter.c + src/core/lib/channel/message_size_filter.c src/core/lib/compression/compression.c src/core/lib/compression/message_compress.c src/core/lib/debug/trace.c @@ -1386,10 +1385,6 @@ add_library(grpc_cronet src/core/ext/transport/chttp2/transport/varint.c src/core/ext/transport/chttp2/transport/writing.c src/core/ext/transport/chttp2/alpn/alpn.c - src/core/ext/filters/http/client/http_client_filter.c - src/core/ext/filters/http/http_filters_plugin.c - src/core/ext/filters/http/message_compress/message_compress_filter.c - src/core/ext/filters/http/server/http_server_filter.c src/core/ext/filters/client_channel/channel_connectivity.c src/core/ext/filters/client_channel/client_channel.c src/core/ext/filters/client_channel/client_channel_factory.c @@ -1410,7 +1405,6 @@ add_library(grpc_cronet src/core/ext/filters/client_channel/subchannel.c src/core/ext/filters/client_channel/subchannel_index.c src/core/ext/filters/client_channel/uri_parser.c - src/core/ext/filters/deadline/deadline_filter.c src/core/lib/http/httpcli_security_connector.c src/core/lib/security/context/security_context.c src/core/lib/security/credentials/composite/composite_credentials.c @@ -1553,10 +1547,15 @@ add_library(grpc_test_util src/core/lib/channel/channel_args.c src/core/lib/channel/channel_stack.c src/core/lib/channel/channel_stack_builder.c + src/core/lib/channel/compress_filter.c src/core/lib/channel/connected_channel.c + src/core/lib/channel/deadline_filter.c src/core/lib/channel/handshaker.c src/core/lib/channel/handshaker_factory.c src/core/lib/channel/handshaker_registry.c + src/core/lib/channel/http_client_filter.c + src/core/lib/channel/http_server_filter.c + src/core/lib/channel/message_size_filter.c src/core/lib/compression/compression.c src/core/lib/compression/message_compress.c src/core/lib/debug/trace.c @@ -1809,10 +1808,15 @@ add_library(grpc_unsecure src/core/lib/channel/channel_args.c src/core/lib/channel/channel_stack.c src/core/lib/channel/channel_stack_builder.c + src/core/lib/channel/compress_filter.c src/core/lib/channel/connected_channel.c + src/core/lib/channel/deadline_filter.c src/core/lib/channel/handshaker.c src/core/lib/channel/handshaker_factory.c src/core/lib/channel/handshaker_registry.c + src/core/lib/channel/http_client_filter.c + src/core/lib/channel/http_server_filter.c + src/core/lib/channel/message_size_filter.c src/core/lib/compression/compression.c src/core/lib/compression/message_compress.c src/core/lib/debug/trace.c @@ -1950,10 +1954,6 @@ add_library(grpc_unsecure src/core/ext/transport/chttp2/transport/varint.c src/core/ext/transport/chttp2/transport/writing.c src/core/ext/transport/chttp2/alpn/alpn.c - src/core/ext/filters/http/client/http_client_filter.c - src/core/ext/filters/http/http_filters_plugin.c - src/core/ext/filters/http/message_compress/message_compress_filter.c - src/core/ext/filters/http/server/http_server_filter.c src/core/ext/transport/chttp2/server/chttp2_server.c src/core/ext/transport/chttp2/client/insecure/channel_create.c src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c @@ -1978,7 +1978,6 @@ add_library(grpc_unsecure src/core/ext/filters/client_channel/subchannel.c src/core/ext/filters/client_channel/subchannel_index.c src/core/ext/filters/client_channel/uri_parser.c - src/core/ext/filters/deadline/deadline_filter.c src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.c src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c @@ -2010,7 +2009,6 @@ add_library(grpc_unsecure src/core/ext/census/trace_context.c src/core/ext/census/tracing.c src/core/ext/filters/max_age/max_age_filter.c - src/core/ext/filters/message_size/message_size_filter.c src/core/plugin_registry/grpc_unsecure_plugin_registry.c ) @@ -2228,10 +2226,15 @@ add_library(grpc++ src/core/lib/channel/channel_args.c src/core/lib/channel/channel_stack.c src/core/lib/channel/channel_stack_builder.c + src/core/lib/channel/compress_filter.c src/core/lib/channel/connected_channel.c + src/core/lib/channel/deadline_filter.c src/core/lib/channel/handshaker.c src/core/lib/channel/handshaker_factory.c src/core/lib/channel/handshaker_registry.c + src/core/lib/channel/http_client_filter.c + src/core/lib/channel/http_server_filter.c + src/core/lib/channel/message_size_filter.c src/core/lib/compression/compression.c src/core/lib/compression/message_compress.c src/core/lib/debug/trace.c @@ -2459,6 +2462,7 @@ foreach(_hdr include/grpc++/impl/codegen/slice.h include/grpc++/impl/codegen/status.h include/grpc++/impl/codegen/status_code_enum.h + include/grpc++/impl/codegen/status_helper.h include/grpc++/impl/codegen/string_ref.h include/grpc++/impl/codegen/stub_options.h include/grpc++/impl/codegen/sync_stream.h @@ -2553,10 +2557,15 @@ add_library(grpc++_cronet src/core/lib/channel/channel_args.c src/core/lib/channel/channel_stack.c src/core/lib/channel/channel_stack_builder.c + src/core/lib/channel/compress_filter.c src/core/lib/channel/connected_channel.c + src/core/lib/channel/deadline_filter.c src/core/lib/channel/handshaker.c src/core/lib/channel/handshaker_factory.c src/core/lib/channel/handshaker_registry.c + src/core/lib/channel/http_client_filter.c + src/core/lib/channel/http_server_filter.c + src/core/lib/channel/message_size_filter.c src/core/lib/compression/compression.c src/core/lib/compression/message_compress.c src/core/lib/debug/trace.c @@ -2699,10 +2708,6 @@ add_library(grpc++_cronet src/core/ext/transport/chttp2/transport/varint.c src/core/ext/transport/chttp2/transport/writing.c src/core/ext/transport/chttp2/alpn/alpn.c - src/core/ext/filters/http/client/http_client_filter.c - src/core/ext/filters/http/http_filters_plugin.c - src/core/ext/filters/http/message_compress/message_compress_filter.c - src/core/ext/filters/http/server/http_server_filter.c src/core/ext/filters/client_channel/channel_connectivity.c src/core/ext/filters/client_channel/client_channel.c src/core/ext/filters/client_channel/client_channel_factory.c @@ -2723,7 +2728,6 @@ add_library(grpc++_cronet src/core/ext/filters/client_channel/subchannel.c src/core/ext/filters/client_channel/subchannel_index.c src/core/ext/filters/client_channel/uri_parser.c - src/core/ext/filters/deadline/deadline_filter.c src/core/ext/transport/chttp2/server/insecure/server_chttp2.c src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c src/core/ext/transport/chttp2/server/chttp2_server.c @@ -2851,6 +2855,7 @@ foreach(_hdr include/grpc++/impl/codegen/slice.h include/grpc++/impl/codegen/status.h include/grpc++/impl/codegen/status_code_enum.h + include/grpc++/impl/codegen/status_helper.h include/grpc++/impl/codegen/string_ref.h include/grpc++/impl/codegen/stub_options.h include/grpc++/impl/codegen/sync_stream.h @@ -3240,6 +3245,7 @@ foreach(_hdr include/grpc++/impl/codegen/slice.h include/grpc++/impl/codegen/status.h include/grpc++/impl/codegen/status_code_enum.h + include/grpc++/impl/codegen/status_helper.h include/grpc++/impl/codegen/string_ref.h include/grpc++/impl/codegen/stub_options.h include/grpc++/impl/codegen/sync_stream.h @@ -3317,10 +3323,15 @@ add_library(grpc++_unsecure src/core/lib/channel/channel_args.c src/core/lib/channel/channel_stack.c src/core/lib/channel/channel_stack_builder.c + src/core/lib/channel/compress_filter.c src/core/lib/channel/connected_channel.c + src/core/lib/channel/deadline_filter.c src/core/lib/channel/handshaker.c src/core/lib/channel/handshaker_factory.c src/core/lib/channel/handshaker_registry.c + src/core/lib/channel/http_client_filter.c + src/core/lib/channel/http_server_filter.c + src/core/lib/channel/message_size_filter.c src/core/lib/compression/compression.c src/core/lib/compression/message_compress.c src/core/lib/debug/trace.c @@ -3547,6 +3558,7 @@ foreach(_hdr include/grpc++/impl/codegen/slice.h include/grpc++/impl/codegen/status.h include/grpc++/impl/codegen/status_code_enum.h + include/grpc++/impl/codegen/status_helper.h include/grpc++/impl/codegen/string_ref.h include/grpc++/impl/codegen/stub_options.h include/grpc++/impl/codegen/sync_stream.h @@ -5444,37 +5456,6 @@ target_link_libraries(ev_epoll_linux_test ) endif() -endif (gRPC_BUILD_TESTS) -if (gRPC_BUILD_TESTS) - -add_executable(fake_resolver_test - test/core/client_channel/resolvers/fake_resolver_test.c -) - - -target_include_directories(fake_resolver_test - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${BORINGSSL_ROOT_DIR}/include - PRIVATE ${PROTOBUF_ROOT_DIR}/src - PRIVATE ${BENCHMARK_ROOT_DIR}/include - PRIVATE ${ZLIB_ROOT_DIR} - PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib - PRIVATE ${CARES_BUILD_INCLUDE_DIR} - PRIVATE ${CARES_INCLUDE_DIR} - PRIVATE ${CARES_PLATFORM_INCLUDE_DIR} - PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares - PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include -) - -target_link_libraries(fake_resolver_test - ${_gRPC_ALLTARGETS_LIBRARIES} - grpc_test_util - grpc - gpr_test_util - gpr -) - endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) @@ -7477,37 +7458,6 @@ target_link_libraries(message_compress_test endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) -add_executable(minimal_stack_is_minimal_test - test/core/channel/minimal_stack_is_minimal_test.c -) - - -target_include_directories(minimal_stack_is_minimal_test - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${BORINGSSL_ROOT_DIR}/include - PRIVATE ${PROTOBUF_ROOT_DIR}/src - PRIVATE ${BENCHMARK_ROOT_DIR}/include - PRIVATE ${ZLIB_ROOT_DIR} - PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib - PRIVATE ${CARES_BUILD_INCLUDE_DIR} - PRIVATE ${CARES_INCLUDE_DIR} - PRIVATE ${CARES_PLATFORM_INCLUDE_DIR} - PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares - PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include -) - -target_link_libraries(minimal_stack_is_minimal_test - ${_gRPC_ALLTARGETS_LIBRARIES} - grpc_test_util - grpc - gpr_test_util - gpr -) - -endif (gRPC_BUILD_TESTS) -if (gRPC_BUILD_TESTS) - add_executable(mlog_test test/core/census/mlog_test.c ) @@ -8006,37 +7956,6 @@ target_link_libraries(slice_buffer_test endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) -add_executable(slice_hash_table_test - test/core/slice/slice_hash_table_test.c -) - - -target_include_directories(slice_hash_table_test - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${BORINGSSL_ROOT_DIR}/include - PRIVATE ${PROTOBUF_ROOT_DIR}/src - PRIVATE ${BENCHMARK_ROOT_DIR}/include - PRIVATE ${ZLIB_ROOT_DIR} - PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib - PRIVATE ${CARES_BUILD_INCLUDE_DIR} - PRIVATE ${CARES_INCLUDE_DIR} - PRIVATE ${CARES_PLATFORM_INCLUDE_DIR} - PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares - PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include -) - -target_link_libraries(slice_hash_table_test - ${_gRPC_ALLTARGETS_LIBRARIES} - grpc_test_util - grpc - gpr_test_util - gpr -) - -endif (gRPC_BUILD_TESTS) -if (gRPC_BUILD_TESTS) - add_executable(slice_string_helpers_test test/core/slice/slice_string_helpers_test.c ) @@ -9809,8 +9728,6 @@ target_include_directories(codegen_test_minimal target_link_libraries(codegen_test_minimal ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} - grpc - gpr ${_gRPC_GFLAGS_LIBRARIES} ) diff --git a/Makefile b/Makefile index a6b4cf39162..9e3daabe405 100644 --- a/Makefile +++ b/Makefile @@ -157,15 +157,6 @@ LDXX_asan-noleaks = clang++ CPPFLAGS_asan-noleaks = -O0 -fsanitize-coverage=edge -fsanitize=address -fno-omit-frame-pointer -Wno-unused-command-line-argument -DGPR_NO_DIRECT_SYSCALLS LDFLAGS_asan-noleaks = -fsanitize=address -VALID_CONFIG_c++-compat = 1 -CC_c++-compat = $(DEFAULT_CC) -CXX_c++-compat = $(DEFAULT_CXX) -LD_c++-compat = $(DEFAULT_CC) -LDXX_c++-compat = $(DEFAULT_CXX) -CFLAGS_c++-compat = -Wc++-compat -CPPFLAGS_c++-compat = -O0 -DEFINES_c++-compat = _DEBUG DEBUG - VALID_CONFIG_ubsan = 1 REQUIRE_CUSTOM_LIBRARIES_ubsan = 1 CC_ubsan = clang @@ -174,7 +165,7 @@ LD_ubsan = clang LDXX_ubsan = clang++ CPPFLAGS_ubsan = -O0 -fsanitize-coverage=edge -fsanitize=undefined -fno-omit-frame-pointer -Wno-unused-command-line-argument -Wvarargs LDFLAGS_ubsan = -fsanitize=undefined,unsigned-integer-overflow -DEFINES_ubsan = NDEBUG GRPC_UBSAN +DEFINES_ubsan = NDEBUG VALID_CONFIG_tsan = 1 REQUIRE_CUSTOM_LIBRARIES_tsan = 1 @@ -418,7 +409,7 @@ AROPTS = $(GRPC_CROSS_AROPTS) # e.g., rc --target=elf32-little USE_BUILT_PROTOC = false endif -GTEST_LIB = -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googletest third_party/googletest/googletest/src/gtest-all.cc -Ithird_party/googletest/googlemock/include -Ithird_party/googletest/googlemock third_party/googletest/googlemock/src/gmock-all.cc +GTEST_LIB = -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googletest third_party/googletest/googletest/src/gtest-all.cc GTEST_LIB += -lgflags ifeq ($(V),1) E = @: @@ -428,9 +419,9 @@ E = @echo Q = @ endif -CORE_VERSION = 4.0.0-dev -CPP_VERSION = 1.4.0-dev -CSHARP_VERSION = 1.4.0-dev +CORE_VERSION = 3.0.0-pre1 +CPP_VERSION = 1.3.0-pre1 +CSHARP_VERSION = 1.3.0-pre1 CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES)) CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS) @@ -478,7 +469,7 @@ SHARED_EXT_CORE = dll SHARED_EXT_CPP = dll SHARED_EXT_CSHARP = dll SHARED_PREFIX = -SHARED_VERSION_CORE = -4 +SHARED_VERSION_CORE = -3 SHARED_VERSION_CPP = -1 SHARED_VERSION_CSHARP = -1 else ifeq ($(SYSTEM),Darwin) @@ -793,7 +784,7 @@ PROTOBUF_PKG_CONFIG = false PC_REQUIRES_GRPCXX = PC_LIBS_GRPCXX = -CPPFLAGS := -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googlemock/include $(CPPFLAGS) +CPPFLAGS := -Ithird_party/googletest/googletest/include $(CPPFLAGS) PROTOC_PLUGINS_ALL = $(BINDIR)/$(CONFIG)/grpc_cpp_plugin $(BINDIR)/$(CONFIG)/grpc_csharp_plugin $(BINDIR)/$(CONFIG)/grpc_node_plugin $(BINDIR)/$(CONFIG)/grpc_objective_c_plugin $(BINDIR)/$(CONFIG)/grpc_php_plugin $(BINDIR)/$(CONFIG)/grpc_python_plugin $(BINDIR)/$(CONFIG)/grpc_ruby_plugin PROTOC_PLUGINS_DIR = $(BINDIR)/$(CONFIG) @@ -990,7 +981,6 @@ dualstack_socket_test: $(BINDIR)/$(CONFIG)/dualstack_socket_test endpoint_pair_test: $(BINDIR)/$(CONFIG)/endpoint_pair_test error_test: $(BINDIR)/$(CONFIG)/error_test ev_epoll_linux_test: $(BINDIR)/$(CONFIG)/ev_epoll_linux_test -fake_resolver_test: $(BINDIR)/$(CONFIG)/fake_resolver_test fd_conservation_posix_test: $(BINDIR)/$(CONFIG)/fd_conservation_posix_test fd_posix_test: $(BINDIR)/$(CONFIG)/fd_posix_test fling_client: $(BINDIR)/$(CONFIG)/fling_client @@ -1060,7 +1050,6 @@ memory_profile_client: $(BINDIR)/$(CONFIG)/memory_profile_client memory_profile_server: $(BINDIR)/$(CONFIG)/memory_profile_server memory_profile_test: $(BINDIR)/$(CONFIG)/memory_profile_test message_compress_test: $(BINDIR)/$(CONFIG)/message_compress_test -minimal_stack_is_minimal_test: $(BINDIR)/$(CONFIG)/minimal_stack_is_minimal_test mlog_test: $(BINDIR)/$(CONFIG)/mlog_test multiple_server_queues_test: $(BINDIR)/$(CONFIG)/multiple_server_queues_test murmur_hash_test: $(BINDIR)/$(CONFIG)/murmur_hash_test @@ -1082,7 +1071,6 @@ server_chttp2_test: $(BINDIR)/$(CONFIG)/server_chttp2_test server_fuzzer: $(BINDIR)/$(CONFIG)/server_fuzzer server_test: $(BINDIR)/$(CONFIG)/server_test slice_buffer_test: $(BINDIR)/$(CONFIG)/slice_buffer_test -slice_hash_table_test: $(BINDIR)/$(CONFIG)/slice_hash_table_test slice_string_helpers_test: $(BINDIR)/$(CONFIG)/slice_string_helpers_test slice_test: $(BINDIR)/$(CONFIG)/slice_test sockaddr_resolver_test: $(BINDIR)/$(CONFIG)/sockaddr_resolver_test @@ -1377,7 +1365,6 @@ buildtests_c: privatelibs_c \ $(BINDIR)/$(CONFIG)/endpoint_pair_test \ $(BINDIR)/$(CONFIG)/error_test \ $(BINDIR)/$(CONFIG)/ev_epoll_linux_test \ - $(BINDIR)/$(CONFIG)/fake_resolver_test \ $(BINDIR)/$(CONFIG)/fd_conservation_posix_test \ $(BINDIR)/$(CONFIG)/fd_posix_test \ $(BINDIR)/$(CONFIG)/fling_client \ @@ -1436,7 +1423,6 @@ buildtests_c: privatelibs_c \ $(BINDIR)/$(CONFIG)/memory_profile_server \ $(BINDIR)/$(CONFIG)/memory_profile_test \ $(BINDIR)/$(CONFIG)/message_compress_test \ - $(BINDIR)/$(CONFIG)/minimal_stack_is_minimal_test \ $(BINDIR)/$(CONFIG)/mlog_test \ $(BINDIR)/$(CONFIG)/multiple_server_queues_test \ $(BINDIR)/$(CONFIG)/murmur_hash_test \ @@ -1453,7 +1439,6 @@ buildtests_c: privatelibs_c \ $(BINDIR)/$(CONFIG)/server_chttp2_test \ $(BINDIR)/$(CONFIG)/server_test \ $(BINDIR)/$(CONFIG)/slice_buffer_test \ - $(BINDIR)/$(CONFIG)/slice_hash_table_test \ $(BINDIR)/$(CONFIG)/slice_string_helpers_test \ $(BINDIR)/$(CONFIG)/slice_test \ $(BINDIR)/$(CONFIG)/sockaddr_resolver_test \ @@ -1790,8 +1775,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/error_test || ( echo test error_test failed ; exit 1 ) $(E) "[RUN] Testing ev_epoll_linux_test" $(Q) $(BINDIR)/$(CONFIG)/ev_epoll_linux_test || ( echo test ev_epoll_linux_test failed ; exit 1 ) - $(E) "[RUN] Testing fake_resolver_test" - $(Q) $(BINDIR)/$(CONFIG)/fake_resolver_test || ( echo test fake_resolver_test failed ; exit 1 ) $(E) "[RUN] Testing fd_conservation_posix_test" $(Q) $(BINDIR)/$(CONFIG)/fd_conservation_posix_test || ( echo test fd_conservation_posix_test failed ; exit 1 ) $(E) "[RUN] Testing fd_posix_test" @@ -1894,8 +1877,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/memory_profile_test || ( echo test memory_profile_test failed ; exit 1 ) $(E) "[RUN] Testing message_compress_test" $(Q) $(BINDIR)/$(CONFIG)/message_compress_test || ( echo test message_compress_test failed ; exit 1 ) - $(E) "[RUN] Testing minimal_stack_is_minimal_test" - $(Q) $(BINDIR)/$(CONFIG)/minimal_stack_is_minimal_test || ( echo test minimal_stack_is_minimal_test failed ; exit 1 ) $(E) "[RUN] Testing multiple_server_queues_test" $(Q) $(BINDIR)/$(CONFIG)/multiple_server_queues_test || ( echo test multiple_server_queues_test failed ; exit 1 ) $(E) "[RUN] Testing murmur_hash_test" @@ -1926,8 +1907,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/server_test || ( echo test server_test failed ; exit 1 ) $(E) "[RUN] Testing slice_buffer_test" $(Q) $(BINDIR)/$(CONFIG)/slice_buffer_test || ( echo test slice_buffer_test failed ; exit 1 ) - $(E) "[RUN] Testing slice_hash_table_test" - $(Q) $(BINDIR)/$(CONFIG)/slice_hash_table_test || ( echo test slice_hash_table_test failed ; exit 1 ) $(E) "[RUN] Testing slice_string_helpers_test" $(Q) $(BINDIR)/$(CONFIG)/slice_string_helpers_test || ( echo test slice_string_helpers_test failed ; exit 1 ) $(E) "[RUN] Testing slice_test" @@ -2238,7 +2217,6 @@ ifeq ($(NO_PROTOC),true) $(GENDIR)/src/proto/grpc/health/v1/health.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/health/v1/health.grpc.pb.cc: protoc_dep_error else - $(GENDIR)/src/proto/grpc/health/v1/health.pb.cc: src/proto/grpc/health/v1/health.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(E) "[PROTOC] Generating protobuf CC file from $<" $(Q) mkdir -p `dirname $@` @@ -2254,7 +2232,6 @@ ifeq ($(NO_PROTOC),true) $(GENDIR)/src/proto/grpc/lb/v1/load_balancer.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/lb/v1/load_balancer.grpc.pb.cc: protoc_dep_error else - $(GENDIR)/src/proto/grpc/lb/v1/load_balancer.pb.cc: src/proto/grpc/lb/v1/load_balancer.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(E) "[PROTOC] Generating protobuf CC file from $<" $(Q) mkdir -p `dirname $@` @@ -2270,7 +2247,6 @@ ifeq ($(NO_PROTOC),true) $(GENDIR)/src/proto/grpc/reflection/v1alpha/reflection.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.cc: protoc_dep_error else - $(GENDIR)/src/proto/grpc/reflection/v1alpha/reflection.pb.cc: src/proto/grpc/reflection/v1alpha/reflection.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(E) "[PROTOC] Generating protobuf CC file from $<" $(Q) mkdir -p `dirname $@` @@ -2286,7 +2262,6 @@ ifeq ($(NO_PROTOC),true) $(GENDIR)/src/proto/grpc/status/status.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/status/status.grpc.pb.cc: protoc_dep_error else - $(GENDIR)/src/proto/grpc/status/status.pb.cc: src/proto/grpc/status/status.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(E) "[PROTOC] Generating protobuf CC file from $<" $(Q) mkdir -p `dirname $@` @@ -2302,8 +2277,6 @@ ifeq ($(NO_PROTOC),true) $(GENDIR)/src/proto/grpc/testing/compiler_test.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/compiler_test.grpc.pb.cc: protoc_dep_error else - - $(GENDIR)/src/proto/grpc/testing/compiler_test.pb.cc: src/proto/grpc/testing/compiler_test.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(E) "[PROTOC] Generating protobuf CC file from $<" $(Q) mkdir -p `dirname $@` @@ -2312,14 +2285,13 @@ $(GENDIR)/src/proto/grpc/testing/compiler_test.pb.cc: src/proto/grpc/testing/com $(GENDIR)/src/proto/grpc/testing/compiler_test.grpc.pb.cc: src/proto/grpc/testing/compiler_test.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(E) "[GRPC] Generating gRPC's protobuf service CC file from $<" $(Q) mkdir -p `dirname $@` - $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=generate_mock_code=true:$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $< + $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $< endif ifeq ($(NO_PROTOC),true) $(GENDIR)/src/proto/grpc/testing/control.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc: protoc_dep_error else - $(GENDIR)/src/proto/grpc/testing/control.pb.cc: src/proto/grpc/testing/control.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(E) "[PROTOC] Generating protobuf CC file from $<" $(Q) mkdir -p `dirname $@` @@ -2335,7 +2307,6 @@ ifeq ($(NO_PROTOC),true) $(GENDIR)/src/proto/grpc/testing/duplicate/echo_duplicate.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.cc: protoc_dep_error else - $(GENDIR)/src/proto/grpc/testing/duplicate/echo_duplicate.pb.cc: src/proto/grpc/testing/duplicate/echo_duplicate.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc $(E) "[PROTOC] Generating protobuf CC file from $<" $(Q) mkdir -p `dirname $@` @@ -2351,8 +2322,6 @@ ifeq ($(NO_PROTOC),true) $(GENDIR)/src/proto/grpc/testing/echo.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/echo.grpc.pb.cc: protoc_dep_error else - - $(GENDIR)/src/proto/grpc/testing/echo.pb.cc: src/proto/grpc/testing/echo.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc $(E) "[PROTOC] Generating protobuf CC file from $<" $(Q) mkdir -p `dirname $@` @@ -2361,14 +2330,13 @@ $(GENDIR)/src/proto/grpc/testing/echo.pb.cc: src/proto/grpc/testing/echo.proto $ $(GENDIR)/src/proto/grpc/testing/echo.grpc.pb.cc: src/proto/grpc/testing/echo.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc $(GENDIR)/src/proto/grpc/testing/echo_messages.grpc.pb.cc $(E) "[GRPC] Generating gRPC's protobuf service CC file from $<" $(Q) mkdir -p `dirname $@` - $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=generate_mock_code=true:$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $< + $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $< endif ifeq ($(NO_PROTOC),true) $(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/echo_messages.grpc.pb.cc: protoc_dep_error else - $(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc: src/proto/grpc/testing/echo_messages.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(E) "[PROTOC] Generating protobuf CC file from $<" $(Q) mkdir -p `dirname $@` @@ -2384,7 +2352,6 @@ ifeq ($(NO_PROTOC),true) $(GENDIR)/src/proto/grpc/testing/empty.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/empty.grpc.pb.cc: protoc_dep_error else - $(GENDIR)/src/proto/grpc/testing/empty.pb.cc: src/proto/grpc/testing/empty.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(E) "[PROTOC] Generating protobuf CC file from $<" $(Q) mkdir -p `dirname $@` @@ -2400,7 +2367,6 @@ ifeq ($(NO_PROTOC),true) $(GENDIR)/src/proto/grpc/testing/messages.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc: protoc_dep_error else - $(GENDIR)/src/proto/grpc/testing/messages.pb.cc: src/proto/grpc/testing/messages.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(E) "[PROTOC] Generating protobuf CC file from $<" $(Q) mkdir -p `dirname $@` @@ -2416,7 +2382,6 @@ ifeq ($(NO_PROTOC),true) $(GENDIR)/src/proto/grpc/testing/metrics.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/metrics.grpc.pb.cc: protoc_dep_error else - $(GENDIR)/src/proto/grpc/testing/metrics.pb.cc: src/proto/grpc/testing/metrics.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(E) "[PROTOC] Generating protobuf CC file from $<" $(Q) mkdir -p `dirname $@` @@ -2432,7 +2397,6 @@ ifeq ($(NO_PROTOC),true) $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc: protoc_dep_error else - $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc: src/proto/grpc/testing/payloads.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(E) "[PROTOC] Generating protobuf CC file from $<" $(Q) mkdir -p `dirname $@` @@ -2448,7 +2412,6 @@ ifeq ($(NO_PROTOC),true) $(GENDIR)/src/proto/grpc/testing/services.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc: protoc_dep_error else - $(GENDIR)/src/proto/grpc/testing/services.pb.cc: src/proto/grpc/testing/services.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(E) "[PROTOC] Generating protobuf CC file from $<" $(Q) mkdir -p `dirname $@` @@ -2464,7 +2427,6 @@ ifeq ($(NO_PROTOC),true) $(GENDIR)/src/proto/grpc/testing/stats.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc: protoc_dep_error else - $(GENDIR)/src/proto/grpc/testing/stats.pb.cc: src/proto/grpc/testing/stats.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(E) "[PROTOC] Generating protobuf CC file from $<" $(Q) mkdir -p `dirname $@` @@ -2480,7 +2442,6 @@ ifeq ($(NO_PROTOC),true) $(GENDIR)/src/proto/grpc/testing/test.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/test.grpc.pb.cc: protoc_dep_error else - $(GENDIR)/src/proto/grpc/testing/test.pb.cc: src/proto/grpc/testing/test.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/empty.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(E) "[PROTOC] Generating protobuf CC file from $<" $(Q) mkdir -p `dirname $@` @@ -2589,7 +2550,7 @@ install-shared_c: shared_c strip-shared_c install-pkg-config_c ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgpr.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so.4 + $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so.3 $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so endif $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" @@ -2598,7 +2559,7 @@ endif ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so.4 + $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so endif $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" @@ -2607,7 +2568,7 @@ endif ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc_cronet.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_cronet.so.4 + $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_cronet.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_cronet.so endif $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" @@ -2616,7 +2577,7 @@ endif ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc_unsecure.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so.4 + $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so endif ifneq ($(SYSTEM),MINGW32) @@ -2633,7 +2594,7 @@ install-shared_cxx: shared_cxx strip-shared_cxx install-shared_c install-pkg-con ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++.so.4 + $(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++.so endif $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)" @@ -2642,7 +2603,7 @@ endif ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_cronet$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_cronet.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_cronet.so.4 + $(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_cronet.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_cronet.so endif $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)" @@ -2651,7 +2612,7 @@ endif ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_error_details$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_error_details.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_error_details.so.4 + $(Q) ln -sf $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_error_details.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_error_details.so endif $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)" @@ -2660,7 +2621,7 @@ endif ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_reflection.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_reflection.so.4 + $(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_reflection.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_reflection.so endif $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)" @@ -2669,7 +2630,7 @@ endif ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_unsecure.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_unsecure.so.4 + $(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_unsecure.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_unsecure.so endif ifneq ($(SYSTEM),MINGW32) @@ -2686,7 +2647,7 @@ install-shared_csharp: shared_csharp strip-shared_csharp ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP)-dll.a $(prefix)/lib/libgrpc_csharp_ext.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/libgrpc_csharp_ext.so.4 + $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/libgrpc_csharp_ext.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/libgrpc_csharp_ext.so endif ifneq ($(SYSTEM),MINGW32) @@ -2851,8 +2812,8 @@ $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBGPR_OB ifeq ($(SYSTEM),Darwin) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgpr.so.4 -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so.4 + $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgpr.so.3 -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so.3 $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so endif endif @@ -2892,10 +2853,15 @@ LIBGRPC_SRC = \ src/core/lib/channel/channel_args.c \ src/core/lib/channel/channel_stack.c \ src/core/lib/channel/channel_stack_builder.c \ + src/core/lib/channel/compress_filter.c \ src/core/lib/channel/connected_channel.c \ + src/core/lib/channel/deadline_filter.c \ src/core/lib/channel/handshaker.c \ src/core/lib/channel/handshaker_factory.c \ src/core/lib/channel/handshaker_registry.c \ + src/core/lib/channel/http_client_filter.c \ + src/core/lib/channel/http_server_filter.c \ + src/core/lib/channel/message_size_filter.c \ src/core/lib/compression/compression.c \ src/core/lib/compression/message_compress.c \ src/core/lib/debug/trace.c \ @@ -3032,10 +2998,6 @@ LIBGRPC_SRC = \ src/core/ext/transport/chttp2/transport/varint.c \ src/core/ext/transport/chttp2/transport/writing.c \ src/core/ext/transport/chttp2/alpn/alpn.c \ - src/core/ext/filters/http/client/http_client_filter.c \ - src/core/ext/filters/http/http_filters_plugin.c \ - src/core/ext/filters/http/message_compress/message_compress_filter.c \ - src/core/ext/filters/http/server/http_server_filter.c \ src/core/lib/http/httpcli_security_connector.c \ src/core/lib/security/context/security_context.c \ src/core/lib/security/credentials/composite/composite_credentials.c \ @@ -3085,7 +3047,6 @@ LIBGRPC_SRC = \ src/core/ext/filters/client_channel/subchannel.c \ src/core/ext/filters/client_channel/subchannel_index.c \ src/core/ext/filters/client_channel/uri_parser.c \ - src/core/ext/filters/deadline/deadline_filter.c \ src/core/ext/transport/chttp2/client/chttp2_connector.c \ src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \ src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c \ @@ -3122,7 +3083,6 @@ LIBGRPC_SRC = \ src/core/ext/census/trace_context.c \ src/core/ext/census/tracing.c \ src/core/ext/filters/max_age/max_age_filter.c \ - src/core/ext/filters/message_size/message_size_filter.c \ src/core/plugin_registry/grpc_plugin_registry.c \ PUBLIC_HEADERS_C += \ @@ -3195,8 +3155,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBGRPC_ ifeq ($(SYSTEM),Darwin) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.4 -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so.4 + $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.3 -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so endif endif @@ -3215,10 +3175,15 @@ LIBGRPC_CRONET_SRC = \ src/core/lib/channel/channel_args.c \ src/core/lib/channel/channel_stack.c \ src/core/lib/channel/channel_stack_builder.c \ + src/core/lib/channel/compress_filter.c \ src/core/lib/channel/connected_channel.c \ + src/core/lib/channel/deadline_filter.c \ src/core/lib/channel/handshaker.c \ src/core/lib/channel/handshaker_factory.c \ src/core/lib/channel/handshaker_registry.c \ + src/core/lib/channel/http_client_filter.c \ + src/core/lib/channel/http_server_filter.c \ + src/core/lib/channel/message_size_filter.c \ src/core/lib/compression/compression.c \ src/core/lib/compression/message_compress.c \ src/core/lib/debug/trace.c \ @@ -3358,10 +3323,6 @@ LIBGRPC_CRONET_SRC = \ src/core/ext/transport/chttp2/transport/varint.c \ src/core/ext/transport/chttp2/transport/writing.c \ src/core/ext/transport/chttp2/alpn/alpn.c \ - src/core/ext/filters/http/client/http_client_filter.c \ - src/core/ext/filters/http/http_filters_plugin.c \ - src/core/ext/filters/http/message_compress/message_compress_filter.c \ - src/core/ext/filters/http/server/http_server_filter.c \ src/core/ext/filters/client_channel/channel_connectivity.c \ src/core/ext/filters/client_channel/client_channel.c \ src/core/ext/filters/client_channel/client_channel_factory.c \ @@ -3382,7 +3343,6 @@ LIBGRPC_CRONET_SRC = \ src/core/ext/filters/client_channel/subchannel.c \ src/core/ext/filters/client_channel/subchannel_index.c \ src/core/ext/filters/client_channel/uri_parser.c \ - src/core/ext/filters/deadline/deadline_filter.c \ src/core/lib/http/httpcli_security_connector.c \ src/core/lib/security/context/security_context.c \ src/core/lib/security/credentials/composite/composite_credentials.c \ @@ -3485,8 +3445,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(L ifeq ($(SYSTEM),Darwin) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CRONET_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_cronet.so.4 -o $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CRONET_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).so.4 + $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_cronet.so.3 -o $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CRONET_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).so endif endif @@ -3524,10 +3484,15 @@ LIBGRPC_TEST_UTIL_SRC = \ src/core/lib/channel/channel_args.c \ src/core/lib/channel/channel_stack.c \ src/core/lib/channel/channel_stack_builder.c \ + src/core/lib/channel/compress_filter.c \ src/core/lib/channel/connected_channel.c \ + src/core/lib/channel/deadline_filter.c \ src/core/lib/channel/handshaker.c \ src/core/lib/channel/handshaker_factory.c \ src/core/lib/channel/handshaker_registry.c \ + src/core/lib/channel/http_client_filter.c \ + src/core/lib/channel/http_server_filter.c \ + src/core/lib/channel/message_size_filter.c \ src/core/lib/compression/compression.c \ src/core/lib/compression/message_compress.c \ src/core/lib/debug/trace.c \ @@ -3752,10 +3717,15 @@ LIBGRPC_UNSECURE_SRC = \ src/core/lib/channel/channel_args.c \ src/core/lib/channel/channel_stack.c \ src/core/lib/channel/channel_stack_builder.c \ + src/core/lib/channel/compress_filter.c \ src/core/lib/channel/connected_channel.c \ + src/core/lib/channel/deadline_filter.c \ src/core/lib/channel/handshaker.c \ src/core/lib/channel/handshaker_factory.c \ src/core/lib/channel/handshaker_registry.c \ + src/core/lib/channel/http_client_filter.c \ + src/core/lib/channel/http_server_filter.c \ + src/core/lib/channel/message_size_filter.c \ src/core/lib/compression/compression.c \ src/core/lib/compression/message_compress.c \ src/core/lib/debug/trace.c \ @@ -3893,10 +3863,6 @@ LIBGRPC_UNSECURE_SRC = \ src/core/ext/transport/chttp2/transport/varint.c \ src/core/ext/transport/chttp2/transport/writing.c \ src/core/ext/transport/chttp2/alpn/alpn.c \ - src/core/ext/filters/http/client/http_client_filter.c \ - src/core/ext/filters/http/http_filters_plugin.c \ - src/core/ext/filters/http/message_compress/message_compress_filter.c \ - src/core/ext/filters/http/server/http_server_filter.c \ src/core/ext/transport/chttp2/server/chttp2_server.c \ src/core/ext/transport/chttp2/client/insecure/channel_create.c \ src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c \ @@ -3921,7 +3887,6 @@ LIBGRPC_UNSECURE_SRC = \ src/core/ext/filters/client_channel/subchannel.c \ src/core/ext/filters/client_channel/subchannel_index.c \ src/core/ext/filters/client_channel/uri_parser.c \ - src/core/ext/filters/deadline/deadline_filter.c \ src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.c \ src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c \ src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c \ @@ -3953,7 +3918,6 @@ LIBGRPC_UNSECURE_SRC = \ src/core/ext/census/trace_context.c \ src/core/ext/census/tracing.c \ src/core/ext/filters/max_age/max_age_filter.c \ - src/core/ext/filters/message_size/message_size_filter.c \ src/core/plugin_registry/grpc_unsecure_plugin_registry.c \ PUBLIC_HEADERS_C += \ @@ -4014,8 +3978,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $ ifeq ($(SYSTEM),Darwin) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_unsecure.so.4 -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so.4 + $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_unsecure.so.3 -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so endif endif @@ -4148,10 +4112,15 @@ LIBGRPC++_SRC = \ src/core/lib/channel/channel_args.c \ src/core/lib/channel/channel_stack.c \ src/core/lib/channel/channel_stack_builder.c \ + src/core/lib/channel/compress_filter.c \ src/core/lib/channel/connected_channel.c \ + src/core/lib/channel/deadline_filter.c \ src/core/lib/channel/handshaker.c \ src/core/lib/channel/handshaker_factory.c \ src/core/lib/channel/handshaker_registry.c \ + src/core/lib/channel/http_client_filter.c \ + src/core/lib/channel/http_server_filter.c \ + src/core/lib/channel/message_size_filter.c \ src/core/lib/compression/compression.c \ src/core/lib/compression/message_compress.c \ src/core/lib/debug/trace.c \ @@ -4341,6 +4310,7 @@ PUBLIC_HEADERS_CXX += \ include/grpc++/impl/codegen/slice.h \ include/grpc++/impl/codegen/status.h \ include/grpc++/impl/codegen/status_code_enum.h \ + include/grpc++/impl/codegen/status_helper.h \ include/grpc++/impl/codegen/string_ref.h \ include/grpc++/impl/codegen/stub_options.h \ include/grpc++/impl/codegen/sync_stream.h \ @@ -4481,10 +4451,15 @@ LIBGRPC++_CRONET_SRC = \ src/core/lib/channel/channel_args.c \ src/core/lib/channel/channel_stack.c \ src/core/lib/channel/channel_stack_builder.c \ + src/core/lib/channel/compress_filter.c \ src/core/lib/channel/connected_channel.c \ + src/core/lib/channel/deadline_filter.c \ src/core/lib/channel/handshaker.c \ src/core/lib/channel/handshaker_factory.c \ src/core/lib/channel/handshaker_registry.c \ + src/core/lib/channel/http_client_filter.c \ + src/core/lib/channel/http_server_filter.c \ + src/core/lib/channel/message_size_filter.c \ src/core/lib/compression/compression.c \ src/core/lib/compression/message_compress.c \ src/core/lib/debug/trace.c \ @@ -4627,10 +4602,6 @@ LIBGRPC++_CRONET_SRC = \ src/core/ext/transport/chttp2/transport/varint.c \ src/core/ext/transport/chttp2/transport/writing.c \ src/core/ext/transport/chttp2/alpn/alpn.c \ - src/core/ext/filters/http/client/http_client_filter.c \ - src/core/ext/filters/http/http_filters_plugin.c \ - src/core/ext/filters/http/message_compress/message_compress_filter.c \ - src/core/ext/filters/http/server/http_server_filter.c \ src/core/ext/filters/client_channel/channel_connectivity.c \ src/core/ext/filters/client_channel/client_channel.c \ src/core/ext/filters/client_channel/client_channel_factory.c \ @@ -4651,7 +4622,6 @@ LIBGRPC++_CRONET_SRC = \ src/core/ext/filters/client_channel/subchannel.c \ src/core/ext/filters/client_channel/subchannel_index.c \ src/core/ext/filters/client_channel/uri_parser.c \ - src/core/ext/filters/deadline/deadline_filter.c \ src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \ src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c \ src/core/ext/transport/chttp2/server/chttp2_server.c \ @@ -4741,6 +4711,7 @@ PUBLIC_HEADERS_CXX += \ include/grpc++/impl/codegen/slice.h \ include/grpc++/impl/codegen/status.h \ include/grpc++/impl/codegen/status_code_enum.h \ + include/grpc++/impl/codegen/status_helper.h \ include/grpc++/impl/codegen/string_ref.h \ include/grpc++/impl/codegen/stub_options.h \ include/grpc++/impl/codegen/sync_stream.h \ @@ -5123,6 +5094,7 @@ PUBLIC_HEADERS_CXX += \ include/grpc++/impl/codegen/slice.h \ include/grpc++/impl/codegen/status.h \ include/grpc++/impl/codegen/status_code_enum.h \ + include/grpc++/impl/codegen/status_helper.h \ include/grpc++/impl/codegen/string_ref.h \ include/grpc++/impl/codegen/stub_options.h \ include/grpc++/impl/codegen/sync_stream.h \ @@ -5242,10 +5214,15 @@ LIBGRPC++_UNSECURE_SRC = \ src/core/lib/channel/channel_args.c \ src/core/lib/channel/channel_stack.c \ src/core/lib/channel/channel_stack_builder.c \ + src/core/lib/channel/compress_filter.c \ src/core/lib/channel/connected_channel.c \ + src/core/lib/channel/deadline_filter.c \ src/core/lib/channel/handshaker.c \ src/core/lib/channel/handshaker_factory.c \ src/core/lib/channel/handshaker_registry.c \ + src/core/lib/channel/http_client_filter.c \ + src/core/lib/channel/http_server_filter.c \ + src/core/lib/channel/message_size_filter.c \ src/core/lib/compression/compression.c \ src/core/lib/compression/message_compress.c \ src/core/lib/debug/trace.c \ @@ -5435,6 +5412,7 @@ PUBLIC_HEADERS_CXX += \ include/grpc++/impl/codegen/slice.h \ include/grpc++/impl/codegen/status.h \ include/grpc++/impl/codegen/status_code_enum.h \ + include/grpc++/impl/codegen/status_helper.h \ include/grpc++/impl/codegen/string_ref.h \ include/grpc++/impl/codegen/stub_options.h \ include/grpc++/impl/codegen/sync_stream.h \ @@ -9432,38 +9410,6 @@ endif endif -FAKE_RESOLVER_TEST_SRC = \ - test/core/client_channel/resolvers/fake_resolver_test.c \ - -FAKE_RESOLVER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(FAKE_RESOLVER_TEST_SRC)))) -ifeq ($(NO_SECURE),true) - -# You can't build secure targets if you don't have OpenSSL. - -$(BINDIR)/$(CONFIG)/fake_resolver_test: openssl_dep_error - -else - - - -$(BINDIR)/$(CONFIG)/fake_resolver_test: $(FAKE_RESOLVER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a - $(E) "[LD] Linking $@" - $(Q) mkdir -p `dirname $@` - $(Q) $(LD) $(LDFLAGS) $(FAKE_RESOLVER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/fake_resolver_test - -endif - -$(OBJDIR)/$(CONFIG)/test/core/client_channel/resolvers/fake_resolver_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a - -deps_fake_resolver_test: $(FAKE_RESOLVER_TEST_OBJS:.o=.dep) - -ifneq ($(NO_SECURE),true) -ifneq ($(NO_DEPS),true) --include $(FAKE_RESOLVER_TEST_OBJS:.o=.dep) -endif -endif - - FD_CONSERVATION_POSIX_TEST_SRC = \ test/core/iomgr/fd_conservation_posix_test.c \ @@ -11672,38 +11618,6 @@ endif endif -MINIMAL_STACK_IS_MINIMAL_TEST_SRC = \ - test/core/channel/minimal_stack_is_minimal_test.c \ - -MINIMAL_STACK_IS_MINIMAL_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(MINIMAL_STACK_IS_MINIMAL_TEST_SRC)))) -ifeq ($(NO_SECURE),true) - -# You can't build secure targets if you don't have OpenSSL. - -$(BINDIR)/$(CONFIG)/minimal_stack_is_minimal_test: openssl_dep_error - -else - - - -$(BINDIR)/$(CONFIG)/minimal_stack_is_minimal_test: $(MINIMAL_STACK_IS_MINIMAL_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a - $(E) "[LD] Linking $@" - $(Q) mkdir -p `dirname $@` - $(Q) $(LD) $(LDFLAGS) $(MINIMAL_STACK_IS_MINIMAL_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/minimal_stack_is_minimal_test - -endif - -$(OBJDIR)/$(CONFIG)/test/core/channel/minimal_stack_is_minimal_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a - -deps_minimal_stack_is_minimal_test: $(MINIMAL_STACK_IS_MINIMAL_TEST_OBJS:.o=.dep) - -ifneq ($(NO_SECURE),true) -ifneq ($(NO_DEPS),true) --include $(MINIMAL_STACK_IS_MINIMAL_TEST_OBJS:.o=.dep) -endif -endif - - MLOG_TEST_SRC = \ test/core/census/mlog_test.c \ @@ -12376,38 +12290,6 @@ endif endif -SLICE_HASH_TABLE_TEST_SRC = \ - test/core/slice/slice_hash_table_test.c \ - -SLICE_HASH_TABLE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SLICE_HASH_TABLE_TEST_SRC)))) -ifeq ($(NO_SECURE),true) - -# You can't build secure targets if you don't have OpenSSL. - -$(BINDIR)/$(CONFIG)/slice_hash_table_test: openssl_dep_error - -else - - - -$(BINDIR)/$(CONFIG)/slice_hash_table_test: $(SLICE_HASH_TABLE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a - $(E) "[LD] Linking $@" - $(Q) mkdir -p `dirname $@` - $(Q) $(LD) $(LDFLAGS) $(SLICE_HASH_TABLE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/slice_hash_table_test - -endif - -$(OBJDIR)/$(CONFIG)/test/core/slice/slice_hash_table_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a - -deps_slice_hash_table_test: $(SLICE_HASH_TABLE_TEST_OBJS:.o=.dep) - -ifneq ($(NO_SECURE),true) -ifneq ($(NO_DEPS),true) --include $(SLICE_HASH_TABLE_TEST_OBJS:.o=.dep) -endif -endif - - SLICE_STRING_HELPERS_TEST_SRC = \ test/core/slice/slice_string_helpers_test.c \ @@ -14256,28 +14138,28 @@ $(BINDIR)/$(CONFIG)/codegen_test_minimal: protobuf_dep_error else -$(BINDIR)/$(CONFIG)/codegen_test_minimal: $(PROTOBUF_DEP) $(CODEGEN_TEST_MINIMAL_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(BINDIR)/$(CONFIG)/codegen_test_minimal: $(PROTOBUF_DEP) $(CODEGEN_TEST_MINIMAL_OBJS) $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(CODEGEN_TEST_MINIMAL_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/codegen_test_minimal + $(Q) $(LDXX) $(LDFLAGS) $(CODEGEN_TEST_MINIMAL_OBJS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/codegen_test_minimal endif endif -$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/control.o: $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/control.o: -$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/messages.o: $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/messages.o: -$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/payloads.o: $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/payloads.o: -$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/services.o: $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/services.o: -$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/stats.o: $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/stats.o: -$(OBJDIR)/$(CONFIG)/test/cpp/codegen/codegen_test_minimal.o: $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/test/cpp/codegen/codegen_test_minimal.o: -$(OBJDIR)/$(CONFIG)/src/cpp/codegen/codegen_init.o: $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/src/cpp/codegen/codegen_init.o: deps_codegen_test_minimal: $(CODEGEN_TEST_MINIMAL_OBJS:.o=.dep) diff --git a/README.md b/README.md index 0edea885185..e6d8792d9c6 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See [Performance dashboard](http://performance-dot-grpc-testing.appspot.com/expl # Repository Structure & Status -This repository contains source code for gRPC libraries for multiple languages written on top of shared C core library [src/core](src/core). +This repository contains source code for gRPC libraries for multiple languages written on top of shared C core library [src/core] (src/core). Libraries in different languages may be in different states of development. We are seeking contributions for all of these libraries. @@ -36,9 +36,10 @@ Libraries in different languages may be in different states of development. We a | C# | [src/csharp](src/csharp) | 1.0 | | Objective-C | [src/objective-c](src/objective-c) | 1.0 | -Java source code is in the [grpc-java](http://github.com/grpc/grpc-java) -repository. Go source code is in the -[grpc-go](http://github.com/grpc/grpc-go) repository. + +Java source code is in the [grpc-java](http://github.com/grpc/grpc-java) repository. +Go source code is in the [grpc-go](http://github.com/grpc/grpc-go) repository. + See [MANIFEST.md](MANIFEST.md) for a listing of top-level items in the repository. diff --git a/WORKSPACE b/WORKSPACE index a78a88979e7..5ba82f3127b 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -15,17 +15,17 @@ bind( bind( name = "protobuf", - actual = "@com_google_protobuf//:protobuf", + actual = "@submodule_protobuf//:protobuf", ) bind( name = "protobuf_clib", - actual = "@com_google_protobuf//:protoc_lib", + actual = "@submodule_protobuf//:protoc_lib", ) bind( name = "protocol_compiler", - actual = "@com_google_protobuf//:protoc", + actual = "@submodule_protobuf//:protoc", ) bind( @@ -48,8 +48,9 @@ bind( actual = "@com_github_gflags_gflags//:gflags", ) -local_repository( +new_local_repository( name = "submodule_boringssl", + build_file = "third_party/boringssl-with-bazel/BUILD", path = "third_party/boringssl-with-bazel", ) @@ -60,7 +61,7 @@ new_local_repository( ) new_local_repository( - name = "com_google_protobuf", + name = "submodule_protobuf", build_file = "third_party/protobuf/BUILD", path = "third_party/protobuf", ) diff --git a/bazel/BUILD b/bazel/BUILD index cb2d9d66aee..b86dcc2ad7e 100644 --- a/bazel/BUILD +++ b/bazel/BUILD @@ -35,12 +35,12 @@ load(":cc_grpc_library.bzl", "cc_grpc_library") proto_library( name = "well_known_protos_list", - srcs = ["@com_google_protobuf//:well_known_protos"], + srcs = ["@submodule_protobuf//:well_known_protos"], ) cc_grpc_library( name = "well_known_protos", srcs = "well_known_protos_list", - proto_only = True, deps = [], + proto_only = True, ) diff --git a/bazel/cc_grpc_library.bzl b/bazel/cc_grpc_library.bzl index 0600bb9e304..ab1add476e1 100644 --- a/bazel/cc_grpc_library.bzl +++ b/bazel/cc_grpc_library.bzl @@ -2,7 +2,7 @@ load("//:bazel/generate_cc.bzl", "generate_cc") -def cc_grpc_library(name, srcs, deps, proto_only, well_known_protos, generate_mock, use_external = False, **kwargs): +def cc_grpc_library(name, srcs, deps, proto_only, well_known_protos, use_external = False, **kwargs): """Generates C++ grpc classes from a .proto file. Assumes the generated classes will be used in cc_api_version = 2. @@ -14,10 +14,9 @@ def cc_grpc_library(name, srcs, deps, proto_only, well_known_protos, generate_mo the compiled code of any message that the services depend on. well_known_protos: The target from protobuf library that exports well known protos. Currently it will only work if the value is - "@com_google_protobuf//:well_known_protos" + "@submodule_protobuf//:well_known_protos" use_external: When True the grpc deps are prefixed with //external. This allows grpc to be used as a dependency in other bazel projects. - generate_mock: When true GMOCk code for client stub is generated. **kwargs: rest of arguments, e.g., compatible_with and visibility. """ if len(srcs) > 1: @@ -55,7 +54,6 @@ def cc_grpc_library(name, srcs, deps, proto_only, well_known_protos, generate_mo srcs = [proto_target], plugin = plugin, well_known_protos = well_known_protos, - generate_mock = generate_mock, **kwargs ) diff --git a/bazel/generate_cc.bzl b/bazel/generate_cc.bzl index 8f0f94f563f..f3961f0a419 100644 --- a/bazel/generate_cc.bzl +++ b/bazel/generate_cc.bzl @@ -12,8 +12,6 @@ def generate_cc_impl(ctx): if ctx.executable.plugin: outs += [proto.basename[:-len(".proto")] + ".grpc.pb.h" for proto in protos] outs += [proto.basename[:-len(".proto")] + ".grpc.pb.cc" for proto in protos] - if ctx.attr.generate_mock: - outs += [proto.basename[:-len(".proto")] + "_mock.grpc.pb.h" for proto in protos] else: outs += [proto.basename[:-len(".proto")] + ".pb.h" for proto in protos] outs += [proto.basename[:-len(".proto")] + ".pb.cc" for proto in protos] @@ -25,10 +23,7 @@ def generate_cc_impl(ctx): arguments = [] if ctx.executable.plugin: arguments += ["--plugin=protoc-gen-PLUGIN=" + ctx.executable.plugin.path] - flags = list(ctx.attr.flags) - if ctx.attr.generate_mock: - flags.append("generate_mock_code=true") - arguments += ["--PLUGIN_out=" + ",".join(flags) + ":" + dir_out] + arguments += ["--PLUGIN_out=" + ",".join(ctx.attr.flags) + ":" + dir_out] additional_input = [ctx.executable.plugin] else: arguments += ["--cpp_out=" + ",".join(ctx.attr.flags) + ":" + dir_out] @@ -40,10 +35,10 @@ def generate_cc_impl(ctx): well_known_proto_files = [] if ctx.attr.well_known_protos: f = ctx.attr.well_known_protos.files.to_list()[0].dirname - if f != "external/com_google_protobuf/src/google/protobuf": - print("Error: Only @com_google_protobuf//:well_known_protos is supported") + if f != "external/submodule_protobuf/src/google/protobuf": + print("Error: Only @submodule_protobuf//:well_known_protos is supported") else: - # f points to "external/com_google_protobuf/src/google/protobuf" + # f points to "external/submodule_protobuf/src/google/protobuf" # add -I argument to protoc so it knows where to look for the proto files. arguments += ["-I{0}".format(f + "/../..")] well_known_proto_files = [f for f in ctx.attr.well_known_protos.files] @@ -76,10 +71,6 @@ generate_cc = rule( "well_known_protos" : attr.label( mandatory = False, ), - "generate_mock" : attr.bool( - default = False, - mandatory = False, - ), "_protoc": attr.label( default = Label("//external:protocol_compiler"), executable = True, diff --git a/bazel/grpc_build_system.bzl b/bazel/grpc_build_system.bzl index a104fa00a0b..8b524bd0e52 100644 --- a/bazel/grpc_build_system.bzl +++ b/bazel/grpc_build_system.bzl @@ -49,22 +49,6 @@ def grpc_cc_library(name, srcs = [], public_hdrs = [], hdrs = [], external_deps ] ) -def grpc_cc_libraries(name_list, additional_src_list = [], additional_dep_list = [], srcs = [], public_hdrs = [], hdrs = [], external_deps = [], deps = [], standalone = False, language="C++"): - names = len(name_list) - asl = additional_src_list + [[]]*(names - len(additional_src_list)) - adl = additional_dep_list + [[]]*(names - len(additional_dep_list)) - for i in range(names): - grpc_cc_library( - name = name_list[i], - srcs = srcs + asl[i], - hdrs = hdrs, - public_hdrs = public_hdrs, - deps = deps + adl[i], - external_deps = external_deps, - standalone = standalone, - language = language - ) - def grpc_proto_plugin(name, srcs = [], deps = []): native.cc_binary( name = name, @@ -75,7 +59,7 @@ def grpc_proto_plugin(name, srcs = [], deps = []): load("//:bazel/cc_grpc_library.bzl", "cc_grpc_library") def grpc_proto_library(name, srcs = [], deps = [], well_known_protos = None, - has_services = True, use_external = False, generate_mock = False): + has_services = True, use_external = False): cc_grpc_library( name = name, srcs = srcs, @@ -83,6 +67,5 @@ def grpc_proto_library(name, srcs = [], deps = [], well_known_protos = None, well_known_protos = well_known_protos, proto_only = not has_services, use_external = use_external, - generate_mock = generate_mock, ) diff --git a/binding.gyp b/binding.gyp index 45d0f719492..e3b2a925a30 100644 --- a/binding.gyp +++ b/binding.gyp @@ -666,10 +666,15 @@ 'src/core/lib/channel/channel_args.c', 'src/core/lib/channel/channel_stack.c', 'src/core/lib/channel/channel_stack_builder.c', + 'src/core/lib/channel/compress_filter.c', 'src/core/lib/channel/connected_channel.c', + 'src/core/lib/channel/deadline_filter.c', 'src/core/lib/channel/handshaker.c', 'src/core/lib/channel/handshaker_factory.c', 'src/core/lib/channel/handshaker_registry.c', + 'src/core/lib/channel/http_client_filter.c', + 'src/core/lib/channel/http_server_filter.c', + 'src/core/lib/channel/message_size_filter.c', 'src/core/lib/compression/compression.c', 'src/core/lib/compression/message_compress.c', 'src/core/lib/debug/trace.c', @@ -806,10 +811,6 @@ 'src/core/ext/transport/chttp2/transport/varint.c', 'src/core/ext/transport/chttp2/transport/writing.c', 'src/core/ext/transport/chttp2/alpn/alpn.c', - 'src/core/ext/filters/http/client/http_client_filter.c', - 'src/core/ext/filters/http/http_filters_plugin.c', - 'src/core/ext/filters/http/message_compress/message_compress_filter.c', - 'src/core/ext/filters/http/server/http_server_filter.c', 'src/core/lib/http/httpcli_security_connector.c', 'src/core/lib/security/context/security_context.c', 'src/core/lib/security/credentials/composite/composite_credentials.c', @@ -859,7 +860,6 @@ 'src/core/ext/filters/client_channel/subchannel.c', 'src/core/ext/filters/client_channel/subchannel_index.c', 'src/core/ext/filters/client_channel/uri_parser.c', - 'src/core/ext/filters/deadline/deadline_filter.c', 'src/core/ext/transport/chttp2/client/chttp2_connector.c', 'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c', 'src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c', @@ -896,7 +896,6 @@ 'src/core/ext/census/trace_context.c', 'src/core/ext/census/tracing.c', 'src/core/ext/filters/max_age/max_age_filter.c', - 'src/core/ext/filters/message_size/message_size_filter.c', 'src/core/plugin_registry/grpc_plugin_registry.c', ], "conditions": [ diff --git a/build.yaml b/build.yaml index 986b993d518..fbef42502d0 100644 --- a/build.yaml +++ b/build.yaml @@ -12,9 +12,9 @@ settings: '#08': Use "-preN" suffixes to identify pre-release versions '#09': Per-language overrides are possible with (eg) ruby_version tag here '#10': See the expand_version.py for all the quirks here - core_version: 4.0.0-dev + core_version: 3.0.0-pre1 g_stands_for: gentle - version: 1.4.0-dev + version: 1.3.0-pre1 filegroups: - name: census public_headers: @@ -176,11 +176,16 @@ filegroups: - src/core/lib/channel/channel_args.h - src/core/lib/channel/channel_stack.h - src/core/lib/channel/channel_stack_builder.h + - src/core/lib/channel/compress_filter.h - src/core/lib/channel/connected_channel.h - src/core/lib/channel/context.h + - src/core/lib/channel/deadline_filter.h - src/core/lib/channel/handshaker.h - src/core/lib/channel/handshaker_factory.h - src/core/lib/channel/handshaker_registry.h + - src/core/lib/channel/http_client_filter.h + - src/core/lib/channel/http_server_filter.h + - src/core/lib/channel/message_size_filter.h - src/core/lib/compression/algorithm_metadata.h - src/core/lib/compression/message_compress.h - src/core/lib/debug/trace.h @@ -283,10 +288,15 @@ filegroups: - src/core/lib/channel/channel_args.c - src/core/lib/channel/channel_stack.c - src/core/lib/channel/channel_stack_builder.c + - src/core/lib/channel/compress_filter.c - src/core/lib/channel/connected_channel.c + - src/core/lib/channel/deadline_filter.c - src/core/lib/channel/handshaker.c - src/core/lib/channel/handshaker_factory.c - src/core/lib/channel/handshaker_registry.c + - src/core/lib/channel/http_client_filter.c + - src/core/lib/channel/http_server_filter.c + - src/core/lib/channel/message_size_filter.c - src/core/lib/compression/compression.c - src/core/lib/compression/message_compress.c - src/core/lib/debug/trace.c @@ -448,7 +458,6 @@ filegroups: plugin: grpc_client_channel uses: - grpc_base - - grpc_deadline_filter - name: grpc_codegen public_headers: - include/grpc/impl/codegen/byte_buffer_reader.h @@ -461,27 +470,6 @@ filegroups: - include/grpc/impl/codegen/status.h uses: - gpr_codegen -- name: grpc_deadline_filter - headers: - - src/core/ext/filters/deadline/deadline_filter.h - src: - - src/core/ext/filters/deadline/deadline_filter.c - plugin: grpc_deadline_filter - uses: - - grpc_base -- name: grpc_http_filters - headers: - - src/core/ext/filters/http/client/http_client_filter.h - - src/core/ext/filters/http/message_compress/message_compress_filter.h - - src/core/ext/filters/http/server/http_server_filter.h - src: - - src/core/ext/filters/http/client/http_client_filter.c - - src/core/ext/filters/http/http_filters_plugin.c - - src/core/ext/filters/http/message_compress/message_compress_filter.c - - src/core/ext/filters/http/server/http_server_filter.c - plugin: grpc_http_filters - uses: - - grpc_base - name: grpc_lb_policy_grpclb headers: - src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h @@ -547,14 +535,6 @@ filegroups: plugin: grpc_max_age_filter uses: - grpc_base -- name: grpc_message_size_filter - headers: - - src/core/ext/filters/message_size/message_size_filter.h - src: - - src/core/ext/filters/message_size/message_size_filter.c - plugin: grpc_message_size_filter - uses: - - grpc_base - name: grpc_resolver_dns_ares headers: - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h @@ -718,7 +698,6 @@ filegroups: uses: - grpc_base - grpc_transport_chttp2_alpn - - grpc_http_filters - name: grpc_transport_chttp2_alpn headers: - src/core/ext/transport/chttp2/alpn/alpn.h @@ -792,7 +771,6 @@ filegroups: filegroups: - grpc_base - grpc_transport_chttp2 - - grpc_http_filters - name: nanopb headers: - third_party/nanopb/pb.h @@ -939,6 +917,7 @@ filegroups: - include/grpc++/impl/codegen/slice.h - include/grpc++/impl/codegen/status.h - include/grpc++/impl/codegen/status_code_enum.h + - include/grpc++/impl/codegen/status_helper.h - include/grpc++/impl/codegen/string_ref.h - include/grpc++/impl/codegen/stub_options.h - include/grpc++/impl/codegen/sync_stream.h @@ -969,7 +948,6 @@ filegroups: - name: grpc++_test language: c++ public_headers: - - include/grpc++/test/mock_stream.h - include/grpc++/test/server_context_test_spouse.h deps: - grpc++ @@ -1023,8 +1001,6 @@ libs: - grpc_secure - census - grpc_max_age_filter - - grpc_message_size_filter - - grpc_deadline_filter generate_plugin_registry: true secure: true vs_packages: @@ -1122,8 +1098,6 @@ libs: - grpc_lb_policy_round_robin - census - grpc_max_age_filter - - grpc_message_size_filter - - grpc_deadline_filter generate_plugin_registry: true secure: false vs_project_guid: '{46CEDFFF-9692-456A-AA24-38B5D6BCF4C5}' @@ -1517,7 +1491,6 @@ libs: - global targets: - name: alarm_test - cpu_cost: 0.1 build: test language: c src: @@ -1701,7 +1674,7 @@ targets: dict: test/core/end2end/fuzzers/hpack.dictionary maxlen: 2048 - name: combiner_test - cpu_cost: 10 + cpu_cost: 30 build: test language: c src: @@ -1722,7 +1695,6 @@ targets: - gpr_test_util - gpr - name: concurrent_connectivity_test - cpu_cost: 2.0 build: test language: c src: @@ -1809,7 +1781,6 @@ targets: - gpr_test_util - gpr - name: ev_epoll_linux_test - cpu_cost: 3 build: test language: c src: @@ -1823,16 +1794,6 @@ targets: - uv platforms: - linux -- name: fake_resolver_test - build: test - language: c - src: - - test/core/client_channel/resolvers/fake_resolver_test.c - deps: - - grpc_test_util - - grpc - - gpr_test_util - - gpr - name: fd_conservation_posix_test build: test language: c @@ -1979,7 +1940,6 @@ targets: - gpr_test_util - gpr - name: gpr_cpu_test - cpu_cost: 30 build: test language: c src: @@ -2029,7 +1989,7 @@ targets: - gpr_test_util - gpr - name: gpr_spinlock_test - cpu_cost: 3 + cpu_cost: 10 build: test language: c src: @@ -2560,16 +2520,6 @@ targets: - grpc - gpr_test_util - gpr -- name: minimal_stack_is_minimal_test - build: test - language: c - src: - - test/core/channel/minimal_stack_is_minimal_test.c - deps: - - grpc_test_util - - grpc - - gpr_test_util - - gpr - name: mlog_test flaky: true build: test @@ -2811,16 +2761,6 @@ targets: - grpc - gpr_test_util - gpr -- name: slice_hash_table_test - build: test - language: c - src: - - test/core/slice/slice_hash_table_test.c - deps: - - grpc_test_util - - grpc - - gpr_test_util - - gpr - name: slice_string_helpers_test build: test language: c @@ -3570,9 +3510,6 @@ targets: - src/proto/grpc/testing/services.proto - src/proto/grpc/testing/stats.proto - test/cpp/codegen/codegen_test_minimal.cc - deps: - - grpc - - gpr filegroups: - grpc++_codegen_base - grpc++_codegen_base_src @@ -3692,7 +3629,7 @@ targets: - grpc - gpr args: - - --generated_file_path=gens/src/proto/grpc/testing/ + - --generated_file_path=gens/src/proto/grpc/testing/compiler_test.grpc.pb.h - name: grpc_cli build: test run: false @@ -3953,8 +3890,6 @@ targets: gtest: true build: test language: c++ - headers: - - include/grpc++/test/mock_stream.h src: - test/cpp/end2end/mock_test.cc deps: @@ -4397,10 +4332,6 @@ configs: basicprof: CPPFLAGS: -O2 -DGRPC_BASIC_PROFILER -DGRPC_TIMERS_RDTSC DEFINES: NDEBUG - c++-compat: - CFLAGS: -Wc++-compat - CPPFLAGS: -O0 - DEFINES: _DEBUG DEBUG counters: CPPFLAGS: -O2 -DGPR_LOW_LEVEL_COUNTERS DEFINES: NDEBUG @@ -4467,7 +4398,7 @@ configs: CPPFLAGS: -O0 -fsanitize-coverage=edge -fsanitize=undefined -fno-omit-frame-pointer -Wno-unused-command-line-argument -Wvarargs CXX: clang++ - DEFINES: NDEBUG GRPC_UBSAN + DEFINES: NDEBUG LD: clang LDFLAGS: -fsanitize=undefined,unsigned-integer-overflow LDXX: clang++ diff --git a/build_config.rb b/build_config.rb index 9a69070dc71..b5a8c2020ba 100644 --- a/build_config.rb +++ b/build_config.rb @@ -28,5 +28,5 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. module GrpcBuildConfig - CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-4.dll' + CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-3.dll' end diff --git a/config.m4 b/config.m4 index 3f5c85391bb..74b60c9241c 100644 --- a/config.m4 +++ b/config.m4 @@ -91,10 +91,15 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/channel/channel_args.c \ src/core/lib/channel/channel_stack.c \ src/core/lib/channel/channel_stack_builder.c \ + src/core/lib/channel/compress_filter.c \ src/core/lib/channel/connected_channel.c \ + src/core/lib/channel/deadline_filter.c \ src/core/lib/channel/handshaker.c \ src/core/lib/channel/handshaker_factory.c \ src/core/lib/channel/handshaker_registry.c \ + src/core/lib/channel/http_client_filter.c \ + src/core/lib/channel/http_server_filter.c \ + src/core/lib/channel/message_size_filter.c \ src/core/lib/compression/compression.c \ src/core/lib/compression/message_compress.c \ src/core/lib/debug/trace.c \ @@ -231,10 +236,6 @@ if test "$PHP_GRPC" != "no"; then src/core/ext/transport/chttp2/transport/varint.c \ src/core/ext/transport/chttp2/transport/writing.c \ src/core/ext/transport/chttp2/alpn/alpn.c \ - src/core/ext/filters/http/client/http_client_filter.c \ - src/core/ext/filters/http/http_filters_plugin.c \ - src/core/ext/filters/http/message_compress/message_compress_filter.c \ - src/core/ext/filters/http/server/http_server_filter.c \ src/core/lib/http/httpcli_security_connector.c \ src/core/lib/security/context/security_context.c \ src/core/lib/security/credentials/composite/composite_credentials.c \ @@ -284,7 +285,6 @@ if test "$PHP_GRPC" != "no"; then src/core/ext/filters/client_channel/subchannel.c \ src/core/ext/filters/client_channel/subchannel_index.c \ src/core/ext/filters/client_channel/uri_parser.c \ - src/core/ext/filters/deadline/deadline_filter.c \ src/core/ext/transport/chttp2/client/chttp2_connector.c \ src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \ src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c \ @@ -321,7 +321,6 @@ if test "$PHP_GRPC" != "no"; then src/core/ext/census/trace_context.c \ src/core/ext/census/tracing.c \ src/core/ext/filters/max_age/max_age_filter.c \ - src/core/ext/filters/message_size/message_size_filter.c \ src/core/plugin_registry/grpc_plugin_registry.c \ src/boringssl/err_data.c \ third_party/boringssl/crypto/aes/aes.c \ @@ -694,14 +693,8 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/dns/c_ares) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/dns/native) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/sockaddr) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/deadline) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/http) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/http/client) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/http/message_compress) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/http/server) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/load_reporting) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/max_age) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/message_size) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/alpn) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/client) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/client/insecure) diff --git a/doc/binary-logging.md b/doc/binary-logging.md index 86b3f766dbd..69020d98285 100644 --- a/doc/binary-logging.md +++ b/doc/binary-logging.md @@ -2,7 +2,7 @@ ## Format -The log format is described in [this proto file](/src/proto/grpc/binary_log/v1alpha/log.proto). It is intended that multiple parts of the call will be logged in separate files, and then correlated by analysis tools using the rpc\_id. +The log format is described in [this proto file](src/proto/grpc/binary_log/v1alpha/log.proto). It is intended that multiple parts of the call will be logged in separate files, and then correlated by analysis tools using the rpc\_id. ## API diff --git a/doc/interop-test-descriptions.md b/doc/interop-test-descriptions.md index b040621f883..66a034d6307 100644 --- a/doc/interop-test-descriptions.md +++ b/doc/interop-test-descriptions.md @@ -81,8 +81,9 @@ Procedure: Client marks the request as cacheable by setting the cacheable flag in the request context. Longer term this should be driven by the method option specified in the proto file itself. - 2. Client calls CacheableUnaryCall again immediately with the same request and - configuration as the previous call. + 2. Client calls CacheableUnaryCall with `SimpleRequest` request again + immediately with the same payload as the previous request. Cacheable flag is + also set for this request's context. Client asserts: * Both calls were successful @@ -985,7 +986,6 @@ for the `SimpleRequest.response_type`. If the server does not support the `response_type`, then it should fail the RPC with `INVALID_ARGUMENT`. ### CacheableUnaryCall -[CacheableUnaryCall]: #cacheableunarycall Server gets the default SimpleRequest proto as the request. The content of the request is ignored. It returns the SimpleResponse proto with the payload set diff --git a/doc/server_side_auth.md b/doc/server_side_auth.md index d260237928d..288c6e9cb38 100644 --- a/doc/server_side_auth.md +++ b/doc/server_side_auth.md @@ -13,7 +13,7 @@ The contents of the *auth properties* are populated by an *auth interceptor*. Th WARNING: AuthContext is the only reliable source of truth when it comes to authenticating RPCs. Using any other call/context properties for authentication purposes is wrong and inherently unsafe. -#### Example AuthContext contents +####Example AuthContext contents For secure channel using mutual TLS authentication with both client and server certificates (test certificates from this repository are used). @@ -45,7 +45,7 @@ gRPC comes with some basic "interceptors" already built-in. WARNING: While there is a public API that allows anyone to write their own custom interceptor, please think twice before using it. There are legitimate uses for custom interceptors but you should keep in mind that as auth interceptors essentially decide which RPCs are authenticated and which are not, their code is very sensitive from the security perspective and getting things wrong might have serious consequences. If unsure, we strongly recommend to rely on official & proven interceptors that come with gRPC. -#### Available auth interceptors +####Available auth interceptors - TLS/SSL certificate authentication (built into gRPC's security layer, automatically used whenever you use a secure connection) - (coming soon) JWT auth token authentication - more will be added over time diff --git a/doc/service_config.md b/doc/service_config.md index 8039fcad095..ecc23817d12 100644 --- a/doc/service_config.md +++ b/doc/service_config.md @@ -13,21 +13,12 @@ The service config is a JSON string of the following form: ``` { // Load balancing policy name. - // Currently, the only selectable client-side policy provided with gRPC - // is 'round_robin', but third parties may add their own policies. - // This field is optional; if unset, the default behavior is to pick - // the first available backend. - // If the policy name is set via the client API, that value overrides - // the value specified here. - // - // Note that if the resolver returns at least one balancer address (as - // opposed to backend addresses), gRPC will use grpclb (see - // https://github.com/grpc/grpc/blob/master/doc/load-balancing.md), - // regardless of what LB policy is requested either here or via the - // client API. However, if the resolver returns at least one backend - // address in addition to the balancer address(es), the client may fall - // back to the requested policy if it is unable to reach any of the - // grpclb load balancers. + // Supported values are 'round_robin' and 'grpclb'. + // Optional; if unset, the default behavior is pick the first available + // backend. + // Note that if the resolver returns only balancer addresses and no + // backend addresses, gRPC will always use the 'grpclb' policy, + // regardless of what this field is set to. 'loadBalancingPolicy': string, // Per-method configuration. Optional. diff --git a/examples/cpp/README.md b/examples/cpp/README.md index 8e2bb5d13b1..783935cd53d 100644 --- a/examples/cpp/README.md +++ b/examples/cpp/README.md @@ -1,4 +1,4 @@ -# gRPC in 3 minutes (C++) +#gRPC in 3 minutes (C++) ## Installation diff --git a/examples/cpp/cpptutorial.md b/examples/cpp/cpptutorial.md index 7d98367da43..ae84aba9163 100644 --- a/examples/cpp/cpptutorial.md +++ b/examples/cpp/cpptutorial.md @@ -1,4 +1,4 @@ -# gRPC Basics: C++ +#gRPC Basics: C++ This tutorial provides a basic C++ programmer's introduction to working with gRPC. By walking through this example you'll learn how to: diff --git a/examples/csharp/helloworld-from-cli/Greeter.sln b/examples/csharp/helloworld-from-cli/Greeter.sln deleted file mode 100644 index ca50470e664..00000000000 --- a/examples/csharp/helloworld-from-cli/Greeter.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26228.4 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Greeter", "Greeter\Greeter.csproj", "{13B6DFC8-F5F6-4CC2-99DF-57A7CF042033}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GreeterClient", "GreeterClient\GreeterClient.csproj", "{B754FB02-D501-4308-8B89-33AB7119C80D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GreeterServer", "GreeterServer\GreeterServer.csproj", "{DDBFF994-E076-43AD-B18D-049DFC1B670C}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {13B6DFC8-F5F6-4CC2-99DF-57A7CF042033}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {13B6DFC8-F5F6-4CC2-99DF-57A7CF042033}.Debug|Any CPU.Build.0 = Debug|Any CPU - {13B6DFC8-F5F6-4CC2-99DF-57A7CF042033}.Release|Any CPU.ActiveCfg = Release|Any CPU - {13B6DFC8-F5F6-4CC2-99DF-57A7CF042033}.Release|Any CPU.Build.0 = Release|Any CPU - {B754FB02-D501-4308-8B89-33AB7119C80D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B754FB02-D501-4308-8B89-33AB7119C80D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B754FB02-D501-4308-8B89-33AB7119C80D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B754FB02-D501-4308-8B89-33AB7119C80D}.Release|Any CPU.Build.0 = Release|Any CPU - {DDBFF994-E076-43AD-B18D-049DFC1B670C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DDBFF994-E076-43AD-B18D-049DFC1B670C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DDBFF994-E076-43AD-B18D-049DFC1B670C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DDBFF994-E076-43AD-B18D-049DFC1B670C}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/examples/csharp/helloworld-from-cli/Greeter/Greeter.csproj b/examples/csharp/helloworld-from-cli/Greeter/Greeter.csproj deleted file mode 100644 index 6b26be1c9cd..00000000000 --- a/examples/csharp/helloworld-from-cli/Greeter/Greeter.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - Greeter - netcoreapp1.0 - portable - Greeter - Greeter - 1.0.4 - - - - - - - - - - diff --git a/examples/csharp/helloworld-from-cli/Greeter/Helloworld.cs b/examples/csharp/helloworld-from-cli/Greeter/Helloworld.cs index ecfc8e131cb..6477b4f35be 100644 --- a/examples/csharp/helloworld-from-cli/Greeter/Helloworld.cs +++ b/examples/csharp/helloworld-from-cli/Greeter/Helloworld.cs @@ -10,6 +10,7 @@ using scg = global::System.Collections.Generic; namespace Helloworld { /// Holder for reflection information generated from helloworld.proto + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class HelloworldReflection { #region Descriptor @@ -40,36 +41,31 @@ namespace Helloworld { } #region Messages /// - /// The request message containing the user's name. + /// The request message containing the user's name. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class HelloRequest : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HelloRequest()); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Helloworld.HelloworldReflection.Descriptor.MessageTypes[0]; } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HelloRequest() { OnConstruction(); } partial void OnConstruction(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HelloRequest(HelloRequest other) : this() { name_ = other.name_; } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HelloRequest Clone() { return new HelloRequest(this); } @@ -77,7 +73,6 @@ namespace Helloworld { /// Field number for the "name" field. public const int NameFieldNumber = 1; private string name_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Name { get { return name_; } set { @@ -85,12 +80,10 @@ namespace Helloworld { } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as HelloRequest); } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(HelloRequest other) { if (ReferenceEquals(other, null)) { return false; @@ -102,19 +95,16 @@ namespace Helloworld { return true; } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); return hash; } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Name.Length != 0) { output.WriteRawTag(10); @@ -122,7 +112,6 @@ namespace Helloworld { } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Name.Length != 0) { @@ -131,7 +120,6 @@ namespace Helloworld { return size; } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(HelloRequest other) { if (other == null) { return; @@ -141,7 +129,6 @@ namespace Helloworld { } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -160,36 +147,31 @@ namespace Helloworld { } /// - /// The response message containing the greetings + /// The response message containing the greetings /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class HelloReply : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HelloReply()); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Helloworld.HelloworldReflection.Descriptor.MessageTypes[1]; } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HelloReply() { OnConstruction(); } partial void OnConstruction(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HelloReply(HelloReply other) : this() { message_ = other.message_; } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HelloReply Clone() { return new HelloReply(this); } @@ -197,7 +179,6 @@ namespace Helloworld { /// Field number for the "message" field. public const int MessageFieldNumber = 1; private string message_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Message { get { return message_; } set { @@ -205,12 +186,10 @@ namespace Helloworld { } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as HelloReply); } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(HelloReply other) { if (ReferenceEquals(other, null)) { return false; @@ -222,19 +201,16 @@ namespace Helloworld { return true; } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Message.Length != 0) hash ^= Message.GetHashCode(); return hash; } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Message.Length != 0) { output.WriteRawTag(10); @@ -242,7 +218,6 @@ namespace Helloworld { } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Message.Length != 0) { @@ -251,7 +226,6 @@ namespace Helloworld { return size; } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(HelloReply other) { if (other == null) { return; @@ -261,7 +235,6 @@ namespace Helloworld { } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { diff --git a/examples/csharp/helloworld-from-cli/Greeter/HelloworldGrpc.cs b/examples/csharp/helloworld-from-cli/Greeter/HelloworldGrpc.cs index b321ea9e682..041f5a78d75 100644 --- a/examples/csharp/helloworld-from-cli/Greeter/HelloworldGrpc.cs +++ b/examples/csharp/helloworld-from-cli/Greeter/HelloworldGrpc.cs @@ -35,21 +35,21 @@ using System; using System.Threading; using System.Threading.Tasks; -using grpc = global::Grpc.Core; +using Grpc.Core; namespace Helloworld { /// - /// The greeting service definition. + /// The greeting service definition. /// - public static partial class Greeter + public static class Greeter { static readonly string __ServiceName = "helloworld.Greeter"; - static readonly grpc::Marshaller __Marshaller_HelloRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloRequest.Parser.ParseFrom); - static readonly grpc::Marshaller __Marshaller_HelloReply = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloReply.Parser.ParseFrom); + static readonly Marshaller __Marshaller_HelloRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloRequest.Parser.ParseFrom); + static readonly Marshaller __Marshaller_HelloReply = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloReply.Parser.ParseFrom); - static readonly grpc::Method __Method_SayHello = new grpc::Method( - grpc::MethodType.Unary, + static readonly Method __Method_SayHello = new Method( + MethodType.Unary, __ServiceName, "SayHello", __Marshaller_HelloRequest, @@ -62,32 +62,29 @@ namespace Helloworld { } /// Base class for server-side implementations of Greeter - public abstract partial class GreeterBase + public abstract class GreeterBase { /// - /// Sends a greeting + /// Sends a greeting /// - /// The request received from the client. - /// The context of the server-side call handler being invoked. - /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task SayHello(global::Helloworld.HelloRequest request, grpc::ServerCallContext context) + public virtual global::System.Threading.Tasks.Task SayHello(global::Helloworld.HelloRequest request, ServerCallContext context) { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + throw new RpcException(new Status(StatusCode.Unimplemented, "")); } } /// Client for Greeter - public partial class GreeterClient : grpc::ClientBase + public class GreeterClient : ClientBase { /// Creates a new client for Greeter /// The channel to use to make remote calls. - public GreeterClient(grpc::Channel channel) : base(channel) + public GreeterClient(Channel channel) : base(channel) { } /// Creates a new client for Greeter that uses a custom CallInvoker. /// The callInvoker to use to make remote calls. - public GreeterClient(grpc::CallInvoker callInvoker) : base(callInvoker) + public GreeterClient(CallInvoker callInvoker) : base(callInvoker) { } /// Protected parameterless constructor to allow creation of test doubles. @@ -101,50 +98,33 @@ namespace Helloworld { } /// - /// Sends a greeting + /// Sends a greeting /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The response received from the server. - public virtual global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return SayHello(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + return SayHello(request, new CallOptions(headers, deadline, cancellationToken)); } /// - /// Sends a greeting + /// Sends a greeting /// - /// The request to send to the server. - /// The options for the call. - /// The response received from the server. - public virtual global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, grpc::CallOptions options) + public virtual global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_SayHello, null, options, request); } /// - /// Sends a greeting + /// Sends a greeting /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncUnaryCall SayHelloAsync(global::Helloworld.HelloRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual AsyncUnaryCall SayHelloAsync(global::Helloworld.HelloRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return SayHelloAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + return SayHelloAsync(request, new CallOptions(headers, deadline, cancellationToken)); } /// - /// Sends a greeting + /// Sends a greeting /// - /// The request to send to the server. - /// The options for the call. - /// The call object. - public virtual grpc::AsyncUnaryCall SayHelloAsync(global::Helloworld.HelloRequest request, grpc::CallOptions options) + public virtual AsyncUnaryCall SayHelloAsync(global::Helloworld.HelloRequest request, CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_SayHello, null, options, request); } - /// Creates a new instance of client from given ClientBaseConfiguration. protected override GreeterClient NewInstance(ClientBaseConfiguration configuration) { return new GreeterClient(configuration); @@ -152,10 +132,9 @@ namespace Helloworld { } /// Creates service definition that can be registered with a server - /// An object implementing the server-side handling logic. - public static grpc::ServerServiceDefinition BindService(GreeterBase serviceImpl) + public static ServerServiceDefinition BindService(GreeterBase serviceImpl) { - return grpc::ServerServiceDefinition.CreateBuilder() + return ServerServiceDefinition.CreateBuilder() .AddMethod(__Method_SayHello, serviceImpl.SayHello).Build(); } diff --git a/examples/csharp/helloworld-from-cli/Greeter/project.json b/examples/csharp/helloworld-from-cli/Greeter/project.json new file mode 100644 index 00000000000..72254ce73e9 --- /dev/null +++ b/examples/csharp/helloworld-from-cli/Greeter/project.json @@ -0,0 +1,31 @@ +{ + "title": "Greeter", + "version": "1.0.0-*", + "buildOptions": { + "debugType": "portable", + }, + "dependencies": { + "Google.Protobuf": "3.0.0", + "Grpc": "1.0.1", + }, + "frameworks": { + "net45": { + "frameworkAssemblies": { + "System.Runtime": "", + "System.IO": "" + }, + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1" + } + }, + "netcoreapp1.0": { + "dependencies": { + "Microsoft.NETCore.App": { + "type": "platform", + "version": "1.0.1" + } + }, + "imports": "dnxcore50" + } + } +} diff --git a/examples/csharp/helloworld-from-cli/GreeterClient/GreeterClient.csproj b/examples/csharp/helloworld-from-cli/GreeterClient/GreeterClient.csproj deleted file mode 100644 index 24cacfc0219..00000000000 --- a/examples/csharp/helloworld-from-cli/GreeterClient/GreeterClient.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - GreeterClient - netcoreapp1.0 - portable - GreeterClient - Exe - GreeterClient - 1.0.4 - - - - - - - diff --git a/examples/csharp/helloworld-from-cli/GreeterClient/project.json b/examples/csharp/helloworld-from-cli/GreeterClient/project.json new file mode 100644 index 00000000000..09e156f68e8 --- /dev/null +++ b/examples/csharp/helloworld-from-cli/GreeterClient/project.json @@ -0,0 +1,35 @@ +{ + "title": "GreeterClient", + "version": "1.0.0-*", + "buildOptions": { + "debugType": "portable", + "emitEntryPoint": "true" + }, + "dependencies": { + "Google.Protobuf": "3.0.0", + "Grpc": "1.0.1", + "Greeter": { + "target": "project" + } + }, + "frameworks": { + "net45": { + "frameworkAssemblies": { + "System.Runtime": "", + "System.IO": "" + }, + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1" + } + }, + "netcoreapp1.0": { + "dependencies": { + "Microsoft.NETCore.App": { + "type": "platform", + "version": "1.0.1" + } + }, + "imports": "dnxcore50" + } + } +} diff --git a/examples/csharp/helloworld-from-cli/GreeterServer/GreeterServer.csproj b/examples/csharp/helloworld-from-cli/GreeterServer/GreeterServer.csproj deleted file mode 100644 index f7980fa7283..00000000000 --- a/examples/csharp/helloworld-from-cli/GreeterServer/GreeterServer.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - GreeterServer - netcoreapp1.0 - portable - GreeterServer - Exe - GreeterServer - 1.0.4 - - - - - - - diff --git a/examples/csharp/helloworld-from-cli/GreeterServer/project.json b/examples/csharp/helloworld-from-cli/GreeterServer/project.json new file mode 100644 index 00000000000..8802fe32657 --- /dev/null +++ b/examples/csharp/helloworld-from-cli/GreeterServer/project.json @@ -0,0 +1,35 @@ +{ + "title": "GreeterServer", + "version": "1.0.0-*", + "buildOptions": { + "debugType": "portable", + "emitEntryPoint": "true" + }, + "dependencies": { + "Google.Protobuf": "3.0.0", + "Grpc": "1.0.1", + "Greeter": { + "target": "project" + } + }, + "frameworks": { + "net45": { + "frameworkAssemblies": { + "System.Runtime": "", + "System.IO": "" + }, + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1" + } + }, + "netcoreapp1.0": { + "dependencies": { + "Microsoft.NETCore.App": { + "type": "platform", + "version": "1.0.1" + } + }, + "imports": "dnxcore50" + } + } +} diff --git a/examples/csharp/helloworld-from-cli/README.md b/examples/csharp/helloworld-from-cli/README.md index c8f8149f73a..4db077631d8 100644 --- a/examples/csharp/helloworld-from-cli/README.md +++ b/examples/csharp/helloworld-from-cli/README.md @@ -12,19 +12,26 @@ Example projects in this directory depend on the [Grpc](https://www.nuget.org/pa and [Google.Protobuf](https://www.nuget.org/packages/Google.Protobuf/) NuGet packages which have been already added to the project for you. +The examples in this directory target .NET 4.5 framework, as .NET Core support is +currently experimental. + PREREQUISITES ------------- -- The [.NET Core SDK](https://www.microsoft.com/net/core). +- The DotNetCore SDK cli. + +- The .NET 4.5 framework. + +Both are available to download at https://www.microsoft.com/net/download BUILD ------- From the `examples/csharp/helloworld-from-cli` directory: -- `dotnet restore Greeter.sln` +- `dotnet restore` -- `dotnet build Greeter.sln` +- `dotnet build **/project.json` (this will automatically download NuGet dependencies) Try it! ------- @@ -33,14 +40,14 @@ Try it! ``` > cd GreeterServer - > dotnet run -f netcoreapp1.0 + > dotnet run ``` - Run the client ``` > cd GreeterClient - > dotnet run -f netcoreapp1.0 + > dotnet run ``` Tutorial diff --git a/examples/csharp/helloworld-from-cli/generate_protos.bat b/examples/csharp/helloworld-from-cli/generate_protos.bat deleted file mode 100644 index 0a35b70e088..00000000000 --- a/examples/csharp/helloworld-from-cli/generate_protos.bat +++ /dev/null @@ -1,42 +0,0 @@ -@rem Copyright 2016, Google Inc. -@rem All rights reserved. -@rem -@rem Redistribution and use in source and binary forms, with or without -@rem modification, are permitted provided that the following conditions are -@rem met: -@rem -@rem * Redistributions of source code must retain the above copyright -@rem notice, this list of conditions and the following disclaimer. -@rem * Redistributions in binary form must reproduce the above -@rem copyright notice, this list of conditions and the following disclaimer -@rem in the documentation and/or other materials provided with the -@rem distribution. -@rem * Neither the name of Google Inc. nor the names of its -@rem contributors may be used to endorse or promote products derived from -@rem this software without specific prior written permission. -@rem -@rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -@rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -@rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -@rem A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -@rem OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -@rem SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -@rem LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -@rem DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -@rem THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -@rem (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -@rem OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -@rem Generate the C# code for .proto files - -setlocal - -@rem enter this directory -cd /d %~dp0 - -set PROTOC=%UserProfile%\.nuget\packages\Google.Protobuf.Tools\3.2.0\tools\windows_x64\protoc.exe -set PLUGIN=%UserProfile%\.nuget\packages\Grpc.Tools\1.2.2\tools\windows_x64\grpc_csharp_plugin.exe - -%PROTOC% -I../../protos --csharp_out Greeter ../../protos/helloworld.proto --grpc_out Greeter --plugin=protoc-gen-grpc=%PLUGIN% - -endlocal diff --git a/examples/csharp/helloworld-from-cli/global.json b/examples/csharp/helloworld-from-cli/global.json new file mode 100644 index 00000000000..f3c33cef6a5 --- /dev/null +++ b/examples/csharp/helloworld-from-cli/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "1.0.0-preview2-003131" + } +} \ No newline at end of file diff --git a/examples/csharp/helloworld/Greeter/Greeter.csproj b/examples/csharp/helloworld/Greeter/Greeter.csproj index 8dcd2d90666..036e6b59fbc 100644 --- a/examples/csharp/helloworld/Greeter/Greeter.csproj +++ b/examples/csharp/helloworld/Greeter/Greeter.csproj @@ -10,8 +10,7 @@ Greeter Greeter v4.5 - - + 2669b4f2 true @@ -32,18 +31,18 @@ false - - ..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll - True + + False + ..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll - - ..\packages\Grpc.Core.1.2.2\lib\net45\Grpc.Core.dll - True + + False + ..\packages\Grpc.Core.1.0.1\lib\net45\Grpc.Core.dll - - ..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll - True + + False + ..\packages\System.Interactive.Async.3.0.0\lib\net45\System.Interactive.Async.dll @@ -62,11 +61,11 @@ - + - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + - \ No newline at end of file + diff --git a/examples/csharp/helloworld/Greeter/Helloworld.cs b/examples/csharp/helloworld/Greeter/Helloworld.cs index ecfc8e131cb..6477b4f35be 100644 --- a/examples/csharp/helloworld/Greeter/Helloworld.cs +++ b/examples/csharp/helloworld/Greeter/Helloworld.cs @@ -10,6 +10,7 @@ using scg = global::System.Collections.Generic; namespace Helloworld { /// Holder for reflection information generated from helloworld.proto + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class HelloworldReflection { #region Descriptor @@ -40,36 +41,31 @@ namespace Helloworld { } #region Messages /// - /// The request message containing the user's name. + /// The request message containing the user's name. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class HelloRequest : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HelloRequest()); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Helloworld.HelloworldReflection.Descriptor.MessageTypes[0]; } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HelloRequest() { OnConstruction(); } partial void OnConstruction(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HelloRequest(HelloRequest other) : this() { name_ = other.name_; } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HelloRequest Clone() { return new HelloRequest(this); } @@ -77,7 +73,6 @@ namespace Helloworld { /// Field number for the "name" field. public const int NameFieldNumber = 1; private string name_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Name { get { return name_; } set { @@ -85,12 +80,10 @@ namespace Helloworld { } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as HelloRequest); } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(HelloRequest other) { if (ReferenceEquals(other, null)) { return false; @@ -102,19 +95,16 @@ namespace Helloworld { return true; } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); return hash; } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Name.Length != 0) { output.WriteRawTag(10); @@ -122,7 +112,6 @@ namespace Helloworld { } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Name.Length != 0) { @@ -131,7 +120,6 @@ namespace Helloworld { return size; } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(HelloRequest other) { if (other == null) { return; @@ -141,7 +129,6 @@ namespace Helloworld { } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -160,36 +147,31 @@ namespace Helloworld { } /// - /// The response message containing the greetings + /// The response message containing the greetings /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class HelloReply : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HelloReply()); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Helloworld.HelloworldReflection.Descriptor.MessageTypes[1]; } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HelloReply() { OnConstruction(); } partial void OnConstruction(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HelloReply(HelloReply other) : this() { message_ = other.message_; } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HelloReply Clone() { return new HelloReply(this); } @@ -197,7 +179,6 @@ namespace Helloworld { /// Field number for the "message" field. public const int MessageFieldNumber = 1; private string message_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Message { get { return message_; } set { @@ -205,12 +186,10 @@ namespace Helloworld { } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as HelloReply); } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(HelloReply other) { if (ReferenceEquals(other, null)) { return false; @@ -222,19 +201,16 @@ namespace Helloworld { return true; } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Message.Length != 0) hash ^= Message.GetHashCode(); return hash; } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Message.Length != 0) { output.WriteRawTag(10); @@ -242,7 +218,6 @@ namespace Helloworld { } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Message.Length != 0) { @@ -251,7 +226,6 @@ namespace Helloworld { return size; } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(HelloReply other) { if (other == null) { return; @@ -261,7 +235,6 @@ namespace Helloworld { } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { diff --git a/examples/csharp/helloworld/Greeter/HelloworldGrpc.cs b/examples/csharp/helloworld/Greeter/HelloworldGrpc.cs index b321ea9e682..041f5a78d75 100644 --- a/examples/csharp/helloworld/Greeter/HelloworldGrpc.cs +++ b/examples/csharp/helloworld/Greeter/HelloworldGrpc.cs @@ -35,21 +35,21 @@ using System; using System.Threading; using System.Threading.Tasks; -using grpc = global::Grpc.Core; +using Grpc.Core; namespace Helloworld { /// - /// The greeting service definition. + /// The greeting service definition. /// - public static partial class Greeter + public static class Greeter { static readonly string __ServiceName = "helloworld.Greeter"; - static readonly grpc::Marshaller __Marshaller_HelloRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloRequest.Parser.ParseFrom); - static readonly grpc::Marshaller __Marshaller_HelloReply = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloReply.Parser.ParseFrom); + static readonly Marshaller __Marshaller_HelloRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloRequest.Parser.ParseFrom); + static readonly Marshaller __Marshaller_HelloReply = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloReply.Parser.ParseFrom); - static readonly grpc::Method __Method_SayHello = new grpc::Method( - grpc::MethodType.Unary, + static readonly Method __Method_SayHello = new Method( + MethodType.Unary, __ServiceName, "SayHello", __Marshaller_HelloRequest, @@ -62,32 +62,29 @@ namespace Helloworld { } /// Base class for server-side implementations of Greeter - public abstract partial class GreeterBase + public abstract class GreeterBase { /// - /// Sends a greeting + /// Sends a greeting /// - /// The request received from the client. - /// The context of the server-side call handler being invoked. - /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task SayHello(global::Helloworld.HelloRequest request, grpc::ServerCallContext context) + public virtual global::System.Threading.Tasks.Task SayHello(global::Helloworld.HelloRequest request, ServerCallContext context) { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + throw new RpcException(new Status(StatusCode.Unimplemented, "")); } } /// Client for Greeter - public partial class GreeterClient : grpc::ClientBase + public class GreeterClient : ClientBase { /// Creates a new client for Greeter /// The channel to use to make remote calls. - public GreeterClient(grpc::Channel channel) : base(channel) + public GreeterClient(Channel channel) : base(channel) { } /// Creates a new client for Greeter that uses a custom CallInvoker. /// The callInvoker to use to make remote calls. - public GreeterClient(grpc::CallInvoker callInvoker) : base(callInvoker) + public GreeterClient(CallInvoker callInvoker) : base(callInvoker) { } /// Protected parameterless constructor to allow creation of test doubles. @@ -101,50 +98,33 @@ namespace Helloworld { } /// - /// Sends a greeting + /// Sends a greeting /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The response received from the server. - public virtual global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return SayHello(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + return SayHello(request, new CallOptions(headers, deadline, cancellationToken)); } /// - /// Sends a greeting + /// Sends a greeting /// - /// The request to send to the server. - /// The options for the call. - /// The response received from the server. - public virtual global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, grpc::CallOptions options) + public virtual global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_SayHello, null, options, request); } /// - /// Sends a greeting + /// Sends a greeting /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncUnaryCall SayHelloAsync(global::Helloworld.HelloRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual AsyncUnaryCall SayHelloAsync(global::Helloworld.HelloRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return SayHelloAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + return SayHelloAsync(request, new CallOptions(headers, deadline, cancellationToken)); } /// - /// Sends a greeting + /// Sends a greeting /// - /// The request to send to the server. - /// The options for the call. - /// The call object. - public virtual grpc::AsyncUnaryCall SayHelloAsync(global::Helloworld.HelloRequest request, grpc::CallOptions options) + public virtual AsyncUnaryCall SayHelloAsync(global::Helloworld.HelloRequest request, CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_SayHello, null, options, request); } - /// Creates a new instance of client from given ClientBaseConfiguration. protected override GreeterClient NewInstance(ClientBaseConfiguration configuration) { return new GreeterClient(configuration); @@ -152,10 +132,9 @@ namespace Helloworld { } /// Creates service definition that can be registered with a server - /// An object implementing the server-side handling logic. - public static grpc::ServerServiceDefinition BindService(GreeterBase serviceImpl) + public static ServerServiceDefinition BindService(GreeterBase serviceImpl) { - return grpc::ServerServiceDefinition.CreateBuilder() + return ServerServiceDefinition.CreateBuilder() .AddMethod(__Method_SayHello, serviceImpl.SayHello).Build(); } diff --git a/examples/csharp/helloworld/Greeter/packages.config b/examples/csharp/helloworld/Greeter/packages.config index ec83cd83002..2bb3a182a66 100644 --- a/examples/csharp/helloworld/Greeter/packages.config +++ b/examples/csharp/helloworld/Greeter/packages.config @@ -1,8 +1,8 @@  - - - - - - \ No newline at end of file + + + + + + diff --git a/examples/csharp/helloworld/GreeterClient/GreeterClient.csproj b/examples/csharp/helloworld/GreeterClient/GreeterClient.csproj index 4b6b1b3e12b..639ac0e70ca 100644 --- a/examples/csharp/helloworld/GreeterClient/GreeterClient.csproj +++ b/examples/csharp/helloworld/GreeterClient/GreeterClient.csproj @@ -10,8 +10,7 @@ GreeterClient GreeterClient v4.5 - - + 5e942a7d true @@ -32,18 +31,18 @@ true - - ..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll - True + + False + ..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll - - ..\packages\Grpc.Core.1.2.2\lib\net45\Grpc.Core.dll - True + + False + ..\packages\Grpc.Core.1.0.1\lib\net45\Grpc.Core.dll - - ..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll - True + + False + ..\packages\System.Interactive.Async.3.0.0\lib\net45\System.Interactive.Async.dll @@ -60,11 +59,11 @@ - + - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + - \ No newline at end of file + diff --git a/examples/csharp/helloworld/GreeterClient/packages.config b/examples/csharp/helloworld/GreeterClient/packages.config index b912fd49580..addcae0f173 100644 --- a/examples/csharp/helloworld/GreeterClient/packages.config +++ b/examples/csharp/helloworld/GreeterClient/packages.config @@ -1,7 +1,7 @@  - - - - - \ No newline at end of file + + + + + diff --git a/examples/csharp/helloworld/GreeterServer/GreeterServer.csproj b/examples/csharp/helloworld/GreeterServer/GreeterServer.csproj index 97978fa7ace..aa7188839c5 100644 --- a/examples/csharp/helloworld/GreeterServer/GreeterServer.csproj +++ b/examples/csharp/helloworld/GreeterServer/GreeterServer.csproj @@ -10,8 +10,7 @@ GreeterServer GreeterServer v4.5 - - + 9c7b2963 true @@ -32,18 +31,18 @@ true - - ..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll - True + + False + ..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll - - ..\packages\Grpc.Core.1.2.2\lib\net45\Grpc.Core.dll - True + + False + ..\packages\Grpc.Core.1.0.1\lib\net45\Grpc.Core.dll - - ..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll - True + + False + ..\packages\System.Interactive.Async.3.0.0\lib\net45\System.Interactive.Async.dll @@ -60,11 +59,11 @@ - + - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + - \ No newline at end of file + diff --git a/examples/csharp/helloworld/GreeterServer/packages.config b/examples/csharp/helloworld/GreeterServer/packages.config index b912fd49580..addcae0f173 100644 --- a/examples/csharp/helloworld/GreeterServer/packages.config +++ b/examples/csharp/helloworld/GreeterServer/packages.config @@ -1,7 +1,7 @@  - - - - - \ No newline at end of file + + + + + diff --git a/examples/csharp/helloworld/generate_protos.bat b/examples/csharp/helloworld/generate_protos.bat index 0d6e92d50f9..0afa1297621 100644 --- a/examples/csharp/helloworld/generate_protos.bat +++ b/examples/csharp/helloworld/generate_protos.bat @@ -34,7 +34,7 @@ setlocal @rem enter this directory cd /d %~dp0 -set TOOLS_PATH=packages\Grpc.Tools.1.2.2\tools\windows_x86 +set TOOLS_PATH=packages\Grpc.Tools.1.0.1\tools\windows_x86 %TOOLS_PATH%\protoc.exe -I../../protos --csharp_out Greeter ../../protos/helloworld.proto --grpc_out Greeter --plugin=protoc-gen-grpc=%TOOLS_PATH%\grpc_csharp_plugin.exe diff --git a/examples/csharp/route_guide/README.md b/examples/csharp/route_guide/README.md index 98073b02963..a9aa87a83df 100644 --- a/examples/csharp/route_guide/README.md +++ b/examples/csharp/route_guide/README.md @@ -1,4 +1,4 @@ -# gRPC Basics: C# sample code +#gRPC Basics: C# sample code The files in this folder are the samples used in [gRPC Basics: C#][], a detailed tutorial for using gRPC in C#. diff --git a/examples/csharp/route_guide/RouteGuide/RouteGuide.cs b/examples/csharp/route_guide/RouteGuide/RouteGuide.cs index 603809ee76f..54cb823983e 100644 --- a/examples/csharp/route_guide/RouteGuide/RouteGuide.cs +++ b/examples/csharp/route_guide/RouteGuide/RouteGuide.cs @@ -53,10 +53,10 @@ namespace Routeguide { } #region Messages /// - /// Points are represented as latitude-longitude pairs in the E7 representation - /// (degrees multiplied by 10**7 and rounded to the nearest integer). - /// Latitudes should be in the range +/- 90 degrees and longitude should be in - /// the range +/- 180 degrees (inclusive). + /// Points are represented as latitude-longitude pairs in the E7 representation + /// (degrees multiplied by 10**7 and rounded to the nearest integer). + /// Latitudes should be in the range +/- 90 degrees and longitude should be in + /// the range +/- 180 degrees (inclusive). /// public sealed partial class Point : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Point()); @@ -204,8 +204,8 @@ namespace Routeguide { } /// - /// A latitude-longitude rectangle, represented as two diagonally opposite - /// points "lo" and "hi". + /// A latitude-longitude rectangle, represented as two diagonally opposite + /// points "lo" and "hi". /// public sealed partial class Rectangle : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Rectangle()); @@ -244,7 +244,7 @@ namespace Routeguide { public const int LoFieldNumber = 1; private global::Routeguide.Point lo_; /// - /// One corner of the rectangle. + /// One corner of the rectangle. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Routeguide.Point Lo { @@ -258,7 +258,7 @@ namespace Routeguide { public const int HiFieldNumber = 2; private global::Routeguide.Point hi_; /// - /// The other corner of the rectangle. + /// The other corner of the rectangle. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Routeguide.Point Hi { @@ -371,9 +371,9 @@ namespace Routeguide { } /// - /// A feature names something at a given point. + /// A feature names something at a given point. /// - /// If a feature could not be named, the name is empty. + /// If a feature could not be named, the name is empty. /// public sealed partial class Feature : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Feature()); @@ -412,7 +412,7 @@ namespace Routeguide { public const int NameFieldNumber = 1; private string name_ = ""; /// - /// The name of the feature. + /// The name of the feature. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Name { @@ -426,7 +426,7 @@ namespace Routeguide { public const int LocationFieldNumber = 2; private global::Routeguide.Point location_; /// - /// The point where the feature is detected. + /// The point where the feature is detected. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Routeguide.Point Location { @@ -533,7 +533,7 @@ namespace Routeguide { } /// - /// A RouteNote is a message sent while at a given point. + /// A RouteNote is a message sent while at a given point. /// public sealed partial class RouteNote : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RouteNote()); @@ -572,7 +572,7 @@ namespace Routeguide { public const int LocationFieldNumber = 1; private global::Routeguide.Point location_; /// - /// The location from which the message is sent. + /// The location from which the message is sent. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Routeguide.Point Location { @@ -586,7 +586,7 @@ namespace Routeguide { public const int MessageFieldNumber = 2; private string message_ = ""; /// - /// The message to be sent. + /// The message to be sent. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Message { @@ -693,11 +693,11 @@ namespace Routeguide { } /// - /// A RouteSummary is received in response to a RecordRoute rpc. + /// A RouteSummary is received in response to a RecordRoute rpc. /// - /// It contains the number of individual points received, the number of - /// detected features, and the total distance covered as the cumulative sum of - /// the distance between each point. + /// It contains the number of individual points received, the number of + /// detected features, and the total distance covered as the cumulative sum of + /// the distance between each point. /// public sealed partial class RouteSummary : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RouteSummary()); @@ -738,7 +738,7 @@ namespace Routeguide { public const int PointCountFieldNumber = 1; private int pointCount_; /// - /// The number of points received. + /// The number of points received. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int PointCount { @@ -752,7 +752,7 @@ namespace Routeguide { public const int FeatureCountFieldNumber = 2; private int featureCount_; /// - /// The number of known features passed while traversing the route. + /// The number of known features passed while traversing the route. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int FeatureCount { @@ -766,7 +766,7 @@ namespace Routeguide { public const int DistanceFieldNumber = 3; private int distance_; /// - /// The distance covered in metres. + /// The distance covered in metres. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int Distance { @@ -780,7 +780,7 @@ namespace Routeguide { public const int ElapsedTimeFieldNumber = 4; private int elapsedTime_; /// - /// The duration of the traversal in seconds. + /// The duration of the traversal in seconds. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int ElapsedTime { diff --git a/examples/csharp/route_guide/RouteGuide/RouteGuide.csproj b/examples/csharp/route_guide/RouteGuide/RouteGuide.csproj index 360444e4918..eee8f0a1bce 100644 --- a/examples/csharp/route_guide/RouteGuide/RouteGuide.csproj +++ b/examples/csharp/route_guide/RouteGuide/RouteGuide.csproj @@ -11,8 +11,7 @@ RouteGuide v4.5 512 - - + de2137f9 true @@ -32,13 +31,13 @@ 4 - - ..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll - True + + False + ..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll - - ..\packages\Grpc.Core.1.2.2\lib\net45\Grpc.Core.dll - True + + False + ..\packages\Grpc.Core.1.0.1\lib\net45\Grpc.Core.dll False @@ -46,15 +45,15 @@ - - ..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll - True - + + False + ..\packages\System.Interactive.Async.3.0.0\lib\net45\System.Interactive.Async.dll + @@ -75,12 +74,12 @@ - + - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + - \ No newline at end of file + diff --git a/examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs b/examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs index 6f2d6bde620..eb70c8e2db5 100644 --- a/examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs +++ b/examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs @@ -35,45 +35,45 @@ using System; using System.Threading; using System.Threading.Tasks; -using grpc = global::Grpc.Core; +using Grpc.Core; namespace Routeguide { /// - /// Interface exported by the server. + /// Interface exported by the server. /// - public static partial class RouteGuide + public static class RouteGuide { static readonly string __ServiceName = "routeguide.RouteGuide"; - static readonly grpc::Marshaller __Marshaller_Point = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.Point.Parser.ParseFrom); - static readonly grpc::Marshaller __Marshaller_Feature = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.Feature.Parser.ParseFrom); - static readonly grpc::Marshaller __Marshaller_Rectangle = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.Rectangle.Parser.ParseFrom); - static readonly grpc::Marshaller __Marshaller_RouteSummary = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.RouteSummary.Parser.ParseFrom); - static readonly grpc::Marshaller __Marshaller_RouteNote = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.RouteNote.Parser.ParseFrom); + static readonly Marshaller __Marshaller_Point = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.Point.Parser.ParseFrom); + static readonly Marshaller __Marshaller_Feature = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.Feature.Parser.ParseFrom); + static readonly Marshaller __Marshaller_Rectangle = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.Rectangle.Parser.ParseFrom); + static readonly Marshaller __Marshaller_RouteSummary = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.RouteSummary.Parser.ParseFrom); + static readonly Marshaller __Marshaller_RouteNote = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.RouteNote.Parser.ParseFrom); - static readonly grpc::Method __Method_GetFeature = new grpc::Method( - grpc::MethodType.Unary, + static readonly Method __Method_GetFeature = new Method( + MethodType.Unary, __ServiceName, "GetFeature", __Marshaller_Point, __Marshaller_Feature); - static readonly grpc::Method __Method_ListFeatures = new grpc::Method( - grpc::MethodType.ServerStreaming, + static readonly Method __Method_ListFeatures = new Method( + MethodType.ServerStreaming, __ServiceName, "ListFeatures", __Marshaller_Rectangle, __Marshaller_Feature); - static readonly grpc::Method __Method_RecordRoute = new grpc::Method( - grpc::MethodType.ClientStreaming, + static readonly Method __Method_RecordRoute = new Method( + MethodType.ClientStreaming, __ServiceName, "RecordRoute", __Marshaller_Point, __Marshaller_RouteSummary); - static readonly grpc::Method __Method_RouteChat = new grpc::Method( - grpc::MethodType.DuplexStreaming, + static readonly Method __Method_RouteChat = new Method( + MethodType.DuplexStreaming, __ServiceName, "RouteChat", __Marshaller_RouteNote, @@ -86,83 +86,69 @@ namespace Routeguide { } /// Base class for server-side implementations of RouteGuide - public abstract partial class RouteGuideBase + public abstract class RouteGuideBase { /// - /// A simple RPC. + /// A simple RPC. /// - /// Obtains the feature at a given position. + /// Obtains the feature at a given position. /// - /// A feature with an empty name is returned if there's no feature at the given - /// position. + /// A feature with an empty name is returned if there's no feature at the given + /// position. /// - /// The request received from the client. - /// The context of the server-side call handler being invoked. - /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task GetFeature(global::Routeguide.Point request, grpc::ServerCallContext context) + public virtual global::System.Threading.Tasks.Task GetFeature(global::Routeguide.Point request, ServerCallContext context) { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + throw new RpcException(new Status(StatusCode.Unimplemented, "")); } /// - /// A server-to-client streaming RPC. + /// A server-to-client streaming RPC. /// - /// Obtains the Features available within the given Rectangle. Results are - /// streamed rather than returned at once (e.g. in a response message with a - /// repeated field), as the rectangle may cover a large area and contain a - /// huge number of features. + /// Obtains the Features available within the given Rectangle. Results are + /// streamed rather than returned at once (e.g. in a response message with a + /// repeated field), as the rectangle may cover a large area and contain a + /// huge number of features. /// - /// The request received from the client. - /// Used for sending responses back to the client. - /// The context of the server-side call handler being invoked. - /// A task indicating completion of the handler. - public virtual global::System.Threading.Tasks.Task ListFeatures(global::Routeguide.Rectangle request, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) + public virtual global::System.Threading.Tasks.Task ListFeatures(global::Routeguide.Rectangle request, IServerStreamWriter responseStream, ServerCallContext context) { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + throw new RpcException(new Status(StatusCode.Unimplemented, "")); } /// - /// A client-to-server streaming RPC. + /// A client-to-server streaming RPC. /// - /// Accepts a stream of Points on a route being traversed, returning a - /// RouteSummary when traversal is completed. + /// Accepts a stream of Points on a route being traversed, returning a + /// RouteSummary when traversal is completed. /// - /// Used for reading requests from the client. - /// The context of the server-side call handler being invoked. - /// The response to send back to the client (wrapped by a task). - public virtual global::System.Threading.Tasks.Task RecordRoute(grpc::IAsyncStreamReader requestStream, grpc::ServerCallContext context) + public virtual global::System.Threading.Tasks.Task RecordRoute(IAsyncStreamReader requestStream, ServerCallContext context) { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + throw new RpcException(new Status(StatusCode.Unimplemented, "")); } /// - /// A Bidirectional streaming RPC. + /// A Bidirectional streaming RPC. /// - /// Accepts a stream of RouteNotes sent while a route is being traversed, - /// while receiving other RouteNotes (e.g. from other users). + /// Accepts a stream of RouteNotes sent while a route is being traversed, + /// while receiving other RouteNotes (e.g. from other users). /// - /// Used for reading requests from the client. - /// Used for sending responses back to the client. - /// The context of the server-side call handler being invoked. - /// A task indicating completion of the handler. - public virtual global::System.Threading.Tasks.Task RouteChat(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) + public virtual global::System.Threading.Tasks.Task RouteChat(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + throw new RpcException(new Status(StatusCode.Unimplemented, "")); } } /// Client for RouteGuide - public partial class RouteGuideClient : grpc::ClientBase + public class RouteGuideClient : ClientBase { /// Creates a new client for RouteGuide /// The channel to use to make remote calls. - public RouteGuideClient(grpc::Channel channel) : base(channel) + public RouteGuideClient(Channel channel) : base(channel) { } /// Creates a new client for RouteGuide that uses a custom CallInvoker. /// The callInvoker to use to make remote calls. - public RouteGuideClient(grpc::CallInvoker callInvoker) : base(callInvoker) + public RouteGuideClient(CallInvoker callInvoker) : base(callInvoker) { } /// Protected parameterless constructor to allow creation of test doubles. @@ -176,154 +162,117 @@ namespace Routeguide { } /// - /// A simple RPC. + /// A simple RPC. /// - /// Obtains the feature at a given position. + /// Obtains the feature at a given position. /// - /// A feature with an empty name is returned if there's no feature at the given - /// position. + /// A feature with an empty name is returned if there's no feature at the given + /// position. /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The response received from the server. - public virtual global::Routeguide.Feature GetFeature(global::Routeguide.Point request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual global::Routeguide.Feature GetFeature(global::Routeguide.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return GetFeature(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + return GetFeature(request, new CallOptions(headers, deadline, cancellationToken)); } /// - /// A simple RPC. + /// A simple RPC. /// - /// Obtains the feature at a given position. + /// Obtains the feature at a given position. /// - /// A feature with an empty name is returned if there's no feature at the given - /// position. + /// A feature with an empty name is returned if there's no feature at the given + /// position. /// - /// The request to send to the server. - /// The options for the call. - /// The response received from the server. - public virtual global::Routeguide.Feature GetFeature(global::Routeguide.Point request, grpc::CallOptions options) + public virtual global::Routeguide.Feature GetFeature(global::Routeguide.Point request, CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_GetFeature, null, options, request); } /// - /// A simple RPC. + /// A simple RPC. /// - /// Obtains the feature at a given position. + /// Obtains the feature at a given position. /// - /// A feature with an empty name is returned if there's no feature at the given - /// position. + /// A feature with an empty name is returned if there's no feature at the given + /// position. /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncUnaryCall GetFeatureAsync(global::Routeguide.Point request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual AsyncUnaryCall GetFeatureAsync(global::Routeguide.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return GetFeatureAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + return GetFeatureAsync(request, new CallOptions(headers, deadline, cancellationToken)); } /// - /// A simple RPC. + /// A simple RPC. /// - /// Obtains the feature at a given position. + /// Obtains the feature at a given position. /// - /// A feature with an empty name is returned if there's no feature at the given - /// position. + /// A feature with an empty name is returned if there's no feature at the given + /// position. /// - /// The request to send to the server. - /// The options for the call. - /// The call object. - public virtual grpc::AsyncUnaryCall GetFeatureAsync(global::Routeguide.Point request, grpc::CallOptions options) + public virtual AsyncUnaryCall GetFeatureAsync(global::Routeguide.Point request, CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_GetFeature, null, options, request); } /// - /// A server-to-client streaming RPC. + /// A server-to-client streaming RPC. /// - /// Obtains the Features available within the given Rectangle. Results are - /// streamed rather than returned at once (e.g. in a response message with a - /// repeated field), as the rectangle may cover a large area and contain a - /// huge number of features. + /// Obtains the Features available within the given Rectangle. Results are + /// streamed rather than returned at once (e.g. in a response message with a + /// repeated field), as the rectangle may cover a large area and contain a + /// huge number of features. /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncServerStreamingCall ListFeatures(global::Routeguide.Rectangle request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual AsyncServerStreamingCall ListFeatures(global::Routeguide.Rectangle request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return ListFeatures(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + return ListFeatures(request, new CallOptions(headers, deadline, cancellationToken)); } /// - /// A server-to-client streaming RPC. + /// A server-to-client streaming RPC. /// - /// Obtains the Features available within the given Rectangle. Results are - /// streamed rather than returned at once (e.g. in a response message with a - /// repeated field), as the rectangle may cover a large area and contain a - /// huge number of features. + /// Obtains the Features available within the given Rectangle. Results are + /// streamed rather than returned at once (e.g. in a response message with a + /// repeated field), as the rectangle may cover a large area and contain a + /// huge number of features. /// - /// The request to send to the server. - /// The options for the call. - /// The call object. - public virtual grpc::AsyncServerStreamingCall ListFeatures(global::Routeguide.Rectangle request, grpc::CallOptions options) + public virtual AsyncServerStreamingCall ListFeatures(global::Routeguide.Rectangle request, CallOptions options) { return CallInvoker.AsyncServerStreamingCall(__Method_ListFeatures, null, options, request); } /// - /// A client-to-server streaming RPC. + /// A client-to-server streaming RPC. /// - /// Accepts a stream of Points on a route being traversed, returning a - /// RouteSummary when traversal is completed. + /// Accepts a stream of Points on a route being traversed, returning a + /// RouteSummary when traversal is completed. /// - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncClientStreamingCall RecordRoute(grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual AsyncClientStreamingCall RecordRoute(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return RecordRoute(new grpc::CallOptions(headers, deadline, cancellationToken)); + return RecordRoute(new CallOptions(headers, deadline, cancellationToken)); } /// - /// A client-to-server streaming RPC. + /// A client-to-server streaming RPC. /// - /// Accepts a stream of Points on a route being traversed, returning a - /// RouteSummary when traversal is completed. + /// Accepts a stream of Points on a route being traversed, returning a + /// RouteSummary when traversal is completed. /// - /// The options for the call. - /// The call object. - public virtual grpc::AsyncClientStreamingCall RecordRoute(grpc::CallOptions options) + public virtual AsyncClientStreamingCall RecordRoute(CallOptions options) { return CallInvoker.AsyncClientStreamingCall(__Method_RecordRoute, null, options); } /// - /// A Bidirectional streaming RPC. + /// A Bidirectional streaming RPC. /// - /// Accepts a stream of RouteNotes sent while a route is being traversed, - /// while receiving other RouteNotes (e.g. from other users). + /// Accepts a stream of RouteNotes sent while a route is being traversed, + /// while receiving other RouteNotes (e.g. from other users). /// - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - public virtual grpc::AsyncDuplexStreamingCall RouteChat(grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual AsyncDuplexStreamingCall RouteChat(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { - return RouteChat(new grpc::CallOptions(headers, deadline, cancellationToken)); + return RouteChat(new CallOptions(headers, deadline, cancellationToken)); } /// - /// A Bidirectional streaming RPC. + /// A Bidirectional streaming RPC. /// - /// Accepts a stream of RouteNotes sent while a route is being traversed, - /// while receiving other RouteNotes (e.g. from other users). + /// Accepts a stream of RouteNotes sent while a route is being traversed, + /// while receiving other RouteNotes (e.g. from other users). /// - /// The options for the call. - /// The call object. - public virtual grpc::AsyncDuplexStreamingCall RouteChat(grpc::CallOptions options) + public virtual AsyncDuplexStreamingCall RouteChat(CallOptions options) { return CallInvoker.AsyncDuplexStreamingCall(__Method_RouteChat, null, options); } - /// Creates a new instance of client from given ClientBaseConfiguration. protected override RouteGuideClient NewInstance(ClientBaseConfiguration configuration) { return new RouteGuideClient(configuration); @@ -331,10 +280,9 @@ namespace Routeguide { } /// Creates service definition that can be registered with a server - /// An object implementing the server-side handling logic. - public static grpc::ServerServiceDefinition BindService(RouteGuideBase serviceImpl) + public static ServerServiceDefinition BindService(RouteGuideBase serviceImpl) { - return grpc::ServerServiceDefinition.CreateBuilder() + return ServerServiceDefinition.CreateBuilder() .AddMethod(__Method_GetFeature, serviceImpl.GetFeature) .AddMethod(__Method_ListFeatures, serviceImpl.ListFeatures) .AddMethod(__Method_RecordRoute, serviceImpl.RecordRoute) diff --git a/examples/csharp/route_guide/RouteGuide/packages.config b/examples/csharp/route_guide/RouteGuide/packages.config index 2dde11f1dd3..b7c401b3c85 100644 --- a/examples/csharp/route_guide/RouteGuide/packages.config +++ b/examples/csharp/route_guide/RouteGuide/packages.config @@ -1,8 +1,8 @@  - - - + + + + - - \ No newline at end of file + diff --git a/examples/csharp/route_guide/RouteGuideClient/RouteGuideClient.csproj b/examples/csharp/route_guide/RouteGuideClient/RouteGuideClient.csproj index 162eaeddc13..a513f6af877 100644 --- a/examples/csharp/route_guide/RouteGuideClient/RouteGuideClient.csproj +++ b/examples/csharp/route_guide/RouteGuideClient/RouteGuideClient.csproj @@ -11,8 +11,7 @@ RouteGuideClient v4.5 512 - - + b880049a AnyCPU @@ -34,13 +33,13 @@ 4 - - ..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll - True + + False + ..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll - - ..\packages\Grpc.Core.1.2.2\lib\net45\Grpc.Core.dll - True + + False + ..\packages\Grpc.Core.1.0.1\lib\net45\Grpc.Core.dll False @@ -48,9 +47,9 @@ - - ..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll - True + + False + ..\packages\System.Interactive.Async.3.0.0\lib\net45\System.Interactive.Async.dll @@ -72,12 +71,12 @@ - + - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + - \ No newline at end of file + diff --git a/examples/csharp/route_guide/RouteGuideClient/packages.config b/examples/csharp/route_guide/RouteGuideClient/packages.config index 2dde11f1dd3..b7c401b3c85 100644 --- a/examples/csharp/route_guide/RouteGuideClient/packages.config +++ b/examples/csharp/route_guide/RouteGuideClient/packages.config @@ -1,8 +1,8 @@  - - - + + + + - - \ No newline at end of file + diff --git a/examples/csharp/route_guide/RouteGuideServer/RouteGuideServer.csproj b/examples/csharp/route_guide/RouteGuideServer/RouteGuideServer.csproj index b6f2f351aaa..8892554b7ed 100644 --- a/examples/csharp/route_guide/RouteGuideServer/RouteGuideServer.csproj +++ b/examples/csharp/route_guide/RouteGuideServer/RouteGuideServer.csproj @@ -11,8 +11,7 @@ RouteGuideServer v4.5 512 - - + 946ecc79 AnyCPU @@ -34,13 +33,13 @@ 4 - - ..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll - True + + False + ..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll - - ..\packages\Grpc.Core.1.2.2\lib\net45\Grpc.Core.dll - True + + False + ..\packages\Grpc.Core.1.0.1\lib\net45\Grpc.Core.dll False @@ -48,15 +47,15 @@ - - ..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll - True - + + False + ..\packages\System.Interactive.Async.3.0.0\lib\net45\System.Interactive.Async.dll + @@ -73,12 +72,12 @@ - + - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + - \ No newline at end of file + diff --git a/examples/csharp/route_guide/RouteGuideServer/packages.config b/examples/csharp/route_guide/RouteGuideServer/packages.config index 46df6453da6..dd498f48ea3 100644 --- a/examples/csharp/route_guide/RouteGuideServer/packages.config +++ b/examples/csharp/route_guide/RouteGuideServer/packages.config @@ -1,9 +1,9 @@  - - - - + + + + - - \ No newline at end of file + + diff --git a/examples/csharp/route_guide/generate_protos.bat b/examples/csharp/route_guide/generate_protos.bat index fbd951aeb27..69f5e0f4a39 100644 --- a/examples/csharp/route_guide/generate_protos.bat +++ b/examples/csharp/route_guide/generate_protos.bat @@ -34,7 +34,7 @@ setlocal @rem enter this directory cd /d %~dp0 -set TOOLS_PATH=packages\Grpc.Tools.1.2.2\tools\windows_x86 +set TOOLS_PATH=packages\Grpc.Tools.1.0.0\tools\windows_x86 %TOOLS_PATH%\protoc.exe -I../../protos --csharp_out RouteGuide ../../protos/route_guide.proto --grpc_out RouteGuide --plugin=protoc-gen-grpc=%TOOLS_PATH%\grpc_csharp_plugin.exe diff --git a/examples/node/dynamic_codegen/route_guide/README.md b/examples/node/dynamic_codegen/route_guide/README.md index 7ec519c76bb..22bcf789863 100644 --- a/examples/node/dynamic_codegen/route_guide/README.md +++ b/examples/node/dynamic_codegen/route_guide/README.md @@ -1,4 +1,4 @@ -# gRPC Basics: Node.js sample code +#gRPC Basics: Node.js sample code The files in this folder are the samples used in [gRPC Basics: Node.js][], a detailed tutorial for using gRPC in Node.js. diff --git a/examples/node/static_codegen/route_guide/README.md b/examples/node/static_codegen/route_guide/README.md index 7ec519c76bb..22bcf789863 100644 --- a/examples/node/static_codegen/route_guide/README.md +++ b/examples/node/static_codegen/route_guide/README.md @@ -1,4 +1,4 @@ -# gRPC Basics: Node.js sample code +#gRPC Basics: Node.js sample code The files in this folder are the samples used in [gRPC Basics: Node.js][], a detailed tutorial for using gRPC in Node.js. diff --git a/examples/objective-c/auth_sample/README.md b/examples/objective-c/auth_sample/README.md index b75dcab2de4..c560b7af65b 100644 --- a/examples/objective-c/auth_sample/README.md +++ b/examples/objective-c/auth_sample/README.md @@ -1,3 +1,3 @@ -# OAuth2 on gRPC: Objective-C +#OAuth2 on gRPC: Objective-C This is the supporting code for the tutorial "[OAuth2 on gRPC: Objective-C](http://www.grpc.io/docs/tutorials/auth/oauth2-objective-c.html)." diff --git a/examples/objective-c/helloworld/README.md b/examples/objective-c/helloworld/README.md index 365bea14228..fdff938a978 100644 --- a/examples/objective-c/helloworld/README.md +++ b/examples/objective-c/helloworld/README.md @@ -1,4 +1,4 @@ -# gRPC in 3 minutes (Objective-C) +#gRPC in 3 minutes (Objective-C) ## Installation diff --git a/examples/objective-c/route_guide/README.md b/examples/objective-c/route_guide/README.md index b99bf546fb7..6a6f7c0d338 100644 --- a/examples/objective-c/route_guide/README.md +++ b/examples/objective-c/route_guide/README.md @@ -1,4 +1,4 @@ -# gRPC Basics: Objective-C +#gRPC Basics: Objective-C This is the supporting code for the tutorial "[gRPC Basics: Objective-C](http://www.grpc.io/docs/tutorials/basic/objective-c.html)." diff --git a/examples/php/route_guide/README.md b/examples/php/route_guide/README.md index 5b2cc05efc7..26f1704f122 100644 --- a/examples/php/route_guide/README.md +++ b/examples/php/route_guide/README.md @@ -1,4 +1,4 @@ -# gRPC Basics: PHP sample code +#gRPC Basics: PHP sample code The files in this folder are the samples used in [gRPC Basics: PHP][], a detailed tutorial for using gRPC in PHP. diff --git a/examples/ruby/errors_and_cancellation/README.md b/examples/ruby/errors_and_cancellation/README.md index 661bd84792f..126518c4aab 100644 --- a/examples/ruby/errors_and_cancellation/README.md +++ b/examples/ruby/errors_and_cancellation/README.md @@ -1,4 +1,4 @@ -# Errors and Cancelletion code samples for grpc-ruby +#Errors and Cancelletion code samples for grpc-ruby The examples in this directory show use of grpc errors. diff --git a/examples/ruby/route_guide/README.md b/examples/ruby/route_guide/README.md index b2514630a96..3c353d1d976 100644 --- a/examples/ruby/route_guide/README.md +++ b/examples/ruby/route_guide/README.md @@ -1,4 +1,4 @@ -# gRPC Basics: Ruby sample code +#gRPC Basics: Ruby sample code The files in this folder are the samples used in [gRPC Basics: Ruby][], a detailed tutorial for using gRPC in Ruby. diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 4bd9cd9363e..bd129f73b5f 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -37,7 +37,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-Core' - version = '1.4.0-dev' + version = '1.3.0-pre1' s.version = version s.summary = 'Core cross-platform gRPC library, written in C' s.homepage = 'http://www.grpc.io' @@ -258,11 +258,16 @@ Pod::Spec.new do |s| 'src/core/lib/channel/channel_args.h', 'src/core/lib/channel/channel_stack.h', 'src/core/lib/channel/channel_stack_builder.h', + 'src/core/lib/channel/compress_filter.h', 'src/core/lib/channel/connected_channel.h', 'src/core/lib/channel/context.h', + 'src/core/lib/channel/deadline_filter.h', 'src/core/lib/channel/handshaker.h', 'src/core/lib/channel/handshaker_factory.h', 'src/core/lib/channel/handshaker_registry.h', + 'src/core/lib/channel/http_client_filter.h', + 'src/core/lib/channel/http_server_filter.h', + 'src/core/lib/channel/message_size_filter.h', 'src/core/lib/compression/algorithm_metadata.h', 'src/core/lib/compression/message_compress.h', 'src/core/lib/debug/trace.h', @@ -381,9 +386,6 @@ Pod::Spec.new do |s| 'src/core/ext/transport/chttp2/transport/stream_map.h', 'src/core/ext/transport/chttp2/transport/varint.h', 'src/core/ext/transport/chttp2/alpn/alpn.h', - 'src/core/ext/filters/http/client/http_client_filter.h', - 'src/core/ext/filters/http/message_compress/message_compress_filter.h', - 'src/core/ext/filters/http/server/http_server_filter.h', 'src/core/lib/security/context/security_context.h', 'src/core/lib/security/credentials/composite/composite_credentials.h', 'src/core/lib/security/credentials/credentials.h', @@ -427,7 +429,6 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/subchannel.h', 'src/core/ext/filters/client_channel/subchannel_index.h', 'src/core/ext/filters/client_channel/uri_parser.h', - 'src/core/ext/filters/deadline/deadline_filter.h', 'src/core/ext/transport/chttp2/client/chttp2_connector.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h', @@ -458,15 +459,19 @@ Pod::Spec.new do |s| 'src/core/ext/census/trace_string.h', 'src/core/ext/census/tracing.h', 'src/core/ext/filters/max_age/max_age_filter.h', - 'src/core/ext/filters/message_size/message_size_filter.h', 'src/core/lib/surface/init.c', 'src/core/lib/channel/channel_args.c', 'src/core/lib/channel/channel_stack.c', 'src/core/lib/channel/channel_stack_builder.c', + 'src/core/lib/channel/compress_filter.c', 'src/core/lib/channel/connected_channel.c', + 'src/core/lib/channel/deadline_filter.c', 'src/core/lib/channel/handshaker.c', 'src/core/lib/channel/handshaker_factory.c', 'src/core/lib/channel/handshaker_registry.c', + 'src/core/lib/channel/http_client_filter.c', + 'src/core/lib/channel/http_server_filter.c', + 'src/core/lib/channel/message_size_filter.c', 'src/core/lib/compression/compression.c', 'src/core/lib/compression/message_compress.c', 'src/core/lib/debug/trace.c', @@ -603,10 +608,6 @@ Pod::Spec.new do |s| 'src/core/ext/transport/chttp2/transport/varint.c', 'src/core/ext/transport/chttp2/transport/writing.c', 'src/core/ext/transport/chttp2/alpn/alpn.c', - 'src/core/ext/filters/http/client/http_client_filter.c', - 'src/core/ext/filters/http/http_filters_plugin.c', - 'src/core/ext/filters/http/message_compress/message_compress_filter.c', - 'src/core/ext/filters/http/server/http_server_filter.c', 'src/core/lib/http/httpcli_security_connector.c', 'src/core/lib/security/context/security_context.c', 'src/core/lib/security/credentials/composite/composite_credentials.c', @@ -656,7 +657,6 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/subchannel.c', 'src/core/ext/filters/client_channel/subchannel_index.c', 'src/core/ext/filters/client_channel/uri_parser.c', - 'src/core/ext/filters/deadline/deadline_filter.c', 'src/core/ext/transport/chttp2/client/chttp2_connector.c', 'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c', 'src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c', @@ -693,7 +693,6 @@ Pod::Spec.new do |s| 'src/core/ext/census/trace_context.c', 'src/core/ext/census/tracing.c', 'src/core/ext/filters/max_age/max_age_filter.c', - 'src/core/ext/filters/message_size/message_size_filter.c', 'src/core/plugin_registry/grpc_plugin_registry.c' ss.private_header_files = 'src/core/lib/profiling/timers.h', @@ -713,11 +712,16 @@ Pod::Spec.new do |s| 'src/core/lib/channel/channel_args.h', 'src/core/lib/channel/channel_stack.h', 'src/core/lib/channel/channel_stack_builder.h', + 'src/core/lib/channel/compress_filter.h', 'src/core/lib/channel/connected_channel.h', 'src/core/lib/channel/context.h', + 'src/core/lib/channel/deadline_filter.h', 'src/core/lib/channel/handshaker.h', 'src/core/lib/channel/handshaker_factory.h', 'src/core/lib/channel/handshaker_registry.h', + 'src/core/lib/channel/http_client_filter.h', + 'src/core/lib/channel/http_server_filter.h', + 'src/core/lib/channel/message_size_filter.h', 'src/core/lib/compression/algorithm_metadata.h', 'src/core/lib/compression/message_compress.h', 'src/core/lib/debug/trace.h', @@ -836,9 +840,6 @@ Pod::Spec.new do |s| 'src/core/ext/transport/chttp2/transport/stream_map.h', 'src/core/ext/transport/chttp2/transport/varint.h', 'src/core/ext/transport/chttp2/alpn/alpn.h', - 'src/core/ext/filters/http/client/http_client_filter.h', - 'src/core/ext/filters/http/message_compress/message_compress_filter.h', - 'src/core/ext/filters/http/server/http_server_filter.h', 'src/core/lib/security/context/security_context.h', 'src/core/lib/security/credentials/composite/composite_credentials.h', 'src/core/lib/security/credentials/credentials.h', @@ -882,7 +883,6 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/subchannel.h', 'src/core/ext/filters/client_channel/subchannel_index.h', 'src/core/ext/filters/client_channel/uri_parser.h', - 'src/core/ext/filters/deadline/deadline_filter.h', 'src/core/ext/transport/chttp2/client/chttp2_connector.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h', @@ -912,8 +912,7 @@ Pod::Spec.new do |s| 'src/core/ext/census/trace_status.h', 'src/core/ext/census/trace_string.h', 'src/core/ext/census/tracing.h', - 'src/core/ext/filters/max_age/max_age_filter.h', - 'src/core/ext/filters/message_size/message_size_filter.h' + 'src/core/ext/filters/max_age/max_age_filter.h' end s.subspec 'Cronet-Interface' do |ss| diff --git a/gRPC-ProtoRPC.podspec b/gRPC-ProtoRPC.podspec index 62cb0d11a1c..de30032ee67 100644 --- a/gRPC-ProtoRPC.podspec +++ b/gRPC-ProtoRPC.podspec @@ -36,7 +36,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-ProtoRPC' - version = '1.4.0-dev' + version = '1.3.0-pre1' s.version = version s.summary = 'RPC library for Protocol Buffers, based on gRPC' s.homepage = 'http://www.grpc.io' diff --git a/gRPC-RxLibrary.podspec b/gRPC-RxLibrary.podspec index 77ceb22123c..642b4cad425 100644 --- a/gRPC-RxLibrary.podspec +++ b/gRPC-RxLibrary.podspec @@ -36,7 +36,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-RxLibrary' - version = '1.4.0-dev' + version = '1.3.0-pre1' s.version = version s.summary = 'Reactive Extensions library for iOS/OSX.' s.homepage = 'http://www.grpc.io' diff --git a/gRPC.podspec b/gRPC.podspec index 10520bd3880..ac3057e8706 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -35,7 +35,7 @@ Pod::Spec.new do |s| s.name = 'gRPC' - version = '1.4.0-dev' + version = '1.3.0-pre1' s.version = version s.summary = 'gRPC client library for iOS/OSX' s.homepage = 'http://www.grpc.io' diff --git a/grpc.def b/grpc.def index b602172bebb..1589316a588 100644 --- a/grpc.def +++ b/grpc.def @@ -70,9 +70,9 @@ EXPORTS grpc_channel_ping grpc_channel_register_call grpc_channel_create_registered_call - grpc_call_arena_alloc grpc_call_start_batch grpc_call_get_peer + grpc_call_set_load_reporting_cost_context grpc_census_call_set_context grpc_census_call_get_context grpc_channel_get_target @@ -82,13 +82,13 @@ EXPORTS grpc_channel_destroy grpc_call_cancel grpc_call_cancel_with_status - grpc_call_ref - grpc_call_unref + grpc_call_destroy grpc_server_request_call grpc_server_register_method grpc_server_request_registered_call grpc_server_create grpc_server_register_completion_queue + grpc_server_register_non_listening_completion_queue grpc_server_add_insecure_http2_port grpc_server_start grpc_server_shutdown_and_notify diff --git a/grpc.gemspec b/grpc.gemspec index e53bd29cd4d..4912872933b 100755 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -174,11 +174,16 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/channel/channel_args.h ) s.files += %w( src/core/lib/channel/channel_stack.h ) s.files += %w( src/core/lib/channel/channel_stack_builder.h ) + s.files += %w( src/core/lib/channel/compress_filter.h ) s.files += %w( src/core/lib/channel/connected_channel.h ) s.files += %w( src/core/lib/channel/context.h ) + s.files += %w( src/core/lib/channel/deadline_filter.h ) s.files += %w( src/core/lib/channel/handshaker.h ) s.files += %w( src/core/lib/channel/handshaker_factory.h ) s.files += %w( src/core/lib/channel/handshaker_registry.h ) + s.files += %w( src/core/lib/channel/http_client_filter.h ) + s.files += %w( src/core/lib/channel/http_server_filter.h ) + s.files += %w( src/core/lib/channel/message_size_filter.h ) s.files += %w( src/core/lib/compression/algorithm_metadata.h ) s.files += %w( src/core/lib/compression/message_compress.h ) s.files += %w( src/core/lib/debug/trace.h ) @@ -297,9 +302,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/transport/chttp2/transport/stream_map.h ) s.files += %w( src/core/ext/transport/chttp2/transport/varint.h ) s.files += %w( src/core/ext/transport/chttp2/alpn/alpn.h ) - s.files += %w( src/core/ext/filters/http/client/http_client_filter.h ) - s.files += %w( src/core/ext/filters/http/message_compress/message_compress_filter.h ) - s.files += %w( src/core/ext/filters/http/server/http_server_filter.h ) s.files += %w( src/core/lib/security/context/security_context.h ) s.files += %w( src/core/lib/security/credentials/composite/composite_credentials.h ) s.files += %w( src/core/lib/security/credentials/credentials.h ) @@ -343,7 +345,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/filters/client_channel/subchannel.h ) s.files += %w( src/core/ext/filters/client_channel/subchannel_index.h ) s.files += %w( src/core/ext/filters/client_channel/uri_parser.h ) - s.files += %w( src/core/ext/filters/deadline/deadline_filter.h ) s.files += %w( src/core/ext/transport/chttp2/client/chttp2_connector.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h ) @@ -374,15 +375,19 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/census/trace_string.h ) s.files += %w( src/core/ext/census/tracing.h ) s.files += %w( src/core/ext/filters/max_age/max_age_filter.h ) - s.files += %w( src/core/ext/filters/message_size/message_size_filter.h ) s.files += %w( src/core/lib/surface/init.c ) s.files += %w( src/core/lib/channel/channel_args.c ) s.files += %w( src/core/lib/channel/channel_stack.c ) s.files += %w( src/core/lib/channel/channel_stack_builder.c ) + s.files += %w( src/core/lib/channel/compress_filter.c ) s.files += %w( src/core/lib/channel/connected_channel.c ) + s.files += %w( src/core/lib/channel/deadline_filter.c ) s.files += %w( src/core/lib/channel/handshaker.c ) s.files += %w( src/core/lib/channel/handshaker_factory.c ) s.files += %w( src/core/lib/channel/handshaker_registry.c ) + s.files += %w( src/core/lib/channel/http_client_filter.c ) + s.files += %w( src/core/lib/channel/http_server_filter.c ) + s.files += %w( src/core/lib/channel/message_size_filter.c ) s.files += %w( src/core/lib/compression/compression.c ) s.files += %w( src/core/lib/compression/message_compress.c ) s.files += %w( src/core/lib/debug/trace.c ) @@ -519,10 +524,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/transport/chttp2/transport/varint.c ) s.files += %w( src/core/ext/transport/chttp2/transport/writing.c ) s.files += %w( src/core/ext/transport/chttp2/alpn/alpn.c ) - s.files += %w( src/core/ext/filters/http/client/http_client_filter.c ) - s.files += %w( src/core/ext/filters/http/http_filters_plugin.c ) - s.files += %w( src/core/ext/filters/http/message_compress/message_compress_filter.c ) - s.files += %w( src/core/ext/filters/http/server/http_server_filter.c ) s.files += %w( src/core/lib/http/httpcli_security_connector.c ) s.files += %w( src/core/lib/security/context/security_context.c ) s.files += %w( src/core/lib/security/credentials/composite/composite_credentials.c ) @@ -572,7 +573,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/filters/client_channel/subchannel.c ) s.files += %w( src/core/ext/filters/client_channel/subchannel_index.c ) s.files += %w( src/core/ext/filters/client_channel/uri_parser.c ) - s.files += %w( src/core/ext/filters/deadline/deadline_filter.c ) s.files += %w( src/core/ext/transport/chttp2/client/chttp2_connector.c ) s.files += %w( src/core/ext/transport/chttp2/server/insecure/server_chttp2.c ) s.files += %w( src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c ) @@ -609,7 +609,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/census/trace_context.c ) s.files += %w( src/core/ext/census/tracing.c ) s.files += %w( src/core/ext/filters/max_age/max_age_filter.c ) - s.files += %w( src/core/ext/filters/message_size/message_size_filter.c ) s.files += %w( src/core/plugin_registry/grpc_plugin_registry.c ) s.files += %w( third_party/boringssl/crypto/aes/internal.h ) s.files += %w( third_party/boringssl/crypto/asn1/asn1_locl.h ) diff --git a/include/grpc++/impl/codegen/async_stream.h b/include/grpc++/impl/codegen/async_stream.h index f97d824bafe..8f529895cac 100644 --- a/include/grpc++/impl/codegen/async_stream.h +++ b/include/grpc++/impl/codegen/async_stream.h @@ -145,19 +145,17 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface { public: /// Create a stream and write the first request out. template - static ClientAsyncReader* Create(ChannelInterface* channel, - CompletionQueue* cq, const RpcMethod& method, - ClientContext* context, const W& request, - void* tag) { - Call call = channel->CreateCall(method, context, cq); - return new (g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncReader))) - ClientAsyncReader(call, context, request, tag); - } - - // always allocated against a call arena, no memory free required - static void operator delete(void* ptr, std::size_t size) { - assert(size == sizeof(ClientAsyncReader)); + ClientAsyncReader(ChannelInterface* channel, CompletionQueue* cq, + const RpcMethod& method, ClientContext* context, + const W& request, void* tag) + : context_(context), call_(channel->CreateCall(method, context, cq)) { + init_ops_.set_output_tag(tag); + init_ops_.SendInitialMetadata(context->send_initial_metadata_, + context->initial_metadata_flags()); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(init_ops_.SendMessage(request).ok()); + init_ops_.ClientSendClose(); + call_.PerformOps(&init_ops_); } void ReadInitialMetadata(void* tag) override { @@ -187,19 +185,6 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface { } private: - template - ClientAsyncReader(Call call, ClientContext* context, const W& request, - void* tag) - : context_(context), call_(call) { - init_ops_.set_output_tag(tag); - init_ops_.SendInitialMetadata(context->send_initial_metadata_, - context->initial_metadata_flags()); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(init_ops_.SendMessage(request).ok()); - init_ops_.ClientSendClose(); - call_.PerformOps(&init_ops_); - } - ClientContext* context_; Call call_; CallOpSet @@ -225,19 +210,23 @@ template class ClientAsyncWriter final : public ClientAsyncWriterInterface { public: template - static ClientAsyncWriter* Create(ChannelInterface* channel, - CompletionQueue* cq, const RpcMethod& method, - ClientContext* context, R* response, - void* tag) { - Call call = channel->CreateCall(method, context, cq); - return new (g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncWriter))) - ClientAsyncWriter(call, context, response, tag); - } - - // always allocated against a call arena, no memory free required - static void operator delete(void* ptr, std::size_t size) { - assert(size == sizeof(ClientAsyncWriter)); + ClientAsyncWriter(ChannelInterface* channel, CompletionQueue* cq, + const RpcMethod& method, ClientContext* context, + R* response, void* tag) + : context_(context), call_(channel->CreateCall(method, context, cq)) { + finish_ops_.RecvMessage(response); + finish_ops_.AllowNoMessage(); + // if corked bit is set in context, we buffer up the initial metadata to + // coalesce with later message to be sent. No op is performed. + if (context_->initial_metadata_corked_) { + write_ops_.SendInitialMetadata(context->send_initial_metadata_, + context->initial_metadata_flags()); + } else { + write_ops_.set_output_tag(tag); + write_ops_.SendInitialMetadata(context->send_initial_metadata_, + context->initial_metadata_flags()); + call_.PerformOps(&write_ops_); + } } void ReadInitialMetadata(void* tag) override { @@ -282,24 +271,6 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface { } private: - template - ClientAsyncWriter(Call call, ClientContext* context, R* response, void* tag) - : context_(context), call_(call) { - finish_ops_.RecvMessage(response); - finish_ops_.AllowNoMessage(); - // if corked bit is set in context, we buffer up the initial metadata to - // coalesce with later message to be sent. No op is performed. - if (context_->initial_metadata_corked_) { - write_ops_.SendInitialMetadata(context->send_initial_metadata_, - context->initial_metadata_flags()); - } else { - write_ops_.set_output_tag(tag); - write_ops_.SendInitialMetadata(context->send_initial_metadata_, - context->initial_metadata_flags()); - call_.PerformOps(&write_ops_); - } - } - ClientContext* context_; Call call_; CallOpSet meta_ops_; @@ -327,20 +298,21 @@ template class ClientAsyncReaderWriter final : public ClientAsyncReaderWriterInterface { public: - static ClientAsyncReaderWriter* Create(ChannelInterface* channel, - CompletionQueue* cq, - const RpcMethod& method, - ClientContext* context, void* tag) { - Call call = channel->CreateCall(method, context, cq); - - return new (g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncReaderWriter))) - ClientAsyncReaderWriter(call, context, tag); - } - - // always allocated against a call arena, no memory free required - static void operator delete(void* ptr, std::size_t size) { - assert(size == sizeof(ClientAsyncReaderWriter)); + ClientAsyncReaderWriter(ChannelInterface* channel, CompletionQueue* cq, + const RpcMethod& method, ClientContext* context, + void* tag) + : context_(context), call_(channel->CreateCall(method, context, cq)) { + if (context_->initial_metadata_corked_) { + // if corked bit is set in context, we buffer up the initial metadata to + // coalesce with later message to be sent. No op is performed. + write_ops_.SendInitialMetadata(context->send_initial_metadata_, + context->initial_metadata_flags()); + } else { + write_ops_.set_output_tag(tag); + write_ops_.SendInitialMetadata(context->send_initial_metadata_, + context->initial_metadata_flags()); + call_.PerformOps(&write_ops_); + } } void ReadInitialMetadata(void* tag) override { @@ -394,21 +366,6 @@ class ClientAsyncReaderWriter final } private: - ClientAsyncReaderWriter(Call call, ClientContext* context, void* tag) - : context_(context), call_(call) { - if (context_->initial_metadata_corked_) { - // if corked bit is set in context, we buffer up the initial metadata to - // coalesce with later message to be sent. No op is performed. - write_ops_.SendInitialMetadata(context->send_initial_metadata_, - context->initial_metadata_flags()); - } else { - write_ops_.set_output_tag(tag); - write_ops_.SendInitialMetadata(context->send_initial_metadata_, - context->initial_metadata_flags()); - call_.PerformOps(&write_ops_); - } - } - ClientContext* context_; Call call_; CallOpSet meta_ops_; diff --git a/include/grpc++/impl/codegen/async_unary_call.h b/include/grpc++/impl/codegen/async_unary_call.h index a147a6acbf8..b77a16b699f 100644 --- a/include/grpc++/impl/codegen/async_unary_call.h +++ b/include/grpc++/impl/codegen/async_unary_call.h @@ -34,7 +34,6 @@ #ifndef GRPCXX_IMPL_CODEGEN_ASYNC_UNARY_CALL_H #define GRPCXX_IMPL_CODEGEN_ASYNC_UNARY_CALL_H -#include #include #include #include @@ -60,67 +59,57 @@ class ClientAsyncResponseReader final : public ClientAsyncResponseReaderInterface { public: template - static ClientAsyncResponseReader* Create(ChannelInterface* channel, - CompletionQueue* cq, - const RpcMethod& method, - ClientContext* context, - const W& request) { - Call call = channel->CreateCall(method, context, cq); - return new (g_core_codegen_interface->grpc_call_arena_alloc( - call.call(), sizeof(ClientAsyncResponseReader))) - ClientAsyncResponseReader(call, context, request); - } - - // always allocated against a call arena, no memory free required - static void operator delete(void* ptr, std::size_t size) { - assert(size == sizeof(ClientAsyncResponseReader)); + ClientAsyncResponseReader(ChannelInterface* channel, CompletionQueue* cq, + const RpcMethod& method, ClientContext* context, + const W& request) + : context_(context), + call_(channel->CreateCall(method, context, cq)), + collection_(std::make_shared()) { + collection_->init_buf_.SetCollection(collection_); + collection_->init_buf_.SendInitialMetadata( + context->send_initial_metadata_, context->initial_metadata_flags()); + // TODO(ctiller): don't assert + GPR_CODEGEN_ASSERT(collection_->init_buf_.SendMessage(request).ok()); + collection_->init_buf_.ClientSendClose(); + call_.PerformOps(&collection_->init_buf_); } void ReadInitialMetadata(void* tag) { GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); - meta_buf_.set_output_tag(tag); - meta_buf_.RecvInitialMetadata(context_); - call_.PerformOps(&meta_buf_); + collection_->meta_buf_.SetCollection(collection_); + collection_->meta_buf_.set_output_tag(tag); + collection_->meta_buf_.RecvInitialMetadata(context_); + call_.PerformOps(&collection_->meta_buf_); } void Finish(R* msg, Status* status, void* tag) { - finish_buf_.set_output_tag(tag); + collection_->finish_buf_.SetCollection(collection_); + collection_->finish_buf_.set_output_tag(tag); if (!context_->initial_metadata_received_) { - finish_buf_.RecvInitialMetadata(context_); + collection_->finish_buf_.RecvInitialMetadata(context_); } - finish_buf_.RecvMessage(msg); - finish_buf_.AllowNoMessage(); - finish_buf_.ClientRecvStatus(context_, status); - call_.PerformOps(&finish_buf_); + collection_->finish_buf_.RecvMessage(msg); + collection_->finish_buf_.AllowNoMessage(); + collection_->finish_buf_.ClientRecvStatus(context_, status); + call_.PerformOps(&collection_->finish_buf_); } private: - ClientContext* const context_; + ClientContext* context_; Call call_; - template - ClientAsyncResponseReader(Call call, ClientContext* context, const W& request) - : context_(context), call_(call) { - init_buf_.SendInitialMetadata(context->send_initial_metadata_, - context->initial_metadata_flags()); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(init_buf_.SendMessage(request).ok()); - init_buf_.ClientSendClose(); - call_.PerformOps(&init_buf_); - } - - // disable operator new - static void* operator new(std::size_t size); - static void* operator new(std::size_t size, void* p) { return p; }; - - SneakyCallOpSet - init_buf_; - CallOpSet meta_buf_; - CallOpSet, - CallOpClientRecvStatus> - finish_buf_; + class CallOpSetCollection : public CallOpSetCollectionInterface { + public: + SneakyCallOpSet + init_buf_; + CallOpSet meta_buf_; + CallOpSet, + CallOpClientRecvStatus> + finish_buf_; + }; + std::shared_ptr collection_; }; template @@ -190,12 +179,4 @@ class ServerAsyncResponseWriter final : public ServerAsyncStreamingInterface { } // namespace grpc -namespace std { -template -class default_delete> { - public: - void operator()(void* p) {} -}; -} - #endif // GRPCXX_IMPL_CODEGEN_ASYNC_UNARY_CALL_H diff --git a/include/grpc++/impl/codegen/call.h b/include/grpc++/impl/codegen/call.h index f334ba61d6c..dd63c21ff17 100644 --- a/include/grpc++/impl/codegen/call.h +++ b/include/grpc++/impl/codegen/call.h @@ -34,7 +34,6 @@ #ifndef GRPCXX_IMPL_CODEGEN_CALL_H #define GRPCXX_IMPL_CODEGEN_CALL_H -#include #include #include #include @@ -48,9 +47,9 @@ #include #include #include +#include #include -#include #include #include @@ -247,10 +246,8 @@ class CallOpSendInitialMetadata { op->data.send_initial_metadata.metadata = initial_metadata_; op->data.send_initial_metadata.maybe_compression_level.is_set = maybe_compression_level_.is_set; - if (maybe_compression_level_.is_set) { - op->data.send_initial_metadata.maybe_compression_level.level = - maybe_compression_level_.level; - } + op->data.send_initial_metadata.maybe_compression_level.level = + maybe_compression_level_.level; } void FinishOp(bool* status) { if (!send_) return; @@ -471,7 +468,7 @@ class CallOpServerSendStatus { trailing_metadata_ = FillMetadataArray( trailing_metadata, &trailing_metadata_count_, send_error_details_); send_status_available_ = true; - send_status_code_ = static_cast(status.error_code()); + send_status_code_ = static_cast(GetCanonicalCode(status)); send_error_message_ = status.error_message(); } @@ -582,6 +579,17 @@ class CallOpClientRecvStatus { grpc_slice error_message_; }; +/// An abstract collection of CallOpSet's, to be used whenever +/// CallOpSet objects must be thought of as a group. Each member +/// of the group should have a shared_ptr back to the collection, +/// as will the object that instantiates the collection, allowing +/// for automatic ref-counting. In practice, any actual use should +/// derive from this base class. This is specifically necessary if +/// some of the CallOpSet's in the collection are "Sneaky" and don't +/// report back to the C++ layer CQ operations +class CallOpSetCollectionInterface + : public std::enable_shared_from_this {}; + /// An abstract collection of call ops, used to generate the /// grpc_call_op structure to pass down to the lower layers, /// and as it is-a CompletionQueueTag, also massages the final @@ -589,9 +597,18 @@ class CallOpClientRecvStatus { /// API. class CallOpSetInterface : public CompletionQueueTag { public: + CallOpSetInterface() {} /// Fills in grpc_op, starting from ops[*nops] and moving /// upwards. - virtual void FillOps(grpc_call* call, grpc_op* ops, size_t* nops) = 0; + virtual void FillOps(grpc_op* ops, size_t* nops) = 0; + + /// Mark this as belonging to a collection if needed + void SetCollection(std::shared_ptr collection) { + collection_ = collection; + } + + protected: + std::shared_ptr collection_; }; /// Primary implementaiton of CallOpSetInterface. @@ -612,15 +629,13 @@ class CallOpSet : public CallOpSetInterface, public Op6 { public: CallOpSet() : return_tag_(this) {} - void FillOps(grpc_call* call, grpc_op* ops, size_t* nops) override { + void FillOps(grpc_op* ops, size_t* nops) override { this->Op1::AddOp(ops, nops); this->Op2::AddOp(ops, nops); this->Op3::AddOp(ops, nops); this->Op4::AddOp(ops, nops); this->Op5::AddOp(ops, nops); this->Op6::AddOp(ops, nops); - g_core_codegen_interface->grpc_call_ref(call); - call_ = call; } bool FinalizeResult(void** tag, bool* status) override { @@ -631,7 +646,7 @@ class CallOpSet : public CallOpSetInterface, this->Op5::FinishOp(status); this->Op6::FinishOp(status); *tag = return_tag_; - g_core_codegen_interface->grpc_call_unref(call_); + collection_.reset(); // drop the ref at this point return true; } @@ -639,7 +654,6 @@ class CallOpSet : public CallOpSetInterface, private: void* return_tag_; - grpc_call* call_; }; /// A CallOpSet that does not post completions to the completion queue. diff --git a/include/grpc++/impl/codegen/client_unary_call.h b/include/grpc++/impl/codegen/client_unary_call.h index 4bf35ae7785..201e52ae073 100644 --- a/include/grpc++/impl/codegen/client_unary_call.h +++ b/include/grpc++/impl/codegen/client_unary_call.h @@ -52,9 +52,7 @@ template Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method, ClientContext* context, const InputMessage& request, OutputMessage* result) { - CompletionQueue cq(grpc_completion_queue_attributes{ - GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK, - GRPC_CQ_DEFAULT_POLLING}); // Pluckable completion queue + CompletionQueue cq; Call call(channel->CreateCall(method, context, &cq)); CallOpSet, diff --git a/include/grpc++/impl/codegen/completion_queue.h b/include/grpc++/impl/codegen/completion_queue.h index c8ab726b0f4..03cecdc21c6 100644 --- a/include/grpc++/impl/codegen/completion_queue.h +++ b/include/grpc++/impl/codegen/completion_queue.h @@ -102,9 +102,10 @@ class CompletionQueue : private GrpcLibraryCodegen { public: /// Default constructor. Implicitly creates a \a grpc_completion_queue /// instance. - CompletionQueue() - : CompletionQueue(grpc_completion_queue_attributes{ - GRPC_CQ_CURRENT_VERSION, GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING}) {} + CompletionQueue() { + cq_ = g_core_codegen_interface->grpc_completion_queue_create(nullptr); + InitialAvalanching(); // reserve this for the future shutdown + } /// Wrap \a take, taking ownership of the instance. /// @@ -184,16 +185,6 @@ class CompletionQueue : private GrpcLibraryCodegen { }; void CompleteAvalanching(); - protected: - /// Private constructor of CompletionQueue only visible to friend classes - CompletionQueue(const grpc_completion_queue_attributes& attributes) { - cq_ = g_core_codegen_interface->grpc_completion_queue_create( - g_core_codegen_interface->grpc_completion_queue_factory_lookup( - &attributes), - &attributes, NULL); - InitialAvalanching(); // reserve this for the future shutdown - } - private: // Friend synchronous wrappers so that they can access Pluck(), which is // a semi-private API geared towards the synchronous implementation. @@ -246,12 +237,6 @@ class CompletionQueue : private GrpcLibraryCodegen { /// Performs a single polling pluck on \a tag. /// \warning Must not be mixed with calls to \a Next. - /// - /// TODO: sreek - This calls tag->FinalizeResult() even if the cq_ is already - /// shutdown. This is most likely a bug and if it is a bug, then change this - /// implementation to simple call the other TryPluck function with a zero - /// timeout. i.e: - /// TryPluck(tag, gpr_time_0(GPR_CLOCK_REALTIME)) void TryPluck(CompletionQueueTag* tag) { auto deadline = g_core_codegen_interface->gpr_time_0(GPR_CLOCK_REALTIME); auto ev = g_core_codegen_interface->grpc_completion_queue_pluck( @@ -263,23 +248,6 @@ class CompletionQueue : private GrpcLibraryCodegen { GPR_CODEGEN_ASSERT(!tag->FinalizeResult(&ignored, &ok)); } - /// Performs a single polling pluck on \a tag. Calls tag->FinalizeResult if - /// the pluck() was successful and returned the tag. - /// - /// This exects tag->FinalizeResult (if called) to return 'false' i.e expects - /// that the tag is internal not something that is returned to the user. - void TryPluck(CompletionQueueTag* tag, gpr_timespec deadline) { - auto ev = g_core_codegen_interface->grpc_completion_queue_pluck( - cq_, tag, deadline, nullptr); - if (ev.type == GRPC_QUEUE_TIMEOUT || ev.type == GRPC_QUEUE_SHUTDOWN) { - return; - } - - bool ok = ev.success != 0; - void* ignored = tag; - GPR_CODEGEN_ASSERT(!tag->FinalizeResult(&ignored, &ok)); - } - grpc_completion_queue* cq_; // owned gpr_atm avalanches_in_flight_; @@ -289,19 +257,17 @@ class CompletionQueue : private GrpcLibraryCodegen { /// by servers. Instantiated by \a ServerBuilder. class ServerCompletionQueue : public CompletionQueue { public: - bool IsFrequentlyPolled() { return polling_type_ != GRPC_CQ_NON_LISTENING; } + bool IsFrequentlyPolled() { return is_frequently_polled_; } private: - grpc_cq_polling_type polling_type_; + bool is_frequently_polled_; friend class ServerBuilder; /// \param is_frequently_polled Informs the GRPC library about whether the /// server completion queue would be actively polled (by calling Next() or /// AsyncNext()). By default all server completion queues are assumed to be /// frequently polled. - ServerCompletionQueue(grpc_cq_polling_type polling_type) - : CompletionQueue(grpc_completion_queue_attributes{ - GRPC_CQ_CURRENT_VERSION, GRPC_CQ_NEXT, polling_type}), - polling_type_(polling_type) {} + ServerCompletionQueue(bool is_frequently_polled = true) + : is_frequently_polled_(is_frequently_polled) {} }; } // namespace grpc diff --git a/include/grpc++/impl/codegen/core_codegen.h b/include/grpc++/impl/codegen/core_codegen.h index a1593729ebc..6bf95129b81 100644 --- a/include/grpc++/impl/codegen/core_codegen.h +++ b/include/grpc++/impl/codegen/core_codegen.h @@ -38,25 +38,14 @@ #include #include -#include #include namespace grpc { /// Implementation of the core codegen interface. -class CoreCodegen final : public CoreCodegenInterface { +class CoreCodegen : public CoreCodegenInterface { private: - virtual const grpc_completion_queue_factory* - grpc_completion_queue_factory_lookup( - const grpc_completion_queue_attributes* attributes) override; - virtual grpc_completion_queue* grpc_completion_queue_create( - const grpc_completion_queue_factory* factory, - const grpc_completion_queue_attributes* attributes, - void* reserved) override; - grpc_completion_queue* grpc_completion_queue_create_for_next( - void* reserved) override; - grpc_completion_queue* grpc_completion_queue_create_for_pluck( - void* reserved) override; + grpc_completion_queue* grpc_completion_queue_create(void* reserved) override; void grpc_completion_queue_destroy(grpc_completion_queue* cq) override; grpc_event grpc_completion_queue_pluck(grpc_completion_queue* cq, void* tag, gpr_timespec deadline, @@ -75,10 +64,6 @@ class CoreCodegen final : public CoreCodegenInterface { void gpr_cv_signal(gpr_cv* cv) override; void gpr_cv_broadcast(gpr_cv* cv) override; - void grpc_call_ref(grpc_call* call) override; - void grpc_call_unref(grpc_call* call) override; - virtual void* grpc_call_arena_alloc(grpc_call* call, size_t length) override; - void grpc_byte_buffer_destroy(grpc_byte_buffer* bb) override; int grpc_byte_buffer_reader_init(grpc_byte_buffer_reader* reader, diff --git a/include/grpc++/impl/codegen/core_codegen_interface.h b/include/grpc++/impl/codegen/core_codegen_interface.h index 7cc3a824761..e111d59364b 100644 --- a/include/grpc++/impl/codegen/core_codegen_interface.h +++ b/include/grpc++/impl/codegen/core_codegen_interface.h @@ -59,15 +59,7 @@ class CoreCodegenInterface { virtual void assert_fail(const char* failed_assertion, const char* file, int line) = 0; - virtual const grpc_completion_queue_factory* - grpc_completion_queue_factory_lookup( - const grpc_completion_queue_attributes* attributes) = 0; virtual grpc_completion_queue* grpc_completion_queue_create( - const grpc_completion_queue_factory* factory, - const grpc_completion_queue_attributes* attributes, void* reserved) = 0; - virtual grpc_completion_queue* grpc_completion_queue_create_for_next( - void* reserved) = 0; - virtual grpc_completion_queue* grpc_completion_queue_create_for_pluck( void* reserved) = 0; virtual void grpc_completion_queue_destroy(grpc_completion_queue* cq) = 0; virtual grpc_event grpc_completion_queue_pluck(grpc_completion_queue* cq, @@ -102,10 +94,6 @@ class CoreCodegenInterface { virtual grpc_byte_buffer* grpc_raw_byte_buffer_create(grpc_slice* slice, size_t nslices) = 0; - virtual void grpc_call_ref(grpc_call* call) = 0; - virtual void grpc_call_unref(grpc_call* call) = 0; - virtual void* grpc_call_arena_alloc(grpc_call* call, size_t length) = 0; - virtual grpc_slice grpc_empty_slice() = 0; virtual grpc_slice grpc_slice_malloc(size_t length) = 0; virtual void grpc_slice_unref(grpc_slice slice) = 0; diff --git a/include/grpc++/impl/codegen/server_context.h b/include/grpc++/impl/codegen/server_context.h index ada304d5719..91f0be06e72 100644 --- a/include/grpc++/impl/codegen/server_context.h +++ b/include/grpc++/impl/codegen/server_context.h @@ -40,7 +40,6 @@ #include -#include #include #include #include @@ -212,8 +211,6 @@ class ServerContext { class CompletionOp; void BeginCompletionOp(Call* call); - // Return the tag queued by BeginCompletionOp() - CompletionQueueTag* GetCompletionOpTag(); ServerContext(gpr_timespec deadline, grpc_metadata_array* arr); diff --git a/include/grpc++/impl/codegen/server_interface.h b/include/grpc++/impl/codegen/server_interface.h index 31d55529efc..bd1b36e8839 100644 --- a/include/grpc++/impl/codegen/server_interface.h +++ b/include/grpc++/impl/codegen/server_interface.h @@ -122,7 +122,9 @@ class ServerInterface : public CallHook { /// caller is required to keep all completion queues live until the server is /// destroyed. /// \param num_cqs How many completion queues does \a cqs hold. - virtual void Start(ServerCompletionQueue** cqs, size_t num_cqs) = 0; + /// + /// \return true on a successful shutdown. + virtual bool Start(ServerCompletionQueue** cqs, size_t num_cqs) = 0; virtual void ShutdownInternal(gpr_timespec deadline) = 0; diff --git a/include/grpc++/impl/codegen/status_helper.h b/include/grpc++/impl/codegen/status_helper.h new file mode 100644 index 00000000000..bfe45d9e5b1 --- /dev/null +++ b/include/grpc++/impl/codegen/status_helper.h @@ -0,0 +1,47 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef GRPCXX_IMPL_CODEGEN_STATUS_HELPER_H +#define GRPCXX_IMPL_CODEGEN_STATUS_HELPER_H + +#include + +namespace grpc { + +inline StatusCode GetCanonicalCode(const Status& status) { + return status.error_code(); +} + +} // namespace grpc + +#endif // GRPCXX_IMPL_CODEGEN_STATUS_HELPER_H diff --git a/include/grpc++/impl/codegen/sync_stream.h b/include/grpc++/impl/codegen/sync_stream.h index a010924cefe..ae3b8e441d1 100644 --- a/include/grpc++/impl/codegen/sync_stream.h +++ b/include/grpc++/impl/codegen/sync_stream.h @@ -155,11 +155,7 @@ class ClientReader final : public ClientReaderInterface { template ClientReader(ChannelInterface* channel, const RpcMethod& method, ClientContext* context, const W& request) - : context_(context), - cq_(grpc_completion_queue_attributes{ - GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK, - GRPC_CQ_DEFAULT_POLLING}), // Pluckable cq - call_(channel->CreateCall(method, context, &cq_)) { + : context_(context), call_(channel->CreateCall(method, context, &cq_)) { CallOpSet ops; @@ -231,11 +227,7 @@ class ClientWriter : public ClientWriterInterface { template ClientWriter(ChannelInterface* channel, const RpcMethod& method, ClientContext* context, R* response) - : context_(context), - cq_(grpc_completion_queue_attributes{ - GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK, - GRPC_CQ_DEFAULT_POLLING}), // Pluckable cq - call_(channel->CreateCall(method, context, &cq_)) { + : context_(context), call_(channel->CreateCall(method, context, &cq_)) { finish_ops_.RecvMessage(response); finish_ops_.AllowNoMessage(); @@ -333,11 +325,7 @@ class ClientReaderWriter final : public ClientReaderWriterInterface { /// Blocking create a stream. ClientReaderWriter(ChannelInterface* channel, const RpcMethod& method, ClientContext* context) - : context_(context), - cq_(grpc_completion_queue_attributes{ - GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK, - GRPC_CQ_DEFAULT_POLLING}), // Pluckable cq - call_(channel->CreateCall(method, context, &cq_)) { + : context_(context), call_(channel->CreateCall(method, context, &cq_)) { if (!context_->initial_metadata_corked_) { CallOpSet ops; ops.SendInitialMetadata(context->send_initial_metadata_, @@ -574,7 +562,7 @@ class ServerReaderWriterBody final { Call* const call_; ServerContext* const ctx_; }; -} // namespace internal +} // class to represent the user API for a bidirectional streaming call template diff --git a/include/grpc++/server.h b/include/grpc++/server.h index 2f7018e95bf..489937712ec 100644 --- a/include/grpc++/server.h +++ b/include/grpc++/server.h @@ -89,8 +89,7 @@ class Server final : public ServerInterface, private GrpcLibraryCodegen { /// Called before server is started. virtual void PreServerStart(Server* server) {} /// Called after a server port is added. - virtual void AddPort(Server* server, const grpc::string& addr, - ServerCredentials* creds, int port) {} + virtual void AddPort(Server* server, int port) {} }; /// Set the global callback object. Can only be called once. Does not take /// ownership of callbacks, and expects the pointed to object to be alive @@ -178,7 +177,9 @@ class Server final : public ServerInterface, private GrpcLibraryCodegen { /// caller is required to keep all completion queues live until the server is /// destroyed. /// \param num_cqs How many completion queues does \a cqs hold. - void Start(ServerCompletionQueue** cqs, size_t num_cqs) override; + /// + /// \return true on a successful shutdown. + bool Start(ServerCompletionQueue** cqs, size_t num_cqs) override; void PerformOpsOnCall(CallOpSetInterface* ops, Call* call) override; diff --git a/include/grpc++/server_builder.h b/include/grpc++/server_builder.h index 7ac23349c84..d707100a522 100644 --- a/include/grpc++/server_builder.h +++ b/include/grpc++/server_builder.h @@ -195,7 +195,10 @@ class ServerBuilder { struct SyncServerSettings { SyncServerSettings() - : num_cqs(1), min_pollers(1), max_pollers(2), cq_timeout_msec(10000) {} + : num_cqs(1), + min_pollers(1), + max_pollers(INT_MAX), + cq_timeout_msec(1000) {} // Number of server completion queues to create to listen to incoming RPCs. int num_cqs; diff --git a/include/grpc++/test/mock_stream.h b/include/grpc++/test/mock_stream.h deleted file mode 100644 index f2de9472d6b..00000000000 --- a/include/grpc++/test/mock_stream.h +++ /dev/null @@ -1,163 +0,0 @@ -/* - * - * Copyright 2017, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef GRPCXX_TEST_MOCK_STREAM_H -#define GRPCXX_TEST_MOCK_STREAM_H - -#include - -#include -#include -#include -#include -#include - -namespace grpc { -namespace testing { - -template -class MockClientReader : public ClientReaderInterface { - public: - MockClientReader() = default; - - // ClientStreamingInterface - MOCK_METHOD0_T(Finish, Status()); - - // ReaderInterface - MOCK_METHOD1_T(NextMessageSize, bool(uint32_t*)); - MOCK_METHOD1_T(Read, bool(R*)); - - // ClientReaderInterface - MOCK_METHOD0_T(WaitForInitialMetadata, void()); -}; - -template -class MockClientWriter : public ClientWriterInterface { - public: - MockClientWriter() = default; - - // ClientStreamingInterface - MOCK_METHOD0_T(Finish, Status()); - - // WriterInterface - MOCK_METHOD2_T(Write, bool(const W&, const WriteOptions)); - - // ClientWriterInterface - MOCK_METHOD0_T(WritesDone, bool()); -}; - -template -class MockClientReaderWriter : public ClientReaderWriterInterface { - public: - MockClientReaderWriter() = default; - - // ClientStreamingInterface - MOCK_METHOD0_T(Finish, Status()); - - // ReaderInterface - MOCK_METHOD1_T(NextMessageSize, bool(uint32_t*)); - MOCK_METHOD1_T(Read, bool(R*)); - - // WriterInterface - MOCK_METHOD2_T(Write, bool(const W&, const WriteOptions)); - - // ClientReaderWriterInterface - MOCK_METHOD0_T(WaitForInitialMetadata, void()); - MOCK_METHOD0_T(WritesDone, bool()); -}; - -// TODO: We do not support mocking an async RPC for now. - -template -class MockClientAsyncResponseReader - : public ClientAsyncResponseReaderInterface { - public: - MockClientAsyncResponseReader() = default; - - MOCK_METHOD1_T(ReadInitialMetadata, void(void*)); - MOCK_METHOD3_T(Finish, void(R*, Status*, void*)); -}; - -template -class MockClientAsyncReader : public ClientAsyncReaderInterface { - public: - MockClientAsyncReader() = default; - - // ClientAsyncStreamingInterface - MOCK_METHOD1_T(ReadInitialMetadata, void(void*)); - MOCK_METHOD2_T(Finish, void(Status*, void*)); - - // AsyncReaderInterface - MOCK_METHOD2_T(Read, void(R*, void*)); -}; - -template -class MockClientAsyncWriter : public ClientAsyncWriterInterface { - public: - MockClientAsyncWriter() = default; - - // ClientAsyncStreamingInterface - MOCK_METHOD1_T(ReadInitialMetadata, void(void*)); - MOCK_METHOD2_T(Finish, void(Status*, void*)); - - // AsyncWriterInterface - MOCK_METHOD2_T(Write, void(const W&, void*)); - - // ClientAsyncWriterInterface - MOCK_METHOD1_T(WritesDone, void(void*)); -}; - -template -class MockClientAsyncReaderWriter - : public ClientAsyncReaderWriterInterface { - public: - MockClientAsyncReaderWriter() = default; - - // ClientAsyncStreamingInterface - MOCK_METHOD1_T(ReadInitialMetadata, void(void*)); - MOCK_METHOD2_T(Finish, void(Status*, void*)); - - // AsyncWriterInterface - MOCK_METHOD2_T(Write, void(const W&, void*)); - - // AsyncReaderInterface - MOCK_METHOD2_T(Read, void(R*, void*)); - - // ClientAsyncReaderWriterInterface - MOCK_METHOD1_T(WritesDone, void(void*)); -}; - -} // namespace testing -} // namespace grpc - -#endif // GRPCXX_TEST_MOCK_STREAM_H diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h index 1eeb075927d..e088435d6cc 100644 --- a/include/grpc/grpc.h +++ b/include/grpc/grpc.h @@ -93,6 +93,55 @@ GRPCAPI const char *grpc_version_string(void); /** Return a string specifying what the 'g' in gRPC stands for */ GRPCAPI const char *grpc_g_stands_for(void); +/** Specifies the type of APIs to use to pop events from the completion queue */ +typedef enum { + /* Events are popped out by calling grpc_completion_queue_next() API ONLY */ + GRPC_CQ_NEXT = 1, + + /* Events are popped out by calling grpc_completion_queue_pluck() API ONLY */ + GRPC_CQ_PLUCK +} grpc_cq_completion_type; + +/** Completion queues internally MAY maintain a set of file descriptors in a + structure called 'pollset'. This enum specifies if a completion queue has an + associated pollset and any restrictions on the type of file descriptors that + can be present in the pollset. + + I/O progress can only be made when grpc_completion_queue_next() or + grpc_completion_queue_pluck() are called on the completion queue (unless the + grpc_cq_polling_type is GRPC_CQ_NON_POLLING) and hence it is very important + to actively call these APIs */ +typedef enum { + /** The completion queue will have an associated pollset and there is no + restriction on the type of file descriptors the pollset may contain */ + GRPC_CQ_DEFAULT_POLLING, + + /* Similar to GRPC_CQ_DEFAULT_POLLING except that the completion queues will + not contain any 'listening file descriptors' (i.e file descriptors used to + listen to incoming channels) */ + GRPC_CQ_NON_LISTENING, + + /* The completion queue will not have an associated pollset. Note that + grpc_completion_queue_next() or grpc_completion_queue_pluck() MUST still be + called to pop events from the completion queue; it is not required to call + them actively to make I/O progress */ + GRPC_CQ_NON_POLLING +} grpc_cq_polling_type; + +#define GRPC_CQ_CURRENT_VERSION 1 +typedef struct grpc_completion_queue_attributes { + /* The version number of this structure. More fields might be added to this + structure in future. */ + int version; /* Set to GRPC_CQ_CURRENT_VERSION */ + + grpc_cq_completion_type cq_completion_type; + + grpc_cq_polling_type cq_polling_type; +} grpc_completion_queue_attributes; + +/** The completion queue factory structure is opaque to the callers of grpc */ +typedef struct grpc_completion_queue_factory grpc_completion_queue_factory; + /** Returns the completion queue factory based on the attributes. MAY return a NULL if no factory can be found */ GRPCAPI const grpc_completion_queue_factory * @@ -110,9 +159,7 @@ GRPCAPI grpc_completion_queue *grpc_completion_queue_create_for_pluck( void *reserved); /** Create a completion queue */ -GRPCAPI grpc_completion_queue *grpc_completion_queue_create( - const grpc_completion_queue_factory *factory, - const grpc_completion_queue_attributes *attributes, void *reserved); +GRPCAPI grpc_completion_queue *grpc_completion_queue_create(void *reserved); /** Blocks until an event is available, the completion queue is being shut down, or deadline is reached. @@ -216,10 +263,6 @@ GRPCAPI grpc_call *grpc_channel_create_registered_call( grpc_completion_queue *completion_queue, void *registered_call_handle, gpr_timespec deadline, void *reserved); -/** Allocate memory in the grpc_call arena: this memory is automatically - discarded at call completion */ -GRPCAPI void *grpc_call_arena_alloc(grpc_call *call, size_t size); - /** Start a batch of operations defined in the array ops; when complete, post a completion of type 'tag' to the completion queue bound to the call. The order of ops specified in the batch has no significance. @@ -251,6 +294,12 @@ GRPCAPI grpc_call_error grpc_call_start_batch(grpc_call *call, functionality. Instead, use grpc_auth_context. */ GRPCAPI char *grpc_call_get_peer(grpc_call *call); +struct grpc_load_reporting_cost_context; + +/* Associate costs contained in \a cost_context to \a call. */ +GRPCAPI void grpc_call_set_load_reporting_cost_context( + grpc_call *call, struct grpc_load_reporting_cost_context *context); + struct census_context; /** Set census context for a call; Must be called before first call to @@ -296,7 +345,7 @@ GRPCAPI void grpc_channel_destroy(grpc_channel *channel); /** Called by clients to cancel an RPC on the server. Can be called multiple times, from any thread. THREAD-SAFETY grpc_call_cancel and grpc_call_cancel_with_status - are thread-safe, and can be called at any point before grpc_call_unref + are thread-safe, and can be called at any point before grpc_call_destroy is called.*/ GRPCAPI grpc_call_error grpc_call_cancel(grpc_call *call, void *reserved); @@ -311,13 +360,9 @@ GRPCAPI grpc_call_error grpc_call_cancel_with_status(grpc_call *call, const char *description, void *reserved); -/** Ref a call. - THREAD SAFETY: grpc_call_unref is thread-compatible */ -GRPCAPI void grpc_call_ref(grpc_call *call); - -/** Unref a call. - THREAD SAFETY: grpc_call_unref is thread-compatible */ -GRPCAPI void grpc_call_unref(grpc_call *call); +/** Destroy a call. + THREAD SAFETY: grpc_call_destroy is thread-compatible */ +GRPCAPI void grpc_call_destroy(grpc_call *call); /** Request notification of a new call. Once a call is received, a notification tagged with \a tag_new is added to @@ -378,6 +423,15 @@ GRPCAPI void grpc_server_register_completion_queue(grpc_server *server, grpc_completion_queue *cq, void *reserved); +/** Register a non-listening completion queue with the server. This API is + similar to grpc_server_register_completion_queue except that the server will + not use this completion_queue to listen to any incoming channels. + + Registering a non-listening completion queue will have negative performance + impact and hence this API is not recommended for production use cases. */ +GRPCAPI void grpc_server_register_non_listening_completion_queue( + grpc_server *server, grpc_completion_queue *q, void *reserved); + /** Add a HTTP2 over plaintext over tcp listener. Returns bound port number on success, 0 on failure. REQUIRES: server not started */ diff --git a/include/grpc/impl/codegen/grpc_types.h b/include/grpc/impl/codegen/grpc_types.h index d9f5e07a8da..8fa76fc0328 100644 --- a/include/grpc/impl/codegen/grpc_types.h +++ b/include/grpc/impl/codegen/grpc_types.h @@ -175,12 +175,6 @@ typedef struct { /** Grace period after the chennel reaches its max age. Int valued, milliseconds. INT_MAX means unlimited. */ #define GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS "grpc.max_connection_age_grace_ms" -/** Enable/disable support for per-message compression. Defaults to 1, unless - GRPC_ARG_MINIMAL_STACK is enabled, in which case it defaults to 0. */ -#define GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION "grpc.per_message_compression" -/** Enable/disable support for deadline checking. Defaults to 1, unless - GRPC_ARG_MINIMAL_STACK is enabled, in which case it defaults to 0 */ -#define GRPC_ARG_ENABLE_DEADLINE_CHECKS "grpc.enable_deadline_checking" /** Initial sequence number for http2 transports. Int valued. */ #define GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER \ "grpc.http2.initial_sequence_number" @@ -205,8 +199,6 @@ typedef struct { /** Minimum time (in milliseconds) between successive ping frames being sent */ #define GRPC_ARG_HTTP2_MIN_TIME_BETWEEN_PINGS_MS \ "grpc.http2.min_time_between_pings_ms" -/* Channel arg to override the http2 :scheme header */ -#define GRPC_ARG_HTTP2_SCHEME "grpc.http2_scheme" /** How many pings can we send before needing to send a data frame or header frame? (0 indicates that an infinite number of pings can be sent without sending @@ -248,8 +240,6 @@ typedef struct { /** Secondary user agent: goes at the end of the user-agent metadata sent on each request. A string. */ #define GRPC_ARG_SECONDARY_USER_AGENT_STRING "grpc.secondary_user_agent" -/** The minimum time between subsequent connection attempts, in ms */ -#define GRPC_ARG_MIN_RECONNECT_BACKOFF_MS "grpc.min_reconnect_backoff_ms" /** The maximum time between subsequent connection attempts, in ms */ #define GRPC_ARG_MAX_RECONNECT_BACKOFF_MS "grpc.max_reconnect_backoff_ms" /** The time between the first and second connection attempts, in ms */ @@ -403,11 +393,8 @@ typedef enum grpc_completion_type { typedef struct grpc_event { /** The type of the completion. */ grpc_completion_type type; - /** If the grpc_completion_type is GRPC_OP_COMPLETE, this field indicates - whether the operation was successful or not; 0 in case of failure and - non-zero in case of success. - If grpc_completion_type is GRPC_QUEUE_SHUTDOWN or GRPC_QUEUE_TIMEOUT, this - field is guaranteed to be 0 */ + /** non-zero if the operation was successful, 0 upon failure. + Only GRPC_OP_COMPLETE can succeed or fail. */ int success; /** The tag passed to grpc_call_start_batch etc to start this operation. Only GRPC_OP_COMPLETE has a tag. */ @@ -556,55 +543,6 @@ typedef struct { typedef struct grpc_resource_quota grpc_resource_quota; -/** Completion queues internally MAY maintain a set of file descriptors in a - structure called 'pollset'. This enum specifies if a completion queue has an - associated pollset and any restrictions on the type of file descriptors that - can be present in the pollset. - - I/O progress can only be made when grpc_completion_queue_next() or - grpc_completion_queue_pluck() are called on the completion queue (unless the - grpc_cq_polling_type is GRPC_CQ_NON_POLLING) and hence it is very important - to actively call these APIs */ -typedef enum { - /** The completion queue will have an associated pollset and there is no - restriction on the type of file descriptors the pollset may contain */ - GRPC_CQ_DEFAULT_POLLING, - - /** Similar to GRPC_CQ_DEFAULT_POLLING except that the completion queues will - not contain any 'listening file descriptors' (i.e file descriptors used to - listen to incoming channels) */ - GRPC_CQ_NON_LISTENING, - - /** The completion queue will not have an associated pollset. Note that - grpc_completion_queue_next() or grpc_completion_queue_pluck() MUST still - be called to pop events from the completion queue; it is not required to - call them actively to make I/O progress */ - GRPC_CQ_NON_POLLING -} grpc_cq_polling_type; - -/** Specifies the type of APIs to use to pop events from the completion queue */ -typedef enum { - /** Events are popped out by calling grpc_completion_queue_next() API ONLY */ - GRPC_CQ_NEXT = 1, - - /** Events are popped out by calling grpc_completion_queue_pluck() API ONLY*/ - GRPC_CQ_PLUCK -} grpc_cq_completion_type; - -#define GRPC_CQ_CURRENT_VERSION 1 -typedef struct grpc_completion_queue_attributes { - /* The version number of this structure. More fields might be added to this - structure in future. */ - int version; /* Set to GRPC_CQ_CURRENT_VERSION */ - - grpc_cq_completion_type cq_completion_type; - - grpc_cq_polling_type cq_polling_type; -} grpc_completion_queue_attributes; - -/** The completion queue factory structure is opaque to the callers of grpc */ -typedef struct grpc_completion_queue_factory grpc_completion_queue_factory; - #ifdef __cplusplus } #endif diff --git a/include/grpc/load_reporting.h b/include/grpc/load_reporting.h index a334a113507..c833ce5c63b 100644 --- a/include/grpc/load_reporting.h +++ b/include/grpc/load_reporting.h @@ -35,6 +35,7 @@ #define GRPC_LOAD_REPORTING_H #include +#include #ifdef __cplusplus extern "C" { @@ -49,12 +50,11 @@ extern "C" { * gRPC LB system. */ #define GRPC_LB_TOKEN_MD_KEY "lb-token" -/** Metadata key for gRPC LB cost reporting. - * - * The value corresponding to this key is an opaque binary blob reported by the - * backend as part of its trailing metadata containing cost information for the - * call. */ -#define GRPC_LB_COST_MD_KEY "lb-cost-bin" +/** A sequence of values for load reporting purposes */ +typedef struct grpc_load_reporting_cost_context { + grpc_slice *values; + size_t values_count; +} grpc_load_reporting_cost_context; #ifdef __cplusplus } diff --git a/include/grpc/slice.h b/include/grpc/slice.h index 8c32a30d762..ea66e094e98 100644 --- a/include/grpc/slice.h +++ b/include/grpc/slice.h @@ -102,9 +102,9 @@ GPRAPI grpc_slice grpc_slice_from_static_string(const char *source); /* Create a slice pointing to constant memory */ GPRAPI grpc_slice grpc_slice_from_static_buffer(const void *source, size_t len); -/* Return a result slice derived from s, which shares a ref count with \a s, - where result.data==s.data+begin, and result.length==end-begin. The ref count - of \a s is increased by one. Do not assign result back to \a s. +/* Return a result slice derived from s, which shares a ref count with s, where + result.data==s.data+begin, and result.length==end-begin. + The ref count of s is increased by one. Requires s initialized, begin <= end, begin <= s.length, and end <= source->length. */ GPRAPI grpc_slice grpc_slice_sub(grpc_slice s, size_t begin, size_t end); diff --git a/package.json b/package.json index e1499a089cd..38312731c23 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "grpc", - "version": "1.4.0-dev", + "version": "1.3.0-pre1", "author": "Google Inc.", "description": "gRPC Library for Node", "homepage": "http://www.grpc.io/", diff --git a/package.xml b/package.xml index 8e6b30e07e6..54a7bae49ac 100644 --- a/package.xml +++ b/package.xml @@ -13,8 +13,8 @@ 2017-03-01 - 1.4.0dev - 1.4.0dev + 1.3.0RC1 + 1.3.0RC1 beta @@ -183,11 +183,16 @@ + + + + + @@ -306,9 +311,6 @@ - - - @@ -352,7 +354,6 @@ - @@ -383,15 +384,19 @@ - + + + + + @@ -528,10 +533,6 @@ - - - - @@ -581,7 +582,6 @@ - @@ -618,7 +618,6 @@ - diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc index d3e71625d65..c01e830cd68 100644 --- a/src/compiler/cpp_generator.cc +++ b/src/compiler/cpp_generator.cc @@ -1106,8 +1106,8 @@ void PrintSourceClientMethod(grpc_generator::Printer *printer, "const $Request$& request, " "::grpc::CompletionQueue* cq) {\n"); printer->Print(*vars, - " return " - "::grpc::ClientAsyncResponseReader< $Response$>::Create(" + " return new " + "::grpc::ClientAsyncResponseReader< $Response$>(" "channel_.get(), cq, " "rpcmethod_$Method$_, " "context, request);\n" @@ -1129,7 +1129,7 @@ void PrintSourceClientMethod(grpc_generator::Printer *printer, "::grpc::ClientContext* context, $Response$* response, " "::grpc::CompletionQueue* cq, void* tag) {\n"); printer->Print(*vars, - " return ::grpc::ClientAsyncWriter< $Request$>::Create(" + " return new ::grpc::ClientAsyncWriter< $Request$>(" "channel_.get(), cq, " "rpcmethod_$Method$_, " "context, response, tag);\n" @@ -1152,7 +1152,7 @@ void PrintSourceClientMethod(grpc_generator::Printer *printer, "::grpc::ClientContext* context, const $Request$& request, " "::grpc::CompletionQueue* cq, void* tag) {\n"); printer->Print(*vars, - " return ::grpc::ClientAsyncReader< $Response$>::Create(" + " return new ::grpc::ClientAsyncReader< $Response$>(" "channel_.get(), cq, " "rpcmethod_$Method$_, " "context, request, tag);\n" @@ -1174,14 +1174,13 @@ void PrintSourceClientMethod(grpc_generator::Printer *printer, "::grpc::ClientAsyncReaderWriter< $Request$, $Response$>* " "$ns$$Service$::Stub::Async$Method$Raw(::grpc::ClientContext* context, " "::grpc::CompletionQueue* cq, void* tag) {\n"); - printer->Print( - *vars, - " return " - "::grpc::ClientAsyncReaderWriter< $Request$, $Response$>::Create(" - "channel_.get(), cq, " - "rpcmethod_$Method$_, " - "context, tag);\n" - "}\n\n"); + printer->Print(*vars, + " return new " + "::grpc::ClientAsyncReaderWriter< $Request$, $Response$>(" + "channel_.get(), cq, " + "rpcmethod_$Method$_, " + "context, tag);\n" + "}\n\n"); } } @@ -1408,180 +1407,4 @@ grpc::string GetSourceEpilogue(grpc_generator::File *file, return temp; } -// TODO(mmukhi): Make sure we need parameters or not. -grpc::string GetMockPrologue(grpc_generator::File *file, - const Parameters & /*params*/) { - grpc::string output; - { - // Scope the output stream so it closes and finalizes output to the string. - auto printer = file->CreatePrinter(&output); - std::map vars; - - vars["filename"] = file->filename(); - vars["filename_base"] = file->filename_without_ext(); - vars["message_header_ext"] = message_header_ext(); - vars["service_header_ext"] = service_header_ext(); - - printer->Print(vars, "// Generated by the gRPC C++ plugin.\n"); - printer->Print(vars, - "// If you make any local change, they will be lost.\n"); - printer->Print(vars, "// source: $filename$\n\n"); - - printer->Print(vars, "#include \"$filename_base$$message_header_ext$\"\n"); - printer->Print(vars, "#include \"$filename_base$$service_header_ext$\"\n"); - printer->Print(vars, file->additional_headers().c_str()); - printer->Print(vars, "\n"); - } - return output; -} - -// TODO(mmukhi): Add client-stream and completion-queue headers. -grpc::string GetMockIncludes(grpc_generator::File *file, - const Parameters ¶ms) { - grpc::string output; - { - // Scope the output stream so it closes and finalizes output to the string. - auto printer = file->CreatePrinter(&output); - std::map vars; - - static const char *headers_strs[] = { - "grpc++/impl/codegen/async_stream.h", - "grpc++/impl/codegen/sync_stream.h", "gmock/gmock.h", - }; - std::vector headers(headers_strs, array_end(headers_strs)); - PrintIncludes(printer.get(), headers, params); - - if (!file->package().empty()) { - std::vector parts = file->package_parts(); - - for (auto part = parts.begin(); part != parts.end(); part++) { - vars["part"] = *part; - printer->Print(vars, "namespace $part$ {\n"); - } - } - - printer->Print(vars, "\n"); - } - return output; -} - -void PrintMockClientMethods(grpc_generator::Printer *printer, - const grpc_generator::Method *method, - std::map *vars) { - (*vars)["Method"] = method->name(); - (*vars)["Request"] = method->input_type_name(); - (*vars)["Response"] = method->output_type_name(); - - if (method->NoStreaming()) { - printer->Print( - *vars, - "MOCK_METHOD3($Method$, ::grpc::Status(::grpc::ClientContext* context, " - "const $Request$& request, $Response$* response));\n"); - printer->Print(*vars, - "MOCK_METHOD3(Async$Method$Raw, " - "::grpc::ClientAsyncResponseReaderInterface< $Response$>*" - "(::grpc::ClientContext* context, const $Request$& request, " - "::grpc::CompletionQueue* cq));\n"); - } else if (ClientOnlyStreaming(method)) { - printer->Print( - *vars, - "MOCK_METHOD2($Method$Raw, " - "::grpc::ClientWriterInterface< $Request$>*" - "(::grpc::ClientContext* context, $Response$* response));\n"); - printer->Print(*vars, - "MOCK_METHOD4(Async$Method$Raw, " - "::grpc::ClientAsyncWriterInterface< $Request$>*" - "(::grpc::ClientContext* context, $Response$* response, " - "::grpc::CompletionQueue* cq, void* tag));\n"); - } else if (ServerOnlyStreaming(method)) { - printer->Print( - *vars, - "MOCK_METHOD2($Method$Raw, " - "::grpc::ClientReaderInterface< $Response$>*" - "(::grpc::ClientContext* context, const $Request$& request));\n"); - printer->Print(*vars, - "MOCK_METHOD4(Async$Method$Raw, " - "::grpc::ClientAsyncReaderInterface< $Response$>*" - "(::grpc::ClientContext* context, const $Request$& request, " - "::grpc::CompletionQueue* cq, void* tag));\n"); - } else if (method->BidiStreaming()) { - printer->Print( - *vars, - "MOCK_METHOD1($Method$Raw, " - "::grpc::ClientReaderWriterInterface< $Request$, $Response$>*" - "(::grpc::ClientContext* context));\n"); - printer->Print( - *vars, - "MOCK_METHOD3(Async$Method$Raw, " - "::grpc::ClientAsyncReaderWriterInterface<$Request$, $Response$>*" - "(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, " - "void* tag));\n"); - } -} - -void PrintMockService(grpc_generator::Printer *printer, - const grpc_generator::Service *service, - std::map *vars) { - (*vars)["Service"] = service->name(); - - printer->Print(*vars, - "class Mock$Service$Stub : public $Service$::StubInterface {\n" - " public:\n"); - printer->Indent(); - for (int i = 0; i < service->method_count(); ++i) { - PrintMockClientMethods(printer, service->method(i).get(), vars); - } - printer->Outdent(); - printer->Print("};\n"); -} - -grpc::string GetMockServices(grpc_generator::File *file, - const Parameters ¶ms) { - grpc::string output; - { - // Scope the output stream so it closes and finalizes output to the string. - auto printer = file->CreatePrinter(&output); - std::map vars; - // Package string is empty or ends with a dot. It is used to fully qualify - // method names. - vars["Package"] = file->package(); - if (!file->package().empty()) { - vars["Package"].append("."); - } - - if (!params.services_namespace.empty()) { - vars["services_namespace"] = params.services_namespace; - printer->Print(vars, "\nnamespace $services_namespace$ {\n\n"); - } - - for (int i = 0; i < file->service_count(); i++) { - PrintMockService(printer.get(), file->service(i).get(), &vars); - printer->Print("\n"); - } - - if (!params.services_namespace.empty()) { - printer->Print(vars, "} // namespace $services_namespace$\n\n"); - } - } - return output; -} - -grpc::string GetMockEpilogue(grpc_generator::File *file, - const Parameters & /*params*/) { - grpc::string temp; - - if (!file->package().empty()) { - std::vector parts = file->package_parts(); - - for (auto part = parts.begin(); part != parts.end(); part++) { - temp.append("} // namespace "); - temp.append(*part); - temp.append("\n"); - } - temp.append("\n"); - } - - return temp; -} - } // namespace grpc_cpp_generator diff --git a/src/compiler/cpp_generator.h b/src/compiler/cpp_generator.h index 6119ebe2896..69fd8a93e93 100644 --- a/src/compiler/cpp_generator.h +++ b/src/compiler/cpp_generator.h @@ -65,8 +65,6 @@ struct Parameters { bool use_system_headers; // Prefix to any grpc include grpc::string grpc_search_path; - // Generate GMOCK code to facilitate unit testing. - bool generate_mock_code; }; // Return the prologue of the generated header file. @@ -101,38 +99,6 @@ grpc::string GetSourceServices(grpc_generator::File *file, grpc::string GetSourceEpilogue(grpc_generator::File *file, const Parameters ¶ms); -// Return the prologue of the generated mock file. -grpc::string GetMockPrologue(grpc_generator::File *file, - const Parameters ¶ms); - -// Return the includes needed for generated mock file. -grpc::string GetMockIncludes(grpc_generator::File *file, - const Parameters ¶ms); - -// Return the services for generated mock file. -grpc::string GetMockServices(grpc_generator::File *file, - const Parameters ¶ms); - -// Return the epilogue of generated mock file. -grpc::string GetMockEpilogue(grpc_generator::File *file, - const Parameters ¶ms); - -// Return the prologue of the generated mock file. -grpc::string GetMockPrologue(grpc_generator::File *file, - const Parameters ¶ms); - -// Return the includes needed for generated mock file. -grpc::string GetMockIncludes(grpc_generator::File *file, - const Parameters ¶ms); - -// Return the services for generated mock file. -grpc::string GetMockServices(grpc_generator::File *file, - const Parameters ¶ms); - -// Return the epilogue of generated mock file. -grpc::string GetMockEpilogue(grpc_generator::File *file, - const Parameters ¶ms); - } // namespace grpc_cpp_generator #endif // GRPC_INTERNAL_COMPILER_CPP_GENERATOR_H diff --git a/src/compiler/cpp_plugin.cc b/src/compiler/cpp_plugin.cc index 35f1bf3e93c..4ee05ee0370 100644 --- a/src/compiler/cpp_plugin.cc +++ b/src/compiler/cpp_plugin.cc @@ -62,7 +62,6 @@ class CppGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { grpc_cpp_generator::Parameters generator_parameters; generator_parameters.use_system_headers = true; - generator_parameters.generate_mock_code = false; ProtoBufFile pbfile(file); @@ -86,13 +85,6 @@ class CppGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { } } else if (param[0] == "grpc_search_path") { generator_parameters.grpc_search_path = param[1]; - } else if (param[0] == "generate_mock_code") { - if (param[1] == "true") { - generator_parameters.generate_mock_code = true; - } else if (param[1] != "false") { - *error = grpc::string("Invalid parameter: ") + *parameter_string; - return false; - } } else { *error = grpc::string("Unknown parameter: ") + *parameter_string; return false; @@ -122,19 +114,6 @@ class CppGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { grpc::protobuf::io::CodedOutputStream source_coded_out(source_output.get()); source_coded_out.WriteRaw(source_code.data(), source_code.size()); - if (!generator_parameters.generate_mock_code) { - return true; - } - grpc::string mock_code = - grpc_cpp_generator::GetMockPrologue(&pbfile, generator_parameters) + - grpc_cpp_generator::GetMockIncludes(&pbfile, generator_parameters) + - grpc_cpp_generator::GetMockServices(&pbfile, generator_parameters) + - grpc_cpp_generator::GetMockEpilogue(&pbfile, generator_parameters); - std::unique_ptr mock_output( - context->Open(file_name + "_mock.grpc.pb.h")); - grpc::protobuf::io::CodedOutputStream mock_coded_out(mock_output.get()); - mock_coded_out.WriteRaw(mock_code.data(), mock_code.size()); - return true; } diff --git a/src/compiler/objective_c_plugin.cc b/src/compiler/objective_c_plugin.cc index 5178115e44c..8de0997ebea 100644 --- a/src/compiler/objective_c_plugin.cc +++ b/src/compiler/objective_c_plugin.cc @@ -68,7 +68,6 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { ::grpc::string imports = ::grpc::string("#import \"") + file_name + ".pbobjc.h\"\n\n" "#import \n" - "#import \n" "#import \n" "#import \n"; diff --git a/src/compiler/python_generator.cc b/src/compiler/python_generator.cc index 50ee54abffe..2649c1688d4 100644 --- a/src/compiler/python_generator.cc +++ b/src/compiler/python_generator.cc @@ -101,14 +101,6 @@ PrivateGenerator::PrivateGenerator(const GeneratorConfiguration& config, void PrivateGenerator::PrintAllComments(StringVector comments, grpc_generator::Printer* out) { if (comments.empty()) { - // Python requires code structures like class and def to have - // a body, even if it is just "pass" or a docstring. We need - // to ensure not to generate empty bodies. We could do something - // smarter and more sophisticated, but at the moment, if there is - // no docstring to print, we simply emit "pass" to ensure validity - // of the generated code. - out->Print("# missing associated documentation comment in .proto file\n"); - out->Print("pass\n"); return; } out->Print("\"\"\""); diff --git a/src/core/ext/census/context.c b/src/core/ext/census/context.c index 4195cb1c9b3..0dfc4ecbf1d 100644 --- a/src/core/ext/census/context.c +++ b/src/core/ext/census/context.c @@ -200,7 +200,7 @@ static bool tag_set_add_tag(struct tag_set *tags, const census_tag *tag, // allocate new memory if needed tags->kvm_size += 2 * CENSUS_MAX_TAG_KV_LEN + TAG_HEADER_SIZE; char *new_kvm = gpr_malloc(tags->kvm_size); - if (tags->kvm_used > 0) memcpy(new_kvm, tags->kvm, tags->kvm_used); + memcpy(new_kvm, tags->kvm, tags->kvm_used); gpr_free(tags->kvm); tags->kvm = new_kvm; } diff --git a/src/core/ext/census/resource.c b/src/core/ext/census/resource.c index 26ea1a86720..ed44f004f91 100644 --- a/src/core/ext/census/resource.c +++ b/src/core/ext/census/resource.c @@ -223,9 +223,7 @@ size_t allocate_resource(void) { if (n_resources == n_defined_resources) { size_t new_n_resources = n_resources ? n_resources * 2 : 2; resource **new_resources = gpr_malloc(new_n_resources * sizeof(resource *)); - if (n_resources != 0) { - memcpy(new_resources, resources, n_resources * sizeof(resource *)); - } + memcpy(new_resources, resources, n_resources * sizeof(resource *)); memset(new_resources + n_resources, 0, (new_n_resources - n_resources) * sizeof(resource *)); gpr_free(resources); diff --git a/src/core/ext/filters/client_channel/client_channel.c b/src/core/ext/filters/client_channel/client_channel.c index 0463b25412a..83e3b8f118d 100644 --- a/src/core/ext/filters/client_channel/client_channel.c +++ b/src/core/ext/filters/client_channel/client_channel.c @@ -49,9 +49,9 @@ #include "src/core/ext/filters/client_channel/resolver_registry.h" #include "src/core/ext/filters/client_channel/retry_throttle.h" #include "src/core/ext/filters/client_channel/subchannel.h" -#include "src/core/ext/filters/deadline/deadline_filter.h" #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/connected_channel.h" +#include "src/core/lib/channel/deadline_filter.h" #include "src/core/lib/iomgr/combiner.h" #include "src/core/lib/iomgr/iomgr.h" #include "src/core/lib/iomgr/polling_entity.h" @@ -96,10 +96,17 @@ static void method_parameters_unref(method_parameters *method_params) { } } +static void *method_parameters_copy(void *value) { + return method_parameters_ref(value); +} + static void method_parameters_free(grpc_exec_ctx *exec_ctx, void *value) { method_parameters_unref(value); } +static const grpc_slice_hash_table_vtable method_parameters_vtable = { + method_parameters_free, method_parameters_copy}; + static bool parse_wait_for_ready(grpc_json *field, wait_for_ready_value *wait_for_ready) { if (field->type != GRPC_JSON_TRUE && field->type != GRPC_JSON_FALSE) { @@ -176,8 +183,6 @@ typedef struct client_channel_channel_data { grpc_resolver *resolver; /** have we started resolving this channel */ bool started_resolving; - /** is deadline checking enabled? */ - bool deadline_checking_enabled; /** client channel factory */ grpc_client_channel_factory *client_channel_factory; @@ -231,23 +236,14 @@ static void set_channel_connectivity_state_locked(grpc_exec_ctx *exec_ctx, grpc_connectivity_state state, grpc_error *error, const char *reason) { - /* TODO: Improve failure handling: - * - Make it possible for policies to return GRPC_CHANNEL_TRANSIENT_FAILURE. - * - Hand over pending picks from old policies during the switch that happens - * when resolver provides an update. */ - if (chand->lb_policy != NULL) { - if (state == GRPC_CHANNEL_TRANSIENT_FAILURE) { - /* cancel picks with wait_for_ready=false */ - grpc_lb_policy_cancel_picks_locked( - exec_ctx, chand->lb_policy, - /* mask= */ GRPC_INITIAL_METADATA_WAIT_FOR_READY, - /* check= */ 0, GRPC_ERROR_REF(error)); - } else if (state == GRPC_CHANNEL_SHUTDOWN) { - /* cancel all picks */ - grpc_lb_policy_cancel_picks_locked(exec_ctx, chand->lb_policy, - /* mask= */ 0, /* check= */ 0, - GRPC_ERROR_REF(error)); - } + if ((state == GRPC_CHANNEL_TRANSIENT_FAILURE || + state == GRPC_CHANNEL_SHUTDOWN) && + chand->lb_policy != NULL) { + /* cancel picks with wait_for_ready=false */ + grpc_lb_policy_cancel_picks_locked( + exec_ctx, chand->lb_policy, + /* mask= */ GRPC_INITIAL_METADATA_WAIT_FOR_READY, + /* check= */ 0, GRPC_ERROR_REF(error)); } grpc_connectivity_state_set(exec_ctx, &chand->state_tracker, state, error, reason); @@ -350,33 +346,6 @@ static void parse_retry_throttle_params(const grpc_json *field, void *arg) { } } -// Wrap a closure associated with \a lb_policy. The associated callback (\a -// wrapped_on_pick_closure_cb) is responsible for unref'ing \a lb_policy after -// scheduling \a wrapped_closure. -typedef struct wrapped_on_pick_closure_arg { - /* the closure instance using this struct as argument */ - grpc_closure wrapper_closure; - - /* the original closure. Usually a on_complete/notify cb for pick() and ping() - * calls against the internal RR instance, respectively. */ - grpc_closure *wrapped_closure; - - /* The policy instance related to the closure */ - grpc_lb_policy *lb_policy; -} wrapped_on_pick_closure_arg; - -// Invoke \a arg->wrapped_closure, unref \a arg->lb_policy and free \a arg. -static void wrapped_on_pick_closure_cb(grpc_exec_ctx *exec_ctx, void *arg, - grpc_error *error) { - wrapped_on_pick_closure_arg *wc_arg = arg; - GPR_ASSERT(wc_arg != NULL); - GPR_ASSERT(wc_arg->wrapped_closure != NULL); - GPR_ASSERT(wc_arg->lb_policy != NULL); - grpc_closure_run(exec_ctx, wc_arg->wrapped_closure, GRPC_ERROR_REF(error)); - GRPC_LB_POLICY_UNREF(exec_ctx, wc_arg->lb_policy, "pick_subchannel_wrapping"); - gpr_free(wc_arg); -} - static void on_resolver_result_changed_locked(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { channel_data *chand = arg; @@ -400,24 +369,26 @@ static void on_resolver_result_changed_locked(grpc_exec_ctx *exec_ctx, GPR_ASSERT(channel_arg->type == GRPC_ARG_STRING); lb_policy_name = channel_arg->value.string; } - // Special case: If at least one balancer address is present, we use - // the grpclb policy, regardless of what the resolver actually specified. + // Special case: If all of the addresses are balancer addresses, + // assume that we should use the grpclb policy, regardless of what the + // resolver actually specified. channel_arg = grpc_channel_args_find(chand->resolver_result, GRPC_ARG_LB_ADDRESSES); if (channel_arg != NULL && channel_arg->type == GRPC_ARG_POINTER) { grpc_lb_addresses *addresses = channel_arg->value.pointer.p; - bool found_balancer_address = false; + bool found_backend_address = false; for (size_t i = 0; i < addresses->num_addresses; ++i) { - if (addresses->addresses[i].is_balancer) { - found_balancer_address = true; + if (!addresses->addresses[i].is_balancer) { + found_backend_address = true; break; } } - if (found_balancer_address) { + if (!found_backend_address) { if (lb_policy_name != NULL && strcmp(lb_policy_name, "grpclb") != 0) { gpr_log(GPR_INFO, - "resolver requested LB policy %s but provided at least one " - "balancer address -- forcing use of grpclb LB policy", + "resolver requested LB policy %s but provided only balancer " + "addresses, no backend addresses -- forcing use of grpclb LB " + "policy", lb_policy_name); } lb_policy_name = "grpclb"; @@ -463,7 +434,7 @@ static void on_resolver_result_changed_locked(grpc_exec_ctx *exec_ctx, grpc_uri_destroy(uri); method_params_table = grpc_service_config_create_method_config_table( exec_ctx, service_config, method_parameters_create_from_json, - method_parameters_free); + &method_parameters_vtable); grpc_service_config_destroy(service_config); } } @@ -705,8 +676,6 @@ static grpc_error *cc_init_channel_elem(grpc_exec_ctx *exec_ctx, if (chand->resolver == NULL) { return GRPC_ERROR_CREATE_FROM_STATIC_STRING("resolver creation failed"); } - chand->deadline_checking_enabled = - grpc_deadline_checking_enabled(args->channel_args); return GRPC_ERROR_NONE; } @@ -895,14 +864,12 @@ static void apply_final_configuration_locked(grpc_exec_ctx *exec_ctx, /* apply service-config level configuration to the call (now that we're * certain it exists) */ call_data *calld = elem->call_data; - channel_data *chand = elem->channel_data; gpr_timespec per_method_deadline; if (set_call_method_params_from_service_config_locked(exec_ctx, elem, &per_method_deadline)) { // If the deadline from the service config is shorter than the one // from the client API, reset the deadline timer. - if (chand->deadline_checking_enabled && - gpr_time_cmp(per_method_deadline, calld->deadline) < 0) { + if (gpr_time_cmp(per_method_deadline, calld->deadline) < 0) { calld->deadline = per_method_deadline; grpc_deadline_state_reset(exec_ctx, elem, calld->deadline); } @@ -1064,29 +1031,11 @@ static bool pick_subchannel_locked( const grpc_lb_policy_pick_args inputs = { initial_metadata, initial_metadata_flags, &calld->lb_token_mdelem, gpr_inf_future(GPR_CLOCK_MONOTONIC)}; - - // Wrap the user-provided callback in order to hold a strong reference to - // the LB policy for the duration of the pick. - wrapped_on_pick_closure_arg *w_on_pick_arg = - gpr_zalloc(sizeof(*w_on_pick_arg)); - grpc_closure_init(&w_on_pick_arg->wrapper_closure, - wrapped_on_pick_closure_cb, w_on_pick_arg, - grpc_schedule_on_exec_ctx); - w_on_pick_arg->wrapped_closure = on_ready; - GRPC_LB_POLICY_REF(lb_policy, "pick_subchannel_wrapping"); - w_on_pick_arg->lb_policy = lb_policy; - const bool pick_done = grpc_lb_policy_pick_locked( - exec_ctx, lb_policy, &inputs, connected_subchannel, NULL, - &w_on_pick_arg->wrapper_closure); - if (pick_done) { - /* synchronous grpc_lb_policy_pick call. Unref the LB policy. */ - GRPC_LB_POLICY_UNREF(exec_ctx, w_on_pick_arg->lb_policy, - "pick_subchannel_wrapping"); - gpr_free(w_on_pick_arg); - } + const bool result = grpc_lb_policy_pick_locked( + exec_ctx, lb_policy, &inputs, connected_subchannel, NULL, on_ready); GRPC_LB_POLICY_UNREF(exec_ctx, lb_policy, "pick_subchannel"); GPR_TIMER_END("pick_subchannel", 0); - return pick_done; + return result; } if (chand->resolver != NULL && !chand->started_resolving) { chand->started_resolving = true; @@ -1278,10 +1227,8 @@ static void cc_start_transport_stream_op_batch( call_data *calld = elem->call_data; channel_data *chand = elem->channel_data; GRPC_CALL_LOG_OP(GPR_INFO, elem, op); - if (chand->deadline_checking_enabled) { - grpc_deadline_state_client_start_transport_stream_op_batch(exec_ctx, elem, - op); - } + grpc_deadline_state_client_start_transport_stream_op_batch(exec_ctx, elem, + op); /* try to (atomically) get the call */ grpc_subchannel_call *call = GET_CALL(calld); GPR_TIMER_BEGIN("cc_start_transport_stream_op_batch", 0); @@ -1315,16 +1262,14 @@ static grpc_error *cc_init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, const grpc_call_element_args *args) { call_data *calld = elem->call_data; - channel_data *chand = elem->channel_data; // Initialize data members. + grpc_deadline_state_init(exec_ctx, elem, args->call_stack); calld->path = grpc_slice_ref_internal(args->path); calld->call_start_time = args->start_time; calld->deadline = gpr_convert_clock_type(args->deadline, GPR_CLOCK_MONOTONIC); calld->owning_call = args->call_stack; calld->arena = args->arena; - if (chand->deadline_checking_enabled) { - grpc_deadline_state_init(exec_ctx, elem, args->call_stack, calld->deadline); - } + grpc_deadline_state_start(exec_ctx, elem, calld->deadline); return GRPC_ERROR_NONE; } @@ -1334,10 +1279,7 @@ static void cc_destroy_call_elem(grpc_exec_ctx *exec_ctx, const grpc_call_final_info *final_info, grpc_closure *then_schedule_closure) { call_data *calld = elem->call_data; - channel_data *chand = elem->channel_data; - if (chand->deadline_checking_enabled) { - grpc_deadline_state_destroy(exec_ctx, elem); - } + grpc_deadline_state_destroy(exec_ctx, elem); grpc_slice_unref_internal(exec_ctx, calld->path); if (calld->method_params != NULL) { method_parameters_unref(calld->method_params); diff --git a/src/core/ext/filters/client_channel/client_channel_plugin.c b/src/core/ext/filters/client_channel/client_channel_plugin.c index 0e3eae6615a..a68c01c2227 100644 --- a/src/core/ext/filters/client_channel/client_channel_plugin.c +++ b/src/core/ext/filters/client_channel/client_channel_plugin.c @@ -91,9 +91,8 @@ void grpc_client_channel_init(void) { grpc_subchannel_index_init(); grpc_channel_init_register_stage(GRPC_CLIENT_CHANNEL, INT_MIN, set_default_host_if_unset, NULL); - grpc_channel_init_register_stage( - GRPC_CLIENT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, append_filter, - (void *)&grpc_client_channel_filter); + grpc_channel_init_register_stage(GRPC_CLIENT_CHANNEL, INT_MAX, append_filter, + (void *)&grpc_client_channel_filter); grpc_http_connect_register_handshaker_factory(); } diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.c b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.c index ad5f0685ec3..ff8d3193098 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.c +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.c @@ -750,11 +750,18 @@ static void destroy_balancer_name(grpc_exec_ctx *exec_ctx, gpr_free(balancer_name); } +static void *copy_balancer_name(void *balancer_name) { + return gpr_strdup(balancer_name); +} + static grpc_slice_hash_table_entry targets_info_entry_create( const char *address, const char *balancer_name) { + static const grpc_slice_hash_table_vtable vtable = {destroy_balancer_name, + copy_balancer_name}; grpc_slice_hash_table_entry entry; entry.key = grpc_slice_from_copied_string(address); - entry.value = gpr_strdup(balancer_name); + entry.value = (void *)balancer_name; + entry.vtable = &vtable; return entry; } @@ -818,8 +825,11 @@ static char *get_lb_uri_target_addresses(grpc_exec_ctx *exec_ctx, uri_path); gpr_free(uri_path); - *targets_info = grpc_slice_hash_table_create( - num_grpclb_addrs, targets_info_entries, destroy_balancer_name); + *targets_info = + grpc_slice_hash_table_create(num_grpclb_addrs, targets_info_entries); + for (size_t i = 0; i < num_grpclb_addrs; i++) { + grpc_slice_unref_internal(exec_ctx, targets_info_entries[i].key); + } gpr_free(targets_info_entries); return target_uri_str; @@ -831,10 +841,10 @@ static grpc_lb_policy *glb_create(grpc_exec_ctx *exec_ctx, /* Count the number of gRPC-LB addresses. There must be at least one. * TODO(roth): For now, we ignore non-balancer addresses, but in the * future, we may change the behavior such that we fall back to using - * the non-balancer addresses if we cannot reach any balancers. In the - * fallback case, we should use the LB policy indicated by - * GRPC_ARG_LB_POLICY_NAME (although if that specifies grpclb or is - * unset, we should default to pick_first). */ + * the non-balancer addresses if we cannot reach any balancers. At that + * time, this should be changed to allow a list with no balancer addresses, + * since the resolver might fail to return a balancer address even when + * this is the right LB policy to use. */ const grpc_arg *arg = grpc_channel_args_find(args->args, GRPC_ARG_LB_ADDRESSES); if (arg == NULL || arg->type != GRPC_ARG_POINTER) { @@ -1112,7 +1122,6 @@ static void lb_call_init_locked(grpc_exec_ctx *exec_ctx, glb_policy->base.interested_parties, GRPC_MDSTR_SLASH_GRPC_DOT_LB_DOT_V1_DOT_LOADBALANCER_SLASH_BALANCELOAD, &host, glb_policy->deadline, NULL); - grpc_slice_unref_internal(exec_ctx, host); grpc_metadata_array_init(&glb_policy->lb_initial_metadata_recv); grpc_metadata_array_init(&glb_policy->lb_trailing_metadata_recv); @@ -1143,7 +1152,7 @@ static void lb_call_init_locked(grpc_exec_ctx *exec_ctx, static void lb_call_destroy_locked(grpc_exec_ctx *exec_ctx, glb_lb_policy *glb_policy) { GPR_ASSERT(glb_policy->lb_call != NULL); - grpc_call_unref(glb_policy->lb_call); + grpc_call_destroy(glb_policy->lb_call); glb_policy->lb_call = NULL; grpc_metadata_array_destroy(&glb_policy->lb_initial_metadata_recv); @@ -1284,7 +1293,6 @@ static void lb_on_response_received_locked(grpc_exec_ctx *exec_ctx, void *arg, "Received empty server list. Picks will stay pending until a " "response with > 0 servers is received"); } - grpc_grpclb_destroy_serverlist(glb_policy->serverlist); } } else { /* serverlist == NULL */ gpr_log(GPR_ERROR, "Invalid LB response received: '%s'. Ignoring.", diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c b/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c index fb119c7fc88..e9adf98711e 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c @@ -16,12 +16,6 @@ const pb_field_t grpc_lb_v1_Duration_fields[3] = { PB_LAST_FIELD }; -const pb_field_t grpc_lb_v1_Timestamp_fields[3] = { - PB_FIELD( 1, INT64 , OPTIONAL, STATIC , FIRST, grpc_lb_v1_Timestamp, seconds, seconds, 0), - PB_FIELD( 2, INT32 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_Timestamp, nanos, seconds, 0), - PB_LAST_FIELD -}; - const pb_field_t grpc_lb_v1_LoadBalanceRequest_fields[3] = { PB_FIELD( 1, MESSAGE , OPTIONAL, STATIC , FIRST, grpc_lb_v1_LoadBalanceRequest, initial_request, initial_request, &grpc_lb_v1_InitialLoadBalanceRequest_fields), PB_FIELD( 2, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v1_LoadBalanceRequest, client_stats, initial_request, &grpc_lb_v1_ClientStats_fields), @@ -33,14 +27,10 @@ const pb_field_t grpc_lb_v1_InitialLoadBalanceRequest_fields[2] = { PB_LAST_FIELD }; -const pb_field_t grpc_lb_v1_ClientStats_fields[8] = { - PB_FIELD( 1, MESSAGE , OPTIONAL, STATIC , FIRST, grpc_lb_v1_ClientStats, timestamp, timestamp, &grpc_lb_v1_Timestamp_fields), - PB_FIELD( 2, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_ClientStats, num_calls_started, timestamp, 0), - PB_FIELD( 3, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_ClientStats, num_calls_finished, num_calls_started, 0), - PB_FIELD( 4, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_ClientStats, num_calls_finished_with_drop_for_rate_limiting, num_calls_finished, 0), - PB_FIELD( 5, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_ClientStats, num_calls_finished_with_drop_for_load_balancing, num_calls_finished_with_drop_for_rate_limiting, 0), - PB_FIELD( 6, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_ClientStats, num_calls_finished_with_client_failed_to_send, num_calls_finished_with_drop_for_load_balancing, 0), - PB_FIELD( 7, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_ClientStats, num_calls_finished_known_received, num_calls_finished_with_client_failed_to_send, 0), +const pb_field_t grpc_lb_v1_ClientStats_fields[4] = { + PB_FIELD( 1, INT64 , OPTIONAL, STATIC , FIRST, grpc_lb_v1_ClientStats, total_requests, total_requests, 0), + PB_FIELD( 2, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_ClientStats, client_rpc_errors, total_requests, 0), + PB_FIELD( 3, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_ClientStats, dropped_requests, client_rpc_errors, 0), PB_LAST_FIELD }; @@ -62,12 +52,11 @@ const pb_field_t grpc_lb_v1_ServerList_fields[3] = { PB_LAST_FIELD }; -const pb_field_t grpc_lb_v1_Server_fields[6] = { +const pb_field_t grpc_lb_v1_Server_fields[5] = { PB_FIELD( 1, BYTES , OPTIONAL, STATIC , FIRST, grpc_lb_v1_Server, ip_address, ip_address, 0), PB_FIELD( 2, INT32 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_Server, port, ip_address, 0), PB_FIELD( 3, STRING , OPTIONAL, STATIC , OTHER, grpc_lb_v1_Server, load_balance_token, port, 0), - PB_FIELD( 4, BOOL , OPTIONAL, STATIC , OTHER, grpc_lb_v1_Server, drop_for_rate_limiting, load_balance_token, 0), - PB_FIELD( 5, BOOL , OPTIONAL, STATIC , OTHER, grpc_lb_v1_Server, drop_for_load_balancing, drop_for_rate_limiting, 0), + PB_FIELD( 4, BOOL , OPTIONAL, STATIC , OTHER, grpc_lb_v1_Server, drop_request, load_balance_token, 0), PB_LAST_FIELD }; @@ -81,7 +70,7 @@ const pb_field_t grpc_lb_v1_Server_fields[6] = { * numbers or field sizes that are larger than what can fit in 8 or 16 bit * field descriptors. */ -PB_STATIC_ASSERT((pb_membersize(grpc_lb_v1_LoadBalanceRequest, initial_request) < 65536 && pb_membersize(grpc_lb_v1_LoadBalanceRequest, client_stats) < 65536 && pb_membersize(grpc_lb_v1_ClientStats, timestamp) < 65536 && pb_membersize(grpc_lb_v1_LoadBalanceResponse, initial_response) < 65536 && pb_membersize(grpc_lb_v1_LoadBalanceResponse, server_list) < 65536 && pb_membersize(grpc_lb_v1_InitialLoadBalanceResponse, client_stats_report_interval) < 65536 && pb_membersize(grpc_lb_v1_ServerList, servers) < 65536 && pb_membersize(grpc_lb_v1_ServerList, expiration_interval) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_grpc_lb_v1_Duration_grpc_lb_v1_Timestamp_grpc_lb_v1_LoadBalanceRequest_grpc_lb_v1_InitialLoadBalanceRequest_grpc_lb_v1_ClientStats_grpc_lb_v1_LoadBalanceResponse_grpc_lb_v1_InitialLoadBalanceResponse_grpc_lb_v1_ServerList_grpc_lb_v1_Server) +PB_STATIC_ASSERT((pb_membersize(grpc_lb_v1_LoadBalanceRequest, initial_request) < 65536 && pb_membersize(grpc_lb_v1_LoadBalanceRequest, client_stats) < 65536 && pb_membersize(grpc_lb_v1_LoadBalanceResponse, initial_response) < 65536 && pb_membersize(grpc_lb_v1_LoadBalanceResponse, server_list) < 65536 && pb_membersize(grpc_lb_v1_InitialLoadBalanceResponse, client_stats_report_interval) < 65536 && pb_membersize(grpc_lb_v1_ServerList, servers) < 65536 && pb_membersize(grpc_lb_v1_ServerList, expiration_interval) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_grpc_lb_v1_Duration_grpc_lb_v1_LoadBalanceRequest_grpc_lb_v1_InitialLoadBalanceRequest_grpc_lb_v1_ClientStats_grpc_lb_v1_LoadBalanceResponse_grpc_lb_v1_InitialLoadBalanceResponse_grpc_lb_v1_ServerList_grpc_lb_v1_Server) #endif #if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) @@ -92,7 +81,7 @@ PB_STATIC_ASSERT((pb_membersize(grpc_lb_v1_LoadBalanceRequest, initial_request) * numbers or field sizes that are larger than what can fit in the default * 8 bit descriptors. */ -PB_STATIC_ASSERT((pb_membersize(grpc_lb_v1_LoadBalanceRequest, initial_request) < 256 && pb_membersize(grpc_lb_v1_LoadBalanceRequest, client_stats) < 256 && pb_membersize(grpc_lb_v1_ClientStats, timestamp) < 256 && pb_membersize(grpc_lb_v1_LoadBalanceResponse, initial_response) < 256 && pb_membersize(grpc_lb_v1_LoadBalanceResponse, server_list) < 256 && pb_membersize(grpc_lb_v1_InitialLoadBalanceResponse, client_stats_report_interval) < 256 && pb_membersize(grpc_lb_v1_ServerList, servers) < 256 && pb_membersize(grpc_lb_v1_ServerList, expiration_interval) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_grpc_lb_v1_Duration_grpc_lb_v1_Timestamp_grpc_lb_v1_LoadBalanceRequest_grpc_lb_v1_InitialLoadBalanceRequest_grpc_lb_v1_ClientStats_grpc_lb_v1_LoadBalanceResponse_grpc_lb_v1_InitialLoadBalanceResponse_grpc_lb_v1_ServerList_grpc_lb_v1_Server) +PB_STATIC_ASSERT((pb_membersize(grpc_lb_v1_LoadBalanceRequest, initial_request) < 256 && pb_membersize(grpc_lb_v1_LoadBalanceRequest, client_stats) < 256 && pb_membersize(grpc_lb_v1_LoadBalanceResponse, initial_response) < 256 && pb_membersize(grpc_lb_v1_LoadBalanceResponse, server_list) < 256 && pb_membersize(grpc_lb_v1_InitialLoadBalanceResponse, client_stats_report_interval) < 256 && pb_membersize(grpc_lb_v1_ServerList, servers) < 256 && pb_membersize(grpc_lb_v1_ServerList, expiration_interval) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_grpc_lb_v1_Duration_grpc_lb_v1_LoadBalanceRequest_grpc_lb_v1_InitialLoadBalanceRequest_grpc_lb_v1_ClientStats_grpc_lb_v1_LoadBalanceResponse_grpc_lb_v1_InitialLoadBalanceResponse_grpc_lb_v1_ServerList_grpc_lb_v1_Server) #endif diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h index d3ae919ec27..725aa7e386f 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h @@ -14,6 +14,16 @@ extern "C" { #endif /* Struct definitions */ +typedef struct _grpc_lb_v1_ClientStats { + bool has_total_requests; + int64_t total_requests; + bool has_client_rpc_errors; + int64_t client_rpc_errors; + bool has_dropped_requests; + int64_t dropped_requests; +/* @@protoc_insertion_point(struct:grpc_lb_v1_ClientStats) */ +} grpc_lb_v1_ClientStats; + typedef struct _grpc_lb_v1_Duration { bool has_seconds; int64_t seconds; @@ -36,39 +46,11 @@ typedef struct _grpc_lb_v1_Server { int32_t port; bool has_load_balance_token; char load_balance_token[50]; - bool has_drop_for_rate_limiting; - bool drop_for_rate_limiting; - bool has_drop_for_load_balancing; - bool drop_for_load_balancing; + bool has_drop_request; + bool drop_request; /* @@protoc_insertion_point(struct:grpc_lb_v1_Server) */ } grpc_lb_v1_Server; -typedef struct _grpc_lb_v1_Timestamp { - bool has_seconds; - int64_t seconds; - bool has_nanos; - int32_t nanos; -/* @@protoc_insertion_point(struct:grpc_lb_v1_Timestamp) */ -} grpc_lb_v1_Timestamp; - -typedef struct _grpc_lb_v1_ClientStats { - bool has_timestamp; - grpc_lb_v1_Timestamp timestamp; - bool has_num_calls_started; - int64_t num_calls_started; - bool has_num_calls_finished; - int64_t num_calls_finished; - bool has_num_calls_finished_with_drop_for_rate_limiting; - int64_t num_calls_finished_with_drop_for_rate_limiting; - bool has_num_calls_finished_with_drop_for_load_balancing; - int64_t num_calls_finished_with_drop_for_load_balancing; - bool has_num_calls_finished_with_client_failed_to_send; - int64_t num_calls_finished_with_client_failed_to_send; - bool has_num_calls_finished_known_received; - int64_t num_calls_finished_known_received; -/* @@protoc_insertion_point(struct:grpc_lb_v1_ClientStats) */ -} grpc_lb_v1_ClientStats; - typedef struct _grpc_lb_v1_InitialLoadBalanceResponse { bool has_load_balancer_delegate; char load_balancer_delegate[64]; @@ -77,13 +59,6 @@ typedef struct _grpc_lb_v1_InitialLoadBalanceResponse { /* @@protoc_insertion_point(struct:grpc_lb_v1_InitialLoadBalanceResponse) */ } grpc_lb_v1_InitialLoadBalanceResponse; -typedef struct _grpc_lb_v1_ServerList { - pb_callback_t servers; - bool has_expiration_interval; - grpc_lb_v1_Duration expiration_interval; -/* @@protoc_insertion_point(struct:grpc_lb_v1_ServerList) */ -} grpc_lb_v1_ServerList; - typedef struct _grpc_lb_v1_LoadBalanceRequest { bool has_initial_request; grpc_lb_v1_InitialLoadBalanceRequest initial_request; @@ -92,6 +67,13 @@ typedef struct _grpc_lb_v1_LoadBalanceRequest { /* @@protoc_insertion_point(struct:grpc_lb_v1_LoadBalanceRequest) */ } grpc_lb_v1_LoadBalanceRequest; +typedef struct _grpc_lb_v1_ServerList { + pb_callback_t servers; + bool has_expiration_interval; + grpc_lb_v1_Duration expiration_interval; +/* @@protoc_insertion_point(struct:grpc_lb_v1_ServerList) */ +} grpc_lb_v1_ServerList; + typedef struct _grpc_lb_v1_LoadBalanceResponse { bool has_initial_response; grpc_lb_v1_InitialLoadBalanceResponse initial_response; @@ -104,72 +86,61 @@ typedef struct _grpc_lb_v1_LoadBalanceResponse { /* Initializer values for message structs */ #define grpc_lb_v1_Duration_init_default {false, 0, false, 0} -#define grpc_lb_v1_Timestamp_init_default {false, 0, false, 0} #define grpc_lb_v1_LoadBalanceRequest_init_default {false, grpc_lb_v1_InitialLoadBalanceRequest_init_default, false, grpc_lb_v1_ClientStats_init_default} #define grpc_lb_v1_InitialLoadBalanceRequest_init_default {false, ""} -#define grpc_lb_v1_ClientStats_init_default {false, grpc_lb_v1_Timestamp_init_default, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} +#define grpc_lb_v1_ClientStats_init_default {false, 0, false, 0, false, 0} #define grpc_lb_v1_LoadBalanceResponse_init_default {false, grpc_lb_v1_InitialLoadBalanceResponse_init_default, false, grpc_lb_v1_ServerList_init_default} #define grpc_lb_v1_InitialLoadBalanceResponse_init_default {false, "", false, grpc_lb_v1_Duration_init_default} #define grpc_lb_v1_ServerList_init_default {{{NULL}, NULL}, false, grpc_lb_v1_Duration_init_default} -#define grpc_lb_v1_Server_init_default {false, {0, {0}}, false, 0, false, "", false, 0, false, 0} +#define grpc_lb_v1_Server_init_default {false, {0, {0}}, false, 0, false, "", false, 0} #define grpc_lb_v1_Duration_init_zero {false, 0, false, 0} -#define grpc_lb_v1_Timestamp_init_zero {false, 0, false, 0} #define grpc_lb_v1_LoadBalanceRequest_init_zero {false, grpc_lb_v1_InitialLoadBalanceRequest_init_zero, false, grpc_lb_v1_ClientStats_init_zero} #define grpc_lb_v1_InitialLoadBalanceRequest_init_zero {false, ""} -#define grpc_lb_v1_ClientStats_init_zero {false, grpc_lb_v1_Timestamp_init_zero, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} +#define grpc_lb_v1_ClientStats_init_zero {false, 0, false, 0, false, 0} #define grpc_lb_v1_LoadBalanceResponse_init_zero {false, grpc_lb_v1_InitialLoadBalanceResponse_init_zero, false, grpc_lb_v1_ServerList_init_zero} #define grpc_lb_v1_InitialLoadBalanceResponse_init_zero {false, "", false, grpc_lb_v1_Duration_init_zero} #define grpc_lb_v1_ServerList_init_zero {{{NULL}, NULL}, false, grpc_lb_v1_Duration_init_zero} -#define grpc_lb_v1_Server_init_zero {false, {0, {0}}, false, 0, false, "", false, 0, false, 0} +#define grpc_lb_v1_Server_init_zero {false, {0, {0}}, false, 0, false, "", false, 0} /* Field tags (for use in manual encoding/decoding) */ +#define grpc_lb_v1_ClientStats_total_requests_tag 1 +#define grpc_lb_v1_ClientStats_client_rpc_errors_tag 2 +#define grpc_lb_v1_ClientStats_dropped_requests_tag 3 #define grpc_lb_v1_Duration_seconds_tag 1 #define grpc_lb_v1_Duration_nanos_tag 2 #define grpc_lb_v1_InitialLoadBalanceRequest_name_tag 1 #define grpc_lb_v1_Server_ip_address_tag 1 #define grpc_lb_v1_Server_port_tag 2 #define grpc_lb_v1_Server_load_balance_token_tag 3 -#define grpc_lb_v1_Server_drop_for_rate_limiting_tag 4 -#define grpc_lb_v1_Server_drop_for_load_balancing_tag 5 -#define grpc_lb_v1_Timestamp_seconds_tag 1 -#define grpc_lb_v1_Timestamp_nanos_tag 2 -#define grpc_lb_v1_ClientStats_timestamp_tag 1 -#define grpc_lb_v1_ClientStats_num_calls_started_tag 2 -#define grpc_lb_v1_ClientStats_num_calls_finished_tag 3 -#define grpc_lb_v1_ClientStats_num_calls_finished_with_drop_for_rate_limiting_tag 4 -#define grpc_lb_v1_ClientStats_num_calls_finished_with_drop_for_load_balancing_tag 5 -#define grpc_lb_v1_ClientStats_num_calls_finished_with_client_failed_to_send_tag 6 -#define grpc_lb_v1_ClientStats_num_calls_finished_known_received_tag 7 +#define grpc_lb_v1_Server_drop_request_tag 4 #define grpc_lb_v1_InitialLoadBalanceResponse_load_balancer_delegate_tag 1 #define grpc_lb_v1_InitialLoadBalanceResponse_client_stats_report_interval_tag 2 -#define grpc_lb_v1_ServerList_servers_tag 1 -#define grpc_lb_v1_ServerList_expiration_interval_tag 3 #define grpc_lb_v1_LoadBalanceRequest_initial_request_tag 1 #define grpc_lb_v1_LoadBalanceRequest_client_stats_tag 2 +#define grpc_lb_v1_ServerList_servers_tag 1 +#define grpc_lb_v1_ServerList_expiration_interval_tag 3 #define grpc_lb_v1_LoadBalanceResponse_initial_response_tag 1 #define grpc_lb_v1_LoadBalanceResponse_server_list_tag 2 /* Struct field encoding specification for nanopb */ extern const pb_field_t grpc_lb_v1_Duration_fields[3]; -extern const pb_field_t grpc_lb_v1_Timestamp_fields[3]; extern const pb_field_t grpc_lb_v1_LoadBalanceRequest_fields[3]; extern const pb_field_t grpc_lb_v1_InitialLoadBalanceRequest_fields[2]; -extern const pb_field_t grpc_lb_v1_ClientStats_fields[8]; +extern const pb_field_t grpc_lb_v1_ClientStats_fields[4]; extern const pb_field_t grpc_lb_v1_LoadBalanceResponse_fields[3]; extern const pb_field_t grpc_lb_v1_InitialLoadBalanceResponse_fields[3]; extern const pb_field_t grpc_lb_v1_ServerList_fields[3]; -extern const pb_field_t grpc_lb_v1_Server_fields[6]; +extern const pb_field_t grpc_lb_v1_Server_fields[5]; /* Maximum encoded size of messages (where known) */ #define grpc_lb_v1_Duration_size 22 -#define grpc_lb_v1_Timestamp_size 22 -#define grpc_lb_v1_LoadBalanceRequest_size 226 +#define grpc_lb_v1_LoadBalanceRequest_size 169 #define grpc_lb_v1_InitialLoadBalanceRequest_size 131 -#define grpc_lb_v1_ClientStats_size 90 +#define grpc_lb_v1_ClientStats_size 33 #define grpc_lb_v1_LoadBalanceResponse_size (98 + grpc_lb_v1_ServerList_size) #define grpc_lb_v1_InitialLoadBalanceResponse_size 90 /* grpc_lb_v1_ServerList_size depends on runtime parameters */ -#define grpc_lb_v1_Server_size 85 +#define grpc_lb_v1_Server_size 83 /* Message IDs (where set with "msgid" option) */ #ifdef PB_MSGID diff --git a/src/core/ext/filters/client_channel/lb_policy_factory.c b/src/core/ext/filters/client_channel/lb_policy_factory.c index 89b8bf89515..e2af216b899 100644 --- a/src/core/ext/filters/client_channel/lb_policy_factory.c +++ b/src/core/ext/filters/client_channel/lb_policy_factory.c @@ -36,18 +36,16 @@ #include #include -#include "src/core/lib/channel/channel_args.h" - #include "src/core/ext/filters/client_channel/lb_policy_factory.h" -#include "src/core/ext/filters/client_channel/parse_address.h" grpc_lb_addresses* grpc_lb_addresses_create( size_t num_addresses, const grpc_lb_user_data_vtable* user_data_vtable) { - grpc_lb_addresses* addresses = gpr_zalloc(sizeof(grpc_lb_addresses)); + grpc_lb_addresses* addresses = gpr_malloc(sizeof(grpc_lb_addresses)); addresses->num_addresses = num_addresses; addresses->user_data_vtable = user_data_vtable; const size_t addresses_size = sizeof(grpc_lb_address) * num_addresses; - addresses->addresses = gpr_zalloc(addresses_size); + addresses->addresses = gpr_malloc(addresses_size); + memset(addresses->addresses, 0, addresses_size); return addresses; } @@ -71,7 +69,7 @@ grpc_lb_addresses* grpc_lb_addresses_copy(const grpc_lb_addresses* addresses) { void grpc_lb_addresses_set_address(grpc_lb_addresses* addresses, size_t index, void* address, size_t address_len, - bool is_balancer, const char* balancer_name, + bool is_balancer, char* balancer_name, void* user_data) { GPR_ASSERT(index < addresses->num_addresses); if (user_data != NULL) GPR_ASSERT(addresses->user_data_vtable != NULL); @@ -79,22 +77,10 @@ void grpc_lb_addresses_set_address(grpc_lb_addresses* addresses, size_t index, memcpy(target->address.addr, address, address_len); target->address.len = address_len; target->is_balancer = is_balancer; - target->balancer_name = gpr_strdup(balancer_name); + target->balancer_name = balancer_name; target->user_data = user_data; } -bool grpc_lb_addresses_set_address_from_uri(grpc_lb_addresses* addresses, - size_t index, const grpc_uri* uri, - bool is_balancer, - const char* balancer_name, - void* user_data) { - grpc_resolved_address address; - if (!grpc_parse_uri(uri, &address)) return false; - grpc_lb_addresses_set_address(addresses, index, address.addr, address.len, - is_balancer, balancer_name, user_data); - return true; -} - int grpc_lb_addresses_cmp(const grpc_lb_addresses* addresses1, const grpc_lb_addresses* addresses2) { if (addresses1->num_addresses > addresses2->num_addresses) return 1; @@ -161,15 +147,6 @@ grpc_arg grpc_lb_addresses_create_channel_arg( return arg; } -grpc_lb_addresses* grpc_lb_addresses_find_channel_arg( - const grpc_channel_args* channel_args) { - const grpc_arg* lb_addresses_arg = - grpc_channel_args_find(channel_args, GRPC_ARG_LB_ADDRESSES); - if (lb_addresses_arg == NULL || lb_addresses_arg->type != GRPC_ARG_POINTER) - return NULL; - return lb_addresses_arg->value.pointer.p; -} - void grpc_lb_policy_factory_ref(grpc_lb_policy_factory* factory) { factory->vtable->ref(factory); } diff --git a/src/core/ext/filters/client_channel/lb_policy_factory.h b/src/core/ext/filters/client_channel/lb_policy_factory.h index 9d6c0fc1398..81ab12ec8f9 100644 --- a/src/core/ext/filters/client_channel/lb_policy_factory.h +++ b/src/core/ext/filters/client_channel/lb_policy_factory.h @@ -34,12 +34,11 @@ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_FACTORY_H #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_FACTORY_H -#include "src/core/lib/iomgr/exec_ctx.h" -#include "src/core/lib/iomgr/resolve_address.h" - #include "src/core/ext/filters/client_channel/client_channel_factory.h" #include "src/core/ext/filters/client_channel/lb_policy.h" -#include "src/core/ext/filters/client_channel/uri_parser.h" + +#include "src/core/lib/iomgr/exec_ctx.h" +#include "src/core/lib/iomgr/resolve_address.h" // Channel arg key for grpc_lb_addresses. #define GRPC_ARG_LB_ADDRESSES "grpc.lb_addresses" @@ -89,18 +88,9 @@ grpc_lb_addresses *grpc_lb_addresses_copy(const grpc_lb_addresses *addresses); * Takes ownership of \a balancer_name. */ void grpc_lb_addresses_set_address(grpc_lb_addresses *addresses, size_t index, void *address, size_t address_len, - bool is_balancer, const char *balancer_name, + bool is_balancer, char *balancer_name, void *user_data); -/** Sets the value of the address at index \a index of \a addresses from \a uri. - * Returns true upon success, false otherwise. Takes ownership of \a - * balancer_name. */ -bool grpc_lb_addresses_set_address_from_uri(grpc_lb_addresses *addresses, - size_t index, const grpc_uri *uri, - bool is_balancer, - const char *balancer_name, - void *user_data); - /** Compares \a addresses1 and \a addresses2. */ int grpc_lb_addresses_cmp(const grpc_lb_addresses *addresses1, const grpc_lb_addresses *addresses2); @@ -113,10 +103,6 @@ void grpc_lb_addresses_destroy(grpc_exec_ctx *exec_ctx, grpc_arg grpc_lb_addresses_create_channel_arg( const grpc_lb_addresses *addresses); -/** Returns the \a grpc_lb_addresses instance in \a channel_args or NULL */ -grpc_lb_addresses *grpc_lb_addresses_find_channel_arg( - const grpc_channel_args *channel_args); - /** Arguments passed to LB policies. */ typedef struct grpc_lb_policy_args { grpc_client_channel_factory *client_channel_factory; diff --git a/src/core/ext/filters/client_channel/parse_address.c b/src/core/ext/filters/client_channel/parse_address.c index edc6ce697d8..0c970620756 100644 --- a/src/core/ext/filters/client_channel/parse_address.c +++ b/src/core/ext/filters/client_channel/parse_address.c @@ -48,12 +48,7 @@ #ifdef GRPC_HAVE_UNIX_SOCKET -bool grpc_parse_unix(const grpc_uri *uri, - grpc_resolved_address *resolved_addr) { - if (strcmp("unix", uri->scheme) != 0) { - gpr_log(GPR_ERROR, "Expected 'unix' scheme, got '%s'", uri->scheme); - return false; - } +int parse_unix(grpc_uri *uri, grpc_resolved_address *resolved_addr) { struct sockaddr_un *un = (struct sockaddr_un *)resolved_addr->addr; const size_t maxlen = sizeof(un->sun_path); const size_t path_len = strnlen(uri->path, maxlen); @@ -66,29 +61,21 @@ bool grpc_parse_unix(const grpc_uri *uri, #else /* GRPC_HAVE_UNIX_SOCKET */ -bool grpc_parse_unix(const grpc_uri *uri, - grpc_resolved_address *resolved_addr) { - abort(); -} +int parse_unix(grpc_uri *uri, grpc_resolved_address *resolved_addr) { abort(); } #endif /* GRPC_HAVE_UNIX_SOCKET */ -bool grpc_parse_ipv4(const grpc_uri *uri, - grpc_resolved_address *resolved_addr) { - if (strcmp("ipv4", uri->scheme) != 0) { - gpr_log(GPR_ERROR, "Expected 'ipv4' scheme, got '%s'", uri->scheme); - return false; - } +int parse_ipv4(grpc_uri *uri, grpc_resolved_address *resolved_addr) { const char *host_port = uri->path; char *host; char *port; int port_num; - bool result = false; + int result = 0; struct sockaddr_in *in = (struct sockaddr_in *)resolved_addr->addr; if (*host_port == '/') ++host_port; if (!gpr_split_host_port(host_port, &host, &port)) { - return false; + return 0; } memset(resolved_addr, 0, sizeof(grpc_resolved_address)); @@ -111,19 +98,14 @@ bool grpc_parse_ipv4(const grpc_uri *uri, goto done; } - result = true; + result = 1; done: gpr_free(host); gpr_free(port); return result; } -bool grpc_parse_ipv6(const grpc_uri *uri, - grpc_resolved_address *resolved_addr) { - if (strcmp("ipv6", uri->scheme) != 0) { - gpr_log(GPR_ERROR, "Expected 'ipv6' scheme, got '%s'", uri->scheme); - return false; - } +int parse_ipv6(grpc_uri *uri, grpc_resolved_address *resolved_addr) { const char *host_port = uri->path; char *host; char *port; @@ -186,15 +168,3 @@ done: gpr_free(port); return result; } - -bool grpc_parse_uri(const grpc_uri *uri, grpc_resolved_address *resolved_addr) { - if (strcmp("unix", uri->scheme) == 0) { - return grpc_parse_unix(uri, resolved_addr); - } else if (strcmp("ipv4", uri->scheme) == 0) { - return grpc_parse_ipv4(uri, resolved_addr); - } else if (strcmp("ipv6", uri->scheme) == 0) { - return grpc_parse_ipv6(uri, resolved_addr); - } - gpr_log(GPR_ERROR, "Can't parse scheme '%s'", uri->scheme); - return false; -} diff --git a/src/core/ext/filters/client_channel/parse_address.h b/src/core/ext/filters/client_channel/parse_address.h index fa7ea33a00b..c8d77baa008 100644 --- a/src/core/ext/filters/client_channel/parse_address.h +++ b/src/core/ext/filters/client_channel/parse_address.h @@ -39,19 +39,16 @@ #include "src/core/ext/filters/client_channel/uri_parser.h" #include "src/core/lib/iomgr/resolve_address.h" -/** Populate \a resolved_addr from \a uri, whose path is expected to contain a +/** Populate \a addr and \a len from \a uri, whose path is expected to contain a * unix socket path. Returns true upon success. */ -bool grpc_parse_unix(const grpc_uri *uri, grpc_resolved_address *resolved_addr); +int parse_unix(grpc_uri *uri, grpc_resolved_address *resolved_addr); -/** Populate \a resolved_addr from \a uri, whose path is expected to contain an - * IPv4 host:port pair. Returns true upon success. */ -bool grpc_parse_ipv4(const grpc_uri *uri, grpc_resolved_address *resolved_addr); +/** Populate /a addr and \a len from \a uri, whose path is expected to contain a + * host:port pair. Returns true upon success. */ +int parse_ipv4(grpc_uri *uri, grpc_resolved_address *resolved_addr); -/** Populate \a resolved_addr from \a uri, whose path is expected to contain an - * IPv6 host:port pair. Returns true upon success. */ -bool grpc_parse_ipv6(const grpc_uri *uri, grpc_resolved_address *resolved_addr); - -/** Populate \a resolved_addr from \a uri. Returns true upon success. */ -bool grpc_parse_uri(const grpc_uri *uri, grpc_resolved_address *resolved_addr); +/** Populate /a addr and \a len from \a uri, whose path is expected to contain a + * host:port pair. Returns true upon success. */ +int parse_ipv6(grpc_uri *uri, grpc_resolved_address *resolved_addr); #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PARSE_ADDRESS_H */ diff --git a/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.c b/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.c index 4d7d878c237..54f020d6914 100644 --- a/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.c +++ b/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.c @@ -157,8 +157,8 @@ static void do_nothing(void *ignored) {} static grpc_resolver *sockaddr_create(grpc_exec_ctx *exec_ctx, grpc_resolver_args *args, - bool parse(const grpc_uri *uri, - grpc_resolved_address *dst)) { + int parse(grpc_uri *uri, + grpc_resolved_address *dst)) { if (0 != strcmp(args->uri->authority, "")) { gpr_log(GPR_ERROR, "authority based uri's not supported by the %s scheme", args->uri->scheme); @@ -209,7 +209,7 @@ static void sockaddr_factory_unref(grpc_resolver_factory *factory) {} static grpc_resolver *name##_factory_create_resolver( \ grpc_exec_ctx *exec_ctx, grpc_resolver_factory *factory, \ grpc_resolver_args *args) { \ - return sockaddr_create(exec_ctx, args, grpc_parse_##name); \ + return sockaddr_create(exec_ctx, args, parse_##name); \ } \ static const grpc_resolver_factory_vtable name##_factory_vtable = { \ sockaddr_factory_ref, sockaddr_factory_unref, \ diff --git a/src/core/ext/filters/client_channel/subchannel.c b/src/core/ext/filters/client_channel/subchannel.c index 967e571221c..9a7a7a0ee5f 100644 --- a/src/core/ext/filters/client_channel/subchannel.c +++ b/src/core/ext/filters/client_channel/subchannel.c @@ -59,9 +59,9 @@ #define INTERNAL_REF_BITS 16 #define STRONG_REF_MASK (~(gpr_atm)((1 << INTERNAL_REF_BITS) - 1)) +#define GRPC_SUBCHANNEL_MIN_CONNECT_TIMEOUT_SECONDS 20 #define GRPC_SUBCHANNEL_INITIAL_CONNECT_BACKOFF_SECONDS 1 #define GRPC_SUBCHANNEL_RECONNECT_BACKOFF_MULTIPLIER 1.6 -#define GRPC_SUBCHANNEL_RECONNECT_MIN_BACKOFF_SECONDS 20 #define GRPC_SUBCHANNEL_RECONNECT_MAX_BACKOFF_SECONDS 120 #define GRPC_SUBCHANNEL_RECONNECT_JITTER 0.2 @@ -353,8 +353,8 @@ grpc_subchannel *grpc_subchannel_create(grpc_exec_ctx *exec_ctx, "subchannel"); int initial_backoff_ms = GRPC_SUBCHANNEL_INITIAL_CONNECT_BACKOFF_SECONDS * 1000; - int min_backoff_ms = GRPC_SUBCHANNEL_RECONNECT_MIN_BACKOFF_SECONDS * 1000; int max_backoff_ms = GRPC_SUBCHANNEL_RECONNECT_MAX_BACKOFF_SECONDS * 1000; + int min_backoff_ms = GRPC_SUBCHANNEL_MIN_CONNECT_TIMEOUT_SECONDS * 1000; bool fixed_reconnect_backoff = false; if (c->args) { for (size_t i = 0; i < c->args->num_args; i++) { @@ -365,12 +365,6 @@ grpc_subchannel *grpc_subchannel_create(grpc_exec_ctx *exec_ctx, grpc_channel_arg_get_integer( &c->args->args[i], (grpc_integer_options){initial_backoff_ms, 100, INT_MAX}); - } else if (0 == strcmp(c->args->args[i].key, - GRPC_ARG_MIN_RECONNECT_BACKOFF_MS)) { - fixed_reconnect_backoff = false; - min_backoff_ms = grpc_channel_arg_get_integer( - &c->args->args[i], - (grpc_integer_options){min_backoff_ms, 100, INT_MAX}); } else if (0 == strcmp(c->args->args[i].key, GRPC_ARG_MAX_RECONNECT_BACKOFF_MS)) { fixed_reconnect_backoff = false; @@ -803,7 +797,13 @@ static void grpc_uri_to_sockaddr(grpc_exec_ctx *exec_ctx, const char *uri_str, grpc_resolved_address *addr) { grpc_uri *uri = grpc_uri_parse(exec_ctx, uri_str, 0 /* suppress_errors */); GPR_ASSERT(uri != NULL); - if (!grpc_parse_uri(uri, addr)) memset(addr, 0, sizeof(*addr)); + if (strcmp(uri->scheme, "ipv4") == 0) { + GPR_ASSERT(parse_ipv4(uri, addr)); + } else if (strcmp(uri->scheme, "ipv6") == 0) { + GPR_ASSERT(parse_ipv6(uri, addr)); + } else { + GPR_ASSERT(parse_unix(uri, addr)); + } grpc_uri_destroy(uri); } diff --git a/src/core/ext/filters/client_channel/uri_parser.c b/src/core/ext/filters/client_channel/uri_parser.c index b233d835cbc..01b99911aa4 100644 --- a/src/core/ext/filters/client_channel/uri_parser.c +++ b/src/core/ext/filters/client_channel/uri_parser.c @@ -50,7 +50,7 @@ #define NOT_SET (~(size_t)0) static grpc_uri *bad_uri(const char *uri_text, size_t pos, const char *section, - bool suppress_errors) { + int suppress_errors) { char *line_prefix; size_t pfx_len; @@ -83,11 +83,6 @@ static char *decode_and_copy_component(grpc_exec_ctx *exec_ctx, const char *src, return out; } -static bool valid_hex(char c) { - return ((c >= 'a') && (c <= 'f')) || ((c >= 'A') && (c <= 'F')) || - ((c >= '0') && (c <= '9')); -} - /** Returns how many chars to advance if \a uri_text[i] begins a valid \a pchar * production. If \a uri_text[i] introduces an invalid \a pchar (such as percent * sign not followed by two hex digits), NOT_SET is returned. */ @@ -98,36 +93,27 @@ static size_t parse_pchar(const char *uri_text, size_t i) { * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "=" */ char c = uri_text[i]; - switch (c) { - default: - if (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')) || - ((c >= '0') && (c <= '9'))) { - return 1; - } - break; - case ':': - case '@': - case '-': - case '.': - case '_': - case '~': - case '!': - case '$': - case '&': - case '\'': - case '(': - case ')': - case '*': - case '+': - case ',': - case ';': - case '=': - return 1; - case '%': /* pct-encoded */ - if (valid_hex(uri_text[i + 1]) && valid_hex(uri_text[i + 2])) { - return 2; - } + if (((c >= 'A') && (c <= 'Z')) || ((c >= 'a') && (c <= 'z')) || + ((c >= '0') && (c <= '9')) || + (c == '-' || c == '.' || c == '_' || c == '~') || /* unreserved */ + (c == '!' || c == '$' || c == '&' || c == '\'' || c == '$' || c == '&' || + c == '(' || c == ')' || c == '*' || c == '+' || c == ',' || c == ';' || + c == '=') /* sub-delims */) { + return 1; + } + if (c == '%') { /* pct-encoded */ + size_t j; + if (uri_text[i + 1] == 0 || uri_text[i + 2] == 0) { return NOT_SET; + } + for (j = i + 1; j < 2; j++) { + c = uri_text[j]; + if (!(((c >= '0') && (c <= '9')) || ((c >= 'a') && (c <= 'f')) || + ((c >= 'A') && (c <= 'F')))) { + return NOT_SET; + } + } + return 2; } return 0; } @@ -197,7 +183,7 @@ static void parse_query_parts(grpc_uri *uri) { } grpc_uri *grpc_uri_parse(grpc_exec_ctx *exec_ctx, const char *uri_text, - bool suppress_errors) { + int suppress_errors) { grpc_uri *uri; size_t scheme_begin = 0; size_t scheme_end = NOT_SET; diff --git a/src/core/ext/filters/client_channel/uri_parser.h b/src/core/ext/filters/client_channel/uri_parser.h index b889040b167..2698d448d8e 100644 --- a/src/core/ext/filters/client_channel/uri_parser.h +++ b/src/core/ext/filters/client_channel/uri_parser.h @@ -53,7 +53,7 @@ typedef struct { /** parse a uri, return NULL on failure */ grpc_uri *grpc_uri_parse(grpc_exec_ctx *exec_ctx, const char *uri_text, - bool suppress_errors); + int suppress_errors); /** return the part of a query string after the '=' in "?key=xxx&...", or NULL * if key is not present */ diff --git a/src/core/ext/filters/http/http_filters_plugin.c b/src/core/ext/filters/http/http_filters_plugin.c deleted file mode 100644 index 195a1a8119b..00000000000 --- a/src/core/ext/filters/http/http_filters_plugin.c +++ /dev/null @@ -1,103 +0,0 @@ -/* - * - * Copyright 2017, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include - -#include "src/core/ext/filters/http/client/http_client_filter.h" -#include "src/core/ext/filters/http/message_compress/message_compress_filter.h" -#include "src/core/ext/filters/http/server/http_server_filter.h" -#include "src/core/lib/channel/channel_stack_builder.h" -#include "src/core/lib/surface/channel_init.h" -#include "src/core/lib/transport/transport_impl.h" - -typedef struct { - const grpc_channel_filter *filter; - const char *control_channel_arg; -} optional_filter; - -static optional_filter compress_filter = { - &grpc_message_compress_filter, GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION}; - -static bool is_building_http_like_transport( - grpc_channel_stack_builder *builder) { - grpc_transport *t = grpc_channel_stack_builder_get_transport(builder); - return t != NULL && strstr(t->vtable->name, "http"); -} - -static bool maybe_add_optional_filter(grpc_exec_ctx *exec_ctx, - grpc_channel_stack_builder *builder, - void *arg) { - if (!is_building_http_like_transport(builder)) return true; - optional_filter *filtarg = arg; - const grpc_channel_args *channel_args = - grpc_channel_stack_builder_get_channel_arguments(builder); - bool enable = grpc_channel_arg_get_bool( - grpc_channel_args_find(channel_args, filtarg->control_channel_arg), - !grpc_channel_args_want_minimal_stack(channel_args)); - return enable ? grpc_channel_stack_builder_prepend_filter( - builder, filtarg->filter, NULL, NULL) - : true; -} - -static bool maybe_add_required_filter(grpc_exec_ctx *exec_ctx, - grpc_channel_stack_builder *builder, - void *arg) { - return is_building_http_like_transport(builder) - ? grpc_channel_stack_builder_prepend_filter( - builder, (const grpc_channel_filter *)arg, NULL, NULL) - : true; -} - -void grpc_http_filters_init(void) { - grpc_register_tracer("compression", &grpc_compression_trace); - grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL, - GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, - maybe_add_optional_filter, &compress_filter); - grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL, - GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, - maybe_add_optional_filter, &compress_filter); - grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL, - GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, - maybe_add_optional_filter, &compress_filter); - grpc_channel_init_register_stage( - GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, - maybe_add_required_filter, (void *)&grpc_http_client_filter); - grpc_channel_init_register_stage( - GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, - maybe_add_required_filter, (void *)&grpc_http_client_filter); - grpc_channel_init_register_stage( - GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, - maybe_add_required_filter, (void *)&grpc_http_server_filter); -} - -void grpc_http_filters_shutdown(void) {} diff --git a/src/core/ext/filters/load_reporting/load_reporting.c b/src/core/ext/filters/load_reporting/load_reporting.c index 4e9d0937ae0..f4dac15a604 100644 --- a/src/core/ext/filters/load_reporting/load_reporting.c +++ b/src/core/ext/filters/load_reporting/load_reporting.c @@ -47,9 +47,32 @@ #include "src/core/lib/surface/call.h" #include "src/core/lib/surface/channel_init.h" +static void destroy_lr_cost_context(void *c) { + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + grpc_load_reporting_cost_context *cost_ctx = c; + for (size_t i = 0; i < cost_ctx->values_count; ++i) { + grpc_slice_unref_internal(&exec_ctx, cost_ctx->values[i]); + } + grpc_exec_ctx_finish(&exec_ctx); + gpr_free(cost_ctx->values); + gpr_free(cost_ctx); +} + +void grpc_call_set_load_reporting_cost_context( + grpc_call *call, grpc_load_reporting_cost_context *ctx) { + grpc_call_context_set(call, GRPC_CONTEXT_LR_COST, ctx, + destroy_lr_cost_context); +} + static bool is_load_reporting_enabled(const grpc_channel_args *a) { - return grpc_channel_arg_get_bool( - grpc_channel_args_find(a, GRPC_ARG_ENABLE_LOAD_REPORTING), false); + if (a == NULL) return false; + for (size_t i = 0; i < a->num_args; i++) { + if (0 == strcmp(a->args[i].key, GRPC_ARG_ENABLE_LOAD_REPORTING)) { + return a->args[i].type == GRPC_ARG_INTEGER && + a->args[i].value.integer != 0; + } + } + return false; } static bool maybe_add_load_reporting_filter(grpc_exec_ctx *exec_ctx, diff --git a/src/core/ext/filters/load_reporting/load_reporting_filter.c b/src/core/ext/filters/load_reporting/load_reporting_filter.c index 75a9a566871..57b25d06518 100644 --- a/src/core/ext/filters/load_reporting/load_reporting_filter.c +++ b/src/core/ext/filters/load_reporting/load_reporting_filter.c @@ -48,8 +48,6 @@ typedef struct call_data { intptr_t id; /**< an id unique to the call */ - bool have_trailing_md_string; - grpc_slice trailing_md_string; bool have_initial_md_string; grpc_slice initial_md_string; bool have_service_method; @@ -142,9 +140,6 @@ static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, if (calld->have_initial_md_string) { grpc_slice_unref_internal(exec_ctx, calld->initial_md_string); } - if (calld->have_trailing_md_string) { - grpc_slice_unref_internal(exec_ctx, calld->trailing_md_string); - } if (calld->have_service_method) { grpc_slice_unref_internal(exec_ctx, calld->service_method); } @@ -188,18 +183,6 @@ static void destroy_channel_elem(grpc_exec_ctx *exec_ctx, */ } -static grpc_filtered_mdelem lr_trailing_md_filter(grpc_exec_ctx *exec_ctx, - void *user_data, - grpc_mdelem md) { - grpc_call_element *elem = user_data; - call_data *calld = elem->call_data; - if (grpc_slice_eq(GRPC_MDKEY(md), GRPC_MDSTR_LB_COST_BIN)) { - calld->trailing_md_string = GRPC_MDVALUE(md); - return GRPC_FILTERED_REMOVE(); - } - return GRPC_FILTERED_MDELEM(md); -} - static void lr_start_transport_stream_op_batch( grpc_exec_ctx *exec_ctx, grpc_call_element *elem, grpc_transport_stream_op_batch *op) { @@ -207,21 +190,13 @@ static void lr_start_transport_stream_op_batch( call_data *calld = elem->call_data; if (op->recv_initial_metadata) { - /* substitute our callback for the higher callback */ calld->recv_initial_metadata = op->payload->recv_initial_metadata.recv_initial_metadata; + /* substitute our callback for the higher callback */ calld->ops_recv_initial_metadata_ready = op->payload->recv_initial_metadata.recv_initial_metadata_ready; op->payload->recv_initial_metadata.recv_initial_metadata_ready = &calld->on_initial_md_ready; - } else if (op->send_trailing_metadata) { - GRPC_LOG_IF_ERROR( - "grpc_metadata_batch_filter", - grpc_metadata_batch_filter( - exec_ctx, - op->payload->send_trailing_metadata.send_trailing_metadata, - lr_trailing_md_filter, elem, - "LR trailing metadata filtering error")); } grpc_call_next_op(exec_ctx, elem, op); diff --git a/src/core/ext/filters/max_age/max_age_filter.c b/src/core/ext/filters/max_age/max_age_filter.c index a9d91e2f80c..b9fde362860 100644 --- a/src/core/ext/filters/max_age/max_age_filter.c +++ b/src/core/ext/filters/max_age/max_age_filter.c @@ -47,11 +47,6 @@ #define DEFAULT_MAX_CONNECTION_IDLE_MS INT_MAX #define MAX_CONNECTION_AGE_JITTER 0.1 -#define MAX_CONNECTION_AGE_INTEGER_OPTIONS \ - (grpc_integer_options) { DEFAULT_MAX_CONNECTION_AGE_MS, 1, INT_MAX } -#define MAX_CONNECTION_IDLE_INTEGER_OPTIONS \ - (grpc_integer_options) { DEFAULT_MAX_CONNECTION_IDLE_MS, 1, INT_MAX } - typedef struct channel_data { /* We take a reference to the channel stack for the timer callback */ grpc_channel_stack* channel_stack; @@ -320,7 +315,8 @@ static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx, if (0 == strcmp(args->channel_args->args[i].key, GRPC_ARG_MAX_CONNECTION_AGE_MS)) { const int value = grpc_channel_arg_get_integer( - &args->channel_args->args[i], MAX_CONNECTION_AGE_INTEGER_OPTIONS); + &args->channel_args->args[i], + (grpc_integer_options){DEFAULT_MAX_CONNECTION_AGE_MS, 1, INT_MAX}); chand->max_connection_age = value == INT_MAX ? gpr_inf_future(GPR_TIMESPAN) @@ -338,7 +334,8 @@ static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx, } else if (0 == strcmp(args->channel_args->args[i].key, GRPC_ARG_MAX_CONNECTION_IDLE_MS)) { const int value = grpc_channel_arg_get_integer( - &args->channel_args->args[i], MAX_CONNECTION_IDLE_INTEGER_OPTIONS); + &args->channel_args->args[i], + (grpc_integer_options){DEFAULT_MAX_CONNECTION_IDLE_MS, 1, INT_MAX}); chand->max_connection_idle = value == INT_MAX ? gpr_inf_future(GPR_TIMESPAN) : gpr_time_from_millis(value, GPR_TIMESPAN); @@ -415,13 +412,16 @@ static bool maybe_add_max_age_filter(grpc_exec_ctx* exec_ctx, void* arg) { const grpc_channel_args* channel_args = grpc_channel_stack_builder_get_channel_arguments(builder); - bool enable = - grpc_channel_arg_get_integer( - grpc_channel_args_find(channel_args, GRPC_ARG_MAX_CONNECTION_AGE_MS), - MAX_CONNECTION_AGE_INTEGER_OPTIONS) != INT_MAX && - grpc_channel_arg_get_integer( - grpc_channel_args_find(channel_args, GRPC_ARG_MAX_CONNECTION_IDLE_MS), - MAX_CONNECTION_IDLE_INTEGER_OPTIONS) != INT_MAX; + const grpc_arg* a = + grpc_channel_args_find(channel_args, GRPC_ARG_MAX_CONNECTION_AGE_MS); + bool enable = false; + if (a != NULL && a->type == GRPC_ARG_INTEGER && a->value.integer != INT_MAX) { + enable = true; + } + a = grpc_channel_args_find(channel_args, GRPC_ARG_MAX_CONNECTION_IDLE_MS); + if (a != NULL && a->type == GRPC_ARG_INTEGER && a->value.integer != INT_MAX) { + enable = true; + } if (enable) { return grpc_channel_stack_builder_prepend_filter( builder, &grpc_max_age_filter, NULL, NULL); diff --git a/src/core/ext/transport/chttp2/server/chttp2_server.c b/src/core/ext/transport/chttp2/server/chttp2_server.c index b9c62c376a1..6433968ca59 100644 --- a/src/core/ext/transport/chttp2/server/chttp2_server.c +++ b/src/core/ext/transport/chttp2/server/chttp2_server.c @@ -43,11 +43,11 @@ #include #include -#include "src/core/ext/filters/http/server/http_server_filter.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/handshaker.h" #include "src/core/lib/channel/handshaker_registry.h" +#include "src/core/lib/channel/http_server_filter.h" #include "src/core/lib/iomgr/endpoint.h" #include "src/core/lib/iomgr/resolve_address.h" #include "src/core/lib/iomgr/tcp_server.h" @@ -80,7 +80,7 @@ static void on_handshake_done(grpc_exec_ctx *exec_ctx, void *arg, gpr_mu_lock(&connection_state->server_state->mu); if (error != GRPC_ERROR_NONE || connection_state->server_state->shutdown) { const char *error_str = grpc_error_string(error); - gpr_log(GPR_DEBUG, "Handshaking failed: %s", error_str); + gpr_log(GPR_ERROR, "Handshaking failed: %s", error_str); if (error == GRPC_ERROR_NONE && args->endpoint != NULL) { // We were shut down after handshaking completed successfully, so diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c index 5d74532edeb..a7d047d6e7a 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c @@ -44,7 +44,6 @@ #include #include -#include "src/core/ext/transport/chttp2/transport/frame_data.h" #include "src/core/ext/transport/chttp2/transport/internal.h" #include "src/core/ext/transport/chttp2/transport/varint.h" #include "src/core/lib/channel/channel_args.h" @@ -130,11 +129,6 @@ static void incoming_byte_stream_update_flow_control(grpc_exec_ctx *exec_ctx, static void incoming_byte_stream_destroy_locked(grpc_exec_ctx *exec_ctx, void *byte_stream, grpc_error *error_ignored); -static void incoming_byte_stream_publish_error( - grpc_exec_ctx *exec_ctx, grpc_chttp2_incoming_byte_stream *bs, - grpc_error *error); -static void incoming_byte_stream_unref(grpc_exec_ctx *exec_ctx, - grpc_chttp2_incoming_byte_stream *bs); static void benign_reclaimer_locked(grpc_exec_ctx *exec_ctx, void *t, grpc_error *error); @@ -180,9 +174,6 @@ static void finish_keepalive_ping_locked(grpc_exec_ctx *exec_ctx, void *arg, static void keepalive_watchdog_fired_locked(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error); -static void reset_byte_stream(grpc_exec_ctx *exec_ctx, void *arg, - grpc_error *error); - /******************************************************************************* * CONSTRUCTION/DESTRUCTION/REFCOUNTING */ @@ -559,10 +550,6 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, exec_ctx, &t->keepalive_ping_timer, gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), t->keepalive_time), &t->init_keepalive_ping_locked, gpr_now(GPR_CLOCK_MONOTONIC)); - } else { - /* Use GRPC_CHTTP2_KEEPALIVE_STATE_DISABLED to indicate there are no - inflight keeaplive timers */ - t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_DISABLED; } grpc_chttp2_initiate_write(exec_ctx, t, false, "init"); @@ -611,18 +598,21 @@ static void close_transport_locked(grpc_exec_ctx *exec_ctx, connectivity_state_set(exec_ctx, t, GRPC_CHANNEL_SHUTDOWN, GRPC_ERROR_REF(error), "close_transport"); grpc_endpoint_shutdown(exec_ctx, t->ep, GRPC_ERROR_REF(error)); - switch (t->keepalive_state) { - case GRPC_CHTTP2_KEEPALIVE_STATE_WAITING: - grpc_timer_cancel(exec_ctx, &t->keepalive_ping_timer); - break; - case GRPC_CHTTP2_KEEPALIVE_STATE_PINGING: - grpc_timer_cancel(exec_ctx, &t->keepalive_ping_timer); - grpc_timer_cancel(exec_ctx, &t->keepalive_watchdog_timer); - break; - case GRPC_CHTTP2_KEEPALIVE_STATE_DYING: - case GRPC_CHTTP2_KEEPALIVE_STATE_DISABLED: - /* keepalive timers are not set in these two states */ - break; + if (t->is_client) { + switch (t->keepalive_state) { + case GRPC_CHTTP2_KEEPALIVE_STATE_WAITING: { + grpc_timer_cancel(exec_ctx, &t->keepalive_ping_timer); + break; + } + case GRPC_CHTTP2_KEEPALIVE_STATE_PINGING: { + grpc_timer_cancel(exec_ctx, &t->keepalive_ping_timer); + grpc_timer_cancel(exec_ctx, &t->keepalive_watchdog_timer); + break; + } + case GRPC_CHTTP2_KEEPALIVE_STATE_DYING: { + break; + } + } } /* flush writable stream list to avoid dangling references */ @@ -665,6 +655,7 @@ static int init_stream(grpc_exec_ctx *exec_ctx, grpc_transport *gt, /* We reserve one 'active stream' that's dropped when the stream is read-closed. The others are for incoming_byte_streams that are actively reading */ + gpr_ref_init(&s->active_streams, 1); GRPC_CHTTP2_STREAM_REF(s, "chttp2"); grpc_chttp2_incoming_metadata_buffer_init(&s->metadata_buffer[0], arena); @@ -674,11 +665,6 @@ static int init_stream(grpc_exec_ctx *exec_ctx, grpc_transport *gt, s->deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC); grpc_closure_init(&s->complete_fetch_locked, complete_fetch_locked, s, grpc_schedule_on_exec_ctx); - grpc_slice_buffer_init(&s->unprocessed_incoming_frames_buffer); - grpc_slice_buffer_init(&s->frame_storage); - s->pending_byte_stream = false; - grpc_closure_init(&s->reset_byte_stream, reset_byte_stream, s, - grpc_combiner_scheduler(t->combiner, false)); GRPC_CHTTP2_REF_TRANSPORT(t, "stream"); @@ -696,6 +682,7 @@ static int init_stream(grpc_exec_ctx *exec_ctx, grpc_transport *gt, static void destroy_stream_locked(grpc_exec_ctx *exec_ctx, void *sp, grpc_error *error) { + grpc_byte_stream *bs; grpc_chttp2_stream *s = sp; grpc_chttp2_transport *t = s->t; @@ -706,9 +693,9 @@ static void destroy_stream_locked(grpc_exec_ctx *exec_ctx, void *sp, GPR_ASSERT(grpc_chttp2_stream_map_find(&t->stream_map, s->id) == NULL); } - grpc_slice_buffer_destroy_internal(exec_ctx, - &s->unprocessed_incoming_frames_buffer); - grpc_slice_buffer_destroy_internal(exec_ctx, &s->frame_storage); + while ((bs = grpc_chttp2_incoming_frame_queue_pop(&s->incoming_frames))) { + incoming_byte_stream_destroy_locked(exec_ctx, bs, GRPC_ERROR_NONE); + } grpc_chttp2_list_remove_stalled_by_transport(t, s); grpc_chttp2_list_remove_stalled_by_stream(t, s); @@ -735,7 +722,6 @@ static void destroy_stream_locked(grpc_exec_ctx *exec_ctx, void *sp, grpc_slice_buffer_destroy_internal(exec_ctx, &s->flow_controlled_buffer); GRPC_ERROR_UNREF(s->read_closed_error); GRPC_ERROR_UNREF(s->write_closed_error); - GRPC_ERROR_UNREF(s->byte_stream_error); if (s->incoming_window_delta > 0) { GRPC_CHTTP2_FLOW_DEBIT_STREAM_INCOMING_WINDOW_DELTA( @@ -1189,9 +1175,8 @@ static void continue_fetching_send_locked(grpc_exec_ctx *exec_ctx, s->fetching_send_message = NULL; return; /* early out */ } else if (grpc_byte_stream_next(exec_ctx, s->fetching_send_message, - UINT32_MAX, &s->complete_fetch_locked)) { - grpc_byte_stream_pull(exec_ctx, s->fetching_send_message, - &s->fetching_slice); + &s->fetching_slice, UINT32_MAX, + &s->complete_fetch_locked)) { add_fetched_slice_locked(exec_ctx, t, s); } } @@ -1202,15 +1187,9 @@ static void complete_fetch_locked(grpc_exec_ctx *exec_ctx, void *gs, grpc_chttp2_stream *s = gs; grpc_chttp2_transport *t = s->t; if (error == GRPC_ERROR_NONE) { - error = grpc_byte_stream_pull(exec_ctx, s->fetching_send_message, - &s->fetching_slice); - if (error == GRPC_ERROR_NONE) { - add_fetched_slice_locked(exec_ctx, t, s); - continue_fetching_send_locked(exec_ctx, t, s); - } - } - - if (error != GRPC_ERROR_NONE) { + add_fetched_slice_locked(exec_ctx, t, s); + continue_fetching_send_locked(exec_ctx, t, s); + } else { /* TODO(ctiller): what to do here */ abort(); } @@ -1442,20 +1421,12 @@ static void perform_stream_op_locked(grpc_exec_ctx *exec_ctx, void *stream_op, } if (op->recv_message) { - size_t already_received; GPR_ASSERT(s->recv_message_ready == NULL); - GPR_ASSERT(!s->pending_byte_stream); s->recv_message_ready = op_payload->recv_message.recv_message_ready; s->recv_message = op_payload->recv_message.recv_message; - if (s->id != 0) { - if (s->pending_byte_stream) { - already_received = s->frame_storage.length; - } else { - already_received = s->frame_storage.length + - s->unprocessed_incoming_frames_buffer.length; - } - incoming_byte_stream_update_flow_control(exec_ctx, t, s, 5, - already_received); + if (s->id != 0 && + (s->incoming_frames.head == NULL || s->incoming_frames.head->is_tail)) { + incoming_byte_stream_update_flow_control(exec_ctx, t, s, 5, 0); } grpc_chttp2_maybe_complete_recv_message(exec_ctx, t, s); } @@ -1643,13 +1614,13 @@ static void perform_transport_op(grpc_exec_ctx *exec_ctx, grpc_transport *gt, void grpc_chttp2_maybe_complete_recv_initial_metadata(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, grpc_chttp2_stream *s) { + grpc_byte_stream *bs; if (s->recv_initial_metadata_ready != NULL && s->published_metadata[0] != GRPC_METADATA_NOT_PUBLISHED) { if (s->seen_error) { - grpc_slice_buffer_reset_and_unref_internal(exec_ctx, &s->frame_storage); - if (!s->pending_byte_stream) { - grpc_slice_buffer_reset_and_unref_internal( - exec_ctx, &s->unprocessed_incoming_frames_buffer); + while ((bs = grpc_chttp2_incoming_frame_queue_pop(&s->incoming_frames)) != + NULL) { + incoming_byte_stream_destroy_locked(exec_ctx, bs, GRPC_ERROR_NONE); } } grpc_chttp2_incoming_metadata_buffer_publish( @@ -1662,65 +1633,39 @@ void grpc_chttp2_maybe_complete_recv_initial_metadata(grpc_exec_ctx *exec_ctx, void grpc_chttp2_maybe_complete_recv_message(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, grpc_chttp2_stream *s) { - grpc_error *error = GRPC_ERROR_NONE; + grpc_byte_stream *bs; if (s->recv_message_ready != NULL) { - *s->recv_message = NULL; - if (s->final_metadata_requested && s->seen_error) { - grpc_slice_buffer_reset_and_unref_internal(exec_ctx, &s->frame_storage); - if (!s->pending_byte_stream) { - grpc_slice_buffer_reset_and_unref_internal( - exec_ctx, &s->unprocessed_incoming_frames_buffer); - } - } - if (!s->pending_byte_stream) { - while (s->unprocessed_incoming_frames_buffer.length > 0 || - s->frame_storage.length > 0) { - if (s->unprocessed_incoming_frames_buffer.length == 0) { - grpc_slice_buffer_swap(&s->unprocessed_incoming_frames_buffer, - &s->frame_storage); - } - error = grpc_deframe_unprocessed_incoming_frames( - exec_ctx, &s->data_parser, s, - &s->unprocessed_incoming_frames_buffer, NULL, s->recv_message); - if (error != GRPC_ERROR_NONE) { - s->seen_error = true; - grpc_slice_buffer_reset_and_unref_internal(exec_ctx, - &s->frame_storage); - grpc_slice_buffer_reset_and_unref_internal( - exec_ctx, &s->unprocessed_incoming_frames_buffer); - break; - } else if (*s->recv_message != NULL) { - break; - } - } + while (s->final_metadata_requested && s->seen_error && + (bs = grpc_chttp2_incoming_frame_queue_pop(&s->incoming_frames)) != + NULL) { + incoming_byte_stream_destroy_locked(exec_ctx, bs, GRPC_ERROR_NONE); } - if (error == GRPC_ERROR_NONE && *s->recv_message != NULL) { + if (s->incoming_frames.head != NULL) { + *s->recv_message = + grpc_chttp2_incoming_frame_queue_pop(&s->incoming_frames); + GPR_ASSERT(*s->recv_message != NULL); null_then_run_closure(exec_ctx, &s->recv_message_ready, GRPC_ERROR_NONE); } else if (s->published_metadata[1] != GRPC_METADATA_NOT_PUBLISHED) { *s->recv_message = NULL; null_then_run_closure(exec_ctx, &s->recv_message_ready, GRPC_ERROR_NONE); } - GRPC_ERROR_UNREF(error); } } void grpc_chttp2_maybe_complete_recv_trailing_metadata(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, grpc_chttp2_stream *s) { + grpc_byte_stream *bs; grpc_chttp2_maybe_complete_recv_message(exec_ctx, t, s); if (s->recv_trailing_metadata_finished != NULL && s->read_closed && s->write_closed) { if (s->seen_error) { - grpc_slice_buffer_reset_and_unref_internal(exec_ctx, &s->frame_storage); - if (!s->pending_byte_stream) { - grpc_slice_buffer_reset_and_unref_internal( - exec_ctx, &s->unprocessed_incoming_frames_buffer); + while ((bs = grpc_chttp2_incoming_frame_queue_pop(&s->incoming_frames)) != + NULL) { + incoming_byte_stream_destroy_locked(exec_ctx, bs, GRPC_ERROR_NONE); } } - bool pending_data = s->pending_byte_stream || - s->unprocessed_incoming_frames_buffer.length > 0; - if (s->read_closed && s->frame_storage.length == 0 && - (!pending_data || s->seen_error) && + if (s->all_incoming_byte_streams_finished && s->recv_trailing_metadata_finished != NULL) { grpc_chttp2_incoming_metadata_buffer_publish( exec_ctx, &s->metadata_buffer[1], s->recv_trailing_metadata); @@ -1731,6 +1676,14 @@ void grpc_chttp2_maybe_complete_recv_trailing_metadata(grpc_exec_ctx *exec_ctx, } } +static void decrement_active_streams_locked(grpc_exec_ctx *exec_ctx, + grpc_chttp2_transport *t, + grpc_chttp2_stream *s) { + if ((s->all_incoming_byte_streams_finished = gpr_unref(&s->active_streams))) { + grpc_chttp2_maybe_complete_recv_trailing_metadata(exec_ctx, t, s); + } +} + static void remove_stream(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, uint32_t id, grpc_error *error) { grpc_chttp2_stream *s = grpc_chttp2_stream_map_delete(&t->stream_map, id); @@ -1739,19 +1692,10 @@ static void remove_stream(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, t->incoming_stream = NULL; grpc_chttp2_parsing_become_skip_parser(exec_ctx, t); } - if (s->pending_byte_stream) { - if (s->on_next != NULL) { - grpc_chttp2_incoming_byte_stream *bs = s->data_parser.parsing_frame; - if (error == GRPC_ERROR_NONE) { - error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Truncated message"); - } - incoming_byte_stream_publish_error(exec_ctx, bs, error); - incoming_byte_stream_unref(exec_ctx, bs); - s->data_parser.parsing_frame = NULL; - } else { - GRPC_ERROR_UNREF(s->byte_stream_error); - s->byte_stream_error = GRPC_ERROR_REF(error); - } + if (s->data_parser.parsing_frame != NULL) { + grpc_chttp2_incoming_byte_stream_finished( + exec_ctx, s->data_parser.parsing_frame, GRPC_ERROR_REF(error)); + s->data_parser.parsing_frame = NULL; } if (grpc_chttp2_stream_map_size(&t->stream_map) == 0) { @@ -1937,6 +1881,7 @@ void grpc_chttp2_mark_stream_closed(grpc_exec_ctx *exec_ctx, s->published_metadata[i] = GPRC_METADATA_PUBLISHED_AT_CLOSE; } } + decrement_active_streams_locked(exec_ctx, t, s); grpc_chttp2_maybe_complete_recv_initial_metadata(exec_ctx, t, s); grpc_chttp2_maybe_complete_recv_message(exec_ctx, t, s); } @@ -2150,7 +2095,6 @@ static void update_bdp(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, (int)bdp); } push_setting(exec_ctx, t, GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE, bdp); - push_setting(exec_ctx, t, GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE, bdp); } static grpc_error *try_http_parsing(grpc_exec_ctx *exec_ctx, @@ -2368,9 +2312,7 @@ static void init_keepalive_ping_locked(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { grpc_chttp2_transport *t = arg; GPR_ASSERT(t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_WAITING); - if (t->destroying || t->closed) { - t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_DYING; - } else if (error == GRPC_ERROR_NONE) { + if (error == GRPC_ERROR_NONE && !(t->destroying || t->closed)) { if (t->keepalive_permit_without_calls || grpc_chttp2_stream_map_size(&t->stream_map) > 0) { t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_PINGING; @@ -2385,7 +2327,7 @@ static void init_keepalive_ping_locked(grpc_exec_ctx *exec_ctx, void *arg, gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), t->keepalive_time), &t->init_keepalive_ping_locked, gpr_now(GPR_CLOCK_MONOTONIC)); } - } else if (error == GRPC_ERROR_CANCELLED) { + } else if (error == GRPC_ERROR_CANCELLED && !(t->destroying || t->closed)) { /* The keepalive ping timer may be cancelled by bdp */ GRPC_CHTTP2_REF_TRANSPORT(t, "init keepalive ping"); grpc_timer_init( @@ -2477,28 +2419,12 @@ static void set_pollset_set(grpc_exec_ctx *exec_ctx, grpc_transport *gt, * BYTE STREAM */ -static void reset_byte_stream(grpc_exec_ctx *exec_ctx, void *arg, - grpc_error *error) { - grpc_chttp2_stream *s = (grpc_chttp2_stream *)arg; - - s->pending_byte_stream = false; - if (error == GRPC_ERROR_NONE) { - grpc_chttp2_maybe_complete_recv_message(exec_ctx, s->t, s); - grpc_chttp2_maybe_complete_recv_trailing_metadata(exec_ctx, s->t, s); - } else { - GPR_ASSERT(error != GRPC_ERROR_NONE); - grpc_closure_sched(exec_ctx, s->on_next, GRPC_ERROR_REF(error)); - s->on_next = NULL; - GRPC_ERROR_UNREF(s->byte_stream_error); - s->byte_stream_error = GRPC_ERROR_NONE; - grpc_chttp2_cancel_stream(exec_ctx, s->t, s, GRPC_ERROR_REF(error)); - s->byte_stream_error = error; - } -} - static void incoming_byte_stream_unref(grpc_exec_ctx *exec_ctx, grpc_chttp2_incoming_byte_stream *bs) { if (gpr_unref(&bs->refs)) { + GRPC_ERROR_UNREF(bs->error); + grpc_slice_buffer_destroy_internal(exec_ctx, &bs->slices); + gpr_mu_destroy(&bs->slice_mu); gpr_free(bs); } } @@ -2558,91 +2484,47 @@ static void incoming_byte_stream_next_locked(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t = bs->transport; grpc_chttp2_stream *s = bs->stream; - size_t cur_length = s->frame_storage.length; - incoming_byte_stream_update_flow_control( - exec_ctx, t, s, bs->next_action.max_size_hint, cur_length); - - GPR_ASSERT(s->unprocessed_incoming_frames_buffer.length == 0); - if (s->frame_storage.length > 0) { - grpc_slice_buffer_swap(&s->frame_storage, - &s->unprocessed_incoming_frames_buffer); - grpc_closure_sched(exec_ctx, bs->next_action.on_complete, GRPC_ERROR_NONE); - } else if (s->byte_stream_error != GRPC_ERROR_NONE) { - grpc_closure_sched(exec_ctx, bs->next_action.on_complete, - GRPC_ERROR_REF(s->byte_stream_error)); - if (s->data_parser.parsing_frame != NULL) { - incoming_byte_stream_unref(exec_ctx, s->data_parser.parsing_frame); - s->data_parser.parsing_frame = NULL; - } - } else if (s->read_closed) { - if (bs->remaining_bytes != 0) { - s->byte_stream_error = - GRPC_ERROR_CREATE_FROM_STATIC_STRING("Truncated message"); - grpc_closure_sched(exec_ctx, bs->next_action.on_complete, - GRPC_ERROR_REF(s->byte_stream_error)); - if (s->data_parser.parsing_frame != NULL) { - incoming_byte_stream_unref(exec_ctx, s->data_parser.parsing_frame); - s->data_parser.parsing_frame = NULL; - } - } else { - /* Should never reach here. */ - GPR_ASSERT(false); - } + if (bs->is_tail) { + gpr_mu_lock(&bs->slice_mu); + size_t cur_length = bs->slices.length; + gpr_mu_unlock(&bs->slice_mu); + incoming_byte_stream_update_flow_control( + exec_ctx, t, s, bs->next_action.max_size_hint, cur_length); + } + gpr_mu_lock(&bs->slice_mu); + if (bs->slices.count > 0) { + *bs->next_action.slice = grpc_slice_buffer_take_first(&bs->slices); + grpc_closure_run(exec_ctx, bs->next_action.on_complete, GRPC_ERROR_NONE); + } else if (bs->error != GRPC_ERROR_NONE) { + grpc_closure_run(exec_ctx, bs->next_action.on_complete, + GRPC_ERROR_REF(bs->error)); } else { - s->on_next = bs->next_action.on_complete; + bs->on_next = bs->next_action.on_complete; + bs->next = bs->next_action.slice; } + gpr_mu_unlock(&bs->slice_mu); incoming_byte_stream_unref(exec_ctx, bs); } -static bool incoming_byte_stream_next(grpc_exec_ctx *exec_ctx, - grpc_byte_stream *byte_stream, - size_t max_size_hint, - grpc_closure *on_complete) { +static int incoming_byte_stream_next(grpc_exec_ctx *exec_ctx, + grpc_byte_stream *byte_stream, + grpc_slice *slice, size_t max_size_hint, + grpc_closure *on_complete) { GPR_TIMER_BEGIN("incoming_byte_stream_next", 0); grpc_chttp2_incoming_byte_stream *bs = (grpc_chttp2_incoming_byte_stream *)byte_stream; - grpc_chttp2_stream *s = bs->stream; - if (s->unprocessed_incoming_frames_buffer.length > 0) { - GPR_TIMER_END("incoming_byte_stream_next", 0); - return true; - } else { - gpr_ref(&bs->refs); - bs->next_action.max_size_hint = max_size_hint; - bs->next_action.on_complete = on_complete; - grpc_closure_sched( - exec_ctx, - grpc_closure_init( - &bs->next_action.closure, incoming_byte_stream_next_locked, bs, - grpc_combiner_scheduler(bs->transport->combiner, false)), - GRPC_ERROR_NONE); - GPR_TIMER_END("incoming_byte_stream_next", 0); - return false; - } -} - -static grpc_error *incoming_byte_stream_pull(grpc_exec_ctx *exec_ctx, - grpc_byte_stream *byte_stream, - grpc_slice *slice) { - GPR_TIMER_BEGIN("incoming_byte_stream_pull", 0); - grpc_chttp2_incoming_byte_stream *bs = - (grpc_chttp2_incoming_byte_stream *)byte_stream; - grpc_chttp2_stream *s = bs->stream; - - if (s->unprocessed_incoming_frames_buffer.length > 0) { - grpc_error *error = grpc_deframe_unprocessed_incoming_frames( - exec_ctx, &s->data_parser, s, &s->unprocessed_incoming_frames_buffer, - slice, NULL); - if (error != GRPC_ERROR_NONE) { - return error; - } - } else { - grpc_error *error = - GRPC_ERROR_CREATE_FROM_STATIC_STRING("Truncated message"); - grpc_closure_sched(exec_ctx, &s->reset_byte_stream, GRPC_ERROR_REF(error)); - return error; - } - GPR_TIMER_END("incoming_byte_stream_pull", 0); - return GRPC_ERROR_NONE; + gpr_ref(&bs->refs); + bs->next_action.slice = slice; + bs->next_action.max_size_hint = max_size_hint; + bs->next_action.on_complete = on_complete; + grpc_closure_sched( + exec_ctx, + grpc_closure_init( + &bs->next_action.closure, incoming_byte_stream_next_locked, bs, + grpc_combiner_scheduler(bs->transport->combiner, false)), + GRPC_ERROR_NONE); + GPR_TIMER_END("incoming_byte_stream_next", 0); + return 0; } static void incoming_byte_stream_destroy(grpc_exec_ctx *exec_ctx, @@ -2652,14 +2534,9 @@ static void incoming_byte_stream_destroy_locked(grpc_exec_ctx *exec_ctx, void *byte_stream, grpc_error *error_ignored) { grpc_chttp2_incoming_byte_stream *bs = byte_stream; - grpc_chttp2_stream *s = bs->stream; - grpc_chttp2_transport *t = s->t; - GPR_ASSERT(bs->base.destroy == incoming_byte_stream_destroy); + decrement_active_streams_locked(exec_ctx, bs->transport, bs->stream); incoming_byte_stream_unref(exec_ctx, bs); - s->pending_byte_stream = false; - grpc_chttp2_maybe_complete_recv_message(exec_ctx, t, s); - grpc_chttp2_maybe_complete_recv_trailing_metadata(exec_ctx, t, s); } static void incoming_byte_stream_destroy(grpc_exec_ctx *exec_ctx, @@ -2679,53 +2556,50 @@ static void incoming_byte_stream_destroy(grpc_exec_ctx *exec_ctx, static void incoming_byte_stream_publish_error( grpc_exec_ctx *exec_ctx, grpc_chttp2_incoming_byte_stream *bs, grpc_error *error) { - grpc_chttp2_stream *s = bs->stream; - GPR_ASSERT(error != GRPC_ERROR_NONE); - grpc_closure_sched(exec_ctx, s->on_next, GRPC_ERROR_REF(error)); - s->on_next = NULL; - GRPC_ERROR_UNREF(s->byte_stream_error); - s->byte_stream_error = GRPC_ERROR_REF(error); + grpc_closure_sched(exec_ctx, bs->on_next, GRPC_ERROR_REF(error)); + bs->on_next = NULL; + GRPC_ERROR_UNREF(bs->error); grpc_chttp2_cancel_stream(exec_ctx, bs->transport, bs->stream, GRPC_ERROR_REF(error)); + bs->error = error; } -grpc_error *grpc_chttp2_incoming_byte_stream_push( - grpc_exec_ctx *exec_ctx, grpc_chttp2_incoming_byte_stream *bs, - grpc_slice slice, grpc_slice *slice_out) { - grpc_chttp2_stream *s = bs->stream; - +void grpc_chttp2_incoming_byte_stream_push(grpc_exec_ctx *exec_ctx, + grpc_chttp2_incoming_byte_stream *bs, + grpc_slice slice) { + gpr_mu_lock(&bs->slice_mu); if (bs->remaining_bytes < GRPC_SLICE_LENGTH(slice)) { - grpc_error *error = - GRPC_ERROR_CREATE_FROM_STATIC_STRING("Too many bytes in stream"); - - grpc_closure_sched(exec_ctx, &s->reset_byte_stream, GRPC_ERROR_REF(error)); - grpc_slice_unref_internal(exec_ctx, slice); - return error; + incoming_byte_stream_publish_error( + exec_ctx, bs, + GRPC_ERROR_CREATE_FROM_STATIC_STRING("Too many bytes in stream")); } else { bs->remaining_bytes -= (uint32_t)GRPC_SLICE_LENGTH(slice); - if (slice_out != NULL) { - *slice_out = slice; + if (bs->on_next != NULL) { + *bs->next = slice; + grpc_closure_sched(exec_ctx, bs->on_next, GRPC_ERROR_NONE); + bs->on_next = NULL; + } else { + grpc_slice_buffer_add(&bs->slices, slice); } - return GRPC_ERROR_NONE; } + gpr_mu_unlock(&bs->slice_mu); } -grpc_error *grpc_chttp2_incoming_byte_stream_finished( +void grpc_chttp2_incoming_byte_stream_finished( grpc_exec_ctx *exec_ctx, grpc_chttp2_incoming_byte_stream *bs, - grpc_error *error, bool reset_on_error) { - grpc_chttp2_stream *s = bs->stream; - + grpc_error *error) { if (error == GRPC_ERROR_NONE) { + gpr_mu_lock(&bs->slice_mu); if (bs->remaining_bytes != 0) { error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Truncated message"); } + gpr_mu_unlock(&bs->slice_mu); } - if (error != GRPC_ERROR_NONE && reset_on_error) { - grpc_closure_sched(exec_ctx, &s->reset_byte_stream, GRPC_ERROR_REF(error)); + if (error != GRPC_ERROR_NONE) { + incoming_byte_stream_publish_error(exec_ctx, bs, error); } incoming_byte_stream_unref(exec_ctx, bs); - return error; } grpc_chttp2_incoming_byte_stream *grpc_chttp2_incoming_byte_stream_create( @@ -2737,12 +2611,26 @@ grpc_chttp2_incoming_byte_stream *grpc_chttp2_incoming_byte_stream_create( incoming_byte_stream->remaining_bytes = frame_size; incoming_byte_stream->base.flags = flags; incoming_byte_stream->base.next = incoming_byte_stream_next; - incoming_byte_stream->base.pull = incoming_byte_stream_pull; incoming_byte_stream->base.destroy = incoming_byte_stream_destroy; + gpr_mu_init(&incoming_byte_stream->slice_mu); gpr_ref_init(&incoming_byte_stream->refs, 2); + incoming_byte_stream->next_message = NULL; incoming_byte_stream->transport = t; incoming_byte_stream->stream = s; - s->byte_stream_error = GRPC_ERROR_NONE; + gpr_ref(&incoming_byte_stream->stream->active_streams); + grpc_slice_buffer_init(&incoming_byte_stream->slices); + incoming_byte_stream->on_next = NULL; + incoming_byte_stream->is_tail = 1; + incoming_byte_stream->error = GRPC_ERROR_NONE; + grpc_chttp2_incoming_frame_queue *q = &s->incoming_frames; + if (q->head == NULL) { + q->head = incoming_byte_stream; + } else { + q->tail->is_tail = 0; + q->tail->next_message = incoming_byte_stream; + } + q->tail = incoming_byte_stream; + grpc_chttp2_maybe_complete_recv_message(exec_ctx, t, s); return incoming_byte_stream; } diff --git a/src/core/ext/transport/chttp2/transport/frame_data.c b/src/core/ext/transport/chttp2/transport/frame_data.c index 9aba3ea445d..6e9258ee7ee 100644 --- a/src/core/ext/transport/chttp2/transport/frame_data.c +++ b/src/core/ext/transport/chttp2/transport/frame_data.c @@ -40,7 +40,6 @@ #include #include #include "src/core/ext/transport/chttp2/transport/internal.h" -#include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/slice/slice_string_helpers.h" #include "src/core/lib/support/string.h" #include "src/core/lib/transport/transport.h" @@ -54,17 +53,16 @@ grpc_error *grpc_chttp2_data_parser_init(grpc_chttp2_data_parser *parser) { void grpc_chttp2_data_parser_destroy(grpc_exec_ctx *exec_ctx, grpc_chttp2_data_parser *parser) { if (parser->parsing_frame != NULL) { - GRPC_ERROR_UNREF(grpc_chttp2_incoming_byte_stream_finished( + grpc_chttp2_incoming_byte_stream_finished( exec_ctx, parser->parsing_frame, - GRPC_ERROR_CREATE_FROM_STATIC_STRING("Parser destroyed"), false)); + GRPC_ERROR_CREATE_FROM_STATIC_STRING("Parser destroyed")); } GRPC_ERROR_UNREF(parser->error); } grpc_error *grpc_chttp2_data_parser_begin_frame(grpc_chttp2_data_parser *parser, uint8_t flags, - uint32_t stream_id, - grpc_chttp2_stream *s) { + uint32_t stream_id) { if (flags & ~GRPC_CHTTP2_DATA_FLAG_END_STREAM) { char *msg; gpr_asprintf(&msg, "unsupported data flags: 0x%02x", flags); @@ -76,14 +74,47 @@ grpc_error *grpc_chttp2_data_parser_begin_frame(grpc_chttp2_data_parser *parser, } if (flags & GRPC_CHTTP2_DATA_FLAG_END_STREAM) { - s->received_last_frame = true; + parser->is_last_frame = 1; } else { - s->received_last_frame = false; + parser->is_last_frame = 0; } return GRPC_ERROR_NONE; } +void grpc_chttp2_incoming_frame_queue_merge( + grpc_chttp2_incoming_frame_queue *head_dst, + grpc_chttp2_incoming_frame_queue *tail_src) { + if (tail_src->head == NULL) { + return; + } + + if (head_dst->head == NULL) { + *head_dst = *tail_src; + memset(tail_src, 0, sizeof(*tail_src)); + return; + } + + head_dst->tail->next_message = tail_src->head; + head_dst->tail = tail_src->tail; + memset(tail_src, 0, sizeof(*tail_src)); +} + +grpc_byte_stream *grpc_chttp2_incoming_frame_queue_pop( + grpc_chttp2_incoming_frame_queue *q) { + grpc_byte_stream *out; + if (q->head == NULL) { + return NULL; + } + out = &q->head->base; + if (q->head == q->tail) { + memset(q, 0, sizeof(*q)); + } else { + q->head = q->head->next_message; + } + return out; +} + void grpc_chttp2_encode_data(uint32_t id, grpc_slice_buffer *inbuf, uint32_t write_bytes, int is_eof, grpc_transport_one_way_stats *stats, @@ -112,215 +143,145 @@ void grpc_chttp2_encode_data(uint32_t id, grpc_slice_buffer *inbuf, stats->data_bytes += write_bytes; } -grpc_error *grpc_deframe_unprocessed_incoming_frames( - grpc_exec_ctx *exec_ctx, grpc_chttp2_data_parser *p, grpc_chttp2_stream *s, - grpc_slice_buffer *slices, grpc_slice *slice_out, - grpc_byte_stream **stream_out) { - grpc_error *error = GRPC_ERROR_NONE; - grpc_chttp2_transport *t = s->t; - - while (slices->count > 0) { - uint8_t *beg = NULL; - uint8_t *end = NULL; - uint8_t *cur = NULL; - - grpc_slice slice = grpc_slice_buffer_take_first(slices); +static grpc_error *parse_inner(grpc_exec_ctx *exec_ctx, + grpc_chttp2_data_parser *p, + grpc_chttp2_transport *t, grpc_chttp2_stream *s, + grpc_slice slice) { + uint8_t *const beg = GRPC_SLICE_START_PTR(slice); + uint8_t *const end = GRPC_SLICE_END_PTR(slice); + uint8_t *cur = beg; + uint32_t message_flags; + grpc_chttp2_incoming_byte_stream *incoming_byte_stream; + char *msg; - beg = GRPC_SLICE_START_PTR(slice); - end = GRPC_SLICE_END_PTR(slice); - cur = beg; - uint32_t message_flags; - char *msg; - - if (cur == end) { - grpc_slice_unref_internal(exec_ctx, slice); - continue; - } - - switch (p->state) { - case GRPC_CHTTP2_DATA_ERROR: - p->state = GRPC_CHTTP2_DATA_ERROR; - grpc_slice_unref_internal(exec_ctx, slice); - return GRPC_ERROR_REF(p->error); - case GRPC_CHTTP2_DATA_FH_0: - p->frame_type = *cur; - switch (p->frame_type) { - case 0: - p->is_frame_compressed = false; /* GPR_FALSE */ - break; - case 1: - p->is_frame_compressed = true; /* GPR_TRUE */ - break; - default: - gpr_asprintf(&msg, "Bad GRPC frame type 0x%02x", p->frame_type); - p->error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg); - p->error = grpc_error_set_int(p->error, GRPC_ERROR_INT_STREAM_ID, - (intptr_t)s->id); - gpr_free(msg); - msg = grpc_dump_slice(slice, GPR_DUMP_HEX | GPR_DUMP_ASCII); - p->error = grpc_error_set_str(p->error, GRPC_ERROR_STR_RAW_BYTES, - grpc_slice_from_copied_string(msg)); - gpr_free(msg); - p->error = - grpc_error_set_int(p->error, GRPC_ERROR_INT_OFFSET, cur - beg); - p->state = GRPC_CHTTP2_DATA_ERROR; - grpc_slice_unref_internal(exec_ctx, slice); - return GRPC_ERROR_REF(p->error); - } - if (++cur == end) { - p->state = GRPC_CHTTP2_DATA_FH_1; - grpc_slice_unref_internal(exec_ctx, slice); - continue; - } - /* fallthrough */ - case GRPC_CHTTP2_DATA_FH_1: - p->frame_size = ((uint32_t)*cur) << 24; - if (++cur == end) { - p->state = GRPC_CHTTP2_DATA_FH_2; - grpc_slice_unref_internal(exec_ctx, slice); - continue; - } - /* fallthrough */ - case GRPC_CHTTP2_DATA_FH_2: - p->frame_size |= ((uint32_t)*cur) << 16; - if (++cur == end) { - p->state = GRPC_CHTTP2_DATA_FH_3; - grpc_slice_unref_internal(exec_ctx, slice); - continue; - } - /* fallthrough */ - case GRPC_CHTTP2_DATA_FH_3: - p->frame_size |= ((uint32_t)*cur) << 8; - if (++cur == end) { - p->state = GRPC_CHTTP2_DATA_FH_4; - grpc_slice_unref_internal(exec_ctx, slice); - continue; - } - /* fallthrough */ - case GRPC_CHTTP2_DATA_FH_4: - GPR_ASSERT(stream_out != NULL); - GPR_ASSERT(p->parsing_frame == NULL); - p->frame_size |= ((uint32_t)*cur); - p->state = GRPC_CHTTP2_DATA_FRAME; - ++cur; - message_flags = 0; - if (p->is_frame_compressed) { - message_flags |= GRPC_WRITE_INTERNAL_COMPRESS; - } - p->parsing_frame = grpc_chttp2_incoming_byte_stream_create( - exec_ctx, t, s, p->frame_size, message_flags); - *stream_out = &p->parsing_frame->base; - if (p->parsing_frame->remaining_bytes == 0) { - GRPC_ERROR_UNREF(grpc_chttp2_incoming_byte_stream_finished( - exec_ctx, p->parsing_frame, GRPC_ERROR_NONE, true)); - p->parsing_frame = NULL; - p->state = GRPC_CHTTP2_DATA_FH_0; - } - s->pending_byte_stream = true; + if (cur == end) { + return GRPC_ERROR_NONE; + } - if (cur != end) { - grpc_slice_buffer_undo_take_first( - &s->unprocessed_incoming_frames_buffer, - grpc_slice_sub(slice, (size_t)(cur - beg), (size_t)(end - beg))); - } - grpc_slice_unref_internal(exec_ctx, slice); + switch (p->state) { + case GRPC_CHTTP2_DATA_ERROR: + p->state = GRPC_CHTTP2_DATA_ERROR; + return GRPC_ERROR_REF(p->error); + fh_0: + case GRPC_CHTTP2_DATA_FH_0: + s->stats.incoming.framing_bytes++; + p->frame_type = *cur; + switch (p->frame_type) { + case 0: + p->is_frame_compressed = 0; /* GPR_FALSE */ + break; + case 1: + p->is_frame_compressed = 1; /* GPR_TRUE */ + break; + default: + gpr_asprintf(&msg, "Bad GRPC frame type 0x%02x", p->frame_type); + p->error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg); + p->error = grpc_error_set_int(p->error, GRPC_ERROR_INT_STREAM_ID, + (intptr_t)s->id); + gpr_free(msg); + msg = grpc_dump_slice(slice, GPR_DUMP_HEX | GPR_DUMP_ASCII); + p->error = grpc_error_set_str(p->error, GRPC_ERROR_STR_RAW_BYTES, + grpc_slice_from_copied_string(msg)); + gpr_free(msg); + p->error = + grpc_error_set_int(p->error, GRPC_ERROR_INT_OFFSET, cur - beg); + p->state = GRPC_CHTTP2_DATA_ERROR; + return GRPC_ERROR_REF(p->error); + } + if (++cur == end) { + p->state = GRPC_CHTTP2_DATA_FH_1; + return GRPC_ERROR_NONE; + } + /* fallthrough */ + case GRPC_CHTTP2_DATA_FH_1: + s->stats.incoming.framing_bytes++; + p->frame_size = ((uint32_t)*cur) << 24; + if (++cur == end) { + p->state = GRPC_CHTTP2_DATA_FH_2; + return GRPC_ERROR_NONE; + } + /* fallthrough */ + case GRPC_CHTTP2_DATA_FH_2: + s->stats.incoming.framing_bytes++; + p->frame_size |= ((uint32_t)*cur) << 16; + if (++cur == end) { + p->state = GRPC_CHTTP2_DATA_FH_3; + return GRPC_ERROR_NONE; + } + /* fallthrough */ + case GRPC_CHTTP2_DATA_FH_3: + s->stats.incoming.framing_bytes++; + p->frame_size |= ((uint32_t)*cur) << 8; + if (++cur == end) { + p->state = GRPC_CHTTP2_DATA_FH_4; + return GRPC_ERROR_NONE; + } + /* fallthrough */ + case GRPC_CHTTP2_DATA_FH_4: + s->stats.incoming.framing_bytes++; + p->frame_size |= ((uint32_t)*cur); + p->state = GRPC_CHTTP2_DATA_FRAME; + ++cur; + message_flags = 0; + if (p->is_frame_compressed) { + message_flags |= GRPC_WRITE_INTERNAL_COMPRESS; + } + p->parsing_frame = incoming_byte_stream = + grpc_chttp2_incoming_byte_stream_create(exec_ctx, t, s, p->frame_size, + message_flags); + /* fallthrough */ + case GRPC_CHTTP2_DATA_FRAME: + if (cur == end) { + return GRPC_ERROR_NONE; + } + uint32_t remaining = (uint32_t)(end - cur); + if (remaining == p->frame_size) { + s->stats.incoming.data_bytes += p->frame_size; + grpc_chttp2_incoming_byte_stream_push( + exec_ctx, p->parsing_frame, + grpc_slice_sub(slice, (size_t)(cur - beg), (size_t)(end - beg))); + grpc_chttp2_incoming_byte_stream_finished(exec_ctx, p->parsing_frame, + GRPC_ERROR_NONE); + p->parsing_frame = NULL; + p->state = GRPC_CHTTP2_DATA_FH_0; + return GRPC_ERROR_NONE; + } else if (remaining > p->frame_size) { + s->stats.incoming.data_bytes += p->frame_size; + grpc_chttp2_incoming_byte_stream_push( + exec_ctx, p->parsing_frame, + grpc_slice_sub(slice, (size_t)(cur - beg), + (size_t)(cur + p->frame_size - beg))); + grpc_chttp2_incoming_byte_stream_finished(exec_ctx, p->parsing_frame, + GRPC_ERROR_NONE); + p->parsing_frame = NULL; + cur += p->frame_size; + goto fh_0; /* loop */ + } else { + GPR_ASSERT(remaining <= p->frame_size); + grpc_chttp2_incoming_byte_stream_push( + exec_ctx, p->parsing_frame, + grpc_slice_sub(slice, (size_t)(cur - beg), (size_t)(end - beg))); + p->frame_size -= remaining; + s->stats.incoming.data_bytes += remaining; return GRPC_ERROR_NONE; - case GRPC_CHTTP2_DATA_FRAME: { - GPR_ASSERT(p->parsing_frame != NULL); - GPR_ASSERT(slice_out != NULL); - if (cur == end) { - grpc_slice_unref_internal(exec_ctx, slice); - continue; - } - uint32_t remaining = (uint32_t)(end - cur); - if (remaining == p->frame_size) { - if (GRPC_ERROR_NONE != (error = grpc_chttp2_incoming_byte_stream_push( - exec_ctx, p->parsing_frame, - grpc_slice_sub(slice, (size_t)(cur - beg), - (size_t)(end - beg)), - slice_out))) { - grpc_slice_unref_internal(exec_ctx, slice); - return error; - } - if (GRPC_ERROR_NONE != - (error = grpc_chttp2_incoming_byte_stream_finished( - exec_ctx, p->parsing_frame, GRPC_ERROR_NONE, true))) { - grpc_slice_unref_internal(exec_ctx, slice); - return error; - } - p->parsing_frame = NULL; - p->state = GRPC_CHTTP2_DATA_FH_0; - grpc_slice_unref_internal(exec_ctx, slice); - return GRPC_ERROR_NONE; - } else if (remaining < p->frame_size) { - if (GRPC_ERROR_NONE != (error = grpc_chttp2_incoming_byte_stream_push( - exec_ctx, p->parsing_frame, - grpc_slice_sub(slice, (size_t)(cur - beg), - (size_t)(end - beg)), - slice_out))) { - return error; - } - p->frame_size -= remaining; - grpc_slice_unref_internal(exec_ctx, slice); - return GRPC_ERROR_NONE; - } else { - GPR_ASSERT(remaining > p->frame_size); - if (GRPC_ERROR_NONE != - (grpc_chttp2_incoming_byte_stream_push( - exec_ctx, p->parsing_frame, - grpc_slice_sub(slice, (size_t)(cur - beg), - (size_t)(cur + p->frame_size - beg)), - slice_out))) { - grpc_slice_unref_internal(exec_ctx, slice); - return error; - } - if (GRPC_ERROR_NONE != - (error = grpc_chttp2_incoming_byte_stream_finished( - exec_ctx, p->parsing_frame, GRPC_ERROR_NONE, true))) { - grpc_slice_unref_internal(exec_ctx, slice); - return error; - } - p->parsing_frame = NULL; - p->state = GRPC_CHTTP2_DATA_FH_0; - cur += p->frame_size; - grpc_slice_buffer_undo_take_first( - &s->unprocessed_incoming_frames_buffer, - grpc_slice_sub(slice, (size_t)(cur - beg), (size_t)(end - beg))); - grpc_slice_unref_internal(exec_ctx, slice); - return GRPC_ERROR_NONE; - } } - } } - return GRPC_ERROR_NONE; + GPR_UNREACHABLE_CODE( + return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Should never reach here")); } grpc_error *grpc_chttp2_data_parser_parse(grpc_exec_ctx *exec_ctx, void *parser, grpc_chttp2_transport *t, grpc_chttp2_stream *s, grpc_slice slice, int is_last) { - /* grpc_error *error = parse_inner_buffer(exec_ctx, p, t, s, slice); */ - s->stats.incoming.framing_bytes += GRPC_SLICE_LENGTH(slice); - if (!s->pending_byte_stream) { - grpc_slice_ref_internal(slice); - grpc_slice_buffer_add(&s->frame_storage, slice); - grpc_chttp2_maybe_complete_recv_message(exec_ctx, t, s); - } else if (s->on_next) { - GPR_ASSERT(s->frame_storage.length == 0); - grpc_slice_ref_internal(slice); - grpc_slice_buffer_add(&s->unprocessed_incoming_frames_buffer, slice); - grpc_closure_sched(exec_ctx, s->on_next, GRPC_ERROR_NONE); - s->on_next = NULL; - } else { - grpc_slice_ref_internal(slice); - grpc_slice_buffer_add(&s->frame_storage, slice); - } + grpc_chttp2_data_parser *p = parser; + grpc_error *error = parse_inner(exec_ctx, p, t, s, slice); - if (is_last && s->received_last_frame) { + if (is_last && p->is_last_frame) { grpc_chttp2_mark_stream_closed(exec_ctx, t, s, true, false, GRPC_ERROR_NONE); } - return GRPC_ERROR_NONE; + return error; } diff --git a/src/core/ext/transport/chttp2/transport/frame_data.h b/src/core/ext/transport/chttp2/transport/frame_data.h index 9ed4ad0f218..264ad146085 100644 --- a/src/core/ext/transport/chttp2/transport/frame_data.h +++ b/src/core/ext/transport/chttp2/transport/frame_data.h @@ -56,16 +56,28 @@ typedef enum { typedef struct grpc_chttp2_incoming_byte_stream grpc_chttp2_incoming_byte_stream; +typedef struct grpc_chttp2_incoming_frame_queue { + grpc_chttp2_incoming_byte_stream *head; + grpc_chttp2_incoming_byte_stream *tail; +} grpc_chttp2_incoming_frame_queue; + typedef struct { grpc_chttp2_stream_state state; + uint8_t is_last_frame; uint8_t frame_type; uint32_t frame_size; grpc_error *error; - bool is_frame_compressed; + int is_frame_compressed; grpc_chttp2_incoming_byte_stream *parsing_frame; } grpc_chttp2_data_parser; +void grpc_chttp2_incoming_frame_queue_merge( + grpc_chttp2_incoming_frame_queue *head_dst, + grpc_chttp2_incoming_frame_queue *tail_src); +grpc_byte_stream *grpc_chttp2_incoming_frame_queue_pop( + grpc_chttp2_incoming_frame_queue *q); + /* initialize per-stream state for data frame parsing */ grpc_error *grpc_chttp2_data_parser_init(grpc_chttp2_data_parser *parser); @@ -75,8 +87,7 @@ void grpc_chttp2_data_parser_destroy(grpc_exec_ctx *exec_ctx, /* start processing a new data frame */ grpc_error *grpc_chttp2_data_parser_begin_frame(grpc_chttp2_data_parser *parser, uint8_t flags, - uint32_t stream_id, - grpc_chttp2_stream *s); + uint32_t stream_id); /* handle a slice of a data frame - is_last indicates the last slice of a frame */ @@ -90,9 +101,4 @@ void grpc_chttp2_encode_data(uint32_t id, grpc_slice_buffer *inbuf, grpc_transport_one_way_stats *stats, grpc_slice_buffer *outbuf); -grpc_error *grpc_deframe_unprocessed_incoming_frames( - grpc_exec_ctx *exec_ctx, grpc_chttp2_data_parser *p, grpc_chttp2_stream *s, - grpc_slice_buffer *slices, grpc_slice *slice_out, - grpc_byte_stream **stream_out); - #endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_DATA_H */ diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h index 0aaa4aebe5f..6eb848b8d77 100644 --- a/src/core/ext/transport/chttp2/transport/internal.h +++ b/src/core/ext/transport/chttp2/transport/internal.h @@ -195,20 +195,22 @@ typedef struct grpc_chttp2_write_cb { struct grpc_chttp2_incoming_byte_stream { grpc_byte_stream base; gpr_refcount refs; + struct grpc_chttp2_incoming_byte_stream *next_message; + grpc_error *error; - grpc_chttp2_transport *transport; /* immutable */ - grpc_chttp2_stream *stream; /* immutable */ + grpc_chttp2_transport *transport; + grpc_chttp2_stream *stream; + bool is_tail; - /* Accessed only by transport thread when stream->pending_byte_stream == false - * Accessed only by application thread when stream->pending_byte_stream == - * true */ + gpr_mu slice_mu; // protects slices, on_next + grpc_slice_buffer slices; + grpc_closure *on_next; + grpc_slice *next; uint32_t remaining_bytes; - /* Accessed only by transport thread when stream->pending_byte_stream == false - * Accessed only by application thread when stream->pending_byte_stream == - * true */ struct { grpc_closure closure; + grpc_slice *slice; size_t max_size_hint; grpc_closure *on_complete; } next_action; @@ -220,7 +222,6 @@ typedef enum { GRPC_CHTTP2_KEEPALIVE_STATE_WAITING, GRPC_CHTTP2_KEEPALIVE_STATE_PINGING, GRPC_CHTTP2_KEEPALIVE_STATE_DYING, - GRPC_CHTTP2_KEEPALIVE_STATE_DISABLED, } grpc_chttp2_keepalive_state; struct grpc_chttp2_transport { @@ -444,8 +445,8 @@ struct grpc_chttp2_stream { uint32_t id; /** window available for us to send to peer, over or under the initial window - * size of the transport... ie: - * outgoing_window = outgoing_window_delta + transport.initial_window_size */ + * size of the transport... ie: + * outgoing_window = outgoing_window_delta + transport.initial_window_size */ int64_t outgoing_window_delta; /** things the upper layers would like to send */ grpc_metadata_batch *send_initial_metadata; @@ -472,6 +473,9 @@ struct grpc_chttp2_stream { grpc_transport_stream_stats *collecting_stats; grpc_transport_stream_stats stats; + /** number of streams that are currently being read */ + gpr_refcount active_streams; + /** Is this stream closed for writing. */ bool write_closed; /** Is this stream reading half-closed. */ @@ -495,17 +499,7 @@ struct grpc_chttp2_stream { grpc_chttp2_incoming_metadata_buffer metadata_buffer[2]; - grpc_slice_buffer frame_storage; /* protected by t combiner */ - - /* Accessed only by transport thread when stream->pending_byte_stream == false - * Accessed only by application thread when stream->pending_byte_stream == - * true */ - grpc_slice_buffer unprocessed_incoming_frames_buffer; - grpc_closure *on_next; /* protected by t combiner */ - bool pending_byte_stream; /* protected by t combiner */ - grpc_closure reset_byte_stream; - grpc_error *byte_stream_error; /* protected by t combiner */ - bool received_last_frame; /* protected by t combiner */ + grpc_chttp2_incoming_frame_queue incoming_frames; gpr_timespec deadline; @@ -518,9 +512,6 @@ struct grpc_chttp2_stream { * incoming_window = incoming_window_delta + transport.initial_window_size */ int64_t incoming_window_delta; /** parsing state for data frames */ - /* Accessed only by transport thread when stream->pending_byte_stream == false - * Accessed only by application thread when stream->pending_byte_stream == - * true */ grpc_chttp2_data_parser data_parser; /** number of bytes received - reset at end of parse thread execution */ int64_t received_bytes; @@ -799,13 +790,10 @@ void grpc_chttp2_ref_transport(grpc_chttp2_transport *t); grpc_chttp2_incoming_byte_stream *grpc_chttp2_incoming_byte_stream_create( grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, grpc_chttp2_stream *s, uint32_t frame_size, uint32_t flags); -grpc_error *grpc_chttp2_incoming_byte_stream_push( - grpc_exec_ctx *exec_ctx, grpc_chttp2_incoming_byte_stream *bs, - grpc_slice slice, grpc_slice *slice_out); -grpc_error *grpc_chttp2_incoming_byte_stream_finished( - grpc_exec_ctx *exec_ctx, grpc_chttp2_incoming_byte_stream *bs, - grpc_error *error, bool reset_on_error); -void grpc_chttp2_incoming_byte_stream_notify( +void grpc_chttp2_incoming_byte_stream_push(grpc_exec_ctx *exec_ctx, + grpc_chttp2_incoming_byte_stream *bs, + grpc_slice slice); +void grpc_chttp2_incoming_byte_stream_finished( grpc_exec_ctx *exec_ctx, grpc_chttp2_incoming_byte_stream *bs, grpc_error *error); diff --git a/src/core/ext/transport/chttp2/transport/parsing.c b/src/core/ext/transport/chttp2/transport/parsing.c index 638b137316f..7e457ced270 100644 --- a/src/core/ext/transport/chttp2/transport/parsing.c +++ b/src/core/ext/transport/chttp2/transport/parsing.c @@ -458,13 +458,12 @@ static grpc_error *init_data_frame_parser(grpc_exec_ctx *exec_ctx, return init_skip_frame_parser(exec_ctx, t, 0); } if (err == GRPC_ERROR_NONE) { - err = grpc_chttp2_data_parser_begin_frame( - &s->data_parser, t->incoming_frame_flags, s->id, s); + err = grpc_chttp2_data_parser_begin_frame(&s->data_parser, + t->incoming_frame_flags, s->id); } error_handler: if (err == GRPC_ERROR_NONE) { t->incoming_stream = s; - /* t->parser = grpc_chttp2_data_parser_parse;*/ t->parser = grpc_chttp2_data_parser_parse; t->parser_data = &s->data_parser; return GRPC_ERROR_NONE; diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.c b/src/core/ext/transport/cronet/transport/cronet_transport.c index 7896c70f9eb..88335ecd0be 100644 --- a/src/core/ext/transport/cronet/transport/cronet_transport.c +++ b/src/core/ext/transport/cronet/transport/cronet_transport.c @@ -973,20 +973,9 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx, grpc_slice_buffer write_slice_buffer; grpc_slice slice; grpc_slice_buffer_init(&write_slice_buffer); - if (1 != grpc_byte_stream_next( - exec_ctx, stream_op->payload->send_message.send_message, - stream_op->payload->send_message.send_message->length, - NULL)) { - /* Should never reach here */ - GPR_ASSERT(false); - } - if (GRPC_ERROR_NONE != - grpc_byte_stream_pull(exec_ctx, - stream_op->payload->send_message.send_message, - &slice)) { - /* Should never reach here */ - GPR_ASSERT(false); - } + grpc_byte_stream_next( + NULL, stream_op->payload->send_message.send_message, &slice, + stream_op->payload->send_message.send_message->length, NULL); grpc_slice_buffer_add(&write_slice_buffer, slice); if (write_slice_buffer.count != 1) { /* Empty request not handled yet */ diff --git a/src/core/lib/channel/channel_args.c b/src/core/lib/channel/channel_args.c index 238d176dfae..a6d124c7199 100644 --- a/src/core/lib/channel/channel_args.c +++ b/src/core/lib/channel/channel_args.c @@ -31,18 +31,17 @@ * */ -#include -#include +#include "src/core/lib/channel/channel_args.h" +#include +#include "src/core/lib/support/string.h" #include -#include #include #include #include #include -#include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/support/string.h" +#include static grpc_arg copy_arg(const grpc_arg *src) { grpc_arg dst; @@ -330,9 +329,7 @@ const grpc_arg *grpc_channel_args_find(const grpc_channel_args *args, return NULL; } -int grpc_channel_arg_get_integer(const grpc_arg *arg, - const grpc_integer_options options) { - if (arg == NULL) return options.default_value; +int grpc_channel_arg_get_integer(grpc_arg *arg, grpc_integer_options options) { if (arg->type != GRPC_ARG_INTEGER) { gpr_log(GPR_ERROR, "%s ignored: it must be an integer", arg->key); return options.default_value; @@ -350,25 +347,9 @@ int grpc_channel_arg_get_integer(const grpc_arg *arg, return arg->value.integer; } -bool grpc_channel_arg_get_bool(const grpc_arg *arg, bool default_value) { - if (arg == NULL) return default_value; - if (arg->type != GRPC_ARG_INTEGER) { - gpr_log(GPR_ERROR, "%s ignored: it must be an integer", arg->key); - return default_value; - } - switch (arg->value.integer) { - case 0: - return false; - case 1: - return true; - default: - gpr_log(GPR_ERROR, "%s treated as bool but set to %d (assuming true)", - arg->key, arg->value.integer); - return true; - } -} - bool grpc_channel_args_want_minimal_stack(const grpc_channel_args *args) { - return grpc_channel_arg_get_bool( - grpc_channel_args_find(args, GRPC_ARG_MINIMAL_STACK), false); + const grpc_arg *arg = grpc_channel_args_find(args, GRPC_ARG_MINIMAL_STACK); + if (arg == NULL) return false; + if (arg->type == GRPC_ARG_INTEGER && arg->value.integer == 0) return false; + return true; } diff --git a/src/core/lib/channel/channel_args.h b/src/core/lib/channel/channel_args.h index f0f603e2514..158cda5b214 100644 --- a/src/core/lib/channel/channel_args.h +++ b/src/core/lib/channel/channel_args.h @@ -120,11 +120,7 @@ typedef struct grpc_integer_options { int min_value; int max_value; } grpc_integer_options; - /** Returns the value of \a arg, subject to the contraints in \a options. */ -int grpc_channel_arg_get_integer(const grpc_arg *arg, - const grpc_integer_options options); - -bool grpc_channel_arg_get_bool(const grpc_arg *arg, bool default_value); +int grpc_channel_arg_get_integer(grpc_arg *arg, grpc_integer_options options); #endif /* GRPC_CORE_LIB_CHANNEL_CHANNEL_ARGS_H */ diff --git a/src/core/lib/channel/channel_stack_builder.c b/src/core/lib/channel/channel_stack_builder.c index 88c02edb70e..b515b7321a7 100644 --- a/src/core/lib/channel/channel_stack_builder.c +++ b/src/core/lib/channel/channel_stack_builder.c @@ -113,17 +113,6 @@ grpc_channel_stack_builder_create_iterator_at_last( return create_iterator_at_filter_node(builder, &builder->end); } -bool grpc_channel_stack_builder_iterator_is_end( - grpc_channel_stack_builder_iterator *iterator) { - return iterator->node == &iterator->builder->end; -} - -const char *grpc_channel_stack_builder_iterator_filter_name( - grpc_channel_stack_builder_iterator *iterator) { - if (iterator->node->filter == NULL) return NULL; - return iterator->node->filter->name; -} - bool grpc_channel_stack_builder_move_next( grpc_channel_stack_builder_iterator *iterator) { if (iterator->node == &iterator->builder->end) return false; diff --git a/src/core/lib/channel/channel_stack_builder.h b/src/core/lib/channel/channel_stack_builder.h index c78111b00d0..8adf38e27bf 100644 --- a/src/core/lib/channel/channel_stack_builder.h +++ b/src/core/lib/channel/channel_stack_builder.h @@ -98,10 +98,6 @@ bool grpc_channel_stack_builder_iterator_is_first( bool grpc_channel_stack_builder_iterator_is_end( grpc_channel_stack_builder_iterator *iterator); -/// What is the name of the filter at this iterator position? -const char *grpc_channel_stack_builder_iterator_filter_name( - grpc_channel_stack_builder_iterator *iterator); - /// Move an iterator to the next item bool grpc_channel_stack_builder_move_next( grpc_channel_stack_builder_iterator *iterator); diff --git a/src/core/ext/filters/http/message_compress/message_compress_filter.c b/src/core/lib/channel/compress_filter.c similarity index 72% rename from src/core/ext/filters/http/message_compress/message_compress_filter.c rename to src/core/lib/channel/compress_filter.c index 4f5f41e9b04..4625cba0d25 100644 --- a/src/core/ext/filters/http/message_compress/message_compress_filter.c +++ b/src/core/lib/channel/compress_filter.c @@ -39,8 +39,8 @@ #include #include -#include "src/core/ext/filters/http/message_compress/message_compress_filter.h" #include "src/core/lib/channel/channel_args.h" +#include "src/core/lib/channel/compress_filter.h" #include "src/core/lib/compression/algorithm_metadata.h" #include "src/core/lib/compression/message_compress.h" #include "src/core/lib/profiling/timers.h" @@ -49,11 +49,7 @@ #include "src/core/lib/support/string.h" #include "src/core/lib/transport/static_metadata.h" -#define INITIAL_METADATA_UNSEEN 0 -#define HAS_COMPRESSION_ALGORITHM 2 -#define NO_COMPRESSION_ALGORITHM 4 - -#define CANCELLED_BIT ((gpr_atm)1) +int grpc_compression_trace = 0; typedef struct call_data { grpc_slice_buffer slices; /**< Buffers up input slices to be compressed */ @@ -63,17 +59,8 @@ typedef struct call_data { /** Compression algorithm we'll try to use. It may be given by incoming * metadata, or by the channel's default compression settings. */ grpc_compression_algorithm compression_algorithm; - - /* Atomic recording the state of initial metadata; allowed values: - INITIAL_METADATA_UNSEEN - initial metadata op not seen - HAS_COMPRESSION_ALGORITHM - initial metadata seen; compression algorithm - set - NO_COMPRESSION_ALGORITHM - initial metadata seen; no compression algorithm - set - pointer - a stalled op containing a send_message that's waiting on initial - metadata - pointer | CANCELLED_BIT - request was cancelled with error pointed to */ - gpr_atm send_initial_metadata_state; + /** If true, contents of \a compression_algorithm are authoritative */ + int has_compression_algorithm; grpc_transport_stream_op_batch *send_op; uint32_t send_length; @@ -94,15 +81,14 @@ typedef struct channel_data { uint32_t supported_compression_algorithms; } channel_data; -static bool skip_compression(grpc_call_element *elem, uint32_t flags, - bool has_compression_algorithm) { +static int skip_compression(grpc_call_element *elem, uint32_t flags) { call_data *calld = elem->call_data; channel_data *channeld = elem->channel_data; if (flags & (GRPC_WRITE_NO_COMPRESS | GRPC_WRITE_INTERNAL_COMPRESS)) { return 1; } - if (has_compression_algorithm) { + if (calld->has_compression_algorithm) { if (calld->compression_algorithm == GRPC_COMPRESS_NONE) { return 1; } @@ -115,14 +101,12 @@ static bool skip_compression(grpc_call_element *elem, uint32_t flags, /** Filter initial metadata */ static grpc_error *process_send_initial_metadata( grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - grpc_metadata_batch *initial_metadata, - bool *has_compression_algorithm) GRPC_MUST_USE_RESULT; + grpc_metadata_batch *initial_metadata) GRPC_MUST_USE_RESULT; static grpc_error *process_send_initial_metadata( grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - grpc_metadata_batch *initial_metadata, bool *has_compression_algorithm) { + grpc_metadata_batch *initial_metadata) { call_data *calld = elem->call_data; channel_data *channeld = elem->channel_data; - *has_compression_algorithm = false; /* Parse incoming request for compression. If any, it'll be available * at calld->compression_algorithm */ if (initial_metadata->idx.named.grpc_internal_encoding_request != NULL) { @@ -146,7 +130,7 @@ static grpc_error *process_send_initial_metadata( gpr_free(val); calld->compression_algorithm = GRPC_COMPRESS_NONE; } - *has_compression_algorithm = true; + calld->has_compression_algorithm = 1; grpc_metadata_batch_remove( exec_ctx, initial_metadata, @@ -156,7 +140,7 @@ static grpc_error *process_send_initial_metadata( * exceptionally skipping compression, fall back to the channel * default */ calld->compression_algorithm = channeld->default_compression_algorithm; - *has_compression_algorithm = true; + calld->has_compression_algorithm = 1; /* GPR_TRUE */ } grpc_error *error = GRPC_ERROR_NONE; @@ -237,13 +221,6 @@ static void finish_send_message(grpc_exec_ctx *exec_ctx, static void got_slice(grpc_exec_ctx *exec_ctx, void *elemp, grpc_error *error) { grpc_call_element *elem = elemp; call_data *calld = elem->call_data; - if (GRPC_ERROR_NONE != - grpc_byte_stream_pull(exec_ctx, - calld->send_op->payload->send_message.send_message, - &calld->incoming_slice)) { - /* Should never reach here */ - abort(); - } grpc_slice_buffer_add(&calld->slices, calld->incoming_slice); if (calld->send_length == calld->slices.length) { finish_send_message(exec_ctx, elem); @@ -256,11 +233,8 @@ static void continue_send_message(grpc_exec_ctx *exec_ctx, grpc_call_element *elem) { call_data *calld = elem->call_data; while (grpc_byte_stream_next( - exec_ctx, calld->send_op->payload->send_message.send_message, ~(size_t)0, - &calld->got_slice)) { - grpc_byte_stream_pull(exec_ctx, - calld->send_op->payload->send_message.send_message, - &calld->incoming_slice); + exec_ctx, calld->send_op->payload->send_message.send_message, + &calld->incoming_slice, ~(size_t)0, &calld->got_slice)) { grpc_slice_buffer_add(&calld->slices, calld->incoming_slice); if (calld->send_length == calld->slices.length) { finish_send_message(exec_ctx, elem); @@ -276,89 +250,21 @@ static void compress_start_transport_stream_op_batch( GPR_TIMER_BEGIN("compress_start_transport_stream_op_batch", 0); - if (op->cancel_stream) { - gpr_atm cur; - GRPC_ERROR_REF(op->payload->cancel_stream.cancel_error); - do { - cur = gpr_atm_acq_load(&calld->send_initial_metadata_state); - } while (!gpr_atm_rel_cas( - &calld->send_initial_metadata_state, cur, - CANCELLED_BIT | (gpr_atm)op->payload->cancel_stream.cancel_error)); - switch (cur) { - case HAS_COMPRESSION_ALGORITHM: - case NO_COMPRESSION_ALGORITHM: - case INITIAL_METADATA_UNSEEN: - break; - default: - if ((cur & CANCELLED_BIT) == 0) { - grpc_transport_stream_op_batch_finish_with_failure( - exec_ctx, (grpc_transport_stream_op_batch *)cur, - GRPC_ERROR_REF(op->payload->cancel_stream.cancel_error)); - } else { - GRPC_ERROR_UNREF((grpc_error *)(cur & ~CANCELLED_BIT)); - } - break; - } - } - if (op->send_initial_metadata) { - bool has_compression_algorithm; grpc_error *error = process_send_initial_metadata( exec_ctx, elem, - op->payload->send_initial_metadata.send_initial_metadata, - &has_compression_algorithm); + op->payload->send_initial_metadata.send_initial_metadata); if (error != GRPC_ERROR_NONE) { grpc_transport_stream_op_batch_finish_with_failure(exec_ctx, op, error); return; } - gpr_atm cur = gpr_atm_acq_load(&calld->send_initial_metadata_state); - GPR_ASSERT(cur != HAS_COMPRESSION_ALGORITHM && - cur != NO_COMPRESSION_ALGORITHM); - if ((cur & CANCELLED_BIT) == 0) { - gpr_atm_rel_store(&calld->send_initial_metadata_state, - has_compression_algorithm ? HAS_COMPRESSION_ALGORITHM - : NO_COMPRESSION_ALGORITHM); - if (cur != INITIAL_METADATA_UNSEEN) { - grpc_call_next_op(exec_ctx, elem, - (grpc_transport_stream_op_batch *)cur); - } - } } - if (op->send_message) { - gpr_atm cur; - retry_send: - cur = gpr_atm_acq_load(&calld->send_initial_metadata_state); - switch (cur) { - case INITIAL_METADATA_UNSEEN: - if (!gpr_atm_rel_cas(&calld->send_initial_metadata_state, cur, - (gpr_atm)op)) { - goto retry_send; - } - break; - case HAS_COMPRESSION_ALGORITHM: - case NO_COMPRESSION_ALGORITHM: - if (!skip_compression(elem, - op->payload->send_message.send_message->flags, - cur == HAS_COMPRESSION_ALGORITHM)) { - calld->send_op = op; - calld->send_length = op->payload->send_message.send_message->length; - calld->send_flags = op->payload->send_message.send_message->flags; - continue_send_message(exec_ctx, elem); - } else { - /* pass control down the stack */ - grpc_call_next_op(exec_ctx, elem, op); - } - break; - default: - if (cur & CANCELLED_BIT) { - grpc_transport_stream_op_batch_finish_with_failure( - exec_ctx, op, - GRPC_ERROR_REF((grpc_error *)(cur & ~CANCELLED_BIT))); - } else { - /* >1 send_message concurrently */ - GPR_UNREACHABLE_CODE(break); - } - } + if (op->send_message && + !skip_compression(elem, op->payload->send_message.send_message->flags)) { + calld->send_op = op; + calld->send_length = op->payload->send_message.send_message->length; + calld->send_flags = op->payload->send_message.send_message->flags; + continue_send_message(exec_ctx, elem); } else { /* pass control down the stack */ grpc_call_next_op(exec_ctx, elem, op); @@ -376,6 +282,7 @@ static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx, /* initialize members */ grpc_slice_buffer_init(&calld->slices); + calld->has_compression_algorithm = 0; grpc_closure_init(&calld->got_slice, got_slice, elem, grpc_schedule_on_exec_ctx); grpc_closure_init(&calld->send_done, send_done, elem, @@ -391,11 +298,6 @@ static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, /* grab pointers to our data from the call element */ call_data *calld = elem->call_data; grpc_slice_buffer_destroy_internal(exec_ctx, &calld->slices); - gpr_atm imstate = - gpr_atm_no_barrier_load(&calld->send_initial_metadata_state); - if (imstate & CANCELLED_BIT) { - GRPC_ERROR_UNREF((grpc_error *)(imstate & ~CANCELLED_BIT)); - } } /* Constructor for channel_data */ @@ -436,7 +338,7 @@ static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx, static void destroy_channel_elem(grpc_exec_ctx *exec_ctx, grpc_channel_element *elem) {} -const grpc_channel_filter grpc_message_compress_filter = { +const grpc_channel_filter grpc_compress_filter = { compress_start_transport_stream_op_batch, grpc_channel_next_op, sizeof(call_data), diff --git a/src/core/ext/filters/http/message_compress/message_compress_filter.h b/src/core/lib/channel/compress_filter.h similarity index 89% rename from src/core/ext/filters/http/message_compress/message_compress_filter.h rename to src/core/lib/channel/compress_filter.h index 75bfa17fba3..e4a2a829d59 100644 --- a/src/core/ext/filters/http/message_compress/message_compress_filter.h +++ b/src/core/lib/channel/compress_filter.h @@ -31,8 +31,8 @@ * */ -#ifndef GRPC_CORE_EXT_FILTERS_HTTP_MESSAGE_COMPRESS_MESSAGE_COMPRESS_FILTER_H -#define GRPC_CORE_EXT_FILTERS_HTTP_MESSAGE_COMPRESS_MESSAGE_COMPRESS_FILTER_H +#ifndef GRPC_CORE_LIB_CHANNEL_COMPRESS_FILTER_H +#define GRPC_CORE_LIB_CHANNEL_COMPRESS_FILTER_H #include @@ -62,7 +62,6 @@ extern int grpc_compression_trace; * aforementioned 'grpc-encoding' metadata value, data will pass through * uncompressed. */ -extern const grpc_channel_filter grpc_message_compress_filter; +extern const grpc_channel_filter grpc_compress_filter; -#endif /* GRPC_CORE_EXT_FILTERS_HTTP_MESSAGE_COMPRESS_MESSAGE_COMPRESS_FILTER_H \ - */ +#endif /* GRPC_CORE_LIB_CHANNEL_COMPRESS_FILTER_H */ diff --git a/src/core/lib/channel/context.h b/src/core/lib/channel/context.h index 6c931ad28ae..2c1174ce7a1 100644 --- a/src/core/lib/channel/context.h +++ b/src/core/lib/channel/context.h @@ -50,6 +50,9 @@ typedef enum { /// Reserved for traffic_class_context. GRPC_CONTEXT_TRAFFIC, + /// Costs for Load Reporting. + GRPC_CONTEXT_LR_COST, + GRPC_CONTEXT_COUNT } grpc_context_index; diff --git a/src/core/ext/filters/deadline/deadline_filter.c b/src/core/lib/channel/deadline_filter.c similarity index 90% rename from src/core/ext/filters/deadline/deadline_filter.c rename to src/core/lib/channel/deadline_filter.c index 2e03d16bf6d..fda099b0211 100644 --- a/src/core/ext/filters/deadline/deadline_filter.c +++ b/src/core/lib/channel/deadline_filter.c @@ -29,7 +29,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -#include "src/core/ext/filters/deadline/deadline_filter.h" +#include "src/core/lib/channel/deadline_filter.h" #include #include @@ -39,11 +39,9 @@ #include #include -#include "src/core/lib/channel/channel_stack_builder.h" #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/timer.h" #include "src/core/lib/slice/slice_internal.h" -#include "src/core/lib/surface/channel_init.h" // // grpc_deadline_state @@ -143,6 +141,18 @@ static void inject_on_complete_cb(grpc_deadline_state* deadline_state, op->on_complete = &deadline_state->on_complete; } +void grpc_deadline_state_init(grpc_exec_ctx* exec_ctx, grpc_call_element* elem, + grpc_call_stack* call_stack) { + grpc_deadline_state* deadline_state = elem->call_data; + deadline_state->call_stack = call_stack; +} + +void grpc_deadline_state_destroy(grpc_exec_ctx* exec_ctx, + grpc_call_element* elem) { + grpc_deadline_state* deadline_state = elem->call_data; + cancel_timer_if_needed(exec_ctx, deadline_state); +} + // Callback and associated state for starting the timer after call stack // initialization has been completed. struct start_timer_after_init_state { @@ -157,11 +167,8 @@ static void start_timer_after_init(grpc_exec_ctx* exec_ctx, void* arg, gpr_free(state); } -void grpc_deadline_state_init(grpc_exec_ctx* exec_ctx, grpc_call_element* elem, - grpc_call_stack* call_stack, - gpr_timespec deadline) { - grpc_deadline_state* deadline_state = elem->call_data; - deadline_state->call_stack = call_stack; +void grpc_deadline_state_start(grpc_exec_ctx* exec_ctx, grpc_call_element* elem, + gpr_timespec deadline) { // Deadline will always be infinite on servers, so the timer will only be // set on clients with a finite deadline. deadline = gpr_convert_clock_type(deadline, GPR_CLOCK_MONOTONIC); @@ -182,12 +189,6 @@ void grpc_deadline_state_init(grpc_exec_ctx* exec_ctx, grpc_call_element* elem, } } -void grpc_deadline_state_destroy(grpc_exec_ctx* exec_ctx, - grpc_call_element* elem) { - grpc_deadline_state* deadline_state = elem->call_data; - cancel_timer_if_needed(exec_ctx, deadline_state); -} - void grpc_deadline_state_reset(grpc_exec_ctx* exec_ctx, grpc_call_element* elem, gpr_timespec new_deadline) { grpc_deadline_state* deadline_state = elem->call_data; @@ -247,7 +248,8 @@ typedef struct server_call_data { static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx, grpc_call_element* elem, const grpc_call_element_args* args) { - grpc_deadline_state_init(exec_ctx, elem, args->call_stack, args->deadline); + grpc_deadline_state_init(exec_ctx, elem, args->call_stack); + grpc_deadline_state_start(exec_ctx, elem, args->deadline); return GRPC_ERROR_NONE; } @@ -344,30 +346,3 @@ const grpc_channel_filter grpc_server_deadline_filter = { grpc_channel_next_get_info, "deadline", }; - -bool grpc_deadline_checking_enabled(const grpc_channel_args* channel_args) { - return grpc_channel_arg_get_bool( - grpc_channel_args_find(channel_args, GRPC_ARG_ENABLE_DEADLINE_CHECKS), - !grpc_channel_args_want_minimal_stack(channel_args)); -} - -static bool maybe_add_deadline_filter(grpc_exec_ctx* exec_ctx, - grpc_channel_stack_builder* builder, - void* arg) { - return grpc_deadline_checking_enabled( - grpc_channel_stack_builder_get_channel_arguments(builder)) - ? grpc_channel_stack_builder_prepend_filter(builder, arg, NULL, - NULL) - : true; -} - -void grpc_deadline_filter_init(void) { - grpc_channel_init_register_stage( - GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, - maybe_add_deadline_filter, (void*)&grpc_client_deadline_filter); - grpc_channel_init_register_stage( - GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, - maybe_add_deadline_filter, (void*)&grpc_server_deadline_filter); -} - -void grpc_deadline_filter_shutdown(void) {} diff --git a/src/core/ext/filters/deadline/deadline_filter.h b/src/core/lib/channel/deadline_filter.h similarity index 89% rename from src/core/ext/filters/deadline/deadline_filter.h rename to src/core/lib/channel/deadline_filter.h index 5050453fa1a..d8db9a9f975 100644 --- a/src/core/ext/filters/deadline/deadline_filter.h +++ b/src/core/lib/channel/deadline_filter.h @@ -29,8 +29,8 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -#ifndef GRPC_CORE_EXT_FILTERS_DEADLINE_DEADLINE_FILTER_H -#define GRPC_CORE_EXT_FILTERS_DEADLINE_DEADLINE_FILTER_H +#ifndef GRPC_CORE_LIB_CHANNEL_DEADLINE_FILTER_H +#define GRPC_CORE_LIB_CHANNEL_DEADLINE_FILTER_H #include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/iomgr/timer.h" @@ -64,11 +64,15 @@ typedef struct grpc_deadline_state { // assumes elem->call_data is zero'd void grpc_deadline_state_init(grpc_exec_ctx* exec_ctx, grpc_call_element* elem, - grpc_call_stack* call_stack, - gpr_timespec deadline); + grpc_call_stack* call_stack); void grpc_deadline_state_destroy(grpc_exec_ctx* exec_ctx, grpc_call_element* elem); +// Starts the timer with the specified deadline. +// Should be called from the filter's init_call_elem() method. +void grpc_deadline_state_start(grpc_exec_ctx* exec_ctx, grpc_call_element* elem, + gpr_timespec deadline); + // Cancels the existing timer and starts a new one with new_deadline. // // Note: It is generally safe to call this with an earlier deadline @@ -89,13 +93,10 @@ void grpc_deadline_state_client_start_transport_stream_op_batch( grpc_exec_ctx* exec_ctx, grpc_call_element* elem, grpc_transport_stream_op_batch* op); -// Should deadline checking be performed (according to channel args) -bool grpc_deadline_checking_enabled(const grpc_channel_args* args); - // Deadline filters for direct client channels and server channels. // Note: Deadlines for non-direct client channels are handled by the // client_channel filter. extern const grpc_channel_filter grpc_client_deadline_filter; extern const grpc_channel_filter grpc_server_deadline_filter; -#endif /* GRPC_CORE_EXT_FILTERS_DEADLINE_DEADLINE_FILTER_H */ +#endif /* GRPC_CORE_LIB_CHANNEL_DEADLINE_FILTER_H */ diff --git a/src/core/ext/filters/http/client/http_client_filter.c b/src/core/lib/channel/http_client_filter.c similarity index 96% rename from src/core/ext/filters/http/client/http_client_filter.c rename to src/core/lib/channel/http_client_filter.c index bf5fbc7da7e..4e47c5c658f 100644 --- a/src/core/ext/filters/http/client/http_client_filter.c +++ b/src/core/lib/channel/http_client_filter.c @@ -30,7 +30,7 @@ * */ -#include "src/core/ext/filters/http/client/http_client_filter.h" +#include "src/core/lib/channel/http_client_filter.h" #include #include #include @@ -220,15 +220,10 @@ static void continue_send_message(grpc_exec_ctx *exec_ctx, call_data *calld = elem->call_data; uint8_t *wrptr = calld->payload_bytes; while (grpc_byte_stream_next( - exec_ctx, calld->send_op->payload->send_message.send_message, ~(size_t)0, - &calld->got_slice)) { - grpc_byte_stream_pull(exec_ctx, - calld->send_op->payload->send_message.send_message, - &calld->incoming_slice); - if (GRPC_SLICE_LENGTH(calld->incoming_slice) > 0) { - memcpy(wrptr, GRPC_SLICE_START_PTR(calld->incoming_slice), - GRPC_SLICE_LENGTH(calld->incoming_slice)); - } + exec_ctx, calld->send_op->payload->send_message.send_message, + &calld->incoming_slice, ~(size_t)0, &calld->got_slice)) { + memcpy(wrptr, GRPC_SLICE_START_PTR(calld->incoming_slice), + GRPC_SLICE_LENGTH(calld->incoming_slice)); wrptr += GRPC_SLICE_LENGTH(calld->incoming_slice); grpc_slice_buffer_add(&calld->slices, calld->incoming_slice); if (calld->send_length == calld->slices.length) { @@ -242,13 +237,6 @@ static void got_slice(grpc_exec_ctx *exec_ctx, void *elemp, grpc_error *error) { grpc_call_element *elem = elemp; call_data *calld = elem->call_data; calld->send_message_blocked = false; - if (GRPC_ERROR_NONE != - grpc_byte_stream_pull(exec_ctx, - calld->send_op->payload->send_message.send_message, - &calld->incoming_slice)) { - /* Should never reach here */ - abort(); - } grpc_slice_buffer_add(&calld->slices, calld->incoming_slice); if (calld->send_length == calld->slices.length) { /* Pass down the original send_message op that was blocked.*/ @@ -323,6 +311,7 @@ static grpc_error *hc_mutate_op(grpc_exec_ctx *exec_ctx, estimated_len += grpc_base64_estimate_encoded_size( op->payload->send_message.send_message->length, k_url_safe, k_multi_line); + estimated_len += 1; /* for the trailing 0 */ grpc_slice path_with_query_slice = grpc_slice_malloc(estimated_len); /* memcopy individual pieces into this slice */ @@ -343,8 +332,10 @@ static grpc_error *hc_mutate_op(grpc_exec_ctx *exec_ctx, */ char *t = (char *)GRPC_SLICE_START_PTR(path_with_query_slice); /* safe to use strlen since base64_encode will always add '\0' */ + size_t path_length = strlen(t) + 1; + *(t + path_length) = '\0'; path_with_query_slice = - grpc_slice_sub_no_ref(path_with_query_slice, 0, strlen(t)); + grpc_slice_sub(path_with_query_slice, 0, path_length); /* substitute previous path with the new path+query */ grpc_mdelem mdelem_path_and_query = grpc_mdelem_from_slices( @@ -358,6 +349,7 @@ static grpc_error *hc_mutate_op(grpc_exec_ctx *exec_ctx, calld->on_complete = op->on_complete; op->on_complete = &calld->hc_on_complete; op->send_message = false; + grpc_slice_unref_internal(exec_ctx, path_with_query_slice); } else { /* Not all data is available. Fall back to POST. */ gpr_log(GPR_DEBUG, diff --git a/src/core/ext/filters/http/client/http_client_filter.h b/src/core/lib/channel/http_client_filter.h similarity index 87% rename from src/core/ext/filters/http/client/http_client_filter.h rename to src/core/lib/channel/http_client_filter.h index 6e1eb3937ba..9e6e106e9cb 100644 --- a/src/core/ext/filters/http/client/http_client_filter.h +++ b/src/core/lib/channel/http_client_filter.h @@ -30,15 +30,18 @@ * */ -#ifndef GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_HTTP_CLIENT_FILTER_H -#define GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_HTTP_CLIENT_FILTER_H +#ifndef GRPC_CORE_LIB_CHANNEL_HTTP_CLIENT_FILTER_H +#define GRPC_CORE_LIB_CHANNEL_HTTP_CLIENT_FILTER_H #include "src/core/lib/channel/channel_stack.h" /* Processes metadata on the client side for HTTP2 transports */ extern const grpc_channel_filter grpc_http_client_filter; +/* Channel arg to override the http2 :scheme header */ +#define GRPC_ARG_HTTP2_SCHEME "grpc.http2_scheme" + /* Channel arg to determine maximum size of payload eligable for GET request */ #define GRPC_ARG_MAX_PAYLOAD_SIZE_FOR_GET "grpc.max_payload_size_for_get" -#endif /* GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_HTTP_CLIENT_FILTER_H */ +#endif /* GRPC_CORE_LIB_CHANNEL_HTTP_CLIENT_FILTER_H */ diff --git a/src/core/ext/filters/http/server/http_server_filter.c b/src/core/lib/channel/http_server_filter.c similarity index 98% rename from src/core/ext/filters/http/server/http_server_filter.c rename to src/core/lib/channel/http_server_filter.c index ff857878e46..c1e49ffacc8 100644 --- a/src/core/ext/filters/http/server/http_server_filter.c +++ b/src/core/lib/channel/http_server_filter.c @@ -31,7 +31,7 @@ * */ -#include "src/core/ext/filters/http/server/http_server_filter.h" +#include "src/core/lib/channel/http_server_filter.h" #include #include @@ -240,9 +240,9 @@ static grpc_error *server_filter_incoming_metadata(grpc_exec_ctx *exec_ctx, const int k_url_safe = 1; grpc_slice_buffer_add( &calld->read_slice_buffer, - grpc_base64_decode_with_len( - exec_ctx, (const char *)GRPC_SLICE_START_PTR(query_slice), - GRPC_SLICE_LENGTH(query_slice), k_url_safe)); + grpc_base64_decode(exec_ctx, + (const char *)GRPC_SLICE_START_PTR(query_slice), + k_url_safe)); grpc_slice_buffer_stream_init(&calld->read_stream, &calld->read_slice_buffer, 0); calld->seen_path_with_query = true; diff --git a/src/core/ext/filters/http/server/http_server_filter.h b/src/core/lib/channel/http_server_filter.h similarity index 89% rename from src/core/ext/filters/http/server/http_server_filter.h rename to src/core/lib/channel/http_server_filter.h index 8a2b2196ae1..77ba2d263d1 100644 --- a/src/core/ext/filters/http/server/http_server_filter.h +++ b/src/core/lib/channel/http_server_filter.h @@ -31,12 +31,12 @@ * */ -#ifndef GRPC_CORE_EXT_FILTERS_HTTP_SERVER_HTTP_SERVER_FILTER_H -#define GRPC_CORE_EXT_FILTERS_HTTP_SERVER_HTTP_SERVER_FILTER_H +#ifndef GRPC_CORE_LIB_CHANNEL_HTTP_SERVER_FILTER_H +#define GRPC_CORE_LIB_CHANNEL_HTTP_SERVER_FILTER_H #include "src/core/lib/channel/channel_stack.h" /* Processes metadata on the client side for HTTP2 transports */ extern const grpc_channel_filter grpc_http_server_filter; -#endif /* GRPC_CORE_EXT_FILTERS_HTTP_SERVER_HTTP_SERVER_FILTER_H */ +#endif /* GRPC_CORE_LIB_CHANNEL_HTTP_SERVER_FILTER_H */ diff --git a/src/core/ext/filters/message_size/message_size_filter.c b/src/core/lib/channel/message_size_filter.c similarity index 70% rename from src/core/ext/filters/message_size/message_size_filter.c rename to src/core/lib/channel/message_size_filter.c index b615116965f..c80b48ee132 100644 --- a/src/core/ext/filters/message_size/message_size_filter.c +++ b/src/core/lib/channel/message_size_filter.c @@ -29,7 +29,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -#include "src/core/ext/filters/message_size/message_size_filter.h" +#include "src/core/lib/channel/message_size_filter.h" #include #include @@ -40,9 +40,7 @@ #include #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/channel/channel_stack_builder.h" #include "src/core/lib/support/string.h" -#include "src/core/lib/surface/channel_init.h" #include "src/core/lib/transport/service_config.h" typedef struct message_size_limits { @@ -50,10 +48,19 @@ typedef struct message_size_limits { int max_recv_size; } message_size_limits; +static void* message_size_limits_copy(void* value) { + void* new_value = gpr_malloc(sizeof(message_size_limits)); + memcpy(new_value, value, sizeof(message_size_limits)); + return new_value; +} + static void message_size_limits_free(grpc_exec_ctx* exec_ctx, void* value) { gpr_free(value); } +static const grpc_slice_hash_table_vtable message_size_limits_vtable = { + message_size_limits_free, message_size_limits_copy}; + static void* message_size_limits_create_from_json(const grpc_json* json) { int max_request_message_bytes = -1; int max_response_message_bytes = -1; @@ -82,7 +89,8 @@ static void* message_size_limits_create_from_json(const grpc_json* json) { } typedef struct call_data { - message_size_limits limits; + int max_send_size; + int max_recv_size; // Receive closures are chained: we inject this closure as the // recv_message_ready up-call on transport_stream_op, and remember to // call our next_recv_message_ready member after handling it. @@ -94,7 +102,8 @@ typedef struct call_data { } call_data; typedef struct channel_data { - message_size_limits limits; + int max_send_size; + int max_recv_size; // Maps path names to message_size_limits structs. grpc_slice_hash_table* method_limit_table; } channel_data; @@ -105,12 +114,12 @@ static void recv_message_ready(grpc_exec_ctx* exec_ctx, void* user_data, grpc_error* error) { grpc_call_element* elem = user_data; call_data* calld = elem->call_data; - if (*calld->recv_message != NULL && calld->limits.max_recv_size >= 0 && - (*calld->recv_message)->length > (size_t)calld->limits.max_recv_size) { + if (*calld->recv_message != NULL && calld->max_recv_size >= 0 && + (*calld->recv_message)->length > (size_t)calld->max_recv_size) { char* message_string; gpr_asprintf(&message_string, "Received message larger than max (%u vs. %d)", - (*calld->recv_message)->length, calld->limits.max_recv_size); + (*calld->recv_message)->length, calld->max_recv_size); grpc_error* new_error = grpc_error_set_int( GRPC_ERROR_CREATE_FROM_COPIED_STRING(message_string), GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_RESOURCE_EXHAUSTED); @@ -121,8 +130,6 @@ static void recv_message_ready(grpc_exec_ctx* exec_ctx, void* user_data, GRPC_ERROR_UNREF(new_error); } gpr_free(message_string); - } else { - GRPC_ERROR_REF(error); } // Invoke the next callback. grpc_closure_run(exec_ctx, calld->next_recv_message_ready, error); @@ -134,13 +141,13 @@ static void start_transport_stream_op_batch( grpc_transport_stream_op_batch* op) { call_data* calld = elem->call_data; // Check max send message size. - if (op->send_message && calld->limits.max_send_size >= 0 && + if (op->send_message && calld->max_send_size >= 0 && op->payload->send_message.send_message->length > - (size_t)calld->limits.max_send_size) { + (size_t)calld->max_send_size) { char* message_string; gpr_asprintf(&message_string, "Sent message larger than max (%u vs. %d)", op->payload->send_message.send_message->length, - calld->limits.max_send_size); + calld->max_send_size); grpc_transport_stream_op_batch_finish_with_failure( exec_ctx, op, grpc_error_set_int(GRPC_ERROR_CREATE_FROM_COPIED_STRING(message_string), @@ -173,20 +180,21 @@ static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx, // Note: Per-method config is only available on the client, so we // apply the max request size to the send limit and the max response // size to the receive limit. - calld->limits = chand->limits; + calld->max_send_size = chand->max_send_size; + calld->max_recv_size = chand->max_recv_size; if (chand->method_limit_table != NULL) { message_size_limits* limits = grpc_method_config_table_get( exec_ctx, chand->method_limit_table, args->path); if (limits != NULL) { if (limits->max_send_size >= 0 && - (limits->max_send_size < calld->limits.max_send_size || - calld->limits.max_send_size < 0)) { - calld->limits.max_send_size = limits->max_send_size; + (limits->max_send_size < calld->max_send_size || + calld->max_send_size < 0)) { + calld->max_send_size = limits->max_send_size; } if (limits->max_recv_size >= 0 && - (limits->max_recv_size < calld->limits.max_recv_size || - calld->limits.max_recv_size < 0)) { - calld->limits.max_recv_size = limits->max_recv_size; + (limits->max_recv_size < calld->max_recv_size || + calld->max_recv_size < 0)) { + calld->max_recv_size = limits->max_recv_size; } } } @@ -198,45 +206,30 @@ static void destroy_call_elem(grpc_exec_ctx* exec_ctx, grpc_call_element* elem, const grpc_call_final_info* final_info, grpc_closure* ignored) {} -static int default_size(const grpc_channel_args* args, - int without_minimal_stack) { - if (grpc_channel_args_want_minimal_stack(args)) { - return -1; - } - return without_minimal_stack; -} - -message_size_limits get_message_size_limits( - const grpc_channel_args* channel_args) { - message_size_limits lim; - lim.max_send_size = - default_size(channel_args, GRPC_DEFAULT_MAX_SEND_MESSAGE_LENGTH); - lim.max_recv_size = - default_size(channel_args, GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH); - for (size_t i = 0; i < channel_args->num_args; ++i) { - if (strcmp(channel_args->args[i].key, GRPC_ARG_MAX_SEND_MESSAGE_LENGTH) == - 0) { - const grpc_integer_options options = {lim.max_send_size, -1, INT_MAX}; - lim.max_send_size = - grpc_channel_arg_get_integer(&channel_args->args[i], options); - } - if (strcmp(channel_args->args[i].key, - GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH) == 0) { - const grpc_integer_options options = {lim.max_recv_size, -1, INT_MAX}; - lim.max_recv_size = - grpc_channel_arg_get_integer(&channel_args->args[i], options); - } - } - return lim; -} - // Constructor for channel_data. static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx, grpc_channel_element* elem, grpc_channel_element_args* args) { GPR_ASSERT(!args->is_last); channel_data* chand = elem->channel_data; - chand->limits = get_message_size_limits(args->channel_args); + chand->max_send_size = GRPC_DEFAULT_MAX_SEND_MESSAGE_LENGTH; + chand->max_recv_size = GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH; + for (size_t i = 0; i < args->channel_args->num_args; ++i) { + if (strcmp(args->channel_args->args[i].key, + GRPC_ARG_MAX_SEND_MESSAGE_LENGTH) == 0) { + const grpc_integer_options options = { + GRPC_DEFAULT_MAX_SEND_MESSAGE_LENGTH, -1, INT_MAX}; + chand->max_send_size = + grpc_channel_arg_get_integer(&args->channel_args->args[i], options); + } + if (strcmp(args->channel_args->args[i].key, + GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH) == 0) { + const grpc_integer_options options = { + GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH, -1, INT_MAX}; + chand->max_recv_size = + grpc_channel_arg_get_integer(&args->channel_args->args[i], options); + } + } // Get method config table from channel args. const grpc_arg* channel_arg = grpc_channel_args_find(args->channel_args, GRPC_ARG_SERVICE_CONFIG); @@ -248,7 +241,7 @@ static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx, chand->method_limit_table = grpc_service_config_create_method_config_table( exec_ctx, service_config, message_size_limits_create_from_json, - message_size_limits_free); + &message_size_limits_vtable); grpc_service_config_destroy(service_config); } } @@ -275,40 +268,3 @@ const grpc_channel_filter grpc_message_size_filter = { grpc_call_next_get_peer, grpc_channel_next_get_info, "message_size"}; - -static bool maybe_add_message_size_filter(grpc_exec_ctx* exec_ctx, - grpc_channel_stack_builder* builder, - void* arg) { - const grpc_channel_args* channel_args = - grpc_channel_stack_builder_get_channel_arguments(builder); - bool enable = false; - message_size_limits lim = get_message_size_limits(channel_args); - if (lim.max_send_size != -1 || lim.max_recv_size != -1) { - enable = true; - } - const grpc_arg* a = - grpc_channel_args_find(channel_args, GRPC_ARG_SERVICE_CONFIG); - if (a != NULL) { - enable = true; - } - if (enable) { - return grpc_channel_stack_builder_prepend_filter( - builder, &grpc_message_size_filter, NULL, NULL); - } else { - return true; - } -} - -void grpc_message_size_filter_init(void) { - grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL, - GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, - maybe_add_message_size_filter, NULL); - grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL, - GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, - maybe_add_message_size_filter, NULL); - grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL, - GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, - maybe_add_message_size_filter, NULL); -} - -void grpc_message_size_filter_shutdown(void) {} diff --git a/src/core/ext/filters/message_size/message_size_filter.h b/src/core/lib/channel/message_size_filter.h similarity index 89% rename from src/core/ext/filters/message_size/message_size_filter.h rename to src/core/lib/channel/message_size_filter.h index 83980e738cb..a88ff7f81a1 100644 --- a/src/core/ext/filters/message_size/message_size_filter.h +++ b/src/core/lib/channel/message_size_filter.h @@ -29,11 +29,11 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -#ifndef GRPC_CORE_EXT_FILTERS_MESSAGE_SIZE_MESSAGE_SIZE_FILTER_H -#define GRPC_CORE_EXT_FILTERS_MESSAGE_SIZE_MESSAGE_SIZE_FILTER_H +#ifndef GRPC_CORE_LIB_CHANNEL_MESSAGE_SIZE_FILTER_H +#define GRPC_CORE_LIB_CHANNEL_MESSAGE_SIZE_FILTER_H #include "src/core/lib/channel/channel_stack.h" extern const grpc_channel_filter grpc_message_size_filter; -#endif /* GRPC_CORE_EXT_FILTERS_MESSAGE_SIZE_MESSAGE_SIZE_FILTER_H */ +#endif /* GRPC_CORE_LIB_CHANNEL_MESSAGE_SIZE_FILTER_H */ diff --git a/src/core/lib/iomgr/error.c b/src/core/lib/iomgr/error.c index 5f2c989aad0..fbbca6b4939 100644 --- a/src/core/lib/iomgr/error.c +++ b/src/core/lib/iomgr/error.c @@ -217,14 +217,8 @@ static uint8_t get_placement(grpc_error **err, size_t size) { if ((*err)->arena_size + slots > (*err)->arena_capacity) { return UINT8_MAX; } -#ifdef GRPC_ERROR_REFCOUNT_DEBUG - grpc_error *orig = *err; -#endif *err = gpr_realloc( *err, sizeof(grpc_error) + (*err)->arena_capacity * sizeof(intptr_t)); -#ifdef GRPC_ERROR_REFCOUNT_DEBUG - if (*err != orig) gpr_log(GPR_DEBUG, "realloc %p -> %p", orig, *err); -#endif } uint8_t placement = (*err)->arena_size; (*err)->arena_size = (uint8_t)((*err)->arena_size + slots); @@ -319,7 +313,7 @@ static void internal_add_error(grpc_error **err, grpc_error *new) { // It is very common to include and extra int and string in an error #define SURPLUS_CAPACITY (2 * SLOTS_PER_INT + SLOTS_PER_TIME) -grpc_error *grpc_error_create(const char *file, int line, grpc_slice desc, +grpc_error *grpc_error_create(grpc_slice file, int line, grpc_slice desc, grpc_error **referencing, size_t num_referencing) { GPR_TIMER_BEGIN("grpc_error_create", 0); @@ -345,8 +339,7 @@ grpc_error *grpc_error_create(const char *file, int line, grpc_slice desc, memset(err->times, UINT8_MAX, GRPC_ERROR_TIME_MAX); internal_set_int(&err, GRPC_ERROR_INT_FILE_LINE, line); - internal_set_str(&err, GRPC_ERROR_STR_FILE, - grpc_slice_from_static_string(file)); + internal_set_str(&err, GRPC_ERROR_STR_FILE, file); internal_set_str(&err, GRPC_ERROR_STR_DESCRIPTION, desc); for (size_t i = 0; i < num_referencing; ++i) { @@ -763,7 +756,7 @@ grpc_error *grpc_os_error(const char *file, int line, int err, return grpc_error_set_str( grpc_error_set_str( grpc_error_set_int( - grpc_error_create(file, line, + grpc_error_create(grpc_slice_from_static_string(file), line, grpc_slice_from_static_string("OS Error"), NULL, 0), GRPC_ERROR_INT_ERRNO, err), @@ -779,7 +772,7 @@ grpc_error *grpc_wsa_error(const char *file, int line, int err, grpc_error *error = grpc_error_set_str( grpc_error_set_str( grpc_error_set_int( - grpc_error_create(file, line, + grpc_error_create(grpc_slice_from_static_string(file), line, grpc_slice_from_static_string("OS Error"), NULL, 0), GRPC_ERROR_INT_WSA_ERROR, err), diff --git a/src/core/lib/iomgr/error.h b/src/core/lib/iomgr/error.h index 34b24d92638..2a44fcfe25e 100644 --- a/src/core/lib/iomgr/error.h +++ b/src/core/lib/iomgr/error.h @@ -138,7 +138,7 @@ typedef enum { const char *grpc_error_string(grpc_error *error); /// Create an error - but use GRPC_ERROR_CREATE instead -grpc_error *grpc_error_create(const char *file, int line, grpc_slice desc, +grpc_error *grpc_error_create(grpc_slice file, int line, grpc_slice desc, grpc_error **referencing, size_t num_referencing); /// Create an error (this is the preferred way of generating an error that is /// not due to a system call - for system calls, use GRPC_OS_ERROR or @@ -148,21 +148,21 @@ grpc_error *grpc_error_create(const char *file, int line, grpc_slice desc, /// err = grpc_error_create(x, y, z, r, nr) is equivalent to: /// err = grpc_error_create(x, y, z, NULL, 0); /// for (i=0; iserver_mu); - grpc_fd_shutdown(exec_ctx, shutdown_args->fd, GRPC_ERROR_REF(error)); - gpr_mu_unlock(shutdown_args->server_mu); - gpr_free(shutdown_args); -} - -static void dummy_cb(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { - // No-op. -} - static void finish_shutdown(grpc_exec_ctx *exec_ctx, grpc_udp_server *s) { if (s->shutdown_complete != NULL) { grpc_closure_sched(exec_ctx, s->shutdown_complete, GRPC_ERROR_NONE); @@ -218,16 +195,12 @@ static void deactivated_all_ports(grpc_exec_ctx *exec_ctx, grpc_udp_server *s) { grpc_closure_init(&sp->destroyed_closure, destroyed_port, s, grpc_schedule_on_exec_ctx); - if (!sp->orphan_notified) { - /* Call the orphan_cb to signal that the FD is about to be closed and - * should no longer be used. Because at this point, all listening ports - * have been shutdown already, no need to shutdown again.*/ - grpc_closure_init(&sp->orphan_fd_closure, dummy_cb, sp->emfd, - grpc_schedule_on_exec_ctx); - GPR_ASSERT(sp->orphan_cb); - sp->orphan_cb(exec_ctx, sp->emfd, &sp->orphan_fd_closure, - sp->server->user_data); - } + + /* Call the orphan_cb to signal that the FD is about to be closed and + * should no longer be used. */ + GPR_ASSERT(sp->orphan_cb); + sp->orphan_cb(exec_ctx, sp->emfd, sp->server->user_data); + grpc_fd_orphan(exec_ctx, sp->emfd, &sp->destroyed_closure, NULL, "udp_listener_shutdown"); } @@ -252,14 +225,9 @@ void grpc_udp_server_destroy(grpc_exec_ctx *exec_ctx, grpc_udp_server *s, if (s->active_ports) { for (sp = s->head; sp; sp = sp->next) { GPR_ASSERT(sp->orphan_cb); - struct shutdown_fd_args *args = gpr_malloc(sizeof(*args)); - args->fd = sp->emfd; - args->server_mu = &s->mu; - grpc_closure_init(&sp->orphan_fd_closure, shutdown_fd, args, - grpc_schedule_on_exec_ctx); - sp->orphan_cb(exec_ctx, sp->emfd, &sp->orphan_fd_closure, - sp->server->user_data); - sp->orphan_notified = true; + sp->orphan_cb(exec_ctx, sp->emfd, sp->server->user_data); + grpc_fd_shutdown(exec_ctx, sp->emfd, GRPC_ERROR_CREATE_FROM_STATIC_STRING( + "Server destroyed")); } gpr_mu_unlock(&s->mu); } else { @@ -423,7 +391,6 @@ static int add_socket_to_server(grpc_udp_server *s, int fd, sp->read_cb = read_cb; sp->write_cb = write_cb; sp->orphan_cb = orphan_cb; - sp->orphan_notified = false; GPR_ASSERT(sp->emfd); gpr_mu_unlock(&s->mu); gpr_free(name); diff --git a/src/core/lib/iomgr/udp_server.h b/src/core/lib/iomgr/udp_server.h index 8006037644d..9df3fe4d1f0 100644 --- a/src/core/lib/iomgr/udp_server.h +++ b/src/core/lib/iomgr/udp_server.h @@ -55,9 +55,7 @@ typedef void (*grpc_udp_server_write_cb)(grpc_exec_ctx *exec_ctx, grpc_fd *emfd, /* Called when the grpc_fd is about to be orphaned (and the FD closed). */ typedef void (*grpc_udp_server_orphan_cb)(grpc_exec_ctx *exec_ctx, - grpc_fd *emfd, - grpc_closure *shutdown_fd_callback, - void *user_data); + grpc_fd *emfd, void *user_data); /* Create a server, initially not bound to any ports */ grpc_udp_server *grpc_udp_server_create(const grpc_channel_args *args); diff --git a/src/core/lib/security/credentials/credentials.c b/src/core/lib/security/credentials/credentials.c index d89da47fc15..52b80141d11 100644 --- a/src/core/lib/security/credentials/credentials.c +++ b/src/core/lib/security/credentials/credentials.c @@ -37,6 +37,7 @@ #include #include "src/core/lib/channel/channel_args.h" +#include "src/core/lib/channel/http_client_filter.h" #include "src/core/lib/http/httpcli.h" #include "src/core/lib/http/parser.h" #include "src/core/lib/iomgr/executor.h" diff --git a/src/core/lib/security/credentials/fake/fake_credentials.c b/src/core/lib/security/credentials/fake/fake_credentials.c index 3fdb67fb912..68636ba2088 100644 --- a/src/core/lib/security/credentials/fake/fake_credentials.c +++ b/src/core/lib/security/credentials/fake/fake_credentials.c @@ -39,15 +39,11 @@ #include #include -#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/iomgr/executor.h" #include "src/core/lib/support/string.h" /* -- Fake transport security credentials. -- */ -#define GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS \ - "grpc.fake_security.expected_targets" - static grpc_security_status fake_transport_security_create_security_connector( grpc_exec_ctx *exec_ctx, grpc_channel_credentials *c, grpc_call_credentials *call_creds, const char *target, @@ -92,25 +88,6 @@ grpc_server_credentials *grpc_fake_transport_security_server_credentials_create( return c; } -grpc_arg grpc_fake_transport_expected_targets_arg(char *expected_targets) { - grpc_arg arg; - arg.type = GRPC_ARG_STRING; - arg.key = GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS; - arg.value.string = expected_targets; - return arg; -} - -const char *grpc_fake_transport_get_expected_targets( - const grpc_channel_args *args) { - const grpc_arg *expected_target_arg = - grpc_channel_args_find(args, GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS); - if (expected_target_arg != NULL && - expected_target_arg->type == GRPC_ARG_STRING) { - return expected_target_arg->value.string; - } - return NULL; -} - /* -- Metadata-only test credentials. -- */ static void md_only_test_destruct(grpc_exec_ctx *exec_ctx, diff --git a/src/core/lib/security/credentials/fake/fake_credentials.h b/src/core/lib/security/credentials/fake/fake_credentials.h index a28b545a676..0fe98417c6c 100644 --- a/src/core/lib/security/credentials/fake/fake_credentials.h +++ b/src/core/lib/security/credentials/fake/fake_credentials.h @@ -38,17 +38,10 @@ /* -- Fake transport security credentials. -- */ -/* Creates a fake transport security credentials object for testing. */ -grpc_channel_credentials *grpc_fake_transport_security_credentials_create(void); - -/* Creates a fake server transport security credentials object for testing. */ -grpc_server_credentials *grpc_fake_transport_security_server_credentials_create( - void); - /* Used to verify the target names given to the fake transport security * connector. * - * The syntax of \a expected_targets by example: + * Its syntax by example: * For LB channels: * "backend_target_1,backend_target_2,...;lb_target_1,lb_target_2,..." * For regular channels: @@ -57,11 +50,15 @@ grpc_server_credentials *grpc_fake_transport_security_server_credentials_create( * That is to say, LB channels have a heading list of LB targets separated from * the list of backend targets by a semicolon. For non-LB channels, only the * latter is present. */ -grpc_arg grpc_fake_transport_expected_targets_arg(char *expected_targets); +#define GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS \ + "grpc.test_only.fake_security.expected_target" -/* Return the value associated with the expected targets channel arg or NULL */ -const char *grpc_fake_transport_get_expected_targets( - const grpc_channel_args *args); +/* Creates a fake transport security credentials object for testing. */ +grpc_channel_credentials *grpc_fake_transport_security_credentials_create(void); + +/* Creates a fake server transport security credentials object for testing. */ +grpc_server_credentials *grpc_fake_transport_security_server_credentials_create( + void); /* -- Metadata-only Test credentials. -- */ diff --git a/src/core/lib/security/credentials/ssl/ssl_credentials.c b/src/core/lib/security/credentials/ssl/ssl_credentials.c index b63bb6b6e9e..4b17ac80983 100644 --- a/src/core/lib/security/credentials/ssl/ssl_credentials.c +++ b/src/core/lib/security/credentials/ssl/ssl_credentials.c @@ -36,6 +36,7 @@ #include #include "src/core/lib/channel/channel_args.h" +#include "src/core/lib/channel/http_client_filter.h" #include "src/core/lib/surface/api_trace.h" #include diff --git a/src/core/lib/security/transport/security_connector.c b/src/core/lib/security/transport/security_connector.c index b15196e6770..dbe3263f92a 100644 --- a/src/core/lib/security/transport/security_connector.c +++ b/src/core/lib/security/transport/security_connector.c @@ -423,8 +423,12 @@ grpc_channel_security_connector *grpc_fake_channel_security_connector_create( c->base.check_call_host = fake_channel_check_call_host; c->base.add_handshakers = fake_channel_add_handshakers; c->target = gpr_strdup(target); - const char *expected_targets = grpc_fake_transport_get_expected_targets(args); - c->expected_targets = gpr_strdup(expected_targets); + const grpc_arg *expected_target_arg = + grpc_channel_args_find(args, GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS); + if (expected_target_arg != NULL) { + GPR_ASSERT(expected_target_arg->type == GRPC_ARG_STRING); + c->expected_targets = gpr_strdup(expected_target_arg->value.string); + } c->is_lb_channel = (grpc_lb_targets_info_find_in_args(args) != NULL); return &c->base; } diff --git a/src/core/lib/slice/slice_hash_table.c b/src/core/lib/slice/slice_hash_table.c index 444f22aa196..219567f36f8 100644 --- a/src/core/lib/slice/slice_hash_table.c +++ b/src/core/lib/slice/slice_hash_table.c @@ -42,47 +42,56 @@ struct grpc_slice_hash_table { gpr_refcount refs; - void (*destroy_value)(grpc_exec_ctx* exec_ctx, void* value); size_t size; - size_t max_num_probes; grpc_slice_hash_table_entry* entries; }; static bool is_empty(grpc_slice_hash_table_entry* entry) { - return entry->value == NULL; + return entry->vtable == NULL; } -static void grpc_slice_hash_table_add(grpc_slice_hash_table* table, - grpc_slice key, void* value) { - GPR_ASSERT(value != NULL); - const size_t hash = grpc_slice_hash(key); - for (size_t offset = 0; offset < table->size; ++offset) { - const size_t idx = (hash + offset) % table->size; +// Helper function for insert and get operations that performs quadratic +// probing (https://en.wikipedia.org/wiki/Quadratic_probing). +static size_t grpc_slice_hash_table_find_index( + const grpc_slice_hash_table* table, const grpc_slice key, bool find_empty) { + size_t hash = grpc_slice_hash(key); + for (size_t i = 0; i < table->size; ++i) { + const size_t idx = (hash + i * i) % table->size; if (is_empty(&table->entries[idx])) { - table->entries[idx].key = key; - table->entries[idx].value = value; - // Keep track of the maximum number of probes needed, since this - // provides an upper bound for lookups. - if (offset > table->max_num_probes) table->max_num_probes = offset; - return; + return find_empty ? idx : table->size; + } + if (grpc_slice_eq(table->entries[idx].key, key)) { + return idx; } } - GPR_ASSERT(false); // Table should never be full. + return table->size; // Not found. +} + +static void grpc_slice_hash_table_add( + grpc_slice_hash_table* table, grpc_slice key, void* value, + const grpc_slice_hash_table_vtable* vtable) { + GPR_ASSERT(value != NULL); + const size_t idx = + grpc_slice_hash_table_find_index(table, key, true /* find_empty */); + GPR_ASSERT(idx != table->size); // Table should never be full. + grpc_slice_hash_table_entry* entry = &table->entries[idx]; + entry->key = grpc_slice_ref_internal(key); + entry->value = vtable->copy_value(value); + entry->vtable = vtable; } grpc_slice_hash_table* grpc_slice_hash_table_create( - size_t num_entries, grpc_slice_hash_table_entry* entries, - void (*destroy_value)(grpc_exec_ctx* exec_ctx, void* value)) { + size_t num_entries, grpc_slice_hash_table_entry* entries) { grpc_slice_hash_table* table = gpr_zalloc(sizeof(*table)); gpr_ref_init(&table->refs, 1); - table->destroy_value = destroy_value; - // Keep load factor low to improve performance of lookups. + // Quadratic probing gets best performance when the table is no more + // than half full. table->size = num_entries * 2; const size_t entry_size = sizeof(grpc_slice_hash_table_entry) * table->size; table->entries = gpr_zalloc(entry_size); for (size_t i = 0; i < num_entries; ++i) { grpc_slice_hash_table_entry* entry = &entries[i]; - grpc_slice_hash_table_add(table, entry->key, entry->value); + grpc_slice_hash_table_add(table, entry->key, entry->value, entry->vtable); } return table; } @@ -99,7 +108,7 @@ void grpc_slice_hash_table_unref(grpc_exec_ctx* exec_ctx, grpc_slice_hash_table_entry* entry = &table->entries[i]; if (!is_empty(entry)) { grpc_slice_unref_internal(exec_ctx, entry->key); - table->destroy_value(exec_ctx, entry->value); + entry->vtable->destroy_value(exec_ctx, entry->value); } } gpr_free(table->entries); @@ -109,15 +118,8 @@ void grpc_slice_hash_table_unref(grpc_exec_ctx* exec_ctx, void* grpc_slice_hash_table_get(const grpc_slice_hash_table* table, const grpc_slice key) { - const size_t hash = grpc_slice_hash(key); - // We cap the number of probes at the max number recorded when - // populating the table. - for (size_t offset = 0; offset <= table->max_num_probes; ++offset) { - const size_t idx = (hash + offset) % table->size; - if (is_empty(&table->entries[idx])) break; - if (grpc_slice_eq(table->entries[idx].key, key)) { - return table->entries[idx].value; - } - } - return NULL; // Not found. + const size_t idx = + grpc_slice_hash_table_find_index(table, key, false /* find_empty */); + if (idx == table->size) return NULL; // Not found. + return table->entries[idx].value; } diff --git a/src/core/lib/slice/slice_hash_table.h b/src/core/lib/slice/slice_hash_table.h index 1e61c5eb116..d0c27122d7f 100644 --- a/src/core/lib/slice/slice_hash_table.h +++ b/src/core/lib/slice/slice_hash_table.h @@ -37,28 +37,33 @@ /** Hash table implementation. * * This implementation uses open addressing - * (https://en.wikipedia.org/wiki/Open_addressing) with linear - * probing (https://en.wikipedia.org/wiki/Linear_probing). + * (https://en.wikipedia.org/wiki/Open_addressing) with quadratic + * probing (https://en.wikipedia.org/wiki/Quadratic_probing). * * The keys are \a grpc_slice objects. The values are arbitrary pointers - * with a common destroy function. + * with a common vtable. * * Hash tables are intentionally immutable, to avoid the need for locking. */ typedef struct grpc_slice_hash_table grpc_slice_hash_table; +typedef struct grpc_slice_hash_table_vtable { + void (*destroy_value)(grpc_exec_ctx *exec_ctx, void *value); + void *(*copy_value)(void *value); +} grpc_slice_hash_table_vtable; + typedef struct grpc_slice_hash_table_entry { grpc_slice key; void *value; /* Must not be NULL. */ + const grpc_slice_hash_table_vtable *vtable; } grpc_slice_hash_table_entry; /** Creates a new hash table of containing \a entries, which is an array - of length \a num_entries. Takes ownership of all keys and values in - \a entries. Values will be cleaned up via \a destroy_value(). */ + of length \a num_entries. + Creates its own copy of all keys and values from \a entries. */ grpc_slice_hash_table *grpc_slice_hash_table_create( - size_t num_entries, grpc_slice_hash_table_entry *entries, - void (*destroy_value)(grpc_exec_ctx *exec_ctx, void *value)); + size_t num_entries, grpc_slice_hash_table_entry *entries); grpc_slice_hash_table *grpc_slice_hash_table_ref(grpc_slice_hash_table *table); void grpc_slice_hash_table_unref(grpc_exec_ctx *exec_ctx, diff --git a/src/core/lib/support/stack_lockfree.c b/src/core/lib/support/stack_lockfree.c index dfbd3fb1251..9d7c9e5a381 100644 --- a/src/core/lib/support/stack_lockfree.c +++ b/src/core/lib/support/stack_lockfree.c @@ -72,20 +72,28 @@ typedef union lockfree_node { struct gpr_stack_lockfree { lockfree_node *entries; lockfree_node head; /* An atomic entry describing curr head */ + +#ifndef NDEBUG + /* Bitmap of pushed entries to check for double-push or pop */ + gpr_atm pushed[(INVALID_ENTRY_INDEX + 1) / (8 * sizeof(gpr_atm))]; +#endif }; gpr_stack_lockfree *gpr_stack_lockfree_create(size_t entries) { gpr_stack_lockfree *stack; - stack = (gpr_stack_lockfree *)gpr_malloc(sizeof(*stack)); + stack = gpr_malloc(sizeof(*stack)); /* Since we only allocate 16 bits to represent an entry number, * make sure that we are within the desired range */ /* Reserve the highest entry number as a dummy */ GPR_ASSERT(entries < INVALID_ENTRY_INDEX); - stack->entries = (lockfree_node *)gpr_malloc_aligned( - entries * sizeof(stack->entries[0]), ENTRY_ALIGNMENT_BITS); + stack->entries = gpr_malloc_aligned(entries * sizeof(stack->entries[0]), + ENTRY_ALIGNMENT_BITS); /* Clear out all entries */ memset(stack->entries, 0, entries * sizeof(stack->entries[0])); memset(&stack->head, 0, sizeof(stack->head)); +#ifndef NDEBUG + memset(&stack->pushed, 0, sizeof(stack->pushed)); +#endif GPR_ASSERT(sizeof(stack->entries->atm) == sizeof(stack->entries->contents)); @@ -122,6 +130,19 @@ int gpr_stack_lockfree_push(gpr_stack_lockfree *stack, int entry) { newhead.contents.aba_ctr = ++curent.contents.aba_ctr; gpr_atm_no_barrier_store(&stack->entries[entry].atm, curent.atm); +#ifndef NDEBUG + /* Check for double push */ + { + int pushed_index = entry / (int)(8 * sizeof(gpr_atm)); + int pushed_bit = entry % (int)(8 * sizeof(gpr_atm)); + gpr_atm old_val; + + old_val = gpr_atm_no_barrier_fetch_add(&stack->pushed[pushed_index], + ((gpr_atm)1 << pushed_bit)); + GPR_ASSERT((old_val & (((gpr_atm)1) << pushed_bit)) == 0); + } +#endif + do { /* Atomically get the existing head value for use */ head.atm = gpr_atm_no_barrier_load(&(stack->head.atm)); @@ -147,6 +168,18 @@ int gpr_stack_lockfree_pop(gpr_stack_lockfree *stack) { gpr_atm_no_barrier_load(&(stack->entries[head.contents.index].atm)); } while (!gpr_atm_no_barrier_cas(&(stack->head.atm), head.atm, newhead.atm)); +#ifndef NDEBUG + /* Check for valid pop */ + { + int pushed_index = head.contents.index / (8 * sizeof(gpr_atm)); + int pushed_bit = head.contents.index % (8 * sizeof(gpr_atm)); + gpr_atm old_val; + + old_val = gpr_atm_no_barrier_fetch_add(&stack->pushed[pushed_index], + -((gpr_atm)1 << pushed_bit)); + GPR_ASSERT((old_val & (((gpr_atm)1) << pushed_bit)) != 0); + } +#endif return head.contents.index; } diff --git a/src/core/lib/support/time_posix.c b/src/core/lib/support/time_posix.c index 9bfec7782a2..a69c501e9fb 100644 --- a/src/core/lib/support/time_posix.c +++ b/src/core/lib/support/time_posix.c @@ -42,7 +42,6 @@ #ifdef __linux__ #include #endif -#include #include #include #include "src/core/lib/support/block_annotate.h" @@ -145,14 +144,7 @@ static gpr_timespec now_impl(gpr_clock_type clock) { gpr_timespec (*gpr_now_impl)(gpr_clock_type clock_type) = now_impl; -#ifdef GPR_LOW_LEVEL_COUNTERS -gpr_atm gpr_now_call_count; -#endif - gpr_timespec gpr_now(gpr_clock_type clock_type) { -#ifdef GPR_LOW_LEVEL_COUNTERS - __atomic_fetch_add(&gpr_now_call_count, 1, __ATOMIC_RELAXED); -#endif return gpr_now_impl(clock_type); } diff --git a/src/core/lib/support/tmpfile_posix.c b/src/core/lib/support/tmpfile_posix.c index 5771c158e07..0cd4bb6fc3c 100644 --- a/src/core/lib/support/tmpfile_posix.c +++ b/src/core/lib/support/tmpfile_posix.c @@ -50,34 +50,34 @@ FILE *gpr_tmpfile(const char *prefix, char **tmp_filename) { FILE *result = NULL; - char *filename_template; + char *template; int fd; if (tmp_filename != NULL) *tmp_filename = NULL; - gpr_asprintf(&filename_template, "/tmp/%s_XXXXXX", prefix); - GPR_ASSERT(filename_template != NULL); + gpr_asprintf(&template, "/tmp/%s_XXXXXX", prefix); + GPR_ASSERT(template != NULL); - fd = mkstemp(filename_template); + fd = mkstemp(template); if (fd == -1) { - gpr_log(GPR_ERROR, "mkstemp failed for filename_template %s with error %s.", - filename_template, strerror(errno)); + gpr_log(GPR_ERROR, "mkstemp failed for template %s with error %s.", + template, strerror(errno)); goto end; } result = fdopen(fd, "w+"); if (result == NULL) { gpr_log(GPR_ERROR, "Could not open file %s from fd %d (error = %s).", - filename_template, fd, strerror(errno)); - unlink(filename_template); + template, fd, strerror(errno)); + unlink(template); close(fd); goto end; } end: if (result != NULL && tmp_filename != NULL) { - *tmp_filename = filename_template; + *tmp_filename = template; } else { - gpr_free(filename_template); + gpr_free(template); } return result; } diff --git a/src/core/lib/surface/call.c b/src/core/lib/surface/call.c index 75258065830..97d50a91be5 100644 --- a/src/core/lib/surface/call.c +++ b/src/core/lib/surface/call.c @@ -160,7 +160,6 @@ typedef struct { } child_call; struct grpc_call { - gpr_refcount ext_ref; gpr_arena *arena; grpc_completion_queue *cq; grpc_polling_entity pollent; @@ -171,7 +170,7 @@ struct grpc_call { /* client or server call */ bool is_client; - /** has grpc_call_unref been called */ + /** has grpc_call_destroy been called */ bool destroy_called; /** flag indicating that cancellation is inherited */ bool cancellation_is_inherited; @@ -245,7 +244,6 @@ struct grpc_call { }; int grpc_call_error_trace = 0; -int grpc_compression_trace = 0; #define CALL_STACK_FROM_CALL(call) ((grpc_call_stack *)((call) + 1)) #define CALL_FROM_CALL_STACK(call_stack) (((grpc_call *)(call_stack)) - 1) @@ -284,10 +282,6 @@ static void add_init_error(grpc_error **composite, grpc_error *new) { *composite = grpc_error_add_child(*composite, new); } -void *grpc_call_arena_alloc(grpc_call *call, size_t size) { - return gpr_arena_alloc(call->arena, size); -} - static parent_call *get_or_create_parent_call(grpc_call *call) { parent_call *p = (parent_call *)gpr_atm_acq_load(&call->parent_call_atm); if (p == NULL) { @@ -318,7 +312,6 @@ grpc_error *grpc_call_create(grpc_exec_ctx *exec_ctx, gpr_arena_create(grpc_channel_get_call_size_estimate(args->channel)); call = gpr_arena_alloc(arena, sizeof(grpc_call) + channel_stack->call_stack_size); - gpr_ref_init(&call->ext_ref, 1); call->arena = arena; *out_call = call; call->channel = args->channel; @@ -353,8 +346,6 @@ grpc_error *grpc_call_create(grpc_exec_ctx *exec_ctx, gpr_timespec send_deadline = gpr_convert_clock_type(args->send_deadline, GPR_CLOCK_MONOTONIC); - bool immediately_cancel = false; - if (args->parent_call != NULL) { child_call *cc = call->child_call = gpr_arena_alloc(arena, sizeof(child_call)); @@ -395,7 +386,8 @@ grpc_error *grpc_call_create(grpc_exec_ctx *exec_ctx, if (args->propagation_mask & GRPC_PROPAGATE_CANCELLATION) { call->cancellation_is_inherited = 1; if (gpr_atm_acq_load(&args->parent_call->received_final_op_atm)) { - immediately_cancel = true; + cancel_with_error(exec_ctx, call, STATUS_FROM_API_OVERRIDE, + GRPC_ERROR_CANCELLED); } } @@ -415,7 +407,7 @@ grpc_error *grpc_call_create(grpc_exec_ctx *exec_ctx, call->send_deadline = send_deadline; GRPC_CHANNEL_INTERNAL_REF(args->channel, "call"); - /* initial refcount dropped by grpc_call_unref */ + /* initial refcount dropped by grpc_call_destroy */ grpc_call_element_args call_args = { .call_stack = CALL_STACK_FROM_CALL(call), .server_transport_data = args->server_transport_data, @@ -430,10 +422,6 @@ grpc_error *grpc_call_create(grpc_exec_ctx *exec_ctx, cancel_with_error(exec_ctx, call, STATUS_FROM_SURFACE, GRPC_ERROR_REF(error)); } - if (immediately_cancel) { - cancel_with_error(exec_ctx, call, STATUS_FROM_API_OVERRIDE, - GRPC_ERROR_CANCELLED); - } if (args->cq != NULL) { GPR_ASSERT( args->pollset_set_alternative == NULL && @@ -540,16 +528,12 @@ static void destroy_call(grpc_exec_ctx *exec_ctx, void *call, GPR_TIMER_END("destroy_call", 0); } -void grpc_call_ref(grpc_call *c) { gpr_ref(&c->ext_ref); } - -void grpc_call_unref(grpc_call *c) { - if (!gpr_unref(&c->ext_ref)) return; - +void grpc_call_destroy(grpc_call *c) { child_call *cc = c->child_call; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - GPR_TIMER_BEGIN("grpc_call_unref", 0); - GRPC_API_TRACE("grpc_call_unref(c=%p)", 1, (c)); + GPR_TIMER_BEGIN("grpc_call_destroy", 0); + GRPC_API_TRACE("grpc_call_destroy(c=%p)", 1, (c)); if (cc) { parent_call *pc = get_parent_call(cc->parent); @@ -576,7 +560,7 @@ void grpc_call_unref(grpc_call *c) { } GRPC_CALL_INTERNAL_UNREF(&exec_ctx, c, "destroy"); grpc_exec_ctx_finish(&exec_ctx); - GPR_TIMER_END("grpc_call_unref", 0); + GPR_TIMER_END("grpc_call_destroy", 0); } grpc_call_error grpc_call_cancel(grpc_call *call, void *reserved) { @@ -1203,7 +1187,6 @@ static void finish_batch_step(grpc_exec_ctx *exec_ctx, batch_control *bctl) { static void continue_receiving_slices(grpc_exec_ctx *exec_ctx, batch_control *bctl) { - grpc_error *error; grpc_call *call = bctl->call; for (;;) { size_t remaining = call->receiving_stream->length - @@ -1215,22 +1198,11 @@ static void continue_receiving_slices(grpc_exec_ctx *exec_ctx, finish_batch_step(exec_ctx, bctl); return; } - if (grpc_byte_stream_next(exec_ctx, call->receiving_stream, remaining, + if (grpc_byte_stream_next(exec_ctx, call->receiving_stream, + &call->receiving_slice, remaining, &call->receiving_slice_ready)) { - error = grpc_byte_stream_pull(exec_ctx, call->receiving_stream, - &call->receiving_slice); - if (error == GRPC_ERROR_NONE) { - grpc_slice_buffer_add(&(*call->receiving_buffer)->data.raw.slice_buffer, - call->receiving_slice); - } else { - grpc_byte_stream_destroy(exec_ctx, call->receiving_stream); - call->receiving_stream = NULL; - grpc_byte_buffer_destroy(*call->receiving_buffer); - *call->receiving_buffer = NULL; - call->receiving_message = 0; - finish_batch_step(exec_ctx, bctl); - return; - } + grpc_slice_buffer_add(&(*call->receiving_buffer)->data.raw.slice_buffer, + call->receiving_slice); } else { return; } @@ -1241,24 +1213,12 @@ static void receiving_slice_ready(grpc_exec_ctx *exec_ctx, void *bctlp, grpc_error *error) { batch_control *bctl = bctlp; grpc_call *call = bctl->call; - grpc_byte_stream *bs = call->receiving_stream; - bool release_error = false; if (error == GRPC_ERROR_NONE) { - grpc_slice slice; - error = grpc_byte_stream_pull(exec_ctx, bs, &slice); - if (error == GRPC_ERROR_NONE) { - grpc_slice_buffer_add(&(*call->receiving_buffer)->data.raw.slice_buffer, - slice); - continue_receiving_slices(exec_ctx, bctl); - } else { - /* Error returned by grpc_byte_stream_pull needs to be released manually - */ - release_error = true; - } - } - - if (error != GRPC_ERROR_NONE) { + grpc_slice_buffer_add(&(*call->receiving_buffer)->data.raw.slice_buffer, + call->receiving_slice); + continue_receiving_slices(exec_ctx, bctl); + } else { if (grpc_trace_operation_failures) { GRPC_LOG_IF_ERROR("receiving_slice_ready", GRPC_ERROR_REF(error)); } @@ -1266,11 +1226,7 @@ static void receiving_slice_ready(grpc_exec_ctx *exec_ctx, void *bctlp, call->receiving_stream = NULL; grpc_byte_buffer_destroy(*call->receiving_buffer); *call->receiving_buffer = NULL; - call->receiving_message = 0; finish_batch_step(exec_ctx, bctl); - if (release_error) { - GRPC_ERROR_UNREF(error); - } } } diff --git a/src/core/lib/surface/channel_init.c b/src/core/lib/surface/channel_init.c index 20f57530049..7acb444d9b1 100644 --- a/src/core/lib/surface/channel_init.c +++ b/src/core/lib/surface/channel_init.c @@ -104,13 +104,30 @@ void grpc_channel_init_shutdown(void) { } } +static const char *name_for_type(grpc_channel_stack_type type) { + switch (type) { + case GRPC_CLIENT_CHANNEL: + return "CLIENT_CHANNEL"; + case GRPC_CLIENT_SUBCHANNEL: + return "CLIENT_SUBCHANNEL"; + case GRPC_SERVER_CHANNEL: + return "SERVER_CHANNEL"; + case GRPC_CLIENT_LAME_CHANNEL: + return "CLIENT_LAME_CHANNEL"; + case GRPC_CLIENT_DIRECT_CHANNEL: + return "CLIENT_DIRECT_CHANNEL"; + case GRPC_NUM_CHANNEL_STACK_TYPES: + break; + } + GPR_UNREACHABLE_CODE(return "UNKNOWN"); +} + bool grpc_channel_init_create_stack(grpc_exec_ctx *exec_ctx, grpc_channel_stack_builder *builder, grpc_channel_stack_type type) { GPR_ASSERT(g_finalized); - grpc_channel_stack_builder_set_name(builder, - grpc_channel_stack_type_string(type)); + grpc_channel_stack_builder_set_name(builder, name_for_type(type)); for (size_t i = 0; i < g_slots[type].num_slots; i++) { const stage_slot *slot = &g_slots[type].slots[i]; diff --git a/src/core/lib/surface/channel_stack_type.c b/src/core/lib/surface/channel_stack_type.c index ed3b53fb36e..c35d603ca3a 100644 --- a/src/core/lib/surface/channel_stack_type.c +++ b/src/core/lib/surface/channel_stack_type.c @@ -52,21 +52,3 @@ bool grpc_channel_stack_type_is_client(grpc_channel_stack_type type) { } GPR_UNREACHABLE_CODE(return true;); } - -const char *grpc_channel_stack_type_string(grpc_channel_stack_type type) { - switch (type) { - case GRPC_CLIENT_CHANNEL: - return "CLIENT_CHANNEL"; - case GRPC_CLIENT_SUBCHANNEL: - return "CLIENT_SUBCHANNEL"; - case GRPC_SERVER_CHANNEL: - return "SERVER_CHANNEL"; - case GRPC_CLIENT_LAME_CHANNEL: - return "CLIENT_LAME_CHANNEL"; - case GRPC_CLIENT_DIRECT_CHANNEL: - return "CLIENT_DIRECT_CHANNEL"; - case GRPC_NUM_CHANNEL_STACK_TYPES: - break; - } - GPR_UNREACHABLE_CODE(return "UNKNOWN"); -} diff --git a/src/core/lib/surface/channel_stack_type.h b/src/core/lib/surface/channel_stack_type.h index ccf4e53d277..4eea4f1b016 100644 --- a/src/core/lib/surface/channel_stack_type.h +++ b/src/core/lib/surface/channel_stack_type.h @@ -55,6 +55,4 @@ typedef enum { bool grpc_channel_stack_type_is_client(grpc_channel_stack_type type); -const char *grpc_channel_stack_type_string(grpc_channel_stack_type type); - #endif /* GRPC_CORE_LIB_SURFACE_CHANNEL_STACK_TYPE_H */ diff --git a/src/core/lib/surface/completion_queue.c b/src/core/lib/surface/completion_queue.c index eae3f103b12..3273addf1d0 100644 --- a/src/core/lib/surface/completion_queue.c +++ b/src/core/lib/surface/completion_queue.c @@ -60,155 +60,10 @@ typedef struct { void *tag; } plucker; -typedef struct { - bool can_get_pollset; - bool can_listen; - size_t (*size)(void); - void (*init)(grpc_pollset *pollset, gpr_mu **mu); - grpc_error *(*kick)(grpc_pollset *pollset, - grpc_pollset_worker *specific_worker); - grpc_error *(*work)(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset, - grpc_pollset_worker **worker, gpr_timespec now, - gpr_timespec deadline); - void (*shutdown)(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset, - grpc_closure *closure); - void (*destroy)(grpc_pollset *pollset); -} cq_poller_vtable; - -typedef struct non_polling_worker { - gpr_cv cv; - bool kicked; - struct non_polling_worker *next; - struct non_polling_worker *prev; -} non_polling_worker; - -typedef struct { - gpr_mu mu; - non_polling_worker *root; - grpc_closure *shutdown; -} non_polling_poller; - -static size_t non_polling_poller_size(void) { - return sizeof(non_polling_poller); -} - -static void non_polling_poller_init(grpc_pollset *pollset, gpr_mu **mu) { - non_polling_poller *npp = (non_polling_poller *)pollset; - gpr_mu_init(&npp->mu); - *mu = &npp->mu; -} - -static void non_polling_poller_destroy(grpc_pollset *pollset) { - non_polling_poller *npp = (non_polling_poller *)pollset; - gpr_mu_destroy(&npp->mu); -} - -static grpc_error *non_polling_poller_work(grpc_exec_ctx *exec_ctx, - grpc_pollset *pollset, - grpc_pollset_worker **worker, - gpr_timespec now, - gpr_timespec deadline) { - non_polling_poller *npp = (non_polling_poller *)pollset; - if (npp->shutdown) return GRPC_ERROR_NONE; - non_polling_worker w; - gpr_cv_init(&w.cv); - if (worker != NULL) *worker = (grpc_pollset_worker *)&w; - if (npp->root == NULL) { - npp->root = w.next = w.prev = &w; - } else { - w.next = npp->root; - w.prev = w.next->prev; - w.next->prev = w.prev->next = &w; - } - w.kicked = false; - while (!npp->shutdown && !w.kicked && !gpr_cv_wait(&w.cv, &npp->mu, deadline)) - ; - if (&w == npp->root) { - npp->root = w.next; - if (&w == npp->root) { - if (npp->shutdown) { - grpc_closure_sched(exec_ctx, npp->shutdown, GRPC_ERROR_NONE); - } - npp->root = NULL; - } - } - w.next->prev = w.prev; - w.prev->next = w.next; - gpr_cv_destroy(&w.cv); - if (worker != NULL) *worker = NULL; - return GRPC_ERROR_NONE; -} - -static grpc_error *non_polling_poller_kick( - grpc_pollset *pollset, grpc_pollset_worker *specific_worker) { - non_polling_poller *p = (non_polling_poller *)pollset; - if (specific_worker == NULL) specific_worker = (grpc_pollset_worker *)p->root; - if (specific_worker != NULL) { - non_polling_worker *w = (non_polling_worker *)specific_worker; - if (!w->kicked) { - w->kicked = true; - gpr_cv_signal(&w->cv); - } - } - return GRPC_ERROR_NONE; -} - -static void non_polling_poller_shutdown(grpc_exec_ctx *exec_ctx, - grpc_pollset *pollset, - grpc_closure *closure) { - non_polling_poller *p = (non_polling_poller *)pollset; - GPR_ASSERT(closure != NULL); - p->shutdown = closure; - if (p->root == NULL) { - grpc_closure_sched(exec_ctx, closure, GRPC_ERROR_NONE); - } else { - non_polling_worker *w = p->root; - do { - gpr_cv_signal(&w->cv); - w = w->next; - } while (w != p->root); - } -} - -static const cq_poller_vtable g_poller_vtable_by_poller_type[] = { - /* GRPC_CQ_DEFAULT_POLLING */ - {.can_get_pollset = true, - .can_listen = true, - .size = grpc_pollset_size, - .init = grpc_pollset_init, - .kick = grpc_pollset_kick, - .work = grpc_pollset_work, - .shutdown = grpc_pollset_shutdown, - .destroy = grpc_pollset_destroy}, - /* GRPC_CQ_NON_LISTENING */ - {.can_get_pollset = true, - .can_listen = false, - .size = grpc_pollset_size, - .init = grpc_pollset_init, - .kick = grpc_pollset_kick, - .work = grpc_pollset_work, - .shutdown = grpc_pollset_shutdown, - .destroy = grpc_pollset_destroy}, - /* GRPC_CQ_NON_POLLING */ - {.can_get_pollset = false, - .can_listen = false, - .size = non_polling_poller_size, - .init = non_polling_poller_init, - .kick = non_polling_poller_kick, - .work = non_polling_poller_work, - .shutdown = non_polling_poller_shutdown, - .destroy = non_polling_poller_destroy}, -}; - /* Completion queue structure */ struct grpc_completion_queue { /** owned by pollset */ gpr_mu *mu; - - grpc_cq_completion_type completion_type; - - const cq_poller_vtable *poller_vtable; - /** completed events */ grpc_cq_completion completed_head; grpc_cq_completion *completed_tail; @@ -224,7 +79,6 @@ struct grpc_completion_queue { int shutdown_called; int is_server_cq; /** Can the server cq accept incoming channels */ - /* TODO: sreek - This will no longer be needed. Use polling_type set */ int is_non_listening_server_cq; int num_pluckers; plucker pluckers[GRPC_MAX_COMPLETION_QUEUE_PLUCKERS]; @@ -256,31 +110,21 @@ int grpc_cq_event_timeout_trace; static void on_pollset_shutdown_done(grpc_exec_ctx *exec_ctx, void *cc, grpc_error *error); -grpc_completion_queue *grpc_completion_queue_create_internal( - grpc_cq_completion_type completion_type, - grpc_cq_polling_type polling_type) { +grpc_completion_queue *grpc_completion_queue_create(void *reserved) { grpc_completion_queue *cc; + GPR_ASSERT(!reserved); - GPR_TIMER_BEGIN("grpc_completion_queue_create_internal", 0); - - GRPC_API_TRACE( - "grpc_completion_queue_create_internal(completion_type=%d, " - "polling_type=%d)", - 2, (completion_type, polling_type)); + GPR_TIMER_BEGIN("grpc_completion_queue_create", 0); - const cq_poller_vtable *poller_vtable = - &g_poller_vtable_by_poller_type[polling_type]; + GRPC_API_TRACE("grpc_completion_queue_create(reserved=%p)", 1, (reserved)); - cc = gpr_zalloc(sizeof(grpc_completion_queue) + poller_vtable->size()); - poller_vtable->init(POLLSET_FROM_CQ(cc), &cc->mu); + cc = gpr_zalloc(sizeof(grpc_completion_queue) + grpc_pollset_size()); + grpc_pollset_init(POLLSET_FROM_CQ(cc), &cc->mu); #ifndef NDEBUG cc->outstanding_tags = NULL; cc->outstanding_tag_capacity = 0; #endif - cc->completion_type = completion_type; - cc->poller_vtable = poller_vtable; - /* Initial ref is dropped by grpc_completion_queue_shutdown */ gpr_ref_init(&cc->pending_events, 1); /* One for destroy(), one for pollset_shutdown */ @@ -299,15 +143,11 @@ grpc_completion_queue *grpc_completion_queue_create_internal( grpc_closure_init(&cc->pollset_shutdown_done, on_pollset_shutdown_done, cc, grpc_schedule_on_exec_ctx); - GPR_TIMER_END("grpc_completion_queue_create_internal", 0); + GPR_TIMER_END("grpc_completion_queue_create", 0); return cc; } -grpc_cq_completion_type grpc_get_cq_completion_type(grpc_completion_queue *cc) { - return cc->completion_type; -} - #ifdef GRPC_CQ_REF_COUNT_DEBUG void grpc_cq_internal_ref(grpc_completion_queue *cc, const char *reason, const char *file, int line) { @@ -335,7 +175,7 @@ void grpc_cq_internal_unref(grpc_completion_queue *cc) { #endif if (gpr_unref(&cc->owning_refs)) { GPR_ASSERT(cc->completed_head.next == (uintptr_t)&cc->completed_head); - cc->poller_vtable->destroy(POLLSET_FROM_CQ(cc)); + grpc_pollset_destroy(POLLSET_FROM_CQ(cc)); #ifndef NDEBUG gpr_free(cc->outstanding_tags); #endif @@ -420,7 +260,7 @@ void grpc_cq_end_op(grpc_exec_ctx *exec_ctx, grpc_completion_queue *cc, } } grpc_error *kick_error = - cc->poller_vtable->kick(POLLSET_FROM_CQ(cc), pluck_worker); + grpc_pollset_kick(POLLSET_FROM_CQ(cc), pluck_worker); gpr_mu_unlock(cc->mu); if (kick_error != GRPC_ERROR_NONE) { const char *msg = grpc_error_string(kick_error); @@ -435,8 +275,8 @@ void grpc_cq_end_op(grpc_exec_ctx *exec_ctx, grpc_completion_queue *cc, GPR_ASSERT(!cc->shutdown); GPR_ASSERT(cc->shutdown_called); cc->shutdown = 1; - cc->poller_vtable->shutdown(exec_ctx, POLLSET_FROM_CQ(cc), - &cc->pollset_shutdown_done); + grpc_pollset_shutdown(exec_ctx, POLLSET_FROM_CQ(cc), + &cc->pollset_shutdown_done); gpr_mu_unlock(cc->mu); } @@ -507,13 +347,6 @@ grpc_event grpc_completion_queue_next(grpc_completion_queue *cc, grpc_event ret; gpr_timespec now; - if (cc->completion_type != GRPC_CQ_NEXT) { - gpr_log(GPR_ERROR, - "grpc_completion_queue_next() cannot be called on this completion " - "queue since its completion type is not GRPC_CQ_NEXT"); - abort(); - } - GPR_TIMER_BEGIN("grpc_completion_queue_next", 0); GRPC_API_TRACE( @@ -592,8 +425,8 @@ grpc_event grpc_completion_queue_next(grpc_completion_queue *cc, gpr_mu_lock(cc->mu); continue; } else { - grpc_error *err = cc->poller_vtable->work(&exec_ctx, POLLSET_FROM_CQ(cc), - NULL, now, iteration_deadline); + grpc_error *err = grpc_pollset_work(&exec_ctx, POLLSET_FROM_CQ(cc), NULL, + now, iteration_deadline); if (err != GRPC_ERROR_NONE) { gpr_mu_unlock(cc->mu); const char *msg = grpc_error_string(err); @@ -683,13 +516,6 @@ grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cc, void *tag, GPR_TIMER_BEGIN("grpc_completion_queue_pluck", 0); - if (cc->completion_type != GRPC_CQ_PLUCK) { - gpr_log(GPR_ERROR, - "grpc_completion_queue_pluck() cannot be called on this completion " - "queue since its completion type is not GRPC_CQ_PLUCK"); - abort(); - } - if (grpc_cq_pluck_trace) { GRPC_API_TRACE( "grpc_completion_queue_pluck(" @@ -784,8 +610,8 @@ grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cc, void *tag, grpc_exec_ctx_flush(&exec_ctx); gpr_mu_lock(cc->mu); } else { - grpc_error *err = cc->poller_vtable->work( - &exec_ctx, POLLSET_FROM_CQ(cc), &worker, now, iteration_deadline); + grpc_error *err = grpc_pollset_work(&exec_ctx, POLLSET_FROM_CQ(cc), + &worker, now, iteration_deadline); if (err != GRPC_ERROR_NONE) { del_plucker(cc, tag, &worker); gpr_mu_unlock(cc->mu); @@ -829,8 +655,8 @@ void grpc_completion_queue_shutdown(grpc_completion_queue *cc) { if (gpr_unref(&cc->pending_events)) { GPR_ASSERT(!cc->shutdown); cc->shutdown = 1; - cc->poller_vtable->shutdown(&exec_ctx, POLLSET_FROM_CQ(cc), - &cc->pollset_shutdown_done); + grpc_pollset_shutdown(&exec_ctx, POLLSET_FROM_CQ(cc), + &cc->pollset_shutdown_done); } gpr_mu_unlock(cc->mu); grpc_exec_ctx_finish(&exec_ctx); @@ -846,7 +672,7 @@ void grpc_completion_queue_destroy(grpc_completion_queue *cc) { } grpc_pollset *grpc_cq_pollset(grpc_completion_queue *cc) { - return cc->poller_vtable->can_get_pollset ? POLLSET_FROM_CQ(cc) : NULL; + return POLLSET_FROM_CQ(cc); } grpc_completion_queue *grpc_cq_from_pollset(grpc_pollset *ps) { @@ -854,23 +680,13 @@ grpc_completion_queue *grpc_cq_from_pollset(grpc_pollset *ps) { } void grpc_cq_mark_non_listening_server_cq(grpc_completion_queue *cc) { - /* TODO: sreek - use cc->polling_type field here and add a validation check - (i.e grpc_cq_mark_non_listening_server_cq can only be called on a cc whose - polling_type is set to GRPC_CQ_NON_LISTENING */ cc->is_non_listening_server_cq = 1; } bool grpc_cq_is_non_listening_server_cq(grpc_completion_queue *cc) { - /* TODO (sreek) - return (cc->polling_type == GRPC_CQ_NON_LISTENING) */ return (cc->is_non_listening_server_cq == 1); } void grpc_cq_mark_server_cq(grpc_completion_queue *cc) { cc->is_server_cq = 1; } -bool grpc_cq_is_server_cq(grpc_completion_queue *cc) { - return cc->is_server_cq; -} - -bool grpc_cq_can_listen(grpc_completion_queue *cc) { - return cc->poller_vtable->can_listen; -} +int grpc_cq_is_server_cq(grpc_completion_queue *cc) { return cc->is_server_cq; } diff --git a/src/core/lib/surface/completion_queue.h b/src/core/lib/surface/completion_queue.h index a932087939d..5d73dd7216e 100644 --- a/src/core/lib/surface/completion_queue.h +++ b/src/core/lib/surface/completion_queue.h @@ -94,13 +94,9 @@ void grpc_cq_end_op(grpc_exec_ctx *exec_ctx, grpc_completion_queue *cc, grpc_pollset *grpc_cq_pollset(grpc_completion_queue *cc); grpc_completion_queue *grpc_cq_from_pollset(grpc_pollset *ps); +void grpc_cq_mark_non_listening_server_cq(grpc_completion_queue *cc); +bool grpc_cq_is_non_listening_server_cq(grpc_completion_queue *cc); void grpc_cq_mark_server_cq(grpc_completion_queue *cc); -bool grpc_cq_is_server_cq(grpc_completion_queue *cc); -bool grpc_cq_can_listen(grpc_completion_queue *cc); - -grpc_cq_completion_type grpc_get_cq_completion_type(grpc_completion_queue *cc); - -grpc_completion_queue *grpc_completion_queue_create_internal( - grpc_cq_completion_type completion_type, grpc_cq_polling_type polling_type); +int grpc_cq_is_server_cq(grpc_completion_queue *cc); #endif /* GRPC_CORE_LIB_SURFACE_COMPLETION_QUEUE_H */ diff --git a/src/core/lib/surface/completion_queue_factory.c b/src/core/lib/surface/completion_queue_factory.c index d68b84eddd3..db67a5192be 100644 --- a/src/core/lib/surface/completion_queue_factory.c +++ b/src/core/lib/surface/completion_queue_factory.c @@ -36,15 +36,12 @@ #include -/* - * == Default completion queue factory implementation == - */ - +/* TODO (sreek) - Currently this does not use the attributes arg. This will be + added in a future PR */ static grpc_completion_queue* default_create( const grpc_completion_queue_factory* factory, - const grpc_completion_queue_attributes* attr) { - return grpc_completion_queue_create_internal(attr->cq_completion_type, - attr->cq_polling_type); + const grpc_completion_queue_attributes* attributes) { + return grpc_completion_queue_create(NULL); } static grpc_completion_queue_factory_vtable default_vtable = {default_create}; @@ -52,24 +49,19 @@ static grpc_completion_queue_factory_vtable default_vtable = {default_create}; static const grpc_completion_queue_factory g_default_cq_factory = { "Default Factory", NULL, &default_vtable}; -/* - * == Completion queue factory APIs - */ - const grpc_completion_queue_factory* grpc_completion_queue_factory_lookup( const grpc_completion_queue_attributes* attributes) { - GPR_ASSERT(attributes->version >= 1 && - attributes->version <= GRPC_CQ_CURRENT_VERSION); + /* As we add more fields to grpc_completion_queue_attributes, we may have to + change this assert to: + GPR_ASSERT (attributes->version >= 1 && + attributes->version <= GRPC_CQ_CURRENT_VERSION) */ + GPR_ASSERT(attributes->version == 1); /* The default factory can handle version 1 of the attributes structure. We may have to change this as more fields are added to the structure */ return &g_default_cq_factory; } -/* - * == Completion queue creation APIs == - */ - grpc_completion_queue* grpc_completion_queue_create_for_next(void* reserved) { GPR_ASSERT(!reserved); grpc_completion_queue_attributes attr = {1, GRPC_CQ_NEXT, @@ -83,10 +75,3 @@ grpc_completion_queue* grpc_completion_queue_create_for_pluck(void* reserved) { GRPC_CQ_DEFAULT_POLLING}; return g_default_cq_factory.vtable->create(&g_default_cq_factory, &attr); } - -grpc_completion_queue* grpc_completion_queue_create( - const grpc_completion_queue_factory* factory, - const grpc_completion_queue_attributes* attr, void* reserved) { - GPR_ASSERT(!reserved); - return factory->vtable->create(factory, attr); -} diff --git a/src/core/lib/surface/init.c b/src/core/lib/surface/init.c index 4b381b19546..91bd014a0e5 100644 --- a/src/core/lib/surface/init.c +++ b/src/core/lib/surface/init.c @@ -41,8 +41,13 @@ #include #include #include "src/core/lib/channel/channel_stack.h" +#include "src/core/lib/channel/compress_filter.h" #include "src/core/lib/channel/connected_channel.h" +#include "src/core/lib/channel/deadline_filter.h" #include "src/core/lib/channel/handshaker_registry.h" +#include "src/core/lib/channel/http_client_filter.h" +#include "src/core/lib/channel/http_server_filter.h" +#include "src/core/lib/channel/message_size_filter.h" #include "src/core/lib/debug/trace.h" #include "src/core/lib/http/parser.h" #include "src/core/lib/iomgr/combiner.h" @@ -90,13 +95,57 @@ static bool prepend_filter(grpc_exec_ctx *exec_ctx, builder, (const grpc_channel_filter *)arg, NULL, NULL); } +static bool maybe_add_http_filter(grpc_exec_ctx *exec_ctx, + grpc_channel_stack_builder *builder, + void *arg) { + grpc_transport *t = grpc_channel_stack_builder_get_transport(builder); + if (t && strstr(t->vtable->name, "http")) { + return grpc_channel_stack_builder_prepend_filter( + builder, (const grpc_channel_filter *)arg, NULL, NULL); + } + return true; +} + static void register_builtin_channel_init() { + grpc_channel_init_register_stage( + GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, + prepend_filter, (void *)&grpc_client_deadline_filter); + grpc_channel_init_register_stage( + GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, prepend_filter, + (void *)&grpc_server_deadline_filter); + grpc_channel_init_register_stage( + GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, + prepend_filter, (void *)&grpc_message_size_filter); + grpc_channel_init_register_stage( + GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, + prepend_filter, (void *)&grpc_message_size_filter); + grpc_channel_init_register_stage( + GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, prepend_filter, + (void *)&grpc_message_size_filter); + grpc_channel_init_register_stage( + GRPC_CLIENT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, prepend_filter, + (void *)&grpc_compress_filter); + grpc_channel_init_register_stage( + GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, + prepend_filter, (void *)&grpc_compress_filter); + grpc_channel_init_register_stage( + GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, prepend_filter, + (void *)&grpc_compress_filter); + grpc_channel_init_register_stage( + GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, + maybe_add_http_filter, (void *)&grpc_http_client_filter); grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, grpc_add_connected_filter, NULL); + grpc_channel_init_register_stage( + GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, + maybe_add_http_filter, (void *)&grpc_http_client_filter); grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, grpc_add_connected_filter, NULL); + grpc_channel_init_register_stage( + GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, + maybe_add_http_filter, (void *)&grpc_http_server_filter); grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, grpc_add_connected_filter, NULL); @@ -140,6 +189,7 @@ void grpc_init(void) { grpc_register_tracer("channel_stack_builder", &grpc_trace_channel_stack_builder); grpc_register_tracer("http1", &grpc_http1_trace); + grpc_register_tracer("compression", &grpc_compression_trace); grpc_register_tracer("queue_pluck", &grpc_cq_pluck_trace); grpc_register_tracer("combiner", &grpc_combiner_trace); grpc_register_tracer("server_channel", &grpc_server_channel_trace); diff --git a/src/core/lib/surface/server.c b/src/core/lib/surface/server.c index 934ca0431a6..191ee75252d 100644 --- a/src/core/lib/surface/server.c +++ b/src/core/lib/surface/server.c @@ -44,7 +44,6 @@ #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/connected_channel.h" -#include "src/core/lib/iomgr/executor.h" #include "src/core/lib/iomgr/iomgr.h" #include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/support/stack_lockfree.h" @@ -212,11 +211,6 @@ struct grpc_server { gpr_mu mu_global; /* mutex for server and channel state */ gpr_mu mu_call; /* mutex for call-specific state */ - /* startup synchronization: flag is protected by mu_global, signals whether - we are doing the listener start routine or not */ - bool starting; - gpr_cv starting_cv; - registered_method *registered_methods; /** one request matcher for unregistered methods */ request_matcher unregistered_request_matcher; @@ -345,7 +339,7 @@ static void request_matcher_destroy(request_matcher *rm) { static void kill_zombie(grpc_exec_ctx *exec_ctx, void *elem, grpc_error *error) { - grpc_call_unref(grpc_call_from_top_element(elem)); + grpc_call_destroy(grpc_call_from_top_element(elem)); } static void request_matcher_zombify_all_pending_calls(grpc_exec_ctx *exec_ctx, @@ -394,7 +388,6 @@ static void server_delete(grpc_exec_ctx *exec_ctx, grpc_server *server) { grpc_channel_args_destroy(exec_ctx, server->channel_args); gpr_mu_destroy(&server->mu_global); gpr_mu_destroy(&server->mu_call); - gpr_cv_destroy(&server->starting_cv); while ((rm = server->registered_methods) != NULL) { server->registered_methods = rm->next; if (server->started) { @@ -981,7 +974,7 @@ const grpc_channel_filter grpc_server_top_filter = { static void register_completion_queue(grpc_server *server, grpc_completion_queue *cq, - void *reserved) { + bool is_non_listening, void *reserved) { size_t i, n; GPR_ASSERT(!reserved); for (i = 0; i < server->cq_count; i++) { @@ -990,6 +983,10 @@ static void register_completion_queue(grpc_server *server, grpc_cq_mark_server_cq(cq); + if (is_non_listening) { + grpc_cq_mark_non_listening_server_cq(cq); + } + GRPC_CQ_INTERNAL_REF(cq, "server"); n = server->cq_count++; server->cqs = gpr_realloc(server->cqs, @@ -1003,16 +1000,16 @@ void grpc_server_register_completion_queue(grpc_server *server, GRPC_API_TRACE( "grpc_server_register_completion_queue(server=%p, cq=%p, reserved=%p)", 3, (server, cq, reserved)); + register_completion_queue(server, cq, false, reserved); +} - if (grpc_get_cq_completion_type(cq) != GRPC_CQ_NEXT) { - gpr_log(GPR_INFO, - "Completion queue which is not of type GRPC_CQ_NEXT is being " - "registered as a server-completion-queue"); - /* Ideally we should log an error and abort but ruby-wrapped-language API - calls grpc_completion_queue_pluck() on server completion queues */ - } - - register_completion_queue(server, cq, reserved); +void grpc_server_register_non_listening_completion_queue( + grpc_server *server, grpc_completion_queue *cq, void *reserved) { + GRPC_API_TRACE( + "grpc_server_register_non_listening_completion_queue(server=%p, cq=%p, " + "reserved=%p)", + 3, (server, cq, reserved)); + register_completion_queue(server, cq, true, reserved); } grpc_server *grpc_server_create(const grpc_channel_args *args, void *reserved) { @@ -1020,9 +1017,10 @@ grpc_server *grpc_server_create(const grpc_channel_args *args, void *reserved) { grpc_server *server = gpr_zalloc(sizeof(grpc_server)); + GPR_ASSERT(grpc_is_initialized() && "call grpc_init()"); + gpr_mu_init(&server->mu_global); gpr_mu_init(&server->mu_call); - gpr_cv_init(&server->starting_cv); /* decremented by grpc_server_destroy */ gpr_ref_init(&server->internal_refcount, 1); @@ -1079,22 +1077,8 @@ void *grpc_server_register_method( return m; } -static void start_listeners(grpc_exec_ctx *exec_ctx, void *s, - grpc_error *error) { - grpc_server *server = s; - for (listener *l = server->listeners; l; l = l->next) { - l->start(exec_ctx, server, l->arg, server->pollsets, server->pollset_count); - } - - gpr_mu_lock(&server->mu_global); - server->starting = false; - gpr_cv_signal(&server->starting_cv); - gpr_mu_unlock(&server->mu_global); - - server_unref(exec_ctx, server); -} - void grpc_server_start(grpc_server *server) { + listener *l; size_t i; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; @@ -1108,7 +1092,7 @@ void grpc_server_start(grpc_server *server) { server->requested_calls_per_cq = gpr_malloc(sizeof(*server->requested_calls_per_cq) * server->cq_count); for (i = 0; i < server->cq_count; i++) { - if (grpc_cq_can_listen(server->cqs[i])) { + if (!grpc_cq_is_non_listening_server_cq(server->cqs[i])) { server->pollsets[server->pollset_count++] = grpc_cq_pollset(server->cqs[i]); } @@ -1128,11 +1112,10 @@ void grpc_server_start(grpc_server *server) { (size_t)server->max_requested_calls_per_cq, server); } - server_ref(server); - server->starting = true; - grpc_closure_sched(&exec_ctx, grpc_closure_create(start_listeners, server, - grpc_executor_scheduler), - GRPC_ERROR_NONE); + for (l = server->listeners; l; l = l->next) { + l->start(&exec_ctx, server, l->arg, server->pollsets, + server->pollset_count); + } grpc_exec_ctx_finish(&exec_ctx); } @@ -1266,14 +1249,8 @@ void grpc_server_shutdown_and_notify(grpc_server *server, GRPC_API_TRACE("grpc_server_shutdown_and_notify(server=%p, cq=%p, tag=%p)", 3, (server, cq, tag)); - /* wait for startup to be finished: locks mu_global */ + /* lock, and gather up some stuff to do */ gpr_mu_lock(&server->mu_global); - while (server->starting) { - gpr_cv_wait(&server->starting_cv, &server->mu_global, - gpr_inf_future(GPR_CLOCK_REALTIME)); - } - - /* stay locked, and gather up some stuff to do */ grpc_cq_begin_op(cq, tag); if (server->shutdown_published) { grpc_cq_end_op(&exec_ctx, cq, tag, GRPC_ERROR_NONE, done_published_shutdown, diff --git a/src/core/lib/surface/version.c b/src/core/lib/surface/version.c index 3793845559c..959b45da2b3 100644 --- a/src/core/lib/surface/version.c +++ b/src/core/lib/surface/version.c @@ -36,6 +36,6 @@ #include -const char *grpc_version_string(void) { return "4.0.0-dev"; } +const char *grpc_version_string(void) { return "3.0.0-pre1"; } const char *grpc_g_stands_for(void) { return "gentle"; } diff --git a/src/core/lib/transport/byte_stream.c b/src/core/lib/transport/byte_stream.c index 5800c70ef44..4d4206189e7 100644 --- a/src/core/lib/transport/byte_stream.c +++ b/src/core/lib/transport/byte_stream.c @@ -40,15 +40,10 @@ #include "src/core/lib/slice/slice_internal.h" int grpc_byte_stream_next(grpc_exec_ctx *exec_ctx, - grpc_byte_stream *byte_stream, size_t max_size_hint, - grpc_closure *on_complete) { - return byte_stream->next(exec_ctx, byte_stream, max_size_hint, on_complete); -} - -grpc_error *grpc_byte_stream_pull(grpc_exec_ctx *exec_ctx, - grpc_byte_stream *byte_stream, - grpc_slice *slice) { - return byte_stream->pull(exec_ctx, byte_stream, slice); + grpc_byte_stream *byte_stream, grpc_slice *slice, + size_t max_size_hint, grpc_closure *on_complete) { + return byte_stream->next(exec_ctx, byte_stream, slice, max_size_hint, + on_complete); } void grpc_byte_stream_destroy(grpc_exec_ctx *exec_ctx, @@ -58,24 +53,16 @@ void grpc_byte_stream_destroy(grpc_exec_ctx *exec_ctx, /* slice_buffer_stream */ -static bool slice_buffer_stream_next(grpc_exec_ctx *exec_ctx, - grpc_byte_stream *byte_stream, - size_t max_size_hint, - grpc_closure *on_complete) { - grpc_slice_buffer_stream *stream = (grpc_slice_buffer_stream *)byte_stream; - GPR_ASSERT(stream->cursor < stream->backing_buffer->count); - return true; -} - -static grpc_error *slice_buffer_stream_pull(grpc_exec_ctx *exec_ctx, - grpc_byte_stream *byte_stream, - grpc_slice *slice) { +static int slice_buffer_stream_next(grpc_exec_ctx *exec_ctx, + grpc_byte_stream *byte_stream, + grpc_slice *slice, size_t max_size_hint, + grpc_closure *on_complete) { grpc_slice_buffer_stream *stream = (grpc_slice_buffer_stream *)byte_stream; GPR_ASSERT(stream->cursor < stream->backing_buffer->count); *slice = grpc_slice_ref_internal(stream->backing_buffer->slices[stream->cursor]); stream->cursor++; - return GRPC_ERROR_NONE; + return 1; } static void slice_buffer_stream_destroy(grpc_exec_ctx *exec_ctx, @@ -88,7 +75,6 @@ void grpc_slice_buffer_stream_init(grpc_slice_buffer_stream *stream, stream->base.length = (uint32_t)slice_buffer->length; stream->base.flags = flags; stream->base.next = slice_buffer_stream_next; - stream->base.pull = slice_buffer_stream_pull; stream->base.destroy = slice_buffer_stream_destroy; stream->backing_buffer = slice_buffer; stream->cursor = 0; diff --git a/src/core/lib/transport/byte_stream.h b/src/core/lib/transport/byte_stream.h index 381c65fb044..1fdd5b4d775 100644 --- a/src/core/lib/transport/byte_stream.h +++ b/src/core/lib/transport/byte_stream.h @@ -49,10 +49,9 @@ typedef struct grpc_byte_stream grpc_byte_stream; struct grpc_byte_stream { uint32_t length; uint32_t flags; - bool (*next)(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream, - size_t max_size_hint, grpc_closure *on_complete); - grpc_error *(*pull)(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream, - grpc_slice *slice); + int (*next)(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream, + grpc_slice *slice, size_t max_size_hint, + grpc_closure *on_complete); void (*destroy)(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream); }; @@ -62,20 +61,12 @@ struct grpc_byte_stream { * * max_size_hint can be set as a hint as to the maximum number * of bytes that would be acceptable to read. - */ -int grpc_byte_stream_next(grpc_exec_ctx *exec_ctx, - grpc_byte_stream *byte_stream, size_t max_size_hint, - grpc_closure *on_complete); - -/* returns the next slice in the byte stream when it is ready (indicated by - * either grpc_byte_stream_next returning 1 or on_complete passed to - * grpc_byte_stream_next is called). * * once a slice is returned into *slice, it is owned by the caller. */ -grpc_error *grpc_byte_stream_pull(grpc_exec_ctx *exec_ctx, - grpc_byte_stream *byte_stream, - grpc_slice *slice); +int grpc_byte_stream_next(grpc_exec_ctx *exec_ctx, + grpc_byte_stream *byte_stream, grpc_slice *slice, + size_t max_size_hint, grpc_closure *on_complete); void grpc_byte_stream_destroy(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream); diff --git a/src/core/lib/transport/service_config.c b/src/core/lib/transport/service_config.c index 6aecb7fa936..1195f75044a 100644 --- a/src/core/lib/transport/service_config.c +++ b/src/core/lib/transport/service_config.c @@ -162,6 +162,7 @@ static char* parse_json_method_name(grpc_json* json) { static bool parse_json_method_config( grpc_exec_ctx* exec_ctx, grpc_json* json, void* (*create_value)(const grpc_json* method_config_json), + const grpc_slice_hash_table_vtable* vtable, grpc_slice_hash_table_entry* entries, size_t* idx) { // Construct value. void* method_config = create_value(json); @@ -184,11 +185,13 @@ static bool parse_json_method_config( // Add entry for each path. for (size_t i = 0; i < paths.count; ++i) { entries[*idx].key = grpc_slice_from_copied_string(paths.strs[i]); - entries[*idx].value = method_config; + entries[*idx].value = vtable->copy_value(method_config); + entries[*idx].vtable = vtable; ++*idx; } success = true; done: + vtable->destroy_value(exec_ctx, method_config); gpr_strvec_destroy(&paths); return success; } @@ -196,7 +199,7 @@ done: grpc_slice_hash_table* grpc_service_config_create_method_config_table( grpc_exec_ctx* exec_ctx, const grpc_service_config* service_config, void* (*create_value)(const grpc_json* method_config_json), - void (*destroy_value)(grpc_exec_ctx* exec_ctx, void* value)) { + const grpc_slice_hash_table_vtable* vtable) { const grpc_json* json = service_config->json_tree; // Traverse parsed JSON tree. if (json->type != GRPC_JSON_OBJECT || json->key != NULL) return NULL; @@ -217,8 +220,8 @@ grpc_slice_hash_table* grpc_service_config_create_method_config_table( size_t idx = 0; for (grpc_json* method = field->child; method != NULL; method = method->next) { - if (!parse_json_method_config(exec_ctx, method, create_value, entries, - &idx)) { + if (!parse_json_method_config(exec_ctx, method, create_value, vtable, + entries, &idx)) { return NULL; } } @@ -228,8 +231,12 @@ grpc_slice_hash_table* grpc_service_config_create_method_config_table( // Instantiate method config table. grpc_slice_hash_table* method_config_table = NULL; if (entries != NULL) { - method_config_table = - grpc_slice_hash_table_create(num_entries, entries, destroy_value); + method_config_table = grpc_slice_hash_table_create(num_entries, entries); + // Clean up. + for (size_t i = 0; i < num_entries; ++i) { + grpc_slice_unref_internal(exec_ctx, entries[i].key); + vtable->destroy_value(exec_ctx, entries[i].value); + } gpr_free(entries); } return method_config_table; diff --git a/src/core/lib/transport/service_config.h b/src/core/lib/transport/service_config.h index e0548b9c3fa..ebfc59b5347 100644 --- a/src/core/lib/transport/service_config.h +++ b/src/core/lib/transport/service_config.h @@ -57,12 +57,12 @@ const char* grpc_service_config_get_lb_policy_name( /// Creates a method config table based on the data in \a json. /// The table's keys are request paths. The table's value type is /// returned by \a create_value(), based on data parsed from the JSON tree. -/// \a destroy_value is used to clean up values. +/// \a vtable provides methods used to manage the values. /// Returns NULL on error. grpc_slice_hash_table* grpc_service_config_create_method_config_table( grpc_exec_ctx* exec_ctx, const grpc_service_config* service_config, void* (*create_value)(const grpc_json* method_config_json), - void (*destroy_value)(grpc_exec_ctx* exec_ctx, void* value)); + const grpc_slice_hash_table_vtable* vtable); /// A helper function for looking up values in the table returned by /// \a grpc_service_config_create_method_config_table(). diff --git a/src/core/lib/transport/static_metadata.c b/src/core/lib/transport/static_metadata.c index 862cdaa8e09..c13ba230b32 100644 --- a/src/core/lib/transport/static_metadata.c +++ b/src/core/lib/transport/static_metadata.c @@ -51,69 +51,67 @@ static uint8_t g_bytes[] = { 115, 103, 114, 112, 99, 45, 112, 97, 121, 108, 111, 97, 100, 45, 98, 105, 110, 103, 114, 112, 99, 45, 101, 110, 99, 111, 100, 105, 110, 103, 103, 114, 112, 99, 45, 97, 99, 99, 101, 112, 116, 45, 101, 110, 99, - 111, 100, 105, 110, 103, 103, 114, 112, 99, 45, 115, 101, 114, 118, 101, - 114, 45, 115, 116, 97, 116, 115, 45, 98, 105, 110, 103, 114, 112, 99, - 45, 116, 97, 103, 115, 45, 98, 105, 110, 103, 114, 112, 99, 45, 116, - 114, 97, 99, 101, 45, 98, 105, 110, 99, 111, 110, 116, 101, 110, 116, - 45, 116, 121, 112, 101, 103, 114, 112, 99, 45, 105, 110, 116, 101, 114, - 110, 97, 108, 45, 101, 110, 99, 111, 100, 105, 110, 103, 45, 114, 101, - 113, 117, 101, 115, 116, 117, 115, 101, 114, 45, 97, 103, 101, 110, 116, - 104, 111, 115, 116, 108, 98, 45, 116, 111, 107, 101, 110, 103, 114, 112, - 99, 45, 116, 105, 109, 101, 111, 117, 116, 103, 114, 112, 99, 46, 119, - 97, 105, 116, 95, 102, 111, 114, 95, 114, 101, 97, 100, 121, 103, 114, - 112, 99, 46, 116, 105, 109, 101, 111, 117, 116, 103, 114, 112, 99, 46, - 109, 97, 120, 95, 114, 101, 113, 117, 101, 115, 116, 95, 109, 101, 115, - 115, 97, 103, 101, 95, 98, 121, 116, 101, 115, 103, 114, 112, 99, 46, - 109, 97, 120, 95, 114, 101, 115, 112, 111, 110, 115, 101, 95, 109, 101, - 115, 115, 97, 103, 101, 95, 98, 121, 116, 101, 115, 47, 103, 114, 112, - 99, 46, 108, 98, 46, 118, 49, 46, 76, 111, 97, 100, 66, 97, 108, - 97, 110, 99, 101, 114, 47, 66, 97, 108, 97, 110, 99, 101, 76, 111, - 97, 100, 48, 49, 50, 105, 100, 101, 110, 116, 105, 116, 121, 103, 122, - 105, 112, 100, 101, 102, 108, 97, 116, 101, 116, 114, 97, 105, 108, 101, - 114, 115, 97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 103, - 114, 112, 99, 80, 79, 83, 84, 50, 48, 48, 52, 48, 52, 104, 116, - 116, 112, 104, 116, 116, 112, 115, 103, 114, 112, 99, 71, 69, 84, 80, - 85, 84, 47, 47, 105, 110, 100, 101, 120, 46, 104, 116, 109, 108, 50, - 48, 52, 50, 48, 54, 51, 48, 52, 52, 48, 48, 53, 48, 48, 97, - 99, 99, 101, 112, 116, 45, 99, 104, 97, 114, 115, 101, 116, 97, 99, - 99, 101, 112, 116, 45, 101, 110, 99, 111, 100, 105, 110, 103, 103, 122, - 105, 112, 44, 32, 100, 101, 102, 108, 97, 116, 101, 97, 99, 99, 101, - 112, 116, 45, 108, 97, 110, 103, 117, 97, 103, 101, 97, 99, 99, 101, - 112, 116, 45, 114, 97, 110, 103, 101, 115, 97, 99, 99, 101, 112, 116, - 97, 99, 99, 101, 115, 115, 45, 99, 111, 110, 116, 114, 111, 108, 45, - 97, 108, 108, 111, 119, 45, 111, 114, 105, 103, 105, 110, 97, 103, 101, - 97, 108, 108, 111, 119, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, - 105, 111, 110, 99, 97, 99, 104, 101, 45, 99, 111, 110, 116, 114, 111, - 108, 99, 111, 110, 116, 101, 110, 116, 45, 100, 105, 115, 112, 111, 115, - 105, 116, 105, 111, 110, 99, 111, 110, 116, 101, 110, 116, 45, 101, 110, - 99, 111, 100, 105, 110, 103, 99, 111, 110, 116, 101, 110, 116, 45, 108, - 97, 110, 103, 117, 97, 103, 101, 99, 111, 110, 116, 101, 110, 116, 45, - 108, 101, 110, 103, 116, 104, 99, 111, 110, 116, 101, 110, 116, 45, 108, - 111, 99, 97, 116, 105, 111, 110, 99, 111, 110, 116, 101, 110, 116, 45, - 114, 97, 110, 103, 101, 99, 111, 111, 107, 105, 101, 100, 97, 116, 101, - 101, 116, 97, 103, 101, 120, 112, 101, 99, 116, 101, 120, 112, 105, 114, - 101, 115, 102, 114, 111, 109, 105, 102, 45, 109, 97, 116, 99, 104, 105, - 102, 45, 109, 111, 100, 105, 102, 105, 101, 100, 45, 115, 105, 110, 99, - 101, 105, 102, 45, 110, 111, 110, 101, 45, 109, 97, 116, 99, 104, 105, - 102, 45, 114, 97, 110, 103, 101, 105, 102, 45, 117, 110, 109, 111, 100, - 105, 102, 105, 101, 100, 45, 115, 105, 110, 99, 101, 108, 97, 115, 116, - 45, 109, 111, 100, 105, 102, 105, 101, 100, 108, 98, 45, 99, 111, 115, - 116, 45, 98, 105, 110, 108, 105, 110, 107, 108, 111, 99, 97, 116, 105, - 111, 110, 109, 97, 120, 45, 102, 111, 114, 119, 97, 114, 100, 115, 112, - 114, 111, 120, 121, 45, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, - 116, 101, 112, 114, 111, 120, 121, 45, 97, 117, 116, 104, 111, 114, 105, - 122, 97, 116, 105, 111, 110, 114, 97, 110, 103, 101, 114, 101, 102, 101, - 114, 101, 114, 114, 101, 102, 114, 101, 115, 104, 114, 101, 116, 114, 121, - 45, 97, 102, 116, 101, 114, 115, 101, 114, 118, 101, 114, 115, 101, 116, - 45, 99, 111, 111, 107, 105, 101, 115, 116, 114, 105, 99, 116, 45, 116, - 114, 97, 110, 115, 112, 111, 114, 116, 45, 115, 101, 99, 117, 114, 105, - 116, 121, 116, 114, 97, 110, 115, 102, 101, 114, 45, 101, 110, 99, 111, - 100, 105, 110, 103, 118, 97, 114, 121, 118, 105, 97, 119, 119, 119, 45, - 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 105, 100, 101, - 110, 116, 105, 116, 121, 44, 100, 101, 102, 108, 97, 116, 101, 105, 100, - 101, 110, 116, 105, 116, 121, 44, 103, 122, 105, 112, 100, 101, 102, 108, - 97, 116, 101, 44, 103, 122, 105, 112, 105, 100, 101, 110, 116, 105, 116, - 121, 44, 100, 101, 102, 108, 97, 116, 101, 44, 103, 122, 105, 112}; + 111, 100, 105, 110, 103, 99, 111, 110, 116, 101, 110, 116, 45, 116, 121, + 112, 101, 103, 114, 112, 99, 45, 105, 110, 116, 101, 114, 110, 97, 108, + 45, 101, 110, 99, 111, 100, 105, 110, 103, 45, 114, 101, 113, 117, 101, + 115, 116, 117, 115, 101, 114, 45, 97, 103, 101, 110, 116, 104, 111, 115, + 116, 108, 98, 45, 116, 111, 107, 101, 110, 103, 114, 112, 99, 45, 116, + 105, 109, 101, 111, 117, 116, 103, 114, 112, 99, 45, 116, 114, 97, 99, + 105, 110, 103, 45, 98, 105, 110, 103, 114, 112, 99, 45, 115, 116, 97, + 116, 115, 45, 98, 105, 110, 103, 114, 112, 99, 46, 119, 97, 105, 116, + 95, 102, 111, 114, 95, 114, 101, 97, 100, 121, 103, 114, 112, 99, 46, + 116, 105, 109, 101, 111, 117, 116, 103, 114, 112, 99, 46, 109, 97, 120, + 95, 114, 101, 113, 117, 101, 115, 116, 95, 109, 101, 115, 115, 97, 103, + 101, 95, 98, 121, 116, 101, 115, 103, 114, 112, 99, 46, 109, 97, 120, + 95, 114, 101, 115, 112, 111, 110, 115, 101, 95, 109, 101, 115, 115, 97, + 103, 101, 95, 98, 121, 116, 101, 115, 47, 103, 114, 112, 99, 46, 108, + 98, 46, 118, 49, 46, 76, 111, 97, 100, 66, 97, 108, 97, 110, 99, + 101, 114, 47, 66, 97, 108, 97, 110, 99, 101, 76, 111, 97, 100, 48, + 49, 50, 105, 100, 101, 110, 116, 105, 116, 121, 103, 122, 105, 112, 100, + 101, 102, 108, 97, 116, 101, 116, 114, 97, 105, 108, 101, 114, 115, 97, + 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 103, 114, 112, 99, + 80, 79, 83, 84, 50, 48, 48, 52, 48, 52, 104, 116, 116, 112, 104, + 116, 116, 112, 115, 103, 114, 112, 99, 71, 69, 84, 80, 85, 84, 47, + 47, 105, 110, 100, 101, 120, 46, 104, 116, 109, 108, 50, 48, 52, 50, + 48, 54, 51, 48, 52, 52, 48, 48, 53, 48, 48, 97, 99, 99, 101, + 112, 116, 45, 99, 104, 97, 114, 115, 101, 116, 97, 99, 99, 101, 112, + 116, 45, 101, 110, 99, 111, 100, 105, 110, 103, 103, 122, 105, 112, 44, + 32, 100, 101, 102, 108, 97, 116, 101, 97, 99, 99, 101, 112, 116, 45, + 108, 97, 110, 103, 117, 97, 103, 101, 97, 99, 99, 101, 112, 116, 45, + 114, 97, 110, 103, 101, 115, 97, 99, 99, 101, 112, 116, 97, 99, 99, + 101, 115, 115, 45, 99, 111, 110, 116, 114, 111, 108, 45, 97, 108, 108, + 111, 119, 45, 111, 114, 105, 103, 105, 110, 97, 103, 101, 97, 108, 108, + 111, 119, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, + 99, 97, 99, 104, 101, 45, 99, 111, 110, 116, 114, 111, 108, 99, 111, + 110, 116, 101, 110, 116, 45, 100, 105, 115, 112, 111, 115, 105, 116, 105, + 111, 110, 99, 111, 110, 116, 101, 110, 116, 45, 101, 110, 99, 111, 100, + 105, 110, 103, 99, 111, 110, 116, 101, 110, 116, 45, 108, 97, 110, 103, + 117, 97, 103, 101, 99, 111, 110, 116, 101, 110, 116, 45, 108, 101, 110, + 103, 116, 104, 99, 111, 110, 116, 101, 110, 116, 45, 108, 111, 99, 97, + 116, 105, 111, 110, 99, 111, 110, 116, 101, 110, 116, 45, 114, 97, 110, + 103, 101, 99, 111, 111, 107, 105, 101, 100, 97, 116, 101, 101, 116, 97, + 103, 101, 120, 112, 101, 99, 116, 101, 120, 112, 105, 114, 101, 115, 102, + 114, 111, 109, 105, 102, 45, 109, 97, 116, 99, 104, 105, 102, 45, 109, + 111, 100, 105, 102, 105, 101, 100, 45, 115, 105, 110, 99, 101, 105, 102, + 45, 110, 111, 110, 101, 45, 109, 97, 116, 99, 104, 105, 102, 45, 114, + 97, 110, 103, 101, 105, 102, 45, 117, 110, 109, 111, 100, 105, 102, 105, + 101, 100, 45, 115, 105, 110, 99, 101, 108, 97, 115, 116, 45, 109, 111, + 100, 105, 102, 105, 101, 100, 108, 105, 110, 107, 108, 111, 99, 97, 116, + 105, 111, 110, 109, 97, 120, 45, 102, 111, 114, 119, 97, 114, 100, 115, + 112, 114, 111, 120, 121, 45, 97, 117, 116, 104, 101, 110, 116, 105, 99, + 97, 116, 101, 112, 114, 111, 120, 121, 45, 97, 117, 116, 104, 111, 114, + 105, 122, 97, 116, 105, 111, 110, 114, 97, 110, 103, 101, 114, 101, 102, + 101, 114, 101, 114, 114, 101, 102, 114, 101, 115, 104, 114, 101, 116, 114, + 121, 45, 97, 102, 116, 101, 114, 115, 101, 114, 118, 101, 114, 115, 101, + 116, 45, 99, 111, 111, 107, 105, 101, 115, 116, 114, 105, 99, 116, 45, + 116, 114, 97, 110, 115, 112, 111, 114, 116, 45, 115, 101, 99, 117, 114, + 105, 116, 121, 116, 114, 97, 110, 115, 102, 101, 114, 45, 101, 110, 99, + 111, 100, 105, 110, 103, 118, 97, 114, 121, 118, 105, 97, 119, 119, 119, + 45, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 105, 100, + 101, 110, 116, 105, 116, 121, 44, 100, 101, 102, 108, 97, 116, 101, 105, + 100, 101, 110, 116, 105, 116, 121, 44, 103, 122, 105, 112, 100, 101, 102, + 108, 97, 116, 101, 44, 103, 122, 105, 112, 105, 100, 101, 110, 116, 105, + 116, 121, 44, 100, 101, 102, 108, 97, 116, 101, 44, 103, 122, 105, 112}; static void static_ref(void *unused) {} static void static_unref(grpc_exec_ctx *exec_ctx, void *unused) {} @@ -222,8 +220,6 @@ grpc_slice_refcount grpc_static_metadata_refcounts[GRPC_STATIC_MDSTR_COUNT] = { {&grpc_static_metadata_vtable, &static_sub_refcnt}, {&grpc_static_metadata_vtable, &static_sub_refcnt}, {&grpc_static_metadata_vtable, &static_sub_refcnt}, - {&grpc_static_metadata_vtable, &static_sub_refcnt}, - {&grpc_static_metadata_vtable, &static_sub_refcnt}, }; const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT] = { @@ -250,201 +246,196 @@ const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT] = { {.refcount = &grpc_static_metadata_refcounts[10], .data.refcounted = {g_bytes + 90, 20}}, {.refcount = &grpc_static_metadata_refcounts[11], - .data.refcounted = {g_bytes + 110, 21}}, + .data.refcounted = {g_bytes + 110, 12}}, {.refcount = &grpc_static_metadata_refcounts[12], - .data.refcounted = {g_bytes + 131, 13}}, + .data.refcounted = {g_bytes + 122, 30}}, {.refcount = &grpc_static_metadata_refcounts[13], - .data.refcounted = {g_bytes + 144, 14}}, + .data.refcounted = {g_bytes + 152, 10}}, {.refcount = &grpc_static_metadata_refcounts[14], - .data.refcounted = {g_bytes + 158, 12}}, + .data.refcounted = {g_bytes + 162, 4}}, {.refcount = &grpc_static_metadata_refcounts[15], - .data.refcounted = {g_bytes + 170, 30}}, + .data.refcounted = {g_bytes + 166, 8}}, {.refcount = &grpc_static_metadata_refcounts[16], - .data.refcounted = {g_bytes + 200, 10}}, + .data.refcounted = {g_bytes + 174, 12}}, {.refcount = &grpc_static_metadata_refcounts[17], - .data.refcounted = {g_bytes + 210, 4}}, + .data.refcounted = {g_bytes + 186, 16}}, {.refcount = &grpc_static_metadata_refcounts[18], - .data.refcounted = {g_bytes + 214, 8}}, + .data.refcounted = {g_bytes + 202, 14}}, {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 222, 12}}, + .data.refcounted = {g_bytes + 216, 0}}, {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}, + .data.refcounted = {g_bytes + 216, 19}}, {.refcount = &grpc_static_metadata_refcounts[21], - .data.refcounted = {g_bytes + 234, 19}}, + .data.refcounted = {g_bytes + 235, 12}}, {.refcount = &grpc_static_metadata_refcounts[22], - .data.refcounted = {g_bytes + 253, 12}}, + .data.refcounted = {g_bytes + 247, 30}}, {.refcount = &grpc_static_metadata_refcounts[23], - .data.refcounted = {g_bytes + 265, 30}}, + .data.refcounted = {g_bytes + 277, 31}}, {.refcount = &grpc_static_metadata_refcounts[24], - .data.refcounted = {g_bytes + 295, 31}}, + .data.refcounted = {g_bytes + 308, 36}}, {.refcount = &grpc_static_metadata_refcounts[25], - .data.refcounted = {g_bytes + 326, 36}}, + .data.refcounted = {g_bytes + 344, 1}}, {.refcount = &grpc_static_metadata_refcounts[26], - .data.refcounted = {g_bytes + 362, 1}}, + .data.refcounted = {g_bytes + 345, 1}}, {.refcount = &grpc_static_metadata_refcounts[27], - .data.refcounted = {g_bytes + 363, 1}}, + .data.refcounted = {g_bytes + 346, 1}}, {.refcount = &grpc_static_metadata_refcounts[28], - .data.refcounted = {g_bytes + 364, 1}}, + .data.refcounted = {g_bytes + 347, 8}}, {.refcount = &grpc_static_metadata_refcounts[29], - .data.refcounted = {g_bytes + 365, 8}}, + .data.refcounted = {g_bytes + 355, 4}}, {.refcount = &grpc_static_metadata_refcounts[30], - .data.refcounted = {g_bytes + 373, 4}}, + .data.refcounted = {g_bytes + 359, 7}}, {.refcount = &grpc_static_metadata_refcounts[31], - .data.refcounted = {g_bytes + 377, 7}}, + .data.refcounted = {g_bytes + 366, 8}}, {.refcount = &grpc_static_metadata_refcounts[32], - .data.refcounted = {g_bytes + 384, 8}}, + .data.refcounted = {g_bytes + 374, 16}}, {.refcount = &grpc_static_metadata_refcounts[33], - .data.refcounted = {g_bytes + 392, 16}}, + .data.refcounted = {g_bytes + 390, 4}}, {.refcount = &grpc_static_metadata_refcounts[34], - .data.refcounted = {g_bytes + 408, 4}}, + .data.refcounted = {g_bytes + 394, 3}}, {.refcount = &grpc_static_metadata_refcounts[35], - .data.refcounted = {g_bytes + 412, 3}}, + .data.refcounted = {g_bytes + 397, 3}}, {.refcount = &grpc_static_metadata_refcounts[36], - .data.refcounted = {g_bytes + 415, 3}}, + .data.refcounted = {g_bytes + 400, 4}}, {.refcount = &grpc_static_metadata_refcounts[37], - .data.refcounted = {g_bytes + 418, 4}}, + .data.refcounted = {g_bytes + 404, 5}}, {.refcount = &grpc_static_metadata_refcounts[38], - .data.refcounted = {g_bytes + 422, 5}}, + .data.refcounted = {g_bytes + 409, 4}}, {.refcount = &grpc_static_metadata_refcounts[39], - .data.refcounted = {g_bytes + 427, 4}}, + .data.refcounted = {g_bytes + 413, 3}}, {.refcount = &grpc_static_metadata_refcounts[40], - .data.refcounted = {g_bytes + 431, 3}}, + .data.refcounted = {g_bytes + 416, 3}}, {.refcount = &grpc_static_metadata_refcounts[41], - .data.refcounted = {g_bytes + 434, 3}}, + .data.refcounted = {g_bytes + 419, 1}}, {.refcount = &grpc_static_metadata_refcounts[42], - .data.refcounted = {g_bytes + 437, 1}}, + .data.refcounted = {g_bytes + 420, 11}}, {.refcount = &grpc_static_metadata_refcounts[43], - .data.refcounted = {g_bytes + 438, 11}}, + .data.refcounted = {g_bytes + 431, 3}}, {.refcount = &grpc_static_metadata_refcounts[44], - .data.refcounted = {g_bytes + 449, 3}}, + .data.refcounted = {g_bytes + 434, 3}}, {.refcount = &grpc_static_metadata_refcounts[45], - .data.refcounted = {g_bytes + 452, 3}}, + .data.refcounted = {g_bytes + 437, 3}}, {.refcount = &grpc_static_metadata_refcounts[46], - .data.refcounted = {g_bytes + 455, 3}}, + .data.refcounted = {g_bytes + 440, 3}}, {.refcount = &grpc_static_metadata_refcounts[47], - .data.refcounted = {g_bytes + 458, 3}}, + .data.refcounted = {g_bytes + 443, 3}}, {.refcount = &grpc_static_metadata_refcounts[48], - .data.refcounted = {g_bytes + 461, 3}}, + .data.refcounted = {g_bytes + 446, 14}}, {.refcount = &grpc_static_metadata_refcounts[49], - .data.refcounted = {g_bytes + 464, 14}}, + .data.refcounted = {g_bytes + 460, 15}}, {.refcount = &grpc_static_metadata_refcounts[50], - .data.refcounted = {g_bytes + 478, 15}}, + .data.refcounted = {g_bytes + 475, 13}}, {.refcount = &grpc_static_metadata_refcounts[51], - .data.refcounted = {g_bytes + 493, 13}}, + .data.refcounted = {g_bytes + 488, 15}}, {.refcount = &grpc_static_metadata_refcounts[52], - .data.refcounted = {g_bytes + 506, 15}}, + .data.refcounted = {g_bytes + 503, 13}}, {.refcount = &grpc_static_metadata_refcounts[53], - .data.refcounted = {g_bytes + 521, 13}}, + .data.refcounted = {g_bytes + 516, 6}}, {.refcount = &grpc_static_metadata_refcounts[54], - .data.refcounted = {g_bytes + 534, 6}}, + .data.refcounted = {g_bytes + 522, 27}}, {.refcount = &grpc_static_metadata_refcounts[55], - .data.refcounted = {g_bytes + 540, 27}}, + .data.refcounted = {g_bytes + 549, 3}}, {.refcount = &grpc_static_metadata_refcounts[56], - .data.refcounted = {g_bytes + 567, 3}}, + .data.refcounted = {g_bytes + 552, 5}}, {.refcount = &grpc_static_metadata_refcounts[57], - .data.refcounted = {g_bytes + 570, 5}}, + .data.refcounted = {g_bytes + 557, 13}}, {.refcount = &grpc_static_metadata_refcounts[58], - .data.refcounted = {g_bytes + 575, 13}}, + .data.refcounted = {g_bytes + 570, 13}}, {.refcount = &grpc_static_metadata_refcounts[59], - .data.refcounted = {g_bytes + 588, 13}}, + .data.refcounted = {g_bytes + 583, 19}}, {.refcount = &grpc_static_metadata_refcounts[60], - .data.refcounted = {g_bytes + 601, 19}}, + .data.refcounted = {g_bytes + 602, 16}}, {.refcount = &grpc_static_metadata_refcounts[61], - .data.refcounted = {g_bytes + 620, 16}}, + .data.refcounted = {g_bytes + 618, 16}}, {.refcount = &grpc_static_metadata_refcounts[62], - .data.refcounted = {g_bytes + 636, 16}}, + .data.refcounted = {g_bytes + 634, 14}}, {.refcount = &grpc_static_metadata_refcounts[63], - .data.refcounted = {g_bytes + 652, 14}}, + .data.refcounted = {g_bytes + 648, 16}}, {.refcount = &grpc_static_metadata_refcounts[64], - .data.refcounted = {g_bytes + 666, 16}}, + .data.refcounted = {g_bytes + 664, 13}}, {.refcount = &grpc_static_metadata_refcounts[65], - .data.refcounted = {g_bytes + 682, 13}}, + .data.refcounted = {g_bytes + 677, 6}}, {.refcount = &grpc_static_metadata_refcounts[66], - .data.refcounted = {g_bytes + 695, 6}}, + .data.refcounted = {g_bytes + 683, 4}}, {.refcount = &grpc_static_metadata_refcounts[67], - .data.refcounted = {g_bytes + 701, 4}}, + .data.refcounted = {g_bytes + 687, 4}}, {.refcount = &grpc_static_metadata_refcounts[68], - .data.refcounted = {g_bytes + 705, 4}}, + .data.refcounted = {g_bytes + 691, 6}}, {.refcount = &grpc_static_metadata_refcounts[69], - .data.refcounted = {g_bytes + 709, 6}}, + .data.refcounted = {g_bytes + 697, 7}}, {.refcount = &grpc_static_metadata_refcounts[70], - .data.refcounted = {g_bytes + 715, 7}}, + .data.refcounted = {g_bytes + 704, 4}}, {.refcount = &grpc_static_metadata_refcounts[71], - .data.refcounted = {g_bytes + 722, 4}}, + .data.refcounted = {g_bytes + 708, 8}}, {.refcount = &grpc_static_metadata_refcounts[72], - .data.refcounted = {g_bytes + 726, 8}}, + .data.refcounted = {g_bytes + 716, 17}}, {.refcount = &grpc_static_metadata_refcounts[73], - .data.refcounted = {g_bytes + 734, 17}}, + .data.refcounted = {g_bytes + 733, 13}}, {.refcount = &grpc_static_metadata_refcounts[74], - .data.refcounted = {g_bytes + 751, 13}}, + .data.refcounted = {g_bytes + 746, 8}}, {.refcount = &grpc_static_metadata_refcounts[75], - .data.refcounted = {g_bytes + 764, 8}}, + .data.refcounted = {g_bytes + 754, 19}}, {.refcount = &grpc_static_metadata_refcounts[76], - .data.refcounted = {g_bytes + 772, 19}}, + .data.refcounted = {g_bytes + 773, 13}}, {.refcount = &grpc_static_metadata_refcounts[77], - .data.refcounted = {g_bytes + 791, 13}}, + .data.refcounted = {g_bytes + 786, 4}}, {.refcount = &grpc_static_metadata_refcounts[78], - .data.refcounted = {g_bytes + 804, 11}}, + .data.refcounted = {g_bytes + 790, 8}}, {.refcount = &grpc_static_metadata_refcounts[79], - .data.refcounted = {g_bytes + 815, 4}}, + .data.refcounted = {g_bytes + 798, 12}}, {.refcount = &grpc_static_metadata_refcounts[80], - .data.refcounted = {g_bytes + 819, 8}}, + .data.refcounted = {g_bytes + 810, 18}}, {.refcount = &grpc_static_metadata_refcounts[81], - .data.refcounted = {g_bytes + 827, 12}}, + .data.refcounted = {g_bytes + 828, 19}}, {.refcount = &grpc_static_metadata_refcounts[82], - .data.refcounted = {g_bytes + 839, 18}}, + .data.refcounted = {g_bytes + 847, 5}}, {.refcount = &grpc_static_metadata_refcounts[83], - .data.refcounted = {g_bytes + 857, 19}}, + .data.refcounted = {g_bytes + 852, 7}}, {.refcount = &grpc_static_metadata_refcounts[84], - .data.refcounted = {g_bytes + 876, 5}}, + .data.refcounted = {g_bytes + 859, 7}}, {.refcount = &grpc_static_metadata_refcounts[85], - .data.refcounted = {g_bytes + 881, 7}}, + .data.refcounted = {g_bytes + 866, 11}}, {.refcount = &grpc_static_metadata_refcounts[86], - .data.refcounted = {g_bytes + 888, 7}}, + .data.refcounted = {g_bytes + 877, 6}}, {.refcount = &grpc_static_metadata_refcounts[87], - .data.refcounted = {g_bytes + 895, 11}}, + .data.refcounted = {g_bytes + 883, 10}}, {.refcount = &grpc_static_metadata_refcounts[88], - .data.refcounted = {g_bytes + 906, 6}}, + .data.refcounted = {g_bytes + 893, 25}}, {.refcount = &grpc_static_metadata_refcounts[89], - .data.refcounted = {g_bytes + 912, 10}}, + .data.refcounted = {g_bytes + 918, 17}}, {.refcount = &grpc_static_metadata_refcounts[90], - .data.refcounted = {g_bytes + 922, 25}}, + .data.refcounted = {g_bytes + 935, 4}}, {.refcount = &grpc_static_metadata_refcounts[91], - .data.refcounted = {g_bytes + 947, 17}}, + .data.refcounted = {g_bytes + 939, 3}}, {.refcount = &grpc_static_metadata_refcounts[92], - .data.refcounted = {g_bytes + 964, 4}}, + .data.refcounted = {g_bytes + 942, 16}}, {.refcount = &grpc_static_metadata_refcounts[93], - .data.refcounted = {g_bytes + 968, 3}}, + .data.refcounted = {g_bytes + 958, 16}}, {.refcount = &grpc_static_metadata_refcounts[94], - .data.refcounted = {g_bytes + 971, 16}}, + .data.refcounted = {g_bytes + 974, 13}}, {.refcount = &grpc_static_metadata_refcounts[95], - .data.refcounted = {g_bytes + 987, 16}}, + .data.refcounted = {g_bytes + 987, 12}}, {.refcount = &grpc_static_metadata_refcounts[96], - .data.refcounted = {g_bytes + 1003, 13}}, - {.refcount = &grpc_static_metadata_refcounts[97], - .data.refcounted = {g_bytes + 1016, 12}}, - {.refcount = &grpc_static_metadata_refcounts[98], - .data.refcounted = {g_bytes + 1028, 21}}, + .data.refcounted = {g_bytes + 999, 21}}, }; uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 6, 6, 8, 8}; + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 6, 6, 8, 8}; static const int8_t elems_r[] = { - 10, 8, -3, 0, 9, 21, -77, 22, 0, 10, -7, 0, 0, 0, - 14, 0, 13, 12, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -50, -51, 16, -53, -54, -55, -56, - -56, -57, -58, -59, 0, 37, 36, 35, 34, 33, 32, 31, 30, 29, - 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, - 14, 13, 12, 11, 10, 13, 12, 11, 10, 9, 8, 7, 0}; + 10, 8, -3, 0, 9, 21, -75, 22, 0, 10, -7, 20, 0, 19, 18, 17, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -48, -49, 16, -51, -52, -53, -54, -54, -55, -56, -57, 0, 37, 36, 35, 34, + 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, + 17, 16, 15, 14, 13, 12, 11, 14, 13, 12, 11, 10, 9, 8, 0}; static uint32_t elems_phash(uint32_t i) { - i -= 42; - uint32_t x = i % 97; - uint32_t y = i / 97; + i -= 41; + uint32_t x = i % 95; + uint32_t y = i / 95; uint32_t h = x; if (y < GPR_ARRAY_SIZE(elems_r)) { uint32_t delta = (uint32_t)elems_r[y]; @@ -454,30 +445,29 @@ static uint32_t elems_phash(uint32_t i) { } static const uint16_t elem_keys[] = { - 1019, 1020, 1021, 242, 243, 244, 245, 246, 139, 140, 42, 43, - 433, 434, 435, 920, 921, 922, 719, 720, 1406, 527, 721, 1604, - 1703, 1802, 4871, 4970, 5001, 5168, 5267, 5366, 5465, 1419, 5564, 5663, - 5762, 5861, 5960, 6059, 6158, 6257, 6356, 6455, 6554, 6653, 6752, 6851, - 6950, 7049, 7148, 7247, 7346, 7445, 7544, 7643, 7742, 7841, 7940, 8039, - 8138, 8237, 8336, 8435, 8534, 8633, 1085, 1086, 1087, 1088, 8732, 8831, - 8930, 9029, 9128, 9227, 9326, 0, 317, 0, 0, 0, 0, 0, + 998, 999, 1000, 237, 238, 239, 240, 241, 136, 137, 41, 42, + 424, 425, 426, 901, 902, 903, 704, 705, 1086, 516, 706, 1280, + 1377, 1474, 4675, 4772, 4803, 4966, 5063, 5160, 5257, 1099, 5354, 5451, + 5548, 5645, 5742, 5839, 5936, 6033, 6130, 6227, 6324, 6421, 6518, 6615, + 6712, 6809, 6906, 7003, 7100, 7197, 7294, 7391, 7488, 7585, 7682, 7779, + 7876, 7973, 8070, 8167, 8264, 1063, 1064, 1065, 1066, 8361, 8458, 8555, + 8652, 8749, 8846, 8943, 310, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 133, 233, 234, 0, 0, 0, 0, + 0, 0, 0, 130, 228, 229, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0}; + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static const uint8_t elem_idxs[] = { - 74, 77, 75, 19, 20, 21, 22, 23, 15, 16, 17, 18, 11, 12, 13, - 3, 4, 5, 0, 1, 41, 6, 2, 70, 48, 55, 24, 25, 26, 27, + 73, 76, 74, 19, 20, 21, 22, 23, 15, 16, 17, 18, 11, 12, 13, + 3, 4, 5, 0, 1, 41, 6, 2, 69, 48, 55, 24, 25, 26, 27, 28, 29, 30, 7, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 76, 78, 79, 80, 66, 67, 68, 69, 71, - 72, 73, 255, 14, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 8, 9, 10}; + 60, 61, 62, 63, 64, 75, 77, 78, 79, 65, 66, 67, 68, 70, 71, + 72, 14, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 8, 9, 10}; grpc_mdelem grpc_static_mdelem_for_static_strings(int a, int b) { if (a == -1 || b == -1) return GRPC_MDNULL; - uint32_t k = (uint32_t)(a * 99 + b); + uint32_t k = (uint32_t)(a * 97 + b); uint32_t h = elems_phash(k); return h < GPR_ARRAY_SIZE(elem_keys) && elem_keys[h] == k ? GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[elem_idxs[h]], @@ -488,328 +478,324 @@ grpc_mdelem grpc_static_mdelem_for_static_strings(int a, int b) { grpc_mdelem_data grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT] = { {{.refcount = &grpc_static_metadata_refcounts[7], .data.refcounted = {g_bytes + 50, 11}}, - {.refcount = &grpc_static_metadata_refcounts[26], - .data.refcounted = {g_bytes + 362, 1}}}, + {.refcount = &grpc_static_metadata_refcounts[25], + .data.refcounted = {g_bytes + 344, 1}}}, {{.refcount = &grpc_static_metadata_refcounts[7], .data.refcounted = {g_bytes + 50, 11}}, - {.refcount = &grpc_static_metadata_refcounts[27], - .data.refcounted = {g_bytes + 363, 1}}}, + {.refcount = &grpc_static_metadata_refcounts[26], + .data.refcounted = {g_bytes + 345, 1}}}, {{.refcount = &grpc_static_metadata_refcounts[7], .data.refcounted = {g_bytes + 50, 11}}, + {.refcount = &grpc_static_metadata_refcounts[27], + .data.refcounted = {g_bytes + 346, 1}}}, + {{.refcount = &grpc_static_metadata_refcounts[9], + .data.refcounted = {g_bytes + 77, 13}}, {.refcount = &grpc_static_metadata_refcounts[28], - .data.refcounted = {g_bytes + 364, 1}}}, + .data.refcounted = {g_bytes + 347, 8}}}, {{.refcount = &grpc_static_metadata_refcounts[9], .data.refcounted = {g_bytes + 77, 13}}, {.refcount = &grpc_static_metadata_refcounts[29], - .data.refcounted = {g_bytes + 365, 8}}}, + .data.refcounted = {g_bytes + 355, 4}}}, {{.refcount = &grpc_static_metadata_refcounts[9], .data.refcounted = {g_bytes + 77, 13}}, {.refcount = &grpc_static_metadata_refcounts[30], - .data.refcounted = {g_bytes + 373, 4}}}, - {{.refcount = &grpc_static_metadata_refcounts[9], - .data.refcounted = {g_bytes + 77, 13}}, - {.refcount = &grpc_static_metadata_refcounts[31], - .data.refcounted = {g_bytes + 377, 7}}}, + .data.refcounted = {g_bytes + 359, 7}}}, {{.refcount = &grpc_static_metadata_refcounts[5], .data.refcounted = {g_bytes + 36, 2}}, + {.refcount = &grpc_static_metadata_refcounts[31], + .data.refcounted = {g_bytes + 366, 8}}}, + {{.refcount = &grpc_static_metadata_refcounts[11], + .data.refcounted = {g_bytes + 110, 12}}, {.refcount = &grpc_static_metadata_refcounts[32], - .data.refcounted = {g_bytes + 384, 8}}}, - {{.refcount = &grpc_static_metadata_refcounts[14], - .data.refcounted = {g_bytes + 158, 12}}, - {.refcount = &grpc_static_metadata_refcounts[33], - .data.refcounted = {g_bytes + 392, 16}}}, + .data.refcounted = {g_bytes + 374, 16}}}, {{.refcount = &grpc_static_metadata_refcounts[1], .data.refcounted = {g_bytes + 5, 7}}, - {.refcount = &grpc_static_metadata_refcounts[34], - .data.refcounted = {g_bytes + 408, 4}}}, + {.refcount = &grpc_static_metadata_refcounts[33], + .data.refcounted = {g_bytes + 390, 4}}}, {{.refcount = &grpc_static_metadata_refcounts[2], .data.refcounted = {g_bytes + 12, 7}}, - {.refcount = &grpc_static_metadata_refcounts[35], - .data.refcounted = {g_bytes + 412, 3}}}, + {.refcount = &grpc_static_metadata_refcounts[34], + .data.refcounted = {g_bytes + 394, 3}}}, {{.refcount = &grpc_static_metadata_refcounts[2], .data.refcounted = {g_bytes + 12, 7}}, + {.refcount = &grpc_static_metadata_refcounts[35], + .data.refcounted = {g_bytes + 397, 3}}}, + {{.refcount = &grpc_static_metadata_refcounts[4], + .data.refcounted = {g_bytes + 29, 7}}, {.refcount = &grpc_static_metadata_refcounts[36], - .data.refcounted = {g_bytes + 415, 3}}}, + .data.refcounted = {g_bytes + 400, 4}}}, {{.refcount = &grpc_static_metadata_refcounts[4], .data.refcounted = {g_bytes + 29, 7}}, {.refcount = &grpc_static_metadata_refcounts[37], - .data.refcounted = {g_bytes + 418, 4}}}, + .data.refcounted = {g_bytes + 404, 5}}}, {{.refcount = &grpc_static_metadata_refcounts[4], .data.refcounted = {g_bytes + 29, 7}}, {.refcount = &grpc_static_metadata_refcounts[38], - .data.refcounted = {g_bytes + 422, 5}}}, - {{.refcount = &grpc_static_metadata_refcounts[4], - .data.refcounted = {g_bytes + 29, 7}}, - {.refcount = &grpc_static_metadata_refcounts[39], - .data.refcounted = {g_bytes + 427, 4}}}, + .data.refcounted = {g_bytes + 409, 4}}}, {{.refcount = &grpc_static_metadata_refcounts[3], .data.refcounted = {g_bytes + 19, 10}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[1], .data.refcounted = {g_bytes + 5, 7}}, - {.refcount = &grpc_static_metadata_refcounts[40], - .data.refcounted = {g_bytes + 431, 3}}}, + {.refcount = &grpc_static_metadata_refcounts[39], + .data.refcounted = {g_bytes + 413, 3}}}, {{.refcount = &grpc_static_metadata_refcounts[1], .data.refcounted = {g_bytes + 5, 7}}, - {.refcount = &grpc_static_metadata_refcounts[41], - .data.refcounted = {g_bytes + 434, 3}}}, + {.refcount = &grpc_static_metadata_refcounts[40], + .data.refcounted = {g_bytes + 416, 3}}}, {{.refcount = &grpc_static_metadata_refcounts[0], .data.refcounted = {g_bytes + 0, 5}}, - {.refcount = &grpc_static_metadata_refcounts[42], - .data.refcounted = {g_bytes + 437, 1}}}, + {.refcount = &grpc_static_metadata_refcounts[41], + .data.refcounted = {g_bytes + 419, 1}}}, {{.refcount = &grpc_static_metadata_refcounts[0], .data.refcounted = {g_bytes + 0, 5}}, + {.refcount = &grpc_static_metadata_refcounts[42], + .data.refcounted = {g_bytes + 420, 11}}}, + {{.refcount = &grpc_static_metadata_refcounts[2], + .data.refcounted = {g_bytes + 12, 7}}, {.refcount = &grpc_static_metadata_refcounts[43], - .data.refcounted = {g_bytes + 438, 11}}}, + .data.refcounted = {g_bytes + 431, 3}}}, {{.refcount = &grpc_static_metadata_refcounts[2], .data.refcounted = {g_bytes + 12, 7}}, {.refcount = &grpc_static_metadata_refcounts[44], - .data.refcounted = {g_bytes + 449, 3}}}, + .data.refcounted = {g_bytes + 434, 3}}}, {{.refcount = &grpc_static_metadata_refcounts[2], .data.refcounted = {g_bytes + 12, 7}}, {.refcount = &grpc_static_metadata_refcounts[45], - .data.refcounted = {g_bytes + 452, 3}}}, + .data.refcounted = {g_bytes + 437, 3}}}, {{.refcount = &grpc_static_metadata_refcounts[2], .data.refcounted = {g_bytes + 12, 7}}, {.refcount = &grpc_static_metadata_refcounts[46], - .data.refcounted = {g_bytes + 455, 3}}}, + .data.refcounted = {g_bytes + 440, 3}}}, {{.refcount = &grpc_static_metadata_refcounts[2], .data.refcounted = {g_bytes + 12, 7}}, {.refcount = &grpc_static_metadata_refcounts[47], - .data.refcounted = {g_bytes + 458, 3}}}, - {{.refcount = &grpc_static_metadata_refcounts[2], - .data.refcounted = {g_bytes + 12, 7}}, - {.refcount = &grpc_static_metadata_refcounts[48], - .data.refcounted = {g_bytes + 461, 3}}}, + .data.refcounted = {g_bytes + 443, 3}}}, + {{.refcount = &grpc_static_metadata_refcounts[48], + .data.refcounted = {g_bytes + 446, 14}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, + {{.refcount = &grpc_static_metadata_refcounts[49], + .data.refcounted = {g_bytes + 460, 15}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[49], - .data.refcounted = {g_bytes + 464, 14}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, - {{.refcount = &grpc_static_metadata_refcounts[50], - .data.refcounted = {g_bytes + 478, 15}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, - {{.refcount = &grpc_static_metadata_refcounts[50], - .data.refcounted = {g_bytes + 478, 15}}, - {.refcount = &grpc_static_metadata_refcounts[51], - .data.refcounted = {g_bytes + 493, 13}}}, + .data.refcounted = {g_bytes + 460, 15}}, + {.refcount = &grpc_static_metadata_refcounts[50], + .data.refcounted = {g_bytes + 475, 13}}}, + {{.refcount = &grpc_static_metadata_refcounts[51], + .data.refcounted = {g_bytes + 488, 15}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[52], - .data.refcounted = {g_bytes + 506, 15}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 503, 13}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[53], - .data.refcounted = {g_bytes + 521, 13}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 516, 6}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[54], - .data.refcounted = {g_bytes + 534, 6}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 522, 27}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[55], - .data.refcounted = {g_bytes + 540, 27}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 549, 3}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[56], - .data.refcounted = {g_bytes + 567, 3}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 552, 5}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[57], - .data.refcounted = {g_bytes + 570, 5}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 557, 13}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[58], - .data.refcounted = {g_bytes + 575, 13}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 570, 13}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[59], - .data.refcounted = {g_bytes + 588, 13}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 583, 19}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[60], - .data.refcounted = {g_bytes + 601, 19}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 602, 16}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[61], - .data.refcounted = {g_bytes + 620, 16}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 618, 16}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[62], - .data.refcounted = {g_bytes + 636, 16}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 634, 14}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[63], - .data.refcounted = {g_bytes + 652, 14}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 648, 16}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[64], - .data.refcounted = {g_bytes + 666, 16}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 664, 13}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, + {{.refcount = &grpc_static_metadata_refcounts[11], + .data.refcounted = {g_bytes + 110, 12}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[65], - .data.refcounted = {g_bytes + 682, 13}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, - {{.refcount = &grpc_static_metadata_refcounts[14], - .data.refcounted = {g_bytes + 158, 12}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 677, 6}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[66], - .data.refcounted = {g_bytes + 695, 6}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 683, 4}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[67], - .data.refcounted = {g_bytes + 701, 4}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 687, 4}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[68], - .data.refcounted = {g_bytes + 705, 4}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 691, 6}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[69], - .data.refcounted = {g_bytes + 709, 6}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 697, 7}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[70], - .data.refcounted = {g_bytes + 715, 7}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 704, 4}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, + {{.refcount = &grpc_static_metadata_refcounts[14], + .data.refcounted = {g_bytes + 162, 4}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[71], - .data.refcounted = {g_bytes + 722, 4}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, - {{.refcount = &grpc_static_metadata_refcounts[17], - .data.refcounted = {g_bytes + 210, 4}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 708, 8}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[72], - .data.refcounted = {g_bytes + 726, 8}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 716, 17}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[73], - .data.refcounted = {g_bytes + 734, 17}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 733, 13}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[74], - .data.refcounted = {g_bytes + 751, 13}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 746, 8}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[75], - .data.refcounted = {g_bytes + 764, 8}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 754, 19}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[76], - .data.refcounted = {g_bytes + 772, 19}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 773, 13}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, + {{.refcount = &grpc_static_metadata_refcounts[15], + .data.refcounted = {g_bytes + 166, 8}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[77], - .data.refcounted = {g_bytes + 791, 13}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, - {{.refcount = &grpc_static_metadata_refcounts[18], - .data.refcounted = {g_bytes + 214, 8}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 786, 4}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[78], - .data.refcounted = {g_bytes + 804, 11}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 790, 8}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[79], - .data.refcounted = {g_bytes + 815, 4}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 798, 12}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[80], - .data.refcounted = {g_bytes + 819, 8}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 810, 18}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[81], - .data.refcounted = {g_bytes + 827, 12}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 828, 19}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[82], - .data.refcounted = {g_bytes + 839, 18}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 847, 5}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[83], - .data.refcounted = {g_bytes + 857, 19}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 852, 7}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[84], - .data.refcounted = {g_bytes + 876, 5}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 859, 7}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[85], - .data.refcounted = {g_bytes + 881, 7}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 866, 11}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[86], - .data.refcounted = {g_bytes + 888, 7}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 877, 6}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[87], - .data.refcounted = {g_bytes + 895, 11}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 883, 10}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[88], - .data.refcounted = {g_bytes + 906, 6}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 893, 25}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[89], - .data.refcounted = {g_bytes + 912, 10}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 918, 17}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, + {{.refcount = &grpc_static_metadata_refcounts[13], + .data.refcounted = {g_bytes + 152, 10}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[90], - .data.refcounted = {g_bytes + 922, 25}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 935, 4}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[91], - .data.refcounted = {g_bytes + 947, 17}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, - {{.refcount = &grpc_static_metadata_refcounts[16], - .data.refcounted = {g_bytes + 200, 10}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 939, 3}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[92], - .data.refcounted = {g_bytes + 964, 4}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, - {{.refcount = &grpc_static_metadata_refcounts[93], - .data.refcounted = {g_bytes + 968, 3}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, - {{.refcount = &grpc_static_metadata_refcounts[94], - .data.refcounted = {g_bytes + 971, 16}}, - {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 234, 0}}}, + .data.refcounted = {g_bytes + 942, 16}}, + {.refcount = &grpc_static_metadata_refcounts[19], + .data.refcounted = {g_bytes + 216, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[10], .data.refcounted = {g_bytes + 90, 20}}, - {.refcount = &grpc_static_metadata_refcounts[29], - .data.refcounted = {g_bytes + 365, 8}}}, + {.refcount = &grpc_static_metadata_refcounts[28], + .data.refcounted = {g_bytes + 347, 8}}}, {{.refcount = &grpc_static_metadata_refcounts[10], .data.refcounted = {g_bytes + 90, 20}}, - {.refcount = &grpc_static_metadata_refcounts[31], - .data.refcounted = {g_bytes + 377, 7}}}, + {.refcount = &grpc_static_metadata_refcounts[30], + .data.refcounted = {g_bytes + 359, 7}}}, {{.refcount = &grpc_static_metadata_refcounts[10], .data.refcounted = {g_bytes + 90, 20}}, - {.refcount = &grpc_static_metadata_refcounts[95], - .data.refcounted = {g_bytes + 987, 16}}}, + {.refcount = &grpc_static_metadata_refcounts[93], + .data.refcounted = {g_bytes + 958, 16}}}, {{.refcount = &grpc_static_metadata_refcounts[10], .data.refcounted = {g_bytes + 90, 20}}, - {.refcount = &grpc_static_metadata_refcounts[30], - .data.refcounted = {g_bytes + 373, 4}}}, + {.refcount = &grpc_static_metadata_refcounts[29], + .data.refcounted = {g_bytes + 355, 4}}}, {{.refcount = &grpc_static_metadata_refcounts[10], .data.refcounted = {g_bytes + 90, 20}}, - {.refcount = &grpc_static_metadata_refcounts[96], - .data.refcounted = {g_bytes + 1003, 13}}}, + {.refcount = &grpc_static_metadata_refcounts[94], + .data.refcounted = {g_bytes + 974, 13}}}, {{.refcount = &grpc_static_metadata_refcounts[10], .data.refcounted = {g_bytes + 90, 20}}, - {.refcount = &grpc_static_metadata_refcounts[97], - .data.refcounted = {g_bytes + 1016, 12}}}, + {.refcount = &grpc_static_metadata_refcounts[95], + .data.refcounted = {g_bytes + 987, 12}}}, {{.refcount = &grpc_static_metadata_refcounts[10], .data.refcounted = {g_bytes + 90, 20}}, - {.refcount = &grpc_static_metadata_refcounts[98], - .data.refcounted = {g_bytes + 1028, 21}}}, + {.refcount = &grpc_static_metadata_refcounts[96], + .data.refcounted = {g_bytes + 999, 21}}}, }; -const uint8_t grpc_static_accept_encoding_metadata[8] = {0, 74, 75, 76, - 77, 78, 79, 80}; +const uint8_t grpc_static_accept_encoding_metadata[8] = {0, 73, 74, 75, + 76, 77, 78, 79}; diff --git a/src/core/lib/transport/static_metadata.h b/src/core/lib/transport/static_metadata.h index 84fb316fd66..f9600ee2e4e 100644 --- a/src/core/lib/transport/static_metadata.h +++ b/src/core/lib/transport/static_metadata.h @@ -44,7 +44,7 @@ #include "src/core/lib/transport/metadata.h" -#define GRPC_STATIC_MDSTR_COUNT 99 +#define GRPC_STATIC_MDSTR_COUNT 97 extern const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT]; /* ":path" */ #define GRPC_MDSTR_PATH (grpc_static_slice_table[0]) @@ -68,186 +68,182 @@ extern const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT]; #define GRPC_MDSTR_GRPC_ENCODING (grpc_static_slice_table[9]) /* "grpc-accept-encoding" */ #define GRPC_MDSTR_GRPC_ACCEPT_ENCODING (grpc_static_slice_table[10]) -/* "grpc-server-stats-bin" */ -#define GRPC_MDSTR_GRPC_SERVER_STATS_BIN (grpc_static_slice_table[11]) -/* "grpc-tags-bin" */ -#define GRPC_MDSTR_GRPC_TAGS_BIN (grpc_static_slice_table[12]) -/* "grpc-trace-bin" */ -#define GRPC_MDSTR_GRPC_TRACE_BIN (grpc_static_slice_table[13]) /* "content-type" */ -#define GRPC_MDSTR_CONTENT_TYPE (grpc_static_slice_table[14]) +#define GRPC_MDSTR_CONTENT_TYPE (grpc_static_slice_table[11]) /* "grpc-internal-encoding-request" */ -#define GRPC_MDSTR_GRPC_INTERNAL_ENCODING_REQUEST (grpc_static_slice_table[15]) +#define GRPC_MDSTR_GRPC_INTERNAL_ENCODING_REQUEST (grpc_static_slice_table[12]) /* "user-agent" */ -#define GRPC_MDSTR_USER_AGENT (grpc_static_slice_table[16]) +#define GRPC_MDSTR_USER_AGENT (grpc_static_slice_table[13]) /* "host" */ -#define GRPC_MDSTR_HOST (grpc_static_slice_table[17]) +#define GRPC_MDSTR_HOST (grpc_static_slice_table[14]) /* "lb-token" */ -#define GRPC_MDSTR_LB_TOKEN (grpc_static_slice_table[18]) +#define GRPC_MDSTR_LB_TOKEN (grpc_static_slice_table[15]) /* "grpc-timeout" */ -#define GRPC_MDSTR_GRPC_TIMEOUT (grpc_static_slice_table[19]) +#define GRPC_MDSTR_GRPC_TIMEOUT (grpc_static_slice_table[16]) +/* "grpc-tracing-bin" */ +#define GRPC_MDSTR_GRPC_TRACING_BIN (grpc_static_slice_table[17]) +/* "grpc-stats-bin" */ +#define GRPC_MDSTR_GRPC_STATS_BIN (grpc_static_slice_table[18]) /* "" */ -#define GRPC_MDSTR_EMPTY (grpc_static_slice_table[20]) +#define GRPC_MDSTR_EMPTY (grpc_static_slice_table[19]) /* "grpc.wait_for_ready" */ -#define GRPC_MDSTR_GRPC_DOT_WAIT_FOR_READY (grpc_static_slice_table[21]) +#define GRPC_MDSTR_GRPC_DOT_WAIT_FOR_READY (grpc_static_slice_table[20]) /* "grpc.timeout" */ -#define GRPC_MDSTR_GRPC_DOT_TIMEOUT (grpc_static_slice_table[22]) +#define GRPC_MDSTR_GRPC_DOT_TIMEOUT (grpc_static_slice_table[21]) /* "grpc.max_request_message_bytes" */ #define GRPC_MDSTR_GRPC_DOT_MAX_REQUEST_MESSAGE_BYTES \ - (grpc_static_slice_table[23]) + (grpc_static_slice_table[22]) /* "grpc.max_response_message_bytes" */ #define GRPC_MDSTR_GRPC_DOT_MAX_RESPONSE_MESSAGE_BYTES \ - (grpc_static_slice_table[24]) + (grpc_static_slice_table[23]) /* "/grpc.lb.v1.LoadBalancer/BalanceLoad" */ #define GRPC_MDSTR_SLASH_GRPC_DOT_LB_DOT_V1_DOT_LOADBALANCER_SLASH_BALANCELOAD \ - (grpc_static_slice_table[25]) + (grpc_static_slice_table[24]) /* "0" */ -#define GRPC_MDSTR_0 (grpc_static_slice_table[26]) +#define GRPC_MDSTR_0 (grpc_static_slice_table[25]) /* "1" */ -#define GRPC_MDSTR_1 (grpc_static_slice_table[27]) +#define GRPC_MDSTR_1 (grpc_static_slice_table[26]) /* "2" */ -#define GRPC_MDSTR_2 (grpc_static_slice_table[28]) +#define GRPC_MDSTR_2 (grpc_static_slice_table[27]) /* "identity" */ -#define GRPC_MDSTR_IDENTITY (grpc_static_slice_table[29]) +#define GRPC_MDSTR_IDENTITY (grpc_static_slice_table[28]) /* "gzip" */ -#define GRPC_MDSTR_GZIP (grpc_static_slice_table[30]) +#define GRPC_MDSTR_GZIP (grpc_static_slice_table[29]) /* "deflate" */ -#define GRPC_MDSTR_DEFLATE (grpc_static_slice_table[31]) +#define GRPC_MDSTR_DEFLATE (grpc_static_slice_table[30]) /* "trailers" */ -#define GRPC_MDSTR_TRAILERS (grpc_static_slice_table[32]) +#define GRPC_MDSTR_TRAILERS (grpc_static_slice_table[31]) /* "application/grpc" */ -#define GRPC_MDSTR_APPLICATION_SLASH_GRPC (grpc_static_slice_table[33]) +#define GRPC_MDSTR_APPLICATION_SLASH_GRPC (grpc_static_slice_table[32]) /* "POST" */ -#define GRPC_MDSTR_POST (grpc_static_slice_table[34]) +#define GRPC_MDSTR_POST (grpc_static_slice_table[33]) /* "200" */ -#define GRPC_MDSTR_200 (grpc_static_slice_table[35]) +#define GRPC_MDSTR_200 (grpc_static_slice_table[34]) /* "404" */ -#define GRPC_MDSTR_404 (grpc_static_slice_table[36]) +#define GRPC_MDSTR_404 (grpc_static_slice_table[35]) /* "http" */ -#define GRPC_MDSTR_HTTP (grpc_static_slice_table[37]) +#define GRPC_MDSTR_HTTP (grpc_static_slice_table[36]) /* "https" */ -#define GRPC_MDSTR_HTTPS (grpc_static_slice_table[38]) +#define GRPC_MDSTR_HTTPS (grpc_static_slice_table[37]) /* "grpc" */ -#define GRPC_MDSTR_GRPC (grpc_static_slice_table[39]) +#define GRPC_MDSTR_GRPC (grpc_static_slice_table[38]) /* "GET" */ -#define GRPC_MDSTR_GET (grpc_static_slice_table[40]) +#define GRPC_MDSTR_GET (grpc_static_slice_table[39]) /* "PUT" */ -#define GRPC_MDSTR_PUT (grpc_static_slice_table[41]) +#define GRPC_MDSTR_PUT (grpc_static_slice_table[40]) /* "/" */ -#define GRPC_MDSTR_SLASH (grpc_static_slice_table[42]) +#define GRPC_MDSTR_SLASH (grpc_static_slice_table[41]) /* "/index.html" */ -#define GRPC_MDSTR_SLASH_INDEX_DOT_HTML (grpc_static_slice_table[43]) +#define GRPC_MDSTR_SLASH_INDEX_DOT_HTML (grpc_static_slice_table[42]) /* "204" */ -#define GRPC_MDSTR_204 (grpc_static_slice_table[44]) +#define GRPC_MDSTR_204 (grpc_static_slice_table[43]) /* "206" */ -#define GRPC_MDSTR_206 (grpc_static_slice_table[45]) +#define GRPC_MDSTR_206 (grpc_static_slice_table[44]) /* "304" */ -#define GRPC_MDSTR_304 (grpc_static_slice_table[46]) +#define GRPC_MDSTR_304 (grpc_static_slice_table[45]) /* "400" */ -#define GRPC_MDSTR_400 (grpc_static_slice_table[47]) +#define GRPC_MDSTR_400 (grpc_static_slice_table[46]) /* "500" */ -#define GRPC_MDSTR_500 (grpc_static_slice_table[48]) +#define GRPC_MDSTR_500 (grpc_static_slice_table[47]) /* "accept-charset" */ -#define GRPC_MDSTR_ACCEPT_CHARSET (grpc_static_slice_table[49]) +#define GRPC_MDSTR_ACCEPT_CHARSET (grpc_static_slice_table[48]) /* "accept-encoding" */ -#define GRPC_MDSTR_ACCEPT_ENCODING (grpc_static_slice_table[50]) +#define GRPC_MDSTR_ACCEPT_ENCODING (grpc_static_slice_table[49]) /* "gzip, deflate" */ -#define GRPC_MDSTR_GZIP_COMMA_DEFLATE (grpc_static_slice_table[51]) +#define GRPC_MDSTR_GZIP_COMMA_DEFLATE (grpc_static_slice_table[50]) /* "accept-language" */ -#define GRPC_MDSTR_ACCEPT_LANGUAGE (grpc_static_slice_table[52]) +#define GRPC_MDSTR_ACCEPT_LANGUAGE (grpc_static_slice_table[51]) /* "accept-ranges" */ -#define GRPC_MDSTR_ACCEPT_RANGES (grpc_static_slice_table[53]) +#define GRPC_MDSTR_ACCEPT_RANGES (grpc_static_slice_table[52]) /* "accept" */ -#define GRPC_MDSTR_ACCEPT (grpc_static_slice_table[54]) +#define GRPC_MDSTR_ACCEPT (grpc_static_slice_table[53]) /* "access-control-allow-origin" */ -#define GRPC_MDSTR_ACCESS_CONTROL_ALLOW_ORIGIN (grpc_static_slice_table[55]) +#define GRPC_MDSTR_ACCESS_CONTROL_ALLOW_ORIGIN (grpc_static_slice_table[54]) /* "age" */ -#define GRPC_MDSTR_AGE (grpc_static_slice_table[56]) +#define GRPC_MDSTR_AGE (grpc_static_slice_table[55]) /* "allow" */ -#define GRPC_MDSTR_ALLOW (grpc_static_slice_table[57]) +#define GRPC_MDSTR_ALLOW (grpc_static_slice_table[56]) /* "authorization" */ -#define GRPC_MDSTR_AUTHORIZATION (grpc_static_slice_table[58]) +#define GRPC_MDSTR_AUTHORIZATION (grpc_static_slice_table[57]) /* "cache-control" */ -#define GRPC_MDSTR_CACHE_CONTROL (grpc_static_slice_table[59]) +#define GRPC_MDSTR_CACHE_CONTROL (grpc_static_slice_table[58]) /* "content-disposition" */ -#define GRPC_MDSTR_CONTENT_DISPOSITION (grpc_static_slice_table[60]) +#define GRPC_MDSTR_CONTENT_DISPOSITION (grpc_static_slice_table[59]) /* "content-encoding" */ -#define GRPC_MDSTR_CONTENT_ENCODING (grpc_static_slice_table[61]) +#define GRPC_MDSTR_CONTENT_ENCODING (grpc_static_slice_table[60]) /* "content-language" */ -#define GRPC_MDSTR_CONTENT_LANGUAGE (grpc_static_slice_table[62]) +#define GRPC_MDSTR_CONTENT_LANGUAGE (grpc_static_slice_table[61]) /* "content-length" */ -#define GRPC_MDSTR_CONTENT_LENGTH (grpc_static_slice_table[63]) +#define GRPC_MDSTR_CONTENT_LENGTH (grpc_static_slice_table[62]) /* "content-location" */ -#define GRPC_MDSTR_CONTENT_LOCATION (grpc_static_slice_table[64]) +#define GRPC_MDSTR_CONTENT_LOCATION (grpc_static_slice_table[63]) /* "content-range" */ -#define GRPC_MDSTR_CONTENT_RANGE (grpc_static_slice_table[65]) +#define GRPC_MDSTR_CONTENT_RANGE (grpc_static_slice_table[64]) /* "cookie" */ -#define GRPC_MDSTR_COOKIE (grpc_static_slice_table[66]) +#define GRPC_MDSTR_COOKIE (grpc_static_slice_table[65]) /* "date" */ -#define GRPC_MDSTR_DATE (grpc_static_slice_table[67]) +#define GRPC_MDSTR_DATE (grpc_static_slice_table[66]) /* "etag" */ -#define GRPC_MDSTR_ETAG (grpc_static_slice_table[68]) +#define GRPC_MDSTR_ETAG (grpc_static_slice_table[67]) /* "expect" */ -#define GRPC_MDSTR_EXPECT (grpc_static_slice_table[69]) +#define GRPC_MDSTR_EXPECT (grpc_static_slice_table[68]) /* "expires" */ -#define GRPC_MDSTR_EXPIRES (grpc_static_slice_table[70]) +#define GRPC_MDSTR_EXPIRES (grpc_static_slice_table[69]) /* "from" */ -#define GRPC_MDSTR_FROM (grpc_static_slice_table[71]) +#define GRPC_MDSTR_FROM (grpc_static_slice_table[70]) /* "if-match" */ -#define GRPC_MDSTR_IF_MATCH (grpc_static_slice_table[72]) +#define GRPC_MDSTR_IF_MATCH (grpc_static_slice_table[71]) /* "if-modified-since" */ -#define GRPC_MDSTR_IF_MODIFIED_SINCE (grpc_static_slice_table[73]) +#define GRPC_MDSTR_IF_MODIFIED_SINCE (grpc_static_slice_table[72]) /* "if-none-match" */ -#define GRPC_MDSTR_IF_NONE_MATCH (grpc_static_slice_table[74]) +#define GRPC_MDSTR_IF_NONE_MATCH (grpc_static_slice_table[73]) /* "if-range" */ -#define GRPC_MDSTR_IF_RANGE (grpc_static_slice_table[75]) +#define GRPC_MDSTR_IF_RANGE (grpc_static_slice_table[74]) /* "if-unmodified-since" */ -#define GRPC_MDSTR_IF_UNMODIFIED_SINCE (grpc_static_slice_table[76]) +#define GRPC_MDSTR_IF_UNMODIFIED_SINCE (grpc_static_slice_table[75]) /* "last-modified" */ -#define GRPC_MDSTR_LAST_MODIFIED (grpc_static_slice_table[77]) -/* "lb-cost-bin" */ -#define GRPC_MDSTR_LB_COST_BIN (grpc_static_slice_table[78]) +#define GRPC_MDSTR_LAST_MODIFIED (grpc_static_slice_table[76]) /* "link" */ -#define GRPC_MDSTR_LINK (grpc_static_slice_table[79]) +#define GRPC_MDSTR_LINK (grpc_static_slice_table[77]) /* "location" */ -#define GRPC_MDSTR_LOCATION (grpc_static_slice_table[80]) +#define GRPC_MDSTR_LOCATION (grpc_static_slice_table[78]) /* "max-forwards" */ -#define GRPC_MDSTR_MAX_FORWARDS (grpc_static_slice_table[81]) +#define GRPC_MDSTR_MAX_FORWARDS (grpc_static_slice_table[79]) /* "proxy-authenticate" */ -#define GRPC_MDSTR_PROXY_AUTHENTICATE (grpc_static_slice_table[82]) +#define GRPC_MDSTR_PROXY_AUTHENTICATE (grpc_static_slice_table[80]) /* "proxy-authorization" */ -#define GRPC_MDSTR_PROXY_AUTHORIZATION (grpc_static_slice_table[83]) +#define GRPC_MDSTR_PROXY_AUTHORIZATION (grpc_static_slice_table[81]) /* "range" */ -#define GRPC_MDSTR_RANGE (grpc_static_slice_table[84]) +#define GRPC_MDSTR_RANGE (grpc_static_slice_table[82]) /* "referer" */ -#define GRPC_MDSTR_REFERER (grpc_static_slice_table[85]) +#define GRPC_MDSTR_REFERER (grpc_static_slice_table[83]) /* "refresh" */ -#define GRPC_MDSTR_REFRESH (grpc_static_slice_table[86]) +#define GRPC_MDSTR_REFRESH (grpc_static_slice_table[84]) /* "retry-after" */ -#define GRPC_MDSTR_RETRY_AFTER (grpc_static_slice_table[87]) +#define GRPC_MDSTR_RETRY_AFTER (grpc_static_slice_table[85]) /* "server" */ -#define GRPC_MDSTR_SERVER (grpc_static_slice_table[88]) +#define GRPC_MDSTR_SERVER (grpc_static_slice_table[86]) /* "set-cookie" */ -#define GRPC_MDSTR_SET_COOKIE (grpc_static_slice_table[89]) +#define GRPC_MDSTR_SET_COOKIE (grpc_static_slice_table[87]) /* "strict-transport-security" */ -#define GRPC_MDSTR_STRICT_TRANSPORT_SECURITY (grpc_static_slice_table[90]) +#define GRPC_MDSTR_STRICT_TRANSPORT_SECURITY (grpc_static_slice_table[88]) /* "transfer-encoding" */ -#define GRPC_MDSTR_TRANSFER_ENCODING (grpc_static_slice_table[91]) +#define GRPC_MDSTR_TRANSFER_ENCODING (grpc_static_slice_table[89]) /* "vary" */ -#define GRPC_MDSTR_VARY (grpc_static_slice_table[92]) +#define GRPC_MDSTR_VARY (grpc_static_slice_table[90]) /* "via" */ -#define GRPC_MDSTR_VIA (grpc_static_slice_table[93]) +#define GRPC_MDSTR_VIA (grpc_static_slice_table[91]) /* "www-authenticate" */ -#define GRPC_MDSTR_WWW_AUTHENTICATE (grpc_static_slice_table[94]) +#define GRPC_MDSTR_WWW_AUTHENTICATE (grpc_static_slice_table[92]) /* "identity,deflate" */ -#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE (grpc_static_slice_table[95]) +#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE (grpc_static_slice_table[93]) /* "identity,gzip" */ -#define GRPC_MDSTR_IDENTITY_COMMA_GZIP (grpc_static_slice_table[96]) +#define GRPC_MDSTR_IDENTITY_COMMA_GZIP (grpc_static_slice_table[94]) /* "deflate,gzip" */ -#define GRPC_MDSTR_DEFLATE_COMMA_GZIP (grpc_static_slice_table[97]) +#define GRPC_MDSTR_DEFLATE_COMMA_GZIP (grpc_static_slice_table[95]) /* "identity,deflate,gzip" */ #define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE_COMMA_GZIP \ - (grpc_static_slice_table[98]) + (grpc_static_slice_table[96]) extern const grpc_slice_refcount_vtable grpc_static_metadata_vtable; extern grpc_slice_refcount @@ -259,7 +255,7 @@ extern grpc_slice_refcount #define GRPC_STATIC_METADATA_INDEX(static_slice) \ ((int)((static_slice).refcount - grpc_static_metadata_refcounts)) -#define GRPC_STATIC_MDELEM_COUNT 81 +#define GRPC_STATIC_MDELEM_COUNT 80 extern grpc_mdelem_data grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT]; extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT]; /* "grpc-status": "0" */ @@ -430,81 +426,78 @@ extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT]; /* "lb-token": "" */ #define GRPC_MDELEM_LB_TOKEN_EMPTY \ (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[55], GRPC_MDELEM_STORAGE_STATIC)) -/* "lb-cost-bin": "" */ -#define GRPC_MDELEM_LB_COST_BIN_EMPTY \ - (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[56], GRPC_MDELEM_STORAGE_STATIC)) /* "link": "" */ #define GRPC_MDELEM_LINK_EMPTY \ - (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[57], GRPC_MDELEM_STORAGE_STATIC)) + (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[56], GRPC_MDELEM_STORAGE_STATIC)) /* "location": "" */ #define GRPC_MDELEM_LOCATION_EMPTY \ - (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[58], GRPC_MDELEM_STORAGE_STATIC)) + (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[57], GRPC_MDELEM_STORAGE_STATIC)) /* "max-forwards": "" */ #define GRPC_MDELEM_MAX_FORWARDS_EMPTY \ - (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[59], GRPC_MDELEM_STORAGE_STATIC)) + (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[58], GRPC_MDELEM_STORAGE_STATIC)) /* "proxy-authenticate": "" */ #define GRPC_MDELEM_PROXY_AUTHENTICATE_EMPTY \ - (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[60], GRPC_MDELEM_STORAGE_STATIC)) + (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[59], GRPC_MDELEM_STORAGE_STATIC)) /* "proxy-authorization": "" */ #define GRPC_MDELEM_PROXY_AUTHORIZATION_EMPTY \ - (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[61], GRPC_MDELEM_STORAGE_STATIC)) + (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[60], GRPC_MDELEM_STORAGE_STATIC)) /* "range": "" */ #define GRPC_MDELEM_RANGE_EMPTY \ - (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[62], GRPC_MDELEM_STORAGE_STATIC)) + (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[61], GRPC_MDELEM_STORAGE_STATIC)) /* "referer": "" */ #define GRPC_MDELEM_REFERER_EMPTY \ - (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[63], GRPC_MDELEM_STORAGE_STATIC)) + (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[62], GRPC_MDELEM_STORAGE_STATIC)) /* "refresh": "" */ #define GRPC_MDELEM_REFRESH_EMPTY \ - (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[64], GRPC_MDELEM_STORAGE_STATIC)) + (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[63], GRPC_MDELEM_STORAGE_STATIC)) /* "retry-after": "" */ #define GRPC_MDELEM_RETRY_AFTER_EMPTY \ - (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[65], GRPC_MDELEM_STORAGE_STATIC)) + (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[64], GRPC_MDELEM_STORAGE_STATIC)) /* "server": "" */ #define GRPC_MDELEM_SERVER_EMPTY \ - (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[66], GRPC_MDELEM_STORAGE_STATIC)) + (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[65], GRPC_MDELEM_STORAGE_STATIC)) /* "set-cookie": "" */ #define GRPC_MDELEM_SET_COOKIE_EMPTY \ - (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[67], GRPC_MDELEM_STORAGE_STATIC)) + (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[66], GRPC_MDELEM_STORAGE_STATIC)) /* "strict-transport-security": "" */ #define GRPC_MDELEM_STRICT_TRANSPORT_SECURITY_EMPTY \ - (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[68], GRPC_MDELEM_STORAGE_STATIC)) + (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[67], GRPC_MDELEM_STORAGE_STATIC)) /* "transfer-encoding": "" */ #define GRPC_MDELEM_TRANSFER_ENCODING_EMPTY \ - (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[69], GRPC_MDELEM_STORAGE_STATIC)) + (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[68], GRPC_MDELEM_STORAGE_STATIC)) /* "user-agent": "" */ #define GRPC_MDELEM_USER_AGENT_EMPTY \ - (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[70], GRPC_MDELEM_STORAGE_STATIC)) + (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[69], GRPC_MDELEM_STORAGE_STATIC)) /* "vary": "" */ #define GRPC_MDELEM_VARY_EMPTY \ - (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[71], GRPC_MDELEM_STORAGE_STATIC)) + (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[70], GRPC_MDELEM_STORAGE_STATIC)) /* "via": "" */ #define GRPC_MDELEM_VIA_EMPTY \ - (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[72], GRPC_MDELEM_STORAGE_STATIC)) + (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[71], GRPC_MDELEM_STORAGE_STATIC)) /* "www-authenticate": "" */ #define GRPC_MDELEM_WWW_AUTHENTICATE_EMPTY \ - (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[73], GRPC_MDELEM_STORAGE_STATIC)) + (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[72], GRPC_MDELEM_STORAGE_STATIC)) /* "grpc-accept-encoding": "identity" */ #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY \ - (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[74], GRPC_MDELEM_STORAGE_STATIC)) + (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[73], GRPC_MDELEM_STORAGE_STATIC)) /* "grpc-accept-encoding": "deflate" */ #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE \ - (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[75], GRPC_MDELEM_STORAGE_STATIC)) + (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[74], GRPC_MDELEM_STORAGE_STATIC)) /* "grpc-accept-encoding": "identity,deflate" */ #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE \ - (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[76], GRPC_MDELEM_STORAGE_STATIC)) + (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[75], GRPC_MDELEM_STORAGE_STATIC)) /* "grpc-accept-encoding": "gzip" */ #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_GZIP \ - (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[77], GRPC_MDELEM_STORAGE_STATIC)) + (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[76], GRPC_MDELEM_STORAGE_STATIC)) /* "grpc-accept-encoding": "identity,gzip" */ #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_GZIP \ - (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[78], GRPC_MDELEM_STORAGE_STATIC)) + (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[77], GRPC_MDELEM_STORAGE_STATIC)) /* "grpc-accept-encoding": "deflate,gzip" */ #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE_COMMA_GZIP \ - (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[79], GRPC_MDELEM_STORAGE_STATIC)) + (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[78], GRPC_MDELEM_STORAGE_STATIC)) /* "grpc-accept-encoding": "identity,deflate,gzip" */ #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE_COMMA_GZIP \ - (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[80], GRPC_MDELEM_STORAGE_STATIC)) + (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[79], GRPC_MDELEM_STORAGE_STATIC)) grpc_mdelem grpc_static_mdelem_for_static_strings(int a, int b); typedef enum { @@ -519,9 +512,6 @@ typedef enum { GRPC_BATCH_GRPC_PAYLOAD_BIN, GRPC_BATCH_GRPC_ENCODING, GRPC_BATCH_GRPC_ACCEPT_ENCODING, - GRPC_BATCH_GRPC_SERVER_STATS_BIN, - GRPC_BATCH_GRPC_TAGS_BIN, - GRPC_BATCH_GRPC_TRACE_BIN, GRPC_BATCH_CONTENT_TYPE, GRPC_BATCH_GRPC_INTERNAL_ENCODING_REQUEST, GRPC_BATCH_USER_AGENT, @@ -544,9 +534,6 @@ typedef union { struct grpc_linked_mdelem *grpc_payload_bin; struct grpc_linked_mdelem *grpc_encoding; struct grpc_linked_mdelem *grpc_accept_encoding; - struct grpc_linked_mdelem *grpc_server_stats_bin; - struct grpc_linked_mdelem *grpc_tags_bin; - struct grpc_linked_mdelem *grpc_trace_bin; struct grpc_linked_mdelem *content_type; struct grpc_linked_mdelem *grpc_internal_encoding_request; struct grpc_linked_mdelem *user_agent; diff --git a/src/core/plugin_registry/grpc_cronet_plugin_registry.c b/src/core/plugin_registry/grpc_cronet_plugin_registry.c index 907e5a0f394..c97f47b397a 100644 --- a/src/core/plugin_registry/grpc_cronet_plugin_registry.c +++ b/src/core/plugin_registry/grpc_cronet_plugin_registry.c @@ -33,24 +33,16 @@ #include -extern void grpc_http_filters_init(void); -extern void grpc_http_filters_shutdown(void); extern void grpc_chttp2_plugin_init(void); extern void grpc_chttp2_plugin_shutdown(void); -extern void grpc_deadline_filter_init(void); -extern void grpc_deadline_filter_shutdown(void); extern void grpc_client_channel_init(void); extern void grpc_client_channel_shutdown(void); extern void grpc_load_reporting_plugin_init(void); extern void grpc_load_reporting_plugin_shutdown(void); void grpc_register_built_in_plugins(void) { - grpc_register_plugin(grpc_http_filters_init, - grpc_http_filters_shutdown); grpc_register_plugin(grpc_chttp2_plugin_init, grpc_chttp2_plugin_shutdown); - grpc_register_plugin(grpc_deadline_filter_init, - grpc_deadline_filter_shutdown); grpc_register_plugin(grpc_client_channel_init, grpc_client_channel_shutdown); grpc_register_plugin(grpc_load_reporting_plugin_init, diff --git a/src/core/plugin_registry/grpc_plugin_registry.c b/src/core/plugin_registry/grpc_plugin_registry.c index 25bda7a2622..803a26b7534 100644 --- a/src/core/plugin_registry/grpc_plugin_registry.c +++ b/src/core/plugin_registry/grpc_plugin_registry.c @@ -33,12 +33,8 @@ #include -extern void grpc_http_filters_init(void); -extern void grpc_http_filters_shutdown(void); extern void grpc_chttp2_plugin_init(void); extern void grpc_chttp2_plugin_shutdown(void); -extern void grpc_deadline_filter_init(void); -extern void grpc_deadline_filter_shutdown(void); extern void grpc_client_channel_init(void); extern void grpc_client_channel_shutdown(void); extern void grpc_lb_policy_grpclb_init(void); @@ -59,16 +55,10 @@ extern void census_grpc_plugin_init(void); extern void census_grpc_plugin_shutdown(void); extern void grpc_max_age_filter_init(void); extern void grpc_max_age_filter_shutdown(void); -extern void grpc_message_size_filter_init(void); -extern void grpc_message_size_filter_shutdown(void); void grpc_register_built_in_plugins(void) { - grpc_register_plugin(grpc_http_filters_init, - grpc_http_filters_shutdown); grpc_register_plugin(grpc_chttp2_plugin_init, grpc_chttp2_plugin_shutdown); - grpc_register_plugin(grpc_deadline_filter_init, - grpc_deadline_filter_shutdown); grpc_register_plugin(grpc_client_channel_init, grpc_client_channel_shutdown); grpc_register_plugin(grpc_lb_policy_grpclb_init, @@ -89,6 +79,4 @@ void grpc_register_built_in_plugins(void) { census_grpc_plugin_shutdown); grpc_register_plugin(grpc_max_age_filter_init, grpc_max_age_filter_shutdown); - grpc_register_plugin(grpc_message_size_filter_init, - grpc_message_size_filter_shutdown); } diff --git a/src/core/plugin_registry/grpc_unsecure_plugin_registry.c b/src/core/plugin_registry/grpc_unsecure_plugin_registry.c index 05d4771bce3..e65fc2425d9 100644 --- a/src/core/plugin_registry/grpc_unsecure_plugin_registry.c +++ b/src/core/plugin_registry/grpc_unsecure_plugin_registry.c @@ -33,12 +33,8 @@ #include -extern void grpc_http_filters_init(void); -extern void grpc_http_filters_shutdown(void); extern void grpc_chttp2_plugin_init(void); extern void grpc_chttp2_plugin_shutdown(void); -extern void grpc_deadline_filter_init(void); -extern void grpc_deadline_filter_shutdown(void); extern void grpc_client_channel_init(void); extern void grpc_client_channel_shutdown(void); extern void grpc_resolver_dns_ares_init(void); @@ -59,16 +55,10 @@ extern void census_grpc_plugin_init(void); extern void census_grpc_plugin_shutdown(void); extern void grpc_max_age_filter_init(void); extern void grpc_max_age_filter_shutdown(void); -extern void grpc_message_size_filter_init(void); -extern void grpc_message_size_filter_shutdown(void); void grpc_register_built_in_plugins(void) { - grpc_register_plugin(grpc_http_filters_init, - grpc_http_filters_shutdown); grpc_register_plugin(grpc_chttp2_plugin_init, grpc_chttp2_plugin_shutdown); - grpc_register_plugin(grpc_deadline_filter_init, - grpc_deadline_filter_shutdown); grpc_register_plugin(grpc_client_channel_init, grpc_client_channel_shutdown); grpc_register_plugin(grpc_resolver_dns_ares_init, @@ -89,6 +79,4 @@ void grpc_register_built_in_plugins(void) { census_grpc_plugin_shutdown); grpc_register_plugin(grpc_max_age_filter_init, grpc_max_age_filter_shutdown); - grpc_register_plugin(grpc_message_size_filter_init, - grpc_message_size_filter_shutdown); } diff --git a/src/core/tsi/ssl_transport_security.c b/src/core/tsi/ssl_transport_security.c index 5f4705db926..984f745b01d 100644 --- a/src/core/tsi/ssl_transport_security.c +++ b/src/core/tsi/ssl_transport_security.c @@ -45,7 +45,6 @@ #include #else #include -#include #endif #include diff --git a/src/cpp/client/channel_cc.cc b/src/cpp/client/channel_cc.cc index fac1ba9d43c..c985183ae76 100644 --- a/src/cpp/client/channel_cc.cc +++ b/src/cpp/client/channel_cc.cc @@ -131,7 +131,7 @@ void Channel::PerformOpsOnCall(CallOpSetInterface* ops, Call* call) { static const size_t MAX_OPS = 8; size_t nops = 0; grpc_op cops[MAX_OPS]; - ops->FillOps(call->call(), cops, &nops); + ops->FillOps(cops, &nops); GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(call->call(), cops, nops, ops, nullptr)); } diff --git a/src/cpp/client/client_context.cc b/src/cpp/client/client_context.cc index 25162328408..3d884cf62e4 100644 --- a/src/cpp/client/client_context.cc +++ b/src/cpp/client/client_context.cc @@ -74,7 +74,7 @@ ClientContext::ClientContext() ClientContext::~ClientContext() { if (call_) { - grpc_call_unref(call_); + grpc_call_destroy(call_); } g_client_callbacks->Destructor(this); } diff --git a/src/cpp/client/generic_stub.cc b/src/cpp/client/generic_stub.cc index 4adb2a53599..7a2fdf941ce 100644 --- a/src/cpp/client/generic_stub.cc +++ b/src/cpp/client/generic_stub.cc @@ -42,7 +42,7 @@ std::unique_ptr GenericStub::Call( ClientContext* context, const grpc::string& method, CompletionQueue* cq, void* tag) { return std::unique_ptr( - GenericClientAsyncReaderWriter::Create( + new GenericClientAsyncReaderWriter( channel_.get(), cq, RpcMethod(method.c_str(), RpcMethod::BIDI_STREAMING), context, tag)); } diff --git a/src/cpp/common/core_codegen.cc b/src/cpp/common/core_codegen.cc index f679a339456..43dffe7a2a9 100644 --- a/src/cpp/common/core_codegen.cc +++ b/src/cpp/common/core_codegen.cc @@ -54,26 +54,9 @@ struct grpc_byte_buffer; namespace grpc { -const grpc_completion_queue_factory* -CoreCodegen::grpc_completion_queue_factory_lookup( - const grpc_completion_queue_attributes* attributes) { - return ::grpc_completion_queue_factory_lookup(attributes); -} - grpc_completion_queue* CoreCodegen::grpc_completion_queue_create( - const grpc_completion_queue_factory* factory, - const grpc_completion_queue_attributes* attributes, void* reserved) { - return ::grpc_completion_queue_create(factory, attributes, reserved); -} - -grpc_completion_queue* CoreCodegen::grpc_completion_queue_create_for_next( void* reserved) { - return ::grpc_completion_queue_create_for_next(reserved); -} - -grpc_completion_queue* CoreCodegen::grpc_completion_queue_create_for_pluck( - void* reserved) { - return ::grpc_completion_queue_create_for_pluck(reserved); + return ::grpc_completion_queue_create(reserved); } void CoreCodegen::grpc_completion_queue_destroy(grpc_completion_queue* cq) { @@ -108,12 +91,6 @@ void CoreCodegen::grpc_byte_buffer_destroy(grpc_byte_buffer* bb) { ::grpc_byte_buffer_destroy(bb); } -void CoreCodegen::grpc_call_ref(grpc_call* call) { ::grpc_call_ref(call); } -void CoreCodegen::grpc_call_unref(grpc_call* call) { ::grpc_call_unref(call); } -void* CoreCodegen::grpc_call_arena_alloc(grpc_call* call, size_t length) { - return ::grpc_call_arena_alloc(call, length); -} - int CoreCodegen::grpc_byte_buffer_reader_init(grpc_byte_buffer_reader* reader, grpc_byte_buffer* buffer) { return ::grpc_byte_buffer_reader_init(reader, buffer); diff --git a/src/cpp/common/version_cc.cc b/src/cpp/common/version_cc.cc index 72a4c4cf94a..16a295de2ea 100644 --- a/src/cpp/common/version_cc.cc +++ b/src/cpp/common/version_cc.cc @@ -37,5 +37,5 @@ #include namespace grpc { -grpc::string Version() { return "1.4.0-dev"; } +grpc::string Version() { return "1.3.0-pre1"; } } diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc index 2ead048a1ff..4eb4b5a1b21 100644 --- a/src/cpp/server/server_builder.cc +++ b/src/cpp/server/server_builder.cc @@ -83,8 +83,7 @@ ServerBuilder::~ServerBuilder() { std::unique_ptr ServerBuilder::AddCompletionQueue( bool is_frequently_polled) { - ServerCompletionQueue* cq = new ServerCompletionQueue( - is_frequently_polled ? GRPC_CQ_DEFAULT_POLLING : GRPC_CQ_NON_LISTENING); + ServerCompletionQueue* cq = new ServerCompletionQueue(is_frequently_polled); cqs_.push_back(cq); return std::unique_ptr(cq); } @@ -243,16 +242,6 @@ std::unique_ptr ServerBuilder::BuildAndStart() { sync_server_cqs(std::make_shared< std::vector>>()); - int num_frequently_polled_cqs = 0; - for (auto it = cqs_.begin(); it != cqs_.end(); ++it) { - if ((*it)->IsFrequentlyPolled()) { - num_frequently_polled_cqs++; - } - } - - const bool is_hybrid_server = - has_sync_methods && num_frequently_polled_cqs > 0; - if (has_sync_methods) { // This is a Sync server gpr_log(GPR_INFO, @@ -262,12 +251,9 @@ std::unique_ptr ServerBuilder::BuildAndStart() { sync_server_settings_.max_pollers, sync_server_settings_.cq_timeout_msec); - grpc_cq_polling_type polling_type = - is_hybrid_server ? GRPC_CQ_NON_POLLING : GRPC_CQ_DEFAULT_POLLING; - // Create completion queues to listen to incoming rpc requests for (int i = 0; i < sync_server_settings_.num_cqs; i++) { - sync_server_cqs->emplace_back(new ServerCompletionQueue(polling_type)); + sync_server_cqs->emplace_back(new ServerCompletionQueue()); } } @@ -283,10 +269,12 @@ std::unique_ptr ServerBuilder::BuildAndStart() { // server // 2. cqs_: Completion queues added via AddCompletionQueue() call + // All sync cqs (if any) are frequently polled by ThreadManager + int num_frequently_polled_cqs = sync_server_cqs->size(); + for (auto it = sync_server_cqs->begin(); it != sync_server_cqs->end(); ++it) { grpc_server_register_completion_queue(server->server_, (*it)->cq(), nullptr); - num_frequently_polled_cqs++; } // cqs_ contains the completion queue added by calling the ServerBuilder's @@ -295,8 +283,14 @@ std::unique_ptr ServerBuilder::BuildAndStart() { // listening to incoming channels. Such completion queues must be registered // as non-listening queues for (auto it = cqs_.begin(); it != cqs_.end(); ++it) { - grpc_server_register_completion_queue(server->server_, (*it)->cq(), - nullptr); + if ((*it)->IsFrequentlyPolled()) { + grpc_server_register_completion_queue(server->server_, (*it)->cq(), + nullptr); + num_frequently_polled_cqs++; + } else { + grpc_server_register_non_listening_completion_queue(server->server_, + (*it)->cq(), nullptr); + } } if (num_frequently_polled_cqs == 0) { @@ -343,7 +337,10 @@ std::unique_ptr ServerBuilder::BuildAndStart() { } auto cqs_data = cqs_.empty() ? nullptr : &cqs_[0]; - server->Start(cqs_data, cqs_.size()); + if (!server->Start(cqs_data, cqs_.size())) { + if (added_port) server->Shutdown(); + return nullptr; + } for (auto plugin = plugins_.begin(); plugin != plugins_.end(); plugin++) { (*plugin)->Finish(initializer); diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc index b4d6961db89..ce173a1ee2d 100644 --- a/src/cpp/server/server_cc.cc +++ b/src/cpp/server/server_cc.cc @@ -124,14 +124,6 @@ class ShutdownTag : public CompletionQueueTag { bool FinalizeResult(void** tag, bool* status) { return false; } }; -class DummyTag : public CompletionQueueTag { - public: - bool FinalizeResult(void** tag, bool* status) { - *status = true; - return true; - } -}; - class Server::SyncRequest final : public CompletionQueueTag { public: SyncRequest(RpcServiceMethod* method, void* tag) @@ -153,7 +145,7 @@ class Server::SyncRequest final : public CompletionQueueTag { grpc_metadata_array_destroy(&request_metadata_); } - void SetupRequest() { cq_ = grpc_completion_queue_create_for_pluck(nullptr); } + void SetupRequest() { cq_ = grpc_completion_queue_create(nullptr); } void TeardownRequest() { grpc_completion_queue_destroy(cq_); @@ -221,15 +213,10 @@ class Server::SyncRequest final : public CompletionQueueTag { MethodHandler::HandlerParameter(&call_, &ctx_, request_payload_)); global_callbacks->PostSynchronousRequest(&ctx_); request_payload_ = nullptr; - + void* ignored_tag; + bool ignored_ok; cq_.Shutdown(); - - CompletionQueueTag* op_tag = ctx_.GetCompletionOpTag(); - cq_.TryPluck(op_tag, gpr_inf_future(GPR_CLOCK_REALTIME)); - - /* Ensure the cq_ is shutdown */ - DummyTag ignored_tag; - GPR_ASSERT(cq_.Pluck(&ignored_tag) == false); + GPR_ASSERT(cq_.Next(&ignored_tag, &ignored_ok) == false); } private: @@ -328,18 +315,14 @@ class Server::SyncRequestThreadManager : public ThreadManager { } } - void Shutdown() override { + void ShutdownAndDrainCompletionQueue() { server_cq_->Shutdown(); - ThreadManager::Shutdown(); - } - void Wait() override { - ThreadManager::Wait(); // Drain any pending items from the queue void* tag; bool ok; while (server_cq_->Next(&tag, &ok)) { - // Do nothing + // Nothing to be done here } } @@ -419,7 +402,7 @@ Server::~Server() { } else if (!started_) { // Shutdown the completion queues for (auto it = sync_req_mgrs_.begin(); it != sync_req_mgrs_.end(); it++) { - (*it)->Shutdown(); + (*it)->ShutdownAndDrainCompletionQueue(); } } } @@ -507,11 +490,11 @@ int Server::AddListeningPort(const grpc::string& addr, ServerCredentials* creds) { GPR_ASSERT(!started_); int port = creds->AddPortToServer(addr, server_); - global_callbacks_->AddPort(this, addr, creds, port); + global_callbacks_->AddPort(this, port); return port; } -void Server::Start(ServerCompletionQueue** cqs, size_t num_cqs) { +bool Server::Start(ServerCompletionQueue** cqs, size_t num_cqs) { GPR_ASSERT(!started_); global_callbacks_->PreServerStart(this); started_ = true; @@ -547,6 +530,8 @@ void Server::Start(ServerCompletionQueue** cqs, size_t num_cqs) { for (auto it = sync_req_mgrs_.begin(); it != sync_req_mgrs_.end(); it++) { (*it)->Start(); } + + return true; } void Server::ShutdownInternal(gpr_timespec deadline) { @@ -583,6 +568,7 @@ void Server::ShutdownInternal(gpr_timespec deadline) { // Wait for threads in all ThreadManagers to terminate for (auto it = sync_req_mgrs_.begin(); it != sync_req_mgrs_.end(); it++) { (*it)->Wait(); + (*it)->ShutdownAndDrainCompletionQueue(); } // Drain the shutdown queue (if the previous call to AsyncNext() timed out @@ -607,7 +593,7 @@ void Server::PerformOpsOnCall(CallOpSetInterface* ops, Call* call) { static const size_t MAX_OPS = 8; size_t nops = 0; grpc_op cops[MAX_OPS]; - ops->FillOps(call->call(), cops, &nops); + ops->FillOps(cops, &nops); auto result = grpc_call_start_batch(call->call(), cops, nops, ops, nullptr); GPR_ASSERT(GRPC_CALL_OK == result); } diff --git a/src/cpp/server/server_context.cc b/src/cpp/server/server_context.cc index 923556413e2..3a408eb23ed 100644 --- a/src/cpp/server/server_context.cc +++ b/src/cpp/server/server_context.cc @@ -62,7 +62,7 @@ class ServerContext::CompletionOp final : public CallOpSetInterface { finalized_(false), cancelled_(0) {} - void FillOps(grpc_call* call, grpc_op* ops, size_t* nops) override; + void FillOps(grpc_op* ops, size_t* nops) override; bool FinalizeResult(void** tag, bool* status) override; bool CheckCancelled(CompletionQueue* cq) { @@ -100,8 +100,7 @@ void ServerContext::CompletionOp::Unref() { } } -void ServerContext::CompletionOp::FillOps(grpc_call* call, grpc_op* ops, - size_t* nops) { +void ServerContext::CompletionOp::FillOps(grpc_op* ops, size_t* nops) { ops->op = GRPC_OP_RECV_CLOSE_ON_SERVER; ops->data.recv_close_on_server.cancelled = &cancelled_; ops->flags = 0; @@ -152,7 +151,7 @@ ServerContext::ServerContext(gpr_timespec deadline, grpc_metadata_array* arr) ServerContext::~ServerContext() { if (call_) { - grpc_call_unref(call_); + grpc_call_destroy(call_); } if (completion_op_) { completion_op_->Unref(); @@ -168,10 +167,6 @@ void ServerContext::BeginCompletionOp(Call* call) { call->PerformOps(completion_op_); } -CompletionQueueTag* ServerContext::GetCompletionOpTag() { - return static_cast(completion_op_); -} - void ServerContext::AddInitialMetadata(const grpc::string& key, const grpc::string& value) { initial_metadata_.insert(std::make_pair(key, value)); @@ -230,9 +225,17 @@ const struct census_context* ServerContext::census_context() const { void ServerContext::SetLoadReportingCosts( const std::vector& cost_data) { if (call_ == nullptr) return; - for (const auto& cost_datum : cost_data) { - AddTrailingMetadata(GRPC_LB_COST_MD_KEY, cost_datum); + grpc_load_reporting_cost_context* cost_ctx = + static_cast( + gpr_malloc(sizeof(*cost_ctx))); + cost_ctx->values_count = cost_data.size(); + cost_ctx->values = static_cast( + gpr_malloc(sizeof(*cost_ctx->values) * cost_ctx->values_count)); + for (size_t i = 0; i < cost_ctx->values_count; ++i) { + cost_ctx->values[i] = + grpc_slice_from_copied_buffer(cost_data[i].data(), cost_data[i].size()); } + grpc_call_set_load_reporting_cost_context(call_, cost_ctx); } } // namespace grpc diff --git a/src/cpp/thread_manager/thread_manager.cc b/src/cpp/thread_manager/thread_manager.cc index a463a4388a4..1450d009e4f 100644 --- a/src/cpp/thread_manager/thread_manager.cc +++ b/src/cpp/thread_manager/thread_manager.cc @@ -98,78 +98,80 @@ void ThreadManager::MarkAsCompleted(WorkerThread* thd) { } void ThreadManager::CleanupCompletedThreads() { - std::list completed_threads; - { - // swap out the completed threads list: allows other threads to clean up - // more quickly - std::unique_lock lock(list_mu_); - completed_threads.swap(completed_threads_); + std::unique_lock lock(list_mu_); + for (auto thd = completed_threads_.begin(); thd != completed_threads_.end(); + thd = completed_threads_.erase(thd)) { + delete *thd; } - for (auto thd : completed_threads) delete thd; } void ThreadManager::Initialize() { - { - std::unique_lock lock(mu_); - num_pollers_ = min_pollers_; - num_threads_ = min_pollers_; + for (int i = 0; i < min_pollers_; i++) { + MaybeCreatePoller(); } +} + +// If the number of pollers (i.e threads currently blocked in PollForWork()) is +// less than max threshold (i.e max_pollers_) and the total number of threads is +// below the maximum threshold, we can let the current thread continue as poller +bool ThreadManager::MaybeContinueAsPoller() { + std::unique_lock lock(mu_); + if (shutdown_ || num_pollers_ > max_pollers_) { + return false; + } + + num_pollers_++; + return true; +} + +// Create a new poller if the current number of pollers i.e num_pollers_ (i.e +// threads currently blocked in PollForWork()) is below the threshold (i.e +// min_pollers_) and the total number of threads is below the maximum threshold +void ThreadManager::MaybeCreatePoller() { + std::unique_lock lock(mu_); + if (!shutdown_ && num_pollers_ < min_pollers_) { + num_pollers_++; + num_threads_++; - for (int i = 0; i < min_pollers_; i++) { // Create a new thread (which ends up calling the MainWorkLoop() function new WorkerThread(this); } } void ThreadManager::MainWorkLoop() { - while (true) { - void* tag; - bool ok; + void* tag; + bool ok; + + /* + 1. Poll for work (i.e PollForWork()) + 2. After returning from PollForWork, reduce the number of pollers by 1. If + PollForWork() returned a TIMEOUT, then it may indicate that we have more + polling threads than needed. Check if the number of pollers is greater + than min_pollers and if so, terminate the thread. + 3. Since we are short of one poller now, see if a new poller has to be + created (i.e see MaybeCreatePoller() for more details) + 4. Do the actual work (DoWork()) + 5. After doing the work, see it this thread can resume polling work (i.e + see MaybeContinueAsPoller() for more details) */ + do { WorkStatus work_status = PollForWork(&tag, &ok); - std::unique_lock lock(mu_); - // Reduce the number of pollers by 1 and check what happened with the poll - num_pollers_--; - bool done = false; - switch (work_status) { - case TIMEOUT: - // If we timed out and we have more pollers than we need (or we are - // shutdown), finish this thread - if (shutdown_ || num_pollers_ > max_pollers_) done = true; - break; - case SHUTDOWN: - // If the thread manager is shutdown, finish this thread - done = true; - break; - case WORK_FOUND: - // If we got work and there are now insufficient pollers, start a new - // one - if (!shutdown_ && num_pollers_ < min_pollers_) { - num_pollers_++; - num_threads_++; - // Drop lock before spawning thread to avoid contention - lock.unlock(); - new WorkerThread(this); - } else { - // Drop lock for consistency with above branch - lock.unlock(); - } - // Lock is always released at this point - do the application work - DoWork(tag, ok); - // Take the lock again to check post conditions - lock.lock(); - // If we're shutdown, we should finish at this point. - if (shutdown_) done = true; + { + std::unique_lock lock(mu_); + num_pollers_--; + + if (work_status == TIMEOUT && num_pollers_ > min_pollers_) { break; + } } - // If we decided to finish the thread, break out of the while loop - if (done) break; - // ... otherwise increase poller count and continue - // There's a chance that we'll exceed the max poller count: that is - // explicitly ok - we'll decrease after one poll timeout, and prevent - // some thrashing starting up and shutting down threads - num_pollers_++; - }; + + // Note that MaybeCreatePoller does check for shutdown and creates a new + // thread only if ThreadManager is not shutdown + if (work_status == WORK_FOUND) { + MaybeCreatePoller(); + DoWork(tag, ok); + } + } while (MaybeContinueAsPoller()); CleanupCompletedThreads(); diff --git a/src/cpp/thread_manager/thread_manager.h b/src/cpp/thread_manager/thread_manager.h index d1050f6dede..9c0569c62c1 100644 --- a/src/cpp/thread_manager/thread_manager.h +++ b/src/cpp/thread_manager/thread_manager.h @@ -89,14 +89,14 @@ class ThreadManager { // Mark the ThreadManager as shutdown and begin draining the work. This is a // non-blocking call and the caller should call Wait(), a blocking call which // returns only once the shutdown is complete - virtual void Shutdown(); + void Shutdown(); // Has Shutdown() been called bool IsShutdown(); // A blocking call that returns only after the ThreadManager has shutdown and // all the threads have drained all the outstanding work - virtual void Wait(); + void Wait(); private: // Helper wrapper class around std::thread. This takes a ThreadManager object @@ -122,6 +122,14 @@ class ThreadManager { // The main funtion in ThreadManager void MainWorkLoop(); + // Create a new poller if the number of current pollers is less than the + // minimum number of pollers needed (i.e min_pollers). + void MaybeCreatePoller(); + + // Returns true if the current thread can resume as a poller. i.e if the + // current number of pollers is less than the max_pollers. + bool MaybeContinueAsPoller(); + void MarkAsCompleted(WorkerThread* thd); void CleanupCompletedThreads(); diff --git a/src/csharp/Grpc.Core.Tests/AppDomainUnloadTest.cs b/src/csharp/Grpc.Core.Tests/AppDomainUnloadTest.cs index 7858e77b278..d7ebdb4201e 100644 --- a/src/csharp/Grpc.Core.Tests/AppDomainUnloadTest.cs +++ b/src/csharp/Grpc.Core.Tests/AppDomainUnloadTest.cs @@ -72,6 +72,10 @@ namespace Grpc.Core.Tests public AppDomainTestClass() { var helper = new MockServiceHelper(Host); + var server = helper.GetServer(); + server.Start(); + var channel = helper.GetChannel(); + var readyToShutdown = new TaskCompletionSource(); helper.DuplexStreamingHandler = new DuplexStreamingServerMethod(async (requestStream, responseStream, context) => { @@ -79,10 +83,6 @@ namespace Grpc.Core.Tests await requestStream.ToListAsync(); }); - var server = helper.GetServer(); - server.Start(); - var channel = helper.GetChannel(); - var call = Calls.AsyncDuplexStreamingCall(helper.CreateDuplexStreamingCall()); readyToShutdown.Task.Wait(); // make sure handler is running } diff --git a/src/csharp/Grpc.Core.Tests/Internal/CompletionQueueSafeHandleTest.cs b/src/csharp/Grpc.Core.Tests/Internal/CompletionQueueSafeHandleTest.cs index 8649906becd..e9ec59eb3db 100644 --- a/src/csharp/Grpc.Core.Tests/Internal/CompletionQueueSafeHandleTest.cs +++ b/src/csharp/Grpc.Core.Tests/Internal/CompletionQueueSafeHandleTest.cs @@ -43,19 +43,19 @@ namespace Grpc.Core.Internal.Tests public class CompletionQueueSafeHandleTest { [Test] - public void CreateSyncAndDestroy() + public void CreateAndDestroy() { GrpcEnvironment.AddRef(); - var cq = CompletionQueueSafeHandle.CreateSync(); + var cq = CompletionQueueSafeHandle.Create(); cq.Dispose(); GrpcEnvironment.ReleaseAsync().Wait(); } [Test] - public void CreateAsyncAndShutdown() + public void CreateAndShutdown() { - var env = GrpcEnvironment.AddRef(); - var cq = CompletionQueueSafeHandle.CreateAsync(new CompletionRegistry(env)); + GrpcEnvironment.AddRef(); + var cq = CompletionQueueSafeHandle.Create(); cq.Shutdown(); var ev = cq.Next(); cq.Dispose(); diff --git a/src/csharp/Grpc.Core.Tests/PInvokeTest.cs b/src/csharp/Grpc.Core.Tests/PInvokeTest.cs index d760717ba6f..d3735c78807 100644 --- a/src/csharp/Grpc.Core.Tests/PInvokeTest.cs +++ b/src/csharp/Grpc.Core.Tests/PInvokeTest.cs @@ -53,7 +53,7 @@ namespace Grpc.Core.Tests /// (~1.26us .NET Windows) /// [Test] - public void CompletionQueueCreateSyncDestroyBenchmark() + public void CompletionQueueCreateDestroyBenchmark() { GrpcEnvironment.AddRef(); // completion queue requires gRPC environment being initialized. @@ -61,7 +61,7 @@ namespace Grpc.Core.Tests 10, 10, () => { - CompletionQueueSafeHandle cq = CompletionQueueSafeHandle.CreateSync(); + CompletionQueueSafeHandle cq = CompletionQueueSafeHandle.Create(); cq.Dispose(); }); diff --git a/src/csharp/Grpc.Core.Tests/UserAgentStringTest.cs b/src/csharp/Grpc.Core.Tests/UserAgentStringTest.cs index 74b4997f69e..cc830086a67 100644 --- a/src/csharp/Grpc.Core.Tests/UserAgentStringTest.cs +++ b/src/csharp/Grpc.Core.Tests/UserAgentStringTest.cs @@ -63,6 +63,10 @@ namespace Grpc.Core.Tests public void DefaultUserAgentString() { helper = new MockServiceHelper(Host); + server = helper.GetServer(); + server.Start(); + channel = helper.GetChannel(); + helper.UnaryHandler = new UnaryServerMethod((request, context) => { var userAgentString = context.RequestHeaders.First(m => (m.Key == "user-agent")).Value; @@ -71,11 +75,6 @@ namespace Grpc.Core.Tests Assert.IsTrue(parts[1].StartsWith("grpc-c/")); return Task.FromResult("PASS"); }); - - server = helper.GetServer(); - server.Start(); - channel = helper.GetChannel(); - Assert.AreEqual("PASS", Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "")); } @@ -84,6 +83,11 @@ namespace Grpc.Core.Tests { helper = new MockServiceHelper(Host, channelOptions: new[] { new ChannelOption(ChannelOptions.PrimaryUserAgentString, "XYZ") }); + server = helper.GetServer(); + server.Start(); + channel = helper.GetChannel(); + + channel = helper.GetChannel(); helper.UnaryHandler = new UnaryServerMethod((request, context) => { var userAgentString = context.RequestHeaders.First(m => (m.Key == "user-agent")).Value; @@ -91,11 +95,6 @@ namespace Grpc.Core.Tests Assert.AreEqual("XYZ", parts[0]); return Task.FromResult("PASS"); }); - - server = helper.GetServer(); - server.Start(); - channel = helper.GetChannel(); - Assert.AreEqual("PASS", Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "")); } } diff --git a/src/csharp/Grpc.Core/Internal/AsyncCall.cs b/src/csharp/Grpc.Core/Internal/AsyncCall.cs index f037b2351af..1f738a3b6f9 100644 --- a/src/csharp/Grpc.Core/Internal/AsyncCall.cs +++ b/src/csharp/Grpc.Core/Internal/AsyncCall.cs @@ -87,7 +87,7 @@ namespace Grpc.Core.Internal var profiler = Profilers.ForCurrentThread(); using (profiler.NewScope("AsyncCall.UnaryCall")) - using (CompletionQueueSafeHandle cq = CompletionQueueSafeHandle.CreateSync()) + using (CompletionQueueSafeHandle cq = CompletionQueueSafeHandle.Create()) { byte[] payload = UnsafeSerialize(msg); diff --git a/src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs b/src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs index 577d7044a57..6c9a31921eb 100644 --- a/src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs +++ b/src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs @@ -51,20 +51,14 @@ namespace Grpc.Core.Internal { } - /// - /// Create a completion queue that can only be used for Pluck operations. - /// - public static CompletionQueueSafeHandle CreateSync() + public static CompletionQueueSafeHandle Create() { - return Native.grpcsharp_completion_queue_create_sync(); + return Native.grpcsharp_completion_queue_create(); } - /// - /// Create a completion queue that can only be used for Next operations. - /// - public static CompletionQueueSafeHandle CreateAsync(CompletionRegistry completionRegistry) + public static CompletionQueueSafeHandle Create(CompletionRegistry completionRegistry) { - var cq = Native.grpcsharp_completion_queue_create_async(); + var cq = Native.grpcsharp_completion_queue_create(); cq.completionRegistry = completionRegistry; return cq; } diff --git a/src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs b/src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs index 07fea812b2a..25a6589f115 100644 --- a/src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs +++ b/src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs @@ -197,7 +197,7 @@ namespace Grpc.Core.Internal for (int i = 0; i < completionQueueCount; i++) { var completionRegistry = new CompletionRegistry(environment); - list.Add(CompletionQueueSafeHandle.CreateAsync(completionRegistry)); + list.Add(CompletionQueueSafeHandle.Create(completionRegistry)); } return list.AsReadOnly(); } diff --git a/src/csharp/Grpc.Core/Internal/NativeMethods.cs b/src/csharp/Grpc.Core/Internal/NativeMethods.cs index a98861af616..dd65f052172 100644 --- a/src/csharp/Grpc.Core/Internal/NativeMethods.cs +++ b/src/csharp/Grpc.Core/Internal/NativeMethods.cs @@ -115,8 +115,7 @@ namespace Grpc.Core.Internal public readonly Delegates.grpcsharp_sizeof_grpc_event_delegate grpcsharp_sizeof_grpc_event; - public readonly Delegates.grpcsharp_completion_queue_create_async_delegate grpcsharp_completion_queue_create_async; - public readonly Delegates.grpcsharp_completion_queue_create_sync_delegate grpcsharp_completion_queue_create_sync; + public readonly Delegates.grpcsharp_completion_queue_create_delegate grpcsharp_completion_queue_create; public readonly Delegates.grpcsharp_completion_queue_shutdown_delegate grpcsharp_completion_queue_shutdown; public readonly Delegates.grpcsharp_completion_queue_next_delegate grpcsharp_completion_queue_next; public readonly Delegates.grpcsharp_completion_queue_pluck_delegate grpcsharp_completion_queue_pluck; @@ -230,8 +229,7 @@ namespace Grpc.Core.Internal this.grpcsharp_sizeof_grpc_event = GetMethodDelegate(library); - this.grpcsharp_completion_queue_create_async = GetMethodDelegate(library); - this.grpcsharp_completion_queue_create_sync = GetMethodDelegate(library); + this.grpcsharp_completion_queue_create = GetMethodDelegate(library); this.grpcsharp_completion_queue_shutdown = GetMethodDelegate(library); this.grpcsharp_completion_queue_next = GetMethodDelegate(library); this.grpcsharp_completion_queue_pluck = GetMethodDelegate(library); @@ -385,8 +383,7 @@ namespace Grpc.Core.Internal public delegate int grpcsharp_sizeof_grpc_event_delegate(); - public delegate CompletionQueueSafeHandle grpcsharp_completion_queue_create_async_delegate(); - public delegate CompletionQueueSafeHandle grpcsharp_completion_queue_create_sync_delegate(); + public delegate CompletionQueueSafeHandle grpcsharp_completion_queue_create_delegate(); public delegate void grpcsharp_completion_queue_shutdown_delegate(CompletionQueueSafeHandle cq); public delegate CompletionQueueEvent grpcsharp_completion_queue_next_delegate(CompletionQueueSafeHandle cq); public delegate CompletionQueueEvent grpcsharp_completion_queue_pluck_delegate(CompletionQueueSafeHandle cq, IntPtr tag); diff --git a/src/csharp/Grpc.Core/Version.csproj.include b/src/csharp/Grpc.Core/Version.csproj.include index 6af2af10bd0..5409c98fe7f 100755 --- a/src/csharp/Grpc.Core/Version.csproj.include +++ b/src/csharp/Grpc.Core/Version.csproj.include @@ -1,7 +1,7 @@ - 1.4.0-dev + 1.3.0-pre1 3.2.0 diff --git a/src/csharp/Grpc.Core/VersionInfo.cs b/src/csharp/Grpc.Core/VersionInfo.cs index 2e55d9d80eb..03d4a96f05d 100644 --- a/src/csharp/Grpc.Core/VersionInfo.cs +++ b/src/csharp/Grpc.Core/VersionInfo.cs @@ -48,11 +48,11 @@ namespace Grpc.Core /// /// Current AssemblyFileVersion of gRPC C# assemblies /// - public const string CurrentAssemblyFileVersion = "1.4.0.0"; + public const string CurrentAssemblyFileVersion = "1.3.0.0"; /// /// Current version of gRPC C# /// - public const string CurrentVersion = "1.4.0-dev"; + public const string CurrentVersion = "1.3.0-pre1"; } } diff --git a/src/csharp/build_packages_dotnetcli.bat b/src/csharp/build_packages_dotnetcli.bat index 673642e3d87..2f8d5b8157d 100755 --- a/src/csharp/build_packages_dotnetcli.bat +++ b/src/csharp/build_packages_dotnetcli.bat @@ -28,7 +28,7 @@ @rem OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @rem Current package versions -set VERSION=1.4.0-dev +set VERSION=1.3.0-pre1 @rem Adjust the location of nuget.exe set NUGET=C:\nuget\nuget.exe diff --git a/src/csharp/build_packages_dotnetcli.sh b/src/csharp/build_packages_dotnetcli.sh index ee923e3d870..3096b3e45b6 100755 --- a/src/csharp/build_packages_dotnetcli.sh +++ b/src/csharp/build_packages_dotnetcli.sh @@ -70,7 +70,7 @@ dotnet pack --configuration Release Grpc.Auth --output ../../../artifacts dotnet pack --configuration Release Grpc.HealthCheck --output ../../../artifacts dotnet pack --configuration Release Grpc.Reflection --output ../../../artifacts -nuget pack Grpc.nuspec -Version "1.4.0-dev" -OutputDirectory ../../artifacts -nuget pack Grpc.Tools.nuspec -Version "1.4.0-dev" -OutputDirectory ../../artifacts +nuget pack Grpc.nuspec -Version "1.3.0-pre1" -OutputDirectory ../../artifacts +nuget pack Grpc.Tools.nuspec -Version "1.3.0-pre1" -OutputDirectory ../../artifacts (cd ../../artifacts && zip csharp_nugets_dotnetcli.zip *.nupkg) diff --git a/src/csharp/ext/grpc_csharp_ext.c b/src/csharp/ext/grpc_csharp_ext.c index f6cff454bdb..491df4de6ad 100644 --- a/src/csharp/ext/grpc_csharp_ext.c +++ b/src/csharp/ext/grpc_csharp_ext.c @@ -34,14 +34,14 @@ #include "src/core/lib/support/string.h" #include -#include -#include -#include +#include #include #include -#include +#include #include #include +#include +#include #include @@ -84,8 +84,7 @@ typedef struct grpcsharp_batch_context { int recv_close_on_server_cancelled; } grpcsharp_batch_context; -GPR_EXPORT grpcsharp_batch_context *GPR_CALLTYPE -grpcsharp_batch_context_create() { +GPR_EXPORT grpcsharp_batch_context *GPR_CALLTYPE grpcsharp_batch_context_create() { grpcsharp_batch_context *ctx = gpr_malloc(sizeof(grpcsharp_batch_context)); memset(ctx, 0, sizeof(grpcsharp_batch_context)); return ctx; @@ -97,10 +96,8 @@ typedef struct { grpc_metadata_array request_metadata; } grpcsharp_request_call_context; -GPR_EXPORT grpcsharp_request_call_context *GPR_CALLTYPE -grpcsharp_request_call_context_create() { - grpcsharp_request_call_context *ctx = - gpr_malloc(sizeof(grpcsharp_request_call_context)); +GPR_EXPORT grpcsharp_request_call_context *GPR_CALLTYPE grpcsharp_request_call_context_create() { + grpcsharp_request_call_context *ctx = gpr_malloc(sizeof(grpcsharp_request_call_context)); memset(ctx, 0, sizeof(grpcsharp_request_call_context)); return ctx; } @@ -178,15 +175,15 @@ grpcsharp_metadata_array_count(grpc_metadata_array *array) { return (intptr_t)array->count; } -GPR_EXPORT const char *GPR_CALLTYPE grpcsharp_metadata_array_get_key( - grpc_metadata_array *array, size_t index, size_t *key_length) { +GPR_EXPORT const char *GPR_CALLTYPE +grpcsharp_metadata_array_get_key(grpc_metadata_array *array, size_t index, size_t *key_length) { GPR_ASSERT(index < array->count); *key_length = GRPC_SLICE_LENGTH(array->metadata[index].key); return (char *)GRPC_SLICE_START_PTR(array->metadata[index].key); } -GPR_EXPORT const char *GPR_CALLTYPE grpcsharp_metadata_array_get_value( - grpc_metadata_array *array, size_t index, size_t *value_length) { +GPR_EXPORT const char *GPR_CALLTYPE +grpcsharp_metadata_array_get_value(grpc_metadata_array *array, size_t index, size_t *value_length) { GPR_ASSERT(index < array->count); *value_length = GRPC_SLICE_LENGTH(array->metadata[index].value); return (char *)GRPC_SLICE_START_PTR(array->metadata[index].value); @@ -211,8 +208,7 @@ void grpcsharp_metadata_array_move(grpc_metadata_array *dest, src->metadata = NULL; } -GPR_EXPORT void GPR_CALLTYPE -grpcsharp_batch_context_destroy(grpcsharp_batch_context *ctx) { +GPR_EXPORT void GPR_CALLTYPE grpcsharp_batch_context_destroy(grpcsharp_batch_context *ctx) { if (!ctx) { return; } @@ -235,8 +231,7 @@ grpcsharp_batch_context_destroy(grpcsharp_batch_context *ctx) { gpr_free(ctx); } -GPR_EXPORT void GPR_CALLTYPE -grpcsharp_request_call_context_destroy(grpcsharp_request_call_context *ctx) { +GPR_EXPORT void GPR_CALLTYPE grpcsharp_request_call_context_destroy(grpcsharp_request_call_context *ctx) { if (!ctx) { return; } @@ -245,7 +240,8 @@ grpcsharp_request_call_context_destroy(grpcsharp_request_call_context *ctx) { to take its ownership. */ grpc_call_details_destroy(&(ctx->call_details)); - grpcsharp_metadata_array_destroy_metadata_only(&(ctx->request_metadata)); + grpcsharp_metadata_array_destroy_metadata_only( + &(ctx->request_metadata)); gpr_free(ctx); } @@ -303,10 +299,8 @@ grpcsharp_batch_context_recv_status_on_client_status( GPR_EXPORT const char *GPR_CALLTYPE grpcsharp_batch_context_recv_status_on_client_details( const grpcsharp_batch_context *ctx, size_t *details_length) { - *details_length = - GRPC_SLICE_LENGTH(ctx->recv_status_on_client.status_details); - return (char *)GRPC_SLICE_START_PTR( - ctx->recv_status_on_client.status_details); + *details_length = GRPC_SLICE_LENGTH(ctx->recv_status_on_client.status_details); + return (char *)GRPC_SLICE_START_PTR(ctx->recv_status_on_client.status_details); } GPR_EXPORT const grpc_metadata_array *GPR_CALLTYPE @@ -315,12 +309,13 @@ grpcsharp_batch_context_recv_status_on_client_trailing_metadata( return &(ctx->recv_status_on_client.trailing_metadata); } -GPR_EXPORT grpc_call *GPR_CALLTYPE -grpcsharp_request_call_context_call(const grpcsharp_request_call_context *ctx) { +GPR_EXPORT grpc_call *GPR_CALLTYPE grpcsharp_request_call_context_call( + const grpcsharp_request_call_context *ctx) { return ctx->call; } -GPR_EXPORT const char *GPR_CALLTYPE grpcsharp_request_call_context_method( +GPR_EXPORT const char *GPR_CALLTYPE +grpcsharp_request_call_context_method( const grpcsharp_request_call_context *ctx, size_t *method_length) { *method_length = GRPC_SLICE_LENGTH(ctx->call_details.method); return (char *)GRPC_SLICE_START_PTR(ctx->call_details.method); @@ -332,7 +327,8 @@ GPR_EXPORT const char *GPR_CALLTYPE grpcsharp_request_call_context_host( return (char *)GRPC_SLICE_START_PTR(ctx->call_details.host); } -GPR_EXPORT gpr_timespec GPR_CALLTYPE grpcsharp_request_call_context_deadline( +GPR_EXPORT gpr_timespec GPR_CALLTYPE +grpcsharp_request_call_context_deadline( const grpcsharp_request_call_context *ctx) { return ctx->call_details.deadline; } @@ -346,7 +342,7 @@ grpcsharp_request_call_context_request_metadata( GPR_EXPORT int32_t GPR_CALLTYPE grpcsharp_batch_context_recv_close_on_server_cancelled( const grpcsharp_batch_context *ctx) { - return (int32_t)ctx->recv_close_on_server_cancelled; + return (int32_t) ctx->recv_close_on_server_cancelled; } /* Init & shutdown */ @@ -358,13 +354,8 @@ GPR_EXPORT void GPR_CALLTYPE grpcsharp_shutdown(void) { grpc_shutdown(); } /* Completion queue */ GPR_EXPORT grpc_completion_queue *GPR_CALLTYPE -grpcsharp_completion_queue_create_async(void) { - return grpc_completion_queue_create_for_next(NULL); -} - -GPR_EXPORT grpc_completion_queue *GPR_CALLTYPE -grpcsharp_completion_queue_create_sync(void) { - return grpc_completion_queue_create_for_pluck(NULL); +grpcsharp_completion_queue_create(void) { + return grpc_completion_queue_create(NULL); } GPR_EXPORT void GPR_CALLTYPE @@ -393,8 +384,7 @@ grpcsharp_completion_queue_pluck(grpc_completion_queue *cq, void *tag) { GPR_EXPORT grpc_channel *GPR_CALLTYPE -grpcsharp_insecure_channel_create(const char *target, - const grpc_channel_args *args) { +grpcsharp_insecure_channel_create(const char *target, const grpc_channel_args *args) { return grpc_insecure_channel_create(target, args, NULL); } @@ -402,10 +392,12 @@ GPR_EXPORT void GPR_CALLTYPE grpcsharp_channel_destroy(grpc_channel *channel) { grpc_channel_destroy(channel); } -GPR_EXPORT grpc_call *GPR_CALLTYPE grpcsharp_channel_create_call( - grpc_channel *channel, grpc_call *parent_call, uint32_t propagation_mask, - grpc_completion_queue *cq, const char *method, const char *host, - gpr_timespec deadline) { +GPR_EXPORT grpc_call *GPR_CALLTYPE +grpcsharp_channel_create_call(grpc_channel *channel, grpc_call *parent_call, + uint32_t propagation_mask, + grpc_completion_queue *cq, + const char *method, const char *host, + gpr_timespec deadline) { grpc_slice method_slice = grpc_slice_from_copied_string(method); grpc_slice *host_slice_ptr = NULL; grpc_slice host_slice; @@ -418,21 +410,18 @@ GPR_EXPORT grpc_call *GPR_CALLTYPE grpcsharp_channel_create_call( } GPR_EXPORT grpc_connectivity_state GPR_CALLTYPE -grpcsharp_channel_check_connectivity_state(grpc_channel *channel, - int32_t try_to_connect) { +grpcsharp_channel_check_connectivity_state(grpc_channel *channel, int32_t try_to_connect) { return grpc_channel_check_connectivity_state(channel, try_to_connect); } GPR_EXPORT void GPR_CALLTYPE grpcsharp_channel_watch_connectivity_state( grpc_channel *channel, grpc_connectivity_state last_observed_state, - gpr_timespec deadline, grpc_completion_queue *cq, - grpcsharp_batch_context *ctx) { - grpc_channel_watch_connectivity_state(channel, last_observed_state, deadline, - cq, ctx); + gpr_timespec deadline, grpc_completion_queue *cq, grpcsharp_batch_context *ctx) { + grpc_channel_watch_connectivity_state(channel, last_observed_state, + deadline, cq, ctx); } -GPR_EXPORT char *GPR_CALLTYPE -grpcsharp_channel_get_target(grpc_channel *channel) { +GPR_EXPORT char *GPR_CALLTYPE grpcsharp_channel_get_target(grpc_channel *channel) { return grpc_channel_get_target(channel); } @@ -450,8 +439,9 @@ grpcsharp_channel_args_create(size_t num_args) { return args; } -GPR_EXPORT void GPR_CALLTYPE grpcsharp_channel_args_set_string( - grpc_channel_args *args, size_t index, const char *key, const char *value) { +GPR_EXPORT void GPR_CALLTYPE +grpcsharp_channel_args_set_string(grpc_channel_args *args, size_t index, + const char *key, const char *value) { GPR_ASSERT(args); GPR_ASSERT(index < args->num_args); args->args[index].type = GRPC_ARG_STRING; @@ -459,8 +449,9 @@ GPR_EXPORT void GPR_CALLTYPE grpcsharp_channel_args_set_string( args->args[index].value.string = gpr_strdup(value); } -GPR_EXPORT void GPR_CALLTYPE grpcsharp_channel_args_set_integer( - grpc_channel_args *args, size_t index, const char *key, int value) { +GPR_EXPORT void GPR_CALLTYPE +grpcsharp_channel_args_set_integer(grpc_channel_args *args, size_t index, + const char *key, int value) { GPR_ASSERT(args); GPR_ASSERT(index < args->num_args); args->args[index].type = GRPC_ARG_INTEGER; @@ -489,18 +480,15 @@ GPR_EXPORT gpr_timespec GPR_CALLTYPE gprsharp_now(gpr_clock_type clock_type) { return gpr_now(clock_type); } -GPR_EXPORT gpr_timespec GPR_CALLTYPE -gprsharp_inf_future(gpr_clock_type clock_type) { +GPR_EXPORT gpr_timespec GPR_CALLTYPE gprsharp_inf_future(gpr_clock_type clock_type) { return gpr_inf_future(clock_type); } -GPR_EXPORT gpr_timespec GPR_CALLTYPE -gprsharp_inf_past(gpr_clock_type clock_type) { +GPR_EXPORT gpr_timespec GPR_CALLTYPE gprsharp_inf_past(gpr_clock_type clock_type) { return gpr_inf_past(clock_type); } -GPR_EXPORT gpr_timespec GPR_CALLTYPE -gprsharp_convert_clock_type(gpr_timespec t, gpr_clock_type target_clock) { +GPR_EXPORT gpr_timespec GPR_CALLTYPE gprsharp_convert_clock_type(gpr_timespec t, gpr_clock_type target_clock) { return gpr_convert_clock_type(t, target_clock); } @@ -514,8 +502,9 @@ GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_cancel(grpc_call *call) { return grpc_call_cancel(call, NULL); } -GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_cancel_with_status( - grpc_call *call, grpc_status_code status, const char *description) { +GPR_EXPORT grpc_call_error GPR_CALLTYPE +grpcsharp_call_cancel_with_status(grpc_call *call, grpc_status_code status, + const char *description) { return grpc_call_cancel_with_status(call, status, description, NULL); } @@ -523,16 +512,18 @@ GPR_EXPORT char *GPR_CALLTYPE grpcsharp_call_get_peer(grpc_call *call) { return grpc_call_get_peer(call); } -GPR_EXPORT void GPR_CALLTYPE gprsharp_free(void *p) { gpr_free(p); } +GPR_EXPORT void GPR_CALLTYPE gprsharp_free(void *p) { + gpr_free(p); +} GPR_EXPORT void GPR_CALLTYPE grpcsharp_call_destroy(grpc_call *call) { - grpc_call_unref(call); + grpc_call_destroy(call); } -GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_start_unary( - grpc_call *call, grpcsharp_batch_context *ctx, const char *send_buffer, - size_t send_buffer_len, uint32_t write_flags, - grpc_metadata_array *initial_metadata, uint32_t initial_metadata_flags) { +GPR_EXPORT grpc_call_error GPR_CALLTYPE +grpcsharp_call_start_unary(grpc_call *call, grpcsharp_batch_context *ctx, + const char *send_buffer, size_t send_buffer_len, uint32_t write_flags, + grpc_metadata_array *initial_metadata, uint32_t initial_metadata_flags) { /* TODO: don't use magic number */ grpc_op ops[6]; memset(ops, 0, sizeof(ops)); @@ -580,9 +571,11 @@ GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_start_unary( NULL); } -GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_start_client_streaming( - grpc_call *call, grpcsharp_batch_context *ctx, - grpc_metadata_array *initial_metadata, uint32_t initial_metadata_flags) { +GPR_EXPORT grpc_call_error GPR_CALLTYPE +grpcsharp_call_start_client_streaming(grpc_call *call, + grpcsharp_batch_context *ctx, + grpc_metadata_array *initial_metadata, + uint32_t initial_metadata_flags) { /* TODO: don't use magic number */ grpc_op ops[4]; memset(ops, 0, sizeof(ops)); @@ -660,9 +653,11 @@ GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_start_server_streaming( NULL); } -GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_start_duplex_streaming( - grpc_call *call, grpcsharp_batch_context *ctx, - grpc_metadata_array *initial_metadata, uint32_t initial_metadata_flags) { +GPR_EXPORT grpc_call_error GPR_CALLTYPE +grpcsharp_call_start_duplex_streaming(grpc_call *call, + grpcsharp_batch_context *ctx, + grpc_metadata_array *initial_metadata, + uint32_t initial_metadata_flags) { /* TODO: don't use magic number */ grpc_op ops[2]; memset(ops, 0, sizeof(ops)); @@ -690,7 +685,7 @@ GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_start_duplex_streaming( } GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_recv_initial_metadata( - grpc_call *call, grpcsharp_batch_context *ctx) { + grpc_call *call, grpcsharp_batch_context *ctx) { /* TODO: don't use magic number */ grpc_op ops[1]; ops[0].op = GRPC_OP_RECV_INITIAL_METADATA; @@ -700,13 +695,14 @@ GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_recv_initial_metadata( ops[0].reserved = NULL; return grpc_call_start_batch(call, ops, sizeof(ops) / sizeof(ops[0]), ctx, - NULL); + NULL); } -GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_send_message( - grpc_call *call, grpcsharp_batch_context *ctx, const char *send_buffer, - size_t send_buffer_len, uint32_t write_flags, - int32_t send_empty_initial_metadata) { +GPR_EXPORT grpc_call_error GPR_CALLTYPE +grpcsharp_call_send_message(grpc_call *call, grpcsharp_batch_context *ctx, + const char *send_buffer, size_t send_buffer_len, + uint32_t write_flags, + int32_t send_empty_initial_metadata) { /* TODO: don't use magic number */ grpc_op ops[2]; memset(ops, 0, sizeof(ops)); @@ -723,8 +719,9 @@ GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_send_message( return grpc_call_start_batch(call, ops, nops, ctx, NULL); } -GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_send_close_from_client( - grpc_call *call, grpcsharp_batch_context *ctx) { +GPR_EXPORT grpc_call_error GPR_CALLTYPE +grpcsharp_call_send_close_from_client(grpc_call *call, + grpcsharp_batch_context *ctx) { /* TODO: don't use magic number */ grpc_op ops[1]; ops[0].op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; @@ -738,15 +735,14 @@ GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_send_close_from_client( GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_send_status_from_server( grpc_call *call, grpcsharp_batch_context *ctx, grpc_status_code status_code, const char *status_details, size_t status_details_len, - grpc_metadata_array *trailing_metadata, int32_t send_empty_initial_metadata, - const char *optional_send_buffer, size_t optional_send_buffer_len, - uint32_t write_flags) { + grpc_metadata_array *trailing_metadata, + int32_t send_empty_initial_metadata, const char* optional_send_buffer, + size_t optional_send_buffer_len, uint32_t write_flags) { /* TODO: don't use magic number */ grpc_op ops[3]; memset(ops, 0, sizeof(ops)); size_t nops = 1; - grpc_slice status_details_slice = - grpc_slice_from_copied_buffer(status_details, status_details_len); + grpc_slice status_details_slice = grpc_slice_from_copied_buffer(status_details, status_details_len); ops[0].op = GRPC_OP_SEND_STATUS_FROM_SERVER; ops[0].data.send_status_from_server.status = status_code; ops[0].data.send_status_from_server.status_details = &status_details_slice; @@ -760,8 +756,8 @@ GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_send_status_from_server( ops[0].reserved = NULL; if (optional_send_buffer) { ops[nops].op = GRPC_OP_SEND_MESSAGE; - ctx->send_message = - string_to_byte_buffer(optional_send_buffer, optional_send_buffer_len); + ctx->send_message = string_to_byte_buffer(optional_send_buffer, + optional_send_buffer_len); ops[nops].data.send_message.send_message = ctx->send_message; ops[nops].flags = write_flags; ops[nops].reserved = NULL; @@ -802,9 +798,10 @@ grpcsharp_call_start_serverside(grpc_call *call, grpcsharp_batch_context *ctx) { NULL); } -GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_send_initial_metadata( - grpc_call *call, grpcsharp_batch_context *ctx, - grpc_metadata_array *initial_metadata) { +GPR_EXPORT grpc_call_error GPR_CALLTYPE +grpcsharp_call_send_initial_metadata(grpc_call *call, + grpcsharp_batch_context *ctx, + grpc_metadata_array *initial_metadata) { /* TODO: don't use magic number */ grpc_op ops[1]; memset(ops, 0, sizeof(ops)); @@ -821,8 +818,9 @@ GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_send_initial_metadata( NULL); } -GPR_EXPORT grpc_call_error GPR_CALLTYPE -grpcsharp_call_set_credentials(grpc_call *call, grpc_call_credentials *creds) { +GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_set_credentials( + grpc_call *call, + grpc_call_credentials *creds) { return grpc_call_set_credentials(call, creds); } @@ -833,13 +831,14 @@ grpcsharp_server_create(const grpc_channel_args *args) { return grpc_server_create(args, NULL); } -GPR_EXPORT void GPR_CALLTYPE grpcsharp_server_register_completion_queue( - grpc_server *server, grpc_completion_queue *cq) { +GPR_EXPORT void GPR_CALLTYPE +grpcsharp_server_register_completion_queue(grpc_server *server, + grpc_completion_queue *cq) { grpc_server_register_completion_queue(server, cq, NULL); } -GPR_EXPORT int32_t GPR_CALLTYPE grpcsharp_server_add_insecure_http2_port( - grpc_server *server, const char *addr) { +GPR_EXPORT int32_t GPR_CALLTYPE +grpcsharp_server_add_insecure_http2_port(grpc_server *server, const char *addr) { return grpc_server_add_insecure_http2_port(server, addr); } @@ -847,14 +846,14 @@ GPR_EXPORT void GPR_CALLTYPE grpcsharp_server_start(grpc_server *server) { grpc_server_start(server); } -GPR_EXPORT void GPR_CALLTYPE grpcsharp_server_shutdown_and_notify_callback( - grpc_server *server, grpc_completion_queue *cq, - grpcsharp_batch_context *ctx) { +GPR_EXPORT void GPR_CALLTYPE +grpcsharp_server_shutdown_and_notify_callback(grpc_server *server, + grpc_completion_queue *cq, + grpcsharp_batch_context *ctx) { grpc_server_shutdown_and_notify(server, cq, ctx); } -GPR_EXPORT void GPR_CALLTYPE -grpcsharp_server_cancel_all_calls(grpc_server *server) { +GPR_EXPORT void GPR_CALLTYPE grpcsharp_server_cancel_all_calls(grpc_server *server) { grpc_server_cancel_all_calls(server); } @@ -865,8 +864,9 @@ GPR_EXPORT void GPR_CALLTYPE grpcsharp_server_destroy(grpc_server *server) { GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_server_request_call(grpc_server *server, grpc_completion_queue *cq, grpcsharp_request_call_context *ctx) { - return grpc_server_request_call(server, &(ctx->call), &(ctx->call_details), - &(ctx->request_metadata), cq, cq, ctx); + return grpc_server_request_call( + server, &(ctx->call), &(ctx->call_details), + &(ctx->request_metadata), cq, cq, ctx); } /* Security */ @@ -883,8 +883,8 @@ static grpc_ssl_roots_override_result override_ssl_roots_handler( return GRPC_SSL_ROOTS_OVERRIDE_OK; } -GPR_EXPORT void GPR_CALLTYPE -grpcsharp_override_default_ssl_roots(const char *pem_root_certs) { +GPR_EXPORT void GPR_CALLTYPE grpcsharp_override_default_ssl_roots( + const char *pem_root_certs) { /* * This currently wastes ~300kB of memory by keeping a copy of roots * in a static variable, but for desktop/server use, the overhead @@ -911,19 +911,20 @@ grpcsharp_ssl_credentials_create(const char *pem_root_certs, } } -GPR_EXPORT void GPR_CALLTYPE -grpcsharp_channel_credentials_release(grpc_channel_credentials *creds) { +GPR_EXPORT void GPR_CALLTYPE grpcsharp_channel_credentials_release( + grpc_channel_credentials *creds) { grpc_channel_credentials_release(creds); } -GPR_EXPORT void GPR_CALLTYPE -grpcsharp_call_credentials_release(grpc_call_credentials *creds) { +GPR_EXPORT void GPR_CALLTYPE grpcsharp_call_credentials_release( + grpc_call_credentials *creds) { grpc_call_credentials_release(creds); } -GPR_EXPORT grpc_channel *GPR_CALLTYPE grpcsharp_secure_channel_create( - grpc_channel_credentials *creds, const char *target, - const grpc_channel_args *args) { +GPR_EXPORT grpc_channel *GPR_CALLTYPE +grpcsharp_secure_channel_create(grpc_channel_credentials *creds, + const char *target, + const grpc_channel_args *args) { return grpc_secure_channel_create(creds, target, args, NULL); } @@ -956,36 +957,36 @@ grpcsharp_ssl_server_credentials_create( return creds; } -GPR_EXPORT void GPR_CALLTYPE -grpcsharp_server_credentials_release(grpc_server_credentials *creds) { +GPR_EXPORT void GPR_CALLTYPE grpcsharp_server_credentials_release( + grpc_server_credentials *creds) { grpc_server_credentials_release(creds); } -GPR_EXPORT int32_t GPR_CALLTYPE grpcsharp_server_add_secure_http2_port( - grpc_server *server, const char *addr, grpc_server_credentials *creds) { +GPR_EXPORT int32_t GPR_CALLTYPE +grpcsharp_server_add_secure_http2_port(grpc_server *server, const char *addr, + grpc_server_credentials *creds) { return grpc_server_add_secure_http2_port(server, addr, creds); } -GPR_EXPORT grpc_channel_credentials *GPR_CALLTYPE -grpcsharp_composite_channel_credentials_create( - grpc_channel_credentials *channel_creds, - grpc_call_credentials *call_creds) { - return grpc_composite_channel_credentials_create(channel_creds, call_creds, - NULL); +GPR_EXPORT grpc_channel_credentials *GPR_CALLTYPE grpcsharp_composite_channel_credentials_create( + grpc_channel_credentials *channel_creds, + grpc_call_credentials *call_creds) { + return grpc_composite_channel_credentials_create(channel_creds, call_creds, NULL); } -GPR_EXPORT grpc_call_credentials *GPR_CALLTYPE -grpcsharp_composite_call_credentials_create(grpc_call_credentials *creds1, - grpc_call_credentials *creds2) { +GPR_EXPORT grpc_call_credentials *GPR_CALLTYPE grpcsharp_composite_call_credentials_create( + grpc_call_credentials *creds1, + grpc_call_credentials *creds2) { return grpc_composite_call_credentials_create(creds1, creds2, NULL); } + /* Metadata credentials plugin */ GPR_EXPORT void GPR_CALLTYPE grpcsharp_metadata_credentials_notify_from_plugin( - grpc_credentials_plugin_metadata_cb cb, void *user_data, - grpc_metadata_array *metadata, grpc_status_code status, - const char *error_details) { + grpc_credentials_plugin_metadata_cb cb, + void *user_data, grpc_metadata_array *metadata, + grpc_status_code status, const char *error_details) { if (metadata) { cb(user_data, metadata->metadata, metadata->count, status, error_details); } else { @@ -994,17 +995,16 @@ GPR_EXPORT void GPR_CALLTYPE grpcsharp_metadata_credentials_notify_from_plugin( } typedef void(GPR_CALLTYPE *grpcsharp_metadata_interceptor_func)( - void *state, const char *service_url, const char *method_name, - grpc_credentials_plugin_metadata_cb cb, void *user_data, - int32_t is_destroy); + void *state, const char *service_url, const char *method_name, + grpc_credentials_plugin_metadata_cb cb, + void *user_data, int32_t is_destroy); static void grpcsharp_get_metadata_handler( void *state, grpc_auth_metadata_context context, grpc_credentials_plugin_metadata_cb cb, void *user_data) { grpcsharp_metadata_interceptor_func interceptor = (grpcsharp_metadata_interceptor_func)(intptr_t)state; - interceptor(state, context.service_url, context.method_name, cb, user_data, - 0); + interceptor(state, context.service_url, context.method_name, cb, user_data, 0); } static void grpcsharp_metadata_credentials_destroy_handler(void *state) { @@ -1013,26 +1013,23 @@ static void grpcsharp_metadata_credentials_destroy_handler(void *state) { interceptor(state, NULL, NULL, NULL, NULL, 1); } -GPR_EXPORT grpc_call_credentials *GPR_CALLTYPE -grpcsharp_metadata_credentials_create_from_plugin( - grpcsharp_metadata_interceptor_func metadata_interceptor) { +GPR_EXPORT grpc_call_credentials *GPR_CALLTYPE grpcsharp_metadata_credentials_create_from_plugin( + grpcsharp_metadata_interceptor_func metadata_interceptor) { grpc_metadata_credentials_plugin plugin; plugin.get_metadata = grpcsharp_get_metadata_handler; plugin.destroy = grpcsharp_metadata_credentials_destroy_handler; - plugin.state = (void *)(intptr_t)metadata_interceptor; + plugin.state = (void*)(intptr_t)metadata_interceptor; plugin.type = ""; return grpc_metadata_credentials_create_from_plugin(plugin, NULL); } /* Auth context */ -GPR_EXPORT grpc_auth_context *GPR_CALLTYPE -grpcsharp_call_auth_context(grpc_call *call) { +GPR_EXPORT grpc_auth_context *GPR_CALLTYPE grpcsharp_call_auth_context(grpc_call *call) { return grpc_call_auth_context(call); } -GPR_EXPORT const char *GPR_CALLTYPE -grpcsharp_auth_context_peer_identity_property_name( +GPR_EXPORT const char *GPR_CALLTYPE grpcsharp_auth_context_peer_identity_property_name( const grpc_auth_context *ctx) { return grpc_auth_context_peer_identity_property_name(ctx); } @@ -1042,13 +1039,12 @@ grpcsharp_auth_context_property_iterator(const grpc_auth_context *ctx) { return grpc_auth_context_property_iterator(ctx); } -GPR_EXPORT const grpc_auth_property *GPR_CALLTYPE -grpcsharp_auth_property_iterator_next(grpc_auth_property_iterator *it) { +GPR_EXPORT const grpc_auth_property *GPR_CALLTYPE grpcsharp_auth_property_iterator_next( + grpc_auth_property_iterator *it) { return grpc_auth_property_iterator_next(it); } -GPR_EXPORT void GPR_CALLTYPE -grpcsharp_auth_context_release(grpc_auth_context *ctx) { +GPR_EXPORT void GPR_CALLTYPE grpcsharp_auth_context_release(grpc_auth_context *ctx) { grpc_auth_context_release(ctx); } diff --git a/src/node/ext/byte_buffer.cc b/src/node/ext/byte_buffer.cc index 470c7ed9019..a99b96bea54 100644 --- a/src/node/ext/byte_buffer.cc +++ b/src/node/ext/byte_buffer.cc @@ -33,10 +33,10 @@ #include -#include #include -#include "grpc/byte_buffer_reader.h" +#include #include "grpc/grpc.h" +#include "grpc/byte_buffer_reader.h" #include "grpc/slice.h" #include "byte_buffer.h" diff --git a/src/node/ext/byte_buffer.h b/src/node/ext/byte_buffer.h index 6cb7a2601bd..e8c4ac90bdd 100644 --- a/src/node/ext/byte_buffer.h +++ b/src/node/ext/byte_buffer.h @@ -36,8 +36,8 @@ #include -#include #include +#include #include "grpc/grpc.h" namespace grpc { diff --git a/src/node/ext/call.cc b/src/node/ext/call.cc index fe0c80e6421..bd60775aad9 100644 --- a/src/node/ext/call.cc +++ b/src/node/ext/call.cc @@ -31,23 +31,23 @@ * */ -#include #include #include +#include #include +#include "grpc/support/log.h" +#include "grpc/grpc.h" +#include "grpc/grpc_security.h" +#include "grpc/support/alloc.h" +#include "grpc/support/time.h" #include "byte_buffer.h" #include "call.h" -#include "call_credentials.h" #include "channel.h" #include "completion_queue.h" #include "completion_queue_async_worker.h" -#include "grpc/grpc.h" -#include "grpc/grpc_security.h" -#include "grpc/support/alloc.h" -#include "grpc/support/log.h" -#include "grpc/support/time.h" +#include "call_credentials.h" #include "slice.h" #include "timeval.h" @@ -101,20 +101,20 @@ bool CreateMetadataArray(Local metadata, grpc_metadata_array *array) { HandleScope scope; Local keys = Nan::GetOwnPropertyNames(metadata).ToLocalChecked(); for (unsigned int i = 0; i < keys->Length(); i++) { - Local current_key = - Nan::To(Nan::Get(keys, i).ToLocalChecked()).ToLocalChecked(); + Local current_key = Nan::To( + Nan::Get(keys, i).ToLocalChecked()).ToLocalChecked(); Local value_array = Nan::Get(metadata, current_key).ToLocalChecked(); if (!value_array->IsArray()) { return false; } array->capacity += Local::Cast(value_array)->Length(); } - array->metadata = reinterpret_cast( + array->metadata = reinterpret_cast( gpr_zalloc(array->capacity * sizeof(grpc_metadata))); for (unsigned int i = 0; i < keys->Length(); i++) { Local current_key(Nan::To(keys->Get(i)).ToLocalChecked()); - Local values = - Local::Cast(Nan::Get(metadata, current_key).ToLocalChecked()); + Local values = Local::Cast( + Nan::Get(metadata, current_key).ToLocalChecked()); grpc_slice key_slice = CreateSliceFromString(current_key); grpc_slice key_intern_slice = grpc_slice_intern(key_slice); grpc_slice_unref(key_slice); @@ -157,7 +157,7 @@ Local ParseMetadata(const grpc_metadata_array *metadata_array) { size_t length = metadata_array->count; Local metadata_object = Nan::New(); for (unsigned int i = 0; i < length; i++) { - grpc_metadata *elem = &metadata_elements[i]; + grpc_metadata* elem = &metadata_elements[i]; // TODO(murgatroid99): Use zero-copy string construction instead Local key_string = CopyStringFromSlice(elem->key); Local array; @@ -183,12 +183,17 @@ Local Op::GetOpType() const { return scope.Escape(Nan::New(GetTypeString()).ToLocalChecked()); } -Op::~Op() {} +Op::~Op() { +} class SendMetadataOp : public Op { public: - SendMetadataOp() { grpc_metadata_array_init(&send_metadata); } - ~SendMetadataOp() { DestroyMetadataArray(&send_metadata); } + SendMetadataOp() { + grpc_metadata_array_init(&send_metadata); + } + ~SendMetadataOp() { + DestroyMetadataArray(&send_metadata); + } Local GetNodeValue() const { EscapableHandleScope scope; return scope.Escape(Nan::True()); @@ -201,26 +206,32 @@ class SendMetadataOp : public Op { if (maybe_metadata.IsEmpty()) { return false; } - if (!CreateMetadataArray(maybe_metadata.ToLocalChecked(), &send_metadata)) { + if (!CreateMetadataArray(maybe_metadata.ToLocalChecked(), + &send_metadata)) { return false; } out->data.send_initial_metadata.count = send_metadata.count; out->data.send_initial_metadata.metadata = send_metadata.metadata; return true; } - bool IsFinalOp() { return false; } - void OnComplete(bool success) {} - + bool IsFinalOp() { + return false; + } + void OnComplete(bool success) { + } protected: - std::string GetTypeString() const { return "send_metadata"; } - + std::string GetTypeString() const { + return "send_metadata"; + } private: grpc_metadata_array send_metadata; }; class SendMessageOp : public Op { public: - SendMessageOp() { send_message = NULL; } + SendMessageOp() { + send_message = NULL; + } ~SendMessageOp() { if (send_message != NULL) { grpc_byte_buffer_destroy(send_message); @@ -235,8 +246,8 @@ class SendMessageOp : public Op { return false; } Local object_value = Nan::To(value).ToLocalChecked(); - MaybeLocal maybe_flag_value = - Nan::Get(object_value, Nan::New("grpcWriteFlags").ToLocalChecked()); + MaybeLocal maybe_flag_value = Nan::Get( + object_value, Nan::New("grpcWriteFlags").ToLocalChecked()); if (!maybe_flag_value.IsEmpty()) { Local flag_value = maybe_flag_value.ToLocalChecked(); if (flag_value->IsUint32()) { @@ -248,13 +259,15 @@ class SendMessageOp : public Op { out->data.send_message.send_message = send_message; return true; } - - bool IsFinalOp() { return false; } - void OnComplete(bool success) {} - + bool IsFinalOp() { + return false; + } + void OnComplete(bool success) { + } protected: - std::string GetTypeString() const { return "send_message"; } - + std::string GetTypeString() const { + return "send_message"; + } private: grpc_byte_buffer *send_message; }; @@ -265,18 +278,25 @@ class SendClientCloseOp : public Op { EscapableHandleScope scope; return scope.Escape(Nan::True()); } - - bool ParseOp(Local value, grpc_op *out) { return true; } - bool IsFinalOp() { return false; } - void OnComplete(bool success) {} - + bool ParseOp(Local value, grpc_op *out) { + return true; + } + bool IsFinalOp() { + return false; + } + void OnComplete(bool success) { + } protected: - std::string GetTypeString() const { return "client_close"; } + std::string GetTypeString() const { + return "client_close"; + } }; class SendServerStatusOp : public Op { public: - SendServerStatusOp() { grpc_metadata_array_init(&status_metadata); } + SendServerStatusOp() { + grpc_metadata_array_init(&status_metadata); + } ~SendServerStatusOp() { grpc_slice_unref(details); DestroyMetadataArray(&status_metadata); @@ -290,18 +310,18 @@ class SendServerStatusOp : public Op { return false; } Local server_status = Nan::To(value).ToLocalChecked(); - MaybeLocal maybe_metadata = - Nan::Get(server_status, Nan::New("metadata").ToLocalChecked()); + MaybeLocal maybe_metadata = Nan::Get( + server_status, Nan::New("metadata").ToLocalChecked()); if (maybe_metadata.IsEmpty()) { return false; } if (!maybe_metadata.ToLocalChecked()->IsObject()) { return false; } - Local metadata = - Nan::To(maybe_metadata.ToLocalChecked()).ToLocalChecked(); - MaybeLocal maybe_code = - Nan::Get(server_status, Nan::New("code").ToLocalChecked()); + Local metadata = Nan::To( + maybe_metadata.ToLocalChecked()).ToLocalChecked(); + MaybeLocal maybe_code = Nan::Get(server_status, + Nan::New("code").ToLocalChecked()); if (maybe_code.IsEmpty()) { return false; } @@ -309,16 +329,16 @@ class SendServerStatusOp : public Op { return false; } uint32_t code = Nan::To(maybe_code.ToLocalChecked()).FromJust(); - MaybeLocal maybe_details = - Nan::Get(server_status, Nan::New("details").ToLocalChecked()); + MaybeLocal maybe_details = Nan::Get( + server_status, Nan::New("details").ToLocalChecked()); if (maybe_details.IsEmpty()) { return false; } if (!maybe_details.ToLocalChecked()->IsString()) { return false; } - Local details = - Nan::To(maybe_details.ToLocalChecked()).ToLocalChecked(); + Local details = Nan::To( + maybe_details.ToLocalChecked()).ToLocalChecked(); if (!CreateMetadataArray(metadata, &status_metadata)) { return false; } @@ -332,11 +352,15 @@ class SendServerStatusOp : public Op { out->data.send_status_from_server.status_details = &this->details; return true; } - bool IsFinalOp() { return true; } - void OnComplete(bool success) {} - + bool IsFinalOp() { + return true; + } + void OnComplete(bool success) { + } protected: - std::string GetTypeString() const { return "send_status"; } + std::string GetTypeString() const { + return "send_status"; + } private: grpc_slice details; @@ -345,9 +369,13 @@ class SendServerStatusOp : public Op { class GetMetadataOp : public Op { public: - GetMetadataOp() { grpc_metadata_array_init(&recv_metadata); } + GetMetadataOp() { + grpc_metadata_array_init(&recv_metadata); + } - ~GetMetadataOp() { grpc_metadata_array_destroy(&recv_metadata); } + ~GetMetadataOp() { + grpc_metadata_array_destroy(&recv_metadata); + } Local GetNodeValue() const { EscapableHandleScope scope; @@ -358,11 +386,16 @@ class GetMetadataOp : public Op { out->data.recv_initial_metadata.recv_initial_metadata = &recv_metadata; return true; } - bool IsFinalOp() { return false; } - void OnComplete(bool success) {} + bool IsFinalOp() { + return false; + } + void OnComplete(bool success) { + } protected: - std::string GetTypeString() const { return "metadata"; } + std::string GetTypeString() const { + return "metadata"; + } private: grpc_metadata_array recv_metadata; @@ -370,7 +403,9 @@ class GetMetadataOp : public Op { class ReadMessageOp : public Op { public: - ReadMessageOp() { recv_message = NULL; } + ReadMessageOp() { + recv_message = NULL; + } ~ReadMessageOp() { if (recv_message != NULL) { grpc_byte_buffer_destroy(recv_message); @@ -385,11 +420,16 @@ class ReadMessageOp : public Op { out->data.recv_message.recv_message = &recv_message; return true; } - bool IsFinalOp() { return false; } - void OnComplete(bool success) {} + bool IsFinalOp() { + return false; + } + void OnComplete(bool success) { + } protected: - std::string GetTypeString() const { return "read"; } + std::string GetTypeString() const { + return "read"; + } private: grpc_byte_buffer *recv_message; @@ -397,9 +437,13 @@ class ReadMessageOp : public Op { class ClientStatusOp : public Op { public: - ClientStatusOp() { grpc_metadata_array_init(&metadata_array); } + ClientStatusOp() { + grpc_metadata_array_init(&metadata_array); + } - ~ClientStatusOp() { grpc_metadata_array_destroy(&metadata_array); } + ~ClientStatusOp() { + grpc_metadata_array_destroy(&metadata_array); + } bool ParseOp(Local value, grpc_op *out) { out->data.recv_status_on_client.trailing_metadata = &metadata_array; @@ -412,19 +456,22 @@ class ClientStatusOp : public Op { EscapableHandleScope scope; Local status_obj = Nan::New(); Nan::Set(status_obj, Nan::New("code").ToLocalChecked(), - Nan::New(status)); + Nan::New(status)); Nan::Set(status_obj, Nan::New("details").ToLocalChecked(), - CopyStringFromSlice(status_details)); + CopyStringFromSlice(status_details)); Nan::Set(status_obj, Nan::New("metadata").ToLocalChecked(), ParseMetadata(&metadata_array)); return scope.Escape(status_obj); } - bool IsFinalOp() { return true; } - void OnComplete(bool success) {} - + bool IsFinalOp() { + return true; + } + void OnComplete(bool success) { + } protected: - std::string GetTypeString() const { return "status"; } - + std::string GetTypeString() const { + return "status"; + } private: grpc_metadata_array metadata_array; grpc_status_code status; @@ -442,18 +489,23 @@ class ServerCloseResponseOp : public Op { out->data.recv_close_on_server.cancelled = &cancelled; return true; } - bool IsFinalOp() { return false; } - void OnComplete(bool success) {} + bool IsFinalOp() { + return false; + } + void OnComplete(bool success) { + } protected: - std::string GetTypeString() const { return "cancelled"; } + std::string GetTypeString() const { + return "cancelled"; + } private: int cancelled; }; -tag::tag(Callback *callback, OpVec *ops, Call *call, Local call_value) - : callback(callback), ops(ops), call(call) { +tag::tag(Callback *callback, OpVec *ops, Call *call, Local call_value) : + callback(callback), ops(ops), call(call){ HandleScope scope; call_persist.Reset(call_value); } @@ -503,15 +555,19 @@ void DestroyTag(void *tag) { void Call::DestroyCall() { if (this->wrapped_call != NULL) { - grpc_call_unref(this->wrapped_call); + grpc_call_destroy(this->wrapped_call); this->wrapped_call = NULL; } } -Call::Call(grpc_call *call) - : wrapped_call(call), pending_batches(0), has_final_op_completed(false) {} +Call::Call(grpc_call *call) : wrapped_call(call), + pending_batches(0), + has_final_op_completed(false) { +} -Call::~Call() { DestroyCall(); } +Call::~Call() { + DestroyCall(); +} void Call::Init(Local exports) { HandleScope scope; @@ -540,10 +596,10 @@ Local Call::WrapStruct(grpc_call *call) { return scope.Escape(Nan::Null()); } const int argc = 1; - Local argv[argc] = { - Nan::New(reinterpret_cast(call))}; - MaybeLocal maybe_instance = - Nan::NewInstance(constructor->GetFunction(), argc, argv); + Local argv[argc] = {Nan::New( + reinterpret_cast(call))}; + MaybeLocal maybe_instance = Nan::NewInstance( + constructor->GetFunction(), argc, argv); if (maybe_instance.IsEmpty()) { return scope.Escape(Nan::Null()); } else { @@ -575,7 +631,8 @@ NAN_METHOD(Call::New) { if (info[0]->IsExternal()) { Local ext = info[0].As(); // This option is used for wrapping an existing call - grpc_call *call_value = reinterpret_cast(ext->Value()); + grpc_call *call_value = + reinterpret_cast(ext->Value()); call = new Call(call_value); } else { if (!Channel::HasInstance(info[0])) { @@ -591,8 +648,8 @@ NAN_METHOD(Call::New) { // These arguments are at the end because they are optional grpc_call *parent_call = NULL; if (Call::HasInstance(info[4])) { - Call *parent_obj = - ObjectWrap::Unwrap(Nan::To(info[4]).ToLocalChecked()); + Call *parent_obj = ObjectWrap::Unwrap( + Nan::To(info[4]).ToLocalChecked()); parent_call = parent_obj->wrapped_call; } else if (!(info[4]->IsUndefined() || info[4]->IsNull())) { return Nan::ThrowTypeError( @@ -613,20 +670,22 @@ NAN_METHOD(Call::New) { double deadline = Nan::To(info[2]).FromJust(); grpc_channel *wrapped_channel = channel->GetWrappedChannel(); grpc_call *wrapped_call; - grpc_slice method = - CreateSliceFromString(Nan::To(info[1]).ToLocalChecked()); + grpc_slice method = CreateSliceFromString( + Nan::To(info[1]).ToLocalChecked()); if (info[3]->IsString()) { grpc_slice *host = new grpc_slice; - *host = - CreateSliceFromString(Nan::To(info[3]).ToLocalChecked()); + *host = CreateSliceFromString( + Nan::To(info[3]).ToLocalChecked()); wrapped_call = grpc_channel_create_call( - wrapped_channel, parent_call, propagate_flags, GetCompletionQueue(), - method, host, MillisecondsToTimespec(deadline), NULL); + wrapped_channel, parent_call, propagate_flags, + GetCompletionQueue(), method, + host, MillisecondsToTimespec(deadline), NULL); delete host; } else if (info[3]->IsUndefined() || info[3]->IsNull()) { wrapped_call = grpc_channel_create_call( - wrapped_channel, parent_call, propagate_flags, GetCompletionQueue(), - method, NULL, MillisecondsToTimespec(deadline), NULL); + wrapped_channel, parent_call, propagate_flags, + GetCompletionQueue(), method, + NULL, MillisecondsToTimespec(deadline), NULL); } else { return Nan::ThrowTypeError("Call's fourth argument must be a string"); } @@ -640,8 +699,8 @@ NAN_METHOD(Call::New) { } else { const int argc = 4; Local argv[argc] = {info[0], info[1], info[2], info[3]}; - MaybeLocal maybe_instance = - Nan::NewInstance(constructor->GetFunction(), argc, argv); + MaybeLocal maybe_instance = Nan::NewInstance( + constructor->GetFunction(), argc, argv); if (maybe_instance.IsEmpty()) { // There's probably a pending exception return; @@ -714,8 +773,8 @@ NAN_METHOD(Call::StartBatch) { } Callback *callback = new Callback(callback_func); grpc_call_error error = grpc_call_start_batch( - call->wrapped_call, &ops[0], nops, - new struct tag(callback, op_vector.release(), call, info.This()), NULL); + call->wrapped_call, &ops[0], nops, new struct tag( + callback, op_vector.release(), call, info.This()), NULL); if (error != GRPC_CALL_OK) { return Nan::ThrowError(nanErrorWithCode("startBatch failed", error)); } @@ -748,8 +807,8 @@ NAN_METHOD(Call::CancelWithStatus) { "cancelWithStatus's second argument must be a string"); } Call *call = ObjectWrap::Unwrap(info.This()); - grpc_status_code code = - static_cast(Nan::To(info[0]).FromJust()); + grpc_status_code code = static_cast( + Nan::To(info[0]).FromJust()); if (code == GRPC_STATUS_OK) { return Nan::ThrowRangeError( "cancelWithStatus cannot be called with OK status"); diff --git a/src/node/ext/call.h b/src/node/ext/call.h index 0bd24f56a9a..340e32682b9 100644 --- a/src/node/ext/call.h +++ b/src/node/ext/call.h @@ -37,13 +37,14 @@ #include #include -#include #include +#include #include "grpc/grpc.h" #include "grpc/support/log.h" #include "channel.h" + namespace grpc { namespace node { diff --git a/src/node/ext/call_credentials.cc b/src/node/ext/call_credentials.cc index f88eb829334..5bd4bdcd5ab 100644 --- a/src/node/ext/call_credentials.cc +++ b/src/node/ext/call_credentials.cc @@ -31,17 +31,17 @@ * */ -#include #include +#include #include #include -#include "call.h" -#include "call_credentials.h" #include "grpc/grpc.h" #include "grpc/grpc_security.h" #include "grpc/support/log.h" +#include "call_credentials.h" +#include "call.h" namespace grpc { namespace node { @@ -86,15 +86,15 @@ void CallCredentials::Init(Local exports) { fun_tpl.Reset(tpl); Local ctr = Nan::GetFunction(tpl).ToLocalChecked(); Nan::Set(ctr, Nan::New("createFromPlugin").ToLocalChecked(), - Nan::GetFunction(Nan::New(CreateFromPlugin)) - .ToLocalChecked()); + Nan::GetFunction( + Nan::New(CreateFromPlugin)).ToLocalChecked()); Nan::Set(exports, Nan::New("CallCredentials").ToLocalChecked(), ctr); constructor = new Nan::Callback(ctr); Local callback_tpl = Nan::New(PluginCallback); - plugin_callback = - new Callback(Nan::GetFunction(callback_tpl).ToLocalChecked()); + plugin_callback = new Callback( + Nan::GetFunction(callback_tpl).ToLocalChecked()); } bool CallCredentials::HasInstance(Local val) { @@ -109,9 +109,9 @@ Local CallCredentials::WrapStruct(grpc_call_credentials *credentials) { return scope.Escape(Nan::Null()); } Local argv[argc] = { - Nan::New(reinterpret_cast(credentials))}; - MaybeLocal maybe_instance = - Nan::NewInstance(constructor->GetFunction(), argc, argv); + Nan::New(reinterpret_cast(credentials))}; + MaybeLocal maybe_instance = Nan::NewInstance( + constructor->GetFunction(), argc, argv); if (maybe_instance.IsEmpty()) { return scope.Escape(Nan::Null()); } else { @@ -160,6 +160,8 @@ NAN_METHOD(CallCredentials::Compose) { info.GetReturnValue().Set(WrapStruct(creds)); } + + NAN_METHOD(CallCredentials::CreateFromPlugin) { if (!info[0]->IsFunction()) { return Nan::ThrowTypeError( @@ -168,19 +170,21 @@ NAN_METHOD(CallCredentials::CreateFromPlugin) { grpc_metadata_credentials_plugin plugin; plugin_state *state = new plugin_state; state->callback = new Nan::Callback(info[0].As()); - state->pending_callbacks = new std::queue(); + state->pending_callbacks = new std::queue(); uv_mutex_init(&state->plugin_mutex); - uv_async_init(uv_default_loop(), &state->plugin_async, SendPluginCallback); - uv_unref((uv_handle_t *)&state->plugin_async); + uv_async_init(uv_default_loop(), + &state->plugin_async, + SendPluginCallback); + uv_unref((uv_handle_t*)&state->plugin_async); state->plugin_async.data = state; plugin.get_metadata = plugin_get_metadata; plugin.destroy = plugin_destroy_state; - plugin.state = reinterpret_cast(state); + plugin.state = reinterpret_cast(state); plugin.type = ""; - grpc_call_credentials *creds = - grpc_metadata_credentials_create_from_plugin(plugin, NULL); + grpc_call_credentials *creds = grpc_metadata_credentials_create_from_plugin( + plugin, NULL); info.GetReturnValue().Set(WrapStruct(creds)); } @@ -202,35 +206,34 @@ NAN_METHOD(PluginCallback) { return Nan::ThrowTypeError( "The callback's fourth argument must be an object"); } - grpc_status_code code = - static_cast(Nan::To(info[0]).FromJust()); + grpc_status_code code = static_cast( + Nan::To(info[0]).FromJust()); Utf8String details_utf8_str(info[1]); char *details = *details_utf8_str; grpc_metadata_array array; grpc_metadata_array_init(&array); Local callback_data = Nan::To(info[3]).ToLocalChecked(); - if (!CreateMetadataArray(Nan::To(info[2]).ToLocalChecked(), &array)) { + if (!CreateMetadataArray(Nan::To(info[2]).ToLocalChecked(), + &array)){ return Nan::ThrowError("Failed to parse metadata"); } grpc_credentials_plugin_metadata_cb cb = reinterpret_cast( - Nan::Get(callback_data, Nan::New("cb").ToLocalChecked()) - .ToLocalChecked() - .As() - ->Value()); + Nan::Get(callback_data, + Nan::New("cb").ToLocalChecked() + ).ToLocalChecked().As()->Value()); void *user_data = - Nan::Get(callback_data, Nan::New("user_data").ToLocalChecked()) - .ToLocalChecked() - .As() - ->Value(); + Nan::Get(callback_data, + Nan::New("user_data").ToLocalChecked() + ).ToLocalChecked().As()->Value(); cb(user_data, array.metadata, array.count, code, details); DestroyMetadataArray(&array); } NAUV_WORK_CB(SendPluginCallback) { Nan::HandleScope scope; - plugin_state *state = reinterpret_cast(async->data); - std::queue callbacks; + plugin_state *state = reinterpret_cast(async->data); + std::queue callbacks; uv_mutex_lock(&state->plugin_mutex); state->pending_callbacks->swap(callbacks); uv_mutex_unlock(&state->plugin_mutex); @@ -239,14 +242,16 @@ NAUV_WORK_CB(SendPluginCallback) { callbacks.pop(); Local callback_data = Nan::New(); Nan::Set(callback_data, Nan::New("cb").ToLocalChecked(), - Nan::New(reinterpret_cast(data->cb))); + Nan::New(reinterpret_cast(data->cb))); Nan::Set(callback_data, Nan::New("user_data").ToLocalChecked(), Nan::New(data->user_data)); const int argc = 3; v8::Local argv[argc] = { - Nan::New(data->service_url).ToLocalChecked(), callback_data, - // Get Local from Nan::Callback* - **plugin_callback}; + Nan::New(data->service_url).ToLocalChecked(), + callback_data, + // Get Local from Nan::Callback* + **plugin_callback + }; Nan::Callback *callback = state->callback; callback->Call(argc, argv); delete data; @@ -256,7 +261,7 @@ NAUV_WORK_CB(SendPluginCallback) { void plugin_get_metadata(void *state, grpc_auth_metadata_context context, grpc_credentials_plugin_metadata_cb cb, void *user_data) { - plugin_state *p_state = reinterpret_cast(state); + plugin_state *p_state = reinterpret_cast(state); plugin_callback_data *data = new plugin_callback_data; data->service_url = context.service_url; data->cb = cb; @@ -270,7 +275,7 @@ void plugin_get_metadata(void *state, grpc_auth_metadata_context context, } void plugin_uv_close_cb(uv_handle_t *handle) { - uv_async_t *async = reinterpret_cast(handle); + uv_async_t *async = reinterpret_cast(handle); plugin_state *state = reinterpret_cast(async->data); uv_mutex_destroy(&state->plugin_mutex); delete state->pending_callbacks; @@ -280,7 +285,7 @@ void plugin_uv_close_cb(uv_handle_t *handle) { void plugin_destroy_state(void *ptr) { plugin_state *state = reinterpret_cast(ptr); - uv_close((uv_handle_t *)&state->plugin_async, plugin_uv_close_cb); + uv_close((uv_handle_t*)&state->plugin_async, plugin_uv_close_cb); } } // namespace node diff --git a/src/node/ext/call_credentials.h b/src/node/ext/call_credentials.h index 5a1741c606f..21a4b8923e2 100644 --- a/src/node/ext/call_credentials.h +++ b/src/node/ext/call_credentials.h @@ -36,8 +36,8 @@ #include -#include #include +#include #include #include "grpc/grpc_security.h" @@ -84,7 +84,7 @@ typedef struct plugin_callback_data { typedef struct plugin_state { Nan::Callback *callback; - std::queue *pending_callbacks; + std::queue *pending_callbacks; uv_mutex_t plugin_mutex; // async.data == this uv_async_t plugin_async; diff --git a/src/node/ext/channel.cc b/src/node/ext/channel.cc index be04cf421d6..1263cc0d286 100644 --- a/src/node/ext/channel.cc +++ b/src/node/ext/channel.cc @@ -35,15 +35,15 @@ #include "grpc/support/log.h" -#include #include +#include +#include "grpc/grpc.h" +#include "grpc/grpc_security.h" #include "call.h" #include "channel.h" -#include "channel_credentials.h" #include "completion_queue.h" #include "completion_queue_async_worker.h" -#include "grpc/grpc.h" -#include "grpc/grpc_security.h" +#include "channel_credentials.h" #include "timeval.h" namespace grpc { @@ -82,8 +82,8 @@ bool ParseChannelArgs(Local args_val, *channel_args_ptr = NULL; return false; } - grpc_channel_args *channel_args = - reinterpret_cast(malloc(sizeof(grpc_channel_args))); + grpc_channel_args *channel_args = reinterpret_cast( + malloc(sizeof(grpc_channel_args))); *channel_args_ptr = channel_args; Local args_hash = Nan::To(args_val).ToLocalChecked(); Local keys = Nan::GetOwnPropertyNames(args_hash).ToLocalChecked(); @@ -104,16 +104,16 @@ bool ParseChannelArgs(Local args_val, } else if (value->IsString()) { Utf8String val_str(value); channel_args->args[i].type = GRPC_ARG_STRING; - channel_args->args[i].value.string = - reinterpret_cast(calloc(val_str.length() + 1, sizeof(char))); - memcpy(channel_args->args[i].value.string, *val_str, - val_str.length() + 1); + channel_args->args[i].value.string = reinterpret_cast( + calloc(val_str.length() + 1,sizeof(char))); + memcpy(channel_args->args[i].value.string, + *val_str, val_str.length() + 1); } else { // The value does not match either of the accepted types return false; } - channel_args->args[i].key = - reinterpret_cast(calloc(key_str.length() + 1, sizeof(char))); + channel_args->args[i].key = reinterpret_cast( + calloc(key_str.length() + 1, sizeof(char))); memcpy(channel_args->args[i].key, *key_str, key_str.length() + 1); } return true; @@ -190,13 +190,12 @@ NAN_METHOD(Channel::New) { grpc_channel_args *channel_args_ptr = NULL; if (!ParseChannelArgs(info[2], &channel_args_ptr)) { DeallocateChannelArgs(channel_args_ptr); - return Nan::ThrowTypeError( - "Channel options must be an object with " - "string keys and integer or string values"); + return Nan::ThrowTypeError("Channel options must be an object with " + "string keys and integer or string values"); } if (creds == NULL) { - wrapped_channel = - grpc_insecure_channel_create(*host, channel_args_ptr, NULL); + wrapped_channel = grpc_insecure_channel_create(*host, channel_args_ptr, + NULL); } else { wrapped_channel = grpc_secure_channel_create(creds, *host, channel_args_ptr, NULL); @@ -209,8 +208,8 @@ NAN_METHOD(Channel::New) { } else { const int argc = 3; Local argv[argc] = {info[0], info[1], info[2]}; - MaybeLocal maybe_instance = - Nan::NewInstance(constructor->GetFunction(), argc, argv); + MaybeLocal maybe_instance = Nan::NewInstance( + constructor->GetFunction(), argc, argv); if (maybe_instance.IsEmpty()) { // There's probably a pending exception return; @@ -233,13 +232,11 @@ NAN_METHOD(Channel::Close) { NAN_METHOD(Channel::GetTarget) { if (!HasInstance(info.This())) { - return Nan::ThrowTypeError( - "getTarget can only be called on Channel objects"); + return Nan::ThrowTypeError("getTarget can only be called on Channel objects"); } Channel *channel = ObjectWrap::Unwrap(info.This()); - info.GetReturnValue().Set( - Nan::New(grpc_channel_get_target(channel->wrapped_channel)) - .ToLocalChecked()); + info.GetReturnValue().Set(Nan::New( + grpc_channel_get_target(channel->wrapped_channel)).ToLocalChecked()); } NAN_METHOD(Channel::GetConnectivityState) { @@ -249,8 +246,9 @@ NAN_METHOD(Channel::GetConnectivityState) { } Channel *channel = ObjectWrap::Unwrap(info.This()); int try_to_connect = (int)info[0]->Equals(Nan::True()); - info.GetReturnValue().Set(grpc_channel_check_connectivity_state( - channel->wrapped_channel, try_to_connect)); + info.GetReturnValue().Set( + grpc_channel_check_connectivity_state(channel->wrapped_channel, + try_to_connect)); } NAN_METHOD(Channel::WatchConnectivityState) { @@ -270,8 +268,9 @@ NAN_METHOD(Channel::WatchConnectivityState) { return Nan::ThrowTypeError( "watchConnectivityState's third argument must be a callback"); } - grpc_connectivity_state last_state = static_cast( - Nan::To(info[0]).FromJust()); + grpc_connectivity_state last_state = + static_cast( + Nan::To(info[0]).FromJust()); double deadline = Nan::To(info[1]).FromJust(); Local callback_func = info[2].As(); Nan::Callback *callback = new Callback(callback_func); @@ -280,7 +279,8 @@ NAN_METHOD(Channel::WatchConnectivityState) { grpc_channel_watch_connectivity_state( channel->wrapped_channel, last_state, MillisecondsToTimespec(deadline), GetCompletionQueue(), - new struct tag(callback, ops.release(), NULL, Nan::Null())); + new struct tag(callback, + ops.release(), NULL, Nan::Null())); CompletionQueueNext(); } diff --git a/src/node/ext/channel.h b/src/node/ext/channel.h index 6d42a5e0406..9ec28e15af0 100644 --- a/src/node/ext/channel.h +++ b/src/node/ext/channel.h @@ -34,8 +34,8 @@ #ifndef NET_GRPC_NODE_CHANNEL_H_ #define NET_GRPC_NODE_CHANNEL_H_ -#include #include +#include #include "grpc/grpc.h" namespace grpc { diff --git a/src/node/ext/channel_credentials.cc b/src/node/ext/channel_credentials.cc index cf1dc318a8f..059bc8a8902 100644 --- a/src/node/ext/channel_credentials.cc +++ b/src/node/ext/channel_credentials.cc @@ -33,12 +33,12 @@ #include -#include "call.h" -#include "call_credentials.h" -#include "channel_credentials.h" #include "grpc/grpc.h" #include "grpc/grpc_security.h" #include "grpc/support/log.h" +#include "channel_credentials.h" +#include "call_credentials.h" +#include "call.h" namespace grpc { namespace node { @@ -80,12 +80,12 @@ void ChannelCredentials::Init(Local exports) { Nan::SetPrototypeMethod(tpl, "compose", Compose); fun_tpl.Reset(tpl); Local ctr = Nan::GetFunction(tpl).ToLocalChecked(); - Nan::Set( - ctr, Nan::New("createSsl").ToLocalChecked(), - Nan::GetFunction(Nan::New(CreateSsl)).ToLocalChecked()); + Nan::Set(ctr, Nan::New("createSsl").ToLocalChecked(), + Nan::GetFunction( + Nan::New(CreateSsl)).ToLocalChecked()); Nan::Set(ctr, Nan::New("createInsecure").ToLocalChecked(), - Nan::GetFunction(Nan::New(CreateInsecure)) - .ToLocalChecked()); + Nan::GetFunction( + Nan::New(CreateInsecure)).ToLocalChecked()); Nan::Set(exports, Nan::New("ChannelCredentials").ToLocalChecked(), ctr); constructor = new Nan::Callback(ctr); } @@ -100,9 +100,9 @@ Local ChannelCredentials::WrapStruct( EscapableHandleScope scope; const int argc = 1; Local argv[argc] = { - Nan::New(reinterpret_cast(credentials))}; - MaybeLocal maybe_instance = - Nan::NewInstance(constructor->GetFunction(), argc, argv); + Nan::New(reinterpret_cast(credentials))}; + MaybeLocal maybe_instance = Nan::NewInstance( + constructor->GetFunction(), argc, argv); if (maybe_instance.IsEmpty()) { return scope.Escape(Nan::Null()); } else { @@ -179,10 +179,11 @@ NAN_METHOD(ChannelCredentials::Compose) { return Nan::ThrowTypeError( "compose's first argument must be a CallCredentials object"); } - ChannelCredentials *self = - ObjectWrap::Unwrap(info.This()); + ChannelCredentials *self = ObjectWrap::Unwrap( + info.This()); if (self->wrapped_credentials == NULL) { - return Nan::ThrowTypeError("Cannot compose insecure credential"); + return Nan::ThrowTypeError( + "Cannot compose insecure credential"); } CallCredentials *other = ObjectWrap::Unwrap( Nan::To(info[0]).ToLocalChecked()); diff --git a/src/node/ext/channel_credentials.h b/src/node/ext/channel_credentials.h index e5c7439de27..89b115267f3 100644 --- a/src/node/ext/channel_credentials.h +++ b/src/node/ext/channel_credentials.h @@ -34,8 +34,8 @@ #ifndef NET_GRPC_NODE_CHANNEL_CREDENTIALS_H_ #define NET_GRPC_NODE_CHANNEL_CREDENTIALS_H_ -#include #include +#include #include "grpc/grpc.h" #include "grpc/grpc_security.h" diff --git a/src/node/ext/completion_queue.h b/src/node/ext/completion_queue.h index a3a055c385a..9b01028ef17 100644 --- a/src/node/ext/completion_queue.h +++ b/src/node/ext/completion_queue.h @@ -31,8 +31,8 @@ * */ -#include #include +#include namespace grpc { namespace node { diff --git a/src/node/ext/completion_queue_threadpool.cc b/src/node/ext/completion_queue_threadpool.cc index 72df5d1d65f..7b1bdda0334 100644 --- a/src/node/ext/completion_queue_threadpool.cc +++ b/src/node/ext/completion_queue_threadpool.cc @@ -34,14 +34,14 @@ /* I don't like using #ifndef, but I don't see a better way to do this */ #ifndef GRPC_UV -#include #include +#include -#include "call.h" -#include "completion_queue.h" #include "grpc/grpc.h" #include "grpc/support/log.h" #include "grpc/support/time.h" +#include "completion_queue.h" +#include "call.h" namespace grpc { namespace node { @@ -111,8 +111,8 @@ CompletionQueueAsyncWorker::CompletionQueueAsyncWorker() CompletionQueueAsyncWorker::~CompletionQueueAsyncWorker() {} void CompletionQueueAsyncWorker::Execute() { - result = grpc_completion_queue_next(queue, gpr_inf_future(GPR_CLOCK_REALTIME), - NULL); + result = + grpc_completion_queue_next(queue, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); if (!result.success) { SetErrorMessage("The async function encountered an error"); } @@ -141,7 +141,7 @@ void CompletionQueueAsyncWorker::Init(Local exports) { Nan::HandleScope scope; current_threads = 0; waiting_next_calls = 0; - queue = grpc_completion_queue_create_for_next(NULL); + queue = grpc_completion_queue_create(NULL); } void CompletionQueueAsyncWorker::HandleOKCallback() { @@ -168,7 +168,9 @@ grpc_completion_queue *GetCompletionQueue() { return CompletionQueueAsyncWorker::GetQueue(); } -void CompletionQueueNext() { CompletionQueueAsyncWorker::Next(); } +void CompletionQueueNext() { + CompletionQueueAsyncWorker::Next(); +} void CompletionQueueInit(Local exports) { CompletionQueueAsyncWorker::Init(exports); @@ -177,4 +179,4 @@ void CompletionQueueInit(Local exports) { } // namespace node } // namespace grpc -#endif /* GRPC_UV */ +#endif /* GRPC_UV */ diff --git a/src/node/ext/completion_queue_uv.cc b/src/node/ext/completion_queue_uv.cc index 9b60911d1e9..0f6f7da4607 100644 --- a/src/node/ext/completion_queue_uv.cc +++ b/src/node/ext/completion_queue_uv.cc @@ -33,10 +33,10 @@ #ifdef GRPC_UV -#include -#include #include +#include #include +#include #include "call.h" #include "completion_queue.h" @@ -57,8 +57,8 @@ void drain_completion_queue(uv_prepare_t *handle) { grpc_event event; (void)handle; do { - event = grpc_completion_queue_next(queue, gpr_inf_past(GPR_CLOCK_MONOTONIC), - NULL); + event = grpc_completion_queue_next( + queue, gpr_inf_past(GPR_CLOCK_MONOTONIC), NULL); if (event.type == GRPC_OP_COMPLETE) { const char *error_message; @@ -77,7 +77,9 @@ void drain_completion_queue(uv_prepare_t *handle) { } while (event.type != GRPC_QUEUE_TIMEOUT); } -grpc_completion_queue *GetCompletionQueue() { return queue; } +grpc_completion_queue *GetCompletionQueue() { + return queue; +} void CompletionQueueNext() { if (pending_batches == 0) { @@ -88,7 +90,7 @@ void CompletionQueueNext() { } void CompletionQueueInit(Local exports) { - queue = grpc_completion_queue_create_for_next(NULL); + queue = grpc_completion_queue_create(NULL); uv_prepare_init(uv_default_loop(), &prepare); pending_batches = 0; } diff --git a/src/node/ext/node_grpc.cc b/src/node/ext/node_grpc.cc index 076f1ed4242..122e5e63ee9 100644 --- a/src/node/ext/node_grpc.cc +++ b/src/node/ext/node_grpc.cc @@ -33,8 +33,8 @@ #include -#include #include +#include #include #include "grpc/grpc.h" #include "grpc/grpc_security.h" @@ -53,12 +53,12 @@ extern "C" { #include "call_credentials.h" #include "channel.h" #include "channel_credentials.h" -#include "completion_queue.h" -#include "completion_queue_async_worker.h" #include "server.h" +#include "completion_queue_async_worker.h" #include "server_credentials.h" #include "slice.h" #include "timeval.h" +#include "completion_queue.h" using grpc::node::CreateSliceFromString; @@ -188,7 +188,8 @@ void InitOpTypeConstants(Local exports) { Nan::New(GRPC_OP_SEND_INITIAL_METADATA)); Nan::Set(op_type, Nan::New("SEND_INITIAL_METADATA").ToLocalChecked(), SEND_INITIAL_METADATA); - Local SEND_MESSAGE(Nan::New(GRPC_OP_SEND_MESSAGE)); + Local SEND_MESSAGE( + Nan::New(GRPC_OP_SEND_MESSAGE)); Nan::Set(op_type, Nan::New("SEND_MESSAGE").ToLocalChecked(), SEND_MESSAGE); Local SEND_CLOSE_FROM_CLIENT( Nan::New(GRPC_OP_SEND_CLOSE_FROM_CLIENT)); @@ -202,7 +203,8 @@ void InitOpTypeConstants(Local exports) { Nan::New(GRPC_OP_RECV_INITIAL_METADATA)); Nan::Set(op_type, Nan::New("RECV_INITIAL_METADATA").ToLocalChecked(), RECV_INITIAL_METADATA); - Local RECV_MESSAGE(Nan::New(GRPC_OP_RECV_MESSAGE)); + Local RECV_MESSAGE( + Nan::New(GRPC_OP_RECV_MESSAGE)); Nan::Set(op_type, Nan::New("RECV_MESSAGE").ToLocalChecked(), RECV_MESSAGE); Local RECV_STATUS_ON_CLIENT( Nan::New(GRPC_OP_RECV_STATUS_ON_CLIENT)); @@ -250,7 +252,8 @@ void InitConnectivityStateConstants(Local exports) { Nan::New(GRPC_CHANNEL_TRANSIENT_FAILURE)); Nan::Set(channel_state, Nan::New("TRANSIENT_FAILURE").ToLocalChecked(), TRANSIENT_FAILURE); - Local FATAL_FAILURE(Nan::New(GRPC_CHANNEL_SHUTDOWN)); + Local FATAL_FAILURE( + Nan::New(GRPC_CHANNEL_SHUTDOWN)); Nan::Set(channel_state, Nan::New("FATAL_FAILURE").ToLocalChecked(), FATAL_FAILURE); } @@ -279,11 +282,13 @@ void InitLogConstants(Local exports) { NAN_METHOD(MetadataKeyIsLegal) { if (!info[0]->IsString()) { - return Nan::ThrowTypeError("headerKeyIsLegal's argument must be a string"); + return Nan::ThrowTypeError( + "headerKeyIsLegal's argument must be a string"); } Local key = Nan::To(info[0]).ToLocalChecked(); grpc_slice slice = CreateSliceFromString(key); - info.GetReturnValue().Set(static_cast(grpc_header_key_is_legal(slice))); + info.GetReturnValue().Set(static_cast( + grpc_header_key_is_legal(slice))); grpc_slice_unref(slice); } @@ -294,8 +299,8 @@ NAN_METHOD(MetadataNonbinValueIsLegal) { } Local value = Nan::To(info[0]).ToLocalChecked(); grpc_slice slice = CreateSliceFromString(value); - info.GetReturnValue().Set( - static_cast(grpc_header_nonbin_value_is_legal(slice))); + info.GetReturnValue().Set(static_cast( + grpc_header_nonbin_value_is_legal(slice))); grpc_slice_unref(slice); } @@ -306,7 +311,8 @@ NAN_METHOD(MetadataKeyIsBinary) { } Local key = Nan::To(info[0]).ToLocalChecked(); grpc_slice slice = CreateSliceFromString(key); - info.GetReturnValue().Set(static_cast(grpc_is_binary_header(slice))); + info.GetReturnValue().Set(static_cast( + grpc_is_binary_header(slice))); grpc_slice_unref(slice); } @@ -348,13 +354,11 @@ NAUV_WORK_CB(LogMessagesCallback) { args.pop(); Local file = Nan::New(arg->core_args.file).ToLocalChecked(); Local line = Nan::New(arg->core_args.line); - Local severity = - Nan::New(gpr_log_severity_string(arg->core_args.severity)) - .ToLocalChecked(); + Local severity = Nan::New( + gpr_log_severity_string(arg->core_args.severity)).ToLocalChecked(); Local message = Nan::New(arg->core_args.message).ToLocalChecked(); - Local timestamp = - Nan::New(grpc::node::TimespecToMilliseconds(arg->timestamp)) - .ToLocalChecked(); + Local timestamp = Nan::New( + grpc::node::TimespecToMilliseconds(arg->timestamp)).ToLocalChecked(); const int argc = 5; Local argv[argc] = {file, line, severity, message, timestamp}; grpc_logger_state.callback->Call(argc, argv); @@ -384,9 +388,10 @@ void init_logger() { memset(&grpc_logger_state, 0, sizeof(logger_state)); grpc_logger_state.pending_args = new std::queue(); uv_mutex_init(&grpc_logger_state.mutex); - uv_async_init(uv_default_loop(), &grpc_logger_state.async, + uv_async_init(uv_default_loop(), + &grpc_logger_state.async, LogMessagesCallback); - uv_unref((uv_handle_t *)&grpc_logger_state.async); + uv_unref((uv_handle_t*)&grpc_logger_state.async); grpc_logger_state.logger_set = false; gpr_log_verbosity_init(); @@ -411,10 +416,11 @@ NAN_METHOD(SetDefaultLoggerCallback) { NAN_METHOD(SetLogVerbosity) { if (!info[0]->IsUint32()) { - return Nan::ThrowTypeError("setLogVerbosity's argument must be a number"); + return Nan::ThrowTypeError( + "setLogVerbosity's argument must be a number"); } - gpr_log_severity severity = - static_cast(Nan::To(info[0]).FromJust()); + gpr_log_severity severity = static_cast( + Nan::To(info[0]).FromJust()); gpr_set_log_verbosity(severity); } @@ -447,25 +453,28 @@ void init(Local exports) { // Attach a few utility functions directly to the module Nan::Set(exports, Nan::New("metadataKeyIsLegal").ToLocalChecked(), - Nan::GetFunction(Nan::New(MetadataKeyIsLegal)) - .ToLocalChecked()); - Nan::Set( - exports, Nan::New("metadataNonbinValueIsLegal").ToLocalChecked(), - Nan::GetFunction(Nan::New(MetadataNonbinValueIsLegal)) - .ToLocalChecked()); + Nan::GetFunction( + Nan::New(MetadataKeyIsLegal)).ToLocalChecked()); + Nan::Set(exports, Nan::New("metadataNonbinValueIsLegal").ToLocalChecked(), + Nan::GetFunction( + Nan::New(MetadataNonbinValueIsLegal) + ).ToLocalChecked()); Nan::Set(exports, Nan::New("metadataKeyIsBinary").ToLocalChecked(), - Nan::GetFunction(Nan::New(MetadataKeyIsBinary)) - .ToLocalChecked()); + Nan::GetFunction( + Nan::New(MetadataKeyIsBinary) + ).ToLocalChecked()); Nan::Set(exports, Nan::New("setDefaultRootsPem").ToLocalChecked(), - Nan::GetFunction(Nan::New(SetDefaultRootsPem)) - .ToLocalChecked()); - Nan::Set( - exports, Nan::New("setDefaultLoggerCallback").ToLocalChecked(), - Nan::GetFunction(Nan::New(SetDefaultLoggerCallback)) - .ToLocalChecked()); + Nan::GetFunction( + Nan::New(SetDefaultRootsPem) + ).ToLocalChecked()); + Nan::Set(exports, Nan::New("setDefaultLoggerCallback").ToLocalChecked(), + Nan::GetFunction( + Nan::New(SetDefaultLoggerCallback) + ).ToLocalChecked()); Nan::Set(exports, Nan::New("setLogVerbosity").ToLocalChecked(), - Nan::GetFunction(Nan::New(SetLogVerbosity)) - .ToLocalChecked()); + Nan::GetFunction( + Nan::New(SetLogVerbosity) + ).ToLocalChecked()); } NODE_MODULE(grpc_node, init) diff --git a/src/node/ext/server.cc b/src/node/ext/server.cc index 1871a324528..5384305631d 100644 --- a/src/node/ext/server.cc +++ b/src/node/ext/server.cc @@ -111,9 +111,14 @@ class NewCallOp : public Op { return scope.Escape(obj); } - bool ParseOp(Local value, grpc_op *out) { return true; } - bool IsFinalOp() { return false; } - void OnComplete(bool success) {} + bool ParseOp(Local value, grpc_op *out) { + return true; + } + bool IsFinalOp() { + return false; + } + void OnComplete(bool success) { + } grpc_call *call; grpc_call_details details; @@ -123,7 +128,7 @@ class NewCallOp : public Op { std::string GetTypeString() const { return "new_call"; } }; -class TryShutdownOp : public Op { +class TryShutdownOp: public Op { public: TryShutdownOp(Server *server, Local server_value) : server(server) { server_persist.Reset(server_value); @@ -132,17 +137,19 @@ class TryShutdownOp : public Op { EscapableHandleScope scope; return scope.Escape(Nan::New(server_persist)); } - bool ParseOp(Local value, grpc_op *out) { return true; } - bool IsFinalOp() { return false; } + bool ParseOp(Local value, grpc_op *out) { + return true; + } + bool IsFinalOp() { + return false; + } void OnComplete(bool success) { if (success) { server->DestroyWrappedServer(); } } - protected: std::string GetTypeString() const { return "try_shutdown"; } - private: Server *server; Nan::Persistent> @@ -220,9 +227,10 @@ NAN_METHOD(Server::RequestCall) { ops->push_back(unique_ptr(op)); grpc_call_error error = grpc_server_request_call( server->wrapped_server, &op->call, &op->details, &op->request_metadata, - GetCompletionQueue(), GetCompletionQueue(), - new struct tag(new Callback(info[0].As()), ops.release(), NULL, - Nan::Null())); + GetCompletionQueue(), + GetCompletionQueue(), + new struct tag(new Callback(info[0].As()), ops.release(), + NULL, Nan::Null())); if (error != GRPC_CALL_OK) { return Nan::ThrowError(nanErrorWithCode("requestCall failed", error)); } diff --git a/src/node/ext/server.h b/src/node/ext/server.h index 2d8cb4c4441..c0f2e86554b 100644 --- a/src/node/ext/server.h +++ b/src/node/ext/server.h @@ -34,8 +34,8 @@ #ifndef NET_GRPC_NODE_SERVER_H_ #define NET_GRPC_NODE_SERVER_H_ -#include #include +#include #include "grpc/grpc.h" namespace grpc { diff --git a/src/node/ext/server_credentials.cc b/src/node/ext/server_credentials.cc index e070ff1f265..0ff58bb2092 100644 --- a/src/node/ext/server_credentials.cc +++ b/src/node/ext/server_credentials.cc @@ -78,12 +78,12 @@ void ServerCredentials::Init(Local exports) { tpl->SetClassName(Nan::New("ServerCredentials").ToLocalChecked()); tpl->InstanceTemplate()->SetInternalFieldCount(1); Local ctr = tpl->GetFunction(); - Nan::Set( - ctr, Nan::New("createSsl").ToLocalChecked(), - Nan::GetFunction(Nan::New(CreateSsl)).ToLocalChecked()); + Nan::Set(ctr, Nan::New("createSsl").ToLocalChecked(), + Nan::GetFunction( + Nan::New(CreateSsl)).ToLocalChecked()); Nan::Set(ctr, Nan::New("createInsecure").ToLocalChecked(), - Nan::GetFunction(Nan::New(CreateInsecure)) - .ToLocalChecked()); + Nan::GetFunction( + Nan::New(CreateInsecure)).ToLocalChecked()); fun_tpl.Reset(tpl); constructor = new Nan::Callback(ctr); Nan::Set(exports, Nan::New("ServerCredentials").ToLocalChecked(), ctr); @@ -99,9 +99,9 @@ Local ServerCredentials::WrapStruct( Nan::EscapableHandleScope scope; const int argc = 1; Local argv[argc] = { - Nan::New(reinterpret_cast(credentials))}; - MaybeLocal maybe_instance = - Nan::NewInstance(constructor->GetFunction(), argc, argv); + Nan::New(reinterpret_cast(credentials))}; + MaybeLocal maybe_instance = Nan::NewInstance( + constructor->GetFunction(), argc, argv); if (maybe_instance.IsEmpty()) { return scope.Escape(Nan::Null()); } else { @@ -160,13 +160,13 @@ NAN_METHOD(ServerCredentials::CreateSsl) { } Local pair_list = Local::Cast(info[1]); uint32_t key_cert_pair_count = pair_list->Length(); - grpc_ssl_pem_key_cert_pair *key_cert_pairs = - new grpc_ssl_pem_key_cert_pair[key_cert_pair_count]; + grpc_ssl_pem_key_cert_pair *key_cert_pairs = new grpc_ssl_pem_key_cert_pair[ + key_cert_pair_count]; Local key_key = Nan::New("private_key").ToLocalChecked(); Local cert_key = Nan::New("cert_chain").ToLocalChecked(); - for (uint32_t i = 0; i < key_cert_pair_count; i++) { + for(uint32_t i = 0; i < key_cert_pair_count; i++) { Local pair_val = Nan::Get(pair_list, i).ToLocalChecked(); if (!pair_val->IsObject()) { delete[] key_cert_pairs; diff --git a/src/node/ext/server_credentials.h b/src/node/ext/server_credentials.h index 808088f6e24..bf279e481c6 100644 --- a/src/node/ext/server_credentials.h +++ b/src/node/ext/server_credentials.h @@ -34,8 +34,8 @@ #ifndef NET_GRPC_NODE_SERVER_CREDENTIALS_H_ #define NET_GRPC_NODE_SERVER_CREDENTIALS_H_ -#include #include +#include #include "grpc/grpc.h" #include "grpc/grpc_security.h" diff --git a/src/node/ext/server_generic.cc b/src/node/ext/server_generic.cc index 088273d527c..0cf20f754a8 100644 --- a/src/node/ext/server_generic.cc +++ b/src/node/ext/server_generic.cc @@ -35,8 +35,8 @@ #include "server.h" -#include #include +#include #include "grpc/grpc.h" #include "grpc/support/time.h" @@ -44,11 +44,9 @@ namespace grpc { namespace node { Server::Server(grpc_server *server) : wrapped_server(server) { - grpc_completion_queue_attributes attrs = { - GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK, GRPC_CQ_NON_LISTENING}; - shutdown_queue = grpc_completion_queue_create( - grpc_completion_queue_factory_lookup(&attrs), &attrs, NULL); - grpc_server_register_completion_queue(server, shutdown_queue, NULL); + shutdown_queue = grpc_completion_queue_create(NULL); + grpc_server_register_non_listening_completion_queue(server, shutdown_queue, + NULL); } Server::~Server() { diff --git a/src/node/ext/server_uv.cc b/src/node/ext/server_uv.cc index 709921b7fc1..789938318eb 100644 --- a/src/node/ext/server_uv.cc +++ b/src/node/ext/server_uv.cc @@ -35,8 +35,8 @@ #include "server.h" -#include #include +#include #include "grpc/grpc.h" #include "grpc/support/time.h" @@ -60,14 +60,22 @@ static Callback *shutdown_callback = NULL; class ServerShutdownOp : public Op { public: - ServerShutdownOp(grpc_server *server) : server(server) {} + ServerShutdownOp(grpc_server *server): server(server) { + } - ~ServerShutdownOp() {} + ~ServerShutdownOp() { + } - Local GetNodeValue() const { return Nan::Null(); } + Local GetNodeValue() const { + return Nan::Null(); + } - bool ParseOp(Local value, grpc_op *out) { return true; } - bool IsFinalOp() { return false; } + bool ParseOp(Local value, grpc_op *out) { + return true; + } + bool IsFinalOp() { + return false; + } void OnComplete(bool success) { /* Because cancel_all_calls was called, we assume that shutdown_and_notify completes successfully */ @@ -80,9 +88,12 @@ class ServerShutdownOp : public Op { std::string GetTypeString() const { return "shutdown"; } }; -Server::Server(grpc_server *server) : wrapped_server(server) {} +Server::Server(grpc_server *server) : wrapped_server(server) { +} -Server::~Server() { this->ShutdownServer(); } +Server::~Server() { + this->ShutdownServer(); +} NAN_METHOD(ServerShutdownCallback) { if (!info[0]->IsNull()) { @@ -94,10 +105,10 @@ void Server::ShutdownServer() { Nan::HandleScope scope; if (this->wrapped_server != NULL) { if (shutdown_callback == NULL) { - Local callback_tpl = + Localcallback_tpl = Nan::New(ServerShutdownCallback); - shutdown_callback = - new Callback(Nan::GetFunction(callback_tpl).ToLocalChecked()); + shutdown_callback = new Callback( + Nan::GetFunction(callback_tpl).ToLocalChecked()); } ServerShutdownOp *op = new ServerShutdownOp(this->wrapped_server); diff --git a/src/node/ext/slice.cc b/src/node/ext/slice.cc index 70e73628e79..104dd9e22cd 100644 --- a/src/node/ext/slice.cc +++ b/src/node/ext/slice.cc @@ -31,10 +31,10 @@ * */ +#include +#include #include #include -#include -#include #include "slice.h" @@ -49,19 +49,19 @@ using v8::Value; namespace { void SliceFreeCallback(char *data, void *hint) { - grpc_slice *slice = reinterpret_cast(hint); + grpc_slice *slice = reinterpret_cast(hint); grpc_slice_unref(*slice); delete slice; } void string_destroy_func(void *user_data) { - delete reinterpret_cast(user_data); + delete reinterpret_cast(user_data); } void buffer_destroy_func(void *user_data) { - delete reinterpret_cast(user_data); + delete reinterpret_cast(user_data); } -} // namespace +} // namespace grpc_slice CreateSliceFromString(const Local source) { Nan::HandleScope scope; @@ -73,32 +73,28 @@ grpc_slice CreateSliceFromString(const Local source) { grpc_slice CreateSliceFromBuffer(const Local source) { // Prerequisite: ::node::Buffer::HasInstance(source) Nan::HandleScope scope; - return grpc_slice_new_with_user_data( - ::node::Buffer::Data(source), ::node::Buffer::Length(source), - buffer_destroy_func, new PersistentValue(source)); + return grpc_slice_new_with_user_data(::node::Buffer::Data(source), + ::node::Buffer::Length(source), + buffer_destroy_func, + new PersistentValue(source)); } Local CopyStringFromSlice(const grpc_slice slice) { Nan::EscapableHandleScope scope; if (GRPC_SLICE_LENGTH(slice) == 0) { return scope.Escape(Nan::EmptyString()); } - return scope.Escape( - Nan::New(const_cast(reinterpret_cast( - GRPC_SLICE_START_PTR(slice))), - GRPC_SLICE_LENGTH(slice)) - .ToLocalChecked()); + return scope.Escape(Nan::New( + const_cast(reinterpret_cast(GRPC_SLICE_START_PTR(slice))), + GRPC_SLICE_LENGTH(slice)).ToLocalChecked()); } Local CreateBufferFromSlice(const grpc_slice slice) { Nan::EscapableHandleScope scope; grpc_slice *slice_ptr = new grpc_slice; *slice_ptr = grpc_slice_ref(slice); - return scope.Escape( - Nan::NewBuffer( - const_cast( - reinterpret_cast(GRPC_SLICE_START_PTR(*slice_ptr))), - GRPC_SLICE_LENGTH(*slice_ptr), SliceFreeCallback, slice_ptr) - .ToLocalChecked()); + return scope.Escape(Nan::NewBuffer( + const_cast(reinterpret_cast(GRPC_SLICE_START_PTR(*slice_ptr))), + GRPC_SLICE_LENGTH(*slice_ptr), SliceFreeCallback, slice_ptr).ToLocalChecked()); } } // namespace node diff --git a/src/node/ext/slice.h b/src/node/ext/slice.h index 89c8ecaf725..7dcb1bd45a8 100644 --- a/src/node/ext/slice.h +++ b/src/node/ext/slice.h @@ -31,15 +31,14 @@ * */ -#include -#include #include +#include +#include namespace grpc { namespace node { -typedef Nan::Persistent> - PersistentValue; +typedef Nan::Persistent> PersistentValue; grpc_slice CreateSliceFromString(const v8::Local source); diff --git a/src/node/ext/timeval.cc b/src/node/ext/timeval.cc index 741c324c66b..9284db62ef6 100644 --- a/src/node/ext/timeval.cc +++ b/src/node/ext/timeval.cc @@ -31,8 +31,8 @@ * */ -#include #include +#include #include "grpc/grpc.h" #include "grpc/support/time.h" diff --git a/src/node/health_check/package.json b/src/node/health_check/package.json index 37c9b7a54f5..3d331182981 100644 --- a/src/node/health_check/package.json +++ b/src/node/health_check/package.json @@ -1,6 +1,6 @@ { "name": "grpc-health-check", - "version": "1.4.0-dev", + "version": "1.3.0-pre1", "author": "Google Inc.", "description": "Health check service for use with gRPC", "repository": { @@ -15,7 +15,7 @@ } ], "dependencies": { - "grpc": "^1.4.0-dev", + "grpc": "^1.3.0-pre1", "lodash": "^3.9.3", "google-protobuf": "^3.0.0" }, diff --git a/src/node/tools/package.json b/src/node/tools/package.json index a81aa87f4bb..056f28ab3c1 100644 --- a/src/node/tools/package.json +++ b/src/node/tools/package.json @@ -1,6 +1,6 @@ { "name": "grpc-tools", - "version": "1.4.0-dev", + "version": "1.3.0-pre1", "author": "Google Inc.", "description": "Tools for developing with gRPC on Node.js", "homepage": "http://www.grpc.io/", diff --git a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec index 2f29058b59d..e636d9c902a 100644 --- a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec @@ -42,7 +42,7 @@ Pod::Spec.new do |s| # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed # before them. s.name = '!ProtoCompiler-gRPCPlugin' - v = '1.4.0-dev' + v = '1.3.0-pre1' s.version = v s.summary = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.' s.description = <<-DESC diff --git a/src/objective-c/BoringSSL.podspec b/src/objective-c/BoringSSL.podspec index 651bd4977d8..908bb0b5e5e 100644 --- a/src/objective-c/BoringSSL.podspec +++ b/src/objective-c/BoringSSL.podspec @@ -31,7 +31,7 @@ Pod::Spec.new do |s| s.name = 'BoringSSL' - version = '8.2' + version = '8.0' s.version = version s.summary = 'BoringSSL is a fork of OpenSSL that is designed to meet Google’s needs.' # Adapted from the homepage: @@ -69,9 +69,8 @@ Pod::Spec.new do |s| s.source = { :git => 'https://boringssl.googlesource.com/boringssl', - # Restore this version name hack in the next version!! - # :tag => "version_for_cocoapods_#{version}", - :tag => "version_for_cocoapods_8.0", + :tag => "version_for_cocoapods_#{version}", + # :commit => '4fec04b48406111cb88fdd8d196253adc54f7a31', } name = 'openssl' @@ -96,7 +95,7 @@ Pod::Spec.new do |s| # The module map and umbrella header created automatically by Cocoapods don't work for C libraries # like this one. The following file, and a correct umbrella header, are created on the fly by the # `prepare_command` of this pod. - s.module_map = 'include/openssl/BoringSSL.modulemap' + s.module_map = 'include/openssl/module.modulemap' # We don't need to inhibit all warnings; only -Wno-shorten-64-to-32. But Cocoapods' linter doesn't # want that for some reason. @@ -149,10 +148,10 @@ Pod::Spec.new do |s| #include "ssl.h" #include "crypto.h" #include "aes.h" - /* The following macros are defined by base.h. The latter is the first file included by the - other headers. */ - #if defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) - # include "arm_arch.h" + /* The following macros are defined by base.h. The latter is the first file included by the + other headers. */ + #if defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) + # include "arm_arch.h" #endif #include "asn1.h" #include "asn1_mac.h" @@ -187,7 +186,7 @@ Pod::Spec.new do |s| #include "x509.h" #include "x509v3.h" EOF - cat > include/openssl/BoringSSL.modulemap < include/openssl/module.modulemap <_unmanagedQueue). This is essential diff --git a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m index 1faba3e20b9..46e9fee7e1f 100644 --- a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m +++ b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m @@ -315,7 +315,7 @@ } - (void)dealloc { - grpc_call_unref(_call); + grpc_call_destroy(_call); } @end diff --git a/src/objective-c/GRPCClient/private/version.h b/src/objective-c/GRPCClient/private/version.h index c846f4214c9..b53033d5248 100644 --- a/src/objective-c/GRPCClient/private/version.h +++ b/src/objective-c/GRPCClient/private/version.h @@ -38,4 +38,4 @@ // `tools/buildgen/generate_projects.sh`. -#define GRPC_OBJC_VERSION_STRING @"1.4.0-dev" +#define GRPC_OBJC_VERSION_STRING @"1.3.0-pre1" diff --git a/src/objective-c/RxLibrary/GRXConcurrentWriteable.h b/src/objective-c/RxLibrary/GRXConcurrentWriteable.h index 07004f6d4dc..b2775f98b56 100644 --- a/src/objective-c/RxLibrary/GRXConcurrentWriteable.h +++ b/src/objective-c/RxLibrary/GRXConcurrentWriteable.h @@ -53,9 +53,7 @@ * The GRXWriteable instance is retained until writesFinishedWithError: is sent to it, and released * after that. */ -- (instancetype)initWithWriteable:(id)writeable - dispatchQueue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; -- (instancetype)initWithWriteable:(id)writeable; +- (instancetype)initWithWriteable:(id)writeable NS_DESIGNATED_INITIALIZER; /** * Enqueues writeValue: to be sent to the writeable in the main thread. diff --git a/src/objective-c/RxLibrary/GRXConcurrentWriteable.m b/src/objective-c/RxLibrary/GRXConcurrentWriteable.m index 88aa7a7282f..08bd079aea5 100644 --- a/src/objective-c/RxLibrary/GRXConcurrentWriteable.m +++ b/src/objective-c/RxLibrary/GRXConcurrentWriteable.m @@ -51,20 +51,14 @@ } // Designated initializer -- (instancetype)initWithWriteable:(id)writeable - dispatchQueue:(dispatch_queue_t)queue { +- (instancetype)initWithWriteable:(id)writeable { if (self = [super init]) { - _writeableQueue = queue; + _writeableQueue = dispatch_get_main_queue(); _writeable = writeable; } return self; } -- (instancetype)initWithWriteable:(id)writeable { - return [self initWithWriteable:writeable - dispatchQueue:dispatch_get_main_queue()]; -} - - (void)enqueueValue:(id)value completionHandler:(void (^)())handler { dispatch_async(_writeableQueue, ^{ // We're racing a possible cancellation performed by another thread. To turn all already- diff --git a/src/objective-c/tests/CoreCronetEnd2EndTests/CoreCronetEnd2EndTests.m b/src/objective-c/tests/CoreCronetEnd2EndTests/CoreCronetEnd2EndTests.m index 3dd264718cb..3b442645e83 100644 --- a/src/objective-c/tests/CoreCronetEnd2EndTests/CoreCronetEnd2EndTests.m +++ b/src/objective-c/tests/CoreCronetEnd2EndTests/CoreCronetEnd2EndTests.m @@ -79,8 +79,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( gpr_join_host_port(&ffd->localaddr, "127.0.0.1", port); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create_for_next(NULL); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); + f.cq = grpc_completion_queue_create(NULL); return f; } diff --git a/src/objective-c/tests/CronetUnitTests/CronetUnitTests.m b/src/objective-c/tests/CronetUnitTests/CronetUnitTests.m index a78dd93993f..a76e45416bf 100644 --- a/src/objective-c/tests/CronetUnitTests/CronetUnitTests.m +++ b/src/objective-c/tests/CronetUnitTests/CronetUnitTests.m @@ -160,7 +160,7 @@ unsigned int parse_h2_length(const char *field) { int port = grpc_pick_unused_port_or_die(); char *addr; gpr_join_host_port(&addr, "127.0.0.1", port); - grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL); + grpc_completion_queue *cq = grpc_completion_queue_create(NULL); stream_engine *cronetEngine = [Cronet getGlobalEngine]; grpc_channel *client = grpc_cronet_secure_channel_create(cronetEngine, addr, NULL, NULL); @@ -258,7 +258,7 @@ unsigned int parse_h2_length(const char *field) { grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); + grpc_call_destroy(c); cq_verifier_destroy(cqv); @@ -295,7 +295,7 @@ unsigned int parse_h2_length(const char *field) { int port = grpc_pick_unused_port_or_die(); char *addr; gpr_join_host_port(&addr, "127.0.0.1", port); - grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL); + grpc_completion_queue *cq = grpc_completion_queue_create(NULL); stream_engine *cronetEngine = [Cronet getGlobalEngine]; grpc_channel *client = grpc_cronet_secure_channel_create(cronetEngine, addr, args, NULL); @@ -437,7 +437,7 @@ unsigned int parse_h2_length(const char *field) { grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); + grpc_call_destroy(c); cq_verifier_destroy(cqv); diff --git a/src/objective-c/tests/GRPCClientTests.m b/src/objective-c/tests/GRPCClientTests.m index e36f5c3ee93..76c15003f60 100644 --- a/src/objective-c/tests/GRPCClientTests.m +++ b/src/objective-c/tests/GRPCClientTests.m @@ -353,59 +353,4 @@ static GRPCProtoMethod *kUnaryCallMethod; [self waitForExpectationsWithTimeout:TEST_TIMEOUT handler:nil]; } -- (void)testAlternateDispatchQueue { - const int32_t kPayloadSize = 100; - RMTSimpleRequest *request = [RMTSimpleRequest message]; - request.responseSize = kPayloadSize; - - __weak XCTestExpectation *expectation1 = [self expectationWithDescription:@"AlternateDispatchQueue1"]; - - // Use default (main) dispatch queue - NSString *main_queue_label = [NSString stringWithUTF8String:dispatch_queue_get_label(dispatch_get_main_queue())]; - - GRXWriter *requestsWriter1 = [GRXWriter writerWithValue:[request data]]; - - GRPCCall *call1 = [[GRPCCall alloc] initWithHost:kHostAddress - path:kUnaryCallMethod.HTTPPath - requestsWriter:requestsWriter1]; - - id responsesWriteable1 = [[GRXWriteable alloc] initWithValueHandler:^(NSData *value) { - NSString *label = [NSString stringWithUTF8String:dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL)]; - XCTAssert([label isEqualToString:main_queue_label]); - - [expectation1 fulfill]; - } completionHandler:^(NSError *errorOrNil) { - }]; - - [call1 startWithWriteable:responsesWriteable1]; - - [self waitForExpectationsWithTimeout:TEST_TIMEOUT handler:nil]; - - // Use a custom queue - __weak XCTestExpectation *expectation2 = [self expectationWithDescription:@"AlternateDispatchQueue2"]; - - NSString *queue_label = @"test.queue1"; - dispatch_queue_t queue = dispatch_queue_create([queue_label UTF8String], DISPATCH_QUEUE_SERIAL); - - GRXWriter *requestsWriter2 = [GRXWriter writerWithValue:[request data]]; - - GRPCCall *call2 = [[GRPCCall alloc] initWithHost:kHostAddress - path:kUnaryCallMethod.HTTPPath - requestsWriter:requestsWriter2]; - - [call2 setResponseDispatchQueue:queue]; - - id responsesWriteable2 = [[GRXWriteable alloc] initWithValueHandler:^(NSData *value) { - NSString *label = [NSString stringWithUTF8String:dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL)]; - XCTAssert([label isEqualToString:queue_label]); - - [expectation2 fulfill]; - } completionHandler:^(NSError *errorOrNil) { - }]; - - [call2 startWithWriteable:responsesWriteable2]; - - [self waitForExpectationsWithTimeout:TEST_TIMEOUT handler:nil]; -} - @end diff --git a/src/objective-c/tests/InteropTestsLocalCleartext.m b/src/objective-c/tests/InteropTestsLocalCleartext.m index cdcdd8a88c7..94cdf859653 100644 --- a/src/objective-c/tests/InteropTestsLocalCleartext.m +++ b/src/objective-c/tests/InteropTestsLocalCleartext.m @@ -36,11 +36,7 @@ #import "InteropTests.h" -// The server address is derived from preprocessor macro, which is -// in turn derived from environment variable of the same name. -#define NSStringize_helper(x) #x -#define NSStringize(x) @NSStringize_helper(x) -static NSString * const kLocalCleartextHost = NSStringize(HOST_PORT_LOCAL); +static NSString * const kLocalCleartextHost = @"localhost:5050"; // The Protocol Buffers encoding overhead of local interop server. Acquired // by experiment. Adjust this when server's proto file changes. diff --git a/src/objective-c/tests/InteropTestsLocalSSL.m b/src/objective-c/tests/InteropTestsLocalSSL.m index 45e62d29b9a..3c78b65ede9 100644 --- a/src/objective-c/tests/InteropTestsLocalSSL.m +++ b/src/objective-c/tests/InteropTestsLocalSSL.m @@ -35,11 +35,8 @@ #import #import "InteropTests.h" -// The server address is derived from preprocessor macro, which is -// in turn derived from environment variable of the same name. -#define NSStringize_helper(x) #x -#define NSStringize(x) @NSStringize_helper(x) -static NSString * const kLocalSSLHost = NSStringize(HOST_PORT_LOCALSSL); + +static NSString * const kLocalSSLHost = @"localhost:5051"; // The Protocol Buffers encoding overhead of local interop server. Acquired // by experiment. Adjust this when server's proto file changes. diff --git a/src/objective-c/tests/InteropTestsRemote.m b/src/objective-c/tests/InteropTestsRemote.m index 5260fe4570b..ff1193302b0 100644 --- a/src/objective-c/tests/InteropTestsRemote.m +++ b/src/objective-c/tests/InteropTestsRemote.m @@ -36,11 +36,7 @@ #import "InteropTests.h" -// The server address is derived from preprocessor macro, which is -// in turn derived from environment variable of the same name. -#define NSStringize_helper(x) #x -#define NSStringize(x) @NSStringize_helper(x) -static NSString * const kRemoteSSLHost = NSStringize(HOST_PORT_REMOTE); +static NSString * const kRemoteSSLHost = @"grpc-test.sandbox.googleapis.com"; // The Protocol Buffers encoding overhead of remote interop server. Acquired // by experiment. Adjust this when server's proto file changes. diff --git a/src/objective-c/tests/InteropTestsRemoteWithCronet/InteropTestsRemoteWithCronet.m b/src/objective-c/tests/InteropTestsRemoteWithCronet/InteropTestsRemoteWithCronet.m index a7f190d2b4a..9edfbc2639d 100644 --- a/src/objective-c/tests/InteropTestsRemoteWithCronet/InteropTestsRemoteWithCronet.m +++ b/src/objective-c/tests/InteropTestsRemoteWithCronet/InteropTestsRemoteWithCronet.m @@ -39,12 +39,7 @@ #import "InteropTests.h" -// The server address is derived from preprocessor macro, which is -// in turn derived from environment variable of the same name. -#define NSStringize_helper(x) #x -#define NSStringize(x) @NSStringize_helper(x) -static NSString * const kRemoteSSLHost = NSStringize(HOST_PORT_REMOTE); - +static NSString * const kRemoteSSLHost = @"grpc-test.sandbox.googleapis.com"; // The Protocol Buffers encoding overhead of remote interop server. Acquired // by experiment. Adjust this when server's proto file changes. diff --git a/src/objective-c/tests/Tests.xcodeproj/project.pbxproj b/src/objective-c/tests/Tests.xcodeproj/project.pbxproj index b01d5ffceaa..97de723a22a 100644 --- a/src/objective-c/tests/Tests.xcodeproj/project.pbxproj +++ b/src/objective-c/tests/Tests.xcodeproj/project.pbxproj @@ -1282,9 +1282,6 @@ GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", - "HOST_PORT_LOCALSSL=$(HOST_PORT_LOCALSSL)", - "HOST_PORT_LOCAL=$(HOST_PORT_LOCAL)", - "HOST_PORT_REMOTE=$(HOST_PORT_REMOTE)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_TREAT_WARNINGS_AS_ERRORS = YES; @@ -1568,7 +1565,6 @@ GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", - "HOST_PORT_REMOTE=$(HOST_PORT_REMOTE)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_TREAT_WARNINGS_AS_ERRORS = YES; diff --git a/src/objective-c/tests/run_tests.sh b/src/objective-c/tests/run_tests.sh index 2432209f4f1..0e82bcaa44a 100755 --- a/src/objective-c/tests/run_tests.sh +++ b/src/objective-c/tests/run_tests.sh @@ -59,9 +59,6 @@ xcodebuild \ -workspace Tests.xcworkspace \ -scheme AllTests \ -destination name="iPhone 6" \ - HOST_PORT_LOCALSSL=localhost:5051 \ - HOST_PORT_LOCAL=localhost:5050 \ - HOST_PORT_REMOTE=grpc-test.sandbox.googleapis.com \ test | xcpretty echo "TIME: $(date)" @@ -87,5 +84,4 @@ xcodebuild \ -workspace Tests.xcworkspace \ -scheme InteropTestsRemoteWithCronet \ -destination name="iPhone 6" \ - HOST_PORT_REMOTE=grpc-test.sandbox.googleapis.com \ test | xcpretty diff --git a/src/php/composer.json b/src/php/composer.json index 24c17c3b572..2b140077cc5 100644 --- a/src/php/composer.json +++ b/src/php/composer.json @@ -2,7 +2,7 @@ "name": "grpc/grpc-dev", "description": "gRPC library for PHP - for Developement use only", "license": "BSD-3-Clause", - "version": "1.4.0", + "version": "1.3.0", "require": { "php": ">=5.5.0", "google/protobuf": "^v3.1.0" diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c index d3fd88416b4..48a374fa08e 100644 --- a/src/php/ext/grpc/call.c +++ b/src/php/ext/grpc/call.c @@ -65,7 +65,7 @@ static zend_object_handlers call_ce_handlers; /* Frees and destroys an instance of wrapped_grpc_call */ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_call) if (p->owned && p->wrapped != NULL) { - grpc_call_unref(p->wrapped); + grpc_call_destroy(p->wrapped); } PHP_GRPC_FREE_WRAPPED_FUNC_END() diff --git a/src/php/ext/grpc/completion_queue.c b/src/php/ext/grpc/completion_queue.c index c75a524530e..741204b0b10 100644 --- a/src/php/ext/grpc/completion_queue.c +++ b/src/php/ext/grpc/completion_queue.c @@ -38,10 +38,13 @@ grpc_completion_queue *completion_queue; void grpc_php_init_completion_queue(TSRMLS_D) { - completion_queue = grpc_completion_queue_create_for_pluck(NULL); + completion_queue = grpc_completion_queue_create(NULL); } void grpc_php_shutdown_completion_queue(TSRMLS_D) { grpc_completion_queue_shutdown(completion_queue); + while (grpc_completion_queue_next(completion_queue, + gpr_inf_future(GPR_CLOCK_REALTIME), + NULL).type != GRPC_QUEUE_SHUTDOWN); grpc_completion_queue_destroy(completion_queue); } diff --git a/src/php/lib/Grpc/BaseStub.php b/src/php/lib/Grpc/BaseStub.php index 24934491b43..ed504f85a86 100644 --- a/src/php/lib/Grpc/BaseStub.php +++ b/src/php/lib/Grpc/BaseStub.php @@ -87,7 +87,7 @@ class BaseStub 'ChannelCredentials::create methods'); } if ($channel) { - if (!is_a($channel, 'Grpc\Channel')) { + if (!is_a($channel, 'Channel')) { throw new \Exception('The channel argument is not a'. 'Channel object'); } diff --git a/src/proto/grpc/health/v1/BUILD b/src/proto/grpc/health/v1/BUILD deleted file mode 100644 index dbb91d91392..00000000000 --- a/src/proto/grpc/health/v1/BUILD +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2017, Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -licenses(["notice"]) # 3-clause BSD - -package(default_visibility = ["//visibility:public"]) - -load("//bazel:grpc_build_system.bzl", "grpc_proto_library") - -grpc_proto_library( - name = "health_proto", - srcs = ["health.proto"], -) diff --git a/src/proto/grpc/lb/v1/load_balancer.proto b/src/proto/grpc/lb/v1/load_balancer.proto index a2502fb284a..44a5150a7e0 100644 --- a/src/proto/grpc/lb/v1/load_balancer.proto +++ b/src/proto/grpc/lb/v1/load_balancer.proto @@ -45,20 +45,6 @@ message Duration { int32 nanos = 2; } -message Timestamp { - - // Represents seconds of UTC time since Unix epoch - // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - // 9999-12-31T23:59:59Z inclusive. - int64 seconds = 1; - - // Non-negative fractions of a second at nanosecond resolution. Negative - // second values with fractions must still have non-negative nanos values - // that count forward in time. Must be from 0 to 999,999,999 - // inclusive. - int32 nanos = 2; -} - service LoadBalancer { // Bidirectional rpc to get a list of servers. rpc BalanceLoad(stream LoadBalanceRequest) @@ -77,37 +63,22 @@ message LoadBalanceRequest { } message InitialLoadBalanceRequest { - // Name of load balanced service (IE, balancer.service.com) + // Name of load balanced service (IE, service.grpc.gslb.google.com). Its // length should be less than 256 bytes. string name = 1; } // Contains client level statistics that are useful to load balancing. Each -// count except the timestamp should be reset to zero after reporting the stats. +// count should be reset to zero after reporting the stats. message ClientStats { - // The timestamp of generating the report. - Timestamp timestamp = 1; + // The total number of requests sent by the client since the last report. + int64 total_requests = 1; - // The total number of RPCs that started. - int64 num_calls_started = 2; + // The number of client rpc errors since the last report. + int64 client_rpc_errors = 2; - // The total number of RPCs that finished. - int64 num_calls_finished = 3; - - // The total number of RPCs that were dropped by the client because of rate - // limiting. - int64 num_calls_finished_with_drop_for_rate_limiting = 4; - - // The total number of RPCs that were dropped by the client because of load - // balancing. - int64 num_calls_finished_with_drop_for_load_balancing = 5; - - // The total number of RPCs that failed to reach a server except dropped RPCs. - int64 num_calls_finished_with_client_failed_to_send = 6; - - // The total number of RPCs that finished and are known to have been received - // by a server. - int64 num_calls_finished_known_received = 7; + // The number of dropped requests since the last report. + int64 dropped_requests = 3; } message LoadBalanceResponse { @@ -149,10 +120,6 @@ message ServerList { Duration expiration_interval = 3; } -// Contains server information. When none of the [drop_for_*] fields are true, -// use the other fields. When drop_for_rate_limiting is true, ignore all other -// fields. Use drop_for_load_balancing only when it is true and -// drop_for_rate_limiting is false. message Server { // A resolved address for the server, serialized in network-byte-order. It may // either be an IPv4 or IPv6 address. @@ -170,10 +137,6 @@ message Server { string load_balance_token = 3; // Indicates whether this particular request should be dropped by the client - // for rate limiting. - bool drop_for_rate_limiting = 4; - - // Indicates whether this particular request should be dropped by the client - // for load balancing. - bool drop_for_load_balancing = 5; + // when this server is chosen from the list. + bool drop_request = 4; } diff --git a/src/proto/grpc/status/BUILD b/src/proto/grpc/status/BUILD index 71363bd1b63..c17f87eb3de 100644 --- a/src/proto/grpc/status/BUILD +++ b/src/proto/grpc/status/BUILD @@ -37,5 +37,7 @@ grpc_proto_library( name = "status_proto", srcs = ["status.proto"], has_services = False, - well_known_protos = "@com_google_protobuf//:well_known_protos", + well_known_protos = "@submodule_protobuf//:well_known_protos", ) + + diff --git a/src/proto/grpc/testing/BUILD b/src/proto/grpc/testing/BUILD index 805988c3372..6f3422e4d16 100644 --- a/src/proto/grpc/testing/BUILD +++ b/src/proto/grpc/testing/BUILD @@ -36,7 +36,6 @@ load("//bazel:grpc_build_system.bzl", "grpc_proto_library") grpc_proto_library( name = "compiler_test_proto", srcs = ["compiler_test.proto"], - generate_mock = True, ) grpc_proto_library( @@ -56,7 +55,6 @@ grpc_proto_library( name = "echo_proto", srcs = ["echo.proto"], deps = ["echo_messages_proto"], - generate_mock = True, ) grpc_proto_library( diff --git a/src/proto/grpc/testing/compiler_test.proto b/src/proto/grpc/testing/compiler_test.proto index 24735522e03..085e8ae59f7 100644 --- a/src/proto/grpc/testing/compiler_test.proto +++ b/src/proto/grpc/testing/compiler_test.proto @@ -59,14 +59,6 @@ service ServiceA { // Method A2 leading comment 2 rpc MethodA2(stream Request) returns (Response); // MethodA2 trailing comment 1 - - // Method A3 leading comment 1 - rpc MethodA3(Request) returns (stream Response); - // Method A3 trailing comment 1 - - // Method A4 leading comment 1 - rpc MethodA4(stream Request) returns (stream Response); - // Method A4 trailing comment 1 } // Ignored ServiceA trailing comment 1 diff --git a/src/python/grpcio/.gitignore b/src/python/grpcio/.gitignore index d0ee1e10fdd..3309795948c 100644 --- a/src/python/grpcio/.gitignore +++ b/src/python/grpcio/.gitignore @@ -11,6 +11,7 @@ dist/ .cache/ nosetests.xml doc/ +_grpcio_metadata.py htmlcov/ grpc/_cython/_credentials poison.c diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/call.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/call.pyx.pxi index aa3558b8436..cc3bd7a0672 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/call.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/call.pyx.pxi @@ -106,7 +106,7 @@ cdef class Call: def __dealloc__(self): if self.c_call != NULL: - grpc_call_unref(self.c_call) + grpc_call_destroy(self.c_call) grpc_shutdown() # The object *should* always be valid from Python. Used for debugging. diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi index 34b2623d346..d8df6c2ef40 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi @@ -40,7 +40,7 @@ cdef class CompletionQueue: def __cinit__(self): grpc_init() with nogil: - self.c_completion_queue = grpc_completion_queue_create_for_next(NULL) + self.c_completion_queue = grpc_completion_queue_create(NULL) self.is_shutting_down = False self.is_shutdown = False diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi index f66f6e41223..bbd72424b9b 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi @@ -309,8 +309,7 @@ cdef extern from "grpc/grpc.h": void grpc_init() nogil void grpc_shutdown() nogil - grpc_completion_queue *grpc_completion_queue_create_for_next(void *reserved) nogil - + grpc_completion_queue *grpc_completion_queue_create(void *reserved) nogil grpc_event grpc_completion_queue_next(grpc_completion_queue *cq, gpr_timespec deadline, void *reserved) nogil @@ -329,7 +328,7 @@ cdef extern from "grpc/grpc.h": const char *description, void *reserved) nogil char *grpc_call_get_peer(grpc_call *call) nogil - void grpc_call_unref(grpc_call *call) nogil + void grpc_call_destroy(grpc_call *call) nogil grpc_channel *grpc_insecure_channel_create(const char *target, const grpc_channel_args *args, @@ -356,6 +355,8 @@ cdef extern from "grpc/grpc.h": void grpc_server_register_completion_queue(grpc_server *server, grpc_completion_queue *cq, void *reserved) nogil + void grpc_server_register_non_listening_completion_queue( + grpc_server *server, grpc_completion_queue *cq, void *reserved) nogil int grpc_server_add_insecure_http2_port( grpc_server *server, const char *addr) nogil void grpc_server_start(grpc_server *server) nogil @@ -500,3 +501,4 @@ cdef extern from "grpc/compression.h": int grpc_compression_options_is_algorithm_enabled( const grpc_compression_options *opts, grpc_compression_algorithm algorithm) nogil + diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi index 97192efda74..18db38b6861 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi @@ -82,11 +82,20 @@ cdef class Server: self.c_server, queue.c_completion_queue, NULL) self.registered_completion_queues.append(queue) + def register_non_listening_completion_queue( + self, CompletionQueue queue not None): + if self.is_started: + raise ValueError("cannot register completion queues after start") + with nogil: + grpc_server_register_non_listening_completion_queue( + self.c_server, queue.c_completion_queue, NULL) + self.registered_completion_queues.append(queue) + def start(self): if self.is_started: raise ValueError("the server has already started") self.backup_shutdown_queue = CompletionQueue() - self.register_completion_queue(self.backup_shutdown_queue) + self.register_non_listening_completion_queue(self.backup_shutdown_queue) self.is_started = True with nogil: grpc_server_start(self.c_server) diff --git a/src/python/grpcio/grpc/_grpcio_metadata.py b/src/python/grpcio/grpc/_grpcio_metadata.py deleted file mode 100644 index a0cb0dd067f..00000000000 --- a/src/python/grpcio/grpc/_grpcio_metadata.py +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2017, Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc/_grpcio_metadata.py.template`!!! - -__version__ = """1.4.0.dev0""" diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 16bb32bcc65..7f810bd0b47 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -80,10 +80,15 @@ CORE_SOURCE_FILES = [ 'src/core/lib/channel/channel_args.c', 'src/core/lib/channel/channel_stack.c', 'src/core/lib/channel/channel_stack_builder.c', + 'src/core/lib/channel/compress_filter.c', 'src/core/lib/channel/connected_channel.c', + 'src/core/lib/channel/deadline_filter.c', 'src/core/lib/channel/handshaker.c', 'src/core/lib/channel/handshaker_factory.c', 'src/core/lib/channel/handshaker_registry.c', + 'src/core/lib/channel/http_client_filter.c', + 'src/core/lib/channel/http_server_filter.c', + 'src/core/lib/channel/message_size_filter.c', 'src/core/lib/compression/compression.c', 'src/core/lib/compression/message_compress.c', 'src/core/lib/debug/trace.c', @@ -220,10 +225,6 @@ CORE_SOURCE_FILES = [ 'src/core/ext/transport/chttp2/transport/varint.c', 'src/core/ext/transport/chttp2/transport/writing.c', 'src/core/ext/transport/chttp2/alpn/alpn.c', - 'src/core/ext/filters/http/client/http_client_filter.c', - 'src/core/ext/filters/http/http_filters_plugin.c', - 'src/core/ext/filters/http/message_compress/message_compress_filter.c', - 'src/core/ext/filters/http/server/http_server_filter.c', 'src/core/lib/http/httpcli_security_connector.c', 'src/core/lib/security/context/security_context.c', 'src/core/lib/security/credentials/composite/composite_credentials.c', @@ -273,7 +274,6 @@ CORE_SOURCE_FILES = [ 'src/core/ext/filters/client_channel/subchannel.c', 'src/core/ext/filters/client_channel/subchannel_index.c', 'src/core/ext/filters/client_channel/uri_parser.c', - 'src/core/ext/filters/deadline/deadline_filter.c', 'src/core/ext/transport/chttp2/client/chttp2_connector.c', 'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c', 'src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c', @@ -310,7 +310,6 @@ CORE_SOURCE_FILES = [ 'src/core/ext/census/trace_context.c', 'src/core/ext/census/tracing.c', 'src/core/ext/filters/max_age/max_age_filter.c', - 'src/core/ext/filters/message_size/message_size_filter.c', 'src/core/plugin_registry/grpc_plugin_registry.c', 'src/boringssl/err_data.c', 'third_party/boringssl/crypto/aes/aes.c', diff --git a/src/python/grpcio/grpc_version.py b/src/python/grpcio/grpc_version.py index ea4bc7ba207..a37630a1851 100644 --- a/src/python/grpcio/grpc_version.py +++ b/src/python/grpcio/grpc_version.py @@ -29,4 +29,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!! -VERSION='1.4.0.dev0' +VERSION='1.3.0rc1' diff --git a/src/python/grpcio_health_checking/grpc_version.py b/src/python/grpcio_health_checking/grpc_version.py index 26aa555e14c..c08110ec2cc 100644 --- a/src/python/grpcio_health_checking/grpc_version.py +++ b/src/python/grpcio_health_checking/grpc_version.py @@ -29,4 +29,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_health_checking/grpc_version.py.template`!!! -VERSION='1.4.0.dev0' +VERSION='1.3.0rc1' diff --git a/src/python/grpcio_reflection/grpc_reflection/v1alpha/reflection.py b/src/python/grpcio_reflection/grpc_reflection/v1alpha/reflection.py index cd896f32c3c..c58cb3ecf17 100644 --- a/src/python/grpcio_reflection/grpc_reflection/v1alpha/reflection.py +++ b/src/python/grpcio_reflection/grpc_reflection/v1alpha/reflection.py @@ -56,7 +56,7 @@ def _file_descriptor_response(descriptor): file_descriptor_proto=(serialized_proto,)),) -class ReflectionServicer(reflection_pb2_grpc.ServerReflectionServicer): +class ReflectionServicer(reflection_pb2.ServerReflectionServicer): """Servicer handling RPCs for service statuses.""" def __init__(self, service_names, pool=None): diff --git a/src/python/grpcio_reflection/grpc_version.py b/src/python/grpcio_reflection/grpc_version.py index 978d6b4011f..45657326211 100644 --- a/src/python/grpcio_reflection/grpc_version.py +++ b/src/python/grpcio_reflection/grpc_version.py @@ -29,4 +29,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_reflection/grpc_version.py.template`!!! -VERSION='1.4.0.dev0' +VERSION='1.3.0rc1' diff --git a/src/python/grpcio_tests/grpc_version.py b/src/python/grpcio_tests/grpc_version.py index 5f0b0848846..aadfabfddee 100644 --- a/src/python/grpcio_tests/grpc_version.py +++ b/src/python/grpcio_tests/grpc_version.py @@ -29,4 +29,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_tests/grpc_version.py.template`!!! -VERSION='1.4.0.dev0' +VERSION='1.3.0rc1' diff --git a/src/python/grpcio_tests/tests/http2/negative_http2_client.py b/src/python/grpcio_tests/tests/http2/negative_http2_client.py index 90f54e80bbf..b184e62cfd4 100644 --- a/src/python/grpcio_tests/tests/http2/negative_http2_client.py +++ b/src/python/grpcio_tests/tests/http2/negative_http2_client.py @@ -96,6 +96,8 @@ def _rst_during_data(stub): def _rst_after_data(stub): resp_future = stub.UnaryCall.future(_SIMPLE_REQUEST) + _validate_payload_type_and_length( + next(resp_future), messages_pb2.COMPRESSABLE, _RESPONSE_SIZE) _validate_status_code_and_details(resp_future, grpc.StatusCode.INTERNAL, "Received RST_STREAM with error code 0") diff --git a/src/ruby/ext/grpc/rb_byte_buffer.c b/src/ruby/ext/grpc/rb_byte_buffer.c index f5be19298fd..65fa2f2cf62 100644 --- a/src/ruby/ext/grpc/rb_byte_buffer.c +++ b/src/ruby/ext/grpc/rb_byte_buffer.c @@ -33,15 +33,15 @@ #include -#include "rb_byte_buffer.h" #include "rb_grpc_imports.generated.h" +#include "rb_byte_buffer.h" -#include #include +#include #include #include "rb_grpc.h" -grpc_byte_buffer *grpc_rb_s_to_byte_buffer(char *string, size_t length) { +grpc_byte_buffer* grpc_rb_s_to_byte_buffer(char *string, size_t length) { grpc_slice slice = grpc_slice_from_copied_buffer(string, length); grpc_byte_buffer *buffer = grpc_raw_byte_buffer_create(&slice, 1); grpc_slice_unref(slice); @@ -61,7 +61,7 @@ VALUE grpc_rb_byte_buffer_to_s(grpc_byte_buffer *buffer) { return Qnil; } while (grpc_byte_buffer_reader_next(&reader, &next) != 0) { - rb_str_cat(rb_string, (const char *)GRPC_SLICE_START_PTR(next), + rb_str_cat(rb_string, (const char *) GRPC_SLICE_START_PTR(next), GRPC_SLICE_LENGTH(next)); grpc_slice_unref(next); } @@ -71,9 +71,7 @@ VALUE grpc_rb_byte_buffer_to_s(grpc_byte_buffer *buffer) { VALUE grpc_rb_slice_to_ruby_string(grpc_slice slice) { if (GRPC_SLICE_START_PTR(slice) == NULL) { - rb_raise(rb_eRuntimeError, - "attempt to convert uninitialized grpc_slice to ruby string"); + rb_raise(rb_eRuntimeError, "attempt to convert uninitialized grpc_slice to ruby string"); } - return rb_str_new((char *)GRPC_SLICE_START_PTR(slice), - GRPC_SLICE_LENGTH(slice)); + return rb_str_new((char*)GRPC_SLICE_START_PTR(slice), GRPC_SLICE_LENGTH(slice)); } diff --git a/src/ruby/ext/grpc/rb_call.c b/src/ruby/ext/grpc/rb_call.c index 0067e108666..344cb941ffb 100644 --- a/src/ruby/ext/grpc/rb_call.c +++ b/src/ruby/ext/grpc/rb_call.c @@ -33,12 +33,12 @@ #include -#include "rb_call.h" #include "rb_grpc_imports.generated.h" +#include "rb_call.h" #include -#include #include +#include #include "rb_byte_buffer.h" #include "rb_call_credentials.h" @@ -101,7 +101,7 @@ typedef struct grpc_rb_call { static void destroy_call(grpc_rb_call *call) { /* Ensure that we only try to destroy the call once */ if (call->wrapped != NULL) { - grpc_call_unref(call->wrapped); + grpc_call_destroy(call->wrapped); call->wrapped = NULL; grpc_rb_completion_queue_destroy(call->queue); call->queue = NULL; @@ -113,7 +113,7 @@ static void grpc_rb_call_destroy(void *p) { if (p == NULL) { return; } - destroy_call((grpc_rb_call *)p); + destroy_call((grpc_rb_call*)p); } static size_t md_ary_datasize(const void *p) { @@ -130,9 +130,7 @@ static size_t md_ary_datasize(const void *p) { static const rb_data_type_t grpc_rb_md_ary_data_type = { "grpc_metadata_array", - {GRPC_RB_GC_NOT_MARKED, - GRPC_RB_GC_DONT_FREE, - md_ary_datasize, + {GRPC_RB_GC_NOT_MARKED, GRPC_RB_GC_DONT_FREE, md_ary_datasize, {NULL, NULL}}, NULL, NULL, @@ -142,20 +140,19 @@ static const rb_data_type_t grpc_rb_md_ary_data_type = { * touches a hash object. * TODO(yugui) Directly use st_table and call the free function earlier? */ - 0, + 0, #endif }; /* Describes grpc_call struct for RTypedData */ -static const rb_data_type_t grpc_call_data_type = {"grpc_call", - {GRPC_RB_GC_NOT_MARKED, - grpc_rb_call_destroy, - GRPC_RB_MEMSIZE_UNAVAILABLE, - {NULL, NULL}}, - NULL, - NULL, +static const rb_data_type_t grpc_call_data_type = { + "grpc_call", + {GRPC_RB_GC_NOT_MARKED, grpc_rb_call_destroy, GRPC_RB_MEMSIZE_UNAVAILABLE, + {NULL, NULL}}, + NULL, + NULL, #ifdef RUBY_TYPED_FREE_IMMEDIATELY - RUBY_TYPED_FREE_IMMEDIATELY + RUBY_TYPED_FREE_IMMEDIATELY #endif }; @@ -178,7 +175,7 @@ static VALUE grpc_rb_call_cancel(VALUE self) { grpc_rb_call *call = NULL; grpc_call_error err; if (RTYPEDDATA_DATA(self) == NULL) { - // This call has been closed + //This call has been closed return Qnil; } @@ -199,7 +196,7 @@ static VALUE grpc_rb_call_cancel(VALUE self) { static VALUE grpc_rb_call_close(VALUE self) { grpc_rb_call *call = NULL; TypedData_Get_Struct(self, grpc_rb_call, &grpc_call_data_type, call); - if (call != NULL) { + if(call != NULL) { destroy_call(call); RTYPEDDATA_DATA(self) = NULL; } @@ -241,8 +238,8 @@ static VALUE grpc_rb_call_get_peer_cert(VALUE self) { } { - grpc_auth_property_iterator it = grpc_auth_context_find_properties_by_name( - ctx, GRPC_X509_PEM_CERT_PROPERTY_NAME); + grpc_auth_property_iterator it = + grpc_auth_context_find_properties_by_name(ctx, GRPC_X509_PEM_CERT_PROPERTY_NAME); const grpc_auth_property *prop = grpc_auth_property_iterator_next(&it); if (prop == NULL) { return Qnil; @@ -391,22 +388,21 @@ static int grpc_rb_md_ary_fill_hash_cb(VALUE key, VALUE val, VALUE md_ary_obj) { long i; grpc_slice key_slice; grpc_slice value_slice; - char *tmp_str; + char* tmp_str; if (TYPE(key) == T_SYMBOL) { key_slice = grpc_slice_from_static_string(rb_id2name(SYM2ID(key))); } else if (TYPE(key) == T_STRING) { - key_slice = - grpc_slice_from_copied_buffer(RSTRING_PTR(key), RSTRING_LEN(key)); + key_slice = grpc_slice_from_copied_buffer(RSTRING_PTR(key), RSTRING_LEN(key)); } else { - rb_raise(rb_eTypeError, - "grpc_rb_md_ary_fill_hash_cb: bad type for key parameter"); + rb_raise(rb_eTypeError, "grpc_rb_md_ary_fill_hash_cb: bad type for key parameter"); } if (!grpc_header_key_is_legal(key_slice)) { tmp_str = grpc_slice_to_c_string(key_slice); rb_raise(rb_eArgError, - "'%s' is an invalid header key, must match [a-z0-9-_.]+", tmp_str); + "'%s' is an invalid header key, must match [a-z0-9-_.]+", + tmp_str); return ST_STOP; } @@ -418,14 +414,13 @@ static int grpc_rb_md_ary_fill_hash_cb(VALUE key, VALUE val, VALUE md_ary_obj) { array_length = RARRAY_LEN(val); /* If the value is an array, add capacity for each value in the array */ for (i = 0; i < array_length; i++) { - value_slice = grpc_slice_from_copied_buffer( - RSTRING_PTR(rb_ary_entry(val, i)), RSTRING_LEN(rb_ary_entry(val, i))); + value_slice = grpc_slice_from_copied_buffer(RSTRING_PTR(rb_ary_entry(val, i)), RSTRING_LEN(rb_ary_entry(val, i))); if (!grpc_is_binary_header(key_slice) && !grpc_header_nonbin_value_is_legal(value_slice)) { // The value has invalid characters tmp_str = grpc_slice_to_c_string(value_slice); - rb_raise(rb_eArgError, "Header value '%s' has invalid characters", - tmp_str); + rb_raise(rb_eArgError, + "Header value '%s' has invalid characters", tmp_str); return ST_STOP; } md_ary->metadata[md_ary->count].key = key_slice; @@ -433,21 +428,21 @@ static int grpc_rb_md_ary_fill_hash_cb(VALUE key, VALUE val, VALUE md_ary_obj) { md_ary->count += 1; } } else if (TYPE(val) == T_STRING) { - value_slice = - grpc_slice_from_copied_buffer(RSTRING_PTR(val), RSTRING_LEN(val)); + value_slice = grpc_slice_from_copied_buffer(RSTRING_PTR(val), RSTRING_LEN(val)); if (!grpc_is_binary_header(key_slice) && !grpc_header_nonbin_value_is_legal(value_slice)) { // The value has invalid characters tmp_str = grpc_slice_to_c_string(value_slice); - rb_raise(rb_eArgError, "Header value '%s' has invalid characters", - tmp_str); + rb_raise(rb_eArgError, + "Header value '%s' has invalid characters", tmp_str); return ST_STOP; } md_ary->metadata[md_ary->count].key = key_slice; md_ary->metadata[md_ary->count].value = value_slice; md_ary->count += 1; } else { - rb_raise(rb_eArgError, "Header values must be of type string or array"); + rb_raise(rb_eArgError, + "Header values must be of type string or array"); return ST_STOP; } @@ -479,7 +474,8 @@ static int grpc_rb_md_ary_capacity_hash_cb(VALUE key, VALUE val, /* grpc_rb_md_ary_convert converts a ruby metadata hash into a grpc_metadata_array. */ -void grpc_rb_md_ary_convert(VALUE md_ary_hash, grpc_metadata_array *md_ary) { +void grpc_rb_md_ary_convert(VALUE md_ary_hash, + grpc_metadata_array *md_ary) { VALUE md_ary_obj = Qnil; if (md_ary_hash == Qnil) { return; /* Do nothing if the expected has value is nil */ @@ -515,14 +511,12 @@ VALUE grpc_rb_md_ary_to_h(grpc_metadata_array *md_ary) { rb_hash_aset(result, key, value); } else if (TYPE(value) == T_ARRAY) { /* Add the string to the returned array */ - rb_ary_push(value, - grpc_rb_slice_to_ruby_string(md_ary->metadata[i].value)); + rb_ary_push(value, grpc_rb_slice_to_ruby_string(md_ary->metadata[i].value)); } else { /* Add the current value with this key and the new one to an array */ new_ary = rb_ary_new(); rb_ary_push(new_ary, value); - rb_ary_push(new_ary, - grpc_rb_slice_to_ruby_string(md_ary->metadata[i].value)); + rb_ary_push(new_ary, grpc_rb_slice_to_ruby_string(md_ary->metadata[i].value)); rb_hash_aset(result, key, new_ary); } } @@ -562,9 +556,10 @@ static int grpc_rb_call_check_op_keys_hash_cb(VALUE key, VALUE val, /* grpc_rb_op_update_status_from_server adds the values in a ruby status struct to the 'send_status_from_server' portion of an op. */ -static void grpc_rb_op_update_status_from_server( - grpc_op *op, grpc_metadata_array *md_ary, grpc_slice *send_status_details, - VALUE status) { +static void grpc_rb_op_update_status_from_server(grpc_op *op, + grpc_metadata_array *md_ary, + grpc_slice *send_status_details, + VALUE status) { VALUE code = rb_struct_aref(status, sym_code); VALUE details = rb_struct_aref(status, sym_details); VALUE metadata_hash = rb_struct_aref(status, sym_metadata); @@ -581,8 +576,7 @@ static void grpc_rb_op_update_status_from_server( return; } - *send_status_details = - grpc_slice_from_copied_buffer(RSTRING_PTR(details), RSTRING_LEN(details)); + *send_status_details = grpc_slice_from_copied_buffer(RSTRING_PTR(details), RSTRING_LEN(details)); op->data.send_status_from_server.status = NUM2INT(code); op->data.send_status_from_server.status_details = send_status_details; @@ -693,8 +687,7 @@ static void grpc_run_batch_stack_fill_ops(run_batch_stack *st, VALUE ops_hash) { /* N.B. later there is no need to explicitly delete the metadata keys * and values, they are references to data in ruby objects. */ grpc_rb_op_update_status_from_server( - &st->ops[st->op_num], &st->send_trailing_metadata, - &st->send_status_details, this_value); + &st->ops[st->op_num], &st->send_trailing_metadata, &st->send_status_details, this_value); break; case GRPC_OP_RECV_INITIAL_METADATA: st->ops[st->op_num].data.recv_initial_metadata.recv_initial_metadata = @@ -756,12 +749,12 @@ static VALUE grpc_run_batch_stack_build_result(run_batch_stack *st) { case GRPC_OP_RECV_STATUS_ON_CLIENT: rb_struct_aset( result, sym_status, - rb_struct_new( - grpc_rb_sStatus, UINT2NUM(st->recv_status), - (GRPC_SLICE_START_PTR(st->recv_status_details) == NULL - ? Qnil - : grpc_rb_slice_to_ruby_string(st->recv_status_details)), - grpc_rb_md_ary_to_h(&st->recv_trailing_metadata), NULL)); + rb_struct_new(grpc_rb_sStatus, UINT2NUM(st->recv_status), + (GRPC_SLICE_START_PTR(st->recv_status_details) == NULL + ? Qnil + : grpc_rb_slice_to_ruby_string(st->recv_status_details)), + grpc_rb_md_ary_to_h(&st->recv_trailing_metadata), + NULL)); break; case GRPC_OP_RECV_CLOSE_ON_SERVER: rb_struct_aset(result, sym_send_close, Qtrue); @@ -798,7 +791,7 @@ static VALUE grpc_rb_call_run_batch(VALUE self, VALUE ops_hash) { VALUE result = Qnil; VALUE rb_write_flag = rb_ivar_get(self, id_write_flag); unsigned write_flag = 0; - void *tag = (void *)&st; + void *tag = (void*)&st; if (RTYPEDDATA_DATA(self) == NULL) { rb_raise(grpc_rb_eCallError, "Cannot run batch on closed call"); @@ -926,8 +919,7 @@ static void Init_grpc_op_codes() { } static void Init_grpc_metadata_keys() { - VALUE grpc_rb_mMetadataKeys = - rb_define_module_under(grpc_rb_mGrpcCore, "MetadataKeys"); + VALUE grpc_rb_mMetadataKeys = rb_define_module_under(grpc_rb_mGrpcCore, "MetadataKeys"); rb_define_const(grpc_rb_mMetadataKeys, "COMPRESSION_REQUEST_ALGORITHM", rb_str_new2(GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY)); } diff --git a/src/ruby/ext/grpc/rb_call.h b/src/ruby/ext/grpc/rb_call.h index dc597f7ba73..56becdc5a4e 100644 --- a/src/ruby/ext/grpc/rb_call.h +++ b/src/ruby/ext/grpc/rb_call.h @@ -39,13 +39,13 @@ #include /* Gets the wrapped call from a VALUE. */ -grpc_call *grpc_rb_get_wrapped_call(VALUE v); +grpc_call* grpc_rb_get_wrapped_call(VALUE v); /* Gets the VALUE corresponding to given grpc_call. */ VALUE grpc_rb_wrap_call(grpc_call *c, grpc_completion_queue *q); /* Provides the details of an call error */ -const char *grpc_call_error_detail_of(grpc_call_error err); +const char* grpc_call_error_detail_of(grpc_call_error err); /* Converts a metadata array to a hash. */ VALUE grpc_rb_md_ary_to_h(grpc_metadata_array *md_ary); @@ -53,7 +53,8 @@ VALUE grpc_rb_md_ary_to_h(grpc_metadata_array *md_ary); /* grpc_rb_md_ary_convert converts a ruby metadata hash into a grpc_metadata_array. */ -void grpc_rb_md_ary_convert(VALUE md_ary_hash, grpc_metadata_array *md_ary); +void grpc_rb_md_ary_convert(VALUE md_ary_hash, + grpc_metadata_array *md_ary); /* grpc_rb_eCallError is the ruby class of the exception thrown during call operations. */ diff --git a/src/ruby/ext/grpc/rb_call_credentials.c b/src/ruby/ext/grpc/rb_call_credentials.c index 7a5a74580d1..fac2cbb04d1 100644 --- a/src/ruby/ext/grpc/rb_call_credentials.c +++ b/src/ruby/ext/grpc/rb_call_credentials.c @@ -33,8 +33,8 @@ #include -#include "rb_call_credentials.h" #include "rb_grpc_imports.generated.h" +#include "rb_call_credentials.h" #include @@ -82,18 +82,20 @@ static VALUE grpc_rb_call_credentials_callback(VALUE callback_args) { static VALUE grpc_rb_call_credentials_callback_rescue(VALUE args, VALUE exception_object) { VALUE result = rb_hash_new(); - VALUE backtrace = - rb_funcall(rb_funcall(exception_object, rb_intern("backtrace"), 0), - rb_intern("join"), 1, rb_str_new2("\n\tfrom ")); - VALUE rb_exception_info = - rb_funcall(exception_object, rb_intern("inspect"), 0); + VALUE backtrace = rb_funcall( + rb_funcall(exception_object, rb_intern("backtrace"), 0), + rb_intern("join"), + 1, rb_str_new2("\n\tfrom ")); + VALUE rb_exception_info = rb_funcall(exception_object, rb_intern("inspect"), 0); (void)args; gpr_log(GPR_INFO, "Call credentials callback failed: %s\n%s", - StringValueCStr(rb_exception_info), StringValueCStr(backtrace)); + StringValueCStr(rb_exception_info), + StringValueCStr(backtrace)); rb_hash_aset(result, rb_str_new2("metadata"), Qnil); rb_hash_aset(result, rb_str_new2("status"), INT2NUM(GRPC_STATUS_UNAUTHENTICATED)); - rb_hash_aset(result, rb_str_new2("details"), rb_exception_info); + rb_hash_aset(result, rb_str_new2("details"), + rb_exception_info); return result; } @@ -116,8 +118,7 @@ static void grpc_rb_call_credentials_callback_with_gil(void *param) { result = rb_rescue(grpc_rb_call_credentials_callback, callback_args, grpc_rb_call_credentials_callback_rescue, Qnil); // Both callbacks return a hash, so result should be a hash - grpc_rb_md_ary_convert(rb_hash_aref(result, rb_str_new2("metadata")), - &md_ary); + grpc_rb_md_ary_convert(rb_hash_aref(result, rb_str_new2("metadata")), &md_ary); status = NUM2INT(rb_hash_aref(result, rb_str_new2("status"))); details = rb_hash_aref(result, rb_str_new2("details")); error_details = StringValueCStr(details); @@ -137,7 +138,7 @@ static void grpc_rb_call_credentials_plugin_get_metadata( params->callback = cb; grpc_rb_event_queue_enqueue(grpc_rb_call_credentials_callback_with_gil, - (void *)(params)); + (void*)(params)); } static void grpc_rb_call_credentials_plugin_destroy(void *state) { @@ -171,15 +172,13 @@ static void grpc_rb_call_credentials_mark(void *p) { } static rb_data_type_t grpc_rb_call_credentials_data_type = { - "grpc_call_credentials", - {grpc_rb_call_credentials_mark, - grpc_rb_call_credentials_free, - GRPC_RB_MEMSIZE_UNAVAILABLE, - {NULL, NULL}}, - NULL, - NULL, + "grpc_call_credentials", + {grpc_rb_call_credentials_mark, grpc_rb_call_credentials_free, + GRPC_RB_MEMSIZE_UNAVAILABLE, {NULL, NULL}}, + NULL, + NULL, #ifdef RUBY_TYPED_FREE_IMMEDIATELY - RUBY_TYPED_FREE_IMMEDIATELY + RUBY_TYPED_FREE_IMMEDIATELY #endif }; @@ -189,8 +188,7 @@ static VALUE grpc_rb_call_credentials_alloc(VALUE cls) { grpc_rb_call_credentials *wrapper = ALLOC(grpc_rb_call_credentials); wrapper->wrapped = NULL; wrapper->mark = Qnil; - return TypedData_Wrap_Struct(cls, &grpc_rb_call_credentials_data_type, - wrapper); + return TypedData_Wrap_Struct(cls, &grpc_rb_call_credentials_data_type, wrapper); } /* Creates a wrapping object for a given call credentials. This should only be @@ -234,7 +232,7 @@ static VALUE grpc_rb_call_credentials_init(VALUE self, VALUE proc) { rb_raise(rb_eTypeError, "Argument to CallCredentials#new must be a proc"); return Qnil; } - plugin.state = (void *)proc; + plugin.state = (void*)proc; plugin.type = ""; creds = grpc_metadata_credentials_create_from_plugin(plugin, NULL); @@ -291,6 +289,7 @@ void Init_grpc_call_credentials() { grpc_call_credentials *grpc_rb_get_wrapped_call_credentials(VALUE v) { grpc_rb_call_credentials *wrapper = NULL; TypedData_Get_Struct(v, grpc_rb_call_credentials, - &grpc_rb_call_credentials_data_type, wrapper); + &grpc_rb_call_credentials_data_type, + wrapper); return wrapper->wrapped; } diff --git a/src/ruby/ext/grpc/rb_channel.c b/src/ruby/ext/grpc/rb_channel.c index a8021837264..fb610f548eb 100644 --- a/src/ruby/ext/grpc/rb_channel.c +++ b/src/ruby/ext/grpc/rb_channel.c @@ -34,9 +34,9 @@ #include #include +#include "rb_grpc_imports.generated.h" #include "rb_byte_buffer.h" #include "rb_channel.h" -#include "rb_grpc_imports.generated.h" #include #include @@ -89,8 +89,8 @@ typedef struct grpc_rb_channel { static void grpc_rb_channel_try_register_connection_polling( grpc_rb_channel *wrapper); static void grpc_rb_channel_safe_destroy(grpc_rb_channel *wrapper); -static void *wait_until_channel_polling_thread_started_no_gil(void *); -static void wait_until_channel_polling_thread_started_unblocking_func(void *); +static void *wait_until_channel_polling_thread_started_no_gil(void*); +static void wait_until_channel_polling_thread_started_unblocking_func(void*); static grpc_completion_queue *channel_polling_cq; static gpr_mu global_connection_polling_mu; @@ -171,9 +171,8 @@ static VALUE grpc_rb_channel_init(int argc, VALUE *argv, VALUE self) { MEMZERO(&args, grpc_channel_args, 1); grpc_ruby_once_init(); - rb_thread_call_without_gvl( - wait_until_channel_polling_thread_started_no_gil, NULL, - wait_until_channel_polling_thread_started_unblocking_func, NULL); + rb_thread_call_without_gvl(wait_until_channel_polling_thread_started_no_gil, NULL, + wait_until_channel_polling_thread_started_unblocking_func, NULL); /* "3" == 3 mandatory args */ rb_scan_args(argc, argv, "3", &target, &channel_args, &credentials); @@ -205,14 +204,14 @@ static VALUE grpc_rb_channel_init(int argc, VALUE *argv, VALUE self) { gpr_mu_lock(&wrapper->channel_mu); wrapper->abort_watch_connectivity_state = 0; - wrapper->current_connectivity_state = - grpc_channel_check_connectivity_state(wrapper->wrapped, 0); + wrapper->current_connectivity_state = grpc_channel_check_connectivity_state(wrapper->wrapped, 0); wrapper->safe_to_destroy = 0; wrapper->request_safe_destroy = 0; gpr_cv_broadcast(&wrapper->channel_cv); gpr_mu_unlock(&wrapper->channel_mu); + grpc_rb_channel_try_register_connection_polling(wrapper); if (args.args != NULL) { @@ -254,8 +253,7 @@ static VALUE grpc_rb_channel_get_connectivity_state(int argc, VALUE *argv, rb_raise(rb_eRuntimeError, "closed!"); return Qnil; } - return LONG2NUM(grpc_channel_check_connectivity_state(wrapper->wrapped, - grpc_try_to_connect)); + return LONG2NUM(grpc_channel_check_connectivity_state(wrapper->wrapped, grpc_try_to_connect)); } typedef struct watch_state_stack { @@ -265,21 +263,22 @@ typedef struct watch_state_stack { } watch_state_stack; static void *watch_channel_state_without_gvl(void *arg) { - watch_state_stack *stack = (watch_state_stack *)arg; + watch_state_stack *stack = (watch_state_stack*)arg; gpr_timespec deadline = stack->deadline; grpc_rb_channel *wrapper = stack->wrapper; int last_state = stack->last_state; - void *return_value = (void *)0; + void *return_value = (void*)0; gpr_mu_lock(&wrapper->channel_mu); - while (wrapper->current_connectivity_state == last_state && - !wrapper->request_safe_destroy && !wrapper->safe_to_destroy && - !wrapper->abort_watch_connectivity_state && - gpr_time_cmp(deadline, gpr_now(GPR_CLOCK_REALTIME)) > 0) { + while(wrapper->current_connectivity_state == last_state && + !wrapper->request_safe_destroy && + !wrapper->safe_to_destroy && + !wrapper->abort_watch_connectivity_state && + gpr_time_cmp(deadline, gpr_now(GPR_CLOCK_REALTIME)) > 0) { gpr_cv_wait(&wrapper->channel_cv, &wrapper->channel_mu, deadline); } if (wrapper->current_connectivity_state != last_state) { - return_value = (void *)1; + return_value = (void*)1; } gpr_mu_unlock(&wrapper->channel_mu); @@ -287,7 +286,7 @@ static void *watch_channel_state_without_gvl(void *arg) { } static void watch_channel_state_unblocking_func(void *arg) { - grpc_rb_channel *wrapper = (grpc_rb_channel *)arg; + grpc_rb_channel *wrapper = (grpc_rb_channel*)arg; gpr_log(GPR_DEBUG, "GRPC_RUBY: watch channel state unblocking func called"); gpr_mu_lock(&wrapper->channel_mu); wrapper->abort_watch_connectivity_state = 1; @@ -307,7 +306,7 @@ static VALUE grpc_rb_channel_watch_connectivity_state(VALUE self, VALUE deadline) { grpc_rb_channel *wrapper = NULL; watch_state_stack stack; - void *out; + void* out; TypedData_Get_Struct(self, grpc_rb_channel, &grpc_channel_data_type, wrapper); @@ -317,18 +316,14 @@ static VALUE grpc_rb_channel_watch_connectivity_state(VALUE self, } if (!FIXNUM_P(last_state)) { - rb_raise( - rb_eTypeError, - "bad type for last_state. want a GRPC::Core::ChannelState constant"); + rb_raise(rb_eTypeError, "bad type for last_state. want a GRPC::Core::ChannelState constant"); return Qnil; } stack.wrapper = wrapper; stack.deadline = grpc_rb_time_timeval(deadline, 0); stack.last_state = NUM2LONG(last_state); - out = - rb_thread_call_without_gvl(watch_channel_state_without_gvl, &stack, - watch_channel_state_unblocking_func, wrapper); + out = rb_thread_call_without_gvl(watch_channel_state_without_gvl, &stack, watch_channel_state_unblocking_func, wrapper); if (out) { return Qtrue; } @@ -364,7 +359,7 @@ static VALUE grpc_rb_channel_create_call(VALUE self, VALUE parent, VALUE mask, parent_call = grpc_rb_get_wrapped_call(parent); } - cq = grpc_completion_queue_create_for_pluck(NULL); + cq = grpc_completion_queue_create(NULL); TypedData_Get_Struct(self, grpc_rb_channel, &grpc_channel_data_type, wrapper); ch = wrapper->wrapped; if (ch == NULL) { @@ -433,7 +428,7 @@ static VALUE grpc_rb_channel_get_target(VALUE self) { // destroy. // Not safe to call while a channel's connection state is polled. static void grpc_rb_channel_try_register_connection_polling( - grpc_rb_channel *wrapper) { + grpc_rb_channel *wrapper) { grpc_connectivity_state conn_state; gpr_timespec sleep_time = gpr_time_add( gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_millis(20, GPR_TIMESPAN)); @@ -506,14 +501,11 @@ static void *run_poll_channels_loop_no_gil(void *arg) { break; } if (event.type == GRPC_OP_COMPLETE) { - grpc_rb_channel_try_register_connection_polling( - (grpc_rb_channel *)event.tag); + grpc_rb_channel_try_register_connection_polling((grpc_rb_channel *)event.tag); } } grpc_completion_queue_destroy(channel_polling_cq); - gpr_log(GPR_DEBUG, - "GRPC_RUBY: run_poll_channels_loop_no_gil - exit connection polling " - "loop"); + gpr_log(GPR_DEBUG, "GRPC_RUBY: run_poll_channels_loop_no_gil - exit connection polling loop"); return NULL; } @@ -521,9 +513,7 @@ static void *run_poll_channels_loop_no_gil(void *arg) { static void run_poll_channels_loop_unblocking_func(void *arg) { (void)arg; gpr_mu_lock(&global_connection_polling_mu); - gpr_log(GPR_DEBUG, - "GRPC_RUBY: grpc_rb_event_unblocking_func - begin aborting " - "connection polling"); + gpr_log(GPR_DEBUG, "GRPC_RUBY: run_poll_channels_loop_unblocking_func - begin aborting connection polling"); abort_channel_polling = 1; grpc_completion_queue_shutdown(channel_polling_cq); gpr_mu_unlock(&global_connection_polling_mu); @@ -532,9 +522,7 @@ static void run_poll_channels_loop_unblocking_func(void *arg) { // Poll channel connectivity states in background thread without the GIL. static VALUE run_poll_channels_loop(VALUE arg) { (void)arg; - gpr_log( - GPR_DEBUG, - "GRPC_RUBY: run_poll_channels_loop - create connection polling thread"); + gpr_log(GPR_DEBUG, "GRPC_RUBY: run_poll_channels_loop - create connection polling thread"); rb_thread_call_without_gvl(run_poll_channels_loop_no_gil, NULL, run_poll_channels_loop_unblocking_func, NULL); @@ -554,14 +542,10 @@ static void *wait_until_channel_polling_thread_started_no_gil(void *arg) { return NULL; } -static void wait_until_channel_polling_thread_started_unblocking_func( - void *arg) { +static void wait_until_channel_polling_thread_started_unblocking_func(void* arg) { (void)arg; gpr_mu_lock(&global_connection_polling_mu); - gpr_log(GPR_DEBUG, - "GRPC_RUBY: " - "wait_until_channel_polling_thread_started_unblocking_func - begin " - "aborting connection polling"); + gpr_log(GPR_DEBUG, "GRPC_RUBY: wait_until_channel_polling_thread_started_unblocking_func - begin aborting connection polling"); abort_channel_polling = 1; gpr_cv_broadcast(&global_connection_polling_cv); gpr_mu_unlock(&global_connection_polling_mu); @@ -587,7 +571,7 @@ void grpc_rb_channel_polling_thread_start() { gpr_mu_init(&global_connection_polling_mu); gpr_cv_init(&global_connection_polling_cv); - channel_polling_cq = grpc_completion_queue_create_for_next(NULL); + channel_polling_cq = grpc_completion_queue_create(NULL); background_thread = rb_thread_create(run_poll_channels_loop, NULL); if (!RTEST(background_thread)) { diff --git a/src/ruby/ext/grpc/rb_channel_args.c b/src/ruby/ext/grpc/rb_channel_args.c index fa9ddee3728..87c0e0a7055 100644 --- a/src/ruby/ext/grpc/rb_channel_args.c +++ b/src/ruby/ext/grpc/rb_channel_args.c @@ -33,8 +33,8 @@ #include -#include "rb_channel_args.h" #include "rb_grpc_imports.generated.h" +#include "rb_channel_args.h" #include @@ -42,12 +42,9 @@ static rb_data_type_t grpc_rb_channel_args_data_type = { "grpc_channel_args", - {GRPC_RB_GC_NOT_MARKED, - GRPC_RB_GC_DONT_FREE, - GRPC_RB_MEMSIZE_UNAVAILABLE, + {GRPC_RB_GC_NOT_MARKED, GRPC_RB_GC_DONT_FREE, GRPC_RB_MEMSIZE_UNAVAILABLE, {NULL, NULL}}, - NULL, - NULL, + NULL, NULL, #ifdef RUBY_TYPED_FREE_IMMEDIATELY RUBY_TYPED_FREE_IMMEDIATELY #endif @@ -140,10 +137,11 @@ static VALUE grpc_rb_hash_convert_to_channel_args0(VALUE as_value) { params->dst->num_args = num_args; params->dst->args = ALLOC_N(grpc_arg, num_args); MEMZERO(params->dst->args, grpc_arg, num_args); - rb_hash_foreach( - params->src_hash, grpc_rb_channel_create_in_process_add_args_hash_cb, - TypedData_Wrap_Struct(grpc_rb_cChannelArgs, - &grpc_rb_channel_args_data_type, params->dst)); + rb_hash_foreach(params->src_hash, + grpc_rb_channel_create_in_process_add_args_hash_cb, + TypedData_Wrap_Struct(grpc_rb_cChannelArgs, + &grpc_rb_channel_args_data_type, + params->dst)); /* reset num_args as grpc_rb_channel_create_in_process_add_args_hash_cb * decrements it during has processing */ params->dst->num_args = num_args; @@ -159,7 +157,7 @@ void grpc_rb_hash_convert_to_channel_args(VALUE src_hash, /* Make a protected call to grpc_rb_hash_convert_channel_args */ params.src_hash = src_hash; params.dst = dst; - rb_protect(grpc_rb_hash_convert_to_channel_args0, (VALUE)¶ms, &status); + rb_protect(grpc_rb_hash_convert_to_channel_args0, (VALUE) & params, &status); if (status != 0) { if (dst->args != NULL) { /* Free any allocated memory before propagating the error */ diff --git a/src/ruby/ext/grpc/rb_channel_credentials.c b/src/ruby/ext/grpc/rb_channel_credentials.c index db713ed8216..d334c091486 100644 --- a/src/ruby/ext/grpc/rb_channel_credentials.c +++ b/src/ruby/ext/grpc/rb_channel_credentials.c @@ -35,8 +35,8 @@ #include -#include "rb_channel_credentials.h" #include "rb_grpc_imports.generated.h" +#include "rb_channel_credentials.h" #include #include @@ -91,10 +91,8 @@ static void grpc_rb_channel_credentials_mark(void *p) { static rb_data_type_t grpc_rb_channel_credentials_data_type = { "grpc_channel_credentials", - {grpc_rb_channel_credentials_mark, - grpc_rb_channel_credentials_free, - GRPC_RB_MEMSIZE_UNAVAILABLE, - {NULL, NULL}}, + {grpc_rb_channel_credentials_mark, grpc_rb_channel_credentials_free, + GRPC_RB_MEMSIZE_UNAVAILABLE, {NULL, NULL}}, NULL, NULL, #ifdef RUBY_TYPED_FREE_IMMEDIATELY @@ -108,15 +106,13 @@ static VALUE grpc_rb_channel_credentials_alloc(VALUE cls) { grpc_rb_channel_credentials *wrapper = ALLOC(grpc_rb_channel_credentials); wrapper->wrapped = NULL; wrapper->mark = Qnil; - return TypedData_Wrap_Struct(cls, &grpc_rb_channel_credentials_data_type, - wrapper); + return TypedData_Wrap_Struct(cls, &grpc_rb_channel_credentials_data_type, wrapper); } /* Creates a wrapping object for a given channel credentials. This should only * be called with grpc_channel_credentials objects that are not already * associated with any Ruby object. */ -VALUE grpc_rb_wrap_channel_credentials(grpc_channel_credentials *c, - VALUE mark) { +VALUE grpc_rb_wrap_channel_credentials(grpc_channel_credentials *c, VALUE mark) { VALUE rb_wrapper; grpc_rb_channel_credentials *wrapper; if (c == NULL) { @@ -151,8 +147,7 @@ static ID id_pem_cert_chain; pem_private_key: (optional) PEM encoding of the client's private key pem_cert_chain: (optional) PEM encoding of the client's cert chain Initializes Credential instances. */ -static VALUE grpc_rb_channel_credentials_init(int argc, VALUE *argv, - VALUE self) { +static VALUE grpc_rb_channel_credentials_init(int argc, VALUE *argv, VALUE self) { VALUE pem_root_certs = Qnil; VALUE pem_private_key = Qnil; VALUE pem_cert_chain = Qnil; @@ -178,8 +173,8 @@ static VALUE grpc_rb_channel_credentials_init(int argc, VALUE *argv, } else { key_cert_pair.private_key = RSTRING_PTR(pem_private_key); key_cert_pair.cert_chain = RSTRING_PTR(pem_cert_chain); - creds = - grpc_ssl_credentials_create(pem_root_certs_cstr, &key_cert_pair, NULL); + creds = grpc_ssl_credentials_create(pem_root_certs_cstr, + &key_cert_pair, NULL); } if (creds == NULL) { rb_raise(rb_eRuntimeError, "could not create a credentials, not sure why"); @@ -238,8 +233,8 @@ static VALUE grpc_rb_set_default_roots_pem(VALUE self, VALUE roots) { } void Init_grpc_channel_credentials() { - grpc_rb_cChannelCredentials = rb_define_class_under( - grpc_rb_mGrpcCore, "ChannelCredentials", rb_cObject); + grpc_rb_cChannelCredentials = + rb_define_class_under(grpc_rb_mGrpcCore, "ChannelCredentials", rb_cObject); /* Allocates an object managed by the ruby runtime */ rb_define_alloc_func(grpc_rb_cChannelCredentials, @@ -267,6 +262,7 @@ void Init_grpc_channel_credentials() { grpc_channel_credentials *grpc_rb_get_wrapped_channel_credentials(VALUE v) { grpc_rb_channel_credentials *wrapper = NULL; TypedData_Get_Struct(v, grpc_rb_channel_credentials, - &grpc_rb_channel_credentials_data_type, wrapper); + &grpc_rb_channel_credentials_data_type, + wrapper); return wrapper->wrapped; } diff --git a/src/ruby/ext/grpc/rb_completion_queue.c b/src/ruby/ext/grpc/rb_completion_queue.c index c9d67739a5f..fd75d2f691f 100644 --- a/src/ruby/ext/grpc/rb_completion_queue.c +++ b/src/ruby/ext/grpc/rb_completion_queue.c @@ -33,14 +33,14 @@ #include -#include "rb_completion_queue.h" #include "rb_grpc_imports.generated.h" +#include "rb_completion_queue.h" #include #include -#include #include +#include #include "rb_grpc.h" /* Used to allow grpc_completion_queue_next call to release the GIL */ @@ -54,13 +54,14 @@ typedef struct next_call_stack { /* Calls grpc_completion_queue_pluck without holding the ruby GIL */ static void *grpc_rb_completion_queue_pluck_no_gil(void *param) { - next_call_stack *const next_call = (next_call_stack *)param; + next_call_stack *const next_call = (next_call_stack*)param; gpr_timespec increment = gpr_time_from_millis(20, GPR_TIMESPAN); gpr_timespec deadline; do { deadline = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), increment); - next_call->event = grpc_completion_queue_pluck( - next_call->cq, next_call->tag, deadline, NULL); + next_call->event = grpc_completion_queue_pluck(next_call->cq, + next_call->tag, + deadline, NULL); if (next_call->event.type != GRPC_QUEUE_TIMEOUT || gpr_time_cmp(deadline, next_call->timeout) > 0) { break; @@ -80,7 +81,7 @@ void grpc_rb_completion_queue_destroy(grpc_completion_queue *cq) { } static void unblock_func(void *param) { - next_call_stack *const next_call = (next_call_stack *)param; + next_call_stack *const next_call = (next_call_stack*)param; next_call->interrupted = 1; } @@ -110,6 +111,7 @@ grpc_event rb_completion_queue_pluck(grpc_completion_queue *queue, void *tag, (void *)&next_call); /* If an interrupt prevented pluck from returning useful information, then any plucks that did complete must have timed out */ - } while (next_call.interrupted && next_call.event.type == GRPC_QUEUE_TIMEOUT); + } while (next_call.interrupted && + next_call.event.type == GRPC_QUEUE_TIMEOUT); return next_call.event; } diff --git a/src/ruby/ext/grpc/rb_compression_options.c b/src/ruby/ext/grpc/rb_compression_options.c index 45c963dca6e..b23e82b0dba 100644 --- a/src/ruby/ext/grpc/rb_compression_options.c +++ b/src/ruby/ext/grpc/rb_compression_options.c @@ -33,15 +33,15 @@ #include -#include "rb_byte_buffer.h" #include "rb_compression_options.h" +#include "rb_byte_buffer.h" #include "rb_grpc_imports.generated.h" #include #include +#include #include #include -#include #include #include "rb_grpc.h" @@ -182,16 +182,15 @@ void grpc_rb_compression_options_algorithm_name_to_value_internal( * correct C string out of it. */ algorithm_name_as_string = rb_funcall(algorithm_name, rb_intern("to_s"), 0); - name_slice = - grpc_slice_from_copied_buffer(RSTRING_PTR(algorithm_name_as_string), - RSTRING_LEN(algorithm_name_as_string)); + name_slice = grpc_slice_from_copied_buffer(RSTRING_PTR(algorithm_name_as_string), RSTRING_LEN(algorithm_name_as_string)); /* Raise an error if the name isn't recognized as a compression algorithm by * the algorithm parse function * in GRPC core. */ - if (!grpc_compression_algorithm_parse(name_slice, algorithm_value)) { + if(!grpc_compression_algorithm_parse(name_slice, algorithm_value)) { tmp_str = grpc_slice_to_c_string(name_slice); - rb_raise(rb_eNameError, "Invalid compression algorithm name: %s", tmp_str); + rb_raise(rb_eNameError, "Invalid compression algorithm name: %s", + tmp_str); } grpc_slice_unref(name_slice); diff --git a/src/ruby/ext/grpc/rb_event_thread.c b/src/ruby/ext/grpc/rb_event_thread.c index 9a3b56ddfb7..9e85bbcfbf2 100644 --- a/src/ruby/ext/grpc/rb_event_thread.c +++ b/src/ruby/ext/grpc/rb_event_thread.c @@ -33,20 +33,20 @@ #include -#include "rb_event_thread.h" #include "rb_grpc_imports.generated.h" +#include "rb_event_thread.h" #include +#include #include -#include #include #include -#include +#include typedef struct grpc_rb_event { // callback will be called with argument while holding the GVL - void (*callback)(void *); + void (*callback)(void*); void *argument; struct grpc_rb_event *next; @@ -65,7 +65,8 @@ typedef struct grpc_rb_event_queue { static grpc_rb_event_queue event_queue; -void grpc_rb_event_queue_enqueue(void (*callback)(void *), void *argument) { +void grpc_rb_event_queue_enqueue(void (*callback)(void*), + void *argument) { grpc_rb_event *event = gpr_malloc(sizeof(grpc_rb_event)); event->callback = callback; event->argument = argument; @@ -106,7 +107,8 @@ static void *grpc_rb_wait_for_event_no_gil(void *param) { (void)param; gpr_mu_lock(&event_queue.mu); while ((event = grpc_rb_event_queue_dequeue()) == NULL) { - gpr_cv_wait(&event_queue.cv, &event_queue.mu, + gpr_cv_wait(&event_queue.cv, + &event_queue.mu, gpr_inf_future(GPR_CLOCK_REALTIME)); if (event_queue.abort) { gpr_mu_unlock(&event_queue.mu); @@ -130,10 +132,10 @@ static void grpc_rb_event_unblocking_func(void *arg) { static VALUE grpc_rb_event_thread(VALUE arg) { grpc_rb_event *event; (void)arg; - while (true) { - event = (grpc_rb_event *)rb_thread_call_without_gvl( - grpc_rb_wait_for_event_no_gil, NULL, grpc_rb_event_unblocking_func, - NULL); + while(true) { + event = (grpc_rb_event*)rb_thread_call_without_gvl( + grpc_rb_wait_for_event_no_gil, NULL, + grpc_rb_event_unblocking_func, NULL); if (event == NULL) { // Indicates that the thread needs to shut down break; diff --git a/src/ruby/ext/grpc/rb_event_thread.h b/src/ruby/ext/grpc/rb_event_thread.h index d7eff760a17..46638bfcf53 100644 --- a/src/ruby/ext/grpc/rb_event_thread.h +++ b/src/ruby/ext/grpc/rb_event_thread.h @@ -33,4 +33,5 @@ void grpc_rb_event_queue_thread_start(); -void grpc_rb_event_queue_enqueue(void (*callback)(void *), void *argument); +void grpc_rb_event_queue_enqueue(void (*callback)(void*), + void *argument); diff --git a/src/ruby/ext/grpc/rb_grpc.c b/src/ruby/ext/grpc/rb_grpc.c index 5be8861e0c4..584b5dbc63d 100644 --- a/src/ruby/ext/grpc/rb_grpc.c +++ b/src/ruby/ext/grpc/rb_grpc.c @@ -33,8 +33,8 @@ #include -#include "rb_grpc.h" #include "rb_grpc_imports.generated.h" +#include "rb_grpc.h" #include #include @@ -46,19 +46,18 @@ #include "rb_call_credentials.h" #include "rb_channel.h" #include "rb_channel_credentials.h" -#include "rb_compression_options.h" -#include "rb_event_thread.h" #include "rb_loader.h" #include "rb_server.h" #include "rb_server_credentials.h" +#include "rb_compression_options.h" +#include "rb_event_thread.h" +#include "rb_channel.h" static VALUE grpc_rb_cTimeVal = Qnil; static rb_data_type_t grpc_rb_timespec_data_type = { "gpr_timespec", - {GRPC_RB_GC_NOT_MARKED, - GRPC_RB_GC_DONT_FREE, - GRPC_RB_MEMSIZE_UNAVAILABLE, + {GRPC_RB_GC_NOT_MARKED, GRPC_RB_GC_DONT_FREE, GRPC_RB_MEMSIZE_UNAVAILABLE, {NULL, NULL}}, NULL, NULL, @@ -87,7 +86,8 @@ VALUE grpc_rb_cannot_init(VALUE self) { /* Init/Clone func that fails by raising an exception. */ VALUE grpc_rb_cannot_init_copy(VALUE copy, VALUE self) { (void)self; - rb_raise(rb_eTypeError, "Copy initialization of %s is not supported", + rb_raise(rb_eTypeError, + "Copy initialization of %s is not supported", rb_obj_classname(copy)); return Qnil; } @@ -145,7 +145,8 @@ gpr_timespec grpc_rb_time_timeval(VALUE time, int interval) { } t.tv_sec = (int64_t)f; if (f != t.tv_sec) { - rb_raise(rb_eRangeError, "%f out of Time range", RFLOAT_VALUE(time)); + rb_raise(rb_eRangeError, "%f out of Time range", + RFLOAT_VALUE(time)); } t.tv_nsec = (int)(d * 1e9 + 0.5); } @@ -270,7 +271,9 @@ static void Init_grpc_time_consts() { id_tv_nsec = rb_intern("tv_nsec"); } -static void grpc_rb_shutdown(void) { grpc_shutdown(); } +static void grpc_rb_shutdown(void) { + grpc_shutdown(); +} /* Initialize the GRPC module structs */ @@ -319,8 +322,9 @@ void Init_grpc_c() { grpc_rb_mGRPC = rb_define_module("GRPC"); grpc_rb_mGrpcCore = rb_define_module_under(grpc_rb_mGRPC, "Core"); - grpc_rb_sNewServerRpc = rb_struct_define( - "NewServerRpc", "method", "host", "deadline", "metadata", "call", NULL); + grpc_rb_sNewServerRpc = + rb_struct_define("NewServerRpc", "method", "host", + "deadline", "metadata", "call", NULL); grpc_rb_sStatus = rb_struct_define("Status", "code", "details", "metadata", NULL); sym_code = ID2SYM(rb_intern("code")); diff --git a/src/ruby/ext/grpc/rb_grpc.h b/src/ruby/ext/grpc/rb_grpc.h index 8538a74211b..4bf11e75df2 100644 --- a/src/ruby/ext/grpc/rb_grpc.h +++ b/src/ruby/ext/grpc/rb_grpc.h @@ -34,8 +34,8 @@ #ifndef GRPC_RB_H_ #define GRPC_RB_H_ -#include #include +#include #include @@ -68,7 +68,7 @@ extern VALUE sym_metadata; /* GRPC_RB_MEMSIZE_UNAVAILABLE is used in rb_data_type_t to indicate that the * number of bytes used by the wrapped struct is not available. */ -#define GRPC_RB_MEMSIZE_UNAVAILABLE (size_t(*)(const void*))(NULL) +#define GRPC_RB_MEMSIZE_UNAVAILABLE (size_t (*)(const void*))(NULL) /* A ruby object alloc func that fails by raising an exception. */ VALUE grpc_rb_cannot_alloc(VALUE cls); diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.c b/src/ruby/ext/grpc/rb_grpc_imports.generated.c index a412277f6d7..063f92114c0 100644 --- a/src/ruby/ext/grpc/rb_grpc_imports.generated.c +++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.c @@ -108,9 +108,9 @@ grpc_channel_create_call_type grpc_channel_create_call_import; grpc_channel_ping_type grpc_channel_ping_import; grpc_channel_register_call_type grpc_channel_register_call_import; grpc_channel_create_registered_call_type grpc_channel_create_registered_call_import; -grpc_call_arena_alloc_type grpc_call_arena_alloc_import; grpc_call_start_batch_type grpc_call_start_batch_import; grpc_call_get_peer_type grpc_call_get_peer_import; +grpc_call_set_load_reporting_cost_context_type grpc_call_set_load_reporting_cost_context_import; grpc_census_call_set_context_type grpc_census_call_set_context_import; grpc_census_call_get_context_type grpc_census_call_get_context_import; grpc_channel_get_target_type grpc_channel_get_target_import; @@ -120,13 +120,13 @@ grpc_lame_client_channel_create_type grpc_lame_client_channel_create_import; grpc_channel_destroy_type grpc_channel_destroy_import; grpc_call_cancel_type grpc_call_cancel_import; grpc_call_cancel_with_status_type grpc_call_cancel_with_status_import; -grpc_call_ref_type grpc_call_ref_import; -grpc_call_unref_type grpc_call_unref_import; +grpc_call_destroy_type grpc_call_destroy_import; grpc_server_request_call_type grpc_server_request_call_import; grpc_server_register_method_type grpc_server_register_method_import; grpc_server_request_registered_call_type grpc_server_request_registered_call_import; grpc_server_create_type grpc_server_create_import; grpc_server_register_completion_queue_type grpc_server_register_completion_queue_import; +grpc_server_register_non_listening_completion_queue_type grpc_server_register_non_listening_completion_queue_import; grpc_server_add_insecure_http2_port_type grpc_server_add_insecure_http2_port_import; grpc_server_start_type grpc_server_start_import; grpc_server_shutdown_and_notify_type grpc_server_shutdown_and_notify_import; @@ -405,9 +405,9 @@ void grpc_rb_load_imports(HMODULE library) { grpc_channel_ping_import = (grpc_channel_ping_type) GetProcAddress(library, "grpc_channel_ping"); grpc_channel_register_call_import = (grpc_channel_register_call_type) GetProcAddress(library, "grpc_channel_register_call"); grpc_channel_create_registered_call_import = (grpc_channel_create_registered_call_type) GetProcAddress(library, "grpc_channel_create_registered_call"); - grpc_call_arena_alloc_import = (grpc_call_arena_alloc_type) GetProcAddress(library, "grpc_call_arena_alloc"); grpc_call_start_batch_import = (grpc_call_start_batch_type) GetProcAddress(library, "grpc_call_start_batch"); grpc_call_get_peer_import = (grpc_call_get_peer_type) GetProcAddress(library, "grpc_call_get_peer"); + grpc_call_set_load_reporting_cost_context_import = (grpc_call_set_load_reporting_cost_context_type) GetProcAddress(library, "grpc_call_set_load_reporting_cost_context"); grpc_census_call_set_context_import = (grpc_census_call_set_context_type) GetProcAddress(library, "grpc_census_call_set_context"); grpc_census_call_get_context_import = (grpc_census_call_get_context_type) GetProcAddress(library, "grpc_census_call_get_context"); grpc_channel_get_target_import = (grpc_channel_get_target_type) GetProcAddress(library, "grpc_channel_get_target"); @@ -417,13 +417,13 @@ void grpc_rb_load_imports(HMODULE library) { grpc_channel_destroy_import = (grpc_channel_destroy_type) GetProcAddress(library, "grpc_channel_destroy"); grpc_call_cancel_import = (grpc_call_cancel_type) GetProcAddress(library, "grpc_call_cancel"); grpc_call_cancel_with_status_import = (grpc_call_cancel_with_status_type) GetProcAddress(library, "grpc_call_cancel_with_status"); - grpc_call_ref_import = (grpc_call_ref_type) GetProcAddress(library, "grpc_call_ref"); - grpc_call_unref_import = (grpc_call_unref_type) GetProcAddress(library, "grpc_call_unref"); + grpc_call_destroy_import = (grpc_call_destroy_type) GetProcAddress(library, "grpc_call_destroy"); grpc_server_request_call_import = (grpc_server_request_call_type) GetProcAddress(library, "grpc_server_request_call"); grpc_server_register_method_import = (grpc_server_register_method_type) GetProcAddress(library, "grpc_server_register_method"); grpc_server_request_registered_call_import = (grpc_server_request_registered_call_type) GetProcAddress(library, "grpc_server_request_registered_call"); grpc_server_create_import = (grpc_server_create_type) GetProcAddress(library, "grpc_server_create"); grpc_server_register_completion_queue_import = (grpc_server_register_completion_queue_type) GetProcAddress(library, "grpc_server_register_completion_queue"); + grpc_server_register_non_listening_completion_queue_import = (grpc_server_register_non_listening_completion_queue_type) GetProcAddress(library, "grpc_server_register_non_listening_completion_queue"); grpc_server_add_insecure_http2_port_import = (grpc_server_add_insecure_http2_port_type) GetProcAddress(library, "grpc_server_add_insecure_http2_port"); grpc_server_start_import = (grpc_server_start_type) GetProcAddress(library, "grpc_server_start"); grpc_server_shutdown_and_notify_import = (grpc_server_shutdown_and_notify_type) GetProcAddress(library, "grpc_server_shutdown_and_notify"); diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.h b/src/ruby/ext/grpc/rb_grpc_imports.generated.h index 7df8dd69fc2..f5dcd68a8e9 100644 --- a/src/ruby/ext/grpc/rb_grpc_imports.generated.h +++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.h @@ -233,7 +233,7 @@ extern grpc_completion_queue_create_for_next_type grpc_completion_queue_create_f typedef grpc_completion_queue *(*grpc_completion_queue_create_for_pluck_type)(void *reserved); extern grpc_completion_queue_create_for_pluck_type grpc_completion_queue_create_for_pluck_import; #define grpc_completion_queue_create_for_pluck grpc_completion_queue_create_for_pluck_import -typedef grpc_completion_queue *(*grpc_completion_queue_create_type)(const grpc_completion_queue_factory *factory, const grpc_completion_queue_attributes *attributes, void *reserved); +typedef grpc_completion_queue *(*grpc_completion_queue_create_type)(void *reserved); extern grpc_completion_queue_create_type grpc_completion_queue_create_import; #define grpc_completion_queue_create grpc_completion_queue_create_import typedef grpc_event(*grpc_completion_queue_next_type)(grpc_completion_queue *cq, gpr_timespec deadline, void *reserved); @@ -275,15 +275,15 @@ extern grpc_channel_register_call_type grpc_channel_register_call_import; typedef grpc_call *(*grpc_channel_create_registered_call_type)(grpc_channel *channel, grpc_call *parent_call, uint32_t propagation_mask, grpc_completion_queue *completion_queue, void *registered_call_handle, gpr_timespec deadline, void *reserved); extern grpc_channel_create_registered_call_type grpc_channel_create_registered_call_import; #define grpc_channel_create_registered_call grpc_channel_create_registered_call_import -typedef void *(*grpc_call_arena_alloc_type)(grpc_call *call, size_t size); -extern grpc_call_arena_alloc_type grpc_call_arena_alloc_import; -#define grpc_call_arena_alloc grpc_call_arena_alloc_import typedef grpc_call_error(*grpc_call_start_batch_type)(grpc_call *call, const grpc_op *ops, size_t nops, void *tag, void *reserved); extern grpc_call_start_batch_type grpc_call_start_batch_import; #define grpc_call_start_batch grpc_call_start_batch_import typedef char *(*grpc_call_get_peer_type)(grpc_call *call); extern grpc_call_get_peer_type grpc_call_get_peer_import; #define grpc_call_get_peer grpc_call_get_peer_import +typedef void(*grpc_call_set_load_reporting_cost_context_type)(grpc_call *call, struct grpc_load_reporting_cost_context *context); +extern grpc_call_set_load_reporting_cost_context_type grpc_call_set_load_reporting_cost_context_import; +#define grpc_call_set_load_reporting_cost_context grpc_call_set_load_reporting_cost_context_import typedef void(*grpc_census_call_set_context_type)(grpc_call *call, struct census_context *context); extern grpc_census_call_set_context_type grpc_census_call_set_context_import; #define grpc_census_call_set_context grpc_census_call_set_context_import @@ -311,12 +311,9 @@ extern grpc_call_cancel_type grpc_call_cancel_import; typedef grpc_call_error(*grpc_call_cancel_with_status_type)(grpc_call *call, grpc_status_code status, const char *description, void *reserved); extern grpc_call_cancel_with_status_type grpc_call_cancel_with_status_import; #define grpc_call_cancel_with_status grpc_call_cancel_with_status_import -typedef void(*grpc_call_ref_type)(grpc_call *call); -extern grpc_call_ref_type grpc_call_ref_import; -#define grpc_call_ref grpc_call_ref_import -typedef void(*grpc_call_unref_type)(grpc_call *call); -extern grpc_call_unref_type grpc_call_unref_import; -#define grpc_call_unref grpc_call_unref_import +typedef void(*grpc_call_destroy_type)(grpc_call *call); +extern grpc_call_destroy_type grpc_call_destroy_import; +#define grpc_call_destroy grpc_call_destroy_import typedef grpc_call_error(*grpc_server_request_call_type)(grpc_server *server, grpc_call **call, grpc_call_details *details, grpc_metadata_array *request_metadata, grpc_completion_queue *cq_bound_to_call, grpc_completion_queue *cq_for_notification, void *tag_new); extern grpc_server_request_call_type grpc_server_request_call_import; #define grpc_server_request_call grpc_server_request_call_import @@ -332,6 +329,9 @@ extern grpc_server_create_type grpc_server_create_import; typedef void(*grpc_server_register_completion_queue_type)(grpc_server *server, grpc_completion_queue *cq, void *reserved); extern grpc_server_register_completion_queue_type grpc_server_register_completion_queue_import; #define grpc_server_register_completion_queue grpc_server_register_completion_queue_import +typedef void(*grpc_server_register_non_listening_completion_queue_type)(grpc_server *server, grpc_completion_queue *q, void *reserved); +extern grpc_server_register_non_listening_completion_queue_type grpc_server_register_non_listening_completion_queue_import; +#define grpc_server_register_non_listening_completion_queue grpc_server_register_non_listening_completion_queue_import typedef int(*grpc_server_add_insecure_http2_port_type)(grpc_server *server, const char *addr); extern grpc_server_add_insecure_http2_port_type grpc_server_add_insecure_http2_port_import; #define grpc_server_add_insecure_http2_port grpc_server_add_insecure_http2_port_import diff --git a/src/ruby/ext/grpc/rb_server.c b/src/ruby/ext/grpc/rb_server.c index d7408f683db..2286a99f249 100644 --- a/src/ruby/ext/grpc/rb_server.c +++ b/src/ruby/ext/grpc/rb_server.c @@ -37,15 +37,15 @@ #include "rb_server.h" #include -#include #include +#include #include -#include "rb_byte_buffer.h" #include "rb_call.h" #include "rb_channel_args.h" #include "rb_completion_queue.h" -#include "rb_grpc.h" #include "rb_server_credentials.h" +#include "rb_byte_buffer.h" +#include "rb_grpc.h" /* grpc_rb_cServer is the ruby class that proxies grpc_server. */ static VALUE grpc_rb_cServer = Qnil; @@ -93,8 +93,9 @@ static void grpc_rb_server_free(void *p) { }; svr = (grpc_rb_server *)p; - deadline = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), - gpr_time_from_seconds(2, GPR_TIMESPAN)); + deadline = gpr_time_add( + gpr_now(GPR_CLOCK_REALTIME), + gpr_time_from_seconds(2, GPR_TIMESPAN)); destroy_server(svr, deadline); @@ -103,15 +104,13 @@ static void grpc_rb_server_free(void *p) { static const rb_data_type_t grpc_rb_server_data_type = { "grpc_server", - {GRPC_RB_GC_NOT_MARKED, - grpc_rb_server_free, - GRPC_RB_MEMSIZE_UNAVAILABLE, + {GRPC_RB_GC_NOT_MARKED, grpc_rb_server_free, GRPC_RB_MEMSIZE_UNAVAILABLE, {NULL, NULL}}, NULL, NULL, #ifdef RUBY_TYPED_FREE_IMMEDIATELY - /* It is unsafe to specify RUBY_TYPED_FREE_IMMEDIATELY because the free - * function would block and we might want to unlock GVL + /* It is unsafe to specify RUBY_TYPED_FREE_IMMEDIATELY because the free function would block + * and we might want to unlock GVL * TODO(yugui) Unlock GVL? */ 0, @@ -140,7 +139,7 @@ static VALUE grpc_rb_server_init(VALUE self, VALUE channel_args) { grpc_ruby_once_init(); - cq = grpc_completion_queue_create_for_pluck(NULL); + cq = grpc_completion_queue_create(NULL); TypedData_Get_Struct(self, grpc_rb_server, &grpc_rb_server_data_type, wrapper); grpc_rb_hash_convert_to_channel_args(channel_args, &args); @@ -168,7 +167,7 @@ typedef struct request_call_stack { /* grpc_request_call_stack_init ensures the request_call_stack is properly * initialized */ -static void grpc_request_call_stack_init(request_call_stack *st) { +static void grpc_request_call_stack_init(request_call_stack* st) { MEMZERO(st, request_call_stack, 1); grpc_metadata_array_init(&st->md_ary); grpc_call_details_init(&st->details); @@ -176,7 +175,7 @@ static void grpc_request_call_stack_init(request_call_stack *st) { /* grpc_request_call_stack_cleanup ensures the request_call_stack is properly * cleaned up */ -static void grpc_request_call_stack_cleanup(request_call_stack *st) { +static void grpc_request_call_stack_cleanup(request_call_stack* st) { grpc_metadata_array_destroy(&st->md_ary); grpc_call_details_destroy(&st->details); } @@ -192,9 +191,8 @@ static VALUE grpc_rb_server_request_call(VALUE self) { grpc_call_error err; request_call_stack st; VALUE result; - void *tag = (void *)&st; - grpc_completion_queue *call_queue = - grpc_completion_queue_create_for_pluck(NULL); + void *tag = (void*)&st; + grpc_completion_queue *call_queue = grpc_completion_queue_create(NULL); gpr_timespec deadline; TypedData_Get_Struct(self, grpc_rb_server, &grpc_rb_server_data_type, s); @@ -205,8 +203,9 @@ static VALUE grpc_rb_server_request_call(VALUE self) { grpc_request_call_stack_init(&st); /* call grpc_server_request_call, then wait for it to complete using * pluck_event */ - err = grpc_server_request_call(s->wrapped, &call, &st.details, &st.md_ary, - call_queue, s->queue, tag); + err = grpc_server_request_call( + s->wrapped, &call, &st.details, &st.md_ary, + call_queue, s->queue, tag); if (err != GRPC_CALL_OK) { grpc_request_call_stack_cleanup(&st); rb_raise(grpc_rb_eCallError, @@ -302,7 +301,8 @@ static VALUE grpc_rb_server_add_http2_port(VALUE self, VALUE port, return Qnil; } else if (TYPE(rb_creds) == T_SYMBOL) { if (id_insecure_server != SYM2ID(rb_creds)) { - rb_raise(rb_eTypeError, "bad creds symbol, want :this_port_is_insecure"); + rb_raise(rb_eTypeError, + "bad creds symbol, want :this_port_is_insecure"); return Qnil; } recvd_port = @@ -314,8 +314,9 @@ static VALUE grpc_rb_server_add_http2_port(VALUE self, VALUE port, } } else { creds = grpc_rb_get_wrapped_server_credentials(rb_creds); - recvd_port = grpc_server_add_secure_http2_port( - s->wrapped, StringValueCStr(port), creds); + recvd_port = + grpc_server_add_secure_http2_port(s->wrapped, StringValueCStr(port), + creds); if (recvd_port == 0) { rb_raise(rb_eRuntimeError, "could not add secure port %s to server, not sure why", @@ -334,17 +335,18 @@ void Init_grpc_server() { /* Provides a ruby constructor and support for dup/clone. */ rb_define_method(grpc_rb_cServer, "initialize", grpc_rb_server_init, 1); - rb_define_method(grpc_rb_cServer, "initialize_copy", grpc_rb_cannot_init_copy, - 1); + rb_define_method(grpc_rb_cServer, "initialize_copy", + grpc_rb_cannot_init_copy, 1); /* Add the server methods. */ - rb_define_method(grpc_rb_cServer, "request_call", grpc_rb_server_request_call, - 0); + rb_define_method(grpc_rb_cServer, "request_call", + grpc_rb_server_request_call, 0); rb_define_method(grpc_rb_cServer, "start", grpc_rb_server_start, 0); rb_define_method(grpc_rb_cServer, "destroy", grpc_rb_server_destroy, -1); rb_define_alias(grpc_rb_cServer, "close", "destroy"); rb_define_method(grpc_rb_cServer, "add_http2_port", - grpc_rb_server_add_http2_port, 2); + grpc_rb_server_add_http2_port, + 2); id_at = rb_intern("at"); id_insecure_server = rb_intern("this_port_is_insecure"); } diff --git a/src/ruby/lib/grpc/version.rb b/src/ruby/lib/grpc/version.rb index f30dff335f1..fa804685b38 100644 --- a/src/ruby/lib/grpc/version.rb +++ b/src/ruby/lib/grpc/version.rb @@ -29,5 +29,5 @@ # GRPC contains the General RPC module. module GRPC - VERSION = '1.4.0.dev' + VERSION = '1.3.0.pre1' end diff --git a/src/ruby/tools/version.rb b/src/ruby/tools/version.rb index 1f8d4afb95f..fa19aee62b5 100644 --- a/src/ruby/tools/version.rb +++ b/src/ruby/tools/version.rb @@ -29,6 +29,6 @@ module GRPC module Tools - VERSION = '1.4.0.dev' + VERSION = '1.3.0.pre1' end end diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index 88e518f1321..c647ea57072 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -314,10 +314,8 @@ set(CMAKE_CXX_FLAGS "<%text>${CMAKE_CXX_FLAGS} -std=c++11") endif() - if(_gRPC_PLATFORM_MAC) - set(_gRPC_ALLTARGETS_LIBRARIES <%text>${CMAKE_DL_LIBS} m pthread) - elseif(UNIX) - set(_gRPC_ALLTARGETS_LIBRARIES <%text>${CMAKE_DL_LIBS} rt m pthread) + if(UNIX) + set(_gRPC_ALLTARGETS_LIBRARIES dl rt m pthread) endif() if(WIN32 AND MSVC) diff --git a/templates/Makefile.template b/templates/Makefile.template index 5ce606f8280..1e6ca9337d7 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -311,7 +311,7 @@ USE_BUILT_PROTOC = false endif - GTEST_LIB = -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googletest third_party/googletest/googletest/src/gtest-all.cc -Ithird_party/googletest/googlemock/include -Ithird_party/googletest/googlemock third_party/googletest/googlemock/src/gmock-all.cc + GTEST_LIB = -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googletest third_party/googletest/googletest/src/gtest-all.cc GTEST_LIB += -lgflags ifeq ($(V),1) E = @: @@ -716,7 +716,7 @@ PC_REQUIRES_GRPCXX = PC_LIBS_GRPCXX = - CPPFLAGS := -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googlemock/include $(CPPFLAGS) + CPPFLAGS := -Ithird_party/googletest/googletest/include $(CPPFLAGS) PROTOC_PLUGINS_ALL =\ % for tgt in targets: @@ -1240,14 +1240,6 @@ $(GENDIR)/${p}.pb.cc: protoc_dep_error $(GENDIR)/${p}.grpc.pb.cc: protoc_dep_error else - <% - pluginflags="" - %> - % if p in ["src/proto/grpc/testing/compiler_test", "src/proto/grpc/testing/echo"]: - <% - pluginflags="generate_mock_code=true:" - %> - % endif $(GENDIR)/${p}.pb.cc: ${p}.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) ${' '.join('$(GENDIR)/%s.pb.cc' % q for q in proto_deps.get(p, []))} $(E) "[PROTOC] Generating protobuf CC file from $<" $(Q) mkdir -p `dirname $@` @@ -1256,7 +1248,7 @@ $(GENDIR)/${p}.grpc.pb.cc: ${p}.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) ${' '.join('$(GENDIR)/%s.pb.cc $(GENDIR)/%s.grpc.pb.cc' % (q,q) for q in proto_deps.get(p, []))} $(E) "[GRPC] Generating gRPC's protobuf service CC file from $<" $(Q) mkdir -p `dirname $@` - $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=${pluginflags}$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $< + $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $< endif % endfor diff --git a/templates/src/python/grpcio/grpc/_grpcio_metadata.py.template b/templates/src/python/grpcio/grpc/_grpcio_metadata.py.template deleted file mode 100644 index 3d325b4d3d8..00000000000 --- a/templates/src/python/grpcio/grpc/_grpcio_metadata.py.template +++ /dev/null @@ -1,34 +0,0 @@ -%YAML 1.2 ---- | - # Copyright 2017, Google Inc. - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, are permitted provided that the following conditions are - # met: - # - # * Redistributions of source code must retain the above copyright - # notice, this list of conditions and the following disclaimer. - # * Redistributions in binary form must reproduce the above - # copyright notice, this list of conditions and the following disclaimer - # in the documentation and/or other materials provided with the - # distribution. - # * Neither the name of Google Inc. nor the names of its - # contributors may be used to endorse or promote products derived from - # this software without specific prior written permission. - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc/_grpcio_metadata.py.template`!!! - - __version__ = """${settings.python_version.pep440()}""" diff --git a/templates/tools/run_tests/generated/sources_and_headers.json.template b/templates/tools/run_tests/generated/sources_and_headers.json.template index c7dc3c837d1..1c5c9747d65 100644 --- a/templates/tools/run_tests/generated/sources_and_headers.json.template +++ b/templates/tools/run_tests/generated/sources_and_headers.json.template @@ -9,7 +9,7 @@ for f in src: name, ext = os.path.splitext(f) if ext == '.proto': - out.extend(fmt % name for fmt in ['%s.grpc.pb.h', '%s.pb.h', '%s_mock.grpc.pb.h']) + out.extend(fmt % name for fmt in ['%s.grpc.pb.h', '%s.pb.h']) return out def all_targets(targets, libs, filegroups): diff --git a/test/core/bad_client/bad_client.c b/test/core/bad_client/bad_client.c index 8dbc5aa8612..9a566e6484c 100644 --- a/test/core/bad_client/bad_client.c +++ b/test/core/bad_client/bad_client.c @@ -40,9 +40,9 @@ #include #include -#include "src/core/ext/filters/http/server/http_server_filter.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/lib/channel/channel_stack.h" +#include "src/core/lib/channel/http_server_filter.h" #include "src/core/lib/iomgr/endpoint_pair.h" #include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/support/murmur_hash.h" @@ -104,7 +104,6 @@ void grpc_run_bad_client_test( grpc_slice_buffer outgoing; grpc_closure done_write_closure; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_completion_queue *shutdown_cq; hex = gpr_dump(client_payload, client_payload_length, GPR_DUMP_HEX | GPR_DUMP_ASCII); @@ -122,7 +121,7 @@ void grpc_run_bad_client_test( /* Create server, completion events */ a.server = grpc_server_create(NULL, NULL); - a.cq = grpc_completion_queue_create_for_next(NULL); + a.cq = grpc_completion_queue_create(NULL); gpr_event_init(&a.done_thd); gpr_event_init(&a.done_write); a.validator = server_validator; @@ -195,13 +194,10 @@ void grpc_run_bad_client_test( grpc_endpoint_destroy(&exec_ctx, sfd.client); grpc_exec_ctx_finish(&exec_ctx); } - - shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); - grpc_server_shutdown_and_notify(a.server, shutdown_cq, NULL); + grpc_server_shutdown_and_notify(a.server, a.cq, NULL); GPR_ASSERT(grpc_completion_queue_pluck( - shutdown_cq, NULL, grpc_timeout_seconds_to_deadline(1), NULL) + a.cq, NULL, grpc_timeout_seconds_to_deadline(1), NULL) .type == GRPC_OP_COMPLETE); - grpc_completion_queue_destroy(shutdown_cq); grpc_server_destroy(a.server); grpc_completion_queue_destroy(a.cq); grpc_slice_buffer_destroy_internal(&exec_ctx, &outgoing); diff --git a/test/core/bad_client/tests/head_of_line_blocking.c b/test/core/bad_client/tests/head_of_line_blocking.c index b0d788bf228..64cb79d82f2 100644 --- a/test/core/bad_client/tests/head_of_line_blocking.c +++ b/test/core/bad_client/tests/head_of_line_blocking.c @@ -103,7 +103,7 @@ static void verifier(grpc_server *server, grpc_completion_queue *cq, GPR_ASSERT(payload != NULL); grpc_metadata_array_destroy(&request_metadata_recv); - grpc_call_unref(s); + grpc_call_destroy(s); grpc_byte_buffer_destroy(payload); cq_verifier_destroy(cqv); } diff --git a/test/core/bad_client/tests/large_metadata.c b/test/core/bad_client/tests/large_metadata.c index d7a3ce9461c..f672776a9fb 100644 --- a/test/core/bad_client/tests/large_metadata.c +++ b/test/core/bad_client/tests/large_metadata.c @@ -131,7 +131,7 @@ static void server_verifier(grpc_server *server, grpc_completion_queue *cq, grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(s); + grpc_call_destroy(s); cq_verifier_destroy(cqv); } @@ -177,7 +177,7 @@ static void server_verifier_sends_too_much_metadata(grpc_server *server, grpc_slice_unref(meta.value); grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(s); + grpc_call_destroy(s); cq_verifier_destroy(cqv); } diff --git a/test/core/bad_client/tests/server_registered_method.c b/test/core/bad_client/tests/server_registered_method.c index c5af0bae767..e174af5931a 100644 --- a/test/core/bad_client/tests/server_registered_method.c +++ b/test/core/bad_client/tests/server_registered_method.c @@ -76,7 +76,7 @@ static void verifier_succeeds(grpc_server *server, grpc_completion_queue *cq, GPR_ASSERT(payload != NULL); grpc_metadata_array_destroy(&request_metadata_recv); - grpc_call_unref(s); + grpc_call_destroy(s); grpc_byte_buffer_destroy(payload); cq_verifier_destroy(cqv); } @@ -102,7 +102,7 @@ static void verifier_fails(grpc_server *server, grpc_completion_queue *cq, GPR_ASSERT(payload == NULL); grpc_metadata_array_destroy(&request_metadata_recv); - grpc_call_unref(s); + grpc_call_destroy(s); cq_verifier_destroy(cqv); } diff --git a/test/core/bad_client/tests/simple_request.c b/test/core/bad_client/tests/simple_request.c index fb342f08815..608b849d415 100644 --- a/test/core/bad_client/tests/simple_request.c +++ b/test/core/bad_client/tests/simple_request.c @@ -122,7 +122,7 @@ static void verifier(grpc_server *server, grpc_completion_queue *cq, grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(s); + grpc_call_destroy(s); cq_verifier_destroy(cqv); } diff --git a/test/core/bad_ssl/bad_ssl_test.c b/test/core/bad_ssl/bad_ssl_test.c index ba5b52aa54d..bd855857066 100644 --- a/test/core/bad_ssl/bad_ssl_test.c +++ b/test/core/bad_ssl/bad_ssl_test.c @@ -61,7 +61,7 @@ static void run_test(const char *target, size_t nops) { grpc_status_code status; grpc_call_error error; gpr_timespec deadline = grpc_timeout_seconds_to_deadline(5); - grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL); + grpc_completion_queue *cq = grpc_completion_queue_create(NULL); cq_verifier *cqv = cq_verifier_create(cq); grpc_op ops[6]; @@ -115,7 +115,7 @@ static void run_test(const char *target, size_t nops) { GPR_ASSERT(status != GRPC_STATUS_OK); - grpc_call_unref(c); + grpc_call_destroy(c); grpc_slice_unref(details); grpc_metadata_array_destroy(&initial_metadata_recv); grpc_metadata_array_destroy(&trailing_metadata_recv); diff --git a/test/core/bad_ssl/server_common.c b/test/core/bad_ssl/server_common.c index 0ec14676c66..6a4313eafd6 100644 --- a/test/core/bad_ssl/server_common.c +++ b/test/core/bad_ssl/server_common.c @@ -66,9 +66,7 @@ void bad_ssl_run(grpc_server *server) { grpc_call *s = NULL; grpc_call_details call_details; grpc_metadata_array request_metadata_recv; - - grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL); - grpc_completion_queue *shutdown_cq; + grpc_completion_queue *cq = grpc_completion_queue_create(NULL); grpc_call_details_init(&call_details); grpc_metadata_array_init(&request_metadata_recv); @@ -84,13 +82,10 @@ void bad_ssl_run(grpc_server *server) { while (!shutdown_finished) { if (got_sigint && !shutdown_started) { gpr_log(GPR_INFO, "Shutting down due to SIGINT"); - shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); - grpc_server_shutdown_and_notify(server, shutdown_cq, NULL); - GPR_ASSERT( - grpc_completion_queue_pluck(shutdown_cq, NULL, - grpc_timeout_seconds_to_deadline(5), NULL) - .type == GRPC_OP_COMPLETE); - grpc_completion_queue_destroy(shutdown_cq); + grpc_server_shutdown_and_notify(server, cq, NULL); + GPR_ASSERT(grpc_completion_queue_pluck( + cq, NULL, grpc_timeout_seconds_to_deadline(5), NULL) + .type == GRPC_OP_COMPLETE); grpc_completion_queue_shutdown(cq); shutdown_started = 1; } diff --git a/test/core/channel/minimal_stack_is_minimal_test.c b/test/core/channel/minimal_stack_is_minimal_test.c deleted file mode 100644 index bac94cbd645..00000000000 --- a/test/core/channel/minimal_stack_is_minimal_test.c +++ /dev/null @@ -1,232 +0,0 @@ -/* - * - * Copyright 2017, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/******************************************************************************* - * This test verifies that various stack configurations result in the set of - * filters that we expect. - * - * This is akin to a golden-file test, and suffers the same disadvantages and - * advantages: it reflects that the code as written has not been modified - and - * valid code modifications WILL break this test and it will need updating. - * - * The intent therefore is to allow code reviewers to more easily catch changes - * that perturb the generated list of channel filters in different - * configurations and assess whether such a change is correct and desirable. - */ - -#include -#include -#include -#include - -#include "src/core/lib/channel/channel_stack_builder.h" -#include "src/core/lib/support/string.h" -#include "src/core/lib/surface/channel_init.h" -#include "src/core/lib/surface/channel_stack_type.h" -#include "src/core/lib/transport/transport_impl.h" -#include "test/core/util/test_config.h" - -// use CHECK_STACK instead -static int check_stack(const char *file, int line, const char *transport_name, - grpc_channel_args *init_args, - grpc_channel_stack_type channel_stack_type, ...); - -// arguments: const char *transport_name - the name of the transport type to -// simulate -// grpc_channel_args *init_args - channel args to pass down -// grpc_channel_stack_type channel_stack_type - the archetype of -// channel stack to create -// variadic arguments - the (in-order) expected list of channel -// filters to instantiate, terminated with NULL -#define CHECK_STACK(...) check_stack(__FILE__, __LINE__, __VA_ARGS__) - -int main(int argc, char **argv) { - grpc_test_init(argc, argv); - grpc_init(); - int errors = 0; - - // tests with a minimal stack - grpc_arg minimal_stack_arg = {.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_MINIMAL_STACK, - .value.integer = 1}; - grpc_channel_args minimal_stack_args = {.num_args = 1, - .args = &minimal_stack_arg}; - errors += CHECK_STACK("unknown", &minimal_stack_args, - GRPC_CLIENT_DIRECT_CHANNEL, "connected", NULL); - errors += CHECK_STACK("unknown", &minimal_stack_args, GRPC_CLIENT_SUBCHANNEL, - "connected", NULL); - errors += CHECK_STACK("unknown", &minimal_stack_args, GRPC_SERVER_CHANNEL, - "server", "connected", NULL); - errors += - CHECK_STACK("chttp2", &minimal_stack_args, GRPC_CLIENT_DIRECT_CHANNEL, - "http-client", "connected", NULL); - errors += CHECK_STACK("chttp2", &minimal_stack_args, GRPC_CLIENT_SUBCHANNEL, - "http-client", "connected", NULL); - errors += CHECK_STACK("chttp2", &minimal_stack_args, GRPC_SERVER_CHANNEL, - "server", "http-server", "connected", NULL); - errors += CHECK_STACK(NULL, &minimal_stack_args, GRPC_CLIENT_CHANNEL, - "client-channel", NULL); - - // tests with a default stack - errors += CHECK_STACK("unknown", NULL, GRPC_CLIENT_DIRECT_CHANNEL, - "message_size", "deadline", "connected", NULL); - errors += CHECK_STACK("unknown", NULL, GRPC_CLIENT_SUBCHANNEL, "message_size", - "connected", NULL); - errors += CHECK_STACK("unknown", NULL, GRPC_SERVER_CHANNEL, "server", - "message_size", "deadline", "connected", NULL); - errors += - CHECK_STACK("chttp2", NULL, GRPC_CLIENT_DIRECT_CHANNEL, "message_size", - "deadline", "http-client", "compress", "connected", NULL); - errors += CHECK_STACK("chttp2", NULL, GRPC_CLIENT_SUBCHANNEL, "message_size", - "http-client", "compress", "connected", NULL); - errors += - CHECK_STACK("chttp2", NULL, GRPC_SERVER_CHANNEL, "server", "message_size", - "deadline", "http-server", "compress", "connected", NULL); - errors += - CHECK_STACK(NULL, NULL, GRPC_CLIENT_CHANNEL, "client-channel", NULL); - - GPR_ASSERT(errors == 0); - grpc_shutdown(); - return 0; -} - -/******************************************************************************* - * End of tests definitions, start of test infrastructure - */ - -static int check_stack(const char *file, int line, const char *transport_name, - grpc_channel_args *init_args, - grpc_channel_stack_type channel_stack_type, ...) { - // create dummy channel stack - grpc_channel_stack_builder *builder = grpc_channel_stack_builder_create(); - grpc_transport_vtable fake_transport_vtable = {.name = transport_name}; - grpc_transport fake_transport = {.vtable = &fake_transport_vtable}; - grpc_channel_stack_builder_set_target(builder, "foo.test.google.fr"); - grpc_channel_args *channel_args = grpc_channel_args_copy(init_args); - if (transport_name != NULL) { - grpc_channel_stack_builder_set_transport(builder, &fake_transport); - } - { - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_channel_stack_builder_set_channel_arguments(&exec_ctx, builder, - channel_args); - GPR_ASSERT( - grpc_channel_init_create_stack(&exec_ctx, builder, channel_stack_type)); - grpc_exec_ctx_finish(&exec_ctx); - } - - // build up our expectation list - gpr_strvec v; - gpr_strvec_init(&v); - va_list args; - va_start(args, channel_stack_type); - for (;;) { - char *a = va_arg(args, char *); - if (a == NULL) break; - if (v.count != 0) gpr_strvec_add(&v, gpr_strdup(", ")); - gpr_strvec_add(&v, gpr_strdup(a)); - } - va_end(args); - char *expect = gpr_strvec_flatten(&v, NULL); - gpr_strvec_destroy(&v); - - // build up our "got" list - gpr_strvec_init(&v); - grpc_channel_stack_builder_iterator *it = - grpc_channel_stack_builder_create_iterator_at_first(builder); - while (grpc_channel_stack_builder_move_next(it)) { - const char *name = grpc_channel_stack_builder_iterator_filter_name(it); - if (name == NULL) continue; - if (v.count != 0) gpr_strvec_add(&v, gpr_strdup(", ")); - gpr_strvec_add(&v, gpr_strdup(name)); - } - char *got = gpr_strvec_flatten(&v, NULL); - gpr_strvec_destroy(&v); - grpc_channel_stack_builder_iterator_destroy(it); - - // figure out result, log if there's an error - int result = 0; - if (0 != strcmp(got, expect)) { - gpr_strvec_init(&v); - gpr_strvec_add(&v, gpr_strdup("{")); - for (size_t i = 0; i < channel_args->num_args; i++) { - if (i > 0) gpr_strvec_add(&v, gpr_strdup(", ")); - gpr_strvec_add(&v, gpr_strdup(channel_args->args[i].key)); - gpr_strvec_add(&v, gpr_strdup("=")); - switch (channel_args->args[i].type) { - case GRPC_ARG_INTEGER: { - char *tmp; - gpr_asprintf(&tmp, "%d", channel_args->args[i].value.integer); - gpr_strvec_add(&v, tmp); - break; - } - case GRPC_ARG_STRING: - gpr_strvec_add(&v, gpr_strdup(channel_args->args[i].value.string)); - break; - case GRPC_ARG_POINTER: { - char *tmp; - gpr_asprintf(&tmp, "%p", channel_args->args[i].value.pointer.p); - gpr_strvec_add(&v, tmp); - break; - } - } - } - gpr_strvec_add(&v, gpr_strdup("}")); - char *args_str = gpr_strvec_flatten(&v, NULL); - gpr_strvec_destroy(&v); - - gpr_log(file, line, GPR_LOG_SEVERITY_ERROR, - "**************************************************"); - gpr_log(file, line, GPR_LOG_SEVERITY_ERROR, - "FAILED transport=%s; stack_type=%s; channel_args=%s:", - transport_name, grpc_channel_stack_type_string(channel_stack_type), - args_str); - gpr_log(file, line, GPR_LOG_SEVERITY_ERROR, "EXPECTED: %s", expect); - gpr_log(file, line, GPR_LOG_SEVERITY_ERROR, "GOT: %s", got); - result = 1; - - gpr_free(args_str); - } - - gpr_free(got); - gpr_free(expect); - - { - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_channel_stack_builder_destroy(&exec_ctx, builder); - grpc_channel_args_destroy(&exec_ctx, channel_args); - grpc_exec_ctx_finish(&exec_ctx); - } - - return result; -} diff --git a/test/core/client_channel/lb_policies_test.c b/test/core/client_channel/lb_policies_test.c index 4492e6f594b..e03492f80e6 100644 --- a/test/core/client_channel/lb_policies_test.c +++ b/test/core/client_channel/lb_policies_test.c @@ -59,7 +59,6 @@ typedef struct servers_fixture { grpc_server **servers; grpc_call **server_calls; grpc_completion_queue *cq; - grpc_completion_queue *shutdown_cq; char **servers_hostports; grpc_metadata_array *request_metadata_recv; } servers_fixture; @@ -147,10 +146,10 @@ static void drain_cq(grpc_completion_queue *cq) { static void kill_server(const servers_fixture *f, size_t i) { gpr_log(GPR_INFO, "KILLING SERVER %" PRIuPTR, i); GPR_ASSERT(f->servers[i] != NULL); - grpc_server_shutdown_and_notify(f->servers[i], f->shutdown_cq, tag(10000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(10000), - n_millis_time(5000), NULL) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->servers[i], f->cq, tag(10000)); + GPR_ASSERT( + grpc_completion_queue_pluck(f->cq, tag(10000), n_millis_time(5000), NULL) + .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->servers[i]); f->servers[i] = NULL; } @@ -197,8 +196,7 @@ static servers_fixture *setup_servers(const char *server_host, /* Create servers. */ f->servers = gpr_malloc(sizeof(grpc_server *) * num_servers); f->servers_hostports = gpr_malloc(sizeof(char *) * num_servers); - f->cq = grpc_completion_queue_create_for_next(NULL); - f->shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); + f->cq = grpc_completion_queue_create(NULL); for (i = 0; i < num_servers; i++) { grpc_metadata_array_init(&f->request_metadata_recv[i]); gpr_join_host_port(&f->servers_hostports[i], server_host, @@ -214,8 +212,8 @@ static void teardown_servers(servers_fixture *f) { /* Destroy server. */ for (i = 0; i < f->num_servers; i++) { if (f->servers[i] == NULL) continue; - grpc_server_shutdown_and_notify(f->servers[i], f->shutdown_cq, tag(10000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(10000), + grpc_server_shutdown_and_notify(f->servers[i], f->cq, tag(10000)); + GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(10000), n_millis_time(5000), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->servers[i]); @@ -223,7 +221,6 @@ static void teardown_servers(servers_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); gpr_free(f->servers); @@ -394,7 +391,7 @@ static request_sequences perform_request(servers_fixture *f, "foo.test.google.fr")); GPR_ASSERT(was_cancelled == 1); - grpc_call_unref(f->server_calls[s_idx]); + grpc_call_destroy(f->server_calls[s_idx]); /* ask for the next request on this server */ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( @@ -420,7 +417,7 @@ static request_sequences perform_request(servers_fixture *f, cq_verifier_destroy(cqv); - grpc_call_unref(c); + grpc_call_destroy(c); for (i = 0; i < f->num_servers; i++) { grpc_call_details_destroy(&rdata->call_details[i]); @@ -616,7 +613,7 @@ static void test_pending_calls(size_t concurrent_calls) { /* destroy the calls after the channel so that they are still around for the * LB's shutdown func to process */ for (i = 0; i < concurrent_calls; i++) { - grpc_call_unref(calls[i]); + grpc_call_destroy(calls[i]); } gpr_free(calls); teardown_servers(f); diff --git a/test/core/client_channel/parse_address_test.c b/test/core/client_channel/parse_address_test.c index 802e41e5dee..629cdb001f9 100644 --- a/test/core/client_channel/parse_address_test.c +++ b/test/core/client_channel/parse_address_test.c @@ -47,12 +47,12 @@ #ifdef GRPC_HAVE_UNIX_SOCKET -static void test_grpc_parse_unix(const char *uri_text, const char *pathname) { +static void test_parse_unix(const char *uri_text, const char *pathname) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_uri *uri = grpc_uri_parse(&exec_ctx, uri_text, 0); grpc_resolved_address addr; - GPR_ASSERT(1 == grpc_parse_unix(uri, &addr)); + GPR_ASSERT(1 == parse_unix(uri, &addr)); struct sockaddr_un *addr_un = (struct sockaddr_un *)addr.addr; GPR_ASSERT(AF_UNIX == addr_un->sun_family); GPR_ASSERT(0 == strcmp(addr_un->sun_path, pathname)); @@ -63,18 +63,18 @@ static void test_grpc_parse_unix(const char *uri_text, const char *pathname) { #else /* GRPC_HAVE_UNIX_SOCKET */ -static void test_grpc_parse_unix(const char *uri_text, const char *pathname) {} +static void test_parse_unix(const char *uri_text, const char *pathname) {} #endif /* GRPC_HAVE_UNIX_SOCKET */ -static void test_grpc_parse_ipv4(const char *uri_text, const char *host, - unsigned short port) { +static void test_parse_ipv4(const char *uri_text, const char *host, + unsigned short port) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_uri *uri = grpc_uri_parse(&exec_ctx, uri_text, 0); grpc_resolved_address addr; char ntop_buf[INET_ADDRSTRLEN]; - GPR_ASSERT(1 == grpc_parse_ipv4(uri, &addr)); + GPR_ASSERT(1 == parse_ipv4(uri, &addr)); struct sockaddr_in *addr_in = (struct sockaddr_in *)addr.addr; GPR_ASSERT(AF_INET == addr_in->sin_family); GPR_ASSERT(NULL != grpc_inet_ntop(AF_INET, &addr_in->sin_addr, ntop_buf, @@ -86,14 +86,14 @@ static void test_grpc_parse_ipv4(const char *uri_text, const char *host, grpc_exec_ctx_finish(&exec_ctx); } -static void test_grpc_parse_ipv6(const char *uri_text, const char *host, - unsigned short port, uint32_t scope_id) { +static void test_parse_ipv6(const char *uri_text, const char *host, + unsigned short port, uint32_t scope_id) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_uri *uri = grpc_uri_parse(&exec_ctx, uri_text, 0); grpc_resolved_address addr; char ntop_buf[INET6_ADDRSTRLEN]; - GPR_ASSERT(1 == grpc_parse_ipv6(uri, &addr)); + GPR_ASSERT(1 == parse_ipv6(uri, &addr)); struct sockaddr_in6 *addr_in6 = (struct sockaddr_in6 *)addr.addr; GPR_ASSERT(AF_INET6 == addr_in6->sin6_family); GPR_ASSERT(NULL != grpc_inet_ntop(AF_INET6, &addr_in6->sin6_addr, ntop_buf, @@ -109,8 +109,8 @@ static void test_grpc_parse_ipv6(const char *uri_text, const char *host, int main(int argc, char **argv) { grpc_test_init(argc, argv); - test_grpc_parse_unix("unix:/path/name", "/path/name"); - test_grpc_parse_ipv4("ipv4:192.0.2.1:12345", "192.0.2.1", 12345); - test_grpc_parse_ipv6("ipv6:[2001:db8::1]:12345", "2001:db8::1", 12345, 0); - test_grpc_parse_ipv6("ipv6:[2001:db8::1%252]:12345", "2001:db8::1", 12345, 2); + test_parse_unix("unix:/path/name", "/path/name"); + test_parse_ipv4("ipv4:192.0.2.1:12345", "192.0.2.1", 12345); + test_parse_ipv6("ipv6:[2001:db8::1]:12345", "2001:db8::1", 12345, 0); + test_parse_ipv6("ipv6:[2001:db8::1%252]:12345", "2001:db8::1", 12345, 2); } diff --git a/test/core/client_channel/resolvers/BUILD b/test/core/client_channel/resolvers/BUILD index e8361cdef63..af37072e3a4 100644 --- a/test/core/client_channel/resolvers/BUILD +++ b/test/core/client_channel/resolvers/BUILD @@ -32,48 +32,20 @@ licenses(["notice"]) # 3-clause BSD cc_test( name = "dns_resolver_connectivity_test", srcs = ["dns_resolver_connectivity_test.c"], - copts = ["-std=c99"], - deps = [ - "//:gpr", - "//:grpc", - "//test/core/util:gpr_test_util", - "//test/core/util:grpc_test_util", - ], + deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"], + copts = ['-std=c99'] ) cc_test( name = "dns_resolver_test", srcs = ["dns_resolver_test.c"], - copts = ["-std=c99"], - deps = [ - "//:gpr", - "//:grpc", - "//test/core/util:gpr_test_util", - "//test/core/util:grpc_test_util", - ], + deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"], + copts = ['-std=c99'] ) cc_test( name = "sockaddr_resolver_test", srcs = ["sockaddr_resolver_test.c"], - copts = ["-std=c99"], - deps = [ - "//:gpr", - "//:grpc", - "//test/core/util:gpr_test_util", - "//test/core/util:grpc_test_util", - ], -) - -cc_test( - name = "fake_resolver_test", - srcs = ["fake_resolver_test.c"], - copts = ["-std=c99"], - deps = [ - "//:gpr", - "//:grpc", - "//test/core/end2end:fake_resolver", - "//test/core/util:gpr_test_util", - "//test/core/util:grpc_test_util", - ], + deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"], + copts = ['-std=c99'] ) diff --git a/test/core/client_channel/resolvers/fake_resolver_test.c b/test/core/client_channel/resolvers/fake_resolver_test.c deleted file mode 100644 index 861918fbd65..00000000000 --- a/test/core/client_channel/resolvers/fake_resolver_test.c +++ /dev/null @@ -1,187 +0,0 @@ -/* - * - * Copyright 2017, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include - -#include -#include -#include - -#include "src/core/ext/filters/client_channel/lb_policy_factory.h" -#include "src/core/ext/filters/client_channel/parse_address.h" -#include "src/core/ext/filters/client_channel/resolver_registry.h" -#include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/iomgr/combiner.h" -#include "src/core/lib/security/credentials/fake/fake_credentials.h" - -#include "test/core/end2end/fake_resolver.h" -#include "test/core/util/test_config.h" - -static grpc_resolver *build_fake_resolver( - grpc_exec_ctx *exec_ctx, grpc_combiner *combiner, - grpc_fake_resolver_response_generator *response_generator) { - grpc_resolver_factory *factory = grpc_resolver_factory_lookup("test"); - grpc_arg generator_arg = - grpc_fake_resolver_response_generator_arg(response_generator); - grpc_resolver_args args; - memset(&args, 0, sizeof(args)); - grpc_channel_args channel_args = {1, &generator_arg}; - args.args = &channel_args; - args.combiner = combiner; - grpc_resolver *resolver = - grpc_resolver_factory_create_resolver(exec_ctx, factory, &args); - grpc_resolver_factory_unref(factory); - return resolver; -} - -typedef struct on_resolution_arg { - grpc_channel_args *resolver_result; - grpc_channel_args *expected_resolver_result; - bool was_called; -} on_resolution_arg; - -void on_resolution_cb(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { - on_resolution_arg *res = arg; - res->was_called = true; - // We only check the addresses channel arg because that's the only one - // explicitly set by the test via - // grpc_fake_resolver_response_generator_set_response. - const grpc_lb_addresses *actual_lb_addresses = - grpc_lb_addresses_find_channel_arg(res->resolver_result); - const grpc_lb_addresses *expected_lb_addresses = - grpc_lb_addresses_find_channel_arg(res->expected_resolver_result); - GPR_ASSERT( - grpc_lb_addresses_cmp(actual_lb_addresses, expected_lb_addresses) == 0); - grpc_channel_args_destroy(exec_ctx, res->resolver_result); - grpc_channel_args_destroy(exec_ctx, res->expected_resolver_result); -} - -static void test_fake_resolver() { - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_combiner *combiner = grpc_combiner_create(NULL); - // Create resolver. - grpc_fake_resolver_response_generator *response_generator = - grpc_fake_resolver_response_generator_create(); - grpc_resolver *resolver = - build_fake_resolver(&exec_ctx, combiner, response_generator); - GPR_ASSERT(resolver != NULL); - - // Setup expectations. - grpc_uri *uris[] = {grpc_uri_parse(&exec_ctx, "ipv4:10.2.1.1:1234", true), - grpc_uri_parse(&exec_ctx, "ipv4:127.0.0.1:4321", true)}; - char *balancer_names[] = {"name1", "name2"}; - const bool is_balancer[] = {true, false}; - grpc_lb_addresses *addresses = grpc_lb_addresses_create(3, NULL); - for (size_t i = 0; i < GPR_ARRAY_SIZE(uris); ++i) { - grpc_lb_addresses_set_address_from_uri( - addresses, i, uris[i], is_balancer[i], balancer_names[i], NULL); - grpc_uri_destroy(uris[i]); - } - const grpc_arg addresses_arg = - grpc_lb_addresses_create_channel_arg(addresses); - grpc_channel_args *results = - grpc_channel_args_copy_and_add(NULL, &addresses_arg, 1); - grpc_lb_addresses_destroy(&exec_ctx, addresses); - on_resolution_arg on_res_arg; - memset(&on_res_arg, 0, sizeof(on_res_arg)); - on_res_arg.expected_resolver_result = results; - grpc_closure *on_resolution = grpc_closure_create( - on_resolution_cb, &on_res_arg, grpc_combiner_scheduler(combiner, false)); - - // Set resolver results and trigger first resolution. on_resolution_cb - // performs the checks. - grpc_fake_resolver_response_generator_set_response( - &exec_ctx, response_generator, results); - grpc_resolver_next_locked(&exec_ctx, resolver, &on_res_arg.resolver_result, - on_resolution); - grpc_exec_ctx_flush(&exec_ctx); - GPR_ASSERT(on_res_arg.was_called); - - // Setup update. - grpc_uri *uris_update[] = { - grpc_uri_parse(&exec_ctx, "ipv4:192.168.1.0:31416", true)}; - char *balancer_names_update[] = {"name3"}; - const bool is_balancer_update[] = {false}; - grpc_lb_addresses *addresses_update = grpc_lb_addresses_create(1, NULL); - for (size_t i = 0; i < GPR_ARRAY_SIZE(uris_update); ++i) { - grpc_lb_addresses_set_address_from_uri(addresses_update, i, uris_update[i], - is_balancer_update[i], - balancer_names_update[i], NULL); - grpc_uri_destroy(uris_update[i]); - } - - grpc_arg addresses_update_arg = - grpc_lb_addresses_create_channel_arg(addresses_update); - grpc_channel_args *results_update = - grpc_channel_args_copy_and_add(NULL, &addresses_update_arg, 1); - grpc_lb_addresses_destroy(&exec_ctx, addresses_update); - - // Setup expectations for the update. - on_resolution_arg on_res_arg_update; - memset(&on_res_arg_update, 0, sizeof(on_res_arg_update)); - on_res_arg_update.expected_resolver_result = results_update; - on_resolution = grpc_closure_create(on_resolution_cb, &on_res_arg_update, - grpc_combiner_scheduler(combiner, false)); - - // Set updated resolver results and trigger a second resolution. - grpc_fake_resolver_response_generator_set_response( - &exec_ctx, response_generator, results_update); - grpc_resolver_next_locked(&exec_ctx, resolver, - &on_res_arg_update.resolver_result, on_resolution); - grpc_exec_ctx_flush(&exec_ctx); - GPR_ASSERT(on_res_arg.was_called); - - // Requesting a new resolution without re-senting the response shouldn't - // trigger the resolution callback. - memset(&on_res_arg, 0, sizeof(on_res_arg)); - grpc_resolver_next_locked(&exec_ctx, resolver, &on_res_arg.resolver_result, - on_resolution); - grpc_exec_ctx_flush(&exec_ctx); - GPR_ASSERT(!on_res_arg.was_called); - - GRPC_COMBINER_UNREF(&exec_ctx, combiner, "test_fake_resolver"); - GRPC_RESOLVER_UNREF(&exec_ctx, resolver, "test_fake_resolver"); - grpc_exec_ctx_finish(&exec_ctx); - grpc_fake_resolver_response_generator_unref(response_generator); -} - -int main(int argc, char **argv) { - grpc_test_init(argc, argv); - grpc_fake_resolver_init(); // Registers the "test" scheme. - grpc_init(); - - test_fake_resolver(); - - grpc_shutdown(); - return 0; -} diff --git a/test/core/end2end/BUILD b/test/core/end2end/BUILD index ffea1cc4e8e..0cef7aa01df 100644 --- a/test/core/end2end/BUILD +++ b/test/core/end2end/BUILD @@ -32,66 +32,49 @@ licenses(["notice"]) # 3-clause BSD load(":generate_tests.bzl", "grpc_end2end_tests") cc_library( - name = "cq_verifier", - srcs = ["cq_verifier.c"], - hdrs = ["cq_verifier.h"], - copts = ["-std=c99"], - visibility = ["//test:__subpackages__"], - deps = [ - "//:gpr", - "//:grpc", - "//test/core/util:grpc_test_util", - ], + name = 'cq_verifier', + srcs = ['cq_verifier.c'], + hdrs = ['cq_verifier.h'], + deps = ['//:gpr', '//:grpc', '//test/core/util:grpc_test_util'], + copts = ['-std=c99'], + visibility = ["//test:__subpackages__"], ) cc_library( - name = "ssl_test_data", - srcs = [ - "data/client_certs.c", - "data/server1_cert.c", - "data/server1_key.c", - "data/test_root_cert.c", - ], - hdrs = ["data/ssl_test_data.h"], - copts = ["-std=c99"], - visibility = ["//test:__subpackages__"], + name = 'ssl_test_data', + visibility = ["//test:__subpackages__"], + hdrs = ['data/ssl_test_data.h'], + copts = ['-std=c99'], + srcs = [ + "data/client_certs.c", + "data/server1_cert.c", + "data/server1_key.c", + "data/test_root_cert.c", + ] ) cc_library( - name = "fake_resolver", - srcs = ["fake_resolver.c"], - hdrs = ["fake_resolver.h"], - copts = ["-std=c99"], - visibility = ["//test:__subpackages__"], - deps = [ - "//:gpr", - "//:grpc", - "//test/core/util:grpc_test_util", - ], + name = 'fake_resolver', + hdrs = ['fake_resolver.h'], + srcs = ['fake_resolver.c'], + copts = ['-std=c99'], + deps = ['//:gpr', '//:grpc', '//test/core/util:grpc_test_util'] ) cc_library( - name = "http_proxy", - srcs = ["fixtures/http_proxy_fixture.c"], - hdrs = ["fixtures/http_proxy_fixture.h"], - copts = ["-std=c99"], - deps = [ - "//:gpr", - "//:grpc", - "//test/core/util:grpc_test_util", - ], + name = 'http_proxy', + hdrs = ['fixtures/http_proxy_fixture.h'], + srcs = ['fixtures/http_proxy_fixture.c'], + copts = ['-std=c99'], + deps = ['//:gpr', '//:grpc', '//test/core/util:grpc_test_util'] ) cc_library( - name = "proxy", - srcs = ["fixtures/proxy.c"], - hdrs = ["fixtures/proxy.h"], - copts = ["-std=c99"], - deps = [ - "//:gpr", - "//:grpc", - "//test/core/util:grpc_test_util", - ], + name = 'proxy', + hdrs = ['fixtures/proxy.h'], + srcs = ['fixtures/proxy.c'], + copts = ['-std=c99'], + deps = ['//:gpr', '//:grpc', '//test/core/util:grpc_test_util'] ) grpc_end2end_tests() diff --git a/test/core/end2end/bad_server_response_test.c b/test/core/end2end/bad_server_response_test.c index fe7e674d17c..c37a292af97 100644 --- a/test/core/end2end/bad_server_response_test.c +++ b/test/core/end2end/bad_server_response_test.c @@ -178,7 +178,7 @@ static void start_rpc(int target_port, grpc_status_code expected_status, cq_verifier *cqv; grpc_slice details; - state.cq = grpc_completion_queue_create_for_next(NULL); + state.cq = grpc_completion_queue_create(NULL); cqv = cq_verifier_create(state.cq); gpr_join_host_port(&state.target, "127.0.0.1", target_port); state.channel = grpc_insecure_channel_create(state.target, NULL, NULL); @@ -236,7 +236,7 @@ static void cleanup_rpc(grpc_exec_ctx *exec_ctx) { grpc_event ev; grpc_slice_buffer_destroy_internal(exec_ctx, &state.temp_incoming_buffer); grpc_slice_buffer_destroy_internal(exec_ctx, &state.outgoing_buffer); - grpc_call_unref(state.call); + grpc_call_destroy(state.call); grpc_completion_queue_shutdown(state.cq); do { ev = grpc_completion_queue_next(state.cq, n_sec_deadline(1), NULL); diff --git a/test/core/end2end/connection_refused_test.c b/test/core/end2end/connection_refused_test.c index db7a6c0a8ec..6ded12ad480 100644 --- a/test/core/end2end/connection_refused_test.c +++ b/test/core/end2end/connection_refused_test.c @@ -68,7 +68,7 @@ static void run_test(bool wait_for_ready, bool use_service_config) { grpc_metadata_array_init(&trailing_metadata_recv); - cq = grpc_completion_queue_create_for_next(NULL); + cq = grpc_completion_queue_create(NULL); cqv = cq_verifier_create(cq); /* if using service config, create channel args */ @@ -138,7 +138,7 @@ static void run_test(bool wait_for_ready, bool use_service_config) { .type != GRPC_QUEUE_SHUTDOWN) ; grpc_completion_queue_destroy(cq); - grpc_call_unref(call); + grpc_call_destroy(call); grpc_channel_destroy(chan); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/dualstack_socket_test.c b/test/core/end2end/dualstack_socket_test.c index caf78286919..3623bd7be8b 100644 --- a/test/core/end2end/dualstack_socket_test.c +++ b/test/core/end2end/dualstack_socket_test.c @@ -76,7 +76,6 @@ void test_connect(const char *server_host, const char *client_host, int port, grpc_channel *client; grpc_server *server; grpc_completion_queue *cq; - grpc_completion_queue *shutdown_cq; grpc_call *c; grpc_call *s; cq_verifier *cqv; @@ -108,7 +107,7 @@ void test_connect(const char *server_host, const char *client_host, int port, grpc_call_details_init(&call_details); /* Create server. */ - cq = grpc_completion_queue_create_for_next(NULL); + cq = grpc_completion_queue_create(NULL); server = grpc_server_create(NULL, NULL); grpc_server_register_completion_queue(server, cq, NULL); GPR_ASSERT((got_port = grpc_server_add_insecure_http2_port( @@ -243,7 +242,7 @@ void test_connect(const char *server_host, const char *client_host, int port, grpc_slice_str_cmp(call_details.host, "foo.test.google.fr")); GPR_ASSERT(was_cancelled == 1); - grpc_call_unref(s); + grpc_call_destroy(s); } else { /* Check for a failed connection. */ CQ_EXPECT_COMPLETION(cqv, tag(1), 1); @@ -252,7 +251,7 @@ void test_connect(const char *server_host, const char *client_host, int port, GPR_ASSERT(status == GRPC_STATUS_UNAVAILABLE); } - grpc_call_unref(c); + grpc_call_destroy(c); cq_verifier_destroy(cqv); @@ -260,14 +259,11 @@ void test_connect(const char *server_host, const char *client_host, int port, grpc_channel_destroy(client); /* Destroy server. */ - shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); - grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - NULL) + grpc_server_shutdown_and_notify(server, cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(server); - grpc_completion_queue_destroy(shutdown_cq); grpc_completion_queue_shutdown(cq); drain_cq(cq); grpc_completion_queue_destroy(cq); diff --git a/test/core/end2end/end2end_tests.h b/test/core/end2end/end2end_tests.h index 4d98bddbd83..cdb26a67e9d 100644 --- a/test/core/end2end/end2end_tests.h +++ b/test/core/end2end/end2end_tests.h @@ -53,7 +53,6 @@ typedef struct grpc_end2end_test_config grpc_end2end_test_config; struct grpc_end2end_test_fixture { grpc_completion_queue *cq; - grpc_completion_queue *shutdown_cq; grpc_server *server; grpc_channel *client; void *fixture_data; diff --git a/test/core/end2end/fake_resolver.c b/test/core/end2end/fake_resolver.c index 6a71c20b804..1c7dd1339c1 100644 --- a/test/core/end2end/fake_resolver.c +++ b/test/core/end2end/fake_resolver.c @@ -32,7 +32,6 @@ // This is similar to the sockaddr resolver, except that it supports a // bunch of query args that are useful for dependency injection in tests. -#include #include #include #include @@ -47,18 +46,12 @@ #include "src/core/ext/filters/client_channel/parse_address.h" #include "src/core/ext/filters/client_channel/resolver_registry.h" #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/iomgr/combiner.h" #include "src/core/lib/iomgr/resolve_address.h" #include "src/core/lib/iomgr/unix_sockets_posix.h" #include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/slice/slice_string_helpers.h" #include "src/core/lib/support/string.h" -#include "test/core/end2end/fake_resolver.h" - -#define GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR \ - "grpc.fake_resolver.response_generator" - // // fake_resolver // @@ -69,11 +62,12 @@ typedef struct { // passed-in parameters grpc_channel_args* channel_args; + grpc_lb_addresses* addresses; - // If not NULL, the next set of resolution results to be returned to - // grpc_resolver_next_locked()'s closure. - grpc_channel_args* next_results; - + // mutex guarding the rest of the state + gpr_mu mu; + // have we published? + bool published; // pending next completion, or NULL grpc_closure* next_completion; // target result address for next completion @@ -82,137 +76,60 @@ typedef struct { static void fake_resolver_destroy(grpc_exec_ctx* exec_ctx, grpc_resolver* gr) { fake_resolver* r = (fake_resolver*)gr; - grpc_channel_args_destroy(exec_ctx, r->next_results); + gpr_mu_destroy(&r->mu); grpc_channel_args_destroy(exec_ctx, r->channel_args); + grpc_lb_addresses_destroy(exec_ctx, r->addresses); gpr_free(r); } -static void fake_resolver_shutdown_locked(grpc_exec_ctx* exec_ctx, - grpc_resolver* resolver) { +static void fake_resolver_shutdown(grpc_exec_ctx* exec_ctx, + grpc_resolver* resolver) { fake_resolver* r = (fake_resolver*)resolver; + gpr_mu_lock(&r->mu); if (r->next_completion != NULL) { *r->target_result = NULL; grpc_closure_sched(exec_ctx, r->next_completion, GRPC_ERROR_NONE); r->next_completion = NULL; } + gpr_mu_unlock(&r->mu); } static void fake_resolver_maybe_finish_next_locked(grpc_exec_ctx* exec_ctx, fake_resolver* r) { - if (r->next_completion != NULL && r->next_results != NULL) { + if (r->next_completion != NULL && !r->published) { + r->published = true; + grpc_arg arg = grpc_lb_addresses_create_channel_arg(r->addresses); *r->target_result = - grpc_channel_args_merge(r->channel_args, r->next_results); - grpc_channel_args_destroy(exec_ctx, r->next_results); + grpc_channel_args_copy_and_add(r->channel_args, &arg, 1); grpc_closure_sched(exec_ctx, r->next_completion, GRPC_ERROR_NONE); r->next_completion = NULL; - r->next_results = NULL; } } -static void fake_resolver_channel_saw_error_locked(grpc_exec_ctx* exec_ctx, - grpc_resolver* resolver) { +static void fake_resolver_channel_saw_error(grpc_exec_ctx* exec_ctx, + grpc_resolver* resolver) { fake_resolver* r = (fake_resolver*)resolver; + gpr_mu_lock(&r->mu); + r->published = false; fake_resolver_maybe_finish_next_locked(exec_ctx, r); + gpr_mu_unlock(&r->mu); } -static void fake_resolver_next_locked(grpc_exec_ctx* exec_ctx, - grpc_resolver* resolver, - grpc_channel_args** target_result, - grpc_closure* on_complete) { +static void fake_resolver_next(grpc_exec_ctx* exec_ctx, grpc_resolver* resolver, + grpc_channel_args** target_result, + grpc_closure* on_complete) { fake_resolver* r = (fake_resolver*)resolver; + gpr_mu_lock(&r->mu); GPR_ASSERT(!r->next_completion); r->next_completion = on_complete; r->target_result = target_result; fake_resolver_maybe_finish_next_locked(exec_ctx, r); + gpr_mu_unlock(&r->mu); } static const grpc_resolver_vtable fake_resolver_vtable = { - fake_resolver_destroy, fake_resolver_shutdown_locked, - fake_resolver_channel_saw_error_locked, fake_resolver_next_locked}; - -struct grpc_fake_resolver_response_generator { - fake_resolver* resolver; // Set by the fake_resolver constructor to itself. - grpc_channel_args* next_response; - gpr_refcount refcount; -}; - -grpc_fake_resolver_response_generator* -grpc_fake_resolver_response_generator_create() { - grpc_fake_resolver_response_generator* generator = - gpr_zalloc(sizeof(*generator)); - gpr_ref_init(&generator->refcount, 1); - return generator; -} - -grpc_fake_resolver_response_generator* -grpc_fake_resolver_response_generator_ref( - grpc_fake_resolver_response_generator* generator) { - gpr_ref(&generator->refcount); - return generator; -} - -void grpc_fake_resolver_response_generator_unref( - grpc_fake_resolver_response_generator* generator) { - if (gpr_unref(&generator->refcount)) { - gpr_free(generator); - } -} - -static void set_response_cb(grpc_exec_ctx* exec_ctx, void* arg, - grpc_error* error) { - grpc_fake_resolver_response_generator* generator = arg; - fake_resolver* r = generator->resolver; - if (r->next_results != NULL) { - grpc_channel_args_destroy(exec_ctx, r->next_results); - } - r->next_results = generator->next_response; - fake_resolver_maybe_finish_next_locked(exec_ctx, r); -} - -void grpc_fake_resolver_response_generator_set_response( - grpc_exec_ctx* exec_ctx, grpc_fake_resolver_response_generator* generator, - grpc_channel_args* next_response) { - GPR_ASSERT(generator->resolver != NULL); - generator->next_response = grpc_channel_args_copy(next_response); - grpc_closure_sched( - exec_ctx, - grpc_closure_create( - set_response_cb, generator, - grpc_combiner_scheduler(generator->resolver->base.combiner, false)), - GRPC_ERROR_NONE); -} - -static void* response_generator_arg_copy(void* p) { - return grpc_fake_resolver_response_generator_ref(p); -} - -static void response_generator_arg_destroy(grpc_exec_ctx* exec_ctx, void* p) { - grpc_fake_resolver_response_generator_unref(p); -} - -static int response_generator_cmp(void* a, void* b) { return GPR_ICMP(a, b); } - -static const grpc_arg_pointer_vtable response_generator_arg_vtable = { - response_generator_arg_copy, response_generator_arg_destroy, - response_generator_cmp}; - -grpc_arg grpc_fake_resolver_response_generator_arg( - grpc_fake_resolver_response_generator* generator) { - grpc_arg arg; - arg.type = GRPC_ARG_POINTER; - arg.key = GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR; - arg.value.pointer.p = generator; - arg.value.pointer.vtable = &response_generator_arg_vtable; - return arg; -} - -grpc_fake_resolver_response_generator* -grpc_fake_resolver_get_response_generator(const grpc_channel_args* args) { - const grpc_arg* arg = - grpc_channel_args_find(args, GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR); - if (arg == NULL || arg->type != GRPC_ARG_POINTER) return NULL; - return arg->value.pointer.p; -} + fake_resolver_destroy, fake_resolver_shutdown, + fake_resolver_channel_saw_error, fake_resolver_next}; // // fake_resolver_factory @@ -222,15 +139,81 @@ static void fake_resolver_factory_ref(grpc_resolver_factory* factory) {} static void fake_resolver_factory_unref(grpc_resolver_factory* factory) {} +static void do_nothing(void* ignored) {} + static grpc_resolver* fake_resolver_create(grpc_exec_ctx* exec_ctx, grpc_resolver_factory* factory, grpc_resolver_args* args) { - fake_resolver* r = gpr_zalloc(sizeof(*r)); + if (0 != strcmp(args->uri->authority, "")) { + gpr_log(GPR_ERROR, "authority based uri's not supported by the %s scheme", + args->uri->scheme); + return NULL; + } + // Get lb_enabled arg. Anything other than "0" is interpreted as true. + const char* lb_enabled_qpart = + grpc_uri_get_query_arg(args->uri, "lb_enabled"); + const bool lb_enabled = + lb_enabled_qpart != NULL && strcmp("0", lb_enabled_qpart) != 0; + + // Get the balancer's names. + const char* balancer_names = + grpc_uri_get_query_arg(args->uri, "balancer_names"); + grpc_slice_buffer balancer_names_parts; + grpc_slice_buffer_init(&balancer_names_parts); + if (balancer_names != NULL) { + const grpc_slice balancer_names_slice = + grpc_slice_from_copied_string(balancer_names); + grpc_slice_split(balancer_names_slice, ",", &balancer_names_parts); + grpc_slice_unref(balancer_names_slice); + } + + // Construct addresses. + grpc_slice path_slice = + grpc_slice_new(args->uri->path, strlen(args->uri->path), do_nothing); + grpc_slice_buffer path_parts; + grpc_slice_buffer_init(&path_parts); + grpc_slice_split(path_slice, ",", &path_parts); + if (balancer_names_parts.count > 0 && + path_parts.count != balancer_names_parts.count) { + gpr_log(GPR_ERROR, + "Balancer names present but mismatched with number of addresses: " + "%lu balancer names != %lu addresses", + (unsigned long)balancer_names_parts.count, + (unsigned long)path_parts.count); + return NULL; + } + grpc_lb_addresses* addresses = + grpc_lb_addresses_create(path_parts.count, NULL /* user_data_vtable */); + bool errors_found = false; + for (size_t i = 0; i < addresses->num_addresses; i++) { + grpc_uri ith_uri = *args->uri; + char* part_str = grpc_slice_to_c_string(path_parts.slices[i]); + ith_uri.path = part_str; + if (!parse_ipv4(&ith_uri, &addresses->addresses[i].address)) { + errors_found = true; + } + gpr_free(part_str); + if (errors_found) break; + addresses->addresses[i].is_balancer = lb_enabled; + addresses->addresses[i].balancer_name = + balancer_names_parts.count > 0 + ? grpc_dump_slice(balancer_names_parts.slices[i], GPR_DUMP_ASCII) + : NULL; + } + grpc_slice_buffer_destroy_internal(exec_ctx, &path_parts); + grpc_slice_buffer_destroy_internal(exec_ctx, &balancer_names_parts); + grpc_slice_unref(path_slice); + if (errors_found) { + grpc_lb_addresses_destroy(exec_ctx, addresses); + return NULL; + } + // Instantiate resolver. + fake_resolver* r = gpr_malloc(sizeof(fake_resolver)); + memset(r, 0, sizeof(*r)); r->channel_args = grpc_channel_args_copy(args->args); + r->addresses = addresses; + gpr_mu_init(&r->mu); grpc_resolver_init(&r->base, &fake_resolver_vtable, args->combiner); - grpc_fake_resolver_response_generator* response_generator = - grpc_fake_resolver_get_response_generator(args->args); - if (response_generator != NULL) response_generator->resolver = r; return &r->base; } diff --git a/test/core/end2end/fake_resolver.h b/test/core/end2end/fake_resolver.h index 447289adefa..7a30347f301 100644 --- a/test/core/end2end/fake_resolver.h +++ b/test/core/end2end/fake_resolver.h @@ -32,42 +32,8 @@ #ifndef GRPC_TEST_CORE_END2END_FAKE_RESOLVER_H #define GRPC_TEST_CORE_END2END_FAKE_RESOLVER_H -#include "src/core/ext/filters/client_channel/lb_policy_factory.h" -#include "src/core/ext/filters/client_channel/uri_parser.h" -#include "src/core/lib/channel/channel_args.h" - #include "test/core/util/test_config.h" void grpc_fake_resolver_init(); -// Instances of \a grpc_fake_resolver_response_generator are passed to the -// fake resolver in a channel argument (see \a -// grpc_fake_resolver_response_generator_arg) in order to inject and trigger -// custom resolutions. See also \a -// grpc_fake_resolver_response_generator_set_response. -typedef struct grpc_fake_resolver_response_generator - grpc_fake_resolver_response_generator; -grpc_fake_resolver_response_generator* -grpc_fake_resolver_response_generator_create(); - -// Instruct the fake resolver associated with the \a response_generator instance -// to trigger a new resolution for \a uri and \a args. -void grpc_fake_resolver_response_generator_set_response( - grpc_exec_ctx* exec_ctx, grpc_fake_resolver_response_generator* generator, - grpc_channel_args* next_response); - -// Return a \a grpc_arg for a \a grpc_fake_resolver_response_generator instance. -grpc_arg grpc_fake_resolver_response_generator_arg( - grpc_fake_resolver_response_generator* generator); -// Return the \a grpc_fake_resolver_response_generator instance in \a args or -// NULL. -grpc_fake_resolver_response_generator* -grpc_fake_resolver_get_response_generator(const grpc_channel_args* args); - -grpc_fake_resolver_response_generator* -grpc_fake_resolver_response_generator_ref( - grpc_fake_resolver_response_generator* generator); -void grpc_fake_resolver_response_generator_unref( - grpc_fake_resolver_response_generator* generator); - #endif /* GRPC_TEST_CORE_END2END_FAKE_RESOLVER_H */ diff --git a/test/core/end2end/fixtures/h2_census.c b/test/core/end2end/fixtures/h2_census.c index e8af03a52bd..97b27b2496a 100644 --- a/test/core/end2end/fixtures/h2_census.c +++ b/test/core/end2end/fixtures/h2_census.c @@ -42,10 +42,10 @@ #include #include #include "src/core/ext/filters/client_channel/client_channel.h" -#include "src/core/ext/filters/http/server/http_server_filter.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/connected_channel.h" +#include "src/core/lib/channel/http_server_filter.h" #include "src/core/lib/surface/channel.h" #include "src/core/lib/surface/server.h" #include "test/core/util/port.h" @@ -65,8 +65,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create_for_next(NULL); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); + f.cq = grpc_completion_queue_create(NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_compress.c b/test/core/end2end/fixtures/h2_compress.c index 49fcd9e9d30..8aec94d6019 100644 --- a/test/core/end2end/fixtures/h2_compress.c +++ b/test/core/end2end/fixtures/h2_compress.c @@ -42,10 +42,10 @@ #include #include #include "src/core/ext/filters/client_channel/client_channel.h" -#include "src/core/ext/filters/http/server/http_server_filter.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/connected_channel.h" +#include "src/core/lib/channel/http_server_filter.h" #include "src/core/lib/surface/channel.h" #include "src/core/lib/surface/server.h" #include "test/core/util/port.h" @@ -69,8 +69,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack_compression( memset(&f, 0, sizeof(f)); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create_for_next(NULL); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); + f.cq = grpc_completion_queue_create(NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_fakesec.c b/test/core/end2end/fixtures/h2_fakesec.c index 5969b110e69..c9747913c2f 100644 --- a/test/core/end2end/fixtures/h2_fakesec.c +++ b/test/core/end2end/fixtures/h2_fakesec.c @@ -60,8 +60,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create_for_next(NULL); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); + f.cq = grpc_completion_queue_create(NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_fd.c b/test/core/end2end/fixtures/h2_fd.c index 53888dbc5b6..223fadc386d 100644 --- a/test/core/end2end/fixtures/h2_fd.c +++ b/test/core/end2end/fixtures/h2_fd.c @@ -70,8 +70,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( grpc_end2end_test_fixture f; memset(&f, 0, sizeof(f)); f.fixture_data = fixture_data; - f.cq = grpc_completion_queue_create_for_next(NULL); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); + f.cq = grpc_completion_queue_create(NULL); create_sockets(fixture_data->fd_pair); diff --git a/test/core/end2end/fixtures/h2_full+pipe.c b/test/core/end2end/fixtures/h2_full+pipe.c index cee48af66f1..0191e59fc83 100644 --- a/test/core/end2end/fixtures/h2_full+pipe.c +++ b/test/core/end2end/fixtures/h2_full+pipe.c @@ -47,9 +47,9 @@ #include #include #include "src/core/ext/filters/client_channel/client_channel.h" -#include "src/core/ext/filters/http/server/http_server_filter.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/lib/channel/connected_channel.h" +#include "src/core/lib/channel/http_server_filter.h" #include "src/core/lib/iomgr/wakeup_fd_posix.h" #include "src/core/lib/surface/channel.h" #include "src/core/lib/surface/server.h" @@ -70,8 +70,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create_for_next(NULL); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); + f.cq = grpc_completion_queue_create(NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_full+trace.c b/test/core/end2end/fixtures/h2_full+trace.c index 57047bc57b9..9dbb27fc4b8 100644 --- a/test/core/end2end/fixtures/h2_full+trace.c +++ b/test/core/end2end/fixtures/h2_full+trace.c @@ -47,9 +47,9 @@ #include #include #include "src/core/ext/filters/client_channel/client_channel.h" -#include "src/core/ext/filters/http/server/http_server_filter.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/lib/channel/connected_channel.h" +#include "src/core/lib/channel/http_server_filter.h" #include "src/core/lib/support/env.h" #include "src/core/lib/surface/channel.h" #include "src/core/lib/surface/server.h" @@ -70,8 +70,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create_for_next(NULL); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); + f.cq = grpc_completion_queue_create(NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_full.c b/test/core/end2end/fixtures/h2_full.c index f18d314c1f6..49c62b34298 100644 --- a/test/core/end2end/fixtures/h2_full.c +++ b/test/core/end2end/fixtures/h2_full.c @@ -42,9 +42,9 @@ #include #include #include "src/core/ext/filters/client_channel/client_channel.h" -#include "src/core/ext/filters/http/server/http_server_filter.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/lib/channel/connected_channel.h" +#include "src/core/lib/channel/http_server_filter.h" #include "src/core/lib/surface/channel.h" #include "src/core/lib/surface/server.h" #include "test/core/util/port.h" @@ -64,8 +64,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create_for_next(NULL); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); + f.cq = grpc_completion_queue_create(NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_http_proxy.c b/test/core/end2end/fixtures/h2_http_proxy.c index aec874b1faf..62c435557d7 100644 --- a/test/core/end2end/fixtures/h2_http_proxy.c +++ b/test/core/end2end/fixtures/h2_http_proxy.c @@ -43,9 +43,9 @@ #include #include #include "src/core/ext/filters/client_channel/client_channel.h" -#include "src/core/ext/filters/http/server/http_server_filter.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/lib/channel/connected_channel.h" +#include "src/core/lib/channel/http_server_filter.h" #include "src/core/lib/support/env.h" #include "src/core/lib/surface/channel.h" #include "src/core/lib/surface/server.h" @@ -69,8 +69,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( ffd->proxy = grpc_end2end_http_proxy_create(); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create_for_next(NULL); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); + f.cq = grpc_completion_queue_create(NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_load_reporting.c b/test/core/end2end/fixtures/h2_load_reporting.c index 8e9c885759e..79f26ed2bc6 100644 --- a/test/core/end2end/fixtures/h2_load_reporting.c +++ b/test/core/end2end/fixtures/h2_load_reporting.c @@ -42,11 +42,11 @@ #include #include #include "src/core/ext/filters/client_channel/client_channel.h" -#include "src/core/ext/filters/http/server/http_server_filter.h" #include "src/core/ext/filters/load_reporting/load_reporting.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/connected_channel.h" +#include "src/core/lib/channel/http_server_filter.h" #include "src/core/lib/surface/channel.h" #include "src/core/lib/surface/server.h" #include "test/core/util/port.h" @@ -67,8 +67,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_load_reporting( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create_for_next(NULL); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); + f.cq = grpc_completion_queue_create(NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_oauth2.c b/test/core/end2end/fixtures/h2_oauth2.c index c94f1f6239c..33516528586 100644 --- a/test/core/end2end/fixtures/h2_oauth2.c +++ b/test/core/end2end/fixtures/h2_oauth2.c @@ -113,8 +113,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create_for_next(NULL); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); + f.cq = grpc_completion_queue_create(NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_proxy.c b/test/core/end2end/fixtures/h2_proxy.c index 3d33d5860d9..a10738fa0b4 100644 --- a/test/core/end2end/fixtures/h2_proxy.c +++ b/test/core/end2end/fixtures/h2_proxy.c @@ -42,9 +42,9 @@ #include #include #include "src/core/ext/filters/client_channel/client_channel.h" -#include "src/core/ext/filters/http/server/http_server_filter.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/lib/channel/connected_channel.h" +#include "src/core/lib/channel/http_server_filter.h" #include "src/core/lib/surface/channel.h" #include "src/core/lib/surface/server.h" #include "test/core/end2end/fixtures/proxy.h" @@ -79,8 +79,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( ffd->proxy = grpc_end2end_proxy_create(&proxy_def, client_args, server_args); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create_for_next(NULL); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); + f.cq = grpc_completion_queue_create(NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_sockpair+trace.c b/test/core/end2end/fixtures/h2_sockpair+trace.c index f3e12200f82..424241c1e47 100644 --- a/test/core/end2end/fixtures/h2_sockpair+trace.c +++ b/test/core/end2end/fixtures/h2_sockpair+trace.c @@ -46,11 +46,11 @@ #include #include #include "src/core/ext/filters/client_channel/client_channel.h" -#include "src/core/ext/filters/http/client/http_client_filter.h" -#include "src/core/ext/filters/http/message_compress/message_compress_filter.h" -#include "src/core/ext/filters/http/server/http_server_filter.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" +#include "src/core/lib/channel/compress_filter.h" #include "src/core/lib/channel/connected_channel.h" +#include "src/core/lib/channel/http_client_filter.h" +#include "src/core/lib/channel/http_server_filter.h" #include "src/core/lib/iomgr/endpoint_pair.h" #include "src/core/lib/iomgr/iomgr.h" #include "src/core/lib/support/env.h" @@ -94,8 +94,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( grpc_end2end_test_fixture f; memset(&f, 0, sizeof(f)); f.fixture_data = sfd; - f.cq = grpc_completion_queue_create_for_next(NULL); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); + f.cq = grpc_completion_queue_create(NULL); *sfd = grpc_iomgr_create_endpoint_pair("fixture", NULL); diff --git a/test/core/end2end/fixtures/h2_sockpair.c b/test/core/end2end/fixtures/h2_sockpair.c index 4e60d03a9c9..fe8d766e74e 100644 --- a/test/core/end2end/fixtures/h2_sockpair.c +++ b/test/core/end2end/fixtures/h2_sockpair.c @@ -41,11 +41,11 @@ #include #include #include "src/core/ext/filters/client_channel/client_channel.h" -#include "src/core/ext/filters/http/client/http_client_filter.h" -#include "src/core/ext/filters/http/message_compress/message_compress_filter.h" -#include "src/core/ext/filters/http/server/http_server_filter.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" +#include "src/core/lib/channel/compress_filter.h" #include "src/core/lib/channel/connected_channel.h" +#include "src/core/lib/channel/http_client_filter.h" +#include "src/core/lib/channel/http_server_filter.h" #include "src/core/lib/iomgr/endpoint_pair.h" #include "src/core/lib/iomgr/iomgr.h" #include "src/core/lib/surface/channel.h" @@ -88,8 +88,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( grpc_end2end_test_fixture f; memset(&f, 0, sizeof(f)); f.fixture_data = sfd; - f.cq = grpc_completion_queue_create_for_next(NULL); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); + f.cq = grpc_completion_queue_create(NULL); *sfd = grpc_iomgr_create_endpoint_pair("fixture", NULL); diff --git a/test/core/end2end/fixtures/h2_sockpair_1byte.c b/test/core/end2end/fixtures/h2_sockpair_1byte.c index 8714266655c..04174fa5015 100644 --- a/test/core/end2end/fixtures/h2_sockpair_1byte.c +++ b/test/core/end2end/fixtures/h2_sockpair_1byte.c @@ -41,11 +41,11 @@ #include #include #include "src/core/ext/filters/client_channel/client_channel.h" -#include "src/core/ext/filters/http/client/http_client_filter.h" -#include "src/core/ext/filters/http/message_compress/message_compress_filter.h" -#include "src/core/ext/filters/http/server/http_server_filter.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" +#include "src/core/lib/channel/compress_filter.h" #include "src/core/lib/channel/connected_channel.h" +#include "src/core/lib/channel/http_client_filter.h" +#include "src/core/lib/channel/http_server_filter.h" #include "src/core/lib/iomgr/endpoint_pair.h" #include "src/core/lib/iomgr/iomgr.h" #include "src/core/lib/surface/channel.h" @@ -88,8 +88,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( grpc_end2end_test_fixture f; memset(&f, 0, sizeof(f)); f.fixture_data = sfd; - f.cq = grpc_completion_queue_create_for_next(NULL); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); + f.cq = grpc_completion_queue_create(NULL); grpc_arg a[] = {{.key = GRPC_ARG_TCP_READ_CHUNK_SIZE, .type = GRPC_ARG_INTEGER, diff --git a/test/core/end2end/fixtures/h2_ssl.c b/test/core/end2end/fixtures/h2_ssl.c index c6a1ca09f83..cf44cd093c9 100644 --- a/test/core/end2end/fixtures/h2_ssl.c +++ b/test/core/end2end/fixtures/h2_ssl.c @@ -64,8 +64,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create_for_next(NULL); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); + f.cq = grpc_completion_queue_create(NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_ssl_cert.c b/test/core/end2end/fixtures/h2_ssl_cert.c index ba3956e8e3e..f62331eea3d 100644 --- a/test/core/end2end/fixtures/h2_ssl_cert.c +++ b/test/core/end2end/fixtures/h2_ssl_cert.c @@ -67,8 +67,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create_for_next(NULL); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); + f.cq = grpc_completion_queue_create(NULL); return f; } @@ -290,10 +289,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -312,7 +310,6 @@ static void end_test(grpc_end2end_test_fixture *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_fixture f, @@ -343,7 +340,7 @@ static void simple_request_body(grpc_end2end_test_fixture f, CQ_EXPECT_COMPLETION(cqv, tag(1), expected_result == SUCCESS); cq_verify(cqv); - grpc_call_unref(c); + grpc_call_destroy(c); cq_verifier_destroy(cqv); } diff --git a/test/core/end2end/fixtures/h2_ssl_proxy.c b/test/core/end2end/fixtures/h2_ssl_proxy.c index 9a6c9f558f1..740b075bf6d 100644 --- a/test/core/end2end/fixtures/h2_ssl_proxy.c +++ b/test/core/end2end/fixtures/h2_ssl_proxy.c @@ -100,8 +100,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( ffd->proxy = grpc_end2end_proxy_create(&proxy_def, client_args, server_args); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create_for_next(NULL); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); + f.cq = grpc_completion_queue_create(NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_uds.c b/test/core/end2end/fixtures/h2_uds.c index de1b8eb5dfd..7bde69d82a4 100644 --- a/test/core/end2end/fixtures/h2_uds.c +++ b/test/core/end2end/fixtures/h2_uds.c @@ -45,9 +45,9 @@ #include #include #include "src/core/ext/filters/client_channel/client_channel.h" -#include "src/core/ext/filters/http/server/http_server_filter.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/lib/channel/connected_channel.h" +#include "src/core/lib/channel/http_server_filter.h" #include "src/core/lib/support/string.h" #include "src/core/lib/surface/channel.h" #include "src/core/lib/surface/server.h" @@ -70,8 +70,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( unique++); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create_for_next(NULL); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); + f.cq = grpc_completion_queue_create(NULL); return f; } diff --git a/test/core/end2end/fixtures/http_proxy_fixture.c b/test/core/end2end/fixtures/http_proxy_fixture.c index f0d09487c62..451ed268d30 100644 --- a/test/core/end2end/fixtures/http_proxy_fixture.c +++ b/test/core/end2end/fixtures/http_proxy_fixture.c @@ -59,7 +59,6 @@ #include "src/core/lib/iomgr/sockaddr_utils.h" #include "src/core/lib/iomgr/tcp_client.h" #include "src/core/lib/iomgr/tcp_server.h" -#include "src/core/lib/iomgr/timer.h" #include "src/core/lib/slice/slice_internal.h" #include "test/core/util/port.h" @@ -70,7 +69,7 @@ struct grpc_end2end_http_proxy { grpc_channel_args* channel_args; gpr_mu* mu; grpc_pollset* pollset; - gpr_refcount users; + gpr_atm shutdown; }; // @@ -78,8 +77,6 @@ struct grpc_end2end_http_proxy { // typedef struct proxy_connection { - grpc_end2end_http_proxy* proxy; - grpc_endpoint* client_endpoint; grpc_endpoint* server_endpoint; @@ -106,20 +103,13 @@ typedef struct proxy_connection { grpc_http_request http_request; } proxy_connection; -static void proxy_connection_ref(proxy_connection* conn, const char* reason) { - gpr_ref(&conn->refcount); -} - // Helper function to destroy the proxy connection. static void proxy_connection_unref(grpc_exec_ctx* exec_ctx, - proxy_connection* conn, const char* reason) { + proxy_connection* conn) { if (gpr_unref(&conn->refcount)) { - gpr_log(GPR_DEBUG, "endpoints: %p %p", conn->client_endpoint, - conn->server_endpoint); grpc_endpoint_destroy(exec_ctx, conn->client_endpoint); - if (conn->server_endpoint != NULL) { + if (conn->server_endpoint != NULL) grpc_endpoint_destroy(exec_ctx, conn->server_endpoint); - } grpc_pollset_set_destroy(exec_ctx, conn->pollset_set); grpc_slice_buffer_destroy_internal(exec_ctx, &conn->client_read_buffer); grpc_slice_buffer_destroy_internal(exec_ctx, @@ -131,7 +121,6 @@ static void proxy_connection_unref(grpc_exec_ctx* exec_ctx, grpc_slice_buffer_destroy_internal(exec_ctx, &conn->server_write_buffer); grpc_http_parser_destroy(&conn->http_parser); grpc_http_request_destroy(&conn->http_request); - gpr_unref(&conn->proxy->users); gpr_free(conn); } } @@ -150,7 +139,7 @@ static void proxy_connection_failed(grpc_exec_ctx* exec_ctx, grpc_endpoint_shutdown(exec_ctx, conn->server_endpoint, GRPC_ERROR_REF(error)); } - proxy_connection_unref(exec_ctx, conn, "conn_failed"); + proxy_connection_unref(exec_ctx, conn); } // Callback for writing proxy data to the client. @@ -174,7 +163,7 @@ static void on_client_write_done(grpc_exec_ctx* exec_ctx, void* arg, &conn->on_client_write_done); } else { // No more writes. Unref the connection. - proxy_connection_unref(exec_ctx, conn, "write_done"); + proxy_connection_unref(exec_ctx, conn); } } @@ -199,7 +188,7 @@ static void on_server_write_done(grpc_exec_ctx* exec_ctx, void* arg, &conn->on_server_write_done); } else { // No more writes. Unref the connection. - proxy_connection_unref(exec_ctx, conn, "server_write"); + proxy_connection_unref(exec_ctx, conn); } } @@ -225,7 +214,7 @@ static void on_client_read_done(grpc_exec_ctx* exec_ctx, void* arg, } else { grpc_slice_buffer_move_into(&conn->client_read_buffer, &conn->server_write_buffer); - proxy_connection_ref(conn, "client_read"); + gpr_ref(&conn->refcount); grpc_endpoint_write(exec_ctx, conn->server_endpoint, &conn->server_write_buffer, &conn->on_server_write_done); @@ -257,7 +246,7 @@ static void on_server_read_done(grpc_exec_ctx* exec_ctx, void* arg, } else { grpc_slice_buffer_move_into(&conn->server_read_buffer, &conn->client_write_buffer); - proxy_connection_ref(conn, "server_read"); + gpr_ref(&conn->refcount); grpc_endpoint_write(exec_ctx, conn->client_endpoint, &conn->client_write_buffer, &conn->on_client_write_done); @@ -281,9 +270,7 @@ static void on_write_response_done(grpc_exec_ctx* exec_ctx, void* arg, // Start reading from both client and server. One of the read // requests inherits our ref to conn, but we need to take a new ref // for the other one. - proxy_connection_ref(conn, "client_read"); - proxy_connection_ref(conn, "server_read"); - proxy_connection_unref(exec_ctx, conn, "write_response"); + gpr_ref(&conn->refcount); grpc_endpoint_read(exec_ctx, conn->client_endpoint, &conn->client_read_buffer, &conn->on_client_read_done); grpc_endpoint_read(exec_ctx, conn->server_endpoint, &conn->server_read_buffer, @@ -325,8 +312,6 @@ static void on_server_connect_done(grpc_exec_ctx* exec_ctx, void* arg, static void on_read_request_done(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) { proxy_connection* conn = arg; - gpr_log(GPR_DEBUG, "on_read_request_done: %p %s", conn, - grpc_error_string(error)); if (error != GRPC_ERROR_NONE) { proxy_connection_failed(exec_ctx, conn, true /* is_client */, "HTTP proxy read request", error); @@ -391,14 +376,12 @@ static void on_accept(grpc_exec_ctx* exec_ctx, void* arg, gpr_free(acceptor); grpc_end2end_http_proxy* proxy = arg; // Instantiate proxy_connection. - proxy_connection* conn = gpr_zalloc(sizeof(*conn)); - gpr_ref(&proxy->users); + proxy_connection* conn = gpr_malloc(sizeof(*conn)); + memset(conn, 0, sizeof(*conn)); conn->client_endpoint = endpoint; - conn->proxy = proxy; gpr_ref_init(&conn->refcount, 1); conn->pollset_set = grpc_pollset_set_create(); grpc_pollset_set_add_pollset(exec_ctx, conn->pollset_set, proxy->pollset); - grpc_endpoint_add_to_pollset_set(exec_ctx, endpoint, conn->pollset_set); grpc_closure_init(&conn->on_read_request_done, on_read_request_done, conn, grpc_schedule_on_exec_ctx); grpc_closure_init(&conn->on_server_connect_done, on_server_connect_done, conn, @@ -433,7 +416,6 @@ static void thread_main(void* arg) { grpc_end2end_http_proxy* proxy = arg; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; do { - gpr_ref(&proxy->users); const gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC); const gpr_timespec deadline = gpr_time_add(now, gpr_time_from_seconds(1, GPR_TIMESPAN)); @@ -444,7 +426,7 @@ static void thread_main(void* arg) { grpc_pollset_work(&exec_ctx, proxy->pollset, &worker, now, deadline)); gpr_mu_unlock(proxy->mu); grpc_exec_ctx_flush(&exec_ctx); - } while (!gpr_unref(&proxy->users)); + } while (!gpr_atm_acq_load(&proxy->shutdown)); grpc_exec_ctx_finish(&exec_ctx); } @@ -452,7 +434,6 @@ grpc_end2end_http_proxy* grpc_end2end_http_proxy_create(void) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_end2end_http_proxy* proxy = gpr_malloc(sizeof(*proxy)); memset(proxy, 0, sizeof(*proxy)); - gpr_ref_init(&proxy->users, 1); // Construct proxy address. const int proxy_port = grpc_pick_unused_port_or_die(); gpr_join_host_port(&proxy->proxy_name, "localhost", proxy_port); @@ -493,16 +474,17 @@ static void destroy_pollset(grpc_exec_ctx* exec_ctx, void* arg, } void grpc_end2end_http_proxy_destroy(grpc_end2end_http_proxy* proxy) { - gpr_unref(&proxy->users); // Signal proxy thread to shutdown. + gpr_atm_rel_store(&proxy->shutdown, 1); // Signal proxy thread to shutdown. grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; gpr_thd_join(proxy->thd); grpc_tcp_server_shutdown_listeners(&exec_ctx, proxy->server); grpc_tcp_server_unref(&exec_ctx, proxy->server); gpr_free(proxy->proxy_name); grpc_channel_args_destroy(&exec_ctx, proxy->channel_args); - grpc_pollset_shutdown(&exec_ctx, proxy->pollset, - grpc_closure_create(destroy_pollset, proxy->pollset, - grpc_schedule_on_exec_ctx)); + grpc_closure destroyed; + grpc_closure_init(&destroyed, destroy_pollset, proxy->pollset, + grpc_schedule_on_exec_ctx); + grpc_pollset_shutdown(&exec_ctx, proxy->pollset, &destroyed); gpr_free(proxy); grpc_exec_ctx_finish(&exec_ctx); } diff --git a/test/core/end2end/fixtures/proxy.c b/test/core/end2end/fixtures/proxy.c index d660073ce65..cee053e8c56 100644 --- a/test/core/end2end/fixtures/proxy.c +++ b/test/core/end2end/fixtures/proxy.c @@ -104,7 +104,7 @@ grpc_end2end_proxy *grpc_end2end_proxy_create(const grpc_end2end_proxy_def *def, gpr_log(GPR_DEBUG, "PROXY ADDR:%s BACKEND:%s", proxy->proxy_port, proxy->server_port); - proxy->cq = grpc_completion_queue_create_for_next(NULL); + proxy->cq = grpc_completion_queue_create(NULL); proxy->server = def->create_server(proxy->proxy_port, server_args); proxy->client = def->create_client(proxy->server_port, client_args); @@ -148,8 +148,8 @@ void grpc_end2end_proxy_destroy(grpc_end2end_proxy *proxy) { static void unrefpc(proxy_call *pc, const char *reason) { if (gpr_unref(&pc->refs)) { - grpc_call_unref(pc->c2p); - grpc_call_unref(pc->p2s); + grpc_call_destroy(pc->c2p); + grpc_call_destroy(pc->p2s); grpc_metadata_array_destroy(&pc->c2p_initial_metadata); grpc_metadata_array_destroy(&pc->p2s_initial_metadata); grpc_metadata_array_destroy(&pc->p2s_trailing_metadata); diff --git a/test/core/end2end/fuzzers/api_fuzzer.c b/test/core/end2end/fuzzers/api_fuzzer.c index 88a0e301da1..a0acf5bf602 100644 --- a/test/core/end2end/fuzzers/api_fuzzer.c +++ b/test/core/end2end/fuzzers/api_fuzzer.c @@ -661,7 +661,7 @@ static void read_metadata(input_stream *inp, size_t *count, } static call_state *destroy_call(call_state *call) { - grpc_call_unref(call->call); + grpc_call_destroy(call->call); call->call = NULL; return maybe_delete_call_state(call); } @@ -735,7 +735,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { g_active_call = new_call(NULL, ROOT); g_resource_quota = grpc_resource_quota_create("api_fuzzer"); - grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL); + grpc_completion_queue *cq = grpc_completion_queue_create(NULL); while (!is_eof(&inp) || g_channel != NULL || g_server != NULL || pending_channel_watches > 0 || pending_pings > 0 || @@ -932,9 +932,6 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { } uint32_t propagation_mask = read_uint32(&inp); grpc_slice method = read_string_like_slice(&inp); - if (GRPC_SLICE_LENGTH(method) == 0) { - ok = false; - } grpc_slice host = read_string_like_slice(&inp); gpr_timespec deadline = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), @@ -970,7 +967,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { break; } grpc_op *ops = gpr_malloc(sizeof(grpc_op) * num_ops); - if (num_ops > 0) memset(ops, 0, sizeof(grpc_op) * num_ops); + memset(ops, 0, sizeof(grpc_op) * num_ops); bool ok = true; size_t i; grpc_op *op; diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/clusterfuzz-testcase-5867145026076672 b/test/core/end2end/fuzzers/api_fuzzer_corpus/clusterfuzz-testcase-5867145026076672 deleted file mode 100644 index 3fd5427b466..00000000000 Binary files a/test/core/end2end/fuzzers/api_fuzzer_corpus/clusterfuzz-testcase-5867145026076672 and /dev/null differ diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/clusterfuzz-testcase-6462055064272896 b/test/core/end2end/fuzzers/api_fuzzer_corpus/clusterfuzz-testcase-6462055064272896 deleted file mode 100644 index c1212832425..00000000000 Binary files a/test/core/end2end/fuzzers/api_fuzzer_corpus/clusterfuzz-testcase-6462055064272896 and /dev/null differ diff --git a/test/core/end2end/fuzzers/client_fuzzer.c b/test/core/end2end/fuzzers/client_fuzzer.c index 6f49baffd2c..e7e7dbefd03 100644 --- a/test/core/end2end/fuzzers/client_fuzzer.c +++ b/test/core/end2end/fuzzers/client_fuzzer.c @@ -65,7 +65,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { grpc_mock_endpoint_create(discard_write, resource_quota); grpc_resource_quota_unref_internal(&exec_ctx, resource_quota); - grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL); + grpc_completion_queue *cq = grpc_completion_queue_create(NULL); grpc_transport *transport = grpc_create_chttp2_transport(&exec_ctx, NULL, mock_endpoint, 1); grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL); @@ -151,7 +151,7 @@ done: ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), NULL); GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN); } - grpc_call_unref(call); + grpc_call_destroy(call); grpc_completion_queue_destroy(cq); grpc_metadata_array_destroy(&initial_metadata_recv); grpc_metadata_array_destroy(&trailing_metadata_recv); diff --git a/test/core/end2end/fuzzers/hpack.dictionary b/test/core/end2end/fuzzers/hpack.dictionary index 2bb9de34c56..6b967854191 100644 --- a/test/core/end2end/fuzzers/hpack.dictionary +++ b/test/core/end2end/fuzzers/hpack.dictionary @@ -10,15 +10,14 @@ "\x10grpc-payload-bin" "\x0Dgrpc-encoding" "\x14grpc-accept-encoding" -"\x15grpc-server-stats-bin" -"\x0Dgrpc-tags-bin" -"\x0Egrpc-trace-bin" "\x0Ccontent-type" "\x1Egrpc-internal-encoding-request" "\x0Auser-agent" "\x04host" "\x08lb-token" "\x0Cgrpc-timeout" +"\x10grpc-tracing-bin" +"\x0Egrpc-stats-bin" "\x00" "\x13grpc.wait_for_ready" "\x0Cgrpc.timeout" @@ -77,7 +76,6 @@ "\x08if-range" "\x13if-unmodified-since" "\x0Dlast-modified" -"\x0Blb-cost-bin" "\x04link" "\x08location" "\x0Cmax-forwards" @@ -154,7 +152,6 @@ "\x00\x13if-unmodified-since\x00" "\x00\x0Dlast-modified\x00" "\x00\x08lb-token\x00" -"\x00\x0Blb-cost-bin\x00" "\x00\x04link\x00" "\x00\x08location\x00" "\x00\x0Cmax-forwards\x00" diff --git a/test/core/end2end/fuzzers/server_fuzzer.c b/test/core/end2end/fuzzers/server_fuzzer.c index 6d65fe1847b..186542d4b2d 100644 --- a/test/core/end2end/fuzzers/server_fuzzer.c +++ b/test/core/end2end/fuzzers/server_fuzzer.c @@ -67,7 +67,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { grpc_slice_from_copied_buffer((const char *)data, size)); grpc_server *server = grpc_server_create(NULL, NULL); - grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL); + grpc_completion_queue *cq = grpc_completion_queue_create(NULL); grpc_server_register_completion_queue(server, cq, NULL); // TODO(ctiller): add registered methods (one for POST, one for PUT) // void *registered_method = @@ -109,7 +109,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { } done: - if (call1 != NULL) grpc_call_unref(call1); + if (call1 != NULL) grpc_call_destroy(call1); grpc_call_details_destroy(&call_details1); grpc_metadata_array_destroy(&request_metadata1); grpc_server_shutdown_and_notify(server, cq, tag(0xdead)); diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/clusterfuzz-testcase-5595941564317696 b/test/core/end2end/fuzzers/server_fuzzer_corpus/clusterfuzz-testcase-5595941564317696 deleted file mode 100644 index 335ce87196f..00000000000 Binary files a/test/core/end2end/fuzzers/server_fuzzer_corpus/clusterfuzz-testcase-5595941564317696 and /dev/null differ diff --git a/test/core/end2end/gen_build_yaml.py b/test/core/end2end/gen_build_yaml.py index 48e57205395..d1e510d6362 100755 --- a/test/core/end2end/gen_build_yaml.py +++ b/test/core/end2end/gen_build_yaml.py @@ -39,9 +39,9 @@ import hashlib FixtureOptions = collections.namedtuple( 'FixtureOptions', - 'fullstack includes_proxy dns_resolver secure platforms ci_mac tracing exclude_configs exclude_iomgrs large_writes enables_compression') + 'fullstack includes_proxy dns_resolver secure platforms ci_mac tracing exclude_configs exclude_iomgrs large_writes') default_unsecure_fixture_options = FixtureOptions( - True, False, True, False, ['windows', 'linux', 'mac', 'posix'], True, False, [], [], True, False) + True, False, True, False, ['windows', 'linux', 'mac', 'posix'], True, False, [], [], True) socketpair_unsecure_fixture_options = default_unsecure_fixture_options._replace(fullstack=False, dns_resolver=False) default_secure_fixture_options = default_unsecure_fixture_options._replace(secure=True) uds_fixture_options = default_unsecure_fixture_options._replace(dns_resolver=False, platforms=['linux', 'mac', 'posix'], exclude_iomgrs=['uv']) @@ -51,7 +51,8 @@ fd_unsecure_fixture_options = default_unsecure_fixture_options._replace( # maps fixture name to whether it requires the security library END2END_FIXTURES = { - 'h2_compress': default_unsecure_fixture_options._replace(enables_compression=True), + 'h2_compress': default_unsecure_fixture_options, + 'h2_census': default_unsecure_fixture_options, 'h2_load_reporting': default_unsecure_fixture_options, 'h2_fakesec': default_secure_fixture_options._replace(ci_mac=False), @@ -82,8 +83,8 @@ END2END_FIXTURES = { TestOptions = collections.namedtuple( 'TestOptions', - 'needs_fullstack needs_dns proxyable secure traceable cpu_cost exclude_iomgrs large_writes flaky allow_compression') -default_test_options = TestOptions(False, False, True, False, True, 1.0, [], False, False, True) + 'needs_fullstack needs_dns proxyable secure traceable cpu_cost exclude_iomgrs large_writes flaky') +default_test_options = TestOptions(False, False, True, False, True, 1.0, [], False, False) connectivity_test_options = default_test_options._replace(needs_fullstack=True) LOWCPU = 0.1 @@ -93,13 +94,12 @@ END2END_TESTS = { 'authority_not_supported': default_test_options, 'bad_hostname': default_test_options, 'bad_ping': connectivity_test_options._replace(proxyable=False), - 'binary_metadata': default_test_options._replace(cpu_cost=LOWCPU), + 'binary_metadata': default_test_options, 'resource_quota_server': default_test_options._replace(large_writes=True, - proxyable=False, - allow_compression=False), + proxyable=False), 'call_creds': default_test_options._replace(secure=True), 'cancel_after_accept': default_test_options._replace(cpu_cost=LOWCPU), - 'cancel_after_client_done': default_test_options._replace(cpu_cost=LOWCPU), + 'cancel_after_client_done': default_test_options, 'cancel_after_invoke': default_test_options._replace(cpu_cost=LOWCPU), 'cancel_before_invoke': default_test_options._replace(cpu_cost=LOWCPU), 'cancel_in_a_vacuum': default_test_options._replace(cpu_cost=LOWCPU), @@ -110,49 +110,46 @@ END2END_TESTS = { 'default_host': default_test_options._replace(needs_fullstack=True, needs_dns=True), 'disappearing_server': connectivity_test_options._replace(flaky=True), - 'empty_batch': default_test_options._replace(cpu_cost=LOWCPU), - 'filter_causes_close': default_test_options._replace(cpu_cost=LOWCPU), + 'empty_batch': default_test_options, + 'filter_causes_close': default_test_options, 'filter_call_init_fails': default_test_options, - 'filter_latency': default_test_options._replace(cpu_cost=LOWCPU), + 'filter_latency': default_test_options, 'graceful_server_shutdown': default_test_options._replace(cpu_cost=LOWCPU), 'hpack_size': default_test_options._replace(proxyable=False, - traceable=False, - cpu_cost=LOWCPU), - 'high_initial_seqno': default_test_options._replace(cpu_cost=LOWCPU), + traceable=False), + 'high_initial_seqno': default_test_options, 'idempotent_request': default_test_options, 'invoke_large_request': default_test_options, - 'keepalive_timeout': default_test_options._replace(proxyable=False, - cpu_cost=LOWCPU), + 'keepalive_timeout': default_test_options._replace(proxyable=False), 'large_metadata': default_test_options, - 'max_concurrent_streams': default_test_options._replace( - proxyable=False, cpu_cost=LOWCPU), - 'max_connection_age': default_test_options._replace(cpu_cost=LOWCPU), + 'max_concurrent_streams': default_test_options._replace(proxyable=False), + 'max_connection_age': default_test_options, 'max_connection_idle': connectivity_test_options._replace( - proxyable=False, exclude_iomgrs=['uv'], cpu_cost=LOWCPU), - 'max_message_length': default_test_options._replace(cpu_cost=LOWCPU), + proxyable=False, exclude_iomgrs=['uv']), + 'max_message_length': default_test_options, 'negative_deadline': default_test_options, - 'network_status_change': default_test_options._replace(cpu_cost=LOWCPU), + 'network_status_change': default_test_options, 'no_logging': default_test_options._replace(traceable=False), 'no_op': default_test_options, 'payload': default_test_options, 'load_reporting_hook': default_test_options, - 'ping_pong_streaming': default_test_options._replace(cpu_cost=LOWCPU), - 'ping': connectivity_test_options._replace(proxyable=False, cpu_cost=LOWCPU), + 'ping_pong_streaming': default_test_options, + 'ping': connectivity_test_options._replace(proxyable=False), 'registered_call': default_test_options, 'request_with_flags': default_test_options._replace( proxyable=False, cpu_cost=LOWCPU), - 'request_with_payload': default_test_options._replace(cpu_cost=LOWCPU), - 'server_finishes_request': default_test_options._replace(cpu_cost=LOWCPU), - 'shutdown_finishes_calls': default_test_options._replace(cpu_cost=LOWCPU), - 'shutdown_finishes_tags': default_test_options._replace(cpu_cost=LOWCPU), - 'simple_cacheable_request': default_test_options._replace(cpu_cost=LOWCPU), + 'request_with_payload': default_test_options, + 'server_finishes_request': default_test_options, + 'shutdown_finishes_calls': default_test_options, + 'shutdown_finishes_tags': default_test_options, + 'simple_cacheable_request': default_test_options, 'simple_delayed_request': connectivity_test_options, 'simple_metadata': default_test_options, 'simple_request': default_test_options, - 'streaming_error_response': default_test_options._replace(cpu_cost=LOWCPU), + 'streaming_error_response': default_test_options, 'trailing_metadata': default_test_options, - 'write_buffering': default_test_options._replace(cpu_cost=LOWCPU), - 'write_buffering_at_end': default_test_options._replace(cpu_cost=LOWCPU), + 'write_buffering': default_test_options, + 'write_buffering_at_end': default_test_options, } @@ -172,9 +169,6 @@ def compatible(f, t): if END2END_TESTS[t].large_writes: if not END2END_FIXTURES[f].large_writes: return False - if not END2END_TESTS[t].allow_compression: - if END2END_FIXTURES[f].enables_compression: - return False return True diff --git a/test/core/end2end/goaway_server_test.c b/test/core/end2end/goaway_server_test.c index ababdb70a80..22d93b321a6 100644 --- a/test/core/end2end/goaway_server_test.c +++ b/test/core/end2end/goaway_server_test.c @@ -129,7 +129,7 @@ int main(int argc, char **argv) { grpc_metadata_array_init(&request_metadata2); grpc_call_details_init(&request_details2); - cq = grpc_completion_queue_create_for_next(NULL); + cq = grpc_completion_queue_create(NULL); cqv = cq_verifier_create(cq); /* reserve two ports */ @@ -302,10 +302,10 @@ int main(int argc, char **argv) { CQ_EXPECT_COMPLETION(cqv, tag(0xdead2), 1); cq_verify(cqv); - grpc_call_unref(call1); - grpc_call_unref(call2); - grpc_call_unref(server_call1); - grpc_call_unref(server_call2); + grpc_call_destroy(call1); + grpc_call_destroy(call2); + grpc_call_destroy(server_call1); + grpc_call_destroy(server_call2); grpc_server_destroy(server1); grpc_server_destroy(server2); grpc_channel_destroy(chan); diff --git a/test/core/end2end/invalid_call_argument_test.c b/test/core/end2end/invalid_call_argument_test.c index e9a31f278c7..bfd8e6fefa3 100644 --- a/test/core/end2end/invalid_call_argument_test.c +++ b/test/core/end2end/invalid_call_argument_test.c @@ -75,7 +75,7 @@ static void prepare_test(int is_client) { grpc_metadata_array_init(&g_state.initial_metadata_recv); grpc_metadata_array_init(&g_state.trailing_metadata_recv); g_state.deadline = grpc_timeout_seconds_to_deadline(2); - g_state.cq = grpc_completion_queue_create_for_next(NULL); + g_state.cq = grpc_completion_queue_create(NULL); g_state.cqv = cq_verifier_create(g_state.cq); g_state.details = grpc_empty_slice(); memset(g_state.ops, 0, sizeof(g_state.ops)); @@ -125,8 +125,7 @@ static void prepare_test(int is_client) { } static void cleanup_test() { - grpc_completion_queue *shutdown_cq; - grpc_call_unref(g_state.call); + grpc_call_destroy(g_state.call); cq_verifier_destroy(g_state.cqv); grpc_channel_destroy(g_state.chan); grpc_slice_unref(g_state.details); @@ -134,14 +133,12 @@ static void cleanup_test() { grpc_metadata_array_destroy(&g_state.trailing_metadata_recv); if (!g_state.is_client) { - shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); - grpc_call_unref(g_state.server_call); - grpc_server_shutdown_and_notify(g_state.server, shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000), + grpc_call_destroy(g_state.server_call); + grpc_server_shutdown_and_notify(g_state.server, g_state.cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck(g_state.cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); - grpc_completion_queue_destroy(shutdown_cq); grpc_server_destroy(g_state.server); grpc_call_details_destroy(&g_state.call_details); grpc_metadata_array_destroy(&g_state.server_initial_metadata_recv); diff --git a/test/core/end2end/multiple_server_queues_test.c b/test/core/end2end/multiple_server_queues_test.c index 4696ecd813c..5e2eaf4ae94 100644 --- a/test/core/end2end/multiple_server_queues_test.c +++ b/test/core/end2end/multiple_server_queues_test.c @@ -37,50 +37,27 @@ int main(int argc, char **argv) { grpc_completion_queue *cq1; grpc_completion_queue *cq2; - grpc_completion_queue *cq3; - grpc_completion_queue_attributes attr; - grpc_server *server; grpc_test_init(argc, argv); grpc_init(); - - attr.version = 1; - attr.cq_completion_type = GRPC_CQ_NEXT; - attr.cq_polling_type = GRPC_CQ_DEFAULT_POLLING; - cq1 = grpc_completion_queue_create( - grpc_completion_queue_factory_lookup(&attr), &attr, NULL); - - attr.cq_polling_type = GRPC_CQ_NON_LISTENING; - cq2 = grpc_completion_queue_create( - grpc_completion_queue_factory_lookup(&attr), &attr, NULL); - - attr.cq_polling_type = GRPC_CQ_NON_POLLING; - cq3 = grpc_completion_queue_create( - grpc_completion_queue_factory_lookup(&attr), &attr, NULL); - + cq1 = grpc_completion_queue_create(NULL); + cq2 = grpc_completion_queue_create(NULL); server = grpc_server_create(NULL, NULL); grpc_server_register_completion_queue(server, cq1, NULL); grpc_server_add_insecure_http2_port(server, "[::]:0"); grpc_server_register_completion_queue(server, cq2, NULL); - grpc_server_register_completion_queue(server, cq3, NULL); - grpc_server_start(server); grpc_server_shutdown_and_notify(server, cq2, NULL); grpc_completion_queue_next(cq2, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); /* cue queue hang */ grpc_completion_queue_shutdown(cq1); grpc_completion_queue_shutdown(cq2); - grpc_completion_queue_shutdown(cq3); - grpc_completion_queue_next(cq1, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); grpc_completion_queue_next(cq2, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); - grpc_completion_queue_next(cq3, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); - grpc_server_destroy(server); grpc_completion_queue_destroy(cq1); grpc_completion_queue_destroy(cq2); - grpc_completion_queue_destroy(cq3); grpc_shutdown(); return 0; } diff --git a/test/core/end2end/no_server_test.c b/test/core/end2end/no_server_test.c index a479d5c868a..26d26d8f7a7 100644 --- a/test/core/end2end/no_server_test.c +++ b/test/core/end2end/no_server_test.c @@ -59,7 +59,7 @@ int main(int argc, char **argv) { grpc_metadata_array_init(&trailing_metadata_recv); - cq = grpc_completion_queue_create_for_next(NULL); + cq = grpc_completion_queue_create(NULL); cqv = cq_verifier_create(cq); /* create a call, channel to a non existant server */ @@ -97,7 +97,7 @@ int main(int argc, char **argv) { .type != GRPC_QUEUE_SHUTDOWN) ; grpc_completion_queue_destroy(cq); - grpc_call_unref(call); + grpc_call_destroy(call); grpc_channel_destroy(chan); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/authority_not_supported.c b/test/core/end2end/tests/authority_not_supported.c index 13cda086173..192a20d4007 100644 --- a/test/core/end2end/tests/authority_not_supported.c +++ b/test/core/end2end/tests/authority_not_supported.c @@ -74,10 +74,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -96,7 +95,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Request/response with metadata and payload.*/ @@ -182,7 +180,7 @@ static void test_with_authority_header(grpc_end2end_test_config config) { grpc_metadata_array_destroy(&initial_metadata_recv); grpc_metadata_array_destroy(&trailing_metadata_recv); - grpc_call_unref(c); + grpc_call_destroy(c); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/bad_hostname.c b/test/core/end2end/tests/bad_hostname.c index 35a531cf785..c63c9c78ada 100644 --- a/test/core/end2end/tests/bad_hostname.c +++ b/test/core/end2end/tests/bad_hostname.c @@ -76,10 +76,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -98,7 +97,6 @@ static void end_test(grpc_end2end_test_fixture *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_fixture f) { @@ -163,7 +161,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); + grpc_call_destroy(c); cq_verifier_destroy(cqv); } diff --git a/test/core/end2end/tests/bad_ping.c b/test/core/end2end/tests/bad_ping.c index 0928ba60cf9..01a6aeaa04f 100644 --- a/test/core/end2end/tests/bad_ping.c +++ b/test/core/end2end/tests/bad_ping.c @@ -75,7 +75,6 @@ static void end_test(grpc_end2end_test_fixture *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 test_bad_ping(grpc_end2end_test_config config) { @@ -208,7 +207,7 @@ static void test_bad_ping(grpc_end2end_test_config config) { CQ_EXPECT_COMPLETION(cqv, tag(0xdead), 1); cq_verify(cqv); - grpc_call_unref(s); + grpc_call_destroy(s); // The connection should be closed immediately after the misbehaved pings, // the in-progress RPC should fail. @@ -224,7 +223,7 @@ static void test_bad_ping(grpc_end2end_test_config config) { 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_destroy(c); cq_verifier_destroy(cqv); end_test(&f); config.tear_down_data(&f); diff --git a/test/core/end2end/tests/binary_metadata.c b/test/core/end2end/tests/binary_metadata.c index 3d36849400a..9cb17c9d429 100644 --- a/test/core/end2end/tests/binary_metadata.c +++ b/test/core/end2end/tests/binary_metadata.c @@ -74,10 +74,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -96,7 +95,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Request/response with metadata and payload.*/ @@ -314,8 +312,8 @@ static void test_request_response_with_metadata_and_payload( grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/call_creds.c b/test/core/end2end/tests/call_creds.c index bc430e56b33..d65073fbbe0 100644 --- a/test/core/end2end/tests/call_creds.c +++ b/test/core/end2end/tests/call_creds.c @@ -92,10 +92,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -114,7 +113,6 @@ static void end_test(grpc_end2end_test_fixture *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 print_auth_context(int is_client, const grpc_auth_context *ctx) { @@ -347,8 +345,8 @@ static void request_response_with_payload_and_call_creds( grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); @@ -473,7 +471,7 @@ static void test_request_with_server_rejecting_client_creds( grpc_byte_buffer_destroy(response_payload_recv); grpc_slice_unref(details); - grpc_call_unref(c); + grpc_call_destroy(c); cq_verifier_destroy(cqv); end_test(&f); diff --git a/test/core/end2end/tests/cancel_after_accept.c b/test/core/end2end/tests/cancel_after_accept.c index e6bcd9d6a30..bda061ccb84 100644 --- a/test/core/end2end/tests/cancel_after_accept.c +++ b/test/core/end2end/tests/cancel_after_accept.c @@ -81,10 +81,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -103,7 +102,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Cancel after accept, no payload */ @@ -252,8 +250,8 @@ static void test_cancel_after_accept(grpc_end2end_test_config config, grpc_byte_buffer_destroy(response_payload_recv); grpc_slice_unref(details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); if (args != NULL) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; diff --git a/test/core/end2end/tests/cancel_after_client_done.c b/test/core/end2end/tests/cancel_after_client_done.c index d0e68354d9f..0e7291116fe 100644 --- a/test/core/end2end/tests/cancel_after_client_done.c +++ b/test/core/end2end/tests/cancel_after_client_done.c @@ -75,10 +75,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -97,7 +96,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Cancel after accept with a writes closed, no payload */ @@ -229,8 +227,8 @@ static void test_cancel_after_accept_and_writes_closed( grpc_byte_buffer_destroy(response_payload_recv); grpc_slice_unref(details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); end_test(&f); diff --git a/test/core/end2end/tests/cancel_after_invoke.c b/test/core/end2end/tests/cancel_after_invoke.c index 5bc9ed283bb..0ee59806fe1 100644 --- a/test/core/end2end/tests/cancel_after_invoke.c +++ b/test/core/end2end/tests/cancel_after_invoke.c @@ -49,12 +49,11 @@ 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, cancellation_mode mode, - size_t test_ops, grpc_channel_args *client_args, grpc_channel_args *server_args) { grpc_end2end_test_fixture f; - gpr_log(GPR_INFO, "Running test: %s/%s/%s [%" PRIdPTR " ops]", test_name, - config.name, mode.name, test_ops); + gpr_log(GPR_INFO, "Running test: %s/%s/%s", test_name, config.name, + mode.name); f = config.create_fixture(client_args, server_args); config.init_server(&f, server_args); config.init_client(&f, client_args); @@ -79,10 +78,9 @@ static void drain_cq(grpc_completion_queue *cq) { static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); - grpc_event ev = grpc_completion_queue_next( - f->cq, grpc_timeout_seconds_to_deadline(5), NULL); - GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); - GPR_ASSERT(ev.tag == tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) + .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; } @@ -100,7 +98,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Cancel after invoke, no payload */ @@ -109,8 +106,8 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config, grpc_op ops[6]; grpc_op *op; grpc_call *c; - grpc_end2end_test_fixture f = begin_test(config, "test_cancel_after_invoke", - mode, test_ops, NULL, NULL); + grpc_end2end_test_fixture f = + begin_test(config, "test_cancel_after_invoke", mode, NULL, NULL); cq_verifier *cqv = cq_verifier_create(f.cq); grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; @@ -190,7 +187,7 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config, grpc_byte_buffer_destroy(response_payload_recv); grpc_slice_unref(details); - grpc_call_unref(c); + grpc_call_destroy(c); cq_verifier_destroy(cqv); end_test(&f); diff --git a/test/core/end2end/tests/cancel_before_invoke.c b/test/core/end2end/tests/cancel_before_invoke.c index 67d2e9b8abc..7d53091a1a7 100644 --- a/test/core/end2end/tests/cancel_before_invoke.c +++ b/test/core/end2end/tests/cancel_before_invoke.c @@ -74,10 +74,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -96,7 +95,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Cancel before invoke */ @@ -186,7 +184,7 @@ static void test_cancel_before_invoke(grpc_end2end_test_config config, grpc_byte_buffer_destroy(response_payload_recv); grpc_slice_unref(details); - grpc_call_unref(c); + grpc_call_destroy(c); cq_verifier_destroy(cqv); end_test(&f); diff --git a/test/core/end2end/tests/cancel_in_a_vacuum.c b/test/core/end2end/tests/cancel_in_a_vacuum.c index 1235cef2dce..c13fc88c532 100644 --- a/test/core/end2end/tests/cancel_in_a_vacuum.c +++ b/test/core/end2end/tests/cancel_in_a_vacuum.c @@ -75,10 +75,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -97,7 +96,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Cancel and do nothing */ @@ -118,7 +116,7 @@ static void test_cancel_in_a_vacuum(grpc_end2end_test_config config, GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c, NULL)); - grpc_call_unref(c); + grpc_call_destroy(c); cq_verifier_destroy(v_client); end_test(&f); diff --git a/test/core/end2end/tests/cancel_with_status.c b/test/core/end2end/tests/cancel_with_status.c index e8259f99f11..1e0e33b4e2f 100644 --- a/test/core/end2end/tests/cancel_with_status.c +++ b/test/core/end2end/tests/cancel_with_status.c @@ -77,10 +77,9 @@ static void drain_cq(grpc_completion_queue *cq) { static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); - grpc_event ev = grpc_completion_queue_next( - f->cq, grpc_timeout_seconds_to_deadline(5), NULL); - GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); - GPR_ASSERT(ev.tag == tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) + .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; } @@ -98,7 +97,6 @@ static void end_test(grpc_end2end_test_fixture *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, @@ -165,7 +163,7 @@ static void simple_request_body(grpc_end2end_test_config config, grpc_metadata_array_destroy(&initial_metadata_recv); grpc_metadata_array_destroy(&trailing_metadata_recv); - grpc_call_unref(c); + grpc_call_destroy(c); cq_verifier_destroy(cqv); } diff --git a/test/core/end2end/tests/compressed_payload.c b/test/core/end2end/tests/compressed_payload.c index 1fe8613adbe..c5b750af528 100644 --- a/test/core/end2end/tests/compressed_payload.c +++ b/test/core/end2end/tests/compressed_payload.c @@ -82,10 +82,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -104,7 +103,6 @@ static void end_test(grpc_end2end_test_fixture *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 request_for_disabled_algorithm( @@ -261,8 +259,8 @@ static void request_for_disabled_algorithm( grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); @@ -519,8 +517,8 @@ static void request_with_payload_template( grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/connectivity.c b/test/core/end2end/tests/connectivity.c index eb84aaed16b..979419a100a 100644 --- a/test/core/end2end/tests/connectivity.c +++ b/test/core/end2end/tests/connectivity.c @@ -171,9 +171,6 @@ static void test_connectivity(grpc_end2end_test_config config) { grpc_channel_destroy(f.client); grpc_completion_queue_shutdown(f.cq); grpc_completion_queue_destroy(f.cq); - - /* shutdown_cq is not used in this test */ - grpc_completion_queue_destroy(f.shutdown_cq); config.tear_down_data(&f); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/default_host.c b/test/core/end2end/tests/default_host.c index efd26829327..8dccca20c7c 100644 --- a/test/core/end2end/tests/default_host.c +++ b/test/core/end2end/tests/default_host.c @@ -76,10 +76,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -98,7 +97,6 @@ static void end_test(grpc_end2end_test_fixture *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_fixture f) { @@ -214,8 +212,8 @@ static void simple_request_body(grpc_end2end_test_fixture f) { grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); } diff --git a/test/core/end2end/tests/disappearing_server.c b/test/core/end2end/tests/disappearing_server.c index 23016f9ee5c..e2b888a3bbd 100644 --- a/test/core/end2end/tests/disappearing_server.c +++ b/test/core/end2end/tests/disappearing_server.c @@ -79,9 +79,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - - /* Note: shutdown_cq was unused in this test */ - grpc_completion_queue_destroy(f->shutdown_cq); } static void do_request_and_shutdown_server(grpc_end2end_test_config config, @@ -191,8 +188,8 @@ static void do_request_and_shutdown_server(grpc_end2end_test_config config, grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); } static void disappearing_server_test(grpc_end2end_test_config config) { diff --git a/test/core/end2end/tests/empty_batch.c b/test/core/end2end/tests/empty_batch.c index d0971367a67..37ca81384f3 100644 --- a/test/core/end2end/tests/empty_batch.c +++ b/test/core/end2end/tests/empty_batch.c @@ -76,10 +76,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -98,7 +97,6 @@ static void end_test(grpc_end2end_test_fixture *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 empty_batch_body(grpc_end2end_test_config config, @@ -121,7 +119,7 @@ static void empty_batch_body(grpc_end2end_test_config config, CQ_EXPECT_COMPLETION(cqv, tag(1), 1); cq_verify(cqv); - grpc_call_unref(c); + grpc_call_destroy(c); cq_verifier_destroy(cqv); } diff --git a/test/core/end2end/tests/filter_call_init_fails.c b/test/core/end2end/tests/filter_call_init_fails.c index 3402584fd9a..0c4f0dd42fe 100644 --- a/test/core/end2end/tests/filter_call_init_fails.c +++ b/test/core/end2end/tests/filter_call_init_fails.c @@ -84,10 +84,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -106,7 +105,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } // Simple request via a SERVER_CHANNEL filter that always fails to @@ -194,7 +192,7 @@ static void test_server_channel_filter(grpc_end2end_test_config config) { grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); + grpc_call_destroy(c); cq_verifier_destroy(cqv); @@ -284,7 +282,7 @@ static void test_client_channel_filter(grpc_end2end_test_config config) { grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); + grpc_call_destroy(c); cq_verifier_destroy(cqv); @@ -372,7 +370,7 @@ static void test_client_subchannel_filter(grpc_end2end_test_config config) { // Reset and create a new call. (The first call uses a different code // path in client_channel.c than subsequent calls on the same channel, // and we need to test both.) - grpc_call_unref(c); + grpc_call_destroy(c); status = GRPC_STATUS_OK; grpc_slice_unref(details); details = grpc_empty_slice(); @@ -399,7 +397,7 @@ static void test_client_subchannel_filter(grpc_end2end_test_config config) { grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); + grpc_call_destroy(c); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/filter_causes_close.c b/test/core/end2end/tests/filter_causes_close.c index ede8fb49df0..9115823a743 100644 --- a/test/core/end2end/tests/filter_causes_close.c +++ b/test/core/end2end/tests/filter_causes_close.c @@ -79,10 +79,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -101,7 +100,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Simple request via a server filter that always closes the stream.*/ @@ -189,7 +187,7 @@ static void test_request(grpc_end2end_test_config config) { grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); + grpc_call_destroy(c); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/filter_latency.c b/test/core/end2end/tests/filter_latency.c index 7d2614a0676..d38ce22e09b 100644 --- a/test/core/end2end/tests/filter_latency.c +++ b/test/core/end2end/tests/filter_latency.c @@ -86,10 +86,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -108,7 +107,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } // Simple request via a server filter that saves the reported latency value. @@ -228,8 +226,8 @@ static void test_request(grpc_end2end_test_config config) { grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(s); - grpc_call_unref(c); + grpc_call_destroy(s); + grpc_call_destroy(c); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/graceful_server_shutdown.c b/test/core/end2end/tests/graceful_server_shutdown.c index 37ac33818f4..182bb207805 100644 --- a/test/core/end2end/tests/graceful_server_shutdown.c +++ b/test/core/end2end/tests/graceful_server_shutdown.c @@ -91,8 +91,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - /* Note: shutdown_cq is not used in this test */ - grpc_completion_queue_destroy(f->shutdown_cq); } static void test_early_server_shutdown_finishes_inflight_calls( @@ -192,7 +190,7 @@ static void test_early_server_shutdown_finishes_inflight_calls( CQ_EXPECT_COMPLETION(cqv, tag(1), 1); cq_verify(cqv); - grpc_call_unref(s); + grpc_call_destroy(s); GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED); GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo")); @@ -206,7 +204,7 @@ static void test_early_server_shutdown_finishes_inflight_calls( grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); + grpc_call_destroy(c); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/high_initial_seqno.c b/test/core/end2end/tests/high_initial_seqno.c index 893fdd68621..f534a19c872 100644 --- a/test/core/end2end/tests/high_initial_seqno.c +++ b/test/core/end2end/tests/high_initial_seqno.c @@ -78,10 +78,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -100,7 +99,6 @@ static void end_test(grpc_end2end_test_fixture *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, @@ -205,8 +203,8 @@ static void simple_request_body(grpc_end2end_test_config config, grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); /* TODO(ctiller): this rate limits the test, and it should be removed when retry has been implemented; until then cross-thread chatter diff --git a/test/core/end2end/tests/hpack_size.c b/test/core/end2end/tests/hpack_size.c index b1db58271e5..17ef204ce94 100644 --- a/test/core/end2end/tests/hpack_size.c +++ b/test/core/end2end/tests/hpack_size.c @@ -218,10 +218,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -240,7 +239,6 @@ static void end_test(grpc_end2end_test_fixture *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, @@ -358,8 +356,8 @@ static void simple_request_body(grpc_end2end_test_config config, grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); } diff --git a/test/core/end2end/tests/idempotent_request.c b/test/core/end2end/tests/idempotent_request.c index 1ea2ac47742..f80654db1a2 100644 --- a/test/core/end2end/tests/idempotent_request.c +++ b/test/core/end2end/tests/idempotent_request.c @@ -76,10 +76,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -98,7 +97,6 @@ static void end_test(grpc_end2end_test_fixture *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, @@ -219,8 +217,8 @@ static void simple_request_body(grpc_end2end_test_config config, grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); } diff --git a/test/core/end2end/tests/invoke_large_request.c b/test/core/end2end/tests/invoke_large_request.c index a49cf4f3d72..f4b93d9873f 100644 --- a/test/core/end2end/tests/invoke_large_request.c +++ b/test/core/end2end/tests/invoke_large_request.c @@ -71,10 +71,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -93,7 +92,6 @@ static void end_test(grpc_end2end_test_fixture *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 grpc_slice large_slice(void) { @@ -258,8 +256,8 @@ static void test_invoke_large_request(grpc_end2end_test_config config, grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/keepalive_timeout.c b/test/core/end2end/tests/keepalive_timeout.c index ceefe5db8e3..bf6ca0d9d94 100644 --- a/test/core/end2end/tests/keepalive_timeout.c +++ b/test/core/end2end/tests/keepalive_timeout.c @@ -78,9 +78,8 @@ static void drain_cq(grpc_completion_queue *cq) { 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_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000), five_seconds_from_now(), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); @@ -100,7 +99,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Client sends a request, server replies with a payload, then waits for the @@ -190,6 +188,8 @@ static void test_keepalive_timeout(grpc_end2end_test_config config) { GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); + cq_verify(cqv); + CQ_EXPECT_COMPLETION(cqv, tag(1), 1); cq_verify(cqv); @@ -223,8 +223,8 @@ static void test_keepalive_timeout(grpc_end2end_test_config config) { grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/large_metadata.c b/test/core/end2end/tests/large_metadata.c index dd796889dbc..a670e411e9c 100644 --- a/test/core/end2end/tests/large_metadata.c +++ b/test/core/end2end/tests/large_metadata.c @@ -74,10 +74,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -96,7 +95,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } // Request with a large amount of metadata. @@ -246,8 +244,8 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) { grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/load_reporting_hook.c b/test/core/end2end/tests/load_reporting_hook.c index 5f671405c27..ea3dd2368be 100644 --- a/test/core/end2end/tests/load_reporting_hook.c +++ b/test/core/end2end/tests/load_reporting_hook.c @@ -101,10 +101,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -123,13 +122,13 @@ static void end_test(grpc_end2end_test_fixture *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 request_response_with_payload( grpc_end2end_test_config config, grpc_end2end_test_fixture f, const char *method_name, const char *request_msg, const char *response_msg, - grpc_metadata *initial_lr_metadata, grpc_metadata *trailing_lr_metadata) { + grpc_metadata *initial_lr_metadata, + grpc_load_reporting_cost_context *cost_ctx) { grpc_slice request_payload_slice = grpc_slice_from_static_string(request_msg); grpc_slice response_payload_slice = grpc_slice_from_static_string(response_msg); @@ -242,9 +241,8 @@ static void request_response_with_payload( op->reserved = NULL; op++; op->op = GRPC_OP_SEND_STATUS_FROM_SERVER; - GPR_ASSERT(trailing_lr_metadata != NULL); - op->data.send_status_from_server.trailing_metadata_count = 1; - op->data.send_status_from_server.trailing_metadata = trailing_lr_metadata; + GPR_ASSERT(cost_ctx != NULL); + grpc_call_set_load_reporting_cost_context(s, cost_ctx); op->data.send_status_from_server.status = GRPC_STATUS_OK; grpc_slice status_details = grpc_slice_from_static_string("xyz"); op->data.send_status_from_server.status_details = &status_details; @@ -266,8 +264,8 @@ static void request_response_with_payload( grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); @@ -298,21 +296,21 @@ static void test_load_reporting_hook(grpc_end2end_test_config config) { const char *response_msg = "... and the response from the server"; grpc_metadata initial_lr_metadata; - grpc_metadata trailing_lr_metadata; initial_lr_metadata.key = GRPC_MDSTR_LB_TOKEN; initial_lr_metadata.value = grpc_slice_from_static_string("client-token"); memset(&initial_lr_metadata.internal_data, 0, sizeof(initial_lr_metadata.internal_data)); - trailing_lr_metadata.key = GRPC_MDSTR_LB_COST_BIN; - trailing_lr_metadata.value = grpc_slice_from_static_string("server-token"); - memset(&trailing_lr_metadata.internal_data, 0, - sizeof(trailing_lr_metadata.internal_data)); + grpc_load_reporting_cost_context *cost_ctx = gpr_malloc(sizeof(*cost_ctx)); + memset(cost_ctx, 0, sizeof(*cost_ctx)); + cost_ctx->values_count = 1; + cost_ctx->values = + gpr_malloc(sizeof(*cost_ctx->values) * cost_ctx->values_count); + cost_ctx->values[0] = grpc_slice_from_static_string("cost-token"); request_response_with_payload(config, f, method_name, request_msg, - response_msg, &initial_lr_metadata, - &trailing_lr_metadata); + response_msg, &initial_lr_metadata, cost_ctx); end_test(&f); { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; diff --git a/test/core/end2end/tests/max_concurrent_streams.c b/test/core/end2end/tests/max_concurrent_streams.c index 8ec92e476a3..2360138ede3 100644 --- a/test/core/end2end/tests/max_concurrent_streams.c +++ b/test/core/end2end/tests/max_concurrent_streams.c @@ -74,10 +74,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -96,7 +95,6 @@ static void end_test(grpc_end2end_test_fixture *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, @@ -201,8 +199,8 @@ static void simple_request_body(grpc_end2end_test_config config, grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); } @@ -433,10 +431,10 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { cq_verifier_destroy(cqv); - grpc_call_unref(c1); - grpc_call_unref(s1); - grpc_call_unref(c2); - grpc_call_unref(s2); + grpc_call_destroy(c1); + grpc_call_destroy(s1); + grpc_call_destroy(c2); + grpc_call_destroy(s2); grpc_slice_unref(details1); grpc_slice_unref(details2); @@ -628,10 +626,10 @@ static void test_max_concurrent_streams_with_timeout_on_first( cq_verifier_destroy(cqv); - grpc_call_unref(c1); - grpc_call_unref(s1); - grpc_call_unref(c2); - grpc_call_unref(s2); + grpc_call_destroy(c1); + grpc_call_destroy(s1); + grpc_call_destroy(c2); + grpc_call_destroy(s2); grpc_slice_unref(details1); grpc_slice_unref(details2); @@ -789,7 +787,7 @@ static void test_max_concurrent_streams_with_timeout_on_second( /* second request is finished because of time out, so destroy the second call */ - grpc_call_unref(c2); + grpc_call_destroy(c2); /* now reply the first call */ memset(ops, 0, sizeof(ops)); @@ -821,8 +819,8 @@ static void test_max_concurrent_streams_with_timeout_on_second( cq_verifier_destroy(cqv); - grpc_call_unref(c1); - grpc_call_unref(s1); + grpc_call_destroy(c1); + grpc_call_destroy(s1); grpc_slice_unref(details1); grpc_slice_unref(details2); diff --git a/test/core/end2end/tests/max_connection_age.c b/test/core/end2end/tests/max_connection_age.c index c470dcda692..04bdb39445f 100644 --- a/test/core/end2end/tests/max_connection_age.c +++ b/test/core/end2end/tests/max_connection_age.c @@ -89,7 +89,6 @@ static void end_test(grpc_end2end_test_fixture *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 test_max_age_forcibly_close(grpc_end2end_test_config config) { @@ -214,7 +213,7 @@ static void test_max_age_forcibly_close(grpc_end2end_test_config config) { CQ_EXPECT_COMPLETION(cqv, tag(0xdead), true); cq_verify(cqv); - grpc_call_unref(s); + grpc_call_destroy(s); /* The connection should be closed immediately after the max age grace period, the in-progress RPC should fail. */ @@ -230,7 +229,7 @@ static void test_max_age_forcibly_close(grpc_end2end_test_config config) { 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_destroy(c); cq_verifier_destroy(cqv); end_test(&f); config.tear_down_data(&f); @@ -352,7 +351,7 @@ static void test_max_age_gracefully_close(grpc_end2end_test_config config) { CQ_EXPECT_COMPLETION(cqv, tag(0xdead), true); cq_verify(cqv); - grpc_call_unref(s); + grpc_call_destroy(s); /* The connection is closed gracefully with goaway, the rpc should still be completed. */ @@ -368,7 +367,7 @@ static void test_max_age_gracefully_close(grpc_end2end_test_config config) { 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_destroy(c); cq_verifier_destroy(cqv); end_test(&f); config.tear_down_data(&f); diff --git a/test/core/end2end/tests/max_connection_idle.c b/test/core/end2end/tests/max_connection_idle.c index 488d945123a..98bc08c6d5a 100644 --- a/test/core/end2end/tests/max_connection_idle.c +++ b/test/core/end2end/tests/max_connection_idle.c @@ -175,8 +175,8 @@ static void simple_request_body(grpc_end2end_test_config config, grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); } @@ -242,7 +242,6 @@ static void test_max_connection_idle(grpc_end2end_test_config config) { grpc_completion_queue_shutdown(f.cq); drain_cq(f.cq); grpc_completion_queue_destroy(f.cq); - grpc_completion_queue_destroy(f.shutdown_cq); config.tear_down_data(&f); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/max_message_length.c b/test/core/end2end/tests/max_message_length.c index f65edab8657..a8b6f1f79a9 100644 --- a/test/core/end2end/tests/max_message_length.c +++ b/test/core/end2end/tests/max_message_length.c @@ -83,10 +83,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -105,7 +104,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } // Test with request larger than the limit. @@ -289,8 +287,8 @@ done: grpc_byte_buffer_destroy(request_payload); grpc_byte_buffer_destroy(recv_payload); - grpc_call_unref(c); - if (s != NULL) grpc_call_unref(s); + grpc_call_destroy(c); + if (s != NULL) grpc_call_destroy(s); cq_verifier_destroy(cqv); @@ -483,8 +481,8 @@ static void test_max_message_length_on_response(grpc_end2end_test_config config, grpc_byte_buffer_destroy(response_payload); grpc_byte_buffer_destroy(recv_payload); - grpc_call_unref(c); - if (s != NULL) grpc_call_unref(s); + grpc_call_destroy(c); + if (s != NULL) grpc_call_destroy(s); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/negative_deadline.c b/test/core/end2end/tests/negative_deadline.c index 113b650a974..e7448bd6bc8 100644 --- a/test/core/end2end/tests/negative_deadline.c +++ b/test/core/end2end/tests/negative_deadline.c @@ -76,10 +76,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -98,7 +97,6 @@ static void end_test(grpc_end2end_test_fixture *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, @@ -162,7 +160,7 @@ static void simple_request_body(grpc_end2end_test_config config, grpc_metadata_array_destroy(&initial_metadata_recv); grpc_metadata_array_destroy(&trailing_metadata_recv); - grpc_call_unref(c); + grpc_call_destroy(c); cq_verifier_destroy(cqv); } diff --git a/test/core/end2end/tests/network_status_change.c b/test/core/end2end/tests/network_status_change.c index 1ea4be81b1e..1a5f2b25cc2 100644 --- a/test/core/end2end/tests/network_status_change.c +++ b/test/core/end2end/tests/network_status_change.c @@ -77,10 +77,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -99,7 +98,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Client sends a request with payload, server reads then returns status. */ @@ -231,8 +229,8 @@ static void test_invoke_network_status_change(grpc_end2end_test_config config) { grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/no_logging.c b/test/core/end2end/tests/no_logging.c index 17b6886f2cb..683d6465db9 100644 --- a/test/core/end2end/tests/no_logging.c +++ b/test/core/end2end/tests/no_logging.c @@ -104,10 +104,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -126,7 +125,6 @@ static void end_test(grpc_end2end_test_fixture *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, @@ -244,8 +242,8 @@ static void simple_request_body(grpc_end2end_test_config config, grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); } diff --git a/test/core/end2end/tests/no_op.c b/test/core/end2end/tests/no_op.c index 0d98fc9c0a6..698d8fbc607 100644 --- a/test/core/end2end/tests/no_op.c +++ b/test/core/end2end/tests/no_op.c @@ -74,10 +74,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -96,7 +95,6 @@ static void end_test(grpc_end2end_test_fixture *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 test_no_op(grpc_end2end_test_config config) { diff --git a/test/core/end2end/tests/payload.c b/test/core/end2end/tests/payload.c index 3f25ecb8ff6..5751b801b5d 100644 --- a/test/core/end2end/tests/payload.c +++ b/test/core/end2end/tests/payload.c @@ -74,10 +74,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -96,7 +95,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Creates and returns a grpc_slice containing random alphanumeric characters. @@ -261,8 +259,8 @@ static void request_response_with_payload(grpc_end2end_test_config config, grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/ping.c b/test/core/end2end/tests/ping.c index 027c17ea4c9..c51c4993e25 100644 --- a/test/core/end2end/tests/ping.c +++ b/test/core/end2end/tests/ping.c @@ -112,9 +112,6 @@ static void test_ping(grpc_end2end_test_config config, grpc_channel_destroy(f.client); grpc_completion_queue_shutdown(f.cq); grpc_completion_queue_destroy(f.cq); - - /* f.shutdown_cq is not used in this test */ - grpc_completion_queue_destroy(f.shutdown_cq); config.tear_down_data(&f); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/ping_pong_streaming.c b/test/core/end2end/tests/ping_pong_streaming.c index 598e45ee33f..cd81ce24feb 100644 --- a/test/core/end2end/tests/ping_pong_streaming.c +++ b/test/core/end2end/tests/ping_pong_streaming.c @@ -74,10 +74,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -96,7 +95,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Client pings and server pongs. Repeat messages rounds before finishing. */ @@ -265,8 +263,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, CQ_EXPECT_COMPLETION(cqv, tag(104), 1); cq_verify(cqv); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/registered_call.c b/test/core/end2end/tests/registered_call.c index 7e07a7129c2..242add37cb8 100644 --- a/test/core/end2end/tests/registered_call.c +++ b/test/core/end2end/tests/registered_call.c @@ -76,10 +76,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -98,7 +97,6 @@ static void end_test(grpc_end2end_test_fixture *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, @@ -200,8 +198,8 @@ static void simple_request_body(grpc_end2end_test_config config, grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); } diff --git a/test/core/end2end/tests/request_with_flags.c b/test/core/end2end/tests/request_with_flags.c index daf15fa5f72..10ecf5b1af5 100644 --- a/test/core/end2end/tests/request_with_flags.c +++ b/test/core/end2end/tests/request_with_flags.c @@ -75,10 +75,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -97,7 +96,6 @@ static void end_test(grpc_end2end_test_fixture *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 test_invoke_request_with_flags( @@ -179,7 +177,7 @@ static void test_invoke_request_with_flags( grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); + grpc_call_destroy(c); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/request_with_payload.c b/test/core/end2end/tests/request_with_payload.c index 43686d58abe..4eb3399bb95 100644 --- a/test/core/end2end/tests/request_with_payload.c +++ b/test/core/end2end/tests/request_with_payload.c @@ -74,10 +74,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -96,7 +95,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Client sends a request with payload, server reads then returns status. */ @@ -226,8 +224,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/resource_quota_server.c b/test/core/end2end/tests/resource_quota_server.c index 2453ca1b89b..4d3ce1c937c 100644 --- a/test/core/end2end/tests/resource_quota_server.c +++ b/test/core/end2end/tests/resource_quota_server.c @@ -74,10 +74,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -96,7 +95,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Creates and returns a grpc_slice containing random alphanumeric characters. @@ -205,7 +203,7 @@ void resource_quota_server(grpc_end2end_test_config config) { op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; - op->flags = GRPC_INITIAL_METADATA_WAIT_FOR_READY; + op->flags = 0; op->reserved = NULL; op++; op->op = GRPC_OP_SEND_MESSAGE; @@ -270,7 +268,7 @@ void resource_quota_server(grpc_end2end_test_config config) { grpc_metadata_array_destroy(&initial_metadata_recv[call_id]); grpc_metadata_array_destroy(&trailing_metadata_recv[call_id]); - grpc_call_unref(client_calls[call_id]); + grpc_call_destroy(client_calls[call_id]); grpc_slice_unref(details[call_id]); pending_client_calls--; @@ -352,7 +350,7 @@ void resource_quota_server(grpc_end2end_test_config config) { GPR_ASSERT(pending_server_end_calls > 0); pending_server_end_calls--; - grpc_call_unref(server_calls[call_id]); + grpc_call_destroy(server_calls[call_id]); } } diff --git a/test/core/end2end/tests/server_finishes_request.c b/test/core/end2end/tests/server_finishes_request.c index be0901bfdd8..88bc90e7788 100644 --- a/test/core/end2end/tests/server_finishes_request.c +++ b/test/core/end2end/tests/server_finishes_request.c @@ -76,10 +76,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -98,7 +97,6 @@ static void end_test(grpc_end2end_test_fixture *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, @@ -199,8 +197,8 @@ static void simple_request_body(grpc_end2end_test_config config, grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); } diff --git a/test/core/end2end/tests/shutdown_finishes_calls.c b/test/core/end2end/tests/shutdown_finishes_calls.c index d19af1a74df..6f9421d19a7 100644 --- a/test/core/end2end/tests/shutdown_finishes_calls.c +++ b/test/core/end2end/tests/shutdown_finishes_calls.c @@ -84,8 +84,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - /* f->shutdown_cq is not used in this test */ - grpc_completion_queue_destroy(f->shutdown_cq); } static void test_early_server_shutdown_finishes_inflight_calls( @@ -186,8 +184,8 @@ static void test_early_server_shutdown_finishes_inflight_calls( grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/shutdown_finishes_tags.c b/test/core/end2end/tests/shutdown_finishes_tags.c index 008f72e6f48..51a242337f1 100644 --- a/test/core/end2end/tests/shutdown_finishes_tags.c +++ b/test/core/end2end/tests/shutdown_finishes_tags.c @@ -84,8 +84,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - /* f->shutdown_cq is not used in this test */ - grpc_completion_queue_destroy(f->shutdown_cq); } static void test_early_server_shutdown_finishes_tags( diff --git a/test/core/end2end/tests/simple_cacheable_request.c b/test/core/end2end/tests/simple_cacheable_request.c index cc0f89c422e..4f1013a0300 100644 --- a/test/core/end2end/tests/simple_cacheable_request.c +++ b/test/core/end2end/tests/simple_cacheable_request.c @@ -76,10 +76,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -98,7 +97,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Request/response with metadata and payload.*/ @@ -274,8 +272,8 @@ static void test_cacheable_request_response_with_metadata_and_payload( grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/simple_delayed_request.c b/test/core/end2end/tests/simple_delayed_request.c index 9e938f86a6c..978dff0dc0e 100644 --- a/test/core/end2end/tests/simple_delayed_request.c +++ b/test/core/end2end/tests/simple_delayed_request.c @@ -62,10 +62,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -84,7 +83,6 @@ static void end_test(grpc_end2end_test_fixture *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_delayed_request_body(grpc_end2end_test_config config, @@ -195,8 +193,8 @@ static void simple_delayed_request_body(grpc_end2end_test_config config, grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); } diff --git a/test/core/end2end/tests/simple_metadata.c b/test/core/end2end/tests/simple_metadata.c index 08679a588a2..83d1037e4bc 100644 --- a/test/core/end2end/tests/simple_metadata.c +++ b/test/core/end2end/tests/simple_metadata.c @@ -74,10 +74,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -96,7 +95,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Request/response with metadata and payload.*/ @@ -266,8 +264,8 @@ static void test_request_response_with_metadata_and_payload( grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/simple_request.c b/test/core/end2end/tests/simple_request.c index 45c717363bf..31bfef4cc24 100644 --- a/test/core/end2end/tests/simple_request.c +++ b/test/core/end2end/tests/simple_request.c @@ -76,10 +76,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -98,7 +97,6 @@ static void end_test(grpc_end2end_test_fixture *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, @@ -219,8 +217,8 @@ static void simple_request_body(grpc_end2end_test_config config, grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); } diff --git a/test/core/end2end/tests/streaming_error_response.c b/test/core/end2end/tests/streaming_error_response.c index e59675a6550..c652d9469d5 100644 --- a/test/core/end2end/tests/streaming_error_response.c +++ b/test/core/end2end/tests/streaming_error_response.c @@ -79,10 +79,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -101,7 +100,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Client sends a request with payload, server reads then returns status. */ @@ -184,9 +182,6 @@ static void test(grpc_end2end_test_config config, bool request_status_early) { GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); - if (!request_status_early) { - CQ_EXPECT_COMPLETION(cqv, tag(1), 1); - } cq_verify(cqv); memset(ops, 0, sizeof(ops)); @@ -198,6 +193,9 @@ static void test(grpc_end2end_test_config config, bool request_status_early) { GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(103), 1); + if (!request_status_early) { + CQ_EXPECT_COMPLETION(cqv, tag(1), 1); + } cq_verify(cqv); memset(ops, 0, sizeof(ops)); @@ -263,8 +261,8 @@ static void test(grpc_end2end_test_config config, bool request_status_early) { grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/trailing_metadata.c b/test/core/end2end/tests/trailing_metadata.c index ca8eb6389e6..3cbffdfe754 100644 --- a/test/core/end2end/tests/trailing_metadata.c +++ b/test/core/end2end/tests/trailing_metadata.c @@ -74,10 +74,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -96,7 +95,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Request/response with metadata and payload.*/ @@ -276,8 +274,8 @@ static void test_request_response_with_metadata_and_payload( grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/write_buffering.c b/test/core/end2end/tests/write_buffering.c index f8f2102e67a..2d4142b97d3 100644 --- a/test/core/end2end/tests/write_buffering.c +++ b/test/core/end2end/tests/write_buffering.c @@ -74,10 +74,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -96,7 +95,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Client sends a request with payload, server reads then returns status. */ @@ -274,8 +272,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/write_buffering_at_end.c b/test/core/end2end/tests/write_buffering_at_end.c index 2facd9c1a4a..e61343e6842 100644 --- a/test/core/end2end/tests/write_buffering_at_end.c +++ b/test/core/end2end/tests/write_buffering_at_end.c @@ -74,10 +74,9 @@ static void drain_cq(grpc_completion_queue *cq) { 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), - NULL) + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -96,7 +95,6 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Client sends a request with payload, server reads then returns status. */ @@ -265,8 +263,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); - grpc_call_unref(c); - grpc_call_unref(s); + grpc_call_destroy(c); + grpc_call_destroy(s); cq_verifier_destroy(cqv); diff --git a/test/core/fling/client.c b/test/core/fling/client.c index 3c43f4311c3..85bab6d431b 100644 --- a/test/core/fling/client.c +++ b/test/core/fling/client.c @@ -99,7 +99,7 @@ static void step_ping_pong_request(void) { (size_t)(op - ops), (void *)1, NULL)); grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); - grpc_call_unref(call); + grpc_call_destroy(call); grpc_byte_buffer_destroy(response_payload_recv); call = NULL; GPR_TIMER_END("ping_pong", 1); @@ -208,7 +208,7 @@ int main(int argc, char **argv) { } channel = grpc_insecure_channel_create(target, NULL, NULL); - cq = grpc_completion_queue_create_for_next(NULL); + cq = grpc_completion_queue_create(NULL); the_buffer = grpc_raw_byte_buffer_create(&slice, (size_t)payload_size); histogram = gpr_histogram_create(0.01, 60e9); @@ -233,7 +233,7 @@ int main(int argc, char **argv) { grpc_profiler_stop(); if (call) { - grpc_call_unref(call); + grpc_call_destroy(call); } grpc_channel_destroy(channel); diff --git a/test/core/fling/server.c b/test/core/fling/server.c index a927e9014ad..7ea54b1167e 100644 --- a/test/core/fling/server.c +++ b/test/core/fling/server.c @@ -185,7 +185,6 @@ int main(int argc, char **argv) { call_state *s; char *addr_buf = NULL; gpr_cmdline *cl; - grpc_completion_queue *shutdown_cq; int shutdown_started = 0; int shutdown_finished = 0; @@ -215,7 +214,7 @@ int main(int argc, char **argv) { } gpr_log(GPR_INFO, "creating server on: %s", addr); - cq = grpc_completion_queue_create_for_next(NULL); + cq = grpc_completion_queue_create(NULL); if (secure) { grpc_ssl_pem_key_cert_pair pem_key_cert_pair = {test_server1_key, test_server1_cert}; @@ -243,16 +242,10 @@ int main(int argc, char **argv) { while (!shutdown_finished) { if (got_sigint && !shutdown_started) { gpr_log(GPR_INFO, "Shutting down due to SIGINT"); - - shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); - grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000)); - - GPR_ASSERT( - grpc_completion_queue_pluck(shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), NULL) - .type == GRPC_OP_COMPLETE); - grpc_completion_queue_destroy(shutdown_cq); - + grpc_server_shutdown_and_notify(server, cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) + .type == GRPC_OP_COMPLETE); grpc_completion_queue_shutdown(cq); shutdown_started = 1; } @@ -301,7 +294,7 @@ int main(int argc, char **argv) { break; case FLING_SERVER_SEND_STATUS_FOR_STREAMING: /* Send status and close completed at server */ - grpc_call_unref(call); + grpc_call_destroy(call); if (!shutdown_started) request_call(); break; case FLING_SERVER_READ_FOR_UNARY: @@ -314,7 +307,7 @@ int main(int argc, char **argv) { /* Finished unary call. */ grpc_byte_buffer_destroy(payload_buffer); payload_buffer = NULL; - grpc_call_unref(call); + grpc_call_destroy(call); if (!shutdown_started) request_call(); break; } diff --git a/test/core/handshake/client_ssl.c b/test/core/handshake/client_ssl.c index f7fa919cd45..f291d09493b 100644 --- a/test/core/handshake/client_ssl.c +++ b/test/core/handshake/client_ssl.c @@ -289,8 +289,7 @@ static bool client_ssl_test(char *server_alpn_preferred) { // completed and we know that the client's ALPN list satisfied the server. int retries = 10; grpc_connectivity_state state = GRPC_CHANNEL_IDLE; - grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL); - + grpc_completion_queue *cq = grpc_completion_queue_create(NULL); while (state != GRPC_CHANNEL_READY && retries-- > 0) { grpc_channel_watch_connectivity_state( channel, state, grpc_timeout_seconds_to_deadline(3), cq, NULL); diff --git a/test/core/handshake/server_ssl.c b/test/core/handshake/server_ssl.c index 30f6474b3fb..e568a370145 100644 --- a/test/core/handshake/server_ssl.c +++ b/test/core/handshake/server_ssl.c @@ -104,7 +104,7 @@ static void server_thread(void *arg) { GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, ssl_creds)); free(addr); - grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL); + grpc_completion_queue *cq = grpc_completion_queue_create(NULL); grpc_server_register_completion_queue(server, cq, NULL); grpc_server_start(server); diff --git a/test/core/iomgr/udp_server_test.c b/test/core/iomgr/udp_server_test.c index 1f1696a7a7a..12d84063239 100644 --- a/test/core/iomgr/udp_server_test.c +++ b/test/core/iomgr/udp_server_test.c @@ -91,7 +91,7 @@ static void on_write(grpc_exec_ctx *exec_ctx, grpc_fd *emfd, void *user_data) { } static void on_fd_orphaned(grpc_exec_ctx *exec_ctx, grpc_fd *emfd, - grpc_closure *closure, void *user_data) { + void *user_data) { gpr_log(GPR_INFO, "gRPC FD about to be orphaned: %d", grpc_fd_wrapped_fd(emfd)); g_number_of_orphan_calls++; @@ -228,9 +228,9 @@ static void test_no_op_with_port_and_start(void) { grpc_udp_server_destroy(&exec_ctx, s, NULL); grpc_exec_ctx_finish(&exec_ctx); - /* The server had a single FD, which is orphaned exactly once in * - * grpc_udp_server_destroy. */ - GPR_ASSERT(g_number_of_orphan_calls == 1); + /* The server had a single FD, which is orphaned once in * + * deactivated_all_ports, and once in grpc_udp_server_destroy. */ + GPR_ASSERT(g_number_of_orphan_calls == 2); } static void test_receive(int number_of_clients) { @@ -297,9 +297,9 @@ static void test_receive(int number_of_clients) { grpc_udp_server_destroy(&exec_ctx, s, NULL); grpc_exec_ctx_finish(&exec_ctx); - /* The server had a single FD, which is orphaned exactly once in * - * grpc_udp_server_destroy. */ - GPR_ASSERT(g_number_of_orphan_calls == 1); + /* The server had a single FD, which is orphaned once in * + * deactivated_all_ports, and once in grpc_udp_server_destroy. */ + GPR_ASSERT(g_number_of_orphan_calls == 2); /* The write callback should have fired a few times. */ GPR_ASSERT(g_number_of_writes > 0); diff --git a/test/core/memory_usage/client.c b/test/core/memory_usage/client.c index ee68399988b..51ea51bc12f 100644 --- a/test/core/memory_usage/client.c +++ b/test/core/memory_usage/client.c @@ -120,7 +120,7 @@ static void finish_ping_pong_request(int call_idx) { grpc_metadata_array_destroy(&calls[call_idx].initial_metadata_recv); grpc_metadata_array_destroy(&calls[call_idx].trailing_metadata_recv); grpc_slice_unref(calls[call_idx].details); - grpc_call_unref(calls[call_idx].call); + grpc_call_destroy(calls[call_idx].call); calls[call_idx].call = NULL; } @@ -187,7 +187,7 @@ static struct grpc_memory_counters send_snapshot_request(int call_idx, grpc_byte_buffer_destroy(response_payload_recv); grpc_slice_unref(calls[call_idx].details); calls[call_idx].details = grpc_empty_slice(); - grpc_call_unref(calls[call_idx].call); + grpc_call_destroy(calls[call_idx].call); calls[call_idx].call = NULL; return snapshot; @@ -223,7 +223,7 @@ int main(int argc, char **argv) { calls[k].details = grpc_empty_slice(); } - cq = grpc_completion_queue_create_for_next(NULL); + cq = grpc_completion_queue_create(NULL); struct grpc_memory_counters client_channel_start = grpc_memory_counters_snapshot(); diff --git a/test/core/memory_usage/server.c b/test/core/memory_usage/server.c index 1c70f5eac0d..ab059c25b8b 100644 --- a/test/core/memory_usage/server.c +++ b/test/core/memory_usage/server.c @@ -161,7 +161,6 @@ int main(int argc, char **argv) { grpc_event ev; char *addr_buf = NULL; gpr_cmdline *cl; - grpc_completion_queue *shutdown_cq; int shutdown_started = 0; int shutdown_finished = 0; @@ -189,7 +188,7 @@ int main(int argc, char **argv) { } gpr_log(GPR_INFO, "creating server on: %s", addr); - cq = grpc_completion_queue_create_for_next(NULL); + cq = grpc_completion_queue_create(NULL); struct grpc_memory_counters before_server_create = grpc_memory_counters_snapshot(); @@ -231,14 +230,10 @@ int main(int argc, char **argv) { while (!shutdown_finished) { if (got_sigint && !shutdown_started) { gpr_log(GPR_INFO, "Shutting down due to SIGINT"); - - shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); - grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000)); - GPR_ASSERT( - grpc_completion_queue_pluck(shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), NULL) - .type == GRPC_OP_COMPLETE); - grpc_completion_queue_destroy(shutdown_cq); + grpc_server_shutdown_and_notify(server, cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) + .type == GRPC_OP_COMPLETE); grpc_completion_queue_shutdown(cq); shutdown_started = 1; } @@ -286,7 +281,7 @@ int main(int argc, char **argv) { case FLING_SERVER_WAIT_FOR_DESTROY: break; case FLING_SERVER_SEND_STATUS_FLING_CALL: - grpc_call_unref(s->call); + grpc_call_destroy(s->call); grpc_call_details_destroy(&s->call_details); grpc_metadata_array_destroy(&s->initial_metadata_send); grpc_metadata_array_destroy(&s->request_metadata_recv); @@ -304,7 +299,7 @@ int main(int argc, char **argv) { case FLING_SERVER_SEND_STATUS_SNAPSHOT: grpc_byte_buffer_destroy(payload_buffer); grpc_byte_buffer_destroy(terminal_buffer); - grpc_call_unref(s->call); + grpc_call_destroy(s->call); grpc_call_details_destroy(&s->call_details); grpc_metadata_array_destroy(&s->initial_metadata_send); grpc_metadata_array_destroy(&s->request_metadata_recv); diff --git a/test/core/security/BUILD b/test/core/security/BUILD index a81e1d366b0..8c63f9143d1 100644 --- a/test/core/security/BUILD +++ b/test/core/security/BUILD @@ -44,8 +44,7 @@ cc_library( srcs = ["oauth2_utils.c"], hdrs = ["oauth2_utils.h"], deps = ["//:grpc"], - copts = ['-std=c99'], - visibility = ["//test/cpp:__subpackages__"], + copts = ['-std=c99'] ) cc_test( diff --git a/test/core/slice/BUILD b/test/core/slice/BUILD index 18cf6f60af0..4d64d0a8183 100644 --- a/test/core/slice/BUILD +++ b/test/core/slice/BUILD @@ -46,30 +46,9 @@ cc_test( copts = ['-std=c99'] ) -cc_test( - name = "slice_test", - srcs = ["slice_test.c"], - deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"], - copts = ['-std=c99'] -) - -cc_test( - name = "slice_string_helpers_test", - srcs = ["slice_string_helpers_test.c"], - deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"], - copts = ['-std=c99'] -) - cc_test( name = "slice_buffer_test", - srcs = ["slice_buffer_test.c"], - deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"], - copts = ['-std=c99'] -) - -cc_test( - name = "slice_hash_table_test", - srcs = ["slice_hash_table_test.c"], + srcs = ["slice_string_helpers_test.c"], deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"], copts = ['-std=c99'] ) diff --git a/test/core/slice/slice_hash_table_test.c b/test/core/slice/slice_hash_table_test.c deleted file mode 100644 index 67041b2d5c9..00000000000 --- a/test/core/slice/slice_hash_table_test.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * - * Copyright 2017, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "src/core/lib/slice/slice_hash_table.h" - -#include - -#include -#include -#include - -#include "src/core/lib/slice/slice_internal.h" -#include "test/core/util/test_config.h" - -typedef struct { - char* key; - char* value; -} test_entry; - -static void populate_entries(const test_entry* input, size_t num_entries, - grpc_slice_hash_table_entry* output) { - for (size_t i = 0; i < num_entries; ++i) { - output[i].key = grpc_slice_from_copied_string(input[i].key); - output[i].value = gpr_strdup(input[i].value); - } -} - -static void check_values(const test_entry* input, size_t num_entries, - grpc_slice_hash_table* table) { - for (size_t i = 0; i < num_entries; ++i) { - grpc_slice key = grpc_slice_from_static_string(input[i].key); - char* actual = grpc_slice_hash_table_get(table, key); - GPR_ASSERT(actual != NULL); - GPR_ASSERT(strcmp(actual, input[i].value) == 0); - grpc_slice_unref(key); - } -} - -static void check_non_existent_value(const char* key_string, - grpc_slice_hash_table* table) { - grpc_slice key = grpc_slice_from_static_string(key_string); - GPR_ASSERT(grpc_slice_hash_table_get(table, key) == NULL); - grpc_slice_unref(key); -} - -static void destroy_string(grpc_exec_ctx* exec_ctx, void* value) { - gpr_free(value); -} - -static void test_slice_hash_table() { - const test_entry test_entries[] = { - {"key_0", "value_0"}, {"key_1", "value_1"}, {"key_2", "value_2"}, - {"key_3", "value_3"}, {"key_4", "value_4"}, {"key_5", "value_5"}, - {"key_6", "value_6"}, {"key_7", "value_7"}, {"key_8", "value_8"}, - {"key_9", "value_9"}, {"key_10", "value_10"}, {"key_11", "value_11"}, - {"key_12", "value_12"}, {"key_13", "value_13"}, {"key_14", "value_14"}, - {"key_15", "value_15"}, {"key_16", "value_16"}, {"key_17", "value_17"}, - {"key_18", "value_18"}, {"key_19", "value_19"}, {"key_20", "value_20"}, - {"key_21", "value_21"}, {"key_22", "value_22"}, {"key_23", "value_23"}, - {"key_24", "value_24"}, {"key_25", "value_25"}, {"key_26", "value_26"}, - {"key_27", "value_27"}, {"key_28", "value_28"}, {"key_29", "value_29"}, - {"key_30", "value_30"}, {"key_31", "value_31"}, {"key_32", "value_32"}, - {"key_33", "value_33"}, {"key_34", "value_34"}, {"key_35", "value_35"}, - {"key_36", "value_36"}, {"key_37", "value_37"}, {"key_38", "value_38"}, - {"key_39", "value_39"}, {"key_40", "value_40"}, {"key_41", "value_41"}, - {"key_42", "value_42"}, {"key_43", "value_43"}, {"key_44", "value_44"}, - {"key_45", "value_45"}, {"key_46", "value_46"}, {"key_47", "value_47"}, - {"key_48", "value_48"}, {"key_49", "value_49"}, {"key_50", "value_50"}, - {"key_51", "value_51"}, {"key_52", "value_52"}, {"key_53", "value_53"}, - {"key_54", "value_54"}, {"key_55", "value_55"}, {"key_56", "value_56"}, - {"key_57", "value_57"}, {"key_58", "value_58"}, {"key_59", "value_59"}, - {"key_60", "value_60"}, {"key_61", "value_61"}, {"key_62", "value_62"}, - {"key_63", "value_63"}, {"key_64", "value_64"}, {"key_65", "value_65"}, - {"key_66", "value_66"}, {"key_67", "value_67"}, {"key_68", "value_68"}, - {"key_69", "value_69"}, {"key_70", "value_70"}, {"key_71", "value_71"}, - {"key_72", "value_72"}, {"key_73", "value_73"}, {"key_74", "value_74"}, - {"key_75", "value_75"}, {"key_76", "value_76"}, {"key_77", "value_77"}, - {"key_78", "value_78"}, {"key_79", "value_79"}, {"key_80", "value_80"}, - {"key_81", "value_81"}, {"key_82", "value_82"}, {"key_83", "value_83"}, - {"key_84", "value_84"}, {"key_85", "value_85"}, {"key_86", "value_86"}, - {"key_87", "value_87"}, {"key_88", "value_88"}, {"key_89", "value_89"}, - {"key_90", "value_90"}, {"key_91", "value_91"}, {"key_92", "value_92"}, - {"key_93", "value_93"}, {"key_94", "value_94"}, {"key_95", "value_95"}, - {"key_96", "value_96"}, {"key_97", "value_97"}, {"key_98", "value_98"}, - {"key_99", "value_99"}, - }; - const size_t num_entries = GPR_ARRAY_SIZE(test_entries); - // Construct table. - grpc_slice_hash_table_entry* entries = - gpr_zalloc(sizeof(*entries) * num_entries); - populate_entries(test_entries, num_entries, entries); - grpc_slice_hash_table* table = - grpc_slice_hash_table_create(num_entries, entries, destroy_string); - gpr_free(entries); - // Check contents of table. - check_values(test_entries, num_entries, table); - check_non_existent_value("XX", table); - // Clean up. - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_slice_hash_table_unref(&exec_ctx, table); - grpc_exec_ctx_finish(&exec_ctx); -} - -int main(int argc, char** argv) { - grpc_test_init(argc, argv); - test_slice_hash_table(); - return 0; -} diff --git a/test/core/support/mpscq_test.c b/test/core/support/mpscq_test.c index 695066c68e3..491eb9148be 100644 --- a/test/core/support/mpscq_test.c +++ b/test/core/support/mpscq_test.c @@ -76,7 +76,7 @@ typedef struct { gpr_event *start; } thd_args; -#define THREAD_ITERATIONS 10000 +#define THREAD_ITERATIONS 100000 static void test_thread(void *args) { thd_args *a = args; diff --git a/test/core/support/spinlock_test.c b/test/core/support/spinlock_test.c index 96055e9bd78..c70e76c7ea1 100644 --- a/test/core/support/spinlock_test.c +++ b/test/core/support/spinlock_test.c @@ -109,7 +109,7 @@ static void test(const char *name, void (*body)(void *m), int timeout_s, start, gpr_time_from_micros((int64_t)timeout_s * 1000000, GPR_TIMESPAN)); fprintf(stderr, "%s:", name); while (gpr_time_cmp(gpr_now(GPR_CLOCK_REALTIME), deadline) < 0) { - if (iterations < INT64_MAX / 2) iterations <<= 1; + iterations <<= 1; fprintf(stderr, " %ld", (long)iterations); m = test_new(10, iterations, incr_step); test_create_threads(m, body); diff --git a/test/core/support/time_test.c b/test/core/support/time_test.c index 00d0b765036..4cb36a788c1 100644 --- a/test/core/support/time_test.c +++ b/test/core/support/time_test.c @@ -47,17 +47,32 @@ static void to_fp(void *arg, const char *buf, size_t len) { fwrite(buf, 1, len, (FILE *)arg); } -/* Convert gpr_intmax x to ascii base b (2..16), and write with +/* Convert gpr_uintmax x to ascii base b (2..16), and write with (*writer)(arg, ...), zero padding to "chars" digits). */ -static void i_to_s(intmax_t x, int base, int chars, +static void u_to_s(uintmax_t x, unsigned base, int chars, void (*writer)(void *arg, const char *buf, size_t len), void *arg) { char buf[64]; - char fmt[32]; - GPR_ASSERT(base == 16 || base == 10); - sprintf(fmt, "%%0%d%s", chars, base == 16 ? PRIxMAX : PRIdMAX); - sprintf(buf, fmt, x); - (*writer)(arg, buf, strlen(buf)); + char *p = buf + sizeof(buf); + do { + *--p = "0123456789abcdef"[x % base]; + x /= base; + chars--; + } while (x != 0 || chars > 0); + (*writer)(arg, p, (size_t)(buf + sizeof(buf) - p)); +} + +/* Convert gpr_intmax x to ascii base b (2..16), and write with + (*writer)(arg, ...), zero padding to "chars" digits). */ +static void i_to_s(intmax_t x, unsigned base, int chars, + void (*writer)(void *arg, const char *buf, size_t len), + void *arg) { + if (x < 0) { + (*writer)(arg, "-", 1); + u_to_s((uintmax_t)-x, base, chars - 1, writer, arg); + } else { + u_to_s((uintmax_t)x, base, chars, writer, arg); + } } /* Convert ts to ascii, and write with (*writer)(arg, ...). */ diff --git a/test/core/surface/alarm_test.c b/test/core/surface/alarm_test.c index 6ea3444fe21..4afe357c277 100644 --- a/test/core/surface/alarm_test.c +++ b/test/core/surface/alarm_test.c @@ -58,7 +58,7 @@ static void test_alarm(void) { grpc_completion_queue *cc; LOG_TEST("test_alarm"); - cc = grpc_completion_queue_create_for_next(NULL); + cc = grpc_completion_queue_create(NULL); { /* regular expiry */ grpc_event ev; diff --git a/test/core/surface/completion_queue_test.c b/test/core/surface/completion_queue_test.c index 35bda5b6418..07f6a9869b7 100644 --- a/test/core/surface/completion_queue_test.c +++ b/test/core/surface/completion_queue_test.c @@ -51,88 +51,33 @@ static void *create_test_tag(void) { static void shutdown_and_destroy(grpc_completion_queue *cc) { grpc_event ev; grpc_completion_queue_shutdown(cc); - - switch (grpc_get_cq_completion_type(cc)) { - case GRPC_CQ_NEXT: { - ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), - NULL); - break; - } - case GRPC_CQ_PLUCK: { - ev = grpc_completion_queue_pluck(cc, create_test_tag(), - gpr_inf_past(GPR_CLOCK_REALTIME), NULL); - break; - } - default: { - gpr_log(GPR_ERROR, "Unknown completion type"); - break; - } - } - + ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), NULL); GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN); grpc_completion_queue_destroy(cc); } /* ensure we can create and destroy a completion channel */ static void test_no_op(void) { - grpc_cq_completion_type completion_types[] = {GRPC_CQ_NEXT, GRPC_CQ_PLUCK}; - grpc_cq_polling_type polling_types[] = { - GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING}; - grpc_completion_queue_attributes attr; LOG_TEST("test_no_op"); - - attr.version = 1; - for (size_t i = 0; i < GPR_ARRAY_SIZE(completion_types); i++) { - for (size_t j = 0; j < GPR_ARRAY_SIZE(polling_types); j++) { - attr.cq_completion_type = completion_types[i]; - attr.cq_polling_type = polling_types[j]; - shutdown_and_destroy(grpc_completion_queue_create( - grpc_completion_queue_factory_lookup(&attr), &attr, NULL)); - } - } + shutdown_and_destroy(grpc_completion_queue_create(NULL)); } static void test_pollset_conversion(void) { - grpc_cq_completion_type completion_types[] = {GRPC_CQ_NEXT, GRPC_CQ_PLUCK}; - grpc_cq_polling_type polling_types[] = {GRPC_CQ_DEFAULT_POLLING, - GRPC_CQ_NON_LISTENING}; - grpc_completion_queue *cq; - grpc_completion_queue_attributes attr; - - LOG_TEST("test_pollset_conversion"); - - attr.version = 1; - for (size_t i = 0; i < GPR_ARRAY_SIZE(completion_types); i++) { - for (size_t j = 0; j < GPR_ARRAY_SIZE(polling_types); j++) { - attr.cq_completion_type = completion_types[i]; - attr.cq_polling_type = polling_types[j]; - cq = grpc_completion_queue_create( - grpc_completion_queue_factory_lookup(&attr), &attr, NULL); - GPR_ASSERT(grpc_cq_from_pollset(grpc_cq_pollset(cq)) == cq); - shutdown_and_destroy(cq); - } - } + grpc_completion_queue *cq = grpc_completion_queue_create(NULL); + GPR_ASSERT(grpc_cq_from_pollset(grpc_cq_pollset(cq)) == cq); + shutdown_and_destroy(cq); } static void test_wait_empty(void) { - grpc_cq_polling_type polling_types[] = { - GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING}; grpc_completion_queue *cc; - grpc_completion_queue_attributes attr; grpc_event event; LOG_TEST("test_wait_empty"); - attr.version = 1; - attr.cq_completion_type = GRPC_CQ_NEXT; - for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) { - attr.cq_polling_type = polling_types[i]; - cc = grpc_completion_queue_create( - grpc_completion_queue_factory_lookup(&attr), &attr, NULL); - event = grpc_completion_queue_next(cc, gpr_now(GPR_CLOCK_REALTIME), NULL); - GPR_ASSERT(event.type == GRPC_QUEUE_TIMEOUT); - shutdown_and_destroy(cc); - } + cc = grpc_completion_queue_create(NULL); + event = grpc_completion_queue_next(cc, gpr_now(GPR_CLOCK_REALTIME), NULL); + GPR_ASSERT(event.type == GRPC_QUEUE_TIMEOUT); + shutdown_and_destroy(cc); } static void do_nothing_end_completion(grpc_exec_ctx *exec_ctx, void *arg, @@ -142,80 +87,50 @@ static void test_cq_end_op(void) { grpc_event ev; grpc_completion_queue *cc; grpc_cq_completion completion; - grpc_cq_polling_type polling_types[] = { - GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING}; - grpc_completion_queue_attributes attr; - grpc_exec_ctx init_exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_exec_ctx exec_ctx; + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; void *tag = create_test_tag(); LOG_TEST("test_cq_end_op"); - attr.version = 1; - attr.cq_completion_type = GRPC_CQ_NEXT; - for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) { - exec_ctx = init_exec_ctx; // Reset exec_ctx - attr.cq_polling_type = polling_types[i]; - cc = grpc_completion_queue_create( - grpc_completion_queue_factory_lookup(&attr), &attr, NULL); - - grpc_cq_begin_op(cc, tag); - grpc_cq_end_op(&exec_ctx, cc, tag, GRPC_ERROR_NONE, - do_nothing_end_completion, NULL, &completion); - - ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), NULL); - GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); - GPR_ASSERT(ev.tag == tag); - GPR_ASSERT(ev.success); - - shutdown_and_destroy(cc); - grpc_exec_ctx_finish(&exec_ctx); - } + cc = grpc_completion_queue_create(NULL); + + grpc_cq_begin_op(cc, tag); + grpc_cq_end_op(&exec_ctx, cc, tag, GRPC_ERROR_NONE, do_nothing_end_completion, + NULL, &completion); + + ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), NULL); + GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); + GPR_ASSERT(ev.tag == tag); + GPR_ASSERT(ev.success); + + shutdown_and_destroy(cc); + grpc_exec_ctx_finish(&exec_ctx); } static void test_shutdown_then_next_polling(void) { - grpc_cq_polling_type polling_types[] = { - GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING}; grpc_completion_queue *cc; - grpc_completion_queue_attributes attr; grpc_event event; LOG_TEST("test_shutdown_then_next_polling"); - attr.version = 1; - attr.cq_completion_type = GRPC_CQ_NEXT; - for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) { - attr.cq_polling_type = polling_types[i]; - cc = grpc_completion_queue_create( - grpc_completion_queue_factory_lookup(&attr), &attr, NULL); - grpc_completion_queue_shutdown(cc); - event = - grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), NULL); - GPR_ASSERT(event.type == GRPC_QUEUE_SHUTDOWN); - grpc_completion_queue_destroy(cc); - } + cc = grpc_completion_queue_create(NULL); + grpc_completion_queue_shutdown(cc); + event = + grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), NULL); + GPR_ASSERT(event.type == GRPC_QUEUE_SHUTDOWN); + grpc_completion_queue_destroy(cc); } static void test_shutdown_then_next_with_timeout(void) { - grpc_cq_polling_type polling_types[] = { - GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING}; grpc_completion_queue *cc; - grpc_completion_queue_attributes attr; grpc_event event; LOG_TEST("test_shutdown_then_next_with_timeout"); - attr.version = 1; - attr.cq_completion_type = GRPC_CQ_NEXT; - for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) { - attr.cq_polling_type = polling_types[i]; - cc = grpc_completion_queue_create( - grpc_completion_queue_factory_lookup(&attr), &attr, NULL); - - grpc_completion_queue_shutdown(cc); - event = grpc_completion_queue_next(cc, gpr_inf_future(GPR_CLOCK_REALTIME), - NULL); - GPR_ASSERT(event.type == GRPC_QUEUE_SHUTDOWN); - grpc_completion_queue_destroy(cc); - } + cc = grpc_completion_queue_create(NULL); + grpc_completion_queue_shutdown(cc); + event = + grpc_completion_queue_next(cc, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); + GPR_ASSERT(event.type == GRPC_QUEUE_SHUTDOWN); + grpc_completion_queue_destroy(cc); } static void test_pluck(void) { @@ -223,11 +138,7 @@ static void test_pluck(void) { grpc_completion_queue *cc; void *tags[128]; grpc_cq_completion completions[GPR_ARRAY_SIZE(tags)]; - grpc_cq_polling_type polling_types[] = { - GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING}; - grpc_completion_queue_attributes attr; - grpc_exec_ctx init_exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_exec_ctx exec_ctx; + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; unsigned i, j; LOG_TEST("test_pluck"); @@ -239,71 +150,49 @@ static void test_pluck(void) { } } - attr.version = 1; - attr.cq_completion_type = GRPC_CQ_PLUCK; - for (size_t pidx = 0; pidx < GPR_ARRAY_SIZE(polling_types); pidx++) { - exec_ctx = init_exec_ctx; // reset exec_ctx - attr.cq_polling_type = polling_types[pidx]; - cc = grpc_completion_queue_create( - grpc_completion_queue_factory_lookup(&attr), &attr, NULL); - - for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { - grpc_cq_begin_op(cc, tags[i]); - grpc_cq_end_op(&exec_ctx, cc, tags[i], GRPC_ERROR_NONE, - do_nothing_end_completion, NULL, &completions[i]); - } + cc = grpc_completion_queue_create(NULL); - for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { - ev = grpc_completion_queue_pluck(cc, tags[i], - gpr_inf_past(GPR_CLOCK_REALTIME), NULL); - GPR_ASSERT(ev.tag == tags[i]); - } + for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { + grpc_cq_begin_op(cc, tags[i]); + grpc_cq_end_op(&exec_ctx, cc, tags[i], GRPC_ERROR_NONE, + do_nothing_end_completion, NULL, &completions[i]); + } - for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { - grpc_cq_begin_op(cc, tags[i]); - grpc_cq_end_op(&exec_ctx, cc, tags[i], GRPC_ERROR_NONE, - do_nothing_end_completion, NULL, &completions[i]); - } + for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { + ev = grpc_completion_queue_pluck(cc, tags[i], + gpr_inf_past(GPR_CLOCK_REALTIME), NULL); + GPR_ASSERT(ev.tag == tags[i]); + } - for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { - ev = grpc_completion_queue_pluck(cc, tags[GPR_ARRAY_SIZE(tags) - i - 1], - gpr_inf_past(GPR_CLOCK_REALTIME), NULL); - GPR_ASSERT(ev.tag == tags[GPR_ARRAY_SIZE(tags) - i - 1]); - } + for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { + grpc_cq_begin_op(cc, tags[i]); + grpc_cq_end_op(&exec_ctx, cc, tags[i], GRPC_ERROR_NONE, + do_nothing_end_completion, NULL, &completions[i]); + } - shutdown_and_destroy(cc); - grpc_exec_ctx_finish(&exec_ctx); + for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { + ev = grpc_completion_queue_pluck(cc, tags[GPR_ARRAY_SIZE(tags) - i - 1], + gpr_inf_past(GPR_CLOCK_REALTIME), NULL); + GPR_ASSERT(ev.tag == tags[GPR_ARRAY_SIZE(tags) - i - 1]); } + + shutdown_and_destroy(cc); + grpc_exec_ctx_finish(&exec_ctx); } static void test_pluck_after_shutdown(void) { - grpc_cq_polling_type polling_types[] = { - GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING}; grpc_event ev; grpc_completion_queue *cc; - grpc_completion_queue_attributes attr; LOG_TEST("test_pluck_after_shutdown"); - - attr.version = 1; - attr.cq_completion_type = GRPC_CQ_PLUCK; - for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) { - attr.cq_polling_type = polling_types[i]; - cc = grpc_completion_queue_create( - grpc_completion_queue_factory_lookup(&attr), &attr, NULL); - grpc_completion_queue_shutdown(cc); - ev = grpc_completion_queue_pluck(cc, NULL, - gpr_inf_future(GPR_CLOCK_REALTIME), NULL); - GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN); - grpc_completion_queue_destroy(cc); - } + cc = grpc_completion_queue_create(NULL); + grpc_completion_queue_shutdown(cc); + ev = grpc_completion_queue_pluck(cc, NULL, gpr_inf_future(GPR_CLOCK_REALTIME), + NULL); + GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN); + grpc_completion_queue_destroy(cc); } -struct thread_state { - grpc_completion_queue *cc; - void *tag; -}; - int main(int argc, char **argv) { grpc_test_init(argc, argv); grpc_init(); diff --git a/test/core/surface/completion_queue_threading_test.c b/test/core/surface/completion_queue_threading_test.c index bff69ec74fd..2d55ead843e 100644 --- a/test/core/surface/completion_queue_threading_test.c +++ b/test/core/surface/completion_queue_threading_test.c @@ -52,24 +52,7 @@ static void *create_test_tag(void) { static void shutdown_and_destroy(grpc_completion_queue *cc) { grpc_event ev; grpc_completion_queue_shutdown(cc); - - switch (grpc_get_cq_completion_type(cc)) { - case GRPC_CQ_NEXT: { - ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), - NULL); - break; - } - case GRPC_CQ_PLUCK: { - ev = grpc_completion_queue_pluck(cc, create_test_tag(), - gpr_inf_past(GPR_CLOCK_REALTIME), NULL); - break; - } - default: { - gpr_log(GPR_ERROR, "Unknown completion type"); - break; - } - } - + ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), NULL); GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN); grpc_completion_queue_destroy(cc); } @@ -101,7 +84,7 @@ static void test_too_many_plucks(void) { LOG_TEST("test_too_many_plucks"); - cc = grpc_completion_queue_create_for_pluck(NULL); + cc = grpc_completion_queue_create(NULL); gpr_thd_options_set_joinable(&thread_options); for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { @@ -227,7 +210,7 @@ static void test_threading(size_t producers, size_t consumers) { gpr_malloc((producers + consumers) * sizeof(test_thread_options)); gpr_event phase1 = GPR_EVENT_INIT; gpr_event phase2 = GPR_EVENT_INIT; - grpc_completion_queue *cc = grpc_completion_queue_create_for_next(NULL); + grpc_completion_queue *cc = grpc_completion_queue_create(NULL); size_t i; size_t total_consumed = 0; static int optid = 101; diff --git a/test/core/surface/concurrent_connectivity_test.c b/test/core/surface/concurrent_connectivity_test.c index d6841ea1f88..2f7c3dfb856 100644 --- a/test/core/surface/concurrent_connectivity_test.c +++ b/test/core/surface/concurrent_connectivity_test.c @@ -66,7 +66,7 @@ static int detag(void *p) { return (int)(uintptr_t)p; } void create_loop_destroy(void *addr) { for (int i = 0; i < NUM_OUTER_LOOPS; ++i) { - grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL); + grpc_completion_queue *cq = grpc_completion_queue_create(NULL); grpc_channel *chan = grpc_insecure_channel_create((char *)addr, NULL, NULL); for (int j = 0; j < NUM_INNER_LOOPS; ++j) { @@ -196,7 +196,7 @@ int main(int argc, char **argv) { gpr_asprintf(&args.addr, "localhost:%d", port); args.server = grpc_server_create(NULL, NULL); grpc_server_add_insecure_http2_port(args.server, args.addr); - args.cq = grpc_completion_queue_create_for_next(NULL); + args.cq = grpc_completion_queue_create(NULL); grpc_server_register_completion_queue(args.server, args.cq, NULL); grpc_server_start(args.server); gpr_thd_new(&server, server_thread, &args, &options); diff --git a/test/core/surface/lame_client_test.c b/test/core/surface/lame_client_test.c index ba0cee07d36..9deb50bb044 100644 --- a/test/core/surface/lame_client_test.c +++ b/test/core/surface/lame_client_test.c @@ -108,7 +108,7 @@ int main(int argc, char **argv) { GPR_ASSERT(GRPC_CHANNEL_SHUTDOWN == grpc_channel_check_connectivity_state(chan, 0)); - cq = grpc_completion_queue_create_for_next(NULL); + cq = grpc_completion_queue_create(NULL); grpc_slice host = grpc_slice_from_static_string("anywhere"); call = grpc_channel_create_call(chan, NULL, GRPC_PROPAGATE_DEFAULTS, cq, @@ -156,7 +156,7 @@ int main(int argc, char **argv) { GPR_ASSERT(strcmp(peer, "lampoon:national") == 0); gpr_free(peer); - grpc_call_unref(call); + grpc_call_destroy(call); grpc_channel_destroy(chan); cq_verifier_destroy(cqv); grpc_completion_queue_destroy(cq); diff --git a/test/core/surface/sequential_connectivity_test.c b/test/core/surface/sequential_connectivity_test.c index fbecdd7e388..5f66f900372 100644 --- a/test/core/surface/sequential_connectivity_test.c +++ b/test/core/surface/sequential_connectivity_test.c @@ -76,8 +76,7 @@ static void run_test(const test_fixture *fixture) { grpc_server *server = grpc_server_create(NULL, NULL); fixture->add_server_port(server, addr); - grpc_completion_queue *server_cq = - grpc_completion_queue_create_for_next(NULL); + grpc_completion_queue *server_cq = grpc_completion_queue_create(NULL); grpc_server_register_completion_queue(server, server_cq, NULL); grpc_server_start(server); @@ -87,7 +86,7 @@ static void run_test(const test_fixture *fixture) { gpr_thd_options_set_joinable(&thdopt); gpr_thd_new(&server_thread, server_thread_func, &sta, &thdopt); - grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL); + grpc_completion_queue *cq = grpc_completion_queue_create(NULL); grpc_channel *channels[NUM_CONNECTIONS]; for (size_t i = 0; i < NUM_CONNECTIONS; i++) { channels[i] = fixture->create_channel(addr); diff --git a/test/core/surface/server_chttp2_test.c b/test/core/surface/server_chttp2_test.c index 06293e51020..8d40c646548 100644 --- a/test/core/surface/server_chttp2_test.c +++ b/test/core/surface/server_chttp2_test.c @@ -60,7 +60,7 @@ void test_add_same_port_twice() { int port = grpc_pick_unused_port_or_die(); char *addr = NULL; - grpc_completion_queue *cq = grpc_completion_queue_create_for_pluck(NULL); + grpc_completion_queue *cq = grpc_completion_queue_create(NULL); grpc_server *server = grpc_server_create(&args, NULL); grpc_server_credentials *fake_creds = grpc_fake_transport_security_server_credentials_create(); diff --git a/test/core/surface/server_test.c b/test/core/surface/server_test.c index 81a39de216d..3fd1c2c2663 100644 --- a/test/core/surface/server_test.c +++ b/test/core/surface/server_test.c @@ -70,7 +70,7 @@ void test_register_method_fail(void) { } void test_request_call_on_no_server_cq(void) { - grpc_completion_queue *cc = grpc_completion_queue_create_for_next(NULL); + grpc_completion_queue *cc = grpc_completion_queue_create(NULL); grpc_server *server = grpc_server_create(NULL, NULL); GPR_ASSERT(GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE == grpc_server_request_call(server, NULL, NULL, NULL, cc, cc, NULL)); @@ -91,7 +91,7 @@ void test_bind_server_twice(void) { char *addr; grpc_server *server1 = grpc_server_create(&args, NULL); grpc_server *server2 = grpc_server_create(&args, NULL); - grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL); + grpc_completion_queue *cq = grpc_completion_queue_create(NULL); int port = grpc_pick_unused_port_or_die(); gpr_asprintf(&addr, "[::]:%d", port); grpc_server_register_completion_queue(server1, cq, NULL); @@ -128,7 +128,7 @@ void test_bind_server_to_addr(const char *host, bool secure) { } else { GPR_ASSERT(grpc_server_add_insecure_http2_port(server, addr)); } - grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL); + grpc_completion_queue *cq = grpc_completion_queue_create(NULL); grpc_server_register_completion_queue(server, cq, NULL); grpc_server_start(server); grpc_server_shutdown_and_notify(server, cq, NULL); diff --git a/test/core/util/port_server_client.c b/test/core/util/port_server_client.c index 254c3a6b613..38054dd1e74 100644 --- a/test/core/util/port_server_client.c +++ b/test/core/util/port_server_client.c @@ -103,7 +103,7 @@ void grpc_free_port_using_server(int port) { grpc_resource_quota *resource_quota = grpc_resource_quota_create("port_server_client/free"); grpc_httpcli_get(&exec_ctx, &context, &pr.pops, resource_quota, &req, - grpc_timeout_seconds_to_deadline(30), + grpc_timeout_seconds_to_deadline(10), grpc_closure_create(freed_port_from_server, &pr, grpc_schedule_on_exec_ctx), &rsp); @@ -235,7 +235,7 @@ int grpc_pick_port_using_server(void) { grpc_resource_quota_create("port_server_client/pick"); grpc_httpcli_get( &exec_ctx, &context, &pr.pops, resource_quota, &req, - grpc_timeout_seconds_to_deadline(30), + grpc_timeout_seconds_to_deadline(10), grpc_closure_create(got_port_from_server, &pr, grpc_schedule_on_exec_ctx), &pr.response); grpc_resource_quota_unref_internal(&exec_ctx, resource_quota); diff --git a/test/core/util/test_config.c b/test/core/util/test_config.c index 9a400c54ca2..0180d6f08d4 100644 --- a/test/core/util/test_config.c +++ b/test/core/util/test_config.c @@ -348,14 +348,6 @@ bool BuiltUnderMsan() { #endif } -bool BuiltUnderUbsan() { -#ifdef GRPC_UBSAN - return true; -#else - return false; -#endif -} - int64_t grpc_test_sanitizer_slowdown_factor() { int64_t sanitizer_multiplier = 1; if (BuiltUnderValgrind()) { @@ -366,8 +358,6 @@ int64_t grpc_test_sanitizer_slowdown_factor() { sanitizer_multiplier = 3; } else if (BuiltUnderMsan()) { sanitizer_multiplier = 4; - } else if (BuiltUnderUbsan()) { - sanitizer_multiplier = 5; } return sanitizer_multiplier; } diff --git a/test/cpp/codegen/BUILD b/test/cpp/codegen/BUILD index 43d133fc342..14d5733da2c 100644 --- a/test/cpp/codegen/BUILD +++ b/test/cpp/codegen/BUILD @@ -62,7 +62,7 @@ cc_test( cc_test( name = "golden_file_test", srcs = ["golden_file_test.cc"], - args = ["--generated_file_path=$(GENDIR)/src/proto/grpc/testing/"], + args = ["--generated_file_path=$(GENDIR)/src/proto/grpc/testing/compiler_test.grpc.pb.h"], data = [ ":compiler_test_golden", "//src/proto/grpc/testing:_compiler_test_proto_grpc_codegen", diff --git a/test/cpp/codegen/compiler_test_golden b/test/cpp/codegen/compiler_test_golden index 8e3ae32a494..fd26a17ac11 100644 --- a/test/cpp/codegen/compiler_test_golden +++ b/test/cpp/codegen/compiler_test_golden @@ -89,30 +89,10 @@ class ServiceA final { return std::unique_ptr< ::grpc::ClientAsyncWriterInterface< ::grpc::testing::Request>>(AsyncMethodA2Raw(context, response, cq, tag)); } // MethodA2 trailing comment 1 - // Method A3 leading comment 1 - std::unique_ptr< ::grpc::ClientReaderInterface< ::grpc::testing::Response>> MethodA3(::grpc::ClientContext* context, const ::grpc::testing::Request& request) { - return std::unique_ptr< ::grpc::ClientReaderInterface< ::grpc::testing::Response>>(MethodA3Raw(context, request)); - } - std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::grpc::testing::Response>> AsyncMethodA3(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq, void* tag) { - return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::grpc::testing::Response>>(AsyncMethodA3Raw(context, request, cq, tag)); - } - // Method A3 trailing comment 1 - // Method A4 leading comment 1 - std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::grpc::testing::Request, ::grpc::testing::Response>> MethodA4(::grpc::ClientContext* context) { - return std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::grpc::testing::Request, ::grpc::testing::Response>>(MethodA4Raw(context)); - } - std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::grpc::testing::Request, ::grpc::testing::Response>> AsyncMethodA4(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { - return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::grpc::testing::Request, ::grpc::testing::Response>>(AsyncMethodA4Raw(context, cq, tag)); - } - // Method A4 trailing comment 1 private: virtual ::grpc::ClientAsyncResponseReaderInterface< ::grpc::testing::Response>* AsyncMethodA1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientWriterInterface< ::grpc::testing::Request>* MethodA2Raw(::grpc::ClientContext* context, ::grpc::testing::Response* response) = 0; virtual ::grpc::ClientAsyncWriterInterface< ::grpc::testing::Request>* AsyncMethodA2Raw(::grpc::ClientContext* context, ::grpc::testing::Response* response, ::grpc::CompletionQueue* cq, void* tag) = 0; - virtual ::grpc::ClientReaderInterface< ::grpc::testing::Response>* MethodA3Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request) = 0; - virtual ::grpc::ClientAsyncReaderInterface< ::grpc::testing::Response>* AsyncMethodA3Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq, void* tag) = 0; - virtual ::grpc::ClientReaderWriterInterface< ::grpc::testing::Request, ::grpc::testing::Response>* MethodA4Raw(::grpc::ClientContext* context) = 0; - virtual ::grpc::ClientAsyncReaderWriterInterface< ::grpc::testing::Request, ::grpc::testing::Response>* AsyncMethodA4Raw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) = 0; }; class Stub final : public StubInterface { public: @@ -127,32 +107,14 @@ class ServiceA final { std::unique_ptr< ::grpc::ClientAsyncWriter< ::grpc::testing::Request>> AsyncMethodA2(::grpc::ClientContext* context, ::grpc::testing::Response* response, ::grpc::CompletionQueue* cq, void* tag) { return std::unique_ptr< ::grpc::ClientAsyncWriter< ::grpc::testing::Request>>(AsyncMethodA2Raw(context, response, cq, tag)); } - std::unique_ptr< ::grpc::ClientReader< ::grpc::testing::Response>> MethodA3(::grpc::ClientContext* context, const ::grpc::testing::Request& request) { - return std::unique_ptr< ::grpc::ClientReader< ::grpc::testing::Response>>(MethodA3Raw(context, request)); - } - std::unique_ptr< ::grpc::ClientAsyncReader< ::grpc::testing::Response>> AsyncMethodA3(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq, void* tag) { - return std::unique_ptr< ::grpc::ClientAsyncReader< ::grpc::testing::Response>>(AsyncMethodA3Raw(context, request, cq, tag)); - } - std::unique_ptr< ::grpc::ClientReaderWriter< ::grpc::testing::Request, ::grpc::testing::Response>> MethodA4(::grpc::ClientContext* context) { - return std::unique_ptr< ::grpc::ClientReaderWriter< ::grpc::testing::Request, ::grpc::testing::Response>>(MethodA4Raw(context)); - } - std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::grpc::testing::Request, ::grpc::testing::Response>> AsyncMethodA4(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { - return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::grpc::testing::Request, ::grpc::testing::Response>>(AsyncMethodA4Raw(context, cq, tag)); - } private: std::shared_ptr< ::grpc::ChannelInterface> channel_; ::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>* AsyncMethodA1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientWriter< ::grpc::testing::Request>* MethodA2Raw(::grpc::ClientContext* context, ::grpc::testing::Response* response) override; ::grpc::ClientAsyncWriter< ::grpc::testing::Request>* AsyncMethodA2Raw(::grpc::ClientContext* context, ::grpc::testing::Response* response, ::grpc::CompletionQueue* cq, void* tag) override; - ::grpc::ClientReader< ::grpc::testing::Response>* MethodA3Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request) override; - ::grpc::ClientAsyncReader< ::grpc::testing::Response>* AsyncMethodA3Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq, void* tag) override; - ::grpc::ClientReaderWriter< ::grpc::testing::Request, ::grpc::testing::Response>* MethodA4Raw(::grpc::ClientContext* context) override; - ::grpc::ClientAsyncReaderWriter< ::grpc::testing::Request, ::grpc::testing::Response>* AsyncMethodA4Raw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) override; const ::grpc::RpcMethod rpcmethod_MethodA1_; const ::grpc::RpcMethod rpcmethod_MethodA2_; - const ::grpc::RpcMethod rpcmethod_MethodA3_; - const ::grpc::RpcMethod rpcmethod_MethodA4_; }; static std::unique_ptr NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); @@ -169,12 +131,6 @@ class ServiceA final { // Method A2 leading comment 2 virtual ::grpc::Status MethodA2(::grpc::ServerContext* context, ::grpc::ServerReader< ::grpc::testing::Request>* reader, ::grpc::testing::Response* response); // MethodA2 trailing comment 1 - // Method A3 leading comment 1 - virtual ::grpc::Status MethodA3(::grpc::ServerContext* context, const ::grpc::testing::Request* request, ::grpc::ServerWriter< ::grpc::testing::Response>* writer); - // Method A3 trailing comment 1 - // Method A4 leading comment 1 - virtual ::grpc::Status MethodA4(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::grpc::testing::Response, ::grpc::testing::Request>* stream); - // Method A4 trailing comment 1 }; template class WithAsyncMethod_MethodA1 : public BaseClass { @@ -216,47 +172,7 @@ class ServiceA final { ::grpc::Service::RequestAsyncClientStreaming(1, context, reader, new_call_cq, notification_cq, tag); } }; - template - class WithAsyncMethod_MethodA3 : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service *service) {} - public: - WithAsyncMethod_MethodA3() { - ::grpc::Service::MarkMethodAsync(2); - } - ~WithAsyncMethod_MethodA3() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status MethodA3(::grpc::ServerContext* context, const ::grpc::testing::Request* request, ::grpc::ServerWriter< ::grpc::testing::Response>* writer) final override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestMethodA3(::grpc::ServerContext* context, ::grpc::testing::Request* request, ::grpc::ServerAsyncWriter< ::grpc::testing::Response>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncServerStreaming(2, context, request, writer, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_MethodA4 : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service *service) {} - public: - WithAsyncMethod_MethodA4() { - ::grpc::Service::MarkMethodAsync(3); - } - ~WithAsyncMethod_MethodA4() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status MethodA4(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::grpc::testing::Response, ::grpc::testing::Request>* stream) final override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestMethodA4(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::grpc::testing::Response, ::grpc::testing::Request>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncBidiStreaming(3, context, stream, new_call_cq, notification_cq, tag); - } - }; - typedef WithAsyncMethod_MethodA1 > > > AsyncService; + typedef WithAsyncMethod_MethodA1 > AsyncService; template class WithGenericMethod_MethodA1 : public BaseClass { private: @@ -292,40 +208,6 @@ class ServiceA final { } }; template - class WithGenericMethod_MethodA3 : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service *service) {} - public: - WithGenericMethod_MethodA3() { - ::grpc::Service::MarkMethodGeneric(2); - } - ~WithGenericMethod_MethodA3() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status MethodA3(::grpc::ServerContext* context, const ::grpc::testing::Request* request, ::grpc::ServerWriter< ::grpc::testing::Response>* writer) final override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_MethodA4 : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service *service) {} - public: - WithGenericMethod_MethodA4() { - ::grpc::Service::MarkMethodGeneric(3); - } - ~WithGenericMethod_MethodA4() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status MethodA4(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::grpc::testing::Response, ::grpc::testing::Request>* stream) final override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template class WithStreamedUnaryMethod_MethodA1 : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service *service) {} @@ -346,28 +228,8 @@ class ServiceA final { virtual ::grpc::Status StreamedMethodA1(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::grpc::testing::Request,::grpc::testing::Response>* server_unary_streamer) = 0; }; typedef WithStreamedUnaryMethod_MethodA1 StreamedUnaryService; - template - class WithSplitStreamingMethod_MethodA3 : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service *service) {} - public: - WithSplitStreamingMethod_MethodA3() { - ::grpc::Service::MarkMethodStreamed(2, - new ::grpc::SplitServerStreamingHandler< ::grpc::testing::Request, ::grpc::testing::Response>(std::bind(&WithSplitStreamingMethod_MethodA3::StreamedMethodA3, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithSplitStreamingMethod_MethodA3() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status MethodA3(::grpc::ServerContext* context, const ::grpc::testing::Request* request, ::grpc::ServerWriter< ::grpc::testing::Response>* writer) final override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with split streamed - virtual ::grpc::Status StreamedMethodA3(::grpc::ServerContext* context, ::grpc::ServerSplitStreamer< ::grpc::testing::Request,::grpc::testing::Response>* server_split_streamer) = 0; - }; - typedef WithSplitStreamingMethod_MethodA3 SplitStreamedService; - typedef WithStreamedUnaryMethod_MethodA1 > StreamedService; + typedef Service SplitStreamedService; + typedef WithStreamedUnaryMethod_MethodA1 StreamedService; }; // ServiceB leading comment 1 diff --git a/test/cpp/codegen/compiler_test_mock_golden b/test/cpp/codegen/compiler_test_mock_golden deleted file mode 100644 index 8e4b4d59112..00000000000 --- a/test/cpp/codegen/compiler_test_mock_golden +++ /dev/null @@ -1,34 +0,0 @@ -// Generated by the gRPC C++ plugin. -// If you make any local change, they will be lost. -// source: src/proto/grpc/testing/compiler_test.proto - -#include "src/proto/grpc/testing/compiler_test.pb.h" -#include "src/proto/grpc/testing/compiler_test.grpc.pb.h" - -#include -#include -#include -namespace grpc { -namespace testing { - -class MockServiceAStub : public ServiceA::StubInterface { - public: - MOCK_METHOD3(MethodA1, ::grpc::Status(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::testing::Response* response)); - MOCK_METHOD3(AsyncMethodA1Raw, ::grpc::ClientAsyncResponseReaderInterface< ::grpc::testing::Response>*(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq)); - MOCK_METHOD2(MethodA2Raw, ::grpc::ClientWriterInterface< ::grpc::testing::Request>*(::grpc::ClientContext* context, ::grpc::testing::Response* response)); - MOCK_METHOD4(AsyncMethodA2Raw, ::grpc::ClientAsyncWriterInterface< ::grpc::testing::Request>*(::grpc::ClientContext* context, ::grpc::testing::Response* response, ::grpc::CompletionQueue* cq, void* tag)); - MOCK_METHOD2(MethodA3Raw, ::grpc::ClientReaderInterface< ::grpc::testing::Response>*(::grpc::ClientContext* context, const ::grpc::testing::Request& request)); - MOCK_METHOD4(AsyncMethodA3Raw, ::grpc::ClientAsyncReaderInterface< ::grpc::testing::Response>*(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq, void* tag)); - MOCK_METHOD1(MethodA4Raw, ::grpc::ClientReaderWriterInterface< ::grpc::testing::Request, ::grpc::testing::Response>*(::grpc::ClientContext* context)); - MOCK_METHOD3(AsyncMethodA4Raw, ::grpc::ClientAsyncReaderWriterInterface<::grpc::testing::Request, ::grpc::testing::Response>*(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag)); -}; - -class MockServiceBStub : public ServiceB::StubInterface { - public: - MOCK_METHOD3(MethodB1, ::grpc::Status(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::testing::Response* response)); - MOCK_METHOD3(AsyncMethodB1Raw, ::grpc::ClientAsyncResponseReaderInterface< ::grpc::testing::Response>*(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq)); -}; - -} // namespace grpc -} // namespace testing - diff --git a/test/cpp/codegen/golden_file_test.cc b/test/cpp/codegen/golden_file_test.cc index 7789ac738b9..158a4d933c9 100644 --- a/test/cpp/codegen/golden_file_test.cc +++ b/test/cpp/codegen/golden_file_test.cc @@ -37,18 +37,16 @@ #include #include -DEFINE_string( - generated_file_path, "", - "path to the directory containing generated files compiler_test.grpc.pb.h" - "and compiler_test_mock.grpc.pb.h"); +DEFINE_string(generated_file_path, "", + "path to the generated compiler_test.grpc.pb.h file"); const char kGoldenFilePath[] = "test/cpp/codegen/compiler_test_golden"; -const char kMockGoldenFilePath[] = "test/cpp/codegen/compiler_test_mock_golden"; -void run_test(std::basic_string generated_file, - std::basic_string golden_file) { - std::ifstream generated(generated_file); - std::ifstream golden(golden_file); +TEST(GoldenFileTest, TestGeneratedFile) { + ASSERT_FALSE(FLAGS_generated_file_path.empty()); + + std::ifstream generated(FLAGS_generated_file_path); + std::ifstream golden(kGoldenFilePath); ASSERT_TRUE(generated.good()); ASSERT_TRUE(golden.good()); @@ -63,23 +61,8 @@ void run_test(std::basic_string generated_file, golden.close(); } -TEST(GoldenFileTest, TestGeneratedFile) { - run_test(FLAGS_generated_file_path + "compiler_test.grpc.pb.h", - kGoldenFilePath); -} - -TEST(GoldenMockFileTest, TestGeneratedMockFile) { - run_test(FLAGS_generated_file_path + "compiler_test_mock.grpc.pb.h", - kMockGoldenFilePath); -} - int main(int argc, char **argv) { ::testing::InitGoogleTest(&argc, argv); ::google::ParseCommandLineFlags(&argc, &argv, true); - if (FLAGS_generated_file_path.empty()) { - FLAGS_generated_file_path = "gens/src/proto/grpc/testing/"; - } - if (FLAGS_generated_file_path.back() != '/') - FLAGS_generated_file_path.append("/"); return RUN_ALL_TESTS(); } diff --git a/test/cpp/end2end/BUILD b/test/cpp/end2end/BUILD index f1212e15c77..0bf7948fcfe 100644 --- a/test/cpp/end2end/BUILD +++ b/test/cpp/end2end/BUILD @@ -51,7 +51,6 @@ cc_test( "//src/proto/grpc/testing:echo_messages_proto", "//src/proto/grpc/testing:echo_proto", "//src/proto/grpc/testing/duplicate:echo_duplicate_proto", - "//src/proto/grpc/health/v1:health_proto", "//test/core/util:gpr_test_util", "//test/core/util:grpc_test_util", "//test/cpp/util:test_util", diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc index cc3958bf13c..0b5215ef8e4 100644 --- a/test/cpp/end2end/async_end2end_test.cc +++ b/test/cpp/end2end/async_end2end_test.cc @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include @@ -50,7 +49,6 @@ #include #include "src/core/lib/iomgr/port.h" -#include "src/proto/grpc/health/v1/health.grpc.pb.h" #include "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h" #include "src/proto/grpc/testing/echo.grpc.pb.h" #include "test/core/util/port.h" @@ -226,15 +224,13 @@ class ServerBuilderSyncPluginDisabler : public ::grpc::ServerBuilderOption { class TestScenario { public: - TestScenario(bool non_block, const grpc::string& creds_type, bool hcs, + TestScenario(bool non_block, const grpc::string& creds_type, const grpc::string& content) : disable_blocking(non_block), - health_check_service(hcs), credentials_type(creds_type), message_content(content) {} void Log() const; bool disable_blocking; - bool health_check_service; // Although the below grpc::string's are logically const, we can't declare // them const because of a limitation in the way old compilers (e.g., gcc-4.4) // manage vector insertion using a copy constructor @@ -247,8 +243,6 @@ static std::ostream& operator<<(std::ostream& out, return out << "TestScenario{disable_blocking=" << (scenario.disable_blocking ? "true" : "false") << ", credentials='" << scenario.credentials_type - << ", health_check_service=" - << (scenario.health_check_service ? "true" : "false") << "', message_size=" << scenario.message_content.size() << "}"; } @@ -258,8 +252,6 @@ void TestScenario::Log() const { gpr_log(GPR_DEBUG, "%s", out.str().c_str()); } -class HealthCheck : public health::v1::Health::Service {}; - class AsyncEnd2endTest : public ::testing::TestWithParam { protected: AsyncEnd2endTest() { GetParam().Log(); } @@ -276,9 +268,6 @@ class AsyncEnd2endTest : public ::testing::TestWithParam { GetParam().credentials_type); builder.AddListeningPort(server_address_.str(), server_creds); builder.RegisterService(&service_); - if (GetParam().health_check_service) { - builder.RegisterService(&health_check_); - } cq_ = builder.AddCompletionQueue(); // TODO(zyc): make a test option to choose wheather sync plugins should be @@ -351,7 +340,6 @@ class AsyncEnd2endTest : public ::testing::TestWithParam { std::unique_ptr stub_; std::unique_ptr server_; grpc::testing::EchoTestService::AsyncService service_; - HealthCheck health_check_; std::ostringstream server_address_; int port_; @@ -1766,14 +1754,12 @@ std::vector CreateTestScenarios(bool test_disable_blocking, messages.push_back(big_msg); } - for (auto health_check_service : {false, true}) { - for (auto cred = credentials_types.begin(); cred != credentials_types.end(); - ++cred) { - for (auto msg = messages.begin(); msg != messages.end(); msg++) { - scenarios.emplace_back(false, *cred, health_check_service, *msg); - if (test_disable_blocking) { - scenarios.emplace_back(true, *cred, health_check_service, *msg); - } + for (auto cred = credentials_types.begin(); cred != credentials_types.end(); + ++cred) { + for (auto msg = messages.begin(); msg != messages.end(); msg++) { + scenarios.emplace_back(false, *cred, *msg); + if (test_disable_blocking) { + scenarios.emplace_back(true, *cred, *msg); } } } diff --git a/test/cpp/end2end/mock_test.cc b/test/cpp/end2end/mock_test.cc index 7e330063ed3..fdb2732e503 100644 --- a/test/cpp/end2end/mock_test.cc +++ b/test/cpp/end2end/mock_test.cc @@ -34,7 +34,6 @@ #include #include -#include #include #include #include @@ -47,95 +46,131 @@ #include #include -#include - #include "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h" #include "src/proto/grpc/testing/echo.grpc.pb.h" -#include "src/proto/grpc/testing/echo_mock.grpc.pb.h" #include "test/core/util/port.h" #include "test/core/util/test_config.h" -#include - -using namespace std; using grpc::testing::EchoRequest; using grpc::testing::EchoResponse; using grpc::testing::EchoTestService; -using grpc::testing::MockClientReaderWriter; using std::chrono::system_clock; -using ::testing::AtLeast; -using ::testing::SetArgPointee; -using ::testing::SaveArg; -using ::testing::_; -using ::testing::Return; -using ::testing::Invoke; -using ::testing::WithArg; -using ::testing::DoAll; namespace grpc { namespace testing { namespace { -class FakeClient { +template +class MockClientReaderWriter final : public ClientReaderWriterInterface { public: - explicit FakeClient(EchoTestService::StubInterface* stub) : stub_(stub) {} - - void DoEcho() { - ClientContext context; - EchoRequest request; - EchoResponse response; - request.set_message("hello world"); - Status s = stub_->Echo(&context, request, &response); - EXPECT_EQ(request.message(), response.message()); - EXPECT_TRUE(s.ok()); + void WaitForInitialMetadata() override {} + bool NextMessageSize(uint32_t* sz) override { + *sz = UINT_MAX; + return true; + } + bool Read(R* msg) override { return true; } + bool Write(const W& msg) override { return true; } + bool WritesDone() override { return true; } + Status Finish() override { return Status::OK; } +}; +template <> +class MockClientReaderWriter final + : public ClientReaderWriterInterface { + public: + MockClientReaderWriter() : writes_done_(false) {} + void WaitForInitialMetadata() override {} + bool NextMessageSize(uint32_t* sz) override { + *sz = UINT_MAX; + return true; + } + bool Read(EchoResponse* msg) override { + if (writes_done_) return false; + msg->set_message(last_message_); + return true; } - void DoRequestStream() { - EchoRequest request; - EchoResponse response; - - ClientContext context; - grpc::string msg("hello"); - grpc::string exp(msg); - - std::unique_ptr> cstream = - stub_->RequestStream(&context, &response); - - request.set_message(msg); - EXPECT_TRUE(cstream->Write(request)); + bool Write(const EchoRequest& msg, WriteOptions options) override { + gpr_log(GPR_INFO, "mock recv msg %s", msg.message().c_str()); + last_message_ = msg.message(); + return true; + } + bool WritesDone() override { + writes_done_ = true; + return true; + } + Status Finish() override { return Status::OK; } - msg = ", world"; - request.set_message(msg); - exp.append(msg); - EXPECT_TRUE(cstream->Write(request)); + private: + bool writes_done_; + grpc::string last_message_; +}; - cstream->WritesDone(); - Status s = cstream->Finish(); +// Mocked stub. +class MockStub : public EchoTestService::StubInterface { + public: + MockStub() {} + ~MockStub() {} + Status Echo(ClientContext* context, const EchoRequest& request, + EchoResponse* response) override { + response->set_message(request.message()); + return Status::OK; + } + Status Unimplemented(ClientContext* context, const EchoRequest& request, + EchoResponse* response) override { + return Status::OK; + } - EXPECT_EQ(exp, response.message()); - EXPECT_TRUE(s.ok()); + private: + ClientAsyncResponseReaderInterface* AsyncEchoRaw( + ClientContext* context, const EchoRequest& request, + CompletionQueue* cq) override { + return nullptr; + } + ClientWriterInterface* RequestStreamRaw( + ClientContext* context, EchoResponse* response) override { + return nullptr; + } + ClientAsyncWriterInterface* AsyncRequestStreamRaw( + ClientContext* context, EchoResponse* response, CompletionQueue* cq, + void* tag) override { + return nullptr; + } + ClientReaderInterface* ResponseStreamRaw( + ClientContext* context, const EchoRequest& request) override { + return nullptr; + } + ClientAsyncReaderInterface* AsyncResponseStreamRaw( + ClientContext* context, const EchoRequest& request, CompletionQueue* cq, + void* tag) override { + return nullptr; + } + ClientReaderWriterInterface* BidiStreamRaw( + ClientContext* context) override { + return new MockClientReaderWriter(); } + ClientAsyncReaderWriterInterface* + AsyncBidiStreamRaw(ClientContext* context, CompletionQueue* cq, + void* tag) override { + return nullptr; + } + ClientAsyncResponseReaderInterface* AsyncUnimplementedRaw( + ClientContext* context, const EchoRequest& request, + CompletionQueue* cq) override { + return nullptr; + } +}; + +class FakeClient { + public: + explicit FakeClient(EchoTestService::StubInterface* stub) : stub_(stub) {} - void DoResponseStream() { + void DoEcho() { + ClientContext context; EchoRequest request; EchoResponse response; request.set_message("hello world"); - - ClientContext context; - std::unique_ptr> cstream = - stub_->ResponseStream(&context, request); - - grpc::string exp = ""; - EXPECT_TRUE(cstream->Read(&response)); - exp.append(response.message() + " "); - - EXPECT_TRUE(cstream->Read(&response)); - exp.append(response.message()); - - EXPECT_FALSE(cstream->Read(&response)); - EXPECT_EQ(request.message(), exp); - - Status s = cstream->Finish(); + Status s = stub_->Echo(&context, request, &response); + EXPECT_EQ(request.message(), response.message()); EXPECT_TRUE(s.ok()); } @@ -184,30 +219,6 @@ class TestServiceImpl : public EchoTestService::Service { return Status::OK; } - Status RequestStream(ServerContext* context, - ServerReader* reader, - EchoResponse* response) override { - EchoRequest request; - grpc::string resp(""); - while (reader->Read(&request)) { - gpr_log(GPR_INFO, "recv msg %s", request.message().c_str()); - resp.append(request.message()); - } - response->set_message(resp); - return Status::OK; - } - - Status ResponseStream(ServerContext* context, const EchoRequest* request, - ServerWriter* writer) override { - EchoResponse response; - vector tokens = split(request->message()); - for (grpc::string token : tokens) { - response.set_message(token); - writer->Write(response); - } - return Status::OK; - } - Status BidiStream( ServerContext* context, ServerReaderWriter* stream) override { @@ -220,25 +231,6 @@ class TestServiceImpl : public EchoTestService::Service { } return Status::OK; } - - private: - const vector split(const grpc::string& input) { - grpc::string buff(""); - vector result; - - for (auto n : input) { - if (n != ' ') { - buff += n; - continue; - } - if (buff == "") continue; - result.push_back(buff); - buff = ""; - } - if (buff != "") result.push_back(buff); - - return result; - } }; class MockTest : public ::testing::Test { @@ -275,82 +267,16 @@ TEST_F(MockTest, SimpleRpc) { ResetStub(); FakeClient client(stub_.get()); client.DoEcho(); - MockEchoTestServiceStub stub; - EchoResponse resp; - resp.set_message("hello world"); - EXPECT_CALL(stub, Echo(_, _, _)) - .Times(AtLeast(1)) - .WillOnce(DoAll(SetArgPointee<2>(resp), Return(Status::OK))); + MockStub stub; client.ResetStub(&stub); client.DoEcho(); } -TEST_F(MockTest, ClientStream) { - ResetStub(); - FakeClient client(stub_.get()); - client.DoRequestStream(); - - MockEchoTestServiceStub stub; - auto w = new MockClientWriter(); - EchoResponse resp; - resp.set_message("hello, world"); - - EXPECT_CALL(*w, Write(_, _)).Times(2).WillRepeatedly(Return(true)); - EXPECT_CALL(*w, WritesDone()); - EXPECT_CALL(*w, Finish()).WillOnce(Return(Status::OK)); - - EXPECT_CALL(stub, RequestStreamRaw(_, _)) - .WillOnce(DoAll(SetArgPointee<1>(resp), Return(w))); - client.ResetStub(&stub); - client.DoRequestStream(); -} - -TEST_F(MockTest, ServerStream) { - ResetStub(); - FakeClient client(stub_.get()); - client.DoResponseStream(); - - MockEchoTestServiceStub stub; - auto r = new MockClientReader(); - EchoResponse resp1; - resp1.set_message("hello"); - EchoResponse resp2; - resp2.set_message("world"); - - EXPECT_CALL(*r, Read(_)) - .WillOnce(DoAll(SetArgPointee<0>(resp1), Return(true))) - .WillOnce(DoAll(SetArgPointee<0>(resp2), Return(true))) - .WillOnce(Return(false)); - EXPECT_CALL(*r, Finish()).WillOnce(Return(Status::OK)); - - EXPECT_CALL(stub, ResponseStreamRaw(_, _)).WillOnce(Return(r)); - - client.ResetStub(&stub); - client.DoResponseStream(); -} - -ACTION_P(copy, msg) { arg0->set_message(msg->message()); } - TEST_F(MockTest, BidiStream) { ResetStub(); FakeClient client(stub_.get()); client.DoBidiStream(); - MockEchoTestServiceStub stub; - auto rw = new MockClientReaderWriter(); - EchoRequest msg; - - EXPECT_CALL(*rw, Write(_, _)) - .Times(3) - .WillRepeatedly(DoAll(SaveArg<0>(&msg), Return(true))); - EXPECT_CALL(*rw, Read(_)) - .WillOnce(DoAll(WithArg<0>(copy(&msg)), Return(true))) - .WillOnce(DoAll(WithArg<0>(copy(&msg)), Return(true))) - .WillOnce(DoAll(WithArg<0>(copy(&msg)), Return(true))) - .WillOnce(Return(false)); - EXPECT_CALL(*rw, WritesDone()); - EXPECT_CALL(*rw, Finish()).WillOnce(Return(Status::OK)); - - EXPECT_CALL(stub, BidiStreamRaw(_)).WillOnce(Return(rw)); + MockStub stub; client.ResetStub(&stub); client.DoBidiStream(); } diff --git a/test/cpp/grpclb/grpclb_api_test.cc b/test/cpp/grpclb/grpclb_api_test.cc index 0b569f14157..d9df2bb6735 100644 --- a/test/cpp/grpclb/grpclb_api_test.cc +++ b/test/cpp/grpclb/grpclb_api_test.cc @@ -106,13 +106,11 @@ TEST_F(GrpclbTest, ParseResponseServerList) { auto* server = serverlist->add_servers(); server->set_ip_address(Ip4ToPackedString("127.0.0.1")); server->set_port(12345); - server->set_drop_for_rate_limiting(true); - server->set_drop_for_load_balancing(false); + server->set_drop_request(true); server = response.mutable_server_list()->add_servers(); server->set_ip_address(Ip4ToPackedString("10.0.0.1")); server->set_port(54321); - server->set_drop_for_rate_limiting(false); - server->set_drop_for_load_balancing(true); + server->set_drop_request(false); auto* expiration_interval = serverlist->mutable_expiration_interval(); expiration_interval->set_seconds(888); expiration_interval->set_nanos(999); @@ -127,14 +125,12 @@ TEST_F(GrpclbTest, ParseResponseServerList) { EXPECT_EQ(PackedStringToIp(c_serverlist->servers[0]->ip_address), "127.0.0.1"); EXPECT_EQ(c_serverlist->servers[0]->port, 12345); - EXPECT_TRUE(c_serverlist->servers[0]->drop_for_rate_limiting); - EXPECT_FALSE(c_serverlist->servers[0]->drop_for_load_balancing); + EXPECT_TRUE(c_serverlist->servers[0]->drop_request); EXPECT_TRUE(c_serverlist->servers[1]->has_ip_address); EXPECT_EQ(PackedStringToIp(c_serverlist->servers[1]->ip_address), "10.0.0.1"); EXPECT_EQ(c_serverlist->servers[1]->port, 54321); - EXPECT_FALSE(c_serverlist->servers[1]->drop_for_rate_limiting); - EXPECT_TRUE(c_serverlist->servers[1]->drop_for_load_balancing); + EXPECT_FALSE(c_serverlist->servers[1]->drop_request); EXPECT_TRUE(c_serverlist->expiration_interval.has_seconds); EXPECT_EQ(c_serverlist->expiration_interval.seconds, 888); diff --git a/test/cpp/grpclb/grpclb_test.cc b/test/cpp/grpclb/grpclb_test.cc index a002c7f77dc..eb3e5b644d7 100644 --- a/test/cpp/grpclb/grpclb_test.cc +++ b/test/cpp/grpclb/grpclb_test.cc @@ -310,7 +310,7 @@ static void start_lb_server(server_fixture *sf, int *ports, size_t nports, gpr_log(GPR_INFO, "LB Server[%s](%s) after tag 204. All done. LB server out", sf->servers_hostport, sf->balancer_name); - grpc_call_unref(s); + grpc_call_destroy(s); cq_verifier_destroy(cqv); @@ -457,7 +457,7 @@ static void start_backend_server(server_fixture *sf) { gpr_log(GPR_INFO, "Server[%s] DONE. After servicing %d calls", sf->servers_hostport, sf->num_calls_serviced); - grpc_call_unref(s); + grpc_call_destroy(s); cq_verifier_destroy(cqv); grpc_metadata_array_destroy(&request_metadata_recv); grpc_call_details_destroy(&call_details); @@ -557,7 +557,7 @@ static void perform_request(client_fixture *cf) { peer = grpc_call_get_peer(c); gpr_log(GPR_INFO, "Client DONE WITH SERVER %s ", peer); - grpc_call_unref(c); + grpc_call_destroy(c); cq_verify_empty_timeout(cqv, 1 /* seconds */); cq_verifier_destroy(cqv); @@ -573,51 +573,34 @@ static void perform_request(client_fixture *cf) { static void setup_client(const server_fixture *lb_server, const server_fixture *backends, client_fixture *cf) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + char *lb_uri; + // The grpclb LB policy will be automatically selected by virtue of + // the fact that the returned addresses are balancer addresses. + gpr_asprintf(&lb_uri, "test:///%s?lb_enabled=1&balancer_names=%s", + lb_server->servers_hostport, lb_server->balancer_name); + + grpc_arg expected_target_arg; + expected_target_arg.type = GRPC_ARG_STRING; + expected_target_arg.key = + const_cast(GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS); char *expected_target_names = NULL; const char *backends_name = lb_server->servers_hostport; gpr_asprintf(&expected_target_names, "%s;%s", backends_name, BALANCERS_NAME); - grpc_fake_resolver_response_generator *response_generator = - grpc_fake_resolver_response_generator_create(); - - grpc_lb_addresses *addresses = grpc_lb_addresses_create(1, NULL); - char *lb_uri_str; - gpr_asprintf(&lb_uri_str, "ipv4:%s", lb_server->servers_hostport); - grpc_uri *lb_uri = grpc_uri_parse(&exec_ctx, lb_uri_str, true); - GPR_ASSERT(lb_uri != NULL); - grpc_lb_addresses_set_address_from_uri(addresses, 0, lb_uri, true, - lb_server->balancer_name, NULL); - grpc_uri_destroy(lb_uri); - gpr_free(lb_uri_str); - - gpr_asprintf(&cf->server_uri, "test:///%s", lb_server->servers_hostport); - const grpc_arg fake_addresses = - grpc_lb_addresses_create_channel_arg(addresses); - grpc_channel_args *fake_result = - grpc_channel_args_copy_and_add(NULL, &fake_addresses, 1); - grpc_lb_addresses_destroy(&exec_ctx, addresses); - - const grpc_arg new_args[] = { - grpc_fake_transport_expected_targets_arg(expected_target_names), - grpc_fake_resolver_response_generator_arg(response_generator)}; - + expected_target_arg.value.string = const_cast(expected_target_names); grpc_channel_args *args = - grpc_channel_args_copy_and_add(NULL, new_args, GPR_ARRAY_SIZE(new_args)); + grpc_channel_args_copy_and_add(NULL, &expected_target_arg, 1); gpr_free(expected_target_names); - cf->cq = grpc_completion_queue_create_for_next(NULL); + cf->cq = grpc_completion_queue_create(NULL); + cf->server_uri = lb_uri; grpc_channel_credentials *fake_creds = grpc_fake_transport_security_credentials_create(); cf->client = grpc_secure_channel_create(fake_creds, cf->server_uri, args, NULL); - grpc_fake_resolver_response_generator_set_response( - &exec_ctx, response_generator, fake_result); - grpc_channel_args_destroy(&exec_ctx, fake_result); grpc_channel_credentials_unref(&exec_ctx, fake_creds); grpc_channel_args_destroy(&exec_ctx, args); - grpc_fake_resolver_response_generator_unref(response_generator); - grpc_exec_ctx_finish(&exec_ctx); } static void teardown_client(client_fixture *cf) { @@ -633,7 +616,7 @@ static void teardown_client(client_fixture *cf) { static void setup_server(const char *host, server_fixture *sf) { int assigned_port; - sf->cq = grpc_completion_queue_create_for_next(NULL); + sf->cq = grpc_completion_queue_create(NULL); const char *colon_idx = strchr(host, ':'); if (colon_idx) { const char *port_str = colon_idx + 1; @@ -660,15 +643,10 @@ static void teardown_server(server_fixture *sf) { if (!sf->server) return; gpr_log(GPR_INFO, "Server[%s] shutting down", sf->servers_hostport); - - grpc_completion_queue *shutdown_cq = - grpc_completion_queue_create_for_pluck(NULL); - grpc_server_shutdown_and_notify(sf->server, shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - NULL) + grpc_server_shutdown_and_notify(sf->server, sf->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck( + sf->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); - grpc_completion_queue_destroy(shutdown_cq); grpc_server_destroy(sf->server); gpr_thd_join(sf->tid); @@ -804,8 +782,8 @@ TEST(GrpclbTest, InvalidAddressInServerlist) {} int main(int argc, char **argv) { ::testing::InitGoogleTest(&argc, argv); - grpc_fake_resolver_init(); grpc_test_init(argc, argv); + grpc_fake_resolver_init(); grpc_init(); const auto result = RUN_ALL_TESTS(); grpc_shutdown(); diff --git a/test/cpp/interop/BUILD b/test/cpp/interop/BUILD deleted file mode 100644 index 1a3e8d916fa..00000000000 --- a/test/cpp/interop/BUILD +++ /dev/null @@ -1,90 +0,0 @@ -# Copyright 2017, Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -licenses(["notice"]) # 3-clause BSD - -cc_library( - name = "server_helper_lib", - srcs = [ - "server_helper.cc", - ], - hdrs = [ - "server_helper.h", - ], - deps = [ - "//test/cpp/util:test_util", - "//external:gflags", - ], -) - -cc_binary( - name = "interop_server", - srcs = [ - "interop_server.cc", - "interop_server_bootstrap.cc", - ], - deps = [ - ":server_helper_lib", - "//:grpc++", - "//src/proto/grpc/testing:empty_proto", - "//src/proto/grpc/testing:messages_proto", - "//src/proto/grpc/testing:test_proto", - "//test/cpp/util:test_config", - ], -) - -cc_library( - name = "client_helper_lib", - srcs = [ - "client_helper.cc", - "interop_client.cc", - ], - hdrs = [ - "client_helper.h", - "interop_client.h", - ], - deps = [ - "//test/cpp/util:test_util", - "//src/proto/grpc/testing:empty_proto", - "//src/proto/grpc/testing:messages_proto", - "//src/proto/grpc/testing:test_proto", - "//test/core/security:oauth2_utils", - "//test/cpp/util:test_config", - ], -) - -cc_binary( - name = "interop_client", - srcs = [ - "client.cc", - ], - deps = [ - ":client_helper_lib", - ], -) diff --git a/test/cpp/interop/client.cc b/test/cpp/interop/client.cc index 6f1d910304c..369413e6a1d 100644 --- a/test/cpp/interop/client.cc +++ b/test/cpp/interop/client.cc @@ -163,8 +163,8 @@ int main(int argc, char** argv) { std::bind(&grpc::testing::InteropClient::DoUnimplementedMethod, &client); actions["unimplemented_service"] = std::bind(&grpc::testing::InteropClient::DoUnimplementedService, &client); - actions["cacheable_unary"] = - std::bind(&grpc::testing::InteropClient::DoCacheableUnary, &client); + // actions["cacheable_unary"] = + // std::bind(&grpc::testing::InteropClient::DoCacheableUnary, &client); UpdateActions(&actions); diff --git a/test/cpp/interop/http2_client.cc b/test/cpp/interop/http2_client.cc index 2109e346164..38a437f39f8 100644 --- a/test/cpp/interop/http2_client.cc +++ b/test/cpp/interop/http2_client.cc @@ -108,7 +108,7 @@ bool Http2Client::DoRstAfterData() { SimpleResponse response; AssertStatusCode(SendUnaryCall(&response), grpc::StatusCode::INTERNAL); - // There is no guarantee that data would be received. + GPR_ASSERT(response.has_payload()); // data should be received gpr_log(GPR_DEBUG, "Done testing reset stream after data"); return true; diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc index 0e79c5e4b44..55ba324cc7d 100644 --- a/test/cpp/interop/interop_client.cc +++ b/test/cpp/interop/interop_client.cc @@ -918,26 +918,6 @@ bool InteropClient::DoCacheableUnary() { // second response is a cached copy of the first response GPR_ASSERT(response2.payload().body() == response1.payload().body()); - // Request 3 - // Modify the request body so it will not get a cache hit - ts = gpr_now(GPR_CLOCK_PRECISE); - timestamp = std::to_string((long long unsigned)ts.tv_nsec); - SimpleRequest request1; - request1.mutable_payload()->set_body(timestamp.c_str(), timestamp.size()); - ClientContext context3; - SimpleResponse response3; - context3.set_cacheable(true); - context3.AddMetadata("x-user-ip", "1.2.3.4"); - Status s3 = - serviceStub_.Get()->CacheableUnaryCall(&context3, request1, &response3); - if (!AssertStatusOk(s3)) { - return false; - } - gpr_log(GPR_DEBUG, "response 3 payload: %s", - response3.payload().body().c_str()); - - // Check that the response is different from the previous response. - GPR_ASSERT(response3.payload().body() != response1.payload().body()); return true; } diff --git a/test/cpp/microbenchmarks/bm_call_create.cc b/test/cpp/microbenchmarks/bm_call_create.cc index c91219e98c8..136b7c0340f 100644 --- a/test/cpp/microbenchmarks/bm_call_create.cc +++ b/test/cpp/microbenchmarks/bm_call_create.cc @@ -46,14 +46,14 @@ extern "C" { #include "src/core/ext/filters/client_channel/client_channel.h" -#include "src/core/ext/filters/deadline/deadline_filter.h" -#include "src/core/ext/filters/http/client/http_client_filter.h" -#include "src/core/ext/filters/http/message_compress/message_compress_filter.h" -#include "src/core/ext/filters/http/server/http_server_filter.h" #include "src/core/ext/filters/load_reporting/load_reporting_filter.h" -#include "src/core/ext/filters/message_size/message_size_filter.h" #include "src/core/lib/channel/channel_stack.h" +#include "src/core/lib/channel/compress_filter.h" #include "src/core/lib/channel/connected_channel.h" +#include "src/core/lib/channel/deadline_filter.h" +#include "src/core/lib/channel/http_client_filter.h" +#include "src/core/lib/channel/http_server_filter.h" +#include "src/core/lib/channel/message_size_filter.h" #include "src/core/lib/profiling/timers.h" #include "src/core/lib/surface/channel.h" #include "src/core/lib/transport/transport_impl.h" @@ -68,12 +68,10 @@ auto &force_library_initialization = Library::get(); void BM_Zalloc(benchmark::State &state) { // speed of light for call creation is zalloc, so benchmark a few interesting // sizes - TrackCounters track_counters; size_t sz = state.range(0); while (state.KeepRunning()) { gpr_free(gpr_zalloc(sz)); } - track_counters.Finish(state); } BENCHMARK(BM_Zalloc) ->Arg(64) @@ -121,12 +119,12 @@ template static void BM_CallCreateDestroy(benchmark::State &state) { TrackCounters track_counters; Fixture fixture; - grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL); + grpc_completion_queue *cq = grpc_completion_queue_create(NULL); gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC); void *method_hdl = grpc_channel_register_call(fixture.channel(), "/foo/bar", NULL, NULL); while (state.KeepRunning()) { - grpc_call_unref(grpc_channel_create_registered_call( + grpc_call_destroy(grpc_channel_create_registered_call( fixture.channel(), NULL, GRPC_PROPAGATE_DEFAULTS, cq, method_hdl, deadline, NULL)); } @@ -168,165 +166,6 @@ static void BM_LameChannelCallCreateCpp(benchmark::State &state) { } BENCHMARK(BM_LameChannelCallCreateCpp); -static void do_nothing(void *ignored) {} - -static void BM_LameChannelCallCreateCore(benchmark::State &state) { - TrackCounters track_counters; - - grpc_channel *channel; - grpc_completion_queue *cq; - grpc_metadata_array initial_metadata_recv; - grpc_metadata_array trailing_metadata_recv; - grpc_byte_buffer *response_payload_recv = NULL; - grpc_status_code status; - grpc_slice details; - grpc::testing::EchoRequest send_request; - grpc_slice send_request_slice = - grpc_slice_new(&send_request, sizeof(send_request), do_nothing); - - channel = grpc_lame_client_channel_create( - "localhost:1234", GRPC_STATUS_UNAUTHENTICATED, "blah"); - cq = grpc_completion_queue_create_for_next(NULL); - void *rc = grpc_channel_register_call( - channel, "/grpc.testing.EchoTestService/Echo", NULL, NULL); - while (state.KeepRunning()) { - GPR_TIMER_SCOPE("BenchmarkCycle", 0); - grpc_call *call = grpc_channel_create_registered_call( - channel, NULL, GRPC_PROPAGATE_DEFAULTS, cq, rc, - gpr_inf_future(GPR_CLOCK_REALTIME), NULL); - grpc_metadata_array_init(&initial_metadata_recv); - grpc_metadata_array_init(&trailing_metadata_recv); - grpc_byte_buffer *request_payload_send = - grpc_raw_byte_buffer_create(&send_request_slice, 1); - - // Fill in call ops - grpc_op ops[6]; - memset(ops, 0, sizeof(ops)); - grpc_op *op = ops; - op->op = GRPC_OP_SEND_INITIAL_METADATA; - op->data.send_initial_metadata.count = 0; - op++; - op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message.send_message = request_payload_send; - op++; - op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; - op++; - op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata.recv_initial_metadata = - &initial_metadata_recv; - op++; - op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message.recv_message = &response_payload_recv; - 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++; - - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(call, ops, - (size_t)(op - ops), - (void *)1, NULL)); - grpc_event ev = grpc_completion_queue_next( - cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); - GPR_ASSERT(ev.type != GRPC_QUEUE_SHUTDOWN); - GPR_ASSERT(ev.success != 0); - grpc_call_unref(call); - grpc_byte_buffer_destroy(request_payload_send); - grpc_byte_buffer_destroy(response_payload_recv); - grpc_metadata_array_destroy(&initial_metadata_recv); - grpc_metadata_array_destroy(&trailing_metadata_recv); - } - grpc_channel_destroy(channel); - grpc_completion_queue_destroy(cq); - grpc_slice_unref(send_request_slice); - track_counters.Finish(state); -} -BENCHMARK(BM_LameChannelCallCreateCore); - -static void BM_LameChannelCallCreateCoreSeparateBatch(benchmark::State &state) { - TrackCounters track_counters; - - grpc_channel *channel; - grpc_completion_queue *cq; - grpc_metadata_array initial_metadata_recv; - grpc_metadata_array trailing_metadata_recv; - grpc_byte_buffer *response_payload_recv = NULL; - grpc_status_code status; - grpc_slice details; - grpc::testing::EchoRequest send_request; - grpc_slice send_request_slice = - grpc_slice_new(&send_request, sizeof(send_request), do_nothing); - - channel = grpc_lame_client_channel_create( - "localhost:1234", GRPC_STATUS_UNAUTHENTICATED, "blah"); - cq = grpc_completion_queue_create_for_next(NULL); - void *rc = grpc_channel_register_call( - channel, "/grpc.testing.EchoTestService/Echo", NULL, NULL); - while (state.KeepRunning()) { - GPR_TIMER_SCOPE("BenchmarkCycle", 0); - grpc_call *call = grpc_channel_create_registered_call( - channel, NULL, GRPC_PROPAGATE_DEFAULTS, cq, rc, - gpr_inf_future(GPR_CLOCK_REALTIME), NULL); - grpc_metadata_array_init(&initial_metadata_recv); - grpc_metadata_array_init(&trailing_metadata_recv); - grpc_byte_buffer *request_payload_send = - grpc_raw_byte_buffer_create(&send_request_slice, 1); - - // Fill in call ops - grpc_op ops[3]; - memset(ops, 0, sizeof(ops)); - grpc_op *op = ops; - op->op = GRPC_OP_SEND_INITIAL_METADATA; - op->data.send_initial_metadata.count = 0; - op++; - op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message.send_message = request_payload_send; - op++; - op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; - op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(call, ops, - (size_t)(op - ops), - (void *)0, NULL)); - memset(ops, 0, sizeof(ops)); - op = ops; - op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata.recv_initial_metadata = - &initial_metadata_recv; - op++; - op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message.recv_message = &response_payload_recv; - 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++; - - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(call, ops, - (size_t)(op - ops), - (void *)1, NULL)); - grpc_event ev = grpc_completion_queue_next( - cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); - GPR_ASSERT(ev.type != GRPC_QUEUE_SHUTDOWN); - GPR_ASSERT(ev.success == 0); - ev = grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), - NULL); - GPR_ASSERT(ev.type != GRPC_QUEUE_SHUTDOWN); - GPR_ASSERT(ev.success != 0); - grpc_call_unref(call); - grpc_byte_buffer_destroy(request_payload_send); - grpc_byte_buffer_destroy(response_payload_recv); - grpc_metadata_array_destroy(&initial_metadata_recv); - grpc_metadata_array_destroy(&trailing_metadata_recv); - } - grpc_channel_destroy(channel); - grpc_completion_queue_destroy(cq); - grpc_slice_unref(send_request_slice); - track_counters.Finish(state); -} -BENCHMARK(BM_LameChannelCallCreateCoreSeparateBatch); - static void FilterDestroy(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { gpr_free(arg); @@ -622,7 +461,7 @@ BENCHMARK_TEMPLATE(BM_IsolatedFilter, DummyFilter, NoOp); BENCHMARK_TEMPLATE(BM_IsolatedFilter, DummyFilter, SendEmptyMetadata); typedef Fixture<&grpc_client_channel_filter, 0> ClientChannelFilter; BENCHMARK_TEMPLATE(BM_IsolatedFilter, ClientChannelFilter, NoOp); -typedef Fixture<&grpc_message_compress_filter, CHECKS_NOT_LAST> CompressFilter; +typedef Fixture<&grpc_compress_filter, CHECKS_NOT_LAST> CompressFilter; BENCHMARK_TEMPLATE(BM_IsolatedFilter, CompressFilter, NoOp); BENCHMARK_TEMPLATE(BM_IsolatedFilter, CompressFilter, SendEmptyMetadata); typedef Fixture<&grpc_client_deadline_filter, CHECKS_NOT_LAST> @@ -721,7 +560,7 @@ static const grpc_channel_filter isolated_call_filter = { GetPeer, GetChannelInfo, "isolated_call_filter"}; -} // namespace isolated_call_filter +} class IsolatedCallFixture : public TrackCounters { public: @@ -737,7 +576,7 @@ class IsolatedCallFixture : public TrackCounters { GRPC_CLIENT_CHANNEL); grpc_exec_ctx_finish(&exec_ctx); } - cq_ = grpc_completion_queue_create_for_next(NULL); + cq_ = grpc_completion_queue_create(NULL); } void Finish(benchmark::State &state) { @@ -761,7 +600,7 @@ static void BM_IsolatedCall_NoOp(benchmark::State &state) { grpc_channel_register_call(fixture.channel(), "/foo/bar", NULL, NULL); while (state.KeepRunning()) { GPR_TIMER_SCOPE("BenchmarkCycle", 0); - grpc_call_unref(grpc_channel_create_registered_call( + grpc_call_destroy(grpc_channel_create_registered_call( fixture.channel(), nullptr, GRPC_PROPAGATE_DEFAULTS, fixture.cq(), method_hdl, deadline, NULL)); } @@ -806,7 +645,7 @@ static void BM_IsolatedCall_Unary(benchmark::State &state) { grpc_call_start_batch(call, ops, 6, tag(1), NULL); grpc_completion_queue_next(fixture.cq(), gpr_inf_future(GPR_CLOCK_MONOTONIC), NULL); - grpc_call_unref(call); + grpc_call_destroy(call); } fixture.Finish(state); grpc_metadata_array_destroy(&recv_initial_metadata); @@ -847,7 +686,7 @@ static void BM_IsolatedCall_StreamingSend(benchmark::State &state) { grpc_completion_queue_next(fixture.cq(), gpr_inf_future(GPR_CLOCK_MONOTONIC), NULL); } - grpc_call_unref(call); + grpc_call_destroy(call); fixture.Finish(state); grpc_metadata_array_destroy(&recv_initial_metadata); grpc_metadata_array_destroy(&recv_trailing_metadata); diff --git a/test/cpp/microbenchmarks/bm_chttp2_transport.cc b/test/cpp/microbenchmarks/bm_chttp2_transport.cc index 8c5413b5fda..c89f349ca7f 100644 --- a/test/cpp/microbenchmarks/bm_chttp2_transport.cc +++ b/test/cpp/microbenchmarks/bm_chttp2_transport.cc @@ -569,17 +569,12 @@ static void BM_TransportStreamRecv(benchmark::State &state) { grpc_closure_sched(exec_ctx, c.get(), GRPC_ERROR_NONE); return; } - } while (grpc_byte_stream_next(exec_ctx, recv_stream, + } while (grpc_byte_stream_next(exec_ctx, recv_stream, &recv_slice, recv_stream->length - received, - drain_continue.get()) && - GRPC_ERROR_NONE == - grpc_byte_stream_pull(exec_ctx, recv_stream, &recv_slice) && - (received += GRPC_SLICE_LENGTH(recv_slice), - grpc_slice_unref_internal(exec_ctx, recv_slice), true)); + drain_continue.get())); }); drain_continue = MakeClosure([&](grpc_exec_ctx *exec_ctx, grpc_error *error) { - grpc_byte_stream_pull(exec_ctx, recv_stream, &recv_slice); received += GRPC_SLICE_LENGTH(recv_slice); grpc_slice_unref_internal(exec_ctx, recv_slice); grpc_closure_run(exec_ctx, drain.get(), GRPC_ERROR_NONE); diff --git a/test/cpp/microbenchmarks/bm_cq.cc b/test/cpp/microbenchmarks/bm_cq.cc index 8b26bf977ca..38ac9d27053 100644 --- a/test/cpp/microbenchmarks/bm_cq.cc +++ b/test/cpp/microbenchmarks/bm_cq.cc @@ -62,8 +62,7 @@ BENCHMARK(BM_CreateDestroyCpp); static void BM_CreateDestroyCpp2(benchmark::State& state) { TrackCounters track_counters; while (state.KeepRunning()) { - grpc_completion_queue* core_cq = - grpc_completion_queue_create_for_next(NULL); + grpc_completion_queue* core_cq = grpc_completion_queue_create(NULL); CompletionQueue cq(core_cq); } track_counters.Finish(state); @@ -73,9 +72,7 @@ BENCHMARK(BM_CreateDestroyCpp2); static void BM_CreateDestroyCore(benchmark::State& state) { TrackCounters track_counters; while (state.KeepRunning()) { - // TODO: sreek Templatize this benchmark and pass completion type and - // polling type as parameters - grpc_completion_queue_destroy(grpc_completion_queue_create_for_next(NULL)); + grpc_completion_queue_destroy(grpc_completion_queue_create(NULL)); } track_counters.Finish(state); } @@ -111,8 +108,7 @@ BENCHMARK(BM_Pass1Cpp); static void BM_Pass1Core(benchmark::State& state) { TrackCounters track_counters; - // TODO: sreek Templatize this benchmark and pass polling_type as a param - grpc_completion_queue* cq = grpc_completion_queue_create_for_next(NULL); + grpc_completion_queue* cq = grpc_completion_queue_create(NULL); gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC); while (state.KeepRunning()) { grpc_cq_completion completion; @@ -130,8 +126,7 @@ BENCHMARK(BM_Pass1Core); static void BM_Pluck1Core(benchmark::State& state) { TrackCounters track_counters; - // TODO: sreek Templatize this benchmark and pass polling_type as a param - grpc_completion_queue* cq = grpc_completion_queue_create_for_pluck(NULL); + grpc_completion_queue* cq = grpc_completion_queue_create(NULL); gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC); while (state.KeepRunning()) { grpc_cq_completion completion; @@ -149,8 +144,7 @@ BENCHMARK(BM_Pluck1Core); static void BM_EmptyCore(benchmark::State& state) { TrackCounters track_counters; - // TODO: sreek Templatize this benchmark and pass polling_type as a param - grpc_completion_queue* cq = grpc_completion_queue_create_for_next(NULL); + grpc_completion_queue* cq = grpc_completion_queue_create(NULL); gpr_timespec deadline = gpr_inf_past(GPR_CLOCK_MONOTONIC); while (state.KeepRunning()) { grpc_completion_queue_next(cq, deadline, NULL); diff --git a/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc b/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc index 9d7f65d2923..86274632042 100644 --- a/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc +++ b/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc @@ -108,7 +108,7 @@ static void setup() { init_engine_vtable(); grpc_set_event_engine_test_only(&g_vtable); - g_cq = grpc_completion_queue_create_for_next(NULL); + g_cq = grpc_completion_queue_create(NULL); } static void teardown() { diff --git a/test/cpp/microbenchmarks/bm_fullstack_streaming_ping_pong.cc b/test/cpp/microbenchmarks/bm_fullstack_streaming_ping_pong.cc index fd2210c4747..c536e15a2cc 100644 --- a/test/cpp/microbenchmarks/bm_fullstack_streaming_ping_pong.cc +++ b/test/cpp/microbenchmarks/bm_fullstack_streaming_ping_pong.cc @@ -436,18 +436,6 @@ BENCHMARK_TEMPLATE(BM_StreamingPingPongMsgs, InProcessCHTTP2, NoOpMutator, BENCHMARK_TEMPLATE(BM_StreamingPingPongMsgs, TCP, NoOpMutator, NoOpMutator) ->Range(0, 128 * 1024 * 1024); -BENCHMARK_TEMPLATE(BM_StreamingPingPong, MinInProcessCHTTP2, NoOpMutator, - NoOpMutator) - ->Apply(StreamingPingPongArgs); -BENCHMARK_TEMPLATE(BM_StreamingPingPong, MinTCP, NoOpMutator, NoOpMutator) - ->Apply(StreamingPingPongArgs); - -BENCHMARK_TEMPLATE(BM_StreamingPingPongMsgs, MinInProcessCHTTP2, NoOpMutator, - NoOpMutator) - ->Range(0, 128 * 1024 * 1024); -BENCHMARK_TEMPLATE(BM_StreamingPingPongMsgs, MinTCP, NoOpMutator, NoOpMutator) - ->Range(0, 128 * 1024 * 1024); - // Generate Args for StreamingPingPongWithCoalescingApi benchmarks. Currently // generates args for only "small streams" (i.e streams with 0, 1 or 2 messages) static void StreamingPingPongWithCoalescingApiArgs( @@ -471,9 +459,6 @@ static void StreamingPingPongWithCoalescingApiArgs( BENCHMARK_TEMPLATE(BM_StreamingPingPongWithCoalescingApi, InProcessCHTTP2, NoOpMutator, NoOpMutator) ->Apply(StreamingPingPongWithCoalescingApiArgs); -BENCHMARK_TEMPLATE(BM_StreamingPingPongWithCoalescingApi, MinInProcessCHTTP2, - NoOpMutator, NoOpMutator) - ->Apply(StreamingPingPongWithCoalescingApiArgs); } // namespace testing } // namespace grpc diff --git a/test/cpp/microbenchmarks/bm_fullstack_streaming_pump.cc b/test/cpp/microbenchmarks/bm_fullstack_streaming_pump.cc index 47705d30318..5c1eb1165b5 100644 --- a/test/cpp/microbenchmarks/bm_fullstack_streaming_pump.cc +++ b/test/cpp/microbenchmarks/bm_fullstack_streaming_pump.cc @@ -189,14 +189,6 @@ BENCHMARK_TEMPLATE(BM_PumpStreamServerToClient, SockPair) ->Range(0, 128 * 1024 * 1024); BENCHMARK_TEMPLATE(BM_PumpStreamServerToClient, InProcessCHTTP2) ->Range(0, 128 * 1024 * 1024); -BENCHMARK_TEMPLATE(BM_PumpStreamClientToServer, MinTCP)->Arg(0); -BENCHMARK_TEMPLATE(BM_PumpStreamClientToServer, MinUDS)->Arg(0); -BENCHMARK_TEMPLATE(BM_PumpStreamClientToServer, MinSockPair)->Arg(0); -BENCHMARK_TEMPLATE(BM_PumpStreamClientToServer, MinInProcessCHTTP2)->Arg(0); -BENCHMARK_TEMPLATE(BM_PumpStreamServerToClient, MinTCP)->Arg(0); -BENCHMARK_TEMPLATE(BM_PumpStreamServerToClient, MinUDS)->Arg(0); -BENCHMARK_TEMPLATE(BM_PumpStreamServerToClient, MinSockPair)->Arg(0); -BENCHMARK_TEMPLATE(BM_PumpStreamServerToClient, MinInProcessCHTTP2)->Arg(0); } // namespace testing } // namespace grpc diff --git a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc index a5cfeb4f955..c563f28b55c 100644 --- a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc +++ b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc @@ -53,8 +53,7 @@ static void* tag(intptr_t x) { return reinterpret_cast(x); } class TrickledCHTTP2 : public EndpointPairFixture { public: TrickledCHTTP2(Service* service, size_t megabits_per_second) - : EndpointPairFixture(service, MakeEndpoints(megabits_per_second), - FixtureConfiguration()) {} + : EndpointPairFixture(service, MakeEndpoints(megabits_per_second)) {} void AddToLabel(std::ostream& out, benchmark::State& state) { out << " writes/iter:" diff --git a/test/cpp/microbenchmarks/bm_fullstack_unary_ping_pong.cc b/test/cpp/microbenchmarks/bm_fullstack_unary_ping_pong.cc index 7524751fbce..615b05b7c7f 100644 --- a/test/cpp/microbenchmarks/bm_fullstack_unary_ping_pong.cc +++ b/test/cpp/microbenchmarks/bm_fullstack_unary_ping_pong.cc @@ -141,21 +141,12 @@ static void SweepSizesArgs(benchmark::internal::Benchmark* b) { BENCHMARK_TEMPLATE(BM_UnaryPingPong, TCP, NoOpMutator, NoOpMutator) ->Apply(SweepSizesArgs); -BENCHMARK_TEMPLATE(BM_UnaryPingPong, MinTCP, NoOpMutator, NoOpMutator) - ->Apply(SweepSizesArgs); BENCHMARK_TEMPLATE(BM_UnaryPingPong, UDS, NoOpMutator, NoOpMutator) ->Args({0, 0}); -BENCHMARK_TEMPLATE(BM_UnaryPingPong, MinUDS, NoOpMutator, NoOpMutator) - ->Args({0, 0}); BENCHMARK_TEMPLATE(BM_UnaryPingPong, SockPair, NoOpMutator, NoOpMutator) ->Args({0, 0}); -BENCHMARK_TEMPLATE(BM_UnaryPingPong, MinSockPair, NoOpMutator, NoOpMutator) - ->Args({0, 0}); BENCHMARK_TEMPLATE(BM_UnaryPingPong, InProcessCHTTP2, NoOpMutator, NoOpMutator) ->Apply(SweepSizesArgs); -BENCHMARK_TEMPLATE(BM_UnaryPingPong, MinInProcessCHTTP2, NoOpMutator, - NoOpMutator) - ->Apply(SweepSizesArgs); BENCHMARK_TEMPLATE(BM_UnaryPingPong, InProcessCHTTP2, Client_AddMetadata, 1>, NoOpMutator) ->Args({0, 0}); diff --git a/test/cpp/microbenchmarks/fullstack_fixtures.h b/test/cpp/microbenchmarks/fullstack_fixtures.h index 98aca1c3465..acc56bf39bf 100644 --- a/test/cpp/microbenchmarks/fullstack_fixtures.h +++ b/test/cpp/microbenchmarks/fullstack_fixtures.h @@ -61,33 +61,29 @@ extern "C" { namespace grpc { namespace testing { -class FixtureConfiguration { - public: - virtual void ApplyCommonChannelArguments(ChannelArguments* c) const { - c->SetInt(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH, INT_MAX); - c->SetInt(GRPC_ARG_MAX_SEND_MESSAGE_LENGTH, INT_MAX); - } +static void ApplyCommonServerBuilderConfig(ServerBuilder* b) { + b->SetMaxReceiveMessageSize(INT_MAX); + b->SetMaxSendMessageSize(INT_MAX); +} - virtual void ApplyCommonServerBuilderConfig(ServerBuilder* b) const { - b->SetMaxReceiveMessageSize(INT_MAX); - b->SetMaxSendMessageSize(INT_MAX); - } -}; +static void ApplyCommonChannelArguments(ChannelArguments* c) { + c->SetInt(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH, INT_MAX); + c->SetInt(GRPC_ARG_MAX_SEND_MESSAGE_LENGTH, INT_MAX); +} class BaseFixture : public TrackCounters {}; class FullstackFixture : public BaseFixture { public: - FullstackFixture(Service* service, const FixtureConfiguration& config, - const grpc::string& address) { + FullstackFixture(Service* service, const grpc::string& address) { ServerBuilder b; b.AddListeningPort(address, InsecureServerCredentials()); cq_ = b.AddCompletionQueue(true); b.RegisterService(service); - config.ApplyCommonServerBuilderConfig(&b); + ApplyCommonServerBuilderConfig(&b); server_ = b.BuildAndStart(); ChannelArguments args; - config.ApplyCommonChannelArguments(&args); + ApplyCommonChannelArguments(&args); channel_ = CreateCustomChannel(address, InsecureChannelCredentials(), args); } @@ -111,52 +107,39 @@ class FullstackFixture : public BaseFixture { class TCP : public FullstackFixture { public: - TCP(Service* service, const FixtureConfiguration& fixture_configuration = - FixtureConfiguration()) - : FullstackFixture(service, fixture_configuration, MakeAddress(&port_)) {} - - ~TCP() { grpc_recycle_unused_port(port_); } + TCP(Service* service) : FullstackFixture(service, MakeAddress()) {} private: - int port_; - - static grpc::string MakeAddress(int* port) { - *port = grpc_pick_unused_port_or_die(); + static grpc::string MakeAddress() { + int port = grpc_pick_unused_port_or_die(); std::stringstream addr; - addr << "localhost:" << *port; + addr << "localhost:" << port; return addr.str(); } }; class UDS : public FullstackFixture { public: - UDS(Service* service, const FixtureConfiguration& fixture_configuration = - FixtureConfiguration()) - : FullstackFixture(service, fixture_configuration, MakeAddress(&port_)) {} - - ~UDS() { grpc_recycle_unused_port(port_); } + UDS(Service* service) : FullstackFixture(service, MakeAddress()) {} private: - int port_; - - static grpc::string MakeAddress(int* port) { - *port = grpc_pick_unused_port_or_die(); // just for a unique id - not a - // real port + static grpc::string MakeAddress() { + int port = grpc_pick_unused_port_or_die(); // just for a unique id - not a + // real port std::stringstream addr; - addr << "unix:/tmp/bm_fullstack." << *port; + addr << "unix:/tmp/bm_fullstack." << port; return addr.str(); } }; class EndpointPairFixture : public BaseFixture { public: - EndpointPairFixture(Service* service, grpc_endpoint_pair endpoints, - const FixtureConfiguration& fixture_configuration) + EndpointPairFixture(Service* service, grpc_endpoint_pair endpoints) : endpoint_pair_(endpoints) { ServerBuilder b; cq_ = b.AddCompletionQueue(true); b.RegisterService(service); - fixture_configuration.ApplyCommonServerBuilderConfig(&b); + ApplyCommonServerBuilderConfig(&b); server_ = b.BuildAndStart(); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; @@ -186,7 +169,7 @@ class EndpointPairFixture : public BaseFixture { { ChannelArguments args; args.SetString(GRPC_ARG_DEFAULT_AUTHORITY, "test.authority"); - fixture_configuration.ApplyCommonChannelArguments(&args); + ApplyCommonChannelArguments(&args); grpc_channel_args c_args = args.c_channel_args(); client_transport_ = @@ -228,19 +211,15 @@ class EndpointPairFixture : public BaseFixture { class SockPair : public EndpointPairFixture { public: - SockPair(Service* service, const FixtureConfiguration& fixture_configuration = - FixtureConfiguration()) + SockPair(Service* service) : EndpointPairFixture(service, - grpc_iomgr_create_endpoint_pair("test", NULL), - fixture_configuration) {} + grpc_iomgr_create_endpoint_pair("test", NULL)) {} }; class InProcessCHTTP2 : public EndpointPairFixture { public: - InProcessCHTTP2(Service* service, - const FixtureConfiguration& fixture_configuration = - FixtureConfiguration()) - : EndpointPairFixture(service, MakeEndpoints(), fixture_configuration) {} + InProcessCHTTP2(Service* service) + : EndpointPairFixture(service, MakeEndpoints()) {} void AddToLabel(std::ostream& out, benchmark::State& state) { EndpointPairFixture::AddToLabel(out, state); @@ -259,32 +238,6 @@ class InProcessCHTTP2 : public EndpointPairFixture { } }; -//////////////////////////////////////////////////////////////////////////////// -// Minimal stack fixtures - -class MinStackConfiguration : public FixtureConfiguration { - void ApplyCommonChannelArguments(ChannelArguments* a) const override { - a->SetInt(GRPC_ARG_MINIMAL_STACK, 1); - FixtureConfiguration::ApplyCommonChannelArguments(a); - } - - void ApplyCommonServerBuilderConfig(ServerBuilder* b) const override { - b->AddChannelArgument(GRPC_ARG_MINIMAL_STACK, 1); - FixtureConfiguration::ApplyCommonServerBuilderConfig(b); - } -}; - -template -class MinStackize : public Base { - public: - MinStackize(Service* service) : Base(service, MinStackConfiguration()) {} -}; - -typedef MinStackize MinTCP; -typedef MinStackize MinUDS; -typedef MinStackize MinSockPair; -typedef MinStackize MinInProcessCHTTP2; - } // namespace testing } // namespace grpc diff --git a/test/cpp/microbenchmarks/helpers.cc b/test/cpp/microbenchmarks/helpers.cc index 6550742453a..d277c5984cd 100644 --- a/test/cpp/microbenchmarks/helpers.cc +++ b/test/cpp/microbenchmarks/helpers.cc @@ -57,10 +57,6 @@ void TrackCounters::AddToLabel(std::ostream &out, benchmark::State &state) { << ((double)(gpr_atm_no_barrier_load(&gpr_counter_atm_add) - atm_add_at_start_) / (double)state.iterations()) - << " nows/iter:" - << ((double)(gpr_atm_no_barrier_load(&gpr_now_call_count) - - now_calls_at_start_) / - (double)state.iterations()) << " allocs/iter:" << ((double)(counters_at_end.total_allocs_absolute - counters_at_start_.total_allocs_absolute) / diff --git a/test/cpp/microbenchmarks/helpers.h b/test/cpp/microbenchmarks/helpers.h index 7360a1c9f26..49ed517b1d7 100644 --- a/test/cpp/microbenchmarks/helpers.h +++ b/test/cpp/microbenchmarks/helpers.h @@ -72,7 +72,6 @@ class Library { extern "C" gpr_atm gpr_mu_locks; extern "C" gpr_atm gpr_counter_atm_cas; extern "C" gpr_atm gpr_counter_atm_add; -extern "C" gpr_atm gpr_now_call_count; #endif class TrackCounters { @@ -87,8 +86,6 @@ class TrackCounters { gpr_atm_no_barrier_load(&gpr_counter_atm_cas); const size_t atm_add_at_start_ = gpr_atm_no_barrier_load(&gpr_counter_atm_add); - const size_t now_calls_at_start_ = - gpr_atm_no_barrier_load(&gpr_now_call_count); grpc_memory_counters counters_at_start_ = grpc_memory_counters_snapshot(); #endif }; diff --git a/test/cpp/qps/client_sync.cc b/test/cpp/qps/client_sync.cc index f8ce2cccbea..a020adde511 100644 --- a/test/cpp/qps/client_sync.cc +++ b/test/cpp/qps/client_sync.cc @@ -153,22 +153,16 @@ class SynchronousStreamingClient final : public SynchronousClient { StartThreads(num_threads_); } ~SynchronousStreamingClient() { - std::vector cleanup_threads; for (size_t i = 0; i < num_threads_; i++) { - cleanup_threads.emplace_back([this, i]() { - auto stream = &stream_[i]; - if (*stream) { - (*stream)->WritesDone(); - Status s = (*stream)->Finish(); - if (!s.ok()) { - gpr_log(GPR_ERROR, "Stream %" PRIuPTR " received an error %s", i, - s.error_message().c_str()); - } + auto stream = &stream_[i]; + if (*stream) { + (*stream)->WritesDone(); + Status s = (*stream)->Finish(); + if (!s.ok()) { + gpr_log(GPR_ERROR, "Stream %" PRIuPTR " received an error %s", i, + s.error_message().c_str()); } - }); - } - for (size_t i = 0; i < num_threads_; i++) { - cleanup_threads[i].join(); + } } } @@ -185,8 +179,6 @@ class SynchronousStreamingClient final : public SynchronousClient { if ((messages_per_stream_ != 0) && (++messages_issued_[thread_idx] < messages_per_stream_)) { return true; - } else if (messages_per_stream_ == 0) { - return true; } else { // Fall through to the below resetting code after finish } diff --git a/test/cpp/util/BUILD b/test/cpp/util/BUILD index c83f89eb906..38f804ffd40 100644 --- a/test/cpp/util/BUILD +++ b/test/cpp/util/BUILD @@ -29,15 +29,6 @@ licenses(["notice"]) # 3-clause BSD -# The following builds a shared-object to confirm that grpc++_unsecure -# builds properly. Build-only is sufficient here -cc_binary( - name = "testso.so", - srcs = [], - deps = ["//:grpc++_unsecure"], - linkshared = 1, -) - cc_library( name = "test_config", srcs = [ diff --git a/third_party/cares/cares.BUILD b/third_party/cares/cares.BUILD index 3583720ef3d..48096aa0551 100644 --- a/third_party/cares/cares.BUILD +++ b/third_party/cares/cares.BUILD @@ -1,8 +1,3 @@ -config_setting( - name = "darwin", - values = {"cpu": "darwin"}, -) - cc_library( name = "ares", srcs = [ @@ -58,6 +53,7 @@ cc_library( ], hdrs = [ "ares_build.h", + "config_linux/ares_config.h", "cares/ares.h", "cares/ares_data.h", "cares/ares_dns.h", @@ -79,17 +75,12 @@ cc_library( "cares/bitncmp.h", "cares/config-win32.h", "cares/setup_once.h", - ] + select({ - ":darwin": ["config_darwin/ares_config.h"], - "//conditions:default": ["config_linux/ares_config.h"], - }), + ], includes = [ ".", - "cares" - ] + select({ - ":darwin": ["config_darwin"], - "//conditions:default": ["config_linux"], - }), + "config_linux", + "cares", + ], linkstatic = 1, visibility = [ "//visibility:public", diff --git a/third_party/cares/config_freebsd/ares_config.h b/third_party/cares/config_freebsd/ares_config.h deleted file mode 100644 index 605db129e2f..00000000000 --- a/third_party/cares/config_freebsd/ares_config.h +++ /dev/null @@ -1,502 +0,0 @@ -/* ares_config.h. Generated from ares_config.h.in by configure. */ -/* ares_config.h.in. Generated from configure.ac by autoheader. */ - -/* Define if building universal (internal helper macro) */ -/* #undef AC_APPLE_UNIVERSAL_BUILD */ - -/* define this if ares is built for a big endian system */ -/* #undef ARES_BIG_ENDIAN */ - -/* when building as static part of libcurl */ -/* #undef BUILDING_LIBCURL */ - -/* Defined for build that exposes internal static functions for testing. */ -/* #undef CARES_EXPOSE_STATICS */ - -/* Defined for build with symbol hiding. */ -#define CARES_SYMBOL_HIDING 1 - -/* Definition to make a library symbol externally visible. */ -#define CARES_SYMBOL_SCOPE_EXTERN __attribute__ ((__visibility__ ("default"))) - -/* Use resolver library to configure cares */ -/* #undef CARES_USE_LIBRESOLV */ - -/* if a /etc/inet dir is being used */ -/* #undef ETC_INET */ - -/* Define to the type of arg 2 for gethostname. */ -#define GETHOSTNAME_TYPE_ARG2 size_t - -/* Define to the type qualifier of arg 1 for getnameinfo. */ -#define GETNAMEINFO_QUAL_ARG1 const - -/* Define to the type of arg 1 for getnameinfo. */ -#define GETNAMEINFO_TYPE_ARG1 struct sockaddr * - -/* Define to the type of arg 2 for getnameinfo. */ -#define GETNAMEINFO_TYPE_ARG2 socklen_t - -/* Define to the type of args 4 and 6 for getnameinfo. */ -#define GETNAMEINFO_TYPE_ARG46 size_t - -/* Define to the type of arg 7 for getnameinfo. */ -#define GETNAMEINFO_TYPE_ARG7 int - -/* Specifies the number of arguments to getservbyport_r */ -#define GETSERVBYPORT_R_ARGS 6 - -/* Specifies the size of the buffer to pass to getservbyport_r */ -#define GETSERVBYPORT_R_BUFSIZE 4096 - -/* Define to 1 if you have AF_INET6. */ -#define HAVE_AF_INET6 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ARPA_INET_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ARPA_NAMESER_COMPAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ARPA_NAMESER_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ASSERT_H 1 - -/* Define to 1 if you have the `bitncmp' function. */ -/* #undef HAVE_BITNCMP */ - -/* Define to 1 if bool is an available type. */ -#define HAVE_BOOL_T 1 - -/* Define to 1 if you have the clock_gettime function and monotonic timer. */ -#define HAVE_CLOCK_GETTIME_MONOTONIC 1 - -/* Define to 1 if you have the closesocket function. */ -/* #undef HAVE_CLOSESOCKET */ - -/* Define to 1 if you have the CloseSocket camel case function. */ -/* #undef HAVE_CLOSESOCKET_CAMEL */ - -/* Define to 1 if you have the connect function. */ -#define HAVE_CONNECT 1 - -/* define if the compiler supports basic C++11 syntax */ -#define HAVE_CXX11 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ERRNO_H 1 - -/* Define to 1 if you have the fcntl function. */ -#define HAVE_FCNTL 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_FCNTL_H 1 - -/* Define to 1 if you have a working fcntl O_NONBLOCK function. */ -#define HAVE_FCNTL_O_NONBLOCK 1 - -/* Define to 1 if you have the freeaddrinfo function. */ -#define HAVE_FREEADDRINFO 1 - -/* Define to 1 if you have a working getaddrinfo function. */ -#define HAVE_GETADDRINFO 1 - -/* Define to 1 if the getaddrinfo function is threadsafe. */ -#define HAVE_GETADDRINFO_THREADSAFE 1 - -/* Define to 1 if you have the getenv function. */ -#define HAVE_GETENV 1 - -/* Define to 1 if you have the gethostbyaddr function. */ -#define HAVE_GETHOSTBYADDR 1 - -/* Define to 1 if you have the gethostbyname function. */ -#define HAVE_GETHOSTBYNAME 1 - -/* Define to 1 if you have the gethostname function. */ -#define HAVE_GETHOSTNAME 1 - -/* Define to 1 if you have the getnameinfo function. */ -#define HAVE_GETNAMEINFO 1 - -/* Define to 1 if you have the getservbyport_r function. */ -#define HAVE_GETSERVBYPORT_R 1 - -/* Define to 1 if you have the `gettimeofday' function. */ -#define HAVE_GETTIMEOFDAY 1 - -/* Define to 1 if you have the `if_indextoname' function. */ -#define HAVE_IF_INDEXTONAME 1 - -/* Define to 1 if you have a IPv6 capable working inet_net_pton function. */ -#define HAVE_INET_NET_PTON 1 - -/* Define to 1 if you have a IPv6 capable working inet_ntop function. */ -#define HAVE_INET_NTOP 1 - -/* Define to 1 if you have a IPv6 capable working inet_pton function. */ -#define HAVE_INET_PTON 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define to 1 if you have the ioctl function. */ -#define HAVE_IOCTL 1 - -/* Define to 1 if you have the ioctlsocket function. */ -/* #undef HAVE_IOCTLSOCKET */ - -/* Define to 1 if you have the IoctlSocket camel case function. */ -/* #undef HAVE_IOCTLSOCKET_CAMEL */ - -/* Define to 1 if you have a working IoctlSocket camel case FIONBIO function. - */ -/* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */ - -/* Define to 1 if you have a working ioctlsocket FIONBIO function. */ -/* #undef HAVE_IOCTLSOCKET_FIONBIO */ - -/* Define to 1 if you have a working ioctl FIONBIO function. */ -#define HAVE_IOCTL_FIONBIO 1 - -/* Define to 1 if you have a working ioctl SIOCGIFADDR function. */ -#define HAVE_IOCTL_SIOCGIFADDR 1 - -/* Define to 1 if you have the `resolve' library (-lresolve). */ -/* #undef HAVE_LIBRESOLVE */ - -/* Define to 1 if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* if your compiler supports LL */ -#define HAVE_LL 1 - -/* Define to 1 if the compiler supports the 'long long' data type. */ -#define HAVE_LONGLONG 1 - -/* Define to 1 if you have the malloc.h header file. */ -/* #undef HAVE_MALLOC_H */ - -/* Define to 1 if you have the memory.h header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the MSG_NOSIGNAL flag. */ -#define HAVE_MSG_NOSIGNAL 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_NETDB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_NETINET_IN_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_NETINET_TCP_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_NET_IF_H 1 - -/* Define to 1 if you have PF_INET6. */ -#define HAVE_PF_INET6 1 - -/* Define to 1 if you have the recv function. */ -#define HAVE_RECV 1 - -/* Define to 1 if you have the recvfrom function. */ -#define HAVE_RECVFROM 1 - -/* Define to 1 if you have the send function. */ -#define HAVE_SEND 1 - -/* Define to 1 if you have the setsockopt function. */ -#define HAVE_SETSOCKOPT 1 - -/* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */ -/* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */ - -/* Define to 1 if you have the header file. */ -#define HAVE_SIGNAL_H 1 - -/* Define to 1 if sig_atomic_t is an available typedef. */ -#define HAVE_SIG_ATOMIC_T 1 - -/* Define to 1 if sig_atomic_t is already defined as volatile. */ -/* #undef HAVE_SIG_ATOMIC_T_VOLATILE */ - -/* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */ -#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 - -/* Define to 1 if you have the socket function. */ -#define HAVE_SOCKET 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SOCKET_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_STDBOOL_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the strcasecmp function. */ -#define HAVE_STRCASECMP 1 - -/* Define to 1 if you have the strcmpi function. */ -/* #undef HAVE_STRCMPI */ - -/* Define to 1 if you have the strdup function. */ -#define HAVE_STRDUP 1 - -/* Define to 1 if you have the stricmp function. */ -/* #undef HAVE_STRICMP */ - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the strncasecmp function. */ -#define HAVE_STRNCASECMP 1 - -/* Define to 1 if you have the strncmpi function. */ -/* #undef HAVE_STRNCMPI */ - -/* Define to 1 if you have the strnicmp function. */ -/* #undef HAVE_STRNICMP */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_STROPTS_H */ - -/* Define to 1 if you have struct addrinfo. */ -#define HAVE_STRUCT_ADDRINFO 1 - -/* Define to 1 if you have struct in6_addr. */ -#define HAVE_STRUCT_IN6_ADDR 1 - -/* Define to 1 if you have struct sockaddr_in6. */ -#define HAVE_STRUCT_SOCKADDR_IN6 1 - -/* if struct sockaddr_storage is defined */ -#define HAVE_STRUCT_SOCKADDR_STORAGE 1 - -/* Define to 1 if you have the timeval struct. */ -#define HAVE_STRUCT_TIMEVAL 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_IOCTL_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_PARAM_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_SELECT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_SOCKET_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TIME_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_UIO_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_TIME_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define to 1 if you have the windows.h header file. */ -/* #undef HAVE_WINDOWS_H */ - -/* Define to 1 if you have the winsock2.h header file. */ -/* #undef HAVE_WINSOCK2_H */ - -/* Define to 1 if you have the winsock.h header file. */ -/* #undef HAVE_WINSOCK_H */ - -/* Define to 1 if you have the writev function. */ -#define HAVE_WRITEV 1 - -/* Define to 1 if you have the ws2tcpip.h header file. */ -/* #undef HAVE_WS2TCPIP_H */ - -/* Define to the sub-directory where libtool stores uninstalled libraries. */ -#define LT_OBJDIR ".libs/" - -/* Define to 1 if you need the malloc.h header file even with stdlib.h */ -/* #undef NEED_MALLOC_H */ - -/* Define to 1 if you need the memory.h header file even with stdlib.h */ -/* #undef NEED_MEMORY_H */ - -/* Define to 1 if _REENTRANT preprocessor symbol must be defined. */ -/* #undef NEED_REENTRANT */ - -/* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */ -/* #undef NEED_THREAD_SAFE */ - -/* cpu-machine-OS */ -#define OS "amd64-unknown-freebsd10.3" - -/* Name of package */ -#define PACKAGE "c-ares" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "c-ares" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "c-ares -" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "c-ares" - -/* Define to the home page for this package. */ -#define PACKAGE_URL "" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "-" - -/* a suitable file/device to read random data from */ -#define RANDOM_FILE "/dev/urandom" - -/* Define to the type qualifier pointed by arg 5 for recvfrom. */ -#define RECVFROM_QUAL_ARG5 - -/* Define to the type of arg 1 for recvfrom. */ -#define RECVFROM_TYPE_ARG1 int - -/* Define to the type pointed by arg 2 for recvfrom. */ -#define RECVFROM_TYPE_ARG2 void - -/* Define to 1 if the type pointed by arg 2 for recvfrom is void. */ -#define RECVFROM_TYPE_ARG2_IS_VOID 1 - -/* Define to the type of arg 3 for recvfrom. */ -#define RECVFROM_TYPE_ARG3 size_t - -/* Define to the type of arg 4 for recvfrom. */ -#define RECVFROM_TYPE_ARG4 int - -/* Define to the type pointed by arg 5 for recvfrom. */ -#define RECVFROM_TYPE_ARG5 struct sockaddr - -/* Define to 1 if the type pointed by arg 5 for recvfrom is void. */ -/* #undef RECVFROM_TYPE_ARG5_IS_VOID */ - -/* Define to the type pointed by arg 6 for recvfrom. */ -#define RECVFROM_TYPE_ARG6 socklen_t - -/* Define to 1 if the type pointed by arg 6 for recvfrom is void. */ -/* #undef RECVFROM_TYPE_ARG6_IS_VOID */ - -/* Define to the function return type for recvfrom. */ -#define RECVFROM_TYPE_RETV ssize_t - -/* Define to the type of arg 1 for recv. */ -#define RECV_TYPE_ARG1 int - -/* Define to the type of arg 2 for recv. */ -#define RECV_TYPE_ARG2 void * - -/* Define to the type of arg 3 for recv. */ -#define RECV_TYPE_ARG3 size_t - -/* Define to the type of arg 4 for recv. */ -#define RECV_TYPE_ARG4 int - -/* Define to the function return type for recv. */ -#define RECV_TYPE_RETV ssize_t - -/* Define as the return type of signal handlers (`int' or `void'). */ -#define RETSIGTYPE void - -/* Define to the type qualifier of arg 2 for send. */ -#define SEND_QUAL_ARG2 const - -/* Define to the type of arg 1 for send. */ -#define SEND_TYPE_ARG1 int - -/* Define to the type of arg 2 for send. */ -#define SEND_TYPE_ARG2 void * - -/* Define to the type of arg 3 for send. */ -#define SEND_TYPE_ARG3 size_t - -/* Define to the type of arg 4 for send. */ -#define SEND_TYPE_ARG4 int - -/* Define to the function return type for send. */ -#define SEND_TYPE_RETV ssize_t - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define to 1 if you can safely include both and . */ -#define TIME_WITH_SYS_TIME 1 - -/* Define to disable non-blocking sockets. */ -/* #undef USE_BLOCKING_SOCKETS */ - -/* Version number of package */ -#define VERSION "-" - -/* Define to avoid automatic inclusion of winsock.h */ -/* #undef WIN32_LEAN_AND_MEAN */ - -/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel). */ -#if defined AC_APPLE_UNIVERSAL_BUILD -# if defined __BIG_ENDIAN__ -# define WORDS_BIGENDIAN 1 -# endif -#else -# ifndef WORDS_BIGENDIAN -/* # undef WORDS_BIGENDIAN */ -# endif -#endif - -/* Define to 1 if OS is AIX. */ -#ifndef _ALL_SOURCE -/* # undef _ALL_SOURCE */ -#endif - -/* Enable large inode numbers on Mac OS X 10.5. */ -#ifndef _DARWIN_USE_64_BIT_INODE -# define _DARWIN_USE_64_BIT_INODE 1 -#endif - -/* Number of bits in a file offset, on hosts where this is settable. */ -/* #undef _FILE_OFFSET_BITS */ - -/* Define for large files, on AIX-style hosts. */ -/* #undef _LARGE_FILES */ - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef const */ - -/* Type to use in place of in_addr_t when system does not provide it. */ -/* #undef in_addr_t */ - -/* Define to `unsigned int' if does not define. */ -/* #undef size_t */ - -/* the signed version of size_t */ -/* #undef ssize_t */ diff --git a/third_party/gtest.BUILD b/third_party/gtest.BUILD index b70f2c51bcf..52c9ca2ba7c 100644 --- a/third_party/gtest.BUILD +++ b/third_party/gtest.BUILD @@ -2,14 +2,11 @@ cc_library( name = "gtest", srcs = [ "googletest/src/gtest-all.cc", - "googlemock/src/gmock-all.cc" ], - hdrs = glob(["googletest/include/**/*.h", "googletest/src/*.cc", "googletest/src/*.h", "googlemock/include/**/*.h", "googlemock/src/*.cc", "googlemock/src/*.h"]), + hdrs = glob(["googletest/include/**/*.h", "googletest/src/*.cc", "googletest/src/*.h"]), includes = [ "googletest", "googletest/include", - "googlemock", - "googlemock/include", ], linkstatic = 1, visibility = [ diff --git a/third_party/zlib b/third_party/zlib index cacf7f1d4e3..50893291621 160000 --- a/third_party/zlib +++ b/third_party/zlib @@ -1 +1 @@ -Subproject commit cacf7f1d4e3d44d871b605da3b647f07d718623f +Subproject commit 50893291621658f355bc5b4d450a8d06a563053d diff --git a/tools/codegen/core/gen_static_metadata.py b/tools/codegen/core/gen_static_metadata.py index 360b0f56e92..109701f740b 100755 --- a/tools/codegen/core/gen_static_metadata.py +++ b/tools/codegen/core/gen_static_metadata.py @@ -56,9 +56,8 @@ CONFIG = [ ':authority', 'grpc-message', 'grpc-status', - 'grpc-server-stats-bin', - 'grpc-tags-bin', - 'grpc-trace-bin', + 'grpc-tracing-bin', + 'grpc-stats-bin', '', # channel arg keys 'grpc.wait_for_ready', @@ -124,7 +123,6 @@ CONFIG = [ ('if-unmodified-since', ''), ('last-modified', ''), ('lb-token', ''), - ('lb-cost-bin', ''), ('link', ''), ('location', ''), ('max-forwards', ''), @@ -156,9 +154,6 @@ METADATA_BATCH_CALLOUTS = [ 'grpc-payload-bin', 'grpc-encoding', 'grpc-accept-encoding', - 'grpc-server-stats-bin', - 'grpc-tags-bin', - 'grpc-trace-bin', 'content-type', 'grpc-internal-encoding-request', 'user-agent', @@ -172,7 +167,6 @@ COMPRESSION_ALGORITHMS = [ 'gzip', ] - # utility: mangle the name of a config def mangle(elem, name=None): xl = { @@ -183,56 +177,43 @@ def mangle(elem, name=None): ',': 'comma', ' ': '_', } - def m0(x): - if not x: - return 'empty' + if not x: return 'empty' r = '' for c in x: put = xl.get(c, c.lower()) - if not put: - continue + if not put: continue last_is_underscore = r[-1] == '_' if r else True - if last_is_underscore and put == '_': - continue + if last_is_underscore and put == '_': continue elif len(put) > 1: - if not last_is_underscore: - r += '_' + if not last_is_underscore: r += '_' r += put r += '_' else: r += put - if r[-1] == '_': - r = r[:-1] + if r[-1] == '_': r = r[:-1] return r - def n(default, name=name): - if name is None: - return 'grpc_%s_' % default - if name == '': - return '' + if name is None: return 'grpc_%s_' % default + if name == '': return '' return 'grpc_%s_' % name - if isinstance(elem, tuple): return '%s%s_%s' % (n('mdelem'), m0(elem[0]), m0(elem[1])) else: return '%s%s' % (n('mdstr'), m0(elem)) - # utility: generate some hash value for a string def fake_hash(elem): return hashlib.md5(elem).hexdigest()[0:8] - # utility: print a big comment block into a set of files def put_banner(files, banner): for f in files: - print >> f, '/*' + print >>f, '/*' for line in banner: - print >> f, ' * %s' % line - print >> f, ' */' - print >> f - + print >>f, ' * %s' % line + print >>f, ' */' + print >>f # build a list of all the strings we need all_strs = list() @@ -255,7 +236,7 @@ for elem in CONFIG: if elem not in all_strs: all_strs.append(elem) compression_elems = [] -for mask in range(1, 1 << len(COMPRESSION_ALGORITHMS)): +for mask in range(1, 1<> H, '#ifndef GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H' -print >> H, '#define GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H' -print >> H -print >> H, '#include "src/core/lib/transport/metadata.h"' -print >> H +print >>H, '#ifndef GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H' +print >>H, '#define GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H' +print >>H +print >>H, '#include "src/core/lib/transport/metadata.h"' +print >>H -print >> C, '#include "src/core/lib/transport/static_metadata.h"' -print >> C -print >> C, '#include "src/core/lib/slice/slice_internal.h"' -print >> C +print >>C, '#include "src/core/lib/transport/static_metadata.h"' +print >>C +print >>C, '#include "src/core/lib/slice/slice_internal.h"' +print >>C str_ofs = 0 id2strofs = {} for i, elem in enumerate(all_strs): id2strofs[i] = str_ofs - str_ofs += len(elem) - - + str_ofs += len(elem); def slice_def(i): - return ('{.refcount = &grpc_static_metadata_refcounts[%d], .data.refcounted =' - ' {g_bytes+%d, %d}}') % ( - i, id2strofs[i], len(all_strs[i])) - + return '{.refcount = &grpc_static_metadata_refcounts[%d], .data.refcounted = {g_bytes+%d, %d}}' % (i, id2strofs[i], len(all_strs[i])) # validate configuration for elem in METADATA_BATCH_CALLOUTS: assert elem in all_strs -print >> H, '#define GRPC_STATIC_MDSTR_COUNT %d' % len(all_strs) -print >> H, ('extern const grpc_slice ' - 'grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT];') +print >>H, '#define GRPC_STATIC_MDSTR_COUNT %d' % len(all_strs) +print >>H, 'extern const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT];' for i, elem in enumerate(all_strs): - print >> H, '/* "%s" */' % elem - print >> H, '#define %s (grpc_static_slice_table[%d])' % ( - mangle(elem).upper(), i) -print >> H -print >> C, 'static uint8_t g_bytes[] = {%s};' % ( - ','.join('%d' % ord(c) for c in ''.join(all_strs))) -print >> C -print >> C, 'static void static_ref(void *unused) {}' -print >> C, 'static void static_unref(grpc_exec_ctx *exec_ctx, void *unused) {}' -print >> C, ('static const grpc_slice_refcount_vtable static_sub_vtable = ' - '{static_ref, static_unref, grpc_slice_default_eq_impl, ' - 'grpc_slice_default_hash_impl};') -print >> H, ('extern const grpc_slice_refcount_vtable ' - 'grpc_static_metadata_vtable;') -print >> C, ('const grpc_slice_refcount_vtable grpc_static_metadata_vtable = ' - '{static_ref, static_unref, grpc_static_slice_eq, ' - 'grpc_static_slice_hash};') -print >> C, ('static grpc_slice_refcount static_sub_refcnt = ' - '{&static_sub_vtable, &static_sub_refcnt};') -print >> H, ('extern grpc_slice_refcount ' - 'grpc_static_metadata_refcounts[GRPC_STATIC_MDSTR_COUNT];') -print >> C, ('grpc_slice_refcount ' - 'grpc_static_metadata_refcounts[GRPC_STATIC_MDSTR_COUNT] = {') + print >>H, '/* "%s" */' % elem + print >>H, '#define %s (grpc_static_slice_table[%d])' % (mangle(elem).upper(), i) +print >>H +print >>C, 'static uint8_t g_bytes[] = {%s};' % (','.join('%d' % ord(c) for c in ''.join(all_strs))) +print >>C +print >>C, 'static void static_ref(void *unused) {}' +print >>C, 'static void static_unref(grpc_exec_ctx *exec_ctx, void *unused) {}' +print >>C, 'static const grpc_slice_refcount_vtable static_sub_vtable = {static_ref, static_unref, grpc_slice_default_eq_impl, grpc_slice_default_hash_impl};'; +print >>H, 'extern const grpc_slice_refcount_vtable grpc_static_metadata_vtable;'; +print >>C, 'const grpc_slice_refcount_vtable grpc_static_metadata_vtable = {static_ref, static_unref, grpc_static_slice_eq, grpc_static_slice_hash};'; +print >>C, 'static grpc_slice_refcount static_sub_refcnt = {&static_sub_vtable, &static_sub_refcnt};'; +print >>H, 'extern grpc_slice_refcount grpc_static_metadata_refcounts[GRPC_STATIC_MDSTR_COUNT];' +print >>C, 'grpc_slice_refcount grpc_static_metadata_refcounts[GRPC_STATIC_MDSTR_COUNT] = {' for i, elem in enumerate(all_strs): - print >> C, ' {&grpc_static_metadata_vtable, &static_sub_refcnt},' -print >> C, '};' -print >> C -print >> H, '#define GRPC_IS_STATIC_METADATA_STRING(slice) \\' -print >> H, (' ((slice).refcount != NULL && (slice).refcount->vtable == ' - '&grpc_static_metadata_vtable)') -print >> H -print >> C, ('const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT]' - ' = {') + print >>C, ' {&grpc_static_metadata_vtable, &static_sub_refcnt},' +print >>C, '};' +print >>C +print >>H, '#define GRPC_IS_STATIC_METADATA_STRING(slice) \\' +print >>H, ' ((slice).refcount != NULL && (slice).refcount->vtable == &grpc_static_metadata_vtable)' +print >>H +print >>C, 'const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT] = {' for i, elem in enumerate(all_strs): - print >> C, slice_def(i) + ',' -print >> C, '};' -print >> C -print >> H, '#define GRPC_STATIC_METADATA_INDEX(static_slice) \\' -print >> H, (' ((int)((static_slice).refcount - ' - 'grpc_static_metadata_refcounts))') -print >> H - -print >> D, '# hpack fuzzing dictionary' + print >>C, slice_def(i) + ',' +print >>C, '};' +print >>C +print >>H, '#define GRPC_STATIC_METADATA_INDEX(static_slice) \\' +print >>H, ' ((int)((static_slice).refcount - grpc_static_metadata_refcounts))' +print >>H + +print >>D, '# hpack fuzzing dictionary' for i, elem in enumerate(all_strs): - print >> D, '%s' % (esc_dict([len(elem)] + [ord(c) for c in elem])) + print >>D, '%s' % (esc_dict([len(elem)] + [ord(c) for c in elem])) for i, elem in enumerate(all_elems): - print >> D, '%s' % (esc_dict([0, len(elem[0])] + [ord(c) for c in elem[0]] + - [len(elem[1])] + [ord(c) for c in elem[1]])) - -print >> H, '#define GRPC_STATIC_MDELEM_COUNT %d' % len(all_elems) -print >> H, ('extern grpc_mdelem_data ' - 'grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT];') -print >> H, ('extern uintptr_t ' - 'grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT];') -for i, elem in enumerate(all_elems): - print >> H, '/* "%s": "%s" */' % elem - print >> H, ('#define %s (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[%d], ' - 'GRPC_MDELEM_STORAGE_STATIC))') % ( - mangle(elem).upper(), i) -print >> H -print >> C, ('uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] ' - '= {') -print >> C, ' %s' % ','.join('%d' % static_userdata.get(elem, 0) - for elem in all_elems) -print >> C, '};' -print >> C + print >>D, '%s' % (esc_dict([0, len(elem[0])] + [ord(c) for c in elem[0]] + + [len(elem[1])] + [ord(c) for c in elem[1]])) +print >>H, '#define GRPC_STATIC_MDELEM_COUNT %d' % len(all_elems) +print >>H, 'extern grpc_mdelem_data grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT];' +print >>H, 'extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT];' +for i, elem in enumerate(all_elems): + print >>H, '/* "%s": "%s" */' % elem + print >>H, '#define %s (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[%d], GRPC_MDELEM_STORAGE_STATIC))' % (mangle(elem).upper(), i) +print >>H +print >>C, 'uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] = {' +print >>C, ' %s' % ','.join('%d' % static_userdata.get(elem, 0) for elem in all_elems) +print >>C, '};' +print >>C def str_idx(s): for i, s2 in enumerate(all_strs): if s == s2: return i - def md_idx(m): for i, m2 in enumerate(all_elems): if m == m2: return i - def offset_trials(mink): yield 0 for i in range(1, 100): for mul in [-1, 1]: yield mul * i - def perfect_hash(keys, name): p = perfection.hash_parameters(keys) - def f(i, p=p): i += p.offset x = i % p.t y = i / p.t return x + p.r[y] - return { - 'PHASHRANGE': - p.t - 1 + max(p.r), - 'PHASHNKEYS': - len(p.slots), - 'pyfunc': - f, - 'code': - """ + 'PHASHRANGE': p.t - 1 + max(p.r), + 'PHASHNKEYS': len(p.slots), + 'pyfunc': f, + 'code': """ static const int8_t %(name)s_r[] = {%(r)s}; static uint32_t %(name)s_phash(uint32_t i) { i %(offset_sign)s= %(offset)d; @@ -490,77 +430,71 @@ static uint32_t %(name)s_phash(uint32_t i) { return h; } """ % { - 'name': name, - 'r': ','.join('%d' % (r if r is not None else 0) for r in p.r), - 't': p.t, - 'offset': abs(p.offset), - 'offset_sign': '+' if p.offset > 0 else '-' + 'name': name, + 'r': ','.join('%d' % (r if r is not None else 0) for r in p.r), + 't': p.t, + 'offset': abs(p.offset), + 'offset_sign': '+' if p.offset > 0 else '-' } } -elem_keys = [ - str_idx(elem[0]) * len(all_strs) + str_idx(elem[1]) for elem in all_elems -] -elem_hash = perfect_hash(elem_keys, 'elems') -print >> C, elem_hash['code'] +elem_keys = [str_idx(elem[0]) * len(all_strs) + str_idx(elem[1]) for elem in all_elems] +elem_hash = perfect_hash(elem_keys, "elems") +print >>C, elem_hash['code'] keys = [0] * int(elem_hash['PHASHRANGE']) idxs = [255] * int(elem_hash['PHASHNKEYS']) for i, k in enumerate(elem_keys): - h = elem_hash['pyfunc'](k) - assert keys[h] == 0 - keys[h] = k - idxs[h] = i -print >> C, 'static const uint16_t elem_keys[] = {%s};' % ','.join( - '%d' % k for k in keys) -print >> C, 'static const uint8_t elem_idxs[] = {%s};' % ','.join( - '%d' % i for i in idxs) -print >> C - -print >> H, 'grpc_mdelem grpc_static_mdelem_for_static_strings(int a, int b);' -print >> C, 'grpc_mdelem grpc_static_mdelem_for_static_strings(int a, int b) {' -print >> C, ' if (a == -1 || b == -1) return GRPC_MDNULL;' -print >> C, ' uint32_t k = (uint32_t)(a * %d + b);' % len(all_strs) -print >> C, ' uint32_t h = elems_phash(k);' -print >> C, ' return h < GPR_ARRAY_SIZE(elem_keys) && elem_keys[h] == k ? GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[elem_idxs[h]], GRPC_MDELEM_STORAGE_STATIC) : GRPC_MDNULL;' -print >> C, '}' -print >> C - -print >> C, 'grpc_mdelem_data grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT] = {' + h = elem_hash['pyfunc'](k) + assert keys[h] == 0 + keys[h] = k + idxs[h] = i +print >>C, 'static const uint16_t elem_keys[] = {%s};' % ','.join('%d' % k for k in keys) +print >>C, 'static const uint8_t elem_idxs[] = {%s};' % ','.join('%d' % i for i in idxs) +print >>C + +print >>H, 'grpc_mdelem grpc_static_mdelem_for_static_strings(int a, int b);' +print >>C, 'grpc_mdelem grpc_static_mdelem_for_static_strings(int a, int b) {' +print >>C, ' if (a == -1 || b == -1) return GRPC_MDNULL;' +print >>C, ' uint32_t k = (uint32_t)(a * %d + b);' % len(all_strs) +print >>C, ' uint32_t h = elems_phash(k);' +print >>C, ' return h < GPR_ARRAY_SIZE(elem_keys) && elem_keys[h] == k ? GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[elem_idxs[h]], GRPC_MDELEM_STORAGE_STATIC) : GRPC_MDNULL;' +print >>C, '}' +print >>C + +print >>C, 'grpc_mdelem_data grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT] = {' for a, b in all_elems: - print >> C, '{%s,%s},' % (slice_def(str_idx(a)), slice_def(str_idx(b))) -print >> C, '};' + print >>C, '{%s,%s},' % (slice_def(str_idx(a)), slice_def(str_idx(b))) +print >>C, '};' -print >> H, 'typedef enum {' +print >>H, 'typedef enum {' for elem in METADATA_BATCH_CALLOUTS: - print >> H, ' %s,' % mangle(elem, 'batch').upper() -print >> H, ' GRPC_BATCH_CALLOUTS_COUNT' -print >> H, '} grpc_metadata_batch_callouts_index;' -print >> H -print >> H, 'typedef union {' -print >> H, ' struct grpc_linked_mdelem *array[GRPC_BATCH_CALLOUTS_COUNT];' -print >> H, ' struct {' + print >>H, ' %s,' % mangle(elem, 'batch').upper() +print >>H, ' GRPC_BATCH_CALLOUTS_COUNT' +print >>H, '} grpc_metadata_batch_callouts_index;' +print >>H +print >>H, 'typedef union {' +print >>H, ' struct grpc_linked_mdelem *array[GRPC_BATCH_CALLOUTS_COUNT];' +print >>H, ' struct {' for elem in METADATA_BATCH_CALLOUTS: - print >> H, ' struct grpc_linked_mdelem *%s;' % mangle(elem, '').lower() -print >> H, ' } named;' -print >> H, '} grpc_metadata_batch_callouts;' -print >> H -print >> H, '#define GRPC_BATCH_INDEX_OF(slice) \\' -print >> H, ' (GRPC_IS_STATIC_METADATA_STRING((slice)) ? (grpc_metadata_batch_callouts_index)GPR_CLAMP(GRPC_STATIC_METADATA_INDEX((slice)), 0, GRPC_BATCH_CALLOUTS_COUNT) : GRPC_BATCH_CALLOUTS_COUNT)' -print >> H - -print >> H, 'extern const uint8_t grpc_static_accept_encoding_metadata[%d];' % ( - 1 << len(COMPRESSION_ALGORITHMS)) -print >> C, 'const uint8_t grpc_static_accept_encoding_metadata[%d] = {' % ( - 1 << len(COMPRESSION_ALGORITHMS)) -print >> C, '0,%s' % ','.join('%d' % md_idx(elem) for elem in compression_elems) -print >> C, '};' -print >> C - -print >> H, '#define GRPC_MDELEM_ACCEPT_ENCODING_FOR_ALGORITHMS(algs) (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[grpc_static_accept_encoding_metadata[(algs)]], GRPC_MDELEM_STORAGE_STATIC))' - -print >> H, '#endif /* GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H */' + print >>H, ' struct grpc_linked_mdelem *%s;' % mangle(elem, '').lower() +print >>H, ' } named;' +print >>H, '} grpc_metadata_batch_callouts;' +print >>H +print >>H, '#define GRPC_BATCH_INDEX_OF(slice) \\' +print >>H, ' (GRPC_IS_STATIC_METADATA_STRING((slice)) ? (grpc_metadata_batch_callouts_index)GPR_CLAMP(GRPC_STATIC_METADATA_INDEX((slice)), 0, GRPC_BATCH_CALLOUTS_COUNT) : GRPC_BATCH_CALLOUTS_COUNT)' +print >>H + +print >>H, 'extern const uint8_t grpc_static_accept_encoding_metadata[%d];' % (1 << len(COMPRESSION_ALGORITHMS)) +print >>C, 'const uint8_t grpc_static_accept_encoding_metadata[%d] = {' % (1 << len(COMPRESSION_ALGORITHMS)) +print >>C, '0,%s' % ','.join('%d' % md_idx(elem) for elem in compression_elems) +print >>C, '};' +print >>C + +print >>H, '#define GRPC_MDELEM_ACCEPT_ENCODING_FOR_ALGORITHMS(algs) (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[grpc_static_accept_encoding_metadata[(algs)]], GRPC_MDELEM_STORAGE_STATIC))' + +print >>H, '#endif /* GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H */' H.close() C.close() diff --git a/tools/distrib/python/grpcio_tools/grpc_version.py b/tools/distrib/python/grpcio_tools/grpc_version.py index 1f2aa81c850..289c0b13c38 100644 --- a/tools/distrib/python/grpcio_tools/grpc_version.py +++ b/tools/distrib/python/grpcio_tools/grpc_version.py @@ -29,4 +29,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!! -VERSION='1.4.0.dev0' +VERSION='1.3.0rc1' diff --git a/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh b/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh index 82b96e086e0..02e811f664b 100755 --- a/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh +++ b/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh @@ -31,7 +31,7 @@ set -e # directories to run against -DIRS="src/core/lib src/core/tsi src/core/ext src/cpp test/core test/cpp include src/compiler src/node src/csharp src/ruby" +DIRS="src/core/lib src/core/tsi src/core/ext src/cpp test/core test/cpp include src/compiler" # file matching patterns to check GLOB="*.h *.c *.cc" diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index 1d2aa959557..01a2dfb74f8 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.4.0-dev +PROJECT_NUMBER = 1.3.0-pre1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -835,6 +835,7 @@ include/grpc++/impl/codegen/service_type.h \ include/grpc++/impl/codegen/slice.h \ include/grpc++/impl/codegen/status.h \ include/grpc++/impl/codegen/status_code_enum.h \ +include/grpc++/impl/codegen/status_helper.h \ include/grpc++/impl/codegen/string_ref.h \ include/grpc++/impl/codegen/stub_options.h \ include/grpc++/impl/codegen/sync_stream.h \ diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 88a9736d5b5..7734d8ba11f 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.4.0-dev +PROJECT_NUMBER = 1.3.0-pre1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -836,6 +836,7 @@ include/grpc++/impl/codegen/service_type.h \ include/grpc++/impl/codegen/slice.h \ include/grpc++/impl/codegen/status.h \ include/grpc++/impl/codegen/status_code_enum.h \ +include/grpc++/impl/codegen/status_helper.h \ include/grpc++/impl/codegen/string_ref.h \ include/grpc++/impl/codegen/stub_options.h \ include/grpc++/impl/codegen/sync_stream.h \ @@ -905,15 +906,25 @@ src/core/lib/channel/channel_stack.c \ src/core/lib/channel/channel_stack.h \ src/core/lib/channel/channel_stack_builder.c \ src/core/lib/channel/channel_stack_builder.h \ +src/core/lib/channel/compress_filter.c \ +src/core/lib/channel/compress_filter.h \ src/core/lib/channel/connected_channel.c \ src/core/lib/channel/connected_channel.h \ src/core/lib/channel/context.h \ +src/core/lib/channel/deadline_filter.c \ +src/core/lib/channel/deadline_filter.h \ src/core/lib/channel/handshaker.c \ src/core/lib/channel/handshaker.h \ src/core/lib/channel/handshaker_factory.c \ src/core/lib/channel/handshaker_factory.h \ src/core/lib/channel/handshaker_registry.c \ src/core/lib/channel/handshaker_registry.h \ +src/core/lib/channel/http_client_filter.c \ +src/core/lib/channel/http_client_filter.h \ +src/core/lib/channel/http_server_filter.c \ +src/core/lib/channel/http_server_filter.h \ +src/core/lib/channel/message_size_filter.c \ +src/core/lib/channel/message_size_filter.h \ src/core/lib/compression/algorithm_metadata.h \ src/core/lib/compression/compression.c \ src/core/lib/compression/message_compress.c \ diff --git a/tools/doxygen/Doxyfile.core b/tools/doxygen/Doxyfile.core index c3bfc6c4a8e..d651c9209e0 100644 --- a/tools/doxygen/Doxyfile.core +++ b/tools/doxygen/Doxyfile.core @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 4.0.0-dev +PROJECT_NUMBER = 3.0.0-pre1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 924595eb959..f5ffe97e499 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 4.0.0-dev +PROJECT_NUMBER = 3.0.0-pre1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -954,23 +954,12 @@ src/core/ext/filters/client_channel/subchannel_index.c \ src/core/ext/filters/client_channel/subchannel_index.h \ src/core/ext/filters/client_channel/uri_parser.c \ src/core/ext/filters/client_channel/uri_parser.h \ -src/core/ext/filters/deadline/deadline_filter.c \ -src/core/ext/filters/deadline/deadline_filter.h \ -src/core/ext/filters/http/client/http_client_filter.c \ -src/core/ext/filters/http/client/http_client_filter.h \ -src/core/ext/filters/http/http_filters_plugin.c \ -src/core/ext/filters/http/message_compress/message_compress_filter.c \ -src/core/ext/filters/http/message_compress/message_compress_filter.h \ -src/core/ext/filters/http/server/http_server_filter.c \ -src/core/ext/filters/http/server/http_server_filter.h \ src/core/ext/filters/load_reporting/load_reporting.c \ src/core/ext/filters/load_reporting/load_reporting.h \ src/core/ext/filters/load_reporting/load_reporting_filter.c \ src/core/ext/filters/load_reporting/load_reporting_filter.h \ src/core/ext/filters/max_age/max_age_filter.c \ src/core/ext/filters/max_age/max_age_filter.h \ -src/core/ext/filters/message_size/message_size_filter.c \ -src/core/ext/filters/message_size/message_size_filter.h \ src/core/ext/transport/README.md \ src/core/ext/transport/chttp2/README.md \ src/core/ext/transport/chttp2/alpn/alpn.c \ @@ -1038,15 +1027,25 @@ src/core/lib/channel/channel_stack.c \ src/core/lib/channel/channel_stack.h \ src/core/lib/channel/channel_stack_builder.c \ src/core/lib/channel/channel_stack_builder.h \ +src/core/lib/channel/compress_filter.c \ +src/core/lib/channel/compress_filter.h \ src/core/lib/channel/connected_channel.c \ src/core/lib/channel/connected_channel.h \ src/core/lib/channel/context.h \ +src/core/lib/channel/deadline_filter.c \ +src/core/lib/channel/deadline_filter.h \ src/core/lib/channel/handshaker.c \ src/core/lib/channel/handshaker.h \ src/core/lib/channel/handshaker_factory.c \ src/core/lib/channel/handshaker_factory.h \ src/core/lib/channel/handshaker_registry.c \ src/core/lib/channel/handshaker_registry.h \ +src/core/lib/channel/http_client_filter.c \ +src/core/lib/channel/http_client_filter.h \ +src/core/lib/channel/http_server_filter.c \ +src/core/lib/channel/http_server_filter.h \ +src/core/lib/channel/message_size_filter.c \ +src/core/lib/channel/message_size_filter.h \ src/core/lib/compression/algorithm_metadata.h \ src/core/lib/compression/compression.c \ src/core/lib/compression/message_compress.c \ diff --git a/tools/grift/README.md b/tools/grift/README.md index 2b5fa5ae14b..7cbbdc567bf 100644 --- a/tools/grift/README.md +++ b/tools/grift/README.md @@ -1,4 +1,6 @@ -# Documentation +Copyright 2016 Google Inc. + +#Documentation grift is integration of [Apache Thrift](https://github.com/apache/thrift.git) Serializer with gRPC. @@ -6,19 +8,19 @@ This integration allows you to use grpc to send thrift messages in C++ and java. grift uses Compact Protocol to serialize thrift messages. -## generating grpc plugins for thrift services +##generating grpc plugins for thrift services -### C++ +###CPP ```sh $ thrift --gen cpp ``` -### Java +###JAVA ```sh $ thrift --gen java ``` -# Installation +#Installation Before Installing thrift make sure to apply this [patch](grpc_plugins_generator.patch) to third_party/thrift. Go to third_party/thrift and follow the [INSTALLATION](https://github.com/apache/thrift.git) instructions to install thrift with commit id bcad91771b7f0bff28a1cac1981d7ef2b9bcef3c. \ No newline at end of file diff --git a/tools/grpcz/BUILD b/tools/grpcz/BUILD index cc887a53751..cac7df2a9da 100644 --- a/tools/grpcz/BUILD +++ b/tools/grpcz/BUILD @@ -33,31 +33,30 @@ package(default_visibility = ["//visibility:public"]) load("//:bazel/grpc_build_system.bzl", "grpc_proto_library") -grpc_proto_library( +grpc_proto_library ( name = "monitoring_proto", srcs = [ "monitoring.proto", ], - well_known_protos = "@com_google_protobuf//:well_known_protos", deps = [ ":census_proto", ], + well_known_protos = "@submodule_protobuf//:well_known_protos", ) -grpc_proto_library( +grpc_proto_library ( name = "census_proto", srcs = [ "census.proto", ], - well_known_protos = "@com_google_protobuf//:well_known_protos", + well_known_protos = "@submodule_protobuf//:well_known_protos", ) cc_binary( name = "grpcz_client", - srcs = ["grpcz_client.cc"], + srcs = ["grpcz_client.cc",], deps = [ - "monitoring_proto", "//external:gflags", - "@mongoose_repo//:mongoose_lib", + "monitoring_proto", ], ) diff --git a/tools/jenkins/run_c_cpp_test.sh b/tools/jenkins/run_c_cpp_test.sh deleted file mode 100755 index a7e574518e3..00000000000 --- a/tools/jenkins/run_c_cpp_test.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2017, Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# This script is invoked by a Jenkins pull request job and executes all -# args passed to this script if the pull request affect C/C++ code -set -ex - -# Enter the gRPC repo root -cd $(dirname $0)/../.. - -AFFECTS_C_CPP=`python -c 'import sys; \ - sys.path.insert(0, "tools/run_tests/python_utils"); \ - import filter_pull_request_tests as filter; \ - print(filter.affects_c_cpp("origin/$ghprbTargetBranch"))'` - -if [ $AFFECTS_C_CPP == "False" ] ; then - echo "This pull request does not affect C/C++. Tests do not need to be run." -else - $@ -fi diff --git a/tools/jenkins/run_interop_objc.sh b/tools/jenkins/run_interop_objc.sh deleted file mode 100755 index 29f9ac989c7..00000000000 --- a/tools/jenkins/run_interop_objc.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2017, Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# This script is invoked by Jenkins and runs interop test suite. -set -ex - -export LANG=en_US.UTF-8 - -# Enter the gRPC repo root -cd $(dirname $0)/../.. - -tools/run_tests/run_interop_tests.py -l objc -s all --use_docker -t -j 1 $@ || true diff --git a/tools/jenkins/run_performance.sh b/tools/jenkins/run_performance.sh index f530fb46b86..dee033a951a 100755 --- a/tools/jenkins/run_performance.sh +++ b/tools/jenkins/run_performance.sh @@ -32,10 +32,9 @@ set -ex # List of benchmarks that provide good signal for analyzing performance changes in pull requests -BENCHMARKS_TO_RUN="bm_fullstack_unary_ping_pong bm_fullstack_streaming_ping_pong bm_fullstack_streaming_pump bm_closure bm_cq bm_call_create bm_error bm_chttp2_hpack bm_chttp2_transport bm_pollset bm_metadata" +BENCHMARKS_TO_RUN="bm_closure bm_cq bm_call_create bm_error bm_chttp2_hpack bm_chttp2_transport bm_pollset bm_metadata" # Enter the gRPC repo root cd $(dirname $0)/../.. -tools/run_tests/start_port_server.py tools/profiling/microbenchmarks/bm_diff.py -d origin/$ghprbTargetBranch -b $BENCHMARKS_TO_RUN diff --git a/tools/jenkins/run_performance_profile_hourly.sh b/tools/jenkins/run_performance_profile_hourly.sh index c352a9f4acf..dfcc2bb1163 100755 --- a/tools/jenkins/run_performance_profile_hourly.sh +++ b/tools/jenkins/run_performance_profile_hourly.sh @@ -32,8 +32,6 @@ set -ex cd $(dirname $0)/../.. -./tools/run_tests/start_port_server.py || true - CPUS=`python -c 'import multiprocessing; print multiprocessing.cpu_count()'` make CONFIG=opt memory_profile_test memory_profile_client memory_profile_server -j $CPUS diff --git a/tools/profiling/microbenchmarks/bm2bq.py b/tools/profiling/microbenchmarks/bm2bq.py index 99cf4a558cf..ffb11f57d8f 100755 --- a/tools/profiling/microbenchmarks/bm2bq.py +++ b/tools/profiling/microbenchmarks/bm2bq.py @@ -71,7 +71,6 @@ columns = [ ('end_of_stream', 'boolean'), ('header_bytes_per_iteration', 'float'), ('framing_bytes_per_iteration', 'float'), - ('nows_per_iteration', 'float'), ] SANITIZE = { @@ -104,3 +103,4 @@ for row in bm_json.expand_json(js, js2): if row[name] == '': continue sane_row[name] = SANITIZE[sql_type](row[name]) writer.writerow(sane_row) + diff --git a/tools/profiling/microbenchmarks/bm_diff.py b/tools/profiling/microbenchmarks/bm_diff.py index 3c15478774e..35a79593b41 100755 --- a/tools/profiling/microbenchmarks/bm_diff.py +++ b/tools/profiling/microbenchmarks/bm_diff.py @@ -41,23 +41,6 @@ import pipes import os sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), '..', '..', 'run_tests', 'python_utils')) import comment_on_pr -import jobset -import itertools -import speedup -import random -import shutil -import errno - -_INTERESTING = ( - 'cpu_time', - 'real_time', - 'locks_per_iteration', - 'allocs_per_iteration', - 'writes_per_iteration', - 'atm_cas_per_iteration', - 'atm_add_per_iteration', - 'nows_per_iteration', -) def changed_ratio(n, o): if float(o) <= .0001: o = 0 @@ -77,6 +60,26 @@ def median(ary): def min_change(pct): return lambda n, o: abs(changed_ratio(n,o)) > pct/100.0 +nanos = { + 'abs_diff': 5, + 'pct_diff': 10, +} +counter = { + 'abs_diff': 0.5, + 'pct_diff': 10, +} + +_INTERESTING = { + 'cpu_time': nanos, + 'real_time': nanos, + 'locks_per_iteration': counter, + 'allocs_per_iteration': counter, + 'writes_per_iteration': counter, + 'atm_cas_per_iteration': counter, + 'atm_add_per_iteration': counter, +} + + _AVAILABLE_BENCHMARK_TESTS = ['bm_fullstack_unary_ping_pong', 'bm_fullstack_streaming_ping_pong', 'bm_fullstack_streaming_pump', @@ -92,15 +95,14 @@ _AVAILABLE_BENCHMARK_TESTS = ['bm_fullstack_unary_ping_pong', argp = argparse.ArgumentParser(description='Perform diff on microbenchmarks') argp.add_argument('-t', '--track', - choices=sorted(_INTERESTING), + choices=sorted(_INTERESTING.keys()), nargs='+', - default=sorted(_INTERESTING), + default=sorted(_INTERESTING.keys()), help='Which metrics to track') argp.add_argument('-b', '--benchmarks', nargs='+', choices=_AVAILABLE_BENCHMARK_TESTS, default=['bm_cq']) argp.add_argument('-d', '--diff_base', type=str) -argp.add_argument('-r', '--repetitions', type=int, default=1) -argp.add_argument('-l', '--loops', type=int, default=20) -argp.add_argument('-j', '--jobs', type=int, default=multiprocessing.cpu_count()) +argp.add_argument('-r', '--repetitions', type=int, default=4) +argp.add_argument('-p', '--p_threshold', type=float, default=0.01) args = argp.parse_args() assert args.diff_base @@ -115,10 +117,9 @@ def avg(lst): def make_cmd(cfg): return ['make'] + args.benchmarks + [ - 'CONFIG=%s' % cfg, '-j', '%d' % args.jobs] + 'CONFIG=%s' % cfg, '-j', '%d' % multiprocessing.cpu_count()] -def build(dest): - shutil.rmtree('bm_diff_%s' % dest, ignore_errors=True) +def build(): subprocess.check_call(['git', 'submodule', 'update']) try: subprocess.check_call(make_cmd('opt')) @@ -127,38 +128,38 @@ def build(dest): subprocess.check_call(['make', 'clean']) subprocess.check_call(make_cmd('opt')) subprocess.check_call(make_cmd('counters')) - os.rename('bins', 'bm_diff_%s' % dest) -def collect1(bm, cfg, ver, idx): - cmd = ['bm_diff_%s/%s/%s' % (ver, cfg, bm), - '--benchmark_out=%s.%s.%s.%d.json' % (bm, cfg, ver, idx), +def collect1(bm, cfg, ver): + cmd = ['bins/%s/%s' % (cfg, bm), + '--benchmark_out=%s.%s.%s.json' % (bm, cfg, ver), '--benchmark_out_format=json', '--benchmark_repetitions=%d' % (args.repetitions) ] - return jobset.JobSpec(cmd, shortname='%s %s %s %d/%d' % (bm, cfg, ver, idx+1, args.loops), - verbose_success=True, timeout_seconds=None) + print cmd + subprocess.check_call(cmd) -build('new') +build() +for bm in args.benchmarks: + collect1(bm, 'opt', 'new') + collect1(bm, 'counters', 'new') where_am_i = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']).strip() subprocess.check_call(['git', 'checkout', args.diff_base]) + try: - build('old') + build() + comparables = [] + for bm in args.benchmarks: + try: + collect1(bm, 'opt', 'old') + collect1(bm, 'counters', 'old') + comparables.append(bm) + except subprocess.CalledProcessError, e: + pass finally: subprocess.check_call(['git', 'checkout', where_am_i]) subprocess.check_call(['git', 'submodule', 'update']) -jobs = [] -for loop in range(0, args.loops): - jobs.extend(x for x in itertools.chain( - (collect1(bm, 'opt', 'new', loop) for bm in args.benchmarks), - (collect1(bm, 'counters', 'new', loop) for bm in args.benchmarks), - (collect1(bm, 'opt', 'old', loop) for bm in args.benchmarks), - (collect1(bm, 'counters', 'old', loop) for bm in args.benchmarks), - )) -random.shuffle(jobs, random.SystemRandom().random) - -jobset.run(jobs, maxjobs=args.jobs) class Benchmark: @@ -179,11 +180,16 @@ class Benchmark: new = self.samples[True][f] old = self.samples[False][f] if not new or not old: continue - mdn_diff = abs(median(new) - median(old)) - print '%s: new=%r old=%r mdn_diff=%r' % (f, new, old, mdn_diff) - s = speedup.speedup(new, old) - if abs(s) > 3 and mdn_diff > 0.5: - self.final[f] = '%+d%%' % s + p = stats.ttest_ind(new, old)[1] + new_mdn = median(new) + old_mdn = median(old) + delta = new_mdn - old_mdn + ratio = changed_ratio(new_mdn, old_mdn) + print '%s: new=%r old=%r new_mdn=%f old_mdn=%f delta=%f(%f:%f) ratio=%f(%f:%f) p=%f' % ( + f, new, old, new_mdn, old_mdn, delta, abs(delta), _INTERESTING[f]['abs_diff'], ratio, abs(ratio), _INTERESTING[f]['pct_diff']/100.0, p + ) + if p < args.p_threshold and abs(delta) > _INTERESTING[f]['abs_diff'] and abs(ratio) > _INTERESTING[f]['pct_diff']/100.0: + self.final[f] = delta return self.final.keys() def skip(self): @@ -193,63 +199,43 @@ class Benchmark: return [self.final[f] if f in self.final else '' for f in flds] -def eintr_be_gone(fn): - """Run fn until it doesn't stop because of EINTR""" - while True: - try: - return fn() - except IOError, e: - if e.errno != errno.EINTR: - raise - - -def read_json(filename): - try: - with open(filename) as f: return json.loads(f.read()) - except ValueError, e: - return None - - -def finalize(): - benchmarks = collections.defaultdict(Benchmark) - - for bm in args.benchmarks: - for loop in range(0, args.loops): - js_new_ctr = read_json('%s.counters.new.%d.json' % (bm, loop)) - js_new_opt = read_json('%s.opt.new.%d.json' % (bm, loop)) - js_old_ctr = read_json('%s.counters.old.%d.json' % (bm, loop)) - js_old_opt = read_json('%s.opt.old.%d.json' % (bm, loop)) - - if js_new_ctr: - for row in bm_json.expand_json(js_new_ctr, js_new_opt): - print row - name = row['cpp_name'] - if name.endswith('_mean') or name.endswith('_stddev'): continue - benchmarks[name].add_sample(row, True) - if js_old_ctr: - for row in bm_json.expand_json(js_old_ctr, js_old_opt): - print row - name = row['cpp_name'] - if name.endswith('_mean') or name.endswith('_stddev'): continue - benchmarks[name].add_sample(row, False) - - really_interesting = set() - for name, bm in benchmarks.items(): - print name - really_interesting.update(bm.process()) - fields = [f for f in args.track if f in really_interesting] - - headers = ['Benchmark'] + fields - rows = [] - for name in sorted(benchmarks.keys()): - if benchmarks[name].skip(): continue - rows.append([name] + benchmarks[name].row(fields)) - if rows: - text = 'Performance differences noted:\n' + tabulate.tabulate(rows, headers=headers, floatfmt='+.2f') - else: - text = 'No significant performance differences' - comment_on_pr.comment_on_pr('```\n%s\n```' % text) - print text - - -eintr_be_gone(finalize) +benchmarks = collections.defaultdict(Benchmark) + +for bm in comparables: + with open('%s.counters.new.json' % bm) as f: + js_new_ctr = json.loads(f.read()) + with open('%s.opt.new.json' % bm) as f: + js_new_opt = json.loads(f.read()) + with open('%s.counters.old.json' % bm) as f: + js_old_ctr = json.loads(f.read()) + with open('%s.opt.old.json' % bm) as f: + js_old_opt = json.loads(f.read()) + + for row in bm_json.expand_json(js_new_ctr, js_new_opt): + print row + name = row['cpp_name'] + if name.endswith('_mean') or name.endswith('_stddev'): continue + benchmarks[name].add_sample(row, True) + for row in bm_json.expand_json(js_old_ctr, js_old_opt): + print row + name = row['cpp_name'] + if name.endswith('_mean') or name.endswith('_stddev'): continue + benchmarks[name].add_sample(row, False) + +really_interesting = set() +for name, bm in benchmarks.items(): + print name + really_interesting.update(bm.process()) +fields = [f for f in args.track if f in really_interesting] + +headers = ['Benchmark'] + fields +rows = [] +for name in sorted(benchmarks.keys()): + if benchmarks[name].skip(): continue + rows.append([name] + benchmarks[name].row(fields)) +if rows: + text = 'Performance differences noted:\n' + tabulate.tabulate(rows, headers=headers, floatfmt='+.2f') +else: + text = 'No significant performance differences' +comment_on_pr.comment_on_pr('```\n%s\n```' % text) +print text diff --git a/tools/profiling/microbenchmarks/speedup.py b/tools/profiling/microbenchmarks/speedup.py deleted file mode 100644 index 8af0066c9df..00000000000 --- a/tools/profiling/microbenchmarks/speedup.py +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright 2017, Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -from scipy import stats -import math - -_THRESHOLD = 1e-10 - -def scale(a, mul): - return [x*mul for x in a] - -def cmp(a, b): - return stats.ttest_ind(a, b) - -def speedup(new, old): - s0, p0 = cmp(new, old) - if math.isnan(p0): return 0 - if s0 == 0: return 0 - if p0 > _THRESHOLD: return 0 - if s0 < 0: - pct = 1 - while pct < 101: - sp, pp = cmp(new, scale(old, 1 - pct/100.0)) - if sp > 0: break - if pp > _THRESHOLD: break - pct += 1 - return -(pct - 1) - else: - pct = 1 - while pct < 100000: - sp, pp = cmp(new, scale(old, 1 + pct/100.0)) - if sp < 0: break - if pp > _THRESHOLD: break - pct += 1 - return pct - 1 - -if __name__ == "__main__": - new=[66034560.0, 126765693.0, 99074674.0, 98588433.0, 96731372.0, 110179725.0, 103802110.0, 101139800.0, 102357205.0, 99016353.0, 98840824.0, 99585632.0, 98791720.0, 96171521.0, 95327098.0, 95629704.0, 98209772.0, 99779411.0, 100182488.0, 98354192.0, 99644781.0, 98546709.0, 99019176.0, 99543014.0, 99077269.0, 98046601.0, 99319039.0, 98542572.0, 98886614.0, 72560968.0] - old=[60423464.0, 71249570.0, 73213089.0, 73200055.0, 72911768.0, 72347798.0, 72494672.0, 72756976.0, 72116565.0, 71541342.0, 73442538.0, 74817383.0, 73007780.0, 72499062.0, 72404945.0, 71843504.0, 73245405.0, 72778304.0, 74004519.0, 73694464.0, 72919931.0, 72955481.0, 71583857.0, 71350467.0, 71836817.0, 70064115.0, 70355345.0, 72516202.0, 71716777.0, 71532266.0] - print speedup(new, old) - print speedup(old, new) diff --git a/tools/run_tests/README.md b/tools/run_tests/README.md index 05d33fd6b1c..e709ddd2c02 100644 --- a/tools/run_tests/README.md +++ b/tools/run_tests/README.md @@ -1,44 +1,44 @@ -# Overview +#Overview This directory contains scripts that facilitate building and running tests. We are using python scripts as entrypoint for our tests because that gives us the opportunity to run tests using the same commandline regardless of the platform you are using. -# Unit tests (run_tests.py) +#Unit tests (run_tests.py) Builds gRPC in given language and runs unit tests. Use `tools/run_tests/run_tests.py --help` for more help. -###### Example +######Example `tools/run_tests/run_tests.py -l csharp -c dbg` -###### Useful options (among many others) +######Useful options (among many others) - `--use_docker` Builds a docker container containing all the prerequisites for given language and runs the tests under that container. - `--build_only` Only build, do not run the tests. -# Interop tests (run_interop_tests.py) +#Interop tests (run_interop_tests.py) Runs tests for cross-platform/cross-language interoperability. For more details, see [Interop tests descriptions](/doc/interop-test-descriptions.md) The script is also capable of running interop tests for grpc-java and grpc-go, using sources checked out alongside the ones of the grpc repository. -###### Example +######Example `tools/run_tests/run_interop_tests.py -l csharp -s c++ --use_docker` (run interop tests with C# client and C++ server) Note: if you see an error like `no space left on device` when running the interop tests using Docker, make sure that Docker is building the image files in a location with sufficient disk space. -# Performance benchmarks (run_performance_tests.py) +#Performance benchmarks (run_performance_tests.py) Runs predefined benchmark scenarios for given languages. Besides the simple configuration of running all the scenarios locally, the script also supports orchestrating test runs with client and server running on different machines and uploading the results to BigQuery. -###### Example +######Example `tools/run_tests/run_peformance_tests.py -l c++ node` -###### Useful options +######Useful options - `--regex` use regex to select particular scenarios to run. -# Stress tests (run_stress_tests.py) +#Stress tests (run_stress_tests.py) Runs modified interop tests clients and servers under heavy load for an extended period of time to discover potential stability issues. The tests are internally using Kubernetes to run the client and server on GKE and upload statistics to BigQuery. @@ -47,10 +47,10 @@ The tests are internally using Kubernetes to run the client and server on GKE an The directory `tools/run_tests/stress_test/configs/` contains the config files for several scenarios -# Artifacts & Packages (task_runner.py) +#Artifacts & Packages (task_runner.py) A generalized framework for running predefined tasks based on their labels. We use this to building binary artifacts & distrib packages and testing them) -###### Example +######Example `tools/run_tests/task_runner.py -f python artifact linux x64` (build tasks with labels `python`, `artifact`, `linux`, and `x64`) diff --git a/tools/run_tests/generated/configs.json b/tools/run_tests/generated/configs.json index abbe76d60c2..93dd6fb3d43 100644 --- a/tools/run_tests/generated/configs.json +++ b/tools/run_tests/generated/configs.json @@ -38,9 +38,6 @@ "ASAN_OPTIONS": "detect_leaks=0:color=always" } }, - { - "config": "c++-compat" - }, { "config": "ubsan", "environ": { diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 1f3bf7837f1..f5653d6f9ef 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -470,23 +470,6 @@ "third_party": false, "type": "target" }, - { - "deps": [ - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "fake_resolver_test", - "src": [ - "test/core/client_channel/resolvers/fake_resolver_test.c" - ], - "third_party": false, - "type": "target" - }, { "deps": [ "gpr", @@ -1606,23 +1589,6 @@ "third_party": false, "type": "target" }, - { - "deps": [ - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "minimal_stack_is_minimal_test", - "src": [ - "test/core/channel/minimal_stack_is_minimal_test.c" - ], - "third_party": false, - "type": "target" - }, { "deps": [ "gpr", @@ -1978,23 +1944,6 @@ "third_party": false, "type": "target" }, - { - "deps": [ - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "slice_hash_table_test", - "src": [ - "test/core/slice/slice_hash_table_test.c" - ], - "third_party": false, - "type": "target" - }, { "deps": [ "gpr", @@ -2871,19 +2820,14 @@ "headers": [ "src/proto/grpc/testing/control.grpc.pb.h", "src/proto/grpc/testing/control.pb.h", - "src/proto/grpc/testing/control_mock.grpc.pb.h", "src/proto/grpc/testing/messages.grpc.pb.h", "src/proto/grpc/testing/messages.pb.h", - "src/proto/grpc/testing/messages_mock.grpc.pb.h", "src/proto/grpc/testing/payloads.grpc.pb.h", "src/proto/grpc/testing/payloads.pb.h", - "src/proto/grpc/testing/payloads_mock.grpc.pb.h", "src/proto/grpc/testing/services.grpc.pb.h", "src/proto/grpc/testing/services.pb.h", - "src/proto/grpc/testing/services_mock.grpc.pb.h", "src/proto/grpc/testing/stats.grpc.pb.h", - "src/proto/grpc/testing/stats.pb.h", - "src/proto/grpc/testing/stats_mock.grpc.pb.h" + "src/proto/grpc/testing/stats.pb.h" ], "is_filegroup": false, "language": "c++", @@ -2896,27 +2840,20 @@ }, { "deps": [ - "gpr", - "grpc", "grpc++_codegen_base", "grpc++_codegen_base_src" ], "headers": [ "src/proto/grpc/testing/control.grpc.pb.h", "src/proto/grpc/testing/control.pb.h", - "src/proto/grpc/testing/control_mock.grpc.pb.h", "src/proto/grpc/testing/messages.grpc.pb.h", "src/proto/grpc/testing/messages.pb.h", - "src/proto/grpc/testing/messages_mock.grpc.pb.h", "src/proto/grpc/testing/payloads.grpc.pb.h", "src/proto/grpc/testing/payloads.pb.h", - "src/proto/grpc/testing/payloads_mock.grpc.pb.h", "src/proto/grpc/testing/services.grpc.pb.h", "src/proto/grpc/testing/services.pb.h", - "src/proto/grpc/testing/services_mock.grpc.pb.h", "src/proto/grpc/testing/stats.grpc.pb.h", - "src/proto/grpc/testing/stats.pb.h", - "src/proto/grpc/testing/stats_mock.grpc.pb.h" + "src/proto/grpc/testing/stats.pb.h" ], "is_filegroup": false, "language": "c++", @@ -3037,8 +2974,7 @@ ], "headers": [ "src/proto/grpc/testing/echo_messages.grpc.pb.h", - "src/proto/grpc/testing/echo_messages.pb.h", - "src/proto/grpc/testing/echo_messages_mock.grpc.pb.h" + "src/proto/grpc/testing/echo_messages.pb.h" ], "is_filegroup": false, "language": "c++", @@ -3095,8 +3031,7 @@ ], "headers": [ "src/proto/grpc/testing/compiler_test.grpc.pb.h", - "src/proto/grpc/testing/compiler_test.pb.h", - "src/proto/grpc/testing/compiler_test_mock.grpc.pb.h" + "src/proto/grpc/testing/compiler_test.pb.h" ], "is_filegroup": false, "language": "c++", @@ -3241,9 +3176,7 @@ "src/proto/grpc/testing/echo.grpc.pb.h", "src/proto/grpc/testing/echo.pb.h", "src/proto/grpc/testing/echo_messages.grpc.pb.h", - "src/proto/grpc/testing/echo_messages.pb.h", - "src/proto/grpc/testing/echo_messages_mock.grpc.pb.h", - "src/proto/grpc/testing/echo_mock.grpc.pb.h" + "src/proto/grpc/testing/echo_messages.pb.h" ], "is_filegroup": false, "language": "c++", @@ -3263,8 +3196,7 @@ ], "headers": [ "src/proto/grpc/lb/v1/load_balancer.grpc.pb.h", - "src/proto/grpc/lb/v1/load_balancer.pb.h", - "src/proto/grpc/lb/v1/load_balancer_mock.grpc.pb.h" + "src/proto/grpc/lb/v1/load_balancer.pb.h" ], "is_filegroup": false, "language": "c++", @@ -3286,8 +3218,7 @@ ], "headers": [ "src/proto/grpc/lb/v1/load_balancer.grpc.pb.h", - "src/proto/grpc/lb/v1/load_balancer.pb.h", - "src/proto/grpc/lb/v1/load_balancer_mock.grpc.pb.h" + "src/proto/grpc/lb/v1/load_balancer.pb.h" ], "is_filegroup": false, "language": "c++", @@ -3442,7 +3373,6 @@ "headers": [ "src/proto/grpc/testing/metrics.grpc.pb.h", "src/proto/grpc/testing/metrics.pb.h", - "src/proto/grpc/testing/metrics_mock.grpc.pb.h", "test/cpp/util/metrics_server.h" ], "is_filegroup": false, @@ -3464,14 +3394,11 @@ "grpc++_test_util", "grpc_test_util" ], - "headers": [ - "include/grpc++/test/mock_stream.h" - ], + "headers": [], "is_filegroup": false, "language": "c++", "name": "mock_test", "src": [ - "include/grpc++/test/mock_stream.h", "test/cpp/end2end/mock_test.cc" ], "third_party": false, @@ -3630,13 +3557,10 @@ "headers": [ "src/proto/grpc/testing/empty.grpc.pb.h", "src/proto/grpc/testing/empty.pb.h", - "src/proto/grpc/testing/empty_mock.grpc.pb.h", "src/proto/grpc/testing/messages.grpc.pb.h", "src/proto/grpc/testing/messages.pb.h", - "src/proto/grpc/testing/messages_mock.grpc.pb.h", "src/proto/grpc/testing/test.grpc.pb.h", - "src/proto/grpc/testing/test.pb.h", - "src/proto/grpc/testing/test_mock.grpc.pb.h" + "src/proto/grpc/testing/test.pb.h" ], "is_filegroup": false, "language": "c++", @@ -3662,13 +3586,10 @@ "headers": [ "src/proto/grpc/testing/empty.grpc.pb.h", "src/proto/grpc/testing/empty.pb.h", - "src/proto/grpc/testing/empty_mock.grpc.pb.h", "src/proto/grpc/testing/messages.grpc.pb.h", "src/proto/grpc/testing/messages.pb.h", - "src/proto/grpc/testing/messages_mock.grpc.pb.h", "src/proto/grpc/testing/test.grpc.pb.h", - "src/proto/grpc/testing/test.pb.h", - "src/proto/grpc/testing/test_mock.grpc.pb.h" + "src/proto/grpc/testing/test.pb.h" ], "is_filegroup": false, "language": "c++", @@ -3769,9 +3690,7 @@ "src/proto/grpc/testing/echo.grpc.pb.h", "src/proto/grpc/testing/echo.pb.h", "src/proto/grpc/testing/echo_messages.grpc.pb.h", - "src/proto/grpc/testing/echo_messages.pb.h", - "src/proto/grpc/testing/echo_messages_mock.grpc.pb.h", - "src/proto/grpc/testing/echo_mock.grpc.pb.h" + "src/proto/grpc/testing/echo_messages.pb.h" ], "is_filegroup": false, "language": "c++", @@ -3908,16 +3827,12 @@ "headers": [ "src/proto/grpc/testing/empty.grpc.pb.h", "src/proto/grpc/testing/empty.pb.h", - "src/proto/grpc/testing/empty_mock.grpc.pb.h", "src/proto/grpc/testing/messages.grpc.pb.h", "src/proto/grpc/testing/messages.pb.h", - "src/proto/grpc/testing/messages_mock.grpc.pb.h", "src/proto/grpc/testing/metrics.grpc.pb.h", "src/proto/grpc/testing/metrics.pb.h", - "src/proto/grpc/testing/metrics_mock.grpc.pb.h", "src/proto/grpc/testing/test.grpc.pb.h", "src/proto/grpc/testing/test.pb.h", - "src/proto/grpc/testing/test_mock.grpc.pb.h", "test/cpp/interop/client_helper.h", "test/cpp/interop/interop_client.h", "test/cpp/interop/stress_interop_client.h", @@ -5696,13 +5611,11 @@ "census", "gpr", "grpc_base", - "grpc_deadline_filter", "grpc_lb_policy_grpclb_secure", "grpc_lb_policy_pick_first", "grpc_lb_policy_round_robin", "grpc_load_reporting", "grpc_max_age_filter", - "grpc_message_size_filter", "grpc_resolver_dns_ares", "grpc_resolver_dns_native", "grpc_resolver_sockaddr", @@ -5801,13 +5714,11 @@ "census", "gpr", "grpc_base", - "grpc_deadline_filter", "grpc_lb_policy_grpclb", "grpc_lb_policy_pick_first", "grpc_lb_policy_round_robin", "grpc_load_reporting", "grpc_max_age_filter", - "grpc_message_size_filter", "grpc_resolver_dns_ares", "grpc_resolver_dns_native", "grpc_resolver_sockaddr", @@ -5932,8 +5843,7 @@ "headers": [ "include/grpc++/support/error_details.h", "src/proto/grpc/status/status.grpc.pb.h", - "src/proto/grpc/status/status.pb.h", - "src/proto/grpc/status/status_mock.grpc.pb.h" + "src/proto/grpc/status/status.pb.h" ], "is_filegroup": false, "language": "c++", @@ -6013,16 +5923,12 @@ "headers": [ "src/proto/grpc/health/v1/health.grpc.pb.h", "src/proto/grpc/health/v1/health.pb.h", - "src/proto/grpc/health/v1/health_mock.grpc.pb.h", "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h", "src/proto/grpc/testing/duplicate/echo_duplicate.pb.h", - "src/proto/grpc/testing/duplicate/echo_duplicate_mock.grpc.pb.h", "src/proto/grpc/testing/echo.grpc.pb.h", "src/proto/grpc/testing/echo.pb.h", "src/proto/grpc/testing/echo_messages.grpc.pb.h", "src/proto/grpc/testing/echo_messages.pb.h", - "src/proto/grpc/testing/echo_messages_mock.grpc.pb.h", - "src/proto/grpc/testing/echo_mock.grpc.pb.h", "test/cpp/end2end/test_service_impl.h", "test/cpp/util/byte_buffer_proto_helper.h", "test/cpp/util/create_test_channel.h", @@ -6202,13 +6108,10 @@ "headers": [ "src/proto/grpc/testing/empty.grpc.pb.h", "src/proto/grpc/testing/empty.pb.h", - "src/proto/grpc/testing/empty_mock.grpc.pb.h", "src/proto/grpc/testing/messages.grpc.pb.h", "src/proto/grpc/testing/messages.pb.h", - "src/proto/grpc/testing/messages_mock.grpc.pb.h", "src/proto/grpc/testing/test.grpc.pb.h", "src/proto/grpc/testing/test.pb.h", - "src/proto/grpc/testing/test_mock.grpc.pb.h", "test/cpp/interop/http2_client.h" ], "is_filegroup": false, @@ -6232,7 +6135,6 @@ "headers": [ "src/proto/grpc/testing/messages.grpc.pb.h", "src/proto/grpc/testing/messages.pb.h", - "src/proto/grpc/testing/messages_mock.grpc.pb.h", "test/cpp/interop/client_helper.h" ], "is_filegroup": false, @@ -6259,13 +6161,10 @@ "headers": [ "src/proto/grpc/testing/empty.grpc.pb.h", "src/proto/grpc/testing/empty.pb.h", - "src/proto/grpc/testing/empty_mock.grpc.pb.h", "src/proto/grpc/testing/messages.grpc.pb.h", "src/proto/grpc/testing/messages.pb.h", - "src/proto/grpc/testing/messages_mock.grpc.pb.h", "src/proto/grpc/testing/test.grpc.pb.h", "src/proto/grpc/testing/test.pb.h", - "src/proto/grpc/testing/test_mock.grpc.pb.h", "test/cpp/interop/interop_client.h" ], "is_filegroup": false, @@ -6314,13 +6213,10 @@ "headers": [ "src/proto/grpc/testing/empty.grpc.pb.h", "src/proto/grpc/testing/empty.pb.h", - "src/proto/grpc/testing/empty_mock.grpc.pb.h", "src/proto/grpc/testing/messages.grpc.pb.h", "src/proto/grpc/testing/messages.pb.h", - "src/proto/grpc/testing/messages_mock.grpc.pb.h", "src/proto/grpc/testing/test.grpc.pb.h", - "src/proto/grpc/testing/test.pb.h", - "src/proto/grpc/testing/test_mock.grpc.pb.h" + "src/proto/grpc/testing/test.pb.h" ], "is_filegroup": false, "language": "c++", @@ -6354,19 +6250,14 @@ "headers": [ "src/proto/grpc/testing/control.grpc.pb.h", "src/proto/grpc/testing/control.pb.h", - "src/proto/grpc/testing/control_mock.grpc.pb.h", "src/proto/grpc/testing/messages.grpc.pb.h", "src/proto/grpc/testing/messages.pb.h", - "src/proto/grpc/testing/messages_mock.grpc.pb.h", "src/proto/grpc/testing/payloads.grpc.pb.h", "src/proto/grpc/testing/payloads.pb.h", - "src/proto/grpc/testing/payloads_mock.grpc.pb.h", "src/proto/grpc/testing/services.grpc.pb.h", "src/proto/grpc/testing/services.pb.h", - "src/proto/grpc/testing/services_mock.grpc.pb.h", "src/proto/grpc/testing/stats.grpc.pb.h", "src/proto/grpc/testing/stats.pb.h", - "src/proto/grpc/testing/stats_mock.grpc.pb.h", "test/cpp/qps/benchmark_config.h", "test/cpp/qps/client.h", "test/cpp/qps/driver.h", @@ -7684,11 +7575,16 @@ "src/core/lib/channel/channel_args.h", "src/core/lib/channel/channel_stack.h", "src/core/lib/channel/channel_stack_builder.h", + "src/core/lib/channel/compress_filter.h", "src/core/lib/channel/connected_channel.h", "src/core/lib/channel/context.h", + "src/core/lib/channel/deadline_filter.h", "src/core/lib/channel/handshaker.h", "src/core/lib/channel/handshaker_factory.h", "src/core/lib/channel/handshaker_registry.h", + "src/core/lib/channel/http_client_filter.h", + "src/core/lib/channel/http_server_filter.h", + "src/core/lib/channel/message_size_filter.h", "src/core/lib/compression/algorithm_metadata.h", "src/core/lib/compression/message_compress.h", "src/core/lib/debug/trace.h", @@ -7808,15 +7704,25 @@ "src/core/lib/channel/channel_stack.h", "src/core/lib/channel/channel_stack_builder.c", "src/core/lib/channel/channel_stack_builder.h", + "src/core/lib/channel/compress_filter.c", + "src/core/lib/channel/compress_filter.h", "src/core/lib/channel/connected_channel.c", "src/core/lib/channel/connected_channel.h", "src/core/lib/channel/context.h", + "src/core/lib/channel/deadline_filter.c", + "src/core/lib/channel/deadline_filter.h", "src/core/lib/channel/handshaker.c", "src/core/lib/channel/handshaker.h", "src/core/lib/channel/handshaker_factory.c", "src/core/lib/channel/handshaker_factory.h", "src/core/lib/channel/handshaker_registry.c", "src/core/lib/channel/handshaker_registry.h", + "src/core/lib/channel/http_client_filter.c", + "src/core/lib/channel/http_client_filter.h", + "src/core/lib/channel/http_server_filter.c", + "src/core/lib/channel/http_server_filter.h", + "src/core/lib/channel/message_size_filter.c", + "src/core/lib/channel/message_size_filter.h", "src/core/lib/compression/algorithm_metadata.h", "src/core/lib/compression/compression.c", "src/core/lib/compression/message_compress.c", @@ -8035,8 +7941,7 @@ { "deps": [ "gpr", - "grpc_base", - "grpc_deadline_filter" + "grpc_base" ], "headers": [ "src/core/ext/filters/client_channel/client_channel.h", @@ -8134,49 +8039,6 @@ "third_party": false, "type": "filegroup" }, - { - "deps": [ - "gpr", - "grpc_base" - ], - "headers": [ - "src/core/ext/filters/deadline/deadline_filter.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_deadline_filter", - "src": [ - "src/core/ext/filters/deadline/deadline_filter.c", - "src/core/ext/filters/deadline/deadline_filter.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base" - ], - "headers": [ - "src/core/ext/filters/http/client/http_client_filter.h", - "src/core/ext/filters/http/message_compress/message_compress_filter.h", - "src/core/ext/filters/http/server/http_server_filter.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_http_filters", - "src": [ - "src/core/ext/filters/http/client/http_client_filter.c", - "src/core/ext/filters/http/client/http_client_filter.h", - "src/core/ext/filters/http/http_filters_plugin.c", - "src/core/ext/filters/http/message_compress/message_compress_filter.c", - "src/core/ext/filters/http/message_compress/message_compress_filter.h", - "src/core/ext/filters/http/server/http_server_filter.c", - "src/core/ext/filters/http/server/http_server_filter.h" - ], - "third_party": false, - "type": "filegroup" - }, { "deps": [ "gpr", @@ -8307,24 +8169,6 @@ "third_party": false, "type": "filegroup" }, - { - "deps": [ - "gpr", - "grpc_base" - ], - "headers": [ - "src/core/ext/filters/message_size/message_size_filter.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_message_size_filter", - "src": [ - "src/core/ext/filters/message_size/message_size_filter.c", - "src/core/ext/filters/message_size/message_size_filter.h" - ], - "third_party": false, - "type": "filegroup" - }, { "deps": [ "gpr", @@ -8525,7 +8369,6 @@ "deps": [ "gpr", "grpc_base", - "grpc_http_filters", "grpc_transport_chttp2_alpn" ], "headers": [ @@ -8730,7 +8573,6 @@ { "deps": [ "grpc_base", - "grpc_http_filters", "grpc_transport_chttp2" ], "headers": [ @@ -8981,6 +8823,7 @@ "include/grpc++/impl/codegen/slice.h", "include/grpc++/impl/codegen/status.h", "include/grpc++/impl/codegen/status_code_enum.h", + "include/grpc++/impl/codegen/status_helper.h", "include/grpc++/impl/codegen/string_ref.h", "include/grpc++/impl/codegen/stub_options.h", "include/grpc++/impl/codegen/sync_stream.h", @@ -9015,6 +8858,7 @@ "include/grpc++/impl/codegen/slice.h", "include/grpc++/impl/codegen/status.h", "include/grpc++/impl/codegen/status_code_enum.h", + "include/grpc++/impl/codegen/status_helper.h", "include/grpc++/impl/codegen/string_ref.h", "include/grpc++/impl/codegen/stub_options.h", "include/grpc++/impl/codegen/sync_stream.h", @@ -9072,8 +8916,7 @@ "deps": [], "headers": [ "src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h", - "src/proto/grpc/reflection/v1alpha/reflection.pb.h", - "src/proto/grpc/reflection/v1alpha/reflection_mock.grpc.pb.h" + "src/proto/grpc/reflection/v1alpha/reflection.pb.h" ], "is_filegroup": true, "language": "c++", @@ -9087,14 +8930,12 @@ "grpc++" ], "headers": [ - "include/grpc++/test/mock_stream.h", "include/grpc++/test/server_context_test_spouse.h" ], "is_filegroup": true, "language": "c++", "name": "grpc++_test", "src": [ - "include/grpc++/test/mock_stream.h", "include/grpc++/test/server_context_test_spouse.h" ], "third_party": false, diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index 058127862ea..a08caf30d36 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -9,7 +9,7 @@ "posix", "windows" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -363,7 +363,7 @@ "posix", "windows" ], - "cpu_cost": 10, + "cpu_cost": 30, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -407,7 +407,7 @@ "posix", "windows" ], - "cpu_cost": 2.0, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -564,7 +564,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 3, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -577,28 +577,6 @@ "linux" ] }, - { - "args": [], - "ci_platforms": [ - "linux", - "mac", - "posix", - "windows" - ], - "cpu_cost": 1.0, - "exclude_configs": [], - "exclude_iomgrs": [], - "flaky": false, - "gtest": false, - "language": "c", - "name": "fake_resolver_test", - "platforms": [ - "linux", - "mac", - "posix", - "windows" - ] - }, { "args": [], "ci_platforms": [ @@ -779,7 +757,7 @@ "posix", "windows" ], - "cpu_cost": 30, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -911,7 +889,7 @@ "posix", "windows" ], - "cpu_cost": 3, + "cpu_cost": 10, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -1697,28 +1675,6 @@ "windows" ] }, - { - "args": [], - "ci_platforms": [ - "linux", - "mac", - "posix", - "windows" - ], - "cpu_cost": 1.0, - "exclude_configs": [], - "exclude_iomgrs": [], - "flaky": false, - "gtest": false, - "language": "c", - "name": "minimal_stack_is_minimal_test", - "platforms": [ - "linux", - "mac", - "posix", - "windows" - ] - }, { "args": [], "ci_platforms": [ @@ -2071,28 +2027,6 @@ "windows" ] }, - { - "args": [], - "ci_platforms": [ - "linux", - "mac", - "posix", - "windows" - ], - "cpu_cost": 1.0, - "exclude_configs": [], - "exclude_iomgrs": [], - "flaky": false, - "gtest": false, - "language": "c", - "name": "slice_hash_table_test", - "platforms": [ - "linux", - "mac", - "posix", - "windows" - ] - }, { "args": [], "ci_platforms": [ @@ -3329,7 +3263,7 @@ }, { "args": [ - "--generated_file_path=gens/src/proto/grpc/testing/" + "--generated_file_path=gens/src/proto/grpc/testing/compiler_test.grpc.pb.h" ], "ci_platforms": [ "linux", @@ -5868,7 +5802,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -5937,7 +5871,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -6146,7 +6080,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -6192,7 +6126,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -6215,7 +6149,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -6261,7 +6195,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -6284,7 +6218,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -6353,7 +6287,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -6422,7 +6356,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -6445,7 +6379,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -6468,7 +6402,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -6493,7 +6427,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -6539,7 +6473,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -6631,7 +6565,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -6654,7 +6588,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -6723,7 +6657,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -6769,7 +6703,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -6792,7 +6726,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -6815,7 +6749,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -6838,7 +6772,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -6930,7 +6864,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -6976,7 +6910,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -6999,7 +6933,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -7091,7 +7025,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -7160,7 +7094,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -7369,7 +7303,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -7415,7 +7349,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -7438,7 +7372,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -7484,7 +7418,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -7507,7 +7441,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -7576,7 +7510,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -7645,7 +7579,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -7668,7 +7602,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -7691,7 +7625,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -7716,7 +7650,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -7762,7 +7696,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -7854,7 +7788,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -7877,7 +7811,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -7946,7 +7880,30 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_compress_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "resource_quota_server" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -7969,7 +7926,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -7992,7 +7949,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -8015,7 +7972,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -8038,7 +7995,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -8130,7 +8087,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -8176,7 +8133,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -8199,7 +8156,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -8287,7 +8244,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -8353,7 +8310,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -8553,7 +8510,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -8597,7 +8554,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -8619,7 +8576,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -8663,7 +8620,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -8685,7 +8642,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -8751,7 +8708,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -8817,7 +8774,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -8839,7 +8796,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -8861,7 +8818,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -8885,7 +8842,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -8929,7 +8886,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -9017,7 +8974,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -9039,7 +8996,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -9105,7 +9062,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -9149,7 +9106,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -9171,7 +9128,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -9193,7 +9150,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -9215,7 +9172,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -9303,7 +9260,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -9347,7 +9304,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -9369,7 +9326,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -9437,7 +9394,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -9506,7 +9463,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -9644,7 +9601,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -9690,7 +9647,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -9713,7 +9670,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -9759,7 +9716,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -9782,7 +9739,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -9851,7 +9808,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -9920,7 +9877,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -9943,7 +9900,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -9966,7 +9923,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -10012,7 +9969,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -10104,7 +10061,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -10173,7 +10130,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -10219,7 +10176,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -10242,7 +10199,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -10265,7 +10222,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -10288,7 +10245,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -10357,7 +10314,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -10403,7 +10360,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -10426,7 +10383,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -10519,7 +10476,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -10588,7 +10545,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -10797,7 +10754,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -10843,7 +10800,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -10866,7 +10823,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -10912,7 +10869,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -10935,7 +10892,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -11004,7 +10961,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -11073,7 +11030,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -11096,7 +11053,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -11119,7 +11076,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -11144,7 +11101,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -11190,7 +11147,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -11282,7 +11239,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -11305,7 +11262,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -11374,7 +11331,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -11420,7 +11377,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -11443,7 +11400,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -11466,7 +11423,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -11489,7 +11446,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -11581,7 +11538,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -11627,7 +11584,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -11650,7 +11607,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -11727,7 +11684,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -11784,7 +11741,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -11955,7 +11912,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -11993,7 +11950,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -12012,7 +11969,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -12050,7 +12007,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -12069,7 +12026,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -12126,7 +12083,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -12183,7 +12140,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -12202,7 +12159,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -12221,7 +12178,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -12240,7 +12197,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -12278,7 +12235,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -12354,7 +12311,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -12373,7 +12330,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -12430,7 +12387,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -12468,7 +12425,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -12487,7 +12444,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -12506,7 +12463,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -12525,7 +12482,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -12601,7 +12558,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -12639,7 +12596,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -12658,7 +12615,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -12749,7 +12706,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -12818,7 +12775,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -13027,7 +12984,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -13073,7 +13030,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -13096,7 +13053,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -13142,7 +13099,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -13211,7 +13168,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -13280,7 +13237,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -13303,7 +13260,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -13326,7 +13283,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -13351,7 +13308,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -13397,7 +13354,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -13466,7 +13423,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -13489,7 +13446,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -13558,7 +13515,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -13604,7 +13561,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -13627,7 +13584,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -13650,7 +13607,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -13673,7 +13630,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -13765,7 +13722,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -13811,7 +13768,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -13834,7 +13791,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -13928,7 +13885,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -14000,7 +13957,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -14216,7 +14173,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -14264,7 +14221,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -14288,7 +14245,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -14336,7 +14293,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -14360,7 +14317,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -14432,7 +14389,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -14504,7 +14461,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -14528,7 +14485,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -14552,7 +14509,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -14576,7 +14533,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -14624,7 +14581,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -14720,7 +14677,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -14744,7 +14701,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -14816,7 +14773,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -14864,7 +14821,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -14888,7 +14845,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -14912,7 +14869,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -14936,7 +14893,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -15032,7 +14989,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -15080,7 +15037,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -15104,7 +15061,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -15198,7 +15155,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -15267,7 +15224,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -15476,7 +15433,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -15522,7 +15479,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -15545,7 +15502,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -15591,7 +15548,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -15614,7 +15571,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -15683,7 +15640,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -15752,7 +15709,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -15775,7 +15732,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -15798,7 +15755,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -15823,7 +15780,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -15869,7 +15826,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -15961,7 +15918,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -15984,7 +15941,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -16053,7 +16010,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -16099,7 +16056,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -16122,7 +16079,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -16145,7 +16102,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -16168,7 +16125,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -16260,7 +16217,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -16306,7 +16263,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -16329,7 +16286,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -16423,7 +16380,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -16495,7 +16452,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -16711,7 +16668,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -16759,7 +16716,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -16783,7 +16740,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -16831,7 +16788,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -16855,7 +16812,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -16927,7 +16884,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -16999,7 +16956,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -17023,7 +16980,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -17047,7 +17004,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -17071,7 +17028,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -17119,7 +17076,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -17215,7 +17172,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -17239,7 +17196,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -17311,7 +17268,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -17359,7 +17316,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -17383,7 +17340,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -17407,7 +17364,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -17431,7 +17388,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -17527,7 +17484,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -17575,7 +17532,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -17599,7 +17556,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -17671,7 +17628,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -17743,7 +17700,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -17911,7 +17868,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -17959,7 +17916,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -17983,7 +17940,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -18031,7 +17988,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -18151,7 +18108,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -18175,7 +18132,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -18223,7 +18180,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -18319,7 +18276,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -18367,7 +18324,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -18391,7 +18348,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -18415,7 +18372,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -18439,7 +18396,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -18463,7 +18420,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -18559,7 +18516,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -18607,7 +18564,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -18631,7 +18588,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -18703,7 +18660,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -18775,7 +18732,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -18919,7 +18876,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -18967,7 +18924,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -18991,7 +18948,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -19039,7 +18996,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -19063,7 +19020,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -19135,7 +19092,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -19207,7 +19164,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -19231,7 +19188,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -19255,7 +19212,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -19303,7 +19260,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -19399,7 +19356,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -19471,7 +19428,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -19519,7 +19476,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -19543,7 +19500,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -19567,7 +19524,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -19591,7 +19548,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -19663,7 +19620,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -19711,7 +19668,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -19735,7 +19692,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -19807,7 +19764,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -19879,7 +19836,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -20023,7 +19980,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -20071,7 +20028,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -20095,7 +20052,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -20143,7 +20100,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -20215,7 +20172,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -20287,7 +20244,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -20311,7 +20268,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -20335,7 +20292,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -20383,7 +20340,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -20455,7 +20412,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -20527,7 +20484,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -20551,7 +20508,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -20575,7 +20532,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -20599,7 +20556,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -20623,7 +20580,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -20695,7 +20652,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -20743,7 +20700,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -20767,7 +20724,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -20843,7 +20800,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -20921,7 +20878,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -21077,7 +21034,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -21129,7 +21086,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -21155,7 +21112,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -21207,7 +21164,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -21233,7 +21190,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -21311,7 +21268,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -21389,7 +21346,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -21415,7 +21372,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -21441,7 +21398,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -21493,7 +21450,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -21597,7 +21554,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -21675,7 +21632,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -21701,7 +21658,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -21727,7 +21684,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -21753,7 +21710,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -21779,7 +21736,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -21857,7 +21814,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -21909,7 +21866,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -21935,7 +21892,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -22031,7 +21988,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -22100,7 +22057,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -22309,7 +22266,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -22355,7 +22312,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -22378,7 +22335,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -22424,7 +22381,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -22447,7 +22404,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -22516,7 +22473,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -22585,7 +22542,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -22608,7 +22565,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -22631,7 +22588,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -22656,7 +22613,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -22702,7 +22659,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -22794,7 +22751,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -22817,7 +22774,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -22886,7 +22843,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -22932,7 +22889,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -22955,7 +22912,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -22978,7 +22935,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -23001,7 +22958,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -23093,7 +23050,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -23139,7 +23096,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -23162,7 +23119,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -23254,7 +23211,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -23323,7 +23280,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -23532,7 +23489,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -23578,7 +23535,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -23601,7 +23558,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -23647,7 +23604,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -23670,7 +23627,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -23739,7 +23696,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -23808,7 +23765,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -23831,7 +23788,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -23854,7 +23811,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -23879,7 +23836,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -23925,7 +23882,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -24017,7 +23974,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -24040,7 +23997,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -24109,7 +24066,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -24155,7 +24112,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -24178,7 +24135,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -24201,7 +24158,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -24224,7 +24181,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -24316,7 +24273,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -24362,7 +24319,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -24385,7 +24342,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -24455,7 +24412,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -24527,7 +24484,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -24695,7 +24652,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -24743,7 +24700,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -24767,7 +24724,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -24815,7 +24772,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -24935,7 +24892,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -24959,7 +24916,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -25007,7 +24964,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -25103,7 +25060,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -25151,7 +25108,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -25175,7 +25132,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -25199,7 +25156,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -25223,7 +25180,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -25247,7 +25204,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -25343,7 +25300,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -25391,7 +25348,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -25415,7 +25372,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -25508,7 +25465,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -25577,7 +25534,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -25761,7 +25718,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -25807,7 +25764,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -25830,7 +25787,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -25876,7 +25833,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -25899,7 +25856,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -25968,7 +25925,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -26037,7 +25994,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -26060,7 +26017,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -26083,7 +26040,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -26106,7 +26063,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -26152,7 +26109,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -26244,7 +26201,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -26267,7 +26224,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -26336,7 +26293,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -26382,7 +26339,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -26405,7 +26362,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -26428,7 +26385,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -26451,7 +26408,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -26543,7 +26500,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -26589,7 +26546,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -26612,7 +26569,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -26705,7 +26662,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -26751,7 +26708,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -26960,7 +26917,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -27006,7 +26963,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -27029,7 +26986,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -27075,7 +27032,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -27098,7 +27055,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -27167,7 +27124,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -27236,7 +27193,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -27259,7 +27216,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -27282,7 +27239,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -27307,7 +27264,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -27353,7 +27310,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -27445,7 +27402,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -27468,7 +27425,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -27537,7 +27494,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -27583,7 +27540,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -27606,7 +27563,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -27629,7 +27586,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -27652,7 +27609,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -27744,7 +27701,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -27790,7 +27747,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -27813,7 +27770,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -27905,7 +27862,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -27951,7 +27908,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -28160,7 +28117,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -28206,7 +28163,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -28229,7 +28186,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -28275,7 +28232,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -28298,7 +28255,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -28367,7 +28324,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -28436,7 +28393,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -28459,7 +28416,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -28482,7 +28439,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -28507,7 +28464,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -28553,7 +28510,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -28645,7 +28602,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -28668,7 +28625,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -28737,7 +28694,30 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_compress_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "resource_quota_server" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -28760,7 +28740,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -28783,7 +28763,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -28806,7 +28786,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -28829,7 +28809,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -28921,7 +28901,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -28967,7 +28947,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -28990,7 +28970,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -29058,7 +29038,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -29104,7 +29084,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -29242,7 +29222,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -29288,7 +29268,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -29311,7 +29291,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -29357,7 +29337,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -29380,7 +29360,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -29449,7 +29429,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -29518,7 +29498,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -29541,7 +29521,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -29564,7 +29544,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -29610,7 +29590,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -29702,7 +29682,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -29771,7 +29751,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -29817,7 +29797,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -29840,7 +29820,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -29863,7 +29843,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -29886,7 +29866,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -29955,7 +29935,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -30001,7 +29981,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -30024,7 +30004,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -30117,7 +30097,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -30163,7 +30143,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -30372,7 +30352,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -30418,7 +30398,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -30441,7 +30421,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -30487,7 +30467,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -30510,7 +30490,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -30579,7 +30559,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -30648,7 +30628,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -30671,7 +30651,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -30694,7 +30674,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -30719,7 +30699,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -30765,7 +30745,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -30857,7 +30837,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -30880,7 +30860,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -30949,7 +30929,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -30995,7 +30975,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -31018,7 +30998,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -31041,7 +31021,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -31064,7 +31044,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -31156,7 +31136,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -31202,7 +31182,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -31225,7 +31205,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -31302,7 +31282,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -31340,7 +31320,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -31511,7 +31491,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -31549,7 +31529,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -31568,7 +31548,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -31606,7 +31586,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -31625,7 +31605,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -31682,7 +31662,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -31739,7 +31719,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -31758,7 +31738,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -31777,7 +31757,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -31796,7 +31776,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -31834,7 +31814,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -31910,7 +31890,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -31929,7 +31909,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -31986,7 +31966,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -32024,7 +32004,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -32043,7 +32023,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -32062,7 +32042,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -32081,7 +32061,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -32157,7 +32137,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -32195,7 +32175,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -32214,7 +32194,7 @@ "ci_platforms": [ "linux" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -32305,7 +32285,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -32351,7 +32331,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -32560,7 +32540,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -32606,7 +32586,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -32629,7 +32609,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -32675,7 +32655,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -32744,7 +32724,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -32813,7 +32793,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -32836,7 +32816,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -32859,7 +32839,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -32884,7 +32864,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -32930,7 +32910,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -32999,7 +32979,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -33022,7 +33002,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -33091,7 +33071,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -33137,7 +33117,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -33160,7 +33140,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -33183,7 +33163,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -33206,7 +33186,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -33298,7 +33278,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -33344,7 +33324,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -33367,7 +33347,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -33461,7 +33441,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -33509,7 +33489,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -33725,7 +33705,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -33773,7 +33753,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -33797,7 +33777,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -33845,7 +33825,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -33869,7 +33849,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -33941,7 +33921,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -34013,7 +33993,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -34037,7 +34017,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -34061,7 +34041,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -34085,7 +34065,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -34133,7 +34113,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -34229,7 +34209,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -34253,7 +34233,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -34325,7 +34305,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -34373,7 +34353,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -34397,7 +34377,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -34421,7 +34401,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -34445,7 +34425,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -34541,7 +34521,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -34589,7 +34569,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -34613,7 +34593,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -34707,7 +34687,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -34753,7 +34733,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -34962,7 +34942,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -35008,7 +34988,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -35031,7 +35011,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -35077,7 +35057,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -35100,7 +35080,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -35169,7 +35149,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -35238,7 +35218,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -35261,7 +35241,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -35284,7 +35264,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -35309,7 +35289,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -35355,7 +35335,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -35447,7 +35427,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -35470,7 +35450,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -35539,7 +35519,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -35585,7 +35565,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -35608,7 +35588,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -35631,7 +35611,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -35654,7 +35634,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -35746,7 +35726,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -35792,7 +35772,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -35815,7 +35795,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [], "flaky": false, @@ -35885,7 +35865,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -35933,7 +35913,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -36101,7 +36081,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -36149,7 +36129,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -36173,7 +36153,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -36221,7 +36201,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -36341,7 +36321,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -36365,7 +36345,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -36413,7 +36393,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -36509,7 +36489,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -36557,7 +36537,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -36581,7 +36561,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -36605,7 +36585,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -36629,7 +36609,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -36653,7 +36633,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -36749,7 +36729,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -36797,7 +36777,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -36821,7 +36801,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -36893,7 +36873,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -36941,7 +36921,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -37085,7 +37065,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -37133,7 +37113,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -37157,7 +37137,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -37205,7 +37185,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -37229,7 +37209,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -37301,7 +37281,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -37373,7 +37353,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -37397,7 +37377,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -37421,7 +37401,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -37469,7 +37449,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -37565,7 +37545,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -37637,7 +37617,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -37685,7 +37665,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -37709,7 +37689,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -37733,7 +37713,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -37757,7 +37737,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -37829,7 +37809,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -37877,7 +37857,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -37901,7 +37881,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -37973,7 +37953,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -38021,7 +38001,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -38165,7 +38145,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -38213,7 +38193,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -38237,7 +38217,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -38285,7 +38265,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -38357,7 +38337,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -38429,7 +38409,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -38453,7 +38433,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -38477,7 +38457,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -38525,7 +38505,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -38597,7 +38577,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -38669,7 +38649,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -38693,7 +38673,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -38717,7 +38697,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -38741,7 +38721,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -38765,7 +38745,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -38837,7 +38817,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -38885,7 +38865,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -38909,7 +38889,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -38985,7 +38965,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -39037,7 +39017,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -39193,7 +39173,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -39245,7 +39225,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -39271,7 +39251,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -39323,7 +39303,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -39349,7 +39329,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -39427,7 +39407,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -39505,7 +39485,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -39531,7 +39511,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -39557,7 +39537,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -39609,7 +39589,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -39713,7 +39693,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -39791,7 +39771,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -39817,7 +39797,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -39843,7 +39823,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -39869,7 +39849,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -39895,7 +39875,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -39973,7 +39953,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -40025,7 +40005,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -40051,7 +40031,7 @@ "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [ "msan" ], @@ -40146,7 +40126,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -40192,7 +40172,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -40376,7 +40356,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -40422,7 +40402,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -40445,7 +40425,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -40491,7 +40471,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -40514,7 +40494,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -40583,7 +40563,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -40652,7 +40632,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -40675,7 +40655,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -40698,7 +40678,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -40721,7 +40701,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -40767,7 +40747,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -40859,7 +40839,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -40882,7 +40862,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -40951,7 +40931,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -40997,7 +40977,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -41020,7 +41000,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -41043,7 +41023,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -41066,7 +41046,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -41158,7 +41138,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -41204,7 +41184,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -41227,7 +41207,7 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "exclude_iomgrs": [ "uv" @@ -42414,7 +42394,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -42452,7 +42431,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -42490,7 +42468,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -42528,7 +42505,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -42566,7 +42542,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -42604,7 +42579,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -42642,7 +42616,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -42680,7 +42653,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -42720,7 +42692,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -42758,7 +42729,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -42798,7 +42768,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -42836,7 +42805,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -42874,7 +42842,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -42912,7 +42879,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -42950,7 +42916,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -42988,7 +42953,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43026,7 +42990,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43064,7 +43027,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43102,7 +43064,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43140,7 +43101,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43178,7 +43138,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43216,7 +43175,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43254,7 +43212,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43292,7 +43249,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43330,7 +43286,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43368,7 +43323,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43406,7 +43360,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43444,7 +43397,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43482,7 +43434,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43520,7 +43471,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43558,7 +43508,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43598,7 +43547,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43636,7 +43584,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43676,7 +43623,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43714,7 +43660,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43752,7 +43697,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43790,7 +43734,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43828,7 +43771,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43866,7 +43808,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43904,7 +43845,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43942,7 +43882,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -43980,7 +43919,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -44018,7 +43956,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -44056,7 +43993,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -44094,7 +44030,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -44132,7 +44067,6 @@ "asan-noleaks", "asan-trace-cmp", "basicprof", - "c++-compat", "counters", "dbg", "gcov", @@ -85141,29 +85075,6 @@ ], "uses_polling": false }, - { - "args": [ - "test/core/end2end/fuzzers/api_fuzzer_corpus/clusterfuzz-testcase-5867145026076672" - ], - "ci_platforms": [ - "linux" - ], - "cpu_cost": 0.1, - "exclude_configs": [ - "tsan" - ], - "exclude_iomgrs": [ - "uv" - ], - "flaky": false, - "language": "c", - "name": "api_fuzzer_one_entry", - "platforms": [ - "mac", - "linux" - ], - "uses_polling": false - }, { "args": [ "test/core/end2end/fuzzers/api_fuzzer_corpus/clusterfuzz-testcase-5965570207907840" @@ -85187,29 +85098,6 @@ ], "uses_polling": false }, - { - "args": [ - "test/core/end2end/fuzzers/api_fuzzer_corpus/clusterfuzz-testcase-6462055064272896" - ], - "ci_platforms": [ - "linux" - ], - "cpu_cost": 0.1, - "exclude_configs": [ - "tsan" - ], - "exclude_iomgrs": [ - "uv" - ], - "flaky": false, - "language": "c", - "name": "api_fuzzer_one_entry", - "platforms": [ - "mac", - "linux" - ], - "uses_polling": false - }, { "args": [ "test/core/end2end/fuzzers/api_fuzzer_corpus/clusterfuzz-testcase-6499902139924480" @@ -150921,29 +150809,6 @@ ], "uses_polling": false }, - { - "args": [ - "test/core/end2end/fuzzers/server_fuzzer_corpus/clusterfuzz-testcase-5595941564317696" - ], - "ci_platforms": [ - "linux" - ], - "cpu_cost": 0.1, - "exclude_configs": [ - "tsan" - ], - "exclude_iomgrs": [ - "uv" - ], - "flaky": false, - "language": "c", - "name": "server_fuzzer_one_entry", - "platforms": [ - "mac", - "linux" - ], - "uses_polling": false - }, { "args": [ "test/core/end2end/fuzzers/server_fuzzer_corpus/clusterfuzz-testcase-6312731374256128" diff --git a/tools/run_tests/python_utils/filter_pull_request_tests.py b/tools/run_tests/python_utils/filter_pull_request_tests.py index 958eb569e01..e0133762959 100644 --- a/tools/run_tests/python_utils/filter_pull_request_tests.py +++ b/tools/run_tests/python_utils/filter_pull_request_tests.py @@ -127,9 +127,6 @@ _WHITELIST_DICT = { 'setup\.py$': [_PYTHON_TEST_SUITE] } -# Regex that combines all keys in _WHITELIST_DICT -_ALL_TRIGGERS = "(" + ")|(".join(_WHITELIST_DICT.keys()) + ")" - # Add all triggers to their respective test suites for trigger, test_suites in six.iteritems(_WHITELIST_DICT): for test_suite in test_suites: @@ -172,21 +169,6 @@ def _remove_irrelevant_tests(tests, skippable_labels): test.labels[2] not in skippable_labels] -def affects_c_cpp(base_branch): - """ - Determines if a pull request's changes affect C/C++. This function exists because - there are pull request tests that only test C/C++ code - :param base_branch: branch that a pull request is requesting to merge into - :return: boolean indicating whether C/C++ changes are made in pull request - """ - changed_files = _get_changed_files(base_branch) - # Run all tests if any changed file is not in the whitelist dictionary - for changed_file in changed_files: - if not re.match(_ALL_TRIGGERS, changed_file): - return True - return not _can_skip_tests(changed_files, _CPP_TEST_SUITE.triggers + _CORE_TEST_SUITE.triggers) - - def filter_tests(tests, base_branch): """ Filters out tests that are safe to ignore @@ -199,9 +181,11 @@ def filter_tests(tests, base_branch): print(' %s' % changed_file) print('') - # Run all tests if any changed file is not in the whitelist dictionary + # Regex that combines all keys in _WHITELIST_DICT + all_triggers = "(" + ")|(".join(_WHITELIST_DICT.keys()) + ")" + # Check if all tests have to be run for changed_file in changed_files: - if not re.match(_ALL_TRIGGERS, changed_file): + if not re.match(all_triggers, changed_file): return(tests) # Figure out which language and platform tests to run skippable_labels = [] @@ -212,3 +196,4 @@ def filter_tests(tests, base_branch): skippable_labels.append(label) tests = _remove_irrelevant_tests(tests, skippable_labels) return tests + diff --git a/tools/run_tests/python_utils/jobset.py b/tools/run_tests/python_utils/jobset.py index 460f359cf35..5d812f28ee9 100755 --- a/tools/run_tests/python_utils/jobset.py +++ b/tools/run_tests/python_utils/jobset.py @@ -348,7 +348,7 @@ class Jobset(object): """Manages one run of jobs.""" def __init__(self, check_cancelled, maxjobs, newline_on_success, travis, - stop_on_failure, add_env, quiet_success, max_time): + stop_on_failure, add_env, quiet_success): self._running = set() self._check_cancelled = check_cancelled self._cancelled = False @@ -360,7 +360,6 @@ class Jobset(object): self._stop_on_failure = stop_on_failure self._add_env = add_env self._quiet_success = quiet_success - self._max_time = max_time self.resultset = {} self._remaining = None self._start_time = time.time() @@ -380,12 +379,6 @@ class Jobset(object): def start(self, spec): """Start a job. Return True on success, False on failure.""" while True: - if self._max_time > 0 and time.time() - self._start_time > self._max_time: - skipped_job_result = JobResult() - skipped_job_result.state = 'SKIPPED' - message('SKIPPED', spec.shortname, do_newline=True) - self.resultset[spec.shortname] = [skipped_job_result] - return True if self.cancelled(): return False current_cpu_cost = self.cpu_cost() if current_cpu_cost == 0: break @@ -481,8 +474,7 @@ def run(cmdlines, stop_on_failure=False, add_env={}, skip_jobs=False, - quiet_success=False, - max_time=-1): + quiet_success=False): if skip_jobs: resultset = {} skipped_job_result = JobResult() @@ -494,7 +486,7 @@ def run(cmdlines, js = Jobset(check_cancelled, maxjobs if maxjobs is not None else _DEFAULT_MAX_JOBS, newline_on_success, travis, stop_on_failure, add_env, - quiet_success, max_time) + quiet_success) for cmdline, remaining in tag_remaining(cmdlines): if not js.start(cmdline): break diff --git a/tools/run_tests/python_utils/port_server.py b/tools/run_tests/python_utils/port_server.py index e96ee0b08c1..dbd32efc0e8 100755 --- a/tools/run_tests/python_utils/port_server.py +++ b/tools/run_tests/python_utils/port_server.py @@ -33,20 +33,18 @@ from __future__ import print_function import argparse -from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler +from six.moves import BaseHTTPServer import hashlib import os import socket import sys import time -from SocketServer import ThreadingMixIn -import threading # increment this number whenever making a change to ensure that # the changes are picked up by running CI servers # note that all changes must be backwards compatible -_MY_VERSION = 14 +_MY_VERSION = 9 if len(sys.argv) == 2 and sys.argv[1] == 'dump_version': @@ -70,7 +68,6 @@ print('port server running on port %d' % args.port) pool = [] in_use = {} -mu = threading.Lock() def refill_pool(max_timeout, req): @@ -98,33 +95,28 @@ def refill_pool(max_timeout, req): def allocate_port(req): global pool global in_use - global mu - mu.acquire() max_timeout = 600 while not pool: refill_pool(max_timeout, req) if not pool: req.log_message("failed to find ports: retrying soon") - mu.release() time.sleep(1) - mu.acquire() max_timeout /= 2 port = pool[0] pool = pool[1:] in_use[port] = time.time() - mu.release() return port keep_running = True -class Handler(BaseHTTPRequestHandler): +class Handler(BaseHTTPServer.BaseHTTPRequestHandler): def setup(self): # If the client is unreachable for 5 seconds, close the connection self.timeout = 5 - BaseHTTPRequestHandler.setup(self) + BaseHTTPServer.BaseHTTPRequestHandler.setup(self) def do_GET(self): global keep_running @@ -166,11 +158,12 @@ class Handler(BaseHTTPRequestHandler): elif self.path == '/quitquitquit': self.send_response(200) self.end_headers() - self.server.shutdown() + keep_running = False -class ThreadedHTTPServer(ThreadingMixIn, HTTPServer): - """Handle requests in a separate thread""" +httpd = BaseHTTPServer.HTTPServer(('', args.port), Handler) +while keep_running: + httpd.handle_request() + sys.stderr.flush() -ThreadedHTTPServer(('', args.port), Handler).serve_forever() - +print('done') diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py index 44e93eb9cc3..d2bf529fef3 100755 --- a/tools/run_tests/run_interop_tests.py +++ b/tools/run_tests/run_interop_tests.py @@ -371,39 +371,6 @@ class PHP7Language: def __str__(self): return 'php7' -class ObjcLanguage: - - def __init__(self): - self.client_cwd = 'src/objective-c/tests' - self.safename = str(self) - - def client_cmd(self, args): - # from args, extract the server port and craft xcodebuild command out of it - for arg in args: - port = re.search('--server_port=(\d+)', arg) - if port: - portnum = port.group(1) - cmdline = 'pod install && xcodebuild -workspace Tests.xcworkspace -scheme InteropTestsLocalSSL -destination name="iPhone 6" HOST_PORT_LOCALSSL=localhost:%s test'%portnum - return [cmdline] - - def cloud_to_prod_env(self): - return {} - - def global_env(self): - return {} - - def unimplemented_test_cases(self): - # ObjC test runs all cases with the same command. It ignores the testcase - # cmdline argument. Here we return all but one test cases as unimplemented, - # and depend upon ObjC test's behavior that it runs all cases even when - # we tell it to run just one. - return _TEST_CASES[1:] + _SKIP_COMPRESSION + _SKIP_DATA_FRAME_PADDING - - def unimplemented_test_cases_server(self): - return _SKIP_COMPRESSION - - def __str__(self): - return 'objc' class RubyLanguage: @@ -435,6 +402,7 @@ class RubyLanguage: def __str__(self): return 'ruby' + class PythonLanguage: def __init__(self): @@ -492,7 +460,6 @@ _LANGUAGES = { 'node' : NodeLanguage(), 'php' : PHPLanguage(), 'php7' : PHP7Language(), - 'objc' : ObjcLanguage(), 'ruby' : RubyLanguage(), 'python' : PythonLanguage(), } @@ -700,8 +667,7 @@ def cloud_to_cloud_jobspec(language, test_case, server_name, server_host, cwd = language.client_cwd environ = language.global_env() - if docker_image and language.safename != 'objc': - # we can't run client in docker for objc. + if docker_image: container_name = dockerjob.random_name('interop_client_%s' % language.safename) cmdline = docker_run_cmdline(cmdline, image=docker_image, @@ -854,7 +820,7 @@ argp.add_argument('-l', '--language', choices=['all'] + sorted(_LANGUAGES), nargs='+', default=['all'], - help='Clients to run. Objc client can be only run on OSX.') + help='Clients to run.') argp.add_argument('-j', '--jobs', default=multiprocessing.cpu_count(), type=int) argp.add_argument('--cloud_to_prod', default=False, @@ -947,13 +913,9 @@ if not args.use_docker and servers: print('Running interop servers is only supported with --use_docker option enabled.') sys.exit(1) - -# we want to include everything but objc in 'all' -# because objc won't run on non-mac platforms -all_but_objc = set(six.iterkeys(_LANGUAGES)) - set(['objc']) languages = set(_LANGUAGES[l] for l in itertools.chain.from_iterable( - all_but_objc if x == 'all' else [x] + six.iterkeys(_LANGUAGES) if x == 'all' else [x] for x in args.language)) languages_http2_clients_for_http2_server_interop = set() @@ -980,9 +942,6 @@ if args.use_docker: build_jobs = [] for l in languages_to_build: - if str(l) == 'objc': - # we don't need to build a docker image for objc - continue job = build_interop_image_jobspec(l) docker_images[str(l)] = job.tag build_jobs.append(job) diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index a1ec1b2f457..9130bc960a8 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -1210,7 +1210,6 @@ argp.add_argument('--quiet_success', 'Useful when running many iterations of each test (argument -n).') argp.add_argument('--force_default_poller', default=False, action='store_const', const=True, help='Dont try to iterate over many polling strategies when they exist') -argp.add_argument('--max_time', default=-1, type=int, help='Maximum test runtime in seconds') args = argp.parse_args() if args.force_default_poller: @@ -1466,7 +1465,7 @@ def _build_and_run( not re.search(args.regex_exclude, spec.shortname)))) # When running on travis, we want out test runs to be as similar as possible # for reproducibility purposes. - if args.travis and args.max_time <= 0: + if args.travis: massaged_one_run = sorted(one_run, key=lambda x: x.shortname) else: # whereas otherwise, we want to shuffle things up to give all tests a @@ -1494,7 +1493,7 @@ def _build_and_run( all_runs, check_cancelled, newline_on_success=newline_on_success, travis=args.travis, maxjobs=args.jobs, stop_on_failure=args.stop_on_failure, - quiet_success=args.quiet_success, max_time=args.max_time) + quiet_success=args.quiet_success) if resultset: for k, v in sorted(resultset.items()): num_runs, num_failures = _calculate_num_runs_failures(v) diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index 02f0ec5eff1..1da754d9f8c 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -377,9 +377,6 @@ if __name__ == "__main__": argp.add_argument('-n', '--runs_per_test', default=1, type=_runs_per_test_type, help='How many times to run each tests. >1 runs implies ' + 'omitting passing test from the output & reports.') - argp.add_argument('--max_time', default=-1, type=int, - help='Maximum amount of time to run tests for' + - '(other tests will be skipped)') args = argp.parse_args() extra_args = [] @@ -391,8 +388,6 @@ if __name__ == "__main__": extra_args.append('-n') extra_args.append('%s' % args.runs_per_test) extra_args.append('--quiet_success') - if args.max_time > 0: - extra_args.extend(('--max_time', '%d' % args.max_time)) all_jobs = _create_test_jobs(extra_args=extra_args, inner_jobs=args.inner_jobs) + \ _create_portability_test_jobs(extra_args=extra_args, inner_jobs=args.inner_jobs) diff --git a/tools/run_tests/sanity/check_submodules.sh b/tools/run_tests/sanity/check_submodules.sh index 0a9c1cc046c..c5a0dbbef32 100755 --- a/tools/run_tests/sanity/check_submodules.sh +++ b/tools/run_tests/sanity/check_submodules.sh @@ -48,7 +48,7 @@ cat << EOF | awk '{ print $1 }' | sort > $want_submodules ec44c6c1675c25b9827aacd08c02433cccde7780 third_party/googletest (release-1.8.0) 593e917c176b5bc5aafa57bf9f6030d749d91cd5 third_party/protobuf (v3.1.0-alpha-1-326-g593e917) bcad91771b7f0bff28a1cac1981d7ef2b9bcef3c third_party/thrift (bcad917) - cacf7f1d4e3d44d871b605da3b647f07d718623f third_party/zlib (v1.2.11) + 50893291621658f355bc5b4d450a8d06a563053d third_party/zlib (v1.2.8) 7691f773af79bf75a62d1863fd0f13ebf9dc51b1 third_party/cares/cares (1.12.0) EOF diff --git a/vsprojects/README.md b/vsprojects/README.md index 1f0cdc24ba7..f1663d25485 100644 --- a/vsprojects/README.md +++ b/vsprojects/README.md @@ -1,10 +1,10 @@ -# Pre-generated MS Visual Studio project & solution files +#Pre-generated MS Visual Studio project & solution files Versions 2013 and 2015 are both supported. You can use [their respective community editions](https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx). -# Building +#Building We are using [NuGet](http://www.nuget.org) to pull zlib and openssl dependencies. If you don't have Visual Studio NuGet plugin installed, you'll need to download nuget.exe from the web and manually restore the NuGet packages. @@ -19,7 +19,7 @@ After that, you can build the solution using one of these options: 1. open `grpc.sln` with Visual Studio and hit "Build". 2. build from commandline using `msbuild grpc.sln /p:Configuration=Debug` -# C/C++ Test Dependencies +#C/C++ Test Dependencies * gtest isn't available as a git repo like the other dependencies. download it and add it to `/third_party/gtest/` (the folder will end up with `/build-aux/`, `/cmake/`, `/codegear/`, etc. folders in it). * if using vs2013: open/import the gtest solution in `/msvc/`, and save over the first solution (you will have to change it from read-only). change all projects to use `/MDd` (Property Pages - C/C++ - Code Generation - Runtime Library) and build. This is a "multithreaded debug" setting and it needs to match grpc. * build all diff --git a/vsprojects/buildtests_c.sln b/vsprojects/buildtests_c.sln index 539f474f9ec..c8fcacf75b1 100644 --- a/vsprojects/buildtests_c.sln +++ b/vsprojects/buildtests_c.sln @@ -317,17 +317,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "error_test", "vcxproj\test\ {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fake_resolver_test", "vcxproj\test\fake_resolver_test\fake_resolver_test.vcxproj", "{2F59EB2E-CEF9-A291-9480-1F737C3E5E57}" - ProjectSection(myProperties) = preProject - lib = "False" - EndProjectSection - ProjectSection(ProjectDependencies) = postProject - {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} = {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} - {29D16885-7228-4C31-81ED-5F9187C7F2A9} = {29D16885-7228-4C31-81ED-5F9187C7F2A9} - {EAB0A629-17A9-44DB-B5FF-E91A721FE037} = {EAB0A629-17A9-44DB-B5FF-E91A721FE037} - {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fling_client", "vcxproj\test\fling_client\fling_client.vcxproj", "{0647D598-9611-F659-EA36-DF995C9F736B}" ProjectSection(myProperties) = preProject lib = "False" @@ -1253,17 +1242,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "message_compress_test", "vc {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "minimal_stack_is_minimal_test", "vcxproj\test\minimal_stack_is_minimal_test\minimal_stack_is_minimal_test.vcxproj", "{68A54124-DFA3-4FF3-081F-70356222C977}" - ProjectSection(myProperties) = preProject - lib = "False" - EndProjectSection - ProjectSection(ProjectDependencies) = postProject - {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} = {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} - {29D16885-7228-4C31-81ED-5F9187C7F2A9} = {29D16885-7228-4C31-81ED-5F9187C7F2A9} - {EAB0A629-17A9-44DB-B5FF-E91A721FE037} = {EAB0A629-17A9-44DB-B5FF-E91A721FE037} - {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mlog_test", "vcxproj\test\mlog_test\mlog_test.vcxproj", "{9345E329-80F3-DED4-FDC3-BF63FCEA2C03}" ProjectSection(myProperties) = preProject lib = "False" @@ -1440,17 +1418,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "slice_buffer_test", "vcxpro {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "slice_hash_table_test", "vcxproj\test\slice_hash_table_test\slice_hash_table_test.vcxproj", "{B3BC3481-FCD3-BA52-C975-E65CDB1CE9A9}" - ProjectSection(myProperties) = preProject - lib = "False" - EndProjectSection - ProjectSection(ProjectDependencies) = postProject - {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} = {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} - {29D16885-7228-4C31-81ED-5F9187C7F2A9} = {29D16885-7228-4C31-81ED-5F9187C7F2A9} - {EAB0A629-17A9-44DB-B5FF-E91A721FE037} = {EAB0A629-17A9-44DB-B5FF-E91A721FE037} - {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "slice_string_helpers_test", "vcxproj\test\slice_string_helpers_test\slice_string_helpers_test.vcxproj", "{419167BB-C3F5-DDEA-403A-394D1902DE65}" ProjectSection(myProperties) = preProject lib = "False" @@ -2138,22 +2105,6 @@ Global {42720233-A6D4-66BC-CCA2-06B57261D0B3}.Release-DLL|Win32.Build.0 = Release|Win32 {42720233-A6D4-66BC-CCA2-06B57261D0B3}.Release-DLL|x64.ActiveCfg = Release|x64 {42720233-A6D4-66BC-CCA2-06B57261D0B3}.Release-DLL|x64.Build.0 = Release|x64 - {2F59EB2E-CEF9-A291-9480-1F737C3E5E57}.Debug|Win32.ActiveCfg = Debug|Win32 - {2F59EB2E-CEF9-A291-9480-1F737C3E5E57}.Debug|x64.ActiveCfg = Debug|x64 - {2F59EB2E-CEF9-A291-9480-1F737C3E5E57}.Release|Win32.ActiveCfg = Release|Win32 - {2F59EB2E-CEF9-A291-9480-1F737C3E5E57}.Release|x64.ActiveCfg = Release|x64 - {2F59EB2E-CEF9-A291-9480-1F737C3E5E57}.Debug|Win32.Build.0 = Debug|Win32 - {2F59EB2E-CEF9-A291-9480-1F737C3E5E57}.Debug|x64.Build.0 = Debug|x64 - {2F59EB2E-CEF9-A291-9480-1F737C3E5E57}.Release|Win32.Build.0 = Release|Win32 - {2F59EB2E-CEF9-A291-9480-1F737C3E5E57}.Release|x64.Build.0 = Release|x64 - {2F59EB2E-CEF9-A291-9480-1F737C3E5E57}.Debug-DLL|Win32.ActiveCfg = Debug|Win32 - {2F59EB2E-CEF9-A291-9480-1F737C3E5E57}.Debug-DLL|Win32.Build.0 = Debug|Win32 - {2F59EB2E-CEF9-A291-9480-1F737C3E5E57}.Debug-DLL|x64.ActiveCfg = Debug|x64 - {2F59EB2E-CEF9-A291-9480-1F737C3E5E57}.Debug-DLL|x64.Build.0 = Debug|x64 - {2F59EB2E-CEF9-A291-9480-1F737C3E5E57}.Release-DLL|Win32.ActiveCfg = Release|Win32 - {2F59EB2E-CEF9-A291-9480-1F737C3E5E57}.Release-DLL|Win32.Build.0 = Release|Win32 - {2F59EB2E-CEF9-A291-9480-1F737C3E5E57}.Release-DLL|x64.ActiveCfg = Release|x64 - {2F59EB2E-CEF9-A291-9480-1F737C3E5E57}.Release-DLL|x64.Build.0 = Release|x64 {0647D598-9611-F659-EA36-DF995C9F736B}.Debug|Win32.ActiveCfg = Debug|Win32 {0647D598-9611-F659-EA36-DF995C9F736B}.Debug|x64.ActiveCfg = Debug|x64 {0647D598-9611-F659-EA36-DF995C9F736B}.Release|Win32.ActiveCfg = Release|Win32 @@ -3562,22 +3513,6 @@ Global {07170557-CCB0-D23C-8018-C2909D115DF9}.Release-DLL|Win32.Build.0 = Release|Win32 {07170557-CCB0-D23C-8018-C2909D115DF9}.Release-DLL|x64.ActiveCfg = Release|x64 {07170557-CCB0-D23C-8018-C2909D115DF9}.Release-DLL|x64.Build.0 = Release|x64 - {68A54124-DFA3-4FF3-081F-70356222C977}.Debug|Win32.ActiveCfg = Debug|Win32 - {68A54124-DFA3-4FF3-081F-70356222C977}.Debug|x64.ActiveCfg = Debug|x64 - {68A54124-DFA3-4FF3-081F-70356222C977}.Release|Win32.ActiveCfg = Release|Win32 - {68A54124-DFA3-4FF3-081F-70356222C977}.Release|x64.ActiveCfg = Release|x64 - {68A54124-DFA3-4FF3-081F-70356222C977}.Debug|Win32.Build.0 = Debug|Win32 - {68A54124-DFA3-4FF3-081F-70356222C977}.Debug|x64.Build.0 = Debug|x64 - {68A54124-DFA3-4FF3-081F-70356222C977}.Release|Win32.Build.0 = Release|Win32 - {68A54124-DFA3-4FF3-081F-70356222C977}.Release|x64.Build.0 = Release|x64 - {68A54124-DFA3-4FF3-081F-70356222C977}.Debug-DLL|Win32.ActiveCfg = Debug|Win32 - {68A54124-DFA3-4FF3-081F-70356222C977}.Debug-DLL|Win32.Build.0 = Debug|Win32 - {68A54124-DFA3-4FF3-081F-70356222C977}.Debug-DLL|x64.ActiveCfg = Debug|x64 - {68A54124-DFA3-4FF3-081F-70356222C977}.Debug-DLL|x64.Build.0 = Debug|x64 - {68A54124-DFA3-4FF3-081F-70356222C977}.Release-DLL|Win32.ActiveCfg = Release|Win32 - {68A54124-DFA3-4FF3-081F-70356222C977}.Release-DLL|Win32.Build.0 = Release|Win32 - {68A54124-DFA3-4FF3-081F-70356222C977}.Release-DLL|x64.ActiveCfg = Release|x64 - {68A54124-DFA3-4FF3-081F-70356222C977}.Release-DLL|x64.Build.0 = Release|x64 {9345E329-80F3-DED4-FDC3-BF63FCEA2C03}.Debug|Win32.ActiveCfg = Debug|Win32 {9345E329-80F3-DED4-FDC3-BF63FCEA2C03}.Debug|x64.ActiveCfg = Debug|x64 {9345E329-80F3-DED4-FDC3-BF63FCEA2C03}.Release|Win32.ActiveCfg = Release|Win32 @@ -3834,22 +3769,6 @@ Global {F0FA4A41-5695-580A-DCDA-EC719CB041B0}.Release-DLL|Win32.Build.0 = Release|Win32 {F0FA4A41-5695-580A-DCDA-EC719CB041B0}.Release-DLL|x64.ActiveCfg = Release|x64 {F0FA4A41-5695-580A-DCDA-EC719CB041B0}.Release-DLL|x64.Build.0 = Release|x64 - {B3BC3481-FCD3-BA52-C975-E65CDB1CE9A9}.Debug|Win32.ActiveCfg = Debug|Win32 - {B3BC3481-FCD3-BA52-C975-E65CDB1CE9A9}.Debug|x64.ActiveCfg = Debug|x64 - {B3BC3481-FCD3-BA52-C975-E65CDB1CE9A9}.Release|Win32.ActiveCfg = Release|Win32 - {B3BC3481-FCD3-BA52-C975-E65CDB1CE9A9}.Release|x64.ActiveCfg = Release|x64 - {B3BC3481-FCD3-BA52-C975-E65CDB1CE9A9}.Debug|Win32.Build.0 = Debug|Win32 - {B3BC3481-FCD3-BA52-C975-E65CDB1CE9A9}.Debug|x64.Build.0 = Debug|x64 - {B3BC3481-FCD3-BA52-C975-E65CDB1CE9A9}.Release|Win32.Build.0 = Release|Win32 - {B3BC3481-FCD3-BA52-C975-E65CDB1CE9A9}.Release|x64.Build.0 = Release|x64 - {B3BC3481-FCD3-BA52-C975-E65CDB1CE9A9}.Debug-DLL|Win32.ActiveCfg = Debug|Win32 - {B3BC3481-FCD3-BA52-C975-E65CDB1CE9A9}.Debug-DLL|Win32.Build.0 = Debug|Win32 - {B3BC3481-FCD3-BA52-C975-E65CDB1CE9A9}.Debug-DLL|x64.ActiveCfg = Debug|x64 - {B3BC3481-FCD3-BA52-C975-E65CDB1CE9A9}.Debug-DLL|x64.Build.0 = Debug|x64 - {B3BC3481-FCD3-BA52-C975-E65CDB1CE9A9}.Release-DLL|Win32.ActiveCfg = Release|Win32 - {B3BC3481-FCD3-BA52-C975-E65CDB1CE9A9}.Release-DLL|Win32.Build.0 = Release|Win32 - {B3BC3481-FCD3-BA52-C975-E65CDB1CE9A9}.Release-DLL|x64.ActiveCfg = Release|x64 - {B3BC3481-FCD3-BA52-C975-E65CDB1CE9A9}.Release-DLL|x64.Build.0 = Release|x64 {419167BB-C3F5-DDEA-403A-394D1902DE65}.Debug|Win32.ActiveCfg = Debug|Win32 {419167BB-C3F5-DDEA-403A-394D1902DE65}.Debug|x64.ActiveCfg = Debug|x64 {419167BB-C3F5-DDEA-403A-394D1902DE65}.Release|Win32.ActiveCfg = Release|Win32 diff --git a/vsprojects/vcxproj/grpc++/grpc++.vcxproj b/vsprojects/vcxproj/grpc++/grpc++.vcxproj index 424af0d9e72..cae44c5e234 100644 --- a/vsprojects/vcxproj/grpc++/grpc++.vcxproj +++ b/vsprojects/vcxproj/grpc++/grpc++.vcxproj @@ -328,6 +328,7 @@ + @@ -379,11 +380,16 @@ + + + + + @@ -576,14 +582,24 @@ + + + + + + + + + + diff --git a/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters b/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters index a2f74655d0f..36da089470b 100644 --- a/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters +++ b/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters @@ -133,9 +133,15 @@ src\core\lib\channel + + src\core\lib\channel + src\core\lib\channel + + src\core\lib\channel + src\core\lib\channel @@ -145,6 +151,15 @@ src\core\lib\channel + + src\core\lib\channel + + + src\core\lib\channel + + + src\core\lib\channel + src\core\lib\compression @@ -708,6 +723,9 @@ include\grpc++\impl\codegen + + include\grpc++\impl\codegen + include\grpc++\impl\codegen @@ -857,12 +875,18 @@ src\core\lib\channel + + src\core\lib\channel + src\core\lib\channel src\core\lib\channel + + src\core\lib\channel + src\core\lib\channel @@ -872,6 +896,15 @@ src\core\lib\channel + + src\core\lib\channel + + + src\core\lib\channel + + + src\core\lib\channel + src\core\lib\compression diff --git a/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj b/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj index 165ebe64f59..c060f98b34a 100644 --- a/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj +++ b/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj @@ -172,6 +172,7 @@ + diff --git a/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj.filters b/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj.filters index d9aa1e3cc92..0623e421b21 100644 --- a/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj.filters +++ b/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj.filters @@ -111,6 +111,9 @@ include\grpc++\impl\codegen + + include\grpc++\impl\codegen + include\grpc++\impl\codegen diff --git a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj index 3f8a2f27572..4d284006e67 100644 --- a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj @@ -328,6 +328,7 @@ + @@ -373,11 +374,16 @@ + + + + + @@ -560,14 +566,24 @@ + + + + + + + + + + diff --git a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters index 929501a56ce..9d641553a2b 100644 --- a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters @@ -118,9 +118,15 @@ src\core\lib\channel + + src\core\lib\channel + src\core\lib\channel + + src\core\lib\channel + src\core\lib\channel @@ -130,6 +136,15 @@ src\core\lib\channel + + src\core\lib\channel + + + src\core\lib\channel + + + src\core\lib\channel + src\core\lib\compression @@ -693,6 +708,9 @@ include\grpc++\impl\codegen + + include\grpc++\impl\codegen + include\grpc++\impl\codegen @@ -824,12 +842,18 @@ src\core\lib\channel + + src\core\lib\channel + src\core\lib\channel src\core\lib\channel + + src\core\lib\channel + src\core\lib\channel @@ -839,6 +863,15 @@ src\core\lib\channel + + src\core\lib\channel + + + src\core\lib\channel + + + src\core\lib\channel + src\core\lib\compression diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj b/vsprojects/vcxproj/grpc/grpc.vcxproj index ca70dde7934..a956a4f2be3 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj @@ -303,11 +303,16 @@ + + + + + @@ -426,9 +431,6 @@ - - - @@ -472,7 +474,6 @@ - @@ -503,7 +504,6 @@ - @@ -514,14 +514,24 @@ + + + + + + + + + + @@ -794,14 +804,6 @@ - - - - - - - - @@ -900,8 +902,6 @@ - - @@ -974,8 +974,6 @@ - - diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters index acadc0ad885..2ccac30d7ad 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters @@ -13,9 +13,15 @@ src\core\lib\channel + + src\core\lib\channel + src\core\lib\channel + + src\core\lib\channel + src\core\lib\channel @@ -25,6 +31,15 @@ src\core\lib\channel + + src\core\lib\channel + + + src\core\lib\channel + + + src\core\lib\channel + src\core\lib\compression @@ -433,18 +448,6 @@ src\core\ext\transport\chttp2\alpn - - src\core\ext\filters\http\client - - - src\core\ext\filters\http - - - src\core\ext\filters\http\message_compress - - - src\core\ext\filters\http\server - src\core\lib\http @@ -592,9 +595,6 @@ src\core\ext\filters\client_channel - - src\core\ext\filters\deadline - src\core\ext\transport\chttp2\client @@ -703,9 +703,6 @@ src\core\ext\filters\max_age - - src\core\ext\filters\message_size - src\core\plugin_registry @@ -815,12 +812,18 @@ src\core\lib\channel + + src\core\lib\channel + src\core\lib\channel src\core\lib\channel + + src\core\lib\channel + src\core\lib\channel @@ -830,6 +833,15 @@ src\core\lib\channel + + src\core\lib\channel + + + src\core\lib\channel + + + src\core\lib\channel + src\core\lib\compression @@ -1184,15 +1196,6 @@ src\core\ext\transport\chttp2\alpn - - src\core\ext\filters\http\client - - - src\core\ext\filters\http\message_compress - - - src\core\ext\filters\http\server - src\core\lib\security\context @@ -1322,9 +1325,6 @@ src\core\ext\filters\client_channel - - src\core\ext\filters\deadline - src\core\ext\transport\chttp2\client @@ -1415,9 +1415,6 @@ src\core\ext\filters\max_age - - src\core\ext\filters\message_size - @@ -1493,30 +1490,12 @@ {bd317dd5-323e-5b27-4c05-d85786be36ab} - - {c8dcda4e-dbaa-1ae8-67a9-0dd26046f652} - - - {2e3ab9f3-39ca-db39-cb3e-2196cbc68098} - - - {e4f7616b-2b49-7df9-8ca3-eb7848d4609d} - - - {7b595f5a-c5b5-29fe-74c2-5ec5fd5c94d2} - - - {a40e82ca-0c04-35b8-898d-7ad5f323d110} - {12559ba7-9445-92ae-0c5a-2d79570d4c9b} {5369e83c-4625-fc14-cc40-9db5da3a7af4} - - {5ca3f38c-539f-3c4f-b68c-38b31ba339ba} - {e3abfd0a-064e-0f2f-c8e8-7c5a7e98142a} diff --git a/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj b/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj index a5ec4ae1717..b1db7e5d15d 100644 --- a/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj +++ b/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj @@ -198,11 +198,16 @@ + + + + + @@ -349,14 +354,24 @@ + + + + + + + + + + diff --git a/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj.filters b/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj.filters index 4078ebd5d7c..a7ecbea87c7 100644 --- a/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj.filters +++ b/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj.filters @@ -70,9 +70,15 @@ src\core\lib\channel + + src\core\lib\channel + src\core\lib\channel + + src\core\lib\channel + src\core\lib\channel @@ -82,6 +88,15 @@ src\core\lib\channel + + src\core\lib\channel + + + src\core\lib\channel + + + src\core\lib\channel + src\core\lib\compression @@ -572,12 +587,18 @@ src\core\lib\channel + + src\core\lib\channel + src\core\lib\channel src\core\lib\channel + + src\core\lib\channel + src\core\lib\channel @@ -587,6 +608,15 @@ src\core\lib\channel + + src\core\lib\channel + + + src\core\lib\channel + + + src\core\lib\channel + src\core\lib\compression diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj index c844e157e44..e3e62da213e 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj @@ -293,11 +293,16 @@ + + + + + @@ -416,9 +421,6 @@ - - - @@ -439,7 +441,6 @@ - @@ -469,7 +470,6 @@ - @@ -482,14 +482,24 @@ + + + + + + + + + + @@ -764,14 +774,6 @@ - - - - - - - - @@ -820,8 +822,6 @@ - - @@ -884,8 +884,6 @@ - - diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters index 43d27b44a20..e79d212f9c4 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters @@ -16,9 +16,15 @@ src\core\lib\channel + + src\core\lib\channel + src\core\lib\channel + + src\core\lib\channel + src\core\lib\channel @@ -28,6 +34,15 @@ src\core\lib\channel + + src\core\lib\channel + + + src\core\lib\channel + + + src\core\lib\channel + src\core\lib\compression @@ -439,18 +454,6 @@ src\core\ext\transport\chttp2\alpn - - src\core\ext\filters\http\client - - - src\core\ext\filters\http - - - src\core\ext\filters\http\message_compress - - - src\core\ext\filters\http\server - src\core\ext\transport\chttp2\server @@ -523,9 +526,6 @@ src\core\ext\filters\client_channel - - src\core\ext\filters\deadline - src\core\ext\filters\client_channel\resolver\dns\c_ares @@ -619,9 +619,6 @@ src\core\ext\filters\max_age - - src\core\ext\filters\message_size - src\core\plugin_registry @@ -728,12 +725,18 @@ src\core\lib\channel + + src\core\lib\channel + src\core\lib\channel src\core\lib\channel + + src\core\lib\channel + src\core\lib\channel @@ -743,6 +746,15 @@ src\core\lib\channel + + src\core\lib\channel + + + src\core\lib\channel + + + src\core\lib\channel + src\core\lib\compression @@ -1097,15 +1109,6 @@ src\core\ext\transport\chttp2\alpn - - src\core\ext\filters\http\client - - - src\core\ext\filters\http\message_compress - - - src\core\ext\filters\http\server - src\core\ext\transport\chttp2\server @@ -1166,9 +1169,6 @@ src\core\ext\filters\client_channel - - src\core\ext\filters\deadline - src\core\ext\filters\client_channel\resolver\dns\c_ares @@ -1256,9 +1256,6 @@ src\core\ext\filters\max_age - - src\core\ext\filters\message_size - @@ -1334,30 +1331,12 @@ {99210f5e-b2a0-ecd1-024f-fc152db68a11} - - {ac374be1-7a3f-14a8-69fe-badac2d9f9ec} - - - {33287f7d-739b-d30d-a9f3-b338103456b0} - - - {95cd5972-7339-6f09-2332-e6769b3cba3f} - - - {cf8cb886-3020-e143-317e-730ff9bbddc3} - - - {2c1e7897-6f69-f8b9-0b90-5c3fae59a48f} - {0aef07b4-39d2-f862-15ac-65b4bf00dabb} {d3bc80c1-5f2d-e842-42ac-43d8a6ada8de} - - {8cbe7444-caac-49dc-be89-d4c4d1c7966a} - {967c89fe-c97c-27e2-aac0-9ba5854cb5fa} diff --git a/vsprojects/vcxproj/test/codegen_test_full/codegen_test_full.vcxproj b/vsprojects/vcxproj/test/codegen_test_full/codegen_test_full.vcxproj index ccb0b521eff..e3f081ba2ab 100644 --- a/vsprojects/vcxproj/test/codegen_test_full/codegen_test_full.vcxproj +++ b/vsprojects/vcxproj/test/codegen_test_full/codegen_test_full.vcxproj @@ -185,6 +185,7 @@ + diff --git a/vsprojects/vcxproj/test/codegen_test_full/codegen_test_full.vcxproj.filters b/vsprojects/vcxproj/test/codegen_test_full/codegen_test_full.vcxproj.filters index 18b331ccb1e..09e7c70e74a 100644 --- a/vsprojects/vcxproj/test/codegen_test_full/codegen_test_full.vcxproj.filters +++ b/vsprojects/vcxproj/test/codegen_test_full/codegen_test_full.vcxproj.filters @@ -96,6 +96,9 @@ include\grpc++\impl\codegen + + include\grpc++\impl\codegen + include\grpc++\impl\codegen diff --git a/vsprojects/vcxproj/test/codegen_test_minimal/codegen_test_minimal.vcxproj b/vsprojects/vcxproj/test/codegen_test_minimal/codegen_test_minimal.vcxproj index d4ac0fbc975..2cd226c6d80 100644 --- a/vsprojects/vcxproj/test/codegen_test_minimal/codegen_test_minimal.vcxproj +++ b/vsprojects/vcxproj/test/codegen_test_minimal/codegen_test_minimal.vcxproj @@ -185,6 +185,7 @@ + @@ -255,14 +256,6 @@ - - - {29D16885-7228-4C31-81ED-5F9187C7F2A9} - - - {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} - - diff --git a/vsprojects/vcxproj/test/codegen_test_minimal/codegen_test_minimal.vcxproj.filters b/vsprojects/vcxproj/test/codegen_test_minimal/codegen_test_minimal.vcxproj.filters index 31680cdc413..66afc8f2fc1 100644 --- a/vsprojects/vcxproj/test/codegen_test_minimal/codegen_test_minimal.vcxproj.filters +++ b/vsprojects/vcxproj/test/codegen_test_minimal/codegen_test_minimal.vcxproj.filters @@ -99,6 +99,9 @@ include\grpc++\impl\codegen + + include\grpc++\impl\codegen + include\grpc++\impl\codegen diff --git a/vsprojects/vcxproj/test/fake_resolver_test/fake_resolver_test.vcxproj b/vsprojects/vcxproj/test/fake_resolver_test/fake_resolver_test.vcxproj deleted file mode 100644 index 8ea721dd7b4..00000000000 --- a/vsprojects/vcxproj/test/fake_resolver_test/fake_resolver_test.vcxproj +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {2F59EB2E-CEF9-A291-9480-1F737C3E5E57} - true - $(SolutionDir)IntDir\$(MSBuildProjectName)\ - - - - v100 - - - v110 - - - v120 - - - v140 - - - Application - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - fake_resolver_test - static - Debug - static - Debug - - - fake_resolver_test - static - Release - static - Release - - - - NotUsing - Level3 - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - true - MultiThreadedDebug - true - None - false - - - Console - true - false - - - - - - NotUsing - Level3 - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - true - MultiThreadedDebug - true - None - false - - - Console - true - false - - - - - - NotUsing - Level3 - MaxSpeed - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - true - true - MultiThreaded - true - None - false - - - Console - true - false - true - true - - - - - - NotUsing - Level3 - MaxSpeed - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - true - true - MultiThreaded - true - None - false - - - Console - true - false - true - true - - - - - - - - - - {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} - - - {29D16885-7228-4C31-81ED-5F9187C7F2A9} - - - {EAB0A629-17A9-44DB-B5FF-E91A721FE037} - - - {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} - - - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - diff --git a/vsprojects/vcxproj/test/fake_resolver_test/fake_resolver_test.vcxproj.filters b/vsprojects/vcxproj/test/fake_resolver_test/fake_resolver_test.vcxproj.filters deleted file mode 100644 index 353cae2b078..00000000000 --- a/vsprojects/vcxproj/test/fake_resolver_test/fake_resolver_test.vcxproj.filters +++ /dev/null @@ -1,24 +0,0 @@ - - - - - test\core\client_channel\resolvers - - - - - - {05f58640-4b7c-c233-bf86-f119fe270ba1} - - - {caeef88d-baf6-603c-83b0-84b1009be480} - - - {c5bba556-fd85-f7b4-99b7-8b1eeb4dfcb2} - - - {eff74a86-6a4c-b68c-0330-6901d992c5c7} - - - - diff --git a/vsprojects/vcxproj/test/grpc_tool_test/grpc_tool_test.vcxproj b/vsprojects/vcxproj/test/grpc_tool_test/grpc_tool_test.vcxproj index 6133d7e2901..d83a496e3b8 100644 --- a/vsprojects/vcxproj/test/grpc_tool_test/grpc_tool_test.vcxproj +++ b/vsprojects/vcxproj/test/grpc_tool_test/grpc_tool_test.vcxproj @@ -186,6 +186,7 @@ + diff --git a/vsprojects/vcxproj/test/grpc_tool_test/grpc_tool_test.vcxproj.filters b/vsprojects/vcxproj/test/grpc_tool_test/grpc_tool_test.vcxproj.filters index 08ea8e9dae4..64e3caf7406 100644 --- a/vsprojects/vcxproj/test/grpc_tool_test/grpc_tool_test.vcxproj.filters +++ b/vsprojects/vcxproj/test/grpc_tool_test/grpc_tool_test.vcxproj.filters @@ -90,6 +90,9 @@ include\grpc++\impl\codegen + + include\grpc++\impl\codegen + include\grpc++\impl\codegen diff --git a/vsprojects/vcxproj/test/minimal_stack_is_minimal_test/minimal_stack_is_minimal_test.vcxproj b/vsprojects/vcxproj/test/minimal_stack_is_minimal_test/minimal_stack_is_minimal_test.vcxproj deleted file mode 100644 index 0473fa95457..00000000000 --- a/vsprojects/vcxproj/test/minimal_stack_is_minimal_test/minimal_stack_is_minimal_test.vcxproj +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {68A54124-DFA3-4FF3-081F-70356222C977} - true - $(SolutionDir)IntDir\$(MSBuildProjectName)\ - - - - v100 - - - v110 - - - v120 - - - v140 - - - Application - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - minimal_stack_is_minimal_test - static - Debug - static - Debug - - - minimal_stack_is_minimal_test - static - Release - static - Release - - - - NotUsing - Level3 - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - true - MultiThreadedDebug - true - None - false - - - Console - true - false - - - - - - NotUsing - Level3 - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - true - MultiThreadedDebug - true - None - false - - - Console - true - false - - - - - - NotUsing - Level3 - MaxSpeed - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - true - true - MultiThreaded - true - None - false - - - Console - true - false - true - true - - - - - - NotUsing - Level3 - MaxSpeed - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - true - true - MultiThreaded - true - None - false - - - Console - true - false - true - true - - - - - - - - - - {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} - - - {29D16885-7228-4C31-81ED-5F9187C7F2A9} - - - {EAB0A629-17A9-44DB-B5FF-E91A721FE037} - - - {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} - - - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - diff --git a/vsprojects/vcxproj/test/minimal_stack_is_minimal_test/minimal_stack_is_minimal_test.vcxproj.filters b/vsprojects/vcxproj/test/minimal_stack_is_minimal_test/minimal_stack_is_minimal_test.vcxproj.filters deleted file mode 100644 index 7eb2ba551f5..00000000000 --- a/vsprojects/vcxproj/test/minimal_stack_is_minimal_test/minimal_stack_is_minimal_test.vcxproj.filters +++ /dev/null @@ -1,21 +0,0 @@ - - - - - test\core\channel - - - - - - {52e0de0c-9f7d-1497-1339-b0ed30ed41f8} - - - {2cd01454-1131-89cc-68a2-10365fa32bb0} - - - {f473b99d-5602-d2df-2d85-99648d00ba4f} - - - - diff --git a/vsprojects/vcxproj/test/mock_test/mock_test.vcxproj b/vsprojects/vcxproj/test/mock_test/mock_test.vcxproj index bc1cae59117..8c840fd5be9 100644 --- a/vsprojects/vcxproj/test/mock_test/mock_test.vcxproj +++ b/vsprojects/vcxproj/test/mock_test/mock_test.vcxproj @@ -159,9 +159,6 @@ - - - diff --git a/vsprojects/vcxproj/test/mock_test/mock_test.vcxproj.filters b/vsprojects/vcxproj/test/mock_test/mock_test.vcxproj.filters index 6db61c9037b..1b3b773b08f 100644 --- a/vsprojects/vcxproj/test/mock_test/mock_test.vcxproj.filters +++ b/vsprojects/vcxproj/test/mock_test/mock_test.vcxproj.filters @@ -5,22 +5,8 @@ test\cpp\end2end - - - include\grpc++\test - - - - {b827d6d2-cfa5-2dd4-6ebc-afcccd5e8e0c} - - - {28289e8f-b68e-b9f5-7680-c15d77b574a5} - - - {4a7b43be-c730-6221-d190-e394521f9ae7} - {69c257a2-3e4c-a86e-ce0d-1a97b237d294} diff --git a/vsprojects/vcxproj/test/proto_utils_test/proto_utils_test.vcxproj b/vsprojects/vcxproj/test/proto_utils_test/proto_utils_test.vcxproj index 397e7b6901f..13a5bb49100 100644 --- a/vsprojects/vcxproj/test/proto_utils_test/proto_utils_test.vcxproj +++ b/vsprojects/vcxproj/test/proto_utils_test/proto_utils_test.vcxproj @@ -185,6 +185,7 @@ + diff --git a/vsprojects/vcxproj/test/proto_utils_test/proto_utils_test.vcxproj.filters b/vsprojects/vcxproj/test/proto_utils_test/proto_utils_test.vcxproj.filters index 2f5a2a065f3..189a3367141 100644 --- a/vsprojects/vcxproj/test/proto_utils_test/proto_utils_test.vcxproj.filters +++ b/vsprojects/vcxproj/test/proto_utils_test/proto_utils_test.vcxproj.filters @@ -81,6 +81,9 @@ include\grpc++\impl\codegen + + include\grpc++\impl\codegen + include\grpc++\impl\codegen diff --git a/vsprojects/vcxproj/test/slice_hash_table_test/slice_hash_table_test.vcxproj b/vsprojects/vcxproj/test/slice_hash_table_test/slice_hash_table_test.vcxproj deleted file mode 100644 index 0fccfdcaa56..00000000000 --- a/vsprojects/vcxproj/test/slice_hash_table_test/slice_hash_table_test.vcxproj +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {B3BC3481-FCD3-BA52-C975-E65CDB1CE9A9} - true - $(SolutionDir)IntDir\$(MSBuildProjectName)\ - - - - v100 - - - v110 - - - v120 - - - v140 - - - Application - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - slice_hash_table_test - static - Debug - static - Debug - - - slice_hash_table_test - static - Release - static - Release - - - - NotUsing - Level3 - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - true - MultiThreadedDebug - true - None - false - - - Console - true - false - - - - - - NotUsing - Level3 - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - true - MultiThreadedDebug - true - None - false - - - Console - true - false - - - - - - NotUsing - Level3 - MaxSpeed - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - true - true - MultiThreaded - true - None - false - - - Console - true - false - true - true - - - - - - NotUsing - Level3 - MaxSpeed - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - true - true - MultiThreaded - true - None - false - - - Console - true - false - true - true - - - - - - - - - - {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} - - - {29D16885-7228-4C31-81ED-5F9187C7F2A9} - - - {EAB0A629-17A9-44DB-B5FF-E91A721FE037} - - - {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} - - - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - diff --git a/vsprojects/vcxproj/test/slice_hash_table_test/slice_hash_table_test.vcxproj.filters b/vsprojects/vcxproj/test/slice_hash_table_test/slice_hash_table_test.vcxproj.filters deleted file mode 100644 index 19738526781..00000000000 --- a/vsprojects/vcxproj/test/slice_hash_table_test/slice_hash_table_test.vcxproj.filters +++ /dev/null @@ -1,21 +0,0 @@ - - - - - test\core\slice - - - - - - {e11f5007-84da-0229-9118-2a2bb17f956c} - - - {a11f4770-5e13-eb1a-a848-8667dde98812} - - - {fb1262a8-0a70-bc85-579a-6ebfffbf25b5} - - - -