aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.clang-tidy6
-rw-r--r--.pylintrc11
-rw-r--r--.pylintrc-tests11
-rw-r--r--BUILD130
-rw-r--r--BUILDING.md (renamed from INSTALL.md)110
-rw-r--r--CMakeLists.txt754
-rw-r--r--CONCEPTS.md63
-rw-r--r--CONTRIBUTING.md31
-rw-r--r--Makefile425
-rw-r--r--README.md120
-rw-r--r--bazel/grpc_build_system.bzl29
-rw-r--r--bazel/grpc_deps.bzl59
-rw-r--r--build.yaml144
-rw-r--r--cmake/nanopb.cmake (renamed from src/python/grpcio_tests/tests/unit/_junkdrawer/__init__.py)4
-rw-r--r--config.m417
-rw-r--r--config.w3221
-rw-r--r--doc/PROTOCOL-WEB.md2
-rw-r--r--doc/command_line_tool.md2
-rw-r--r--doc/g_stands_for.md3
-rw-r--r--examples/cpp/README.md2
-rw-r--r--examples/cpp/cpptutorial.md4
-rw-r--r--examples/cpp/helloworld/README.md4
-rw-r--r--examples/cpp/route_guide/README.md6
-rw-r--r--examples/python/helloworld/greeter_client.py9
-rw-r--r--examples/python/interceptors/default_value/greeter_client.py12
-rw-r--r--examples/python/interceptors/headers/greeter_client.py12
-rw-r--r--examples/python/multiplex/multiplex_client.py31
-rw-r--r--examples/python/route_guide/route_guide_client.py23
-rw-r--r--gRPC-C++.podspec16
-rw-r--r--gRPC-Core.podspec41
-rw-r--r--gRPC-ProtoRPC.podspec25
-rw-r--r--gRPC-RxLibrary.podspec2
-rw-r--r--gRPC.podspec12
-rw-r--r--grpc.def2
-rw-r--r--grpc.gemspec12
-rw-r--r--grpc.gyp41
-rw-r--r--include/grpc/grpc.h8
-rw-r--r--include/grpc/grpc_security.h31
-rw-r--r--include/grpc/impl/codegen/grpc_types.h8
-rw-r--r--include/grpc/impl/codegen/port_platform.h3
-rw-r--r--include/grpc/module.modulemap1
-rw-r--r--include/grpcpp/impl/codegen/call.h15
-rw-r--r--include/grpcpp/impl/codegen/server_interface.h29
-rw-r--r--include/grpcpp/opencensus.h41
-rw-r--r--include/grpcpp/server_builder.h6
-rw-r--r--package.xml16
-rw-r--r--setup.py3
-rw-r--r--src/compiler/csharp_generator.cc16
-rw-r--r--src/core/ext/filters/client_channel/client_channel.cc1004
-rw-r--r--src/core/ext/filters/client_channel/http_proxy.cc27
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc6
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h4
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c19
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h54
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c19
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h54
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c21
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h100
-rw-r--r--src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc4
-rw-r--r--src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc311
-rw-r--r--src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h50
-rw-r--r--src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc334
-rw-r--r--src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc155
-rw-r--r--src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h4
-rw-r--r--src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc11
-rw-r--r--src/core/ext/filters/deadline/deadline_filter.cc33
-rw-r--r--src/core/ext/filters/deadline/deadline_filter.h10
-rw-r--r--src/core/ext/filters/http/client/http_client_filter.cc19
-rw-r--r--src/core/ext/filters/http/server/http_server_filter.h2
-rw-r--r--src/core/ext/filters/load_reporting/registered_opencensus_objects.h108
-rw-r--r--src/core/ext/filters/load_reporting/server_load_reporting_filter.cc432
-rw-r--r--src/core/ext/filters/load_reporting/server_load_reporting_filter.h99
-rw-r--r--src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc71
-rw-r--r--src/core/ext/filters/load_reporting/server_load_reporting_plugin.h61
-rw-r--r--src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc2
-rw-r--r--src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc5
-rw-r--r--src/core/ext/transport/chttp2/transport/chttp2_transport.cc47
-rw-r--r--src/core/ext/transport/chttp2/transport/writing.cc37
-rw-r--r--src/core/ext/transport/cronet/transport/cronet_transport.cc19
-rw-r--r--src/core/ext/transport/inproc/inproc_transport.cc52
-rw-r--r--src/core/lib/channel/channel_trace.cc49
-rw-r--r--src/core/lib/channel/channel_trace.h30
-rw-r--r--src/core/lib/channel/channelz.cc185
-rw-r--r--src/core/lib/channel/channelz.h85
-rw-r--r--src/core/lib/channel/connected_channel.cc9
-rw-r--r--src/core/lib/channel/handshaker.cc29
-rw-r--r--src/core/lib/gprpp/inlined_vector.h2
-rw-r--r--src/core/lib/iomgr/call_combiner.h80
-rw-r--r--src/core/lib/iomgr/cfstream_handle.cc185
-rw-r--r--src/core/lib/iomgr/cfstream_handle.h80
-rw-r--r--src/core/lib/iomgr/closure.h5
-rw-r--r--src/core/lib/iomgr/endpoint_cfstream.cc372
-rw-r--r--src/core/lib/iomgr/endpoint_cfstream.h49
-rw-r--r--src/core/lib/iomgr/endpoint_pair_posix.cc4
-rw-r--r--src/core/lib/iomgr/error.cc12
-rw-r--r--src/core/lib/iomgr/error.h5
-rw-r--r--src/core/lib/iomgr/error_cfstream.cc52
-rw-r--r--src/core/lib/iomgr/error_cfstream.h31
-rw-r--r--src/core/lib/iomgr/ev_epoll1_linux.cc49
-rw-r--r--src/core/lib/iomgr/ev_epollex_linux.cc217
-rw-r--r--src/core/lib/iomgr/ev_epollsig_linux.cc70
-rw-r--r--src/core/lib/iomgr/ev_poll_posix.cc18
-rw-r--r--src/core/lib/iomgr/ev_posix.cc30
-rw-r--r--src/core/lib/iomgr/ev_posix.h24
-rw-r--r--src/core/lib/iomgr/exec_ctx.h11
-rw-r--r--src/core/lib/iomgr/executor.cc2
-rw-r--r--src/core/lib/iomgr/iomgr_posix.cc4
-rw-r--r--src/core/lib/iomgr/is_epollexclusive_available.cc1
-rw-r--r--src/core/lib/iomgr/polling_entity.cc13
-rw-r--r--src/core/lib/iomgr/port.h39
-rw-r--r--src/core/lib/iomgr/resolve_address.h2
-rw-r--r--src/core/lib/iomgr/resolve_address_posix.cc2
-rw-r--r--src/core/lib/iomgr/sockaddr_posix.h2
-rw-r--r--src/core/lib/iomgr/socket_factory_posix.cc2
-rw-r--r--src/core/lib/iomgr/socket_utils.h9
-rw-r--r--src/core/lib/iomgr/socket_utils_common_posix.cc6
-rw-r--r--src/core/lib/iomgr/socket_utils_uv.cc4
-rw-r--r--src/core/lib/iomgr/socket_utils_windows.cc4
-rw-r--r--src/core/lib/iomgr/tcp_client_cfstream.cc216
-rw-r--r--src/core/lib/iomgr/tcp_client_posix.cc10
-rw-r--r--src/core/lib/iomgr/tcp_posix.cc26
-rw-r--r--src/core/lib/iomgr/tcp_server_posix.cc10
-rw-r--r--src/core/lib/iomgr/tcp_server_utils_posix_common.cc6
-rw-r--r--src/core/lib/iomgr/timer_manager.cc2
-rw-r--r--src/core/lib/iomgr/udp_server.cc5
-rw-r--r--src/core/lib/security/context/security_context.cc8
-rw-r--r--src/core/lib/security/context/security_context.h5
-rw-r--r--src/core/lib/security/credentials/google_default/google_default_credentials.cc3
-rw-r--r--src/core/lib/security/credentials/oauth2/oauth2_credentials.cc16
-rw-r--r--src/core/lib/security/credentials/oauth2/oauth2_credentials.h2
-rw-r--r--src/core/lib/security/credentials/ssl/ssl_credentials.cc20
-rw-r--r--src/core/lib/security/security_connector/security_connector.cc35
-rw-r--r--src/core/lib/security/security_connector/security_connector.h1
-rw-r--r--src/core/lib/security/transport/server_auth_filter.cc2
-rw-r--r--src/core/lib/security/util/json_util.cc4
-rw-r--r--src/core/lib/slice/slice_buffer.cc18
-rw-r--r--src/core/lib/surface/call.cc111
-rw-r--r--src/core/lib/surface/call.h2
-rw-r--r--src/core/lib/surface/channel.cc33
-rw-r--r--src/core/lib/surface/channel.h4
-rw-r--r--src/core/lib/surface/version.cc2
-rw-r--r--src/core/lib/transport/transport.cc32
-rw-r--r--src/core/lib/transport/transport.h34
-rw-r--r--src/core/lib/transport/transport_op_string.cc7
-rw-r--r--src/core/plugin_registry/grpc_cronet_plugin_registry.cc4
-rw-r--r--src/core/plugin_registry/grpc_plugin_registry.cc4
-rw-r--r--src/core/plugin_registry/grpc_unsecure_plugin_registry.cc4
-rw-r--r--src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h4
-rw-r--r--src/core/tsi/alts/handshaker/altscontext.pb.c1
-rw-r--r--src/core/tsi/alts/handshaker/altscontext.pb.h3
-rw-r--r--src/core/tsi/alts/handshaker/handshaker.pb.c1
-rw-r--r--src/core/tsi/alts/handshaker/handshaker.pb.h3
-rw-r--r--src/core/tsi/alts/handshaker/transport_security_common.pb.c1
-rw-r--r--src/core/tsi/alts/handshaker/transport_security_common.pb.h2
-rw-r--r--src/core/tsi/alts/handshaker/transport_security_common_api.h4
-rw-r--r--src/core/tsi/ssl_transport_security.cc5
-rw-r--r--src/cpp/README.md64
-rw-r--r--src/cpp/client/secure_credentials.cc3
-rw-r--r--src/cpp/common/channel_filter.h12
-rw-r--r--src/cpp/common/version_cc.cc2
-rw-r--r--src/cpp/ext/filters/census/channel_filter.cc (renamed from src/objective-c/GRPCClient/GRPCCall+MobileLog.m)19
-rw-r--r--src/cpp/ext/filters/census/channel_filter.h (renamed from test/core/statistics/multiple_writers_circular_buffer_test.cc)27
-rw-r--r--src/cpp/ext/filters/census/client_filter.cc165
-rw-r--r--src/cpp/ext/filters/census/client_filter.h104
-rw-r--r--src/cpp/ext/filters/census/context.cc132
-rw-r--r--src/cpp/ext/filters/census/context.h126
-rw-r--r--src/cpp/ext/filters/census/grpc_context.cc (renamed from src/core/ext/census/grpc_context.cc)0
-rw-r--r--src/cpp/ext/filters/census/grpc_plugin.cc130
-rw-r--r--src/cpp/ext/filters/census/grpc_plugin.h111
-rw-r--r--src/cpp/ext/filters/census/measures.cc129
-rw-r--r--src/cpp/ext/filters/census/measures.h46
-rw-r--r--src/cpp/ext/filters/census/rpc_encoding.cc39
-rw-r--r--src/cpp/ext/filters/census/rpc_encoding.h284
-rw-r--r--src/cpp/ext/filters/census/server_filter.cc198
-rw-r--r--src/cpp/ext/filters/census/server_filter.h101
-rw-r--r--src/cpp/ext/filters/census/views.cc491
-rw-r--r--src/cpp/server/health/default_health_check_service.cc4
-rw-r--r--src/cpp/server/health/health.pb.h2
-rw-r--r--src/cpp/server/load_reporter/constants.h71
-rw-r--r--src/cpp/server/load_reporter/get_cpu_stats.h (renamed from test/core/statistics/multiple_writers_test.cc)27
-rw-r--r--src/cpp/server/load_reporter/get_cpu_stats_linux.cc45
-rw-r--r--src/cpp/server/load_reporter/get_cpu_stats_macos.cc45
-rw-r--r--src/cpp/server/load_reporter/get_cpu_stats_unsupported.cc40
-rw-r--r--src/cpp/server/load_reporter/get_cpu_stats_windows.cc55
-rw-r--r--src/cpp/server/load_reporter/load_data_store.cc65
-rw-r--r--src/cpp/server/load_reporter/load_data_store.h34
-rw-r--r--src/cpp/server/load_reporter/load_reporter.cc498
-rw-r--r--src/cpp/server/load_reporter/load_reporter.h225
-rw-r--r--src/cpp/server/server_builder.cc12
-rw-r--r--src/cpp/server/server_cc.cc6
-rw-r--r--src/csharp/Grpc.Core.NativeDebug.nuspec25
-rw-r--r--src/csharp/Grpc.Core.Testing/TestCalls.cs2
-rw-r--r--src/csharp/Grpc.Core/Interceptors/CallInvokerExtensions.cs1
-rw-r--r--src/csharp/Grpc.Core/Interceptors/ChannelExtensions.cs1
-rw-r--r--src/csharp/Grpc.Core/Interceptors/ClientInterceptorContext.cs1
-rw-r--r--src/csharp/Grpc.Core/Interceptors/Interceptor.cs1
-rw-r--r--src/csharp/Grpc.Core/Interceptors/ServerServiceDefinitionExtensions.cs3
-rw-r--r--src/csharp/Grpc.Core/Server.cs2
-rwxr-xr-xsrc/csharp/Grpc.Core/Version.csproj.include2
-rw-r--r--src/csharp/Grpc.Core/VersionInfo.cs4
-rwxr-xr-xsrc/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj2
-rw-r--r--src/csharp/Grpc.Examples.Tests/MathClientMockableTest.cs101
-rw-r--r--src/csharp/Grpc.Examples.Tests/MathServiceImplTestabilityTest.cs47
-rw-r--r--src/csharp/Grpc.Examples/MathGrpc.cs24
-rw-r--r--src/csharp/Grpc.HealthCheck/HealthGrpc.cs8
-rw-r--r--src/csharp/Grpc.IntegrationTesting/BenchmarkServiceGrpc.cs24
-rw-r--r--src/csharp/Grpc.IntegrationTesting/GeneratedClientTest.cs23
-rwxr-xr-xsrc/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj1
-rw-r--r--src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs14
-rw-r--r--src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioServiceGrpc.cs8
-rw-r--r--src/csharp/Grpc.IntegrationTesting/TestGrpc.cs66
-rw-r--r--src/csharp/Grpc.IntegrationTesting/WorkerServiceGrpc.cs30
-rw-r--r--src/csharp/Grpc.Reflection/ReflectionGrpc.cs8
-rw-r--r--src/csharp/README.md4
-rwxr-xr-xsrc/csharp/build_packages_dotnetcli.bat3
-rwxr-xr-xsrc/csharp/build_packages_dotnetcli.sh5
-rw-r--r--src/csharp/ext/grpc_csharp_ext.c5
-rw-r--r--src/csharp/tests.json4
-rw-r--r--src/objective-c/!ProtoCompiler-gRPCPlugin.podspec2
-rw-r--r--src/objective-c/GRPCClient/GRPCCall+MobileLog.h30
-rw-r--r--src/objective-c/GRPCClient/GRPCCall.m5
-rw-r--r--src/objective-c/GRPCClient/private/GRPCCompletionQueue.m11
-rw-r--r--src/objective-c/GRPCClient/private/GRPCHost.h1
-rw-r--r--src/objective-c/GRPCClient/private/GRPCHost.m34
-rw-r--r--src/objective-c/GRPCClient/private/version.h2
-rw-r--r--src/objective-c/examples/Sample/Sample.xcodeproj/project.pbxproj2
-rw-r--r--src/objective-c/examples/Sample/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme2
-rw-r--r--src/objective-c/tests/Connectivity/ConnectivityTestingApp.xcodeproj/project.pbxproj17
-rw-r--r--src/objective-c/tests/Connectivity/ConnectivityTestingApp/ViewController.m2
-rw-r--r--src/objective-c/tests/Connectivity/Podfile6
-rw-r--r--src/objective-c/tests/GRPCClientTests.m3
-rw-r--r--src/objective-c/tests/Podfile31
-rw-r--r--src/objective-c/tests/Tests.xcodeproj/project.pbxproj773
-rw-r--r--src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/AllTests.xcscheme2
-rw-r--r--src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsLocalCleartext.xcscheme2
-rw-r--r--src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsLocalCleartextCFStream.xcscheme63
-rw-r--r--src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsLocalSSLCFStream.xcscheme63
-rw-r--r--src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsRemote.xcscheme2
-rw-r--r--src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsRemoteCFStream.xcscheme61
-rwxr-xr-xsrc/objective-c/tests/analyze_link_map.py78
-rwxr-xr-xsrc/objective-c/tests/build_one_example.sh5
-rwxr-xr-xsrc/objective-c/tests/run_tests.sh41
-rw-r--r--src/objective-c/tests/version.h2
-rw-r--r--src/php/README.md196
-rw-r--r--src/php/composer.json2
-rw-r--r--src/php/ext/grpc/channel_credentials.c2
-rw-r--r--src/php/ext/grpc/version.h2
-rw-r--r--src/php/lib/Grpc/BaseStub.php76
-rw-r--r--src/php/lib/Grpc/Interceptor.php14
-rw-r--r--src/php/tests/unit_tests/InterceptorTest.php20
-rw-r--r--src/proto/census/census.options3
-rw-r--r--src/proto/census/census.proto307
-rw-r--r--src/proto/census/trace_context.options0
-rw-r--r--src/proto/grpc/channelz/channelz.proto143
-rw-r--r--src/proto/grpc/lb/v1/BUILD19
-rw-r--r--src/proto/grpc/lb/v1/load_balancer.proto61
-rw-r--r--src/proto/grpc/lb/v1/load_reporter.proto180
-rw-r--r--src/proto/grpc/testing/messages.proto4
-rw-r--r--src/python/grpcio/grpc/__init__.py26
-rw-r--r--src/python/grpcio/grpc/_channel.py11
-rw-r--r--src/python/grpcio/grpc/_common.py6
-rw-r--r--src/python/grpcio/grpc/_cython/_cygrpc/arguments.pyx.pxi2
-rw-r--r--src/python/grpcio/grpc/_cython/_cygrpc/channel.pxd.pxi3
-rw-r--r--src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi2
-rw-r--r--src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi5
-rw-r--r--src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi23
-rw-r--r--src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi14
-rw-r--r--src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pxd.pxi (renamed from src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pxd)0
-rw-r--r--src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pyx.pxi (renamed from src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pyx)0
-rw-r--r--src/python/grpcio/grpc/_cython/_cygrpc/grpc_string.pyx.pxi3
-rw-r--r--src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi1
-rw-r--r--src/python/grpcio/grpc/_cython/_cygrpc/server.pxd.pxi1
-rw-r--r--src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi6
-rw-r--r--src/python/grpcio/grpc/_cython/cygrpc.pxd2
-rw-r--r--src/python/grpcio/grpc/_cython/cygrpc.pyx2
-rw-r--r--src/python/grpcio/grpc/_grpcio_metadata.py2
-rw-r--r--src/python/grpcio/grpc/_interceptor.py147
-rw-r--r--src/python/grpcio/grpc/_plugin_wrapping.py4
-rw-r--r--src/python/grpcio/grpc/_server.py31
-rw-r--r--src/python/grpcio/grpc/_utilities.py2
-rw-r--r--src/python/grpcio/grpc/beta/_server_adaptations.py1
-rw-r--r--src/python/grpcio/grpc/beta/utilities.py2
-rw-r--r--src/python/grpcio/grpc/experimental/session_cache.py45
-rw-r--r--src/python/grpcio/grpc/framework/foundation/callable_util.py4
-rw-r--r--src/python/grpcio/grpc/framework/foundation/logging_pool.py4
-rw-r--r--src/python/grpcio/grpc/framework/foundation/stream_util.py11
-rw-r--r--src/python/grpcio/grpc_core_dependencies.py8
-rw-r--r--src/python/grpcio/grpc_version.py2
-rw-r--r--src/python/grpcio_health_checking/grpc_version.py2
-rw-r--r--src/python/grpcio_reflection/grpc_version.py2
-rw-r--r--src/python/grpcio_testing/MANIFEST.in3
-rw-r--r--src/python/grpcio_testing/README.rst10
-rw-r--r--src/python/grpcio_testing/grpc_testing/__init__.py2
-rw-r--r--src/python/grpcio_testing/grpc_testing/_channel/_invocation.py3
-rw-r--r--src/python/grpcio_testing/grpc_testing/_server/_handler.py4
-rw-r--r--src/python/grpcio_testing/grpc_testing/_server/_rpc.py6
-rw-r--r--src/python/grpcio_testing/grpc_testing/_time.py4
-rw-r--r--src/python/grpcio_testing/grpc_version.py2
-rw-r--r--src/python/grpcio_tests/commands.py2
-rw-r--r--src/python/grpcio_tests/grpc_version.py2
-rw-r--r--src/python/grpcio_tests/tests/_loader.py11
-rw-r--r--src/python/grpcio_tests/tests/_result.py41
-rw-r--r--src/python/grpcio_tests/tests/interop/methods.py4
-rw-r--r--src/python/grpcio_tests/tests/interop/server.py7
-rw-r--r--src/python/grpcio_tests/tests/tests.json2
-rw-r--r--src/python/grpcio_tests/tests/unit/_auth_context_test.py45
-rw-r--r--src/python/grpcio_tests/tests/unit/_junkdrawer/stock_pb2.py164
-rw-r--r--src/python/grpcio_tests/tests/unit/_server_test.py52
-rw-r--r--src/python/grpcio_tests/tests/unit/_session_cache_test.py145
-rwxr-xr-xsrc/ruby/end2end/multiple_killed_watching_threads_driver.rb4
-rw-r--r--src/ruby/end2end/package_with_underscore_checker.rb54
-rw-r--r--src/ruby/end2end/protos/package_with_underscore/data.proto (renamed from src/ruby/spec/pb/package_with_underscore/data.proto)0
-rw-r--r--src/ruby/end2end/protos/package_with_underscore/service.proto (renamed from src/ruby/spec/pb/package_with_underscore/service.proto)0
-rw-r--r--src/ruby/ext/grpc/rb_channel_credentials.c6
-rw-r--r--src/ruby/ext/grpc/rb_grpc_imports.generated.c4
-rw-r--r--src/ruby/ext/grpc/rb_grpc_imports.generated.h8
-rw-r--r--src/ruby/lib/grpc/generic/active_call.rb42
-rw-r--r--src/ruby/lib/grpc/version.rb2
-rw-r--r--src/ruby/spec/call_credentials_spec.rb2
-rw-r--r--src/ruby/spec/call_spec.rb2
-rw-r--r--src/ruby/spec/channel_credentials_spec.rb2
-rw-r--r--src/ruby/spec/channel_spec.rb2
-rw-r--r--src/ruby/spec/client_auth_spec.rb13
-rw-r--r--src/ruby/spec/client_server_spec.rb2
-rw-r--r--src/ruby/spec/compression_options_spec.rb2
-rw-r--r--src/ruby/spec/error_sanity_spec.rb2
-rw-r--r--src/ruby/spec/generic/client_stub_spec.rb14
-rw-r--r--src/ruby/spec/generic/rpc_desc_spec.rb2
-rw-r--r--src/ruby/spec/generic/rpc_server_pool_spec.rb2
-rw-r--r--src/ruby/spec/generic/service_spec.rb2
-rw-r--r--src/ruby/spec/google_rpc_status_utils_spec.rb13
-rw-r--r--src/ruby/spec/pb/duplicate/codegen_spec.rb1
-rw-r--r--src/ruby/spec/pb/health/checker_spec.rb2
-rw-r--r--src/ruby/spec/pb/package_with_underscore/checker_spec.rb51
-rw-r--r--src/ruby/spec/server_credentials_spec.rb2
-rw-r--r--src/ruby/spec/server_spec.rb2
-rw-r--r--src/ruby/spec/spec_helper.rb1
-rw-r--r--src/ruby/spec/support/services.rb2
-rw-r--r--src/ruby/spec/time_consts_spec.rb2
-rw-r--r--src/ruby/tools/version.rb2
-rw-r--r--templates/CMakeLists.txt.template11
-rw-r--r--templates/Makefile.template2
-rw-r--r--templates/config.m4.template5
-rw-r--r--templates/config.w32.template5
-rw-r--r--templates/gRPC-C++.podspec.template8
-rw-r--r--templates/gRPC-Core.podspec.template21
-rw-r--r--templates/gRPC-ProtoRPC.podspec.template23
-rw-r--r--templates/gRPC.podspec.template10
-rw-r--r--templates/grpc.gyp.template1
-rwxr-xr-xtemplates/src/csharp/build_packages_dotnetcli.bat.template1
-rwxr-xr-xtemplates/src/csharp/build_packages_dotnetcli.sh.template1
-rw-r--r--test/core/avl/avl_test.cc3361
-rw-r--r--test/core/bad_ssl/bad_ssl_test.cc2
-rw-r--r--test/core/channel/BUILD18
-rw-r--r--test/core/channel/channel_trace_test.cc195
-rw-r--r--test/core/channel/channelz_registry_test.cc1
-rw-r--r--test/core/channel/channelz_test.cc216
-rw-r--r--test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc8
-rw-r--r--test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc18
-rw-r--r--test/core/end2end/end2end_nosec_tests.cc24
-rw-r--r--test/core/end2end/end2end_tests.cc24
-rw-r--r--test/core/end2end/fixtures/h2_load_reporting.cc120
-rw-r--r--test/core/end2end/fixtures/h2_oauth2.cc2
-rw-r--r--test/core/end2end/fixtures/h2_ssl.cc2
-rw-r--r--test/core/end2end/fixtures/h2_ssl_proxy.cc4
-rw-r--r--test/core/end2end/fuzzers/api_fuzzer.cc17
-rwxr-xr-xtest/core/end2end/gen_build_yaml.py10
-rwxr-xr-xtest/core/end2end/generate_tests.bzl11
-rw-r--r--test/core/end2end/goaway_server_test.cc20
-rw-r--r--test/core/end2end/h2_ssl_cert_test.cc4
-rw-r--r--test/core/end2end/h2_ssl_session_reuse_test.cc2
-rw-r--r--test/core/end2end/tests/channelz.cc299
-rw-r--r--test/core/end2end/tests/no_error_on_hotpath.cc246
-rw-r--r--test/core/end2end/tests/retry_server_pushback_delay.cc2
-rw-r--r--test/core/gpr/arena_test.cc2
-rw-r--r--test/core/gprpp/inlined_vector_test.cc2
-rw-r--r--test/core/gprpp/ref_counted_ptr_test.cc4
-rw-r--r--test/core/handshake/BUILD18
-rw-r--r--test/core/handshake/client_ssl.cc4
-rw-r--r--test/core/handshake/verify_peer_options.cc275
-rw-r--r--test/core/iomgr/BUILD20
-rw-r--r--test/core/iomgr/ev_epollex_linux_test.cc115
-rw-r--r--test/core/iomgr/ev_epollsig_linux_test.cc10
-rw-r--r--test/core/iomgr/fd_posix_test.cc16
-rw-r--r--test/core/iomgr/ios/CFStreamTests/CFStreamClientTests.mm201
-rw-r--r--test/core/iomgr/ios/CFStreamTests/CFStreamEndpointTests.mm344
-rw-r--r--test/core/iomgr/ios/CFStreamTests/CFStreamTests.xcodeproj/project.pbxproj338
-rw-r--r--test/core/iomgr/ios/CFStreamTests/CFStreamTests.xcodeproj/xcshareddata/xcschemes/CFStreamTests.xcscheme56
-rw-r--r--test/core/iomgr/ios/CFStreamTests/CFStreamTests.xcodeproj/xcshareddata/xcschemes/CFStreamTests_Asan.xcscheme61
-rw-r--r--test/core/iomgr/ios/CFStreamTests/CFStreamTests.xcodeproj/xcshareddata/xcschemes/CFStreamTests_Msan.xcscheme78
-rw-r--r--test/core/iomgr/ios/CFStreamTests/CFStreamTests.xcodeproj/xcshareddata/xcschemes/CFStreamTests_Tsan.xcscheme60
-rw-r--r--test/core/iomgr/ios/CFStreamTests/Info.plist22
-rw-r--r--test/core/iomgr/ios/CFStreamTests/Podfile50
-rwxr-xr-xtest/core/iomgr/ios/CFStreamTests/build_tests.sh39
-rwxr-xr-xtest/core/iomgr/ios/CFStreamTests/run_tests.sh67
-rw-r--r--test/core/iomgr/pollset_set_test.cc5
-rw-r--r--test/core/iomgr/tcp_posix_test.cc20
-rw-r--r--test/core/security/BUILD4
-rw-r--r--test/core/statistics/census_log_tests.h36
-rw-r--r--test/core/statistics/census_stub_test.cc62
-rw-r--r--test/core/statistics/performance_test.cc31
-rw-r--r--test/core/statistics/quick_test.cc39
-rw-r--r--test/core/statistics/rpc_stats_test.cc183
-rw-r--r--test/core/statistics/small_log_test.cc31
-rw-r--r--test/core/surface/num_external_connectivity_watchers_test.cc2
-rw-r--r--test/core/surface/public_headers_must_be_c89.c3
-rw-r--r--test/core/surface/sequential_connectivity_test.cc2
-rw-r--r--test/core/transport/BUILD1
-rw-r--r--test/core/transport/status_conversion_test.cc25
-rw-r--r--test/core/tsi/alts/crypt/BUILD1
-rw-r--r--test/core/tsi/alts/frame_protector/BUILD4
-rw-r--r--test/core/tsi/alts/handshaker/BUILD5
-rw-r--r--test/core/tsi/alts/zero_copy_frame_protector/BUILD3
-rw-r--r--test/core/util/BUILD5
-rw-r--r--test/core/util/lsan_suppressions.txt (renamed from tools/lsan_suppressions.txt)0
-rw-r--r--test/core/util/tsan_suppressions.txt (renamed from tools/tsan_suppressions.txt)0
-rw-r--r--test/core/util/ubsan_suppressions.txt (renamed from tools/ubsan_suppressions.txt)0
-rw-r--r--test/cpp/client/BUILD1
-rw-r--r--test/cpp/codegen/golden_file_test.cc4
-rw-r--r--test/cpp/end2end/async_end2end_test.cc16
-rw-r--r--test/cpp/end2end/client_lb_end2end_test.cc2
-rw-r--r--test/cpp/end2end/end2end_test.cc14
-rw-r--r--test/cpp/end2end/grpclb_end2end_test.cc2
-rw-r--r--test/cpp/end2end/mock_test.cc2
-rw-r--r--test/cpp/end2end/thread_stress_test.cc1
-rw-r--r--test/cpp/ext/filters/census/BUILD42
-rw-r--r--test/cpp/ext/filters/census/stats_plugin_end2end_test.cc376
-rw-r--r--test/cpp/interop/http2_client.cc11
-rw-r--r--test/cpp/interop/http2_client.h6
-rw-r--r--test/cpp/interop/interop_client.cc16
-rw-r--r--test/cpp/interop/interop_client.h11
-rw-r--r--test/cpp/interop/interop_server.cc8
-rw-r--r--test/cpp/interop/server_helper.h8
-rw-r--r--test/cpp/interop/stress_interop_client.cc5
-rw-r--r--test/cpp/interop/stress_interop_client.h4
-rw-r--r--test/cpp/microbenchmarks/BUILD27
-rw-r--r--test/cpp/microbenchmarks/bm_call_create.cc35
-rw-r--r--test/cpp/microbenchmarks/bm_channel.cc90
-rw-r--r--test/cpp/microbenchmarks/bm_chttp2_hpack.cc2
-rw-r--r--test/cpp/microbenchmarks/bm_opencensus_plugin.cc118
-rw-r--r--test/cpp/microbenchmarks/bm_pollset.cc8
-rw-r--r--test/cpp/naming/BUILD18
-rw-r--r--test/cpp/naming/cancel_ares_query_test.cc289
-rwxr-xr-xtest/cpp/naming/gen_build_yaml.py19
-rw-r--r--test/cpp/naming/resolver_component_test.cc122
-rw-r--r--test/cpp/naming/resolver_component_tests_runner_invoker.cc26
-rw-r--r--test/cpp/qps/client.h2
-rw-r--r--test/cpp/qps/client_async.cc43
-rw-r--r--test/cpp/qps/client_sync.cc4
-rw-r--r--test/cpp/qps/driver.cc29
-rw-r--r--test/cpp/qps/qps_interarrival_test.cc3
-rw-r--r--test/cpp/qps/report.h2
-rw-r--r--test/cpp/qps/server_sync.cc2
-rw-r--r--test/cpp/server/load_reporter/BUILD34
-rw-r--r--test/cpp/server/load_reporter/get_cpu_stats_test.cc61
-rw-r--r--test/cpp/server/load_reporter/load_data_store_test.cc14
-rw-r--r--test/cpp/server/load_reporter/load_reporter_test.cc498
-rw-r--r--test/cpp/util/.clang-tidy6
-rw-r--r--test/cpp/util/BUILD2
-rw-r--r--test/cpp/util/byte_buffer_test.cc2
-rw-r--r--test/cpp/util/channel_trace_proto_helper.cc41
-rw-r--r--test/cpp/util/channel_trace_proto_helper.h1
-rw-r--r--test/cpp/util/cli_call.cc5
-rw-r--r--test/cpp/util/cli_call.h3
-rw-r--r--test/cpp/util/grpc_tool.cc28
-rw-r--r--test/cpp/util/proto_file_parser.cc2
-rw-r--r--test/cpp/util/proto_file_parser.h2
-rw-r--r--test/cpp/util/proto_reflection_descriptor_database.cc14
-rw-r--r--test/cpp/util/proto_reflection_descriptor_database.h2
-rw-r--r--test/cpp/util/string_ref_test.cc2
-rw-r--r--test/distrib/csharp/DistribTest/packages.config1
-rwxr-xr-xtest/distrib/csharp/run_distrib_test.sh3
-rwxr-xr-xtest/distrib/csharp/test_codegen/test_codegen.sh38
-rw-r--r--test/distrib/csharp/test_codegen/testcodegen.proto (renamed from src/proto/census/trace_context.proto)24
-rwxr-xr-xtest/distrib/csharp/update_version.sh2
-rwxr-xr-xtest/distrib/python/test_packages.sh16
-rw-r--r--third_party/cares/BUILD1
-rw-r--r--third_party/cares/cares.BUILD22
-rw-r--r--third_party/cares/config_windows/ares_config.h423
-rw-r--r--third_party/nanopb.BUILD19
-rw-r--r--third_party/nanopb/BUILD29
-rw-r--r--tools/bazel.rc6
-rwxr-xr-xtools/codegen/core/gen_nano_proto.sh20
-rwxr-xr-xtools/distrib/check_copyright.py4
-rwxr-xr-xtools/distrib/check_include_guards.py2
-rwxr-xr-xtools/distrib/check_nanopb_output.sh10
-rwxr-xr-xtools/distrib/pylint_code.sh11
-rw-r--r--tools/distrib/python/grpcio_tools/grpc_version.py2
-rwxr-xr-xtools/distrib/run_clang_tidy.py8
-rw-r--r--tools/dockerfile/distribtest/csharp_centos7_x64/Dockerfile20
-rw-r--r--tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile7
-rw-r--r--tools/dockerfile/distribtest/csharp_jessie_x86/Dockerfile7
-rw-r--r--tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile12
-rw-r--r--tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile15
-rw-r--r--tools/dockerfile/distribtest/csharp_wheezy_x64/Dockerfile20
-rw-r--r--tools/dockerfile/grpc_artifact_python_manylinux_x64/Dockerfile5
-rw-r--r--tools/dockerfile/grpc_artifact_python_manylinux_x86/Dockerfile5
-rwxr-xr-xtools/dockerfile/interoptest/grpc_interop_python/build_interop.sh3
-rw-r--r--tools/doxygen/Doxyfile.c++3
-rw-r--r--tools/doxygen/Doxyfile.c++.internal4
-rw-r--r--tools/doxygen/Doxyfile.core1
-rw-r--r--tools/doxygen/Doxyfile.core.internal12
-rw-r--r--tools/internal_ci/linux/grpc_tsan_on_foundry.sh2
-rw-r--r--tools/interop_matrix/client_matrix.py3
-rwxr-xr-xtools/profiling/ios_bin/binary_diff.py127
-rwxr-xr-xtools/profiling/ios_bin/parse_link_map.py104
-rw-r--r--tools/run_tests/artifacts/artifact_targets.py2
-rw-r--r--tools/run_tests/artifacts/build_artifact_csharp.bat5
-rwxr-xr-xtools/run_tests/artifacts/build_artifact_python.sh8
-rw-r--r--tools/run_tests/artifacts/distribtest_targets.py1
-rw-r--r--tools/run_tests/generated/configs.json8
-rw-r--r--tools/run_tests/generated/sources_and_headers.json241
-rw-r--r--tools/run_tests/generated/tests.json5084
-rwxr-xr-xtools/run_tests/helper_scripts/build_ruby.sh3
-rwxr-xr-xtools/run_tests/helper_scripts/run_ruby.sh3
-rwxr-xr-xtools/run_tests/helper_scripts/run_ruby_end2end_tests.sh21
-rw-r--r--tools/run_tests/python_utils/filter_pull_request_tests.py2
-rw-r--r--tools/run_tests/python_utils/upload_rbe_results.py8
-rw-r--r--tools/run_tests/python_utils/upload_test_results.py56
-rwxr-xr-xtools/run_tests/run_tests.py13
-rwxr-xr-xtools/run_tests/sanity/check_bazel_workspace.py6
-rwxr-xr-xtools/run_tests/sanity/check_sources_and_headers.py126
-rwxr-xr-xtools/run_tests/sanity/core_banned_functions.py3
-rw-r--r--tools/run_tests/sanity/sanity_tests.yaml1
-rw-r--r--vsprojects/.gitignore12
-rw-r--r--vsprojects/README.md11
526 files changed, 18274 insertions, 12452 deletions
diff --git a/.clang-tidy b/.clang-tidy
new file mode 100644
index 0000000000..fbf0b6541e
--- /dev/null
+++ b/.clang-tidy
@@ -0,0 +1,6 @@
+---
+Checks: 'modernize-use-nullptr,google-build-namespaces,google-build-explicit-make-pair,readability-function-size,performance-*'
+WarningsAsErrors: 'modernize-use-nullptr,google-build-namespaces,google-build-explicit-make-pair,readability-function-size,performance-*'
+CheckOptions:
+ - key: readability-function-size.StatementThreshold
+ value: '450'
diff --git a/.pylintrc b/.pylintrc
index 453b45aab5..90e8989ffc 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -72,6 +72,13 @@ disable=
# TODO(https://github.com/grpc/grpc/issues/261): Maybe we could have
# this one if we extracted just a few more helper functions...
too-many-nested-blocks,
- # NOTE(nathaniel): I have disputed the premise of this inspection from
- # the beginning and will continue to do so until it goes away for good.
+ # TODO(https://github.com/grpc/grpc/issues/261): Disable unnecessary
+ # super-init requirement for abstract class implementations for now.
+ super-init-not-called,
+ # NOTE(nathaniel): A single statement that always returns program
+ # control is better than two statements the first of which sometimes
+ # returns program control and the second of which always returns
+ # program control. Probably generally, but definitely in the cases of
+ # if:/else: and for:/else:.
useless-else-on-loop,
+ no-else-return,
diff --git a/.pylintrc-tests b/.pylintrc-tests
index b358b2c4a0..ebe9d507cd 100644
--- a/.pylintrc-tests
+++ b/.pylintrc-tests
@@ -103,6 +103,13 @@ disable=
# TODO(https://github.com/grpc/grpc/issues/261): Maybe we could have
# this one if we extracted just a few more helper functions...
too-many-nested-blocks,
- # NOTE(nathaniel): I have disputed the premise of this inspection from
- # the beginning and will continue to do so until it goes away for good.
+ # TODO(https://github.com/grpc/grpc/issues/261): Disable unnecessary
+ # super-init requirement for abstract class implementations for now.
+ super-init-not-called,
+ # NOTE(nathaniel): A single statement that always returns program
+ # control is better than two statements the first of which sometimes
+ # returns program control and the second of which always returns
+ # program control. Probably generally, but definitely in the cases of
+ # if:/else: and for:/else:.
useless-else-on-loop,
+ no-else-return,
diff --git a/BUILD b/BUILD
index db1bdaa994..dca9c8794a 100644
--- a/BUILD
+++ b/BUILD
@@ -29,8 +29,8 @@ package(
load(
"//bazel:grpc_build_system.bzl",
"grpc_cc_library",
- "grpc_proto_plugin",
"grpc_generate_one_off_targets",
+ "grpc_proto_plugin",
)
config_setting(
@@ -64,11 +64,11 @@ config_setting(
)
# This should be updated along with build.yaml
-g_stands_for = "gloriosa"
+g_stands_for = "gladiolus"
core_version = "6.0.0-dev"
-version = "1.13.0-dev"
+version = "1.14.0-dev"
GPR_PUBLIC_HDRS = [
"include/grpc/support/alloc.h",
@@ -485,10 +485,7 @@ grpc_cc_library(
grpc_cc_library(
name = "census",
srcs = [
- "src/core/ext/census/grpc_context.cc",
- ],
- external_deps = [
- "nanopb",
+ "src/cpp/ext/filters/census/grpc_context.cc",
],
language = "c++",
public_hdrs = [
@@ -678,6 +675,7 @@ grpc_cc_library(
"src/core/lib/channel/channel_stack.cc",
"src/core/lib/channel/channel_stack_builder.cc",
"src/core/lib/channel/channel_trace.cc",
+ "src/core/lib/channel/channelz.cc",
"src/core/lib/channel/channelz_registry.cc",
"src/core/lib/channel/connected_channel.cc",
"src/core/lib/channel/handshaker.cc",
@@ -825,6 +823,7 @@ grpc_cc_library(
"src/core/lib/channel/channel_stack.h",
"src/core/lib/channel/channel_stack_builder.h",
"src/core/lib/channel/channel_trace.h",
+ "src/core/lib/channel/channelz.h",
"src/core/lib/channel/channelz_registry.h",
"src/core/lib/channel/connected_channel.h",
"src/core/lib/channel/context.h",
@@ -988,7 +987,6 @@ grpc_cc_library(
"grpc_client_authority_filter",
"grpc_lb_policy_pick_first",
"grpc_lb_policy_round_robin",
- "grpc_server_load_reporting",
"grpc_max_age_filter",
"grpc_message_size_filter",
"grpc_resolver_dns_ares",
@@ -1004,6 +1002,25 @@ grpc_cc_library(
)
grpc_cc_library(
+ name = "grpc_cfstream",
+ srcs = [
+ "src/core/lib/iomgr/cfstream_handle.cc",
+ "src/core/lib/iomgr/endpoint_cfstream.cc",
+ "src/core/lib/iomgr/error_cfstream.cc",
+ "src/core/lib/iomgr/tcp_client_cfstream.cc",
+ ],
+ hdrs = [
+ "src/core/lib/iomgr/cfstream_handle.h",
+ "src/core/lib/iomgr/endpoint_cfstream.h",
+ "src/core/lib/iomgr/error_cfstream.h",
+ ],
+ deps = [
+ ":gpr_base",
+ ":grpc_base",
+ ],
+)
+
+grpc_cc_library(
name = "grpc_client_channel",
srcs = [
"src/core/ext/filters/client_channel/backup_poller.cc",
@@ -1180,6 +1197,8 @@ grpc_cc_library(
"src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc",
"src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc",
"src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c",
+ "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c",
+ "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c",
],
hdrs = [
"src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h",
@@ -1188,6 +1207,8 @@ grpc_cc_library(
"src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h",
"src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h",
"src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h",
+ "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h",
+ "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h",
],
external_deps = [
"nanopb",
@@ -1209,6 +1230,8 @@ grpc_cc_library(
"src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc",
"src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc",
"src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c",
+ "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c",
+ "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c",
],
hdrs = [
"src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h",
@@ -1217,6 +1240,8 @@ grpc_cc_library(
"src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h",
"src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h",
"src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h",
+ "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h",
+ "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h",
],
external_deps = [
"nanopb",
@@ -1269,18 +1294,22 @@ grpc_cc_library(
)
grpc_cc_library(
- name = "grpc_server_load_reporting",
+ name = "lb_server_load_reporting_filter",
srcs = [
"src/core/ext/filters/load_reporting/server_load_reporting_filter.cc",
- "src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc",
],
hdrs = [
+ "src/core/ext/filters/load_reporting/registered_opencensus_objects.h",
"src/core/ext/filters/load_reporting/server_load_reporting_filter.h",
- "src/core/ext/filters/load_reporting/server_load_reporting_plugin.h",
+ "src/cpp/server/load_reporter/constants.h",
+ ],
+ external_deps = [
+ "opencensus-stats",
],
language = "c++",
deps = [
- "grpc_base",
+ "grpc++_base",
+ "grpc_secure",
],
)
@@ -1290,6 +1319,7 @@ grpc_cc_library(
"src/cpp/server/load_reporter/load_data_store.cc",
],
hdrs = [
+ "src/cpp/server/load_reporter/constants.h",
"src/cpp/server/load_reporter/load_data_store.h",
],
language = "c++",
@@ -1299,6 +1329,43 @@ grpc_cc_library(
)
grpc_cc_library(
+ name = "lb_get_cpu_stats",
+ srcs = [
+ "src/cpp/server/load_reporter/get_cpu_stats_linux.cc",
+ "src/cpp/server/load_reporter/get_cpu_stats_macos.cc",
+ "src/cpp/server/load_reporter/get_cpu_stats_unsupported.cc",
+ "src/cpp/server/load_reporter/get_cpu_stats_windows.cc",
+ ],
+ hdrs = [
+ "src/cpp/server/load_reporter/get_cpu_stats.h",
+ ],
+ language = "c++",
+ deps = [
+ "grpc++",
+ ],
+)
+
+grpc_cc_library(
+ name = "lb_load_reporter",
+ srcs = [
+ "src/cpp/server/load_reporter/load_reporter.cc",
+ ],
+ hdrs = [
+ "src/cpp/server/load_reporter/constants.h",
+ "src/cpp/server/load_reporter/load_reporter.h",
+ ],
+ external_deps = [
+ "opencensus-stats",
+ ],
+ language = "c++",
+ deps = [
+ "lb_get_cpu_stats",
+ "lb_load_data_store",
+ "//src/proto/grpc/lb/v1:load_reporter_proto",
+ ],
+)
+
+grpc_cc_library(
name = "grpc_resolver_dns_native",
srcs = [
"src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc",
@@ -1314,6 +1381,7 @@ grpc_cc_library(
name = "grpc_resolver_dns_ares",
srcs = [
"src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc",
+ "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc",
"src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc",
"src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc",
"src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc",
@@ -1720,11 +1788,11 @@ grpc_cc_library(
"src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h",
"src/core/tsi/alts/handshaker/transport_security_common_api.h",
],
- public_hdrs = GRPC_SECURE_PUBLIC_HDRS,
external_deps = [
"nanopb",
],
language = "c++",
+ public_hdrs = GRPC_SECURE_PUBLIC_HDRS,
deps = [
"alts_proto",
"gpr",
@@ -1970,4 +2038,40 @@ grpc_cc_library(
],
)
+grpc_cc_library(
+ name = "grpc_opencensus_plugin",
+ srcs = [
+ "src/cpp/ext/filters/census/channel_filter.cc",
+ "src/cpp/ext/filters/census/client_filter.cc",
+ "src/cpp/ext/filters/census/context.cc",
+ "src/cpp/ext/filters/census/grpc_context.cc",
+ "src/cpp/ext/filters/census/grpc_plugin.cc",
+ "src/cpp/ext/filters/census/measures.cc",
+ "src/cpp/ext/filters/census/rpc_encoding.cc",
+ "src/cpp/ext/filters/census/server_filter.cc",
+ "src/cpp/ext/filters/census/views.cc",
+ ],
+ hdrs = [
+ "include/grpcpp/opencensus.h",
+ "src/cpp/ext/filters/census/channel_filter.h",
+ "src/cpp/ext/filters/census/client_filter.h",
+ "src/cpp/ext/filters/census/context.h",
+ "src/cpp/ext/filters/census/grpc_plugin.h",
+ "src/cpp/ext/filters/census/measures.h",
+ "src/cpp/ext/filters/census/rpc_encoding.h",
+ "src/cpp/ext/filters/census/server_filter.h",
+ ],
+ external_deps = [
+ "absl-base",
+ "absl-time",
+ "opencensus-trace",
+ "opencensus-stats",
+ ],
+ language = "c++",
+ deps = [
+ ":census",
+ ":grpc++",
+ ],
+)
+
grpc_generate_one_off_targets()
diff --git a/INSTALL.md b/BUILDING.md
index a61af3479c..e1d63a7461 100644
--- a/INSTALL.md
+++ b/BUILDING.md
@@ -1,18 +1,5 @@
-# If you are in a hurry
-
-For language-specific installation instructions for gRPC runtime, please
-refer to these documents
-
- * [C++](examples/cpp): Currently to install gRPC for C++, you need to build from source as described below.
- * [C#](src/csharp): NuGet package `Grpc`
- * [Go](https://github.com/grpc/grpc-go): `go get google.golang.org/grpc`
- * [Java](https://github.com/grpc/grpc-java)
- * [Node](src/node): `npm install grpc`
- * [Objective-C](src/objective-c)
- * [PHP](src/php): `pecl install grpc`
- * [Python](src/python/grpcio): `pip install grpcio`
- * [Ruby](src/ruby): `gem install grpc`
-
+gRPC C++ - Building from source
+===========================
# Pre-requisites
@@ -28,7 +15,7 @@ If you plan to build from source and run tests, install the following as well:
$ [sudo] apt-get install clang libc++-dev
```
-## macOS
+## MacOS
On a Mac, you will first need to
install Xcode or
@@ -60,6 +47,17 @@ installed by `brew` is being used:
$ LIBTOOL=glibtool LIBTOOLIZE=glibtoolize make
```
+## Windows
+
+To prepare for cmake + Microsoft Visual C++ compiler build
+- Install Visual Studio 2015 or 2017 (Visual C++ compiler will be used).
+- Install [Git](https://git-scm.com/).
+- Install [CMake](https://cmake.org/download/).
+- Install [Active State Perl](https://www.activestate.com/activeperl/) (`choco install activeperl`) - *required by boringssl*
+- Install [Go](https://golang.org/dl/) (`choco install golang`) - *required by boringssl*
+- Install [yasm](http://yasm.tortall.net/) and add it to `PATH` (`choco install yasm`) - *required by boringssl*
+- (Optional) Install [Ninja](https://ninja-build.org/) (`choco install ninja`)
+
## Protoc
By default gRPC uses [protocol buffers](https://github.com/google/protobuf),
@@ -77,48 +75,49 @@ $ cd grpc/third_party/protobuf
$ sudo make install # 'make' should have been run by core grpc
```
-# Build from Source
+# Clone the repository (including submodules)
-For developers who are interested to contribute, the following commands show how to compile the
-gRPC C Core library.
+Before building, you need to clone the gRPC github repository and download submodules containing source code
+for gRPC's dependencies (that's done by the `submodule` command or `--recursive` flag). The following commands will clone the gRPC
+repository at the latest stable version.
+
+## Unix
```sh
$ git clone -b $(curl -L https://grpc.io/release) https://github.com/grpc/grpc
$ cd grpc
$ git submodule update --init
- $ make
- $ [sudo] make install
-```
+ ```
## Windows
-There are several ways to build under Windows, of varying complexity depending
-on experience with the tools involved.
+```
+> @rem You can also do just "git clone --recursive -b THE_BRANCH_YOU_WANT https://github.com/grpc/grpc"
+> powershell git clone --recursive -b ((New-Object System.Net.WebClient).DownloadString(\"https://grpc.io/release\").Trim()) https://github.com/grpc/grpc
+> cd grpc
+> @rem To update submodules at later time, run "git submodule update --init"
+```
+# Build from source
+In the C++ world, there's no "standard" build system that would work for in all supported use cases and on all supported platforms.
+Therefore, gRPC supports several major build systems, which should satisfy most users.
-### Building using CMake (RECOMMENDED)
+## make (on UNIX systems)
-Builds gRPC C and C++ with boringssl.
-- Install Visual Studio 2015 or 2017 (Visual C++ compiler will be used).
-- Install [Git](https://git-scm.com/).
-- Install [CMake](https://cmake.org/download/).
-- Install [Active State Perl](https://www.activestate.com/activeperl/) (`choco install activeperl`) - *required by boringssl*
-- Install [Go](https://golang.org/dl/) (`choco install golang`) - *required by boringssl*
-- Install [yasm](http://yasm.tortall.net/) and add it to `PATH` (`choco install yasm`) - *required by boringssl*
-- (Optional) Install [Ninja](https://ninja-build.org/) (`choco install ninja`)
+From the grpc repository root
+```sh
+ $ make
+```
-#### Clone grpc sources including submodules
-Before building, you need to clone the gRPC github repository and download submodules containing source code
-for gRPC's dependencies (that's done by the `submodule` command).
+## bazel
+
+From the grpc repository root
```
-> @rem You can also do just "git clone --recursive -b THE_BRANCH_YOU_WANT https://github.com/grpc/grpc"
-> powershell git clone --recursive -b ((New-Object System.Net.WebClient).DownloadString(\"https://grpc.io/release\").Trim()) https://github.com/grpc/grpc
-> cd grpc
-> @rem To update submodules at later time, run "git submodule update --init"
+bazel build :all
```
-#### cmake: Using Visual Studio 2015 or 2017 (can only build with OPENSSL_NO_ASM).
+## cmake: Windows, Using Visual Studio 2015 or 2017 (can only build with OPENSSL_NO_ASM).
When using the "Visual Studio" generator,
cmake will generate a solution (`grpc.sln`) that contains a VS project for
every target defined in `CMakeLists.txt` (+ few extra convenience projects
@@ -132,7 +131,7 @@ you will be able to browse and build the code.
> cmake --build .
```
-#### cmake: Using Ninja (faster build, supports boringssl's assembly optimizations).
+## cmake: Windows, Using Ninja (faster build, supports boringssl's assembly optimizations).
Please note that when using Ninja, you will still need Visual C++ (part of Visual Studio)
installed to be able to compile the C/C++ sources.
```
@@ -143,30 +142,3 @@ installed to be able to compile the C/C++ sources.
> cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release
> cmake --build .
```
-
-### msys2 (with mingw)
-
-The Makefile (and source code) should support msys2's mingw32 and mingw64
-compilers. Building with msys2's native compiler is possible, but
-difficult.
-
-This approach requires having [msys2](https://msys2.github.io/) installed.
-
-```
-# Install prerequisites
-MSYS2$ pacman -S autoconf automake gcc libtool mingw-w64-x86_64-toolchain perl pkg-config zlib
-MSYS2$ pacman -S mingw-w64-x86_64-gflags
-```
-
-```
-# From mingw shell
-MINGW64$ export CPPFLAGS="-D_WIN32_WINNT=0x0600"
-MINGW64$ make
-```
-
-NOTE: Though most of the make targets are buildable under Mingw, some haven't been ported to Windows yet
-and may fail to build (mostly trying to include POSIX headers not available on Mingw).
-
-### Pre-generated Visual Studio solution (DELETED)
-
-*WARNING: This used to be the recommended way to build on Windows, but because of significant limitations (hard to build dependencies including boringssl, .proto codegen is hard to support, ..) we are no longer providing them. Use cmake to build on Windows instead.*
diff --git a/CMakeLists.txt b/CMakeLists.txt
index af56886cd9..0d1b201f9d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,7 +24,7 @@
cmake_minimum_required(VERSION 2.8)
set(PACKAGE_NAME "grpc")
-set(PACKAGE_VERSION "1.13.0-dev")
+set(PACKAGE_VERSION "1.14.0-dev")
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/")
@@ -39,6 +39,7 @@ set(gRPC_INSTALL_SHAREDIR "share/grpc" CACHE STRING "Installation directory for
# Options
option(gRPC_BUILD_TESTS "Build tests" OFF)
option(gRPC_BUILD_CODEGEN "Build codegen" ON)
+option(gRPC_BUILD_CSHARP_EXT "Build C# extensions" ON)
set(gRPC_INSTALL_default ON)
if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
@@ -119,6 +120,7 @@ include(cmake/ssl.cmake)
include(cmake/gflags.cmake)
include(cmake/benchmark.cmake)
include(cmake/address_sorting.cmake)
+include(cmake/nanopb.cmake)
if(NOT MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
@@ -244,6 +246,9 @@ endif()
add_dependencies(buildtests_c endpoint_pair_test)
add_dependencies(buildtests_c error_test)
if(_gRPC_PLATFORM_LINUX)
+add_dependencies(buildtests_c ev_epollex_linux_test)
+endif()
+if(_gRPC_PLATFORM_LINUX)
add_dependencies(buildtests_c ev_epollsig_linux_test)
endif()
add_dependencies(buildtests_c fake_resolver_test)
@@ -308,6 +313,9 @@ endif()
if(_gRPC_PLATFORM_LINUX)
add_dependencies(buildtests_c handshake_server_with_readahead_handshaker)
endif()
+if(_gRPC_PLATFORM_LINUX)
+add_dependencies(buildtests_c handshake_verify_peer_options)
+endif()
add_dependencies(buildtests_c histogram_test)
add_dependencies(buildtests_c hpack_parser_test)
add_dependencies(buildtests_c hpack_table_test)
@@ -425,7 +433,6 @@ endif()
add_dependencies(buildtests_c h2_full+trace_test)
add_dependencies(buildtests_c h2_full+workarounds_test)
add_dependencies(buildtests_c h2_http_proxy_test)
-add_dependencies(buildtests_c h2_load_reporting_test)
add_dependencies(buildtests_c h2_oauth2_test)
add_dependencies(buildtests_c h2_proxy_test)
add_dependencies(buildtests_c h2_sockpair_test)
@@ -449,7 +456,6 @@ endif()
add_dependencies(buildtests_c h2_full+trace_nosec_test)
add_dependencies(buildtests_c h2_full+workarounds_nosec_test)
add_dependencies(buildtests_c h2_http_proxy_nosec_test)
-add_dependencies(buildtests_c h2_load_reporting_nosec_test)
add_dependencies(buildtests_c h2_proxy_nosec_test)
add_dependencies(buildtests_c h2_sockpair_nosec_test)
add_dependencies(buildtests_c h2_sockpair+trace_nosec_test)
@@ -499,6 +505,9 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx bm_call_create)
endif()
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
+add_dependencies(buildtests_cxx bm_channel)
+endif()
+if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx bm_chttp2_hpack)
endif()
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
@@ -539,6 +548,7 @@ add_dependencies(buildtests_cxx channel_arguments_test)
add_dependencies(buildtests_cxx channel_filter_test)
add_dependencies(buildtests_cxx channel_trace_test)
add_dependencies(buildtests_cxx channelz_registry_test)
+add_dependencies(buildtests_cxx channelz_test)
add_dependencies(buildtests_cxx check_gcp_environment_linux_test)
add_dependencies(buildtests_cxx check_gcp_environment_windows_test)
add_dependencies(buildtests_cxx chttp2_settings_timeout_test)
@@ -590,7 +600,6 @@ endif()
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx json_run_localhost)
endif()
-add_dependencies(buildtests_cxx lb_load_data_store_test)
add_dependencies(buildtests_cxx memory_test)
add_dependencies(buildtests_cxx metrics_client)
add_dependencies(buildtests_cxx mock_test)
@@ -663,6 +672,9 @@ endif()
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx address_sorting_test)
endif()
+if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
+add_dependencies(buildtests_cxx cancel_ares_query_test)
+endif()
add_custom_target(buildtests
DEPENDS buildtests_c buildtests_cxx)
@@ -697,9 +709,11 @@ target_include_directories(address_sorting
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(address_sorting
+ ${_gRPC_BASELIB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
)
@@ -742,6 +756,7 @@ target_include_directories(alts_test_util
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(alts_test_util
@@ -817,6 +832,7 @@ target_include_directories(gpr
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(gpr
@@ -905,6 +921,7 @@ target_include_directories(gpr_test_util
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(gpr_test_util
@@ -923,6 +940,7 @@ add_library(grpc
src/core/lib/channel/channel_stack.cc
src/core/lib/channel/channel_stack_builder.cc
src/core/lib/channel/channel_trace.cc
+ src/core/lib/channel/channelz.cc
src/core/lib/channel/channelz_registry.cc
src/core/lib/channel/connected_channel.cc
src/core/lib/channel/handshaker.cc
@@ -1199,19 +1217,20 @@ add_library(grpc
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc
src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc
+ src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c
+ src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c
src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
+ src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc
src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
- src/core/ext/filters/load_reporting/server_load_reporting_filter.cc
- src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc
- src/core/ext/census/grpc_context.cc
+ src/cpp/ext/filters/census/grpc_context.cc
src/core/ext/filters/max_age/max_age_filter.cc
src/core/ext/filters/message_size/message_size_filter.cc
src/core/ext/filters/http/client_authority_filter.cc
@@ -1242,6 +1261,7 @@ target_include_directories(grpc
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(grpc
@@ -1284,7 +1304,6 @@ foreach(_hdr
include/grpc/grpc.h
include/grpc/grpc_posix.h
include/grpc/grpc_security_constants.h
- include/grpc/load_reporting.h
include/grpc/slice.h
include/grpc/slice_buffer.h
include/grpc/status.h
@@ -1316,6 +1335,7 @@ add_library(grpc_cronet
src/core/lib/channel/channel_stack.cc
src/core/lib/channel/channel_stack_builder.cc
src/core/lib/channel/channel_trace.cc
+ src/core/lib/channel/channelz.cc
src/core/lib/channel/channelz_registry.cc
src/core/lib/channel/connected_channel.cc
src/core/lib/channel/handshaker.cc
@@ -1584,8 +1604,6 @@ add_library(grpc_cronet
src/core/tsi/ssl/session_cache/ssl_session_openssl.cc
src/core/tsi/ssl_transport_security.cc
src/core/tsi/transport_security_grpc.cc
- src/core/ext/filters/load_reporting/server_load_reporting_filter.cc
- src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc
src/core/plugin_registry/grpc_cronet_plugin_registry.cc
)
@@ -1611,6 +1629,7 @@ target_include_directories(grpc_cronet
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(grpc_cronet
@@ -1701,6 +1720,7 @@ add_library(grpc_test_util
src/core/lib/channel/channel_stack.cc
src/core/lib/channel/channel_stack_builder.cc
src/core/lib/channel/channel_trace.cc
+ src/core/lib/channel/channelz.cc
src/core/lib/channel/channelz_registry.cc
src/core/lib/channel/connected_channel.cc
src/core/lib/channel/handshaker.cc
@@ -1917,6 +1937,7 @@ target_include_directories(grpc_test_util
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(grpc_test_util
@@ -2005,6 +2026,7 @@ add_library(grpc_test_util_unsecure
src/core/lib/channel/channel_stack.cc
src/core/lib/channel/channel_stack_builder.cc
src/core/lib/channel/channel_trace.cc
+ src/core/lib/channel/channelz.cc
src/core/lib/channel/channelz_registry.cc
src/core/lib/channel/connected_channel.cc
src/core/lib/channel/handshaker.cc
@@ -2221,6 +2243,7 @@ target_include_directories(grpc_test_util_unsecure
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(grpc_test_util_unsecure
@@ -2288,6 +2311,7 @@ add_library(grpc_unsecure
src/core/lib/channel/channel_stack.cc
src/core/lib/channel/channel_stack_builder.cc
src/core/lib/channel/channel_trace.cc
+ src/core/lib/channel/channelz.cc
src/core/lib/channel/channelz_registry.cc
src/core/lib/channel/connected_channel.cc
src/core/lib/channel/handshaker.cc
@@ -2490,26 +2514,27 @@ add_library(grpc_unsecure
src/core/ext/transport/inproc/inproc_plugin.cc
src/core/ext/transport/inproc/inproc_transport.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
+ src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc
src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
- src/core/ext/filters/load_reporting/server_load_reporting_filter.cc
- src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc
src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc
src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc
+ src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c
+ src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c
src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c
third_party/nanopb/pb_common.c
third_party/nanopb/pb_decode.c
third_party/nanopb/pb_encode.c
src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
- src/core/ext/census/grpc_context.cc
+ src/cpp/ext/filters/census/grpc_context.cc
src/core/ext/filters/max_age/max_age_filter.cc
src/core/ext/filters/message_size/message_size_filter.cc
src/core/ext/filters/http/client_authority_filter.cc
@@ -2540,6 +2565,7 @@ target_include_directories(grpc_unsecure
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(grpc_unsecure
@@ -2580,7 +2606,6 @@ foreach(_hdr
include/grpc/grpc.h
include/grpc/grpc_posix.h
include/grpc/grpc_security_constants.h
- include/grpc/load_reporting.h
include/grpc/slice.h
include/grpc/slice_buffer.h
include/grpc/status.h
@@ -2631,6 +2656,7 @@ target_include_directories(reconnect_server
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(reconnect_server
@@ -2672,6 +2698,7 @@ target_include_directories(test_tcp_server
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(test_tcp_server
@@ -2752,6 +2779,7 @@ target_include_directories(grpc++
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE ${_gRPC_PROTO_GENS_DIR}
)
@@ -2894,7 +2922,6 @@ foreach(_hdr
include/grpc/grpc.h
include/grpc/grpc_posix.h
include/grpc/grpc_security_constants.h
- include/grpc/load_reporting.h
include/grpc/slice.h
include/grpc/slice_buffer.h
include/grpc/status.h
@@ -3026,6 +3053,7 @@ target_include_directories(grpc++_core_stats
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -3114,6 +3142,7 @@ add_library(grpc++_cronet
src/core/lib/channel/channel_stack.cc
src/core/lib/channel/channel_stack_builder.cc
src/core/lib/channel/channel_trace.cc
+ src/core/lib/channel/channelz.cc
src/core/lib/channel/channelz_registry.cc
src/core/lib/channel/connected_channel.cc
src/core/lib/channel/handshaker.cc
@@ -3287,10 +3316,7 @@ add_library(grpc++_cronet
src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc
src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
src/core/ext/transport/chttp2/server/chttp2_server.cc
- src/core/ext/census/grpc_context.cc
- third_party/nanopb/pb_common.c
- third_party/nanopb/pb_decode.c
- third_party/nanopb/pb_encode.c
+ src/cpp/ext/filters/census/grpc_context.cc
)
if(WIN32 AND MSVC)
@@ -3315,6 +3341,7 @@ target_include_directories(grpc++_cronet
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE ${_gRPC_PROTO_GENS_DIR}
)
@@ -3458,7 +3485,6 @@ foreach(_hdr
include/grpc/grpc.h
include/grpc/grpc_posix.h
include/grpc/grpc_security_constants.h
- include/grpc/load_reporting.h
include/grpc/slice.h
include/grpc/slice_buffer.h
include/grpc/status.h
@@ -3584,6 +3610,7 @@ target_include_directories(grpc++_error_details
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE ${_gRPC_PROTO_GENS_DIR}
)
@@ -3651,6 +3678,7 @@ target_include_directories(grpc++_proto_reflection_desc_db
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -3714,6 +3742,7 @@ target_include_directories(grpc++_reflection
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE ${_gRPC_PROTO_GENS_DIR}
)
@@ -3773,6 +3802,7 @@ target_include_directories(grpc++_test_config
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -3859,6 +3889,7 @@ target_include_directories(grpc++_test_util
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -4034,6 +4065,7 @@ target_include_directories(grpc++_test_util_unsecure
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -4210,6 +4242,7 @@ target_include_directories(grpc++_unsecure
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE ${_gRPC_PROTO_GENS_DIR}
)
@@ -4351,7 +4384,6 @@ foreach(_hdr
include/grpc/grpc.h
include/grpc/grpc_posix.h
include/grpc/grpc_security_constants.h
- include/grpc/load_reporting.h
include/grpc/slice.h
include/grpc/slice_buffer.h
include/grpc/status.h
@@ -4469,6 +4501,7 @@ target_include_directories(grpc_benchmark
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -4528,6 +4561,7 @@ target_include_directories(grpc_cli_libs
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -4589,6 +4623,7 @@ target_include_directories(grpc_plugin_support
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE ${_gRPC_PROTO_GENS_DIR}
)
@@ -4668,6 +4703,7 @@ target_include_directories(http2_client_main
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -4724,6 +4760,7 @@ target_include_directories(interop_client_helper
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -4795,6 +4832,7 @@ target_include_directories(interop_client_main
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -4846,6 +4884,7 @@ target_include_directories(interop_server_helper
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -4915,6 +4954,7 @@ target_include_directories(interop_server_lib
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -4966,6 +5006,7 @@ target_include_directories(interop_server_main
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -4983,49 +5024,6 @@ target_link_libraries(interop_server_main
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
-add_library(lb_load_data_store
- src/cpp/server/load_reporter/load_data_store.cc
-)
-
-if(WIN32 AND MSVC)
- set_target_properties(lb_load_data_store PROPERTIES COMPILE_PDB_NAME "lb_load_data_store"
- COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
- )
- if (gRPC_INSTALL)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lb_load_data_store.pdb
- DESTINATION ${gRPC_INSTALL_LIBDIR} OPTIONAL
- )
- endif()
-endif()
-
-
-target_include_directories(lb_load_data_store
- PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
- PRIVATE ${_gRPC_SSL_INCLUDE_DIR}
- PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR}
- PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR}
- PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR}
- PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
- PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
- PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- PRIVATE third_party/googletest/googletest/include
- PRIVATE third_party/googletest/googletest
- PRIVATE third_party/googletest/googlemock/include
- PRIVATE third_party/googletest/googlemock
- PRIVATE ${_gRPC_PROTO_GENS_DIR}
-)
-
-target_link_libraries(lb_load_data_store
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc++
-)
-
-
-endif (gRPC_BUILD_TESTS)
-if (gRPC_BUILD_TESTS)
-
if (gRPC_BUILD_CODEGEN)
add_library(qps
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/messages.pb.cc
@@ -5111,6 +5109,7 @@ target_include_directories(qps
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -5131,6 +5130,7 @@ target_link_libraries(qps
endif (gRPC_BUILD_CODEGEN)
endif (gRPC_BUILD_TESTS)
+if (gRPC_BUILD_CSHARP_EXT)
add_library(grpc_csharp_ext SHARED
src/csharp/ext/grpc_csharp_ext.c
@@ -5158,6 +5158,7 @@ target_include_directories(grpc_csharp_ext
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(grpc_csharp_ext
@@ -5176,6 +5177,7 @@ if (gRPC_INSTALL)
)
endif()
+endif (gRPC_BUILD_CSHARP_EXT)
if (gRPC_BUILD_TESTS)
add_library(bad_client_test
@@ -5204,6 +5206,7 @@ target_include_directories(bad_client_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(bad_client_test
@@ -5244,6 +5247,7 @@ target_include_directories(bad_ssl_test_server
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(bad_ssl_test_server
@@ -5274,6 +5278,7 @@ add_library(end2end_tests
test/core/end2end/tests/cancel_before_invoke.cc
test/core/end2end/tests/cancel_in_a_vacuum.cc
test/core/end2end/tests/cancel_with_status.cc
+ test/core/end2end/tests/channelz.cc
test/core/end2end/tests/compressed_payload.cc
test/core/end2end/tests/connectivity.cc
test/core/end2end/tests/default_host.cc
@@ -5290,13 +5295,13 @@ add_library(end2end_tests
test/core/end2end/tests/invoke_large_request.cc
test/core/end2end/tests/keepalive_timeout.cc
test/core/end2end/tests/large_metadata.cc
- test/core/end2end/tests/load_reporting_hook.cc
test/core/end2end/tests/max_concurrent_streams.cc
test/core/end2end/tests/max_connection_age.cc
test/core/end2end/tests/max_connection_idle.cc
test/core/end2end/tests/max_message_length.cc
test/core/end2end/tests/negative_deadline.cc
test/core/end2end/tests/network_status_change.cc
+ test/core/end2end/tests/no_error_on_hotpath.cc
test/core/end2end/tests/no_logging.cc
test/core/end2end/tests/no_op.cc
test/core/end2end/tests/payload.cc
@@ -5362,6 +5367,7 @@ target_include_directories(end2end_tests
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(end2end_tests
@@ -5392,6 +5398,7 @@ add_library(end2end_nosec_tests
test/core/end2end/tests/cancel_before_invoke.cc
test/core/end2end/tests/cancel_in_a_vacuum.cc
test/core/end2end/tests/cancel_with_status.cc
+ test/core/end2end/tests/channelz.cc
test/core/end2end/tests/compressed_payload.cc
test/core/end2end/tests/connectivity.cc
test/core/end2end/tests/default_host.cc
@@ -5408,13 +5415,13 @@ add_library(end2end_nosec_tests
test/core/end2end/tests/invoke_large_request.cc
test/core/end2end/tests/keepalive_timeout.cc
test/core/end2end/tests/large_metadata.cc
- test/core/end2end/tests/load_reporting_hook.cc
test/core/end2end/tests/max_concurrent_streams.cc
test/core/end2end/tests/max_connection_age.cc
test/core/end2end/tests/max_connection_idle.cc
test/core/end2end/tests/max_message_length.cc
test/core/end2end/tests/negative_deadline.cc
test/core/end2end/tests/network_status_change.cc
+ test/core/end2end/tests/no_error_on_hotpath.cc
test/core/end2end/tests/no_logging.cc
test/core/end2end/tests/no_op.cc
test/core/end2end/tests/payload.cc
@@ -5480,6 +5487,7 @@ target_include_directories(end2end_nosec_tests
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(end2end_nosec_tests
@@ -5510,6 +5518,7 @@ target_include_directories(algorithm_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(algorithm_test
@@ -5538,6 +5547,7 @@ target_include_directories(alloc_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(alloc_test
@@ -5564,6 +5574,7 @@ target_include_directories(alpn_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(alpn_test
@@ -5592,6 +5603,7 @@ target_include_directories(arena_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(arena_test
@@ -5618,6 +5630,7 @@ target_include_directories(avl_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(avl_test
@@ -5645,6 +5658,7 @@ target_include_directories(bad_server_response_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(bad_server_response_test
@@ -5674,6 +5688,7 @@ target_include_directories(bin_decoder_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(bin_decoder_test
@@ -5700,6 +5715,7 @@ target_include_directories(bin_encoder_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(bin_encoder_test
@@ -5726,6 +5742,7 @@ target_include_directories(channel_create_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(channel_create_test
@@ -5753,6 +5770,7 @@ target_include_directories(check_epollexclusive
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(check_epollexclusive
@@ -5778,6 +5796,7 @@ target_include_directories(chttp2_hpack_encoder_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(chttp2_hpack_encoder_test
@@ -5806,6 +5825,7 @@ target_include_directories(chttp2_stream_map_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(chttp2_stream_map_test
@@ -5834,6 +5854,7 @@ target_include_directories(chttp2_varint_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(chttp2_varint_test
@@ -5862,6 +5883,7 @@ target_include_directories(cmdline_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(cmdline_test
@@ -5889,6 +5911,7 @@ target_include_directories(combiner_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(combiner_test
@@ -5917,6 +5940,7 @@ target_include_directories(compression_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(compression_test
@@ -5945,6 +5969,7 @@ target_include_directories(concurrent_connectivity_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(concurrent_connectivity_test
@@ -5973,6 +5998,7 @@ target_include_directories(connection_refused_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(connection_refused_test
@@ -6001,6 +6027,7 @@ target_include_directories(dns_resolver_connectivity_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(dns_resolver_connectivity_test
@@ -6029,6 +6056,7 @@ target_include_directories(dns_resolver_cooldown_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(dns_resolver_cooldown_test
@@ -6057,6 +6085,7 @@ target_include_directories(dns_resolver_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(dns_resolver_test
@@ -6086,6 +6115,7 @@ target_include_directories(dualstack_socket_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(dualstack_socket_test
@@ -6115,6 +6145,7 @@ target_include_directories(endpoint_pair_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(endpoint_pair_test
@@ -6143,6 +6174,7 @@ target_include_directories(error_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(error_test
@@ -6157,6 +6189,37 @@ endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX)
+add_executable(ev_epollex_linux_test
+ test/core/iomgr/ev_epollex_linux_test.cc
+)
+
+
+target_include_directories(ev_epollex_linux_test
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
+ PRIVATE ${_gRPC_SSL_INCLUDE_DIR}
+ PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR}
+ PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR}
+ PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR}
+ PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
+ PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
+ PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
+)
+
+target_link_libraries(ev_epollex_linux_test
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+ grpc
+ gpr_test_util
+ gpr
+)
+
+endif()
+endif (gRPC_BUILD_TESTS)
+if (gRPC_BUILD_TESTS)
+if(_gRPC_PLATFORM_LINUX)
+
add_executable(ev_epollsig_linux_test
test/core/iomgr/ev_epollsig_linux_test.cc
)
@@ -6172,6 +6235,7 @@ target_include_directories(ev_epollsig_linux_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(ev_epollsig_linux_test
@@ -6201,6 +6265,7 @@ target_include_directories(fake_resolver_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(fake_resolver_test
@@ -6231,6 +6296,7 @@ target_include_directories(fake_transport_security_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(fake_transport_security_test
@@ -6260,6 +6326,7 @@ target_include_directories(fd_conservation_posix_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(fd_conservation_posix_test
@@ -6290,6 +6357,7 @@ target_include_directories(fd_posix_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(fd_posix_test
@@ -6319,6 +6387,7 @@ target_include_directories(fling_client
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(fling_client
@@ -6347,6 +6416,7 @@ target_include_directories(fling_server
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(fling_server
@@ -6376,6 +6446,7 @@ target_include_directories(fling_stream_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(fling_stream_test
@@ -6406,6 +6477,7 @@ target_include_directories(fling_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(fling_test
@@ -6436,6 +6508,7 @@ target_include_directories(fork_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(fork_test
@@ -6464,6 +6537,7 @@ target_include_directories(goaway_server_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(goaway_server_test
@@ -6493,6 +6567,7 @@ target_include_directories(gpr_cpu_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(gpr_cpu_test
@@ -6519,6 +6594,7 @@ target_include_directories(gpr_env_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(gpr_env_test
@@ -6545,6 +6621,7 @@ target_include_directories(gpr_host_port_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(gpr_host_port_test
@@ -6571,6 +6648,7 @@ target_include_directories(gpr_log_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(gpr_log_test
@@ -6597,6 +6675,7 @@ target_include_directories(gpr_manual_constructor_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(gpr_manual_constructor_test
@@ -6623,6 +6702,7 @@ target_include_directories(gpr_mpscq_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(gpr_mpscq_test
@@ -6649,6 +6729,7 @@ target_include_directories(gpr_spinlock_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(gpr_spinlock_test
@@ -6675,6 +6756,7 @@ target_include_directories(gpr_string_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(gpr_string_test
@@ -6701,6 +6783,7 @@ target_include_directories(gpr_sync_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(gpr_sync_test
@@ -6727,6 +6810,7 @@ target_include_directories(gpr_thd_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(gpr_thd_test
@@ -6753,6 +6837,7 @@ target_include_directories(gpr_time_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(gpr_time_test
@@ -6779,6 +6864,7 @@ target_include_directories(gpr_tls_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(gpr_tls_test
@@ -6805,6 +6891,7 @@ target_include_directories(gpr_useful_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(gpr_useful_test
@@ -6831,6 +6918,7 @@ target_include_directories(grpc_auth_context_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(grpc_auth_context_test
@@ -6859,6 +6947,7 @@ target_include_directories(grpc_b64_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(grpc_b64_test
@@ -6887,6 +6976,7 @@ target_include_directories(grpc_byte_buffer_reader_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(grpc_byte_buffer_reader_test
@@ -6915,6 +7005,7 @@ target_include_directories(grpc_channel_args_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(grpc_channel_args_test
@@ -6943,6 +7034,7 @@ target_include_directories(grpc_channel_stack_builder_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(grpc_channel_stack_builder_test
@@ -6971,6 +7063,7 @@ target_include_directories(grpc_channel_stack_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(grpc_channel_stack_test
@@ -6999,6 +7092,7 @@ target_include_directories(grpc_completion_queue_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(grpc_completion_queue_test
@@ -7027,6 +7121,7 @@ target_include_directories(grpc_completion_queue_threading_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(grpc_completion_queue_threading_test
@@ -7055,6 +7150,7 @@ target_include_directories(grpc_create_jwt
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(grpc_create_jwt
@@ -7081,6 +7177,7 @@ target_include_directories(grpc_credentials_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(grpc_credentials_test
@@ -7109,6 +7206,7 @@ target_include_directories(grpc_fetch_oauth2
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(grpc_fetch_oauth2
@@ -7138,6 +7236,7 @@ target_include_directories(grpc_json_token_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(grpc_json_token_test
@@ -7167,6 +7266,7 @@ target_include_directories(grpc_jwt_verifier_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(grpc_jwt_verifier_test
@@ -7195,6 +7295,7 @@ target_include_directories(grpc_print_google_default_creds_token
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(grpc_print_google_default_creds_token
@@ -7220,6 +7321,7 @@ target_include_directories(grpc_security_connector_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(grpc_security_connector_test
@@ -7248,6 +7350,7 @@ target_include_directories(grpc_ssl_credentials_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(grpc_ssl_credentials_test
@@ -7276,6 +7379,7 @@ target_include_directories(grpc_verify_jwt
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(grpc_verify_jwt
@@ -7302,6 +7406,7 @@ target_include_directories(handshake_client
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(handshake_client
@@ -7334,6 +7439,7 @@ target_include_directories(handshake_server
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(handshake_server
@@ -7366,6 +7472,7 @@ target_include_directories(handshake_server_with_readahead_handshaker
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(handshake_server_with_readahead_handshaker
@@ -7380,6 +7487,38 @@ target_link_libraries(handshake_server_with_readahead_handshaker
endif()
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
+if(_gRPC_PLATFORM_LINUX)
+
+add_executable(handshake_verify_peer_options
+ test/core/handshake/verify_peer_options.cc
+)
+
+
+target_include_directories(handshake_verify_peer_options
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
+ PRIVATE ${_gRPC_SSL_INCLUDE_DIR}
+ PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR}
+ PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR}
+ PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR}
+ PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
+ PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
+ PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
+)
+
+target_link_libraries(handshake_verify_peer_options
+ ${_gRPC_SSL_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+ grpc
+ gpr_test_util
+ gpr
+)
+
+endif()
+endif (gRPC_BUILD_TESTS)
+if (gRPC_BUILD_TESTS)
add_executable(histogram_test
test/core/util/histogram_test.cc
@@ -7396,6 +7535,7 @@ target_include_directories(histogram_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(histogram_test
@@ -7422,6 +7562,7 @@ target_include_directories(hpack_parser_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(hpack_parser_test
@@ -7450,6 +7591,7 @@ target_include_directories(hpack_table_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(hpack_table_test
@@ -7478,6 +7620,7 @@ target_include_directories(http_parser_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(http_parser_test
@@ -7506,6 +7649,7 @@ target_include_directories(httpcli_format_request_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(httpcli_format_request_test
@@ -7535,6 +7679,7 @@ target_include_directories(httpcli_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(httpcli_test
@@ -7565,6 +7710,7 @@ target_include_directories(httpscli_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(httpscli_test
@@ -7594,6 +7740,7 @@ target_include_directories(init_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(init_test
@@ -7622,6 +7769,7 @@ target_include_directories(invalid_call_argument_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(invalid_call_argument_test
@@ -7650,6 +7798,7 @@ target_include_directories(json_rewrite
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(json_rewrite
@@ -7678,6 +7827,7 @@ target_include_directories(json_rewrite_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(json_rewrite_test
@@ -7706,6 +7856,7 @@ target_include_directories(json_stream_error_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(json_stream_error_test
@@ -7734,6 +7885,7 @@ target_include_directories(json_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(json_test
@@ -7762,6 +7914,7 @@ target_include_directories(lame_client_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(lame_client_test
@@ -7790,6 +7943,7 @@ target_include_directories(load_file_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(load_file_test
@@ -7818,6 +7972,7 @@ target_include_directories(memory_profile_client
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(memory_profile_client
@@ -7846,6 +8001,7 @@ target_include_directories(memory_profile_server
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(memory_profile_server
@@ -7875,6 +8031,7 @@ target_include_directories(memory_profile_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(memory_profile_test
@@ -7904,6 +8061,7 @@ target_include_directories(message_compress_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(message_compress_test
@@ -7932,6 +8090,7 @@ target_include_directories(minimal_stack_is_minimal_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(minimal_stack_is_minimal_test
@@ -7960,6 +8119,7 @@ target_include_directories(multiple_server_queues_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(multiple_server_queues_test
@@ -7988,6 +8148,7 @@ target_include_directories(murmur_hash_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(murmur_hash_test
@@ -8014,6 +8175,7 @@ target_include_directories(no_server_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(no_server_test
@@ -8042,6 +8204,7 @@ target_include_directories(num_external_connectivity_watchers_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(num_external_connectivity_watchers_test
@@ -8070,6 +8233,7 @@ target_include_directories(parse_address_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(parse_address_test
@@ -8098,6 +8262,7 @@ target_include_directories(percent_encoding_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(percent_encoding_test
@@ -8127,6 +8292,7 @@ target_include_directories(pollset_set_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(pollset_set_test
@@ -8157,6 +8323,7 @@ target_include_directories(resolve_address_posix_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(resolve_address_posix_test
@@ -8186,6 +8353,7 @@ target_include_directories(resolve_address_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(resolve_address_test
@@ -8214,6 +8382,7 @@ target_include_directories(resource_quota_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(resource_quota_test
@@ -8242,6 +8411,7 @@ target_include_directories(secure_channel_create_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(secure_channel_create_test
@@ -8270,6 +8440,7 @@ target_include_directories(secure_endpoint_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(secure_endpoint_test
@@ -8298,6 +8469,7 @@ target_include_directories(sequential_connectivity_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(sequential_connectivity_test
@@ -8326,6 +8498,7 @@ target_include_directories(server_chttp2_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(server_chttp2_test
@@ -8354,6 +8527,7 @@ target_include_directories(server_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(server_test
@@ -8382,6 +8556,7 @@ target_include_directories(slice_buffer_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(slice_buffer_test
@@ -8410,6 +8585,7 @@ target_include_directories(slice_string_helpers_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(slice_string_helpers_test
@@ -8438,6 +8614,7 @@ target_include_directories(slice_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(slice_test
@@ -8466,6 +8643,7 @@ target_include_directories(sockaddr_resolver_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(sockaddr_resolver_test
@@ -8494,6 +8672,7 @@ target_include_directories(sockaddr_utils_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(sockaddr_utils_test
@@ -8523,6 +8702,7 @@ target_include_directories(socket_utils_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(socket_utils_test
@@ -8554,6 +8734,7 @@ target_include_directories(ssl_transport_security_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(ssl_transport_security_test
@@ -8582,6 +8763,7 @@ target_include_directories(status_conversion_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(status_conversion_test
@@ -8610,6 +8792,7 @@ target_include_directories(stream_compression_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(stream_compression_test
@@ -8638,6 +8821,7 @@ target_include_directories(stream_owned_slice_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(stream_owned_slice_test
@@ -8667,6 +8851,7 @@ target_include_directories(tcp_client_posix_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(tcp_client_posix_test
@@ -8696,6 +8881,7 @@ target_include_directories(tcp_client_uv_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(tcp_client_uv_test
@@ -8725,6 +8911,7 @@ target_include_directories(tcp_posix_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(tcp_posix_test
@@ -8755,6 +8942,7 @@ target_include_directories(tcp_server_posix_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(tcp_server_posix_test
@@ -8784,6 +8972,7 @@ target_include_directories(tcp_server_uv_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(tcp_server_uv_test
@@ -8812,6 +9001,7 @@ target_include_directories(time_averaged_stats_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(time_averaged_stats_test
@@ -8840,6 +9030,7 @@ target_include_directories(timeout_encoding_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(timeout_encoding_test
@@ -8868,6 +9059,7 @@ target_include_directories(timer_heap_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(timer_heap_test
@@ -8896,6 +9088,7 @@ target_include_directories(timer_list_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(timer_list_test
@@ -8924,6 +9117,7 @@ target_include_directories(transport_connectivity_state_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(transport_connectivity_state_test
@@ -8952,6 +9146,7 @@ target_include_directories(transport_metadata_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(transport_metadata_test
@@ -8981,6 +9176,7 @@ target_include_directories(transport_security_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(transport_security_test
@@ -9011,6 +9207,7 @@ target_include_directories(udp_server_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(udp_server_test
@@ -9040,6 +9237,7 @@ target_include_directories(uri_parser_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(uri_parser_test
@@ -9069,6 +9267,7 @@ target_include_directories(wakeup_fd_cv_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(wakeup_fd_cv_test
@@ -9100,6 +9299,7 @@ target_include_directories(alarm_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -9139,6 +9339,7 @@ target_include_directories(alts_counter_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -9175,6 +9376,7 @@ target_include_directories(alts_crypt_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -9212,6 +9414,7 @@ target_include_directories(alts_crypter_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -9248,6 +9451,7 @@ target_include_directories(alts_frame_handler_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -9285,6 +9489,7 @@ target_include_directories(alts_frame_protector_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -9321,6 +9526,7 @@ target_include_directories(alts_grpc_record_protocol_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -9357,6 +9563,7 @@ target_include_directories(alts_handshaker_client_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -9393,6 +9600,7 @@ target_include_directories(alts_handshaker_service_api_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -9429,6 +9637,7 @@ target_include_directories(alts_iovec_record_protocol_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -9465,6 +9674,7 @@ target_include_directories(alts_security_connector_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -9500,6 +9710,7 @@ target_include_directories(alts_tsi_handshaker_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -9536,6 +9747,7 @@ target_include_directories(alts_tsi_utils_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -9572,6 +9784,7 @@ target_include_directories(alts_zero_copy_grpc_protector_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -9608,6 +9821,7 @@ target_include_directories(async_end2end_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -9647,6 +9861,7 @@ target_include_directories(auth_property_iterator_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -9686,6 +9901,7 @@ target_include_directories(backoff_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -9723,6 +9939,7 @@ target_include_directories(bdp_estimator_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -9763,6 +9980,7 @@ target_include_directories(bm_arena
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -9807,6 +10025,7 @@ target_include_directories(bm_call_create
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -9834,6 +10053,51 @@ endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
+add_executable(bm_channel
+ test/cpp/microbenchmarks/bm_channel.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+
+target_include_directories(bm_channel
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
+ PRIVATE ${_gRPC_SSL_INCLUDE_DIR}
+ PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR}
+ PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR}
+ PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR}
+ PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
+ PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
+ PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
+ PRIVATE third_party/googletest/googletest/include
+ PRIVATE third_party/googletest/googletest
+ PRIVATE third_party/googletest/googlemock/include
+ PRIVATE third_party/googletest/googlemock
+ PRIVATE ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(bm_channel
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_benchmark
+ ${_gRPC_BENCHMARK_LIBRARIES}
+ grpc++_test_util_unsecure
+ grpc_test_util_unsecure
+ grpc++_unsecure
+ grpc_unsecure
+ gpr_test_util
+ gpr
+ grpc++_test_config
+ ${_gRPC_GFLAGS_LIBRARIES}
+)
+
+endif()
+endif (gRPC_BUILD_TESTS)
+if (gRPC_BUILD_TESTS)
+if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
+
add_executable(bm_chttp2_hpack
test/cpp/microbenchmarks/bm_chttp2_hpack.cc
third_party/googletest/googletest/src/gtest-all.cc
@@ -9851,6 +10115,7 @@ target_include_directories(bm_chttp2_hpack
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -9895,6 +10160,7 @@ target_include_directories(bm_chttp2_transport
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -9939,6 +10205,7 @@ target_include_directories(bm_closure
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -9983,6 +10250,7 @@ target_include_directories(bm_cq
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -10027,6 +10295,7 @@ target_include_directories(bm_cq_multiple_threads
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -10071,6 +10340,7 @@ target_include_directories(bm_error
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -10115,6 +10385,7 @@ target_include_directories(bm_fullstack_streaming_ping_pong
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -10159,6 +10430,7 @@ target_include_directories(bm_fullstack_streaming_pump
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -10203,6 +10475,7 @@ target_include_directories(bm_fullstack_trickle
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -10247,6 +10520,7 @@ target_include_directories(bm_fullstack_unary_ping_pong
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -10291,6 +10565,7 @@ target_include_directories(bm_metadata
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -10335,6 +10610,7 @@ target_include_directories(bm_pollset
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -10378,6 +10654,7 @@ target_include_directories(byte_stream_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -10415,6 +10692,7 @@ target_include_directories(channel_arguments_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -10451,6 +10729,7 @@ target_include_directories(channel_filter_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -10494,6 +10773,7 @@ target_include_directories(channel_trace_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -10533,6 +10813,7 @@ target_include_directories(channelz_registry_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -10555,6 +10836,53 @@ target_link_libraries(channelz_registry_test
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
+add_executable(channelz_test
+ test/core/channel/channelz_test.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.grpc.pb.h
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+protobuf_generate_grpc_cpp(
+ src/proto/grpc/channelz/channelz.proto
+)
+
+target_include_directories(channelz_test
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
+ PRIVATE ${_gRPC_SSL_INCLUDE_DIR}
+ PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR}
+ PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR}
+ PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR}
+ PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
+ PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
+ PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
+ PRIVATE third_party/googletest/googletest/include
+ PRIVATE third_party/googletest/googletest
+ PRIVATE third_party/googletest/googlemock/include
+ PRIVATE third_party/googletest/googlemock
+ PRIVATE ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(channelz_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+ grpc++_test_util
+ grpc++
+ grpc
+ gpr_test_util
+ gpr
+ ${_gRPC_GFLAGS_LIBRARIES}
+)
+
+endif (gRPC_BUILD_TESTS)
+if (gRPC_BUILD_TESTS)
+
add_executable(check_gcp_environment_linux_test
test/core/security/check_gcp_environment_linux_test.cc
third_party/googletest/googletest/src/gtest-all.cc
@@ -10572,6 +10900,7 @@ target_include_directories(check_gcp_environment_linux_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -10607,6 +10936,7 @@ target_include_directories(check_gcp_environment_windows_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -10642,6 +10972,7 @@ target_include_directories(chttp2_settings_timeout_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -10679,6 +11010,7 @@ target_include_directories(cli_call_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -10726,6 +11058,7 @@ target_include_directories(client_channel_stress_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -10766,6 +11099,7 @@ target_include_directories(client_crash_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -10806,6 +11140,7 @@ target_include_directories(client_crash_test_server
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -10845,6 +11180,7 @@ target_include_directories(client_lb_end2end_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -10933,6 +11269,7 @@ target_include_directories(codegen_test_full
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -11020,6 +11357,7 @@ target_include_directories(codegen_test_minimal
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -11056,6 +11394,7 @@ target_include_directories(credentials_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -11092,6 +11431,7 @@ target_include_directories(cxx_byte_buffer_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -11130,6 +11470,7 @@ target_include_directories(cxx_slice_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -11168,6 +11509,7 @@ target_include_directories(cxx_string_ref_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -11203,6 +11545,7 @@ target_include_directories(cxx_time_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -11241,6 +11584,7 @@ target_include_directories(end2end_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -11287,6 +11631,7 @@ target_include_directories(error_details_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -11322,6 +11667,7 @@ target_include_directories(exception_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -11361,6 +11707,7 @@ target_include_directories(filter_end2end_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -11400,6 +11747,7 @@ target_include_directories(generic_end2end_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -11446,6 +11794,7 @@ target_include_directories(golden_file_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -11482,6 +11831,7 @@ target_include_directories(grpc_alts_credentials_options_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -11517,6 +11867,7 @@ target_include_directories(grpc_cli
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -11554,6 +11905,7 @@ target_include_directories(grpc_cpp_plugin
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE ${_gRPC_PROTO_GENS_DIR}
)
@@ -11591,6 +11943,7 @@ target_include_directories(grpc_csharp_plugin
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE ${_gRPC_PROTO_GENS_DIR}
)
@@ -11628,6 +11981,7 @@ target_include_directories(grpc_node_plugin
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE ${_gRPC_PROTO_GENS_DIR}
)
@@ -11665,6 +12019,7 @@ target_include_directories(grpc_objective_c_plugin
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE ${_gRPC_PROTO_GENS_DIR}
)
@@ -11702,6 +12057,7 @@ target_include_directories(grpc_php_plugin
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE ${_gRPC_PROTO_GENS_DIR}
)
@@ -11739,6 +12095,7 @@ target_include_directories(grpc_python_plugin
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE ${_gRPC_PROTO_GENS_DIR}
)
@@ -11776,6 +12133,7 @@ target_include_directories(grpc_ruby_plugin
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE ${_gRPC_PROTO_GENS_DIR}
)
@@ -11829,6 +12187,7 @@ target_include_directories(grpc_tool_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -11878,6 +12237,7 @@ target_include_directories(grpclb_api_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -11922,6 +12282,7 @@ target_include_directories(grpclb_end2end_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -11961,6 +12322,7 @@ target_include_directories(h2_ssl_cert_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -11999,6 +12361,7 @@ target_include_directories(h2_ssl_session_reuse_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -12037,6 +12400,7 @@ target_include_directories(health_service_end2end_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -12076,6 +12440,7 @@ target_include_directories(http2_client
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -12116,6 +12481,7 @@ target_include_directories(hybrid_end2end_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -12155,6 +12521,7 @@ target_include_directories(inlined_vector_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -12194,6 +12561,7 @@ target_include_directories(inproc_sync_unary_ping_pong_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -12237,6 +12605,7 @@ target_include_directories(interop_client
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -12280,6 +12649,7 @@ target_include_directories(interop_server
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -12325,6 +12695,7 @@ target_include_directories(interop_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -12365,6 +12736,7 @@ target_include_directories(json_run_localhost
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -12389,46 +12761,6 @@ endif()
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
-add_executable(lb_load_data_store_test
- test/cpp/server/load_reporter/load_data_store_test.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
-)
-
-
-target_include_directories(lb_load_data_store_test
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
- PRIVATE ${_gRPC_SSL_INCLUDE_DIR}
- PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR}
- PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR}
- PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR}
- PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
- PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
- PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- PRIVATE third_party/googletest/googletest/include
- PRIVATE third_party/googletest/googletest
- PRIVATE third_party/googletest/googlemock/include
- PRIVATE third_party/googletest/googlemock
- PRIVATE ${_gRPC_PROTO_GENS_DIR}
-)
-
-target_link_libraries(lb_load_data_store_test
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- lb_load_data_store
- grpc++_test_util
- grpc_test_util
- grpc++
- grpc
- gpr_test_util
- gpr
- ${_gRPC_GFLAGS_LIBRARIES}
-)
-
-endif (gRPC_BUILD_TESTS)
-if (gRPC_BUILD_TESTS)
-
add_executable(memory_test
test/core/gprpp/memory_test.cc
third_party/googletest/googletest/src/gtest-all.cc
@@ -12446,6 +12778,7 @@ target_include_directories(memory_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -12491,6 +12824,7 @@ target_include_directories(metrics_client
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -12528,6 +12862,7 @@ target_include_directories(mock_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -12567,6 +12902,7 @@ target_include_directories(nonblocking_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -12606,6 +12942,7 @@ target_include_directories(noop-benchmark
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -12640,6 +12977,7 @@ target_include_directories(orphanable_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -12678,6 +13016,7 @@ target_include_directories(proto_server_reflection_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -12719,6 +13058,7 @@ target_include_directories(proto_utils_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -12755,6 +13095,7 @@ target_include_directories(qps_interarrival_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -12797,6 +13138,7 @@ target_include_directories(qps_json_driver
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -12840,6 +13182,7 @@ target_include_directories(qps_openloop_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -12883,6 +13226,7 @@ target_include_directories(qps_worker
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -12946,6 +13290,7 @@ target_include_directories(reconnect_interop_client
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -13007,6 +13352,7 @@ target_include_directories(reconnect_interop_server
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -13049,6 +13395,7 @@ target_include_directories(ref_counted_ptr_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -13087,6 +13434,7 @@ target_include_directories(ref_counted_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -13125,6 +13473,7 @@ target_include_directories(retry_throttle_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -13162,6 +13511,7 @@ target_include_directories(secure_auth_context_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -13202,6 +13552,7 @@ target_include_directories(secure_sync_unary_ping_pong_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -13245,6 +13596,7 @@ target_include_directories(server_builder_plugin_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -13298,6 +13650,7 @@ target_include_directories(server_builder_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -13352,6 +13705,7 @@ target_include_directories(server_builder_with_socket_mutator_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -13392,6 +13746,7 @@ target_include_directories(server_context_test_spouse_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -13431,6 +13786,7 @@ target_include_directories(server_crash_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -13471,6 +13827,7 @@ target_include_directories(server_crash_test_client
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -13510,6 +13867,7 @@ target_include_directories(server_early_return_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -13563,6 +13921,7 @@ target_include_directories(server_request_call_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -13602,6 +13961,7 @@ target_include_directories(shutdown_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -13641,6 +14001,7 @@ target_include_directories(slice_hash_table_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -13678,6 +14039,7 @@ target_include_directories(slice_weak_hash_table_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -13715,6 +14077,7 @@ target_include_directories(stats_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -13753,6 +14116,7 @@ target_include_directories(status_metadata_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -13787,6 +14151,7 @@ target_include_directories(status_util_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -13822,6 +14187,7 @@ target_include_directories(streaming_throughput_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -13893,6 +14259,7 @@ target_include_directories(stress_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -13933,6 +14300,7 @@ target_include_directories(thread_manager_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -13970,6 +14338,7 @@ target_include_directories(thread_stress_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -14009,6 +14378,7 @@ target_include_directories(transport_pid_controller_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -14048,6 +14418,7 @@ target_include_directories(transport_security_common_api_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -14085,6 +14456,7 @@ target_include_directories(writes_per_rpc_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -14123,6 +14495,7 @@ target_include_directories(public_headers_must_be_c89
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(public_headers_must_be_c89
@@ -14148,6 +14521,7 @@ target_include_directories(gen_hpack_tables
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(gen_hpack_tables
@@ -14172,6 +14546,7 @@ target_include_directories(gen_legal_metadata_characters
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(gen_legal_metadata_characters
@@ -14194,6 +14569,7 @@ target_include_directories(gen_percent_encoding_tables
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(gen_percent_encoding_tables
@@ -14217,6 +14593,7 @@ target_include_directories(badreq_bad_client_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(badreq_bad_client_test
@@ -14247,6 +14624,7 @@ target_include_directories(connection_prefix_bad_client_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(connection_prefix_bad_client_test
@@ -14277,6 +14655,7 @@ target_include_directories(duplicate_header_bad_client_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(duplicate_header_bad_client_test
@@ -14307,6 +14686,7 @@ target_include_directories(head_of_line_blocking_bad_client_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(head_of_line_blocking_bad_client_test
@@ -14337,6 +14717,7 @@ target_include_directories(headers_bad_client_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(headers_bad_client_test
@@ -14367,6 +14748,7 @@ target_include_directories(initial_settings_frame_bad_client_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(initial_settings_frame_bad_client_test
@@ -14397,6 +14779,7 @@ target_include_directories(large_metadata_bad_client_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(large_metadata_bad_client_test
@@ -14427,6 +14810,7 @@ target_include_directories(server_registered_method_bad_client_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(server_registered_method_bad_client_test
@@ -14457,6 +14841,7 @@ target_include_directories(simple_request_bad_client_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(simple_request_bad_client_test
@@ -14487,6 +14872,7 @@ target_include_directories(unknown_frame_bad_client_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(unknown_frame_bad_client_test
@@ -14517,6 +14903,7 @@ target_include_directories(window_overflow_bad_client_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(window_overflow_bad_client_test
@@ -14548,6 +14935,7 @@ target_include_directories(bad_ssl_cert_server
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(bad_ssl_cert_server
@@ -14579,6 +14967,7 @@ target_include_directories(bad_ssl_cert_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(bad_ssl_cert_test
@@ -14608,6 +14997,7 @@ target_include_directories(h2_census_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_census_test
@@ -14637,6 +15027,7 @@ target_include_directories(h2_compress_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_compress_test
@@ -14666,6 +15057,7 @@ target_include_directories(h2_fakesec_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_fakesec_test
@@ -14696,6 +15088,7 @@ target_include_directories(h2_fd_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_fd_test
@@ -14726,6 +15119,7 @@ target_include_directories(h2_full_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_full_test
@@ -14756,6 +15150,7 @@ target_include_directories(h2_full+pipe_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_full+pipe_test
@@ -14786,6 +15181,7 @@ target_include_directories(h2_full+trace_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_full+trace_test
@@ -14815,6 +15211,7 @@ target_include_directories(h2_full+workarounds_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_full+workarounds_test
@@ -14844,6 +15241,7 @@ target_include_directories(h2_http_proxy_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_http_proxy_test
@@ -14858,35 +15256,6 @@ target_link_libraries(h2_http_proxy_test
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
-add_executable(h2_load_reporting_test
- test/core/end2end/fixtures/h2_load_reporting.cc
-)
-
-
-target_include_directories(h2_load_reporting_test
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
- PRIVATE ${_gRPC_SSL_INCLUDE_DIR}
- PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR}
- PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR}
- PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR}
- PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
- PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
- PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
-)
-
-target_link_libraries(h2_load_reporting_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- end2end_tests
- grpc_test_util
- grpc
- gpr_test_util
- gpr
-)
-
-endif (gRPC_BUILD_TESTS)
-if (gRPC_BUILD_TESTS)
-
add_executable(h2_oauth2_test
test/core/end2end/fixtures/h2_oauth2.cc
)
@@ -14902,6 +15271,7 @@ target_include_directories(h2_oauth2_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_oauth2_test
@@ -14931,6 +15301,7 @@ target_include_directories(h2_proxy_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_proxy_test
@@ -14960,6 +15331,7 @@ target_include_directories(h2_sockpair_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_sockpair_test
@@ -14989,6 +15361,7 @@ target_include_directories(h2_sockpair+trace_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_sockpair+trace_test
@@ -15018,6 +15391,7 @@ target_include_directories(h2_sockpair_1byte_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_sockpair_1byte_test
@@ -15047,6 +15421,7 @@ target_include_directories(h2_ssl_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_ssl_test
@@ -15076,6 +15451,7 @@ target_include_directories(h2_ssl_proxy_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_ssl_proxy_test
@@ -15106,6 +15482,7 @@ target_include_directories(h2_uds_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_uds_test
@@ -15136,6 +15513,7 @@ target_include_directories(inproc_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(inproc_test
@@ -15165,6 +15543,7 @@ target_include_directories(h2_census_nosec_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_census_nosec_test
@@ -15194,6 +15573,7 @@ target_include_directories(h2_compress_nosec_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_compress_nosec_test
@@ -15224,6 +15604,7 @@ target_include_directories(h2_fd_nosec_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_fd_nosec_test
@@ -15254,6 +15635,7 @@ target_include_directories(h2_full_nosec_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_full_nosec_test
@@ -15284,6 +15666,7 @@ target_include_directories(h2_full+pipe_nosec_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_full+pipe_nosec_test
@@ -15314,6 +15697,7 @@ target_include_directories(h2_full+trace_nosec_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_full+trace_nosec_test
@@ -15343,6 +15727,7 @@ target_include_directories(h2_full+workarounds_nosec_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_full+workarounds_nosec_test
@@ -15372,6 +15757,7 @@ target_include_directories(h2_http_proxy_nosec_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_http_proxy_nosec_test
@@ -15386,35 +15772,6 @@ target_link_libraries(h2_http_proxy_nosec_test
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
-add_executable(h2_load_reporting_nosec_test
- test/core/end2end/fixtures/h2_load_reporting.cc
-)
-
-
-target_include_directories(h2_load_reporting_nosec_test
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
- PRIVATE ${_gRPC_SSL_INCLUDE_DIR}
- PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR}
- PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR}
- PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR}
- PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
- PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
- PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
-)
-
-target_link_libraries(h2_load_reporting_nosec_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- end2end_nosec_tests
- grpc_test_util_unsecure
- grpc_unsecure
- gpr_test_util
- gpr
-)
-
-endif (gRPC_BUILD_TESTS)
-if (gRPC_BUILD_TESTS)
-
add_executable(h2_proxy_nosec_test
test/core/end2end/fixtures/h2_proxy.cc
)
@@ -15430,6 +15787,7 @@ target_include_directories(h2_proxy_nosec_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_proxy_nosec_test
@@ -15459,6 +15817,7 @@ target_include_directories(h2_sockpair_nosec_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_sockpair_nosec_test
@@ -15488,6 +15847,7 @@ target_include_directories(h2_sockpair+trace_nosec_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_sockpair+trace_nosec_test
@@ -15517,6 +15877,7 @@ target_include_directories(h2_sockpair_1byte_nosec_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_sockpair_1byte_nosec_test
@@ -15547,6 +15908,7 @@ target_include_directories(h2_uds_nosec_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(h2_uds_nosec_test
@@ -15577,6 +15939,7 @@ target_include_directories(inproc_nosec_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(inproc_nosec_test
@@ -15609,6 +15972,7 @@ target_include_directories(resolver_component_test_unsecure
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -15651,6 +16015,7 @@ target_include_directories(resolver_component_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -15693,6 +16058,7 @@ target_include_directories(resolver_component_tests_runner_invoker_unsecure
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -15735,6 +16101,7 @@ target_include_directories(resolver_component_tests_runner_invoker
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -15777,6 +16144,7 @@ target_include_directories(address_sorting_test_unsecure
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -15819,6 +16187,7 @@ target_include_directories(address_sorting_test
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
@@ -15842,6 +16211,49 @@ target_link_libraries(address_sorting_test
endif()
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
+if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
+
+add_executable(cancel_ares_query_test
+ test/cpp/naming/cancel_ares_query_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+
+target_include_directories(cancel_ares_query_test
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
+ PRIVATE ${_gRPC_SSL_INCLUDE_DIR}
+ PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR}
+ PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR}
+ PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR}
+ PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
+ PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
+ PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
+ PRIVATE third_party/googletest/googletest/include
+ PRIVATE third_party/googletest/googletest
+ PRIVATE third_party/googletest/googlemock/include
+ PRIVATE third_party/googletest/googlemock
+ PRIVATE ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(cancel_ares_query_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc++_test_util
+ grpc_test_util
+ gpr_test_util
+ grpc++
+ grpc
+ gpr
+ grpc++_test_config
+ ${_gRPC_GFLAGS_LIBRARIES}
+)
+
+endif()
+endif (gRPC_BUILD_TESTS)
+if (gRPC_BUILD_TESTS)
add_executable(alts_credentials_fuzzer_one_entry
test/core/security/alts_credentials_fuzzer.cc
@@ -15859,6 +16271,7 @@ target_include_directories(alts_credentials_fuzzer_one_entry
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(alts_credentials_fuzzer_one_entry
@@ -15888,6 +16301,7 @@ target_include_directories(api_fuzzer_one_entry
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(api_fuzzer_one_entry
@@ -15917,6 +16331,7 @@ target_include_directories(client_fuzzer_one_entry
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(client_fuzzer_one_entry
@@ -15946,6 +16361,7 @@ target_include_directories(hpack_parser_fuzzer_test_one_entry
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(hpack_parser_fuzzer_test_one_entry
@@ -15975,6 +16391,7 @@ target_include_directories(http_request_fuzzer_test_one_entry
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(http_request_fuzzer_test_one_entry
@@ -16004,6 +16421,7 @@ target_include_directories(http_response_fuzzer_test_one_entry
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(http_response_fuzzer_test_one_entry
@@ -16033,6 +16451,7 @@ target_include_directories(json_fuzzer_test_one_entry
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(json_fuzzer_test_one_entry
@@ -16062,6 +16481,7 @@ target_include_directories(nanopb_fuzzer_response_test_one_entry
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(nanopb_fuzzer_response_test_one_entry
@@ -16091,6 +16511,7 @@ target_include_directories(nanopb_fuzzer_serverlist_test_one_entry
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(nanopb_fuzzer_serverlist_test_one_entry
@@ -16120,6 +16541,7 @@ target_include_directories(percent_decode_fuzzer_one_entry
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(percent_decode_fuzzer_one_entry
@@ -16149,6 +16571,7 @@ target_include_directories(percent_encode_fuzzer_one_entry
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(percent_encode_fuzzer_one_entry
@@ -16178,6 +16601,7 @@ target_include_directories(server_fuzzer_one_entry
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(server_fuzzer_one_entry
@@ -16207,6 +16631,7 @@ target_include_directories(ssl_server_fuzzer_one_entry
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(ssl_server_fuzzer_one_entry
@@ -16236,6 +16661,7 @@ target_include_directories(uri_fuzzer_test_one_entry
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
target_link_libraries(uri_fuzzer_test_one_entry
diff --git a/CONCEPTS.md b/CONCEPTS.md
new file mode 100644
index 0000000000..034d58e427
--- /dev/null
+++ b/CONCEPTS.md
@@ -0,0 +1,63 @@
+# gRPC Concepts Overview
+
+Remote Procedure Calls (RPCs) provide a useful abstraction for building
+distributed applications and services. The libraries in this repository
+provide a concrete implementation of the gRPC protocol, layered over HTTP/2.
+These libraries enable communication between clients and servers using any
+combination of the supported languages.
+
+
+## Interface
+
+Developers using gRPC start with a language agnostic description of an RPC service (a collection
+of methods). From this description, gRPC will generate client and server side interfaces
+in any of the supported languages. The server implements
+the service interface, which can be remotely invoked by the client interface.
+
+By default, gRPC uses [Protocol Buffers](https://github.com/google/protobuf) as the
+Interface Definition Language (IDL) for describing both the service interface
+and the structure of the payload messages. It is possible to use other
+alternatives if desired.
+
+### Invoking & handling remote calls
+Starting from an interface definition in a .proto file, gRPC provides
+Protocol Compiler plugins that generate Client- and Server-side APIs.
+gRPC users call into these APIs on the Client side and implement
+the corresponding API on the server side.
+
+#### Synchronous vs. asynchronous
+Synchronous RPC calls, that block until a response arrives from the server, are
+the closest approximation to the abstraction of a procedure call that RPC
+aspires to.
+
+On the other hand, networks are inherently asynchronous and in many scenarios,
+it is desirable to have the ability to start RPCs without blocking the current
+thread.
+
+The gRPC programming surface in most languages comes in both synchronous and
+asynchronous flavors.
+
+
+## Streaming
+
+gRPC supports streaming semantics, where either the client or the server (or both)
+send a stream of messages on a single RPC call. The most general case is
+Bidirectional Streaming where a single gRPC call establishes a stream in which both
+the client and the server can send a stream of messages to each other. The streamed
+messages are delivered in the order they were sent.
+
+
+# Protocol
+
+The [gRPC protocol](doc/PROTOCOL-HTTP2.md) specifies the abstract requirements for communication between
+clients and servers. A concrete embedding over HTTP/2 completes the picture by
+fleshing out the details of each of the required operations.
+
+## Abstract gRPC protocol
+A gRPC call comprises of a bidirectional stream of messages, initiated by the client. In the client-to-server direction, this stream begins with a mandatory `Call Header`, followed by optional `Initial-Metadata`, followed by zero or more `Payload Messages`. The server-to-client direction contains an optional `Initial-Metadata`, followed by zero or more `Payload Messages` terminated with a mandatory `Status` and optional `Status-Metadata` (a.k.a.,`Trailing-Metadata`).
+
+## Implementation over HTTP/2
+The abstract protocol defined above is implemented over [HTTP/2](https://http2.github.io/). gRPC bidirectional streams are mapped to HTTP/2 streams. The contents of `Call Header` and `Initial Metadata` are sent as HTTP/2 headers and subject to HPACK compression. `Payload Messages` are serialized into a byte stream of length prefixed gRPC frames which are then fragmented into HTTP/2 frames at the sender and reassembled at the receiver. `Status` and `Trailing-Metadata` are sent as HTTP/2 trailing headers (a.k.a., trailers).
+
+## Flow Control
+gRPC uses the flow control mechanism in HTTP/2. This enables fine-grained control of memory used for buffering in-flight messages.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 2f90ccf281..abd7a5eb78 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -11,13 +11,34 @@ In order to protect both you and ourselves, you will need to sign the
[Contributor License
Agreement](https://identity.linuxfoundation.org/projects/cncf).
-## Running tests
+## Cloning the repository
-Use `tools/run_tests/run_tests.py` script to run the unit tests. See
-[tools/run_tests](tools/run_tests) for how to run tests for a given language.
+Before starting any development work you will need a local copy of the gRPC repository.
+Please follow the instructions in [Building gRPC C++: Clone the repository](BUILDING.md#clone-the-repository-including-submodules).
-Prerequisites for building and running tests are listed in
-[INSTALL.md](INSTALL.md) and in `src/YOUR-LANGUAGE` (e.g. `src/csharp`)
+## Building & Running tests
+
+Different languages use different build systems. To hide the complexity
+of needing to build with many different build systems, a portable python
+script that unifies the experience of building and testing gRPC in different
+languages and on different platforms is provided.
+
+To build gRPC in the language of choice (e.g. `c++`, `csharp`, `php`, `python`, `ruby`, ...)
+- Prepare you development environment based on language-specific instructions in `src/YOUR-LANGUAGE` directory.
+- The language-specific instructions might involve installing C/C++ prerequisites listed in
+ [Building gRPC C++: Prerequisites](BUILDING.md#pre-requisites) as gRPC implementations
+ in this repository are using the native gRPC "core" library internally.
+- Run
+ ```
+ python tools/run_tests/run_tests.py -l YOUR_LANGUAGE --build_only
+ ```
+- To also run all the unit tests after building
+ ```
+ python tools/run_tests/run_tests.py -l YOUR_LANGUAGE
+ ```
+
+You can also run `python tools/run_tests/run_tests.py --help` to discover useful command line flags supported. For more details,
+see [tools/run_tests](tools/run_tests) where you will also find guidance on how to run various other test suites (e.g. interop tests, benchmarks)
## Generated project files
diff --git a/Makefile b/Makefile
index 76a8d7ec00..3d16ee8cf9 100644
--- a/Makefile
+++ b/Makefile
@@ -346,12 +346,10 @@ CXXFLAGS += -std=c++11
ifeq ($(SYSTEM),Darwin)
CXXFLAGS += -stdlib=libc++
endif
-CPPFLAGS += -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 -Wno-deprecated-declarations
+CPPFLAGS += -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 -Wno-deprecated-declarations -Ithird_party/nanopb -DPB_FIELD_32BIT
COREFLAGS += -fno-rtti -fno-exceptions
LDFLAGS += -g
-DEFINES += PB_FIELD_16BIT
-
CPPFLAGS += $(CPPFLAGS_$(CONFIG))
CFLAGS += $(CFLAGS_$(CONFIG))
CXXFLAGS += $(CXXFLAGS_$(CONFIG))
@@ -433,8 +431,8 @@ Q = @
endif
CORE_VERSION = 6.0.0-dev
-CPP_VERSION = 1.13.0-dev
-CSHARP_VERSION = 1.13.0-dev
+CPP_VERSION = 1.14.0-dev
+CSHARP_VERSION = 1.14.0-dev
CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES))
CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS)
@@ -982,6 +980,7 @@ dns_resolver_test: $(BINDIR)/$(CONFIG)/dns_resolver_test
dualstack_socket_test: $(BINDIR)/$(CONFIG)/dualstack_socket_test
endpoint_pair_test: $(BINDIR)/$(CONFIG)/endpoint_pair_test
error_test: $(BINDIR)/$(CONFIG)/error_test
+ev_epollex_linux_test: $(BINDIR)/$(CONFIG)/ev_epollex_linux_test
ev_epollsig_linux_test: $(BINDIR)/$(CONFIG)/ev_epollsig_linux_test
fake_resolver_test: $(BINDIR)/$(CONFIG)/fake_resolver_test
fake_transport_security_test: $(BINDIR)/$(CONFIG)/fake_transport_security_test
@@ -1026,6 +1025,7 @@ grpc_verify_jwt: $(BINDIR)/$(CONFIG)/grpc_verify_jwt
handshake_client: $(BINDIR)/$(CONFIG)/handshake_client
handshake_server: $(BINDIR)/$(CONFIG)/handshake_server
handshake_server_with_readahead_handshaker: $(BINDIR)/$(CONFIG)/handshake_server_with_readahead_handshaker
+handshake_verify_peer_options: $(BINDIR)/$(CONFIG)/handshake_verify_peer_options
histogram_test: $(BINDIR)/$(CONFIG)/histogram_test
hpack_parser_fuzzer_test: $(BINDIR)/$(CONFIG)/hpack_parser_fuzzer_test
hpack_parser_test: $(BINDIR)/$(CONFIG)/hpack_parser_test
@@ -1118,6 +1118,7 @@ backoff_test: $(BINDIR)/$(CONFIG)/backoff_test
bdp_estimator_test: $(BINDIR)/$(CONFIG)/bdp_estimator_test
bm_arena: $(BINDIR)/$(CONFIG)/bm_arena
bm_call_create: $(BINDIR)/$(CONFIG)/bm_call_create
+bm_channel: $(BINDIR)/$(CONFIG)/bm_channel
bm_chttp2_hpack: $(BINDIR)/$(CONFIG)/bm_chttp2_hpack
bm_chttp2_transport: $(BINDIR)/$(CONFIG)/bm_chttp2_transport
bm_closure: $(BINDIR)/$(CONFIG)/bm_closure
@@ -1135,6 +1136,7 @@ channel_arguments_test: $(BINDIR)/$(CONFIG)/channel_arguments_test
channel_filter_test: $(BINDIR)/$(CONFIG)/channel_filter_test
channel_trace_test: $(BINDIR)/$(CONFIG)/channel_trace_test
channelz_registry_test: $(BINDIR)/$(CONFIG)/channelz_registry_test
+channelz_test: $(BINDIR)/$(CONFIG)/channelz_test
check_gcp_environment_linux_test: $(BINDIR)/$(CONFIG)/check_gcp_environment_linux_test
check_gcp_environment_windows_test: $(BINDIR)/$(CONFIG)/check_gcp_environment_windows_test
chttp2_settings_timeout_test: $(BINDIR)/$(CONFIG)/chttp2_settings_timeout_test
@@ -1179,7 +1181,6 @@ interop_client: $(BINDIR)/$(CONFIG)/interop_client
interop_server: $(BINDIR)/$(CONFIG)/interop_server
interop_test: $(BINDIR)/$(CONFIG)/interop_test
json_run_localhost: $(BINDIR)/$(CONFIG)/json_run_localhost
-lb_load_data_store_test: $(BINDIR)/$(CONFIG)/lb_load_data_store_test
memory_test: $(BINDIR)/$(CONFIG)/memory_test
metrics_client: $(BINDIR)/$(CONFIG)/metrics_client
mock_test: $(BINDIR)/$(CONFIG)/mock_test
@@ -1297,7 +1298,6 @@ h2_full+pipe_test: $(BINDIR)/$(CONFIG)/h2_full+pipe_test
h2_full+trace_test: $(BINDIR)/$(CONFIG)/h2_full+trace_test
h2_full+workarounds_test: $(BINDIR)/$(CONFIG)/h2_full+workarounds_test
h2_http_proxy_test: $(BINDIR)/$(CONFIG)/h2_http_proxy_test
-h2_load_reporting_test: $(BINDIR)/$(CONFIG)/h2_load_reporting_test
h2_oauth2_test: $(BINDIR)/$(CONFIG)/h2_oauth2_test
h2_proxy_test: $(BINDIR)/$(CONFIG)/h2_proxy_test
h2_sockpair_test: $(BINDIR)/$(CONFIG)/h2_sockpair_test
@@ -1315,7 +1315,6 @@ h2_full+pipe_nosec_test: $(BINDIR)/$(CONFIG)/h2_full+pipe_nosec_test
h2_full+trace_nosec_test: $(BINDIR)/$(CONFIG)/h2_full+trace_nosec_test
h2_full+workarounds_nosec_test: $(BINDIR)/$(CONFIG)/h2_full+workarounds_nosec_test
h2_http_proxy_nosec_test: $(BINDIR)/$(CONFIG)/h2_http_proxy_nosec_test
-h2_load_reporting_nosec_test: $(BINDIR)/$(CONFIG)/h2_load_reporting_nosec_test
h2_proxy_nosec_test: $(BINDIR)/$(CONFIG)/h2_proxy_nosec_test
h2_sockpair_nosec_test: $(BINDIR)/$(CONFIG)/h2_sockpair_nosec_test
h2_sockpair+trace_nosec_test: $(BINDIR)/$(CONFIG)/h2_sockpair+trace_nosec_test
@@ -1328,6 +1327,7 @@ resolver_component_tests_runner_invoker_unsecure: $(BINDIR)/$(CONFIG)/resolver_c
resolver_component_tests_runner_invoker: $(BINDIR)/$(CONFIG)/resolver_component_tests_runner_invoker
address_sorting_test_unsecure: $(BINDIR)/$(CONFIG)/address_sorting_test_unsecure
address_sorting_test: $(BINDIR)/$(CONFIG)/address_sorting_test
+cancel_ares_query_test: $(BINDIR)/$(CONFIG)/cancel_ares_query_test
alts_credentials_fuzzer_one_entry: $(BINDIR)/$(CONFIG)/alts_credentials_fuzzer_one_entry
api_fuzzer_one_entry: $(BINDIR)/$(CONFIG)/api_fuzzer_one_entry
client_fuzzer_one_entry: $(BINDIR)/$(CONFIG)/client_fuzzer_one_entry
@@ -1394,9 +1394,9 @@ pc_cxx: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++.pc
pc_cxx_unsecure: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++_unsecure.pc
ifeq ($(EMBED_OPENSSL),true)
-privatelibs_cxx: $(LIBDIR)/$(CONFIG)/libgrpc++_core_stats.a $(LIBDIR)/$(CONFIG)/libgrpc++_proto_reflection_desc_db.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_cli_libs.a $(LIBDIR)/$(CONFIG)/libhttp2_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a $(LIBDIR)/$(CONFIG)/libinterop_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a $(LIBDIR)/$(CONFIG)/libinterop_server_lib.a $(LIBDIR)/$(CONFIG)/libinterop_server_main.a $(LIBDIR)/$(CONFIG)/liblb_load_data_store.a $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libboringssl_test_util.a $(LIBDIR)/$(CONFIG)/libboringssl_crypto_test_data_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_asn1_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_base64_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_bio_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_buf_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_bytestring_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_chacha_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_aead_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_cipher_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_cmac_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_compiler_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_constant_time_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ed25519_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_spake25519_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_x25519_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_dh_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_digest_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_dsa_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ecdh_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_err_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_evp_extra_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_evp_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pbkdf_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_scrypt_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_aes_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_bn_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ec_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_p256-x86_64_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ecdsa_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_gcm_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ctrdrbg_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_hkdf_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_hmac_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_lhash_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_obj_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pkcs7_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pkcs12_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pkcs8_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_poly1305_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pool_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_refcount_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_rsa_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_self_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_file_test_gtest_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_gtest_main_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_thread_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_x509_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_tab_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_v3name_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_span_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ssl_test_lib.a $(LIBDIR)/$(CONFIG)/libbenchmark.a
+privatelibs_cxx: $(LIBDIR)/$(CONFIG)/libgrpc++_core_stats.a $(LIBDIR)/$(CONFIG)/libgrpc++_proto_reflection_desc_db.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_cli_libs.a $(LIBDIR)/$(CONFIG)/libhttp2_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a $(LIBDIR)/$(CONFIG)/libinterop_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a $(LIBDIR)/$(CONFIG)/libinterop_server_lib.a $(LIBDIR)/$(CONFIG)/libinterop_server_main.a $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libboringssl_test_util.a $(LIBDIR)/$(CONFIG)/libboringssl_crypto_test_data_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_asn1_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_base64_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_bio_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_buf_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_bytestring_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_chacha_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_aead_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_cipher_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_cmac_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_compiler_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_constant_time_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ed25519_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_spake25519_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_x25519_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_dh_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_digest_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_dsa_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ecdh_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_err_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_evp_extra_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_evp_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pbkdf_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_scrypt_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_aes_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_bn_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ec_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_p256-x86_64_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ecdsa_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_gcm_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ctrdrbg_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_hkdf_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_hmac_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_lhash_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_obj_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pkcs7_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pkcs12_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pkcs8_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_poly1305_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pool_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_refcount_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_rsa_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_self_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_file_test_gtest_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_gtest_main_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_thread_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_x509_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_tab_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_v3name_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_span_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ssl_test_lib.a $(LIBDIR)/$(CONFIG)/libbenchmark.a
else
-privatelibs_cxx: $(LIBDIR)/$(CONFIG)/libgrpc++_core_stats.a $(LIBDIR)/$(CONFIG)/libgrpc++_proto_reflection_desc_db.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_cli_libs.a $(LIBDIR)/$(CONFIG)/libhttp2_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a $(LIBDIR)/$(CONFIG)/libinterop_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a $(LIBDIR)/$(CONFIG)/libinterop_server_lib.a $(LIBDIR)/$(CONFIG)/libinterop_server_main.a $(LIBDIR)/$(CONFIG)/liblb_load_data_store.a $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libbenchmark.a
+privatelibs_cxx: $(LIBDIR)/$(CONFIG)/libgrpc++_core_stats.a $(LIBDIR)/$(CONFIG)/libgrpc++_proto_reflection_desc_db.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_cli_libs.a $(LIBDIR)/$(CONFIG)/libhttp2_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a $(LIBDIR)/$(CONFIG)/libinterop_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a $(LIBDIR)/$(CONFIG)/libinterop_server_lib.a $(LIBDIR)/$(CONFIG)/libinterop_server_main.a $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libbenchmark.a
endif
@@ -1426,6 +1426,7 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/dualstack_socket_test \
$(BINDIR)/$(CONFIG)/endpoint_pair_test \
$(BINDIR)/$(CONFIG)/error_test \
+ $(BINDIR)/$(CONFIG)/ev_epollex_linux_test \
$(BINDIR)/$(CONFIG)/ev_epollsig_linux_test \
$(BINDIR)/$(CONFIG)/fake_resolver_test \
$(BINDIR)/$(CONFIG)/fake_transport_security_test \
@@ -1467,6 +1468,7 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/handshake_client \
$(BINDIR)/$(CONFIG)/handshake_server \
$(BINDIR)/$(CONFIG)/handshake_server_with_readahead_handshaker \
+ $(BINDIR)/$(CONFIG)/handshake_verify_peer_options \
$(BINDIR)/$(CONFIG)/histogram_test \
$(BINDIR)/$(CONFIG)/hpack_parser_test \
$(BINDIR)/$(CONFIG)/hpack_table_test \
@@ -1550,7 +1552,6 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/h2_full+trace_test \
$(BINDIR)/$(CONFIG)/h2_full+workarounds_test \
$(BINDIR)/$(CONFIG)/h2_http_proxy_test \
- $(BINDIR)/$(CONFIG)/h2_load_reporting_test \
$(BINDIR)/$(CONFIG)/h2_oauth2_test \
$(BINDIR)/$(CONFIG)/h2_proxy_test \
$(BINDIR)/$(CONFIG)/h2_sockpair_test \
@@ -1568,7 +1569,6 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/h2_full+trace_nosec_test \
$(BINDIR)/$(CONFIG)/h2_full+workarounds_nosec_test \
$(BINDIR)/$(CONFIG)/h2_http_proxy_nosec_test \
- $(BINDIR)/$(CONFIG)/h2_load_reporting_nosec_test \
$(BINDIR)/$(CONFIG)/h2_proxy_nosec_test \
$(BINDIR)/$(CONFIG)/h2_sockpair_nosec_test \
$(BINDIR)/$(CONFIG)/h2_sockpair+trace_nosec_test \
@@ -1613,6 +1613,7 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/bdp_estimator_test \
$(BINDIR)/$(CONFIG)/bm_arena \
$(BINDIR)/$(CONFIG)/bm_call_create \
+ $(BINDIR)/$(CONFIG)/bm_channel \
$(BINDIR)/$(CONFIG)/bm_chttp2_hpack \
$(BINDIR)/$(CONFIG)/bm_chttp2_transport \
$(BINDIR)/$(CONFIG)/bm_closure \
@@ -1630,6 +1631,7 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/channel_filter_test \
$(BINDIR)/$(CONFIG)/channel_trace_test \
$(BINDIR)/$(CONFIG)/channelz_registry_test \
+ $(BINDIR)/$(CONFIG)/channelz_test \
$(BINDIR)/$(CONFIG)/check_gcp_environment_linux_test \
$(BINDIR)/$(CONFIG)/check_gcp_environment_windows_test \
$(BINDIR)/$(CONFIG)/chttp2_settings_timeout_test \
@@ -1667,7 +1669,6 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/interop_server \
$(BINDIR)/$(CONFIG)/interop_test \
$(BINDIR)/$(CONFIG)/json_run_localhost \
- $(BINDIR)/$(CONFIG)/lb_load_data_store_test \
$(BINDIR)/$(CONFIG)/memory_test \
$(BINDIR)/$(CONFIG)/metrics_client \
$(BINDIR)/$(CONFIG)/mock_test \
@@ -1765,6 +1766,7 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/resolver_component_tests_runner_invoker \
$(BINDIR)/$(CONFIG)/address_sorting_test_unsecure \
$(BINDIR)/$(CONFIG)/address_sorting_test \
+ $(BINDIR)/$(CONFIG)/cancel_ares_query_test \
else
buildtests_cxx: privatelibs_cxx \
@@ -1788,6 +1790,7 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/bdp_estimator_test \
$(BINDIR)/$(CONFIG)/bm_arena \
$(BINDIR)/$(CONFIG)/bm_call_create \
+ $(BINDIR)/$(CONFIG)/bm_channel \
$(BINDIR)/$(CONFIG)/bm_chttp2_hpack \
$(BINDIR)/$(CONFIG)/bm_chttp2_transport \
$(BINDIR)/$(CONFIG)/bm_closure \
@@ -1805,6 +1808,7 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/channel_filter_test \
$(BINDIR)/$(CONFIG)/channel_trace_test \
$(BINDIR)/$(CONFIG)/channelz_registry_test \
+ $(BINDIR)/$(CONFIG)/channelz_test \
$(BINDIR)/$(CONFIG)/check_gcp_environment_linux_test \
$(BINDIR)/$(CONFIG)/check_gcp_environment_windows_test \
$(BINDIR)/$(CONFIG)/chttp2_settings_timeout_test \
@@ -1842,7 +1846,6 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/interop_server \
$(BINDIR)/$(CONFIG)/interop_test \
$(BINDIR)/$(CONFIG)/json_run_localhost \
- $(BINDIR)/$(CONFIG)/lb_load_data_store_test \
$(BINDIR)/$(CONFIG)/memory_test \
$(BINDIR)/$(CONFIG)/metrics_client \
$(BINDIR)/$(CONFIG)/mock_test \
@@ -1889,6 +1892,7 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/resolver_component_tests_runner_invoker \
$(BINDIR)/$(CONFIG)/address_sorting_test_unsecure \
$(BINDIR)/$(CONFIG)/address_sorting_test \
+ $(BINDIR)/$(CONFIG)/cancel_ares_query_test \
endif
@@ -1944,6 +1948,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/endpoint_pair_test || ( echo test endpoint_pair_test failed ; exit 1 )
$(E) "[RUN] Testing error_test"
$(Q) $(BINDIR)/$(CONFIG)/error_test || ( echo test error_test failed ; exit 1 )
+ $(E) "[RUN] Testing ev_epollex_linux_test"
+ $(Q) $(BINDIR)/$(CONFIG)/ev_epollex_linux_test || ( echo test ev_epollex_linux_test failed ; exit 1 )
$(E) "[RUN] Testing ev_epollsig_linux_test"
$(Q) $(BINDIR)/$(CONFIG)/ev_epollsig_linux_test || ( echo test ev_epollsig_linux_test failed ; exit 1 )
$(E) "[RUN] Testing fake_resolver_test"
@@ -2020,6 +2026,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/handshake_server || ( echo test handshake_server failed ; exit 1 )
$(E) "[RUN] Testing handshake_server_with_readahead_handshaker"
$(Q) $(BINDIR)/$(CONFIG)/handshake_server_with_readahead_handshaker || ( echo test handshake_server_with_readahead_handshaker failed ; exit 1 )
+ $(E) "[RUN] Testing handshake_verify_peer_options"
+ $(Q) $(BINDIR)/$(CONFIG)/handshake_verify_peer_options || ( echo test handshake_verify_peer_options failed ; exit 1 )
$(E) "[RUN] Testing histogram_test"
$(Q) $(BINDIR)/$(CONFIG)/histogram_test || ( echo test histogram_test failed ; exit 1 )
$(E) "[RUN] Testing hpack_parser_test"
@@ -2206,6 +2214,8 @@ test_cxx: buildtests_cxx
$(Q) $(BINDIR)/$(CONFIG)/bm_arena || ( echo test bm_arena failed ; exit 1 )
$(E) "[RUN] Testing bm_call_create"
$(Q) $(BINDIR)/$(CONFIG)/bm_call_create || ( echo test bm_call_create failed ; exit 1 )
+ $(E) "[RUN] Testing bm_channel"
+ $(Q) $(BINDIR)/$(CONFIG)/bm_channel || ( echo test bm_channel failed ; exit 1 )
$(E) "[RUN] Testing bm_chttp2_hpack"
$(Q) $(BINDIR)/$(CONFIG)/bm_chttp2_hpack || ( echo test bm_chttp2_hpack failed ; exit 1 )
$(E) "[RUN] Testing bm_chttp2_transport"
@@ -2240,6 +2250,8 @@ test_cxx: buildtests_cxx
$(Q) $(BINDIR)/$(CONFIG)/channel_trace_test || ( echo test channel_trace_test failed ; exit 1 )
$(E) "[RUN] Testing channelz_registry_test"
$(Q) $(BINDIR)/$(CONFIG)/channelz_registry_test || ( echo test channelz_registry_test failed ; exit 1 )
+ $(E) "[RUN] Testing channelz_test"
+ $(Q) $(BINDIR)/$(CONFIG)/channelz_test || ( echo test channelz_test failed ; exit 1 )
$(E) "[RUN] Testing check_gcp_environment_linux_test"
$(Q) $(BINDIR)/$(CONFIG)/check_gcp_environment_linux_test || ( echo test check_gcp_environment_linux_test failed ; exit 1 )
$(E) "[RUN] Testing check_gcp_environment_windows_test"
@@ -2300,8 +2312,6 @@ test_cxx: buildtests_cxx
$(Q) $(BINDIR)/$(CONFIG)/inproc_sync_unary_ping_pong_test || ( echo test inproc_sync_unary_ping_pong_test failed ; exit 1 )
$(E) "[RUN] Testing interop_test"
$(Q) $(BINDIR)/$(CONFIG)/interop_test || ( echo test interop_test failed ; exit 1 )
- $(E) "[RUN] Testing lb_load_data_store_test"
- $(Q) $(BINDIR)/$(CONFIG)/lb_load_data_store_test || ( echo test lb_load_data_store_test failed ; exit 1 )
$(E) "[RUN] Testing memory_test"
$(Q) $(BINDIR)/$(CONFIG)/memory_test || ( echo test memory_test failed ; exit 1 )
$(E) "[RUN] Testing mock_test"
@@ -2374,6 +2384,8 @@ test_cxx: buildtests_cxx
$(Q) $(BINDIR)/$(CONFIG)/address_sorting_test_unsecure || ( echo test address_sorting_test_unsecure failed ; exit 1 )
$(E) "[RUN] Testing address_sorting_test"
$(Q) $(BINDIR)/$(CONFIG)/address_sorting_test || ( echo test address_sorting_test failed ; exit 1 )
+ $(E) "[RUN] Testing cancel_ares_query_test"
+ $(Q) $(BINDIR)/$(CONFIG)/cancel_ares_query_test || ( echo test cancel_ares_query_test failed ; exit 1 )
flaky_test_cxx: buildtests_cxx
@@ -3365,6 +3377,7 @@ LIBGRPC_SRC = \
src/core/lib/channel/channel_stack.cc \
src/core/lib/channel/channel_stack_builder.cc \
src/core/lib/channel/channel_trace.cc \
+ src/core/lib/channel/channelz.cc \
src/core/lib/channel/channelz_registry.cc \
src/core/lib/channel/connected_channel.cc \
src/core/lib/channel/handshaker.cc \
@@ -3641,19 +3654,20 @@ LIBGRPC_SRC = \
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc \
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc \
src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc \
+ src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c \
+ src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c \
src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c \
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \
src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \
src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \
+ src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc \
src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc \
src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc \
- src/core/ext/filters/load_reporting/server_load_reporting_filter.cc \
- src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc \
- src/core/ext/census/grpc_context.cc \
+ src/cpp/ext/filters/census/grpc_context.cc \
src/core/ext/filters/max_age/max_age_filter.cc \
src/core/ext/filters/message_size/message_size_filter.cc \
src/core/ext/filters/http/client_authority_filter.cc \
@@ -3691,7 +3705,6 @@ PUBLIC_HEADERS_C += \
include/grpc/grpc.h \
include/grpc/grpc_posix.h \
include/grpc/grpc_security_constants.h \
- include/grpc/load_reporting.h \
include/grpc/slice.h \
include/grpc/slice_buffer.h \
include/grpc/status.h \
@@ -3758,6 +3771,7 @@ LIBGRPC_CRONET_SRC = \
src/core/lib/channel/channel_stack.cc \
src/core/lib/channel/channel_stack_builder.cc \
src/core/lib/channel/channel_trace.cc \
+ src/core/lib/channel/channelz.cc \
src/core/lib/channel/channelz_registry.cc \
src/core/lib/channel/connected_channel.cc \
src/core/lib/channel/handshaker.cc \
@@ -4026,8 +4040,6 @@ LIBGRPC_CRONET_SRC = \
src/core/tsi/ssl/session_cache/ssl_session_openssl.cc \
src/core/tsi/ssl_transport_security.cc \
src/core/tsi/transport_security_grpc.cc \
- src/core/ext/filters/load_reporting/server_load_reporting_filter.cc \
- src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc \
src/core/plugin_registry/grpc_cronet_plugin_registry.cc \
PUBLIC_HEADERS_C += \
@@ -4142,6 +4154,7 @@ LIBGRPC_TEST_UTIL_SRC = \
src/core/lib/channel/channel_stack.cc \
src/core/lib/channel/channel_stack_builder.cc \
src/core/lib/channel/channel_trace.cc \
+ src/core/lib/channel/channelz.cc \
src/core/lib/channel/channelz_registry.cc \
src/core/lib/channel/connected_channel.cc \
src/core/lib/channel/handshaker.cc \
@@ -4438,6 +4451,7 @@ LIBGRPC_TEST_UTIL_UNSECURE_SRC = \
src/core/lib/channel/channel_stack.cc \
src/core/lib/channel/channel_stack_builder.cc \
src/core/lib/channel/channel_trace.cc \
+ src/core/lib/channel/channelz.cc \
src/core/lib/channel/channelz_registry.cc \
src/core/lib/channel/connected_channel.cc \
src/core/lib/channel/handshaker.cc \
@@ -4700,6 +4714,7 @@ LIBGRPC_UNSECURE_SRC = \
src/core/lib/channel/channel_stack.cc \
src/core/lib/channel/channel_stack_builder.cc \
src/core/lib/channel/channel_trace.cc \
+ src/core/lib/channel/channelz.cc \
src/core/lib/channel/channelz_registry.cc \
src/core/lib/channel/connected_channel.cc \
src/core/lib/channel/handshaker.cc \
@@ -4902,26 +4917,27 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/transport/inproc/inproc_plugin.cc \
src/core/ext/transport/inproc/inproc_transport.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \
+ src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc \
src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc \
src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc \
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \
- src/core/ext/filters/load_reporting/server_load_reporting_filter.cc \
- src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc \
src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc \
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc \
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc \
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc \
src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc \
+ src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c \
+ src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c \
src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c \
third_party/nanopb/pb_common.c \
third_party/nanopb/pb_decode.c \
third_party/nanopb/pb_encode.c \
src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \
src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \
- src/core/ext/census/grpc_context.cc \
+ src/cpp/ext/filters/census/grpc_context.cc \
src/core/ext/filters/max_age/max_age_filter.cc \
src/core/ext/filters/message_size/message_size_filter.cc \
src/core/ext/filters/http/client_authority_filter.cc \
@@ -4958,7 +4974,6 @@ PUBLIC_HEADERS_C += \
include/grpc/grpc.h \
include/grpc/grpc_posix.h \
include/grpc/grpc_security_constants.h \
- include/grpc/load_reporting.h \
include/grpc/slice.h \
include/grpc/slice_buffer.h \
include/grpc/status.h \
@@ -5254,7 +5269,6 @@ PUBLIC_HEADERS_CXX += \
include/grpc/grpc.h \
include/grpc/grpc_posix.h \
include/grpc/grpc_security_constants.h \
- include/grpc/load_reporting.h \
include/grpc/slice.h \
include/grpc/slice_buffer.h \
include/grpc/status.h \
@@ -5519,6 +5533,7 @@ LIBGRPC++_CRONET_SRC = \
src/core/lib/channel/channel_stack.cc \
src/core/lib/channel/channel_stack_builder.cc \
src/core/lib/channel/channel_trace.cc \
+ src/core/lib/channel/channelz.cc \
src/core/lib/channel/channelz_registry.cc \
src/core/lib/channel/connected_channel.cc \
src/core/lib/channel/handshaker.cc \
@@ -5692,10 +5707,7 @@ LIBGRPC++_CRONET_SRC = \
src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc \
src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc \
src/core/ext/transport/chttp2/server/chttp2_server.cc \
- src/core/ext/census/grpc_context.cc \
- third_party/nanopb/pb_common.c \
- third_party/nanopb/pb_decode.c \
- third_party/nanopb/pb_encode.c \
+ src/cpp/ext/filters/census/grpc_context.cc \
PUBLIC_HEADERS_CXX += \
include/grpc++/alarm.h \
@@ -5827,7 +5839,6 @@ PUBLIC_HEADERS_CXX += \
include/grpc/grpc.h \
include/grpc/grpc_posix.h \
include/grpc/grpc_security_constants.h \
- include/grpc/load_reporting.h \
include/grpc/slice.h \
include/grpc/slice_buffer.h \
include/grpc/status.h \
@@ -6687,7 +6698,6 @@ PUBLIC_HEADERS_CXX += \
include/grpc/grpc.h \
include/grpc/grpc_posix.h \
include/grpc/grpc_security_constants.h \
- include/grpc/load_reporting.h \
include/grpc/slice.h \
include/grpc/slice_buffer.h \
include/grpc/status.h \
@@ -7275,55 +7285,6 @@ endif
endif
-LIBLB_LOAD_DATA_STORE_SRC = \
- src/cpp/server/load_reporter/load_data_store.cc \
-
-PUBLIC_HEADERS_CXX += \
-
-LIBLB_LOAD_DATA_STORE_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBLB_LOAD_DATA_STORE_SRC))))
-
-
-ifeq ($(NO_SECURE),true)
-
-# You can't build secure libraries if you don't have OpenSSL.
-
-$(LIBDIR)/$(CONFIG)/liblb_load_data_store.a: openssl_dep_error
-
-
-else
-
-ifeq ($(NO_PROTOBUF),true)
-
-# You can't build a C++ library if you don't have protobuf - a bit overreached, but still okay.
-
-$(LIBDIR)/$(CONFIG)/liblb_load_data_store.a: protobuf_dep_error
-
-
-else
-
-$(LIBDIR)/$(CONFIG)/liblb_load_data_store.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(CARES_DEP) $(ADDRESS_SORTING_DEP) $(PROTOBUF_DEP) $(LIBLB_LOAD_DATA_STORE_OBJS)
- $(E) "[AR] Creating $@"
- $(Q) mkdir -p `dirname $@`
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/liblb_load_data_store.a
- $(Q) $(AR) $(AROPTS) $(LIBDIR)/$(CONFIG)/liblb_load_data_store.a $(LIBLB_LOAD_DATA_STORE_OBJS)
-ifeq ($(SYSTEM),Darwin)
- $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/liblb_load_data_store.a
-endif
-
-
-
-
-endif
-
-endif
-
-ifneq ($(NO_SECURE),true)
-ifneq ($(NO_DEPS),true)
--include $(LIBLB_LOAD_DATA_STORE_OBJS:.o=.dep)
-endif
-endif
-
-
LIBQPS_SRC = \
$(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc \
$(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc \
@@ -10029,6 +9990,7 @@ LIBEND2END_TESTS_SRC = \
test/core/end2end/tests/cancel_before_invoke.cc \
test/core/end2end/tests/cancel_in_a_vacuum.cc \
test/core/end2end/tests/cancel_with_status.cc \
+ test/core/end2end/tests/channelz.cc \
test/core/end2end/tests/compressed_payload.cc \
test/core/end2end/tests/connectivity.cc \
test/core/end2end/tests/default_host.cc \
@@ -10045,13 +10007,13 @@ LIBEND2END_TESTS_SRC = \
test/core/end2end/tests/invoke_large_request.cc \
test/core/end2end/tests/keepalive_timeout.cc \
test/core/end2end/tests/large_metadata.cc \
- test/core/end2end/tests/load_reporting_hook.cc \
test/core/end2end/tests/max_concurrent_streams.cc \
test/core/end2end/tests/max_connection_age.cc \
test/core/end2end/tests/max_connection_idle.cc \
test/core/end2end/tests/max_message_length.cc \
test/core/end2end/tests/negative_deadline.cc \
test/core/end2end/tests/network_status_change.cc \
+ test/core/end2end/tests/no_error_on_hotpath.cc \
test/core/end2end/tests/no_logging.cc \
test/core/end2end/tests/no_op.cc \
test/core/end2end/tests/payload.cc \
@@ -10145,6 +10107,7 @@ LIBEND2END_NOSEC_TESTS_SRC = \
test/core/end2end/tests/cancel_before_invoke.cc \
test/core/end2end/tests/cancel_in_a_vacuum.cc \
test/core/end2end/tests/cancel_with_status.cc \
+ test/core/end2end/tests/channelz.cc \
test/core/end2end/tests/compressed_payload.cc \
test/core/end2end/tests/connectivity.cc \
test/core/end2end/tests/default_host.cc \
@@ -10161,13 +10124,13 @@ LIBEND2END_NOSEC_TESTS_SRC = \
test/core/end2end/tests/invoke_large_request.cc \
test/core/end2end/tests/keepalive_timeout.cc \
test/core/end2end/tests/large_metadata.cc \
- test/core/end2end/tests/load_reporting_hook.cc \
test/core/end2end/tests/max_concurrent_streams.cc \
test/core/end2end/tests/max_connection_age.cc \
test/core/end2end/tests/max_connection_idle.cc \
test/core/end2end/tests/max_message_length.cc \
test/core/end2end/tests/negative_deadline.cc \
test/core/end2end/tests/network_status_change.cc \
+ test/core/end2end/tests/no_error_on_hotpath.cc \
test/core/end2end/tests/no_logging.cc \
test/core/end2end/tests/no_op.cc \
test/core/end2end/tests/payload.cc \
@@ -11100,6 +11063,38 @@ endif
endif
+EV_EPOLLEX_LINUX_TEST_SRC = \
+ test/core/iomgr/ev_epollex_linux_test.cc \
+
+EV_EPOLLEX_LINUX_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(EV_EPOLLEX_LINUX_TEST_SRC))))
+ifeq ($(NO_SECURE),true)
+
+# You can't build secure targets if you don't have OpenSSL.
+
+$(BINDIR)/$(CONFIG)/ev_epollex_linux_test: openssl_dep_error
+
+else
+
+
+
+$(BINDIR)/$(CONFIG)/ev_epollex_linux_test: $(EV_EPOLLEX_LINUX_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) $(EV_EPOLLEX_LINUX_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)/ev_epollex_linux_test
+
+endif
+
+$(OBJDIR)/$(CONFIG)/test/core/iomgr/ev_epollex_linux_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+
+deps_ev_epollex_linux_test: $(EV_EPOLLEX_LINUX_TEST_OBJS:.o=.dep)
+
+ifneq ($(NO_SECURE),true)
+ifneq ($(NO_DEPS),true)
+-include $(EV_EPOLLEX_LINUX_TEST_OBJS:.o=.dep)
+endif
+endif
+
+
EV_EPOLLSIG_LINUX_TEST_SRC = \
test/core/iomgr/ev_epollsig_linux_test.cc \
@@ -12526,6 +12521,38 @@ endif
endif
+HANDSHAKE_VERIFY_PEER_OPTIONS_SRC = \
+ test/core/handshake/verify_peer_options.cc \
+
+HANDSHAKE_VERIFY_PEER_OPTIONS_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HANDSHAKE_VERIFY_PEER_OPTIONS_SRC))))
+ifeq ($(NO_SECURE),true)
+
+# You can't build secure targets if you don't have OpenSSL.
+
+$(BINDIR)/$(CONFIG)/handshake_verify_peer_options: openssl_dep_error
+
+else
+
+
+
+$(BINDIR)/$(CONFIG)/handshake_verify_peer_options: $(HANDSHAKE_VERIFY_PEER_OPTIONS_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) $(HANDSHAKE_VERIFY_PEER_OPTIONS_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)/handshake_verify_peer_options
+
+endif
+
+$(OBJDIR)/$(CONFIG)/test/core/handshake/verify_peer_options.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+
+deps_handshake_verify_peer_options: $(HANDSHAKE_VERIFY_PEER_OPTIONS_OBJS:.o=.dep)
+
+ifneq ($(NO_SECURE),true)
+ifneq ($(NO_DEPS),true)
+-include $(HANDSHAKE_VERIFY_PEER_OPTIONS_OBJS:.o=.dep)
+endif
+endif
+
+
HISTOGRAM_TEST_SRC = \
test/core/util/histogram_test.cc \
@@ -15698,6 +15725,50 @@ endif
endif
+BM_CHANNEL_SRC = \
+ test/cpp/microbenchmarks/bm_channel.cc \
+
+BM_CHANNEL_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(BM_CHANNEL_SRC))))
+ifeq ($(NO_SECURE),true)
+
+# You can't build secure targets if you don't have OpenSSL.
+
+$(BINDIR)/$(CONFIG)/bm_channel: openssl_dep_error
+
+else
+
+
+
+
+ifeq ($(NO_PROTOBUF),true)
+
+# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+.
+
+$(BINDIR)/$(CONFIG)/bm_channel: protobuf_dep_error
+
+else
+
+$(BINDIR)/$(CONFIG)/bm_channel: $(PROTOBUF_DEP) $(BM_CHANNEL_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
+ $(E) "[LD] Linking $@"
+ $(Q) mkdir -p `dirname $@`
+ $(Q) $(LDXX) $(LDFLAGS) $(BM_CHANNEL_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_channel
+
+endif
+
+endif
+
+$(BM_CHANNEL_OBJS): CPPFLAGS += -Ithird_party/benchmark/include -DHAVE_POSIX_REGEX
+$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_channel.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
+
+deps_bm_channel: $(BM_CHANNEL_OBJS:.o=.dep)
+
+ifneq ($(NO_SECURE),true)
+ifneq ($(NO_DEPS),true)
+-include $(BM_CHANNEL_OBJS:.o=.dep)
+endif
+endif
+
+
BM_CHTTP2_HPACK_SRC = \
test/cpp/microbenchmarks/bm_chttp2_hpack.cc \
@@ -16445,6 +16516,53 @@ endif
endif
+CHANNELZ_TEST_SRC = \
+ test/core/channel/channelz_test.cc \
+ $(GENDIR)/src/proto/grpc/channelz/channelz.pb.cc $(GENDIR)/src/proto/grpc/channelz/channelz.grpc.pb.cc \
+
+CHANNELZ_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(CHANNELZ_TEST_SRC))))
+ifeq ($(NO_SECURE),true)
+
+# You can't build secure targets if you don't have OpenSSL.
+
+$(BINDIR)/$(CONFIG)/channelz_test: openssl_dep_error
+
+else
+
+
+
+
+ifeq ($(NO_PROTOBUF),true)
+
+# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+.
+
+$(BINDIR)/$(CONFIG)/channelz_test: protobuf_dep_error
+
+else
+
+$(BINDIR)/$(CONFIG)/channelz_test: $(PROTOBUF_DEP) $(CHANNELZ_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+ $(E) "[LD] Linking $@"
+ $(Q) mkdir -p `dirname $@`
+ $(Q) $(LDXX) $(LDFLAGS) $(CHANNELZ_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/channelz_test
+
+endif
+
+endif
+
+$(OBJDIR)/$(CONFIG)/test/core/channel/channelz_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+
+$(OBJDIR)/$(CONFIG)/src/proto/grpc/channelz/channelz.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+
+deps_channelz_test: $(CHANNELZ_TEST_OBJS:.o=.dep)
+
+ifneq ($(NO_SECURE),true)
+ifneq ($(NO_DEPS),true)
+-include $(CHANNELZ_TEST_OBJS:.o=.dep)
+endif
+endif
+$(OBJDIR)/$(CONFIG)/test/core/channel/channelz_test.o: $(GENDIR)/src/proto/grpc/channelz/channelz.pb.cc $(GENDIR)/src/proto/grpc/channelz/channelz.grpc.pb.cc
+
+
CHECK_GCP_ENVIRONMENT_LINUX_TEST_SRC = \
test/core/security/check_gcp_environment_linux_test.cc \
@@ -18292,49 +18410,6 @@ endif
endif
-LB_LOAD_DATA_STORE_TEST_SRC = \
- test/cpp/server/load_reporter/load_data_store_test.cc \
-
-LB_LOAD_DATA_STORE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LB_LOAD_DATA_STORE_TEST_SRC))))
-ifeq ($(NO_SECURE),true)
-
-# You can't build secure targets if you don't have OpenSSL.
-
-$(BINDIR)/$(CONFIG)/lb_load_data_store_test: openssl_dep_error
-
-else
-
-
-
-
-ifeq ($(NO_PROTOBUF),true)
-
-# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+.
-
-$(BINDIR)/$(CONFIG)/lb_load_data_store_test: protobuf_dep_error
-
-else
-
-$(BINDIR)/$(CONFIG)/lb_load_data_store_test: $(PROTOBUF_DEP) $(LB_LOAD_DATA_STORE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/liblb_load_data_store.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
- $(E) "[LD] Linking $@"
- $(Q) mkdir -p `dirname $@`
- $(Q) $(LDXX) $(LDFLAGS) $(LB_LOAD_DATA_STORE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/liblb_load_data_store.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/lb_load_data_store_test
-
-endif
-
-endif
-
-$(OBJDIR)/$(CONFIG)/test/cpp/server/load_reporter/load_data_store_test.o: $(LIBDIR)/$(CONFIG)/liblb_load_data_store.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
-
-deps_lb_load_data_store_test: $(LB_LOAD_DATA_STORE_TEST_OBJS:.o=.dep)
-
-ifneq ($(NO_SECURE),true)
-ifneq ($(NO_DEPS),true)
--include $(LB_LOAD_DATA_STORE_TEST_OBJS:.o=.dep)
-endif
-endif
-
-
MEMORY_TEST_SRC = \
test/core/gprpp/memory_test.cc \
@@ -22870,38 +22945,6 @@ endif
endif
-H2_LOAD_REPORTING_TEST_SRC = \
- test/core/end2end/fixtures/h2_load_reporting.cc \
-
-H2_LOAD_REPORTING_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_LOAD_REPORTING_TEST_SRC))))
-ifeq ($(NO_SECURE),true)
-
-# You can't build secure targets if you don't have OpenSSL.
-
-$(BINDIR)/$(CONFIG)/h2_load_reporting_test: openssl_dep_error
-
-else
-
-
-
-$(BINDIR)/$(CONFIG)/h2_load_reporting_test: $(H2_LOAD_REPORTING_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(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) $(H2_LOAD_REPORTING_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(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)/h2_load_reporting_test
-
-endif
-
-$(OBJDIR)/$(CONFIG)/test/core/end2end/fixtures/h2_load_reporting.o: $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
-
-deps_h2_load_reporting_test: $(H2_LOAD_REPORTING_TEST_OBJS:.o=.dep)
-
-ifneq ($(NO_SECURE),true)
-ifneq ($(NO_DEPS),true)
--include $(H2_LOAD_REPORTING_TEST_OBJS:.o=.dep)
-endif
-endif
-
-
H2_OAUTH2_TEST_SRC = \
test/core/end2end/fixtures/h2_oauth2.cc \
@@ -23350,26 +23393,6 @@ ifneq ($(NO_DEPS),true)
endif
-H2_LOAD_REPORTING_NOSEC_TEST_SRC = \
- test/core/end2end/fixtures/h2_load_reporting.cc \
-
-H2_LOAD_REPORTING_NOSEC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_LOAD_REPORTING_NOSEC_TEST_SRC))))
-
-
-$(BINDIR)/$(CONFIG)/h2_load_reporting_nosec_test: $(H2_LOAD_REPORTING_NOSEC_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
- $(E) "[LD] Linking $@"
- $(Q) mkdir -p `dirname $@`
- $(Q) $(LD) $(LDFLAGS) $(H2_LOAD_REPORTING_NOSEC_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) -o $(BINDIR)/$(CONFIG)/h2_load_reporting_nosec_test
-
-$(OBJDIR)/$(CONFIG)/test/core/end2end/fixtures/h2_load_reporting.o: $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
-
-deps_h2_load_reporting_nosec_test: $(H2_LOAD_REPORTING_NOSEC_TEST_OBJS:.o=.dep)
-
-ifneq ($(NO_DEPS),true)
--include $(H2_LOAD_REPORTING_NOSEC_TEST_OBJS:.o=.dep)
-endif
-
-
H2_PROXY_NOSEC_TEST_SRC = \
test/core/end2end/fixtures/h2_proxy.cc \
@@ -23748,6 +23771,49 @@ endif
endif
+CANCEL_ARES_QUERY_TEST_SRC = \
+ test/cpp/naming/cancel_ares_query_test.cc \
+
+CANCEL_ARES_QUERY_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(CANCEL_ARES_QUERY_TEST_SRC))))
+ifeq ($(NO_SECURE),true)
+
+# You can't build secure targets if you don't have OpenSSL.
+
+$(BINDIR)/$(CONFIG)/cancel_ares_query_test: openssl_dep_error
+
+else
+
+
+
+
+ifeq ($(NO_PROTOBUF),true)
+
+# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+.
+
+$(BINDIR)/$(CONFIG)/cancel_ares_query_test: protobuf_dep_error
+
+else
+
+$(BINDIR)/$(CONFIG)/cancel_ares_query_test: $(PROTOBUF_DEP) $(CANCEL_ARES_QUERY_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
+ $(E) "[LD] Linking $@"
+ $(Q) mkdir -p `dirname $@`
+ $(Q) $(LDXX) $(LDFLAGS) $(CANCEL_ARES_QUERY_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/cancel_ares_query_test
+
+endif
+
+endif
+
+$(OBJDIR)/$(CONFIG)/test/cpp/naming/cancel_ares_query_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
+
+deps_cancel_ares_query_test: $(CANCEL_ARES_QUERY_TEST_OBJS:.o=.dep)
+
+ifneq ($(NO_SECURE),true)
+ifneq ($(NO_DEPS),true)
+-include $(CANCEL_ARES_QUERY_TEST_OBJS:.o=.dep)
+endif
+endif
+
+
ALTS_CREDENTIALS_FUZZER_ONE_ENTRY_SRC = \
test/core/security/alts_credentials_fuzzer.cc \
test/core/util/one_corpus_entry_fuzzer.cc \
@@ -24327,7 +24393,6 @@ src/cpp/common/secure_channel_arguments.cc: $(OPENSSL_DEP)
src/cpp/common/secure_create_auth_context.cc: $(OPENSSL_DEP)
src/cpp/ext/proto_server_reflection.cc: $(OPENSSL_DEP)
src/cpp/ext/proto_server_reflection_plugin.cc: $(OPENSSL_DEP)
-src/cpp/server/load_reporter/load_data_store.cc: $(OPENSSL_DEP)
src/cpp/server/secure_server_credentials.cc: $(OPENSSL_DEP)
src/cpp/util/core_stats.cc: $(OPENSSL_DEP)
src/cpp/util/error_details.cc: $(OPENSSL_DEP)
diff --git a/README.md b/README.md
index 21a9910e3e..23964e7fc6 100644
--- a/README.md
+++ b/README.md
@@ -1,24 +1,59 @@
-[gRPC - An RPC library and framework](http://github.com/grpc/grpc)
+gRPC - An RPC library and framework
===================================
+gRPC is a modern, open source, high-performance remote procedure call (RPC) framework that can run anywhere. It enables client and server applications to communicate transparently, and makes it easier to build connected systems.
+
+<table>
+ <tr>
+ <td><b>Homepage:</b></td>
+ <td><a href="https://grpc.io/">grpc.io</a></td>
+ </tr>
+ <tr>
+ <td><b>Mailing List:</b></td>
+ <td><a href="https://groups.google.com/forum/#!forum/grpc-io">grpc-io@googlegroups.com</a></td>
+ </tr>
+</table>
+
[![Join the chat at https://gitter.im/grpc/grpc](https://badges.gitter.im/grpc/grpc.svg)](https://gitter.im/grpc/grpc?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
-Copyright 2015
-[The gRPC Authors](https://github.com/grpc/grpc/blob/master/AUTHORS)
+# To start using gRPC
+
+To maximize usability, gRPC supports the standard way of adding dependencies in your language of choice (if there is one).
+In most languages, the gRPC runtime comes in form of a package available in your language's package manager.
+
+For instructions on how to use the language-specific gRPC runtime in your project, please refer to these documents
-# Documentation
+ * [C++](src/cpp): follow the instructions under the `src/cpp` directory
+ * [C#](src/csharp): NuGet package `Grpc`
+ * [Dart](https://github.com/grpc/grpc-dart): pub package `grpc`
+ * [Go](https://github.com/grpc/grpc-go): `go get google.golang.org/grpc`
+ * [Java](https://github.com/grpc/grpc-java): Use JARs from Maven Central Repository
+ * [Node](https://github.com/grpc/grpc-node): `npm install grpc`
+ * [Objective-C](src/objective-c): Add `gRPC-ProtoRPC` dependency to podspec
+ * [PHP](src/php): `pecl install grpc`
+ * [Python](src/python/grpcio): `pip install grpcio`
+ * [Ruby](src/ruby): `gem install grpc`
+ * [WebJS](https://github.com/grpc/grpc-web): follow the grpc-web instructions
-You can find more detailed documentation and examples in the [doc](doc) and [examples](examples) directories respectively.
+You can find per-language quickstart guides and tutorials in [Documentation section on grpc.io website](https://grpc.io/docs/). The code examples are available in the [examples](examples) directory.
-# Installation & Testing
+# To start developing gRPC
-See [INSTALL](INSTALL.md) for installation instructions for various platforms.
+Contributions are welcome!
-See [tools/run_tests](tools/run_tests) for more guidance on how to run various test suites (e.g. unit tests, interop tests, benchmarks)
+Please read [How to contribute](CONTRIBUTING.md) which will guide you through the entire workflow of how to build the source code, how to run the tests and how to contribute your changes to
+the gRPC codebase.
+The document also contains info on how the contributing process works and contains best practices for creating contributions.
+
+# Performance
See [Performance dashboard](http://performance-dot-grpc-testing.appspot.com/explore?dashboard=5636470266134528) for the performance numbers for the latest released version.
-# Repository Structure & Status
+# Concepts
+
+See [gRPC Concepts](CONCEPTS.md)
+
+# About This Repository
This repository contains source code for gRPC libraries for multiple languages written on top of shared C core library [src/core](src/core).
@@ -42,70 +77,3 @@ Libraries in different languages may be in different states of development. We a
| WebJS | [grpc-web](https://github.com/grpc/grpc-web) |
| Dart | [grpc-dart](https://github.com/grpc/grpc-dart) |
-See [MANIFEST.md](MANIFEST.md) for a listing of top-level items in the
-repository.
-
-# Overview
-
-
-Remote Procedure Calls (RPCs) provide a useful abstraction for building
-distributed applications and services. The libraries in this repository
-provide a concrete implementation of the gRPC protocol, layered over HTTP/2.
-These libraries enable communication between clients and servers using any
-combination of the supported languages.
-
-
-## Interface
-
-
-Developers using gRPC typically start with the description of an RPC service
-(a collection of methods), and generate client and server side interfaces
-which they use on the client-side and implement on the server side.
-
-By default, gRPC uses [Protocol Buffers](https://github.com/google/protobuf) as the
-Interface Definition Language (IDL) for describing both the service interface
-and the structure of the payload messages. It is possible to use other
-alternatives if desired.
-
-### Surface API
-Starting from an interface definition in a .proto file, gRPC provides
-Protocol Compiler plugins that generate Client- and Server-side APIs.
-gRPC users typically call into these APIs on the Client side and implement
-the corresponding API on the server side.
-
-#### Synchronous vs. asynchronous
-Synchronous RPC calls, that block until a response arrives from the server, are
-the closest approximation to the abstraction of a procedure call that RPC
-aspires to.
-
-On the other hand, networks are inherently asynchronous and in many scenarios,
-it is desirable to have the ability to start RPCs without blocking the current
-thread.
-
-The gRPC programming surface in most languages comes in both synchronous and
-asynchronous flavors.
-
-
-## Streaming
-
-gRPC supports streaming semantics, where either the client or the server (or both)
-send a stream of messages on a single RPC call. The most general case is
-Bidirectional Streaming where a single gRPC call establishes a stream where both
-the client and the server can send a stream of messages to each other. The streamed
-messages are delivered in the order they were sent.
-
-
-# Protocol
-
-The [gRPC protocol](doc/PROTOCOL-HTTP2.md) specifies the abstract requirements for communication between
-clients and servers. A concrete embedding over HTTP/2 completes the picture by
-fleshing out the details of each of the required operations.
-
-## Abstract gRPC protocol
-A gRPC RPC comprises of a bidirectional stream of messages, initiated by the client. In the client-to-server direction, this stream begins with a mandatory `Call Header`, followed by optional `Initial-Metadata`, followed by zero or more `Payload Messages`. The server-to-client direction contains an optional `Initial-Metadata`, followed by zero or more `Payload Messages` terminated with a mandatory `Status` and optional `Status-Metadata` (a.k.a.,`Trailing-Metadata`).
-
-## Implementation over HTTP/2
-The abstract protocol defined above is implemented over [HTTP/2](https://http2.github.io/). gRPC bidirectional streams are mapped to HTTP/2 streams. The contents of `Call Header` and `Initial Metadata` are sent as HTTP/2 headers and subject to HPACK compression. `Payload Messages` are serialized into a byte stream of length prefixed gRPC frames which are then fragmented into HTTP/2 frames at the sender and reassembled at the receiver. `Status` and `Trailing-Metadata` are sent as HTTP/2 trailing headers (a.k.a., trailers).
-
-## Flow Control
-gRPC inherits the flow control mechanisms in HTTP/2 and uses them to enable fine-grained control of the amount of memory used for buffering in-flight messages.
diff --git a/bazel/grpc_build_system.bzl b/bazel/grpc_build_system.bzl
index 095b1596c8..73147bf3ac 100644
--- a/bazel/grpc_build_system.bzl
+++ b/bazel/grpc_build_system.bzl
@@ -36,9 +36,7 @@ def if_not_windows(a):
def _get_external_deps(external_deps):
ret = []
for dep in external_deps:
- if dep == "nanopb":
- ret += ["grpc_nanopb"]
- elif dep == "address_sorting":
+ if dep == "address_sorting":
ret += ["//third_party/address_sorting"]
elif dep == "cares":
ret += select({"//:grpc_no_ares": [],
@@ -62,7 +60,7 @@ def _maybe_update_cc_library_hdrs(hdrs):
def grpc_cc_library(name, srcs = [], public_hdrs = [], hdrs = [],
external_deps = [], deps = [], standalone = False,
language = "C++", testonly = False, visibility = None,
- alwayslink = 0):
+ alwayslink = 0, data = []):
copts = []
if language.upper() == "C":
copts = if_not_windows(["-std=c99"])
@@ -87,6 +85,7 @@ def grpc_cc_library(name, srcs = [], public_hdrs = [], hdrs = [],
"include"
],
alwayslink = alwayslink,
+ data = data,
)
def grpc_proto_plugin(name, srcs = [], deps = []):
@@ -110,7 +109,7 @@ def grpc_proto_library(name, srcs = [], deps = [], well_known_protos = False,
generate_mocks = generate_mocks,
)
-def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data = [], uses_polling = True, language = "C++", size = "medium", timeout = "moderate"):
+def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data = [], uses_polling = True, language = "C++", size = "medium", timeout = "moderate", tags = []):
copts = []
if language.upper() == "C":
copts = if_not_windows(["-std=c99"])
@@ -140,6 +139,7 @@ def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data
poller,
'$(location %s)' % name,
] + args['args'],
+ tags = tags,
)
else:
native.cc_test(**args)
@@ -160,24 +160,7 @@ def grpc_cc_binary(name, srcs = [], deps = [], external_deps = [], args = [], da
linkopts = if_not_windows(["-pthread"]) + linkopts,
)
-def grpc_generate_one_off_targets():
- native.cc_library(
- name = "grpc_nanopb",
- hdrs = [
- "//third_party/nanopb:pb.h",
- "//third_party/nanopb:pb_common.h",
- "//third_party/nanopb:pb_decode.h",
- "//third_party/nanopb:pb_encode.h",
- ],
- srcs = [
- "//third_party/nanopb:pb_common.c",
- "//third_party/nanopb:pb_decode.c",
- "//third_party/nanopb:pb_encode.c",
- ],
- defines = [
- "PB_FIELD_16BIT=1",
- ],
- )
+def grpc_generate_one_off_targets(): pass
def grpc_sh_test(name, srcs, args = [], data = []):
native.sh_test(
diff --git a/bazel/grpc_deps.bzl b/bazel/grpc_deps.bzl
index 162ec1f5f5..7c349dbcdc 100644
--- a/bazel/grpc_deps.bzl
+++ b/bazel/grpc_deps.bzl
@@ -2,6 +2,22 @@
def grpc_deps():
"""Loads dependencies need to compile and test the grpc library."""
+
+ native.bind(
+ name = "nanopb",
+ actual = "@com_github_nanopb_nanopb//:nanopb",
+ )
+
+ native.bind(
+ name = "absl-base",
+ actual = "@com_google_absl//absl/base",
+ )
+
+ native.bind(
+ name = "absl-time",
+ actual = "@com_google_absl//absl/time:time",
+ )
+
native.bind(
name = "libssl",
actual = "@boringssl//:ssl",
@@ -59,12 +75,27 @@ def grpc_deps():
native.bind(
name = "grpc_cpp_plugin",
- actual = "@com_github_grpc_grpc//:grpc_cpp_plugin"
+ actual = "@com_github_grpc_grpc//:grpc_cpp_plugin",
)
native.bind(
name = "grpc++_codegen_proto",
- actual = "@com_github_grpc_grpc//:grpc++_codegen_proto"
+ actual = "@com_github_grpc_grpc//:grpc++_codegen_proto",
+ )
+
+ native.bind(
+ name = "opencensus-trace",
+ actual = "@io_opencensus_cpp//opencensus/trace:trace"
+ )
+
+ native.bind(
+ name = "opencensus-stats",
+ actual = "@io_opencensus_cpp//opencensus/stats:stats"
+ )
+
+ native.bind(
+ name = "opencensus-stats-test",
+ actual = "@io_opencensus_cpp//opencensus/stats:test_utils"
)
if "boringssl" not in native.existing_rules():
@@ -87,6 +118,14 @@ def grpc_deps():
name = "com_google_protobuf",
strip_prefix = "protobuf-b5fbb742af122b565925987e65c08957739976a7",
url = "https://github.com/google/protobuf/archive/b5fbb742af122b565925987e65c08957739976a7.tar.gz",
+ )
+
+ if "com_github_nanopb_nanopb" not in native.existing_rules():
+ native.new_http_archive(
+ name = "com_github_nanopb_nanopb",
+ build_file = "@com_github_grpc_grpc//third_party:nanopb.BUILD",
+ strip_prefix = "nanopb-f8ac463766281625ad710900479130c7fcb4d63b",
+ url = "https://github.com/nanopb/nanopb/archive/f8ac463766281625ad710900479130c7fcb4d63b.tar.gz",
)
if "com_github_google_googletest" not in native.existing_rules():
@@ -108,8 +147,8 @@ def grpc_deps():
native.new_http_archive(
name = "com_github_google_benchmark",
build_file = "@com_github_grpc_grpc//third_party:benchmark.BUILD",
- strip_prefix = "benchmark-5b7683f49e1e9223cf9927b24f6fd3d6bd82e3f8",
- url = "https://github.com/google/benchmark/archive/5b7683f49e1e9223cf9927b24f6fd3d6bd82e3f8.tar.gz",
+ strip_prefix = "benchmark-9913418d323e64a0111ca0da81388260c2bbe1e9",
+ url = "https://github.com/google/benchmark/archive/9913418d323e64a0111ca0da81388260c2bbe1e9.tar.gz",
)
if "com_github_cares_cares" not in native.existing_rules():
@@ -123,8 +162,8 @@ def grpc_deps():
if "com_google_absl" not in native.existing_rules():
native.http_archive(
name = "com_google_absl",
- strip_prefix = "abseil-cpp-cc4bed2d74f7c8717e31f9579214ab52a9c9c610",
- url = "https://github.com/abseil/abseil-cpp/archive/cc4bed2d74f7c8717e31f9579214ab52a9c9c610.tar.gz",
+ strip_prefix = "abseil-cpp-cd95e71df6eaf8f2a282b1da556c2cf1c9b09207",
+ url = "https://github.com/abseil/abseil-cpp/archive/cd95e71df6eaf8f2a282b1da556c2cf1c9b09207.tar.gz",
)
if "com_github_bazelbuild_bazeltoolchains" not in native.existing_rules():
@@ -138,6 +177,14 @@ def grpc_deps():
sha256 = "1c4a532b396c698e6467a1548554571cb85fa091e472b05e398ebc836c315d77",
)
+ if "io_opencensus_cpp" not in native.existing_rules():
+ native.http_archive(
+ name = "io_opencensus_cpp",
+ strip_prefix = "opencensus-cpp-fdf0f308b1631bb4a942e32ba5d22536a6170274",
+ url = "https://github.com/census-instrumentation/opencensus-cpp/archive/fdf0f308b1631bb4a942e32ba5d22536a6170274.tar.gz",
+ )
+
+
# TODO: move some dependencies from "grpc_deps" here?
def grpc_test_only_deps():
"""Internal, not intended for use by packages that are consuming grpc.
diff --git a/build.yaml b/build.yaml
index 1c6c98ff09..b9e5895207 100644
--- a/build.yaml
+++ b/build.yaml
@@ -13,8 +13,8 @@ settings:
'#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: 6.0.0-dev
- g_stands_for: gloriosa
- version: 1.13.0-dev
+ g_stands_for: gladiolus
+ version: 1.14.0-dev
filegroups:
- name: alts_proto
headers:
@@ -100,10 +100,9 @@ filegroups:
public_headers:
- include/grpc/census.h
src:
- - src/core/ext/census/grpc_context.cc
+ - src/cpp/ext/filters/census/grpc_context.cc
uses:
- grpc_base
- - nanopb
- name: cmdline
headers:
- test/core/util/cmdline.h
@@ -235,6 +234,7 @@ filegroups:
- src/core/lib/channel/channel_stack.cc
- src/core/lib/channel/channel_stack_builder.cc
- src/core/lib/channel/channel_trace.cc
+ - src/core/lib/channel/channelz.cc
- src/core/lib/channel/channelz_registry.cc
- src/core/lib/channel/connected_channel.cc
- src/core/lib/channel/handshaker.cc
@@ -393,7 +393,6 @@ filegroups:
- include/grpc/grpc.h
- include/grpc/grpc_posix.h
- include/grpc/grpc_security_constants.h
- - include/grpc/load_reporting.h
- include/grpc/slice.h
- include/grpc/slice_buffer.h
- include/grpc/status.h
@@ -405,6 +404,7 @@ filegroups:
- src/core/lib/channel/channel_stack.h
- src/core/lib/channel/channel_stack_builder.h
- src/core/lib/channel/channel_trace.h
+ - src/core/lib/channel/channelz.h
- src/core/lib/channel/channelz_registry.h
- src/core/lib/channel/connected_channel.h
- src/core/lib/channel/context.h
@@ -536,6 +536,19 @@ filegroups:
uses:
- grpc_codegen
- grpc_trace_headers
+- name: grpc_cfstream
+ headers:
+ - src/core/lib/iomgr/cfstream_handle.h
+ - src/core/lib/iomgr/endpoint_cfstream.h
+ - src/core/lib/iomgr/error_cfstream.h
+ src:
+ - src/core/lib/iomgr/cfstream_handle.cc
+ - src/core/lib/iomgr/endpoint_cfstream.cc
+ - src/core/lib/iomgr/error_cfstream.cc
+ - src/core/lib/iomgr/tcp_client_cfstream.cc
+ uses:
+ - grpc_base_headers
+ - gpr_base_headers
- name: grpc_client_authority_filter
headers:
- src/core/ext/filters/http/client_authority_filter.h
@@ -639,6 +652,8 @@ filegroups:
- src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc
- src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc
- src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc
+ - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c
+ - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c
- src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c
plugin: grpc_lb_policy_grpclb
uses:
@@ -660,6 +675,8 @@ filegroups:
- src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc
- src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc
- src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc
+ - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c
+ - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c
- src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c
plugin: grpc_lb_policy_grpclb
uses:
@@ -712,6 +729,7 @@ filegroups:
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
src:
- src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
+ - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc
@@ -808,16 +826,6 @@ filegroups:
- src/core/ext/filters/workarounds/workaround_utils.cc
uses:
- grpc_base
-- name: grpc_server_load_reporting
- headers:
- - src/core/ext/filters/load_reporting/server_load_reporting_filter.h
- - src/core/ext/filters/load_reporting/server_load_reporting_plugin.h
- src:
- - src/core/ext/filters/load_reporting/server_load_reporting_filter.cc
- - src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc
- plugin: grpc_server_load_reporting_plugin
- uses:
- - grpc_base
- name: grpc_test_util_base
build: test
headers:
@@ -1425,7 +1433,6 @@ libs:
- grpc_resolver_dns_native
- grpc_resolver_sockaddr
- grpc_resolver_fake
- - grpc_server_load_reporting
- grpc_secure
- census
- grpc_max_age_filter
@@ -1452,7 +1459,6 @@ libs:
- grpc_base
- grpc_transport_cronet_client_secure
- grpc_transport_chttp2_client_secure
- - grpc_server_load_reporting
generate_plugin_registry: true
platforms:
- linux
@@ -1526,7 +1532,6 @@ libs:
- grpc_resolver_dns_native
- grpc_resolver_sockaddr
- grpc_resolver_fake
- - grpc_server_load_reporting
- grpc_lb_policy_grpclb
- grpc_lb_policy_pick_first
- grpc_lb_policy_round_robin
@@ -1917,15 +1922,6 @@ libs:
- test/cpp/interop/interop_server_bootstrap.cc
deps:
- interop_server_lib
-- name: lb_load_data_store
- build: private
- language: c++
- headers:
- - src/cpp/server/load_reporter/load_data_store.h
- src:
- - src/cpp/server/load_reporter/load_data_store.cc
- deps:
- - grpc++
- name: qps
build: private
language: c++
@@ -2045,6 +2041,7 @@ targets:
dict: test/core/end2end/fuzzers/api_fuzzer.dictionary
maxlen: 2048
- name: arena_test
+ cpu_cost: 10
build: test
language: c
src:
@@ -2289,6 +2286,21 @@ targets:
- gpr_test_util
- gpr
uses_polling: false
+- name: ev_epollex_linux_test
+ cpu_cost: 3
+ build: test
+ language: c
+ src:
+ - test/core/iomgr/ev_epollex_linux_test.cc
+ deps:
+ - grpc_test_util
+ - grpc
+ - gpr_test_util
+ - gpr
+ exclude_iomgrs:
+ - uv
+ platforms:
+ - linux
- name: ev_epollsig_linux_test
cpu_cost: 3
build: test
@@ -2804,6 +2816,21 @@ targets:
platforms:
- linux
secure: true
+- name: handshake_verify_peer_options
+ build: test
+ language: c
+ src:
+ - test/core/handshake/verify_peer_options.cc
+ deps:
+ - grpc_test_util
+ - grpc
+ - gpr_test_util
+ - gpr
+ exclude_iomgrs:
+ - uv
+ platforms:
+ - linux
+ secure: true
- name: histogram_test
build: test
language: c
@@ -3903,6 +3930,28 @@ targets:
- linux
- posix
uses_polling: false
+- name: bm_channel
+ build: test
+ language: c++
+ src:
+ - test/cpp/microbenchmarks/bm_channel.cc
+ deps:
+ - grpc_benchmark
+ - benchmark
+ - grpc++_test_util_unsecure
+ - grpc_test_util_unsecure
+ - grpc++_unsecure
+ - grpc_unsecure
+ - gpr_test_util
+ - gpr
+ - grpc++_test_config
+ benchmark: true
+ defaults: benchmark
+ platforms:
+ - mac
+ - linux
+ - posix
+ uses_polling: false
- name: bm_chttp2_hpack
build: test
language: c++
@@ -4249,6 +4298,23 @@ targets:
uses:
- grpc++_test
uses_polling: false
+- name: channelz_test
+ gtest: true
+ build: test
+ language: c++
+ src:
+ - test/core/channel/channelz_test.cc
+ deps:
+ - grpc_test_util
+ - grpc++_test_util
+ - grpc++
+ - grpc
+ - gpr_test_util
+ - gpr
+ filegroups:
+ - grpc++_channelz_proto
+ uses:
+ - grpc++_test
- name: check_gcp_environment_linux_test
build: test
language: c++
@@ -4842,20 +4908,6 @@ targets:
- mac
- linux
- posix
-- name: lb_load_data_store_test
- gtest: true
- build: test
- language: c++
- src:
- - test/cpp/server/load_reporter/load_data_store_test.cc
- deps:
- - lb_load_data_store
- - grpc++_test_util
- - grpc_test_util
- - grpc++
- - grpc
- - gpr_test_util
- - gpr
- name: memory_test
gtest: true
build: test
@@ -5505,7 +5557,7 @@ configs:
compile_the_world: true
test_environ:
ASAN_OPTIONS: detect_leaks=1:color=always
- LSAN_OPTIONS: suppressions=tools/lsan_suppressions.txt:report_objects=1
+ LSAN_OPTIONS: suppressions=test/core/util/lsan_suppressions.txt:report_objects=1
asan-noleaks:
CC: clang
CPPFLAGS: -O0 -fsanitize-coverage=edge,trace-pc-guard -fsanitize=address -fno-omit-frame-pointer
@@ -5529,7 +5581,7 @@ configs:
compile_the_world: true
test_environ:
ASAN_OPTIONS: detect_leaks=1:color=always
- LSAN_OPTIONS: suppressions=tools/lsan_suppressions.txt:report_objects=1
+ LSAN_OPTIONS: suppressions=test/core/util/lsan_suppressions.txt:report_objects=1
basicprof:
CPPFLAGS: -O2 -DGRPC_BASIC_PROFILER -DGRPC_TIMERS_RDTSC
DEFINES: NDEBUG
@@ -5603,7 +5655,7 @@ configs:
LDXX: clang++
compile_the_world: true
test_environ:
- TSAN_OPTIONS: suppressions=tools/tsan_suppressions.txt:halt_on_error=1:second_deadlock_stack=1
+ TSAN_OPTIONS: suppressions=test/core/util/tsan_suppressions.txt:halt_on_error=1:second_deadlock_stack=1
ubsan:
CC: clang
CPPFLAGS: -O0 -fsanitize-coverage=edge,trace-pc-guard -fsanitize=undefined -fno-omit-frame-pointer
@@ -5615,7 +5667,7 @@ configs:
LDXX: clang++
compile_the_world: true
test_environ:
- UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1:suppressions=tools/ubsan_suppressions.txt
+ UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1:suppressions=test/core/util/ubsan_suppressions.txt
defaults:
ares:
CFLAGS: -Wno-sign-conversion $(if $(subst Darwin,,$(SYSTEM)),,-Wno-shorten-64-to-32)
@@ -5642,7 +5694,7 @@ defaults:
global:
COREFLAGS: -fno-rtti -fno-exceptions
CPPFLAGS: -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1
- -Wno-deprecated-declarations
+ -Wno-deprecated-declarations -Ithird_party/nanopb -DPB_FIELD_32BIT
LDFLAGS: -g
zlib:
CFLAGS: -Wno-sign-conversion -Wno-conversion -Wno-unused-value -Wno-implicit-function-declaration
diff --git a/src/python/grpcio_tests/tests/unit/_junkdrawer/__init__.py b/cmake/nanopb.cmake
index 5fb4f3c3cf..cebf6da27c 100644
--- a/src/python/grpcio_tests/tests/unit/_junkdrawer/__init__.py
+++ b/cmake/nanopb.cmake
@@ -1,4 +1,4 @@
-# Copyright 2015 gRPC authors.
+# Copyright 2018 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -11,3 +11,5 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+
+set(_gRPC_NANOPB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/nanopb")
diff --git a/config.m4 b/config.m4
index 8190485249..3cf2b3e7b1 100644
--- a/config.m4
+++ b/config.m4
@@ -9,11 +9,12 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/src/php/ext/grpc)
PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/boringssl/include)
PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/address_sorting/include)
+ PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/nanopb)
LIBS="-lpthread $LIBS"
- CFLAGS="-Wall -Werror -Wno-parentheses-equality -Wno-unused-value -std=c11 -g -O2 -D PB_FIELD_16BIT=1"
- CXXFLAGS="-std=c++11 -fno-exceptions -fno-rtti -g -O2 -D PB_FIELD_16BIT=1"
+ CFLAGS="-Wall -Werror -Wno-parentheses-equality -Wno-unused-value -std=c11 -g -O2 -D PB_FIELD_32BIT=1"
+ CXXFLAGS="-std=c++11 -fno-exceptions -fno-rtti -g -O2 -D PB_FIELD_32BIT=1"
GRPC_SHARED_LIBADD="-lpthread $GRPC_SHARED_LIBADD"
PHP_REQUIRE_CXX()
PHP_ADD_LIBRARY(pthread)
@@ -89,6 +90,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/channel/channel_stack.cc \
src/core/lib/channel/channel_stack_builder.cc \
src/core/lib/channel/channel_trace.cc \
+ src/core/lib/channel/channelz.cc \
src/core/lib/channel/channelz_registry.cc \
src/core/lib/channel/connected_channel.cc \
src/core/lib/channel/handshaker.cc \
@@ -365,19 +367,20 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc \
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc \
src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc \
+ src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c \
+ src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c \
src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c \
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \
src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \
src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \
+ src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc \
src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc \
src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc \
- src/core/ext/filters/load_reporting/server_load_reporting_filter.cc \
- src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc \
- src/core/ext/census/grpc_context.cc \
+ src/cpp/ext/filters/census/grpc_context.cc \
src/core/ext/filters/max_age/max_age_filter.cc \
src/core/ext/filters/message_size/message_size_filter.cc \
src/core/ext/filters/http/client_authority_filter.cc \
@@ -648,10 +651,10 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/php/ext/grpc)
PHP_ADD_BUILD_DIR($ext_builddir/src/boringssl)
- PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/census)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/grpclb)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/pick_first)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/round_robin)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/dns/c_ares)
@@ -663,7 +666,6 @@ if test "$PHP_GRPC" != "no"; then
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/filters/workarounds)
@@ -711,6 +713,7 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/tsi/alts/handshaker)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/tsi/alts/zero_copy_frame_protector)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/tsi/ssl/session_cache)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/cpp/ext/filters/census)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/address_sorting)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/asn1)
diff --git a/config.w32 b/config.w32
index db7679ce53..ecdd941c98 100644
--- a/config.w32
+++ b/config.w32
@@ -65,6 +65,7 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\channel\\channel_stack.cc " +
"src\\core\\lib\\channel\\channel_stack_builder.cc " +
"src\\core\\lib\\channel\\channel_trace.cc " +
+ "src\\core\\lib\\channel\\channelz.cc " +
"src\\core\\lib\\channel\\channelz_registry.cc " +
"src\\core\\lib\\channel\\connected_channel.cc " +
"src\\core\\lib\\channel\\handshaker.cc " +
@@ -341,19 +342,20 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\grpclb_channel_secure.cc " +
"src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\grpclb_client_stats.cc " +
"src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\load_balancer_api.cc " +
+ "src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1\\google\\protobuf\\duration.pb.c " +
+ "src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1\\google\\protobuf\\timestamp.pb.c " +
"src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1\\load_balancer.pb.c " +
"src\\core\\ext\\filters\\client_channel\\resolver\\fake\\fake_resolver.cc " +
"src\\core\\ext\\filters\\client_channel\\lb_policy\\pick_first\\pick_first.cc " +
"src\\core\\ext\\filters\\client_channel\\lb_policy\\round_robin\\round_robin.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\dns_resolver_ares.cc " +
+ "src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\grpc_ares_ev_driver.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\grpc_ares_ev_driver_posix.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\grpc_ares_wrapper.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\grpc_ares_wrapper_fallback.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\dns\\native\\dns_resolver.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\sockaddr\\sockaddr_resolver.cc " +
- "src\\core\\ext\\filters\\load_reporting\\server_load_reporting_filter.cc " +
- "src\\core\\ext\\filters\\load_reporting\\server_load_reporting_plugin.cc " +
- "src\\core\\ext\\census\\grpc_context.cc " +
+ "src\\cpp\\ext\\filters\\census\\grpc_context.cc " +
"src\\core\\ext\\filters\\max_age\\max_age_filter.cc " +
"src\\core\\ext\\filters\\message_size\\message_size_filter.cc " +
"src\\core\\ext\\filters\\http\\client_authority_filter.cc " +
@@ -637,13 +639,14 @@ if (PHP_GRPC != "no") {
EXTENSION("grpc", grpc_source, null,
"/DOPENSSL_NO_ASM /D_GNU_SOURCE /DWIN32_LEAN_AND_MEAN "+
"/D_HAS_EXCEPTIONS=0 /DNOMINMAX /DGRPC_ARES=0 /D_WIN32_WINNT=0x600 "+
- "/DPB_FIELD_16BIT "+
+ "/DPB_FIELD_32BIT "+
"/I"+configure_module_dirname+" "+
"/I"+configure_module_dirname+"\\include "+
"/I"+configure_module_dirname+"\\src\\php\\ext\\grpc "+
"/I"+configure_module_dirname+"\\third_party\\boringssl\\include "+
"/I"+configure_module_dirname+"\\third_party\\zlib "+
- "/I"+configure_module_dirname+"\\third_party\\address_sorting\\include");
+ "/I"+configure_module_dirname+"\\third_party\\address_sorting\\include "+
+ "/I"+configure_module_dirname+"\\third_party\\nanopb");
base_dir = get_define('BUILD_DIR');
FSO.CreateFolder(base_dir+"\\ext");
@@ -652,7 +655,6 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\boringssl");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\census");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy");
@@ -661,6 +663,8 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1\\google");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1\\google\\protobuf");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\pick_first");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\round_robin");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver");
@@ -674,7 +678,6 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\http\\client");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\http\\message_compress");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\http\\server");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\load_reporting");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\max_age");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\message_size");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\workarounds");
@@ -728,6 +731,10 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\tsi\\alts\\zero_copy_frame_protector");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\tsi\\ssl");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\tsi\\ssl\\session_cache");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\cpp");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\cpp\\ext");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\cpp\\ext\\filters");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\cpp\\ext\\filters\\census");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\php");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\php\\ext");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\php\\ext\\grpc");
diff --git a/doc/PROTOCOL-WEB.md b/doc/PROTOCOL-WEB.md
index 5100c9b555..a06dfb1b54 100644
--- a/doc/PROTOCOL-WEB.md
+++ b/doc/PROTOCOL-WEB.md
@@ -138,4 +138,4 @@ Versioning
Browser-specific features
-* For features that are unique to browser or HTML clients, check the [spec doc](https://github.com/grpc/grpc-web/blob/master/PROTOCOL-WEB.md) published in the grpc/grpc-web repo.
+* For features that are unique to browser or HTML clients, check the [spec doc](https://github.com/grpc/grpc-web/blob/master/BROWSER-FEATURES.md) published in the grpc/grpc-web repo.
diff --git a/doc/command_line_tool.md b/doc/command_line_tool.md
index 082e6402eb..6337acaf60 100644
--- a/doc/command_line_tool.md
+++ b/doc/command_line_tool.md
@@ -32,7 +32,7 @@ The command line tool should support the following things:
To use the tool, you need to get the grpc repository and make sure your system
has the prerequisites for building grpc from source, given in the [installation
-instructions](https://github.com/grpc/grpc/blob/master/INSTALL.md).
+instructions](../BUILDING.md).
In order to build the grpc command line tool from a fresh clone of the grpc
repository, you need to run the following command to update submodules:
diff --git a/doc/g_stands_for.md b/doc/g_stands_for.md
index 8b9cf91d3e..f86bd76f32 100644
--- a/doc/g_stands_for.md
+++ b/doc/g_stands_for.md
@@ -12,4 +12,5 @@
- 1.10 'g' stands for ['glamorous'](https://github.com/grpc/grpc/tree/v1.10.x)
- 1.11 'g' stands for ['gorgeous'](https://github.com/grpc/grpc/tree/v1.11.x)
- 1.12 'g' stands for ['glorious'](https://github.com/grpc/grpc/tree/v1.12.x)
-- 1.13 'g' stands for ['gloriosa'](https://github.com/grpc/grpc/tree/master)
+- 1.13 'g' stands for ['gloriosa'](https://github.com/grpc/grpc/tree/v1.13.x)
+- 1.14 'g' stands for ['gladiolus'](https://github.com/grpc/grpc/tree/master)
diff --git a/examples/cpp/README.md b/examples/cpp/README.md
index 8e2bb5d13b..0e358bf9a2 100644
--- a/examples/cpp/README.md
+++ b/examples/cpp/README.md
@@ -3,7 +3,7 @@
## Installation
To install gRPC on your system, follow the instructions to build from source
-[here](../../INSTALL.md). This also installs the protocol buffer compiler
+[here](../../BUILDING.md). This also installs the protocol buffer compiler
`protoc` (if you don't have it already), and the C++ gRPC plugin for `protoc`.
## Hello C++ gRPC!
diff --git a/examples/cpp/cpptutorial.md b/examples/cpp/cpptutorial.md
index 7d98367da4..c40676de13 100644
--- a/examples/cpp/cpptutorial.md
+++ b/examples/cpp/cpptutorial.md
@@ -35,7 +35,7 @@ updating.
The example code for our tutorial is in [examples/cpp/route_guide](route_guide).
You also should have the relevant tools installed to generate the server and
client interface code - if you don't already, follow the setup instructions in
-[INSTALL.md](../../INSTALL.md).
+[BUILDING.md](../../BUILDING.md).
## Defining the service
@@ -130,7 +130,7 @@ a special gRPC C++ plugin.
For simplicity, we've provided a [Makefile](route_guide/Makefile) that runs
`protoc` for you with the appropriate plugin, input, and output (if you want to
run this yourself, make sure you've installed protoc and followed the gRPC code
-[installation instructions](../../INSTALL.md) first):
+[installation instructions](../../BUILDING.md) first):
```shell
$ make route_guide.grpc.pb.cc route_guide.pb.cc
diff --git a/examples/cpp/helloworld/README.md b/examples/cpp/helloworld/README.md
index 18d3d79dcc..c598658b1d 100644
--- a/examples/cpp/helloworld/README.md
+++ b/examples/cpp/helloworld/README.md
@@ -1,8 +1,8 @@
# gRPC C++ Hello World Tutorial
### Install gRPC
-Make sure you have installed gRPC on your system. Follow the instructions here:
-[https://github.com/grpc/grpc/blob/master/INSTALL](../../../INSTALL.md).
+Make sure you have installed gRPC on your system. Follow the
+[BUILDING.md](../../../BUILDING.md) instructions.
### Get the tutorial source code
diff --git a/examples/cpp/route_guide/README.md b/examples/cpp/route_guide/README.md
new file mode 100644
index 0000000000..1cb5a409f8
--- /dev/null
+++ b/examples/cpp/route_guide/README.md
@@ -0,0 +1,6 @@
+# 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++.
+
+[gRPC Basics: C++]:https://grpc.io/docs/tutorials/basic/c.html
diff --git a/examples/python/helloworld/greeter_client.py b/examples/python/helloworld/greeter_client.py
index a0aeb47bd7..24b49ac233 100644
--- a/examples/python/helloworld/greeter_client.py
+++ b/examples/python/helloworld/greeter_client.py
@@ -22,9 +22,12 @@ import helloworld_pb2_grpc
def run():
- channel = grpc.insecure_channel('localhost:50051')
- stub = helloworld_pb2_grpc.GreeterStub(channel)
- response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'))
+ # NOTE(gRPC Python Team): .close() is possible on a channel and should be
+ # used in circumstances in which the with statement does not fit the needs
+ # of the code.
+ with grpc.insecure_channel('localhost:50051') as channel:
+ stub = helloworld_pb2_grpc.GreeterStub(channel)
+ response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'))
print("Greeter client received: " + response.message)
diff --git a/examples/python/interceptors/default_value/greeter_client.py b/examples/python/interceptors/default_value/greeter_client.py
index aba7571d83..da21ac68ec 100644
--- a/examples/python/interceptors/default_value/greeter_client.py
+++ b/examples/python/interceptors/default_value/greeter_client.py
@@ -27,10 +27,14 @@ def run():
message='Hello from your local interceptor!')
default_value_interceptor = default_value_client_interceptor.DefaultValueClientInterceptor(
default_value)
- channel = grpc.insecure_channel('localhost:50051')
- channel = grpc.intercept_channel(channel, default_value_interceptor)
- stub = helloworld_pb2_grpc.GreeterStub(channel)
- response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'))
+ # NOTE(gRPC Python Team): .close() is possible on a channel and should be
+ # used in circumstances in which the with statement does not fit the needs
+ # of the code.
+ with grpc.insecure_channel('localhost:50051') as channel:
+ intercept_channel = grpc.intercept_channel(channel,
+ default_value_interceptor)
+ stub = helloworld_pb2_grpc.GreeterStub(intercept_channel)
+ response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'))
print("Greeter client received: " + response.message)
diff --git a/examples/python/interceptors/headers/greeter_client.py b/examples/python/interceptors/headers/greeter_client.py
index 2b0dd3e177..6a09a3b9c5 100644
--- a/examples/python/interceptors/headers/greeter_client.py
+++ b/examples/python/interceptors/headers/greeter_client.py
@@ -25,10 +25,14 @@ import header_manipulator_client_interceptor
def run():
header_adder_interceptor = header_manipulator_client_interceptor.header_adder_interceptor(
'one-time-password', '42')
- channel = grpc.insecure_channel('localhost:50051')
- channel = grpc.intercept_channel(channel, header_adder_interceptor)
- stub = helloworld_pb2_grpc.GreeterStub(channel)
- response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'))
+ # NOTE(gRPC Python Team): .close() is possible on a channel and should be
+ # used in circumstances in which the with statement does not fit the needs
+ # of the code.
+ with grpc.insecure_channel('localhost:50051') as channel:
+ intercept_channel = grpc.intercept_channel(channel,
+ header_adder_interceptor)
+ stub = helloworld_pb2_grpc.GreeterStub(intercept_channel)
+ response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'))
print("Greeter client received: " + response.message)
diff --git a/examples/python/multiplex/multiplex_client.py b/examples/python/multiplex/multiplex_client.py
index 9baa10247d..19d39ce66e 100644
--- a/examples/python/multiplex/multiplex_client.py
+++ b/examples/python/multiplex/multiplex_client.py
@@ -106,20 +106,23 @@ def guide_route_chat(route_guide_stub):
def run():
- channel = grpc.insecure_channel('localhost:50051')
- greeter_stub = helloworld_pb2_grpc.GreeterStub(channel)
- route_guide_stub = route_guide_pb2_grpc.RouteGuideStub(channel)
- greeter_response = greeter_stub.SayHello(
- helloworld_pb2.HelloRequest(name='you'))
- print("Greeter client received: " + greeter_response.message)
- print("-------------- GetFeature --------------")
- guide_get_feature(route_guide_stub)
- print("-------------- ListFeatures --------------")
- guide_list_features(route_guide_stub)
- print("-------------- RecordRoute --------------")
- guide_record_route(route_guide_stub)
- print("-------------- RouteChat --------------")
- guide_route_chat(route_guide_stub)
+ # NOTE(gRPC Python Team): .close() is possible on a channel and should be
+ # used in circumstances in which the with statement does not fit the needs
+ # of the code.
+ with grpc.insecure_channel('localhost:50051') as channel:
+ greeter_stub = helloworld_pb2_grpc.GreeterStub(channel)
+ route_guide_stub = route_guide_pb2_grpc.RouteGuideStub(channel)
+ greeter_response = greeter_stub.SayHello(
+ helloworld_pb2.HelloRequest(name='you'))
+ print("Greeter client received: " + greeter_response.message)
+ print("-------------- GetFeature --------------")
+ guide_get_feature(route_guide_stub)
+ print("-------------- ListFeatures --------------")
+ guide_list_features(route_guide_stub)
+ print("-------------- RecordRoute --------------")
+ guide_record_route(route_guide_stub)
+ print("-------------- RouteChat --------------")
+ guide_route_chat(route_guide_stub)
if __name__ == '__main__':
diff --git a/examples/python/route_guide/route_guide_client.py b/examples/python/route_guide/route_guide_client.py
index f2d4317ef1..b4ff3239ba 100644
--- a/examples/python/route_guide/route_guide_client.py
+++ b/examples/python/route_guide/route_guide_client.py
@@ -100,16 +100,19 @@ def guide_route_chat(stub):
def run():
- channel = grpc.insecure_channel('localhost:50051')
- stub = route_guide_pb2_grpc.RouteGuideStub(channel)
- print("-------------- GetFeature --------------")
- guide_get_feature(stub)
- print("-------------- ListFeatures --------------")
- guide_list_features(stub)
- print("-------------- RecordRoute --------------")
- guide_record_route(stub)
- print("-------------- RouteChat --------------")
- guide_route_chat(stub)
+ # NOTE(gRPC Python Team): .close() is possible on a channel and should be
+ # used in circumstances in which the with statement does not fit the needs
+ # of the code.
+ with grpc.insecure_channel('localhost:50051') as channel:
+ stub = route_guide_pb2_grpc.RouteGuideStub(channel)
+ print("-------------- GetFeature --------------")
+ guide_get_feature(stub)
+ print("-------------- ListFeatures --------------")
+ guide_list_features(stub)
+ print("-------------- RecordRoute --------------")
+ guide_record_route(stub)
+ print("-------------- RouteChat --------------")
+ guide_route_chat(stub)
if __name__ == '__main__':
diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec
index 262de72971..7eb7abed8a 100644
--- a/gRPC-C++.podspec
+++ b/gRPC-C++.podspec
@@ -23,7 +23,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC-C++'
# TODO (mxyan): use version that match gRPC version when pod is stabilized
- # version = '1.13.0-dev'
+ # version = '1.14.0-dev'
version = '0.0.2'
s.version = version
s.summary = 'gRPC C++ library'
@@ -31,7 +31,7 @@ Pod::Spec.new do |s|
s.license = 'Apache License, Version 2.0'
s.authors = { 'The gRPC contributors' => 'grpc-packages@google.com' }
- grpc_version = '1.13.0-dev'
+ grpc_version = '1.14.0-dev'
s.source = {
:git => 'https://github.com/grpc/grpc.git',
@@ -347,6 +347,7 @@ Pod::Spec.new do |s|
'src/core/lib/channel/channel_stack.h',
'src/core/lib/channel/channel_stack_builder.h',
'src/core/lib/channel/channel_trace.h',
+ 'src/core/lib/channel/channelz.h',
'src/core/lib/channel/channelz_registry.h',
'src/core/lib/channel/connected_channel.h',
'src/core/lib/channel/context.h',
@@ -483,8 +484,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/lb_policy/subchannel_list.h',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h',
- 'src/core/ext/filters/load_reporting/server_load_reporting_filter.h',
- 'src/core/ext/filters/load_reporting/server_load_reporting_plugin.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/http/client_authority_filter.h',
@@ -532,6 +531,7 @@ Pod::Spec.new do |s|
'src/core/lib/channel/channel_stack.h',
'src/core/lib/channel/channel_stack_builder.h',
'src/core/lib/channel/channel_trace.h',
+ 'src/core/lib/channel/channelz.h',
'src/core/lib/channel/channelz_registry.h',
'src/core/lib/channel/connected_channel.h',
'src/core/lib/channel/context.h',
@@ -663,9 +663,9 @@ Pod::Spec.new do |s|
end
s.prepare_command = <<-END_OF_COMMAND
- find src/cpp/ -type f -exec sed -E -i'.back' 's;#include "third_party/nanopb/(.*)";#include <nanopb/\\1>;g' {} \\\;
- find src/cpp/ -name "*.back" -type f -delete
- find src/core/ -regex ".*\.h" -type f -exec sed -E -i'.back' 's;#include "third_party/nanopb/(.*)";#include <nanopb/\\1>;g' {} \\\;
- find src/core/ -name "*.back" -type f -delete
+ find src/cpp/ -type f ! -path '*.grpc_back' -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(pb(_.*)?\\.h)";#include <nanopb/\\1>;g'
+ find src/cpp/ -type f -path '*.grpc_back' -print0 | xargs -0 rm
+ find src/core/ -type f ! -path '*.grpc_back' -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(pb(_.*)?\\.h)";#include <nanopb/\\1>;g'
+ find src/core/ -type f -path '*.grpc_back' -print0 | xargs -0 rm
END_OF_COMMAND
end
diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec
index f3be7129b5..11988ef5a4 100644
--- a/gRPC-Core.podspec
+++ b/gRPC-Core.podspec
@@ -22,7 +22,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC-Core'
- version = '1.13.0-dev'
+ version = '1.14.0-dev'
s.version = version
s.summary = 'Core cross-platform gRPC library, written in C'
s.homepage = 'https://grpc.io'
@@ -168,7 +168,6 @@ Pod::Spec.new do |s|
'include/grpc/grpc.h',
'include/grpc/grpc_posix.h',
'include/grpc/grpc_security_constants.h',
- 'include/grpc/load_reporting.h',
'include/grpc/slice.h',
'include/grpc/slice_buffer.h',
'include/grpc/status.h',
@@ -357,6 +356,7 @@ Pod::Spec.new do |s|
'src/core/lib/channel/channel_stack.h',
'src/core/lib/channel/channel_stack_builder.h',
'src/core/lib/channel/channel_trace.h',
+ 'src/core/lib/channel/channelz.h',
'src/core/lib/channel/channelz_registry.h',
'src/core/lib/channel/connected_channel.h',
'src/core/lib/channel/context.h',
@@ -493,8 +493,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/lb_policy/subchannel_list.h',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h',
- 'src/core/ext/filters/load_reporting/server_load_reporting_filter.h',
- 'src/core/ext/filters/load_reporting/server_load_reporting_plugin.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/http/client_authority_filter.h',
@@ -507,6 +505,7 @@ Pod::Spec.new do |s|
'src/core/lib/channel/channel_stack.cc',
'src/core/lib/channel/channel_stack_builder.cc',
'src/core/lib/channel/channel_trace.cc',
+ 'src/core/lib/channel/channelz.cc',
'src/core/lib/channel/channelz_registry.cc',
'src/core/lib/channel/connected_channel.cc',
'src/core/lib/channel/handshaker.cc',
@@ -780,19 +779,20 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc',
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc',
'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc',
+ 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c',
+ 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c',
'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c',
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc',
'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc',
'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc',
+ 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc',
'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc',
'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc',
- 'src/core/ext/filters/load_reporting/server_load_reporting_filter.cc',
- 'src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc',
- 'src/core/ext/census/grpc_context.cc',
+ 'src/cpp/ext/filters/census/grpc_context.cc',
'src/core/ext/filters/max_age/max_age_filter.cc',
'src/core/ext/filters/message_size/message_size_filter.cc',
'src/core/ext/filters/http/client_authority_filter.cc',
@@ -935,6 +935,7 @@ Pod::Spec.new do |s|
'src/core/lib/channel/channel_stack.h',
'src/core/lib/channel/channel_stack_builder.h',
'src/core/lib/channel/channel_trace.h',
+ 'src/core/lib/channel/channelz.h',
'src/core/lib/channel/channelz_registry.h',
'src/core/lib/channel/connected_channel.h',
'src/core/lib/channel/context.h',
@@ -1071,8 +1072,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/lb_policy/subchannel_list.h',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h',
- 'src/core/ext/filters/load_reporting/server_load_reporting_filter.h',
- 'src/core/ext/filters/load_reporting/server_load_reporting_plugin.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/http/client_authority_filter.h',
@@ -1080,6 +1079,24 @@ Pod::Spec.new do |s|
'src/core/ext/filters/workarounds/workaround_utils.h'
end
+ s.subspec 'CFStream-Implementation' do |ss|
+ ss.header_mappings_dir = '.'
+ ss.dependency "#{s.name}/Implementation", version
+ ss.pod_target_xcconfig = {
+ 'GCC_PREPROCESSOR_DEFINITIONS' => 'GRPC_CFSTREAM=1'
+ }
+ ss.source_files = 'src/core/lib/iomgr/cfstream_handle.cc',
+ 'src/core/lib/iomgr/endpoint_cfstream.cc',
+ 'src/core/lib/iomgr/error_cfstream.cc',
+ 'src/core/lib/iomgr/tcp_client_cfstream.cc',
+ 'src/core/lib/iomgr/cfstream_handle.h',
+ 'src/core/lib/iomgr/endpoint_cfstream.h',
+ 'src/core/lib/iomgr/error_cfstream.h'
+ ss.private_header_files = 'src/core/lib/iomgr/cfstream_handle.h',
+ 'src/core/lib/iomgr/endpoint_cfstream.h',
+ 'src/core/lib/iomgr/error_cfstream.h'
+ end
+
s.subspec 'Cronet-Interface' do |ss|
ss.header_mappings_dir = 'include/grpc'
ss.source_files = 'include/grpc/grpc_cronet.h'
@@ -1175,6 +1192,7 @@ Pod::Spec.new do |s|
'test/core/end2end/tests/cancel_before_invoke.cc',
'test/core/end2end/tests/cancel_in_a_vacuum.cc',
'test/core/end2end/tests/cancel_with_status.cc',
+ 'test/core/end2end/tests/channelz.cc',
'test/core/end2end/tests/compressed_payload.cc',
'test/core/end2end/tests/connectivity.cc',
'test/core/end2end/tests/default_host.cc',
@@ -1191,13 +1209,13 @@ Pod::Spec.new do |s|
'test/core/end2end/tests/invoke_large_request.cc',
'test/core/end2end/tests/keepalive_timeout.cc',
'test/core/end2end/tests/large_metadata.cc',
- 'test/core/end2end/tests/load_reporting_hook.cc',
'test/core/end2end/tests/max_concurrent_streams.cc',
'test/core/end2end/tests/max_connection_age.cc',
'test/core/end2end/tests/max_connection_idle.cc',
'test/core/end2end/tests/max_message_length.cc',
'test/core/end2end/tests/negative_deadline.cc',
'test/core/end2end/tests/network_status_change.cc',
+ 'test/core/end2end/tests/no_error_on_hotpath.cc',
'test/core/end2end/tests/no_logging.cc',
'test/core/end2end/tests/no_op.cc',
'test/core/end2end/tests/payload.cc',
@@ -1245,6 +1263,7 @@ Pod::Spec.new do |s|
# TODO (mxyan): Instead of this hack, add include path "third_party" to C core's include path?
s.prepare_command = <<-END_OF_COMMAND
- find src/core/ -type f ! -path '*.back*' -exec sed -E -i'.back' 's;#include "third_party/nanopb/(.*)";#include <nanopb/\\1>;g' {} \\\;
+ find src/core/ -type f ! -path '*.grpc_back' -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(pb(_.*)?\\.h)";#include <nanopb/\\1>;g'
+ find src/core/ -type f -path '*.grpc_back' -print0 | xargs -0 rm
END_OF_COMMAND
end
diff --git a/gRPC-ProtoRPC.podspec b/gRPC-ProtoRPC.podspec
index 17e650c264..6548f36a32 100644
--- a/gRPC-ProtoRPC.podspec
+++ b/gRPC-ProtoRPC.podspec
@@ -21,7 +21,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC-ProtoRPC'
- version = '1.13.0-dev'
+ version = '1.14.0-dev'
s.version = version
s.summary = 'RPC library for Protocol Buffers, based on gRPC'
s.homepage = 'https://grpc.io'
@@ -41,12 +41,25 @@ Pod::Spec.new do |s|
s.header_dir = name
src_dir = 'src/objective-c/ProtoRPC'
- s.source_files = "#{src_dir}/*.{h,m}"
- s.header_mappings_dir = "#{src_dir}"
- s.dependency 'gRPC', version
- s.dependency 'gRPC-RxLibrary', version
- s.dependency 'Protobuf', '~> 3.0'
+ s.default_subspec = 'Main'
+
+ s.subspec 'Main' do |ss|
+ ss.header_mappings_dir = "#{src_dir}"
+ ss.dependency 'gRPC', version
+ ss.dependency 'gRPC-RxLibrary', version
+ ss.dependency 'Protobuf', '~> 3.0'
+
+ ss.source_files = "#{src_dir}/*.{h,m}"
+ end
+ s.subspec 'CFStream' do |ss|
+ ss.dependency 'gRPC/CFStream', version
+ ss.dependency "#{s.name}/Main", version
+ ss.pod_target_xcconfig = {
+ 'GCC_PREPROCESSOR_DEFINITIONS' => 'GRPC_CFSTREAM=1'
+ }
+ end
+
s.pod_target_xcconfig = {
# This is needed by all pods that depend on Protobuf:
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
diff --git a/gRPC-RxLibrary.podspec b/gRPC-RxLibrary.podspec
index b9288afd80..ebd942cf78 100644
--- a/gRPC-RxLibrary.podspec
+++ b/gRPC-RxLibrary.podspec
@@ -21,7 +21,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC-RxLibrary'
- version = '1.13.0-dev'
+ version = '1.14.0-dev'
s.version = version
s.summary = 'Reactive Extensions library for iOS/OSX.'
s.homepage = 'https://grpc.io'
diff --git a/gRPC.podspec b/gRPC.podspec
index afc4581091..d6d59c2141 100644
--- a/gRPC.podspec
+++ b/gRPC.podspec
@@ -20,7 +20,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC'
- version = '1.13.0-dev'
+ version = '1.14.0-dev'
s.version = version
s.summary = 'gRPC client library for iOS/OSX'
s.homepage = 'https://grpc.io'
@@ -63,6 +63,16 @@ Pod::Spec.new do |s|
ss.dependency 'gRPC-Core', version
end
+ # This subspec is mutually exclusive with the `Main` subspec
+ s.subspec 'CFStream' do |ss|
+ ss.dependency 'gRPC-Core/CFStream-Implementation', version
+ ss.dependency "#{s.name}/Main", version
+
+ ss.pod_target_xcconfig = {
+ 'GCC_PREPROCESSOR_DEFINITIONS' => 'GRPC_CFSTREAM=1'
+ }
+ end
+
s.subspec 'GID' do |ss|
ss.ios.deployment_target = '7.0'
diff --git a/grpc.def b/grpc.def
index 6a91214e8c..e7f93396b2 100644
--- a/grpc.def
+++ b/grpc.def
@@ -45,8 +45,6 @@ EXPORTS
grpc_insecure_channel_create
grpc_lame_client_channel_create
grpc_channel_destroy
- grpc_channel_get_trace
- grpc_channel_get_uuid
grpc_call_cancel
grpc_call_cancel_with_status
grpc_call_ref
diff --git a/grpc.gemspec b/grpc.gemspec
index 5ab3713683..30bb522c3a 100644
--- a/grpc.gemspec
+++ b/grpc.gemspec
@@ -173,7 +173,6 @@ Gem::Specification.new do |s|
s.files += %w( include/grpc/grpc.h )
s.files += %w( include/grpc/grpc_posix.h )
s.files += %w( include/grpc/grpc_security_constants.h )
- s.files += %w( include/grpc/load_reporting.h )
s.files += %w( include/grpc/slice.h )
s.files += %w( include/grpc/slice_buffer.h )
s.files += %w( include/grpc/status.h )
@@ -294,6 +293,7 @@ Gem::Specification.new do |s|
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/channel_trace.h )
+ s.files += %w( src/core/lib/channel/channelz.h )
s.files += %w( src/core/lib/channel/channelz_registry.h )
s.files += %w( src/core/lib/channel/connected_channel.h )
s.files += %w( src/core/lib/channel/context.h )
@@ -430,8 +430,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/lb_policy/subchannel_list.h )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h )
- s.files += %w( src/core/ext/filters/load_reporting/server_load_reporting_filter.h )
- s.files += %w( src/core/ext/filters/load_reporting/server_load_reporting_plugin.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/ext/filters/http/client_authority_filter.h )
@@ -444,6 +442,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/channel/channel_stack.cc )
s.files += %w( src/core/lib/channel/channel_stack_builder.cc )
s.files += %w( src/core/lib/channel/channel_trace.cc )
+ s.files += %w( src/core/lib/channel/channelz.cc )
s.files += %w( src/core/lib/channel/channelz_registry.cc )
s.files += %w( src/core/lib/channel/connected_channel.cc )
s.files += %w( src/core/lib/channel/handshaker.cc )
@@ -720,19 +719,20 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc )
+ s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c )
+ s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c )
s.files += %w( src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc )
+ s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc )
- s.files += %w( src/core/ext/filters/load_reporting/server_load_reporting_filter.cc )
- s.files += %w( src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc )
- s.files += %w( src/core/ext/census/grpc_context.cc )
+ s.files += %w( src/cpp/ext/filters/census/grpc_context.cc )
s.files += %w( src/core/ext/filters/max_age/max_age_filter.cc )
s.files += %w( src/core/ext/filters/message_size/message_size_filter.cc )
s.files += %w( src/core/ext/filters/http/client_authority_filter.cc )
diff --git a/grpc.gyp b/grpc.gyp
index 43e2485289..fcb5a3fdf9 100644
--- a/grpc.gyp
+++ b/grpc.gyp
@@ -59,6 +59,8 @@
'-Wno-unused-parameter',
'-DOSATOMIC_USE_INLINED=1',
'-Wno-deprecated-declarations',
+ '-Ithird_party/nanopb',
+ '-DPB_FIELD_32BIT',
],
'ldflags': [
'-g',
@@ -75,6 +77,7 @@
'.',
'../..',
'include',
+ '../../third_party/nanopb',
],
'defines': [
'GRPC_ARES=0',
@@ -137,6 +140,8 @@
'-Wno-unused-parameter',
'-DOSATOMIC_USE_INLINED=1',
'-Wno-deprecated-declarations',
+ '-Ithird_party/nanopb',
+ '-DPB_FIELD_32BIT',
],
'OTHER_CPLUSPLUSFLAGS': [
'-g',
@@ -147,6 +152,8 @@
'-Wno-unused-parameter',
'-DOSATOMIC_USE_INLINED=1',
'-Wno-deprecated-declarations',
+ '-Ithird_party/nanopb',
+ '-DPB_FIELD_32BIT',
'-stdlib=libc++',
'-std=c++11',
'-Wno-error=deprecated-declarations',
@@ -275,6 +282,7 @@
'src/core/lib/channel/channel_stack.cc',
'src/core/lib/channel/channel_stack_builder.cc',
'src/core/lib/channel/channel_trace.cc',
+ 'src/core/lib/channel/channelz.cc',
'src/core/lib/channel/channelz_registry.cc',
'src/core/lib/channel/connected_channel.cc',
'src/core/lib/channel/handshaker.cc',
@@ -551,19 +559,20 @@
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc',
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc',
'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc',
+ 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c',
+ 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c',
'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c',
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc',
'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc',
'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc',
+ 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc',
'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc',
'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc',
- 'src/core/ext/filters/load_reporting/server_load_reporting_filter.cc',
- 'src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc',
- 'src/core/ext/census/grpc_context.cc',
+ 'src/cpp/ext/filters/census/grpc_context.cc',
'src/core/ext/filters/max_age/max_age_filter.cc',
'src/core/ext/filters/message_size/message_size_filter.cc',
'src/core/ext/filters/http/client_authority_filter.cc',
@@ -624,6 +633,7 @@
'src/core/lib/channel/channel_stack.cc',
'src/core/lib/channel/channel_stack_builder.cc',
'src/core/lib/channel/channel_trace.cc',
+ 'src/core/lib/channel/channelz.cc',
'src/core/lib/channel/channelz_registry.cc',
'src/core/lib/channel/connected_channel.cc',
'src/core/lib/channel/handshaker.cc',
@@ -855,6 +865,7 @@
'src/core/lib/channel/channel_stack.cc',
'src/core/lib/channel/channel_stack_builder.cc',
'src/core/lib/channel/channel_trace.cc',
+ 'src/core/lib/channel/channelz.cc',
'src/core/lib/channel/channelz_registry.cc',
'src/core/lib/channel/connected_channel.cc',
'src/core/lib/channel/handshaker.cc',
@@ -1064,6 +1075,7 @@
'src/core/lib/channel/channel_stack.cc',
'src/core/lib/channel/channel_stack_builder.cc',
'src/core/lib/channel/channel_trace.cc',
+ 'src/core/lib/channel/channelz.cc',
'src/core/lib/channel/channelz_registry.cc',
'src/core/lib/channel/connected_channel.cc',
'src/core/lib/channel/handshaker.cc',
@@ -1266,26 +1278,27 @@
'src/core/ext/transport/inproc/inproc_plugin.cc',
'src/core/ext/transport/inproc/inproc_transport.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc',
+ 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc',
'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc',
'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc',
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc',
- 'src/core/ext/filters/load_reporting/server_load_reporting_filter.cc',
- 'src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc',
'src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc',
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc',
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc',
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc',
'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc',
+ 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c',
+ 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c',
'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c',
'third_party/nanopb/pb_common.c',
'third_party/nanopb/pb_decode.c',
'third_party/nanopb/pb_encode.c',
'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc',
'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc',
- 'src/core/ext/census/grpc_context.cc',
+ 'src/cpp/ext/filters/census/grpc_context.cc',
'src/core/ext/filters/max_age/max_age_filter.cc',
'src/core/ext/filters/message_size/message_size_filter.cc',
'src/core/ext/filters/http/client_authority_filter.cc',
@@ -1663,16 +1676,6 @@
],
},
{
- 'target_name': 'lb_load_data_store',
- 'type': 'static_library',
- 'dependencies': [
- 'grpc++',
- ],
- 'sources': [
- 'src/cpp/server/load_reporter/load_data_store.cc',
- ],
- },
- {
'target_name': 'qps',
'type': 'static_library',
'dependencies': [
@@ -2633,6 +2636,7 @@
'test/core/end2end/tests/cancel_before_invoke.cc',
'test/core/end2end/tests/cancel_in_a_vacuum.cc',
'test/core/end2end/tests/cancel_with_status.cc',
+ 'test/core/end2end/tests/channelz.cc',
'test/core/end2end/tests/compressed_payload.cc',
'test/core/end2end/tests/connectivity.cc',
'test/core/end2end/tests/default_host.cc',
@@ -2649,13 +2653,13 @@
'test/core/end2end/tests/invoke_large_request.cc',
'test/core/end2end/tests/keepalive_timeout.cc',
'test/core/end2end/tests/large_metadata.cc',
- 'test/core/end2end/tests/load_reporting_hook.cc',
'test/core/end2end/tests/max_concurrent_streams.cc',
'test/core/end2end/tests/max_connection_age.cc',
'test/core/end2end/tests/max_connection_idle.cc',
'test/core/end2end/tests/max_message_length.cc',
'test/core/end2end/tests/negative_deadline.cc',
'test/core/end2end/tests/network_status_change.cc',
+ 'test/core/end2end/tests/no_error_on_hotpath.cc',
'test/core/end2end/tests/no_logging.cc',
'test/core/end2end/tests/no_op.cc',
'test/core/end2end/tests/payload.cc',
@@ -2723,6 +2727,7 @@
'test/core/end2end/tests/cancel_before_invoke.cc',
'test/core/end2end/tests/cancel_in_a_vacuum.cc',
'test/core/end2end/tests/cancel_with_status.cc',
+ 'test/core/end2end/tests/channelz.cc',
'test/core/end2end/tests/compressed_payload.cc',
'test/core/end2end/tests/connectivity.cc',
'test/core/end2end/tests/default_host.cc',
@@ -2739,13 +2744,13 @@
'test/core/end2end/tests/invoke_large_request.cc',
'test/core/end2end/tests/keepalive_timeout.cc',
'test/core/end2end/tests/large_metadata.cc',
- 'test/core/end2end/tests/load_reporting_hook.cc',
'test/core/end2end/tests/max_concurrent_streams.cc',
'test/core/end2end/tests/max_connection_age.cc',
'test/core/end2end/tests/max_connection_idle.cc',
'test/core/end2end/tests/max_message_length.cc',
'test/core/end2end/tests/negative_deadline.cc',
'test/core/end2end/tests/network_status_change.cc',
+ 'test/core/end2end/tests/no_error_on_hotpath.cc',
'test/core/end2end/tests/no_logging.cc',
'test/core/end2end/tests/no_op.cc',
'test/core/end2end/tests/payload.cc',
diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h
index dd8a5d7d5f..c129a66949 100644
--- a/include/grpc/grpc.h
+++ b/include/grpc/grpc.h
@@ -286,14 +286,6 @@ GRPCAPI grpc_channel* grpc_lame_client_channel_create(
/** Close and destroy a grpc channel */
GRPCAPI void grpc_channel_destroy(grpc_channel* channel);
-/** Returns the JSON formatted channel trace for this channel. The caller
- owns the returned string and is responsible for freeing it. */
-GRPCAPI char* grpc_channel_get_trace(grpc_channel* channel);
-
-/** Returns the channel uuid, which can be used to look up its trace at a
- later time. */
-GRPCAPI intptr_t grpc_channel_get_uuid(grpc_channel* channel);
-
/** Error handling for grpc_call
Most grpc_call functions return a grpc_error. If the error is not GRPC_OK
then the operation failed due to some unsatisfied precondition.
diff --git a/include/grpc/grpc_security.h b/include/grpc/grpc_security.h
index e1975a8e09..b34fb70898 100644
--- a/include/grpc/grpc_security.h
+++ b/include/grpc/grpc_security.h
@@ -163,6 +163,26 @@ typedef struct {
const char* cert_chain;
} grpc_ssl_pem_key_cert_pair;
+/** Object that holds additional peer-verification options on a secure
+ channel. */
+typedef struct {
+ /** If non-NULL this callback will be invoked with the expected
+ target_name, the peer's certificate (in PEM format), and whatever
+ userdata pointer is set below. If a non-zero value is returned by this
+ callback then it is treated as a verification failure. Invocation of
+ the callback is blocking, so any implementation should be light-weight.
+ */
+ int (*verify_peer_callback)(const char* target_name, const char* peer_pem,
+ void* userdata);
+ /** Arbitrary userdata that will be passed as the last argument to
+ verify_peer_callback. */
+ void* verify_peer_callback_userdata;
+ /** A destruct callback that will be invoked when the channel is being
+ cleaned up. The userdata argument will be passed to it. The intent is
+ to perform any cleanup associated with that userdata. */
+ void (*verify_peer_destruct)(void* userdata);
+} verify_peer_options;
+
/** Creates an SSL credentials object.
- pem_root_certs is the NULL-terminated string containing the PEM encoding
of the server root certificates. If this parameter is NULL, the
@@ -173,10 +193,17 @@ typedef struct {
disk (in the grpc install directory).
- pem_key_cert_pair is a pointer on the object containing client's private
key and certificate chain. This parameter can be NULL if the client does
- not have such a key/cert pair. */
+ not have such a key/cert pair.
+ - verify_options is an optional verify_peer_options object which holds
+ additional options controlling how peer certificates are verified. For
+ example, you can supply a callback which receives the peer's certificate
+ with which you can do additional verification. Can be NULL, in which
+ case verification will retain default behavior. Any settings in
+ verify_options are copied during this call, so the verify_options
+ object can be released afterwards. */
GRPCAPI grpc_channel_credentials* grpc_ssl_credentials_create(
const char* pem_root_certs, grpc_ssl_pem_key_cert_pair* pem_key_cert_pair,
- void* reserved);
+ const verify_peer_options* verify_options, void* reserved);
/** --- grpc_call_credentials object.
diff --git a/include/grpc/impl/codegen/grpc_types.h b/include/grpc/impl/codegen/grpc_types.h
index 022be5fec4..c32e99ed4c 100644
--- a/include/grpc/impl/codegen/grpc_types.h
+++ b/include/grpc/impl/codegen/grpc_types.h
@@ -289,6 +289,10 @@ typedef struct {
* subchannel. The default is 10. If set to 0, channel tracing is disabled. */
#define GRPC_ARG_MAX_CHANNEL_TRACE_EVENTS_PER_NODE \
"grpc.max_channel_trace_events_per_node"
+/** If non-zero, gRPC library will track stats and information at at per channel
+ * level. Disabling channelz naturally disables channel tracing. The default
+ * is for channelz to be disabled. */
+#define GRPC_ARG_ENABLE_CHANNELZ "grpc.enable_channelz"
/** If non-zero, Cronet transport will coalesce packets to fewer frames
* when possible. */
#define GRPC_ARG_USE_CRONET_PACKET_COALESCING \
@@ -332,10 +336,12 @@ typedef struct {
#define GRPC_ARG_PER_RPC_RETRY_BUFFER_SIZE "grpc.per_rpc_retry_buffer_size"
/** Channel arg that carries the bridged objective c object for custom metrics
* logging filter. */
-#define GRPC_ARG_MOBILE_LOG_CONFIG "grpc.mobile_log_config"
+#define GRPC_ARG_MOBILE_LOG_CONTEXT "grpc.mobile_log_context"
/** If non-zero, client authority filter is disabled for the channel */
#define GRPC_ARG_DISABLE_CLIENT_AUTHORITY_FILTER \
"grpc.disable_client_authority_filter"
+/** If set to zero, disables use of http proxies. Enabled by default. */
+#define GRPC_ARG_ENABLE_HTTP_PROXY "grpc.enable_http_proxy"
/** \} */
/** Result of a grpc call. If the caller satisfies the prerequisites of a
diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h
index bf1bf3df6a..01ce5f03e9 100644
--- a/include/grpc/impl/codegen/port_platform.h
+++ b/include/grpc/impl/codegen/port_platform.h
@@ -227,7 +227,10 @@
#define GPR_POSIX_SYNC 1
#define GPR_POSIX_TIME 1
#define GPR_GETPID_IN_UNISTD_H 1
+/* TODO(mxyan): Remove when CFStream becomes default */
+#ifndef GRPC_CFSTREAM
#define GPR_SUPPORT_CHANNELS_FROM_FD 1
+#endif
#ifdef _LP64
#define GPR_ARCH_64 1
#else /* _LP64 */
diff --git a/include/grpc/module.modulemap b/include/grpc/module.modulemap
index e0d5404e8a..755b6e78e8 100644
--- a/include/grpc/module.modulemap
+++ b/include/grpc/module.modulemap
@@ -43,7 +43,6 @@ framework module grpc {
header "grpc.h"
header "grpc_posix.h"
header "grpc_security_constants.h"
- header "load_reporting.h"
header "slice.h"
header "slice_buffer.h"
header "status.h"
diff --git a/include/grpcpp/impl/codegen/call.h b/include/grpcpp/impl/codegen/call.h
index 28cc4a9e20..a5e930aaa5 100644
--- a/include/grpcpp/impl/codegen/call.h
+++ b/include/grpcpp/impl/codegen/call.h
@@ -171,8 +171,8 @@ class WriteOptions {
return *this;
}
- /// Guarantee that all bytes have been written to the wire before completing
- /// this write (usually writes are completed when they pass flow control)
+ /// Guarantee that all bytes have been written to the socket before completing
+ /// this write (usually writes are completed when they pass flow control).
inline WriteOptions& set_write_through() {
SetBit(GRPC_WRITE_THROUGH);
return *this;
@@ -573,10 +573,13 @@ class CallOpClientRecvStatus {
binary_error_details =
grpc::string(iter->second.begin(), iter->second.length());
}
- *recv_status_ = Status(static_cast<StatusCode>(status_code_),
- grpc::string(GRPC_SLICE_START_PTR(error_message_),
- GRPC_SLICE_END_PTR(error_message_)),
- binary_error_details);
+ *recv_status_ =
+ Status(static_cast<StatusCode>(status_code_),
+ GRPC_SLICE_IS_EMPTY(error_message_)
+ ? grpc::string()
+ : grpc::string(GRPC_SLICE_START_PTR(error_message_),
+ GRPC_SLICE_END_PTR(error_message_)),
+ binary_error_details);
client_context_->set_debug_error_string(
debug_error_string_ != nullptr ? debug_error_string_ : "");
g_core_codegen_interface->grpc_slice_unref(error_message_);
diff --git a/include/grpcpp/impl/codegen/server_interface.h b/include/grpcpp/impl/codegen/server_interface.h
index cf330ac352..237991cde6 100644
--- a/include/grpcpp/impl/codegen/server_interface.h
+++ b/include/grpcpp/impl/codegen/server_interface.h
@@ -49,12 +49,35 @@ class ServerInterface : public internal::CallHook {
public:
virtual ~ServerInterface() {}
- /// Shutdown the server, blocking until all rpc processing finishes.
- /// Forcefully terminate pending calls after \a deadline expires.
+ /// \a Shutdown does the following things:
+ ///
+ /// 1. Shutdown the server: deactivate all listening ports, mark it in
+ /// "shutdown mode" so that further call Request's or incoming RPC matches
+ /// are no longer allowed. Also return all Request'ed-but-not-yet-active
+ /// calls as failed (!ok). This refers to calls that have been requested
+ /// at the server by the server-side library or application code but that
+ /// have not yet been matched to incoming RPCs from the client. Note that
+ /// this would even include default calls added automatically by the gRPC
+ /// C++ API without the user's input (e.g., "Unimplemented RPC method")
+ ///
+ /// 2. Block until all rpc method handlers invoked automatically by the sync
+ /// API finish.
+ ///
+ /// 3. If all pending calls complete (and all their operations are
+ /// retrieved by Next) before \a deadline expires, this finishes
+ /// gracefully. Otherwise, forcefully cancel all pending calls associated
+ /// with the server after \a deadline expires. In the case of the sync API,
+ /// if the RPC function for a streaming call has already been started and
+ /// takes a week to complete, the RPC function won't be forcefully
+ /// terminated (since that would leave state corrupt and incomplete) and
+ /// the method handler will just keep running (which will prevent the
+ /// server from completing the "join" operation that it needs to do at
+ /// shutdown time).
///
/// All completion queue associated with the server (for example, for async
/// serving) must be shutdown *after* this method has returned:
/// See \a ServerBuilder::AddCompletionQueue for details.
+ /// They must also be drained (by repeated Next) after being shutdown.
///
/// \param deadline How long to wait until pending rpcs are forcefully
/// terminated.
@@ -63,7 +86,7 @@ class ServerInterface : public internal::CallHook {
ShutdownInternal(TimePoint<T>(deadline).raw_time());
}
- /// Shutdown the server, waiting for all rpc processing to finish.
+ /// Shutdown the server without a deadline and forced cancellation.
///
/// All completion queue associated with the server (for example, for async
/// serving) must be shutdown *after* this method has returned:
diff --git a/include/grpcpp/opencensus.h b/include/grpcpp/opencensus.h
new file mode 100644
index 0000000000..7e5d1dfeb4
--- /dev/null
+++ b/include/grpcpp/opencensus.h
@@ -0,0 +1,41 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPCPP_OPENCENSUS_H
+#define GRPCPP_OPENCENSUS_H
+
+namespace grpc {
+// These symbols in this file will not be included in the binary unless
+// grpc_opencensus_plugin build target was added as a dependency. At the moment
+// it is only setup to be built with Bazel.
+
+// Registers the OpenCensus plugin with gRPC, so that it will be used for future
+// RPCs. This must be called before any views are created.
+void RegisterOpenCensusPlugin();
+
+// RPC stats definitions, defined by
+// https://github.com/census-instrumentation/opencensus-specs/blob/master/stats/gRPC.md
+
+// Registers the cumulative gRPC views so that they will be exported by any
+// registered stats exporter. For on-task stats, construct a View using the
+// ViewDescriptors below.
+void RegisterOpenCensusViewsForExport();
+
+} // namespace grpc
+
+#endif // GRPCPP_OPENCENSUS_H
diff --git a/include/grpcpp/server_builder.h b/include/grpcpp/server_builder.h
index 4c8dcf4916..a58a59c2d8 100644
--- a/include/grpcpp/server_builder.h
+++ b/include/grpcpp/server_builder.h
@@ -86,8 +86,8 @@ class ServerBuilder {
/// \param creds The credentials associated with the server.
/// \param selected_port[out] If not `nullptr`, gets populated with the port
/// number bound to the \a grpc::Server for the corresponding endpoint after
- /// it is successfully bound, 0 otherwise.
- ///
+ /// it is successfully bound by BuildAndStart(), 0 otherwise. AddListeningPort
+ /// does not modify this pointer.
ServerBuilder& AddListeningPort(const grpc::string& addr_uri,
std::shared_ptr<ServerCredentials> creds,
int* selected_port = nullptr);
@@ -144,12 +144,14 @@ class ServerBuilder {
// Fine control knobs
/// Set max receive message size in bytes.
+ /// The default is GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH.
ServerBuilder& SetMaxReceiveMessageSize(int max_receive_message_size) {
max_receive_message_size_ = max_receive_message_size;
return *this;
}
/// Set max send message size in bytes.
+ /// The default is GRPC_DEFAULT_MAX_SEND_MESSAGE_LENGTH.
ServerBuilder& SetMaxSendMessageSize(int max_send_message_size) {
max_send_message_size_ = max_send_message_size;
return *this;
diff --git a/package.xml b/package.xml
index b8cda9d79f..cd5a2a0099 100644
--- a/package.xml
+++ b/package.xml
@@ -13,8 +13,8 @@
<date>2018-01-19</date>
<time>16:06:07</time>
<version>
- <release>1.13.0dev</release>
- <api>1.13.0dev</api>
+ <release>1.14.0dev</release>
+ <api>1.14.0dev</api>
</version>
<stability>
<release>beta</release>
@@ -178,7 +178,6 @@
<file baseinstalldir="/" name="include/grpc/grpc.h" role="src" />
<file baseinstalldir="/" name="include/grpc/grpc_posix.h" role="src" />
<file baseinstalldir="/" name="include/grpc/grpc_security_constants.h" role="src" />
- <file baseinstalldir="/" name="include/grpc/load_reporting.h" role="src" />
<file baseinstalldir="/" name="include/grpc/slice.h" role="src" />
<file baseinstalldir="/" name="include/grpc/slice_buffer.h" role="src" />
<file baseinstalldir="/" name="include/grpc/status.h" role="src" />
@@ -299,6 +298,7 @@
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack_builder.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_trace.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/channel/channelz.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channelz_registry.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/connected_channel.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/context.h" role="src" />
@@ -435,8 +435,6 @@
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/subchannel_list.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/load_reporting/server_load_reporting_filter.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/load_reporting/server_load_reporting_plugin.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/max_age/max_age_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/message_size/message_size_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/http/client_authority_filter.h" role="src" />
@@ -449,6 +447,7 @@
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack_builder.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_trace.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/channel/channelz.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channelz_registry.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/connected_channel.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/handshaker.cc" role="src" />
@@ -725,19 +724,20 @@
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/load_reporting/server_load_reporting_filter.cc" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc" role="src" />
- <file baseinstalldir="/" name="src/core/ext/census/grpc_context.cc" role="src" />
+ <file baseinstalldir="/" name="src/cpp/ext/filters/census/grpc_context.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/max_age/max_age_filter.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/message_size/message_size_filter.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/http/client_authority_filter.cc" role="src" />
diff --git a/setup.py b/setup.py
index 43c25aafeb..388e629ec2 100644
--- a/setup.py
+++ b/setup.py
@@ -37,6 +37,7 @@ PYTHON_STEM = os.path.join('src', 'python', 'grpcio')
CORE_INCLUDE = ('include', '.',)
SSL_INCLUDE = (os.path.join('third_party', 'boringssl', 'include'),)
ZLIB_INCLUDE = (os.path.join('third_party', 'zlib'),)
+NANOPB_INCLUDE = (os.path.join('third_party', 'nanopb'),)
CARES_INCLUDE = (
os.path.join('third_party', 'cares'),
os.path.join('third_party', 'cares', 'cares'),)
@@ -181,7 +182,7 @@ if BUILD_WITH_SYSTEM_CARES:
EXTENSION_INCLUDE_DIRECTORIES = (
(PYTHON_STEM,) + CORE_INCLUDE + SSL_INCLUDE + ZLIB_INCLUDE +
- CARES_INCLUDE + ADDRESS_SORTING_INCLUDE)
+ NANOPB_INCLUDE + CARES_INCLUDE + ADDRESS_SORTING_INCLUDE)
EXTENSION_LIBRARIES = ()
if "linux" in sys.platform:
diff --git a/src/compiler/csharp_generator.cc b/src/compiler/csharp_generator.cc
index 14173e0794..a923ce8e38 100644
--- a/src/compiler/csharp_generator.cc
+++ b/src/compiler/csharp_generator.cc
@@ -202,7 +202,8 @@ std::string GetCSharpMethodType(MethodType method_type) {
std::string GetServiceNameFieldName() { return "__ServiceName"; }
std::string GetMarshallerFieldName(const Descriptor* message) {
- return "__Marshaller_" + message->name();
+ return "__Marshaller_" +
+ grpc_generator::StringReplace(message->full_name(), ".", "_", true);
}
std::string GetMethodFieldName(const MethodDescriptor* method) {
@@ -680,14 +681,19 @@ grpc::string GetServices(const FileDescriptor* file, bool generate_client,
out.Print("using grpc = global::Grpc.Core;\n");
out.Print("\n");
- out.Print("namespace $namespace$ {\n", "namespace", GetFileNamespace(file));
- out.Indent();
+ grpc::string file_namespace = GetFileNamespace(file);
+ if (file_namespace != "") {
+ out.Print("namespace $namespace$ {\n", "namespace", file_namespace);
+ out.Indent();
+ }
for (int i = 0; i < file->service_count(); i++) {
GenerateService(&out, file->service(i), generate_client, generate_server,
internal_access);
}
- out.Outdent();
- out.Print("}\n");
+ if (file_namespace != "") {
+ out.Outdent();
+ out.Print("}\n");
+ }
out.Print("#endregion\n");
}
return output;
diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc
index ea6775a8d8..520431e63b 100644
--- a/src/core/ext/filters/client_channel/client_channel.cc
+++ b/src/core/ext/filters/client_channel/client_channel.cc
@@ -794,6 +794,15 @@ typedef struct {
// The batch to use in the subchannel call.
// Its payload field points to subchannel_call_retry_state.batch_payload.
grpc_transport_stream_op_batch batch;
+ // For intercepting on_complete.
+ grpc_closure on_complete;
+} subchannel_batch_data;
+
+// Retry state associated with a subchannel call.
+// Stored in the parent_data of the subchannel call object.
+typedef struct {
+ // subchannel_batch_data.batch.payload points to this.
+ grpc_transport_stream_op_batch_payload batch_payload;
// For send_initial_metadata.
// Note that we need to make a copy of the initial metadata for each
// subchannel call instead of just referring to the copy in call_data,
@@ -817,15 +826,7 @@ typedef struct {
// For intercepting recv_trailing_metadata.
grpc_metadata_batch recv_trailing_metadata;
grpc_transport_stream_stats collect_stats;
- // For intercepting on_complete.
- grpc_closure on_complete;
-} subchannel_batch_data;
-
-// Retry state associated with a subchannel call.
-// Stored in the parent_data of the subchannel call object.
-typedef struct {
- // subchannel_batch_data.batch.payload points to this.
- grpc_transport_stream_op_batch_payload batch_payload;
+ grpc_closure recv_trailing_metadata_ready;
// These fields indicate which ops have been started and completed on
// this subchannel call.
size_t started_send_message_count;
@@ -1192,35 +1193,24 @@ static void pending_batches_fail(grpc_call_element* elem, grpc_error* error,
"chand=%p calld=%p: failing %" PRIuPTR " pending batches: %s",
elem->channel_data, calld, num_batches, grpc_error_string(error));
}
- grpc_transport_stream_op_batch*
- batches[GPR_ARRAY_SIZE(calld->pending_batches)];
- size_t num_batches = 0;
+ grpc_core::CallCombinerClosureList closures;
for (size_t i = 0; i < GPR_ARRAY_SIZE(calld->pending_batches); ++i) {
pending_batch* pending = &calld->pending_batches[i];
grpc_transport_stream_op_batch* batch = pending->batch;
if (batch != nullptr) {
- batches[num_batches++] = batch;
+ batch->handler_private.extra_arg = calld;
+ GRPC_CLOSURE_INIT(&batch->handler_private.closure,
+ fail_pending_batch_in_call_combiner, batch,
+ grpc_schedule_on_exec_ctx);
+ closures.Add(&batch->handler_private.closure, GRPC_ERROR_REF(error),
+ "pending_batches_fail");
pending_batch_clear(calld, pending);
}
}
- for (size_t i = yield_call_combiner ? 1 : 0; i < num_batches; ++i) {
- grpc_transport_stream_op_batch* batch = batches[i];
- batch->handler_private.extra_arg = calld;
- GRPC_CLOSURE_INIT(&batch->handler_private.closure,
- fail_pending_batch_in_call_combiner, batch,
- grpc_schedule_on_exec_ctx);
- GRPC_CALL_COMBINER_START(calld->call_combiner,
- &batch->handler_private.closure,
- GRPC_ERROR_REF(error), "pending_batches_fail");
- }
if (yield_call_combiner) {
- if (num_batches > 0) {
- // Note: This will release the call combiner.
- grpc_transport_stream_op_batch_finish_with_failure(
- batches[0], GRPC_ERROR_REF(error), calld->call_combiner);
- } else {
- GRPC_CALL_COMBINER_STOP(calld->call_combiner, "pending_batches_fail");
- }
+ closures.RunClosures(calld->call_combiner);
+ } else {
+ closures.RunClosuresWithoutYielding(calld->call_combiner);
}
GRPC_ERROR_UNREF(error);
}
@@ -1255,30 +1245,22 @@ static void pending_batches_resume(grpc_call_element* elem) {
" pending batches on subchannel_call=%p",
chand, calld, num_batches, calld->subchannel_call);
}
- grpc_transport_stream_op_batch*
- batches[GPR_ARRAY_SIZE(calld->pending_batches)];
- size_t num_batches = 0;
+ grpc_core::CallCombinerClosureList closures;
for (size_t i = 0; i < GPR_ARRAY_SIZE(calld->pending_batches); ++i) {
pending_batch* pending = &calld->pending_batches[i];
grpc_transport_stream_op_batch* batch = pending->batch;
if (batch != nullptr) {
- batches[num_batches++] = batch;
+ batch->handler_private.extra_arg = calld->subchannel_call;
+ GRPC_CLOSURE_INIT(&batch->handler_private.closure,
+ resume_pending_batch_in_call_combiner, batch,
+ grpc_schedule_on_exec_ctx);
+ closures.Add(&batch->handler_private.closure, GRPC_ERROR_NONE,
+ "pending_batches_resume");
pending_batch_clear(calld, pending);
}
}
- for (size_t i = 1; i < num_batches; ++i) {
- grpc_transport_stream_op_batch* batch = batches[i];
- batch->handler_private.extra_arg = calld->subchannel_call;
- GRPC_CLOSURE_INIT(&batch->handler_private.closure,
- resume_pending_batch_in_call_combiner, batch,
- grpc_schedule_on_exec_ctx);
- GRPC_CALL_COMBINER_START(calld->call_combiner,
- &batch->handler_private.closure, GRPC_ERROR_NONE,
- "pending_batches_resume");
- }
- GPR_ASSERT(num_batches > 0);
// Note: This will release the call combiner.
- grpc_subchannel_call_process_op(calld->subchannel_call, batches[0]);
+ closures.RunClosures(calld->call_combiner);
}
static void maybe_clear_pending_batch(grpc_call_element* elem,
@@ -1293,7 +1275,10 @@ static void maybe_clear_pending_batch(grpc_call_element* elem,
batch->payload->recv_initial_metadata.recv_initial_metadata_ready ==
nullptr) &&
(!batch->recv_message ||
- batch->payload->recv_message.recv_message_ready == nullptr)) {
+ batch->payload->recv_message.recv_message_ready == nullptr) &&
+ (!batch->recv_trailing_metadata ||
+ batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready ==
+ nullptr)) {
if (grpc_client_channel_trace.enabled()) {
gpr_log(GPR_INFO, "chand=%p calld=%p: clearing pending batch", chand,
calld);
@@ -1302,75 +1287,27 @@ static void maybe_clear_pending_batch(grpc_call_element* elem,
}
}
-// Returns true if all ops in the pending batch have been completed.
-static bool pending_batch_is_completed(
- pending_batch* pending, call_data* calld,
- subchannel_call_retry_state* retry_state) {
- if (pending->batch == nullptr || pending->batch->on_complete == nullptr) {
- return false;
- }
- if (pending->batch->send_initial_metadata &&
- !retry_state->completed_send_initial_metadata) {
- return false;
- }
- if (pending->batch->send_message &&
- retry_state->completed_send_message_count <
- calld->send_messages->size()) {
- return false;
- }
- if (pending->batch->send_trailing_metadata &&
- !retry_state->completed_send_trailing_metadata) {
- return false;
- }
- if (pending->batch->recv_initial_metadata &&
- !retry_state->completed_recv_initial_metadata) {
- return false;
- }
- if (pending->batch->recv_message &&
- retry_state->completed_recv_message_count <
- retry_state->started_recv_message_count) {
- return false;
- }
- if (pending->batch->recv_trailing_metadata &&
- !retry_state->completed_recv_trailing_metadata) {
- return false;
- }
- return true;
-}
-
-// Returns true if any op in the batch was not yet started.
-static bool pending_batch_is_unstarted(
- pending_batch* pending, call_data* calld,
- subchannel_call_retry_state* retry_state) {
- if (pending->batch == nullptr || pending->batch->on_complete == nullptr) {
- return false;
- }
- if (pending->batch->send_initial_metadata &&
- !retry_state->started_send_initial_metadata) {
- return true;
- }
- if (pending->batch->send_message &&
- retry_state->started_send_message_count < calld->send_messages->size()) {
- return true;
- }
- if (pending->batch->send_trailing_metadata &&
- !retry_state->started_send_trailing_metadata) {
- return true;
- }
- if (pending->batch->recv_initial_metadata &&
- !retry_state->started_recv_initial_metadata) {
- return true;
- }
- if (pending->batch->recv_message &&
- retry_state->completed_recv_message_count ==
- retry_state->started_recv_message_count) {
- return true;
- }
- if (pending->batch->recv_trailing_metadata &&
- !retry_state->started_recv_trailing_metadata) {
- return true;
+// Returns a pointer to the first pending batch for which predicate(batch)
+// returns true, or null if not found.
+template <typename Predicate>
+static pending_batch* pending_batch_find(grpc_call_element* elem,
+ const char* log_message,
+ Predicate predicate) {
+ channel_data* chand = static_cast<channel_data*>(elem->channel_data);
+ call_data* calld = static_cast<call_data*>(elem->call_data);
+ for (size_t i = 0; i < GPR_ARRAY_SIZE(calld->pending_batches); ++i) {
+ pending_batch* pending = &calld->pending_batches[i];
+ grpc_transport_stream_op_batch* batch = pending->batch;
+ if (batch != nullptr && predicate(batch)) {
+ if (grpc_client_channel_trace.enabled()) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p: %s pending batch at index %" PRIuPTR, chand,
+ calld, log_message, i);
+ }
+ return pending;
+ }
}
- return false;
+ return nullptr;
}
//
@@ -1557,8 +1494,13 @@ static bool maybe_retry(grpc_call_element* elem,
// subchannel_batch_data
//
+// Creates a subchannel_batch_data object on the call's arena with the
+// specified refcount. If set_on_complete is true, the batch's
+// on_complete callback will be set to point to on_complete();
+// otherwise, the batch's on_complete callback will be null.
static subchannel_batch_data* batch_data_create(grpc_call_element* elem,
- int refcount) {
+ int refcount,
+ bool set_on_complete) {
call_data* calld = static_cast<call_data*>(elem->call_data);
subchannel_call_retry_state* retry_state =
static_cast<subchannel_call_retry_state*>(
@@ -1571,26 +1513,32 @@ static subchannel_batch_data* batch_data_create(grpc_call_element* elem,
GRPC_SUBCHANNEL_CALL_REF(calld->subchannel_call, "batch_data_create");
batch_data->batch.payload = &retry_state->batch_payload;
gpr_ref_init(&batch_data->refs, refcount);
- GRPC_CLOSURE_INIT(&batch_data->on_complete, on_complete, batch_data,
- grpc_schedule_on_exec_ctx);
- batch_data->batch.on_complete = &batch_data->on_complete;
+ if (set_on_complete) {
+ GRPC_CLOSURE_INIT(&batch_data->on_complete, on_complete, batch_data,
+ grpc_schedule_on_exec_ctx);
+ batch_data->batch.on_complete = &batch_data->on_complete;
+ }
GRPC_CALL_STACK_REF(calld->owning_call, "batch_data");
return batch_data;
}
static void batch_data_unref(subchannel_batch_data* batch_data) {
if (gpr_unref(&batch_data->refs)) {
- if (batch_data->send_initial_metadata_storage != nullptr) {
- grpc_metadata_batch_destroy(&batch_data->send_initial_metadata);
+ subchannel_call_retry_state* retry_state =
+ static_cast<subchannel_call_retry_state*>(
+ grpc_connected_subchannel_call_get_parent_data(
+ batch_data->subchannel_call));
+ if (batch_data->batch.send_initial_metadata) {
+ grpc_metadata_batch_destroy(&retry_state->send_initial_metadata);
}
- if (batch_data->send_trailing_metadata_storage != nullptr) {
- grpc_metadata_batch_destroy(&batch_data->send_trailing_metadata);
+ if (batch_data->batch.send_trailing_metadata) {
+ grpc_metadata_batch_destroy(&retry_state->send_trailing_metadata);
}
if (batch_data->batch.recv_initial_metadata) {
- grpc_metadata_batch_destroy(&batch_data->recv_initial_metadata);
+ grpc_metadata_batch_destroy(&retry_state->recv_initial_metadata);
}
if (batch_data->batch.recv_trailing_metadata) {
- grpc_metadata_batch_destroy(&batch_data->recv_trailing_metadata);
+ grpc_metadata_batch_destroy(&retry_state->recv_trailing_metadata);
}
GRPC_SUBCHANNEL_CALL_UNREF(batch_data->subchannel_call, "batch_data_unref");
call_data* calld = static_cast<call_data*>(batch_data->elem->call_data);
@@ -1606,30 +1554,22 @@ static void batch_data_unref(subchannel_batch_data* batch_data) {
static void invoke_recv_initial_metadata_callback(void* arg,
grpc_error* error) {
subchannel_batch_data* batch_data = static_cast<subchannel_batch_data*>(arg);
- channel_data* chand =
- static_cast<channel_data*>(batch_data->elem->channel_data);
- call_data* calld = static_cast<call_data*>(batch_data->elem->call_data);
// Find pending batch.
- pending_batch* pending = nullptr;
- for (size_t i = 0; i < GPR_ARRAY_SIZE(calld->pending_batches); ++i) {
- grpc_transport_stream_op_batch* batch = calld->pending_batches[i].batch;
- if (batch != nullptr && batch->recv_initial_metadata &&
- batch->payload->recv_initial_metadata.recv_initial_metadata_ready !=
- nullptr) {
- if (grpc_client_channel_trace.enabled()) {
- gpr_log(GPR_INFO,
- "chand=%p calld=%p: invoking recv_initial_metadata_ready for "
- "pending batch at index %" PRIuPTR,
- chand, calld, i);
- }
- pending = &calld->pending_batches[i];
- break;
- }
- }
+ pending_batch* pending = pending_batch_find(
+ batch_data->elem, "invoking recv_initial_metadata_ready for",
+ [](grpc_transport_stream_op_batch* batch) {
+ return batch->recv_initial_metadata &&
+ batch->payload->recv_initial_metadata
+ .recv_initial_metadata_ready != nullptr;
+ });
GPR_ASSERT(pending != nullptr);
// Return metadata.
+ subchannel_call_retry_state* retry_state =
+ static_cast<subchannel_call_retry_state*>(
+ grpc_connected_subchannel_call_get_parent_data(
+ batch_data->subchannel_call));
grpc_metadata_batch_move(
- &batch_data->recv_initial_metadata,
+ &retry_state->recv_initial_metadata,
pending->batch->payload->recv_initial_metadata.recv_initial_metadata);
// Update bookkeeping.
// Note: Need to do this before invoking the callback, since invoking
@@ -1661,11 +1601,20 @@ static void recv_initial_metadata_ready(void* arg, grpc_error* error) {
static_cast<subchannel_call_retry_state*>(
grpc_connected_subchannel_call_get_parent_data(
batch_data->subchannel_call));
+ retry_state->completed_recv_initial_metadata = true;
+ // If a retry was already dispatched, then we're not going to use the
+ // result of this recv_initial_metadata op, so do nothing.
+ if (retry_state->retry_dispatched) {
+ GRPC_CALL_COMBINER_STOP(
+ calld->call_combiner,
+ "recv_initial_metadata_ready after retry dispatched");
+ return;
+ }
// If we got an error or a Trailers-Only response and have not yet gotten
- // the recv_trailing_metadata on_complete callback, then defer
- // propagating this callback back to the surface. We can evaluate whether
- // to retry when recv_trailing_metadata comes back.
- if (GPR_UNLIKELY((batch_data->trailing_metadata_available ||
+ // the recv_trailing_metadata_ready callback, then defer propagating this
+ // callback back to the surface. We can evaluate whether to retry when
+ // recv_trailing_metadata comes back.
+ if (GPR_UNLIKELY((retry_state->trailing_metadata_available ||
error != GRPC_ERROR_NONE) &&
!retry_state->completed_recv_trailing_metadata)) {
if (grpc_client_channel_trace.enabled()) {
@@ -1689,9 +1638,9 @@ static void recv_initial_metadata_ready(void* arg, grpc_error* error) {
}
// Received valid initial metadata, so commit the call.
retry_commit(elem, retry_state);
+ // Invoke the callback to return the result to the surface.
// Manually invoking a callback function; it does not take ownership of error.
invoke_recv_initial_metadata_callback(batch_data, error);
- GRPC_ERROR_UNREF(error);
}
//
@@ -1701,29 +1650,21 @@ static void recv_initial_metadata_ready(void* arg, grpc_error* error) {
// Invokes recv_message_ready for a subchannel batch.
static void invoke_recv_message_callback(void* arg, grpc_error* error) {
subchannel_batch_data* batch_data = static_cast<subchannel_batch_data*>(arg);
- channel_data* chand =
- static_cast<channel_data*>(batch_data->elem->channel_data);
- call_data* calld = static_cast<call_data*>(batch_data->elem->call_data);
// Find pending op.
- pending_batch* pending = nullptr;
- for (size_t i = 0; i < GPR_ARRAY_SIZE(calld->pending_batches); ++i) {
- grpc_transport_stream_op_batch* batch = calld->pending_batches[i].batch;
- if (batch != nullptr && batch->recv_message &&
- batch->payload->recv_message.recv_message_ready != nullptr) {
- if (grpc_client_channel_trace.enabled()) {
- gpr_log(GPR_INFO,
- "chand=%p calld=%p: invoking recv_message_ready for "
- "pending batch at index %" PRIuPTR,
- chand, calld, i);
- }
- pending = &calld->pending_batches[i];
- break;
- }
- }
+ pending_batch* pending = pending_batch_find(
+ batch_data->elem, "invoking recv_message_ready for",
+ [](grpc_transport_stream_op_batch* batch) {
+ return batch->recv_message &&
+ batch->payload->recv_message.recv_message_ready != nullptr;
+ });
GPR_ASSERT(pending != nullptr);
// Return payload.
+ subchannel_call_retry_state* retry_state =
+ static_cast<subchannel_call_retry_state*>(
+ grpc_connected_subchannel_call_get_parent_data(
+ batch_data->subchannel_call));
*pending->batch->payload->recv_message.recv_message =
- std::move(batch_data->recv_message);
+ std::move(retry_state->recv_message);
// Update bookkeeping.
// Note: Need to do this before invoking the callback, since invoking
// the callback will result in yielding the call combiner.
@@ -1751,12 +1692,20 @@ static void recv_message_ready(void* arg, grpc_error* error) {
static_cast<subchannel_call_retry_state*>(
grpc_connected_subchannel_call_get_parent_data(
batch_data->subchannel_call));
+ ++retry_state->completed_recv_message_count;
+ // If a retry was already dispatched, then we're not going to use the
+ // result of this recv_message op, so do nothing.
+ if (retry_state->retry_dispatched) {
+ GRPC_CALL_COMBINER_STOP(calld->call_combiner,
+ "recv_message_ready after retry dispatched");
+ return;
+ }
// If we got an error or the payload was nullptr and we have not yet gotten
- // the recv_trailing_metadata on_complete callback, then defer
- // propagating this callback back to the surface. We can evaluate whether
- // to retry when recv_trailing_metadata comes back.
+ // the recv_trailing_metadata_ready callback, then defer propagating this
+ // callback back to the surface. We can evaluate whether to retry when
+ // recv_trailing_metadata comes back.
if (GPR_UNLIKELY(
- (batch_data->recv_message == nullptr || error != GRPC_ERROR_NONE) &&
+ (retry_state->recv_message == nullptr || error != GRPC_ERROR_NONE) &&
!retry_state->completed_recv_trailing_metadata)) {
if (grpc_client_channel_trace.enabled()) {
gpr_log(GPR_INFO,
@@ -1777,133 +1726,272 @@ static void recv_message_ready(void* arg, grpc_error* error) {
}
// Received a valid message, so commit the call.
retry_commit(elem, retry_state);
+ // Invoke the callback to return the result to the surface.
// Manually invoking a callback function; it does not take ownership of error.
invoke_recv_message_callback(batch_data, error);
- GRPC_ERROR_UNREF(error);
}
//
-// list of closures to execute in call combiner
+// recv_trailing_metadata handling
//
-// Represents a closure that needs to run in the call combiner as part of
-// starting or completing a batch.
-typedef struct {
- grpc_closure* closure;
- grpc_error* error;
- const char* reason;
- bool free_reason = false;
-} closure_to_execute;
-
-static void execute_closures_in_call_combiner(grpc_call_element* elem,
- const char* caller,
- closure_to_execute* closures,
- size_t num_closures) {
- channel_data* chand = static_cast<channel_data*>(elem->channel_data);
+// Sets *status and *server_pushback_md based on batch_data and error.
+static void get_call_status(subchannel_batch_data* batch_data,
+ grpc_error* error, grpc_status_code* status,
+ grpc_mdelem** server_pushback_md) {
+ grpc_call_element* elem = batch_data->elem;
call_data* calld = static_cast<call_data*>(elem->call_data);
- // Note that the call combiner will be yielded for each closure that
- // we schedule. We're already running in the call combiner, so one of
- // the closures can be scheduled directly, but the others will
- // have to re-enter the call combiner.
- if (num_closures > 0) {
- if (grpc_client_channel_trace.enabled()) {
- gpr_log(GPR_INFO, "chand=%p calld=%p: %s starting closure: %s", chand,
- calld, caller, closures[0].reason);
- }
- GRPC_CLOSURE_SCHED(closures[0].closure, closures[0].error);
- if (closures[0].free_reason) {
- gpr_free(const_cast<char*>(closures[0].reason));
- }
- for (size_t i = 1; i < num_closures; ++i) {
- if (grpc_client_channel_trace.enabled()) {
- gpr_log(GPR_INFO,
- "chand=%p calld=%p: %s starting closure in call combiner: %s",
- chand, calld, caller, closures[i].reason);
- }
- GRPC_CALL_COMBINER_START(calld->call_combiner, closures[i].closure,
- closures[i].error, closures[i].reason);
- if (closures[i].free_reason) {
- gpr_free(const_cast<char*>(closures[i].reason));
- }
- }
+ if (error != GRPC_ERROR_NONE) {
+ grpc_error_get_status(error, calld->deadline, status, nullptr, nullptr,
+ nullptr);
} else {
- if (grpc_client_channel_trace.enabled()) {
- gpr_log(GPR_INFO, "chand=%p calld=%p: no closures to run for %s", chand,
- calld, caller);
+ grpc_metadata_batch* md_batch =
+ batch_data->batch.payload->recv_trailing_metadata
+ .recv_trailing_metadata;
+ GPR_ASSERT(md_batch->idx.named.grpc_status != nullptr);
+ *status =
+ grpc_get_status_code_from_metadata(md_batch->idx.named.grpc_status->md);
+ if (md_batch->idx.named.grpc_retry_pushback_ms != nullptr) {
+ *server_pushback_md = &md_batch->idx.named.grpc_retry_pushback_ms->md;
}
- GRPC_CALL_COMBINER_STOP(calld->call_combiner, "no closures to run");
}
+ GRPC_ERROR_UNREF(error);
}
-//
-// on_complete callback handling
-//
-
-// Updates retry_state to reflect the ops completed in batch_data.
-static void update_retry_state_for_completed_batch(
- subchannel_batch_data* batch_data,
- subchannel_call_retry_state* retry_state) {
- if (batch_data->batch.send_initial_metadata) {
- retry_state->completed_send_initial_metadata = true;
- }
- if (batch_data->batch.send_message) {
- ++retry_state->completed_send_message_count;
- }
- if (batch_data->batch.send_trailing_metadata) {
- retry_state->completed_send_trailing_metadata = true;
- }
- if (batch_data->batch.recv_initial_metadata) {
- retry_state->completed_recv_initial_metadata = true;
- }
- if (batch_data->batch.recv_message) {
- ++retry_state->completed_recv_message_count;
- }
- if (batch_data->batch.recv_trailing_metadata) {
- retry_state->completed_recv_trailing_metadata = true;
+// Adds recv_trailing_metadata_ready closure to closures.
+static void add_closure_for_recv_trailing_metadata_ready(
+ grpc_call_element* elem, subchannel_batch_data* batch_data,
+ grpc_error* error, grpc_core::CallCombinerClosureList* closures) {
+ // Find pending batch.
+ pending_batch* pending = pending_batch_find(
+ elem, "invoking recv_trailing_metadata for",
+ [](grpc_transport_stream_op_batch* batch) {
+ return batch->recv_trailing_metadata &&
+ batch->payload->recv_trailing_metadata
+ .recv_trailing_metadata_ready != nullptr;
+ });
+ // If we generated the recv_trailing_metadata op internally via
+ // start_internal_recv_trailing_metadata(), then there will be no
+ // pending batch.
+ if (pending == nullptr) {
+ GRPC_ERROR_UNREF(error);
+ return;
}
+ // Return metadata.
+ subchannel_call_retry_state* retry_state =
+ static_cast<subchannel_call_retry_state*>(
+ grpc_connected_subchannel_call_get_parent_data(
+ batch_data->subchannel_call));
+ grpc_metadata_batch_move(
+ &retry_state->recv_trailing_metadata,
+ pending->batch->payload->recv_trailing_metadata.recv_trailing_metadata);
+ // Add closure.
+ closures->Add(pending->batch->payload->recv_trailing_metadata
+ .recv_trailing_metadata_ready,
+ error, "recv_trailing_metadata_ready for pending batch");
+ // Update bookkeeping.
+ pending->batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready =
+ nullptr;
+ maybe_clear_pending_batch(elem, pending);
}
// Adds any necessary closures for deferred recv_initial_metadata and
-// recv_message callbacks to closures, updating *num_closures as needed.
+// recv_message callbacks to closures.
static void add_closures_for_deferred_recv_callbacks(
subchannel_batch_data* batch_data, subchannel_call_retry_state* retry_state,
- closure_to_execute* closures, size_t* num_closures) {
+ grpc_core::CallCombinerClosureList* closures) {
if (batch_data->batch.recv_trailing_metadata) {
// Add closure for deferred recv_initial_metadata_ready.
if (GPR_UNLIKELY(retry_state->recv_initial_metadata_ready_deferred_batch !=
nullptr)) {
- closure_to_execute* closure = &closures[(*num_closures)++];
- closure->closure = GRPC_CLOSURE_INIT(
- &batch_data->recv_initial_metadata_ready,
- invoke_recv_initial_metadata_callback,
- retry_state->recv_initial_metadata_ready_deferred_batch,
- grpc_schedule_on_exec_ctx);
- closure->error = retry_state->recv_initial_metadata_error;
- closure->reason = "resuming recv_initial_metadata_ready";
+ GRPC_CLOSURE_INIT(&retry_state->recv_initial_metadata_ready,
+ invoke_recv_initial_metadata_callback,
+ retry_state->recv_initial_metadata_ready_deferred_batch,
+ grpc_schedule_on_exec_ctx);
+ closures->Add(&retry_state->recv_initial_metadata_ready,
+ retry_state->recv_initial_metadata_error,
+ "resuming recv_initial_metadata_ready");
retry_state->recv_initial_metadata_ready_deferred_batch = nullptr;
}
// Add closure for deferred recv_message_ready.
if (GPR_UNLIKELY(retry_state->recv_message_ready_deferred_batch !=
nullptr)) {
- closure_to_execute* closure = &closures[(*num_closures)++];
- closure->closure = GRPC_CLOSURE_INIT(
- &batch_data->recv_message_ready, invoke_recv_message_callback,
- retry_state->recv_message_ready_deferred_batch,
- grpc_schedule_on_exec_ctx);
- closure->error = retry_state->recv_message_error;
- closure->reason = "resuming recv_message_ready";
+ GRPC_CLOSURE_INIT(&retry_state->recv_message_ready,
+ invoke_recv_message_callback,
+ retry_state->recv_message_ready_deferred_batch,
+ grpc_schedule_on_exec_ctx);
+ closures->Add(&retry_state->recv_message_ready,
+ retry_state->recv_message_error,
+ "resuming recv_message_ready");
retry_state->recv_message_ready_deferred_batch = nullptr;
}
}
}
+// Returns true if any op in the batch was not yet started.
+// Only looks at send ops, since recv ops are always started immediately.
+static bool pending_batch_is_unstarted(
+ pending_batch* pending, call_data* calld,
+ subchannel_call_retry_state* retry_state) {
+ if (pending->batch == nullptr || pending->batch->on_complete == nullptr) {
+ return false;
+ }
+ if (pending->batch->send_initial_metadata &&
+ !retry_state->started_send_initial_metadata) {
+ return true;
+ }
+ if (pending->batch->send_message &&
+ retry_state->started_send_message_count < calld->send_messages->size()) {
+ return true;
+ }
+ if (pending->batch->send_trailing_metadata &&
+ !retry_state->started_send_trailing_metadata) {
+ return true;
+ }
+ return false;
+}
+
+// For any pending batch containing an op that has not yet been started,
+// adds the pending batch's completion closures to closures.
+static void add_closures_to_fail_unstarted_pending_batches(
+ grpc_call_element* elem, subchannel_call_retry_state* retry_state,
+ grpc_error* error, grpc_core::CallCombinerClosureList* closures) {
+ channel_data* chand = static_cast<channel_data*>(elem->channel_data);
+ call_data* calld = static_cast<call_data*>(elem->call_data);
+ for (size_t i = 0; i < GPR_ARRAY_SIZE(calld->pending_batches); ++i) {
+ pending_batch* pending = &calld->pending_batches[i];
+ if (pending_batch_is_unstarted(pending, calld, retry_state)) {
+ if (grpc_client_channel_trace.enabled()) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p: failing unstarted pending batch at index "
+ "%" PRIuPTR,
+ chand, calld, i);
+ }
+ closures->Add(pending->batch->on_complete, GRPC_ERROR_REF(error),
+ "failing on_complete for pending batch");
+ pending->batch->on_complete = nullptr;
+ maybe_clear_pending_batch(elem, pending);
+ }
+ }
+ GRPC_ERROR_UNREF(error);
+}
+
+// Runs necessary closures upon completion of a call attempt.
+static void run_closures_for_completed_call(subchannel_batch_data* batch_data,
+ grpc_error* error) {
+ grpc_call_element* elem = batch_data->elem;
+ call_data* calld = static_cast<call_data*>(elem->call_data);
+ subchannel_call_retry_state* retry_state =
+ static_cast<subchannel_call_retry_state*>(
+ grpc_connected_subchannel_call_get_parent_data(
+ batch_data->subchannel_call));
+ // Construct list of closures to execute.
+ grpc_core::CallCombinerClosureList closures;
+ // First, add closure for recv_trailing_metadata_ready.
+ add_closure_for_recv_trailing_metadata_ready(
+ elem, batch_data, GRPC_ERROR_REF(error), &closures);
+ // If there are deferred recv_initial_metadata_ready or recv_message_ready
+ // callbacks, add them to closures.
+ add_closures_for_deferred_recv_callbacks(batch_data, retry_state, &closures);
+ // Add closures to fail any pending batches that have not yet been started.
+ add_closures_to_fail_unstarted_pending_batches(
+ elem, retry_state, GRPC_ERROR_REF(error), &closures);
+ // Don't need batch_data anymore.
+ batch_data_unref(batch_data);
+ // Schedule all of the closures identified above.
+ // Note: This will release the call combiner.
+ closures.RunClosures(calld->call_combiner);
+ GRPC_ERROR_UNREF(error);
+}
+
+// Intercepts recv_trailing_metadata_ready callback for retries.
+// Commits the call and returns the trailing metadata up the stack.
+static void recv_trailing_metadata_ready(void* arg, grpc_error* error) {
+ subchannel_batch_data* batch_data = static_cast<subchannel_batch_data*>(arg);
+ grpc_call_element* elem = batch_data->elem;
+ channel_data* chand = static_cast<channel_data*>(elem->channel_data);
+ call_data* calld = static_cast<call_data*>(elem->call_data);
+ if (grpc_client_channel_trace.enabled()) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p: got recv_trailing_metadata_ready, error=%s",
+ chand, calld, grpc_error_string(error));
+ }
+ subchannel_call_retry_state* retry_state =
+ static_cast<subchannel_call_retry_state*>(
+ grpc_connected_subchannel_call_get_parent_data(
+ batch_data->subchannel_call));
+ retry_state->completed_recv_trailing_metadata = true;
+ // Get the call's status and check for server pushback metadata.
+ grpc_status_code status = GRPC_STATUS_OK;
+ grpc_mdelem* server_pushback_md = nullptr;
+ get_call_status(batch_data, GRPC_ERROR_REF(error), &status,
+ &server_pushback_md);
+ if (grpc_client_channel_trace.enabled()) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p: call finished, status=%s", chand,
+ calld, grpc_status_code_to_string(status));
+ }
+ // Check if we should retry.
+ if (maybe_retry(elem, batch_data, status, server_pushback_md)) {
+ // Unref batch_data for deferred recv_initial_metadata_ready or
+ // recv_message_ready callbacks, if any.
+ if (retry_state->recv_initial_metadata_ready_deferred_batch != nullptr) {
+ batch_data_unref(batch_data);
+ GRPC_ERROR_UNREF(retry_state->recv_initial_metadata_error);
+ }
+ if (retry_state->recv_message_ready_deferred_batch != nullptr) {
+ batch_data_unref(batch_data);
+ GRPC_ERROR_UNREF(retry_state->recv_message_error);
+ }
+ batch_data_unref(batch_data);
+ return;
+ }
+ // Not retrying, so commit the call.
+ retry_commit(elem, retry_state);
+ // Run any necessary closures.
+ run_closures_for_completed_call(batch_data, GRPC_ERROR_REF(error));
+}
+
+//
+// on_complete callback handling
+//
+
+// Adds the on_complete closure for the pending batch completed in
+// batch_data to closures.
+static void add_closure_for_completed_pending_batch(
+ grpc_call_element* elem, subchannel_batch_data* batch_data,
+ subchannel_call_retry_state* retry_state, grpc_error* error,
+ grpc_core::CallCombinerClosureList* closures) {
+ pending_batch* pending = pending_batch_find(
+ elem, "completed", [batch_data](grpc_transport_stream_op_batch* batch) {
+ // Match the pending batch with the same set of send ops as the
+ // subchannel batch we've just completed.
+ return batch->on_complete != nullptr &&
+ batch_data->batch.send_initial_metadata ==
+ batch->send_initial_metadata &&
+ batch_data->batch.send_message == batch->send_message &&
+ batch_data->batch.send_trailing_metadata ==
+ batch->send_trailing_metadata;
+ });
+ // If batch_data is a replay batch, then there will be no pending
+ // batch to complete.
+ if (pending == nullptr) {
+ GRPC_ERROR_UNREF(error);
+ return;
+ }
+ // Add closure.
+ closures->Add(pending->batch->on_complete, error,
+ "on_complete for pending batch");
+ pending->batch->on_complete = nullptr;
+ maybe_clear_pending_batch(elem, pending);
+}
+
// If there are any cached ops to replay or pending ops to start on the
// subchannel call, adds a closure to closures to invoke
-// start_retriable_subchannel_batches(), updating *num_closures as needed.
+// start_retriable_subchannel_batches().
static void add_closures_for_replay_or_pending_send_ops(
grpc_call_element* elem, subchannel_batch_data* batch_data,
- subchannel_call_retry_state* retry_state, closure_to_execute* closures,
- size_t* num_closures) {
+ subchannel_call_retry_state* retry_state,
+ grpc_core::CallCombinerClosureList* closures) {
channel_data* chand = static_cast<channel_data*>(elem->channel_data);
call_data* calld = static_cast<call_data*>(elem->call_data);
bool have_pending_send_message_ops =
@@ -1929,93 +2017,12 @@ static void add_closures_for_replay_or_pending_send_ops(
"chand=%p calld=%p: starting next batch for pending send op(s)",
chand, calld);
}
- closure_to_execute* closure = &closures[(*num_closures)++];
- closure->closure = GRPC_CLOSURE_INIT(
- &batch_data->batch.handler_private.closure,
- start_retriable_subchannel_batches, elem, grpc_schedule_on_exec_ctx);
- closure->error = GRPC_ERROR_NONE;
- closure->reason = "starting next batch for send_* op(s)";
- }
-}
-
-// For any pending batch completed in batch_data, adds the necessary
-// completion closures to closures, updating *num_closures as needed.
-static void add_closures_for_completed_pending_batches(
- grpc_call_element* elem, subchannel_batch_data* batch_data,
- subchannel_call_retry_state* retry_state, grpc_error* error,
- closure_to_execute* closures, size_t* num_closures) {
- channel_data* chand = static_cast<channel_data*>(elem->channel_data);
- call_data* calld = static_cast<call_data*>(elem->call_data);
- for (size_t i = 0; i < GPR_ARRAY_SIZE(calld->pending_batches); ++i) {
- pending_batch* pending = &calld->pending_batches[i];
- if (pending_batch_is_completed(pending, calld, retry_state)) {
- if (grpc_client_channel_trace.enabled()) {
- gpr_log(GPR_INFO,
- "chand=%p calld=%p: pending batch completed at index %" PRIuPTR,
- chand, calld, i);
- }
- // Copy the trailing metadata to return it to the surface.
- if (batch_data->batch.recv_trailing_metadata) {
- grpc_metadata_batch_move(&batch_data->recv_trailing_metadata,
- pending->batch->payload->recv_trailing_metadata
- .recv_trailing_metadata);
- }
- closure_to_execute* closure = &closures[(*num_closures)++];
- closure->closure = pending->batch->on_complete;
- closure->error = GRPC_ERROR_REF(error);
- closure->reason = "on_complete for pending batch";
- pending->batch->on_complete = nullptr;
- maybe_clear_pending_batch(elem, pending);
- }
- }
- GRPC_ERROR_UNREF(error);
-}
-
-// For any pending batch containing an op that has not yet been started,
-// adds the pending batch's completion closures to closures, updating
-// *num_closures as needed.
-static void add_closures_to_fail_unstarted_pending_batches(
- grpc_call_element* elem, subchannel_call_retry_state* retry_state,
- grpc_error* error, closure_to_execute* closures, size_t* num_closures) {
- channel_data* chand = static_cast<channel_data*>(elem->channel_data);
- call_data* calld = static_cast<call_data*>(elem->call_data);
- for (size_t i = 0; i < GPR_ARRAY_SIZE(calld->pending_batches); ++i) {
- pending_batch* pending = &calld->pending_batches[i];
- if (pending_batch_is_unstarted(pending, calld, retry_state)) {
- if (grpc_client_channel_trace.enabled()) {
- gpr_log(GPR_INFO,
- "chand=%p calld=%p: failing unstarted pending batch at index "
- "%" PRIuPTR,
- chand, calld, i);
- }
- if (pending->batch->recv_initial_metadata) {
- closure_to_execute* closure = &closures[(*num_closures)++];
- closure->closure = pending->batch->payload->recv_initial_metadata
- .recv_initial_metadata_ready;
- closure->error = GRPC_ERROR_REF(error);
- closure->reason =
- "failing recv_initial_metadata_ready for pending batch";
- pending->batch->payload->recv_initial_metadata
- .recv_initial_metadata_ready = nullptr;
- }
- if (pending->batch->recv_message) {
- *pending->batch->payload->recv_message.recv_message = nullptr;
- closure_to_execute* closure = &closures[(*num_closures)++];
- closure->closure =
- pending->batch->payload->recv_message.recv_message_ready;
- closure->error = GRPC_ERROR_REF(error);
- closure->reason = "failing recv_message_ready for pending batch";
- pending->batch->payload->recv_message.recv_message_ready = nullptr;
- }
- closure_to_execute* closure = &closures[(*num_closures)++];
- closure->closure = pending->batch->on_complete;
- closure->error = GRPC_ERROR_REF(error);
- closure->reason = "failing on_complete for pending batch";
- pending->batch->on_complete = nullptr;
- maybe_clear_pending_batch(elem, pending);
- }
+ GRPC_CLOSURE_INIT(&batch_data->batch.handler_private.closure,
+ start_retriable_subchannel_batches, elem,
+ grpc_schedule_on_exec_ctx);
+ closures->Add(&batch_data->batch.handler_private.closure, GRPC_ERROR_NONE,
+ "starting next batch for send_* op(s)");
}
- GRPC_ERROR_UNREF(error);
}
// Callback used to intercept on_complete from subchannel calls.
@@ -2035,136 +2042,49 @@ static void on_complete(void* arg, grpc_error* error) {
static_cast<subchannel_call_retry_state*>(
grpc_connected_subchannel_call_get_parent_data(
batch_data->subchannel_call));
- // If we have previously completed recv_trailing_metadata, then the
- // call is finished.
- bool call_finished = retry_state->completed_recv_trailing_metadata;
- // Record whether we were already committed before receiving this callback.
- const bool previously_committed = calld->retry_committed;
// Update bookkeeping in retry_state.
- update_retry_state_for_completed_batch(batch_data, retry_state);
- if (call_finished) {
- if (grpc_client_channel_trace.enabled()) {
- gpr_log(GPR_INFO, "chand=%p calld=%p: call already finished", chand,
- calld);
- }
- } else {
- // Check if this batch finished the call, and if so, get its status.
- // The call is finished if either (a) this callback was invoked with
- // an error or (b) we receive status.
- grpc_status_code status = GRPC_STATUS_OK;
- grpc_mdelem* server_pushback_md = nullptr;
- if (GPR_UNLIKELY(error != GRPC_ERROR_NONE)) { // Case (a).
- call_finished = true;
- grpc_error_get_status(error, calld->deadline, &status, nullptr, nullptr,
- nullptr);
- } else if (batch_data->batch.recv_trailing_metadata) { // Case (b).
- call_finished = true;
- grpc_metadata_batch* md_batch =
- batch_data->batch.payload->recv_trailing_metadata
- .recv_trailing_metadata;
- GPR_ASSERT(md_batch->idx.named.grpc_status != nullptr);
- status = grpc_get_status_code_from_metadata(
- md_batch->idx.named.grpc_status->md);
- if (md_batch->idx.named.grpc_retry_pushback_ms != nullptr) {
- server_pushback_md = &md_batch->idx.named.grpc_retry_pushback_ms->md;
- }
- }
- // If the call just finished, check if we should retry.
- if (call_finished) {
- if (grpc_client_channel_trace.enabled()) {
- gpr_log(GPR_INFO, "chand=%p calld=%p: call finished, status=%s", chand,
- calld, grpc_status_code_to_string(status));
- }
- if (maybe_retry(elem, batch_data, status, server_pushback_md)) {
- // Unref batch_data for deferred recv_initial_metadata_ready or
- // recv_message_ready callbacks, if any.
- if (batch_data->batch.recv_trailing_metadata &&
- retry_state->recv_initial_metadata_ready_deferred_batch !=
- nullptr) {
- batch_data_unref(batch_data);
- GRPC_ERROR_UNREF(retry_state->recv_initial_metadata_error);
- }
- if (batch_data->batch.recv_trailing_metadata &&
- retry_state->recv_message_ready_deferred_batch != nullptr) {
- batch_data_unref(batch_data);
- GRPC_ERROR_UNREF(retry_state->recv_message_error);
- }
- // Track number of pending subchannel send batches and determine if
- // this was the last one.
- bool last_callback_complete = false;
- if (batch_data->batch.send_initial_metadata ||
- batch_data->batch.send_message ||
- batch_data->batch.send_trailing_metadata) {
- --calld->num_pending_retriable_subchannel_send_batches;
- last_callback_complete =
- calld->num_pending_retriable_subchannel_send_batches == 0;
- }
- batch_data_unref(batch_data);
- // If we just completed the last subchannel send batch, unref the
- // call stack.
- if (last_callback_complete) {
- GRPC_CALL_STACK_UNREF(calld->owning_call, "subchannel_send_batches");
- }
- return;
- }
- // Not retrying, so commit the call.
- retry_commit(elem, retry_state);
- }
+ if (batch_data->batch.send_initial_metadata) {
+ retry_state->completed_send_initial_metadata = true;
+ }
+ if (batch_data->batch.send_message) {
+ ++retry_state->completed_send_message_count;
+ }
+ if (batch_data->batch.send_trailing_metadata) {
+ retry_state->completed_send_trailing_metadata = true;
}
- // If we were already committed before receiving this callback, free
- // cached data for send ops that we've just completed. (If the call has
- // just now finished, the call to retry_commit() above will have freed all
- // cached send ops, so we don't need to do it here.)
- if (previously_committed) {
+ // If the call is committed, free cached data for send ops that we've just
+ // completed.
+ if (calld->retry_committed) {
free_cached_send_op_data_for_completed_batch(elem, batch_data, retry_state);
}
- // Call not being retried.
// Construct list of closures to execute.
- // Max number of closures is number of pending batches plus one for
- // each of:
- // - recv_initial_metadata_ready (either deferred or unstarted)
- // - recv_message_ready (either deferred or unstarted)
- // - starting a new batch for pending send ops
- closure_to_execute closures[GPR_ARRAY_SIZE(calld->pending_batches) + 3];
- size_t num_closures = 0;
- // If there are deferred recv_initial_metadata_ready or recv_message_ready
- // callbacks, add them to closures.
- add_closures_for_deferred_recv_callbacks(batch_data, retry_state, closures,
- &num_closures);
- // Find pending batches whose ops are now complete and add their
- // on_complete callbacks to closures.
- add_closures_for_completed_pending_batches(elem, batch_data, retry_state,
- GRPC_ERROR_REF(error), closures,
- &num_closures);
- // Add closures to handle any pending batches that have not yet been started.
- // If the call is finished, we fail these batches; otherwise, we add a
- // callback to start_retriable_subchannel_batches() to start them on
- // the subchannel call.
- if (call_finished) {
- add_closures_to_fail_unstarted_pending_batches(
- elem, retry_state, GRPC_ERROR_REF(error), closures, &num_closures);
- } else {
- add_closures_for_replay_or_pending_send_ops(elem, batch_data, retry_state,
- closures, &num_closures);
+ grpc_core::CallCombinerClosureList closures;
+ // If a retry was already dispatched, that means we saw
+ // recv_trailing_metadata before this, so we do nothing here.
+ // Otherwise, invoke the callback to return the result to the surface.
+ if (!retry_state->retry_dispatched) {
+ // Add closure for the completed pending batch, if any.
+ add_closure_for_completed_pending_batch(elem, batch_data, retry_state,
+ GRPC_ERROR_REF(error), &closures);
+ // If needed, add a callback to start any replay or pending send ops on
+ // the subchannel call.
+ if (!retry_state->completed_recv_trailing_metadata) {
+ add_closures_for_replay_or_pending_send_ops(elem, batch_data, retry_state,
+ &closures);
+ }
}
// Track number of pending subchannel send batches and determine if this
// was the last one.
- bool last_callback_complete = false;
- if (batch_data->batch.send_initial_metadata ||
- batch_data->batch.send_message ||
- batch_data->batch.send_trailing_metadata) {
- --calld->num_pending_retriable_subchannel_send_batches;
- last_callback_complete =
- calld->num_pending_retriable_subchannel_send_batches == 0;
- }
+ --calld->num_pending_retriable_subchannel_send_batches;
+ const bool last_send_batch_complete =
+ calld->num_pending_retriable_subchannel_send_batches == 0;
// Don't need batch_data anymore.
batch_data_unref(batch_data);
// Schedule all of the closures identified above.
// Note: This yeilds the call combiner.
- execute_closures_in_call_combiner(elem, "on_complete", closures,
- num_closures);
- // If we just completed the last subchannel send batch, unref the call stack.
- if (last_callback_complete) {
+ closures.RunClosures(calld->call_combiner);
+ // If this was the last subchannel send batch, unref the call stack.
+ if (last_send_batch_complete) {
GRPC_CALL_STACK_UNREF(calld->owning_call, "subchannel_send_batches");
}
}
@@ -2185,27 +2105,22 @@ static void start_batch_in_call_combiner(void* arg, grpc_error* ignored) {
// Adds a closure to closures that will execute batch in the call combiner.
static void add_closure_for_subchannel_batch(
- call_data* calld, grpc_transport_stream_op_batch* batch,
- closure_to_execute* closures, size_t* num_closures) {
+ grpc_call_element* elem, grpc_transport_stream_op_batch* batch,
+ grpc_core::CallCombinerClosureList* closures) {
+ channel_data* chand = static_cast<channel_data*>(elem->channel_data);
+ call_data* calld = static_cast<call_data*>(elem->call_data);
batch->handler_private.extra_arg = calld->subchannel_call;
GRPC_CLOSURE_INIT(&batch->handler_private.closure,
start_batch_in_call_combiner, batch,
grpc_schedule_on_exec_ctx);
- closure_to_execute* closure = &closures[(*num_closures)++];
- closure->closure = &batch->handler_private.closure;
- closure->error = GRPC_ERROR_NONE;
- // If the tracer is enabled, we log a more detailed message, which
- // requires dynamic allocation. This will be freed in
- // start_retriable_subchannel_batches().
if (grpc_client_channel_trace.enabled()) {
char* batch_str = grpc_transport_stream_op_batch_string(batch);
- gpr_asprintf(const_cast<char**>(&closure->reason),
- "starting batch in call combiner: %s", batch_str);
+ gpr_log(GPR_INFO, "chand=%p calld=%p: starting subchannel batch: %s", chand,
+ calld, batch_str);
gpr_free(batch_str);
- closure->free_reason = true;
- } else {
- closure->reason = "start_subchannel_batch";
}
+ closures->Add(&batch->handler_private.closure, GRPC_ERROR_NONE,
+ "start_subchannel_batch");
}
// Adds retriable send_initial_metadata op to batch_data.
@@ -2221,28 +2136,28 @@ static void add_retriable_send_initial_metadata_op(
//
// If we've already completed one or more attempts, add the
// grpc-retry-attempts header.
- batch_data->send_initial_metadata_storage =
+ retry_state->send_initial_metadata_storage =
static_cast<grpc_linked_mdelem*>(gpr_arena_alloc(
calld->arena, sizeof(grpc_linked_mdelem) *
(calld->send_initial_metadata.list.count +
(calld->num_attempts_completed > 0))));
grpc_metadata_batch_copy(&calld->send_initial_metadata,
- &batch_data->send_initial_metadata,
- batch_data->send_initial_metadata_storage);
- if (GPR_UNLIKELY(batch_data->send_initial_metadata.idx.named
+ &retry_state->send_initial_metadata,
+ retry_state->send_initial_metadata_storage);
+ if (GPR_UNLIKELY(retry_state->send_initial_metadata.idx.named
.grpc_previous_rpc_attempts != nullptr)) {
- grpc_metadata_batch_remove(
- &batch_data->send_initial_metadata,
- batch_data->send_initial_metadata.idx.named.grpc_previous_rpc_attempts);
+ grpc_metadata_batch_remove(&retry_state->send_initial_metadata,
+ retry_state->send_initial_metadata.idx.named
+ .grpc_previous_rpc_attempts);
}
if (GPR_UNLIKELY(calld->num_attempts_completed > 0)) {
grpc_mdelem retry_md = grpc_mdelem_from_slices(
GRPC_MDSTR_GRPC_PREVIOUS_RPC_ATTEMPTS,
*retry_count_strings[calld->num_attempts_completed - 1]);
grpc_error* error = grpc_metadata_batch_add_tail(
- &batch_data->send_initial_metadata,
- &batch_data->send_initial_metadata_storage[calld->send_initial_metadata
- .list.count],
+ &retry_state->send_initial_metadata,
+ &retry_state->send_initial_metadata_storage[calld->send_initial_metadata
+ .list.count],
retry_md);
if (GPR_UNLIKELY(error != GRPC_ERROR_NONE)) {
gpr_log(GPR_ERROR, "error adding retry metadata: %s",
@@ -2253,7 +2168,7 @@ static void add_retriable_send_initial_metadata_op(
retry_state->started_send_initial_metadata = true;
batch_data->batch.send_initial_metadata = true;
batch_data->batch.payload->send_initial_metadata.send_initial_metadata =
- &batch_data->send_initial_metadata;
+ &retry_state->send_initial_metadata;
batch_data->batch.payload->send_initial_metadata.send_initial_metadata_flags =
calld->send_initial_metadata_flags;
batch_data->batch.payload->send_initial_metadata.peer_string =
@@ -2274,10 +2189,10 @@ static void add_retriable_send_message_op(
grpc_core::ByteStreamCache* cache =
(*calld->send_messages)[retry_state->started_send_message_count];
++retry_state->started_send_message_count;
- batch_data->send_message.Init(cache);
+ retry_state->send_message.Init(cache);
batch_data->batch.send_message = true;
batch_data->batch.payload->send_message.send_message.reset(
- batch_data->send_message.get());
+ retry_state->send_message.get());
}
// Adds retriable send_trailing_metadata op to batch_data.
@@ -2287,17 +2202,17 @@ static void add_retriable_send_trailing_metadata_op(
// We need to make a copy of the metadata batch for each attempt, since
// the filters in the subchannel stack may modify this batch, and we don't
// want those modifications to be passed forward to subsequent attempts.
- batch_data->send_trailing_metadata_storage =
+ retry_state->send_trailing_metadata_storage =
static_cast<grpc_linked_mdelem*>(gpr_arena_alloc(
calld->arena, sizeof(grpc_linked_mdelem) *
calld->send_trailing_metadata.list.count));
grpc_metadata_batch_copy(&calld->send_trailing_metadata,
- &batch_data->send_trailing_metadata,
- batch_data->send_trailing_metadata_storage);
+ &retry_state->send_trailing_metadata,
+ retry_state->send_trailing_metadata_storage);
retry_state->started_send_trailing_metadata = true;
batch_data->batch.send_trailing_metadata = true;
batch_data->batch.payload->send_trailing_metadata.send_trailing_metadata =
- &batch_data->send_trailing_metadata;
+ &retry_state->send_trailing_metadata;
}
// Adds retriable recv_initial_metadata op to batch_data.
@@ -2306,16 +2221,16 @@ static void add_retriable_recv_initial_metadata_op(
subchannel_batch_data* batch_data) {
retry_state->started_recv_initial_metadata = true;
batch_data->batch.recv_initial_metadata = true;
- grpc_metadata_batch_init(&batch_data->recv_initial_metadata);
+ grpc_metadata_batch_init(&retry_state->recv_initial_metadata);
batch_data->batch.payload->recv_initial_metadata.recv_initial_metadata =
- &batch_data->recv_initial_metadata;
+ &retry_state->recv_initial_metadata;
batch_data->batch.payload->recv_initial_metadata.trailing_metadata_available =
- &batch_data->trailing_metadata_available;
- GRPC_CLOSURE_INIT(&batch_data->recv_initial_metadata_ready,
+ &retry_state->trailing_metadata_available;
+ GRPC_CLOSURE_INIT(&retry_state->recv_initial_metadata_ready,
recv_initial_metadata_ready, batch_data,
grpc_schedule_on_exec_ctx);
batch_data->batch.payload->recv_initial_metadata.recv_initial_metadata_ready =
- &batch_data->recv_initial_metadata_ready;
+ &retry_state->recv_initial_metadata_ready;
}
// Adds retriable recv_message op to batch_data.
@@ -2325,11 +2240,11 @@ static void add_retriable_recv_message_op(
++retry_state->started_recv_message_count;
batch_data->batch.recv_message = true;
batch_data->batch.payload->recv_message.recv_message =
- &batch_data->recv_message;
- GRPC_CLOSURE_INIT(&batch_data->recv_message_ready, recv_message_ready,
+ &retry_state->recv_message;
+ GRPC_CLOSURE_INIT(&retry_state->recv_message_ready, recv_message_ready,
batch_data, grpc_schedule_on_exec_ctx);
batch_data->batch.payload->recv_message.recv_message_ready =
- &batch_data->recv_message_ready;
+ &retry_state->recv_message_ready;
}
// Adds retriable recv_trailing_metadata op to batch_data.
@@ -2338,12 +2253,17 @@ static void add_retriable_recv_trailing_metadata_op(
subchannel_batch_data* batch_data) {
retry_state->started_recv_trailing_metadata = true;
batch_data->batch.recv_trailing_metadata = true;
- grpc_metadata_batch_init(&batch_data->recv_trailing_metadata);
+ grpc_metadata_batch_init(&retry_state->recv_trailing_metadata);
batch_data->batch.payload->recv_trailing_metadata.recv_trailing_metadata =
- &batch_data->recv_trailing_metadata;
- batch_data->batch.collect_stats = true;
- batch_data->batch.payload->collect_stats.collect_stats =
- &batch_data->collect_stats;
+ &retry_state->recv_trailing_metadata;
+ batch_data->batch.payload->recv_trailing_metadata.collect_stats =
+ &retry_state->collect_stats;
+ GRPC_CLOSURE_INIT(&retry_state->recv_trailing_metadata_ready,
+ recv_trailing_metadata_ready, batch_data,
+ grpc_schedule_on_exec_ctx);
+ batch_data->batch.payload->recv_trailing_metadata
+ .recv_trailing_metadata_ready =
+ &retry_state->recv_trailing_metadata_ready;
}
// Helper function used to start a recv_trailing_metadata batch. This
@@ -2364,9 +2284,11 @@ static void start_internal_recv_trailing_metadata(grpc_call_element* elem) {
grpc_connected_subchannel_call_get_parent_data(
calld->subchannel_call));
// Create batch_data with 2 refs, since this batch will be unreffed twice:
- // once when the subchannel batch returns, and again when we actually get
- // a recv_trailing_metadata op from the surface.
- subchannel_batch_data* batch_data = batch_data_create(elem, 2);
+ // once for the recv_trailing_metadata_ready callback when the subchannel
+ // batch returns, and again when we actually get a recv_trailing_metadata
+ // op from the surface.
+ subchannel_batch_data* batch_data =
+ batch_data_create(elem, 2, false /* set_on_complete */);
add_retriable_recv_trailing_metadata_op(calld, retry_state, batch_data);
retry_state->recv_trailing_metadata_internal_batch = batch_data;
// Note: This will release the call combiner.
@@ -2391,7 +2313,7 @@ static subchannel_batch_data* maybe_create_subchannel_batch_for_replay(
"send_initial_metadata op",
chand, calld);
}
- replay_batch_data = batch_data_create(elem, 1);
+ replay_batch_data = batch_data_create(elem, 1, true /* set_on_complete */);
add_retriable_send_initial_metadata_op(calld, retry_state,
replay_batch_data);
}
@@ -2408,7 +2330,8 @@ static subchannel_batch_data* maybe_create_subchannel_batch_for_replay(
chand, calld);
}
if (replay_batch_data == nullptr) {
- replay_batch_data = batch_data_create(elem, 1);
+ replay_batch_data =
+ batch_data_create(elem, 1, true /* set_on_complete */);
}
add_retriable_send_message_op(elem, retry_state, replay_batch_data);
}
@@ -2427,7 +2350,8 @@ static subchannel_batch_data* maybe_create_subchannel_batch_for_replay(
chand, calld);
}
if (replay_batch_data == nullptr) {
- replay_batch_data = batch_data_create(elem, 1);
+ replay_batch_data =
+ batch_data_create(elem, 1, true /* set_on_complete */);
}
add_retriable_send_trailing_metadata_op(calld, retry_state,
replay_batch_data);
@@ -2439,7 +2363,7 @@ static subchannel_batch_data* maybe_create_subchannel_batch_for_replay(
// *num_batches as needed.
static void add_subchannel_batches_for_pending_batches(
grpc_call_element* elem, subchannel_call_retry_state* retry_state,
- closure_to_execute* closures, size_t* num_closures) {
+ grpc_core::CallCombinerClosureList* closures) {
call_data* calld = static_cast<call_data*>(elem->call_data);
for (size_t i = 0; i < GPR_ARRAY_SIZE(calld->pending_batches); ++i) {
pending_batch* pending = &calld->pending_batches[i];
@@ -2493,15 +2417,11 @@ static void add_subchannel_batches_for_pending_batches(
// started subchannel batch, since we'll propagate the
// completion when it completes.
if (retry_state->completed_recv_trailing_metadata) {
- subchannel_batch_data* batch_data =
- retry_state->recv_trailing_metadata_internal_batch;
- closure_to_execute* closure = &closures[(*num_closures)++];
- closure->closure = &batch_data->on_complete;
// Batches containing recv_trailing_metadata always succeed.
- closure->error = GRPC_ERROR_NONE;
- closure->reason =
- "re-executing on_complete for recv_trailing_metadata "
- "to propagate internally triggered result";
+ closures->Add(
+ &retry_state->recv_trailing_metadata_ready, GRPC_ERROR_NONE,
+ "re-executing recv_trailing_metadata_ready to propagate "
+ "internally triggered result");
} else {
batch_data_unref(retry_state->recv_trailing_metadata_internal_batch);
}
@@ -2513,14 +2433,19 @@ static void add_subchannel_batches_for_pending_batches(
if (calld->method_params == nullptr ||
calld->method_params->retry_policy() == nullptr ||
calld->retry_committed) {
- add_closure_for_subchannel_batch(calld, batch, closures, num_closures);
+ add_closure_for_subchannel_batch(elem, batch, closures);
pending_batch_clear(calld, pending);
continue;
}
// Create batch with the right number of callbacks.
- const int num_callbacks =
- 1 + batch->recv_initial_metadata + batch->recv_message;
- subchannel_batch_data* batch_data = batch_data_create(elem, num_callbacks);
+ const bool has_send_ops = batch->send_initial_metadata ||
+ batch->send_message ||
+ batch->send_trailing_metadata;
+ const int num_callbacks = has_send_ops + batch->recv_initial_metadata +
+ batch->recv_message +
+ batch->recv_trailing_metadata;
+ subchannel_batch_data* batch_data = batch_data_create(
+ elem, num_callbacks, has_send_ops /* set_on_complete */);
// Cache send ops if needed.
maybe_cache_send_ops_for_batch(calld, pending);
// send_initial_metadata.
@@ -2547,11 +2472,9 @@ static void add_subchannel_batches_for_pending_batches(
}
// recv_trailing_metadata.
if (batch->recv_trailing_metadata) {
- GPR_ASSERT(batch->collect_stats);
add_retriable_recv_trailing_metadata_op(calld, retry_state, batch_data);
}
- add_closure_for_subchannel_batch(calld, &batch_data->batch, closures,
- num_closures);
+ add_closure_for_subchannel_batch(elem, &batch_data->batch, closures);
// Track number of pending subchannel send batches.
// If this is the first one, take a ref to the call stack.
if (batch->send_initial_metadata || batch->send_message ||
@@ -2579,15 +2502,13 @@ static void start_retriable_subchannel_batches(void* arg, grpc_error* ignored) {
grpc_connected_subchannel_call_get_parent_data(
calld->subchannel_call));
// Construct list of closures to execute, one for each pending batch.
- // We can start up to 6 batches.
- closure_to_execute closures[GPR_ARRAY_SIZE(calld->pending_batches)];
- size_t num_closures = 0;
+ grpc_core::CallCombinerClosureList closures;
// Replay previously-returned send_* ops if needed.
subchannel_batch_data* replay_batch_data =
maybe_create_subchannel_batch_for_replay(elem, retry_state);
if (replay_batch_data != nullptr) {
- add_closure_for_subchannel_batch(calld, &replay_batch_data->batch, closures,
- &num_closures);
+ add_closure_for_subchannel_batch(elem, &replay_batch_data->batch,
+ &closures);
// Track number of pending subchannel send batches.
// If this is the first one, take a ref to the call stack.
if (calld->num_pending_retriable_subchannel_send_batches == 0) {
@@ -2596,17 +2517,16 @@ static void start_retriable_subchannel_batches(void* arg, grpc_error* ignored) {
++calld->num_pending_retriable_subchannel_send_batches;
}
// Now add pending batches.
- add_subchannel_batches_for_pending_batches(elem, retry_state, closures,
- &num_closures);
+ add_subchannel_batches_for_pending_batches(elem, retry_state, &closures);
// Start batches on subchannel call.
if (grpc_client_channel_trace.enabled()) {
gpr_log(GPR_INFO,
"chand=%p calld=%p: starting %" PRIuPTR
" retriable batches on subchannel_call=%p",
- chand, calld, num_closures, calld->subchannel_call);
+ chand, calld, closures.size(), calld->subchannel_call);
}
- execute_closures_in_call_combiner(elem, "start_retriable_subchannel_batches",
- closures, num_closures);
+ // Note: This will yield the call combiner.
+ closures.RunClosures(calld->call_combiner);
}
//
diff --git a/src/core/ext/filters/client_channel/http_proxy.cc b/src/core/ext/filters/client_channel/http_proxy.cc
index 29a6c0e367..26d3f479b7 100644
--- a/src/core/ext/filters/client_channel/http_proxy.cc
+++ b/src/core/ext/filters/client_channel/http_proxy.cc
@@ -37,17 +37,21 @@
#include "src/core/lib/slice/b64.h"
/**
- * Parses the 'http_proxy' env var and returns the proxy hostname to resolve or
- * nullptr on error. Also sets 'user_cred' to user credentials if present in the
- * 'http_proxy' env var, otherwise leaves it unchanged. It is caller's
- * responsibility to gpr_free user_cred.
+ * Parses the 'https_proxy' env var (fallback on 'http_proxy') and returns the
+ * proxy hostname to resolve or nullptr on error. Also sets 'user_cred' to user
+ * credentials if present in the 'http_proxy' env var, otherwise leaves it
+ * unchanged. It is caller's responsibility to gpr_free user_cred.
*/
static char* get_http_proxy_server(char** user_cred) {
GPR_ASSERT(user_cred != nullptr);
char* proxy_name = nullptr;
- char* uri_str = gpr_getenv("http_proxy");
char** authority_strs = nullptr;
size_t authority_nstrs;
+ /* Prefer using 'https_proxy'. Fallback on 'http_proxy' if it is not set. The
+ * fallback behavior can be removed if there's a demand for it.
+ */
+ char* uri_str = gpr_getenv("https_proxy");
+ if (uri_str == nullptr) uri_str = gpr_getenv("http_proxy");
if (uri_str == nullptr) return nullptr;
grpc_uri* uri = grpc_uri_parse(uri_str, false /* suppress_errors */);
if (uri == nullptr || uri->authority == nullptr) {
@@ -83,11 +87,24 @@ done:
return proxy_name;
}
+/**
+ * Checks the value of GRPC_ARG_ENABLE_HTTP_PROXY to determine if http_proxy
+ * should be used.
+ */
+bool http_proxy_enabled(const grpc_channel_args* args) {
+ const grpc_arg* arg =
+ grpc_channel_args_find(args, GRPC_ARG_ENABLE_HTTP_PROXY);
+ return grpc_channel_arg_get_bool(arg, true);
+}
+
static bool proxy_mapper_map_name(grpc_proxy_mapper* mapper,
const char* server_uri,
const grpc_channel_args* args,
char** name_to_resolve,
grpc_channel_args** new_args) {
+ if (!http_proxy_enabled(args)) {
+ return false;
+ }
char* user_cred = nullptr;
*name_to_resolve = get_http_proxy_server(&user_cred);
if (*name_to_resolve == nullptr) return false;
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc
index ed246273c9..f24281a5bf 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc
@@ -18,9 +18,9 @@
#include <grpc/support/port_platform.h>
+#include "pb_decode.h"
+#include "pb_encode.h"
#include "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h"
-#include "third_party/nanopb/pb_decode.h"
-#include "third_party/nanopb/pb_encode.h"
#include <grpc/support/alloc.h>
@@ -73,7 +73,7 @@ grpc_grpclb_request* grpc_grpclb_request_create(const char* lb_service_name) {
}
static void populate_timestamp(gpr_timespec timestamp,
- struct _grpc_lb_v1_Timestamp* timestamp_pb) {
+ grpc_grpclb_timestamp* timestamp_pb) {
timestamp_pb->has_seconds = true;
timestamp_pb->seconds = timestamp.tv_sec;
timestamp_pb->has_nanos = true;
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h
index 06810a9fe8..9ca7b28d8e 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h
@@ -33,7 +33,9 @@ typedef grpc_lb_v1_Server_ip_address_t grpc_grpclb_ip_address;
typedef grpc_lb_v1_LoadBalanceRequest grpc_grpclb_request;
typedef grpc_lb_v1_InitialLoadBalanceResponse grpc_grpclb_initial_response;
typedef grpc_lb_v1_Server grpc_grpclb_server;
-typedef grpc_lb_v1_Duration grpc_grpclb_duration;
+typedef google_protobuf_Duration grpc_grpclb_duration;
+typedef google_protobuf_Timestamp grpc_grpclb_timestamp;
+
typedef struct {
grpc_grpclb_server** servers;
size_t num_servers;
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c b/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c
new file mode 100644
index 0000000000..131d9b7cae
--- /dev/null
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c
@@ -0,0 +1,19 @@
+/* Automatically generated nanopb constant definitions */
+/* Generated by nanopb-0.3.7-dev */
+
+#include "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h"
+/* @@protoc_insertion_point(includes) */
+#if PB_PROTO_HEADER_VERSION != 30
+#error Regenerate this file with the current version of nanopb generator.
+#endif
+
+
+
+const pb_field_t google_protobuf_Duration_fields[3] = {
+ PB_FIELD( 1, INT64 , OPTIONAL, STATIC , FIRST, google_protobuf_Duration, seconds, seconds, 0),
+ PB_FIELD( 2, INT32 , OPTIONAL, STATIC , OTHER, google_protobuf_Duration, nanos, seconds, 0),
+ PB_LAST_FIELD
+};
+
+
+/* @@protoc_insertion_point(eof) */
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h
new file mode 100644
index 0000000000..93070c65b8
--- /dev/null
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h
@@ -0,0 +1,54 @@
+/* Automatically generated nanopb header */
+/* Generated by nanopb-0.3.7-dev */
+
+#ifndef PB_GOOGLE_PROTOBUF_DURATION_PB_H_INCLUDED
+#define PB_GOOGLE_PROTOBUF_DURATION_PB_H_INCLUDED
+#include "pb.h"
+/* @@protoc_insertion_point(includes) */
+#if PB_PROTO_HEADER_VERSION != 30
+#error Regenerate this file with the current version of nanopb generator.
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Struct definitions */
+typedef struct _google_protobuf_Duration {
+ bool has_seconds;
+ int64_t seconds;
+ bool has_nanos;
+ int32_t nanos;
+/* @@protoc_insertion_point(struct:google_protobuf_Duration) */
+} google_protobuf_Duration;
+
+/* Default values for struct fields */
+
+/* Initializer values for message structs */
+#define google_protobuf_Duration_init_default {false, 0, false, 0}
+#define google_protobuf_Duration_init_zero {false, 0, false, 0}
+
+/* Field tags (for use in manual encoding/decoding) */
+#define google_protobuf_Duration_seconds_tag 1
+#define google_protobuf_Duration_nanos_tag 2
+
+/* Struct field encoding specification for nanopb */
+extern const pb_field_t google_protobuf_Duration_fields[3];
+
+/* Maximum encoded size of messages (where known) */
+#define google_protobuf_Duration_size 22
+
+/* Message IDs (where set with "msgid" option) */
+#ifdef PB_MSGID
+
+#define DURATION_MESSAGES \
+
+
+#endif
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+/* @@protoc_insertion_point(eof) */
+
+#endif
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c b/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c
new file mode 100644
index 0000000000..b6f8ffc559
--- /dev/null
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c
@@ -0,0 +1,19 @@
+/* Automatically generated nanopb constant definitions */
+/* Generated by nanopb-0.3.7-dev */
+
+#include "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h"
+/* @@protoc_insertion_point(includes) */
+#if PB_PROTO_HEADER_VERSION != 30
+#error Regenerate this file with the current version of nanopb generator.
+#endif
+
+
+
+const pb_field_t google_protobuf_Timestamp_fields[3] = {
+ PB_FIELD( 1, INT64 , OPTIONAL, STATIC , FIRST, google_protobuf_Timestamp, seconds, seconds, 0),
+ PB_FIELD( 2, INT32 , OPTIONAL, STATIC , OTHER, google_protobuf_Timestamp, nanos, seconds, 0),
+ PB_LAST_FIELD
+};
+
+
+/* @@protoc_insertion_point(eof) */
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h
new file mode 100644
index 0000000000..7f48481524
--- /dev/null
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h
@@ -0,0 +1,54 @@
+/* Automatically generated nanopb header */
+/* Generated by nanopb-0.3.7-dev */
+
+#ifndef PB_GOOGLE_PROTOBUF_TIMESTAMP_PB_H_INCLUDED
+#define PB_GOOGLE_PROTOBUF_TIMESTAMP_PB_H_INCLUDED
+#include "pb.h"
+/* @@protoc_insertion_point(includes) */
+#if PB_PROTO_HEADER_VERSION != 30
+#error Regenerate this file with the current version of nanopb generator.
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Struct definitions */
+typedef struct _google_protobuf_Timestamp {
+ bool has_seconds;
+ int64_t seconds;
+ bool has_nanos;
+ int32_t nanos;
+/* @@protoc_insertion_point(struct:google_protobuf_Timestamp) */
+} google_protobuf_Timestamp;
+
+/* Default values for struct fields */
+
+/* Initializer values for message structs */
+#define google_protobuf_Timestamp_init_default {false, 0, false, 0}
+#define google_protobuf_Timestamp_init_zero {false, 0, false, 0}
+
+/* Field tags (for use in manual encoding/decoding) */
+#define google_protobuf_Timestamp_seconds_tag 1
+#define google_protobuf_Timestamp_nanos_tag 2
+
+/* Struct field encoding specification for nanopb */
+extern const pb_field_t google_protobuf_Timestamp_fields[3];
+
+/* Maximum encoded size of messages (where known) */
+#define google_protobuf_Timestamp_size 22
+
+/* Message IDs (where set with "msgid" option) */
+#ifdef PB_MSGID
+
+#define TIMESTAMP_MESSAGES \
+
+
+#endif
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+/* @@protoc_insertion_point(eof) */
+
+#endif
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 4e6c5cc832..f6538e1349 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
@@ -2,7 +2,6 @@
/* Generated by nanopb-0.3.7-dev */
#include "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h"
-
/* @@protoc_insertion_point(includes) */
#if PB_PROTO_HEADER_VERSION != 30
#error Regenerate this file with the current version of nanopb generator.
@@ -10,18 +9,6 @@
-const pb_field_t grpc_lb_v1_Duration_fields[3] = {
- PB_FIELD( 1, INT64 , OPTIONAL, STATIC , FIRST, grpc_lb_v1_Duration, seconds, seconds, 0),
- PB_FIELD( 2, INT32 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_Duration, nanos, seconds, 0),
- 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),
@@ -40,7 +27,7 @@ const pb_field_t grpc_lb_v1_ClientStatsPerToken_fields[3] = {
};
const pb_field_t grpc_lb_v1_ClientStats_fields[7] = {
- PB_FIELD( 1, MESSAGE , OPTIONAL, STATIC , FIRST, grpc_lb_v1_ClientStats, timestamp, timestamp, &grpc_lb_v1_Timestamp_fields),
+ PB_FIELD( 1, MESSAGE , OPTIONAL, STATIC , FIRST, grpc_lb_v1_ClientStats, timestamp, timestamp, &google_protobuf_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( 6, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_ClientStats, num_calls_finished_with_client_failed_to_send, num_calls_finished, 0),
@@ -57,7 +44,7 @@ const pb_field_t grpc_lb_v1_LoadBalanceResponse_fields[3] = {
const pb_field_t grpc_lb_v1_InitialLoadBalanceResponse_fields[3] = {
PB_FIELD( 1, STRING , OPTIONAL, STATIC , FIRST, grpc_lb_v1_InitialLoadBalanceResponse, load_balancer_delegate, load_balancer_delegate, 0),
- PB_FIELD( 2, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v1_InitialLoadBalanceResponse, client_stats_report_interval, load_balancer_delegate, &grpc_lb_v1_Duration_fields),
+ PB_FIELD( 2, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v1_InitialLoadBalanceResponse, client_stats_report_interval, load_balancer_delegate, &google_protobuf_Duration_fields),
PB_LAST_FIELD
};
@@ -84,7 +71,7 @@ const pb_field_t grpc_lb_v1_Server_fields[5] = {
* 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_ClientStats, calls_finished_with_drop) < 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), 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_ClientStatsPerToken_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_ClientStats, timestamp) < 65536 && pb_membersize(grpc_lb_v1_ClientStats, calls_finished_with_drop) < 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), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_grpc_lb_v1_LoadBalanceRequest_grpc_lb_v1_InitialLoadBalanceRequest_grpc_lb_v1_ClientStatsPerToken_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)
@@ -95,7 +82,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_ClientStats, calls_finished_with_drop) < 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), 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_ClientStatsPerToken_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_ClientStats, timestamp) < 256 && pb_membersize(grpc_lb_v1_ClientStats, calls_finished_with_drop) < 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), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_grpc_lb_v1_LoadBalanceRequest_grpc_lb_v1_InitialLoadBalanceRequest_grpc_lb_v1_ClientStatsPerToken_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 066c076202..a4ff516d8e 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
@@ -3,7 +3,9 @@
#ifndef PB_GRPC_LB_V1_LOAD_BALANCER_PB_H_INCLUDED
#define PB_GRPC_LB_V1_LOAD_BALANCER_PB_H_INCLUDED
-#include "third_party/nanopb/pb.h"
+#include "pb.h"
+#include "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h"
+#include "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h"
/* @@protoc_insertion_point(includes) */
#if PB_PROTO_HEADER_VERSION != 30
#error Regenerate this file with the current version of nanopb generator.
@@ -19,6 +21,21 @@ typedef struct _grpc_lb_v1_ServerList {
/* @@protoc_insertion_point(struct:grpc_lb_v1_ServerList) */
} grpc_lb_v1_ServerList;
+typedef struct _grpc_lb_v1_ClientStats {
+ bool has_timestamp;
+ google_protobuf_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_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;
+ pb_callback_t calls_finished_with_drop;
+/* @@protoc_insertion_point(struct:grpc_lb_v1_ClientStats) */
+} grpc_lb_v1_ClientStats;
+
typedef struct _grpc_lb_v1_ClientStatsPerToken {
pb_callback_t load_balance_token;
bool has_num_calls;
@@ -26,20 +43,20 @@ typedef struct _grpc_lb_v1_ClientStatsPerToken {
/* @@protoc_insertion_point(struct:grpc_lb_v1_ClientStatsPerToken) */
} grpc_lb_v1_ClientStatsPerToken;
-typedef struct _grpc_lb_v1_Duration {
- bool has_seconds;
- int64_t seconds;
- bool has_nanos;
- int32_t nanos;
-/* @@protoc_insertion_point(struct:grpc_lb_v1_Duration) */
-} grpc_lb_v1_Duration;
-
typedef struct _grpc_lb_v1_InitialLoadBalanceRequest {
bool has_name;
char name[128];
/* @@protoc_insertion_point(struct:grpc_lb_v1_InitialLoadBalanceRequest) */
} grpc_lb_v1_InitialLoadBalanceRequest;
+typedef struct _grpc_lb_v1_InitialLoadBalanceResponse {
+ bool has_load_balancer_delegate;
+ char load_balancer_delegate[64];
+ bool has_client_stats_report_interval;
+ google_protobuf_Duration client_stats_report_interval;
+/* @@protoc_insertion_point(struct:grpc_lb_v1_InitialLoadBalanceResponse) */
+} grpc_lb_v1_InitialLoadBalanceResponse;
+
typedef PB_BYTES_ARRAY_T(16) grpc_lb_v1_Server_ip_address_t;
typedef struct _grpc_lb_v1_Server {
bool has_ip_address;
@@ -53,37 +70,6 @@ typedef struct _grpc_lb_v1_Server {
/* @@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_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;
- pb_callback_t calls_finished_with_drop;
-/* @@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];
- bool has_client_stats_report_interval;
- grpc_lb_v1_Duration client_stats_report_interval;
-/* @@protoc_insertion_point(struct:grpc_lb_v1_InitialLoadBalanceResponse) */
-} grpc_lb_v1_InitialLoadBalanceResponse;
-
typedef struct _grpc_lb_v1_LoadBalanceRequest {
bool has_initial_request;
grpc_lb_v1_InitialLoadBalanceRequest initial_request;
@@ -103,56 +89,46 @@ typedef struct _grpc_lb_v1_LoadBalanceResponse {
/* Default values for struct fields */
/* 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_ClientStatsPerToken_init_default {{{NULL}, NULL}, false, 0}
-#define grpc_lb_v1_ClientStats_init_default {false, grpc_lb_v1_Timestamp_init_default, false, 0, false, 0, false, 0, false, 0, {{NULL}, NULL}}
+#define grpc_lb_v1_ClientStats_init_default {false, google_protobuf_Timestamp_init_default, false, 0, false, 0, false, 0, false, 0, {{NULL}, NULL}}
#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_InitialLoadBalanceResponse_init_default {false, "", false, google_protobuf_Duration_init_default}
#define grpc_lb_v1_ServerList_init_default {{{NULL}, NULL}}
#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_ClientStatsPerToken_init_zero {{{NULL}, NULL}, false, 0}
-#define grpc_lb_v1_ClientStats_init_zero {false, grpc_lb_v1_Timestamp_init_zero, false, 0, false, 0, false, 0, false, 0, {{NULL}, NULL}}
+#define grpc_lb_v1_ClientStats_init_zero {false, google_protobuf_Timestamp_init_zero, false, 0, false, 0, false, 0, false, 0, {{NULL}, NULL}}
#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_InitialLoadBalanceResponse_init_zero {false, "", false, google_protobuf_Duration_init_zero}
#define grpc_lb_v1_ServerList_init_zero {{{NULL}, NULL}}
#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_ServerList_servers_tag 1
-#define grpc_lb_v1_ClientStatsPerToken_load_balance_token_tag 1
-#define grpc_lb_v1_ClientStatsPerToken_num_calls_tag 2
-#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_tag 4
-#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_client_failed_to_send_tag 6
#define grpc_lb_v1_ClientStats_num_calls_finished_known_received_tag 7
#define grpc_lb_v1_ClientStats_calls_finished_with_drop_tag 8
+#define grpc_lb_v1_ClientStatsPerToken_load_balance_token_tag 1
+#define grpc_lb_v1_ClientStatsPerToken_num_calls_tag 2
+#define grpc_lb_v1_InitialLoadBalanceRequest_name_tag 1
#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_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_tag 4
#define grpc_lb_v1_LoadBalanceRequest_initial_request_tag 1
#define grpc_lb_v1_LoadBalanceRequest_client_stats_tag 2
#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_ClientStatsPerToken_fields[3];
@@ -163,8 +139,6 @@ extern const pb_field_t grpc_lb_v1_ServerList_fields[2];
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 (140 + grpc_lb_v1_ClientStats_size)
#define grpc_lb_v1_InitialLoadBalanceRequest_size 131
/* grpc_lb_v1_ClientStatsPerToken_size depends on runtime parameters */
diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
index 3c40ae14b8..f4f6444c5f 100644
--- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
+++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
@@ -414,10 +414,10 @@ void AresDnsResolver::StartResolvingLocked() {
resolving_ = true;
lb_addresses_ = nullptr;
service_config_json_ = nullptr;
- pending_request_ = grpc_dns_lookup_ares(
+ pending_request_ = grpc_dns_lookup_ares_locked(
dns_server_, name_to_resolve_, kDefaultPort, interested_parties_,
&on_resolved_, &lb_addresses_, true /* check_grpclb */,
- request_service_config_ ? &service_config_json_ : nullptr);
+ request_service_config_ ? &service_config_json_ : nullptr, combiner());
last_resolution_timestamp_ = grpc_core::ExecCtx::Get()->Now();
}
diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc
new file mode 100644
index 0000000000..06a6e853f5
--- /dev/null
+++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc
@@ -0,0 +1,311 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/iomgr/port.h"
+#if GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_ARES_EV_DRIVER)
+
+#include <ares.h>
+#include <string.h>
+#include <sys/ioctl.h>
+
+#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h"
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/time.h>
+#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/iomgr/ev_posix.h"
+#include "src/core/lib/iomgr/iomgr_internal.h"
+#include "src/core/lib/iomgr/sockaddr_utils.h"
+
+typedef struct fd_node {
+ /** the owner of this fd node */
+ grpc_ares_ev_driver* ev_driver;
+ /** a closure wrapping on_readable_locked, which should be
+ invoked when the grpc_fd in this node becomes readable. */
+ grpc_closure read_closure;
+ /** a closure wrapping on_writable_locked, which should be
+ invoked when the grpc_fd in this node becomes writable. */
+ grpc_closure write_closure;
+ /** next fd node in the list */
+ struct fd_node* next;
+
+ /** wrapped fd that's polled by grpc's poller for the current platform */
+ grpc_core::GrpcPolledFd* grpc_polled_fd;
+ /** if the readable closure has been registered */
+ bool readable_registered;
+ /** if the writable closure has been registered */
+ bool writable_registered;
+ /** if the fd has been shutdown yet from grpc iomgr perspective */
+ bool already_shutdown;
+} fd_node;
+
+struct grpc_ares_ev_driver {
+ /** the ares_channel owned by this event driver */
+ ares_channel channel;
+ /** pollset set for driving the IO events of the channel */
+ grpc_pollset_set* pollset_set;
+ /** refcount of the event driver */
+ gpr_refcount refs;
+
+ /** combiner to synchronize c-ares and I/O callbacks on */
+ grpc_combiner* combiner;
+ /** a list of grpc_fd that this event driver is currently using. */
+ fd_node* fds;
+ /** is this event driver currently working? */
+ bool working;
+ /** is this event driver being shut down */
+ bool shutting_down;
+};
+
+static void grpc_ares_notify_on_event_locked(grpc_ares_ev_driver* ev_driver);
+
+static grpc_ares_ev_driver* grpc_ares_ev_driver_ref(
+ grpc_ares_ev_driver* ev_driver) {
+ gpr_log(GPR_DEBUG, "Ref ev_driver %" PRIuPTR, (uintptr_t)ev_driver);
+ gpr_ref(&ev_driver->refs);
+ return ev_driver;
+}
+
+static void grpc_ares_ev_driver_unref(grpc_ares_ev_driver* ev_driver) {
+ gpr_log(GPR_DEBUG, "Unref ev_driver %" PRIuPTR, (uintptr_t)ev_driver);
+ if (gpr_unref(&ev_driver->refs)) {
+ gpr_log(GPR_DEBUG, "destroy ev_driver %" PRIuPTR, (uintptr_t)ev_driver);
+ GPR_ASSERT(ev_driver->fds == nullptr);
+ GRPC_COMBINER_UNREF(ev_driver->combiner, "free ares event driver");
+ ares_destroy(ev_driver->channel);
+ gpr_free(ev_driver);
+ }
+}
+
+static void fd_node_destroy_locked(fd_node* fdn) {
+ gpr_log(GPR_DEBUG, "delete fd: %s", fdn->grpc_polled_fd->GetName());
+ GPR_ASSERT(!fdn->readable_registered);
+ GPR_ASSERT(!fdn->writable_registered);
+ GPR_ASSERT(fdn->already_shutdown);
+ grpc_core::Delete(fdn->grpc_polled_fd);
+ gpr_free(fdn);
+}
+
+static void fd_node_shutdown_locked(fd_node* fdn, const char* reason) {
+ if (!fdn->already_shutdown) {
+ fdn->already_shutdown = true;
+ fdn->grpc_polled_fd->ShutdownLocked(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING(reason));
+ }
+}
+
+grpc_error* grpc_ares_ev_driver_create_locked(grpc_ares_ev_driver** ev_driver,
+ grpc_pollset_set* pollset_set,
+ grpc_combiner* combiner) {
+ *ev_driver = static_cast<grpc_ares_ev_driver*>(
+ gpr_malloc(sizeof(grpc_ares_ev_driver)));
+ ares_options opts;
+ memset(&opts, 0, sizeof(opts));
+ opts.flags |= ARES_FLAG_STAYOPEN;
+ int status = ares_init_options(&(*ev_driver)->channel, &opts, ARES_OPT_FLAGS);
+ grpc_core::ConfigureAresChannelLocked(&(*ev_driver)->channel);
+ gpr_log(GPR_DEBUG, "grpc_ares_ev_driver_create_locked");
+ if (status != ARES_SUCCESS) {
+ char* err_msg;
+ gpr_asprintf(&err_msg, "Failed to init ares channel. C-ares error: %s",
+ ares_strerror(status));
+ grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(err_msg);
+ gpr_free(err_msg);
+ gpr_free(*ev_driver);
+ return err;
+ }
+ (*ev_driver)->combiner = GRPC_COMBINER_REF(combiner, "ares event driver");
+ gpr_ref_init(&(*ev_driver)->refs, 1);
+ (*ev_driver)->pollset_set = pollset_set;
+ (*ev_driver)->fds = nullptr;
+ (*ev_driver)->working = false;
+ (*ev_driver)->shutting_down = false;
+ return GRPC_ERROR_NONE;
+}
+
+void grpc_ares_ev_driver_destroy_locked(grpc_ares_ev_driver* ev_driver) {
+ // We mark the event driver as being shut down. If the event driver
+ // is working, grpc_ares_notify_on_event_locked will shut down the
+ // fds; if it's not working, there are no fds to shut down.
+ ev_driver->shutting_down = true;
+ grpc_ares_ev_driver_unref(ev_driver);
+}
+
+void grpc_ares_ev_driver_shutdown_locked(grpc_ares_ev_driver* ev_driver) {
+ ev_driver->shutting_down = true;
+ fd_node* fn = ev_driver->fds;
+ while (fn != nullptr) {
+ fd_node_shutdown_locked(fn, "grpc_ares_ev_driver_shutdown");
+ fn = fn->next;
+ }
+}
+
+// Search fd in the fd_node list head. This is an O(n) search, the max possible
+// value of n is ARES_GETSOCK_MAXNUM (16). n is typically 1 - 2 in our tests.
+static fd_node* pop_fd_node_locked(fd_node** head, ares_socket_t as) {
+ fd_node dummy_head;
+ dummy_head.next = *head;
+ fd_node* node = &dummy_head;
+ while (node->next != nullptr) {
+ if (node->next->grpc_polled_fd->GetWrappedAresSocketLocked() == as) {
+ fd_node* ret = node->next;
+ node->next = node->next->next;
+ *head = dummy_head.next;
+ return ret;
+ }
+ node = node->next;
+ }
+ return nullptr;
+}
+
+static void on_readable_locked(void* arg, grpc_error* error) {
+ fd_node* fdn = static_cast<fd_node*>(arg);
+ grpc_ares_ev_driver* ev_driver = fdn->ev_driver;
+ const ares_socket_t as = fdn->grpc_polled_fd->GetWrappedAresSocketLocked();
+ fdn->readable_registered = false;
+ gpr_log(GPR_DEBUG, "readable on %s", fdn->grpc_polled_fd->GetName());
+ if (error == GRPC_ERROR_NONE) {
+ do {
+ ares_process_fd(ev_driver->channel, as, ARES_SOCKET_BAD);
+ } while (fdn->grpc_polled_fd->IsFdStillReadableLocked());
+ } else {
+ // If error is not GRPC_ERROR_NONE, it means the fd has been shutdown or
+ // timed out. The pending lookups made on this ev_driver will be cancelled
+ // by the following ares_cancel() and the on_done callbacks will be invoked
+ // with a status of ARES_ECANCELLED. The remaining file descriptors in this
+ // ev_driver will be cleaned up in the follwing
+ // grpc_ares_notify_on_event_locked().
+ ares_cancel(ev_driver->channel);
+ }
+ grpc_ares_notify_on_event_locked(ev_driver);
+ grpc_ares_ev_driver_unref(ev_driver);
+}
+
+static void on_writable_locked(void* arg, grpc_error* error) {
+ fd_node* fdn = static_cast<fd_node*>(arg);
+ grpc_ares_ev_driver* ev_driver = fdn->ev_driver;
+ const ares_socket_t as = fdn->grpc_polled_fd->GetWrappedAresSocketLocked();
+ fdn->writable_registered = false;
+ gpr_log(GPR_DEBUG, "writable on %s", fdn->grpc_polled_fd->GetName());
+ if (error == GRPC_ERROR_NONE) {
+ ares_process_fd(ev_driver->channel, ARES_SOCKET_BAD, as);
+ } else {
+ // If error is not GRPC_ERROR_NONE, it means the fd has been shutdown or
+ // timed out. The pending lookups made on this ev_driver will be cancelled
+ // by the following ares_cancel() and the on_done callbacks will be invoked
+ // with a status of ARES_ECANCELLED. The remaining file descriptors in this
+ // ev_driver will be cleaned up in the follwing
+ // grpc_ares_notify_on_event_locked().
+ ares_cancel(ev_driver->channel);
+ }
+ grpc_ares_notify_on_event_locked(ev_driver);
+ grpc_ares_ev_driver_unref(ev_driver);
+}
+
+ares_channel* grpc_ares_ev_driver_get_channel_locked(
+ grpc_ares_ev_driver* ev_driver) {
+ return &ev_driver->channel;
+}
+
+// Get the file descriptors used by the ev_driver's ares channel, register
+// driver_closure with these filedescriptors.
+static void grpc_ares_notify_on_event_locked(grpc_ares_ev_driver* ev_driver) {
+ fd_node* new_list = nullptr;
+ if (!ev_driver->shutting_down) {
+ ares_socket_t socks[ARES_GETSOCK_MAXNUM];
+ int socks_bitmask =
+ ares_getsock(ev_driver->channel, socks, ARES_GETSOCK_MAXNUM);
+ for (size_t i = 0; i < ARES_GETSOCK_MAXNUM; i++) {
+ if (ARES_GETSOCK_READABLE(socks_bitmask, i) ||
+ ARES_GETSOCK_WRITABLE(socks_bitmask, i)) {
+ fd_node* fdn = pop_fd_node_locked(&ev_driver->fds, socks[i]);
+ // Create a new fd_node if sock[i] is not in the fd_node list.
+ if (fdn == nullptr) {
+ fdn = static_cast<fd_node*>(gpr_malloc(sizeof(fd_node)));
+ fdn->grpc_polled_fd = grpc_core::NewGrpcPolledFdLocked(
+ socks[i], ev_driver->pollset_set);
+ gpr_log(GPR_DEBUG, "new fd: %s", fdn->grpc_polled_fd->GetName());
+ fdn->ev_driver = ev_driver;
+ fdn->readable_registered = false;
+ fdn->writable_registered = false;
+ fdn->already_shutdown = false;
+ GRPC_CLOSURE_INIT(&fdn->read_closure, on_readable_locked, fdn,
+ grpc_combiner_scheduler(ev_driver->combiner));
+ GRPC_CLOSURE_INIT(&fdn->write_closure, on_writable_locked, fdn,
+ grpc_combiner_scheduler(ev_driver->combiner));
+ }
+ fdn->next = new_list;
+ new_list = fdn;
+ // Register read_closure if the socket is readable and read_closure has
+ // not been registered with this socket.
+ if (ARES_GETSOCK_READABLE(socks_bitmask, i) &&
+ !fdn->readable_registered) {
+ grpc_ares_ev_driver_ref(ev_driver);
+ gpr_log(GPR_DEBUG, "notify read on: %s",
+ fdn->grpc_polled_fd->GetName());
+ fdn->grpc_polled_fd->RegisterForOnReadableLocked(&fdn->read_closure);
+ fdn->readable_registered = true;
+ }
+ // Register write_closure if the socket is writable and write_closure
+ // has not been registered with this socket.
+ if (ARES_GETSOCK_WRITABLE(socks_bitmask, i) &&
+ !fdn->writable_registered) {
+ gpr_log(GPR_DEBUG, "notify write on: %s",
+ fdn->grpc_polled_fd->GetName());
+ grpc_ares_ev_driver_ref(ev_driver);
+ fdn->grpc_polled_fd->RegisterForOnWriteableLocked(
+ &fdn->write_closure);
+ fdn->writable_registered = true;
+ }
+ }
+ }
+ }
+ // Any remaining fds in ev_driver->fds were not returned by ares_getsock() and
+ // are therefore no longer in use, so they can be shut down and removed from
+ // the list.
+ while (ev_driver->fds != nullptr) {
+ fd_node* cur = ev_driver->fds;
+ ev_driver->fds = ev_driver->fds->next;
+ fd_node_shutdown_locked(cur, "c-ares fd shutdown");
+ if (!cur->readable_registered && !cur->writable_registered) {
+ fd_node_destroy_locked(cur);
+ } else {
+ cur->next = new_list;
+ new_list = cur;
+ }
+ }
+ ev_driver->fds = new_list;
+ // If the ev driver has no working fd, all the tasks are done.
+ if (new_list == nullptr) {
+ ev_driver->working = false;
+ gpr_log(GPR_DEBUG, "ev driver stop working");
+ }
+}
+
+void grpc_ares_ev_driver_start_locked(grpc_ares_ev_driver* ev_driver) {
+ if (!ev_driver->working) {
+ ev_driver->working = true;
+ grpc_ares_notify_on_event_locked(ev_driver);
+ }
+}
+
+#endif /* GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_ARES_EV_DRIVER) */
diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
index 6239549534..7002c8f95f 100644
--- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
+++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <ares.h>
+#include "src/core/lib/gprpp/abstract.h"
#include "src/core/lib/iomgr/pollset_set.h"
typedef struct grpc_ares_ev_driver grpc_ares_ev_driver;
@@ -29,25 +30,62 @@ typedef struct grpc_ares_ev_driver grpc_ares_ev_driver;
/* Start \a ev_driver. It will keep working until all IO on its ares_channel is
done, or grpc_ares_ev_driver_destroy() is called. It may notify the callbacks
bound to its ares_channel when necessary. */
-void grpc_ares_ev_driver_start(grpc_ares_ev_driver* ev_driver);
+void grpc_ares_ev_driver_start_locked(grpc_ares_ev_driver* ev_driver);
/* Returns the ares_channel owned by \a ev_driver. To bind a c-ares query to
\a ev_driver, use the ares_channel owned by \a ev_driver as the arg of the
query. */
-ares_channel* grpc_ares_ev_driver_get_channel(grpc_ares_ev_driver* ev_driver);
+ares_channel* grpc_ares_ev_driver_get_channel_locked(
+ grpc_ares_ev_driver* ev_driver);
/* Creates a new grpc_ares_ev_driver. Returns GRPC_ERROR_NONE if \a ev_driver is
created successfully. */
-grpc_error* grpc_ares_ev_driver_create(grpc_ares_ev_driver** ev_driver,
- grpc_pollset_set* pollset_set);
+grpc_error* grpc_ares_ev_driver_create_locked(grpc_ares_ev_driver** ev_driver,
+ grpc_pollset_set* pollset_set,
+ grpc_combiner* combiner);
/* Destroys \a ev_driver asynchronously. Pending lookups made on \a ev_driver
will be cancelled and their on_done callbacks will be invoked with a status
of ARES_ECANCELLED. */
-void grpc_ares_ev_driver_destroy(grpc_ares_ev_driver* ev_driver);
+void grpc_ares_ev_driver_destroy_locked(grpc_ares_ev_driver* ev_driver);
/* Shutdown all the grpc_fds used by \a ev_driver */
-void grpc_ares_ev_driver_shutdown(grpc_ares_ev_driver* ev_driver);
+void grpc_ares_ev_driver_shutdown_locked(grpc_ares_ev_driver* ev_driver);
+
+namespace grpc_core {
+
+/* A wrapped fd that integrates with the grpc iomgr of the current platform.
+ * A GrpcPolledFd knows how to create grpc platform-specific iomgr endpoints
+ * from "ares_socket_t" sockets, and then sign up for readability/writeability
+ * with that poller, and do shutdown and destruction. */
+class GrpcPolledFd {
+ public:
+ virtual ~GrpcPolledFd() {}
+ /* Called when c-ares library is interested and there's no pending callback */
+ virtual void RegisterForOnReadableLocked(grpc_closure* read_closure)
+ GRPC_ABSTRACT;
+ /* Called when c-ares library is interested and there's no pending callback */
+ virtual void RegisterForOnWriteableLocked(grpc_closure* write_closure)
+ GRPC_ABSTRACT;
+ /* Indicates if there is data left even after just being read from */
+ virtual bool IsFdStillReadableLocked() GRPC_ABSTRACT;
+ /* Called once and only once. Must cause cancellation of any pending
+ * read/write callbacks. */
+ virtual void ShutdownLocked(grpc_error* error) GRPC_ABSTRACT;
+ /* Get the underlying ares_socket_t that this was created from */
+ virtual ares_socket_t GetWrappedAresSocketLocked() GRPC_ABSTRACT;
+ /* A unique name, for logging */
+ virtual const char* GetName() GRPC_ABSTRACT;
+
+ GRPC_ABSTRACT_BASE_CLASS
+};
+
+/* Creates a new wrapped fd for the current platform */
+GrpcPolledFd* NewGrpcPolledFdLocked(ares_socket_t as,
+ grpc_pollset_set* driver_pollset_set);
+void ConfigureAresChannelLocked(ares_channel* channel);
+
+} // namespace grpc_core
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_EV_DRIVER_H \
*/
diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
index b604f2bf14..5db832baf8 100644
--- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
+++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
@@ -18,9 +18,10 @@
#include <grpc/support/port_platform.h>
#include "src/core/lib/iomgr/port.h"
-#if GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET)
+#if GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_ARES_EV_DRIVER)
#include <ares.h>
+#include <string.h>
#include <sys/ioctl.h>
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h"
@@ -35,317 +36,60 @@
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/sockaddr_utils.h"
-typedef struct fd_node {
- /** the owner of this fd node */
- grpc_ares_ev_driver* ev_driver;
- /** a closure wrapping on_readable_cb, which should be invoked when the
- grpc_fd in this node becomes readable. */
- grpc_closure read_closure;
- /** a closure wrapping on_writable_cb, which should be invoked when the
- grpc_fd in this node becomes writable. */
- grpc_closure write_closure;
- /** next fd node in the list */
- struct fd_node* next;
+namespace grpc_core {
- /** mutex guarding the rest of the state */
- gpr_mu mu;
- /** the grpc_fd owned by this fd node */
- grpc_fd* fd;
- /** if the readable closure has been registered */
- bool readable_registered;
- /** if the writable closure has been registered */
- bool writable_registered;
- /** if the fd is being shut down */
- bool shutting_down;
-} fd_node;
-
-struct grpc_ares_ev_driver {
- /** the ares_channel owned by this event driver */
- ares_channel channel;
- /** pollset set for driving the IO events of the channel */
- grpc_pollset_set* pollset_set;
- /** refcount of the event driver */
- gpr_refcount refs;
-
- /** mutex guarding the rest of the state */
- gpr_mu mu;
- /** a list of grpc_fd that this event driver is currently using. */
- fd_node* fds;
- /** is this event driver currently working? */
- bool working;
- /** is this event driver being shut down */
- bool shutting_down;
-};
-
-static void grpc_ares_notify_on_event_locked(grpc_ares_ev_driver* ev_driver);
-
-static grpc_ares_ev_driver* grpc_ares_ev_driver_ref(
- grpc_ares_ev_driver* ev_driver) {
- gpr_log(GPR_DEBUG, "Ref ev_driver %" PRIuPTR, (uintptr_t)ev_driver);
- gpr_ref(&ev_driver->refs);
- return ev_driver;
-}
-
-static void grpc_ares_ev_driver_unref(grpc_ares_ev_driver* ev_driver) {
- gpr_log(GPR_DEBUG, "Unref ev_driver %" PRIuPTR, (uintptr_t)ev_driver);
- if (gpr_unref(&ev_driver->refs)) {
- gpr_log(GPR_DEBUG, "destroy ev_driver %" PRIuPTR, (uintptr_t)ev_driver);
- GPR_ASSERT(ev_driver->fds == nullptr);
- gpr_mu_destroy(&ev_driver->mu);
- ares_destroy(ev_driver->channel);
- gpr_free(ev_driver);
+class GrpcPolledFdPosix : public GrpcPolledFd {
+ public:
+ GrpcPolledFdPosix(ares_socket_t as, grpc_pollset_set* driver_pollset_set)
+ : as_(as) {
+ gpr_asprintf(&name_, "c-ares fd: %d", (int)as);
+ fd_ = grpc_fd_create((int)as, name_, false);
+ grpc_pollset_set_add_fd(driver_pollset_set, fd_);
}
-}
-static void fd_node_destroy(fd_node* fdn) {
- gpr_log(GPR_DEBUG, "delete fd: %d", grpc_fd_wrapped_fd(fdn->fd));
- GPR_ASSERT(!fdn->readable_registered);
- GPR_ASSERT(!fdn->writable_registered);
- gpr_mu_destroy(&fdn->mu);
- /* c-ares library has closed the fd inside grpc_fd. This fd may be picked up
- immediately by another thread, and should not be closed by the following
- grpc_fd_orphan. */
- grpc_fd_orphan(fdn->fd, nullptr, nullptr, true /* already_closed */,
- "c-ares query finished");
- gpr_free(fdn);
-}
-
-static void fd_node_shutdown(fd_node* fdn) {
- gpr_mu_lock(&fdn->mu);
- fdn->shutting_down = true;
- if (!fdn->readable_registered && !fdn->writable_registered) {
- gpr_mu_unlock(&fdn->mu);
- fd_node_destroy(fdn);
- } else {
- grpc_fd_shutdown(
- fdn->fd, GRPC_ERROR_CREATE_FROM_STATIC_STRING("c-ares fd shutdown"));
- gpr_mu_unlock(&fdn->mu);
+ ~GrpcPolledFdPosix() {
+ gpr_free(name_);
+ /* c-ares library will close the fd inside grpc_fd. This fd may be picked up
+ immediately by another thread, and should not be closed by the following
+ grpc_fd_orphan. */
+ int dummy_release_fd;
+ grpc_fd_orphan(fd_, nullptr, &dummy_release_fd, "c-ares query finished");
}
-}
-grpc_error* grpc_ares_ev_driver_create(grpc_ares_ev_driver** ev_driver,
- grpc_pollset_set* pollset_set) {
- *ev_driver = static_cast<grpc_ares_ev_driver*>(
- gpr_malloc(sizeof(grpc_ares_ev_driver)));
- int status = ares_init(&(*ev_driver)->channel);
- gpr_log(GPR_DEBUG, "grpc_ares_ev_driver_create");
- if (status != ARES_SUCCESS) {
- char* err_msg;
- gpr_asprintf(&err_msg, "Failed to init ares channel. C-ares error: %s",
- ares_strerror(status));
- grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(err_msg);
- gpr_free(err_msg);
- gpr_free(*ev_driver);
- return err;
+ void RegisterForOnReadableLocked(grpc_closure* read_closure) override {
+ grpc_fd_notify_on_read(fd_, read_closure);
}
- gpr_mu_init(&(*ev_driver)->mu);
- gpr_ref_init(&(*ev_driver)->refs, 1);
- (*ev_driver)->pollset_set = pollset_set;
- (*ev_driver)->fds = nullptr;
- (*ev_driver)->working = false;
- (*ev_driver)->shutting_down = false;
- return GRPC_ERROR_NONE;
-}
-void grpc_ares_ev_driver_destroy(grpc_ares_ev_driver* ev_driver) {
- // It's not safe to shut down remaining fds here directly, becauses
- // ares_host_callback does not provide an exec_ctx. We mark the event driver
- // as being shut down. If the event driver is working,
- // grpc_ares_notify_on_event_locked will shut down the fds; if it's not
- // working, there are no fds to shut down.
- gpr_mu_lock(&ev_driver->mu);
- ev_driver->shutting_down = true;
- gpr_mu_unlock(&ev_driver->mu);
- grpc_ares_ev_driver_unref(ev_driver);
-}
-
-void grpc_ares_ev_driver_shutdown(grpc_ares_ev_driver* ev_driver) {
- gpr_mu_lock(&ev_driver->mu);
- ev_driver->shutting_down = true;
- fd_node* fn = ev_driver->fds;
- while (fn != nullptr) {
- grpc_fd_shutdown(fn->fd, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "grpc_ares_ev_driver_shutdown"));
- fn = fn->next;
+ void RegisterForOnWriteableLocked(grpc_closure* write_closure) override {
+ grpc_fd_notify_on_write(fd_, write_closure);
}
- gpr_mu_unlock(&ev_driver->mu);
-}
-// Search fd in the fd_node list head. This is an O(n) search, the max possible
-// value of n is ARES_GETSOCK_MAXNUM (16). n is typically 1 - 2 in our tests.
-static fd_node* pop_fd_node(fd_node** head, int fd) {
- fd_node dummy_head;
- dummy_head.next = *head;
- fd_node* node = &dummy_head;
- while (node->next != nullptr) {
- if (grpc_fd_wrapped_fd(node->next->fd) == fd) {
- fd_node* ret = node->next;
- node->next = node->next->next;
- *head = dummy_head.next;
- return ret;
- }
- node = node->next;
+ bool IsFdStillReadableLocked() override {
+ size_t bytes_available = 0;
+ return ioctl(grpc_fd_wrapped_fd(fd_), FIONREAD, &bytes_available) == 0 &&
+ bytes_available > 0;
}
- return nullptr;
-}
-
-/* Check if \a fd is still readable */
-static bool grpc_ares_is_fd_still_readable(grpc_ares_ev_driver* ev_driver,
- int fd) {
- size_t bytes_available = 0;
- return ioctl(fd, FIONREAD, &bytes_available) == 0 && bytes_available > 0;
-}
-static void on_readable_cb(void* arg, grpc_error* error) {
- fd_node* fdn = static_cast<fd_node*>(arg);
- grpc_ares_ev_driver* ev_driver = fdn->ev_driver;
- gpr_mu_lock(&fdn->mu);
- const int fd = grpc_fd_wrapped_fd(fdn->fd);
- fdn->readable_registered = false;
- if (fdn->shutting_down && !fdn->writable_registered) {
- gpr_mu_unlock(&fdn->mu);
- fd_node_destroy(fdn);
- grpc_ares_ev_driver_unref(ev_driver);
- return;
+ void ShutdownLocked(grpc_error* error) override {
+ grpc_fd_shutdown(fd_, error);
}
- gpr_mu_unlock(&fdn->mu);
- gpr_log(GPR_DEBUG, "readable on %d", fd);
- if (error == GRPC_ERROR_NONE) {
- do {
- ares_process_fd(ev_driver->channel, fd, ARES_SOCKET_BAD);
- } while (grpc_ares_is_fd_still_readable(ev_driver, fd));
- } else {
- // If error is not GRPC_ERROR_NONE, it means the fd has been shutdown or
- // timed out. The pending lookups made on this ev_driver will be cancelled
- // by the following ares_cancel() and the on_done callbacks will be invoked
- // with a status of ARES_ECANCELLED. The remaining file descriptors in this
- // ev_driver will be cleaned up in the follwing
- // grpc_ares_notify_on_event_locked().
- ares_cancel(ev_driver->channel);
- }
- gpr_mu_lock(&ev_driver->mu);
- grpc_ares_notify_on_event_locked(ev_driver);
- gpr_mu_unlock(&ev_driver->mu);
- grpc_ares_ev_driver_unref(ev_driver);
-}
+ ares_socket_t GetWrappedAresSocketLocked() override { return as_; }
-static void on_writable_cb(void* arg, grpc_error* error) {
- fd_node* fdn = static_cast<fd_node*>(arg);
- grpc_ares_ev_driver* ev_driver = fdn->ev_driver;
- gpr_mu_lock(&fdn->mu);
- const int fd = grpc_fd_wrapped_fd(fdn->fd);
- fdn->writable_registered = false;
- if (fdn->shutting_down && !fdn->readable_registered) {
- gpr_mu_unlock(&fdn->mu);
- fd_node_destroy(fdn);
- grpc_ares_ev_driver_unref(ev_driver);
- return;
- }
- gpr_mu_unlock(&fdn->mu);
+ const char* GetName() override { return name_; }
- gpr_log(GPR_DEBUG, "writable on %d", fd);
- if (error == GRPC_ERROR_NONE) {
- ares_process_fd(ev_driver->channel, ARES_SOCKET_BAD, fd);
- } else {
- // If error is not GRPC_ERROR_NONE, it means the fd has been shutdown or
- // timed out. The pending lookups made on this ev_driver will be cancelled
- // by the following ares_cancel() and the on_done callbacks will be invoked
- // with a status of ARES_ECANCELLED. The remaining file descriptors in this
- // ev_driver will be cleaned up in the follwing
- // grpc_ares_notify_on_event_locked().
- ares_cancel(ev_driver->channel);
- }
- gpr_mu_lock(&ev_driver->mu);
- grpc_ares_notify_on_event_locked(ev_driver);
- gpr_mu_unlock(&ev_driver->mu);
- grpc_ares_ev_driver_unref(ev_driver);
-}
+ char* name_;
+ ares_socket_t as_;
+ grpc_fd* fd_;
+};
-ares_channel* grpc_ares_ev_driver_get_channel(grpc_ares_ev_driver* ev_driver) {
- return &ev_driver->channel;
+GrpcPolledFd* NewGrpcPolledFdLocked(ares_socket_t as,
+ grpc_pollset_set* driver_pollset_set) {
+ return grpc_core::New<GrpcPolledFdPosix>(as, driver_pollset_set);
}
-// Get the file descriptors used by the ev_driver's ares channel, register
-// driver_closure with these filedescriptors.
-static void grpc_ares_notify_on_event_locked(grpc_ares_ev_driver* ev_driver) {
- fd_node* new_list = nullptr;
- if (!ev_driver->shutting_down) {
- ares_socket_t socks[ARES_GETSOCK_MAXNUM];
- int socks_bitmask =
- ares_getsock(ev_driver->channel, socks, ARES_GETSOCK_MAXNUM);
- for (size_t i = 0; i < ARES_GETSOCK_MAXNUM; i++) {
- if (ARES_GETSOCK_READABLE(socks_bitmask, i) ||
- ARES_GETSOCK_WRITABLE(socks_bitmask, i)) {
- fd_node* fdn = pop_fd_node(&ev_driver->fds, socks[i]);
- // Create a new fd_node if sock[i] is not in the fd_node list.
- if (fdn == nullptr) {
- char* fd_name;
- gpr_asprintf(&fd_name, "ares_ev_driver-%" PRIuPTR, i);
- fdn = static_cast<fd_node*>(gpr_malloc(sizeof(fd_node)));
- gpr_log(GPR_DEBUG, "new fd: %d", socks[i]);
- fdn->fd = grpc_fd_create(socks[i], fd_name);
- fdn->ev_driver = ev_driver;
- fdn->readable_registered = false;
- fdn->writable_registered = false;
- fdn->shutting_down = false;
- gpr_mu_init(&fdn->mu);
- GRPC_CLOSURE_INIT(&fdn->read_closure, on_readable_cb, fdn,
- grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&fdn->write_closure, on_writable_cb, fdn,
- grpc_schedule_on_exec_ctx);
- grpc_pollset_set_add_fd(ev_driver->pollset_set, fdn->fd);
- gpr_free(fd_name);
- }
- fdn->next = new_list;
- new_list = fdn;
- gpr_mu_lock(&fdn->mu);
- // Register read_closure if the socket is readable and read_closure has
- // not been registered with this socket.
- if (ARES_GETSOCK_READABLE(socks_bitmask, i) &&
- !fdn->readable_registered) {
- grpc_ares_ev_driver_ref(ev_driver);
- gpr_log(GPR_DEBUG, "notify read on: %d", grpc_fd_wrapped_fd(fdn->fd));
- grpc_fd_notify_on_read(fdn->fd, &fdn->read_closure);
- fdn->readable_registered = true;
- }
- // Register write_closure if the socket is writable and write_closure
- // has not been registered with this socket.
- if (ARES_GETSOCK_WRITABLE(socks_bitmask, i) &&
- !fdn->writable_registered) {
- gpr_log(GPR_DEBUG, "notify write on: %d",
- grpc_fd_wrapped_fd(fdn->fd));
- grpc_ares_ev_driver_ref(ev_driver);
- grpc_fd_notify_on_write(fdn->fd, &fdn->write_closure);
- fdn->writable_registered = true;
- }
- gpr_mu_unlock(&fdn->mu);
- }
- }
- }
- // Any remaining fds in ev_driver->fds were not returned by ares_getsock() and
- // are therefore no longer in use, so they can be shut down and removed from
- // the list.
- while (ev_driver->fds != nullptr) {
- fd_node* cur = ev_driver->fds;
- ev_driver->fds = ev_driver->fds->next;
- fd_node_shutdown(cur);
- }
- ev_driver->fds = new_list;
- // If the ev driver has no working fd, all the tasks are done.
- if (new_list == nullptr) {
- ev_driver->working = false;
- gpr_log(GPR_DEBUG, "ev driver stop working");
- }
-}
+void ConfigureAresChannelLocked(ares_channel* channel) {}
-void grpc_ares_ev_driver_start(grpc_ares_ev_driver* ev_driver) {
- gpr_mu_lock(&ev_driver->mu);
- if (!ev_driver->working) {
- ev_driver->working = true;
- grpc_ares_notify_on_event_locked(ev_driver);
- }
- gpr_mu_unlock(&ev_driver->mu);
-}
+} // namespace grpc_core
-#endif /* GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET) */
+#endif /* GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_ARES_EV_DRIVER) */
diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
index 18d0a7b9f6..471de58e8c 100644
--- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
+++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
@@ -65,8 +65,6 @@ struct grpc_ares_request {
/** number of ongoing queries */
gpr_refcount pending_queries;
- /** mutex guarding the rest of the state */
- gpr_mu mu;
/** is there at least one successful query, set in on_done_cb */
bool success;
/** the errors explaining the request failure, set in on_done_cb */
@@ -74,7 +72,8 @@ struct grpc_ares_request {
};
typedef struct grpc_ares_hostbyname_request {
- /** following members are set in create_hostbyname_request */
+ /** following members are set in create_hostbyname_request_locked
+ */
/** the top-level request instance */
grpc_ares_request* parent_request;
/** host to resolve, parsed from the name to resolve */
@@ -96,10 +95,6 @@ static uint16_t strhtons(const char* port) {
return htons(static_cast<unsigned short>(atoi(port)));
}
-static void grpc_ares_request_ref(grpc_ares_request* r) {
- gpr_ref(&r->pending_queries);
-}
-
static void log_address_sorting_list(grpc_lb_addresses* lb_addrs,
const char* input_output_str) {
for (size_t i = 0; i < lb_addrs->num_addresses; i++) {
@@ -149,7 +144,11 @@ void grpc_cares_wrapper_test_only_address_sorting_sort(
grpc_cares_wrapper_address_sorting_sort(lb_addrs);
}
-static void grpc_ares_request_unref(grpc_ares_request* r) {
+static void grpc_ares_request_ref_locked(grpc_ares_request* r) {
+ gpr_ref(&r->pending_queries);
+}
+
+static void grpc_ares_request_unref_locked(grpc_ares_request* r) {
/* If there are no pending queries, invoke on_done callback and destroy the
request */
if (gpr_unref(&r->pending_queries)) {
@@ -158,13 +157,12 @@ static void grpc_ares_request_unref(grpc_ares_request* r) {
grpc_cares_wrapper_address_sorting_sort(lb_addrs);
}
GRPC_CLOSURE_SCHED(r->on_done, r->error);
- gpr_mu_destroy(&r->mu);
- grpc_ares_ev_driver_destroy(r->ev_driver);
+ grpc_ares_ev_driver_destroy_locked(r->ev_driver);
gpr_free(r);
}
}
-static grpc_ares_hostbyname_request* create_hostbyname_request(
+static grpc_ares_hostbyname_request* create_hostbyname_request_locked(
grpc_ares_request* parent_request, char* host, uint16_t port,
bool is_balancer) {
grpc_ares_hostbyname_request* hr = static_cast<grpc_ares_hostbyname_request*>(
@@ -173,22 +171,22 @@ static grpc_ares_hostbyname_request* create_hostbyname_request(
hr->host = gpr_strdup(host);
hr->port = port;
hr->is_balancer = is_balancer;
- grpc_ares_request_ref(parent_request);
+ grpc_ares_request_ref_locked(parent_request);
return hr;
}
-static void destroy_hostbyname_request(grpc_ares_hostbyname_request* hr) {
- grpc_ares_request_unref(hr->parent_request);
+static void destroy_hostbyname_request_locked(
+ grpc_ares_hostbyname_request* hr) {
+ grpc_ares_request_unref_locked(hr->parent_request);
gpr_free(hr->host);
gpr_free(hr);
}
-static void on_hostbyname_done_cb(void* arg, int status, int timeouts,
- struct hostent* hostent) {
+static void on_hostbyname_done_locked(void* arg, int status, int timeouts,
+ struct hostent* hostent) {
grpc_ares_hostbyname_request* hr =
static_cast<grpc_ares_hostbyname_request*>(arg);
grpc_ares_request* r = hr->parent_request;
- gpr_mu_lock(&r->mu);
if (status == ARES_SUCCESS) {
GRPC_ERROR_UNREF(r->error);
r->error = GRPC_ERROR_NONE;
@@ -263,33 +261,33 @@ static void on_hostbyname_done_cb(void* arg, int status, int timeouts,
r->error = grpc_error_add_child(error, r->error);
}
}
- gpr_mu_unlock(&r->mu);
- destroy_hostbyname_request(hr);
+ destroy_hostbyname_request_locked(hr);
}
-static void on_srv_query_done_cb(void* arg, int status, int timeouts,
- unsigned char* abuf, int alen) {
+static void on_srv_query_done_locked(void* arg, int status, int timeouts,
+ unsigned char* abuf, int alen) {
grpc_ares_request* r = static_cast<grpc_ares_request*>(arg);
- gpr_log(GPR_DEBUG, "on_query_srv_done_cb");
+ gpr_log(GPR_DEBUG, "on_query_srv_done_locked");
if (status == ARES_SUCCESS) {
- gpr_log(GPR_DEBUG, "on_query_srv_done_cb ARES_SUCCESS");
+ gpr_log(GPR_DEBUG, "on_query_srv_done_locked ARES_SUCCESS");
struct ares_srv_reply* reply;
const int parse_status = ares_parse_srv_reply(abuf, alen, &reply);
if (parse_status == ARES_SUCCESS) {
- ares_channel* channel = grpc_ares_ev_driver_get_channel(r->ev_driver);
+ ares_channel* channel =
+ grpc_ares_ev_driver_get_channel_locked(r->ev_driver);
for (struct ares_srv_reply* srv_it = reply; srv_it != nullptr;
srv_it = srv_it->next) {
if (grpc_ipv6_loopback_available()) {
- grpc_ares_hostbyname_request* hr = create_hostbyname_request(
+ grpc_ares_hostbyname_request* hr = create_hostbyname_request_locked(
r, srv_it->host, htons(srv_it->port), true /* is_balancer */);
ares_gethostbyname(*channel, hr->host, AF_INET6,
- on_hostbyname_done_cb, hr);
+ on_hostbyname_done_locked, hr);
}
- grpc_ares_hostbyname_request* hr = create_hostbyname_request(
+ grpc_ares_hostbyname_request* hr = create_hostbyname_request_locked(
r, srv_it->host, htons(srv_it->port), true /* is_balancer */);
- ares_gethostbyname(*channel, hr->host, AF_INET, on_hostbyname_done_cb,
- hr);
- grpc_ares_ev_driver_start(r->ev_driver);
+ ares_gethostbyname(*channel, hr->host, AF_INET,
+ on_hostbyname_done_locked, hr);
+ grpc_ares_ev_driver_start_locked(r->ev_driver);
}
}
if (reply != nullptr) {
@@ -307,21 +305,20 @@ static void on_srv_query_done_cb(void* arg, int status, int timeouts,
r->error = grpc_error_add_child(error, r->error);
}
}
- grpc_ares_request_unref(r);
+ grpc_ares_request_unref_locked(r);
}
static const char g_service_config_attribute_prefix[] = "grpc_config=";
-static void on_txt_done_cb(void* arg, int status, int timeouts,
- unsigned char* buf, int len) {
- gpr_log(GPR_DEBUG, "on_txt_done_cb");
+static void on_txt_done_locked(void* arg, int status, int timeouts,
+ unsigned char* buf, int len) {
+ gpr_log(GPR_DEBUG, "on_txt_done_locked");
char* error_msg;
grpc_ares_request* r = static_cast<grpc_ares_request*>(arg);
const size_t prefix_len = sizeof(g_service_config_attribute_prefix) - 1;
struct ares_txt_ext* result = nullptr;
struct ares_txt_ext* reply = nullptr;
grpc_error* error = GRPC_ERROR_NONE;
- gpr_mu_lock(&r->mu);
if (status != ARES_SUCCESS) goto fail;
status = ares_parse_txt_reply_ext(buf, len, &reply);
if (status != ARES_SUCCESS) goto fail;
@@ -366,14 +363,14 @@ fail:
r->error = grpc_error_add_child(error, r->error);
}
done:
- gpr_mu_unlock(&r->mu);
- grpc_ares_request_unref(r);
+ grpc_ares_request_unref_locked(r);
}
-static grpc_ares_request* grpc_dns_lookup_ares_impl(
+static grpc_ares_request* grpc_dns_lookup_ares_locked_impl(
const char* dns_server, const char* name, const char* default_port,
grpc_pollset_set* interested_parties, grpc_closure* on_done,
- grpc_lb_addresses** addrs, bool check_grpclb, char** service_config_json) {
+ grpc_lb_addresses** addrs, bool check_grpclb, char** service_config_json,
+ grpc_combiner* combiner) {
grpc_error* error = GRPC_ERROR_NONE;
grpc_ares_hostbyname_request* hr = nullptr;
grpc_ares_request* r = nullptr;
@@ -402,20 +399,19 @@ static grpc_ares_request* grpc_dns_lookup_ares_impl(
}
port = gpr_strdup(default_port);
}
-
grpc_ares_ev_driver* ev_driver;
- error = grpc_ares_ev_driver_create(&ev_driver, interested_parties);
+ error = grpc_ares_ev_driver_create_locked(&ev_driver, interested_parties,
+ combiner);
if (error != GRPC_ERROR_NONE) goto error_cleanup;
r = static_cast<grpc_ares_request*>(gpr_zalloc(sizeof(grpc_ares_request)));
- gpr_mu_init(&r->mu);
r->ev_driver = ev_driver;
r->on_done = on_done;
r->lb_addrs_out = addrs;
r->service_config_json_out = service_config_json;
r->success = false;
r->error = GRPC_ERROR_NONE;
- channel = grpc_ares_ev_driver_get_channel(r->ev_driver);
+ channel = grpc_ares_ev_driver_get_channel_locked(r->ev_driver);
// If dns_server is specified, use it.
if (dns_server != nullptr) {
@@ -457,32 +453,34 @@ static grpc_ares_request* grpc_dns_lookup_ares_impl(
}
gpr_ref_init(&r->pending_queries, 1);
if (grpc_ipv6_loopback_available()) {
- hr = create_hostbyname_request(r, host, strhtons(port),
- false /* is_balancer */);
- ares_gethostbyname(*channel, hr->host, AF_INET6, on_hostbyname_done_cb, hr);
+ hr = create_hostbyname_request_locked(r, host, strhtons(port),
+ false /* is_balancer */);
+ ares_gethostbyname(*channel, hr->host, AF_INET6, on_hostbyname_done_locked,
+ hr);
}
- hr = create_hostbyname_request(r, host, strhtons(port),
- false /* is_balancer */);
- ares_gethostbyname(*channel, hr->host, AF_INET, on_hostbyname_done_cb, hr);
+ hr = create_hostbyname_request_locked(r, host, strhtons(port),
+ false /* is_balancer */);
+ ares_gethostbyname(*channel, hr->host, AF_INET, on_hostbyname_done_locked,
+ hr);
if (check_grpclb) {
/* Query the SRV record */
- grpc_ares_request_ref(r);
+ grpc_ares_request_ref_locked(r);
char* service_name;
gpr_asprintf(&service_name, "_grpclb._tcp.%s", host);
- ares_query(*channel, service_name, ns_c_in, ns_t_srv, on_srv_query_done_cb,
- r);
+ ares_query(*channel, service_name, ns_c_in, ns_t_srv,
+ on_srv_query_done_locked, r);
gpr_free(service_name);
}
if (service_config_json != nullptr) {
- grpc_ares_request_ref(r);
+ grpc_ares_request_ref_locked(r);
char* config_name;
gpr_asprintf(&config_name, "_grpc_config.%s", host);
- ares_search(*channel, config_name, ns_c_in, ns_t_txt, on_txt_done_cb, r);
+ ares_search(*channel, config_name, ns_c_in, ns_t_txt, on_txt_done_locked,
+ r);
gpr_free(config_name);
}
- /* TODO(zyc): Handle CNAME records here. */
- grpc_ares_ev_driver_start(r->ev_driver);
- grpc_ares_request_unref(r);
+ grpc_ares_ev_driver_start_locked(r->ev_driver);
+ grpc_ares_request_unref_locked(r);
gpr_free(host);
gpr_free(port);
return r;
@@ -494,15 +492,15 @@ error_cleanup:
return nullptr;
}
-grpc_ares_request* (*grpc_dns_lookup_ares)(
+grpc_ares_request* (*grpc_dns_lookup_ares_locked)(
const char* dns_server, const char* name, const char* default_port,
grpc_pollset_set* interested_parties, grpc_closure* on_done,
- grpc_lb_addresses** addrs, bool check_grpclb,
- char** service_config_json) = grpc_dns_lookup_ares_impl;
+ grpc_lb_addresses** addrs, bool check_grpclb, char** service_config_json,
+ grpc_combiner* combiner) = grpc_dns_lookup_ares_locked_impl;
void grpc_cancel_ares_request(grpc_ares_request* r) {
- if (grpc_dns_lookup_ares == grpc_dns_lookup_ares_impl) {
- grpc_ares_ev_driver_shutdown(r->ev_driver);
+ if (grpc_dns_lookup_ares_locked == grpc_dns_lookup_ares_locked_impl) {
+ grpc_ares_ev_driver_shutdown_locked(r->ev_driver);
}
}
@@ -534,6 +532,8 @@ void grpc_ares_cleanup(void) {
*/
typedef struct grpc_resolve_address_ares_request {
+ /* combiner that queries and related callbacks run under */
+ grpc_combiner* combiner;
/** the pointer to receive the resolved addresses */
grpc_resolved_addresses** addrs_out;
/** currently resolving lb addresses */
@@ -541,8 +541,14 @@ typedef struct grpc_resolve_address_ares_request {
/** closure to call when the resolve_address_ares request completes */
grpc_closure* on_resolve_address_done;
/** a closure wrapping on_dns_lookup_done_cb, which should be invoked when the
- grpc_dns_lookup_ares operation is done. */
+ grpc_dns_lookup_ares_locked operation is done. */
grpc_closure on_dns_lookup_done;
+ /* target name */
+ const char* name;
+ /* default port to use if none is specified */
+ const char* default_port;
+ /* pollset_set to be driven by */
+ grpc_pollset_set* interested_parties;
} grpc_resolve_address_ares_request;
static void on_dns_lookup_done_cb(void* arg, grpc_error* error) {
@@ -566,9 +572,20 @@ static void on_dns_lookup_done_cb(void* arg, grpc_error* error) {
}
GRPC_CLOSURE_SCHED(r->on_resolve_address_done, GRPC_ERROR_REF(error));
if (r->lb_addrs != nullptr) grpc_lb_addresses_destroy(r->lb_addrs);
+ GRPC_COMBINER_UNREF(r->combiner, "on_dns_lookup_done_cb");
gpr_free(r);
}
+static void grpc_resolve_address_invoke_dns_lookup_ares_locked(
+ void* arg, grpc_error* unused_error) {
+ grpc_resolve_address_ares_request* r =
+ static_cast<grpc_resolve_address_ares_request*>(arg);
+ grpc_dns_lookup_ares_locked(
+ nullptr /* dns_server */, r->name, r->default_port, r->interested_parties,
+ &r->on_dns_lookup_done, &r->lb_addrs, false /* check_grpclb */,
+ nullptr /* service_config_json */, r->combiner);
+}
+
static void grpc_resolve_address_ares_impl(const char* name,
const char* default_port,
grpc_pollset_set* interested_parties,
@@ -577,14 +594,18 @@ static void grpc_resolve_address_ares_impl(const char* name,
grpc_resolve_address_ares_request* r =
static_cast<grpc_resolve_address_ares_request*>(
gpr_zalloc(sizeof(grpc_resolve_address_ares_request)));
+ r->combiner = grpc_combiner_create();
r->addrs_out = addrs;
r->on_resolve_address_done = on_done;
GRPC_CLOSURE_INIT(&r->on_dns_lookup_done, on_dns_lookup_done_cb, r,
grpc_schedule_on_exec_ctx);
- grpc_dns_lookup_ares(nullptr /* dns_server */, name, default_port,
- interested_parties, &r->on_dns_lookup_done, &r->lb_addrs,
- false /* check_grpclb */,
- nullptr /* service_config_json */);
+ r->name = name;
+ r->default_port = default_port;
+ r->interested_parties = interested_parties;
+ GRPC_CLOSURE_SCHED(
+ GRPC_CLOSURE_CREATE(grpc_resolve_address_invoke_dns_lookup_ares_locked, r,
+ grpc_combiner_scheduler(r->combiner)),
+ GRPC_ERROR_NONE);
}
void (*grpc_resolve_address_ares)(
diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
index 2d84a038d6..9e93d0cf94 100644
--- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
+++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
@@ -48,11 +48,11 @@ extern void (*grpc_resolve_address_ares)(const char* name,
function. \a on_done may be called directly in this function without being
scheduled with \a exec_ctx, so it must not try to acquire locks that are
being held by the caller. */
-extern grpc_ares_request* (*grpc_dns_lookup_ares)(
+extern grpc_ares_request* (*grpc_dns_lookup_ares_locked)(
const char* dns_server, const char* name, const char* default_port,
grpc_pollset_set* interested_parties, grpc_closure* on_done,
grpc_lb_addresses** addresses, bool check_grpclb,
- char** service_config_json);
+ char** service_config_json, grpc_combiner* combiner);
/* Cancel the pending grpc_ares_request \a request */
void grpc_cancel_ares_request(grpc_ares_request* request);
diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc
index 5096e480bc..d6a76fc8b6 100644
--- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc
+++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc
@@ -26,18 +26,19 @@ struct grpc_ares_request {
char val;
};
-static grpc_ares_request* grpc_dns_lookup_ares_impl(
+static grpc_ares_request* grpc_dns_lookup_ares_locked_impl(
const char* dns_server, const char* name, const char* default_port,
grpc_pollset_set* interested_parties, grpc_closure* on_done,
- grpc_lb_addresses** addrs, bool check_grpclb, char** service_config_json) {
+ grpc_lb_addresses** addrs, bool check_grpclb, char** service_config_json,
+ grpc_combiner* combiner) {
return NULL;
}
-grpc_ares_request* (*grpc_dns_lookup_ares)(
+grpc_ares_request* (*grpc_dns_lookup_ares_locked)(
const char* dns_server, const char* name, const char* default_port,
grpc_pollset_set* interested_parties, grpc_closure* on_done,
- grpc_lb_addresses** addrs, bool check_grpclb,
- char** service_config_json) = grpc_dns_lookup_ares_impl;
+ grpc_lb_addresses** addrs, bool check_grpclb, char** service_config_json,
+ grpc_combiner* combiner) = grpc_dns_lookup_ares_locked_impl;
void grpc_cancel_ares_request(grpc_ares_request* r) {}
diff --git a/src/core/ext/filters/deadline/deadline_filter.cc b/src/core/ext/filters/deadline/deadline_filter.cc
index 27d3eac8d6..d23ad67ad5 100644
--- a/src/core/ext/filters/deadline/deadline_filter.cc
+++ b/src/core/ext/filters/deadline/deadline_filter.cc
@@ -128,21 +128,25 @@ static void cancel_timer_if_needed(grpc_deadline_state* deadline_state) {
}
}
-// Callback run when the call is complete.
-static void on_complete(void* arg, grpc_error* error) {
+// Callback run when we receive trailing metadata.
+static void recv_trailing_metadata_ready(void* arg, grpc_error* error) {
grpc_deadline_state* deadline_state = static_cast<grpc_deadline_state*>(arg);
cancel_timer_if_needed(deadline_state);
- // Invoke the next callback.
- GRPC_CLOSURE_RUN(deadline_state->next_on_complete, GRPC_ERROR_REF(error));
+ // Invoke the original callback.
+ GRPC_CLOSURE_RUN(deadline_state->original_recv_trailing_metadata_ready,
+ GRPC_ERROR_REF(error));
}
-// Inject our own on_complete callback into op.
-static void inject_on_complete_cb(grpc_deadline_state* deadline_state,
- grpc_transport_stream_op_batch* op) {
- deadline_state->next_on_complete = op->on_complete;
- GRPC_CLOSURE_INIT(&deadline_state->on_complete, on_complete, deadline_state,
+// Inject our own recv_trailing_metadata_ready callback into op.
+static void inject_recv_trailing_metadata_ready(
+ grpc_deadline_state* deadline_state, grpc_transport_stream_op_batch* op) {
+ deadline_state->original_recv_trailing_metadata_ready =
+ op->payload->recv_trailing_metadata.recv_trailing_metadata_ready;
+ GRPC_CLOSURE_INIT(&deadline_state->recv_trailing_metadata_ready,
+ recv_trailing_metadata_ready, deadline_state,
grpc_schedule_on_exec_ctx);
- op->on_complete = &deadline_state->on_complete;
+ op->payload->recv_trailing_metadata.recv_trailing_metadata_ready =
+ &deadline_state->recv_trailing_metadata_ready;
}
// Callback and associated state for starting the timer after call stack
@@ -226,7 +230,7 @@ void grpc_deadline_state_client_start_transport_stream_op_batch(
// Make sure we know when the call is complete, so that we can cancel
// the timer.
if (op->recv_trailing_metadata) {
- inject_on_complete_cb(deadline_state, op);
+ inject_recv_trailing_metadata_ready(deadline_state, op);
}
}
}
@@ -289,11 +293,10 @@ static void client_start_transport_stream_op_batch(
static void recv_initial_metadata_ready(void* arg, grpc_error* error) {
grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
server_call_data* calld = static_cast<server_call_data*>(elem->call_data);
- // Get deadline from metadata and start the timer if needed.
start_timer_if_needed(elem, calld->recv_initial_metadata->deadline);
// Invoke the next callback.
- calld->next_recv_initial_metadata_ready->cb(
- calld->next_recv_initial_metadata_ready->cb_arg, error);
+ GRPC_CLOSURE_RUN(calld->next_recv_initial_metadata_ready,
+ GRPC_ERROR_REF(error));
}
// Method for starting a call op for server filter.
@@ -323,7 +326,7 @@ static void server_start_transport_stream_op_batch(
// the client never sends trailing metadata, because this is the
// hook that tells us when the call is complete on the server side.
if (op->recv_trailing_metadata) {
- inject_on_complete_cb(&calld->base.deadline_state, op);
+ inject_recv_trailing_metadata_ready(&calld->base.deadline_state, op);
}
}
// Chain to next filter.
diff --git a/src/core/ext/filters/deadline/deadline_filter.h b/src/core/ext/filters/deadline/deadline_filter.h
index 13207cbd6f..1d797f445a 100644
--- a/src/core/ext/filters/deadline/deadline_filter.h
+++ b/src/core/ext/filters/deadline/deadline_filter.h
@@ -37,12 +37,12 @@ typedef struct grpc_deadline_state {
grpc_deadline_timer_state timer_state;
grpc_timer timer;
grpc_closure timer_callback;
- // Closure to invoke when the call is complete.
+ // Closure to invoke when we receive trailing metadata.
// We use this to cancel the timer.
- grpc_closure on_complete;
- // The original on_complete closure, which we chain to after our own
- // closure is invoked.
- grpc_closure* next_on_complete;
+ grpc_closure recv_trailing_metadata_ready;
+ // The original recv_trailing_metadata_ready closure, which we chain to
+ // after our own closure is invoked.
+ grpc_closure* original_recv_trailing_metadata_ready;
} grpc_deadline_state;
//
diff --git a/src/core/ext/filters/http/client/http_client_filter.cc b/src/core/ext/filters/http/client/http_client_filter.cc
index ae94ce47b9..1678051beb 100644
--- a/src/core/ext/filters/http/client/http_client_filter.cc
+++ b/src/core/ext/filters/http/client/http_client_filter.cc
@@ -55,8 +55,8 @@ struct call_data {
grpc_closure recv_initial_metadata_ready;
// State for handling recv_trailing_metadata ops.
grpc_metadata_batch* recv_trailing_metadata;
- grpc_closure* original_recv_trailing_metadata_on_complete;
- grpc_closure recv_trailing_metadata_on_complete;
+ grpc_closure* original_recv_trailing_metadata_ready;
+ grpc_closure recv_trailing_metadata_ready;
// State for handling send_message ops.
grpc_transport_stream_op_batch* send_message_batch;
size_t send_message_bytes_read;
@@ -153,8 +153,7 @@ static void recv_initial_metadata_ready(void* user_data, grpc_error* error) {
GRPC_CLOSURE_RUN(calld->original_recv_initial_metadata_ready, error);
}
-static void recv_trailing_metadata_on_complete(void* user_data,
- grpc_error* error) {
+static void recv_trailing_metadata_ready(void* user_data, grpc_error* error) {
grpc_call_element* elem = static_cast<grpc_call_element*>(user_data);
call_data* calld = static_cast<call_data*>(elem->call_data);
if (error == GRPC_ERROR_NONE) {
@@ -163,7 +162,7 @@ static void recv_trailing_metadata_on_complete(void* user_data,
} else {
GRPC_ERROR_REF(error);
}
- GRPC_CLOSURE_RUN(calld->original_recv_trailing_metadata_on_complete, error);
+ GRPC_CLOSURE_RUN(calld->original_recv_trailing_metadata_ready, error);
}
static void send_message_on_complete(void* arg, grpc_error* error) {
@@ -312,8 +311,10 @@ static void hc_start_transport_stream_op_batch(
/* substitute our callback for the higher callback */
calld->recv_trailing_metadata =
batch->payload->recv_trailing_metadata.recv_trailing_metadata;
- calld->original_recv_trailing_metadata_on_complete = batch->on_complete;
- batch->on_complete = &calld->recv_trailing_metadata_on_complete;
+ calld->original_recv_trailing_metadata_ready =
+ batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready;
+ batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready =
+ &calld->recv_trailing_metadata_ready;
}
grpc_error* error = GRPC_ERROR_NONE;
@@ -420,8 +421,8 @@ static grpc_error* init_call_elem(grpc_call_element* elem,
GRPC_CLOSURE_INIT(&calld->recv_initial_metadata_ready,
recv_initial_metadata_ready, elem,
grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&calld->recv_trailing_metadata_on_complete,
- recv_trailing_metadata_on_complete, elem,
+ GRPC_CLOSURE_INIT(&calld->recv_trailing_metadata_ready,
+ recv_trailing_metadata_ready, elem,
grpc_schedule_on_exec_ctx);
GRPC_CLOSURE_INIT(&calld->send_message_on_complete, send_message_on_complete,
elem, grpc_schedule_on_exec_ctx);
diff --git a/src/core/ext/filters/http/server/http_server_filter.h b/src/core/ext/filters/http/server/http_server_filter.h
index 4eb130b1fd..e4e0546f6d 100644
--- a/src/core/ext/filters/http/server/http_server_filter.h
+++ b/src/core/ext/filters/http/server/http_server_filter.h
@@ -23,7 +23,7 @@
#include "src/core/lib/channel/channel_stack.h"
-/* Processes metadata on the client side for HTTP2 transports */
+/* Processes metadata on the server side for HTTP2 transports */
extern const grpc_channel_filter grpc_http_server_filter;
#endif /* GRPC_CORE_EXT_FILTERS_HTTP_SERVER_HTTP_SERVER_FILTER_H */
diff --git a/src/core/ext/filters/load_reporting/registered_opencensus_objects.h b/src/core/ext/filters/load_reporting/registered_opencensus_objects.h
new file mode 100644
index 0000000000..b62863dc2c
--- /dev/null
+++ b/src/core/ext/filters/load_reporting/registered_opencensus_objects.h
@@ -0,0 +1,108 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_REGISTERED_OPENCENSUS_OBJECTS_H
+#define GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_REGISTERED_OPENCENSUS_OBJECTS_H
+
+#include <grpc/support/port_platform.h>
+
+#include "opencensus/stats/stats.h"
+
+#include "src/cpp/server/load_reporter/constants.h"
+
+namespace grpc {
+namespace load_reporter {
+
+// Measures.
+
+::opencensus::stats::MeasureInt64 MeasureStartCount() {
+ static const ::opencensus::stats::MeasureInt64 start_count =
+ ::opencensus::stats::MeasureInt64::Register(
+ kMeasureStartCount, kMeasureStartCount, kMeasureStartCount);
+ return start_count;
+}
+
+::opencensus::stats::MeasureInt64 MeasureEndCount() {
+ static const ::opencensus::stats::MeasureInt64 end_count =
+ ::opencensus::stats::MeasureInt64::Register(
+ kMeasureEndCount, kMeasureEndCount, kMeasureEndCount);
+ return end_count;
+}
+
+::opencensus::stats::MeasureInt64 MeasureEndBytesSent() {
+ static const ::opencensus::stats::MeasureInt64 end_bytes_sent =
+ ::opencensus::stats::MeasureInt64::Register(
+ kMeasureEndBytesSent, kMeasureEndBytesSent, kMeasureEndBytesSent);
+ return end_bytes_sent;
+}
+
+::opencensus::stats::MeasureInt64 MeasureEndBytesReceived() {
+ static const ::opencensus::stats::MeasureInt64 end_bytes_received =
+ ::opencensus::stats::MeasureInt64::Register(kMeasureEndBytesReceived,
+ kMeasureEndBytesReceived,
+ kMeasureEndBytesReceived);
+ return end_bytes_received;
+}
+
+::opencensus::stats::MeasureInt64 MeasureEndLatencyMs() {
+ static const ::opencensus::stats::MeasureInt64 end_latency_ms =
+ ::opencensus::stats::MeasureInt64::Register(
+ kMeasureEndLatencyMs, kMeasureEndLatencyMs, kMeasureEndLatencyMs);
+ return end_latency_ms;
+}
+
+::opencensus::stats::MeasureDouble MeasureOtherCallMetric() {
+ static const ::opencensus::stats::MeasureDouble other_call_metric =
+ ::opencensus::stats::MeasureDouble::Register(kMeasureOtherCallMetric,
+ kMeasureOtherCallMetric,
+ kMeasureOtherCallMetric);
+ return other_call_metric;
+}
+
+// Tags.
+
+opencensus::stats::TagKey TagKeyToken() {
+ static const auto token = opencensus::stats::TagKey::Register(kTagKeyToken);
+ return token;
+}
+
+opencensus::stats::TagKey TagKeyHost() {
+ static const auto token = opencensus::stats::TagKey::Register(kTagKeyHost);
+ return token;
+}
+opencensus::stats::TagKey TagKeyUserId() {
+ static const auto token = opencensus::stats::TagKey::Register(kTagKeyUserId);
+ return token;
+}
+
+opencensus::stats::TagKey TagKeyStatus() {
+ static const auto token = opencensus::stats::TagKey::Register(kTagKeyStatus);
+ return token;
+}
+
+opencensus::stats::TagKey TagKeyMetricName() {
+ static const auto token =
+ opencensus::stats::TagKey::Register(kTagKeyMetricName);
+ return token;
+}
+
+} // namespace load_reporter
+} // namespace grpc
+
+#endif /* GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_REGISTERED_OPENCENSUS_OBJECTS_H \
+ */
diff --git a/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc b/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc
index 0d349e2a89..51e4d795d7 100644
--- a/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc
+++ b/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc
@@ -18,205 +18,311 @@
#include <grpc/support/port_platform.h>
-#include <string.h>
-
+#include <grpc/grpc_security.h>
#include <grpc/load_reporting.h>
+#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
-#include <grpc/support/sync.h>
+#include "src/core/ext/filters/client_channel/parse_address.h"
+#include "src/core/ext/filters/client_channel/uri_parser.h"
+#include "src/core/ext/filters/load_reporting/registered_opencensus_objects.h"
#include "src/core/ext/filters/load_reporting/server_load_reporting_filter.h"
-#include "src/core/ext/filters/load_reporting/server_load_reporting_plugin.h"
#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/channel/context.h"
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/sockaddr_posix.h"
+#include "src/core/lib/iomgr/socket_utils.h"
#include "src/core/lib/profiling/timers.h"
+#include "src/core/lib/security/context/security_context.h"
#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/surface/call.h"
#include "src/core/lib/transport/static_metadata.h"
-namespace {
-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;
- grpc_slice service_method;
-
- /* stores the recv_initial_metadata op's ready closure, which we wrap with our
- * own (on_initial_md_ready) in order to capture the incoming initial metadata
- * */
- grpc_closure* ops_recv_initial_metadata_ready;
-
- /* to get notified of the availability of the incoming initial metadata. */
- grpc_closure on_initial_md_ready;
- grpc_metadata_batch* recv_initial_metadata;
-};
+namespace grpc {
-struct channel_data {
- intptr_t id; /**< an id unique to the channel */
-};
-} // namespace
-
-static void on_initial_md_ready(void* user_data, grpc_error* err) {
- grpc_call_element* elem = static_cast<grpc_call_element*>(user_data);
- call_data* calld = static_cast<call_data*>(elem->call_data);
-
- if (err == GRPC_ERROR_NONE) {
- if (calld->recv_initial_metadata->idx.named.path != nullptr) {
- calld->service_method = grpc_slice_ref_internal(
- GRPC_MDVALUE(calld->recv_initial_metadata->idx.named.path->md));
- calld->have_service_method = true;
- } else {
- err = grpc_error_add_child(
- err, GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing :path header"));
- }
- if (calld->recv_initial_metadata->idx.named.lb_token != nullptr) {
- calld->initial_md_string = grpc_slice_ref_internal(
- GRPC_MDVALUE(calld->recv_initial_metadata->idx.named.lb_token->md));
- calld->have_initial_md_string = true;
- grpc_metadata_batch_remove(
- calld->recv_initial_metadata,
- calld->recv_initial_metadata->idx.named.lb_token);
+grpc_error* ServerLoadReportingChannelData::Init(
+ grpc_channel_element* /* elem */, grpc_channel_element_args* args) {
+ GPR_ASSERT(!args->is_last);
+ // Find and record the peer_identity.
+ const grpc_auth_context* auth_context =
+ grpc_find_auth_context_in_args(args->channel_args);
+ if (auth_context != nullptr &&
+ grpc_auth_context_peer_is_authenticated(auth_context)) {
+ grpc_auth_property_iterator auth_it =
+ grpc_auth_context_peer_identity(auth_context);
+ const grpc_auth_property* auth_property =
+ grpc_auth_property_iterator_next(&auth_it);
+ if (auth_property != nullptr) {
+ peer_identity_ = auth_property->value;
+ peer_identity_len_ = auth_property->value_length;
}
- } else {
- GRPC_ERROR_REF(err);
}
- calld->ops_recv_initial_metadata_ready->cb(
- calld->ops_recv_initial_metadata_ready->cb_arg, err);
- GRPC_ERROR_UNREF(err);
-}
-
-/* Constructor for call_data */
-static grpc_error* init_call_elem(grpc_call_element* elem,
- const grpc_call_element_args* args) {
- call_data* calld = static_cast<call_data*>(elem->call_data);
- calld->id = (intptr_t)args->call_stack;
- GRPC_CLOSURE_INIT(&calld->on_initial_md_ready, on_initial_md_ready, elem,
- grpc_schedule_on_exec_ctx);
-
- /* TODO(dgq): do something with the data
- channel_data *chand = elem->channel_data;
- grpc_load_reporting_call_data lr_call_data = {GRPC_LR_POINT_CALL_CREATION,
- (intptr_t)chand->id,
- (intptr_t)calld->id,
- NULL,
- NULL,
- NULL,
- NULL};
- */
-
return GRPC_ERROR_NONE;
}
-/* Destructor for call_data */
-static void destroy_call_elem(grpc_call_element* elem,
- const grpc_call_final_info* final_info,
- grpc_closure* ignored) {
- call_data* calld = static_cast<call_data*>(elem->call_data);
+void ServerLoadReportingCallData::Destroy(
+ grpc_call_element* elem, const grpc_call_final_info* final_info,
+ grpc_closure* then_call_closure) {
+ ServerLoadReportingChannelData* chand =
+ reinterpret_cast<ServerLoadReportingChannelData*>(elem->channel_data);
+ // Only record an end if we've recorded its corresponding start, which is
+ // indicated by a non-null client_ip_and_lr_token_. Note that it's possible
+ // that we attempt to record the call end before we have recorded the call
+ // start, because the data needed for recording the start comes from the
+ // initial metadata, which may not be ready before the call finishes.
+ if (client_ip_and_lr_token_ != nullptr) {
+ opencensus::stats::Record(
+ {{::grpc::load_reporter::MeasureEndCount(), 1},
+ {::grpc::load_reporter::MeasureEndBytesSent(),
+ final_info->stats.transport_stream_stats.outgoing.data_bytes},
+ {::grpc::load_reporter::MeasureEndBytesReceived(),
+ final_info->stats.transport_stream_stats.incoming.data_bytes},
+ {::grpc::load_reporter::MeasureEndLatencyMs(),
+ gpr_time_to_millis(final_info->stats.latency)}},
+ {{::grpc::load_reporter::TagKeyToken(),
+ {client_ip_and_lr_token_, client_ip_and_lr_token_len_}},
+ {::grpc::load_reporter::TagKeyHost(),
+ {target_host_, target_host_len_}},
+ {::grpc::load_reporter::TagKeyUserId(),
+ {chand->peer_identity(), chand->peer_identity_len()}},
+ {::grpc::load_reporter::TagKeyStatus(),
+ GetStatusTagForStatus(final_info->final_status)}});
+ }
+ grpc_slice_unref_internal(service_method_);
+}
- /* TODO(dgq): do something with the data
- channel_data *chand = elem->channel_data;
- grpc_load_reporting_call_data lr_call_data = {GRPC_LR_POINT_CALL_DESTRUCTION,
- (intptr_t)chand->id,
- (intptr_t)calld->id,
- final_info,
- calld->initial_md_string,
- calld->trailing_md_string,
- calld->service_method};
- */
+void ServerLoadReportingCallData::StartTransportStreamOpBatch(
+ grpc_call_element* elem, TransportStreamOpBatch* op) {
+ GPR_TIMER_SCOPE("lr_start_transport_stream_op", 0);
+ if (op->recv_initial_metadata() != nullptr) {
+ // Save some fields to use when initial metadata is ready.
+ peer_string_ = op->get_peer_string();
+ recv_initial_metadata_ = op->recv_initial_metadata();
+ original_recv_initial_metadata_ready_ = op->recv_initial_metadata_ready();
+ // Substitute the original closure for the wrapper closure.
+ op->set_recv_initial_metadata_ready(&recv_initial_metadata_ready_);
+ } else if (op->send_trailing_metadata() != nullptr) {
+ GRPC_LOG_IF_ERROR(
+ "server_load_reporting_filter",
+ grpc_metadata_batch_filter(op->send_trailing_metadata()->batch(),
+ SendTrailingMetadataFilter, elem,
+ "send_trailing_metadata filtering error"));
+ }
+ grpc_call_next_op(elem, op->op());
+}
- if (calld->have_initial_md_string) {
- grpc_slice_unref_internal(calld->initial_md_string);
+void ServerLoadReportingCallData::GetCensusSafeClientIpString(
+ char** client_ip_string, size_t* size) {
+ // Find the client URI string.
+ const char* client_uri_str =
+ reinterpret_cast<const char*>(gpr_atm_acq_load(peer_string_));
+ if (client_uri_str == nullptr) {
+ gpr_log(GPR_ERROR,
+ "Unable to extract client URI string (peer string) from gRPC "
+ "metadata.");
+ *client_ip_string = nullptr;
+ *size = 0;
+ return;
}
- if (calld->have_trailing_md_string) {
- grpc_slice_unref_internal(calld->trailing_md_string);
+ // Parse the client URI string into grpc_uri.
+ grpc_uri* client_uri = grpc_uri_parse(client_uri_str, true);
+ if (client_uri == nullptr) {
+ gpr_log(GPR_ERROR,
+ "Unable to parse the client URI string (peer string) to a client "
+ "URI.");
+ *client_ip_string = nullptr;
+ *size = 0;
+ return;
}
- if (calld->have_service_method) {
- grpc_slice_unref_internal(calld->service_method);
+ // Parse the client URI into grpc_resolved_address.
+ grpc_resolved_address resolved_address;
+ bool success = grpc_parse_uri(client_uri, &resolved_address);
+ grpc_uri_destroy(client_uri);
+ if (!success) {
+ gpr_log(GPR_ERROR,
+ "Unable to parse client URI into a grpc_resolved_address.");
+ *client_ip_string = nullptr;
+ *size = 0;
+ return;
+ }
+ // Convert the socket address in the grpc_resolved_address into a hex string
+ // according to the address family.
+ grpc_sockaddr* addr = reinterpret_cast<grpc_sockaddr*>(resolved_address.addr);
+ if (addr->sa_family == GRPC_AF_INET) {
+ grpc_sockaddr_in* addr4 = reinterpret_cast<grpc_sockaddr_in*>(addr);
+ gpr_asprintf(client_ip_string, "%08x", grpc_ntohl(addr4->sin_addr.s_addr));
+ *size = 8;
+ } else if (addr->sa_family == GRPC_AF_INET6) {
+ grpc_sockaddr_in6* addr6 = reinterpret_cast<grpc_sockaddr_in6*>(addr);
+ *client_ip_string = static_cast<char*>(gpr_malloc(32));
+ for (size_t i = 0; i < 16; ++i) {
+ sprintf(*client_ip_string + i, "%02x",
+ addr6->sin6_addr.__in6_u.__u6_addr8[i]);
+ }
+ *size = 32;
+ } else {
+ GPR_UNREACHABLE_CODE();
}
}
-/* Constructor for channel_data */
-static grpc_error* init_channel_elem(grpc_channel_element* elem,
- grpc_channel_element_args* args) {
- GPR_ASSERT(!args->is_last);
-
- channel_data* chand = static_cast<channel_data*>(elem->channel_data);
- chand->id = (intptr_t)args->channel_stack;
+void ServerLoadReportingCallData::StoreClientIpAndLrToken(const char* lr_token,
+ size_t lr_token_len) {
+ char* client_ip;
+ size_t client_ip_len;
+ GetCensusSafeClientIpString(&client_ip, &client_ip_len);
+ client_ip_and_lr_token_len_ =
+ kLengthPrefixSize + client_ip_len + lr_token_len;
+ client_ip_and_lr_token_ = static_cast<char*>(
+ gpr_zalloc(client_ip_and_lr_token_len_ * sizeof(char)));
+ char* cur_pos = client_ip_and_lr_token_;
+ // Store the IP length prefix.
+ if (client_ip_len == 0) {
+ strncpy(cur_pos, kEmptyAddressLengthString, kLengthPrefixSize);
+ } else if (client_ip_len == 8) {
+ strncpy(cur_pos, kEncodedIpv4AddressLengthString, kLengthPrefixSize);
+ } else if (client_ip_len == 32) {
+ strncpy(cur_pos, kEncodedIpv6AddressLengthString, kLengthPrefixSize);
+ } else {
+ GPR_UNREACHABLE_CODE();
+ }
+ cur_pos += kLengthPrefixSize;
+ // Store the IP.
+ if (client_ip_len != 0) {
+ strncpy(cur_pos, client_ip, client_ip_len);
+ }
+ gpr_free(client_ip);
+ cur_pos += client_ip_len;
+ // Store the LR token.
+ if (lr_token_len != 0) {
+ strncpy(cur_pos, lr_token, lr_token_len);
+ }
+ GPR_ASSERT(cur_pos + lr_token_len - client_ip_and_lr_token_ ==
+ client_ip_and_lr_token_len_);
+}
- /* TODO(dgq): do something with the data
- grpc_load_reporting_call_data lr_call_data = {GRPC_LR_POINT_CHANNEL_CREATION,
- (intptr_t)chand,
- 0,
- NULL,
- NULL,
- NULL,
- NULL};
- */
+grpc_filtered_mdelem ServerLoadReportingCallData::RecvInitialMetadataFilter(
+ void* user_data, grpc_mdelem md) {
+ grpc_call_element* elem = reinterpret_cast<grpc_call_element*>(user_data);
+ ServerLoadReportingCallData* calld =
+ reinterpret_cast<ServerLoadReportingCallData*>(elem->call_data);
+ if (grpc_slice_eq(GRPC_MDKEY(md), GRPC_MDSTR_PATH)) {
+ calld->service_method_ = grpc_slice_ref_internal(GRPC_MDVALUE(md));
+ } else if (calld->target_host_ == nullptr &&
+ grpc_slice_eq(GRPC_MDKEY(md), GRPC_MDSTR_AUTHORITY)) {
+ grpc_slice target_host_slice = GRPC_MDVALUE(md);
+ calld->target_host_len_ = GRPC_SLICE_LENGTH(target_host_slice);
+ calld->target_host_ =
+ reinterpret_cast<char*>(gpr_zalloc(calld->target_host_len_));
+ for (size_t i = 0; i < calld->target_host_len_; ++i) {
+ calld->target_host_[i] = static_cast<char>(
+ tolower(GRPC_SLICE_START_PTR(target_host_slice)[i]));
+ }
+ } else if (grpc_slice_eq(GRPC_MDKEY(md), GRPC_MDSTR_LB_TOKEN)) {
+ if (calld->client_ip_and_lr_token_ == nullptr) {
+ calld->StoreClientIpAndLrToken(
+ reinterpret_cast<const char*> GRPC_SLICE_START_PTR(GRPC_MDVALUE(md)),
+ GRPC_SLICE_LENGTH(GRPC_MDVALUE(md)));
+ }
+ return GRPC_FILTERED_REMOVE();
+ }
+ return GRPC_FILTERED_MDELEM(md);
+}
- return GRPC_ERROR_NONE;
+void ServerLoadReportingCallData::RecvInitialMetadataReady(void* arg,
+ grpc_error* err) {
+ grpc_call_element* elem = reinterpret_cast<grpc_call_element*>(arg);
+ ServerLoadReportingCallData* calld =
+ reinterpret_cast<ServerLoadReportingCallData*>(elem->call_data);
+ ServerLoadReportingChannelData* chand =
+ reinterpret_cast<ServerLoadReportingChannelData*>(elem->channel_data);
+ if (err == GRPC_ERROR_NONE) {
+ GRPC_LOG_IF_ERROR(
+ "server_load_reporting_filter",
+ grpc_metadata_batch_filter(calld->recv_initial_metadata_->batch(),
+ RecvInitialMetadataFilter, elem,
+ "recv_initial_metadata filtering error"));
+ // If the LB token was not found in the recv_initial_metadata, only the
+ // client IP part will be recorded (with an empty LB token).
+ if (calld->client_ip_and_lr_token_ == nullptr) {
+ calld->StoreClientIpAndLrToken(nullptr, 0);
+ }
+ opencensus::stats::Record(
+ {{::grpc::load_reporter::MeasureStartCount(), 1}},
+ {{::grpc::load_reporter::TagKeyToken(),
+ {calld->client_ip_and_lr_token_, calld->client_ip_and_lr_token_len_}},
+ {::grpc::load_reporter::TagKeyHost(),
+ {calld->target_host_, calld->target_host_len_}},
+ {::grpc::load_reporter::TagKeyUserId(),
+ {chand->peer_identity(), chand->peer_identity_len()}}});
+ }
+ GRPC_CLOSURE_RUN(calld->original_recv_initial_metadata_ready_,
+ GRPC_ERROR_REF(err));
}
-/* Destructor for channel data */
-static void destroy_channel_elem(grpc_channel_element* elem) {
- /* TODO(dgq): do something with the data
- channel_data *chand = elem->channel_data;
- grpc_load_reporting_call_data lr_call_data = {
- GRPC_LR_POINT_CHANNEL_DESTRUCTION,
- (intptr_t)chand->id,
- 0,
- NULL,
- NULL,
- NULL,
- NULL};
- */
+grpc_error* ServerLoadReportingCallData::Init(
+ grpc_call_element* elem, const grpc_call_element_args* args) {
+ service_method_ = grpc_empty_slice();
+ GRPC_CLOSURE_INIT(&recv_initial_metadata_ready_, RecvInitialMetadataReady,
+ elem, grpc_schedule_on_exec_ctx);
+ return GRPC_ERROR_NONE;
}
-static grpc_filtered_mdelem lr_trailing_md_filter(void* user_data,
- grpc_mdelem md) {
- grpc_call_element* elem = static_cast<grpc_call_element*>(user_data);
- call_data* calld = static_cast<call_data*>(elem->call_data);
+grpc_filtered_mdelem ServerLoadReportingCallData::SendTrailingMetadataFilter(
+ void* user_data, grpc_mdelem md) {
+ grpc_call_element* elem = reinterpret_cast<grpc_call_element*>(user_data);
+ ServerLoadReportingCallData* calld =
+ reinterpret_cast<ServerLoadReportingCallData*>(elem->call_data);
+ ServerLoadReportingChannelData* chand =
+ reinterpret_cast<ServerLoadReportingChannelData*>(elem->channel_data);
+ // TODO(juanlishen): GRPC_MDSTR_LB_COST_BIN meaning?
if (grpc_slice_eq(GRPC_MDKEY(md), GRPC_MDSTR_LB_COST_BIN)) {
- calld->trailing_md_string = GRPC_MDVALUE(md);
+ const grpc_slice value = GRPC_MDVALUE(md);
+ const size_t cost_entry_size = GRPC_SLICE_LENGTH(value);
+ if (cost_entry_size < sizeof(double)) {
+ gpr_log(GPR_ERROR,
+ "Cost metadata value too small (%zu bytes) to hold valid data. "
+ "Ignoring.",
+ cost_entry_size);
+ return GRPC_FILTERED_REMOVE();
+ }
+ const double* cost_entry_ptr =
+ reinterpret_cast<const double*>(GRPC_SLICE_START_PTR(value));
+ double cost_value = *cost_entry_ptr++;
+ const char* cost_name = reinterpret_cast<const char*>(cost_entry_ptr);
+ const size_t cost_name_len = cost_entry_size - sizeof(double);
+ opencensus::stats::Record(
+ {{::grpc::load_reporter::MeasureOtherCallMetric(), cost_value}},
+ {{::grpc::load_reporter::TagKeyToken(),
+ {calld->client_ip_and_lr_token_, calld->client_ip_and_lr_token_len_}},
+ {::grpc::load_reporter::TagKeyHost(),
+ {calld->target_host_, calld->target_host_len_}},
+ {::grpc::load_reporter::TagKeyUserId(),
+ {chand->peer_identity(), chand->peer_identity_len()}},
+ {::grpc::load_reporter::TagKeyMetricName(),
+ {cost_name, cost_name_len}}});
return GRPC_FILTERED_REMOVE();
}
return GRPC_FILTERED_MDELEM(md);
}
-static void lr_start_transport_stream_op_batch(
- grpc_call_element* elem, grpc_transport_stream_op_batch* op) {
- GPR_TIMER_SCOPE("lr_start_transport_stream_op_batch", 0);
- call_data* calld = static_cast<call_data*>(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;
- 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(
- op->payload->send_trailing_metadata.send_trailing_metadata,
- lr_trailing_md_filter, elem,
- "LR trailing metadata filtering error"));
+const char* ServerLoadReportingCallData::GetStatusTagForStatus(
+ grpc_status_code status) {
+ switch (status) {
+ case GRPC_STATUS_OK:
+ return ::grpc::load_reporter::kCallStatusOk;
+ case GRPC_STATUS_UNKNOWN:
+ case GRPC_STATUS_DEADLINE_EXCEEDED:
+ case GRPC_STATUS_UNIMPLEMENTED:
+ case GRPC_STATUS_INTERNAL:
+ case GRPC_STATUS_UNAVAILABLE:
+ case GRPC_STATUS_DATA_LOSS:
+ return ::grpc::load_reporter::kCallStatusServerError;
+ default:
+ return ::grpc::load_reporter::kCallStatusClientError;
}
- grpc_call_next_op(elem, op);
}
-const grpc_channel_filter grpc_server_load_reporting_filter = {
- lr_start_transport_stream_op_batch,
- grpc_channel_next_op,
- sizeof(call_data),
- init_call_elem,
- grpc_call_stack_ignore_set_pollset_or_pollset_set,
- destroy_call_elem,
- sizeof(channel_data),
- init_channel_elem,
- destroy_channel_elem,
- grpc_channel_next_get_info,
- "load_reporting"};
+} // namespace grpc
diff --git a/src/core/ext/filters/load_reporting/server_load_reporting_filter.h b/src/core/ext/filters/load_reporting/server_load_reporting_filter.h
index b459a8ec5f..029b19ac89 100644
--- a/src/core/ext/filters/load_reporting/server_load_reporting_filter.h
+++ b/src/core/ext/filters/load_reporting/server_load_reporting_filter.h
@@ -21,10 +21,105 @@
#include <grpc/support/port_platform.h>
-#include "src/core/ext/filters/load_reporting/server_load_reporting_plugin.h"
#include "src/core/lib/channel/channel_stack.h"
+#include "src/cpp/common/channel_filter.h"
-extern const grpc_channel_filter grpc_server_load_reporting_filter;
+namespace grpc {
+
+class ServerLoadReportingChannelData : public ChannelData {
+ public:
+ grpc_error* Init(grpc_channel_element* elem,
+ grpc_channel_element_args* args) override;
+
+ // Getters.
+ const char* peer_identity() { return peer_identity_; }
+ size_t peer_identity_len() { return peer_identity_len_; }
+
+ private:
+ // The peer's authenticated identity.
+ char* peer_identity_ = nullptr;
+ size_t peer_identity_len_ = 0;
+};
+
+class ServerLoadReportingCallData : public CallData {
+ public:
+ grpc_error* Init(grpc_call_element* elem,
+ const grpc_call_element_args* args) override;
+
+ void Destroy(grpc_call_element* elem, const grpc_call_final_info* final_info,
+ grpc_closure* then_call_closure) override;
+
+ void StartTransportStreamOpBatch(grpc_call_element* elem,
+ TransportStreamOpBatch* op) override;
+
+ private:
+ // From the peer_string_ in calld, extracts the client IP string (owned by
+ // caller), e.g., "01020a0b". Upon failure, set the output pointer to null and
+ // size to zero.
+ void GetCensusSafeClientIpString(char** client_ip_string, size_t* size);
+
+ // Concatenates the client IP address and the load reporting token, then
+ // stores the result into the call data.
+ void StoreClientIpAndLrToken(const char* lr_token, size_t lr_token_len);
+
+ // This matches the classification of the status codes in
+ // googleapis/google/rpc/code.proto.
+ static const char* GetStatusTagForStatus(grpc_status_code status);
+
+ // Records the call start.
+ static void RecvInitialMetadataReady(void* arg, grpc_error* err);
+
+ // From the initial metadata, extracts the service_method_, target_host_, and
+ // client_ip_and_lr_token_.
+ static grpc_filtered_mdelem RecvInitialMetadataFilter(void* user_data,
+ grpc_mdelem md);
+
+ // Records the other call metrics.
+ static grpc_filtered_mdelem SendTrailingMetadataFilter(void* user_data,
+ grpc_mdelem md);
+
+ // The peer string (a member of the recv_initial_metadata op). Note that
+ // gpr_atm itself is a pointer type here, making "peer_string_" effectively a
+ // double pointer.
+ const gpr_atm* peer_string_;
+
+ // The received initial metadata (a member of the recv_initial_metadata op).
+ // When it is ready, we will extract some data from it via
+ // recv_initial_metadata_ready_ closure, before the original
+ // recv_initial_metadata_ready closure,
+ MetadataBatch* recv_initial_metadata_;
+
+ // The original recv_initial_metadata closure, which is wrapped by our own
+ // closure (recv_initial_metadata_ready_) to capture the incoming initial
+ // metadata.
+ grpc_closure* original_recv_initial_metadata_ready_;
+
+ // The closure that wraps the original closure. Scheduled when
+ // recv_initial_metadata_ is ready.
+ grpc_closure recv_initial_metadata_ready_;
+
+ // Corresponds to the :path header.
+ grpc_slice service_method_;
+
+ // The backend host that the client thinks it's talking to. This may be
+ // different from the actual backend in the case of, for example,
+ // load-balanced targets. We store a copy of the metadata slice in order to
+ // lowercase it. */
+ char* target_host_;
+ size_t target_host_len_;
+
+ // The client IP address (including a length prefix) and the load reporting
+ // token.
+ char* client_ip_and_lr_token_;
+ size_t client_ip_and_lr_token_len_;
+
+ static constexpr char kEncodedIpv4AddressLengthString[] = "08";
+ static constexpr char kEncodedIpv6AddressLengthString[] = "32";
+ static constexpr char kEmptyAddressLengthString[] = "00";
+ static constexpr size_t kLengthPrefixSize = 2;
+};
+
+} // namespace grpc
#endif /* GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_SERVER_LOAD_REPORTING_FILTER_H \
*/
diff --git a/src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc b/src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc
deleted file mode 100644
index 667c0c56ef..0000000000
--- a/src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include <limits.h>
-#include <string.h>
-
-#include <grpc/load_reporting.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/sync.h>
-
-#include "src/core/ext/filters/load_reporting/server_load_reporting_filter.h"
-#include "src/core/ext/filters/load_reporting/server_load_reporting_plugin.h"
-#include "src/core/lib/channel/channel_stack_builder.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/surface/call.h"
-#include "src/core/lib/surface/channel_init.h"
-
-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);
-}
-
-static bool maybe_add_server_load_reporting_filter(
- grpc_channel_stack_builder* builder, void* arg) {
- const grpc_channel_args* args =
- grpc_channel_stack_builder_get_channel_arguments(builder);
- const grpc_channel_filter* filter =
- static_cast<const grpc_channel_filter*>(arg);
- grpc_channel_stack_builder_iterator* it =
- grpc_channel_stack_builder_iterator_find(builder, filter->name);
- const bool already_has_load_reporting_filter =
- !grpc_channel_stack_builder_iterator_is_end(it);
- grpc_channel_stack_builder_iterator_destroy(it);
- if (is_load_reporting_enabled(args) && !already_has_load_reporting_filter) {
- return grpc_channel_stack_builder_prepend_filter(builder, filter, nullptr,
- nullptr);
- }
- return true;
-}
-
-grpc_arg grpc_load_reporting_enable_arg() {
- return grpc_channel_arg_integer_create((char*)GRPC_ARG_ENABLE_LOAD_REPORTING,
- 1);
-}
-
-/* Plugin registration */
-
-void grpc_server_load_reporting_plugin_init(void) {
- grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL, INT_MAX,
- maybe_add_server_load_reporting_filter,
- (void*)&grpc_server_load_reporting_filter);
-}
-
-void grpc_server_load_reporting_plugin_shutdown() {}
diff --git a/src/core/ext/filters/load_reporting/server_load_reporting_plugin.h b/src/core/ext/filters/load_reporting/server_load_reporting_plugin.h
deleted file mode 100644
index c20aaa744f..0000000000
--- a/src/core/ext/filters/load_reporting/server_load_reporting_plugin.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_SERVER_LOAD_REPORTING_PLUGIN_H
-#define GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_SERVER_LOAD_REPORTING_PLUGIN_H
-
-#include <grpc/support/port_platform.h>
-
-#include <grpc/impl/codegen/grpc_types.h>
-
-#include "src/core/lib/channel/channel_stack.h"
-
-/** Identifiers for the invocation point of the users LR callback */
-typedef enum grpc_load_reporting_source {
- GRPC_LR_POINT_UNKNOWN = 0,
- GRPC_LR_POINT_CHANNEL_CREATION,
- GRPC_LR_POINT_CHANNEL_DESTRUCTION,
- GRPC_LR_POINT_CALL_CREATION,
- GRPC_LR_POINT_CALL_DESTRUCTION
-} grpc_load_reporting_source;
-
-/** Call information to be passed to the provided LR callback. */
-typedef struct grpc_load_reporting_call_data {
- const grpc_load_reporting_source source; /**< point of last data update. */
-
- /** Unique identifier for the channel associated with the data */
- intptr_t channel_id;
-
- /** Unique identifier for the call associated with the data. If the call
- * hasn't been created yet, it'll have a value of zero. */
- intptr_t call_id;
-
- /** Only valid when \a source is \a GRPC_LR_POINT_CALL_DESTRUCTION, that is,
- * once the call has completed */
- const grpc_call_final_info* final_info;
-
- const char* initial_md_string; /**< value string for LR's initial md key */
- const char* trailing_md_string; /**< value string for LR's trailing md key */
- const char* method_name; /**< Corresponds to :path header */
-} grpc_load_reporting_call_data;
-
-/** Return a \a grpc_arg enabling load reporting */
-grpc_arg grpc_load_reporting_enable_arg();
-
-#endif /* GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_SERVER_LOAD_REPORTING_PLUGIN_H \
- */
diff --git a/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc b/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
index b95c9dae53..dfed824cd5 100644
--- a/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
+++ b/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
@@ -50,7 +50,7 @@ grpc_channel* grpc_insecure_channel_create_from_fd(
GPR_ASSERT(fcntl(fd, F_SETFL, flags | O_NONBLOCK) == 0);
grpc_endpoint* client = grpc_tcp_client_create_from_fd(
- grpc_fd_create(fd, "client"), args, "fd-client");
+ grpc_fd_create(fd, "client", false), args, "fd-client");
grpc_transport* transport =
grpc_create_chttp2_transport(final_args, client, true);
diff --git a/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc b/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
index 371e463814..a0228785ee 100644
--- a/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
+++ b/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
@@ -43,8 +43,9 @@ void grpc_server_add_insecure_channel_from_fd(grpc_server* server,
char* name;
gpr_asprintf(&name, "fd:%d", fd);
- grpc_endpoint* server_endpoint = grpc_tcp_create(
- grpc_fd_create(fd, name), grpc_server_get_channel_args(server), name);
+ grpc_endpoint* server_endpoint =
+ grpc_tcp_create(grpc_fd_create(fd, name, false),
+ grpc_server_get_channel_args(server), name);
gpr_free(name);
diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
index cc4a823798..0d6b72c66e 100644
--- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
+++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
@@ -1149,12 +1149,10 @@ static void maybe_start_some_streams(grpc_chttp2_transport* t) {
}
}
-/* Flag that this closure barrier wants stats to be updated before finishing */
-#define CLOSURE_BARRIER_STATS_BIT (1 << 0)
/* Flag that this closure barrier may be covering a write in a pollset, and so
we should not complete this closure until we can prove that the write got
scheduled */
-#define CLOSURE_BARRIER_MAY_COVER_WRITE (1 << 1)
+#define CLOSURE_BARRIER_MAY_COVER_WRITE (1 << 0)
/* First bit of the reference count, stored in the high order bits (with the low
bits being used for flags defined above) */
#define CLOSURE_BARRIER_FIRST_REF_BIT (1 << 16)
@@ -1206,10 +1204,6 @@ void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t,
grpc_error_add_child(closure->error_data.error, error);
}
if (closure->next_data.scratch < CLOSURE_BARRIER_FIRST_REF_BIT) {
- if (closure->next_data.scratch & CLOSURE_BARRIER_STATS_BIT) {
- grpc_transport_move_stats(&s->stats, s->collecting_stats);
- s->collecting_stats = nullptr;
- }
if ((t->write_state == GRPC_CHTTP2_WRITE_STATE_IDLE) ||
!(closure->next_data.scratch & CLOSURE_BARRIER_MAY_COVER_WRITE)) {
GRPC_CLOSURE_RUN(closure, closure->error_data.error);
@@ -1351,9 +1345,14 @@ static void perform_stream_op_locked(void* stream_op,
}
grpc_closure* on_complete = op->on_complete;
+ // TODO(roth): This is a hack needed because we use data inside of the
+ // closure itself to do the barrier calculation (i.e., to ensure that
+ // we don't schedule the closure until all ops in the batch have been
+ // completed). This can go away once we move to a new C++ closure API
+ // that provides the ability to create a barrier closure.
if (on_complete == nullptr) {
- on_complete =
- GRPC_CLOSURE_CREATE(do_nothing, nullptr, grpc_schedule_on_exec_ctx);
+ on_complete = GRPC_CLOSURE_INIT(&op->handler_private.closure, do_nothing,
+ nullptr, grpc_schedule_on_exec_ctx);
}
/* use final_data as a barrier until enqueue time; the inital counter is
@@ -1361,12 +1360,6 @@ static void perform_stream_op_locked(void* stream_op,
on_complete->next_data.scratch = CLOSURE_BARRIER_FIRST_REF_BIT;
on_complete->error_data.error = GRPC_ERROR_NONE;
- if (op->collect_stats) {
- GPR_ASSERT(s->collecting_stats == nullptr);
- s->collecting_stats = op_payload->collect_stats.collect_stats;
- on_complete->next_data.scratch |= CLOSURE_BARRIER_STATS_BIT;
- }
-
if (op->cancel_stream) {
GRPC_STATS_INC_HTTP2_OP_CANCEL();
grpc_chttp2_cancel_stream(t, s, op_payload->cancel_stream.cancel_error);
@@ -1451,10 +1444,8 @@ static void perform_stream_op_locked(void* stream_op,
}
}
if (op_payload->send_initial_metadata.peer_string != nullptr) {
- char* old_peer_string = (char*)gpr_atm_full_xchg(
- op_payload->send_initial_metadata.peer_string,
- (gpr_atm)gpr_strdup(t->peer_string));
- gpr_free(old_peer_string);
+ gpr_atm_rel_store(op_payload->send_initial_metadata.peer_string,
+ (gpr_atm)t->peer_string);
}
}
@@ -1569,10 +1560,8 @@ static void perform_stream_op_locked(void* stream_op,
s->trailing_metadata_available =
op_payload->recv_initial_metadata.trailing_metadata_available;
if (op_payload->recv_initial_metadata.peer_string != nullptr) {
- char* old_peer_string = (char*)gpr_atm_full_xchg(
- op_payload->recv_initial_metadata.peer_string,
- (gpr_atm)gpr_strdup(t->peer_string));
- gpr_free(old_peer_string);
+ gpr_atm_rel_store(op_payload->recv_initial_metadata.peer_string,
+ (gpr_atm)t->peer_string);
}
grpc_chttp2_maybe_complete_recv_initial_metadata(t, s);
}
@@ -1604,8 +1593,11 @@ static void perform_stream_op_locked(void* stream_op,
if (op->recv_trailing_metadata) {
GRPC_STATS_INC_HTTP2_OP_RECV_TRAILING_METADATA();
+ GPR_ASSERT(s->collecting_stats == nullptr);
+ s->collecting_stats = op_payload->recv_trailing_metadata.collect_stats;
GPR_ASSERT(s->recv_trailing_metadata_finished == nullptr);
- s->recv_trailing_metadata_finished = add_closure_barrier(on_complete);
+ s->recv_trailing_metadata_finished =
+ op_payload->recv_trailing_metadata.recv_trailing_metadata_ready;
s->recv_trailing_metadata =
op_payload->recv_trailing_metadata.recv_trailing_metadata;
s->final_metadata_requested = true;
@@ -1964,11 +1956,12 @@ void grpc_chttp2_maybe_complete_recv_trailing_metadata(grpc_chttp2_transport* t,
}
if (s->read_closed && s->frame_storage.length == 0 && !pending_data &&
s->recv_trailing_metadata_finished != nullptr) {
+ grpc_transport_move_stats(&s->stats, s->collecting_stats);
+ s->collecting_stats = nullptr;
grpc_chttp2_incoming_metadata_buffer_publish(&s->metadata_buffer[1],
s->recv_trailing_metadata);
- grpc_chttp2_complete_closure_step(
- t, s, &s->recv_trailing_metadata_finished, GRPC_ERROR_NONE,
- "recv_trailing_metadata_finished");
+ null_then_run_closure(&s->recv_trailing_metadata_finished,
+ GRPC_ERROR_NONE);
}
}
}
diff --git a/src/core/ext/transport/chttp2/transport/writing.cc b/src/core/ext/transport/chttp2/transport/writing.cc
index 34d5e6e218..8b73b01dea 100644
--- a/src/core/ext/transport/chttp2/transport/writing.cc
+++ b/src/core/ext/transport/chttp2/transport/writing.cc
@@ -139,22 +139,27 @@ static bool update_list(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
static void report_stall(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
const char* staller) {
- gpr_log(
- GPR_DEBUG,
- "%s:%p stream %d stalled by %s [fc:pending=%" PRIdPTR
- ":pending-compressed=%" PRIdPTR ":flowed=%" PRId64
- ":peer_initwin=%d:t_win=%" PRId64 ":s_win=%d:s_delta=%" PRId64 "]",
- t->peer_string, t, s->id, staller, s->flow_controlled_buffer.length,
- s->compressed_data_buffer.length, s->flow_controlled_bytes_flowed,
- t->settings[GRPC_ACKED_SETTINGS]
- [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE],
- t->flow_control->remote_window(),
- static_cast<uint32_t> GPR_MAX(
- 0,
- s->flow_control->remote_window_delta() +
- (int64_t)t->settings[GRPC_PEER_SETTINGS]
- [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]),
- s->flow_control->remote_window_delta());
+ if (grpc_flowctl_trace.enabled()) {
+ gpr_log(
+ GPR_DEBUG,
+ "%s:%p stream %d moved to stalled list by %s. This is FULLY expected "
+ "to happen in a healthy program that is not seeing flow control stalls."
+ " However, if you know that there are unwanted stalls, here is some "
+ "helpful data: [fc:pending=%" PRIdPTR ":pending-compressed=%" PRIdPTR
+ ":flowed=%" PRId64 ":peer_initwin=%d:t_win=%" PRId64
+ ":s_win=%d:s_delta=%" PRId64 "]",
+ t->peer_string, t, s->id, staller, s->flow_controlled_buffer.length,
+ s->compressed_data_buffer.length, s->flow_controlled_bytes_flowed,
+ t->settings[GRPC_ACKED_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE],
+ t->flow_control->remote_window(),
+ static_cast<uint32_t> GPR_MAX(
+ 0,
+ s->flow_control->remote_window_delta() +
+ (int64_t)t->settings[GRPC_PEER_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]),
+ s->flow_control->remote_window_delta());
+ }
}
static bool stream_ref_if_not_destroyed(gpr_refcount* r) {
diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.cc b/src/core/ext/transport/cronet/transport/cronet_transport.cc
index 420c2d13e1..4a252d972d 100644
--- a/src/core/ext/transport/cronet/transport/cronet_transport.cc
+++ b/src/core/ext/transport/cronet/transport/cronet_transport.cc
@@ -925,6 +925,10 @@ static bool op_can_be_run(grpc_transport_stream_op_batch* curr_op,
result = false;
}
/* Check if every op that was asked for is done. */
+ /* TODO(muxi): We should not consider the recv ops here, since they
+ * have their own callbacks. We should invoke a batch's on_complete
+ * as soon as all of the batch's send ops are complete, even if
+ * there are still recv ops pending. */
else if (curr_op->send_initial_metadata &&
!stream_state->state_callback_received[OP_SEND_INITIAL_METADATA]) {
CRONET_LOG(GPR_DEBUG, "Because");
@@ -1280,12 +1284,20 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) {
op_can_be_run(stream_op, s, &oas->state,
OP_RECV_TRAILING_METADATA)) {
CRONET_LOG(GPR_DEBUG, "running: %p OP_RECV_TRAILING_METADATA", oas);
- if (oas->s->state.rs.trailing_metadata_valid) {
+ grpc_error* error = GRPC_ERROR_NONE;
+ if (stream_state->state_op_done[OP_CANCEL_ERROR]) {
+ error = GRPC_ERROR_REF(stream_state->cancel_error);
+ } else if (stream_state->state_op_done[OP_FAILED]) {
+ error = make_error_with_desc(GRPC_STATUS_UNAVAILABLE, "Unavailable.");
+ } else if (oas->s->state.rs.trailing_metadata_valid) {
grpc_chttp2_incoming_metadata_buffer_publish(
&oas->s->state.rs.trailing_metadata,
stream_op->payload->recv_trailing_metadata.recv_trailing_metadata);
stream_state->rs.trailing_metadata_valid = false;
}
+ GRPC_CLOSURE_SCHED(
+ stream_op->payload->recv_trailing_metadata.recv_trailing_metadata_ready,
+ error);
stream_state->state_op_done[OP_RECV_TRAILING_METADATA] = true;
result = ACTION_TAKEN_NO_CALLBACK;
} else if (stream_op->cancel_stream &&
@@ -1398,6 +1410,11 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
GRPC_CLOSURE_SCHED(op->payload->recv_message.recv_message_ready,
GRPC_ERROR_CANCELLED);
}
+ if (op->recv_trailing_metadata) {
+ GRPC_CLOSURE_SCHED(
+ op->payload->recv_trailing_metadata.recv_trailing_metadata_ready,
+ GRPC_ERROR_CANCELLED);
+ }
GRPC_CLOSURE_SCHED(op->on_complete, GRPC_ERROR_CANCELLED);
return;
}
diff --git a/src/core/ext/transport/inproc/inproc_transport.cc b/src/core/ext/transport/inproc/inproc_transport.cc
index 2c3bff5c1e..b0ca7f8207 100644
--- a/src/core/ext/transport/inproc/inproc_transport.cc
+++ b/src/core/ext/transport/inproc/inproc_transport.cc
@@ -120,7 +120,6 @@ typedef struct inproc_stream {
struct inproc_stream* stream_list_next;
} inproc_stream;
-static grpc_closure do_nothing_closure;
static bool cancel_stream_locked(inproc_stream* s, grpc_error* error);
static void op_state_machine(void* arg, grpc_error* error);
@@ -373,6 +372,10 @@ static void complete_if_batch_end_locked(inproc_stream* s, grpc_error* error,
const char* msg) {
int is_sm = static_cast<int>(op == s->send_message_op);
int is_stm = static_cast<int>(op == s->send_trailing_md_op);
+ // TODO(vjpai): We should not consider the recv ops here, since they
+ // have their own callbacks. We should invoke a batch's on_complete
+ // as soon as all of the batch's send ops are complete, even if there
+ // are still recv ops pending.
int is_rim = static_cast<int>(op == s->recv_initial_md_op);
int is_rm = static_cast<int>(op == s->recv_message_op);
int is_rtm = static_cast<int>(op == s->recv_trailing_md_op);
@@ -496,6 +499,11 @@ static void fail_helper_locked(inproc_stream* s, grpc_error* error) {
s->send_trailing_md_op = nullptr;
}
if (s->recv_trailing_md_op) {
+ INPROC_LOG(GPR_INFO, "fail_helper %p scheduling trailing-metadata-ready %p",
+ s, error);
+ GRPC_CLOSURE_SCHED(s->recv_trailing_md_op->payload->recv_trailing_metadata
+ .recv_trailing_metadata_ready,
+ GRPC_ERROR_REF(error));
INPROC_LOG(GPR_INFO, "fail_helper %p scheduling trailing-md-on-complete %p",
s, error);
complete_if_batch_end_locked(
@@ -639,6 +647,12 @@ static void op_state_machine(void* arg, grpc_error* error) {
s->trailing_md_sent = true;
if (!s->t->is_client && s->trailing_md_recvd && s->recv_trailing_md_op) {
INPROC_LOG(GPR_INFO,
+ "op_state_machine %p scheduling trailing-metadata-ready", s);
+ GRPC_CLOSURE_SCHED(
+ s->recv_trailing_md_op->payload->recv_trailing_metadata
+ .recv_trailing_metadata_ready,
+ GRPC_ERROR_NONE);
+ INPROC_LOG(GPR_INFO,
"op_state_machine %p scheduling trailing-md-on-complete", s);
GRPC_CLOSURE_SCHED(s->recv_trailing_md_op->on_complete,
GRPC_ERROR_NONE);
@@ -711,6 +725,12 @@ static void op_state_machine(void* arg, grpc_error* error) {
}
if (s->recv_trailing_md_op && s->t->is_client && other &&
other->send_message_op) {
+ INPROC_LOG(GPR_INFO,
+ "op_state_machine %p scheduling trailing-metadata-ready %p", s,
+ GRPC_ERROR_NONE);
+ GRPC_CLOSURE_SCHED(s->recv_trailing_md_op->payload->recv_trailing_metadata
+ .recv_trailing_metadata_ready,
+ GRPC_ERROR_NONE);
maybe_schedule_op_closure_locked(other, GRPC_ERROR_NONE);
}
if (s->to_read_trailing_md_filled) {
@@ -766,6 +786,10 @@ static void op_state_machine(void* arg, grpc_error* error) {
INPROC_LOG(GPR_INFO,
"op_state_machine %p scheduling trailing-md-on-complete %p",
s, new_err);
+ GRPC_CLOSURE_SCHED(
+ s->recv_trailing_md_op->payload->recv_trailing_metadata
+ .recv_trailing_metadata_ready,
+ GRPC_ERROR_REF(new_err));
GRPC_CLOSURE_SCHED(s->recv_trailing_md_op->on_complete,
GRPC_ERROR_REF(new_err));
s->recv_trailing_md_op = nullptr;
@@ -859,6 +883,9 @@ static bool cancel_stream_locked(inproc_stream* s, grpc_error* error) {
// couldn't complete that because we hadn't yet sent out trailing
// md, now's the chance
if (!s->t->is_client && s->trailing_md_recvd && s->recv_trailing_md_op) {
+ GRPC_CLOSURE_SCHED(s->recv_trailing_md_op->payload->recv_trailing_metadata
+ .recv_trailing_metadata_ready,
+ GRPC_ERROR_REF(s->cancel_self_error));
complete_if_batch_end_locked(
s, s->cancel_self_error, s->recv_trailing_md_op,
"cancel_stream scheduling trailing-md-on-complete");
@@ -873,6 +900,8 @@ static bool cancel_stream_locked(inproc_stream* s, grpc_error* error) {
return ret;
}
+static void do_nothing(void* arg, grpc_error* error) {}
+
static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
grpc_transport_stream_op_batch* op) {
INPROC_LOG(GPR_INFO, "perform_stream_op %p %p %p", gt, gs, op);
@@ -892,8 +921,14 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
}
grpc_error* error = GRPC_ERROR_NONE;
grpc_closure* on_complete = op->on_complete;
+ // TODO(roth): This is a hack needed because we use data inside of the
+ // closure itself to do the barrier calculation (i.e., to ensure that
+ // we don't schedule the closure until all ops in the batch have been
+ // completed). This can go away once we move to a new C++ closure API
+ // that provides the ability to create a barrier closure.
if (on_complete == nullptr) {
- on_complete = &do_nothing_closure;
+ on_complete = GRPC_CLOSURE_INIT(&op->handler_private.closure, do_nothing,
+ nullptr, grpc_schedule_on_exec_ctx);
}
if (op->cancel_stream) {
@@ -1026,6 +1061,15 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
GRPC_CLOSURE_SCHED(op->payload->recv_message.recv_message_ready,
GRPC_ERROR_REF(error));
}
+ if (op->recv_trailing_metadata) {
+ INPROC_LOG(
+ GPR_INFO,
+ "perform_stream_op error %p scheduling trailing-metadata-ready %p",
+ s, error);
+ GRPC_CLOSURE_SCHED(
+ op->payload->recv_trailing_metadata.recv_trailing_metadata_ready,
+ GRPC_ERROR_REF(error));
+ }
}
INPROC_LOG(GPR_INFO, "perform_stream_op %p scheduling on_complete %p", s,
error);
@@ -1129,12 +1173,8 @@ static grpc_endpoint* get_endpoint(grpc_transport* t) { return nullptr; }
/*******************************************************************************
* GLOBAL INIT AND DESTROY
*/
-static void do_nothing(void* arg, grpc_error* error) {}
-
void grpc_inproc_transport_init(void) {
grpc_core::ExecCtx exec_ctx;
- GRPC_CLOSURE_INIT(&do_nothing_closure, do_nothing, nullptr,
- grpc_schedule_on_exec_ctx);
g_empty_slice = grpc_slice_from_static_buffer(nullptr, 0);
grpc_slice key_tmp = grpc_slice_from_static_string(":path");
diff --git a/src/core/lib/channel/channel_trace.cc b/src/core/lib/channel/channel_trace.cc
index eb7214b355..0f655d8716 100644
--- a/src/core/lib/channel/channel_trace.cc
+++ b/src/core/lib/channel/channel_trace.cc
@@ -28,7 +28,6 @@
#include <stdlib.h>
#include <string.h>
-#include "src/core/lib/channel/channelz_registry.h"
#include "src/core/lib/channel/status_util.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
@@ -40,16 +39,17 @@
#include "src/core/lib/transport/error_utils.h"
namespace grpc_core {
+namespace channelz {
ChannelTrace::TraceEvent::TraceEvent(
Severity severity, grpc_slice data,
- RefCountedPtr<ChannelTrace> referenced_tracer, ReferencedType type)
+ RefCountedPtr<ChannelNode> referenced_channel, ReferencedType type)
: severity_(severity),
data_(data),
timestamp_(grpc_millis_to_timespec(grpc_core::ExecCtx::Get()->Now(),
GPR_CLOCK_REALTIME)),
next_(nullptr),
- referenced_tracer_(std::move(referenced_tracer)),
+ referenced_channel_(std::move(referenced_channel)),
referenced_type_(type) {}
ChannelTrace::TraceEvent::TraceEvent(Severity severity, grpc_slice data)
@@ -62,15 +62,13 @@ ChannelTrace::TraceEvent::TraceEvent(Severity severity, grpc_slice data)
ChannelTrace::TraceEvent::~TraceEvent() { grpc_slice_unref_internal(data_); }
ChannelTrace::ChannelTrace(size_t max_events)
- : channel_uuid_(-1),
- num_events_logged_(0),
+ : num_events_logged_(0),
list_size_(0),
max_list_size_(max_events),
head_trace_(nullptr),
tail_trace_(nullptr) {
if (max_list_size_ == 0) return; // tracing is disabled if max_events == 0
gpr_mu_init(&tracer_mu_);
- channel_uuid_ = ChannelzRegistry::Register(this);
time_created_ = grpc_millis_to_timespec(grpc_core::ExecCtx::Get()->Now(),
GPR_CLOCK_REALTIME);
}
@@ -83,12 +81,9 @@ ChannelTrace::~ChannelTrace() {
it = it->next();
Delete<TraceEvent>(to_free);
}
- ChannelzRegistry::Unregister(channel_uuid_);
gpr_mu_destroy(&tracer_mu_);
}
-intptr_t ChannelTrace::GetUuid() const { return channel_uuid_; }
-
void ChannelTrace::AddTraceEventHelper(TraceEvent* new_trace_event) {
++num_events_logged_;
// first event case
@@ -117,20 +112,21 @@ void ChannelTrace::AddTraceEvent(Severity severity, grpc_slice data) {
void ChannelTrace::AddTraceEventReferencingChannel(
Severity severity, grpc_slice data,
- RefCountedPtr<ChannelTrace> referenced_tracer) {
+ RefCountedPtr<ChannelNode> referenced_channel) {
if (max_list_size_ == 0) return; // tracing is disabled if max_events == 0
// create and fill up the new event
- AddTraceEventHelper(
- New<TraceEvent>(severity, data, std::move(referenced_tracer), Channel));
+ AddTraceEventHelper(New<TraceEvent>(
+ severity, data, std::move(referenced_channel), ReferencedType::Channel));
}
void ChannelTrace::AddTraceEventReferencingSubchannel(
Severity severity, grpc_slice data,
- RefCountedPtr<ChannelTrace> referenced_tracer) {
+ RefCountedPtr<ChannelNode> referenced_subchannel) {
if (max_list_size_ == 0) return; // tracing is disabled if max_events == 0
// create and fill up the new event
- AddTraceEventHelper(New<TraceEvent>(
- severity, data, std::move(referenced_tracer), Subchannel));
+ AddTraceEventHelper(New<TraceEvent>(severity, data,
+ std::move(referenced_subchannel),
+ ReferencedType::Subchannel));
}
namespace {
@@ -193,22 +189,24 @@ void ChannelTrace::TraceEvent::RenderTraceEvent(grpc_json* json) const {
json_iterator =
grpc_json_create_child(json_iterator, json, "timestamp",
fmt_time(timestamp_), GRPC_JSON_STRING, true);
- if (referenced_tracer_ != nullptr) {
+ if (referenced_channel_ != nullptr) {
char* uuid_str;
- gpr_asprintf(&uuid_str, "%" PRIdPTR, referenced_tracer_->channel_uuid_);
+ gpr_asprintf(&uuid_str, "%" PRIdPTR, referenced_channel_->channel_uuid());
grpc_json* child_ref = grpc_json_create_child(
json_iterator, json,
- (referenced_type_ == Channel) ? "channelRef" : "subchannelRef", nullptr,
- GRPC_JSON_OBJECT, false);
+ (referenced_type_ == ReferencedType::Channel) ? "channelRef"
+ : "subchannelRef",
+ nullptr, GRPC_JSON_OBJECT, false);
json_iterator = grpc_json_create_child(
nullptr, child_ref,
- (referenced_type_ == Channel) ? "channelId" : "subchannelId", uuid_str,
- GRPC_JSON_STRING, true);
+ (referenced_type_ == ReferencedType::Channel) ? "channelId"
+ : "subchannelId",
+ uuid_str, GRPC_JSON_STRING, true);
json_iterator = child_ref;
}
}
-char* ChannelTrace::RenderTrace() const {
+grpc_json* ChannelTrace::RenderJSON() const {
if (!max_list_size_)
return nullptr; // tracing is disabled if max_events == 0
grpc_json* json = grpc_json_create(GRPC_JSON_OBJECT);
@@ -219,7 +217,7 @@ char* ChannelTrace::RenderTrace() const {
grpc_json_create_child(json_iterator, json, "numEventsLogged",
num_events_logged_str, GRPC_JSON_STRING, true);
json_iterator =
- grpc_json_create_child(json_iterator, json, "creationTime",
+ grpc_json_create_child(json_iterator, json, "creationTimestamp",
fmt_time(time_created_), GRPC_JSON_STRING, true);
grpc_json* events = grpc_json_create_child(json_iterator, json, "events",
nullptr, GRPC_JSON_ARRAY, false);
@@ -231,9 +229,8 @@ char* ChannelTrace::RenderTrace() const {
it->RenderTraceEvent(json_iterator);
it = it->next();
}
- char* json_str = grpc_json_dump_to_string(json, 0);
- grpc_json_destroy(json);
- return json_str;
+ return json;
}
+} // namespace channelz
} // namespace grpc_core
diff --git a/src/core/lib/channel/channel_trace.h b/src/core/lib/channel/channel_trace.h
index 1df1e585f2..0dd162a777 100644
--- a/src/core/lib/channel/channel_trace.h
+++ b/src/core/lib/channel/channel_trace.h
@@ -28,18 +28,18 @@
#include "src/core/lib/json/json.h"
namespace grpc_core {
+namespace channelz {
+
+class ChannelNode;
// Object used to hold live data for a channel. This data is exposed via the
// channelz service:
// https://github.com/grpc/proposal/blob/master/A14-channelz.md
-class ChannelTrace : public RefCounted<ChannelTrace> {
+class ChannelTrace {
public:
ChannelTrace(size_t max_events);
~ChannelTrace();
- // returns the tracer's uuid
- intptr_t GetUuid() const;
-
enum Severity {
Unset = 0, // never to be used
Info, // we start at 1 to avoid using proto default values
@@ -59,34 +59,30 @@ class ChannelTrace : public RefCounted<ChannelTrace> {
// created a new subchannel, then it would record that with a TraceEvent
// referencing the new subchannel.
//
- // TODO(ncteisen): Once channelz is implemented, the events should reference
- // the overall channelz object, not just the ChannelTrace object.
// TODO(ncteisen): as this call is used more and more throughout the gRPC
// stack, determine if it makes more sense to accept a char* instead of a
// slice.
void AddTraceEventReferencingChannel(
Severity severity, grpc_slice data,
- RefCountedPtr<ChannelTrace> referenced_tracer);
+ RefCountedPtr<ChannelNode> referenced_channel);
void AddTraceEventReferencingSubchannel(
Severity severity, grpc_slice data,
- RefCountedPtr<ChannelTrace> referenced_tracer);
+ RefCountedPtr<ChannelNode> referenced_subchannel);
- // Returns the tracing data rendered as a grpc json string.
- // The string is owned by the caller and must be freed.
- char* RenderTrace() const;
+ // Creates and returns the raw grpc_json object, so a parent channelz
+ // object may incorporate the json before rendering.
+ grpc_json* RenderJSON() const;
private:
// Types of objects that can be references by trace events.
- enum ReferencedType { Channel, Subchannel };
+ enum class ReferencedType { Channel, Subchannel };
// Private class to encapsulate all the data and bookkeeping needed for a
// a trace event.
class TraceEvent {
public:
// Constructor for a TraceEvent that references a different channel.
- // TODO(ncteisen): once channelz is implemented, this should reference the
- // overall channelz object, not just the ChannelTrace object
TraceEvent(Severity severity, grpc_slice data,
- RefCountedPtr<ChannelTrace> referenced_tracer,
+ RefCountedPtr<ChannelNode> referenced_channel,
ReferencedType type);
// Constructor for a TraceEvent that does not reverence a different
@@ -109,7 +105,7 @@ class ChannelTrace : public RefCounted<ChannelTrace> {
gpr_timespec timestamp_;
TraceEvent* next_;
// the tracer object for the (sub)channel that this trace event refers to.
- RefCountedPtr<ChannelTrace> referenced_tracer_;
+ RefCountedPtr<ChannelNode> referenced_channel_;
// the type that the referenced tracer points to. Unused if this trace
// does not point to any channel or subchannel
ReferencedType referenced_type_;
@@ -119,7 +115,6 @@ class ChannelTrace : public RefCounted<ChannelTrace> {
void AddTraceEventHelper(TraceEvent* new_trace_event);
gpr_mu tracer_mu_;
- intptr_t channel_uuid_;
uint64_t num_events_logged_;
size_t list_size_;
size_t max_list_size_;
@@ -128,6 +123,7 @@ class ChannelTrace : public RefCounted<ChannelTrace> {
gpr_timespec time_created_;
};
+} // namespace channelz
} // namespace grpc_core
#endif /* GRPC_CORE_LIB_CHANNEL_CHANNEL_TRACE_H */
diff --git a/src/core/lib/channel/channelz.cc b/src/core/lib/channel/channelz.cc
new file mode 100644
index 0000000000..3550fc0551
--- /dev/null
+++ b/src/core/lib/channel/channelz.cc
@@ -0,0 +1,185 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/impl/codegen/port_platform.h>
+
+#include "src/core/lib/channel/channelz.h"
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "src/core/lib/channel/channelz_registry.h"
+#include "src/core/lib/channel/status_util.h"
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/gpr/useful.h"
+#include "src/core/lib/gprpp/memory.h"
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/transport/connectivity_state.h"
+#include "src/core/lib/transport/error_utils.h"
+
+namespace grpc_core {
+namespace channelz {
+
+namespace {
+
+// TODO(ncteisen): move this function to a common helper location.
+//
+// returns an allocated string that represents tm according to RFC-3339, and,
+// more specifically, follows:
+// https://developers.google.com/protocol-buffers/docs/proto3#json
+//
+// "Uses RFC 3339, where generated output will always be Z-normalized and uses
+// 0, 3, 6 or 9 fractional digits."
+char* fmt_time(gpr_timespec tm) {
+ char time_buffer[35];
+ char ns_buffer[11]; // '.' + 9 digits of precision
+ struct tm* tm_info = localtime((const time_t*)&tm.tv_sec);
+ strftime(time_buffer, sizeof(time_buffer), "%Y-%m-%dT%H:%M:%S", tm_info);
+ snprintf(ns_buffer, 11, ".%09d", tm.tv_nsec);
+ // This loop trims off trailing zeros by inserting a null character that the
+ // right point. We iterate in chunks of three because we want 0, 3, 6, or 9
+ // fractional digits.
+ for (int i = 7; i >= 1; i -= 3) {
+ if (ns_buffer[i] == '0' && ns_buffer[i + 1] == '0' &&
+ ns_buffer[i + 2] == '0') {
+ ns_buffer[i] = '\0';
+ // Edge case in which all fractional digits were 0.
+ if (i == 1) {
+ ns_buffer[0] = '\0';
+ }
+ } else {
+ break;
+ }
+ }
+ char* full_time_str;
+ gpr_asprintf(&full_time_str, "%s%sZ", time_buffer, ns_buffer);
+ return full_time_str;
+}
+
+// TODO(ncteisen); move this to json library
+grpc_json* add_num_str(grpc_json* parent, grpc_json* it, const char* name,
+ int64_t num) {
+ char* num_str;
+ gpr_asprintf(&num_str, "%" PRId64, num);
+ return grpc_json_create_child(it, parent, name, num_str, GRPC_JSON_STRING,
+ true);
+}
+
+} // namespace
+
+ChannelNode::ChannelNode(grpc_channel* channel, size_t channel_tracer_max_nodes)
+ : channel_(channel), target_(nullptr), channel_uuid_(-1) {
+ trace_.Init(channel_tracer_max_nodes);
+ target_ = UniquePtr<char>(grpc_channel_get_target(channel_));
+ channel_uuid_ = ChannelzRegistry::Register(this);
+ gpr_atm_no_barrier_store(&last_call_started_millis_,
+ (gpr_atm)ExecCtx::Get()->Now());
+}
+
+ChannelNode::~ChannelNode() {
+ trace_.Destroy();
+ ChannelzRegistry::Unregister(channel_uuid_);
+}
+
+void ChannelNode::RecordCallStarted() {
+ gpr_atm_no_barrier_fetch_add(&calls_started_, (gpr_atm)1);
+ gpr_atm_no_barrier_store(&last_call_started_millis_,
+ (gpr_atm)ExecCtx::Get()->Now());
+}
+
+grpc_connectivity_state ChannelNode::GetConnectivityState() {
+ if (channel_ == nullptr) {
+ return GRPC_CHANNEL_SHUTDOWN;
+ } else {
+ return grpc_channel_check_connectivity_state(channel_, false);
+ }
+}
+
+char* ChannelNode::RenderJSON() {
+ // We need to track these three json objects to build our object
+ grpc_json* top_level_json = grpc_json_create(GRPC_JSON_OBJECT);
+ grpc_json* json = top_level_json;
+ grpc_json* json_iterator = nullptr;
+ // create and fill the ref child
+ json_iterator = grpc_json_create_child(json_iterator, json, "ref", nullptr,
+ GRPC_JSON_OBJECT, false);
+ json = json_iterator;
+ json_iterator = nullptr;
+ json_iterator = add_num_str(json, json_iterator, "channelId", channel_uuid_);
+ // reset json iterators to top level object
+ json = top_level_json;
+ json_iterator = nullptr;
+ // create and fill the data child.
+ grpc_json* data = grpc_json_create_child(json_iterator, json, "data", nullptr,
+ GRPC_JSON_OBJECT, false);
+ json = data;
+ json_iterator = nullptr;
+ // create and fill the connectivity state child.
+ grpc_connectivity_state connectivity_state = GetConnectivityState();
+ json_iterator = grpc_json_create_child(json_iterator, json, "state", nullptr,
+ GRPC_JSON_OBJECT, false);
+ json = json_iterator;
+ grpc_json_create_child(nullptr, json, "state",
+ grpc_connectivity_state_name(connectivity_state),
+ GRPC_JSON_STRING, false);
+ // reset the parent to be the data object.
+ json = data;
+ json_iterator = grpc_json_create_child(
+ json_iterator, json, "target", target_.get(), GRPC_JSON_STRING, false);
+ // fill in the channel trace if applicable
+ grpc_json* trace = trace_->RenderJSON();
+ if (trace != nullptr) {
+ // we manuall link up and fill the child since it was created for us in
+ // ChannelTrace::RenderJSON
+ json_iterator = grpc_json_link_child(json, trace, json_iterator);
+ trace->parent = json;
+ trace->value = nullptr;
+ trace->key = "trace";
+ trace->owns_value = false;
+ }
+ // reset the parent to be the data object.
+ json = data;
+ json_iterator = nullptr;
+ // We use -1 as sentinel values since proto default value for integers is
+ // zero, and the confuses the parser into thinking the value weren't present
+ json_iterator =
+ add_num_str(json, json_iterator, "callsStarted", calls_started_);
+ json_iterator =
+ add_num_str(json, json_iterator, "callsSucceeded", calls_succeeded_);
+ json_iterator =
+ add_num_str(json, json_iterator, "callsFailed", calls_failed_);
+ gpr_timespec ts =
+ grpc_millis_to_timespec(last_call_started_millis_, GPR_CLOCK_REALTIME);
+ json_iterator =
+ grpc_json_create_child(json_iterator, json, "lastCallStartedTimestamp",
+ fmt_time(ts), GRPC_JSON_STRING, true);
+ // render and return the over json object
+ char* json_str = grpc_json_dump_to_string(top_level_json, 0);
+ grpc_json_destroy(top_level_json);
+ return json_str;
+}
+
+} // namespace channelz
+} // namespace grpc_core
diff --git a/src/core/lib/channel/channelz.h b/src/core/lib/channel/channelz.h
new file mode 100644
index 0000000000..2aad1e82f4
--- /dev/null
+++ b/src/core/lib/channel/channelz.h
@@ -0,0 +1,85 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPC_CORE_LIB_CHANNEL_CHANNELZ_H
+#define GRPC_CORE_LIB_CHANNEL_CHANNELZ_H
+
+#include <grpc/impl/codegen/port_platform.h>
+
+#include <grpc/grpc.h>
+
+#include "src/core/lib/channel/channel_trace.h"
+#include "src/core/lib/gprpp/manual_constructor.h"
+#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/json/json.h"
+
+namespace grpc_core {
+namespace channelz {
+
+namespace testing {
+class ChannelNodePeer;
+}
+
+class ChannelNode : public RefCounted<ChannelNode> {
+ public:
+ ChannelNode(grpc_channel* channel, size_t channel_tracer_max_nodes);
+ ~ChannelNode();
+
+ void RecordCallStarted();
+ void RecordCallFailed() {
+ gpr_atm_no_barrier_fetch_add(&calls_failed_, (gpr_atm(1)));
+ }
+ void RecordCallSucceeded() {
+ gpr_atm_no_barrier_fetch_add(&calls_succeeded_, (gpr_atm(1)));
+ }
+
+ char* RenderJSON();
+
+ ChannelTrace* trace() { return trace_.get(); }
+
+ void set_channel_destroyed() {
+ GPR_ASSERT(channel_ != nullptr);
+ channel_ = nullptr;
+ }
+
+ intptr_t channel_uuid() { return channel_uuid_; }
+
+ private:
+ // testing peer friend.
+ friend class testing::ChannelNodePeer;
+
+ // helper for getting connectivity state.
+ grpc_connectivity_state GetConnectivityState();
+
+ grpc_channel* channel_ = nullptr;
+ UniquePtr<char> target_;
+ gpr_atm calls_started_ = 0;
+ gpr_atm calls_succeeded_ = 0;
+ gpr_atm calls_failed_ = 0;
+ gpr_atm last_call_started_millis_ = 0;
+ intptr_t channel_uuid_;
+ ManualConstructor<ChannelTrace> trace_;
+};
+
+} // namespace channelz
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_LIB_CHANNEL_CHANNELZ_H */
diff --git a/src/core/lib/channel/connected_channel.cc b/src/core/lib/channel/connected_channel.cc
index ddd3029402..e2ea334ded 100644
--- a/src/core/lib/channel/connected_channel.cc
+++ b/src/core/lib/channel/connected_channel.cc
@@ -51,6 +51,7 @@ typedef struct connected_channel_call_data {
callback_state on_complete[6]; // Max number of pending batches.
callback_state recv_initial_metadata_ready;
callback_state recv_message_ready;
+ callback_state recv_trailing_metadata_ready;
} call_data;
static void run_in_call_combiner(void* arg, grpc_error* error) {
@@ -111,6 +112,12 @@ static void con_start_transport_stream_op_batch(
intercept_callback(calld, state, false, "recv_message_ready",
&batch->payload->recv_message.recv_message_ready);
}
+ if (batch->recv_trailing_metadata) {
+ callback_state* state = &calld->recv_trailing_metadata_ready;
+ intercept_callback(
+ calld, state, false, "recv_trailing_metadata_ready",
+ &batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready);
+ }
if (batch->cancel_stream) {
// There can be more than one cancellation batch in flight at any
// given time, so we can't just pick out a fixed index into
@@ -121,7 +128,7 @@ static void con_start_transport_stream_op_batch(
static_cast<callback_state*>(gpr_malloc(sizeof(*state)));
intercept_callback(calld, state, true, "on_complete (cancel_stream)",
&batch->on_complete);
- } else {
+ } else if (batch->on_complete != nullptr) {
callback_state* state = get_state_for_batch(calld, batch);
intercept_callback(calld, state, false, "on_complete", &batch->on_complete);
}
diff --git a/src/core/lib/channel/handshaker.cc b/src/core/lib/channel/handshaker.cc
index 86f8699e04..ad3250b7e9 100644
--- a/src/core/lib/channel/handshaker.cc
+++ b/src/core/lib/channel/handshaker.cc
@@ -223,18 +223,23 @@ static bool call_next_handshaker_locked(grpc_handshake_manager* mgr,
mgr->index == mgr->count) {
if (error == GRPC_ERROR_NONE && mgr->shutdown) {
error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("handshaker shutdown");
- // TODO(roth): It is currently necessary to shutdown endpoints
- // before destroying then, even when we know that there are no
- // pending read/write callbacks. This should be fixed, at which
- // point this can be removed.
- grpc_endpoint_shutdown(mgr->args.endpoint, GRPC_ERROR_REF(error));
- grpc_endpoint_destroy(mgr->args.endpoint);
- mgr->args.endpoint = nullptr;
- grpc_channel_args_destroy(mgr->args.args);
- mgr->args.args = nullptr;
- grpc_slice_buffer_destroy_internal(mgr->args.read_buffer);
- gpr_free(mgr->args.read_buffer);
- mgr->args.read_buffer = nullptr;
+ // It is possible that the endpoint has already been destroyed by
+ // a shutdown call while this callback was sitting on the ExecCtx
+ // with no error.
+ if (mgr->args.endpoint != nullptr) {
+ // TODO(roth): It is currently necessary to shutdown endpoints
+ // before destroying then, even when we know that there are no
+ // pending read/write callbacks. This should be fixed, at which
+ // point this can be removed.
+ grpc_endpoint_shutdown(mgr->args.endpoint, GRPC_ERROR_REF(error));
+ grpc_endpoint_destroy(mgr->args.endpoint);
+ mgr->args.endpoint = nullptr;
+ grpc_channel_args_destroy(mgr->args.args);
+ mgr->args.args = nullptr;
+ grpc_slice_buffer_destroy_internal(mgr->args.read_buffer);
+ gpr_free(mgr->args.read_buffer);
+ mgr->args.read_buffer = nullptr;
+ }
}
if (grpc_handshaker_trace.enabled()) {
gpr_log(GPR_INFO,
diff --git a/src/core/lib/gprpp/inlined_vector.h b/src/core/lib/gprpp/inlined_vector.h
index f36f6cb706..0d2586e507 100644
--- a/src/core/lib/gprpp/inlined_vector.h
+++ b/src/core/lib/gprpp/inlined_vector.h
@@ -99,6 +99,8 @@ class InlinedVector {
void push_back(T&& value) { emplace_back(std::move(value)); }
size_t size() const { return size_; }
+ bool empty() const { return size_ == 0; }
+
size_t capacity() const { return capacity_; }
void clear() {
diff --git a/src/core/lib/iomgr/call_combiner.h b/src/core/lib/iomgr/call_combiner.h
index 0ccd08ea57..641fa18082 100644
--- a/src/core/lib/iomgr/call_combiner.h
+++ b/src/core/lib/iomgr/call_combiner.h
@@ -26,6 +26,7 @@
#include <grpc/support/atm.h>
#include "src/core/lib/gpr/mpscq.h"
+#include "src/core/lib/gprpp/inlined_vector.h"
#include "src/core/lib/iomgr/closure.h"
// A simple, lock-free mechanism for serializing activity related to a
@@ -109,4 +110,83 @@ void grpc_call_combiner_set_notify_on_cancel(grpc_call_combiner* call_combiner,
void grpc_call_combiner_cancel(grpc_call_combiner* call_combiner,
grpc_error* error);
+namespace grpc_core {
+
+// Helper for running a list of closures in a call combiner.
+//
+// Each callback running in the call combiner will eventually be
+// returned to the surface, at which point the surface will yield the
+// call combiner. So when we are running in the call combiner and have
+// more than one callback to return to the surface, we need to re-enter
+// the call combiner for all but one of those callbacks.
+class CallCombinerClosureList {
+ public:
+ CallCombinerClosureList() {}
+
+ // Adds a closure to the list. The closure must eventually result in
+ // the call combiner being yielded.
+ void Add(grpc_closure* closure, grpc_error* error, const char* reason) {
+ closures_.emplace_back(closure, error, reason);
+ }
+
+ // Runs all closures in the call combiner and yields the call combiner.
+ //
+ // All but one of the closures in the list will be scheduled via
+ // GRPC_CALL_COMBINER_START(), and the remaining closure will be
+ // scheduled via GRPC_CLOSURE_SCHED(), which will eventually result in
+ // yielding the call combiner. If the list is empty, then the call
+ // combiner will be yielded immediately.
+ void RunClosures(grpc_call_combiner* call_combiner) {
+ if (closures_.empty()) {
+ GRPC_CALL_COMBINER_STOP(call_combiner, "no closures to schedule");
+ return;
+ }
+ for (size_t i = 1; i < closures_.size(); ++i) {
+ auto& closure = closures_[i];
+ GRPC_CALL_COMBINER_START(call_combiner, closure.closure, closure.error,
+ closure.reason);
+ }
+ if (grpc_call_combiner_trace.enabled()) {
+ gpr_log(GPR_INFO,
+ "CallCombinerClosureList executing closure while already "
+ "holding call_combiner %p: closure=%p error=%s reason=%s",
+ call_combiner, closures_[0].closure,
+ grpc_error_string(closures_[0].error), closures_[0].reason);
+ }
+ // This will release the call combiner.
+ GRPC_CLOSURE_SCHED(closures_[0].closure, closures_[0].error);
+ closures_.clear();
+ }
+
+ // Runs all closures in the call combiner, but does NOT yield the call
+ // combiner. All closures will be scheduled via GRPC_CALL_COMBINER_START().
+ void RunClosuresWithoutYielding(grpc_call_combiner* call_combiner) {
+ for (size_t i = 0; i < closures_.size(); ++i) {
+ auto& closure = closures_[i];
+ GRPC_CALL_COMBINER_START(call_combiner, closure.closure, closure.error,
+ closure.reason);
+ }
+ closures_.clear();
+ }
+
+ size_t size() const { return closures_.size(); }
+
+ private:
+ struct CallCombinerClosure {
+ grpc_closure* closure;
+ grpc_error* error;
+ const char* reason;
+
+ CallCombinerClosure(grpc_closure* closure, grpc_error* error,
+ const char* reason)
+ : closure(closure), error(error), reason(reason) {}
+ };
+
+ // There are generally a maximum of 6 closures to run in the call
+ // combiner, one for each pending op.
+ InlinedVector<CallCombinerClosure, 6> closures_;
+};
+
+} // namespace grpc_core
+
#endif /* GRPC_CORE_LIB_IOMGR_CALL_COMBINER_H */
diff --git a/src/core/lib/iomgr/cfstream_handle.cc b/src/core/lib/iomgr/cfstream_handle.cc
new file mode 100644
index 0000000000..827fd24831
--- /dev/null
+++ b/src/core/lib/iomgr/cfstream_handle.cc
@@ -0,0 +1,185 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/iomgr/port.h"
+
+#ifdef GRPC_CFSTREAM
+#import <CoreFoundation/CoreFoundation.h>
+#import "src/core/lib/iomgr/cfstream_handle.h"
+
+#include <grpc/support/atm.h>
+#include <grpc/support/sync.h>
+
+#include "src/core/lib/debug/trace.h"
+#include "src/core/lib/iomgr/closure.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+
+extern grpc_core::TraceFlag grpc_tcp_trace;
+
+void* CFStreamHandle::Retain(void* info) {
+ CFStreamHandle* handle = static_cast<CFStreamHandle*>(info);
+ CFSTREAM_HANDLE_REF(handle, "retain");
+ return info;
+}
+
+void CFStreamHandle::Release(void* info) {
+ CFStreamHandle* handle = static_cast<CFStreamHandle*>(info);
+ CFSTREAM_HANDLE_UNREF(handle, "release");
+}
+
+CFStreamHandle* CFStreamHandle::CreateStreamHandle(
+ CFReadStreamRef read_stream, CFWriteStreamRef write_stream) {
+ return new CFStreamHandle(read_stream, write_stream);
+}
+
+void CFStreamHandle::ReadCallback(CFReadStreamRef stream,
+ CFStreamEventType type,
+ void* client_callback_info) {
+ CFStreamHandle* handle = static_cast<CFStreamHandle*>(client_callback_info);
+ CFSTREAM_HANDLE_REF(handle, "read callback");
+ dispatch_async(
+ dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+ grpc_core::ExecCtx exec_ctx;
+ if (grpc_tcp_trace.enabled()) {
+ gpr_log(GPR_DEBUG, "CFStream ReadCallback (%p, %p, %lu, %p)", handle,
+ stream, type, client_callback_info);
+ }
+ switch (type) {
+ case kCFStreamEventOpenCompleted:
+ handle->open_event_.SetReady();
+ break;
+ case kCFStreamEventHasBytesAvailable:
+ case kCFStreamEventEndEncountered:
+ handle->read_event_.SetReady();
+ break;
+ case kCFStreamEventErrorOccurred:
+ handle->open_event_.SetReady();
+ handle->read_event_.SetReady();
+ break;
+ default:
+ GPR_UNREACHABLE_CODE(return );
+ }
+ CFSTREAM_HANDLE_UNREF(handle, "read callback");
+ });
+}
+void CFStreamHandle::WriteCallback(CFWriteStreamRef stream,
+ CFStreamEventType type,
+ void* clientCallBackInfo) {
+ CFStreamHandle* handle = static_cast<CFStreamHandle*>(clientCallBackInfo);
+ CFSTREAM_HANDLE_REF(handle, "write callback");
+ dispatch_async(
+ dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+ grpc_core::ExecCtx exec_ctx;
+ if (grpc_tcp_trace.enabled()) {
+ gpr_log(GPR_DEBUG, "CFStream WriteCallback (%p, %p, %lu, %p)", handle,
+ stream, type, clientCallBackInfo);
+ }
+ switch (type) {
+ case kCFStreamEventOpenCompleted:
+ handle->open_event_.SetReady();
+ break;
+ case kCFStreamEventCanAcceptBytes:
+ case kCFStreamEventEndEncountered:
+ handle->write_event_.SetReady();
+ break;
+ case kCFStreamEventErrorOccurred:
+ handle->open_event_.SetReady();
+ handle->write_event_.SetReady();
+ break;
+ default:
+ GPR_UNREACHABLE_CODE(return );
+ }
+ CFSTREAM_HANDLE_UNREF(handle, "write callback");
+ });
+}
+
+CFStreamHandle::CFStreamHandle(CFReadStreamRef read_stream,
+ CFWriteStreamRef write_stream) {
+ gpr_ref_init(&refcount_, 1);
+ open_event_.InitEvent();
+ read_event_.InitEvent();
+ write_event_.InitEvent();
+ CFStreamClientContext ctx = {0, static_cast<void*>(this),
+ CFStreamHandle::Retain, CFStreamHandle::Release,
+ nil};
+ CFReadStreamSetClient(
+ read_stream,
+ kCFStreamEventOpenCompleted | kCFStreamEventHasBytesAvailable |
+ kCFStreamEventErrorOccurred | kCFStreamEventEndEncountered,
+ CFStreamHandle::ReadCallback, &ctx);
+ CFWriteStreamSetClient(
+ write_stream,
+ kCFStreamEventOpenCompleted | kCFStreamEventCanAcceptBytes |
+ kCFStreamEventErrorOccurred | kCFStreamEventEndEncountered,
+ CFStreamHandle::WriteCallback, &ctx);
+ CFReadStreamScheduleWithRunLoop(read_stream, CFRunLoopGetMain(),
+ kCFRunLoopCommonModes);
+ CFWriteStreamScheduleWithRunLoop(write_stream, CFRunLoopGetMain(),
+ kCFRunLoopCommonModes);
+}
+
+CFStreamHandle::~CFStreamHandle() {
+ open_event_.DestroyEvent();
+ read_event_.DestroyEvent();
+ write_event_.DestroyEvent();
+}
+
+void CFStreamHandle::NotifyOnOpen(grpc_closure* closure) {
+ open_event_.NotifyOn(closure);
+}
+
+void CFStreamHandle::NotifyOnRead(grpc_closure* closure) {
+ read_event_.NotifyOn(closure);
+}
+
+void CFStreamHandle::NotifyOnWrite(grpc_closure* closure) {
+ write_event_.NotifyOn(closure);
+}
+
+void CFStreamHandle::Shutdown(grpc_error* error) {
+ open_event_.SetShutdown(GRPC_ERROR_REF(error));
+ read_event_.SetShutdown(GRPC_ERROR_REF(error));
+ write_event_.SetShutdown(GRPC_ERROR_REF(error));
+ GRPC_ERROR_UNREF(error);
+}
+
+void CFStreamHandle::Ref(const char* file, int line, const char* reason) {
+ if (grpc_tcp_trace.enabled()) {
+ gpr_atm val = gpr_atm_no_barrier_load(&refcount_.count);
+ gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
+ "CFStream Handle ref %p : %s %" PRIdPTR " -> %" PRIdPTR, this,
+ reason, val, val + 1);
+ }
+ gpr_ref(&refcount_);
+}
+
+void CFStreamHandle::Unref(const char* file, int line, const char* reason) {
+ if (grpc_tcp_trace.enabled()) {
+ gpr_atm val = gpr_atm_no_barrier_load(&refcount_.count);
+ gpr_log(GPR_ERROR,
+ "CFStream Handle unref %p : %s %" PRIdPTR " -> %" PRIdPTR, this,
+ reason, val, val - 1);
+ }
+ if (gpr_unref(&refcount_)) {
+ delete this;
+ }
+}
+
+#endif
diff --git a/src/core/lib/iomgr/cfstream_handle.h b/src/core/lib/iomgr/cfstream_handle.h
new file mode 100644
index 0000000000..4258e72431
--- /dev/null
+++ b/src/core/lib/iomgr/cfstream_handle.h
@@ -0,0 +1,80 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/* The CFStream handle acts as an event synchronization entity for
+ * read/write/open/error/eos events happening on CFStream streams. */
+
+#ifndef GRPC_CORE_LIB_IOMGR_CFSTREAM_HANDLE_H
+#define GRPC_CORE_LIB_IOMGR_CFSTREAM_HANDLE_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/iomgr/port.h"
+
+#ifdef GRPC_CFSTREAM
+#import <CoreFoundation/CoreFoundation.h>
+
+#include "src/core/lib/iomgr/closure.h"
+#include "src/core/lib/iomgr/lockfree_event.h"
+
+class CFStreamHandle final {
+ public:
+ static CFStreamHandle* CreateStreamHandle(CFReadStreamRef read_stream,
+ CFWriteStreamRef write_stream);
+ ~CFStreamHandle();
+ CFStreamHandle(const CFReadStreamRef& ref) = delete;
+ CFStreamHandle(CFReadStreamRef&& ref) = delete;
+ CFStreamHandle& operator=(const CFStreamHandle& rhs) = delete;
+
+ void NotifyOnOpen(grpc_closure* closure);
+ void NotifyOnRead(grpc_closure* closure);
+ void NotifyOnWrite(grpc_closure* closure);
+ void Shutdown(grpc_error* error);
+
+ void Ref(const char* file = "", int line = 0, const char* reason = nullptr);
+ void Unref(const char* file = "", int line = 0, const char* reason = nullptr);
+
+ private:
+ CFStreamHandle(CFReadStreamRef read_stream, CFWriteStreamRef write_stream);
+ static void ReadCallback(CFReadStreamRef stream, CFStreamEventType type,
+ void* client_callback_info);
+ static void WriteCallback(CFWriteStreamRef stream, CFStreamEventType type,
+ void* client_callback_info);
+ static void* Retain(void* info);
+ static void Release(void* info);
+
+ grpc_core::LockfreeEvent open_event_;
+ grpc_core::LockfreeEvent read_event_;
+ grpc_core::LockfreeEvent write_event_;
+
+ gpr_refcount refcount_;
+};
+
+#ifdef DEBUG
+#define CFSTREAM_HANDLE_REF(handle, reason) \
+ (handle)->Ref(__FILE__, __LINE__, (reason))
+#define CFSTREAM_HANDLE_UNREF(handle, reason) \
+ (handle)->Unref(__FILE__, __LINE__, (reason))
+#else
+#define CFSTREAM_HANDLE_REF(handle, reason) (handle)->Ref()
+#define CFSTREAM_HANDLE_UNREF(handle, reason) (handle)->Unref()
+#endif
+
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_CFSTREAM_HANDLE_H */
diff --git a/src/core/lib/iomgr/closure.h b/src/core/lib/iomgr/closure.h
index 34a494485d..f14c723844 100644
--- a/src/core/lib/iomgr/closure.h
+++ b/src/core/lib/iomgr/closure.h
@@ -283,9 +283,10 @@ inline void grpc_closure_sched(grpc_closure* c, grpc_error* error) {
if (c->scheduled) {
gpr_log(GPR_ERROR,
"Closure already scheduled. (closure: %p, created: [%s:%d], "
- "previously scheduled at: [%s: %d] run?: %s",
+ "previously scheduled at: [%s: %d], newly scheduled at [%s: %d], "
+ "run?: %s",
c, c->file_created, c->line_created, c->file_initiated,
- c->line_initiated, c->run ? "true" : "false");
+ c->line_initiated, file, line, c->run ? "true" : "false");
abort();
}
c->scheduled = true;
diff --git a/src/core/lib/iomgr/endpoint_cfstream.cc b/src/core/lib/iomgr/endpoint_cfstream.cc
new file mode 100644
index 0000000000..c3bc0cc8fd
--- /dev/null
+++ b/src/core/lib/iomgr/endpoint_cfstream.cc
@@ -0,0 +1,372 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/iomgr/port.h"
+
+#ifdef GRPC_CFSTREAM_ENDPOINT
+
+#import <CoreFoundation/CoreFoundation.h>
+#import "src/core/lib/iomgr/endpoint_cfstream.h"
+
+#include <grpc/slice_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/iomgr/cfstream_handle.h"
+#include "src/core/lib/iomgr/closure.h"
+#include "src/core/lib/iomgr/endpoint.h"
+#include "src/core/lib/iomgr/error_cfstream.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/slice/slice_string_helpers.h"
+
+extern grpc_core::TraceFlag grpc_tcp_trace;
+
+typedef struct {
+ grpc_endpoint base;
+ gpr_refcount refcount;
+
+ CFReadStreamRef read_stream;
+ CFWriteStreamRef write_stream;
+ CFStreamHandle* stream_sync;
+
+ grpc_closure* read_cb;
+ grpc_closure* write_cb;
+ grpc_slice_buffer* read_slices;
+ grpc_slice_buffer* write_slices;
+
+ grpc_closure read_action;
+ grpc_closure write_action;
+
+ char* peer_string;
+ grpc_resource_user* resource_user;
+ grpc_resource_user_slice_allocator slice_allocator;
+} CFStreamEndpoint;
+
+static void CFStreamFree(CFStreamEndpoint* ep) {
+ grpc_resource_user_unref(ep->resource_user);
+ CFRelease(ep->read_stream);
+ CFRelease(ep->write_stream);
+ CFSTREAM_HANDLE_UNREF(ep->stream_sync, "free");
+ gpr_free(ep->peer_string);
+ gpr_free(ep);
+}
+
+#ifndef NDEBUG
+#define EP_REF(ep, reason) CFStreamRef((ep), (reason), __FILE__, __LINE__)
+#define EP_UNREF(ep, reason) CFStreamUnref((ep), (reason), __FILE__, __LINE__)
+static void CFStreamUnref(CFStreamEndpoint* ep, const char* reason,
+ const char* file, int line) {
+ if (grpc_tcp_trace.enabled()) {
+ gpr_atm val = gpr_atm_no_barrier_load(&ep->refcount.count);
+ gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
+ "CFStream endpoint unref %p : %s %" PRIdPTR " -> %" PRIdPTR, ep,
+ reason, val, val - 1);
+ }
+ if (gpr_unref(&ep->refcount)) {
+ CFStreamFree(ep);
+ }
+}
+static void CFStreamRef(CFStreamEndpoint* ep, const char* reason,
+ const char* file, int line) {
+ if (grpc_tcp_trace.enabled()) {
+ gpr_atm val = gpr_atm_no_barrier_load(&ep->refcount.count);
+ gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
+ "CFStream endpoint ref %p : %s %" PRIdPTR " -> %" PRIdPTR, ep,
+ reason, val, val + 1);
+ }
+ gpr_ref(&ep->refcount);
+}
+#else
+#define EP_REF(ep, reason) CFStreamRef((ep))
+#define EP_UNREF(ep, reason) CFStreamUnref((ep))
+static void CFStreamUnref(CFStreamEndpoint* ep) {
+ if (gpr_unref(&ep->refcount)) {
+ CFStreamFree(ep);
+ }
+}
+static void CFStreamRef(CFStreamEndpoint* ep) { gpr_ref(&ep->refcount); }
+#endif
+
+static grpc_error* CFStreamAnnotateError(grpc_error* src_error,
+ CFStreamEndpoint* ep) {
+ return grpc_error_set_str(
+ grpc_error_set_int(src_error, GRPC_ERROR_INT_GRPC_STATUS,
+ GRPC_STATUS_UNAVAILABLE),
+ GRPC_ERROR_STR_TARGET_ADDRESS,
+ grpc_slice_from_copied_string(ep->peer_string));
+}
+
+static void CallReadCb(CFStreamEndpoint* ep, grpc_error* error) {
+ if (grpc_tcp_trace.enabled()) {
+ gpr_log(GPR_DEBUG, "CFStream endpoint:%p call_read_cb %p %p:%p", ep,
+ ep->read_cb, ep->read_cb->cb, ep->read_cb->cb_arg);
+ size_t i;
+ const char* str = grpc_error_string(error);
+ gpr_log(GPR_DEBUG, "read: error=%s", str);
+
+ for (i = 0; i < ep->read_slices->count; i++) {
+ char* dump = grpc_dump_slice(ep->read_slices->slices[i],
+ GPR_DUMP_HEX | GPR_DUMP_ASCII);
+ gpr_log(GPR_DEBUG, "READ %p (peer=%s): %s", ep, ep->peer_string, dump);
+ gpr_free(dump);
+ }
+ }
+ grpc_closure* cb = ep->read_cb;
+ ep->read_cb = nullptr;
+ ep->read_slices = nullptr;
+ GRPC_CLOSURE_SCHED(cb, error);
+}
+
+static void CallWriteCb(CFStreamEndpoint* ep, grpc_error* error) {
+ if (grpc_tcp_trace.enabled()) {
+ gpr_log(GPR_DEBUG, "CFStream endpoint:%p call_write_cb %p %p:%p", ep,
+ ep->write_cb, ep->write_cb->cb, ep->write_cb->cb_arg);
+ const char* str = grpc_error_string(error);
+ gpr_log(GPR_DEBUG, "write: error=%s", str);
+ }
+ grpc_closure* cb = ep->write_cb;
+ ep->write_cb = nullptr;
+ ep->write_slices = nullptr;
+ GRPC_CLOSURE_SCHED(cb, error);
+}
+
+static void ReadAction(void* arg, grpc_error* error) {
+ CFStreamEndpoint* ep = static_cast<CFStreamEndpoint*>(arg);
+ GPR_ASSERT(ep->read_cb != nullptr);
+ if (error) {
+ grpc_slice_buffer_reset_and_unref_internal(ep->read_slices);
+ CallReadCb(ep, GRPC_ERROR_REF(error));
+ EP_UNREF(ep, "read");
+ return;
+ }
+
+ GPR_ASSERT(ep->read_slices->count == 1);
+ grpc_slice slice = ep->read_slices->slices[0];
+ size_t len = GRPC_SLICE_LENGTH(slice);
+ CFIndex read_size =
+ CFReadStreamRead(ep->read_stream, GRPC_SLICE_START_PTR(slice), len);
+ if (read_size == -1) {
+ grpc_slice_buffer_reset_and_unref_internal(ep->read_slices);
+ CFErrorRef stream_error = CFReadStreamCopyError(ep->read_stream);
+ if (stream_error != nullptr) {
+ error = CFStreamAnnotateError(
+ GRPC_ERROR_CREATE_FROM_CFERROR(stream_error, "Read error"), ep);
+ CFRelease(stream_error);
+ } else {
+ error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Read error");
+ }
+ CallReadCb(ep, error);
+ EP_UNREF(ep, "read");
+ } else if (read_size == 0) {
+ grpc_slice_buffer_reset_and_unref_internal(ep->read_slices);
+ CallReadCb(ep,
+ CFStreamAnnotateError(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Socket closed"), ep));
+ EP_UNREF(ep, "read");
+ } else {
+ if (read_size < len) {
+ grpc_slice_buffer_trim_end(ep->read_slices, len - read_size, nullptr);
+ }
+ CallReadCb(ep, GRPC_ERROR_NONE);
+ EP_UNREF(ep, "read");
+ }
+}
+
+static void WriteAction(void* arg, grpc_error* error) {
+ CFStreamEndpoint* ep = static_cast<CFStreamEndpoint*>(arg);
+ GPR_ASSERT(ep->write_cb != nullptr);
+ if (error) {
+ grpc_slice_buffer_reset_and_unref_internal(ep->write_slices);
+ CallWriteCb(ep, GRPC_ERROR_REF(error));
+ EP_UNREF(ep, "write");
+ return;
+ }
+
+ grpc_slice slice = grpc_slice_buffer_take_first(ep->write_slices);
+ size_t slice_len = GRPC_SLICE_LENGTH(slice);
+ CFIndex write_size = CFWriteStreamWrite(
+ ep->write_stream, GRPC_SLICE_START_PTR(slice), slice_len);
+ if (write_size == -1) {
+ grpc_slice_buffer_reset_and_unref_internal(ep->write_slices);
+ CFErrorRef stream_error = CFWriteStreamCopyError(ep->write_stream);
+ if (stream_error != nullptr) {
+ error = CFStreamAnnotateError(
+ GRPC_ERROR_CREATE_FROM_CFERROR(stream_error, "write failed."), ep);
+ CFRelease(stream_error);
+ } else {
+ error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("write failed.");
+ }
+ CallWriteCb(ep, error);
+ EP_UNREF(ep, "write");
+ } else {
+ if (write_size < GRPC_SLICE_LENGTH(slice)) {
+ grpc_slice_buffer_undo_take_first(
+ ep->write_slices, grpc_slice_sub(slice, write_size, slice_len));
+ }
+ if (ep->write_slices->length > 0) {
+ ep->stream_sync->NotifyOnWrite(&ep->write_action);
+ } else {
+ CallWriteCb(ep, GRPC_ERROR_NONE);
+ EP_UNREF(ep, "write");
+ }
+
+ if (grpc_tcp_trace.enabled()) {
+ grpc_slice trace_slice = grpc_slice_sub(slice, 0, write_size);
+ char* dump = grpc_dump_slice(trace_slice, GPR_DUMP_HEX | GPR_DUMP_ASCII);
+ gpr_log(GPR_DEBUG, "WRITE %p (peer=%s): %s", ep, ep->peer_string, dump);
+ gpr_free(dump);
+ grpc_slice_unref_internal(trace_slice);
+ }
+ }
+ grpc_slice_unref_internal(slice);
+}
+
+static void CFStreamReadAllocationDone(void* arg, grpc_error* error) {
+ CFStreamEndpoint* ep = static_cast<CFStreamEndpoint*>(arg);
+ if (error == GRPC_ERROR_NONE) {
+ ep->stream_sync->NotifyOnRead(&ep->read_action);
+ } else {
+ grpc_slice_buffer_reset_and_unref_internal(ep->read_slices);
+ CallReadCb(ep, error);
+ EP_UNREF(ep, "read");
+ }
+}
+
+static void CFStreamRead(grpc_endpoint* ep, grpc_slice_buffer* slices,
+ grpc_closure* cb) {
+ CFStreamEndpoint* ep_impl = reinterpret_cast<CFStreamEndpoint*>(ep);
+ if (grpc_tcp_trace.enabled()) {
+ gpr_log(GPR_DEBUG, "CFStream endpoint:%p read (%p, %p) length:%zu", ep_impl,
+ slices, cb, slices->length);
+ }
+ GPR_ASSERT(ep_impl->read_cb == nullptr);
+ ep_impl->read_cb = cb;
+ ep_impl->read_slices = slices;
+ grpc_slice_buffer_reset_and_unref_internal(slices);
+ grpc_resource_user_alloc_slices(&ep_impl->slice_allocator,
+ GRPC_TCP_DEFAULT_READ_SLICE_SIZE, 1,
+ ep_impl->read_slices);
+ EP_REF(ep_impl, "read");
+}
+
+static void CFStreamWrite(grpc_endpoint* ep, grpc_slice_buffer* slices,
+ grpc_closure* cb) {
+ CFStreamEndpoint* ep_impl = reinterpret_cast<CFStreamEndpoint*>(ep);
+ if (grpc_tcp_trace.enabled()) {
+ gpr_log(GPR_DEBUG, "CFStream endpoint:%p write (%p, %p) length:%zu",
+ ep_impl, slices, cb, slices->length);
+ }
+ GPR_ASSERT(ep_impl->write_cb == nullptr);
+ ep_impl->write_cb = cb;
+ ep_impl->write_slices = slices;
+ EP_REF(ep_impl, "write");
+ ep_impl->stream_sync->NotifyOnWrite(&ep_impl->write_action);
+}
+
+void CFStreamShutdown(grpc_endpoint* ep, grpc_error* why) {
+ CFStreamEndpoint* ep_impl = reinterpret_cast<CFStreamEndpoint*>(ep);
+ if (grpc_tcp_trace.enabled()) {
+ gpr_log(GPR_DEBUG, "CFStream endpoint:%p shutdown (%p)", ep_impl, why);
+ }
+ CFReadStreamClose(ep_impl->read_stream);
+ CFWriteStreamClose(ep_impl->write_stream);
+ ep_impl->stream_sync->Shutdown(why);
+ grpc_resource_user_shutdown(ep_impl->resource_user);
+ if (grpc_tcp_trace.enabled()) {
+ gpr_log(GPR_DEBUG, "CFStream endpoint:%p shutdown DONE (%p)", ep_impl, why);
+ }
+}
+
+void CFStreamDestroy(grpc_endpoint* ep) {
+ CFStreamEndpoint* ep_impl = reinterpret_cast<CFStreamEndpoint*>(ep);
+ if (grpc_tcp_trace.enabled()) {
+ gpr_log(GPR_DEBUG, "CFStream endpoint:%p destroy", ep_impl);
+ }
+ EP_UNREF(ep_impl, "destroy");
+}
+
+grpc_resource_user* CFStreamGetResourceUser(grpc_endpoint* ep) {
+ CFStreamEndpoint* ep_impl = reinterpret_cast<CFStreamEndpoint*>(ep);
+ return ep_impl->resource_user;
+}
+
+char* CFStreamGetPeer(grpc_endpoint* ep) {
+ CFStreamEndpoint* ep_impl = reinterpret_cast<CFStreamEndpoint*>(ep);
+ return gpr_strdup(ep_impl->peer_string);
+}
+
+int CFStreamGetFD(grpc_endpoint* ep) { return 0; }
+
+void CFStreamAddToPollset(grpc_endpoint* ep, grpc_pollset* pollset) {}
+void CFStreamAddToPollsetSet(grpc_endpoint* ep, grpc_pollset_set* pollset) {}
+void CFStreamDeleteFromPollsetSet(grpc_endpoint* ep,
+ grpc_pollset_set* pollset) {}
+
+static const grpc_endpoint_vtable vtable = {CFStreamRead,
+ CFStreamWrite,
+ CFStreamAddToPollset,
+ CFStreamAddToPollsetSet,
+ CFStreamDeleteFromPollsetSet,
+ CFStreamShutdown,
+ CFStreamDestroy,
+ CFStreamGetResourceUser,
+ CFStreamGetPeer,
+ CFStreamGetFD};
+
+grpc_endpoint* grpc_cfstream_endpoint_create(
+ CFReadStreamRef read_stream, CFWriteStreamRef write_stream,
+ const char* peer_string, grpc_resource_quota* resource_quota,
+ CFStreamHandle* stream_sync) {
+ CFStreamEndpoint* ep_impl =
+ static_cast<CFStreamEndpoint*>(gpr_malloc(sizeof(CFStreamEndpoint)));
+ if (grpc_tcp_trace.enabled()) {
+ gpr_log(GPR_DEBUG,
+ "CFStream endpoint:%p create readStream:%p writeStream: %p",
+ ep_impl, read_stream, write_stream);
+ }
+ ep_impl->base.vtable = &vtable;
+ gpr_ref_init(&ep_impl->refcount, 1);
+ ep_impl->read_stream = read_stream;
+ ep_impl->write_stream = write_stream;
+ CFRetain(read_stream);
+ CFRetain(write_stream);
+ ep_impl->stream_sync = stream_sync;
+ CFSTREAM_HANDLE_REF(ep_impl->stream_sync, "endpoint create");
+
+ ep_impl->peer_string = gpr_strdup(peer_string);
+ ep_impl->read_cb = nil;
+ ep_impl->write_cb = nil;
+ ep_impl->read_slices = nil;
+ ep_impl->write_slices = nil;
+ GRPC_CLOSURE_INIT(&ep_impl->read_action, ReadAction,
+ static_cast<void*>(ep_impl), grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&ep_impl->write_action, WriteAction,
+ static_cast<void*>(ep_impl), grpc_schedule_on_exec_ctx);
+ ep_impl->resource_user =
+ grpc_resource_user_create(resource_quota, peer_string);
+ grpc_resource_user_slice_allocator_init(&ep_impl->slice_allocator,
+ ep_impl->resource_user,
+ CFStreamReadAllocationDone, ep_impl);
+
+ return &ep_impl->base;
+}
+
+#endif /* GRPC_CFSTREAM_ENDPOINT */
diff --git a/src/core/lib/iomgr/endpoint_cfstream.h b/src/core/lib/iomgr/endpoint_cfstream.h
new file mode 100644
index 0000000000..ef957c1f11
--- /dev/null
+++ b/src/core/lib/iomgr/endpoint_cfstream.h
@@ -0,0 +1,49 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPC_CORE_LIB_IOMGR_ENDPOINT_CFSTREAM_H
+#define GRPC_CORE_LIB_IOMGR_ENDPOINT_CFSTREAM_H
+/*
+ Low level TCP "bottom half" implementation, for use by transports built on
+ top of a TCP connection.
+
+ Note that this file does not (yet) include APIs for creating the socket in
+ the first place.
+
+ All calls passing slice transfer ownership of a slice refcount unless
+ otherwise specified.
+*/
+
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_CFSTREAM
+
+#import <CoreFoundation/CoreFoundation.h>
+
+#include "src/core/lib/debug/trace.h"
+#include "src/core/lib/iomgr/cfstream_handle.h"
+#include "src/core/lib/iomgr/endpoint.h"
+
+grpc_endpoint* grpc_cfstream_endpoint_create(
+ CFReadStreamRef read_stream, CFWriteStreamRef write_stream,
+ const char* peer_string, grpc_resource_quota* resource_quota,
+ CFStreamHandle* stream_sync);
+
+#endif /* GRPC_CFSTREAM */
+
+#endif /* GRPC_CORE_LIB_IOMGR_ENDPOINT_CFSTREAM_H */
diff --git a/src/core/lib/iomgr/endpoint_pair_posix.cc b/src/core/lib/iomgr/endpoint_pair_posix.cc
index 49850ab3a1..5c5c246f99 100644
--- a/src/core/lib/iomgr/endpoint_pair_posix.cc
+++ b/src/core/lib/iomgr/endpoint_pair_posix.cc
@@ -59,11 +59,11 @@ grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(const char* name,
grpc_core::ExecCtx exec_ctx;
gpr_asprintf(&final_name, "%s:client", name);
- p.client = grpc_tcp_create(grpc_fd_create(sv[1], final_name), args,
+ p.client = grpc_tcp_create(grpc_fd_create(sv[1], final_name, false), args,
"socketpair-server");
gpr_free(final_name);
gpr_asprintf(&final_name, "%s:server", name);
- p.server = grpc_tcp_create(grpc_fd_create(sv[0], final_name), args,
+ p.server = grpc_tcp_create(grpc_fd_create(sv[0], final_name, false), args,
"socketpair-client");
gpr_free(final_name);
diff --git a/src/core/lib/iomgr/error.cc b/src/core/lib/iomgr/error.cc
index 4088cf612e..90ed34da11 100644
--- a/src/core/lib/iomgr/error.cc
+++ b/src/core/lib/iomgr/error.cc
@@ -312,6 +312,12 @@ static void internal_add_error(grpc_error** err, grpc_error* new_err) {
// It is very common to include and extra int and string in an error
#define SURPLUS_CAPACITY (2 * SLOTS_PER_INT + SLOTS_PER_TIME)
+static bool g_error_creation_allowed = true;
+
+void grpc_disable_error_creation() { g_error_creation_allowed = false; }
+
+void grpc_enable_error_creation() { g_error_creation_allowed = true; }
+
grpc_error* grpc_error_create(const char* file, int line, grpc_slice desc,
grpc_error** referencing,
size_t num_referencing) {
@@ -326,6 +332,12 @@ grpc_error* grpc_error_create(const char* file, int line, grpc_slice desc,
return GRPC_ERROR_OOM;
}
#ifndef NDEBUG
+ if (!g_error_creation_allowed) {
+ gpr_log(GPR_ERROR,
+ "Error creation occurred when error creation was disabled [%s:%d]",
+ file, line);
+ abort();
+ }
if (grpc_trace_error_refcount.enabled()) {
gpr_log(GPR_DEBUG, "%p create [%s:%d]", err, file, line);
}
diff --git a/src/core/lib/iomgr/error.h b/src/core/lib/iomgr/error.h
index f8cae4da82..27c4d22fd1 100644
--- a/src/core/lib/iomgr/error.h
+++ b/src/core/lib/iomgr/error.h
@@ -123,6 +123,11 @@ typedef enum {
#define GRPC_ERROR_OOM ((grpc_error*)2)
#define GRPC_ERROR_CANCELLED ((grpc_error*)4)
+// debug only toggles that allow for a sanity to check that ensures we will
+// never create any errors in the per-RPC hotpath.
+void grpc_disable_error_creation();
+void grpc_enable_error_creation();
+
const char* grpc_error_string(grpc_error* error);
/// Create an error - but use GRPC_ERROR_CREATE instead
diff --git a/src/core/lib/iomgr/error_cfstream.cc b/src/core/lib/iomgr/error_cfstream.cc
new file mode 100644
index 0000000000..d7af8c377f
--- /dev/null
+++ b/src/core/lib/iomgr/error_cfstream.cc
@@ -0,0 +1,52 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_CFSTREAM
+#include <CoreFoundation/CoreFoundation.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/iomgr/error.h"
+
+#define MAX_ERROR_DESCRIPTION 256
+
+grpc_error* grpc_error_create_from_cferror(const char* file, int line,
+ void* arg, const char* custom_desc) {
+ CFErrorRef error = static_cast<CFErrorRef>(arg);
+ char buf_domain[MAX_ERROR_DESCRIPTION];
+ char buf_desc[MAX_ERROR_DESCRIPTION];
+ char* error_msg;
+ CFErrorDomain domain = CFErrorGetDomain((error));
+ CFIndex code = CFErrorGetCode((error));
+ CFStringRef desc = CFErrorCopyDescription((error));
+ CFStringGetCString(domain, buf_domain, MAX_ERROR_DESCRIPTION,
+ kCFStringEncodingUTF8);
+ CFStringGetCString(desc, buf_desc, MAX_ERROR_DESCRIPTION,
+ kCFStringEncodingUTF8);
+ gpr_asprintf(&error_msg, "%s (error domain:%s, code:%ld, description:%s)",
+ custom_desc, buf_domain, code, buf_desc);
+ CFRelease(desc);
+ grpc_error* return_error = grpc_error_create(
+ file, line, grpc_slice_from_copied_string(error_msg), NULL, 0);
+ gpr_free(error_msg);
+ return return_error;
+}
+#endif /* GRPC_CFSTREAM */
diff --git a/src/core/lib/iomgr/error_cfstream.h b/src/core/lib/iomgr/error_cfstream.h
new file mode 100644
index 0000000000..06ab751329
--- /dev/null
+++ b/src/core/lib/iomgr/error_cfstream.h
@@ -0,0 +1,31 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPC_CORE_LIB_IOMGR_ERROR_CFSTREAM_H
+#define GRPC_CORE_LIB_IOMGR_ERROR_CFSTREAM_H
+
+#ifdef GRPC_CFSTREAM
+// Create an error from Apple Core Foundation CFError object
+#define GRPC_ERROR_CREATE_FROM_CFERROR(error, desc) \
+ grpc_error_create_from_cferror(__FILE__, __LINE__, \
+ static_cast<void*>((error)), (desc))
+grpc_error* grpc_error_create_from_cferror(const char* file, int line,
+ void* arg, const char* desc);
+#endif /* GRPC_CFSTREAM */
+
+#endif /* GRPC_CORE_LIB_IOMGR_ERROR_CFSTREAM_H */
diff --git a/src/core/lib/iomgr/ev_epoll1_linux.cc b/src/core/lib/iomgr/ev_epoll1_linux.cc
index e5db1be0e0..86a0243d2e 100644
--- a/src/core/lib/iomgr/ev_epoll1_linux.cc
+++ b/src/core/lib/iomgr/ev_epoll1_linux.cc
@@ -136,6 +136,7 @@ struct grpc_fd {
grpc_core::ManualConstructor<grpc_core::LockfreeEvent> read_closure;
grpc_core::ManualConstructor<grpc_core::LockfreeEvent> write_closure;
+ grpc_core::ManualConstructor<grpc_core::LockfreeEvent> error_closure;
struct grpc_fd* freelist_next;
@@ -272,7 +273,7 @@ static void fd_global_shutdown(void) {
gpr_mu_destroy(&fd_freelist_mu);
}
-static grpc_fd* fd_create(int fd, const char* name) {
+static grpc_fd* fd_create(int fd, const char* name, bool track_err) {
grpc_fd* new_fd = nullptr;
gpr_mu_lock(&fd_freelist_mu);
@@ -286,11 +287,12 @@ static grpc_fd* fd_create(int fd, const char* name) {
new_fd = static_cast<grpc_fd*>(gpr_malloc(sizeof(grpc_fd)));
new_fd->read_closure.Init();
new_fd->write_closure.Init();
+ new_fd->error_closure.Init();
}
-
new_fd->fd = fd;
new_fd->read_closure->InitEvent();
new_fd->write_closure->InitEvent();
+ new_fd->error_closure->InitEvent();
gpr_atm_no_barrier_store(&new_fd->read_notifier_pollset, (gpr_atm)NULL);
new_fd->freelist_next = nullptr;
@@ -307,7 +309,13 @@ static grpc_fd* fd_create(int fd, const char* name) {
struct epoll_event ev;
ev.events = static_cast<uint32_t>(EPOLLIN | EPOLLOUT | EPOLLET);
- ev.data.ptr = new_fd;
+ /* Use the least significant bit of ev.data.ptr to store track_err. We expect
+ * the addresses to be word aligned. We need to store track_err to avoid
+ * synchronization issues when accessing it after receiving an event.
+ * Accessing fd would be a data race there because the fd might have been
+ * returned to the free list at that point. */
+ ev.data.ptr = reinterpret_cast<void*>(reinterpret_cast<intptr_t>(new_fd) |
+ (track_err ? 1 : 0));
if (epoll_ctl(g_epoll_set.epfd, EPOLL_CTL_ADD, fd, &ev) != 0) {
gpr_log(GPR_ERROR, "epoll_ctl failed: %s", strerror(errno));
}
@@ -327,6 +335,7 @@ static void fd_shutdown_internal(grpc_fd* fd, grpc_error* why,
shutdown(fd->fd, SHUT_RDWR);
}
fd->write_closure->SetShutdown(GRPC_ERROR_REF(why));
+ fd->error_closure->SetShutdown(GRPC_ERROR_REF(why));
}
GRPC_ERROR_UNREF(why);
}
@@ -337,7 +346,7 @@ static void fd_shutdown(grpc_fd* fd, grpc_error* why) {
}
static void fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
- bool already_closed, const char* reason) {
+ const char* reason) {
grpc_error* error = GRPC_ERROR_NONE;
bool is_release_fd = (release_fd != nullptr);
@@ -350,7 +359,7 @@ static void fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
descriptor fd->fd (but we still own the grpc_fd structure). */
if (is_release_fd) {
*release_fd = fd->fd;
- } else if (!already_closed) {
+ } else {
close(fd->fd);
}
@@ -359,6 +368,7 @@ static void fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
grpc_iomgr_unregister_object(&fd->iomgr_object);
fd->read_closure->DestroyEvent();
fd->write_closure->DestroyEvent();
+ fd->error_closure->DestroyEvent();
gpr_mu_lock(&fd_freelist_mu);
fd->freelist_next = fd_freelist;
@@ -383,6 +393,10 @@ static void fd_notify_on_write(grpc_fd* fd, grpc_closure* closure) {
fd->write_closure->NotifyOn(closure);
}
+static void fd_notify_on_error(grpc_fd* fd, grpc_closure* closure) {
+ fd->error_closure->NotifyOn(closure);
+}
+
static void fd_become_readable(grpc_fd* fd, grpc_pollset* notifier) {
fd->read_closure->SetReady();
/* Use release store to match with acquire load in fd_get_read_notifier */
@@ -391,6 +405,8 @@ static void fd_become_readable(grpc_fd* fd, grpc_pollset* notifier) {
static void fd_become_writable(grpc_fd* fd) { fd->write_closure->SetReady(); }
+static void fd_has_errors(grpc_fd* fd) { fd->error_closure->SetReady(); }
+
/*******************************************************************************
* Pollset Definitions
*/
@@ -611,16 +627,25 @@ static grpc_error* process_epoll_events(grpc_pollset* pollset) {
append_error(&error, grpc_wakeup_fd_consume_wakeup(&global_wakeup_fd),
err_desc);
} else {
- grpc_fd* fd = static_cast<grpc_fd*>(data_ptr);
- bool cancel = (ev->events & (EPOLLERR | EPOLLHUP)) != 0;
+ grpc_fd* fd = reinterpret_cast<grpc_fd*>(
+ reinterpret_cast<intptr_t>(data_ptr) & ~static_cast<intptr_t>(1));
+ bool track_err =
+ reinterpret_cast<intptr_t>(data_ptr) & static_cast<intptr_t>(1);
+ bool cancel = (ev->events & EPOLLHUP) != 0;
+ bool error = (ev->events & EPOLLERR) != 0;
bool read_ev = (ev->events & (EPOLLIN | EPOLLPRI)) != 0;
bool write_ev = (ev->events & EPOLLOUT) != 0;
+ bool err_fallback = error && !track_err;
+
+ if (error && !err_fallback) {
+ fd_has_errors(fd);
+ }
- if (read_ev || cancel) {
+ if (read_ev || cancel || err_fallback) {
fd_become_readable(fd, pollset);
}
- if (write_ev || cancel) {
+ if (write_ev || cancel || err_fallback) {
fd_become_writable(fd);
}
}
@@ -1183,6 +1208,7 @@ static void shutdown_engine(void) {
static const grpc_event_engine_vtable vtable = {
sizeof(grpc_pollset),
+ true,
fd_create,
fd_wrapped_fd,
@@ -1190,6 +1216,7 @@ static const grpc_event_engine_vtable vtable = {
fd_shutdown,
fd_notify_on_read,
fd_notify_on_write,
+ fd_notify_on_error,
fd_is_shutdown,
fd_get_read_notifier_pollset,
@@ -1237,12 +1264,12 @@ const grpc_event_engine_vtable* grpc_init_epoll1_linux(bool explicit_request) {
}
#else /* defined(GRPC_LINUX_EPOLL) */
-#if defined(GRPC_POSIX_SOCKET)
+#if defined(GRPC_POSIX_SOCKET_EV_EPOLL1)
#include "src/core/lib/iomgr/ev_epoll1_linux.h"
/* If GRPC_LINUX_EPOLL is not defined, it means epoll is not available. Return
* NULL */
const grpc_event_engine_vtable* grpc_init_epoll1_linux(bool explicit_request) {
return nullptr;
}
-#endif /* defined(GRPC_POSIX_SOCKET) */
+#endif /* defined(GRPC_POSIX_SOCKET_EV_EPOLL1) */
#endif /* !defined(GRPC_LINUX_EPOLL) */
diff --git a/src/core/lib/iomgr/ev_epollex_linux.cc b/src/core/lib/iomgr/ev_epollex_linux.cc
index 12f23ea1d6..5ffabdc665 100644
--- a/src/core/lib/iomgr/ev_epollex_linux.cc
+++ b/src/core/lib/iomgr/ev_epollex_linux.cc
@@ -33,6 +33,7 @@
#include <poll.h>
#include <pthread.h>
#include <string.h>
+#include <sys/epoll.h>
#include <sys/socket.h>
#include <sys/syscall.h>
#include <unistd.h>
@@ -63,7 +64,7 @@
// a keepalive ping timeout issue. We may want to revert https://github
// .com/grpc/grpc/pull/14943 once we figure out the root cause.
#define MAX_EPOLL_EVENTS_HANDLED_EACH_POLL_CALL 16
-#define MAX_PROBE_EPOLL_FDS 32
+#define MAX_FDS_IN_CACHE 32
grpc_core::DebugOnlyTraceFlag grpc_trace_pollable_refcount(false,
"pollable_refcount");
@@ -77,8 +78,14 @@ typedef enum { PO_MULTI, PO_FD, PO_EMPTY } pollable_type;
typedef struct pollable pollable;
typedef struct cached_fd {
+ // Set to the grpc_fd's salt value. See 'salt' variable' in grpc_fd for more
+ // details
intptr_t salt;
+
+ // The underlying fd
int fd;
+
+ // A recency time counter that helps to determine the LRU fd in the cache
uint64_t last_used;
} cached_fd;
@@ -97,8 +104,10 @@ struct pollable {
int epfd;
grpc_wakeup_fd wakeup;
- // only for type fd... one ref to the owner fd
- grpc_fd* owner_fd;
+ // The following are relevant only for type PO_FD
+ grpc_fd* owner_fd; // Set to the owner_fd if the type is PO_FD
+ gpr_mu owner_orphan_mu; // Synchronizes access to owner_orphaned field
+ bool owner_orphaned; // Is the owner fd orphaned
grpc_pollset_set* pollset_set;
pollable* next;
@@ -111,10 +120,32 @@ struct pollable {
int event_count;
struct epoll_event events[MAX_EPOLL_EVENTS];
- // Maintain a LRU-eviction cache of fds in this pollable
- cached_fd fd_cache[MAX_PROBE_EPOLL_FDS];
+ // We may be calling pollable_add_fd() on the same (pollable, fd) multiple
+ // times. To prevent pollable_add_fd() from making multiple sys calls to
+ // epoll_ctl() to add the fd, we maintain a cache of what fds are already
+ // present in the underlying epoll-set.
+ //
+ // Since this is not a correctness issue, we do not need to maintain all the
+ // fds in the cache. Hence we just use an LRU cache of size 'MAX_FDS_IN_CACHE'
+ //
+ // NOTE: An ideal implementation of this should do the following:
+ // 1) Add fds to the cache in pollable_add_fd() function (i.e whenever the fd
+ // is added to the pollable's epoll set)
+ // 2) Remove the fd from the cache whenever the fd is removed from the
+ // underlying epoll set (i.e whenever fd_orphan() is called).
+ //
+ // Implementing (2) above (i.e removing fds from cache on fd_orphan) adds a
+ // lot of complexity since an fd can be present in multiple pollalbles. So our
+ // implementation ONLY DOES (1) and NOT (2).
+ //
+ // The cache_fd.salt variable helps here to maintain correctness (it serves as
+ // an epoch that differentiates one grpc_fd from the other even though both of
+ // them may have the same fd number)
+ //
+ // The following implements LRU-eviction cache of fds in this pollable
+ cached_fd fd_cache[MAX_FDS_IN_CACHE];
int fd_cache_size;
- uint64_t fd_cache_counter;
+ uint64_t fd_cache_counter; // Recency timer tick counter
};
static const char* pollable_type_string(pollable_type t) {
@@ -157,15 +188,24 @@ static void pollable_unref(pollable* p, int line, const char* reason);
* Fd Declarations
*/
+// Monotonically increasing Epoch counter that is assinged to each grpc_fd. See
+// the description of 'salt' variable in 'grpc_fd' for more details
+// TODO: (sreek/kpayson) gpr_atm is intptr_t which may not be wide-enough on
+// 32-bit systems. Change this to int_64 - atleast on 32-bit systems
static gpr_atm g_fd_salt;
struct grpc_fd {
int fd;
+
+ // Since fd numbers can be reused (after old fds are closed), this serves as
+ // an epoch that uniquely identifies this fd (i.e the pair (salt, fd) is
+ // unique (until the salt counter (i.e g_fd_salt) overflows)
intptr_t salt;
- /* refst format:
- bit 0 : 1=Active / 0=Orphaned
- bits 1-n : refcount
- Ref/Unref by two to avoid altering the orphaned bit */
+
+ // refst format:
+ // bit 0 : 1=Active / 0=Orphaned
+ // bits 1-n : refcount
+ // Ref/Unref by two to avoid altering the orphaned bit
gpr_atm refst;
gpr_mu orphan_mu;
@@ -175,15 +215,19 @@ struct grpc_fd {
grpc_core::ManualConstructor<grpc_core::LockfreeEvent> read_closure;
grpc_core::ManualConstructor<grpc_core::LockfreeEvent> write_closure;
+ grpc_core::ManualConstructor<grpc_core::LockfreeEvent> error_closure;
struct grpc_fd* freelist_next;
grpc_closure* on_done_closure;
- /* The pollset that last noticed that the fd is readable. The actual type
- * stored in this is (grpc_pollset *) */
+ // The pollset that last noticed that the fd is readable. The actual type
+ // stored in this is (grpc_pollset *)
gpr_atm read_notifier_pollset;
grpc_iomgr_object iomgr_object;
+
+ // Do we need to track EPOLLERR events separately?
+ bool track_err;
};
static void fd_global_init(void);
@@ -296,20 +340,45 @@ static void ref_by(grpc_fd* fd, int n) {
GPR_ASSERT(gpr_atm_no_barrier_fetch_add(&fd->refst, n) > 0);
}
+#ifndef NDEBUG
+#define INVALIDATE_FD(fd) invalidate_fd(fd)
+/* Since an fd is never really destroyed (i.e gpr_free() is not called), it is
+ * hard to cases where fd fields are accessed even after calling fd_destroy().
+ * The following invalidates fd fields to make catching such errors easier */
+static void invalidate_fd(grpc_fd* fd) {
+ fd->fd = -1;
+ fd->salt = -1;
+ gpr_atm_no_barrier_store(&fd->refst, -1);
+ memset(&fd->orphan_mu, -1, sizeof(fd->orphan_mu));
+ memset(&fd->pollable_mu, -1, sizeof(fd->pollable_mu));
+ fd->pollable_obj = nullptr;
+ fd->on_done_closure = nullptr;
+ gpr_atm_no_barrier_store(&fd->read_notifier_pollset, 0);
+ memset(&fd->iomgr_object, -1, sizeof(fd->iomgr_object));
+ fd->track_err = false;
+}
+#else
+#define INVALIDATE_FD(fd)
+#endif
+
+/* Uninitialize and add to the freelist */
static void fd_destroy(void* arg, grpc_error* error) {
grpc_fd* fd = static_cast<grpc_fd*>(arg);
- /* Add the fd to the freelist */
grpc_iomgr_unregister_object(&fd->iomgr_object);
POLLABLE_UNREF(fd->pollable_obj, "fd_pollable");
gpr_mu_destroy(&fd->pollable_mu);
gpr_mu_destroy(&fd->orphan_mu);
- gpr_mu_lock(&fd_freelist_mu);
- fd->freelist_next = fd_freelist;
- fd_freelist = fd;
fd->read_closure->DestroyEvent();
fd->write_closure->DestroyEvent();
+ fd->error_closure->DestroyEvent();
+
+ INVALIDATE_FD(fd);
+ /* Add the fd to the freelist */
+ gpr_mu_lock(&fd_freelist_mu);
+ fd->freelist_next = fd_freelist;
+ fd_freelist = fd;
gpr_mu_unlock(&fd_freelist_mu);
}
@@ -348,7 +417,7 @@ static void fd_global_shutdown(void) {
gpr_mu_destroy(&fd_freelist_mu);
}
-static grpc_fd* fd_create(int fd, const char* name) {
+static grpc_fd* fd_create(int fd, const char* name, bool track_err) {
grpc_fd* new_fd = nullptr;
gpr_mu_lock(&fd_freelist_mu);
@@ -362,20 +431,21 @@ static grpc_fd* fd_create(int fd, const char* name) {
new_fd = static_cast<grpc_fd*>(gpr_malloc(sizeof(grpc_fd)));
new_fd->read_closure.Init();
new_fd->write_closure.Init();
+ new_fd->error_closure.Init();
}
- gpr_mu_init(&new_fd->pollable_mu);
- gpr_mu_init(&new_fd->orphan_mu);
- new_fd->pollable_obj = nullptr;
- gpr_atm_rel_store(&new_fd->refst, (gpr_atm)1);
new_fd->fd = fd;
new_fd->salt = gpr_atm_no_barrier_fetch_add(&g_fd_salt, 1);
+ gpr_atm_rel_store(&new_fd->refst, (gpr_atm)1);
+ gpr_mu_init(&new_fd->orphan_mu);
+ gpr_mu_init(&new_fd->pollable_mu);
+ new_fd->pollable_obj = nullptr;
new_fd->read_closure->InitEvent();
new_fd->write_closure->InitEvent();
- gpr_atm_no_barrier_store(&new_fd->read_notifier_pollset, (gpr_atm)NULL);
-
+ new_fd->error_closure->InitEvent();
new_fd->freelist_next = nullptr;
new_fd->on_done_closure = nullptr;
+ gpr_atm_no_barrier_store(&new_fd->read_notifier_pollset, (gpr_atm)NULL);
char* fd_name;
gpr_asprintf(&fd_name, "%s fd=%d", name, fd);
@@ -386,6 +456,8 @@ static grpc_fd* fd_create(int fd, const char* name) {
}
#endif
gpr_free(fd_name);
+
+ new_fd->track_err = track_err;
return new_fd;
}
@@ -395,18 +467,29 @@ static int fd_wrapped_fd(grpc_fd* fd) {
}
static void fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
- bool already_closed, const char* reason) {
- bool is_fd_closed = already_closed;
+ const char* reason) {
+ bool is_fd_closed = false;
gpr_mu_lock(&fd->orphan_mu);
+ // Get the fd->pollable_obj and set the owner_orphaned on that pollable to
+ // true so that the pollable will no longer access its owner_fd field.
+ gpr_mu_lock(&fd->pollable_mu);
+ pollable* pollable_obj = fd->pollable_obj;
+ gpr_mu_unlock(&fd->pollable_mu);
+
+ if (pollable_obj) {
+ gpr_mu_lock(&pollable_obj->owner_orphan_mu);
+ pollable_obj->owner_orphaned = true;
+ }
+
fd->on_done_closure = on_done;
/* If release_fd is not NULL, we should be relinquishing control of the file
descriptor fd->fd (but we still own the grpc_fd structure). */
if (release_fd != nullptr) {
*release_fd = fd->fd;
- } else if (!is_fd_closed) {
+ } else {
close(fd->fd);
is_fd_closed = true;
}
@@ -421,6 +504,10 @@ static void fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
GRPC_CLOSURE_SCHED(fd->on_done_closure, GRPC_ERROR_NONE);
+ if (pollable_obj) {
+ gpr_mu_unlock(&pollable_obj->owner_orphan_mu);
+ }
+
gpr_mu_unlock(&fd->orphan_mu);
UNREF_BY(fd, 2, reason); /* Drop the reference */
@@ -438,8 +525,14 @@ static bool fd_is_shutdown(grpc_fd* fd) {
/* Might be called multiple times */
static void fd_shutdown(grpc_fd* fd, grpc_error* why) {
if (fd->read_closure->SetShutdown(GRPC_ERROR_REF(why))) {
- shutdown(fd->fd, SHUT_RDWR);
+ if (shutdown(fd->fd, SHUT_RDWR)) {
+ if (errno != ENOTCONN) {
+ gpr_log(GPR_ERROR, "Error shutting down fd %d. errno: %d",
+ grpc_fd_wrapped_fd(fd), errno);
+ }
+ }
fd->write_closure->SetShutdown(GRPC_ERROR_REF(why));
+ fd->error_closure->SetShutdown(GRPC_ERROR_REF(why));
}
GRPC_ERROR_UNREF(why);
}
@@ -452,6 +545,10 @@ static void fd_notify_on_write(grpc_fd* fd, grpc_closure* closure) {
fd->write_closure->NotifyOn(closure);
}
+static void fd_notify_on_error(grpc_fd* fd, grpc_closure* closure) {
+ fd->error_closure->NotifyOn(closure);
+}
+
/*******************************************************************************
* Pollable Definitions
*/
@@ -495,6 +592,8 @@ static grpc_error* pollable_create(pollable_type type, pollable** p) {
gpr_mu_init(&(*p)->mu);
(*p)->epfd = epfd;
(*p)->owner_fd = nullptr;
+ gpr_mu_init(&(*p)->owner_orphan_mu);
+ (*p)->owner_orphaned = false;
(*p)->pollset_set = nullptr;
(*p)->next = (*p)->prev = *p;
(*p)->root_worker = nullptr;
@@ -534,6 +633,7 @@ static void pollable_unref(pollable* p, int line, const char* reason) {
GRPC_FD_TRACE("pollable_unref: Closing epfd: %d", p->epfd);
close(p->epfd);
grpc_wakeup_fd_destroy(&p->wakeup);
+ gpr_mu_destroy(&p->owner_orphan_mu);
gpr_free(p);
}
}
@@ -544,6 +644,7 @@ static grpc_error* pollable_add_fd(pollable* p, grpc_fd* fd) {
const int epfd = p->epfd;
gpr_mu_lock(&p->mu);
p->fd_cache_counter++;
+
// Handle the case of overflow for our cache counter by
// reseting the recency-counter on all cache objects
if (p->fd_cache_counter == 0) {
@@ -563,8 +664,9 @@ static grpc_error* pollable_add_fd(pollable* p, grpc_fd* fd) {
lru_idx = i;
}
}
+
// Add to cache
- if (p->fd_cache_size < MAX_PROBE_EPOLL_FDS) {
+ if (p->fd_cache_size < MAX_FDS_IN_CACHE) {
lru_idx = p->fd_cache_size;
p->fd_cache_size++;
}
@@ -572,6 +674,7 @@ static grpc_error* pollable_add_fd(pollable* p, grpc_fd* fd) {
p->fd_cache[lru_idx].salt = fd->salt;
p->fd_cache[lru_idx].last_used = p->fd_cache_counter;
gpr_mu_unlock(&p->mu);
+
if (grpc_polling_trace.enabled()) {
gpr_log(GPR_INFO, "add fd %p (%d) to pollable %p", fd, fd->fd, p);
}
@@ -579,7 +682,12 @@ static grpc_error* pollable_add_fd(pollable* p, grpc_fd* fd) {
struct epoll_event ev_fd;
ev_fd.events =
static_cast<uint32_t>(EPOLLET | EPOLLIN | EPOLLOUT | EPOLLEXCLUSIVE);
- ev_fd.data.ptr = fd;
+ /* Use the second least significant bit of ev_fd.data.ptr to store track_err
+ * to avoid synchronization issues when accessing it after receiving an event.
+ * Accessing fd would be a data race there because the fd might have been
+ * returned to the free list at that point. */
+ ev_fd.data.ptr = reinterpret_cast<void*>(reinterpret_cast<intptr_t>(fd) |
+ (fd->track_err ? 2 : 0));
GRPC_STATS_INC_SYSCALL_EPOLL_CTL();
if (epoll_ctl(epfd, EPOLL_CTL_ADD, fd->fd, &ev_fd) != 0) {
switch (errno) {
@@ -780,10 +888,17 @@ static void fd_become_readable(grpc_fd* fd, grpc_pollset* notifier) {
static void fd_become_writable(grpc_fd* fd) { fd->write_closure->SetReady(); }
-static grpc_error* fd_get_or_become_pollable(grpc_fd* fd, pollable** p) {
+static void fd_has_errors(grpc_fd* fd) { fd->error_closure->SetReady(); }
+
+/* Get the pollable_obj attached to this fd. If none is attached, create a new
+ * pollable object (of type PO_FD), attach it to the fd and return it
+ *
+ * Note that if a pollable object is already attached to the fd, it may be of
+ * either PO_FD or PO_MULTI type */
+static grpc_error* get_fd_pollable(grpc_fd* fd, pollable** p) {
gpr_mu_lock(&fd->pollable_mu);
grpc_error* error = GRPC_ERROR_NONE;
- static const char* err_desc = "fd_get_or_become_pollable";
+ static const char* err_desc = "get_fd_pollable";
if (fd->pollable_obj == nullptr) {
if (append_error(&error, pollable_create(PO_FD, &fd->pollable_obj),
err_desc)) {
@@ -848,20 +963,28 @@ static grpc_error* pollable_process_events(grpc_pollset* pollset,
(intptr_t)data_ptr)),
err_desc);
} else {
- grpc_fd* fd = static_cast<grpc_fd*>(data_ptr);
- bool cancel = (ev->events & (EPOLLERR | EPOLLHUP)) != 0;
+ grpc_fd* fd =
+ reinterpret_cast<grpc_fd*>(reinterpret_cast<intptr_t>(data_ptr) & ~2);
+ bool track_err = reinterpret_cast<intptr_t>(data_ptr) & 2;
+ bool cancel = (ev->events & EPOLLHUP) != 0;
+ bool error = (ev->events & EPOLLERR) != 0;
bool read_ev = (ev->events & (EPOLLIN | EPOLLPRI)) != 0;
bool write_ev = (ev->events & EPOLLOUT) != 0;
+ bool err_fallback = error && !track_err;
+
if (grpc_polling_trace.enabled()) {
gpr_log(GPR_INFO,
"PS:%p got fd %p: cancel=%d read=%d "
"write=%d",
pollset, fd, cancel, read_ev, write_ev);
}
- if (read_ev || cancel) {
+ if (error && !err_fallback) {
+ fd_has_errors(fd);
+ }
+ if (read_ev || cancel || err_fallback) {
fd_become_readable(fd, pollset);
}
- if (write_ev || cancel) {
+ if (write_ev || cancel || err_fallback) {
fd_become_writable(fd);
}
}
@@ -1112,7 +1235,7 @@ static grpc_error* pollset_transition_pollable_from_empty_to_fd_locked(
}
append_error(&error, pollset_kick_all(pollset), err_desc);
POLLABLE_UNREF(pollset->active_pollable, "pollset");
- append_error(&error, fd_get_or_become_pollable(fd, &pollset->active_pollable),
+ append_error(&error, get_fd_pollable(fd, &pollset->active_pollable),
err_desc);
return error;
}
@@ -1156,9 +1279,8 @@ static grpc_error* pollset_add_fd_locked(grpc_pollset* pollset, grpc_fd* fd) {
error = pollset_transition_pollable_from_empty_to_fd_locked(pollset, fd);
break;
case PO_FD:
- gpr_mu_lock(&po_at_start->owner_fd->orphan_mu);
- if ((gpr_atm_no_barrier_load(&pollset->active_pollable->owner_fd->refst) &
- 1) == 0) {
+ gpr_mu_lock(&po_at_start->owner_orphan_mu);
+ if (po_at_start->owner_orphaned) {
error =
pollset_transition_pollable_from_empty_to_fd_locked(pollset, fd);
} else {
@@ -1166,7 +1288,7 @@ static grpc_error* pollset_add_fd_locked(grpc_pollset* pollset, grpc_fd* fd) {
error =
pollset_transition_pollable_from_fd_to_multi_locked(pollset, fd);
}
- gpr_mu_unlock(&po_at_start->owner_fd->orphan_mu);
+ gpr_mu_unlock(&po_at_start->owner_orphan_mu);
break;
case PO_MULTI:
error = pollable_add_fd(pollset->active_pollable, fd);
@@ -1202,16 +1324,17 @@ static grpc_error* pollset_as_multipollable_locked(grpc_pollset* pollset,
append_error(&error, pollset_kick_all(pollset), err_desc);
break;
case PO_FD:
- gpr_mu_lock(&po_at_start->owner_fd->orphan_mu);
- if ((gpr_atm_no_barrier_load(&pollset->active_pollable->owner_fd->refst) &
- 1) == 0) {
+ gpr_mu_lock(&po_at_start->owner_orphan_mu);
+ if (po_at_start->owner_orphaned) {
+ // Unlock before Unref'ing the pollable
+ gpr_mu_unlock(&po_at_start->owner_orphan_mu);
POLLABLE_UNREF(pollset->active_pollable, "pollset");
error = pollable_create(PO_MULTI, &pollset->active_pollable);
} else {
error = pollset_transition_pollable_from_fd_to_multi_locked(pollset,
nullptr);
+ gpr_mu_unlock(&po_at_start->owner_orphan_mu);
}
- gpr_mu_unlock(&po_at_start->owner_fd->orphan_mu);
break;
case PO_MULTI:
break;
@@ -1503,6 +1626,7 @@ static void shutdown_engine(void) {
static const grpc_event_engine_vtable vtable = {
sizeof(grpc_pollset),
+ true,
fd_create,
fd_wrapped_fd,
@@ -1510,6 +1634,7 @@ static const grpc_event_engine_vtable vtable = {
fd_shutdown,
fd_notify_on_read,
fd_notify_on_write,
+ fd_notify_on_error,
fd_is_shutdown,
fd_get_read_notifier_pollset,
@@ -1556,7 +1681,7 @@ const grpc_event_engine_vtable* grpc_init_epollex_linux(
}
#else /* defined(GRPC_LINUX_EPOLL_CREATE1) */
-#if defined(GRPC_POSIX_SOCKET)
+#if defined(GRPC_POSIX_SOCKET_EV_EPOLLEX)
#include "src/core/lib/iomgr/ev_epollex_linux.h"
/* If GRPC_LINUX_EPOLL_CREATE1 is not defined, it means
epoll_create1 is not available. Return NULL */
@@ -1564,6 +1689,6 @@ const grpc_event_engine_vtable* grpc_init_epollex_linux(
bool explicitly_requested) {
return nullptr;
}
-#endif /* defined(GRPC_POSIX_SOCKET) */
+#endif /* defined(GRPC_POSIX_SOCKET_EV_EPOLLEX) */
#endif /* !defined(GRPC_LINUX_EPOLL_CREATE1) */
diff --git a/src/core/lib/iomgr/ev_epollsig_linux.cc b/src/core/lib/iomgr/ev_epollsig_linux.cc
index 494bc71c1d..2189801c18 100644
--- a/src/core/lib/iomgr/ev_epollsig_linux.cc
+++ b/src/core/lib/iomgr/ev_epollsig_linux.cc
@@ -132,6 +132,7 @@ struct grpc_fd {
grpc_core::ManualConstructor<grpc_core::LockfreeEvent> read_closure;
grpc_core::ManualConstructor<grpc_core::LockfreeEvent> write_closure;
+ grpc_core::ManualConstructor<grpc_core::LockfreeEvent> error_closure;
struct grpc_fd* freelist_next;
grpc_closure* on_done_closure;
@@ -141,6 +142,9 @@ struct grpc_fd {
gpr_atm read_notifier_pollset;
grpc_iomgr_object iomgr_object;
+
+ /* Do we need to track EPOLLERR events separately? */
+ bool track_err;
};
/* Reference counting for fds */
@@ -352,7 +356,10 @@ static void polling_island_add_fds_locked(polling_island* pi, grpc_fd** fds,
for (i = 0; i < fd_count; i++) {
ev.events = static_cast<uint32_t>(EPOLLIN | EPOLLOUT | EPOLLET);
- ev.data.ptr = fds[i];
+ /* Use the least significant bit of ev.data.ptr to store track_err to avoid
+ * synchronization issues when accessing it after receiving an event */
+ ev.data.ptr = reinterpret_cast<void*>(reinterpret_cast<intptr_t>(fds[i]) |
+ (fds[i]->track_err ? 1 : 0));
err = epoll_ctl(pi->epoll_fd, EPOLL_CTL_ADD, fds[i]->fd, &ev);
if (err < 0) {
@@ -435,7 +442,6 @@ static void polling_island_remove_all_fds_locked(polling_island* pi,
/* The caller is expected to hold pi->mu lock before calling this function */
static void polling_island_remove_fd_locked(polling_island* pi, grpc_fd* fd,
- bool is_fd_closed,
grpc_error** error) {
int err;
size_t i;
@@ -444,16 +450,14 @@ static void polling_island_remove_fd_locked(polling_island* pi, grpc_fd* fd,
/* If fd is already closed, then it would have been automatically been removed
from the epoll set */
- if (!is_fd_closed) {
- err = epoll_ctl(pi->epoll_fd, EPOLL_CTL_DEL, fd->fd, nullptr);
- if (err < 0 && errno != ENOENT) {
- gpr_asprintf(
- &err_msg,
- "epoll_ctl (epoll_fd: %d) del fd: %d failed with error: %d (%s)",
- pi->epoll_fd, fd->fd, errno, strerror(errno));
- append_error(error, GRPC_OS_ERROR(errno, err_msg), err_desc);
- gpr_free(err_msg);
- }
+ err = epoll_ctl(pi->epoll_fd, EPOLL_CTL_DEL, fd->fd, nullptr);
+ if (err < 0 && errno != ENOENT) {
+ gpr_asprintf(
+ &err_msg,
+ "epoll_ctl (epoll_fd: %d) del fd: %d failed with error: %d (%s)",
+ pi->epoll_fd, fd->fd, errno, strerror(errno));
+ append_error(error, GRPC_OS_ERROR(errno, err_msg), err_desc);
+ gpr_free(err_msg);
}
for (i = 0; i < pi->fd_cnt; i++) {
@@ -769,6 +773,7 @@ static void unref_by(grpc_fd* fd, int n) {
fd->read_closure->DestroyEvent();
fd->write_closure->DestroyEvent();
+ fd->error_closure->DestroyEvent();
gpr_mu_unlock(&fd_freelist_mu);
} else {
@@ -806,7 +811,7 @@ static void fd_global_shutdown(void) {
gpr_mu_destroy(&fd_freelist_mu);
}
-static grpc_fd* fd_create(int fd, const char* name) {
+static grpc_fd* fd_create(int fd, const char* name, bool track_err) {
grpc_fd* new_fd = nullptr;
gpr_mu_lock(&fd_freelist_mu);
@@ -821,6 +826,7 @@ static grpc_fd* fd_create(int fd, const char* name) {
gpr_mu_init(&new_fd->po.mu);
new_fd->read_closure.Init();
new_fd->write_closure.Init();
+ new_fd->error_closure.Init();
}
/* Note: It is not really needed to get the new_fd->po.mu lock here. If this
@@ -837,6 +843,8 @@ static grpc_fd* fd_create(int fd, const char* name) {
new_fd->orphaned = false;
new_fd->read_closure->InitEvent();
new_fd->write_closure->InitEvent();
+ new_fd->error_closure->InitEvent();
+ new_fd->track_err = track_err;
gpr_atm_no_barrier_store(&new_fd->read_notifier_pollset, (gpr_atm)NULL);
new_fd->freelist_next = nullptr;
@@ -863,7 +871,7 @@ static int fd_wrapped_fd(grpc_fd* fd) {
}
static void fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
- bool already_closed, const char* reason) {
+ const char* reason) {
grpc_error* error = GRPC_ERROR_NONE;
polling_island* unref_pi = nullptr;
@@ -884,7 +892,7 @@ static void fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
before doing this.) */
if (fd->po.pi != nullptr) {
polling_island* pi_latest = polling_island_lock(fd->po.pi);
- polling_island_remove_fd_locked(pi_latest, fd, already_closed, &error);
+ polling_island_remove_fd_locked(pi_latest, fd, &error);
gpr_mu_unlock(&pi_latest->mu);
unref_pi = fd->po.pi;
@@ -933,6 +941,7 @@ static void fd_shutdown(grpc_fd* fd, grpc_error* why) {
if (fd->read_closure->SetShutdown(GRPC_ERROR_REF(why))) {
shutdown(fd->fd, SHUT_RDWR);
fd->write_closure->SetShutdown(GRPC_ERROR_REF(why));
+ fd->error_closure->SetShutdown(GRPC_ERROR_REF(why));
}
GRPC_ERROR_UNREF(why);
}
@@ -945,6 +954,10 @@ static void fd_notify_on_write(grpc_fd* fd, grpc_closure* closure) {
fd->write_closure->NotifyOn(closure);
}
+static void fd_notify_on_error(grpc_fd* fd, grpc_closure* closure) {
+ fd->error_closure->NotifyOn(closure);
+}
+
/*******************************************************************************
* Pollset Definitions
*/
@@ -1116,6 +1129,8 @@ static void fd_become_readable(grpc_fd* fd, grpc_pollset* notifier) {
static void fd_become_writable(grpc_fd* fd) { fd->write_closure->SetReady(); }
+static void fd_has_errors(grpc_fd* fd) { fd->error_closure->SetReady(); }
+
static void pollset_release_polling_island(grpc_pollset* ps,
const char* reason) {
if (ps->po.pi != nullptr) {
@@ -1254,14 +1269,23 @@ static void pollset_work_and_unlock(grpc_pollset* pollset,
to the function pollset_work_and_unlock() will pick up the correct
epoll_fd */
} else {
- grpc_fd* fd = static_cast<grpc_fd*>(data_ptr);
- int cancel = ep_ev[i].events & (EPOLLERR | EPOLLHUP);
- int read_ev = ep_ev[i].events & (EPOLLIN | EPOLLPRI);
- int write_ev = ep_ev[i].events & EPOLLOUT;
- if (read_ev || cancel) {
+ grpc_fd* fd = reinterpret_cast<grpc_fd*>(
+ reinterpret_cast<intptr_t>(data_ptr) & ~static_cast<intptr_t>(1));
+ bool track_err =
+ reinterpret_cast<intptr_t>(data_ptr) & ~static_cast<intptr_t>(1);
+ bool cancel = (ep_ev[i].events & EPOLLHUP) != 0;
+ bool error = (ep_ev[i].events & EPOLLERR) != 0;
+ bool read_ev = (ep_ev[i].events & (EPOLLIN | EPOLLPRI)) != 0;
+ bool write_ev = (ep_ev[i].events & EPOLLOUT) != 0;
+ bool err_fallback = error && !track_err;
+
+ if (error && !err_fallback) {
+ fd_has_errors(fd);
+ }
+ if (read_ev || cancel || err_fallback) {
fd_become_readable(fd, pollset);
}
- if (write_ev || cancel) {
+ if (write_ev || cancel || err_fallback) {
fd_become_writable(fd);
}
}
@@ -1634,6 +1658,7 @@ static void shutdown_engine(void) {
static const grpc_event_engine_vtable vtable = {
sizeof(grpc_pollset),
+ true,
fd_create,
fd_wrapped_fd,
@@ -1641,6 +1666,7 @@ static const grpc_event_engine_vtable vtable = {
fd_shutdown,
fd_notify_on_read,
fd_notify_on_write,
+ fd_notify_on_error,
fd_is_shutdown,
fd_get_read_notifier_pollset,
@@ -1721,7 +1747,7 @@ const grpc_event_engine_vtable* grpc_init_epollsig_linux(
}
#else /* defined(GRPC_LINUX_EPOLL_CREATE1) */
-#if defined(GRPC_POSIX_SOCKET)
+#if defined(GRPC_POSIX_SOCKET_EV_EPOLLSIG)
#include "src/core/lib/iomgr/ev_epollsig_linux.h"
/* If GRPC_LINUX_EPOLL_CREATE1 is not defined, it means
epoll_create1 is not available. Return NULL */
diff --git a/src/core/lib/iomgr/ev_poll_posix.cc b/src/core/lib/iomgr/ev_poll_posix.cc
index 504787e659..c9c09881a2 100644
--- a/src/core/lib/iomgr/ev_poll_posix.cc
+++ b/src/core/lib/iomgr/ev_poll_posix.cc
@@ -20,7 +20,7 @@
#include "src/core/lib/iomgr/port.h"
-#ifdef GRPC_POSIX_SOCKET
+#ifdef GRPC_POSIX_SOCKET_EV_POLL
#include "src/core/lib/iomgr/ev_poll_posix.h"
@@ -330,7 +330,8 @@ static void unref_by(grpc_fd* fd, int n) {
}
}
-static grpc_fd* fd_create(int fd, const char* name) {
+static grpc_fd* fd_create(int fd, const char* name, bool track_err) {
+ GPR_DEBUG_ASSERT(track_err == false);
grpc_fd* r = static_cast<grpc_fd*>(gpr_malloc(sizeof(*r)));
gpr_mu_init(&r->mu);
gpr_atm_rel_store(&r->refst, 1);
@@ -424,14 +425,12 @@ static int fd_wrapped_fd(grpc_fd* fd) {
}
static void fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
- bool already_closed, const char* reason) {
+ const char* reason) {
fd->on_done_closure = on_done;
fd->released = release_fd != nullptr;
if (release_fd != nullptr) {
*release_fd = fd->fd;
fd->released = true;
- } else if (already_closed) {
- fd->released = true;
}
gpr_mu_lock(&fd->mu);
REF_BY(fd, 1, reason); /* remove active status, but keep referenced */
@@ -553,6 +552,11 @@ static void fd_notify_on_write(grpc_fd* fd, grpc_closure* closure) {
gpr_mu_unlock(&fd->mu);
}
+static void fd_notify_on_error(grpc_fd* fd, grpc_closure* closure) {
+ gpr_log(GPR_ERROR, "Polling engine does not support tracking errors.");
+ abort();
+}
+
static uint32_t fd_begin_poll(grpc_fd* fd, grpc_pollset* pollset,
grpc_pollset_worker* worker, uint32_t read_mask,
uint32_t write_mask, grpc_fd_watcher* watcher) {
@@ -1710,6 +1714,7 @@ static void shutdown_engine(void) {
static const grpc_event_engine_vtable vtable = {
sizeof(grpc_pollset),
+ false,
fd_create,
fd_wrapped_fd,
@@ -1717,6 +1722,7 @@ static const grpc_event_engine_vtable vtable = {
fd_shutdown,
fd_notify_on_read,
fd_notify_on_write,
+ fd_notify_on_error,
fd_is_shutdown,
fd_get_read_notifier_pollset,
@@ -1761,4 +1767,4 @@ const grpc_event_engine_vtable* grpc_init_poll_cv_posix(bool explicit_request) {
return &vtable;
}
-#endif
+#endif /* GRPC_POSIX_SOCKET_EV_POLL */
diff --git a/src/core/lib/iomgr/ev_posix.cc b/src/core/lib/iomgr/ev_posix.cc
index 902dca934a..1139b3273a 100644
--- a/src/core/lib/iomgr/ev_posix.cc
+++ b/src/core/lib/iomgr/ev_posix.cc
@@ -20,7 +20,7 @@
#include "src/core/lib/iomgr/port.h"
-#ifdef GRPC_POSIX_SOCKET
+#ifdef GRPC_POSIX_SOCKET_EV
#include "src/core/lib/iomgr/ev_posix.h"
@@ -193,10 +193,15 @@ void grpc_event_engine_shutdown(void) {
g_event_engine = nullptr;
}
-grpc_fd* grpc_fd_create(int fd, const char* name) {
- GRPC_POLLING_API_TRACE("fd_create(%d, %s)", fd, name);
- GRPC_FD_TRACE("fd_create(%d, %s)", fd, name);
- return g_event_engine->fd_create(fd, name);
+bool grpc_event_engine_can_track_errors(void) {
+ return g_event_engine->can_track_err;
+}
+
+grpc_fd* grpc_fd_create(int fd, const char* name, bool track_err) {
+ GRPC_POLLING_API_TRACE("fd_create(%d, %s, %d)", fd, name, track_err);
+ GRPC_FD_TRACE("fd_create(%d, %s, %d)", fd, name, track_err);
+ GPR_DEBUG_ASSERT(!track_err || g_event_engine->can_track_err);
+ return g_event_engine->fd_create(fd, name, track_err);
}
int grpc_fd_wrapped_fd(grpc_fd* fd) {
@@ -204,13 +209,12 @@ int grpc_fd_wrapped_fd(grpc_fd* fd) {
}
void grpc_fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
- bool already_closed, const char* reason) {
- GRPC_POLLING_API_TRACE("fd_orphan(%d, %p, %p, %d, %s)",
- grpc_fd_wrapped_fd(fd), on_done, release_fd,
- already_closed, reason);
+ const char* reason) {
+ GRPC_POLLING_API_TRACE("fd_orphan(%d, %p, %p, %s)", grpc_fd_wrapped_fd(fd),
+ on_done, release_fd, reason);
GRPC_FD_TRACE("grpc_fd_orphan, fd:%d closed", grpc_fd_wrapped_fd(fd));
- g_event_engine->fd_orphan(fd, on_done, release_fd, already_closed, reason);
+ g_event_engine->fd_orphan(fd, on_done, release_fd, reason);
}
void grpc_fd_shutdown(grpc_fd* fd, grpc_error* why) {
@@ -231,6 +235,10 @@ void grpc_fd_notify_on_write(grpc_fd* fd, grpc_closure* closure) {
g_event_engine->fd_notify_on_write(fd, closure);
}
+void grpc_fd_notify_on_error(grpc_fd* fd, grpc_closure* closure) {
+ g_event_engine->fd_notify_on_error(fd, closure);
+}
+
static size_t pollset_size(void) { return g_event_engine->pollset_size; }
static void pollset_init(grpc_pollset* pollset, gpr_mu** mu) {
@@ -334,4 +342,4 @@ void grpc_pollset_set_del_fd(grpc_pollset_set* pollset_set, grpc_fd* fd) {
g_event_engine->pollset_set_del_fd(pollset_set, fd);
}
-#endif // GRPC_POSIX_SOCKET
+#endif // GRPC_POSIX_SOCKET_EV
diff --git a/src/core/lib/iomgr/ev_posix.h b/src/core/lib/iomgr/ev_posix.h
index 82cbce9a7b..b4c17fc80d 100644
--- a/src/core/lib/iomgr/ev_posix.h
+++ b/src/core/lib/iomgr/ev_posix.h
@@ -41,14 +41,16 @@ typedef struct grpc_fd grpc_fd;
typedef struct grpc_event_engine_vtable {
size_t pollset_size;
+ bool can_track_err;
- grpc_fd* (*fd_create)(int fd, const char* name);
+ grpc_fd* (*fd_create)(int fd, const char* name, bool track_err);
int (*fd_wrapped_fd)(grpc_fd* fd);
void (*fd_orphan)(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
- bool already_closed, const char* reason);
+ const char* reason);
void (*fd_shutdown)(grpc_fd* fd, grpc_error* why);
void (*fd_notify_on_read)(grpc_fd* fd, grpc_closure* closure);
void (*fd_notify_on_write)(grpc_fd* fd, grpc_closure* closure);
+ void (*fd_notify_on_error)(grpc_fd* fd, grpc_closure* closure);
bool (*fd_is_shutdown)(grpc_fd* fd);
grpc_pollset* (*fd_get_read_notifier_pollset)(grpc_fd* fd);
@@ -84,10 +86,20 @@ void grpc_event_engine_shutdown(void);
/* Return the name of the poll strategy */
const char* grpc_get_poll_strategy_name();
+/* Returns true if polling engine can track errors separately, false otherwise.
+ * If this is true, fd can be created with track_err set. After this, error
+ * events will be reported using fd_notify_on_error. If it is not set, errors
+ * will continue to be reported through fd_notify_on_read and
+ * fd_notify_on_write.
+ */
+bool grpc_event_engine_can_track_errors();
+
/* Create a wrapped file descriptor.
Requires fd is a non-blocking file descriptor.
+ \a track_err if true means that error events would be tracked separately
+ using grpc_fd_notify_on_error. Currently, valid only for linux systems.
This takes ownership of closing fd. */
-grpc_fd* grpc_fd_create(int fd, const char* name);
+grpc_fd* grpc_fd_create(int fd, const char* name, bool track_err);
/* Return the wrapped fd, or -1 if it has been released or closed. */
int grpc_fd_wrapped_fd(grpc_fd* fd);
@@ -100,7 +112,7 @@ int grpc_fd_wrapped_fd(grpc_fd* fd);
notify_on_write.
MUST NOT be called with a pollset lock taken */
void grpc_fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
- bool already_closed, const char* reason);
+ const char* reason);
/* Has grpc_fd_shutdown been called on an fd? */
bool grpc_fd_is_shutdown(grpc_fd* fd);
@@ -126,6 +138,10 @@ void grpc_fd_notify_on_read(grpc_fd* fd, grpc_closure* closure);
/* Exactly the same semantics as above, except based on writable events. */
void grpc_fd_notify_on_write(grpc_fd* fd, grpc_closure* closure);
+/* Exactly the same semantics as above, except based on error events. track_err
+ * needs to have been set on grpc_fd_create */
+void grpc_fd_notify_on_error(grpc_fd* fd, grpc_closure* closure);
+
/* Return the read notifier pollset from the fd */
grpc_pollset* grpc_fd_get_read_notifier_pollset(grpc_fd* fd);
diff --git a/src/core/lib/iomgr/exec_ctx.h b/src/core/lib/iomgr/exec_ctx.h
index cf1118a003..8ddab0d381 100644
--- a/src/core/lib/iomgr/exec_ctx.h
+++ b/src/core/lib/iomgr/exec_ctx.h
@@ -45,6 +45,9 @@ typedef struct grpc_combiner grpc_combiner;
/* The exec_ctx's thread is (potentially) owned by a call or channel: care
should be given to not delete said call/channel from this exec_ctx */
#define GRPC_EXEC_CTX_FLAG_THREAD_RESOURCE_LOOP 2
+/* This exec ctx was initialized by an internal thread, and should not
+ be counted by fork handlers */
+#define GRPC_EXEC_CTX_FLAG_IS_INTERNAL_THREAD 4
extern grpc_closure_scheduler* grpc_schedule_on_exec_ctx;
@@ -93,7 +96,9 @@ class ExecCtx {
/** Parameterised Constructor */
ExecCtx(uintptr_t fl) : flags_(fl) {
- grpc_core::Fork::IncExecCtxCount();
+ if (!(GRPC_EXEC_CTX_FLAG_IS_INTERNAL_THREAD & flags_)) {
+ grpc_core::Fork::IncExecCtxCount();
+ }
Set(this);
}
@@ -102,7 +107,9 @@ class ExecCtx {
flags_ |= GRPC_EXEC_CTX_FLAG_IS_FINISHED;
Flush();
Set(last_exec_ctx_);
- grpc_core::Fork::DecExecCtxCount();
+ if (!(GRPC_EXEC_CTX_FLAG_IS_INTERNAL_THREAD & flags_)) {
+ grpc_core::Fork::DecExecCtxCount();
+ }
}
/** Disallow copy and assignment operators */
diff --git a/src/core/lib/iomgr/executor.cc b/src/core/lib/iomgr/executor.cc
index f19f8cf20d..db4b45d1a9 100644
--- a/src/core/lib/iomgr/executor.cc
+++ b/src/core/lib/iomgr/executor.cc
@@ -145,7 +145,7 @@ static void executor_thread(void* arg) {
thread_state* ts = static_cast<thread_state*>(arg);
gpr_tls_set(&g_this_thread_state, (intptr_t)ts);
- grpc_core::ExecCtx exec_ctx(0);
+ grpc_core::ExecCtx exec_ctx(GRPC_EXEC_CTX_FLAG_IS_INTERNAL_THREAD);
size_t subtract_depth = 0;
for (;;) {
diff --git a/src/core/lib/iomgr/iomgr_posix.cc b/src/core/lib/iomgr/iomgr_posix.cc
index 66c9cb7ff7..ca7334c9a4 100644
--- a/src/core/lib/iomgr/iomgr_posix.cc
+++ b/src/core/lib/iomgr/iomgr_posix.cc
@@ -20,7 +20,7 @@
#include "src/core/lib/iomgr/port.h"
-#ifdef GRPC_POSIX_SOCKET
+#ifdef GRPC_POSIX_SOCKET_IOMGR
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/iomgr/ev_posix.h"
@@ -64,4 +64,4 @@ void grpc_set_default_iomgr_platform() {
grpc_set_iomgr_platform_vtable(&vtable);
}
-#endif /* GRPC_POSIX_SOCKET */
+#endif /* GRPC_POSIX_SOCKET_IOMGR */
diff --git a/src/core/lib/iomgr/is_epollexclusive_available.cc b/src/core/lib/iomgr/is_epollexclusive_available.cc
index 036b77866f..8df6a66e6b 100644
--- a/src/core/lib/iomgr/is_epollexclusive_available.cc
+++ b/src/core/lib/iomgr/is_epollexclusive_available.cc
@@ -27,6 +27,7 @@
#include <grpc/support/log.h>
#include <errno.h>
+#include <sys/epoll.h>
#include <sys/eventfd.h>
#include <unistd.h>
diff --git a/src/core/lib/iomgr/polling_entity.cc b/src/core/lib/iomgr/polling_entity.cc
index 9f164f65b0..dea07cae53 100644
--- a/src/core/lib/iomgr/polling_entity.cc
+++ b/src/core/lib/iomgr/polling_entity.cc
@@ -61,8 +61,11 @@ bool grpc_polling_entity_is_empty(const grpc_polling_entity* pollent) {
void grpc_polling_entity_add_to_pollset_set(grpc_polling_entity* pollent,
grpc_pollset_set* pss_dst) {
if (pollent->tag == GRPC_POLLS_POLLSET) {
- GPR_ASSERT(pollent->pollent.pollset != nullptr);
- grpc_pollset_set_add_pollset(pss_dst, pollent->pollent.pollset);
+ // CFStream does not use file destriptors. When CFStream is used, the fd
+ // pollset is possible to be null.
+ if (pollent->pollent.pollset != nullptr) {
+ grpc_pollset_set_add_pollset(pss_dst, pollent->pollent.pollset);
+ }
} else if (pollent->tag == GRPC_POLLS_POLLSET_SET) {
GPR_ASSERT(pollent->pollent.pollset_set != nullptr);
grpc_pollset_set_add_pollset_set(pss_dst, pollent->pollent.pollset_set);
@@ -75,8 +78,14 @@ void grpc_polling_entity_add_to_pollset_set(grpc_polling_entity* pollent,
void grpc_polling_entity_del_from_pollset_set(grpc_polling_entity* pollent,
grpc_pollset_set* pss_dst) {
if (pollent->tag == GRPC_POLLS_POLLSET) {
+#ifdef GRPC_CFSTREAM
+ if (pollent->pollent.pollset != nullptr) {
+ grpc_pollset_set_del_pollset(pss_dst, pollent->pollent.pollset);
+ }
+#else
GPR_ASSERT(pollent->pollent.pollset != nullptr);
grpc_pollset_set_del_pollset(pss_dst, pollent->pollent.pollset);
+#endif
} else if (pollent->tag == GRPC_POLLS_POLLSET_SET) {
GPR_ASSERT(pollent->pollent.pollset_set != nullptr);
grpc_pollset_set_del_pollset_set(pss_dst, pollent->pollent.pollset_set);
diff --git a/src/core/lib/iomgr/port.h b/src/core/lib/iomgr/port.h
index a397012003..80d8e63cdd 100644
--- a/src/core/lib/iomgr/port.h
+++ b/src/core/lib/iomgr/port.h
@@ -97,7 +97,26 @@
#define GRPC_MSG_IOVLEN_TYPE int
#define GRPC_POSIX_FORK 1
#define GRPC_POSIX_NO_SPECIAL_WAKEUP_FD 1
+#ifdef GRPC_CFSTREAM
+#define GRPC_POSIX_SOCKET_IOMGR 1
+#define GRPC_CFSTREAM_ENDPOINT 1
+#define GRPC_CFSTREAM_CLIENT 1
+#define GRPC_POSIX_SOCKET_ARES_EV_DRIVER 1
+#define GRPC_POSIX_SOCKET_EV 1
+#define GRPC_POSIX_SOCKET_EV_EPOLL1 1
+#define GRPC_POSIX_SOCKET_EV_EPOLLEX 1
+#define GRPC_POSIX_SOCKET_EV_EPOLLSIG 1
+#define GRPC_POSIX_SOCKET_EV_POLL 1
+#define GRPC_POSIX_SOCKET_RESOLVE_ADDRESS 1
+#define GRPC_POSIX_SOCKET_SOCKADDR 1
+#define GRPC_POSIX_SOCKET_SOCKET_FACTORY 1
+#define GRPC_POSIX_SOCKET_TCP 1
+#define GRPC_POSIX_SOCKET_TCP_SERVER 1
+#define GRPC_POSIX_SOCKET_TCP_SERVER_UTILS_COMMON 1
+#define GRPC_POSIX_SOCKET_UTILS_COMMON 1
+#else
#define GRPC_POSIX_SOCKET 1
+#endif
#define GRPC_POSIX_SOCKETUTILS 1
#define GRPC_POSIX_SYSCONF 1
#define GRPC_POSIX_WAKEUP_FD 1
@@ -131,12 +150,30 @@
#endif
#if defined(GRPC_POSIX_SOCKET) + defined(GRPC_WINSOCK_SOCKET) + \
- defined(GRPC_CUSTOM_SOCKET) != \
+ defined(GRPC_CUSTOM_SOCKET) + defined(GRPC_CFSTREAM) != \
1
#error \
"Must define exactly one of GRPC_POSIX_SOCKET, GRPC_WINSOCK_SOCKET, GRPC_CUSTOM_SOCKET"
#endif
+#ifdef GRPC_POSIX_SOCKET
+#define GRPC_POSIX_SOCKET_ARES_EV_DRIVER 1
+#define GRPC_POSIX_SOCKET_EV 1
+#define GRPC_POSIX_SOCKET_EV_EPOLLEX 1
+#define GRPC_POSIX_SOCKET_EV_EPOLLSIG 1
+#define GRPC_POSIX_SOCKET_EV_POLL 1
+#define GRPC_POSIX_SOCKET_EV_EPOLL1 1
+#define GRPC_POSIX_SOCKET_IOMGR 1
+#define GRPC_POSIX_SOCKET_RESOLVE_ADDRESS 1
+#define GRPC_POSIX_SOCKET_SOCKADDR 1
+#define GRPC_POSIX_SOCKET_SOCKET_FACTORY 1
+#define GRPC_POSIX_SOCKET_TCP 1
+#define GRPC_POSIX_SOCKET_TCP_CLIENT 1
+#define GRPC_POSIX_SOCKET_TCP_SERVER 1
+#define GRPC_POSIX_SOCKET_TCP_SERVER_UTILS_COMMON 1
+#define GRPC_POSIX_SOCKET_UTILS_COMMON 1
+#endif
+
#if defined(GRPC_POSIX_HOST_NAME_MAX) && defined(GRPC_POSIX_SYSCONF)
#error "Cannot define both GRPC_POSIX_HOST_NAME_MAX and GRPC_POSIX_SYSCONF"
#endif
diff --git a/src/core/lib/iomgr/resolve_address.h b/src/core/lib/iomgr/resolve_address.h
index fe0d834582..6afe94a7a9 100644
--- a/src/core/lib/iomgr/resolve_address.h
+++ b/src/core/lib/iomgr/resolve_address.h
@@ -33,7 +33,7 @@
#include <ws2tcpip.h>
#endif
-#ifdef GRPC_POSIX_SOCKET
+#if defined(GRPC_POSIX_SOCKET) || defined(GRPC_CFSTREAM)
#include <sys/socket.h>
#endif
diff --git a/src/core/lib/iomgr/resolve_address_posix.cc b/src/core/lib/iomgr/resolve_address_posix.cc
index a82075542f..7a825643e1 100644
--- a/src/core/lib/iomgr/resolve_address_posix.cc
+++ b/src/core/lib/iomgr/resolve_address_posix.cc
@@ -19,7 +19,7 @@
#include <grpc/support/port_platform.h>
#include "src/core/lib/iomgr/port.h"
-#ifdef GRPC_POSIX_SOCKET
+#ifdef GRPC_POSIX_SOCKET_RESOLVE_ADDRESS
#include "src/core/lib/iomgr/sockaddr.h"
diff --git a/src/core/lib/iomgr/sockaddr_posix.h b/src/core/lib/iomgr/sockaddr_posix.h
index 5b18bbc465..3cedd9082d 100644
--- a/src/core/lib/iomgr/sockaddr_posix.h
+++ b/src/core/lib/iomgr/sockaddr_posix.h
@@ -23,7 +23,7 @@
#include "src/core/lib/iomgr/port.h"
-#ifdef GRPC_POSIX_SOCKET
+#ifdef GRPC_POSIX_SOCKET_SOCKADDR
#include <arpa/inet.h>
#include <netdb.h>
#include <netinet/in.h>
diff --git a/src/core/lib/iomgr/socket_factory_posix.cc b/src/core/lib/iomgr/socket_factory_posix.cc
index 1d1e36c0e3..57137769c8 100644
--- a/src/core/lib/iomgr/socket_factory_posix.cc
+++ b/src/core/lib/iomgr/socket_factory_posix.cc
@@ -20,7 +20,7 @@
#include "src/core/lib/iomgr/port.h"
-#ifdef GRPC_POSIX_SOCKET
+#ifdef GRPC_POSIX_SOCKET_SOCKET_FACTORY
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/useful.h"
diff --git a/src/core/lib/iomgr/socket_utils.h b/src/core/lib/iomgr/socket_utils.h
index cf1a7be648..14bb081e93 100644
--- a/src/core/lib/iomgr/socket_utils.h
+++ b/src/core/lib/iomgr/socket_utils.h
@@ -23,12 +23,21 @@
#include <stddef.h>
+// TODO(juanlishen): The following functions might be simple enough to implement
+// ourselves, so that they don't cause any portability hassle.
+
/* A wrapper for htons on POSIX and Windows */
uint16_t grpc_htons(uint16_t hostshort);
/* A wrapper for ntohs on POSIX and WINDOWS */
uint16_t grpc_ntohs(uint16_t netshort);
+/* A wrapper for htonl on POSIX and Windows */
+uint32_t grpc_htonl(uint32_t hostlong);
+
+/* A wrapper for ntohl on POSIX and WINDOWS */
+uint32_t grpc_ntohl(uint32_t netlong);
+
/* A wrapper for inet_pton on POSIX and WINDOWS */
int grpc_inet_pton(int af, const char* src, void* dst);
diff --git a/src/core/lib/iomgr/socket_utils_common_posix.cc b/src/core/lib/iomgr/socket_utils_common_posix.cc
index 04a1767731..c4b991c94d 100644
--- a/src/core/lib/iomgr/socket_utils_common_posix.cc
+++ b/src/core/lib/iomgr/socket_utils_common_posix.cc
@@ -20,7 +20,7 @@
#include "src/core/lib/iomgr/port.h"
-#ifdef GRPC_POSIX_SOCKET
+#ifdef GRPC_POSIX_SOCKET_UTILS_COMMON
#include "src/core/lib/iomgr/socket_utils.h"
#include "src/core/lib/iomgr/socket_utils_posix.h"
@@ -339,6 +339,10 @@ uint16_t grpc_htons(uint16_t hostshort) { return htons(hostshort); }
uint16_t grpc_ntohs(uint16_t netshort) { return ntohs(netshort); }
+uint32_t grpc_htonl(uint32_t hostlong) { return htonl(hostlong); }
+
+uint32_t grpc_ntohl(uint32_t netlong) { return ntohl(netlong); }
+
int grpc_inet_pton(int af, const char* src, void* dst) {
return inet_pton(af, src, dst);
}
diff --git a/src/core/lib/iomgr/socket_utils_uv.cc b/src/core/lib/iomgr/socket_utils_uv.cc
index 7eba40c46b..b5f96b52df 100644
--- a/src/core/lib/iomgr/socket_utils_uv.cc
+++ b/src/core/lib/iomgr/socket_utils_uv.cc
@@ -33,6 +33,10 @@ uint16_t grpc_htons(uint16_t hostshort) { return htons(hostshort); }
uint16_t grpc_ntohs(uint16_t netshort) { return ntohs(netshort); }
+uint32_t grpc_htonl(uint32_t hostlong) { return htonl(hostlong); }
+
+uint32_t grpc_ntohl(uint32_t netlong) { return ntohl(netlong); }
+
int grpc_inet_pton(int af, const char* src, void* dst) {
return inet_pton(af, src, dst);
}
diff --git a/src/core/lib/iomgr/socket_utils_windows.cc b/src/core/lib/iomgr/socket_utils_windows.cc
index 3e7b5b812d..9137ab98e6 100644
--- a/src/core/lib/iomgr/socket_utils_windows.cc
+++ b/src/core/lib/iomgr/socket_utils_windows.cc
@@ -31,6 +31,10 @@ uint16_t grpc_htons(uint16_t hostshort) { return htons(hostshort); }
uint16_t grpc_ntohs(uint16_t netshort) { return ntohs(netshort); }
+uint32_t grpc_htonl(uint32_t hostlong) { return htonl(hostlong); }
+
+uint32_t grpc_ntohl(uint32_t netlong) { return ntohl(netlong); }
+
int grpc_inet_pton(int af, const char* src, void* dst) {
return inet_pton(af, src, dst);
}
diff --git a/src/core/lib/iomgr/tcp_client_cfstream.cc b/src/core/lib/iomgr/tcp_client_cfstream.cc
new file mode 100644
index 0000000000..5acea91792
--- /dev/null
+++ b/src/core/lib/iomgr/tcp_client_cfstream.cc
@@ -0,0 +1,216 @@
+
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/iomgr/port.h"
+
+#ifdef GRPC_CFSTREAM_CLIENT
+
+#include <CoreFoundation/CoreFoundation.h>
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+
+#include <netinet/in.h>
+
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/gpr/host_port.h"
+#include "src/core/lib/iomgr/cfstream_handle.h"
+#include "src/core/lib/iomgr/closure.h"
+#include "src/core/lib/iomgr/endpoint_cfstream.h"
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/iomgr/error_cfstream.h"
+#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "src/core/lib/iomgr/tcp_client.h"
+#include "src/core/lib/iomgr/timer.h"
+
+extern grpc_core::TraceFlag grpc_tcp_trace;
+
+typedef struct CFStreamConnect {
+ gpr_mu mu;
+ gpr_refcount refcount;
+
+ CFReadStreamRef read_stream;
+ CFWriteStreamRef write_stream;
+ CFStreamHandle* stream_handle;
+
+ grpc_timer alarm;
+ grpc_closure on_alarm;
+ grpc_closure on_open;
+
+ bool read_stream_open;
+ bool write_stream_open;
+ bool failed;
+
+ grpc_closure* closure;
+ grpc_endpoint** endpoint;
+ int refs;
+ char* addr_name;
+ grpc_resource_quota* resource_quota;
+} CFStreamConnect;
+
+static void CFStreamConnectCleanup(CFStreamConnect* connect) {
+ grpc_resource_quota_unref_internal(connect->resource_quota);
+ CFSTREAM_HANDLE_UNREF(connect->stream_handle, "async connect clean up");
+ CFRelease(connect->read_stream);
+ CFRelease(connect->write_stream);
+ gpr_mu_destroy(&connect->mu);
+ gpr_free(connect->addr_name);
+ gpr_free(connect);
+}
+
+static void OnAlarm(void* arg, grpc_error* error) {
+ CFStreamConnect* connect = static_cast<CFStreamConnect*>(arg);
+ if (grpc_tcp_trace.enabled()) {
+ gpr_log(GPR_DEBUG, "CLIENT_CONNECT :%p OnAlarm, error:%p", connect, error);
+ }
+ gpr_mu_lock(&connect->mu);
+ grpc_closure* closure = connect->closure;
+ connect->closure = nil;
+ const bool done = (--connect->refs == 0);
+ gpr_mu_unlock(&connect->mu);
+ // Only schedule a callback once, by either OnAlarm or OnOpen. The
+ // first one issues callback while the second one does cleanup.
+ if (done) {
+ CFStreamConnectCleanup(connect);
+ } else {
+ grpc_error* error =
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("connect() timed out");
+ GRPC_CLOSURE_SCHED(closure, error);
+ }
+}
+
+static void OnOpen(void* arg, grpc_error* error) {
+ CFStreamConnect* connect = static_cast<CFStreamConnect*>(arg);
+ if (grpc_tcp_trace.enabled()) {
+ gpr_log(GPR_DEBUG, "CLIENT_CONNECT :%p OnOpen, error:%p", connect, error);
+ }
+ gpr_mu_lock(&connect->mu);
+ grpc_timer_cancel(&connect->alarm);
+ grpc_closure* closure = connect->closure;
+ connect->closure = nil;
+
+ bool done = (--connect->refs == 0);
+ grpc_endpoint** endpoint = connect->endpoint;
+
+ // Only schedule a callback once, by either OnAlarm or OnOpen. The
+ // first one issues callback while the second one does cleanup.
+ if (done) {
+ gpr_mu_unlock(&connect->mu);
+ CFStreamConnectCleanup(connect);
+ } else {
+ if (error == GRPC_ERROR_NONE) {
+ CFErrorRef stream_error = CFReadStreamCopyError(connect->read_stream);
+ if (stream_error == NULL) {
+ stream_error = CFWriteStreamCopyError(connect->write_stream);
+ }
+ if (stream_error) {
+ error = GRPC_ERROR_CREATE_FROM_CFERROR(stream_error, "connect() error");
+ CFRelease(stream_error);
+ }
+ if (error == GRPC_ERROR_NONE) {
+ *endpoint = grpc_cfstream_endpoint_create(
+ connect->read_stream, connect->write_stream, connect->addr_name,
+ connect->resource_quota, connect->stream_handle);
+ }
+ } else {
+ GRPC_ERROR_REF(error);
+ }
+ gpr_mu_unlock(&connect->mu);
+ GRPC_CLOSURE_SCHED(closure, error);
+ }
+}
+
+static void ParseResolvedAddress(const grpc_resolved_address* addr,
+ CFStringRef* host, int* port) {
+ char *host_port, *host_string, *port_string;
+ grpc_sockaddr_to_string(&host_port, addr, 1);
+ gpr_split_host_port(host_port, &host_string, &port_string);
+ *host = CFStringCreateWithCString(NULL, host_string, kCFStringEncodingUTF8);
+ gpr_free(host_string);
+ gpr_free(port_string);
+ gpr_free(host_port);
+ *port = grpc_sockaddr_get_port(addr);
+}
+
+static void CFStreamClientConnect(grpc_closure* closure, grpc_endpoint** ep,
+ grpc_pollset_set* interested_parties,
+ const grpc_channel_args* channel_args,
+ const grpc_resolved_address* resolved_addr,
+ grpc_millis deadline) {
+ CFStreamConnect* connect;
+
+ connect = (CFStreamConnect*)gpr_zalloc(sizeof(CFStreamConnect));
+ connect->closure = closure;
+ connect->endpoint = ep;
+ connect->addr_name = grpc_sockaddr_to_uri(resolved_addr);
+ // connect->resource_quota = resource_quota;
+ connect->refs = 2; // One for the connect operation, one for the timer.
+ gpr_ref_init(&connect->refcount, 1);
+ gpr_mu_init(&connect->mu);
+
+ if (grpc_tcp_trace.enabled()) {
+ gpr_log(GPR_DEBUG, "CLIENT_CONNECT: %p, %s: asynchronously connecting",
+ connect, connect->addr_name);
+ }
+
+ grpc_resource_quota* resource_quota = grpc_resource_quota_create(NULL);
+ if (channel_args != NULL) {
+ for (size_t i = 0; i < channel_args->num_args; i++) {
+ if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_RESOURCE_QUOTA)) {
+ grpc_resource_quota_unref_internal(resource_quota);
+ resource_quota = grpc_resource_quota_ref_internal(
+ (grpc_resource_quota*)channel_args->args[i].value.pointer.p);
+ }
+ }
+ }
+ connect->resource_quota = resource_quota;
+
+ CFReadStreamRef read_stream;
+ CFWriteStreamRef write_stream;
+
+ CFStringRef host;
+ int port;
+ ParseResolvedAddress(resolved_addr, &host, &port);
+ CFStreamCreatePairWithSocketToHost(NULL, host, port, &read_stream,
+ &write_stream);
+ CFRelease(host);
+ connect->read_stream = read_stream;
+ connect->write_stream = write_stream;
+ connect->stream_handle =
+ CFStreamHandle::CreateStreamHandle(read_stream, write_stream);
+ GRPC_CLOSURE_INIT(&connect->on_open, OnOpen, static_cast<void*>(connect),
+ grpc_schedule_on_exec_ctx);
+ connect->stream_handle->NotifyOnOpen(&connect->on_open);
+ GRPC_CLOSURE_INIT(&connect->on_alarm, OnAlarm, connect,
+ grpc_schedule_on_exec_ctx);
+ gpr_mu_lock(&connect->mu);
+ CFReadStreamOpen(read_stream);
+ CFWriteStreamOpen(write_stream);
+ grpc_timer_init(&connect->alarm, deadline, &connect->on_alarm);
+ gpr_mu_unlock(&connect->mu);
+}
+
+grpc_tcp_client_vtable grpc_posix_tcp_client_vtable = {CFStreamClientConnect};
+
+#endif /* GRPC_CFSTREAM_CLIENT */
diff --git a/src/core/lib/iomgr/tcp_client_posix.cc b/src/core/lib/iomgr/tcp_client_posix.cc
index 900c056575..296ee74311 100644
--- a/src/core/lib/iomgr/tcp_client_posix.cc
+++ b/src/core/lib/iomgr/tcp_client_posix.cc
@@ -20,7 +20,7 @@
#include "src/core/lib/iomgr/port.h"
-#ifdef GRPC_POSIX_SOCKET
+#ifdef GRPC_POSIX_SOCKET_TCP_CLIENT
#include "src/core/lib/iomgr/tcp_client_posix.h"
@@ -211,8 +211,7 @@ static void on_writable(void* acp, grpc_error* error) {
finish:
if (fd != nullptr) {
grpc_pollset_set_del_fd(ac->interested_parties, fd);
- grpc_fd_orphan(fd, nullptr, nullptr, false /* already_closed */,
- "tcp_client_orphan");
+ grpc_fd_orphan(fd, nullptr, nullptr, "tcp_client_orphan");
fd = nullptr;
}
done = (--ac->refs == 0);
@@ -280,7 +279,7 @@ grpc_error* grpc_tcp_client_prepare_fd(const grpc_channel_args* channel_args,
}
addr_str = grpc_sockaddr_to_uri(mapped_addr);
gpr_asprintf(&name, "tcp-client:%s", addr_str);
- *fdobj = grpc_fd_create(fd, name);
+ *fdobj = grpc_fd_create(fd, name, false);
gpr_free(name);
gpr_free(addr_str);
return GRPC_ERROR_NONE;
@@ -305,8 +304,7 @@ void grpc_tcp_client_create_from_prepared_fd(
return;
}
if (errno != EWOULDBLOCK && errno != EINPROGRESS) {
- grpc_fd_orphan(fdobj, nullptr, nullptr, false /* already_closed */,
- "tcp_client_connect_error");
+ grpc_fd_orphan(fdobj, nullptr, nullptr, "tcp_client_connect_error");
GRPC_CLOSURE_SCHED(closure, GRPC_OS_ERROR(errno, "connect"));
return;
}
diff --git a/src/core/lib/iomgr/tcp_posix.cc b/src/core/lib/iomgr/tcp_posix.cc
index b79ffe20f1..9df2e206b2 100644
--- a/src/core/lib/iomgr/tcp_posix.cc
+++ b/src/core/lib/iomgr/tcp_posix.cc
@@ -20,7 +20,7 @@
#include "src/core/lib/iomgr/port.h"
-#ifdef GRPC_POSIX_SOCKET
+#ifdef GRPC_POSIX_SOCKET_TCP
#include "src/core/lib/iomgr/network_status_tracker.h"
#include "src/core/lib/iomgr/tcp_posix.h"
@@ -70,7 +70,9 @@ struct grpc_tcp {
grpc_endpoint base;
grpc_fd* em_fd;
int fd;
- bool finished_edge;
+ /* Used by the endpoint read function to distinguish the very first read call
+ * from the rest */
+ bool is_first_read;
double target_length;
double bytes_read_this_round;
gpr_refcount refcount;
@@ -295,7 +297,7 @@ static void tcp_shutdown(grpc_endpoint* ep, grpc_error* why) {
static void tcp_free(grpc_tcp* tcp) {
grpc_fd_orphan(tcp->em_fd, tcp->release_fd_cb, tcp->release_fd,
- false /* already_closed */, "tcp_unref_orphan");
+ "tcp_unref_orphan");
grpc_slice_buffer_destroy_internal(&tcp->last_read_buffer);
grpc_resource_user_unref(tcp->resource_user);
gpr_free(tcp->peer_string);
@@ -377,7 +379,6 @@ static void tcp_do_read(grpc_tcp* tcp) {
ssize_t read_bytes;
size_t i;
- GPR_ASSERT(!tcp->finished_edge);
GPR_ASSERT(tcp->incoming_buffer->count <= MAX_READ_IOVEC);
for (i = 0; i < tcp->incoming_buffer->count; i++) {
@@ -473,7 +474,6 @@ static void tcp_continue_read(grpc_tcp* tcp) {
static void tcp_handle_read(void* arg /* grpc_tcp */, grpc_error* error) {
grpc_tcp* tcp = static_cast<grpc_tcp*>(arg);
- GPR_ASSERT(!tcp->finished_edge);
if (grpc_tcp_trace.enabled()) {
gpr_log(GPR_INFO, "TCP:%p got_read: %s", tcp, grpc_error_string(error));
}
@@ -497,10 +497,17 @@ static void tcp_read(grpc_endpoint* ep, grpc_slice_buffer* incoming_buffer,
grpc_slice_buffer_reset_and_unref_internal(incoming_buffer);
grpc_slice_buffer_swap(incoming_buffer, &tcp->last_read_buffer);
TCP_REF(tcp, "read");
- if (tcp->finished_edge) {
- tcp->finished_edge = false;
+ if (tcp->is_first_read) {
+ /* Endpoint read called for the very first time. Register read callback with
+ * the polling engine */
+ tcp->is_first_read = false;
notify_on_read(tcp);
} else {
+ /* Not the first time. We may or may not have more bytes available. In any
+ * case call tcp->read_done_closure (i.e tcp_handle_read()) which does the
+ * right thing (i.e calls tcp_do_read() which either reads the available
+ * bytes or calls notify_on_read() to be notified when new bytes become
+ * available */
GRPC_CLOSURE_SCHED(&tcp->read_done_closure, GRPC_ERROR_NONE);
}
}
@@ -778,7 +785,8 @@ grpc_endpoint* grpc_tcp_create(grpc_fd* em_fd,
tcp->min_read_chunk_size = tcp_min_read_chunk_size;
tcp->max_read_chunk_size = tcp_max_read_chunk_size;
tcp->bytes_read_this_round = 0;
- tcp->finished_edge = true;
+ /* Will be set to false by the very first endpoint read function */
+ tcp->is_first_read = true;
/* paired with unref in grpc_tcp_destroy */
gpr_ref_init(&tcp->refcount, 1);
gpr_atm_no_barrier_store(&tcp->shutdown_count, 0);
@@ -811,4 +819,4 @@ void grpc_tcp_destroy_and_release_fd(grpc_endpoint* ep, int* fd,
TCP_UNREF(tcp, "destroy");
}
-#endif
+#endif /* GRPC_POSIX_SOCKET_TCP */
diff --git a/src/core/lib/iomgr/tcp_server_posix.cc b/src/core/lib/iomgr/tcp_server_posix.cc
index 484d2b6077..8ddf684fea 100644
--- a/src/core/lib/iomgr/tcp_server_posix.cc
+++ b/src/core/lib/iomgr/tcp_server_posix.cc
@@ -25,7 +25,7 @@
#include "src/core/lib/iomgr/port.h"
-#ifdef GRPC_POSIX_SOCKET
+#ifdef GRPC_POSIX_SOCKET_TCP_SERVER
#include "src/core/lib/iomgr/tcp_server.h"
@@ -150,7 +150,7 @@ static void deactivated_all_ports(grpc_tcp_server* s) {
GRPC_CLOSURE_INIT(&sp->destroyed_closure, destroyed_port, s,
grpc_schedule_on_exec_ctx);
grpc_fd_orphan(sp->emfd, &sp->destroyed_closure, nullptr,
- false /* already_closed */, "tcp_listener_shutdown");
+ "tcp_listener_shutdown");
}
gpr_mu_unlock(&s->mu);
} else {
@@ -226,7 +226,7 @@ static void on_read(void* arg, grpc_error* err) {
gpr_log(GPR_INFO, "SERVER_CONNECT: incoming connection: %s", addr_str);
}
- grpc_fd* fdobj = grpc_fd_create(fd, name);
+ grpc_fd* fdobj = grpc_fd_create(fd, name, false);
read_notifier_pollset =
sp->server->pollsets[static_cast<size_t>(gpr_atm_no_barrier_fetch_add(
@@ -362,7 +362,7 @@ static grpc_error* clone_port(grpc_tcp_listener* listener, unsigned count) {
listener->sibling = sp;
sp->server = listener->server;
sp->fd = fd;
- sp->emfd = grpc_fd_create(fd, name);
+ sp->emfd = grpc_fd_create(fd, name, false);
memcpy(&sp->addr, &listener->addr, sizeof(grpc_resolved_address));
sp->port = port;
sp->port_index = listener->port_index;
@@ -559,4 +559,4 @@ grpc_tcp_server_vtable grpc_posix_tcp_server_vtable = {
tcp_server_shutdown_starting_add,
tcp_server_unref,
tcp_server_shutdown_listeners};
-#endif
+#endif /* GRPC_POSIX_SOCKET_TCP_SERVER */
diff --git a/src/core/lib/iomgr/tcp_server_utils_posix_common.cc b/src/core/lib/iomgr/tcp_server_utils_posix_common.cc
index 2d95aa66d6..b9f8145572 100644
--- a/src/core/lib/iomgr/tcp_server_utils_posix_common.cc
+++ b/src/core/lib/iomgr/tcp_server_utils_posix_common.cc
@@ -20,7 +20,7 @@
#include "src/core/lib/iomgr/port.h"
-#ifdef GRPC_POSIX_SOCKET
+#ifdef GRPC_POSIX_SOCKET_TCP_SERVER_UTILS_COMMON
#include "src/core/lib/iomgr/tcp_server_utils_posix.h"
@@ -105,7 +105,7 @@ static grpc_error* add_socket_to_server(grpc_tcp_server* s, int fd,
s->tail = sp;
sp->server = s;
sp->fd = fd;
- sp->emfd = grpc_fd_create(fd, name);
+ sp->emfd = grpc_fd_create(fd, name, false);
memcpy(&sp->addr, addr, sizeof(grpc_resolved_address));
sp->port = port;
sp->port_index = port_index;
@@ -217,4 +217,4 @@ error:
return ret;
}
-#endif /* GRPC_POSIX_SOCKET */
+#endif /* GRPC_POSIX_SOCKET_TCP_SERVER_UTILS_COMMON */
diff --git a/src/core/lib/iomgr/timer_manager.cc b/src/core/lib/iomgr/timer_manager.cc
index 9fdae17909..55be919bbb 100644
--- a/src/core/lib/iomgr/timer_manager.cc
+++ b/src/core/lib/iomgr/timer_manager.cc
@@ -265,7 +265,7 @@ static void timer_thread_cleanup(completed_thread* ct) {
static void timer_thread(void* completed_thread_ptr) {
// this threads exec_ctx: we try to run things through to completion here
// since it's easy to spin up new threads
- grpc_core::ExecCtx exec_ctx(0);
+ grpc_core::ExecCtx exec_ctx(GRPC_EXEC_CTX_FLAG_IS_INTERNAL_THREAD);
timer_main_loop();
timer_thread_cleanup(static_cast<completed_thread*>(completed_thread_ptr));
diff --git a/src/core/lib/iomgr/udp_server.cc b/src/core/lib/iomgr/udp_server.cc
index 51d17eb174..bdb2d0e764 100644
--- a/src/core/lib/iomgr/udp_server.cc
+++ b/src/core/lib/iomgr/udp_server.cc
@@ -152,7 +152,7 @@ GrpcUdpListener::GrpcUdpListener(grpc_udp_server* server, int fd,
grpc_sockaddr_to_string(&addr_str, addr, 1);
gpr_asprintf(&name, "udp-server-listener:%s", addr_str);
gpr_free(addr_str);
- emfd_ = grpc_fd_create(fd, name);
+ emfd_ = grpc_fd_create(fd, name, false);
memcpy(&addr_, addr, sizeof(grpc_resolved_address));
GPR_ASSERT(emfd_);
gpr_free(name);
@@ -300,8 +300,7 @@ void GrpcUdpListener::OrphanFd() {
grpc_schedule_on_exec_ctx);
/* Because at this point, all listening sockets have been shutdown already, no
* need to call OnFdAboutToOrphan() to notify the handler again. */
- grpc_fd_orphan(emfd_, &destroyed_closure_, nullptr,
- false /* already_closed */, "udp_listener_shutdown");
+ grpc_fd_orphan(emfd_, &destroyed_closure_, nullptr, "udp_listener_shutdown");
}
void grpc_udp_server_destroy(grpc_udp_server* s, grpc_closure* on_done) {
diff --git a/src/core/lib/security/context/security_context.cc b/src/core/lib/security/context/security_context.cc
index 14051a3f00..dbf6e39577 100644
--- a/src/core/lib/security/context/security_context.cc
+++ b/src/core/lib/security/context/security_context.cc
@@ -21,6 +21,7 @@
#include <string.h>
#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/gpr/arena.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/security/context/security_context.h"
#include "src/core/lib/surface/api_trace.h"
@@ -99,10 +100,10 @@ void grpc_client_security_context_destroy(void* ctx) {
}
/* --- grpc_server_security_context --- */
-
-grpc_server_security_context* grpc_server_security_context_create(void) {
+grpc_server_security_context* grpc_server_security_context_create(
+ gpr_arena* arena) {
return static_cast<grpc_server_security_context*>(
- gpr_zalloc(sizeof(grpc_server_security_context)));
+ gpr_arena_alloc(arena, sizeof(grpc_server_security_context)));
}
void grpc_server_security_context_destroy(void* ctx) {
@@ -112,7 +113,6 @@ void grpc_server_security_context_destroy(void* ctx) {
if (c->extension.instance != nullptr && c->extension.destroy != nullptr) {
c->extension.destroy(c->extension.instance);
}
- gpr_free(ctx);
}
/* --- grpc_auth_context --- */
diff --git a/src/core/lib/security/context/security_context.h b/src/core/lib/security/context/security_context.h
index e782e4f28f..1e98d169a2 100644
--- a/src/core/lib/security/context/security_context.h
+++ b/src/core/lib/security/context/security_context.h
@@ -26,6 +26,8 @@
extern grpc_core::DebugOnlyTraceFlag grpc_trace_auth_context_refcount;
+struct gpr_arena;
+
/* --- grpc_auth_context ---
High level authentication context object. Can optionally be chained. */
@@ -101,7 +103,8 @@ typedef struct {
grpc_security_context_extension extension;
} grpc_server_security_context;
-grpc_server_security_context* grpc_server_security_context_create(void);
+grpc_server_security_context* grpc_server_security_context_create(
+ gpr_arena* arena);
void grpc_server_security_context_destroy(void* ctx);
/* --- Channel args for auth context --- */
diff --git a/src/core/lib/security/credentials/google_default/google_default_credentials.cc b/src/core/lib/security/credentials/google_default/google_default_credentials.cc
index 38c9175717..c456ffaf5d 100644
--- a/src/core/lib/security/credentials/google_default/google_default_credentials.cc
+++ b/src/core/lib/security/credentials/google_default/google_default_credentials.cc
@@ -231,7 +231,8 @@ end:
creds->base.vtable = &google_default_credentials_vtable;
creds->base.type = GRPC_CHANNEL_CREDENTIALS_TYPE_GOOGLE_DEFAULT;
gpr_ref_init(&creds->base.refcount, 1);
- creds->ssl_creds = grpc_ssl_credentials_create(nullptr, nullptr, nullptr);
+ creds->ssl_creds =
+ grpc_ssl_credentials_create(nullptr, nullptr, nullptr, nullptr);
GPR_ASSERT(creds->ssl_creds != nullptr);
grpc_alts_credentials_options* options =
grpc_alts_credentials_client_options_create();
diff --git a/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc b/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc
index 2129029737..43dd68e874 100644
--- a/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc
+++ b/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc
@@ -219,9 +219,11 @@ static void on_oauth2_token_fetcher_http_response(void* user_data,
gpr_mu_lock(&c->mu);
c->token_fetch_pending = false;
c->access_token_md = GRPC_MDELEM_REF(access_token_md);
- c->token_expiration = status == GRPC_CREDENTIALS_OK
- ? grpc_core::ExecCtx::Get()->Now() + token_lifetime
- : 0;
+ c->token_expiration =
+ status == GRPC_CREDENTIALS_OK
+ ? gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
+ gpr_time_from_millis(token_lifetime, GPR_TIMESPAN))
+ : gpr_inf_past(GPR_CLOCK_MONOTONIC);
grpc_oauth2_pending_get_request_metadata* pending_request =
c->pending_requests;
c->pending_requests = nullptr;
@@ -259,8 +261,10 @@ static bool oauth2_token_fetcher_get_request_metadata(
grpc_mdelem cached_access_token_md = GRPC_MDNULL;
gpr_mu_lock(&c->mu);
if (!GRPC_MDISNULL(c->access_token_md) &&
- (c->token_expiration - grpc_core::ExecCtx::Get()->Now() >
- refresh_threshold)) {
+ gpr_time_cmp(
+ gpr_time_sub(c->token_expiration, gpr_now(GPR_CLOCK_MONOTONIC)),
+ gpr_time_from_seconds(GRPC_SECURE_TOKEN_REFRESH_THRESHOLD_SECS,
+ GPR_TIMESPAN)) > 0) {
cached_access_token_md = GRPC_MDELEM_REF(c->access_token_md);
}
if (!GRPC_MDISNULL(cached_access_token_md)) {
@@ -333,7 +337,7 @@ static void init_oauth2_token_fetcher(grpc_oauth2_token_fetcher_credentials* c,
c->base.type = GRPC_CALL_CREDENTIALS_TYPE_OAUTH2;
gpr_ref_init(&c->base.refcount, 1);
gpr_mu_init(&c->mu);
- c->token_expiration = 0;
+ c->token_expiration = gpr_inf_past(GPR_CLOCK_MONOTONIC);
c->fetch_func = fetch_func;
c->pollent =
grpc_polling_entity_create_from_pollset_set(grpc_pollset_set_create());
diff --git a/src/core/lib/security/credentials/oauth2/oauth2_credentials.h b/src/core/lib/security/credentials/oauth2/oauth2_credentials.h
index c0dd1546e3..12a1d4484f 100644
--- a/src/core/lib/security/credentials/oauth2/oauth2_credentials.h
+++ b/src/core/lib/security/credentials/oauth2/oauth2_credentials.h
@@ -71,7 +71,7 @@ typedef struct {
grpc_call_credentials base;
gpr_mu mu;
grpc_mdelem access_token_md;
- grpc_millis token_expiration;
+ gpr_timespec token_expiration;
bool token_fetch_pending;
grpc_oauth2_pending_get_request_metadata* pending_requests;
grpc_httpcli_context httpcli_context;
diff --git a/src/core/lib/security/credentials/ssl/ssl_credentials.cc b/src/core/lib/security/credentials/ssl/ssl_credentials.cc
index 2b6377d3ec..3d6f2f200a 100644
--- a/src/core/lib/security/credentials/ssl/ssl_credentials.cc
+++ b/src/core/lib/security/credentials/ssl/ssl_credentials.cc
@@ -48,6 +48,10 @@ static void ssl_destruct(grpc_channel_credentials* creds) {
grpc_ssl_credentials* c = reinterpret_cast<grpc_ssl_credentials*>(creds);
gpr_free(c->config.pem_root_certs);
grpc_tsi_ssl_pem_key_cert_pairs_destroy(c->config.pem_key_cert_pair, 1);
+ if (c->config.verify_options.verify_peer_destruct != nullptr) {
+ c->config.verify_options.verify_peer_destruct(
+ c->config.verify_options.verify_peer_callback_userdata);
+ }
}
static grpc_security_status ssl_create_security_connector(
@@ -87,6 +91,7 @@ static grpc_channel_credentials_vtable ssl_vtable = {
static void ssl_build_config(const char* pem_root_certs,
grpc_ssl_pem_key_cert_pair* pem_key_cert_pair,
+ const verify_peer_options* verify_options,
grpc_ssl_config* config) {
if (pem_root_certs != nullptr) {
config->pem_root_certs = gpr_strdup(pem_root_certs);
@@ -101,23 +106,32 @@ static void ssl_build_config(const char* pem_root_certs,
config->pem_key_cert_pair->private_key =
gpr_strdup(pem_key_cert_pair->private_key);
}
+ if (verify_options != nullptr) {
+ memcpy(&config->verify_options, verify_options,
+ sizeof(verify_peer_options));
+ } else {
+ // Otherwise set all options to default values
+ memset(&config->verify_options, 0, sizeof(verify_peer_options));
+ }
}
grpc_channel_credentials* grpc_ssl_credentials_create(
const char* pem_root_certs, grpc_ssl_pem_key_cert_pair* pem_key_cert_pair,
- void* reserved) {
+ const verify_peer_options* verify_options, void* reserved) {
grpc_ssl_credentials* c = static_cast<grpc_ssl_credentials*>(
gpr_zalloc(sizeof(grpc_ssl_credentials)));
GRPC_API_TRACE(
"grpc_ssl_credentials_create(pem_root_certs=%s, "
"pem_key_cert_pair=%p, "
+ "verify_options=%p, "
"reserved=%p)",
- 3, (pem_root_certs, pem_key_cert_pair, reserved));
+ 4, (pem_root_certs, pem_key_cert_pair, verify_options, reserved));
GPR_ASSERT(reserved == nullptr);
c->base.type = GRPC_CHANNEL_CREDENTIALS_TYPE_SSL;
c->base.vtable = &ssl_vtable;
gpr_ref_init(&c->base.refcount, 1);
- ssl_build_config(pem_root_certs, pem_key_cert_pair, &c->config);
+ ssl_build_config(pem_root_certs, pem_key_cert_pair, verify_options,
+ &c->config);
return &c->base;
}
diff --git a/src/core/lib/security/security_connector/security_connector.cc b/src/core/lib/security/security_connector/security_connector.cc
index b54a7643e4..cc72bb6164 100644
--- a/src/core/lib/security/security_connector/security_connector.cc
+++ b/src/core/lib/security/security_connector/security_connector.cc
@@ -620,6 +620,7 @@ typedef struct {
tsi_ssl_client_handshaker_factory* client_handshaker_factory;
char* target_name;
char* overridden_target_name;
+ const verify_peer_options* verify_options;
} grpc_ssl_channel_security_connector;
typedef struct {
@@ -878,11 +879,34 @@ static void ssl_channel_check_peer(grpc_security_connector* sc, tsi_peer peer,
grpc_closure* on_peer_checked) {
grpc_ssl_channel_security_connector* c =
reinterpret_cast<grpc_ssl_channel_security_connector*>(sc);
- grpc_error* error = ssl_check_peer(sc,
- c->overridden_target_name != nullptr
- ? c->overridden_target_name
- : c->target_name,
- &peer, auth_context);
+ const char* target_name = c->overridden_target_name != nullptr
+ ? c->overridden_target_name
+ : c->target_name;
+ grpc_error* error = ssl_check_peer(sc, target_name, &peer, auth_context);
+ if (error == GRPC_ERROR_NONE &&
+ c->verify_options->verify_peer_callback != nullptr) {
+ const tsi_peer_property* p =
+ tsi_peer_get_property_by_name(&peer, TSI_X509_PEM_CERT_PROPERTY);
+ if (p == nullptr) {
+ error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Cannot check peer: missing pem cert property.");
+ } else {
+ char* peer_pem = static_cast<char*>(gpr_malloc(p->value.length + 1));
+ memcpy(peer_pem, p->value.data, p->value.length);
+ peer_pem[p->value.length] = '\0';
+ int callback_status = c->verify_options->verify_peer_callback(
+ target_name, peer_pem,
+ c->verify_options->verify_peer_callback_userdata);
+ gpr_free(peer_pem);
+ if (callback_status) {
+ char* msg;
+ gpr_asprintf(&msg, "Verify peer callback returned a failure (%d)",
+ callback_status);
+ error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
+ gpr_free(msg);
+ }
+ }
+ }
GRPC_CLOSURE_SCHED(on_peer_checked, error);
tsi_peer_destruct(&peer);
}
@@ -1047,6 +1071,7 @@ grpc_security_status grpc_ssl_channel_security_connector_create(
if (overridden_target_name != nullptr) {
c->overridden_target_name = gpr_strdup(overridden_target_name);
}
+ c->verify_options = &config->verify_options;
has_key_cert_pair = config->pem_key_cert_pair != nullptr &&
config->pem_key_cert_pair->private_key != nullptr &&
diff --git a/src/core/lib/security/security_connector/security_connector.h b/src/core/lib/security/security_connector/security_connector.h
index f9723166d0..67a506b576 100644
--- a/src/core/lib/security/security_connector/security_connector.h
+++ b/src/core/lib/security/security_connector/security_connector.h
@@ -193,6 +193,7 @@ grpc_server_security_connector* grpc_fake_server_security_connector_create(
typedef struct {
tsi_ssl_pem_key_cert_pair* pem_key_cert_pair;
char* pem_root_certs;
+ verify_peer_options verify_options;
} grpc_ssl_config;
/* Creates an SSL channel_security_connector.
diff --git a/src/core/lib/security/transport/server_auth_filter.cc b/src/core/lib/security/transport/server_auth_filter.cc
index a560a4a02e..0bf91d219e 100644
--- a/src/core/lib/security/transport/server_auth_filter.cc
+++ b/src/core/lib/security/transport/server_auth_filter.cc
@@ -214,7 +214,7 @@ static grpc_error* init_call_elem(grpc_call_element* elem,
// Create server security context. Set its auth context from channel
// data and save it in the call context.
grpc_server_security_context* server_ctx =
- grpc_server_security_context_create();
+ grpc_server_security_context_create(args->arena);
server_ctx->auth_context = grpc_auth_context_create(chand->auth_context);
calld->auth_context = server_ctx->auth_context;
if (args->context[GRPC_CONTEXT_SECURITY].value != nullptr) {
diff --git a/src/core/lib/security/util/json_util.cc b/src/core/lib/security/util/json_util.cc
index 75512a19c9..fe9f5fe3d3 100644
--- a/src/core/lib/security/util/json_util.cc
+++ b/src/core/lib/security/util/json_util.cc
@@ -29,6 +29,10 @@ const char* grpc_json_get_string_property(const grpc_json* json,
const char* prop_name) {
grpc_json* child;
for (child = json->child; child != nullptr; child = child->next) {
+ if (child->key == nullptr) {
+ gpr_log(GPR_ERROR, "Invalid (null) JSON key encountered");
+ return nullptr;
+ }
if (strcmp(child->key, prop_name) == 0) break;
}
if (child == nullptr || child->type != GRPC_JSON_STRING) {
diff --git a/src/core/lib/slice/slice_buffer.cc b/src/core/lib/slice/slice_buffer.cc
index fd56997388..1f1c08b159 100644
--- a/src/core/lib/slice/slice_buffer.cc
+++ b/src/core/lib/slice/slice_buffer.cc
@@ -333,14 +333,26 @@ void grpc_slice_buffer_trim_end(grpc_slice_buffer* sb, size_t n,
size_t slice_len = GRPC_SLICE_LENGTH(slice);
if (slice_len > n) {
sb->slices[idx] = grpc_slice_split_head(&slice, slice_len - n);
- grpc_slice_buffer_add_indexed(garbage, slice);
+ if (garbage) {
+ grpc_slice_buffer_add_indexed(garbage, slice);
+ } else {
+ grpc_slice_unref_internal(slice);
+ }
return;
} else if (slice_len == n) {
- grpc_slice_buffer_add_indexed(garbage, slice);
+ if (garbage) {
+ grpc_slice_buffer_add_indexed(garbage, slice);
+ } else {
+ grpc_slice_unref_internal(slice);
+ }
sb->count = idx;
return;
} else {
- grpc_slice_buffer_add_indexed(garbage, slice);
+ if (garbage) {
+ grpc_slice_buffer_add_indexed(garbage, slice);
+ } else {
+ grpc_slice_unref_internal(slice);
+ }
n -= slice_len;
sb->count = idx;
}
diff --git a/src/core/lib/surface/call.cc b/src/core/lib/surface/call.cc
index 86e0afa6ee..3f26b05c34 100644
--- a/src/core/lib/surface/call.cc
+++ b/src/core/lib/surface/call.cc
@@ -233,6 +233,7 @@ struct grpc_call {
grpc_closure receiving_slice_ready;
grpc_closure receiving_stream_ready;
grpc_closure receiving_initial_metadata_ready;
+ grpc_closure receiving_trailing_metadata_ready;
uint32_t test_only_last_message_flags;
grpc_closure release_call;
@@ -270,8 +271,17 @@ struct grpc_call {
grpc_core::TraceFlag grpc_call_error_trace(false, "call_error");
grpc_core::TraceFlag grpc_compression_trace(false, "compression");
-#define CALL_STACK_FROM_CALL(call) ((grpc_call_stack*)((call) + 1))
-#define CALL_FROM_CALL_STACK(call_stack) (((grpc_call*)(call_stack)) - 1)
+/* Given a size, round up to the next multiple of sizeof(void*) */
+#define ROUND_UP_TO_ALIGNMENT_SIZE(x) \
+ (((x) + GPR_MAX_ALIGNMENT - 1u) & ~(GPR_MAX_ALIGNMENT - 1u))
+
+#define CALL_STACK_FROM_CALL(call) \
+ (grpc_call_stack*)((char*)(call) + \
+ ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(grpc_call)))
+#define CALL_FROM_CALL_STACK(call_stack) \
+ (grpc_call*)(((char*)(call_stack)) - \
+ ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(grpc_call)))
+
#define CALL_ELEM_FROM_CALL(call, idx) \
grpc_call_stack_element(CALL_STACK_FROM_CALL(call), idx)
#define CALL_FROM_TOP_ELEM(top_elem) \
@@ -342,8 +352,9 @@ grpc_error* grpc_call_create(const grpc_call_create_args* args,
size_t initial_size = grpc_channel_get_call_size_estimate(args->channel);
GRPC_STATS_INC_CALL_INITIAL_SIZE(initial_size);
gpr_arena* arena = gpr_arena_create(initial_size);
- call = static_cast<grpc_call*>(gpr_arena_alloc(
- arena, sizeof(grpc_call) + channel_stack->call_stack_size));
+ call = static_cast<grpc_call*>(
+ gpr_arena_alloc(arena, ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(grpc_call)) +
+ channel_stack->call_stack_size));
gpr_ref_init(&call->ext_ref, 1);
call->arena = arena;
grpc_call_combiner_init(&call->call_combiner);
@@ -478,6 +489,12 @@ grpc_error* grpc_call_create(const grpc_call_create_args* args,
&call->pollent);
}
+ grpc_core::channelz::ChannelNode* channelz_channel =
+ grpc_channel_get_channelz_node(call->channel);
+ if (channelz_channel != nullptr) {
+ channelz_channel->RecordCallStarted();
+ }
+
grpc_slice_unref_internal(path);
return error;
@@ -516,12 +533,10 @@ static void release_call(void* call, grpc_error* error) {
grpc_call* c = static_cast<grpc_call*>(call);
grpc_channel* channel = c->channel;
grpc_call_combiner_destroy(&c->call_combiner);
- gpr_free((char*)c->peer_string);
grpc_channel_update_call_size_estimate(channel, gpr_arena_destroy(c->arena));
GRPC_CHANNEL_INTERNAL_UNREF(channel, "call");
}
-static void set_status_value_directly(grpc_status_code status, void* dest);
static void destroy_call(void* call, grpc_error* error) {
GPR_TIMER_SCOPE("destroy_call", 0);
size_t i;
@@ -1077,13 +1092,12 @@ static void recv_trailing_filter(void* args, grpc_metadata_batch* b) {
if (b->idx.named.grpc_status != nullptr) {
grpc_status_code status_code =
grpc_get_status_code_from_metadata(b->idx.named.grpc_status->md);
- grpc_error* error =
- status_code == GRPC_STATUS_OK
- ? GRPC_ERROR_NONE
- : grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Error received from peer"),
- GRPC_ERROR_INT_GRPC_STATUS,
- static_cast<intptr_t>(status_code));
+ grpc_error* error = GRPC_ERROR_NONE;
+ if (status_code != GRPC_STATUS_OK) {
+ error = grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Error received from peer"),
+ GRPC_ERROR_INT_GRPC_STATUS, static_cast<intptr_t>(status_code));
+ }
if (b->idx.named.grpc_message != nullptr) {
error = grpc_error_set_str(
error, GRPC_ERROR_STR_GRPC_MESSAGE,
@@ -1099,6 +1113,8 @@ static void recv_trailing_filter(void* args, grpc_metadata_batch* b) {
publish_app_metadata(call, b, true);
}
+gpr_arena* grpc_call_get_arena(grpc_call* call) { return call->arena; }
+
grpc_call_stack* grpc_call_get_call_stack(grpc_call* call) {
return CALL_STACK_FROM_CALL(call);
}
@@ -1210,7 +1226,6 @@ static void post_batch_completion(batch_control* bctl) {
if (bctl->op.send_initial_metadata) {
grpc_metadata_batch_destroy(
-
&call->metadata_batch[0 /* is_receiving */][0 /* is_trailing */]);
}
if (bctl->op.send_message) {
@@ -1218,14 +1233,9 @@ static void post_batch_completion(batch_control* bctl) {
}
if (bctl->op.send_trailing_metadata) {
grpc_metadata_batch_destroy(
-
&call->metadata_batch[0 /* is_receiving */][1 /* is_trailing */]);
}
if (bctl->op.recv_trailing_metadata) {
- grpc_metadata_batch* md =
- &call->metadata_batch[1 /* is_receiving */][1 /* is_trailing */];
- recv_trailing_filter(call, md);
-
/* propagate cancellation to any interested children */
gpr_atm_rel_store(&call->received_final_op_atm, 1);
parent_call* pc = get_parent_call(call);
@@ -1247,7 +1257,6 @@ static void post_batch_completion(batch_control* bctl) {
}
gpr_mu_unlock(&pc->child_list_mu);
}
-
if (call->is_client) {
get_final_status(call, set_status_value_directly,
call->final_op.client.status,
@@ -1257,7 +1266,15 @@ static void post_batch_completion(batch_control* bctl) {
get_final_status(call, set_cancelled_value,
call->final_op.server.cancelled, nullptr, nullptr);
}
-
+ grpc_core::channelz::ChannelNode* channelz_channel =
+ grpc_channel_get_channelz_node(call->channel);
+ if (channelz_channel != nullptr) {
+ if (*call->final_op.client.status != GRPC_STATUS_OK) {
+ channelz_channel->RecordCallFailed();
+ } else {
+ channelz_channel->RecordCallSucceeded();
+ }
+ }
GRPC_ERROR_UNREF(error);
error = GRPC_ERROR_NONE;
}
@@ -1539,6 +1556,17 @@ static void receiving_initial_metadata_ready(void* bctlp, grpc_error* error) {
finish_batch_step(bctl);
}
+static void receiving_trailing_metadata_ready(void* bctlp, grpc_error* error) {
+ batch_control* bctl = static_cast<batch_control*>(bctlp);
+ grpc_call* call = bctl->call;
+ GRPC_CALL_COMBINER_STOP(&call->call_combiner, "recv_trailing_metadata_ready");
+ add_batch_error(bctl, GRPC_ERROR_REF(error), false);
+ grpc_metadata_batch* md =
+ &call->metadata_batch[1 /* is_receiving */][1 /* is_trailing */];
+ recv_trailing_filter(call, md);
+ finish_batch_step(bctl);
+}
+
static void finish_batch(void* bctlp, grpc_error* error) {
batch_control* bctl = static_cast<batch_control*>(bctlp);
grpc_call* call = bctl->call;
@@ -1559,7 +1587,8 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
size_t i;
const grpc_op* op;
batch_control* bctl;
- int num_completion_callbacks_needed = 1;
+ bool has_send_ops = false;
+ int num_recv_ops = 0;
grpc_call_error error = GRPC_CALL_OK;
grpc_transport_stream_op_batch* stream_op;
grpc_transport_stream_op_batch_payload* stream_op_payload;
@@ -1665,6 +1694,7 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
stream_op_payload->send_initial_metadata.peer_string =
&call->peer_string;
}
+ has_send_ops = true;
break;
}
case GRPC_OP_SEND_MESSAGE: {
@@ -1694,6 +1724,7 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
&op->data.send_message.send_message->data.raw.slice_buffer, flags);
stream_op_payload->send_message.send_message.reset(
call->sending_stream.get());
+ has_send_ops = true;
break;
}
case GRPC_OP_SEND_CLOSE_FROM_CLIENT: {
@@ -1714,6 +1745,7 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
call->sent_final_op = true;
stream_op_payload->send_trailing_metadata.send_trailing_metadata =
&call->metadata_batch[0 /* is_receiving */][1 /* is_trailing */];
+ has_send_ops = true;
break;
}
case GRPC_OP_SEND_STATUS_FROM_SERVER: {
@@ -1778,6 +1810,7 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
}
stream_op_payload->send_trailing_metadata.send_trailing_metadata =
&call->metadata_batch[0 /* is_receiving */][1 /* is_trailing */];
+ has_send_ops = true;
break;
}
case GRPC_OP_RECV_INITIAL_METADATA: {
@@ -1805,7 +1838,7 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
stream_op_payload->recv_initial_metadata.peer_string =
&call->peer_string;
}
- num_completion_callbacks_needed++;
+ ++num_recv_ops;
break;
}
case GRPC_OP_RECV_MESSAGE: {
@@ -1827,7 +1860,7 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
grpc_schedule_on_exec_ctx);
stream_op_payload->recv_message.recv_message_ready =
&call->receiving_stream_ready;
- num_completion_callbacks_needed++;
+ ++num_recv_ops;
break;
}
case GRPC_OP_RECV_STATUS_ON_CLIENT: {
@@ -1853,11 +1886,16 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
call->final_op.client.error_string =
op->data.recv_status_on_client.error_string;
stream_op->recv_trailing_metadata = true;
- stream_op->collect_stats = true;
stream_op_payload->recv_trailing_metadata.recv_trailing_metadata =
&call->metadata_batch[1 /* is_receiving */][1 /* is_trailing */];
- stream_op_payload->collect_stats.collect_stats =
+ stream_op_payload->recv_trailing_metadata.collect_stats =
&call->final_info.stats.transport_stream_stats;
+ GRPC_CLOSURE_INIT(&call->receiving_trailing_metadata_ready,
+ receiving_trailing_metadata_ready, bctl,
+ grpc_schedule_on_exec_ctx);
+ stream_op_payload->recv_trailing_metadata.recv_trailing_metadata_ready =
+ &call->receiving_trailing_metadata_ready;
+ ++num_recv_ops;
break;
}
case GRPC_OP_RECV_CLOSE_ON_SERVER: {
@@ -1878,11 +1916,16 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
call->final_op.server.cancelled =
op->data.recv_close_on_server.cancelled;
stream_op->recv_trailing_metadata = true;
- stream_op->collect_stats = true;
stream_op_payload->recv_trailing_metadata.recv_trailing_metadata =
&call->metadata_batch[1 /* is_receiving */][1 /* is_trailing */];
- stream_op_payload->collect_stats.collect_stats =
+ stream_op_payload->recv_trailing_metadata.collect_stats =
&call->final_info.stats.transport_stream_stats;
+ GRPC_CLOSURE_INIT(&call->receiving_trailing_metadata_ready,
+ receiving_trailing_metadata_ready, bctl,
+ grpc_schedule_on_exec_ctx);
+ stream_op_payload->recv_trailing_metadata.recv_trailing_metadata_ready =
+ &call->receiving_trailing_metadata_ready;
+ ++num_recv_ops;
break;
}
}
@@ -1892,13 +1935,15 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
if (!is_notify_tag_closure) {
GPR_ASSERT(grpc_cq_begin_op(call->cq, notify_tag));
}
- gpr_ref_init(&bctl->steps_to_complete, num_completion_callbacks_needed);
+ gpr_ref_init(&bctl->steps_to_complete, (has_send_ops ? 1 : 0) + num_recv_ops);
- GRPC_CLOSURE_INIT(&bctl->finish_batch, finish_batch, bctl,
- grpc_schedule_on_exec_ctx);
- stream_op->on_complete = &bctl->finish_batch;
- gpr_atm_rel_store(&call->any_ops_sent_atm, 1);
+ if (has_send_ops) {
+ GRPC_CLOSURE_INIT(&bctl->finish_batch, finish_batch, bctl,
+ grpc_schedule_on_exec_ctx);
+ stream_op->on_complete = &bctl->finish_batch;
+ }
+ gpr_atm_rel_store(&call->any_ops_sent_atm, 1);
execute_batch(call, stream_op, &bctl->start_batch);
done:
diff --git a/src/core/lib/surface/call.h b/src/core/lib/surface/call.h
index e000f13e7d..b3b06059d4 100644
--- a/src/core/lib/surface/call.h
+++ b/src/core/lib/surface/call.h
@@ -71,6 +71,8 @@ void grpc_call_internal_unref(grpc_call* call);
#define GRPC_CALL_INTERNAL_UNREF(call, reason) grpc_call_internal_unref(call)
#endif
+gpr_arena* grpc_call_get_arena(grpc_call* call);
+
grpc_call_stack* grpc_call_get_call_stack(grpc_call* call);
grpc_call_error grpc_call_start_batch_and_execute(grpc_call* call,
diff --git a/src/core/lib/surface/channel.cc b/src/core/lib/surface/channel.cc
index a466b325be..d5d75fcb2a 100644
--- a/src/core/lib/surface/channel.cc
+++ b/src/core/lib/surface/channel.cc
@@ -32,6 +32,7 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_trace.h"
+#include "src/core/lib/channel/channelz.h"
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/manual_constructor.h"
@@ -66,7 +67,7 @@ struct grpc_channel {
gpr_mu registered_call_mu;
registered_call* registered_calls;
- grpc_core::RefCountedPtr<grpc_core::ChannelTrace> tracer;
+ grpc_core::RefCountedPtr<grpc_core::channelz::ChannelNode> channelz_channel;
char* target;
};
@@ -103,6 +104,7 @@ grpc_channel* grpc_channel_create_with_builder(
channel->target = target;
channel->is_client = grpc_channel_stack_type_is_client(channel_stack_type);
size_t channel_tracer_max_nodes = 0; // default to off
+ bool channelz_enabled = false;
gpr_mu_init(&channel->registered_call_mu);
channel->registered_calls = nullptr;
@@ -141,15 +143,20 @@ grpc_channel* grpc_channel_create_with_builder(
const grpc_integer_options options = {0, 0, INT_MAX};
channel_tracer_max_nodes =
(size_t)grpc_channel_arg_get_integer(&args->args[i], options);
+ } else if (0 == strcmp(args->args[i].key, GRPC_ARG_ENABLE_CHANNELZ)) {
+ channelz_enabled = grpc_channel_arg_get_bool(&args->args[i], false);
}
}
grpc_channel_args_destroy(args);
- channel->tracer = grpc_core::MakeRefCounted<grpc_core::ChannelTrace>(
- channel_tracer_max_nodes);
- channel->tracer->AddTraceEvent(
- grpc_core::ChannelTrace::Severity::Info,
- grpc_slice_from_static_string("Channel created"));
+ if (channelz_enabled) {
+ channel->channelz_channel =
+ grpc_core::MakeRefCounted<grpc_core::channelz::ChannelNode>(
+ channel, channel_tracer_max_nodes);
+ channel->channelz_channel->trace()->AddTraceEvent(
+ grpc_core::channelz::ChannelTrace::Severity::Info,
+ grpc_slice_from_static_string("Channel created"));
+ }
return channel;
}
@@ -184,12 +191,9 @@ static grpc_channel_args* build_channel_args(
return grpc_channel_args_copy_and_add(input_args, new_args, num_new_args);
}
-char* grpc_channel_get_trace(grpc_channel* channel) {
- return channel->tracer->RenderTrace();
-}
-
-intptr_t grpc_channel_get_uuid(grpc_channel* channel) {
- return channel->tracer->GetUuid();
+grpc_core::channelz::ChannelNode* grpc_channel_get_channelz_node(
+ grpc_channel* channel) {
+ return channel->channelz_channel.get();
}
grpc_channel* grpc_channel_create(const char* target,
@@ -395,6 +399,10 @@ void grpc_channel_internal_unref(grpc_channel* c REF_ARG) {
static void destroy_channel(void* arg, grpc_error* error) {
grpc_channel* channel = static_cast<grpc_channel*>(arg);
+ if (channel->channelz_channel != nullptr) {
+ channel->channelz_channel->set_channel_destroyed();
+ channel->channelz_channel.reset();
+ }
grpc_channel_stack_destroy(CHANNEL_STACK_FROM_CHANNEL(channel));
while (channel->registered_calls) {
registered_call* rc = channel->registered_calls;
@@ -403,7 +411,6 @@ static void destroy_channel(void* arg, grpc_error* error) {
GRPC_MDELEM_UNREF(rc->authority);
gpr_free(rc);
}
- channel->tracer.reset();
gpr_mu_destroy(&channel->registered_call_mu);
gpr_free(channel->target);
gpr_free(channel);
diff --git a/src/core/lib/surface/channel.h b/src/core/lib/surface/channel.h
index 288313951e..e5ff2c3596 100644
--- a/src/core/lib/surface/channel.h
+++ b/src/core/lib/surface/channel.h
@@ -23,6 +23,7 @@
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/channel_stack_builder.h"
+#include "src/core/lib/channel/channelz.h"
#include "src/core/lib/surface/channel_stack_type.h"
grpc_channel* grpc_channel_create(const char* target,
@@ -50,6 +51,9 @@ grpc_call* grpc_channel_create_pollset_set_call(
/** Get a (borrowed) pointer to this channels underlying channel stack */
grpc_channel_stack* grpc_channel_get_channel_stack(grpc_channel* channel);
+grpc_core::channelz::ChannelNode* grpc_channel_get_channelz_node(
+ grpc_channel* channel);
+
/** Get a grpc_mdelem of grpc-status: X where X is the numeric value of
status_code.
diff --git a/src/core/lib/surface/version.cc b/src/core/lib/surface/version.cc
index 306b7c395e..ac8cec2980 100644
--- a/src/core/lib/surface/version.cc
+++ b/src/core/lib/surface/version.cc
@@ -25,4 +25,4 @@
const char* grpc_version_string(void) { return "6.0.0-dev"; }
-const char* grpc_g_stands_for(void) { return "gloriosa"; }
+const char* grpc_g_stands_for(void) { return "gladiolus"; }
diff --git a/src/core/lib/transport/transport.cc b/src/core/lib/transport/transport.cc
index 6b41e4b37e..cbdb77c844 100644
--- a/src/core/lib/transport/transport.cc
+++ b/src/core/lib/transport/transport.cc
@@ -184,7 +184,8 @@ void grpc_transport_set_pops(grpc_transport* transport, grpc_stream* stream,
nullptr) {
transport->vtable->set_pollset_set(transport, stream, pollset_set);
} else {
- abort();
+ // No-op for empty pollset. Empty pollset is possible when using
+ // non-fd-based event engines such as CFStream.
}
}
@@ -211,21 +212,32 @@ void grpc_transport_stream_op_batch_finish_with_failure(
if (batch->send_message) {
batch->payload->send_message.send_message.reset();
}
- if (batch->recv_message) {
- GRPC_CALL_COMBINER_START(
- call_combiner, batch->payload->recv_message.recv_message_ready,
- GRPC_ERROR_REF(error), "failing recv_message_ready");
+ if (batch->cancel_stream) {
+ GRPC_ERROR_UNREF(batch->payload->cancel_stream.cancel_error);
}
+ // Construct a list of closures to execute.
+ grpc_core::CallCombinerClosureList closures;
if (batch->recv_initial_metadata) {
- GRPC_CALL_COMBINER_START(
- call_combiner,
+ closures.Add(
batch->payload->recv_initial_metadata.recv_initial_metadata_ready,
GRPC_ERROR_REF(error), "failing recv_initial_metadata_ready");
}
- GRPC_CLOSURE_SCHED(batch->on_complete, error);
- if (batch->cancel_stream) {
- GRPC_ERROR_UNREF(batch->payload->cancel_stream.cancel_error);
+ if (batch->recv_message) {
+ closures.Add(batch->payload->recv_message.recv_message_ready,
+ GRPC_ERROR_REF(error), "failing recv_message_ready");
+ }
+ if (batch->recv_trailing_metadata) {
+ closures.Add(
+ batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready,
+ GRPC_ERROR_REF(error), "failing recv_trailing_metadata_ready");
+ }
+ if (batch->on_complete != nullptr) {
+ closures.Add(batch->on_complete, GRPC_ERROR_REF(error),
+ "failing on_complete");
}
+ // Execute closures.
+ closures.RunClosures(call_combiner);
+ GRPC_ERROR_UNREF(error);
}
typedef struct {
diff --git a/src/core/lib/transport/transport.h b/src/core/lib/transport/transport.h
index 10e9df0f7c..585b9dfae9 100644
--- a/src/core/lib/transport/transport.h
+++ b/src/core/lib/transport/transport.h
@@ -122,9 +122,15 @@ typedef struct grpc_transport_stream_op_batch_payload
/* Transport stream op: a set of operations to perform on a transport
against a single stream */
typedef struct grpc_transport_stream_op_batch {
- /** Should be enqueued when all requested operations (excluding recv_message
- and recv_initial_metadata which have their own closures) in a given batch
- have been completed. */
+ /** Should be scheduled when all of the non-recv operations in the batch
+ are complete.
+
+ The recv ops (recv_initial_metadata, recv_message, and
+ recv_trailing_metadata) each have their own callbacks. If a batch
+ contains both recv ops and non-recv ops, on_complete should be
+ scheduled as soon as the non-recv ops are complete, regardless of
+ whether or not the recv ops are complete. If a batch contains
+ only recv ops, on_complete can be null. */
grpc_closure* on_complete;
/** Values for the stream op (fields set are determined by flags above) */
@@ -149,9 +155,6 @@ typedef struct grpc_transport_stream_op_batch {
*/
bool recv_trailing_metadata : 1;
- /** Collect any stats into provided buffer, zero internal stat counters */
- bool collect_stats : 1;
-
/** Cancel this stream with the provided error */
bool cancel_stream : 1;
@@ -168,13 +171,11 @@ struct grpc_transport_stream_op_batch_payload {
/** Iff send_initial_metadata != NULL, flags associated with
send_initial_metadata: a bitfield of GRPC_INITIAL_METADATA_xxx */
uint32_t send_initial_metadata_flags;
- // If non-NULL, will be set by the transport to the peer string
- // (a char*, which the caller takes ownership of).
+ // If non-NULL, will be set by the transport to the peer string (a char*).
+ // The transport retains ownership of the string.
// Note: This pointer may be used by the transport after the
// send_initial_metadata op is completed. It must remain valid
// until the call is destroyed.
- // Note: When a transport sets this, it must free the previous
- // value, if any.
gpr_atm* peer_string;
} send_initial_metadata;
@@ -202,13 +203,11 @@ struct grpc_transport_stream_op_batch_payload {
// immediately available. This may be a signal that we received a
// Trailers-Only response.
bool* trailing_metadata_available;
- // If non-NULL, will be set by the transport to the peer string
- // (a char*, which the caller takes ownership of).
+ // If non-NULL, will be set by the transport to the peer string (a char*).
+ // The transport retains ownership of the string.
// Note: This pointer may be used by the transport after the
// recv_initial_metadata op is completed. It must remain valid
// until the call is destroyed.
- // Note: When a transport sets this, it must free the previous
- // value, if any.
gpr_atm* peer_string;
} recv_initial_metadata;
@@ -223,11 +222,10 @@ struct grpc_transport_stream_op_batch_payload {
struct {
grpc_metadata_batch* recv_trailing_metadata;
- } recv_trailing_metadata;
-
- struct {
grpc_transport_stream_stats* collect_stats;
- } collect_stats;
+ /** Should be enqueued when initial metadata is ready to be processed. */
+ grpc_closure* recv_trailing_metadata_ready;
+ } recv_trailing_metadata;
/** Forcefully close this stream.
The HTTP2 semantics should be:
diff --git a/src/core/lib/transport/transport_op_string.cc b/src/core/lib/transport/transport_op_string.cc
index 25ab492f3a..8c7db642a5 100644
--- a/src/core/lib/transport/transport_op_string.cc
+++ b/src/core/lib/transport/transport_op_string.cc
@@ -120,13 +120,6 @@ char* grpc_transport_stream_op_batch_string(
gpr_strvec_add(&b, tmp);
}
- if (op->collect_stats) {
- gpr_strvec_add(&b, gpr_strdup(" "));
- gpr_asprintf(&tmp, "COLLECT_STATS:%p",
- op->payload->collect_stats.collect_stats);
- gpr_strvec_add(&b, tmp);
- }
-
out = gpr_strvec_flatten(&b, nullptr);
gpr_strvec_destroy(&b);
diff --git a/src/core/plugin_registry/grpc_cronet_plugin_registry.cc b/src/core/plugin_registry/grpc_cronet_plugin_registry.cc
index 49b9c7d4fe..c0c17b0a4b 100644
--- a/src/core/plugin_registry/grpc_cronet_plugin_registry.cc
+++ b/src/core/plugin_registry/grpc_cronet_plugin_registry.cc
@@ -30,8 +30,6 @@ void grpc_client_channel_init(void);
void grpc_client_channel_shutdown(void);
void grpc_tsi_alts_init(void);
void grpc_tsi_alts_shutdown(void);
-void grpc_server_load_reporting_plugin_init(void);
-void grpc_server_load_reporting_plugin_shutdown(void);
void grpc_register_built_in_plugins(void) {
grpc_register_plugin(grpc_http_filters_init,
@@ -44,6 +42,4 @@ void grpc_register_built_in_plugins(void) {
grpc_client_channel_shutdown);
grpc_register_plugin(grpc_tsi_alts_init,
grpc_tsi_alts_shutdown);
- grpc_register_plugin(grpc_server_load_reporting_plugin_init,
- grpc_server_load_reporting_plugin_shutdown);
}
diff --git a/src/core/plugin_registry/grpc_plugin_registry.cc b/src/core/plugin_registry/grpc_plugin_registry.cc
index e371310fa1..fb523a173d 100644
--- a/src/core/plugin_registry/grpc_plugin_registry.cc
+++ b/src/core/plugin_registry/grpc_plugin_registry.cc
@@ -46,8 +46,6 @@ void grpc_resolver_dns_native_init(void);
void grpc_resolver_dns_native_shutdown(void);
void grpc_resolver_sockaddr_init(void);
void grpc_resolver_sockaddr_shutdown(void);
-void grpc_server_load_reporting_plugin_init(void);
-void grpc_server_load_reporting_plugin_shutdown(void);
void grpc_max_age_filter_init(void);
void grpc_max_age_filter_shutdown(void);
void grpc_message_size_filter_init(void);
@@ -84,8 +82,6 @@ void grpc_register_built_in_plugins(void) {
grpc_resolver_dns_native_shutdown);
grpc_register_plugin(grpc_resolver_sockaddr_init,
grpc_resolver_sockaddr_shutdown);
- grpc_register_plugin(grpc_server_load_reporting_plugin_init,
- grpc_server_load_reporting_plugin_shutdown);
grpc_register_plugin(grpc_max_age_filter_init,
grpc_max_age_filter_shutdown);
grpc_register_plugin(grpc_message_size_filter_init,
diff --git a/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc b/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
index 283db5b4f4..80214aebe2 100644
--- a/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
+++ b/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
@@ -38,8 +38,6 @@ void grpc_resolver_sockaddr_init(void);
void grpc_resolver_sockaddr_shutdown(void);
void grpc_resolver_fake_init(void);
void grpc_resolver_fake_shutdown(void);
-void grpc_server_load_reporting_plugin_init(void);
-void grpc_server_load_reporting_plugin_shutdown(void);
void grpc_lb_policy_grpclb_init(void);
void grpc_lb_policy_grpclb_shutdown(void);
void grpc_lb_policy_pick_first_init(void);
@@ -74,8 +72,6 @@ void grpc_register_built_in_plugins(void) {
grpc_resolver_sockaddr_shutdown);
grpc_register_plugin(grpc_resolver_fake_init,
grpc_resolver_fake_shutdown);
- grpc_register_plugin(grpc_server_load_reporting_plugin_init,
- grpc_server_load_reporting_plugin_shutdown);
grpc_register_plugin(grpc_lb_policy_grpclb_init,
grpc_lb_policy_grpclb_shutdown);
grpc_register_plugin(grpc_lb_policy_pick_first_init,
diff --git a/src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h b/src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h
index 8fe8f73f8b..966ea45617 100644
--- a/src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h
+++ b/src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h
@@ -21,8 +21,8 @@
#include <grpc/support/port_platform.h>
-#include "third_party/nanopb/pb_decode.h"
-#include "third_party/nanopb/pb_encode.h"
+#include "pb_decode.h"
+#include "pb_encode.h"
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
diff --git a/src/core/tsi/alts/handshaker/altscontext.pb.c b/src/core/tsi/alts/handshaker/altscontext.pb.c
index 81a82f5992..5fb152a558 100644
--- a/src/core/tsi/alts/handshaker/altscontext.pb.c
+++ b/src/core/tsi/alts/handshaker/altscontext.pb.c
@@ -2,7 +2,6 @@
/* Generated by nanopb-0.3.7-dev */
#include "src/core/tsi/alts/handshaker/altscontext.pb.h"
-
/* @@protoc_insertion_point(includes) */
#if PB_PROTO_HEADER_VERSION != 30
#error Regenerate this file with the current version of nanopb generator.
diff --git a/src/core/tsi/alts/handshaker/altscontext.pb.h b/src/core/tsi/alts/handshaker/altscontext.pb.h
index 3e72d7f678..632b20c0e2 100644
--- a/src/core/tsi/alts/handshaker/altscontext.pb.h
+++ b/src/core/tsi/alts/handshaker/altscontext.pb.h
@@ -3,9 +3,8 @@
#ifndef PB_GRPC_GCP_ALTSCONTEXT_PB_H_INCLUDED
#define PB_GRPC_GCP_ALTSCONTEXT_PB_H_INCLUDED
-#include "third_party/nanopb/pb.h"
+#include "pb.h"
#include "src/core/tsi/alts/handshaker/transport_security_common.pb.h"
-
/* @@protoc_insertion_point(includes) */
#if PB_PROTO_HEADER_VERSION != 30
#error Regenerate this file with the current version of nanopb generator.
diff --git a/src/core/tsi/alts/handshaker/handshaker.pb.c b/src/core/tsi/alts/handshaker/handshaker.pb.c
index bd992dfa4a..5450b1602d 100644
--- a/src/core/tsi/alts/handshaker/handshaker.pb.c
+++ b/src/core/tsi/alts/handshaker/handshaker.pb.c
@@ -2,7 +2,6 @@
/* Generated by nanopb-0.3.7-dev */
#include "src/core/tsi/alts/handshaker/handshaker.pb.h"
-
/* @@protoc_insertion_point(includes) */
#if PB_PROTO_HEADER_VERSION != 30
#error Regenerate this file with the current version of nanopb generator.
diff --git a/src/core/tsi/alts/handshaker/handshaker.pb.h b/src/core/tsi/alts/handshaker/handshaker.pb.h
index 0805a144de..5ee42a3c69 100644
--- a/src/core/tsi/alts/handshaker/handshaker.pb.h
+++ b/src/core/tsi/alts/handshaker/handshaker.pb.h
@@ -3,9 +3,8 @@
#ifndef PB_GRPC_GCP_HANDSHAKER_PB_H_INCLUDED
#define PB_GRPC_GCP_HANDSHAKER_PB_H_INCLUDED
-#include "third_party/nanopb/pb.h"
+#include "pb.h"
#include "src/core/tsi/alts/handshaker/transport_security_common.pb.h"
-
/* @@protoc_insertion_point(includes) */
#if PB_PROTO_HEADER_VERSION != 30
#error Regenerate this file with the current version of nanopb generator.
diff --git a/src/core/tsi/alts/handshaker/transport_security_common.pb.c b/src/core/tsi/alts/handshaker/transport_security_common.pb.c
index 6063c7625e..326b1b10ab 100644
--- a/src/core/tsi/alts/handshaker/transport_security_common.pb.c
+++ b/src/core/tsi/alts/handshaker/transport_security_common.pb.c
@@ -2,7 +2,6 @@
/* Generated by nanopb-0.3.7-dev */
#include "src/core/tsi/alts/handshaker/transport_security_common.pb.h"
-
/* @@protoc_insertion_point(includes) */
#if PB_PROTO_HEADER_VERSION != 30
#error Regenerate this file with the current version of nanopb generator.
diff --git a/src/core/tsi/alts/handshaker/transport_security_common.pb.h b/src/core/tsi/alts/handshaker/transport_security_common.pb.h
index 49096dffa3..87d9abf149 100644
--- a/src/core/tsi/alts/handshaker/transport_security_common.pb.h
+++ b/src/core/tsi/alts/handshaker/transport_security_common.pb.h
@@ -3,7 +3,7 @@
#ifndef PB_GRPC_GCP_TRANSPORT_SECURITY_COMMON_PB_H_INCLUDED
#define PB_GRPC_GCP_TRANSPORT_SECURITY_COMMON_PB_H_INCLUDED
-#include "third_party/nanopb/pb.h"
+#include "pb.h"
/* @@protoc_insertion_point(includes) */
#if PB_PROTO_HEADER_VERSION != 30
#error Regenerate this file with the current version of nanopb generator.
diff --git a/src/core/tsi/alts/handshaker/transport_security_common_api.h b/src/core/tsi/alts/handshaker/transport_security_common_api.h
index 68228cb3b5..ec2a0b4b5e 100644
--- a/src/core/tsi/alts/handshaker/transport_security_common_api.h
+++ b/src/core/tsi/alts/handshaker/transport_security_common_api.h
@@ -21,8 +21,8 @@
#include <grpc/support/port_platform.h>
-#include "third_party/nanopb/pb_decode.h"
-#include "third_party/nanopb/pb_encode.h"
+#include "pb_decode.h"
+#include "pb_encode.h"
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
diff --git a/src/core/tsi/ssl_transport_security.cc b/src/core/tsi/ssl_transport_security.cc
index 8065a8b185..e66fc9ba03 100644
--- a/src/core/tsi/ssl_transport_security.cc
+++ b/src/core/tsi/ssl_transport_security.cc
@@ -260,14 +260,13 @@ static tsi_result ssl_get_x509_common_name(X509* cert, unsigned char** utf8,
X509_NAME* subject_name = X509_get_subject_name(cert);
int utf8_returned_size = 0;
if (subject_name == nullptr) {
- gpr_log(GPR_ERROR, "Could not get subject name from certificate.");
+ gpr_log(GPR_INFO, "Could not get subject name from certificate.");
return TSI_NOT_FOUND;
}
common_name_index =
X509_NAME_get_index_by_NID(subject_name, NID_commonName, -1);
if (common_name_index == -1) {
- gpr_log(GPR_ERROR,
- "Could not get common name of subject from certificate.");
+ gpr_log(GPR_INFO, "Could not get common name of subject from certificate.");
return TSI_NOT_FOUND;
}
common_name_entry = X509_NAME_get_entry(subject_name, common_name_index);
diff --git a/src/cpp/README.md b/src/cpp/README.md
index ac76bf74ed..f16cab1f44 100644
--- a/src/cpp/README.md
+++ b/src/cpp/README.md
@@ -1,13 +1,62 @@
# Overview
-This directory contains source code for C++ implementation of gRPC.
+A C++ implementation of gRPC
-To install gRPC for C++ on your system, follow the instructions to build from source
-[here](../../INSTALL.md). This also installs the protocol buffer compiler
-`protoc` (if you don't have it already), and the C++ gRPC plugin for `protoc`.
+# To start using gRPC C++
-# Documentation
+In the C++ world, there's no universally accepted standard for managing project dependencies.
+Therefore, gRPC supports several major build systems, which should satisfy most users.
+
+## bazel
+
+We recommend using Bazel for projects that use gRPC as it will give you the best developer experience
+(easy handling of dependencies that support bazel & fast builds).
+
+To add gRPC as a dependency in bazel:
+1. determine commit SHA for the grpc release you want to use
+2. Use the [http_archive](https://docs.bazel.build/versions/master/be/workspace.html#http_archive) bazel rule to include gRPC source
+ ```
+ http_archive(
+ name = "grpc",
+ urls = [
+ "https://github.com/grpc/grpc/archive/YOUR_GRPC_COMMIT_SHA.tar.gz",
+ ],
+ strip_prefix = "grpc-YOUR_GRPC_COMMIT_SHA",
+ )
+ ```
+
+NOTE: currently bazel is only supported for building gRPC on Linux.
+
+## make
+
+Currently the default choice for building on UNIX based systems is `make`.
+
+To install gRPC for C++ on your system using `make`, follow the [Building gRPC C++](../../BUILDING.md)
+instructions to build from source and then install locally using `make install`.
+This also installs the protocol buffer compiler `protoc` (if you don't have it already),
+and the C++ gRPC plugin for `protoc`.
+
+WARNING: After installing with `make install` there is no easy way to uninstall, which can cause issues
+if you later want to remove the grpc and/or protobuf installation or upgrade to a newer version.
+
+## cmake
+
+`cmake` is the default build option on Windows, but also works on Linux, MacOS. `cmake` has good
+support for crosscompiling and can be used for targeting Android platform.
+
+If your project is using cmake, there are several ways to add gRPC dependency.
+- install gRPC via cmake first and then locate it with `find_package(gRPC CONFIG)`. [Example](../../examples/cpp/helloworld/CMakeLists.txt)
+- via cmake's `ExternalProject_Add` using a technique called "superbuild". [Example](../../examples/cpp/helloworld/cmake_externalproject/CMakeLists.txt)
+- add gRPC source tree to your project (preferrably as a git submodule) and add it to your cmake project with `add_subdirectory`. [Example](../../examples/cpp/helloworld/CMakeLists.txt)
+
+## Packaging systems
+
+There's no standard packaging system for C++. We've looked into supporting some (e.g. Conan and vcpkg) but we are not there yet.
+Contributions and community-maintained packages for popular packaging systems are welcome!
+
+
+## Examples & Additional Documentation
You can find out how to build and run our simplest gRPC C++ example in our
[C++ quick start](../../examples/cpp).
@@ -25,7 +74,6 @@ documentation site at [grpc.io](https://grpc.io), specifically:
APIs.
-# Examples
+# To start developing gRPC C++
-Code examples for gRPC C++ live in this repository's
-[examples/cpp](../../examples/cpp) directory.
+For instructions on how to build gRPC C++ from source, follow the [Building gRPC C++](../../BUILDING.md) instructions.
diff --git a/src/cpp/client/secure_credentials.cc b/src/cpp/client/secure_credentials.cc
index 00245b397d..bdb6359632 100644
--- a/src/cpp/client/secure_credentials.cc
+++ b/src/cpp/client/secure_credentials.cc
@@ -83,7 +83,8 @@ std::shared_ptr<ChannelCredentials> SslCredentials(
grpc_channel_credentials* c_creds = grpc_ssl_credentials_create(
options.pem_root_certs.empty() ? nullptr : options.pem_root_certs.c_str(),
- options.pem_private_key.empty() ? nullptr : &pem_key_cert_pair, nullptr);
+ options.pem_private_key.empty() ? nullptr : &pem_key_cert_pair, nullptr,
+ nullptr);
return WrapChannelCredentials(c_creds);
}
diff --git a/src/cpp/common/channel_filter.h b/src/cpp/common/channel_filter.h
index bd0ec969b4..5e569c97e6 100644
--- a/src/cpp/common/channel_filter.h
+++ b/src/cpp/common/channel_filter.h
@@ -207,6 +207,18 @@ class TransportStreamOpBatch {
op_->payload->context[GRPC_CONTEXT_TRACING].value);
}
+ const gpr_atm* get_peer_string() const {
+ if (op_->send_initial_metadata &&
+ op_->payload->send_initial_metadata.peer_string != nullptr) {
+ return op_->payload->send_initial_metadata.peer_string;
+ } else if (op_->recv_initial_metadata &&
+ op_->payload->recv_initial_metadata.peer_string != nullptr) {
+ return op_->payload->recv_initial_metadata.peer_string;
+ } else {
+ return nullptr;
+ }
+ }
+
private:
grpc_transport_stream_op_batch* op_; // Not owned.
MetadataBatch send_initial_metadata_;
diff --git a/src/cpp/common/version_cc.cc b/src/cpp/common/version_cc.cc
index 54cd2076ec..a7b093dfd2 100644
--- a/src/cpp/common/version_cc.cc
+++ b/src/cpp/common/version_cc.cc
@@ -22,5 +22,5 @@
#include <grpcpp/grpcpp.h>
namespace grpc {
-grpc::string Version() { return "1.13.0-dev"; }
+grpc::string Version() { return "1.14.0-dev"; }
} // namespace grpc
diff --git a/src/objective-c/GRPCClient/GRPCCall+MobileLog.m b/src/cpp/ext/filters/census/channel_filter.cc
index 4dedb7de8b..4ac684d277 100644
--- a/src/objective-c/GRPCClient/GRPCCall+MobileLog.m
+++ b/src/cpp/ext/filters/census/channel_filter.cc
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2017 gRPC authors.
+ * Copyright 2018 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,18 +16,15 @@
*
*/
-#import "GRPCCall+MobileLog.h"
+#include <grpc/support/port_platform.h>
-static id globalLogConfig = nil;
+#include "src/cpp/ext/filters/census/channel_filter.h"
-@implementation GRPCCall (MobileLog)
+namespace grpc {
-+ (void)setLogConfig:(id)logConfig {
- globalLogConfig = logConfig;
+grpc_error* CensusChannelData::Init(grpc_channel_element* elem,
+ grpc_channel_element_args* args) {
+ return GRPC_ERROR_NONE;
}
-+ (id)logConfig {
- return globalLogConfig;
-}
-
-@end
+} // namespace grpc
diff --git a/test/core/statistics/multiple_writers_circular_buffer_test.cc b/src/cpp/ext/filters/census/channel_filter.h
index 6d3411289e..0b7c682681 100644
--- a/test/core/statistics/multiple_writers_circular_buffer_test.cc
+++ b/src/cpp/ext/filters/census/channel_filter.h
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015 gRPC authors.
+ * Copyright 2018 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,16 +16,21 @@
*
*/
-#include "test/core/statistics/census_log_tests.h"
+#ifndef GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_CHANNEL_FILTER_H
+#define GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_CHANNEL_FILTER_H
-#include <stdlib.h>
+#include <grpc/support/port_platform.h>
-#include <grpc/support/time.h>
-#include "test/core/util/test_config.h"
+#include "src/cpp/ext/filters/census/context.h"
-int main(int argc, char** argv) {
- grpc_test_init(argc, argv);
- srand(gpr_now(GPR_CLOCK_REALTIME).tv_nsec);
- test_multiple_writers_circular_log();
- return 0;
-}
+namespace grpc {
+
+class CensusChannelData : public ChannelData {
+ public:
+ grpc_error* Init(grpc_channel_element* elem,
+ grpc_channel_element_args* args) override;
+};
+
+} // namespace grpc
+
+#endif /* GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_CHANNEL_FILTER_H */
diff --git a/src/cpp/ext/filters/census/client_filter.cc b/src/cpp/ext/filters/census/client_filter.cc
new file mode 100644
index 0000000000..940d42d100
--- /dev/null
+++ b/src/cpp/ext/filters/census/client_filter.cc
@@ -0,0 +1,165 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#include "src/cpp/ext/filters/census/client_filter.h"
+
+#include "absl/strings/str_cat.h"
+#include "absl/strings/string_view.h"
+#include "opencensus/stats/stats.h"
+#include "src/core/lib/surface/call.h"
+#include "src/cpp/ext/filters/census/grpc_plugin.h"
+#include "src/cpp/ext/filters/census/measures.h"
+
+namespace grpc {
+
+constexpr uint32_t CensusClientCallData::kMaxTraceContextLen;
+constexpr uint32_t CensusClientCallData::kMaxTagsLen;
+
+namespace {
+
+void FilterTrailingMetadata(grpc_metadata_batch* b, uint64_t* elapsed_time) {
+ if (b->idx.named.grpc_server_stats_bin != nullptr) {
+ ServerStatsDeserialize(
+ reinterpret_cast<const char*>(GRPC_SLICE_START_PTR(
+ GRPC_MDVALUE(b->idx.named.grpc_server_stats_bin->md))),
+ GRPC_SLICE_LENGTH(GRPC_MDVALUE(b->idx.named.grpc_server_stats_bin->md)),
+ elapsed_time);
+ grpc_metadata_batch_remove(b, b->idx.named.grpc_server_stats_bin);
+ }
+}
+
+} // namespace
+
+void CensusClientCallData::OnDoneRecvTrailingMetadataCb(void* user_data,
+ grpc_error* error) {
+ grpc_call_element* elem = reinterpret_cast<grpc_call_element*>(user_data);
+ CensusClientCallData* calld =
+ reinterpret_cast<CensusClientCallData*>(elem->call_data);
+ GPR_ASSERT(calld != nullptr);
+ if (error == GRPC_ERROR_NONE) {
+ GPR_ASSERT(calld->recv_trailing_metadata_ != nullptr);
+ FilterTrailingMetadata(calld->recv_trailing_metadata_,
+ &calld->elapsed_time_);
+ }
+ GRPC_CLOSURE_RUN(calld->initial_on_done_recv_trailing_metadata_,
+ GRPC_ERROR_REF(error));
+}
+
+void CensusClientCallData::OnDoneRecvMessageCb(void* user_data,
+ grpc_error* error) {
+ grpc_call_element* elem = reinterpret_cast<grpc_call_element*>(user_data);
+ CensusClientCallData* calld =
+ reinterpret_cast<CensusClientCallData*>(elem->call_data);
+ CensusChannelData* channeld =
+ reinterpret_cast<CensusChannelData*>(elem->channel_data);
+ GPR_ASSERT(calld != nullptr);
+ GPR_ASSERT(channeld != nullptr);
+ // Stream messages are no longer valid after receiving trailing metadata.
+ if ((*calld->recv_message_) != nullptr) {
+ calld->recv_message_count_++;
+ }
+ GRPC_CLOSURE_RUN(calld->initial_on_done_recv_message_, GRPC_ERROR_REF(error));
+}
+
+void CensusClientCallData::StartTransportStreamOpBatch(
+ grpc_call_element* elem, TransportStreamOpBatch* op) {
+ if (op->send_initial_metadata() != nullptr) {
+ census_context* ctxt = op->get_census_context();
+ GenerateClientContext(
+ qualified_method_, &context_,
+ (ctxt == nullptr) ? nullptr : reinterpret_cast<CensusContext*>(ctxt));
+ size_t tracing_len = TraceContextSerialize(context_.Context(), tracing_buf_,
+ kMaxTraceContextLen);
+ if (tracing_len > 0) {
+ GRPC_LOG_IF_ERROR(
+ "census grpc_filter",
+ grpc_metadata_batch_add_tail(
+ op->send_initial_metadata()->batch(), &tracing_bin_,
+ grpc_mdelem_from_slices(
+ GRPC_MDSTR_GRPC_TRACE_BIN,
+ grpc_slice_from_copied_buffer(tracing_buf_, tracing_len))));
+ }
+ grpc_slice tags = grpc_empty_slice();
+ // TODO: Add in tagging serialization.
+ size_t encoded_tags_len = StatsContextSerialize(kMaxTagsLen, &tags);
+ if (encoded_tags_len > 0) {
+ GRPC_LOG_IF_ERROR(
+ "census grpc_filter",
+ grpc_metadata_batch_add_tail(
+ op->send_initial_metadata()->batch(), &stats_bin_,
+ grpc_mdelem_from_slices(GRPC_MDSTR_GRPC_TAGS_BIN, tags)));
+ }
+ }
+
+ if (op->send_message() != nullptr) {
+ ++sent_message_count_;
+ }
+ if (op->recv_message() != nullptr) {
+ recv_message_ = op->op()->payload->recv_message.recv_message;
+ initial_on_done_recv_message_ =
+ op->op()->payload->recv_message.recv_message_ready;
+ op->op()->payload->recv_message.recv_message_ready = &on_done_recv_message_;
+ }
+ if (op->recv_trailing_metadata() != nullptr) {
+ recv_trailing_metadata_ = op->recv_trailing_metadata()->batch();
+ initial_on_done_recv_trailing_metadata_ =
+ op->op()->payload->recv_trailing_metadata.recv_trailing_metadata_ready;
+ op->op()->payload->recv_trailing_metadata.recv_trailing_metadata_ready =
+ &on_done_recv_trailing_metadata_;
+ }
+ // Call next op.
+ grpc_call_next_op(elem, op->op());
+}
+
+grpc_error* CensusClientCallData::Init(grpc_call_element* elem,
+ const grpc_call_element_args* args) {
+ path_ = grpc_slice_ref_internal(args->path);
+ start_time_ = absl::Now();
+ method_ = GetMethod(&path_);
+ qualified_method_ = absl::StrCat("Sent.", method_);
+ GRPC_CLOSURE_INIT(&on_done_recv_message_, OnDoneRecvMessageCb, elem,
+ grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&on_done_recv_trailing_metadata_,
+ OnDoneRecvTrailingMetadataCb, elem,
+ grpc_schedule_on_exec_ctx);
+ return GRPC_ERROR_NONE;
+}
+
+void CensusClientCallData::Destroy(grpc_call_element* elem,
+ const grpc_call_final_info* final_info,
+ grpc_closure* then_call_closure) {
+ const uint64_t request_size = GetOutgoingDataSize(final_info);
+ const uint64_t response_size = GetIncomingDataSize(final_info);
+ double latency_ms = absl::ToDoubleMilliseconds(absl::Now() - start_time_);
+ ::opencensus::stats::Record(
+ {{RpcClientSentBytesPerRpc(), static_cast<double>(request_size)},
+ {RpcClientReceivedBytesPerRpc(), static_cast<double>(response_size)},
+ {RpcClientRoundtripLatency(), latency_ms},
+ {RpcClientServerLatency(),
+ ToDoubleMilliseconds(absl::Nanoseconds(elapsed_time_))},
+ {RpcClientSentMessagesPerRpc(), sent_message_count_},
+ {RpcClientReceivedMessagesPerRpc(), recv_message_count_}},
+ {{ClientMethodTagKey(), method_},
+ {ClientStatusTagKey(), StatusCodeToString(final_info->final_status)}});
+ grpc_slice_unref_internal(path_);
+ context_.EndSpan();
+}
+
+} // namespace grpc
diff --git a/src/cpp/ext/filters/census/client_filter.h b/src/cpp/ext/filters/census/client_filter.h
new file mode 100644
index 0000000000..851022873f
--- /dev/null
+++ b/src/cpp/ext/filters/census/client_filter.h
@@ -0,0 +1,104 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_CLIENT_FILTER_H
+#define GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_CLIENT_FILTER_H
+
+#include <grpc/support/port_platform.h>
+
+#include "absl/strings/string_view.h"
+#include "absl/time/time.h"
+#include "src/cpp/ext/filters/census/channel_filter.h"
+#include "src/cpp/ext/filters/census/context.h"
+
+namespace grpc {
+
+// A CallData class will be created for every grpc call within a channel. It is
+// used to store data and methods specific to that call. CensusClientCallData is
+// thread-compatible, however typically only 1 thread should be interacting with
+// a call at a time.
+class CensusClientCallData : public CallData {
+ public:
+ // Maximum size of trace context is sent on the wire.
+ static constexpr uint32_t kMaxTraceContextLen = 64;
+ // Maximum size of tags that are sent on the wire.
+ static constexpr uint32_t kMaxTagsLen = 2048;
+
+ CensusClientCallData()
+ : recv_trailing_metadata_(nullptr),
+ initial_on_done_recv_trailing_metadata_(nullptr),
+ initial_on_done_recv_message_(nullptr),
+ elapsed_time_(0),
+ recv_message_(nullptr),
+ recv_message_count_(0),
+ sent_message_count_(0) {
+ memset(&stats_bin_, 0, sizeof(grpc_linked_mdelem));
+ memset(&tracing_bin_, 0, sizeof(grpc_linked_mdelem));
+ memset(&path_, 0, sizeof(grpc_slice));
+ memset(&on_done_recv_trailing_metadata_, 0, sizeof(grpc_closure));
+ memset(&on_done_recv_message_, 0, sizeof(grpc_closure));
+ }
+
+ grpc_error* Init(grpc_call_element* elem,
+ const grpc_call_element_args* args) override;
+
+ void Destroy(grpc_call_element* elem, const grpc_call_final_info* final_info,
+ grpc_closure* then_call_closure) override;
+
+ void StartTransportStreamOpBatch(grpc_call_element* elem,
+ TransportStreamOpBatch* op) override;
+
+ static void OnDoneRecvTrailingMetadataCb(void* user_data, grpc_error* error);
+
+ static void OnDoneSendInitialMetadataCb(void* user_data, grpc_error* error);
+
+ static void OnDoneRecvMessageCb(void* user_data, grpc_error* error);
+
+ private:
+ CensusContext context_;
+ // Metadata elements for tracing and census stats data.
+ grpc_linked_mdelem stats_bin_;
+ grpc_linked_mdelem tracing_bin_;
+ // Client method.
+ absl::string_view method_;
+ std::string qualified_method_;
+ grpc_slice path_;
+ // The recv trailing metadata callbacks.
+ grpc_metadata_batch* recv_trailing_metadata_;
+ grpc_closure* initial_on_done_recv_trailing_metadata_;
+ grpc_closure on_done_recv_trailing_metadata_;
+ // recv message
+ grpc_closure* initial_on_done_recv_message_;
+ grpc_closure on_done_recv_message_;
+ // Start time (for measuring latency).
+ absl::Time start_time_;
+ // Server elapsed time in nanoseconds.
+ uint64_t elapsed_time_;
+ // The received message--may be null.
+ grpc_core::OrphanablePtr<grpc_core::ByteStream>* recv_message_;
+ // Number of messages in this RPC.
+ uint64_t recv_message_count_;
+ uint64_t sent_message_count_;
+ // Buffer needed for grpc_slice to reference when adding trace context
+ // metatdata to outgoing message.
+ char tracing_buf_[kMaxTraceContextLen];
+};
+
+} // namespace grpc
+
+#endif /* GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_CLIENT_FILTER_H */
diff --git a/src/cpp/ext/filters/census/context.cc b/src/cpp/ext/filters/census/context.cc
new file mode 100644
index 0000000000..4b3250236d
--- /dev/null
+++ b/src/cpp/ext/filters/census/context.cc
@@ -0,0 +1,132 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#include "src/cpp/ext/filters/census/context.h"
+
+namespace grpc {
+
+using ::opencensus::trace::Span;
+using ::opencensus::trace::SpanContext;
+
+void GenerateServerContext(absl::string_view tracing, absl::string_view stats,
+ absl::string_view primary_role,
+ absl::string_view method, CensusContext* context) {
+ GrpcTraceContext trace_ctxt;
+ TraceContextEncoding::Decode(tracing, &trace_ctxt);
+ SpanContext parent_ctx = trace_ctxt.ToSpanContext();
+ new (context) CensusContext(method, parent_ctx);
+}
+
+void GenerateClientContext(absl::string_view method, CensusContext* ctxt,
+ CensusContext* parent_ctxt) {
+ if (parent_ctxt != nullptr) {
+ SpanContext span_ctxt = parent_ctxt->Context();
+ Span span = parent_ctxt->Span();
+ if (span_ctxt.IsValid()) {
+ new (ctxt) CensusContext(method, &span);
+ return;
+ }
+ }
+ new (ctxt) CensusContext(method);
+}
+
+size_t TraceContextSerialize(const ::opencensus::trace::SpanContext& context,
+ char* tracing_buf, size_t tracing_buf_size) {
+ GrpcTraceContext trace_ctxt(context);
+ return TraceContextEncoding::Encode(trace_ctxt, tracing_buf,
+ tracing_buf_size);
+}
+
+size_t StatsContextSerialize(size_t max_tags_len, grpc_slice* tags) {
+ // TODO: Add implementation. Waiting on stats tagging to be added.
+ return 0;
+}
+
+size_t ServerStatsSerialize(uint64_t server_elapsed_time, char* buf,
+ size_t buf_size) {
+ return RpcServerStatsEncoding::Encode(server_elapsed_time, buf, buf_size);
+}
+
+size_t ServerStatsDeserialize(const char* buf, size_t buf_size,
+ uint64_t* server_elapsed_time) {
+ return RpcServerStatsEncoding::Decode(absl::string_view(buf, buf_size),
+ server_elapsed_time);
+}
+
+uint64_t GetIncomingDataSize(const grpc_call_final_info* final_info) {
+ return final_info->stats.transport_stream_stats.incoming.data_bytes;
+}
+
+uint64_t GetOutgoingDataSize(const grpc_call_final_info* final_info) {
+ return final_info->stats.transport_stream_stats.outgoing.data_bytes;
+}
+
+SpanContext SpanContextFromCensusContext(const census_context* ctxt) {
+ return reinterpret_cast<const CensusContext*>(ctxt)->Context();
+}
+
+Span SpanFromCensusContext(const census_context* ctxt) {
+ return reinterpret_cast<const CensusContext*>(ctxt)->Span();
+}
+
+absl::string_view StatusCodeToString(grpc_status_code code) {
+ switch (code) {
+ case GRPC_STATUS_OK:
+ return "OK";
+ case GRPC_STATUS_CANCELLED:
+ return "CANCELLED";
+ case GRPC_STATUS_UNKNOWN:
+ return "UNKNOWN";
+ case GRPC_STATUS_INVALID_ARGUMENT:
+ return "INVALID_ARGUMENT";
+ case GRPC_STATUS_DEADLINE_EXCEEDED:
+ return "DEADLINE_EXCEEDED";
+ case GRPC_STATUS_NOT_FOUND:
+ return "NOT_FOUND";
+ case GRPC_STATUS_ALREADY_EXISTS:
+ return "ALREADY_EXISTS";
+ case GRPC_STATUS_PERMISSION_DENIED:
+ return "PERMISSION_DENIED";
+ case GRPC_STATUS_UNAUTHENTICATED:
+ return "UNAUTHENTICATED";
+ case GRPC_STATUS_RESOURCE_EXHAUSTED:
+ return "RESOURCE_EXHAUSTED";
+ case GRPC_STATUS_FAILED_PRECONDITION:
+ return "FAILED_PRECONDITION";
+ case GRPC_STATUS_ABORTED:
+ return "ABORTED";
+ case GRPC_STATUS_OUT_OF_RANGE:
+ return "OUT_OF_RANGE";
+ case GRPC_STATUS_UNIMPLEMENTED:
+ return "UNIMPLEMENTED";
+ case GRPC_STATUS_INTERNAL:
+ return "INTERNAL";
+ case GRPC_STATUS_UNAVAILABLE:
+ return "UNAVAILABLE";
+ case GRPC_STATUS_DATA_LOSS:
+ return "DATA_LOSS";
+ default:
+ // gRPC wants users of this enum to include a default branch so that
+ // adding values is not a breaking change.
+ return "UNKNOWN_STATUS";
+ }
+}
+
+} // namespace grpc
diff --git a/src/cpp/ext/filters/census/context.h b/src/cpp/ext/filters/census/context.h
new file mode 100644
index 0000000000..1643fdd11b
--- /dev/null
+++ b/src/cpp/ext/filters/census/context.h
@@ -0,0 +1,126 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_CONTEXT_H
+#define GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_CONTEXT_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/status.h>
+#include "absl/memory/memory.h"
+#include "absl/strings/string_view.h"
+#include "absl/strings/strip.h"
+#include "opencensus/trace/span.h"
+#include "opencensus/trace/span_context.h"
+#include "opencensus/trace/trace_params.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/cpp/common/channel_filter.h"
+#include "src/cpp/ext/filters/census/rpc_encoding.h"
+
+// This is needed because grpc has hardcoded CensusContext with a
+// forward declaration of 'struct census_context;'
+struct census_context;
+
+namespace grpc {
+
+// Thread compatible.
+class CensusContext {
+ public:
+ CensusContext() : span_(::opencensus::trace::Span::BlankSpan()) {}
+
+ explicit CensusContext(absl::string_view name)
+ : span_(::opencensus::trace::Span::StartSpan(name)) {}
+
+ CensusContext(absl::string_view name, const ::opencensus::trace::Span* parent)
+ : span_(::opencensus::trace::Span::StartSpan(name, parent)) {}
+
+ CensusContext(absl::string_view name,
+ const ::opencensus::trace::SpanContext& parent_ctxt)
+ : span_(::opencensus::trace::Span::StartSpanWithRemoteParent(
+ name, parent_ctxt)) {}
+
+ ::opencensus::trace::SpanContext Context() const { return span_.context(); }
+ ::opencensus::trace::Span Span() const { return span_; }
+ void EndSpan() { span_.End(); }
+
+ private:
+ ::opencensus::trace::Span span_;
+};
+
+// Serializes the outgoing trace context. Field IDs are 1 byte followed by
+// field data. A 1 byte version ID is always encoded first.
+size_t TraceContextSerialize(const ::opencensus::trace::SpanContext& context,
+ char* tracing_buf, size_t tracing_buf_size);
+
+// Serializes the outgoing stats context. Field IDs are 1 byte followed by
+// field data. A 1 byte version ID is always encoded first. Tags are directly
+// serialized into the given grpc_slice.
+size_t StatsContextSerialize(size_t max_tags_len, grpc_slice* tags);
+
+// Serialize outgoing server stats. Returns the number of bytes serialized.
+size_t ServerStatsSerialize(uint64_t server_elapsed_time, char* buf,
+ size_t buf_size);
+
+// Deserialize incoming server stats. Returns the number of bytes deserialized.
+size_t ServerStatsDeserialize(const char* buf, size_t buf_size,
+ uint64_t* server_elapsed_time);
+
+// Deserialize the incoming SpanContext and generate a new server context based
+// on that. This new span will never be a root span. This should only be called
+// with a blank CensusContext as it overwrites it.
+void GenerateServerContext(absl::string_view tracing, absl::string_view stats,
+ absl::string_view primary_role,
+ absl::string_view method, CensusContext* context);
+
+// Creates a new client context that is by default a new root context.
+// If the current context is the default context then the newly created
+// span automatically becomes a root span. This should only be called with a
+// blank CensusContext as it overwrites it.
+void GenerateClientContext(absl::string_view method, CensusContext* ctxt,
+ CensusContext* parent_ctx);
+
+// Returns the incoming data size from the grpc call final info.
+uint64_t GetIncomingDataSize(const grpc_call_final_info* final_info);
+
+// Returns the outgoing data size from the grpc call final info.
+uint64_t GetOutgoingDataSize(const grpc_call_final_info* final_info);
+
+// These helper functions return the SpanContext and Span, respectively
+// associated with the census_context* stored by grpc. The user will need to
+// call this for manual propagation of tracing data.
+::opencensus::trace::SpanContext SpanContextFromCensusContext(
+ const census_context* ctxt);
+::opencensus::trace::Span SpanFromCensusContext(const census_context* ctxt);
+
+// Returns a string representation of the StatusCode enum.
+absl::string_view StatusCodeToString(grpc_status_code code);
+
+inline absl::string_view GetMethod(const grpc_slice* path) {
+ if (GRPC_SLICE_IS_EMPTY(*path)) {
+ return "";
+ }
+ // Check for leading '/' and trim it if present.
+ return absl::StripPrefix(absl::string_view(reinterpret_cast<const char*>(
+ GRPC_SLICE_START_PTR(*path)),
+ GRPC_SLICE_LENGTH(*path)),
+ "/");
+}
+
+} // namespace grpc
+
+#endif /* GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_CONTEXT_H */
diff --git a/src/core/ext/census/grpc_context.cc b/src/cpp/ext/filters/census/grpc_context.cc
index 599a798dda..599a798dda 100644
--- a/src/core/ext/census/grpc_context.cc
+++ b/src/cpp/ext/filters/census/grpc_context.cc
diff --git a/src/cpp/ext/filters/census/grpc_plugin.cc b/src/cpp/ext/filters/census/grpc_plugin.cc
new file mode 100644
index 0000000000..f978ed3bf5
--- /dev/null
+++ b/src/cpp/ext/filters/census/grpc_plugin.cc
@@ -0,0 +1,130 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#include "src/cpp/ext/filters/census/grpc_plugin.h"
+
+#include <grpcpp/server_context.h>
+
+#include "opencensus/trace/span.h"
+#include "src/cpp/ext/filters/census/channel_filter.h"
+#include "src/cpp/ext/filters/census/client_filter.h"
+#include "src/cpp/ext/filters/census/measures.h"
+#include "src/cpp/ext/filters/census/server_filter.h"
+
+namespace grpc {
+
+void RegisterOpenCensusPlugin() {
+ RegisterChannelFilter<CensusChannelData, CensusClientCallData>(
+ "opencensus_client", GRPC_CLIENT_CHANNEL, INT_MAX /* priority */,
+ nullptr /* condition function */);
+ RegisterChannelFilter<CensusChannelData, CensusServerCallData>(
+ "opencensus_server", GRPC_SERVER_CHANNEL, INT_MAX /* priority */,
+ nullptr /* condition function */);
+
+ // Access measures to ensure they are initialized. Otherwise, creating a view
+ // before the first RPC would cause an error.
+ RpcClientSentBytesPerRpc();
+ RpcClientReceivedBytesPerRpc();
+ RpcClientRoundtripLatency();
+ RpcClientServerLatency();
+ RpcClientSentMessagesPerRpc();
+ RpcClientReceivedMessagesPerRpc();
+
+ RpcServerSentBytesPerRpc();
+ RpcServerReceivedBytesPerRpc();
+ RpcServerServerLatency();
+ RpcServerSentMessagesPerRpc();
+ RpcServerReceivedMessagesPerRpc();
+}
+
+::opencensus::trace::Span GetSpanFromServerContext(ServerContext* context) {
+ return reinterpret_cast<const CensusContext*>(context->census_context())
+ ->Span();
+}
+
+// These measure definitions should be kept in sync across opencensus
+// implementations--see
+// https://github.com/census-instrumentation/opencensus-java/blob/master/contrib/grpc_metrics/src/main/java/io/opencensus/contrib/grpc/metrics/RpcMeasureConstants.java.
+::opencensus::stats::TagKey ClientMethodTagKey() {
+ static const auto method_tag_key =
+ ::opencensus::stats::TagKey::Register("grpc_client_method");
+ return method_tag_key;
+}
+
+::opencensus::stats::TagKey ClientStatusTagKey() {
+ static const auto status_tag_key =
+ ::opencensus::stats::TagKey::Register("grpc_client_status");
+ return status_tag_key;
+}
+
+::opencensus::stats::TagKey ServerMethodTagKey() {
+ static const auto method_tag_key =
+ ::opencensus::stats::TagKey::Register("grpc_server_method");
+ return method_tag_key;
+}
+
+::opencensus::stats::TagKey ServerStatusTagKey() {
+ static const auto status_tag_key =
+ ::opencensus::stats::TagKey::Register("grpc_server_status");
+ return status_tag_key;
+}
+
+// Client
+ABSL_CONST_INIT const absl::string_view
+ kRpcClientSentMessagesPerRpcMeasureName =
+ "grpc.io/client/sent_messages_per_rpc";
+
+ABSL_CONST_INIT const absl::string_view kRpcClientSentBytesPerRpcMeasureName =
+ "grpc.io/client/sent_bytes_per_rpc";
+
+ABSL_CONST_INIT const absl::string_view
+ kRpcClientReceivedMessagesPerRpcMeasureName =
+ "grpc.io/client/received_messages_per_rpc";
+
+ABSL_CONST_INIT const absl::string_view
+ kRpcClientReceivedBytesPerRpcMeasureName =
+ "grpc.io/client/received_bytes_per_rpc";
+
+ABSL_CONST_INIT const absl::string_view kRpcClientRoundtripLatencyMeasureName =
+ "grpc.io/client/roundtrip_latency";
+
+ABSL_CONST_INIT const absl::string_view kRpcClientServerLatencyMeasureName =
+ "grpc.io/client/server_latency";
+
+// Server
+ABSL_CONST_INIT const absl::string_view
+ kRpcServerSentMessagesPerRpcMeasureName =
+ "grpc.io/server/sent_messages_per_rpc";
+
+ABSL_CONST_INIT const absl::string_view kRpcServerSentBytesPerRpcMeasureName =
+ "grpc.io/server/sent_bytes_per_rpc";
+
+ABSL_CONST_INIT const absl::string_view
+ kRpcServerReceivedMessagesPerRpcMeasureName =
+ "grpc.io/server/received_messages_per_rpc";
+
+ABSL_CONST_INIT const absl::string_view
+ kRpcServerReceivedBytesPerRpcMeasureName =
+ "grpc.io/server/received_bytes_per_rpc";
+
+ABSL_CONST_INIT const absl::string_view kRpcServerServerLatencyMeasureName =
+ "grpc.io/server/server_latency";
+
+} // namespace grpc
diff --git a/src/cpp/ext/filters/census/grpc_plugin.h b/src/cpp/ext/filters/census/grpc_plugin.h
new file mode 100644
index 0000000000..7ff2e7a8b8
--- /dev/null
+++ b/src/cpp/ext/filters/census/grpc_plugin.h
@@ -0,0 +1,111 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_GRPC_PLUGIN_H
+#define GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_GRPC_PLUGIN_H
+
+#include <grpc/support/port_platform.h>
+
+#include "absl/strings/string_view.h"
+#include "include/grpcpp/opencensus.h"
+#include "opencensus/stats/stats.h"
+#include "opencensus/trace/span.h"
+
+namespace grpc {
+
+class ServerContext;
+
+// Returns the tracing Span for the current RPC.
+::opencensus::trace::Span GetSpanFromServerContext(ServerContext* context);
+
+// The tag keys set when recording RPC stats.
+::opencensus::stats::TagKey ClientMethodTagKey();
+::opencensus::stats::TagKey ClientStatusTagKey();
+::opencensus::stats::TagKey ServerMethodTagKey();
+::opencensus::stats::TagKey ServerStatusTagKey();
+
+// Names of measures used by the plugin--users can create views on these
+// measures but should not record data for them.
+extern const absl::string_view kRpcClientSentMessagesPerRpcMeasureName;
+extern const absl::string_view kRpcClientSentBytesPerRpcMeasureName;
+extern const absl::string_view kRpcClientReceivedMessagesPerRpcMeasureName;
+extern const absl::string_view kRpcClientReceivedBytesPerRpcMeasureName;
+extern const absl::string_view kRpcClientRoundtripLatencyMeasureName;
+extern const absl::string_view kRpcClientServerLatencyMeasureName;
+
+extern const absl::string_view kRpcServerSentMessagesPerRpcMeasureName;
+extern const absl::string_view kRpcServerSentBytesPerRpcMeasureName;
+extern const absl::string_view kRpcServerReceivedMessagesPerRpcMeasureName;
+extern const absl::string_view kRpcServerReceivedBytesPerRpcMeasureName;
+extern const absl::string_view kRpcServerServerLatencyMeasureName;
+
+// Canonical gRPC view definitions.
+const ::opencensus::stats::ViewDescriptor& ClientSentMessagesPerRpcCumulative();
+const ::opencensus::stats::ViewDescriptor& ClientSentBytesPerRpcCumulative();
+const ::opencensus::stats::ViewDescriptor&
+ClientReceivedMessagesPerRpcCumulative();
+const ::opencensus::stats::ViewDescriptor&
+ClientReceivedBytesPerRpcCumulative();
+const ::opencensus::stats::ViewDescriptor& ClientRoundtripLatencyCumulative();
+const ::opencensus::stats::ViewDescriptor& ClientServerLatencyCumulative();
+const ::opencensus::stats::ViewDescriptor& ClientCompletedRpcsCumulative();
+
+const ::opencensus::stats::ViewDescriptor& ServerSentBytesPerRpcCumulative();
+const ::opencensus::stats::ViewDescriptor&
+ServerReceivedBytesPerRpcCumulative();
+const ::opencensus::stats::ViewDescriptor& ServerServerLatencyCumulative();
+const ::opencensus::stats::ViewDescriptor& ServerStartedCountCumulative();
+const ::opencensus::stats::ViewDescriptor& ServerCompletedRpcsCumulative();
+const ::opencensus::stats::ViewDescriptor& ServerSentMessagesPerRpcCumulative();
+const ::opencensus::stats::ViewDescriptor&
+ServerReceivedMessagesPerRpcCumulative();
+
+const ::opencensus::stats::ViewDescriptor& ClientSentMessagesPerRpcMinute();
+const ::opencensus::stats::ViewDescriptor& ClientSentBytesPerRpcMinute();
+const ::opencensus::stats::ViewDescriptor& ClientReceivedMessagesPerRpcMinute();
+const ::opencensus::stats::ViewDescriptor& ClientReceivedBytesPerRpcMinute();
+const ::opencensus::stats::ViewDescriptor& ClientRoundtripLatencyMinute();
+const ::opencensus::stats::ViewDescriptor& ClientServerLatencyMinute();
+const ::opencensus::stats::ViewDescriptor& ClientCompletedRpcsMinute();
+
+const ::opencensus::stats::ViewDescriptor& ServerSentMessagesPerRpcMinute();
+const ::opencensus::stats::ViewDescriptor& ServerSentBytesPerRpcMinute();
+const ::opencensus::stats::ViewDescriptor& ServerReceivedMessagesPerRpcMinute();
+const ::opencensus::stats::ViewDescriptor& ServerReceivedBytesPerRpcMinute();
+const ::opencensus::stats::ViewDescriptor& ServerServerLatencyMinute();
+const ::opencensus::stats::ViewDescriptor& ServerCompletedRpcsMinute();
+
+const ::opencensus::stats::ViewDescriptor& ClientSentMessagesPerRpcHour();
+const ::opencensus::stats::ViewDescriptor& ClientSentBytesPerRpcHour();
+const ::opencensus::stats::ViewDescriptor& ClientReceivedMessagesPerRpcHour();
+const ::opencensus::stats::ViewDescriptor& ClientReceivedBytesPerRpcHour();
+const ::opencensus::stats::ViewDescriptor& ClientRoundtripLatencyHour();
+const ::opencensus::stats::ViewDescriptor& ClientServerLatencyHour();
+const ::opencensus::stats::ViewDescriptor& ClientCompletedRpcsHour();
+
+const ::opencensus::stats::ViewDescriptor& ServerSentMessagesPerRpcHour();
+const ::opencensus::stats::ViewDescriptor& ServerSentBytesPerRpcHour();
+const ::opencensus::stats::ViewDescriptor& ServerReceivedMessagesPerRpcHour();
+const ::opencensus::stats::ViewDescriptor& ServerReceivedBytesPerRpcHour();
+const ::opencensus::stats::ViewDescriptor& ServerServerLatencyHour();
+const ::opencensus::stats::ViewDescriptor& ServerStartedCountHour();
+const ::opencensus::stats::ViewDescriptor& ServerCompletedRpcsHour();
+
+} // namespace grpc
+
+#endif /* GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_GRPC_PLUGIN_H */
diff --git a/src/cpp/ext/filters/census/measures.cc b/src/cpp/ext/filters/census/measures.cc
new file mode 100644
index 0000000000..b522fae09a
--- /dev/null
+++ b/src/cpp/ext/filters/census/measures.cc
@@ -0,0 +1,129 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#include "src/cpp/ext/filters/census/measures.h"
+
+#include "opencensus/stats/stats.h"
+#include "src/cpp/ext/filters/census/grpc_plugin.h"
+
+namespace grpc {
+
+using ::opencensus::stats::MeasureDouble;
+using ::opencensus::stats::MeasureInt64;
+
+// These measure definitions should be kept in sync across opencensus
+// implementations--see
+// https://github.com/census-instrumentation/opencensus-java/blob/master/contrib/grpc_metrics/src/main/java/io/opencensus/contrib/grpc/metrics/RpcMeasureConstants.java.
+
+namespace {
+
+// Unit constants
+constexpr char kUnitBytes[] = "By";
+constexpr char kUnitMilliseconds[] = "ms";
+constexpr char kCount[] = "1";
+
+} // namespace
+
+// Client
+MeasureDouble RpcClientSentBytesPerRpc() {
+ static const auto measure = MeasureDouble::Register(
+ kRpcClientSentBytesPerRpcMeasureName,
+ "Total bytes sent across all request messages per RPC", kUnitBytes);
+ return measure;
+}
+
+MeasureDouble RpcClientReceivedBytesPerRpc() {
+ static const auto measure = MeasureDouble::Register(
+ kRpcClientReceivedBytesPerRpcMeasureName,
+ "Total bytes received across all response messages per RPC", kUnitBytes);
+ return measure;
+}
+
+MeasureDouble RpcClientRoundtripLatency() {
+ static const auto measure = MeasureDouble::Register(
+ kRpcClientRoundtripLatencyMeasureName,
+ "Time between first byte of request sent to last byte of response "
+ "received, or terminal error",
+ kUnitMilliseconds);
+ return measure;
+}
+
+MeasureDouble RpcClientServerLatency() {
+ static const auto measure = MeasureDouble::Register(
+ kRpcClientServerLatencyMeasureName,
+ "Time between first byte of request received to last byte of response "
+ "sent, or terminal error (propagated from the server)",
+ kUnitMilliseconds);
+ return measure;
+}
+
+MeasureInt64 RpcClientSentMessagesPerRpc() {
+ static const auto measure =
+ MeasureInt64::Register(kRpcClientSentMessagesPerRpcMeasureName,
+ "Number of messages sent per RPC", kCount);
+ return measure;
+}
+
+MeasureInt64 RpcClientReceivedMessagesPerRpc() {
+ static const auto measure =
+ MeasureInt64::Register(kRpcClientReceivedMessagesPerRpcMeasureName,
+ "Number of messages received per RPC", kCount);
+ return measure;
+}
+
+// Server
+MeasureDouble RpcServerSentBytesPerRpc() {
+ static const auto measure = MeasureDouble::Register(
+ kRpcServerSentBytesPerRpcMeasureName,
+ "Total bytes sent across all messages per RPC", kUnitBytes);
+ return measure;
+}
+
+MeasureDouble RpcServerReceivedBytesPerRpc() {
+ static const auto measure = MeasureDouble::Register(
+ kRpcServerReceivedBytesPerRpcMeasureName,
+ "Total bytes received across all messages per RPC", kUnitBytes);
+ return measure;
+}
+
+MeasureDouble RpcServerServerLatency() {
+ static const auto measure = MeasureDouble::Register(
+ kRpcServerServerLatencyMeasureName,
+ "Time between first byte of request received to last byte of response "
+ "sent, or terminal error",
+ kUnitMilliseconds);
+ return measure;
+}
+
+MeasureInt64 RpcServerSentMessagesPerRpc() {
+ static const auto measure =
+ MeasureInt64::Register(kRpcServerSentMessagesPerRpcMeasureName,
+ "Number of messages sent per RPC", kCount);
+ return measure;
+}
+
+MeasureInt64 RpcServerReceivedMessagesPerRpc() {
+ static const auto measure =
+ MeasureInt64::Register(kRpcServerReceivedMessagesPerRpcMeasureName,
+ "Number of messages received per RPC", kCount);
+ return measure;
+}
+
+} // namespace grpc
diff --git a/src/cpp/ext/filters/census/measures.h b/src/cpp/ext/filters/census/measures.h
new file mode 100644
index 0000000000..8f8e72ace2
--- /dev/null
+++ b/src/cpp/ext/filters/census/measures.h
@@ -0,0 +1,46 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_MEASURES_H
+#define GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_MEASURES_H
+
+#include <grpc/support/port_platform.h>
+
+#include "opencensus/stats/stats.h"
+#include "src/cpp/ext/filters/census/grpc_plugin.h"
+
+namespace grpc {
+
+::opencensus::stats::MeasureInt64 RpcClientSentMessagesPerRpc();
+::opencensus::stats::MeasureDouble RpcClientSentBytesPerRpc();
+::opencensus::stats::MeasureInt64 RpcClientReceivedMessagesPerRpc();
+::opencensus::stats::MeasureDouble RpcClientReceivedBytesPerRpc();
+::opencensus::stats::MeasureDouble RpcClientRoundtripLatency();
+::opencensus::stats::MeasureDouble RpcClientServerLatency();
+::opencensus::stats::MeasureInt64 RpcClientCompletedRpcs();
+
+::opencensus::stats::MeasureInt64 RpcServerSentMessagesPerRpc();
+::opencensus::stats::MeasureDouble RpcServerSentBytesPerRpc();
+::opencensus::stats::MeasureInt64 RpcServerReceivedMessagesPerRpc();
+::opencensus::stats::MeasureDouble RpcServerReceivedBytesPerRpc();
+::opencensus::stats::MeasureDouble RpcServerServerLatency();
+::opencensus::stats::MeasureInt64 RpcServerCompletedRpcs();
+
+} // namespace grpc
+
+#endif /* GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_MEASURES_H */
diff --git a/src/cpp/ext/filters/census/rpc_encoding.cc b/src/cpp/ext/filters/census/rpc_encoding.cc
new file mode 100644
index 0000000000..45a66d9dc8
--- /dev/null
+++ b/src/cpp/ext/filters/census/rpc_encoding.cc
@@ -0,0 +1,39 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#include "src/cpp/ext/filters/census/rpc_encoding.h"
+
+namespace grpc {
+
+constexpr size_t TraceContextEncoding::kGrpcTraceContextSize;
+constexpr size_t TraceContextEncoding::kEncodeDecodeFailure;
+constexpr size_t TraceContextEncoding::kVersionIdSize;
+constexpr size_t TraceContextEncoding::kFieldIdSize;
+constexpr size_t TraceContextEncoding::kVersionIdOffset;
+constexpr size_t TraceContextEncoding::kVersionId;
+
+constexpr size_t RpcServerStatsEncoding::kRpcServerStatsSize;
+constexpr size_t RpcServerStatsEncoding::kEncodeDecodeFailure;
+constexpr size_t RpcServerStatsEncoding::kVersionIdSize;
+constexpr size_t RpcServerStatsEncoding::kFieldIdSize;
+constexpr size_t RpcServerStatsEncoding::kVersionIdOffset;
+constexpr size_t RpcServerStatsEncoding::kVersionId;
+
+} // namespace grpc
diff --git a/src/cpp/ext/filters/census/rpc_encoding.h b/src/cpp/ext/filters/census/rpc_encoding.h
new file mode 100644
index 0000000000..ffffa60c46
--- /dev/null
+++ b/src/cpp/ext/filters/census/rpc_encoding.h
@@ -0,0 +1,284 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_RPC_ENCODING_H
+#define GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_RPC_ENCODING_H
+
+#include <grpc/support/port_platform.h>
+
+#include <string.h>
+
+#include "absl/base/internal/endian.h"
+#include "absl/strings/string_view.h"
+#include "opencensus/trace/span_context.h"
+#include "opencensus/trace/span_id.h"
+#include "opencensus/trace/trace_id.h"
+
+namespace grpc {
+
+// TODO: Rename to GrpcTraceContextV0.
+struct GrpcTraceContext {
+ GrpcTraceContext() {}
+
+ explicit GrpcTraceContext(const ::opencensus::trace::SpanContext& ctx) {
+ ctx.trace_id().CopyTo(trace_id);
+ ctx.span_id().CopyTo(span_id);
+ ctx.trace_options().CopyTo(trace_options);
+ }
+
+ ::opencensus::trace::SpanContext ToSpanContext() const {
+ return ::opencensus::trace::SpanContext(
+ ::opencensus::trace::TraceId(trace_id),
+ ::opencensus::trace::SpanId(span_id),
+ ::opencensus::trace::TraceOptions(trace_options));
+ }
+
+ // TODO: For performance:
+ // uint8_t version;
+ // uint8_t trace_id_field_id;
+ uint8_t trace_id[::opencensus::trace::TraceId::kSize];
+ // uint8_t span_id_field_id;
+ uint8_t span_id[::opencensus::trace::SpanId::kSize];
+ // uint8_t trace_options_field_id;
+ uint8_t trace_options[::opencensus::trace::TraceOptions::kSize];
+};
+
+// TraceContextEncoding encapsulates the logic for encoding and decoding of
+// trace contexts.
+class TraceContextEncoding {
+ public:
+ // Size of encoded GrpcTraceContext. (16 + 8 + 1 + 4)
+ static constexpr size_t kGrpcTraceContextSize = 29;
+ // Error value.
+ static constexpr size_t kEncodeDecodeFailure = 0;
+
+ // Deserializes a GrpcTraceContext from the incoming buffer. Returns the
+ // number of bytes deserialized from the buffer. If the incoming buffer is
+ // empty or the encoding version is not supported it will return 0 bytes,
+ // currently only version 0 is supported. If an unknown field ID is
+ // encountered it will return immediately without parsing the rest of the
+ // buffer. Inlined for performance reasons.
+ static size_t Decode(absl::string_view buf, GrpcTraceContext* tc) {
+ if (buf.empty()) {
+ return kEncodeDecodeFailure;
+ }
+ uint8_t version = buf[kVersionIdOffset];
+ // TODO: Support other versions later. Only support version 0 for
+ // now.
+ if (version != kVersionId) {
+ return kEncodeDecodeFailure;
+ }
+
+ size_t pos = kVersionIdSize;
+ while (pos < buf.size()) {
+ size_t bytes_read =
+ ParseField(absl::string_view(&buf[pos], buf.size() - pos), tc);
+ if (bytes_read == 0) {
+ break;
+ } else {
+ pos += bytes_read;
+ }
+ }
+ return pos;
+ }
+
+ // Serializes a GrpcTraceContext into the provided buffer. Returns the number
+ // of bytes serialized into the buffer. If the buffer is not of sufficient
+ // size (it must be at least kGrpcTraceContextSize bytes) it will drop
+ // everything and return 0 bytes serialized. Inlined for performance reasons.
+ static size_t Encode(const GrpcTraceContext& tc, char* buf, size_t buf_size) {
+ if (buf_size < kGrpcTraceContextSize) {
+ return kEncodeDecodeFailure;
+ }
+ buf[kVersionIdOffset] = kVersionId;
+ buf[kTraceIdOffset] = kTraceIdField;
+ memcpy(&buf[kTraceIdOffset + 1], tc.trace_id,
+ opencensus::trace::TraceId::kSize);
+ buf[kSpanIdOffset] = kSpanIdField;
+ memcpy(&buf[kSpanIdOffset + 1], tc.span_id,
+ opencensus::trace::SpanId::kSize);
+ buf[kTraceOptionsOffset] = kTraceOptionsField;
+ memcpy(&buf[kTraceOptionsOffset + 1], tc.trace_options,
+ opencensus::trace::TraceOptions::kSize);
+ return kGrpcTraceContextSize;
+ }
+
+ private:
+ // Parses the next field from the incoming buffer and stores the parsed value
+ // in a GrpcTraceContext struct. If it does not recognize the field ID it
+ // will return 0, otherwise it returns the number of bytes read.
+ static size_t ParseField(absl::string_view buf, GrpcTraceContext* tc) {
+ // TODO: Add support for multi-byte field IDs.
+ if (buf.empty()) {
+ return 0;
+ }
+ // Field ID is always the first byte in a field.
+ uint32_t field_id = buf[0];
+ size_t bytes_read = kFieldIdSize;
+ switch (field_id) {
+ case kTraceIdField:
+ bytes_read += kTraceIdSize;
+ if (bytes_read > buf.size()) {
+ return 0;
+ }
+ memcpy(tc->trace_id, &buf[kFieldIdSize],
+ opencensus::trace::TraceId::kSize);
+ break;
+ case kSpanIdField:
+ bytes_read += kSpanIdSize;
+ if (bytes_read > buf.size()) {
+ return 0;
+ }
+ memcpy(tc->span_id, &buf[kFieldIdSize],
+ opencensus::trace::SpanId::kSize);
+ break;
+ case kTraceOptionsField:
+ bytes_read += kTraceOptionsSize;
+ if (bytes_read > buf.size()) {
+ return 0;
+ }
+ memcpy(tc->trace_options, &buf[kFieldIdSize],
+ opencensus::trace::TraceOptions::kSize);
+ break;
+ default: // Invalid field ID
+ return 0;
+ }
+
+ return bytes_read;
+ }
+
+ // Size of Version ID.
+ static constexpr size_t kVersionIdSize = 1;
+ // Size of Field ID.
+ static constexpr size_t kFieldIdSize = 1;
+
+ // Offset and value for currently supported version ID.
+ static constexpr size_t kVersionIdOffset = 0;
+ static constexpr size_t kVersionId = 0;
+
+ // Fixed Field ID values:
+ enum FieldIdValue {
+ kTraceIdField = 0,
+ kSpanIdField = 1,
+ kTraceOptionsField = 2,
+ };
+
+ // Field data sizes in bytes
+ enum FieldSize {
+ kTraceIdSize = 16,
+ kSpanIdSize = 8,
+ kTraceOptionsSize = 1,
+ };
+
+ // Fixed size offsets for field ID start positions during encoding. Field
+ // data immediately follows.
+ enum FieldIdOffset {
+ kTraceIdOffset = kVersionIdSize,
+ kSpanIdOffset = kTraceIdOffset + kFieldIdSize + kTraceIdSize,
+ kTraceOptionsOffset = kSpanIdOffset + kFieldIdSize + kSpanIdSize,
+ };
+
+ TraceContextEncoding() = delete;
+ TraceContextEncoding(const TraceContextEncoding&) = delete;
+ TraceContextEncoding(TraceContextEncoding&&) = delete;
+ TraceContextEncoding operator=(const TraceContextEncoding&) = delete;
+ TraceContextEncoding operator=(TraceContextEncoding&&) = delete;
+};
+
+// TODO: This may not be needed. Check to see if opencensus requires
+// a trailing server response.
+// RpcServerStatsEncoding encapsulates the logic for encoding and decoding of
+// rpc server stats messages. Rpc server stats consists of a uint64_t time
+// value (server latency in nanoseconds).
+class RpcServerStatsEncoding {
+ public:
+ // Size of encoded RPC server stats.
+ static constexpr size_t kRpcServerStatsSize = 10;
+ // Error value.
+ static constexpr size_t kEncodeDecodeFailure = 0;
+
+ // Deserializes rpc server stats from the incoming 'buf' into *time. Returns
+ // number of bytes decoded. If the buffer is of insufficient size (it must be
+ // at least kRpcServerStatsSize bytes) or the encoding version or field ID are
+ // unrecognized, *time will be set to 0 and it will return
+ // kEncodeDecodeFailure. Inlined for performance reasons.
+ static size_t Decode(absl::string_view buf, uint64_t* time) {
+ if (buf.size() < kRpcServerStatsSize) {
+ *time = 0;
+ return kEncodeDecodeFailure;
+ }
+
+ uint8_t version = buf[kVersionIdOffset];
+ uint32_t fieldID = buf[kServerElapsedTimeOffset];
+ if (version != kVersionId || fieldID != kServerElapsedTimeField) {
+ *time = 0;
+ return kEncodeDecodeFailure;
+ }
+ *time = absl::little_endian::Load64(
+ &buf[kServerElapsedTimeOffset + kFieldIdSize]);
+ return kRpcServerStatsSize;
+ }
+
+ // Serializes rpc server stats into the provided buffer. It returns the
+ // number of bytes written to the buffer. If the buffer is smaller than
+ // kRpcServerStatsSize bytes it will return kEncodeDecodeFailure. Inlined for
+ // performance reasons.
+ static size_t Encode(uint64_t time, char* buf, size_t buf_size) {
+ if (buf_size < kRpcServerStatsSize) {
+ return kEncodeDecodeFailure;
+ }
+
+ buf[kVersionIdOffset] = kVersionId;
+ buf[kServerElapsedTimeOffset] = kServerElapsedTimeField;
+ absl::little_endian::Store64(&buf[kServerElapsedTimeOffset + kFieldIdSize],
+ time);
+ return kRpcServerStatsSize;
+ }
+
+ private:
+ // Size of Version ID.
+ static constexpr size_t kVersionIdSize = 1;
+ // Size of Field ID.
+ static constexpr size_t kFieldIdSize = 1;
+
+ // Offset and value for currently supported version ID.
+ static constexpr size_t kVersionIdOffset = 0;
+ static constexpr size_t kVersionId = 0;
+
+ enum FieldIdValue {
+ kServerElapsedTimeField = 0,
+ };
+
+ enum FieldSize {
+ kServerElapsedTimeSize = 8,
+ };
+
+ enum FieldIdOffset {
+ kServerElapsedTimeOffset = kVersionIdSize,
+ };
+
+ RpcServerStatsEncoding() = delete;
+ RpcServerStatsEncoding(const RpcServerStatsEncoding&) = delete;
+ RpcServerStatsEncoding(RpcServerStatsEncoding&&) = delete;
+ RpcServerStatsEncoding operator=(const RpcServerStatsEncoding&) = delete;
+ RpcServerStatsEncoding operator=(RpcServerStatsEncoding&&) = delete;
+};
+
+} // namespace grpc
+
+#endif /* GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_RPC_ENCODING_H */
diff --git a/src/cpp/ext/filters/census/server_filter.cc b/src/cpp/ext/filters/census/server_filter.cc
new file mode 100644
index 0000000000..c7c62eefe5
--- /dev/null
+++ b/src/cpp/ext/filters/census/server_filter.cc
@@ -0,0 +1,198 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#include "src/cpp/ext/filters/census/server_filter.h"
+
+#include "absl/strings/str_cat.h"
+#include "absl/strings/string_view.h"
+#include "absl/time/clock.h"
+#include "absl/time/time.h"
+#include "opencensus/stats/stats.h"
+#include "src/core/lib/surface/call.h"
+#include "src/cpp/ext/filters/census/grpc_plugin.h"
+#include "src/cpp/ext/filters/census/measures.h"
+
+namespace grpc {
+
+constexpr uint32_t CensusServerCallData::kMaxServerStatsLen;
+
+namespace {
+
+// server metadata elements
+struct ServerMetadataElements {
+ grpc_slice path;
+ grpc_slice tracing_slice;
+ grpc_slice census_proto;
+};
+
+void FilterInitialMetadata(grpc_metadata_batch* b,
+ ServerMetadataElements* sml) {
+ if (b->idx.named.path != nullptr) {
+ sml->path = grpc_slice_ref_internal(GRPC_MDVALUE(b->idx.named.path->md));
+ }
+ if (b->idx.named.grpc_trace_bin != nullptr) {
+ sml->tracing_slice =
+ grpc_slice_ref_internal(GRPC_MDVALUE(b->idx.named.grpc_trace_bin->md));
+ grpc_metadata_batch_remove(b, b->idx.named.grpc_trace_bin);
+ }
+ if (b->idx.named.grpc_tags_bin != nullptr) {
+ sml->census_proto =
+ grpc_slice_ref_internal(GRPC_MDVALUE(b->idx.named.grpc_tags_bin->md));
+ grpc_metadata_batch_remove(b, b->idx.named.grpc_tags_bin);
+ }
+}
+
+} // namespace
+
+void CensusServerCallData::OnDoneRecvMessageCb(void* user_data,
+ grpc_error* error) {
+ grpc_call_element* elem = reinterpret_cast<grpc_call_element*>(user_data);
+ CensusServerCallData* calld =
+ reinterpret_cast<CensusServerCallData*>(elem->call_data);
+ CensusChannelData* channeld =
+ reinterpret_cast<CensusChannelData*>(elem->channel_data);
+ GPR_ASSERT(calld != nullptr);
+ GPR_ASSERT(channeld != nullptr);
+ // Stream messages are no longer valid after receiving trailing metadata.
+ if ((*calld->recv_message_) != nullptr) {
+ ++calld->recv_message_count_;
+ }
+ GRPC_CLOSURE_RUN(calld->initial_on_done_recv_message_, GRPC_ERROR_REF(error));
+}
+
+void CensusServerCallData::OnDoneRecvInitialMetadataCb(void* user_data,
+ grpc_error* error) {
+ grpc_call_element* elem = reinterpret_cast<grpc_call_element*>(user_data);
+ CensusServerCallData* calld =
+ reinterpret_cast<CensusServerCallData*>(elem->call_data);
+ GPR_ASSERT(calld != nullptr);
+ if (error == GRPC_ERROR_NONE) {
+ grpc_metadata_batch* initial_metadata = calld->recv_initial_metadata_;
+ GPR_ASSERT(initial_metadata != nullptr);
+ ServerMetadataElements sml;
+ sml.path = grpc_empty_slice();
+ sml.tracing_slice = grpc_empty_slice();
+ sml.census_proto = grpc_empty_slice();
+ FilterInitialMetadata(initial_metadata, &sml);
+ calld->path_ = grpc_slice_ref_internal(sml.path);
+ calld->method_ = GetMethod(&calld->path_);
+ calld->qualified_method_ = StrCat("Recv.", calld->method_);
+ const char* tracing_str =
+ GRPC_SLICE_IS_EMPTY(sml.tracing_slice)
+ ? ""
+ : reinterpret_cast<const char*>(
+ GRPC_SLICE_START_PTR(sml.tracing_slice));
+ size_t tracing_str_len = GRPC_SLICE_IS_EMPTY(sml.tracing_slice)
+ ? 0
+ : GRPC_SLICE_LENGTH(sml.tracing_slice);
+ const char* census_str = GRPC_SLICE_IS_EMPTY(sml.census_proto)
+ ? ""
+ : reinterpret_cast<const char*>(
+ GRPC_SLICE_START_PTR(sml.census_proto));
+ size_t census_str_len = GRPC_SLICE_IS_EMPTY(sml.census_proto)
+ ? 0
+ : GRPC_SLICE_LENGTH(sml.census_proto);
+
+ GenerateServerContext(absl::string_view(tracing_str, tracing_str_len),
+ absl::string_view(census_str, census_str_len),
+ /*primary_role*/ "", calld->qualified_method_,
+ &calld->context_);
+
+ grpc_slice_unref_internal(sml.tracing_slice);
+ grpc_slice_unref_internal(sml.census_proto);
+ grpc_slice_unref_internal(sml.path);
+ grpc_census_call_set_context(
+ calld->gc_, reinterpret_cast<census_context*>(&calld->context_));
+ }
+ GRPC_CLOSURE_RUN(calld->initial_on_done_recv_initial_metadata_,
+ GRPC_ERROR_REF(error));
+}
+
+void CensusServerCallData::StartTransportStreamOpBatch(
+ grpc_call_element* elem, TransportStreamOpBatch* op) {
+ if (op->recv_initial_metadata() != nullptr) {
+ // substitute our callback for the op callback
+ recv_initial_metadata_ = op->recv_initial_metadata()->batch();
+ initial_on_done_recv_initial_metadata_ = op->recv_initial_metadata_ready();
+ op->set_recv_initial_metadata_ready(&on_done_recv_initial_metadata_);
+ }
+ if (op->send_message() != nullptr) {
+ ++sent_message_count_;
+ }
+ if (op->recv_message() != nullptr) {
+ recv_message_ = op->op()->payload->recv_message.recv_message;
+ initial_on_done_recv_message_ =
+ op->op()->payload->recv_message.recv_message_ready;
+ op->op()->payload->recv_message.recv_message_ready = &on_done_recv_message_;
+ }
+ // We need to record the time when the trailing metadata was sent to mark the
+ // completeness of the request.
+ if (op->send_trailing_metadata() != nullptr) {
+ elapsed_time_ = absl::Now() - start_time_;
+ size_t len = ServerStatsSerialize(absl::ToInt64Nanoseconds(elapsed_time_),
+ stats_buf_, kMaxServerStatsLen);
+ if (len > 0) {
+ GRPC_LOG_IF_ERROR(
+ "census grpc_filter",
+ grpc_metadata_batch_add_tail(
+ op->send_trailing_metadata()->batch(), &census_bin_,
+ grpc_mdelem_from_slices(
+ GRPC_MDSTR_GRPC_SERVER_STATS_BIN,
+ grpc_slice_from_copied_buffer(stats_buf_, len))));
+ }
+ }
+ // Call next op.
+ grpc_call_next_op(elem, op->op());
+}
+
+grpc_error* CensusServerCallData::Init(grpc_call_element* elem,
+ const grpc_call_element_args* args) {
+ start_time_ = absl::Now();
+ gc_ =
+ grpc_call_from_top_element(grpc_call_stack_element(args->call_stack, 0));
+ GRPC_CLOSURE_INIT(&on_done_recv_initial_metadata_,
+ OnDoneRecvInitialMetadataCb, elem,
+ grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&on_done_recv_message_, OnDoneRecvMessageCb, elem,
+ grpc_schedule_on_exec_ctx);
+ auth_context_ = grpc_call_auth_context(gc_);
+ return GRPC_ERROR_NONE;
+}
+
+void CensusServerCallData::Destroy(grpc_call_element* elem,
+ const grpc_call_final_info* final_info,
+ grpc_closure* then_call_closure) {
+ const uint64_t request_size = GetOutgoingDataSize(final_info);
+ const uint64_t response_size = GetIncomingDataSize(final_info);
+ double elapsed_time_ms = absl::ToDoubleMilliseconds(elapsed_time_);
+ grpc_auth_context_release(auth_context_);
+ ::opencensus::stats::Record(
+ {{RpcServerSentBytesPerRpc(), static_cast<double>(response_size)},
+ {RpcServerReceivedBytesPerRpc(), static_cast<double>(request_size)},
+ {RpcServerServerLatency(), elapsed_time_ms},
+ {RpcServerSentMessagesPerRpc(), sent_message_count_},
+ {RpcServerReceivedMessagesPerRpc(), recv_message_count_}},
+ {{ServerMethodTagKey(), method_},
+ {ServerStatusTagKey(), StatusCodeToString(final_info->final_status)}});
+ grpc_slice_unref_internal(path_);
+ context_.EndSpan();
+}
+
+} // namespace grpc
diff --git a/src/cpp/ext/filters/census/server_filter.h b/src/cpp/ext/filters/census/server_filter.h
new file mode 100644
index 0000000000..e393ed3283
--- /dev/null
+++ b/src/cpp/ext/filters/census/server_filter.h
@@ -0,0 +1,101 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_SERVER_FILTER_H
+#define GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_SERVER_FILTER_H
+
+#include <grpc/support/port_platform.h>
+
+#include "absl/strings/string_view.h"
+#include "absl/time/clock.h"
+#include "absl/time/time.h"
+#include "include/grpc/grpc_security.h"
+#include "src/cpp/ext/filters/census/channel_filter.h"
+#include "src/cpp/ext/filters/census/context.h"
+
+namespace grpc {
+
+// A CallData class will be created for every grpc call within a channel. It is
+// used to store data and methods specific to that call. CensusServerCallData is
+// thread-compatible, however typically only 1 thread should be interacting with
+// a call at a time.
+class CensusServerCallData : public CallData {
+ public:
+ // Maximum size of server stats that are sent on the wire.
+ static constexpr uint32_t kMaxServerStatsLen = 16;
+
+ CensusServerCallData()
+ : gc_(nullptr),
+ auth_context_(nullptr),
+ recv_initial_metadata_(nullptr),
+ initial_on_done_recv_initial_metadata_(nullptr),
+ initial_on_done_recv_message_(nullptr),
+ recv_message_(nullptr),
+ recv_message_count_(0),
+ sent_message_count_(0) {
+ memset(&census_bin_, 0, sizeof(grpc_linked_mdelem));
+ memset(&path_, 0, sizeof(grpc_slice));
+ memset(&on_done_recv_initial_metadata_, 0, sizeof(grpc_closure));
+ memset(&on_done_recv_message_, 0, sizeof(grpc_closure));
+ }
+
+ grpc_error* Init(grpc_call_element* elem,
+ const grpc_call_element_args* args) override;
+
+ void Destroy(grpc_call_element* elem, const grpc_call_final_info* final_info,
+ grpc_closure* then_call_closure) override;
+
+ void StartTransportStreamOpBatch(grpc_call_element* elem,
+ TransportStreamOpBatch* op) override;
+
+ static void OnDoneRecvInitialMetadataCb(void* user_data, grpc_error* error);
+
+ static void OnDoneRecvMessageCb(void* user_data, grpc_error* error);
+
+ private:
+ CensusContext context_;
+ // server method
+ absl::string_view method_;
+ std::string qualified_method_;
+ grpc_slice path_;
+ // Pointer to the grpc_call element
+ grpc_call* gc_;
+ // Authorization context for the call.
+ grpc_auth_context* auth_context_;
+ // Metadata element for census stats.
+ grpc_linked_mdelem census_bin_;
+ // recv callback
+ grpc_metadata_batch* recv_initial_metadata_;
+ grpc_closure* initial_on_done_recv_initial_metadata_;
+ grpc_closure on_done_recv_initial_metadata_;
+ // recv message
+ grpc_closure* initial_on_done_recv_message_;
+ grpc_closure on_done_recv_message_;
+ absl::Time start_time_;
+ absl::Duration elapsed_time_;
+ grpc_core::OrphanablePtr<grpc_core::ByteStream>* recv_message_;
+ uint64_t recv_message_count_;
+ uint64_t sent_message_count_;
+ // Buffer needed for grpc_slice to reference it when adding metatdata to
+ // response.
+ char stats_buf_[kMaxServerStatsLen];
+};
+
+} // namespace grpc
+
+#endif /* GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_SERVER_FILTER_H */
diff --git a/src/cpp/ext/filters/census/views.cc b/src/cpp/ext/filters/census/views.cc
new file mode 100644
index 0000000000..2c0c5f7295
--- /dev/null
+++ b/src/cpp/ext/filters/census/views.cc
@@ -0,0 +1,491 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#include "src/cpp/ext/filters/census/grpc_plugin.h"
+
+#include "absl/time/time.h"
+#include "opencensus/stats/internal/aggregation_window.h"
+#include "opencensus/stats/internal/set_aggregation_window.h"
+#include "opencensus/stats/stats.h"
+
+namespace grpc {
+
+using ::opencensus::stats::Aggregation;
+using ::opencensus::stats::AggregationWindow;
+using ::opencensus::stats::BucketBoundaries;
+using ::opencensus::stats::ViewDescriptor;
+
+// These measure definitions should be kept in sync across opencensus
+// implementations.
+
+namespace {
+
+Aggregation BytesDistributionAggregation() {
+ return Aggregation::Distribution(BucketBoundaries::Explicit(
+ {0, 1024, 2048, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216,
+ 67108864, 268435456, 1073741824, 4294967296}));
+}
+
+Aggregation MillisDistributionAggregation() {
+ return Aggregation::Distribution(BucketBoundaries::Explicit(
+ {0, 0.01, 0.05, 0.1, 0.3, 0.6, 0.8, 1, 2, 3, 4,
+ 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50,
+ 65, 80, 100, 130, 160, 200, 250, 300, 400, 500, 650,
+ 800, 1000, 2000, 5000, 10000, 20000, 50000, 100000}));
+}
+
+Aggregation CountDistributionAggregation() {
+ return Aggregation::Distribution(BucketBoundaries::Exponential(17, 1.0, 2.0));
+}
+
+ViewDescriptor MinuteDescriptor() {
+ auto descriptor = ViewDescriptor();
+ SetAggregationWindow(AggregationWindow::Interval(absl::Minutes(1)),
+ &descriptor);
+ return descriptor;
+}
+
+ViewDescriptor HourDescriptor() {
+ auto descriptor = ViewDescriptor();
+ SetAggregationWindow(AggregationWindow::Interval(absl::Hours(1)),
+ &descriptor);
+ return descriptor;
+}
+
+} // namespace
+
+void RegisterOpenCensusViewsForExport() {
+ ClientSentMessagesPerRpcCumulative().RegisterForExport();
+ ClientSentBytesPerRpcCumulative().RegisterForExport();
+ ClientReceivedMessagesPerRpcCumulative().RegisterForExport();
+ ClientReceivedBytesPerRpcCumulative().RegisterForExport();
+ ClientRoundtripLatencyCumulative().RegisterForExport();
+ ClientServerLatencyCumulative().RegisterForExport();
+
+ ServerSentMessagesPerRpcCumulative().RegisterForExport();
+ ServerSentBytesPerRpcCumulative().RegisterForExport();
+ ServerReceivedMessagesPerRpcCumulative().RegisterForExport();
+ ServerReceivedBytesPerRpcCumulative().RegisterForExport();
+ ServerServerLatencyCumulative().RegisterForExport();
+}
+
+// client cumulative
+const ViewDescriptor& ClientSentBytesPerRpcCumulative() {
+ const static ViewDescriptor descriptor =
+ ViewDescriptor()
+ .set_name("grpc.io/client/sent_bytes_per_rpc/cumulative")
+ .set_measure(kRpcClientSentBytesPerRpcMeasureName)
+ .set_aggregation(BytesDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientReceivedBytesPerRpcCumulative() {
+ const static ViewDescriptor descriptor =
+ ViewDescriptor()
+ .set_name("grpc.io/client/received_bytes_per_rpc/cumulative")
+ .set_measure(kRpcClientReceivedBytesPerRpcMeasureName)
+ .set_aggregation(BytesDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientRoundtripLatencyCumulative() {
+ const static ViewDescriptor descriptor =
+ ViewDescriptor()
+ .set_name("grpc.io/client/roundtrip_latency/cumulative")
+ .set_measure(kRpcClientRoundtripLatencyMeasureName)
+ .set_aggregation(MillisDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientServerLatencyCumulative() {
+ const static ViewDescriptor descriptor =
+ ViewDescriptor()
+ .set_name("grpc.io/client/server_latency/cumulative")
+ .set_measure(kRpcClientServerLatencyMeasureName)
+ .set_aggregation(MillisDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientCompletedRpcsCumulative() {
+ const static ViewDescriptor descriptor =
+ ViewDescriptor()
+ .set_name("grpc.io/client/completed_rpcs/cumulative")
+ .set_measure(kRpcClientRoundtripLatencyMeasureName)
+ .set_aggregation(Aggregation::Count())
+ .add_column(ClientMethodTagKey())
+ .add_column(ClientStatusTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientSentMessagesPerRpcCumulative() {
+ const static ViewDescriptor descriptor =
+ ViewDescriptor()
+ .set_name("grpc.io/client/received_messages_per_rpc/cumulative")
+ .set_measure(kRpcClientSentMessagesPerRpcMeasureName)
+ .set_aggregation(CountDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientReceivedMessagesPerRpcCumulative() {
+ const static ViewDescriptor descriptor =
+ ViewDescriptor()
+ .set_name("grpc.io/client/sent_messages_per_rpc/cumulative")
+ .set_measure(kRpcClientReceivedMessagesPerRpcMeasureName)
+ .set_aggregation(CountDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+// server cumulative
+const ViewDescriptor& ServerSentBytesPerRpcCumulative() {
+ const static ViewDescriptor descriptor =
+ ViewDescriptor()
+ .set_name("grpc.io/server/received_bytes_per_rpc/cumulative")
+ .set_measure(kRpcServerSentBytesPerRpcMeasureName)
+ .set_aggregation(BytesDistributionAggregation())
+ .add_column(ServerMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ServerReceivedBytesPerRpcCumulative() {
+ const static ViewDescriptor descriptor =
+ ViewDescriptor()
+ .set_name("grpc.io/server/sent_bytes_per_rpc/cumulative")
+ .set_measure(kRpcServerReceivedBytesPerRpcMeasureName)
+ .set_aggregation(BytesDistributionAggregation())
+ .add_column(ServerMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ServerServerLatencyCumulative() {
+ const static ViewDescriptor descriptor =
+ ViewDescriptor()
+ .set_name("grpc.io/server/elapsed_time/cumulative")
+ .set_measure(kRpcServerServerLatencyMeasureName)
+ .set_aggregation(MillisDistributionAggregation())
+ .add_column(ServerMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ServerCompletedRpcsCumulative() {
+ const static ViewDescriptor descriptor =
+ ViewDescriptor()
+ .set_name("grpc.io/server/completed_rpcs/cumulative")
+ .set_measure(kRpcServerServerLatencyMeasureName)
+ .set_aggregation(Aggregation::Count())
+ .add_column(ServerMethodTagKey())
+ .add_column(ServerStatusTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ServerSentMessagesPerRpcCumulative() {
+ const static ViewDescriptor descriptor =
+ ViewDescriptor()
+ .set_name("grpc.io/server/received_messages_per_rpc/cumulative")
+ .set_measure(kRpcServerSentMessagesPerRpcMeasureName)
+ .set_aggregation(CountDistributionAggregation())
+ .add_column(ServerMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ServerReceivedMessagesPerRpcCumulative() {
+ const static ViewDescriptor descriptor =
+ ViewDescriptor()
+ .set_name("grpc.io/server/sent_messages_per_rpc/cumulative")
+ .set_measure(kRpcServerReceivedMessagesPerRpcMeasureName)
+ .set_aggregation(CountDistributionAggregation())
+ .add_column(ServerMethodTagKey());
+ return descriptor;
+}
+
+// client minute
+const ViewDescriptor& ClientSentBytesPerRpcMinute() {
+ const static ViewDescriptor descriptor =
+ MinuteDescriptor()
+ .set_name("grpc.io/client/sent_bytes_per_rpc/minute")
+ .set_measure(kRpcClientSentBytesPerRpcMeasureName)
+ .set_aggregation(BytesDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientReceivedBytesPerRpcMinute() {
+ const static ViewDescriptor descriptor =
+ MinuteDescriptor()
+ .set_name("grpc.io/client/received_bytes_per_rpc/minute")
+ .set_measure(kRpcClientReceivedBytesPerRpcMeasureName)
+ .set_aggregation(BytesDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientRoundtripLatencyMinute() {
+ const static ViewDescriptor descriptor =
+ MinuteDescriptor()
+ .set_name("grpc.io/client/roundtrip_latency/minute")
+ .set_measure(kRpcClientRoundtripLatencyMeasureName)
+ .set_aggregation(MillisDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientServerLatencyMinute() {
+ const static ViewDescriptor descriptor =
+ MinuteDescriptor()
+ .set_name("grpc.io/client/server_latency/minute")
+ .set_measure(kRpcClientServerLatencyMeasureName)
+ .set_aggregation(MillisDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientCompletedRpcsMinute() {
+ const static ViewDescriptor descriptor =
+ MinuteDescriptor()
+ .set_name("grpc.io/client/completed_rpcs/minute")
+ .set_measure(kRpcClientRoundtripLatencyMeasureName)
+ .set_aggregation(Aggregation::Count())
+ .add_column(ClientMethodTagKey())
+ .add_column(ClientStatusTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientSentMessagesPerRpcMinute() {
+ const static ViewDescriptor descriptor =
+ MinuteDescriptor()
+ .set_name("grpc.io/client/sent_messages_per_rpc/minute")
+ .set_measure(kRpcClientSentMessagesPerRpcMeasureName)
+ .set_aggregation(CountDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientReceivedMessagesPerRpcMinute() {
+ const static ViewDescriptor descriptor =
+ MinuteDescriptor()
+ .set_name("grpc.io/client/received_messages_per_rpc/minute")
+ .set_measure(kRpcClientReceivedMessagesPerRpcMeasureName)
+ .set_aggregation(CountDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+// server minute
+const ViewDescriptor& ServerSentBytesPerRpcMinute() {
+ const static ViewDescriptor descriptor =
+ MinuteDescriptor()
+ .set_name("grpc.io/server/sent_bytes_per_rpc/minute")
+ .set_measure(kRpcServerSentBytesPerRpcMeasureName)
+ .set_aggregation(BytesDistributionAggregation())
+ .add_column(ServerMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ServerReceivedBytesPerRpcMinute() {
+ const static ViewDescriptor descriptor =
+ MinuteDescriptor()
+ .set_name("grpc.io/server/received_bytes_per_rpc/minute")
+ .set_measure(kRpcServerReceivedBytesPerRpcMeasureName)
+ .set_aggregation(BytesDistributionAggregation())
+ .add_column(ServerMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ServerServerLatencyMinute() {
+ const static ViewDescriptor descriptor =
+ MinuteDescriptor()
+ .set_name("grpc.io/server/server_latency/minute")
+ .set_measure(kRpcServerServerLatencyMeasureName)
+ .set_aggregation(MillisDistributionAggregation())
+ .add_column(ServerMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ServerCompletedRpcsMinute() {
+ const static ViewDescriptor descriptor =
+ MinuteDescriptor()
+ .set_name("grpc.io/server/completed_rpcs/minute")
+ .set_measure(kRpcServerServerLatencyMeasureName)
+ .set_aggregation(Aggregation::Count())
+ .add_column(ServerMethodTagKey())
+ .add_column(ServerStatusTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ServerSentMessagesPerRpcMinute() {
+ const static ViewDescriptor descriptor =
+ MinuteDescriptor()
+ .set_name("grpc.io/server/sent_messages_per_rpc/minute")
+ .set_measure(kRpcServerSentMessagesPerRpcMeasureName)
+ .set_aggregation(CountDistributionAggregation())
+ .add_column(ServerMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ServerReceivedMessagesPerRpcMinute() {
+ const static ViewDescriptor descriptor =
+ MinuteDescriptor()
+ .set_name("grpc.io/server/received_messages_per_rpc/minute")
+ .set_measure(kRpcServerReceivedMessagesPerRpcMeasureName)
+ .set_aggregation(CountDistributionAggregation())
+ .add_column(ServerMethodTagKey());
+ return descriptor;
+}
+
+// client hour
+const ViewDescriptor& ClientSentBytesPerRpcHour() {
+ const static ViewDescriptor descriptor =
+ HourDescriptor()
+ .set_name("grpc.io/client/sent_bytes_per_rpc/hour")
+ .set_measure(kRpcClientSentBytesPerRpcMeasureName)
+ .set_aggregation(BytesDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientReceivedBytesPerRpcHour() {
+ const static ViewDescriptor descriptor =
+ HourDescriptor()
+ .set_name("grpc.io/client/received_bytes_per_rpc/hour")
+ .set_measure(kRpcClientReceivedBytesPerRpcMeasureName)
+ .set_aggregation(BytesDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientRoundtripLatencyHour() {
+ const static ViewDescriptor descriptor =
+ HourDescriptor()
+ .set_name("grpc.io/client/roundtrip_latency/hour")
+ .set_measure(kRpcClientRoundtripLatencyMeasureName)
+ .set_aggregation(MillisDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientServerLatencyHour() {
+ const static ViewDescriptor descriptor =
+ HourDescriptor()
+ .set_name("grpc.io/client/server_latency/hour")
+ .set_measure(kRpcClientServerLatencyMeasureName)
+ .set_aggregation(MillisDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientCompletedRpcsHour() {
+ const static ViewDescriptor descriptor =
+ HourDescriptor()
+ .set_name("grpc.io/client/completed_rpcs/hour")
+ .set_measure(kRpcClientRoundtripLatencyMeasureName)
+ .set_aggregation(Aggregation::Count())
+ .add_column(ClientMethodTagKey())
+ .add_column(ClientStatusTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientSentMessagesPerRpcHour() {
+ const static ViewDescriptor descriptor =
+ HourDescriptor()
+ .set_name("grpc.io/client/sent_messages_per_rpc/hour")
+ .set_measure(kRpcClientSentMessagesPerRpcMeasureName)
+ .set_aggregation(CountDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientReceivedMessagesPerRpcHour() {
+ const static ViewDescriptor descriptor =
+ HourDescriptor()
+ .set_name("grpc.io/client/received_messages_per_rpc/hour")
+ .set_measure(kRpcClientReceivedMessagesPerRpcMeasureName)
+ .set_aggregation(CountDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+// server hour
+const ViewDescriptor& ServerSentBytesPerRpcHour() {
+ const static ViewDescriptor descriptor =
+ HourDescriptor()
+ .set_name("grpc.io/server/sent_bytes_per_rpc/hour")
+ .set_measure(kRpcServerSentBytesPerRpcMeasureName)
+ .set_aggregation(BytesDistributionAggregation())
+ .add_column(ServerMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ServerReceivedBytesPerRpcHour() {
+ const static ViewDescriptor descriptor =
+ HourDescriptor()
+ .set_name("grpc.io/server/received_bytes_per_rpc/hour")
+ .set_measure(kRpcServerReceivedBytesPerRpcMeasureName)
+ .set_aggregation(BytesDistributionAggregation())
+ .add_column(ServerMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ServerServerLatencyHour() {
+ const static ViewDescriptor descriptor =
+ HourDescriptor()
+ .set_name("grpc.io/server/server_latency/hour")
+ .set_measure(kRpcServerServerLatencyMeasureName)
+ .set_aggregation(MillisDistributionAggregation())
+ .add_column(ServerMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ServerCompletedRpcsHour() {
+ const static ViewDescriptor descriptor =
+ HourDescriptor()
+ .set_name("grpc.io/server/completed_rpcs/hour")
+ .set_measure(kRpcServerServerLatencyMeasureName)
+ .set_aggregation(Aggregation::Count())
+ .add_column(ServerMethodTagKey())
+ .add_column(ServerStatusTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ServerSentMessagesPerRpcHour() {
+ const static ViewDescriptor descriptor =
+ HourDescriptor()
+ .set_name("grpc.io/server/sent_messages_per_rpc/hour")
+ .set_measure(kRpcServerSentMessagesPerRpcMeasureName)
+ .set_aggregation(CountDistributionAggregation())
+ .add_column(ServerMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ServerReceivedMessagesPerRpcHour() {
+ const static ViewDescriptor descriptor =
+ HourDescriptor()
+ .set_name("grpc.io/server/received_messages_per_rpc/hour")
+ .set_measure(kRpcServerReceivedMessagesPerRpcMeasureName)
+ .set_aggregation(CountDistributionAggregation())
+ .add_column(ServerMethodTagKey());
+ return descriptor;
+}
+
+} // namespace grpc
diff --git a/src/cpp/server/health/default_health_check_service.cc b/src/cpp/server/health/default_health_check_service.cc
index 0b45a8b714..bfda67d086 100644
--- a/src/cpp/server/health/default_health_check_service.cc
+++ b/src/cpp/server/health/default_health_check_service.cc
@@ -24,10 +24,10 @@
#include <grpc/support/log.h>
#include <grpcpp/impl/codegen/method_handler_impl.h>
+#include "pb_decode.h"
+#include "pb_encode.h"
#include "src/cpp/server/health/default_health_check_service.h"
#include "src/cpp/server/health/health.pb.h"
-#include "third_party/nanopb/pb_decode.h"
-#include "third_party/nanopb/pb_encode.h"
namespace grpc {
namespace {
diff --git a/src/cpp/server/health/health.pb.h b/src/cpp/server/health/health.pb.h
index 7051b3260a..29e1f3bacb 100644
--- a/src/cpp/server/health/health.pb.h
+++ b/src/cpp/server/health/health.pb.h
@@ -3,7 +3,7 @@
#ifndef PB_GRPC_HEALTH_V1_HEALTH_PB_H_INCLUDED
#define PB_GRPC_HEALTH_V1_HEALTH_PB_H_INCLUDED
-#include "third_party/nanopb/pb.h"
+#include "pb.h"
/* @@protoc_insertion_point(includes) */
#if PB_PROTO_HEADER_VERSION != 30
#error Regenerate this file with the current version of nanopb generator.
diff --git a/src/cpp/server/load_reporter/constants.h b/src/cpp/server/load_reporter/constants.h
new file mode 100644
index 0000000000..07c5965fff
--- /dev/null
+++ b/src/cpp/server/load_reporter/constants.h
@@ -0,0 +1,71 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPC_SRC_CPP_SERVER_LOAD_REPORTER_UTIL_H
+#define GRPC_SRC_CPP_SERVER_LOAD_REPORTER_UTIL_H
+
+#include <grpc/impl/codegen/port_platform.h>
+
+namespace grpc {
+namespace load_reporter {
+
+constexpr size_t kLbIdLength = 8;
+constexpr size_t kIpv4AddressLength = 8;
+constexpr size_t kIpv6AddressLength = 32;
+
+constexpr char kInvalidLbId[] = "<INVALID_LBID_238dsb234890rb>";
+
+// Call statuses.
+
+constexpr char kCallStatusOk[] = "OK";
+constexpr char kCallStatusServerError[] = "5XX";
+constexpr char kCallStatusClientError[] = "4XX";
+
+// Tag keys.
+
+constexpr char kTagKeyToken[] = "token";
+constexpr char kTagKeyHost[] = "host";
+constexpr char kTagKeyUserId[] = "user_id";
+constexpr char kTagKeyStatus[] = "status";
+constexpr char kTagKeyMetricName[] = "metric_name";
+
+// Measure names.
+
+constexpr char kMeasureStartCount[] = "grpc.io/lb/start_count";
+constexpr char kMeasureEndCount[] = "grpc.io/lb/end_count";
+constexpr char kMeasureEndBytesSent[] = "grpc.io/lb/bytes_sent";
+constexpr char kMeasureEndBytesReceived[] = "grpc.io/lb/bytes_received";
+constexpr char kMeasureEndLatencyMs[] = "grpc.io/lb/latency_ms";
+constexpr char kMeasureOtherCallMetric[] = "grpc.io/lb/other_call_metric";
+
+// View names.
+
+constexpr char kViewStartCount[] = "grpc.io/lb_view/start_count";
+constexpr char kViewEndCount[] = "grpc.io/lb_view/end_count";
+constexpr char kViewEndBytesSent[] = "grpc.io/lb_view/bytes_sent";
+constexpr char kViewEndBytesReceived[] = "grpc.io/lb_view/bytes_received";
+constexpr char kViewEndLatencyMs[] = "grpc.io/lb_view/latency_ms";
+constexpr char kViewOtherCallMetricCount[] =
+ "grpc.io/lb_view/other_call_metric_count";
+constexpr char kViewOtherCallMetricValue[] =
+ "grpc.io/lb_view/other_call_metric_value";
+
+} // namespace load_reporter
+} // namespace grpc
+
+#endif // GRPC_SRC_CPP_SERVER_LOAD_REPORTER_UTIL_H
diff --git a/test/core/statistics/multiple_writers_test.cc b/src/cpp/server/load_reporter/get_cpu_stats.h
index 47410ab105..f514b0752f 100644
--- a/test/core/statistics/multiple_writers_test.cc
+++ b/src/cpp/server/load_reporter/get_cpu_stats.h
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015 gRPC authors.
+ * Copyright 2018 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,16 +16,21 @@
*
*/
-#include "test/core/statistics/census_log_tests.h"
+#ifndef GRPC_SRC_CPP_SERVER_LOAD_REPORTER_GET_CPU_STATS_H
+#define GRPC_SRC_CPP_SERVER_LOAD_REPORTER_GET_CPU_STATS_H
-#include <stdlib.h>
+#include <grpc/impl/codegen/port_platform.h>
-#include <grpc/support/time.h>
-#include "test/core/util/test_config.h"
+#include <utility>
-int main(int argc, char** argv) {
- grpc_test_init(argc, argv);
- srand(gpr_now(GPR_CLOCK_REALTIME).tv_nsec);
- test_multiple_writers();
- return 0;
-}
+namespace grpc {
+namespace load_reporter {
+
+// Reads the CPU stats (in a pair of busy and total numbers) from the system.
+// The units of the stats should be the same.
+std::pair<uint64_t, uint64_t> GetCpuStatsImpl();
+
+} // namespace load_reporter
+} // namespace grpc
+
+#endif // GRPC_SRC_CPP_SERVER_LOAD_REPORTER_GET_CPU_STATS_H
diff --git a/src/cpp/server/load_reporter/get_cpu_stats_linux.cc b/src/cpp/server/load_reporter/get_cpu_stats_linux.cc
new file mode 100644
index 0000000000..9c1fd0cd0b
--- /dev/null
+++ b/src/cpp/server/load_reporter/get_cpu_stats_linux.cc
@@ -0,0 +1,45 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#ifdef GPR_LINUX
+
+#include <cstdio>
+
+#include "src/cpp/server/load_reporter/get_cpu_stats.h"
+
+namespace grpc {
+namespace load_reporter {
+
+std::pair<uint64_t, uint64_t> GetCpuStatsImpl() {
+ uint64_t busy = 0, total = 0;
+ FILE* fp;
+ fp = fopen("/proc/stat", "r");
+ uint64_t user, nice, system, idle;
+ fscanf(fp, "cpu %lu %lu %lu %lu", &user, &nice, &system, &idle);
+ fclose(fp);
+ busy = user + nice + system;
+ total = busy + idle;
+ return std::make_pair(busy, total);
+}
+
+} // namespace load_reporter
+} // namespace grpc
+
+#endif // GPR_LINUX
diff --git a/src/cpp/server/load_reporter/get_cpu_stats_macos.cc b/src/cpp/server/load_reporter/get_cpu_stats_macos.cc
new file mode 100644
index 0000000000..dbdde304c2
--- /dev/null
+++ b/src/cpp/server/load_reporter/get_cpu_stats_macos.cc
@@ -0,0 +1,45 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#ifdef GPR_APPLE
+
+#include <mach/mach.h>
+
+#include "src/cpp/server/load_reporter/get_cpu_stats.h"
+
+namespace grpc {
+namespace load_reporter {
+
+std::pair<uint64_t, uint64_t> GetCpuStatsImpl() {
+ uint64_t busy = 0, total = 0;
+ host_cpu_load_info_data_t cpuinfo;
+ mach_msg_type_number_t count = HOST_CPU_LOAD_INFO_COUNT;
+ if (host_statistics(mach_host_self(), HOST_CPU_LOAD_INFO,
+ (host_info_t)&cpuinfo, &count) == KERN_SUCCESS) {
+ for (int i = 0; i < CPU_STATE_MAX; i++) total += cpuinfo.cpu_ticks[i];
+ busy = total - cpuinfo.cpu_ticks[CPU_STATE_IDLE];
+ }
+ return std::make_pair(busy, total);
+}
+
+} // namespace load_reporter
+} // namespace grpc
+
+#endif // GPR_APPLE
diff --git a/src/cpp/server/load_reporter/get_cpu_stats_unsupported.cc b/src/cpp/server/load_reporter/get_cpu_stats_unsupported.cc
new file mode 100644
index 0000000000..80fb8b6da1
--- /dev/null
+++ b/src/cpp/server/load_reporter/get_cpu_stats_unsupported.cc
@@ -0,0 +1,40 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#if !defined(GPR_LINUX) && !defined(GPR_WINDOWS) && !defined(GPR_APPLE)
+
+#include <grpc/support/log.h>
+
+#include "src/cpp/server/load_reporter/get_cpu_stats.h"
+
+namespace grpc {
+namespace load_reporter {
+
+std::pair<uint64_t, uint64_t> GetCpuStatsImpl() {
+ uint64_t busy = 0, total = 0;
+ gpr_log(GPR_ERROR,
+ "Platforms other than Linux, Windows, and MacOS are not supported.");
+ return std::make_pair(busy, total);
+}
+
+} // namespace load_reporter
+} // namespace grpc
+
+#endif // !defined(GPR_LINUX) && !defined(GPR_WINDOWS) && !defined(GPR_APPLE)
diff --git a/src/cpp/server/load_reporter/get_cpu_stats_windows.cc b/src/cpp/server/load_reporter/get_cpu_stats_windows.cc
new file mode 100644
index 0000000000..0a98e848a2
--- /dev/null
+++ b/src/cpp/server/load_reporter/get_cpu_stats_windows.cc
@@ -0,0 +1,55 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#ifdef GPR_WINDOWS
+
+#include <windows.h>
+#include <cstdint>
+
+#include "src/cpp/server/load_reporter/get_cpu_stats.h"
+
+namespace grpc {
+namespace load_reporter {
+
+namespace {
+
+uint64_t FiletimeToInt(const FILETIME& ft) {
+ ULARGE_INTEGER i;
+ i.LowPart = ft.dwLowDateTime;
+ i.HighPart = ft.dwHighDateTime;
+ return i.QuadPart;
+}
+
+} // namespace
+
+std::pair<uint64_t, uint64_t> GetCpuStatsImpl() {
+ uint64_t busy = 0, total = 0;
+ FILETIME idle, kernel, user;
+ if (GetSystemTimes(&idle, &kernel, &user) != 0) {
+ total = FiletimeToInt(kernel) + FiletimeToInt(user);
+ busy = total - FiletimeToInt(idle);
+ }
+ return std::make_pair(busy, total);
+}
+
+} // namespace load_reporter
+} // namespace grpc
+
+#endif // GPR_WINDOWS
diff --git a/src/cpp/server/load_reporter/load_data_store.cc b/src/cpp/server/load_reporter/load_data_store.cc
index 70f12c1102..594473f5e7 100644
--- a/src/cpp/server/load_reporter/load_data_store.cc
+++ b/src/cpp/server/load_reporter/load_data_store.cc
@@ -16,11 +16,15 @@
*
*/
+#include <grpc/impl/codegen/port_platform.h>
+
+#include <stdio.h>
#include <cstdlib>
#include <set>
#include <unordered_map>
#include <vector>
+#include "src/core/lib/iomgr/socket_utils.h"
#include "src/cpp/server/load_reporter/load_data_store.h"
namespace grpc {
@@ -73,6 +77,67 @@ const typename C::value_type* RandomElement(const C& container) {
} // namespace
+LoadRecordKey::LoadRecordKey(const grpc::string& client_ip_and_token,
+ grpc::string user_id)
+ : user_id_(std::move(user_id)) {
+ GPR_ASSERT(client_ip_and_token.size() >= 2);
+ int ip_hex_size;
+ GPR_ASSERT(sscanf(client_ip_and_token.substr(0, 2).c_str(), "%d",
+ &ip_hex_size) == 1);
+ GPR_ASSERT(ip_hex_size == 0 || ip_hex_size == kIpv4AddressLength ||
+ ip_hex_size == kIpv6AddressLength);
+ size_t cur_pos = 2;
+ client_ip_hex_ = client_ip_and_token.substr(cur_pos, ip_hex_size);
+ cur_pos += ip_hex_size;
+ if (client_ip_and_token.size() - cur_pos < kLbIdLength) {
+ lb_id_ = kInvalidLbId;
+ lb_tag_ = "";
+ } else {
+ lb_id_ = client_ip_and_token.substr(cur_pos, kLbIdLength);
+ lb_tag_ = client_ip_and_token.substr(cur_pos + kLbIdLength);
+ }
+}
+
+grpc::string LoadRecordKey::GetClientIpBytes() const {
+ if (client_ip_hex_.empty()) {
+ return "";
+ } else if (client_ip_hex_.size() == kIpv4AddressLength) {
+ uint32_t ip_bytes;
+ if (sscanf(client_ip_hex_.c_str(), "%x", &ip_bytes) != 1) {
+ gpr_log(GPR_ERROR,
+ "Can't parse client IP (%s) from a hex string to an integer.",
+ client_ip_hex_.c_str());
+ return "";
+ }
+ ip_bytes = grpc_htonl(ip_bytes);
+ return grpc::string(reinterpret_cast<const char*>(&ip_bytes),
+ sizeof(ip_bytes));
+ } else if (client_ip_hex_.size() == kIpv6AddressLength) {
+ uint32_t ip_bytes[4];
+ for (size_t i = 0; i < 4; ++i) {
+ if (sscanf(client_ip_hex_.substr(i * 8, (i + 1) * 8).c_str(), "%x",
+ ip_bytes + i) != 1) {
+ gpr_log(
+ GPR_ERROR,
+ "Can't parse client IP part (%s) from a hex string to an integer.",
+ client_ip_hex_.substr(i * 8, (i + 1) * 8).c_str());
+ return "";
+ }
+ ip_bytes[i] = grpc_htonl(ip_bytes[i]);
+ }
+ return grpc::string(reinterpret_cast<const char*>(ip_bytes),
+ sizeof(ip_bytes));
+ } else {
+ GPR_UNREACHABLE_CODE(return "");
+ }
+}
+
+LoadRecordValue::LoadRecordValue(grpc::string metric_name, uint64_t num_calls,
+ double total_metric_value) {
+ call_metrics_.emplace(std::move(metric_name),
+ CallMetricValue(num_calls, total_metric_value));
+}
+
void PerBalancerStore::MergeRow(const LoadRecordKey& key,
const LoadRecordValue& value) {
// During suspension, the load data received will be dropped.
diff --git a/src/cpp/server/load_reporter/load_data_store.h b/src/cpp/server/load_reporter/load_data_store.h
index feb8b2fd59..2da78ea064 100644
--- a/src/cpp/server/load_reporter/load_data_store.h
+++ b/src/cpp/server/load_reporter/load_data_store.h
@@ -28,12 +28,11 @@
#include <grpc/support/log.h>
#include <grpcpp/impl/codegen/config.h>
+#include "src/cpp/server/load_reporter/constants.h"
+
namespace grpc {
namespace load_reporter {
-constexpr char kInvalidLbId[] = "<INVALID_LBID_238dsb234890rb>";
-constexpr uint8_t kLbIdLen = 8;
-
// The load data storage is organized in hierarchy. The LoadDataStore is the
// top-level data store. In LoadDataStore, for each host we keep a
// PerHostStore, in which for each balancer we keep a PerBalancerStore. Each
@@ -68,13 +67,16 @@ class CallMetricValue {
// The key of a load record.
class LoadRecordKey {
public:
- explicit LoadRecordKey(grpc::string lb_id, grpc::string lb_tag,
- grpc::string user_id, grpc::string client_ip_hex)
+ LoadRecordKey(grpc::string lb_id, grpc::string lb_tag, grpc::string user_id,
+ grpc::string client_ip_hex)
: lb_id_(std::move(lb_id)),
lb_tag_(std::move(lb_tag)),
user_id_(std::move(user_id)),
client_ip_hex_(std::move(client_ip_hex)) {}
+ // Parses the input client_ip_and_token to set client IP, LB ID, and LB tag.
+ LoadRecordKey(const grpc::string& client_ip_and_token, grpc::string user_id);
+
grpc::string ToString() const {
return "[lb_id_=" + lb_id_ + ", lb_tag_=" + lb_tag_ +
", user_id_=" + user_id_ + ", client_ip_hex_=" + client_ip_hex_ +
@@ -86,6 +88,9 @@ class LoadRecordKey {
user_id_ == other.user_id_ && client_ip_hex_ == other.client_ip_hex_;
}
+ // Gets the client IP bytes in network order (i.e., big-endian).
+ grpc::string GetClientIpBytes() const;
+
// Getters.
const grpc::string& lb_id() const { return lb_id_; }
const grpc::string& lb_tag() const { return lb_tag_; }
@@ -119,8 +124,8 @@ class LoadRecordKey {
class LoadRecordValue {
public:
explicit LoadRecordValue(uint64_t start_count = 0, uint64_t ok_count = 0,
- uint64_t error_count = 0, double bytes_sent = 0,
- double bytes_recv = 0, double latency_ms = 0)
+ uint64_t error_count = 0, uint64_t bytes_sent = 0,
+ uint64_t bytes_recv = 0, uint64_t latency_ms = 0)
: start_count_(start_count),
ok_count_(ok_count),
error_count_(error_count),
@@ -128,6 +133,9 @@ class LoadRecordValue {
bytes_recv_(bytes_recv),
latency_ms_(latency_ms) {}
+ LoadRecordValue(grpc::string metric_name, uint64_t num_calls,
+ double total_metric_value);
+
void MergeFrom(const LoadRecordValue& other) {
start_count_ += other.start_count_;
ok_count_ += other.ok_count_;
@@ -164,9 +172,9 @@ class LoadRecordValue {
uint64_t start_count() const { return start_count_; }
uint64_t ok_count() const { return ok_count_; }
uint64_t error_count() const { return error_count_; }
- double bytes_sent() const { return bytes_sent_; }
- double bytes_recv() const { return bytes_recv_; }
- double latency_ms() const { return latency_ms_; }
+ uint64_t bytes_sent() const { return bytes_sent_; }
+ uint64_t bytes_recv() const { return bytes_recv_; }
+ uint64_t latency_ms() const { return latency_ms_; }
const std::unordered_map<grpc::string, CallMetricValue>& call_metrics()
const {
return call_metrics_;
@@ -176,9 +184,9 @@ class LoadRecordValue {
uint64_t start_count_ = 0;
uint64_t ok_count_ = 0;
uint64_t error_count_ = 0;
- double bytes_sent_ = 0;
- double bytes_recv_ = 0;
- double latency_ms_ = 0;
+ uint64_t bytes_sent_ = 0;
+ uint64_t bytes_recv_ = 0;
+ uint64_t latency_ms_ = 0;
std::unordered_map<grpc::string, CallMetricValue> call_metrics_;
};
diff --git a/src/cpp/server/load_reporter/load_reporter.cc b/src/cpp/server/load_reporter/load_reporter.cc
new file mode 100644
index 0000000000..3f0063d883
--- /dev/null
+++ b/src/cpp/server/load_reporter/load_reporter.cc
@@ -0,0 +1,498 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/impl/codegen/port_platform.h>
+
+#include <stdint.h>
+#include <stdio.h>
+#include <chrono>
+#include <ctime>
+
+#include "src/cpp/server/load_reporter/constants.h"
+#include "src/cpp/server/load_reporter/get_cpu_stats.h"
+#include "src/cpp/server/load_reporter/load_reporter.h"
+
+#include "opencensus/stats/internal/set_aggregation_window.h"
+
+namespace grpc {
+namespace load_reporter {
+
+CpuStatsProvider::CpuStatsSample CpuStatsProviderDefaultImpl::GetCpuStats() {
+ return GetCpuStatsImpl();
+}
+
+CensusViewProvider::CensusViewProvider()
+ : tag_key_token_(::opencensus::stats::TagKey::Register(kTagKeyToken)),
+ tag_key_host_(::opencensus::stats::TagKey::Register(kTagKeyHost)),
+ tag_key_user_id_(::opencensus::stats::TagKey::Register(kTagKeyUserId)),
+ tag_key_status_(::opencensus::stats::TagKey::Register(kTagKeyStatus)),
+ tag_key_metric_name_(
+ ::opencensus::stats::TagKey::Register(kTagKeyMetricName)) {
+ // One view related to starting a call.
+ auto vd_start_count =
+ ::opencensus::stats::ViewDescriptor()
+ .set_name(kViewStartCount)
+ .set_measure(kMeasureStartCount)
+ .set_aggregation(::opencensus::stats::Aggregation::Sum())
+ .add_column(tag_key_token_)
+ .add_column(tag_key_host_)
+ .add_column(tag_key_user_id_)
+ .set_description(
+ "Delta count of calls started broken down by <token, host, "
+ "user_id>.");
+ ::opencensus::stats::SetAggregationWindow(
+ ::opencensus::stats::AggregationWindow::Delta(), &vd_start_count);
+ view_descriptor_map_.emplace(kViewStartCount, vd_start_count);
+ // Four views related to ending a call.
+ // If this view is set as Count of kMeasureEndBytesSent (in hope of saving one
+ // measure), it's infeasible to prepare fake data for testing. That's because
+ // the OpenCensus API to make up view data will add the input data as separate
+ // measurements instead of setting the data values directly.
+ auto vd_end_count =
+ ::opencensus::stats::ViewDescriptor()
+ .set_name((kViewEndCount))
+ .set_measure((kMeasureEndCount))
+ .set_aggregation(::opencensus::stats::Aggregation::Sum())
+ .add_column(tag_key_token_)
+ .add_column(tag_key_host_)
+ .add_column(tag_key_user_id_)
+ .add_column(tag_key_status_)
+ .set_description(
+ "Delta count of calls ended broken down by <token, host, "
+ "user_id, status>.");
+ ::opencensus::stats::SetAggregationWindow(
+ ::opencensus::stats::AggregationWindow::Delta(), &vd_end_count);
+ view_descriptor_map_.emplace(kViewEndCount, vd_end_count);
+ auto vd_end_bytes_sent =
+ ::opencensus::stats::ViewDescriptor()
+ .set_name((kViewEndBytesSent))
+ .set_measure((kMeasureEndBytesSent))
+ .set_aggregation(::opencensus::stats::Aggregation::Sum())
+ .add_column(tag_key_token_)
+ .add_column(tag_key_host_)
+ .add_column(tag_key_user_id_)
+ .add_column(tag_key_status_)
+ .set_description(
+ "Delta sum of bytes sent broken down by <token, host, user_id, "
+ "status>.");
+ ::opencensus::stats::SetAggregationWindow(
+ ::opencensus::stats::AggregationWindow::Delta(), &vd_end_bytes_sent);
+ view_descriptor_map_.emplace(kViewEndBytesSent, vd_end_bytes_sent);
+ auto vd_end_bytes_received =
+ ::opencensus::stats::ViewDescriptor()
+ .set_name((kViewEndBytesReceived))
+ .set_measure((kMeasureEndBytesReceived))
+ .set_aggregation(::opencensus::stats::Aggregation::Sum())
+ .add_column(tag_key_token_)
+ .add_column(tag_key_host_)
+ .add_column(tag_key_user_id_)
+ .add_column(tag_key_status_)
+ .set_description(
+ "Delta sum of bytes received broken down by <token, host, "
+ "user_id, status>.");
+ ::opencensus::stats::SetAggregationWindow(
+ ::opencensus::stats::AggregationWindow::Delta(), &vd_end_bytes_received);
+ view_descriptor_map_.emplace(kViewEndBytesReceived, vd_end_bytes_received);
+ auto vd_end_latency_ms =
+ ::opencensus::stats::ViewDescriptor()
+ .set_name((kViewEndLatencyMs))
+ .set_measure((kMeasureEndLatencyMs))
+ .set_aggregation(::opencensus::stats::Aggregation::Sum())
+ .add_column(tag_key_token_)
+ .add_column(tag_key_host_)
+ .add_column(tag_key_user_id_)
+ .add_column(tag_key_status_)
+ .set_description(
+ "Delta sum of latency in ms broken down by <token, host, "
+ "user_id, status>.");
+ ::opencensus::stats::SetAggregationWindow(
+ ::opencensus::stats::AggregationWindow::Delta(), &vd_end_latency_ms);
+ view_descriptor_map_.emplace(kViewEndLatencyMs, vd_end_latency_ms);
+ // Two views related to other call metrics.
+ auto vd_metric_call_count =
+ ::opencensus::stats::ViewDescriptor()
+ .set_name((kViewOtherCallMetricCount))
+ .set_measure((kMeasureOtherCallMetric))
+ .set_aggregation(::opencensus::stats::Aggregation::Count())
+ .add_column(tag_key_token_)
+ .add_column(tag_key_host_)
+ .add_column(tag_key_user_id_)
+ .add_column(tag_key_metric_name_)
+ .set_description(
+ "Delta count of calls broken down by <token, host, user_id, "
+ "metric_name>.");
+ ::opencensus::stats::SetAggregationWindow(
+ ::opencensus::stats::AggregationWindow::Delta(), &vd_metric_call_count);
+ view_descriptor_map_.emplace(kViewOtherCallMetricCount, vd_metric_call_count);
+ auto vd_metric_value =
+ ::opencensus::stats::ViewDescriptor()
+ .set_name((kViewOtherCallMetricValue))
+ .set_measure((kMeasureOtherCallMetric))
+ .set_aggregation(::opencensus::stats::Aggregation::Sum())
+ .add_column(tag_key_token_)
+ .add_column(tag_key_host_)
+ .add_column(tag_key_user_id_)
+ .add_column(tag_key_metric_name_)
+ .set_description(
+ "Delta sum of call metric value broken down "
+ "by <token, host, user_id, metric_name>.");
+ ::opencensus::stats::SetAggregationWindow(
+ ::opencensus::stats::AggregationWindow::Delta(), &vd_metric_value);
+ view_descriptor_map_.emplace(kViewOtherCallMetricValue, vd_metric_value);
+}
+
+double CensusViewProvider::GetRelatedViewDataRowDouble(
+ const ViewDataMap& view_data_map, const char* view_name,
+ size_t view_name_len, const std::vector<grpc::string>& tag_values) {
+ auto it_vd = view_data_map.find(grpc::string(view_name, view_name_len));
+ GPR_ASSERT(it_vd != view_data_map.end());
+ auto it_row = it_vd->second.double_data().find(tag_values);
+ GPR_ASSERT(it_row != it_vd->second.double_data().end());
+ return it_row->second;
+}
+
+CensusViewProviderDefaultImpl::CensusViewProviderDefaultImpl() {
+ for (const auto& p : view_descriptor_map()) {
+ const grpc::string& view_name = p.first;
+ const ::opencensus::stats::ViewDescriptor& vd = p.second;
+ // We need to use pair's piecewise ctor here, otherwise the deleted copy
+ // ctor of View will be called.
+ view_map_.emplace(std::piecewise_construct,
+ std::forward_as_tuple(view_name),
+ std::forward_as_tuple(vd));
+ }
+}
+
+CensusViewProvider::ViewDataMap CensusViewProviderDefaultImpl::FetchViewData() {
+ gpr_log(GPR_DEBUG, "[CVP %p] Starts fetching Census view data.", this);
+ ViewDataMap view_data_map;
+ for (auto& p : view_map_) {
+ const grpc::string& view_name = p.first;
+ ::opencensus::stats::View& view = p.second;
+ if (view.IsValid()) {
+ view_data_map.emplace(view_name, view.GetData());
+ gpr_log(GPR_DEBUG, "[CVP %p] Fetched view data (view: %s).", this,
+ view_name.c_str());
+ } else {
+ gpr_log(
+ GPR_DEBUG,
+ "[CVP %p] Can't fetch view data because view is invalid (view: %s).",
+ this, view_name.c_str());
+ }
+ }
+ return view_data_map;
+}
+
+grpc::string LoadReporter::GenerateLbId() {
+ while (true) {
+ if (next_lb_id_ > UINT32_MAX) {
+ gpr_log(GPR_ERROR, "[LR %p] The LB ID exceeds the max valid value!",
+ this);
+ return "";
+ }
+ int64_t lb_id = next_lb_id_++;
+ // Overflow should never happen.
+ GPR_ASSERT(lb_id >= 0);
+ // Convert to padded hex string for a 32-bit LB ID. E.g, "0000ca5b".
+ char buf[kLbIdLength + 1];
+ snprintf(buf, sizeof(buf), "%08lx", lb_id);
+ grpc::string lb_id_str(buf, kLbIdLength);
+ // The client may send requests with LB ID that has never been allocated
+ // by this load reporter. Those IDs are tracked and will be skipped when
+ // we generate a new ID.
+ if (!load_data_store_.IsTrackedUnknownBalancerId(lb_id_str)) {
+ return lb_id_str;
+ }
+ }
+}
+
+::grpc::lb::v1::LoadBalancingFeedback
+LoadReporter::GenerateLoadBalancingFeedback() {
+ std::unique_lock<std::mutex> lock(feedback_mu_);
+ auto now = std::chrono::system_clock::now();
+ // Discard records outside the window until there is only one record
+ // outside the window, which is used as the base for difference.
+ while (feedback_records_.size() > 1 &&
+ !IsRecordInWindow(feedback_records_[1], now)) {
+ feedback_records_.pop_front();
+ }
+ if (feedback_records_.size() < 2) {
+ return ::grpc::lb::v1::LoadBalancingFeedback::default_instance();
+ }
+ // Find the longest range with valid ends.
+ LoadBalancingFeedbackRecord* oldest = &feedback_records_[0];
+ LoadBalancingFeedbackRecord* newest =
+ &feedback_records_[feedback_records_.size() - 1];
+ while (newest > oldest &&
+ (newest->cpu_limit == 0 || oldest->cpu_limit == 0)) {
+ // A zero limit means that the system info reading was failed, so these
+ // records can't be used to calculate CPU utilization.
+ if (newest->cpu_limit == 0) --newest;
+ if (oldest->cpu_limit == 0) ++oldest;
+ }
+ if (newest - oldest < 1 || oldest->end_time == newest->end_time ||
+ newest->cpu_limit == oldest->cpu_limit) {
+ return ::grpc::lb::v1::LoadBalancingFeedback::default_instance();
+ }
+ uint64_t rpcs = 0;
+ uint64_t errors = 0;
+ for (LoadBalancingFeedbackRecord* p = newest; p != oldest; --p) {
+ // Because these two numbers are counters, the oldest record shouldn't be
+ // included.
+ rpcs += p->rpcs;
+ errors += p->errors;
+ }
+ double cpu_usage = newest->cpu_usage - oldest->cpu_usage;
+ double cpu_limit = newest->cpu_limit - oldest->cpu_limit;
+ std::chrono::duration<double> duration_seconds =
+ newest->end_time - oldest->end_time;
+ lock.unlock();
+ ::grpc::lb::v1::LoadBalancingFeedback feedback;
+ feedback.set_server_utilization(static_cast<float>(cpu_usage / cpu_limit));
+ feedback.set_calls_per_second(
+ static_cast<float>(rpcs / duration_seconds.count()));
+ feedback.set_errors_per_second(
+ static_cast<float>(errors / duration_seconds.count()));
+ return feedback;
+}
+
+::google::protobuf::RepeatedPtrField<::grpc::lb::v1::Load>
+LoadReporter::GenerateLoads(const grpc::string& hostname,
+ const grpc::string& lb_id) {
+ std::lock_guard<std::mutex> lock(store_mu_);
+ auto assigned_stores = load_data_store_.GetAssignedStores(hostname, lb_id);
+ GPR_ASSERT(assigned_stores != nullptr);
+ GPR_ASSERT(!assigned_stores->empty());
+ ::google::protobuf::RepeatedPtrField<::grpc::lb::v1::Load> loads;
+ for (PerBalancerStore* per_balancer_store : *assigned_stores) {
+ GPR_ASSERT(!per_balancer_store->IsSuspended());
+ if (!per_balancer_store->load_record_map().empty()) {
+ for (const auto& p : per_balancer_store->load_record_map()) {
+ const auto& key = p.first;
+ const auto& value = p.second;
+ auto load = loads.Add();
+ load->set_load_balance_tag(key.lb_tag());
+ load->set_user_id(key.user_id());
+ load->set_client_ip_address(key.GetClientIpBytes());
+ load->set_num_calls_started(static_cast<int64_t>(value.start_count()));
+ load->set_num_calls_finished_without_error(
+ static_cast<int64_t>(value.ok_count()));
+ load->set_num_calls_finished_with_error(
+ static_cast<int64_t>(value.error_count()));
+ load->set_total_bytes_sent(static_cast<int64_t>(value.bytes_sent()));
+ load->set_total_bytes_received(
+ static_cast<int64_t>(value.bytes_recv()));
+ load->mutable_total_latency()->set_seconds(
+ static_cast<int64_t>(value.latency_ms() / 1000));
+ load->mutable_total_latency()->set_nanos(
+ (static_cast<int32_t>(value.latency_ms()) % 1000) * 1000000);
+ for (const auto& p : value.call_metrics()) {
+ const grpc::string& metric_name = p.first;
+ const CallMetricValue& metric_value = p.second;
+ auto call_metric_data = load->add_metric_data();
+ call_metric_data->set_metric_name(metric_name);
+ call_metric_data->set_num_calls_finished_with_metric(
+ metric_value.num_calls());
+ call_metric_data->set_total_metric_value(
+ metric_value.total_metric_value());
+ }
+ if (per_balancer_store->lb_id() != lb_id) {
+ // This per-balancer store is an orphan assigned to this receiving
+ // balancer.
+ AttachOrphanLoadId(load, *per_balancer_store);
+ }
+ }
+ per_balancer_store->ClearLoadRecordMap();
+ }
+ if (per_balancer_store->IsNumCallsInProgressChangedSinceLastReport()) {
+ auto load = loads.Add();
+ load->set_num_calls_in_progress(
+ per_balancer_store->GetNumCallsInProgressForReport());
+ if (per_balancer_store->lb_id() != lb_id) {
+ // This per-balancer store is an orphan assigned to this receiving
+ // balancer.
+ AttachOrphanLoadId(load, *per_balancer_store);
+ }
+ }
+ }
+ return loads;
+}
+
+void LoadReporter::AttachOrphanLoadId(
+ ::grpc::lb::v1::Load* load, const PerBalancerStore& per_balancer_store) {
+ if (per_balancer_store.lb_id() == kInvalidLbId) {
+ load->set_load_key_unknown(true);
+ } else {
+ load->set_load_key_unknown(false);
+ load->mutable_orphaned_load_identifier()->set_load_key(
+ per_balancer_store.load_key());
+ load->mutable_orphaned_load_identifier()->set_load_balancer_id(
+ per_balancer_store.lb_id());
+ }
+}
+
+void LoadReporter::AppendNewFeedbackRecord(uint64_t rpcs, uint64_t errors) {
+ CpuStatsProvider::CpuStatsSample cpu_stats;
+ if (cpu_stats_provider_ != nullptr) {
+ cpu_stats = cpu_stats_provider_->GetCpuStats();
+ } else {
+ // This will make the load balancing feedback generation a no-op.
+ cpu_stats = {0, 0};
+ }
+ std::unique_lock<std::mutex> lock(feedback_mu_);
+ feedback_records_.emplace_back(std::chrono::system_clock::now(), rpcs, errors,
+ cpu_stats.first, cpu_stats.second);
+}
+
+void LoadReporter::ReportStreamCreated(const grpc::string& hostname,
+ const grpc::string& lb_id,
+ const grpc::string& load_key) {
+ std::lock_guard<std::mutex> lock(store_mu_);
+ load_data_store_.ReportStreamCreated(hostname, lb_id, load_key);
+ gpr_log(GPR_INFO,
+ "[LR %p] Report stream created (host: %s, LB ID: %s, load key: %s).",
+ this, hostname.c_str(), lb_id.c_str(), load_key.c_str());
+}
+
+void LoadReporter::ReportStreamClosed(const grpc::string& hostname,
+ const grpc::string& lb_id) {
+ std::lock_guard<std::mutex> lock(store_mu_);
+ load_data_store_.ReportStreamClosed(hostname, lb_id);
+ gpr_log(GPR_INFO, "[LR %p] Report stream closed (host: %s, LB ID: %s).", this,
+ hostname.c_str(), lb_id.c_str());
+}
+
+void LoadReporter::ProcessViewDataCallStart(
+ const CensusViewProvider::ViewDataMap& view_data_map) {
+ auto it = view_data_map.find(kViewStartCount);
+ if (it != view_data_map.end()) {
+ // Note that the data type for any Sum view is double, whatever the data
+ // type of the original measure.
+ for (const auto& p : it->second.double_data()) {
+ const std::vector<grpc::string>& tag_values = p.first;
+ const uint64_t start_count = static_cast<uint64_t>(p.second);
+ const grpc::string& client_ip_and_token = tag_values[0];
+ const grpc::string& host = tag_values[1];
+ const grpc::string& user_id = tag_values[2];
+ LoadRecordKey key(client_ip_and_token, user_id);
+ LoadRecordValue value = LoadRecordValue(start_count);
+ {
+ std::unique_lock<std::mutex> lock(store_mu_);
+ load_data_store_.MergeRow(host, key, value);
+ }
+ }
+ }
+}
+
+void LoadReporter::ProcessViewDataCallEnd(
+ const CensusViewProvider::ViewDataMap& view_data_map) {
+ uint64_t total_end_count = 0;
+ uint64_t total_error_count = 0;
+ auto it = view_data_map.find(kViewEndCount);
+ if (it != view_data_map.end()) {
+ // Note that the data type for any Sum view is double, whatever the data
+ // type of the original measure.
+ for (const auto& p : it->second.double_data()) {
+ const std::vector<grpc::string>& tag_values = p.first;
+ const uint64_t end_count = static_cast<uint64_t>(p.second);
+ const grpc::string& client_ip_and_token = tag_values[0];
+ const grpc::string& host = tag_values[1];
+ const grpc::string& user_id = tag_values[2];
+ const grpc::string& status = tag_values[3];
+ // This is due to a bug reported internally of Java server load reporting
+ // implementation.
+ // TODO(juanlishen): Check whether this situation happens in OSS C++.
+ if (client_ip_and_token.size() == 0) {
+ gpr_log(GPR_DEBUG,
+ "Skipping processing Opencensus record with empty "
+ "client_ip_and_token tag.");
+ continue;
+ }
+ LoadRecordKey key(client_ip_and_token, user_id);
+ const uint64_t bytes_sent =
+ CensusViewProvider::GetRelatedViewDataRowDouble(
+ view_data_map, kViewEndBytesSent, sizeof(kViewEndBytesSent) - 1,
+ tag_values);
+ const uint64_t bytes_received =
+ CensusViewProvider::GetRelatedViewDataRowDouble(
+ view_data_map, kViewEndBytesReceived,
+ sizeof(kViewEndBytesReceived) - 1, tag_values);
+ const uint64_t latency_ms =
+ CensusViewProvider::GetRelatedViewDataRowDouble(
+ view_data_map, kViewEndLatencyMs, sizeof(kViewEndLatencyMs) - 1,
+ tag_values);
+ uint64_t ok_count = 0;
+ uint64_t error_count = 0;
+ total_end_count += end_count;
+ if (std::strcmp(status.c_str(), kCallStatusOk) == 0) {
+ ok_count = end_count;
+ } else {
+ error_count = end_count;
+ total_error_count += end_count;
+ }
+ LoadRecordValue value = LoadRecordValue(
+ 0, ok_count, error_count, bytes_sent, bytes_received, latency_ms);
+ {
+ std::unique_lock<std::mutex> lock(store_mu_);
+ load_data_store_.MergeRow(host, key, value);
+ }
+ }
+ }
+ AppendNewFeedbackRecord(total_end_count, total_error_count);
+}
+
+void LoadReporter::ProcessViewDataOtherCallMetrics(
+ const CensusViewProvider::ViewDataMap& view_data_map) {
+ auto it = view_data_map.find(kViewOtherCallMetricCount);
+ if (it != view_data_map.end()) {
+ for (const auto& p : it->second.int_data()) {
+ const std::vector<grpc::string>& tag_values = p.first;
+ const int64_t num_calls = p.second;
+ const grpc::string& client_ip_and_token = tag_values[0];
+ const grpc::string& host = tag_values[1];
+ const grpc::string& user_id = tag_values[2];
+ const grpc::string& metric_name = tag_values[3];
+ LoadRecordKey key(client_ip_and_token, user_id);
+ const double total_metric_value =
+ CensusViewProvider::GetRelatedViewDataRowDouble(
+ view_data_map, kViewOtherCallMetricValue,
+ sizeof(kViewOtherCallMetricValue) - 1, tag_values);
+ LoadRecordValue value = LoadRecordValue(
+ metric_name, static_cast<uint64_t>(num_calls), total_metric_value);
+ {
+ std::unique_lock<std::mutex> lock(store_mu_);
+ load_data_store_.MergeRow(host, key, value);
+ }
+ }
+ }
+}
+
+void LoadReporter::FetchAndSample() {
+ gpr_log(GPR_DEBUG,
+ "[LR %p] Starts fetching Census view data and sampling LB feedback "
+ "record.",
+ this);
+ CensusViewProvider::ViewDataMap view_data_map =
+ census_view_provider_->FetchViewData();
+ ProcessViewDataCallStart(view_data_map);
+ ProcessViewDataCallEnd(view_data_map);
+ ProcessViewDataOtherCallMetrics(view_data_map);
+}
+
+} // namespace load_reporter
+} // namespace grpc
diff --git a/src/cpp/server/load_reporter/load_reporter.h b/src/cpp/server/load_reporter/load_reporter.h
new file mode 100644
index 0000000000..49a2e4b53c
--- /dev/null
+++ b/src/cpp/server/load_reporter/load_reporter.h
@@ -0,0 +1,225 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPC_SRC_CPP_SERVER_LOAD_REPORTER_LOAD_REPORTER_H
+#define GRPC_SRC_CPP_SERVER_LOAD_REPORTER_LOAD_REPORTER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <atomic>
+#include <chrono>
+#include <deque>
+#include <vector>
+
+#include <grpc/support/log.h>
+#include <grpcpp/impl/codegen/config.h>
+
+#include "src/cpp/server/load_reporter/load_data_store.h"
+#include "src/proto/grpc/lb/v1/load_reporter.grpc.pb.h"
+
+#include "opencensus/stats/stats.h"
+
+namespace grpc {
+namespace load_reporter {
+
+// The interface to get the Census stats. Abstracted for mocking.
+class CensusViewProvider {
+ public:
+ // Maps from the view name to the view data.
+ using ViewDataMap =
+ std::unordered_map<grpc::string, ::opencensus::stats::ViewData>;
+ // Maps from the view name to the view descriptor.
+ using ViewDescriptorMap =
+ std::unordered_map<grpc::string, ::opencensus::stats::ViewDescriptor>;
+
+ CensusViewProvider();
+ virtual ~CensusViewProvider() = default;
+
+ // Fetches the view data accumulated since last fetching, and returns it as a
+ // map from the view name to the view data.
+ virtual ViewDataMap FetchViewData() = 0;
+
+ // A helper function that gets a row with the input tag values from the view
+ // data. Only used when we know that row must exist because we have seen a row
+ // with the same tag values in a related view data. Several ViewData's are
+ // considered related if their views are based on the measures that are always
+ // recorded at the same time.
+ double static GetRelatedViewDataRowDouble(
+ const ViewDataMap& view_data_map, const char* view_name,
+ size_t view_name_len, const std::vector<grpc::string>& tag_values);
+
+ protected:
+ const ViewDescriptorMap& view_descriptor_map() const {
+ return view_descriptor_map_;
+ }
+
+ private:
+ ViewDescriptorMap view_descriptor_map_;
+ // Tag keys.
+ ::opencensus::stats::TagKey tag_key_token_;
+ ::opencensus::stats::TagKey tag_key_host_;
+ ::opencensus::stats::TagKey tag_key_user_id_;
+ ::opencensus::stats::TagKey tag_key_status_;
+ ::opencensus::stats::TagKey tag_key_metric_name_;
+};
+
+// The default implementation fetches the real stats from Census.
+class CensusViewProviderDefaultImpl : public CensusViewProvider {
+ public:
+ CensusViewProviderDefaultImpl();
+
+ ViewDataMap FetchViewData() override;
+
+ private:
+ std::unordered_map<grpc::string, ::opencensus::stats::View> view_map_;
+};
+
+// The interface to get the CPU stats. Abstracted for mocking.
+class CpuStatsProvider {
+ public:
+ // The used and total amounts of CPU usage.
+ using CpuStatsSample = std::pair<uint64_t, uint64_t>;
+
+ virtual ~CpuStatsProvider() = default;
+
+ // Gets the cumulative used CPU and total CPU resource.
+ virtual CpuStatsSample GetCpuStats() = 0;
+};
+
+// The default implementation reads CPU jiffies from the system to calculate CPU
+// utilization.
+class CpuStatsProviderDefaultImpl : public CpuStatsProvider {
+ public:
+ CpuStatsSample GetCpuStats() override;
+};
+
+// Maintains all the load data and load reporting streams.
+class LoadReporter {
+ public:
+ // TODO(juanlishen): Allow config for providers from users.
+ LoadReporter(uint32_t feedback_sample_window_seconds,
+ std::unique_ptr<CensusViewProvider> census_view_provider,
+ std::unique_ptr<CpuStatsProvider> cpu_stats_provider)
+ : feedback_sample_window_seconds_(feedback_sample_window_seconds),
+ census_view_provider_(std::move(census_view_provider)),
+ cpu_stats_provider_(std::move(cpu_stats_provider)) {
+ // Append the initial record so that the next real record can have a base.
+ AppendNewFeedbackRecord(0, 0);
+ }
+
+ // Fetches the latest data from Census and merge it into the data store.
+ // Also adds a new sample to the LB feedback sliding window.
+ // Thread-unsafe. (1). The access to the load data store and feedback records
+ // has locking. (2). The access to the Census view provider and CPU stats
+ // provider lacks locking, but we only access these two members in this method
+ // (in testing, we also access them when setting up expectation). So the
+ // invocations of this method must be serialized.
+ void FetchAndSample();
+
+ // Generates a report for that host and balancer. The report contains
+ // all the stats data accumulated between the last report (i.e., the last
+ // consumption) and the last fetch from Census (i.e., the last production).
+ // Thread-safe.
+ ::google::protobuf::RepeatedPtrField<::grpc::lb::v1::Load> GenerateLoads(
+ const grpc::string& hostname, const grpc::string& lb_id);
+
+ // The feedback is calculated from the stats data recorded in the sliding
+ // window. Outdated records are discarded.
+ // Thread-safe.
+ ::grpc::lb::v1::LoadBalancingFeedback GenerateLoadBalancingFeedback();
+
+ // Wrapper around LoadDataStore::ReportStreamCreated.
+ // Thread-safe.
+ void ReportStreamCreated(const grpc::string& hostname,
+ const grpc::string& lb_id,
+ const grpc::string& load_key);
+
+ // Wrapper around LoadDataStore::ReportStreamClosed.
+ // Thread-safe.
+ void ReportStreamClosed(const grpc::string& hostname,
+ const grpc::string& lb_id);
+
+ // Generates a unique LB ID of length kLbIdLength. Returns an empty string
+ // upon failure. Thread-safe.
+ grpc::string GenerateLbId();
+
+ // Accessors only for testing.
+ CensusViewProvider* census_view_provider() {
+ return census_view_provider_.get();
+ }
+ CpuStatsProvider* cpu_stats_provider() { return cpu_stats_provider_.get(); }
+
+ private:
+ struct LoadBalancingFeedbackRecord {
+ std::chrono::system_clock::time_point end_time;
+ uint64_t rpcs;
+ uint64_t errors;
+ uint64_t cpu_usage;
+ uint64_t cpu_limit;
+
+ LoadBalancingFeedbackRecord(
+ const std::chrono::system_clock::time_point& end_time, uint64_t rpcs,
+ uint64_t errors, uint64_t cpu_usage, uint64_t cpu_limit)
+ : end_time(end_time),
+ rpcs(rpcs),
+ errors(errors),
+ cpu_usage(cpu_usage),
+ cpu_limit(cpu_limit) {}
+ };
+
+ // Finds the view data about starting call from the view_data_map and merges
+ // the data to the load data store.
+ void ProcessViewDataCallStart(
+ const CensusViewProvider::ViewDataMap& view_data_map);
+ // Finds the view data about ending call from the view_data_map and merges the
+ // data to the load data store.
+ void ProcessViewDataCallEnd(
+ const CensusViewProvider::ViewDataMap& view_data_map);
+ // Finds the view data about the customized call metrics from the
+ // view_data_map and merges the data to the load data store.
+ void ProcessViewDataOtherCallMetrics(
+ const CensusViewProvider::ViewDataMap& view_data_map);
+
+ bool IsRecordInWindow(const LoadBalancingFeedbackRecord& record,
+ std::chrono::system_clock::time_point now) {
+ return record.end_time > now - feedback_sample_window_seconds_;
+ }
+
+ void AppendNewFeedbackRecord(uint64_t rpcs, uint64_t errors);
+
+ // Extracts an OrphanedLoadIdentifier from the per-balancer store and attaches
+ // it to the load.
+ void AttachOrphanLoadId(::grpc::lb::v1::Load* load,
+ const PerBalancerStore& per_balancer_store);
+
+ std::atomic<int64_t> next_lb_id_{0};
+ const std::chrono::seconds feedback_sample_window_seconds_;
+ std::mutex feedback_mu_;
+ std::deque<LoadBalancingFeedbackRecord> feedback_records_;
+ // TODO(juanlishen): Lock in finer grain. Locking the whole store may be
+ // too expensive.
+ std::mutex store_mu_;
+ LoadDataStore load_data_store_;
+ std::unique_ptr<CensusViewProvider> census_view_provider_;
+ std::unique_ptr<CpuStatsProvider> cpu_stats_provider_;
+};
+
+} // namespace load_reporter
+} // namespace grpc
+
+#endif // GRPC_SRC_CPP_SERVER_LOAD_REPORTER_LOAD_REPORTER_H
diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc
index e951801965..5d1919cd1d 100644
--- a/src/cpp/server/server_builder.cc
+++ b/src/cpp/server/server_builder.cc
@@ -24,6 +24,8 @@
#include <grpcpp/resource_quota.h>
#include <grpcpp/server.h>
+#include <utility>
+
#include "src/core/lib/gpr/useful.h"
#include "src/cpp/server/thread_pool_interface.h"
@@ -39,8 +41,8 @@ static void do_plugin_list_init(void) {
}
ServerBuilder::ServerBuilder()
- : max_receive_message_size_(-1),
- max_send_message_size_(-1),
+ : max_receive_message_size_(INT_MIN),
+ max_send_message_size_(INT_MIN),
sync_server_settings_(SyncServerSettings()),
resource_quota_(nullptr),
generic_service_(nullptr) {
@@ -166,7 +168,7 @@ ServerBuilder& ServerBuilder::AddListeningPort(
while (addr_uri[pos] == '/') ++pos; // Skip slashes.
addr = addr_uri.substr(pos);
}
- Port port = {addr, creds, selected_port};
+ Port port = {addr, std::move(creds), selected_port};
ports_.push_back(port);
return *this;
}
@@ -186,10 +188,12 @@ std::unique_ptr<Server> ServerBuilder::BuildAndStart() {
(*plugin)->UpdateChannelArguments(&args);
}
- if (max_receive_message_size_ >= 0) {
+ if (max_receive_message_size_ >= -1) {
args.SetInt(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH, max_receive_message_size_);
}
+ // The default message size is -1 (max), so no need to explicitly set it for
+ // -1.
if (max_send_message_size_ >= 0) {
args.SetInt(GRPC_ARG_MAX_SEND_MESSAGE_LENGTH, max_send_message_size_);
}
diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc
index 391ca44962..0d77510e29 100644
--- a/src/cpp/server/server_cc.cc
+++ b/src/cpp/server/server_cc.cc
@@ -219,7 +219,7 @@ class Server::SyncRequest final : public internal::CompletionQueueTag {
}
}
- void Run(std::shared_ptr<GlobalCallbacks> global_callbacks) {
+ void Run(const std::shared_ptr<GlobalCallbacks>& global_callbacks) {
ctx_.BeginCompletionOp(&call_);
global_callbacks->PreSynchronousRequest(&ctx_);
method_->handler()->RunHandler(internal::MethodHandler::HandlerParameter(
@@ -272,7 +272,7 @@ class Server::SyncRequestThreadManager : public ThreadManager {
server_(server),
server_cq_(server_cq),
cq_timeout_msec_(cq_timeout_msec),
- global_callbacks_(global_callbacks) {}
+ global_callbacks_(std::move(global_callbacks)) {}
WorkStatus PollForWork(void** tag, bool* ok) override {
*tag = nullptr;
@@ -378,7 +378,7 @@ Server::Server(
sync_server_cqs,
int min_pollers, int max_pollers, int sync_cq_timeout_msec)
: max_receive_message_size_(max_receive_message_size),
- sync_server_cqs_(sync_server_cqs),
+ sync_server_cqs_(std::move(sync_server_cqs)),
started_(false),
shutdown_(false),
shutdown_notified_(false),
diff --git a/src/csharp/Grpc.Core.NativeDebug.nuspec b/src/csharp/Grpc.Core.NativeDebug.nuspec
new file mode 100644
index 0000000000..d4bb8ad223
--- /dev/null
+++ b/src/csharp/Grpc.Core.NativeDebug.nuspec
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<package>
+ <metadata>
+ <id>Grpc.Core.NativeDebug</id>
+ <title>Grpc.Core: Native Debug Symbols</title>
+ <summary>Debug symbols for the native library contained in Grpc.Core</summary>
+ <description>Currently contains grpc_csharp_ext.pdb</description>
+ <version>$version$</version>
+ <authors>Google Inc.</authors>
+ <owners>grpc-packages</owners>
+ <licenseUrl>https://github.com/grpc/grpc/blob/master/LICENSE</licenseUrl>
+ <projectUrl>https://github.com/grpc/grpc</projectUrl>
+ <requireLicenseAcceptance>false</requireLicenseAcceptance>
+ <releaseNotes>Release $version$</releaseNotes>
+ <copyright>Copyright 2015, Google Inc.</copyright>
+ <tags>gRPC RPC Protocol HTTP/2</tags>
+ </metadata>
+ <files>
+ <!-- forward slashes in src path enable building on Linux -->
+ <file src="nativelibs/csharp_ext_windows_x86/grpc_csharp_ext.dll" target="runtimes/win/native/grpc_csharp_ext.x86.dll" />
+ <file src="nativelibs/csharp_ext_windows_x86/grpc_csharp_ext.pdb" target="runtimes/win/native/grpc_csharp_ext.x86.pdb" />
+ <file src="nativelibs/csharp_ext_windows_x64/grpc_csharp_ext.dll" target="runtimes/win/native/grpc_csharp_ext.x64.dll" />
+ <file src="nativelibs/csharp_ext_windows_x64/grpc_csharp_ext.pdb" target="runtimes/win/native/grpc_csharp_ext.x64.pdb" />
+ </files>
+</package>
diff --git a/src/csharp/Grpc.Core.Testing/TestCalls.cs b/src/csharp/Grpc.Core.Testing/TestCalls.cs
index ac29a8b974..8c76781bbe 100644
--- a/src/csharp/Grpc.Core.Testing/TestCalls.cs
+++ b/src/csharp/Grpc.Core.Testing/TestCalls.cs
@@ -65,7 +65,7 @@ namespace Grpc.Core.Testing
/// Creates a test double for <c>AsyncDuplexStreamingCall</c>. Only for testing.
/// Note: experimental API that can change or be removed without any prior notice.
/// </summary>
- public static AsyncDuplexStreamingCall<TRequest, TResponse> AsyncDuplexStreamingCall<TResponse, TRequest>(
+ public static AsyncDuplexStreamingCall<TRequest, TResponse> AsyncDuplexStreamingCall<TRequest, TResponse>(
IClientStreamWriter<TRequest> requestStream, IAsyncStreamReader<TResponse> responseStream,
Task<Metadata> responseHeadersAsync, Func<Status> getStatusFunc,
Func<Metadata> getTrailersFunc, Action disposeAction)
diff --git a/src/csharp/Grpc.Core/Interceptors/CallInvokerExtensions.cs b/src/csharp/Grpc.Core/Interceptors/CallInvokerExtensions.cs
index 421b5d379e..39c24d0157 100644
--- a/src/csharp/Grpc.Core/Interceptors/CallInvokerExtensions.cs
+++ b/src/csharp/Grpc.Core/Interceptors/CallInvokerExtensions.cs
@@ -24,7 +24,6 @@ namespace Grpc.Core.Interceptors
{
/// <summary>
/// Extends the CallInvoker class to provide the interceptor facility on the client side.
- /// This is an EXPERIMENTAL API.
/// </summary>
public static class CallInvokerExtensions
{
diff --git a/src/csharp/Grpc.Core/Interceptors/ChannelExtensions.cs b/src/csharp/Grpc.Core/Interceptors/ChannelExtensions.cs
index 00b2fa8bec..c7d0c2472a 100644
--- a/src/csharp/Grpc.Core/Interceptors/ChannelExtensions.cs
+++ b/src/csharp/Grpc.Core/Interceptors/ChannelExtensions.cs
@@ -22,7 +22,6 @@ namespace Grpc.Core.Interceptors
{
/// <summary>
/// Provides extension methods to make it easy to register interceptors on Channel objects.
- /// This is an EXPERIMENTAL API.
/// </summary>
public static class ChannelExtensions
{
diff --git a/src/csharp/Grpc.Core/Interceptors/ClientInterceptorContext.cs b/src/csharp/Grpc.Core/Interceptors/ClientInterceptorContext.cs
index de06a77077..4665fc553b 100644
--- a/src/csharp/Grpc.Core/Interceptors/ClientInterceptorContext.cs
+++ b/src/csharp/Grpc.Core/Interceptors/ClientInterceptorContext.cs
@@ -25,7 +25,6 @@ namespace Grpc.Core.Interceptors
{
/// <summary>
/// Carries along the context associated with intercepted invocations on the client side.
- /// This is an EXPERIMENTAL API.
/// </summary>
public struct ClientInterceptorContext<TRequest, TResponse>
where TRequest : class
diff --git a/src/csharp/Grpc.Core/Interceptors/Interceptor.cs b/src/csharp/Grpc.Core/Interceptors/Interceptor.cs
index 56a30c34af..ab708034f3 100644
--- a/src/csharp/Grpc.Core/Interceptors/Interceptor.cs
+++ b/src/csharp/Grpc.Core/Interceptors/Interceptor.cs
@@ -25,7 +25,6 @@ namespace Grpc.Core.Interceptors
{
/// <summary>
/// Serves as the base class for gRPC interceptors.
- /// This is an EXPERIMENTAL API.
/// </summary>
public abstract class Interceptor
{
diff --git a/src/csharp/Grpc.Core/Interceptors/ServerServiceDefinitionExtensions.cs b/src/csharp/Grpc.Core/Interceptors/ServerServiceDefinitionExtensions.cs
index b9b53247ce..8987544f7f 100644
--- a/src/csharp/Grpc.Core/Interceptors/ServerServiceDefinitionExtensions.cs
+++ b/src/csharp/Grpc.Core/Interceptors/ServerServiceDefinitionExtensions.cs
@@ -24,14 +24,12 @@ namespace Grpc.Core.Interceptors
{
/// <summary>
/// Extends the ServerServiceDefinition class to add methods used to register interceptors on the server side.
- /// This is an EXPERIMENTAL API.
/// </summary>
public static class ServerServiceDefinitionExtensions
{
/// <summary>
/// Returns a <see cref="Grpc.Core.ServerServiceDefinition" /> instance that
/// intercepts incoming calls to the underlying service handler through the given interceptor.
- /// This is an EXPERIMENTAL API.
/// </summary>
/// <param name="serverServiceDefinition">The <see cref="Grpc.Core.ServerServiceDefinition" /> instance to register interceptors on.</param>
/// <param name="interceptor">The interceptor to intercept the incoming invocations with.</param>
@@ -52,7 +50,6 @@ namespace Grpc.Core.Interceptors
/// <summary>
/// Returns a <see cref="Grpc.Core.ServerServiceDefinition" /> instance that
/// intercepts incoming calls to the underlying service handler through the given interceptors.
- /// This is an EXPERIMENTAL API.
/// </summary>
/// <param name="serverServiceDefinition">The <see cref="Grpc.Core.ServerServiceDefinition" /> instance to register interceptors on.</param>
/// <param name="interceptors">
diff --git a/src/csharp/Grpc.Core/Server.cs b/src/csharp/Grpc.Core/Server.cs
index 60dacbf126..64bb407c57 100644
--- a/src/csharp/Grpc.Core/Server.cs
+++ b/src/csharp/Grpc.Core/Server.cs
@@ -29,7 +29,7 @@ using Grpc.Core.Utils;
namespace Grpc.Core
{
/// <summary>
- /// gRPC server. A single server can server arbitrary number of services and can listen on more than one ports.
+ /// gRPC server. A single server can serve an arbitrary number of services and can listen on more than one port.
/// </summary>
public class Server
{
diff --git a/src/csharp/Grpc.Core/Version.csproj.include b/src/csharp/Grpc.Core/Version.csproj.include
index f5d63b77f0..2b45e7ae20 100755
--- a/src/csharp/Grpc.Core/Version.csproj.include
+++ b/src/csharp/Grpc.Core/Version.csproj.include
@@ -1,7 +1,7 @@
<!-- This file is generated -->
<Project>
<PropertyGroup>
- <GrpcCsharpVersion>1.13.0-dev</GrpcCsharpVersion>
+ <GrpcCsharpVersion>1.14.0-dev</GrpcCsharpVersion>
<GoogleProtobufVersion>3.5.1</GoogleProtobufVersion>
</PropertyGroup>
</Project>
diff --git a/src/csharp/Grpc.Core/VersionInfo.cs b/src/csharp/Grpc.Core/VersionInfo.cs
index 87edddae3f..c4531e5275 100644
--- a/src/csharp/Grpc.Core/VersionInfo.cs
+++ b/src/csharp/Grpc.Core/VersionInfo.cs
@@ -33,11 +33,11 @@ namespace Grpc.Core
/// <summary>
/// Current <c>AssemblyFileVersion</c> of gRPC C# assemblies
/// </summary>
- public const string CurrentAssemblyFileVersion = "1.13.0.0";
+ public const string CurrentAssemblyFileVersion = "1.14.0.0";
/// <summary>
/// Current version of gRPC C#
/// </summary>
- public const string CurrentVersion = "1.13.0-dev";
+ public const string CurrentVersion = "1.14.0-dev";
}
}
diff --git a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj
index 3ccc9adfaf..d2cc5bbc65 100755
--- a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj
+++ b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj
@@ -13,11 +13,13 @@
<ItemGroup>
<ProjectReference Include="../Grpc.Examples/Grpc.Examples.csproj" />
+ <ProjectReference Include="../Grpc.Core.Testing/Grpc.Core.Testing.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="NUnit" Version="3.6.0" />
<PackageReference Include="NUnitLite" Version="3.6.0" />
+ <PackageReference Include="Moq" Version="4.8.2" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
diff --git a/src/csharp/Grpc.Examples.Tests/MathClientMockableTest.cs b/src/csharp/Grpc.Examples.Tests/MathClientMockableTest.cs
new file mode 100644
index 0000000000..6ed7b0a937
--- /dev/null
+++ b/src/csharp/Grpc.Examples.Tests/MathClientMockableTest.cs
@@ -0,0 +1,101 @@
+#region Copyright notice and license
+
+// Copyright 2018 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#endregion
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Grpc.Core;
+using Grpc.Core.Testing;
+using NUnit.Framework;
+
+namespace Math.Tests
+{
+ /// <summary>
+ /// Demonstrates how to mock method stubs for all method types in a generated client.
+ /// </summary>
+ public class MathClientMockableTest
+ {
+ [Test]
+ public void ClientBaseBlockingUnaryCallCanBeMocked()
+ {
+ var mockClient = new Moq.Mock<Math.MathClient>();
+
+ var expected = new DivReply();
+ mockClient.Setup(m => m.Div(Moq.It.IsAny<DivArgs>(), null, null, CancellationToken.None)).Returns(expected);
+ Assert.AreSame(expected, mockClient.Object.Div(new DivArgs()));
+ }
+
+ [Test]
+ public void ClientBaseBlockingUnaryCallWithCallOptionsCallCanBeMocked()
+ {
+ var mockClient = new Moq.Mock<Math.MathClient>();
+
+ var expected = new DivReply();
+ mockClient.Setup(m => m.Div(Moq.It.IsAny<DivArgs>(), Moq.It.IsAny<CallOptions>())).Returns(expected);
+ Assert.AreSame(expected, mockClient.Object.Div(new DivArgs(), new CallOptions()));
+ }
+
+ [Test]
+ public void ClientBaseAsyncUnaryCallCanBeMocked()
+ {
+ var mockClient = new Moq.Mock<Math.MathClient>();
+
+ // Use a factory method provided by Grpc.Core.Testing.TestCalls to create an instance of a call.
+ var fakeCall = TestCalls.AsyncUnaryCall<DivReply>(Task.FromResult(new DivReply()), Task.FromResult(new Metadata()), () => Status.DefaultSuccess, () => new Metadata(), () => { });
+ mockClient.Setup(m => m.DivAsync(Moq.It.IsAny<DivArgs>(), null, null, CancellationToken.None)).Returns(fakeCall);
+ Assert.AreSame(fakeCall, mockClient.Object.DivAsync(new DivArgs()));
+ }
+
+ [Test]
+ public void ClientBaseClientStreamingCallCanBeMocked()
+ {
+ var mockClient = new Moq.Mock<Math.MathClient>();
+ var mockRequestStream = new Moq.Mock<IClientStreamWriter<Num>>();
+
+ // Use a factory method provided by Grpc.Core.Testing.TestCalls to create an instance of a call.
+ var fakeCall = TestCalls.AsyncClientStreamingCall<Num, Num>(mockRequestStream.Object, Task.FromResult(new Num()), Task.FromResult(new Metadata()), () => Status.DefaultSuccess, () => new Metadata(), () => { });
+ mockClient.Setup(m => m.Sum(null, null, CancellationToken.None)).Returns(fakeCall);
+ Assert.AreSame(fakeCall, mockClient.Object.Sum());
+ }
+
+ [Test]
+ public void ClientBaseServerStreamingCallCanBeMocked()
+ {
+ var mockClient = new Moq.Mock<Math.MathClient>();
+ var mockResponseStream = new Moq.Mock<IAsyncStreamReader<Num>>();
+
+ // Use a factory method provided by Grpc.Core.Testing.TestCalls to create an instance of a call.
+ var fakeCall = TestCalls.AsyncServerStreamingCall<Num>(mockResponseStream.Object, Task.FromResult(new Metadata()), () => Status.DefaultSuccess, () => new Metadata(), () => { });
+ mockClient.Setup(m => m.Fib(Moq.It.IsAny<FibArgs>(), null, null, CancellationToken.None)).Returns(fakeCall);
+ Assert.AreSame(fakeCall, mockClient.Object.Fib(new FibArgs()));
+ }
+
+ [Test]
+ public void ClientBaseDuplexStreamingCallCanBeMocked()
+ {
+ var mockClient = new Moq.Mock<Math.MathClient>();
+ var mockRequestStream = new Moq.Mock<IClientStreamWriter<DivArgs>>();
+ var mockResponseStream = new Moq.Mock<IAsyncStreamReader<DivReply>>();
+
+ // Use a factory method provided by Grpc.Core.Testing.TestCalls to create an instance of a call.
+ var fakeCall = TestCalls.AsyncDuplexStreamingCall<DivArgs, DivReply>(mockRequestStream.Object, mockResponseStream.Object, Task.FromResult(new Metadata()), () => Status.DefaultSuccess, () => new Metadata(), () => { });
+ mockClient.Setup(m => m.DivMany(null, null, CancellationToken.None)).Returns(fakeCall);
+ Assert.AreSame(fakeCall, mockClient.Object.DivMany());
+ }
+ }
+}
diff --git a/src/csharp/Grpc.Examples.Tests/MathServiceImplTestabilityTest.cs b/src/csharp/Grpc.Examples.Tests/MathServiceImplTestabilityTest.cs
new file mode 100644
index 0000000000..7c5fb94408
--- /dev/null
+++ b/src/csharp/Grpc.Examples.Tests/MathServiceImplTestabilityTest.cs
@@ -0,0 +1,47 @@
+#region Copyright notice and license
+
+// Copyright 2018 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#endregion
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Grpc.Core;
+using Grpc.Core.Testing;
+using Grpc.Core.Utils;
+using NUnit.Framework;
+
+namespace Math.Tests
+{
+ /// <summary>
+ /// Demonstrates how to unit test implementations of generated server stubs.
+ /// </summary>
+ public class MathServiceImplTestabilityTest
+ {
+ [Test]
+ public async Task ServerCallImplIsTestable()
+ {
+ var mathImpl = new MathServiceImpl();
+
+ // Use a factory method provided by Grpc.Core.Testing.TestServerCallContext to create an instance of server call context.
+ // This allows testing even those server-side implementations that rely on the contents of ServerCallContext.
+ var fakeServerCallContext = TestServerCallContext.Create("fooMethod", null, DateTime.UtcNow.AddHours(1), new Metadata(), CancellationToken.None, "127.0.0.1", null, null, (metadata) => TaskUtils.CompletedTask, () => new WriteOptions(), (writeOptions) => { });
+ var response = await mathImpl.Div(new DivArgs { Dividend = 10, Divisor = 2 }, fakeServerCallContext);
+ Assert.AreEqual(5, response.Quotient);
+ Assert.AreEqual(0, response.Remainder);
+ }
+ }
+}
diff --git a/src/csharp/Grpc.Examples/MathGrpc.cs b/src/csharp/Grpc.Examples/MathGrpc.cs
index a4739da81d..9578bb4d81 100644
--- a/src/csharp/Grpc.Examples/MathGrpc.cs
+++ b/src/csharp/Grpc.Examples/MathGrpc.cs
@@ -27,38 +27,38 @@ namespace Math {
{
static readonly string __ServiceName = "math.Math";
- static readonly grpc::Marshaller<global::Math.DivArgs> __Marshaller_DivArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.DivArgs.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Math.DivReply> __Marshaller_DivReply = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.DivReply.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Math.FibArgs> __Marshaller_FibArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.FibArgs.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Math.Num> __Marshaller_Num = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.Num.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Math.DivArgs> __Marshaller_math_DivArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.DivArgs.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Math.DivReply> __Marshaller_math_DivReply = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.DivReply.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Math.FibArgs> __Marshaller_math_FibArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.FibArgs.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Math.Num> __Marshaller_math_Num = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.Num.Parser.ParseFrom);
static readonly grpc::Method<global::Math.DivArgs, global::Math.DivReply> __Method_Div = new grpc::Method<global::Math.DivArgs, global::Math.DivReply>(
grpc::MethodType.Unary,
__ServiceName,
"Div",
- __Marshaller_DivArgs,
- __Marshaller_DivReply);
+ __Marshaller_math_DivArgs,
+ __Marshaller_math_DivReply);
static readonly grpc::Method<global::Math.DivArgs, global::Math.DivReply> __Method_DivMany = new grpc::Method<global::Math.DivArgs, global::Math.DivReply>(
grpc::MethodType.DuplexStreaming,
__ServiceName,
"DivMany",
- __Marshaller_DivArgs,
- __Marshaller_DivReply);
+ __Marshaller_math_DivArgs,
+ __Marshaller_math_DivReply);
static readonly grpc::Method<global::Math.FibArgs, global::Math.Num> __Method_Fib = new grpc::Method<global::Math.FibArgs, global::Math.Num>(
grpc::MethodType.ServerStreaming,
__ServiceName,
"Fib",
- __Marshaller_FibArgs,
- __Marshaller_Num);
+ __Marshaller_math_FibArgs,
+ __Marshaller_math_Num);
static readonly grpc::Method<global::Math.Num, global::Math.Num> __Method_Sum = new grpc::Method<global::Math.Num, global::Math.Num>(
grpc::MethodType.ClientStreaming,
__ServiceName,
"Sum",
- __Marshaller_Num,
- __Marshaller_Num);
+ __Marshaller_math_Num,
+ __Marshaller_math_Num);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
diff --git a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs
index ebd890e48d..5e79c04d2a 100644
--- a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs
+++ b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs
@@ -30,15 +30,15 @@ namespace Grpc.Health.V1 {
{
static readonly string __ServiceName = "grpc.health.v1.Health";
- static readonly grpc::Marshaller<global::Grpc.Health.V1.HealthCheckRequest> __Marshaller_HealthCheckRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1.HealthCheckRequest.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Health.V1.HealthCheckResponse> __Marshaller_HealthCheckResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1.HealthCheckResponse.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Health.V1.HealthCheckRequest> __Marshaller_grpc_health_v1_HealthCheckRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1.HealthCheckRequest.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Health.V1.HealthCheckResponse> __Marshaller_grpc_health_v1_HealthCheckResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1.HealthCheckResponse.Parser.ParseFrom);
static readonly grpc::Method<global::Grpc.Health.V1.HealthCheckRequest, global::Grpc.Health.V1.HealthCheckResponse> __Method_Check = new grpc::Method<global::Grpc.Health.V1.HealthCheckRequest, global::Grpc.Health.V1.HealthCheckResponse>(
grpc::MethodType.Unary,
__ServiceName,
"Check",
- __Marshaller_HealthCheckRequest,
- __Marshaller_HealthCheckResponse);
+ __Marshaller_grpc_health_v1_HealthCheckRequest,
+ __Marshaller_grpc_health_v1_HealthCheckResponse);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
diff --git a/src/csharp/Grpc.IntegrationTesting/BenchmarkServiceGrpc.cs b/src/csharp/Grpc.IntegrationTesting/BenchmarkServiceGrpc.cs
index e2a4b93cef..b5738593f2 100644
--- a/src/csharp/Grpc.IntegrationTesting/BenchmarkServiceGrpc.cs
+++ b/src/csharp/Grpc.IntegrationTesting/BenchmarkServiceGrpc.cs
@@ -29,43 +29,43 @@ namespace Grpc.Testing {
{
static readonly string __ServiceName = "grpc.testing.BenchmarkService";
- static readonly grpc::Marshaller<global::Grpc.Testing.SimpleRequest> __Marshaller_SimpleRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.SimpleResponse> __Marshaller_SimpleResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.SimpleRequest> __Marshaller_grpc_testing_SimpleRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.SimpleResponse> __Marshaller_grpc_testing_SimpleResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom);
static readonly grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_UnaryCall = new grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
grpc::MethodType.Unary,
__ServiceName,
"UnaryCall",
- __Marshaller_SimpleRequest,
- __Marshaller_SimpleResponse);
+ __Marshaller_grpc_testing_SimpleRequest,
+ __Marshaller_grpc_testing_SimpleResponse);
static readonly grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_StreamingCall = new grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
grpc::MethodType.DuplexStreaming,
__ServiceName,
"StreamingCall",
- __Marshaller_SimpleRequest,
- __Marshaller_SimpleResponse);
+ __Marshaller_grpc_testing_SimpleRequest,
+ __Marshaller_grpc_testing_SimpleResponse);
static readonly grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_StreamingFromClient = new grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
grpc::MethodType.ClientStreaming,
__ServiceName,
"StreamingFromClient",
- __Marshaller_SimpleRequest,
- __Marshaller_SimpleResponse);
+ __Marshaller_grpc_testing_SimpleRequest,
+ __Marshaller_grpc_testing_SimpleResponse);
static readonly grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_StreamingFromServer = new grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
grpc::MethodType.ServerStreaming,
__ServiceName,
"StreamingFromServer",
- __Marshaller_SimpleRequest,
- __Marshaller_SimpleResponse);
+ __Marshaller_grpc_testing_SimpleRequest,
+ __Marshaller_grpc_testing_SimpleResponse);
static readonly grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_StreamingBothWays = new grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
grpc::MethodType.DuplexStreaming,
__ServiceName,
"StreamingBothWays",
- __Marshaller_SimpleRequest,
- __Marshaller_SimpleResponse);
+ __Marshaller_grpc_testing_SimpleRequest,
+ __Marshaller_grpc_testing_SimpleResponse);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
diff --git a/src/csharp/Grpc.IntegrationTesting/GeneratedClientTest.cs b/src/csharp/Grpc.IntegrationTesting/GeneratedClientTest.cs
index 2462606879..c8bcb7a93f 100644
--- a/src/csharp/Grpc.IntegrationTesting/GeneratedClientTest.cs
+++ b/src/csharp/Grpc.IntegrationTesting/GeneratedClientTest.cs
@@ -34,29 +34,6 @@ namespace Grpc.IntegrationTesting
TestService.TestServiceClient unimplementedClient = new UnimplementedTestServiceClient();
[Test]
- public void ExpandedParamOverloadCanBeMocked()
- {
- var expected = new SimpleResponse();
-
- var mockClient = new Moq.Mock<TestService.TestServiceClient>();
- // mocking is relatively clumsy because one needs to specify value for all the optional params.
- mockClient.Setup(m => m.UnaryCall(Moq.It.IsAny<SimpleRequest>(), null, null, CancellationToken.None)).Returns(expected);
-
- Assert.AreSame(expected, mockClient.Object.UnaryCall(new SimpleRequest()));
- }
-
- [Test]
- public void CallOptionsOverloadCanBeMocked()
- {
- var expected = new SimpleResponse();
-
- var mockClient = new Moq.Mock<TestService.TestServiceClient>();
- mockClient.Setup(m => m.UnaryCall(Moq.It.IsAny<SimpleRequest>(), Moq.It.IsAny<CallOptions>())).Returns(expected);
-
- Assert.AreSame(expected, mockClient.Object.UnaryCall(new SimpleRequest(), new CallOptions()));
- }
-
- [Test]
public void DefaultMethodStubThrows_UnaryCall()
{
Assert.Throws(typeof(NotImplementedException), () => unimplementedClient.UnaryCall(new SimpleRequest()));
diff --git a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj
index ba2107a576..e4f36d8810 100755
--- a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj
+++ b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj
@@ -19,7 +19,6 @@
<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="$(GoogleProtobufVersion)" />
<PackageReference Include="CommandLineParser" Version="2.1.1-beta" />
- <PackageReference Include="Moq" Version="4.8.2" />
<PackageReference Include="NUnit" Version="3.6.0" />
<PackageReference Include="NUnitLite" Version="3.6.0" />
</ItemGroup>
diff --git a/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs b/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs
index e8c566e167..9f16f41ac1 100644
--- a/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs
+++ b/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs
@@ -33,23 +33,23 @@ namespace Grpc.Testing {
{
static readonly string __ServiceName = "grpc.testing.MetricsService";
- static readonly grpc::Marshaller<global::Grpc.Testing.EmptyMessage> __Marshaller_EmptyMessage = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.EmptyMessage.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.GaugeResponse> __Marshaller_GaugeResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.GaugeResponse.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.GaugeRequest> __Marshaller_GaugeRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.GaugeRequest.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.EmptyMessage> __Marshaller_grpc_testing_EmptyMessage = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.EmptyMessage.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.GaugeResponse> __Marshaller_grpc_testing_GaugeResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.GaugeResponse.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.GaugeRequest> __Marshaller_grpc_testing_GaugeRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.GaugeRequest.Parser.ParseFrom);
static readonly grpc::Method<global::Grpc.Testing.EmptyMessage, global::Grpc.Testing.GaugeResponse> __Method_GetAllGauges = new grpc::Method<global::Grpc.Testing.EmptyMessage, global::Grpc.Testing.GaugeResponse>(
grpc::MethodType.ServerStreaming,
__ServiceName,
"GetAllGauges",
- __Marshaller_EmptyMessage,
- __Marshaller_GaugeResponse);
+ __Marshaller_grpc_testing_EmptyMessage,
+ __Marshaller_grpc_testing_GaugeResponse);
static readonly grpc::Method<global::Grpc.Testing.GaugeRequest, global::Grpc.Testing.GaugeResponse> __Method_GetGauge = new grpc::Method<global::Grpc.Testing.GaugeRequest, global::Grpc.Testing.GaugeResponse>(
grpc::MethodType.Unary,
__ServiceName,
"GetGauge",
- __Marshaller_GaugeRequest,
- __Marshaller_GaugeResponse);
+ __Marshaller_grpc_testing_GaugeRequest,
+ __Marshaller_grpc_testing_GaugeResponse);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
diff --git a/src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioServiceGrpc.cs b/src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioServiceGrpc.cs
index 60a3890f21..1da0548cb4 100644
--- a/src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioServiceGrpc.cs
+++ b/src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioServiceGrpc.cs
@@ -29,15 +29,15 @@ namespace Grpc.Testing {
{
static readonly string __ServiceName = "grpc.testing.ReportQpsScenarioService";
- static readonly grpc::Marshaller<global::Grpc.Testing.ScenarioResult> __Marshaller_ScenarioResult = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ScenarioResult.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.Void> __Marshaller_Void = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Void.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.ScenarioResult> __Marshaller_grpc_testing_ScenarioResult = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ScenarioResult.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.Void> __Marshaller_grpc_testing_Void = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Void.Parser.ParseFrom);
static readonly grpc::Method<global::Grpc.Testing.ScenarioResult, global::Grpc.Testing.Void> __Method_ReportScenario = new grpc::Method<global::Grpc.Testing.ScenarioResult, global::Grpc.Testing.Void>(
grpc::MethodType.Unary,
__ServiceName,
"ReportScenario",
- __Marshaller_ScenarioResult,
- __Marshaller_Void);
+ __Marshaller_grpc_testing_ScenarioResult,
+ __Marshaller_grpc_testing_Void);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
diff --git a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs
index aec4ce7be7..2176916b43 100644
--- a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs
+++ b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs
@@ -34,69 +34,69 @@ namespace Grpc.Testing {
{
static readonly string __ServiceName = "grpc.testing.TestService";
- static readonly grpc::Marshaller<global::Grpc.Testing.Empty> __Marshaller_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.SimpleRequest> __Marshaller_SimpleRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.SimpleResponse> __Marshaller_SimpleResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.StreamingOutputCallRequest> __Marshaller_StreamingOutputCallRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingOutputCallRequest.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.StreamingOutputCallResponse> __Marshaller_StreamingOutputCallResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingOutputCallResponse.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.StreamingInputCallRequest> __Marshaller_StreamingInputCallRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingInputCallRequest.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.StreamingInputCallResponse> __Marshaller_StreamingInputCallResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingInputCallResponse.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.Empty> __Marshaller_grpc_testing_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.SimpleRequest> __Marshaller_grpc_testing_SimpleRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.SimpleResponse> __Marshaller_grpc_testing_SimpleResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.StreamingOutputCallRequest> __Marshaller_grpc_testing_StreamingOutputCallRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingOutputCallRequest.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.StreamingOutputCallResponse> __Marshaller_grpc_testing_StreamingOutputCallResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingOutputCallResponse.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.StreamingInputCallRequest> __Marshaller_grpc_testing_StreamingInputCallRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingInputCallRequest.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.StreamingInputCallResponse> __Marshaller_grpc_testing_StreamingInputCallResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingInputCallResponse.Parser.ParseFrom);
static readonly grpc::Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty> __Method_EmptyCall = new grpc::Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty>(
grpc::MethodType.Unary,
__ServiceName,
"EmptyCall",
- __Marshaller_Empty,
- __Marshaller_Empty);
+ __Marshaller_grpc_testing_Empty,
+ __Marshaller_grpc_testing_Empty);
static readonly grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_UnaryCall = new grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
grpc::MethodType.Unary,
__ServiceName,
"UnaryCall",
- __Marshaller_SimpleRequest,
- __Marshaller_SimpleResponse);
+ __Marshaller_grpc_testing_SimpleRequest,
+ __Marshaller_grpc_testing_SimpleResponse);
static readonly grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_CacheableUnaryCall = new grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
grpc::MethodType.Unary,
__ServiceName,
"CacheableUnaryCall",
- __Marshaller_SimpleRequest,
- __Marshaller_SimpleResponse);
+ __Marshaller_grpc_testing_SimpleRequest,
+ __Marshaller_grpc_testing_SimpleResponse);
static readonly grpc::Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> __Method_StreamingOutputCall = new grpc::Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse>(
grpc::MethodType.ServerStreaming,
__ServiceName,
"StreamingOutputCall",
- __Marshaller_StreamingOutputCallRequest,
- __Marshaller_StreamingOutputCallResponse);
+ __Marshaller_grpc_testing_StreamingOutputCallRequest,
+ __Marshaller_grpc_testing_StreamingOutputCallResponse);
static readonly grpc::Method<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse> __Method_StreamingInputCall = new grpc::Method<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse>(
grpc::MethodType.ClientStreaming,
__ServiceName,
"StreamingInputCall",
- __Marshaller_StreamingInputCallRequest,
- __Marshaller_StreamingInputCallResponse);
+ __Marshaller_grpc_testing_StreamingInputCallRequest,
+ __Marshaller_grpc_testing_StreamingInputCallResponse);
static readonly grpc::Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> __Method_FullDuplexCall = new grpc::Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse>(
grpc::MethodType.DuplexStreaming,
__ServiceName,
"FullDuplexCall",
- __Marshaller_StreamingOutputCallRequest,
- __Marshaller_StreamingOutputCallResponse);
+ __Marshaller_grpc_testing_StreamingOutputCallRequest,
+ __Marshaller_grpc_testing_StreamingOutputCallResponse);
static readonly grpc::Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> __Method_HalfDuplexCall = new grpc::Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse>(
grpc::MethodType.DuplexStreaming,
__ServiceName,
"HalfDuplexCall",
- __Marshaller_StreamingOutputCallRequest,
- __Marshaller_StreamingOutputCallResponse);
+ __Marshaller_grpc_testing_StreamingOutputCallRequest,
+ __Marshaller_grpc_testing_StreamingOutputCallResponse);
static readonly grpc::Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty> __Method_UnimplementedCall = new grpc::Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty>(
grpc::MethodType.Unary,
__ServiceName,
"UnimplementedCall",
- __Marshaller_Empty,
- __Marshaller_Empty);
+ __Marshaller_grpc_testing_Empty,
+ __Marshaller_grpc_testing_Empty);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
@@ -548,14 +548,14 @@ namespace Grpc.Testing {
{
static readonly string __ServiceName = "grpc.testing.UnimplementedService";
- static readonly grpc::Marshaller<global::Grpc.Testing.Empty> __Marshaller_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.Empty> __Marshaller_grpc_testing_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom);
static readonly grpc::Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty> __Method_UnimplementedCall = new grpc::Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty>(
grpc::MethodType.Unary,
__ServiceName,
"UnimplementedCall",
- __Marshaller_Empty,
- __Marshaller_Empty);
+ __Marshaller_grpc_testing_Empty,
+ __Marshaller_grpc_testing_Empty);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
@@ -669,23 +669,23 @@ namespace Grpc.Testing {
{
static readonly string __ServiceName = "grpc.testing.ReconnectService";
- static readonly grpc::Marshaller<global::Grpc.Testing.ReconnectParams> __Marshaller_ReconnectParams = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ReconnectParams.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.Empty> __Marshaller_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.ReconnectInfo> __Marshaller_ReconnectInfo = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ReconnectInfo.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.ReconnectParams> __Marshaller_grpc_testing_ReconnectParams = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ReconnectParams.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.Empty> __Marshaller_grpc_testing_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.ReconnectInfo> __Marshaller_grpc_testing_ReconnectInfo = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ReconnectInfo.Parser.ParseFrom);
static readonly grpc::Method<global::Grpc.Testing.ReconnectParams, global::Grpc.Testing.Empty> __Method_Start = new grpc::Method<global::Grpc.Testing.ReconnectParams, global::Grpc.Testing.Empty>(
grpc::MethodType.Unary,
__ServiceName,
"Start",
- __Marshaller_ReconnectParams,
- __Marshaller_Empty);
+ __Marshaller_grpc_testing_ReconnectParams,
+ __Marshaller_grpc_testing_Empty);
static readonly grpc::Method<global::Grpc.Testing.Empty, global::Grpc.Testing.ReconnectInfo> __Method_Stop = new grpc::Method<global::Grpc.Testing.Empty, global::Grpc.Testing.ReconnectInfo>(
grpc::MethodType.Unary,
__ServiceName,
"Stop",
- __Marshaller_Empty,
- __Marshaller_ReconnectInfo);
+ __Marshaller_grpc_testing_Empty,
+ __Marshaller_grpc_testing_ReconnectInfo);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
diff --git a/src/csharp/Grpc.IntegrationTesting/WorkerServiceGrpc.cs b/src/csharp/Grpc.IntegrationTesting/WorkerServiceGrpc.cs
index 85f2cfd871..b9e8f91231 100644
--- a/src/csharp/Grpc.IntegrationTesting/WorkerServiceGrpc.cs
+++ b/src/csharp/Grpc.IntegrationTesting/WorkerServiceGrpc.cs
@@ -29,41 +29,41 @@ namespace Grpc.Testing {
{
static readonly string __ServiceName = "grpc.testing.WorkerService";
- static readonly grpc::Marshaller<global::Grpc.Testing.ServerArgs> __Marshaller_ServerArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerArgs.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.ServerStatus> __Marshaller_ServerStatus = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerStatus.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.ClientArgs> __Marshaller_ClientArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientArgs.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.ClientStatus> __Marshaller_ClientStatus = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientStatus.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.CoreRequest> __Marshaller_CoreRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreRequest.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.CoreResponse> __Marshaller_CoreResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreResponse.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Testing.Void> __Marshaller_Void = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Void.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.ServerArgs> __Marshaller_grpc_testing_ServerArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerArgs.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.ServerStatus> __Marshaller_grpc_testing_ServerStatus = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerStatus.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.ClientArgs> __Marshaller_grpc_testing_ClientArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientArgs.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.ClientStatus> __Marshaller_grpc_testing_ClientStatus = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientStatus.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.CoreRequest> __Marshaller_grpc_testing_CoreRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreRequest.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.CoreResponse> __Marshaller_grpc_testing_CoreResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreResponse.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Testing.Void> __Marshaller_grpc_testing_Void = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Void.Parser.ParseFrom);
static readonly grpc::Method<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> __Method_RunServer = new grpc::Method<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus>(
grpc::MethodType.DuplexStreaming,
__ServiceName,
"RunServer",
- __Marshaller_ServerArgs,
- __Marshaller_ServerStatus);
+ __Marshaller_grpc_testing_ServerArgs,
+ __Marshaller_grpc_testing_ServerStatus);
static readonly grpc::Method<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> __Method_RunClient = new grpc::Method<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus>(
grpc::MethodType.DuplexStreaming,
__ServiceName,
"RunClient",
- __Marshaller_ClientArgs,
- __Marshaller_ClientStatus);
+ __Marshaller_grpc_testing_ClientArgs,
+ __Marshaller_grpc_testing_ClientStatus);
static readonly grpc::Method<global::Grpc.Testing.CoreRequest, global::Grpc.Testing.CoreResponse> __Method_CoreCount = new grpc::Method<global::Grpc.Testing.CoreRequest, global::Grpc.Testing.CoreResponse>(
grpc::MethodType.Unary,
__ServiceName,
"CoreCount",
- __Marshaller_CoreRequest,
- __Marshaller_CoreResponse);
+ __Marshaller_grpc_testing_CoreRequest,
+ __Marshaller_grpc_testing_CoreResponse);
static readonly grpc::Method<global::Grpc.Testing.Void, global::Grpc.Testing.Void> __Method_QuitWorker = new grpc::Method<global::Grpc.Testing.Void, global::Grpc.Testing.Void>(
grpc::MethodType.Unary,
__ServiceName,
"QuitWorker",
- __Marshaller_Void,
- __Marshaller_Void);
+ __Marshaller_grpc_testing_Void,
+ __Marshaller_grpc_testing_Void);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
diff --git a/src/csharp/Grpc.Reflection/ReflectionGrpc.cs b/src/csharp/Grpc.Reflection/ReflectionGrpc.cs
index 387c9fb52f..c00075b7c6 100644
--- a/src/csharp/Grpc.Reflection/ReflectionGrpc.cs
+++ b/src/csharp/Grpc.Reflection/ReflectionGrpc.cs
@@ -29,15 +29,15 @@ namespace Grpc.Reflection.V1Alpha {
{
static readonly string __ServiceName = "grpc.reflection.v1alpha.ServerReflection";
- static readonly grpc::Marshaller<global::Grpc.Reflection.V1Alpha.ServerReflectionRequest> __Marshaller_ServerReflectionRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Reflection.V1Alpha.ServerReflectionRequest.Parser.ParseFrom);
- static readonly grpc::Marshaller<global::Grpc.Reflection.V1Alpha.ServerReflectionResponse> __Marshaller_ServerReflectionResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Reflection.V1Alpha.ServerReflectionResponse.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Reflection.V1Alpha.ServerReflectionRequest> __Marshaller_grpc_reflection_v1alpha_ServerReflectionRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Reflection.V1Alpha.ServerReflectionRequest.Parser.ParseFrom);
+ static readonly grpc::Marshaller<global::Grpc.Reflection.V1Alpha.ServerReflectionResponse> __Marshaller_grpc_reflection_v1alpha_ServerReflectionResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Reflection.V1Alpha.ServerReflectionResponse.Parser.ParseFrom);
static readonly grpc::Method<global::Grpc.Reflection.V1Alpha.ServerReflectionRequest, global::Grpc.Reflection.V1Alpha.ServerReflectionResponse> __Method_ServerReflectionInfo = new grpc::Method<global::Grpc.Reflection.V1Alpha.ServerReflectionRequest, global::Grpc.Reflection.V1Alpha.ServerReflectionResponse>(
grpc::MethodType.DuplexStreaming,
__ServiceName,
"ServerReflectionInfo",
- __Marshaller_ServerReflectionRequest,
- __Marshaller_ServerReflectionResponse);
+ __Marshaller_grpc_reflection_v1alpha_ServerReflectionRequest,
+ __Marshaller_grpc_reflection_v1alpha_ServerReflectionResponse);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
diff --git a/src/csharp/README.md b/src/csharp/README.md
index e117e66afd..92be4bf1e5 100644
--- a/src/csharp/README.md
+++ b/src/csharp/README.md
@@ -42,7 +42,7 @@ If you are a user of gRPC C#, go to Usage section above.
- [dotnet SDK](https://www.microsoft.com/net/core)
- [Mono 4+](https://www.mono-project.com/) (only needed for Linux and MacOS)
-- Prerequisites mentioned in [INSTALL.md](../../INSTALL.md#pre-requisites)
+- Prerequisites mentioned in [BUILDING.md](../../BUILDING.md#pre-requisites)
to be able to compile the native code.
**Windows, Linux or Mac OS X**
@@ -93,6 +93,6 @@ THE NATIVE DEPENDENCY
Internally, gRPC C# uses a native library written in C (gRPC C core) and invokes its functionality via P/Invoke. The fact that a native library is used should be fully transparent to the users and just installing the `Grpc.Core` NuGet package is the only step needed to use gRPC C# on all supported platforms.
-[API Reference]: https://grpc.io/grpc/csharp/
+[API Reference]: https://grpc.io/grpc/csharp/api/Grpc.Core.html
[Helloworld Example]: ../../examples/csharp/helloworld
[RouteGuide Tutorial]: https://grpc.io/docs/tutorials/basic/csharp.html
diff --git a/src/csharp/build_packages_dotnetcli.bat b/src/csharp/build_packages_dotnetcli.bat
index 924d7b1697..394b859e0b 100755
--- a/src/csharp/build_packages_dotnetcli.bat
+++ b/src/csharp/build_packages_dotnetcli.bat
@@ -13,7 +13,7 @@
@rem limitations under the License.
@rem Current package versions
-set VERSION=1.13.0-dev
+set VERSION=1.14.0-dev
@rem Adjust the location of nuget.exe
set NUGET=C:\nuget\nuget.exe
@@ -47,6 +47,7 @@ xcopy /Y /I nativelibs\csharp_ext_windows_x64\grpc_csharp_ext.dll ..\..\cmake\bu
%DOTNET% pack --configuration Release Grpc.Reflection --output ..\..\..\artifacts || goto :error
%NUGET% pack Grpc.nuspec -Version %VERSION% -OutputDirectory ..\..\artifacts || goto :error
+%NUGET% pack Grpc.Core.NativeDebug.nuspec -Version %VERSION% -OutputDirectory ..\..\artifacts
%NUGET% pack Grpc.Tools.nuspec -Version %VERSION% -OutputDirectory ..\..\artifacts
@rem copy resulting nuget packages to artifacts directory
diff --git a/src/csharp/build_packages_dotnetcli.sh b/src/csharp/build_packages_dotnetcli.sh
index 5c73a8f95f..273d745f17 100755
--- a/src/csharp/build_packages_dotnetcli.sh
+++ b/src/csharp/build_packages_dotnetcli.sh
@@ -45,7 +45,8 @@ 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.13.0-dev" -OutputDirectory ../../artifacts
-nuget pack Grpc.Tools.nuspec -Version "1.13.0-dev" -OutputDirectory ../../artifacts
+nuget pack Grpc.nuspec -Version "1.14.0-dev" -OutputDirectory ../../artifacts
+nuget pack Grpc.Core.NativeDebug.nuspec -Version "1.14.0-dev" -OutputDirectory ../../artifacts
+nuget pack Grpc.Tools.nuspec -Version "1.14.0-dev" -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 3e6ec474b7..87a2516f8d 100644
--- a/src/csharp/ext/grpc_csharp_ext.c
+++ b/src/csharp/ext/grpc_csharp_ext.c
@@ -935,11 +935,12 @@ grpcsharp_ssl_credentials_create(const char* pem_root_certs,
if (key_cert_pair_cert_chain || key_cert_pair_private_key) {
key_cert_pair.cert_chain = key_cert_pair_cert_chain;
key_cert_pair.private_key = key_cert_pair_private_key;
- return grpc_ssl_credentials_create(pem_root_certs, &key_cert_pair, NULL);
+ return grpc_ssl_credentials_create(pem_root_certs, &key_cert_pair, NULL,
+ NULL);
} else {
GPR_ASSERT(!key_cert_pair_cert_chain);
GPR_ASSERT(!key_cert_pair_private_key);
- return grpc_ssl_credentials_create(pem_root_certs, NULL, NULL);
+ return grpc_ssl_credentials_create(pem_root_certs, NULL, NULL, NULL);
}
}
diff --git a/src/csharp/tests.json b/src/csharp/tests.json
index 60f67ff3c9..c2f243fe0a 100644
--- a/src/csharp/tests.json
+++ b/src/csharp/tests.json
@@ -41,7 +41,9 @@
"Grpc.Core.Tests.UserAgentStringTest"
],
"Grpc.Examples.Tests": [
- "Math.Tests.MathClientServerTest"
+ "Math.Tests.MathClientMockableTest",
+ "Math.Tests.MathClientServerTest",
+ "Math.Tests.MathServiceImplTestabilityTest"
],
"Grpc.HealthCheck.Tests": [
"Grpc.HealthCheck.Tests.HealthClientServerTest",
diff --git a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec
index 515dc917d1..28dfffd863 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.13.0-dev'
+ v = '1.14.0-dev'
s.version = v
s.summary = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.'
s.description = <<-DESC
diff --git a/src/objective-c/GRPCClient/GRPCCall+MobileLog.h b/src/objective-c/GRPCClient/GRPCCall+MobileLog.h
deleted file mode 100644
index 53b347d9ca..0000000000
--- a/src/objective-c/GRPCClient/GRPCCall+MobileLog.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#import "GRPCCall.h"
-
-@interface GRPCCall (MobileLog)
-// Set the object to be passed down along channel stack with channel arg
-// GRPC_ARG_MOBILE_LOG_CONFIG. The setting may be used by custom channel
-// filters for metrics logging.
-+ (void)setLogConfig:(id)logConfig;
-
-// Obtain the object to be passed down along channel stack with channel arg
-// GRPC_ARG_MOBILE_LOG_CONFIG.
-+ (id)logConfig;
-@end
diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m
index 5b48d06158..9783b06440 100644
--- a/src/objective-c/GRPCClient/GRPCCall.m
+++ b/src/objective-c/GRPCClient/GRPCCall.m
@@ -206,8 +206,9 @@ static NSString *const kBearerPrefix = @"Bearer ";
} else {
[_responseWriteable enqueueSuccessfulCompletion];
}
-
+#ifndef GRPC_CFSTREAM
[GRPCConnectivityMonitor unregisterObserver:self];
+#endif
// If the call isn't retained anywhere else, it can be deallocated now.
_retainSelf = nil;
@@ -462,7 +463,9 @@ static NSString *const kBearerPrefix = @"Bearer ";
[self sendHeaders:_requestHeaders];
[self invokeCall];
+#ifndef GRPC_CFSTREAM
[GRPCConnectivityMonitor registerObserver:self selector:@selector(connectivityChanged:)];
+#endif
}
- (void)startWithWriteable:(id<GRXWriteable>)writeable {
diff --git a/src/objective-c/GRPCClient/private/GRPCCompletionQueue.m b/src/objective-c/GRPCClient/private/GRPCCompletionQueue.m
index 57dbde8d04..bda1c3360b 100644
--- a/src/objective-c/GRPCClient/private/GRPCCompletionQueue.m
+++ b/src/objective-c/GRPCClient/private/GRPCCompletionQueue.m
@@ -20,6 +20,14 @@
#import <grpc/grpc.h>
+#ifdef GRPC_CFSTREAM
+const grpc_completion_queue_attributes kCompletionQueueAttr = {GRPC_CQ_CURRENT_VERSION,
+ GRPC_CQ_NEXT, GRPC_CQ_NON_POLLING};
+#else
+const grpc_completion_queue_attributes kCompletionQueueAttr = {
+ GRPC_CQ_CURRENT_VERSION, GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING};
+#endif
+
@implementation GRPCCompletionQueue
+ (instancetype)completionQueue {
@@ -33,7 +41,8 @@
- (instancetype)init {
if ((self = [super init])) {
- _unmanagedQueue = grpc_completion_queue_create_for_next(NULL);
+ _unmanagedQueue = grpc_completion_queue_create(
+ grpc_completion_queue_factory_lookup(&kCompletionQueueAttr), &kCompletionQueueAttr, NULL);
// This is for the following block to capture the pointer by value (instead
// of retaining self and doing self->_unmanagedQueue). This is essential
diff --git a/src/objective-c/GRPCClient/private/GRPCHost.h b/src/objective-c/GRPCClient/private/GRPCHost.h
index 6697f61be4..d9916d9303 100644
--- a/src/objective-c/GRPCClient/private/GRPCHost.h
+++ b/src/objective-c/GRPCClient/private/GRPCHost.h
@@ -37,6 +37,7 @@ struct grpc_channel_credentials;
@property(nonatomic) grpc_compression_algorithm compressAlgorithm;
@property(nonatomic) int keepaliveInterval;
@property(nonatomic) int keepaliveTimeout;
+@property(nonatomic) id logContext;
/** The following properties should only be modified for testing: */
diff --git a/src/objective-c/GRPCClient/private/GRPCHost.m b/src/objective-c/GRPCClient/private/GRPCHost.m
index c3ea9afc37..348989904a 100644
--- a/src/objective-c/GRPCClient/private/GRPCHost.m
+++ b/src/objective-c/GRPCClient/private/GRPCHost.m
@@ -18,7 +18,6 @@
#import "GRPCHost.h"
-#import <GRPCClient/GRPCCall+MobileLog.h>
#import <GRPCClient/GRPCCall.h>
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
@@ -50,7 +49,9 @@ static NSMutableDictionary *kHostCache;
if (_channelCreds != nil) {
grpc_channel_credentials_release(_channelCreds);
}
+#ifndef GRPC_CFSTREAM
[GRPCConnectivityMonitor unregisterObserver:self];
+#endif
}
// Default initializer.
@@ -85,7 +86,9 @@ static NSMutableDictionary *kHostCache;
kHostCache[address] = self;
_compressAlgorithm = GRPC_COMPRESS_NONE;
}
+#ifndef GRPC_CFSTREAM
[GRPCConnectivityMonitor registerObserver:self selector:@selector(connectivityChange:)];
+#endif
}
return self;
}
@@ -126,6 +129,14 @@ static NSMutableDictionary *kHostCache;
completionQueue:queue];
}
+- (NSData *)nullTerminatedDataWithString:(NSString *)string {
+ // dataUsingEncoding: does not return a null-terminated string.
+ NSData *data = [string dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
+ NSMutableData *nullTerminated = [NSMutableData dataWithData:data];
+ [nullTerminated appendBytes:"\0" length:1];
+ return nullTerminated;
+}
+
- (BOOL)setTLSPEMRootCerts:(nullable NSString *)pemRootCerts
withPrivateKey:(nullable NSString *)pemPrivateKey
withCertChain:(nullable NSString *)pemCertChain
@@ -147,13 +158,12 @@ static NSMutableDictionary *kHostCache;
kDefaultRootsError = error;
return;
}
- kDefaultRootsASCII =
- [contentInUTF8 dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
+ kDefaultRootsASCII = [self nullTerminatedDataWithString:contentInUTF8];
});
NSData *rootsASCII;
if (pemRootCerts != nil) {
- rootsASCII = [pemRootCerts dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
+ rootsASCII = [self nullTerminatedDataWithString:pemRootCerts];
} else {
if (kDefaultRootsASCII == nil) {
if (errorPtr) {
@@ -173,16 +183,14 @@ static NSMutableDictionary *kHostCache;
grpc_channel_credentials *creds;
if (pemPrivateKey == nil && pemCertChain == nil) {
- creds = grpc_ssl_credentials_create(rootsASCII.bytes, NULL, NULL);
+ creds = grpc_ssl_credentials_create(rootsASCII.bytes, NULL, NULL, NULL);
} else {
grpc_ssl_pem_key_cert_pair key_cert_pair;
- NSData *privateKeyASCII =
- [pemPrivateKey dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
- NSData *certChainASCII =
- [pemCertChain dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
+ NSData *privateKeyASCII = [self nullTerminatedDataWithString:pemPrivateKey];
+ NSData *certChainASCII = [self nullTerminatedDataWithString:pemCertChain];
key_cert_pair.private_key = privateKeyASCII.bytes;
key_cert_pair.cert_chain = certChainASCII.bytes;
- creds = grpc_ssl_credentials_create(rootsASCII.bytes, &key_cert_pair, NULL);
+ creds = grpc_ssl_credentials_create(rootsASCII.bytes, &key_cert_pair, NULL, NULL);
}
@synchronized(self) {
@@ -223,9 +231,9 @@ static NSMutableDictionary *kHostCache;
args[@GRPC_ARG_KEEPALIVE_TIMEOUT_MS] = [NSNumber numberWithInt:_keepaliveTimeout];
}
- id logConfig = [GRPCCall logConfig];
- if (logConfig != nil) {
- args[@GRPC_ARG_MOBILE_LOG_CONFIG] = logConfig;
+ id logContext = self.logContext;
+ if (logContext != nil) {
+ args[@GRPC_ARG_MOBILE_LOG_CONTEXT] = logContext;
}
if (useCronet) {
diff --git a/src/objective-c/GRPCClient/private/version.h b/src/objective-c/GRPCClient/private/version.h
index 6fe4a7d051..60571b1f43 100644
--- a/src/objective-c/GRPCClient/private/version.h
+++ b/src/objective-c/GRPCClient/private/version.h
@@ -22,4 +22,4 @@
// instead. This file can be regenerated from the template by running
// `tools/buildgen/generate_projects.sh`.
-#define GRPC_OBJC_VERSION_STRING @"1.13.0-dev"
+#define GRPC_OBJC_VERSION_STRING @"1.14.0-dev"
diff --git a/src/objective-c/examples/Sample/Sample.xcodeproj/project.pbxproj b/src/objective-c/examples/Sample/Sample.xcodeproj/project.pbxproj
index ab7159cda2..cdd1c6c8f7 100644
--- a/src/objective-c/examples/Sample/Sample.xcodeproj/project.pbxproj
+++ b/src/objective-c/examples/Sample/Sample.xcodeproj/project.pbxproj
@@ -325,6 +325,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = Sample/Info.plist;
+ LD_GENERATE_MAP_FILE = YES;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.grpc.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -337,6 +338,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = Sample/Info.plist;
+ LD_GENERATE_MAP_FILE = YES;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.grpc.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
diff --git a/src/objective-c/examples/Sample/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme b/src/objective-c/examples/Sample/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme
index d399e22e46..e356ea22a6 100644
--- a/src/objective-c/examples/Sample/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme
+++ b/src/objective-c/examples/Sample/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme
@@ -42,7 +42,7 @@
</AdditionalOptions>
</TestAction>
<LaunchAction
- buildConfiguration = "Debug"
+ buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
diff --git a/src/objective-c/tests/Connectivity/ConnectivityTestingApp.xcodeproj/project.pbxproj b/src/objective-c/tests/Connectivity/ConnectivityTestingApp.xcodeproj/project.pbxproj
index 6a4c3519d6..7a03f9b41a 100644
--- a/src/objective-c/tests/Connectivity/ConnectivityTestingApp.xcodeproj/project.pbxproj
+++ b/src/objective-c/tests/Connectivity/ConnectivityTestingApp.xcodeproj/project.pbxproj
@@ -99,7 +99,6 @@
5EC49F8D2043E46B00ED189A /* Sources */,
5EC49F8E2043E46B00ED189A /* Frameworks */,
5EC49F8F2043E46B00ED189A /* Resources */,
- 9F67C72B6B6BAF2781078886 /* [CP] Embed Pods Frameworks */,
735516C793AF7394FBB83B7F /* [CP] Copy Pods Resources */,
);
buildRules = (
@@ -194,21 +193,6 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
- 9F67C72B6B6BAF2781078886 /* [CP] Embed Pods Frameworks */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- name = "[CP] Embed Pods Frameworks";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ConnectivityTestingApp/Pods-ConnectivityTestingApp-frameworks.sh\"\n";
- showEnvVarsInLog = 0;
- };
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -284,6 +268,7 @@
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
+ "GRPC_CFSTREAM=1",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
diff --git a/src/objective-c/tests/Connectivity/ConnectivityTestingApp/ViewController.m b/src/objective-c/tests/Connectivity/ConnectivityTestingApp/ViewController.m
index 88780e39f0..3c77fe2f2c 100644
--- a/src/objective-c/tests/Connectivity/ConnectivityTestingApp/ViewController.m
+++ b/src/objective-c/tests/Connectivity/ConnectivityTestingApp/ViewController.m
@@ -35,7 +35,9 @@ NSString *host = @"grpc-test.sandbox.googleapis.com";
- (void)viewDidLoad {
[super viewDidLoad];
+#ifndef GRPC_CFSTREAM
[GRPCConnectivityMonitor registerObserver:self selector:@selector(reachabilityChanged:)];
+#endif
}
- (void)reachabilityChanged:(NSNotification *)note {
diff --git a/src/objective-c/tests/Connectivity/Podfile b/src/objective-c/tests/Connectivity/Podfile
index cdbc6dde59..c7127b3e78 100644
--- a/src/objective-c/tests/Connectivity/Podfile
+++ b/src/objective-c/tests/Connectivity/Podfile
@@ -5,9 +5,9 @@ platform :ios, '8.0'
GRPC_LOCAL_SRC = '../../../..'
target 'ConnectivityTestingApp' do
- pod 'gRPC', :path => GRPC_LOCAL_SRC
- pod 'gRPC-Core', :path => GRPC_LOCAL_SRC
- pod 'gRPC-ProtoRPC', :path => GRPC_LOCAL_SRC
+ pod 'gRPC/CFStream', :path => GRPC_LOCAL_SRC
+ pod 'gRPC-Core/CFStream-Implementation', :path => GRPC_LOCAL_SRC
+ pod 'gRPC-ProtoRPC/CFStream', :path => GRPC_LOCAL_SRC
pod 'gRPC-RxLibrary', :path => GRPC_LOCAL_SRC
pod 'Protobuf', :path => "#{GRPC_LOCAL_SRC}/third_party/protobuf"
pod 'BoringSSL', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c"
diff --git a/src/objective-c/tests/GRPCClientTests.m b/src/objective-c/tests/GRPCClientTests.m
index 5cd0231db7..d9186561c3 100644
--- a/src/objective-c/tests/GRPCClientTests.m
+++ b/src/objective-c/tests/GRPCClientTests.m
@@ -525,7 +525,8 @@ static GRPCProtoMethod *kFullDuplexCallMethod;
- (void)testErrorCode {
int port = [self findFreePort];
NSString *const kDummyAddress = [NSString stringWithFormat:@"localhost:%d", port];
- __weak XCTestExpectation *completion = [self expectationWithDescription:@"Empty RPC completed."];
+ __weak XCTestExpectation *completion =
+ [self expectationWithDescription:@"Received correct error code."];
GRPCCall *call = [[GRPCCall alloc] initWithHost:kDummyAddress
path:kEmptyCallMethod.HTTPPath
diff --git a/src/objective-c/tests/Podfile b/src/objective-c/tests/Podfile
index b6e389715a..3c2a34fb49 100644
--- a/src/objective-c/tests/Podfile
+++ b/src/objective-c/tests/Podfile
@@ -37,6 +37,27 @@ GRPC_LOCAL_SRC = '../../..'
end
%w(
+ InteropTestsRemoteCFStream
+ InteropTestsLocalSSLCFStream
+ InteropTestsLocalCleartextCFStream
+).each do |target_name|
+ target target_name do
+ pod 'Protobuf', :path => "#{GRPC_LOCAL_SRC}/third_party/protobuf", :inhibit_warnings => true
+
+ pod '!ProtoCompiler', :path => "#{GRPC_LOCAL_SRC}/src/objective-c"
+ pod '!ProtoCompiler-gRPCPlugin', :path => "#{GRPC_LOCAL_SRC}/src/objective-c"
+
+ pod 'BoringSSL', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c", :inhibit_warnings => true
+
+ pod 'gRPC/CFStream', :path => GRPC_LOCAL_SRC
+ pod 'gRPC-Core/CFStream-Implementation', :path => GRPC_LOCAL_SRC
+ pod 'gRPC-RxLibrary', :path => GRPC_LOCAL_SRC
+ pod 'gRPC-ProtoRPC', :path => GRPC_LOCAL_SRC, :inhibit_warnings => true
+ pod 'RemoteTest', :path => "RemoteTestClient", :inhibit_warnings => true
+ end
+end
+
+%w(
CoreCronetEnd2EndTests
CronetUnitTests
).each do |target_name|
@@ -65,7 +86,7 @@ end
# TODO(jcanizales): Send a PR to Cocoapods to get rid of this need.
pre_install do |installer|
# This is the gRPC-Core podspec object, as initialized by its podspec file.
- grpc_core_spec = installer.pod_targets.find{|t| t.name == 'gRPC-Core'}.root_spec
+ grpc_core_spec = installer.pod_targets.find{|t| t.name.start_with?('gRPC-Core')}.root_spec
# Copied from gRPC-Core.podspec, except for the adjusted src_root:
src_root = "$(PODS_ROOT)/../#{GRPC_LOCAL_SRC}"
@@ -96,7 +117,11 @@ post_install do |installer|
# GPR_UNREACHABLE_CODE causes "Control may reach end of non-void
# function" warning
config.build_settings['GCC_WARN_ABOUT_RETURN_TYPE'] = 'NO'
- config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) COCOAPODS=1 GRPC_CRONET_WITH_PACKET_COALESCING=1'
+ if target.name.include?('CFStream')
+ config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) COCOAPODS=1 GRPC_CFSTREAM=1'
+ else
+ config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) COCOAPODS=1 GRPC_CRONET_WITH_PACKET_COALESCING=1'
+ end
end
end
@@ -104,7 +129,7 @@ post_install do |installer|
# the test target 'InteropTestsRemoteWithCronet'
# Activate GRPCCall+InternalTests functions for the dedicated build configuration 'Test', which will
# be used by all test targets using it.
- if target.name == 'gRPC'
+ if target.name == 'gRPC' || target.name.start_with?('gRPC.')
target.build_configurations.each do |config|
if config.name == 'Cronet'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) COCOAPODS=1 GRPC_COMPILE_WITH_CRONET=1 GRPC_TEST_OBJC=1'
diff --git a/src/objective-c/tests/Tests.xcodeproj/project.pbxproj b/src/objective-c/tests/Tests.xcodeproj/project.pbxproj
index e0f220eaee..8ff4633582 100644
--- a/src/objective-c/tests/Tests.xcodeproj/project.pbxproj
+++ b/src/objective-c/tests/Tests.xcodeproj/project.pbxproj
@@ -13,11 +13,18 @@
16A9E77B6E336B3C0B9BA6E0 /* libPods-InteropTestsLocalSSL.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DBEDE45BDA60DF1E1C8950C0 /* libPods-InteropTestsLocalSSL.a */; };
20DFDF829DD993A4A00D5662 /* libPods-RxLibraryUnitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A58BE6DF1C62D1739EBB2C78 /* libPods-RxLibraryUnitTests.a */; };
333E8FC01C8285B7C547D799 /* libPods-InteropTestsLocalCleartext.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD346DB2C23F676C4842F3FF /* libPods-InteropTestsLocalCleartext.a */; };
- 3D7C85F6AA68C4A205E3BA16 /* libPods-Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 20DFF2F3C97EF098FE5A3171 /* libPods-Tests.a */; };
5E8A5DA71D3840B4000F8BC4 /* CoreCronetEnd2EndTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5E8A5DA61D3840B4000F8BC4 /* CoreCronetEnd2EndTests.mm */; };
5E8A5DA91D3840B4000F8BC4 /* libTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 635697C71B14FC11007A7283 /* libTests.a */; };
5EAD6D271E27047400002378 /* CronetUnitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EAD6D261E27047400002378 /* CronetUnitTests.m */; };
5EAD6D291E27047400002378 /* libTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 635697C71B14FC11007A7283 /* libTests.a */; };
+ 5EC5E42B2081782C000EF4AD /* InteropTestsRemote.m in Sources */ = {isa = PBXBuildFile; fileRef = 6379CC4F1BE16703001BC0A1 /* InteropTestsRemote.m */; };
+ 5EC5E42C20817832000EF4AD /* InteropTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 635ED2EB1B1A3BC400FDE5C3 /* InteropTests.m */; };
+ 5EC5E43B208185A7000EF4AD /* InteropTestsLocalCleartext.m in Sources */ = {isa = PBXBuildFile; fileRef = 63715F551B780C020029CB0B /* InteropTestsLocalCleartext.m */; };
+ 5EC5E43C208185AD000EF4AD /* InteropTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 635ED2EB1B1A3BC400FDE5C3 /* InteropTests.m */; };
+ 5EC5E43D208185B0000EF4AD /* GRPCClientTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6312AE4D1B1BF49B00341DEE /* GRPCClientTests.m */; };
+ 5EC5E44C208185EC000EF4AD /* InteropTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 635ED2EB1B1A3BC400FDE5C3 /* InteropTests.m */; };
+ 5EC5E44D208185F0000EF4AD /* InteropTestsLocalSSL.m in Sources */ = {isa = PBXBuildFile; fileRef = 63E240CD1B6C4E2B005F3B0E /* InteropTestsLocalSSL.m */; };
+ 5EC5E44E20818948000EF4AD /* TestCertificates.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 63E240CF1B6C63DC005F3B0E /* TestCertificates.bundle */; };
5EE84BF41D4717E40050C6CC /* InteropTestsRemoteWithCronet.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EE84BF31D4717E40050C6CC /* InteropTestsRemoteWithCronet.m */; };
5EE84BF61D4717E40050C6CC /* libTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 635697C71B14FC11007A7283 /* libTests.a */; };
5EE84BFE1D471D400050C6CC /* InteropTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 635ED2EB1B1A3BC400FDE5C3 /* InteropTests.m */; };
@@ -44,6 +51,9 @@
63DC84501BE153AA000708E8 /* GRPCClientTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6312AE4D1B1BF49B00341DEE /* GRPCClientTests.m */; };
63E240CE1B6C4E2B005F3B0E /* InteropTestsLocalSSL.m in Sources */ = {isa = PBXBuildFile; fileRef = 63E240CD1B6C4E2B005F3B0E /* InteropTestsLocalSSL.m */; };
63E240D01B6C63DC005F3B0E /* TestCertificates.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 63E240CF1B6C63DC005F3B0E /* TestCertificates.bundle */; };
+ 91D4B3C85B6D8562F409CB48 /* libPods-InteropTestsLocalSSLCFStream.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F3AB031E0E26AC8EF30A2A2A /* libPods-InteropTestsLocalSSLCFStream.a */; };
+ BC111C80CBF7068B62869352 /* libPods-InteropTestsRemoteCFStream.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F44AC3F44E3491A8C0D890FE /* libPods-InteropTestsRemoteCFStream.a */; };
+ C3D6F4270A2FFF634D8849ED /* libPods-InteropTestsLocalCleartextCFStream.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0BDA4BA011779D5D25B5618C /* libPods-InteropTestsLocalCleartextCFStream.a */; };
F15EF7852DC70770EFDB1D2C /* libPods-AllTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CAE086D5B470DA367D415AB0 /* libPods-AllTests.a */; };
/* End PBXBuildFile section */
@@ -120,31 +130,41 @@
/* Begin PBXFileReference section */
02192CF1FF9534E3D18C65FC /* Pods-CronetUnitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CronetUnitTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-CronetUnitTests/Pods-CronetUnitTests.release.xcconfig"; sourceTree = "<group>"; };
- 060EF32D7EC0DF67ED617507 /* Pods-Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig"; sourceTree = "<group>"; };
07D10A965323BEA7FE59A74B /* Pods-RxLibraryUnitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RxLibraryUnitTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RxLibraryUnitTests/Pods-RxLibraryUnitTests.debug.xcconfig"; sourceTree = "<group>"; };
0A4F89D9C90E9C30990218F0 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
+ 0BDA4BA011779D5D25B5618C /* libPods-InteropTestsLocalCleartextCFStream.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-InteropTestsLocalCleartextCFStream.a"; sourceTree = BUILT_PRODUCTS_DIR; };
0D2284C3DF7E57F0ED504E39 /* Pods-CoreCronetEnd2EndTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CoreCronetEnd2EndTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CoreCronetEnd2EndTests/Pods-CoreCronetEnd2EndTests.debug.xcconfig"; sourceTree = "<group>"; };
14B09A58FEE53A7A6B838920 /* Pods-InteropTestsLocalSSL.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalSSL.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalSSL/Pods-InteropTestsLocalSSL.cronet.xcconfig"; sourceTree = "<group>"; };
1588C85DEAF7FC0ACDEA4C02 /* Pods-InteropTestsLocalCleartext.test.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalCleartext.test.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalCleartext/Pods-InteropTestsLocalCleartext.test.xcconfig"; sourceTree = "<group>"; };
17F60BF2871F6AF85FB3FA12 /* Pods-InteropTestsRemoteWithCronet.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsRemoteWithCronet.debug.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsRemoteWithCronet/Pods-InteropTestsRemoteWithCronet.debug.xcconfig"; sourceTree = "<group>"; };
20DFF2F3C97EF098FE5A3171 /* libPods-Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
2B89F3037963E6EDDD48D8C3 /* Pods-InteropTestsRemoteWithCronet.test.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsRemoteWithCronet.test.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsRemoteWithCronet/Pods-InteropTestsRemoteWithCronet.test.xcconfig"; sourceTree = "<group>"; };
+ 303F4A17EB1650FC44603D17 /* Pods-InteropTestsRemoteCFStream.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsRemoteCFStream.release.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsRemoteCFStream/Pods-InteropTestsRemoteCFStream.release.xcconfig"; sourceTree = "<group>"; };
+ 32748C4078AEB05F8F954361 /* Pods-InteropTestsRemoteCFStream.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsRemoteCFStream.debug.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsRemoteCFStream/Pods-InteropTestsRemoteCFStream.debug.xcconfig"; sourceTree = "<group>"; };
35F2B6BF3BAE8F0DC4AFD76E /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
386712AEACF7C2190C4B8B3F /* Pods-CronetUnitTests.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CronetUnitTests.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-CronetUnitTests/Pods-CronetUnitTests.cronet.xcconfig"; sourceTree = "<group>"; };
3B0861FC805389C52DB260D4 /* Pods-RxLibraryUnitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RxLibraryUnitTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-RxLibraryUnitTests/Pods-RxLibraryUnitTests.release.xcconfig"; sourceTree = "<group>"; };
+ 3EB55EF291706E3DDE23C3B7 /* Pods-InteropTestsLocalSSLCFStream.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalSSLCFStream.debug.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalSSLCFStream/Pods-InteropTestsLocalSSLCFStream.debug.xcconfig"; sourceTree = "<group>"; };
3F27B2E744482771EB93C394 /* Pods-InteropTestsRemoteWithCronet.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsRemoteWithCronet.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsRemoteWithCronet/Pods-InteropTestsRemoteWithCronet.cronet.xcconfig"; sourceTree = "<group>"; };
+ 41AA59529240A6BBBD3DB904 /* Pods-InteropTestsLocalSSLCFStream.test.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalSSLCFStream.test.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalSSLCFStream/Pods-InteropTestsLocalSSLCFStream.test.xcconfig"; sourceTree = "<group>"; };
+ 4A1A42B2E941CCD453489E5B /* Pods-InteropTestsRemoteCFStream.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsRemoteCFStream.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsRemoteCFStream/Pods-InteropTestsRemoteCFStream.cronet.xcconfig"; sourceTree = "<group>"; };
4AD97096D13D7416DC91A72A /* Pods-CoreCronetEnd2EndTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CoreCronetEnd2EndTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-CoreCronetEnd2EndTests/Pods-CoreCronetEnd2EndTests.release.xcconfig"; sourceTree = "<group>"; };
4ADEA1C8BBE10D90940AC68E /* Pods-InteropTestsRemote.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsRemote.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsRemote/Pods-InteropTestsRemote.cronet.xcconfig"; sourceTree = "<group>"; };
51A275E86C141416ED63FF76 /* Pods-InteropTestsLocalCleartext.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalCleartext.release.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalCleartext/Pods-InteropTestsLocalCleartext.release.xcconfig"; sourceTree = "<group>"; };
553BBBED24E4162D1F769D65 /* Pods-InteropTestsLocalSSL.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalSSL.debug.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalSSL/Pods-InteropTestsLocalSSL.debug.xcconfig"; sourceTree = "<group>"; };
+ 55B630C1FF8C36D1EFC4E0A4 /* Pods-InteropTestsLocalSSLCFStream.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalSSLCFStream.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalSSLCFStream/Pods-InteropTestsLocalSSLCFStream.cronet.xcconfig"; sourceTree = "<group>"; };
573450F334B331D0BED8B961 /* Pods-CoreCronetEnd2EndTests.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CoreCronetEnd2EndTests.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-CoreCronetEnd2EndTests/Pods-CoreCronetEnd2EndTests.cronet.xcconfig"; sourceTree = "<group>"; };
5761E98978DDDF136A58CB7E /* Pods-AllTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AllTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-AllTests/Pods-AllTests.release.xcconfig"; sourceTree = "<group>"; };
5E8A5DA41D3840B4000F8BC4 /* CoreCronetEnd2EndTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoreCronetEnd2EndTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
5E8A5DA61D3840B4000F8BC4 /* CoreCronetEnd2EndTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CoreCronetEnd2EndTests.mm; sourceTree = "<group>"; };
+ 5EA908CF4CDA4CE218352A06 /* Pods-InteropTestsLocalSSLCFStream.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalSSLCFStream.release.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalSSLCFStream/Pods-InteropTestsLocalSSLCFStream.release.xcconfig"; sourceTree = "<group>"; };
5EAD6D241E27047400002378 /* CronetUnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CronetUnitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
5EAD6D261E27047400002378 /* CronetUnitTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CronetUnitTests.m; sourceTree = "<group>"; };
5EAD6D281E27047400002378 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
5EAFE8271F8EFB87007F2189 /* version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = version.h; sourceTree = "<group>"; };
+ 5EC5E421208177CC000EF4AD /* InteropTestsRemoteCFStream.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = InteropTestsRemoteCFStream.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+ 5EC5E4312081856B000EF4AD /* InteropTestsLocalCleartextCFStream.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = InteropTestsLocalCleartextCFStream.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+ 5EC5E442208185CE000EF4AD /* InteropTestsLocalSSLCFStream.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = InteropTestsLocalSSLCFStream.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
5EE84BF11D4717E40050C6CC /* InteropTestsRemoteWithCronet.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = InteropTestsRemoteWithCronet.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
5EE84BF31D4717E40050C6CC /* InteropTestsRemoteWithCronet.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = InteropTestsRemoteWithCronet.m; sourceTree = "<group>"; };
5EE84BF51D4717E40050C6CC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@@ -169,14 +189,17 @@
781089FAE980F51F88A3BE0B /* Pods-RxLibraryUnitTests.test.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RxLibraryUnitTests.test.xcconfig"; path = "Pods/Target Support Files/Pods-RxLibraryUnitTests/Pods-RxLibraryUnitTests.test.xcconfig"; sourceTree = "<group>"; };
79C68EFFCB5533475D810B79 /* Pods-RxLibraryUnitTests.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RxLibraryUnitTests.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-RxLibraryUnitTests/Pods-RxLibraryUnitTests.cronet.xcconfig"; sourceTree = "<group>"; };
7A2E97E3F469CC2A758D77DE /* Pods-InteropTestsLocalSSL.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalSSL.release.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalSSL/Pods-InteropTestsLocalSSL.release.xcconfig"; sourceTree = "<group>"; };
+ 7BA53C6D224288D5870FE6F3 /* Pods-InteropTestsLocalCleartextCFStream.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalCleartextCFStream.release.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalCleartextCFStream/Pods-InteropTestsLocalCleartextCFStream.release.xcconfig"; sourceTree = "<group>"; };
+ 8B498B05C6DA0818B2FA91D4 /* Pods-InteropTestsLocalCleartextCFStream.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalCleartextCFStream.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalCleartextCFStream/Pods-InteropTestsLocalCleartextCFStream.cronet.xcconfig"; sourceTree = "<group>"; };
+ 943138072A9605B5B8DC1FC0 /* Pods-InteropTestsLocalCleartextCFStream.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalCleartextCFStream.debug.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalCleartextCFStream/Pods-InteropTestsLocalCleartextCFStream.debug.xcconfig"; sourceTree = "<group>"; };
9E9444C764F0FFF64A7EB58E /* libPods-InteropTestsRemoteWithCronet.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-InteropTestsRemoteWithCronet.a"; sourceTree = BUILT_PRODUCTS_DIR; };
- A0361771A855917162911180 /* Pods-Tests.test.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.test.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.test.xcconfig"; sourceTree = "<group>"; };
A58BE6DF1C62D1739EBB2C78 /* libPods-RxLibraryUnitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RxLibraryUnitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
A6F832FCEFA6F6881E620F12 /* Pods-InteropTestsRemote.test.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsRemote.test.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsRemote/Pods-InteropTestsRemote.test.xcconfig"; sourceTree = "<group>"; };
AA7CB64B4DD9915AE7C03163 /* Pods-InteropTestsLocalCleartext.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalCleartext.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalCleartext/Pods-InteropTestsLocalCleartext.cronet.xcconfig"; sourceTree = "<group>"; };
AC414EF7A6BF76ED02B6E480 /* Pods-InteropTestsRemoteWithCronet.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsRemoteWithCronet.release.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsRemoteWithCronet/Pods-InteropTestsRemoteWithCronet.release.xcconfig"; sourceTree = "<group>"; };
B226619DC4E709E0FFFF94B8 /* Pods-CronetUnitTests.test.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CronetUnitTests.test.xcconfig"; path = "Pods/Target Support Files/Pods-CronetUnitTests/Pods-CronetUnitTests.test.xcconfig"; sourceTree = "<group>"; };
B94C27C06733CF98CE1B2757 /* Pods-AllTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AllTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-AllTests/Pods-AllTests.debug.xcconfig"; sourceTree = "<group>"; };
+ C17F57E5BCB989AB1C2F1F25 /* Pods-InteropTestsRemoteCFStream.test.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsRemoteCFStream.test.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsRemoteCFStream/Pods-InteropTestsRemoteCFStream.test.xcconfig"; sourceTree = "<group>"; };
C6134277D2EB8B380862A03F /* libPods-CronetUnitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-CronetUnitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
CAE086D5B470DA367D415AB0 /* libPods-AllTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-AllTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
D13BEC8181B8E678A1B52F54 /* Pods-InteropTestsLocalSSL.test.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalSSL.test.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalSSL/Pods-InteropTestsLocalSSL.test.xcconfig"; sourceTree = "<group>"; };
@@ -186,9 +209,10 @@
DC3CA1D948F068E76957A861 /* Pods-InteropTestsRemote.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsRemote.debug.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsRemote/Pods-InteropTestsRemote.debug.xcconfig"; sourceTree = "<group>"; };
E1486220285AF123EB124008 /* Pods-InteropTestsLocalCleartext.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalCleartext.debug.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalCleartext/Pods-InteropTestsLocalCleartext.debug.xcconfig"; sourceTree = "<group>"; };
E4275A759BDBDF143B9B438F /* Pods-InteropTestsRemote.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsRemote.release.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsRemote/Pods-InteropTestsRemote.release.xcconfig"; sourceTree = "<group>"; };
- E6733B838B28453434B556E2 /* Pods-Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig"; sourceTree = "<group>"; };
+ E4FD4606D4AB8D5A314D72F0 /* Pods-InteropTestsLocalCleartextCFStream.test.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalCleartextCFStream.test.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalCleartextCFStream/Pods-InteropTestsLocalCleartextCFStream.test.xcconfig"; sourceTree = "<group>"; };
E7E4D3FD76E3B745D992AF5F /* Pods-AllTests.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AllTests.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-AllTests/Pods-AllTests.cronet.xcconfig"; sourceTree = "<group>"; };
- F671D4CAD2864FB203B920B4 /* Pods-Tests.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.cronet.xcconfig"; sourceTree = "<group>"; };
+ F3AB031E0E26AC8EF30A2A2A /* libPods-InteropTestsLocalSSLCFStream.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-InteropTestsLocalSSLCFStream.a"; sourceTree = BUILT_PRODUCTS_DIR; };
+ F44AC3F44E3491A8C0D890FE /* libPods-InteropTestsRemoteCFStream.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-InteropTestsRemoteCFStream.a"; sourceTree = BUILT_PRODUCTS_DIR; };
FBD98AC417B9882D32B19F28 /* libPods-CoreCronetEnd2EndTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-CoreCronetEnd2EndTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
FD346DB2C23F676C4842F3FF /* libPods-InteropTestsLocalCleartext.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-InteropTestsLocalCleartext.a"; sourceTree = BUILT_PRODUCTS_DIR; };
FF7B5489BCFE40111D768DD0 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
@@ -213,6 +237,30 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ 5EC5E41E208177CC000EF4AD /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BC111C80CBF7068B62869352 /* libPods-InteropTestsRemoteCFStream.a in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 5EC5E42E2081856B000EF4AD /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ C3D6F4270A2FFF634D8849ED /* libPods-InteropTestsLocalCleartextCFStream.a in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 5EC5E43F208185CE000EF4AD /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 91D4B3C85B6D8562F409CB48 /* libPods-InteropTestsLocalSSLCFStream.a in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
5EE84BEE1D4717E40050C6CC /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -235,7 +283,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- 3D7C85F6AA68C4A205E3BA16 /* libPods-Tests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -291,6 +338,9 @@
FBD98AC417B9882D32B19F28 /* libPods-CoreCronetEnd2EndTests.a */,
9E9444C764F0FFF64A7EB58E /* libPods-InteropTestsRemoteWithCronet.a */,
C6134277D2EB8B380862A03F /* libPods-CronetUnitTests.a */,
+ F44AC3F44E3491A8C0D890FE /* libPods-InteropTestsRemoteCFStream.a */,
+ 0BDA4BA011779D5D25B5618C /* libPods-InteropTestsLocalCleartextCFStream.a */,
+ F3AB031E0E26AC8EF30A2A2A /* libPods-InteropTestsLocalSSLCFStream.a */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -310,8 +360,6 @@
E4275A759BDBDF143B9B438F /* Pods-InteropTestsRemote.release.xcconfig */,
07D10A965323BEA7FE59A74B /* Pods-RxLibraryUnitTests.debug.xcconfig */,
3B0861FC805389C52DB260D4 /* Pods-RxLibraryUnitTests.release.xcconfig */,
- 060EF32D7EC0DF67ED617507 /* Pods-Tests.debug.xcconfig */,
- E6733B838B28453434B556E2 /* Pods-Tests.release.xcconfig */,
0D2284C3DF7E57F0ED504E39 /* Pods-CoreCronetEnd2EndTests.debug.xcconfig */,
4AD97096D13D7416DC91A72A /* Pods-CoreCronetEnd2EndTests.release.xcconfig */,
17F60BF2871F6AF85FB3FA12 /* Pods-InteropTestsRemoteWithCronet.debug.xcconfig */,
@@ -323,7 +371,6 @@
4ADEA1C8BBE10D90940AC68E /* Pods-InteropTestsRemote.cronet.xcconfig */,
3F27B2E744482771EB93C394 /* Pods-InteropTestsRemoteWithCronet.cronet.xcconfig */,
79C68EFFCB5533475D810B79 /* Pods-RxLibraryUnitTests.cronet.xcconfig */,
- F671D4CAD2864FB203B920B4 /* Pods-Tests.cronet.xcconfig */,
64F68A9A6A63CC930DD30A6E /* Pods-CronetUnitTests.debug.xcconfig */,
386712AEACF7C2190C4B8B3F /* Pods-CronetUnitTests.cronet.xcconfig */,
02192CF1FF9534E3D18C65FC /* Pods-CronetUnitTests.release.xcconfig */,
@@ -335,7 +382,18 @@
A6F832FCEFA6F6881E620F12 /* Pods-InteropTestsRemote.test.xcconfig */,
2B89F3037963E6EDDD48D8C3 /* Pods-InteropTestsRemoteWithCronet.test.xcconfig */,
781089FAE980F51F88A3BE0B /* Pods-RxLibraryUnitTests.test.xcconfig */,
- A0361771A855917162911180 /* Pods-Tests.test.xcconfig */,
+ 32748C4078AEB05F8F954361 /* Pods-InteropTestsRemoteCFStream.debug.xcconfig */,
+ C17F57E5BCB989AB1C2F1F25 /* Pods-InteropTestsRemoteCFStream.test.xcconfig */,
+ 4A1A42B2E941CCD453489E5B /* Pods-InteropTestsRemoteCFStream.cronet.xcconfig */,
+ 303F4A17EB1650FC44603D17 /* Pods-InteropTestsRemoteCFStream.release.xcconfig */,
+ 943138072A9605B5B8DC1FC0 /* Pods-InteropTestsLocalCleartextCFStream.debug.xcconfig */,
+ E4FD4606D4AB8D5A314D72F0 /* Pods-InteropTestsLocalCleartextCFStream.test.xcconfig */,
+ 8B498B05C6DA0818B2FA91D4 /* Pods-InteropTestsLocalCleartextCFStream.cronet.xcconfig */,
+ 7BA53C6D224288D5870FE6F3 /* Pods-InteropTestsLocalCleartextCFStream.release.xcconfig */,
+ 3EB55EF291706E3DDE23C3B7 /* Pods-InteropTestsLocalSSLCFStream.debug.xcconfig */,
+ 41AA59529240A6BBBD3DB904 /* Pods-InteropTestsLocalSSLCFStream.test.xcconfig */,
+ 55B630C1FF8C36D1EFC4E0A4 /* Pods-InteropTestsLocalSSLCFStream.cronet.xcconfig */,
+ 5EA908CF4CDA4CE218352A06 /* Pods-InteropTestsLocalSSLCFStream.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
@@ -392,6 +450,9 @@
5E8A5DA41D3840B4000F8BC4 /* CoreCronetEnd2EndTests.xctest */,
5EE84BF11D4717E40050C6CC /* InteropTestsRemoteWithCronet.xctest */,
5EAD6D241E27047400002378 /* CronetUnitTests.xctest */,
+ 5EC5E421208177CC000EF4AD /* InteropTestsRemoteCFStream.xctest */,
+ 5EC5E4312081856B000EF4AD /* InteropTestsLocalCleartextCFStream.xctest */,
+ 5EC5E442208185CE000EF4AD /* InteropTestsLocalSSLCFStream.xctest */,
);
name = Products;
sourceTree = "<group>";
@@ -433,7 +494,6 @@
5E8A5DA11D3840B4000F8BC4 /* Frameworks */,
5E8A5DA21D3840B4000F8BC4 /* Resources */,
E63468C760D0724F18861822 /* [CP] Embed Pods Frameworks */,
- 6DFE9E77CAB5760196D79E0F /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -454,7 +514,6 @@
5EAD6D211E27047400002378 /* Frameworks */,
5EAD6D221E27047400002378 /* Resources */,
A686B9967BB4CB81B1CBF8F8 /* [CP] Embed Pods Frameworks */,
- 051806D6A59B19C8A0B76BED /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -466,6 +525,63 @@
productReference = 5EAD6D241E27047400002378 /* CronetUnitTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
+ 5EC5E420208177CC000EF4AD /* InteropTestsRemoteCFStream */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 5EC5E42A208177CD000EF4AD /* Build configuration list for PBXNativeTarget "InteropTestsRemoteCFStream" */;
+ buildPhases = (
+ 483CDBBAEAEFCB530ADDDDD5 /* [CP] Check Pods Manifest.lock */,
+ 5EC5E41D208177CC000EF4AD /* Sources */,
+ 5EC5E41E208177CC000EF4AD /* Frameworks */,
+ 5EC5E41F208177CC000EF4AD /* Resources */,
+ 95FBC48B743503845678584F /* [CP] Copy Pods Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = InteropTestsRemoteCFStream;
+ productName = InteropTestsRemoteCFStream;
+ productReference = 5EC5E421208177CC000EF4AD /* InteropTestsRemoteCFStream.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
+ 5EC5E4302081856B000EF4AD /* InteropTestsLocalCleartextCFStream */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 5EC5E4362081856C000EF4AD /* Build configuration list for PBXNativeTarget "InteropTestsLocalCleartextCFStream" */;
+ buildPhases = (
+ 252A376345E38FD452A89C3D /* [CP] Check Pods Manifest.lock */,
+ 5EC5E42D2081856B000EF4AD /* Sources */,
+ 5EC5E42E2081856B000EF4AD /* Frameworks */,
+ 5EC5E42F2081856B000EF4AD /* Resources */,
+ A023FB55205A7EA37D413549 /* [CP] Copy Pods Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = InteropTestsLocalCleartextCFStream;
+ productName = InteropTestsLocalCleartextCFStream;
+ productReference = 5EC5E4312081856B000EF4AD /* InteropTestsLocalCleartextCFStream.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
+ 5EC5E441208185CE000EF4AD /* InteropTestsLocalSSLCFStream */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 5EC5E447208185CE000EF4AD /* Build configuration list for PBXNativeTarget "InteropTestsLocalSSLCFStream" */;
+ buildPhases = (
+ F3D5B2CDA172580341682830 /* [CP] Check Pods Manifest.lock */,
+ 5EC5E43E208185CE000EF4AD /* Sources */,
+ 5EC5E43F208185CE000EF4AD /* Frameworks */,
+ 5EC5E440208185CE000EF4AD /* Resources */,
+ 4EB2FFF40BB00AD0C545D7EF /* [CP] Copy Pods Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = InteropTestsLocalSSLCFStream;
+ productName = InteropTestsLocalSSLCFStream;
+ productReference = 5EC5E442208185CE000EF4AD /* InteropTestsLocalSSLCFStream.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
5EE84BF01D4717E40050C6CC /* InteropTestsRemoteWithCronet */ = {
isa = PBXNativeTarget;
buildConfigurationList = 5EE84BFB1D4717E40050C6CC /* Build configuration list for PBXNativeTarget "InteropTestsRemoteWithCronet" */;
@@ -496,7 +612,6 @@
63423F411B150A5F006CF63C /* Frameworks */,
63423F421B150A5F006CF63C /* Resources */,
A441F71824DCB9D0CA297748 /* [CP] Copy Pods Resources */,
- 5F14F59509E10C2852014F9E /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@@ -512,11 +627,9 @@
isa = PBXNativeTarget;
buildConfigurationList = 635697DB1B14FC11007A7283 /* Build configuration list for PBXNativeTarget "Tests" */;
buildPhases = (
- 796680C7599CB4ED736DD62A /* [CP] Check Pods Manifest.lock */,
635697C31B14FC11007A7283 /* Sources */,
635697C41B14FC11007A7283 /* Frameworks */,
635697C51B14FC11007A7283 /* CopyFiles */,
- AEEBFC914CBAEE347382E8C4 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -535,7 +648,6 @@
63DC840F1BE15179000708E8 /* Sources */,
63DC84101BE15179000708E8 /* Frameworks */,
63DC84111BE15179000708E8 /* Resources */,
- 4F5690DC0E6AD6663FE78B8B /* [CP] Embed Pods Frameworks */,
C977426A8727267BBAC7D48E /* [CP] Copy Pods Resources */,
);
buildRules = (
@@ -556,7 +668,6 @@
63DC841F1BE15267000708E8 /* Sources */,
63DC84201BE15267000708E8 /* Frameworks */,
63DC84211BE15267000708E8 /* Resources */,
- 900B6EDD4D16BE7D765C3885 /* [CP] Embed Pods Frameworks */,
C2E09DC4BD239F71160F0CC1 /* [CP] Copy Pods Resources */,
);
buildRules = (
@@ -577,7 +688,6 @@
63DC84301BE15294000708E8 /* Sources */,
63DC84311BE15294000708E8 /* Frameworks */,
63DC84321BE15294000708E8 /* Resources */,
- C591129ACE9F6CC5EE03FCDE /* [CP] Embed Pods Frameworks */,
693DD0B453431D64EA24FD66 /* [CP] Copy Pods Resources */,
);
buildRules = (
@@ -598,7 +708,6 @@
63DC843F1BE152B5000708E8 /* Sources */,
63DC84401BE152B5000708E8 /* Frameworks */,
63DC84411BE152B5000708E8 /* Resources */,
- A8E3AC66DF770B774114A30E /* [CP] Embed Pods Frameworks */,
8AD3130D3C58A0FB32FF2A36 /* [CP] Copy Pods Resources */,
);
buildRules = (
@@ -626,6 +735,18 @@
5EAD6D231E27047400002378 = {
CreatedOnToolsVersion = 7.3.1;
};
+ 5EC5E420208177CC000EF4AD = {
+ CreatedOnToolsVersion = 9.2;
+ ProvisioningStyle = Automatic;
+ };
+ 5EC5E4302081856B000EF4AD = {
+ CreatedOnToolsVersion = 9.2;
+ ProvisioningStyle = Automatic;
+ };
+ 5EC5E441208185CE000EF4AD = {
+ CreatedOnToolsVersion = 9.2;
+ ProvisioningStyle = Automatic;
+ };
5EE84BF01D4717E40050C6CC = {
CreatedOnToolsVersion = 7.3.1;
};
@@ -670,6 +791,9 @@
5E8A5DA31D3840B4000F8BC4 /* CoreCronetEnd2EndTests */,
5EE84BF01D4717E40050C6CC /* InteropTestsRemoteWithCronet */,
5EAD6D231E27047400002378 /* CronetUnitTests */,
+ 5EC5E420208177CC000EF4AD /* InteropTestsRemoteCFStream */,
+ 5EC5E4302081856B000EF4AD /* InteropTestsLocalCleartextCFStream */,
+ 5EC5E441208185CE000EF4AD /* InteropTestsLocalSSLCFStream */,
);
};
/* End PBXProject section */
@@ -689,6 +813,28 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ 5EC5E41F208177CC000EF4AD /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 5EC5E42F2081856B000EF4AD /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 5EC5E440208185CE000EF4AD /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 5EC5E44E20818948000EF4AD /* TestCertificates.bundle in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
5EE84BEF1D4717E40050C6CC /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -736,22 +882,22 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
- 051806D6A59B19C8A0B76BED /* [CP] Copy Pods Resources */ = {
+ 252A376345E38FD452A89C3D /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
- "${SRCROOT}/Pods/Target Support Files/Pods-CronetUnitTests/Pods-CronetUnitTests-resources.sh",
- "${PODS_CONFIGURATION_BUILD_DIR}/gRPC/gRPCCertificates.bundle",
+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+ "${PODS_ROOT}/Manifest.lock",
);
- name = "[CP] Copy Pods Resources";
+ name = "[CP] Check Pods Manifest.lock";
outputPaths = (
- "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/gRPCCertificates.bundle",
+ "$(DERIVED_FILE_DIR)/Pods-InteropTestsLocalCleartextCFStream-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CronetUnitTests/Pods-CronetUnitTests-resources.sh\"\n";
+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
31F8D1C407195CBF0C02929B /* [CP] Embed Pods Frameworks */ = {
@@ -772,7 +918,7 @@
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-InteropTestsRemoteWithCronet/Pods-InteropTestsRemoteWithCronet-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
- 4C406327D3907A5E5FBA8AC9 /* [CP] Check Pods Manifest.lock */ = {
+ 483CDBBAEAEFCB530ADDDDD5 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -783,29 +929,14 @@
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
- "$(DERIVED_FILE_DIR)/Pods-InteropTestsRemote-checkManifestLockResult.txt",
+ "$(DERIVED_FILE_DIR)/Pods-InteropTestsRemoteCFStream-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
- 4F5690DC0E6AD6663FE78B8B /* [CP] Embed Pods Frameworks */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- name = "[CP] Embed Pods Frameworks";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-RxLibraryUnitTests/Pods-RxLibraryUnitTests-frameworks.sh\"\n";
- showEnvVarsInLog = 0;
- };
- 5C20DCCB71C3991E6FE78C22 /* [CP] Check Pods Manifest.lock */ = {
+ 4C406327D3907A5E5FBA8AC9 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -816,53 +947,56 @@
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
- "$(DERIVED_FILE_DIR)/Pods-InteropTestsLocalSSL-checkManifestLockResult.txt",
+ "$(DERIVED_FILE_DIR)/Pods-InteropTestsRemote-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
- 5F14F59509E10C2852014F9E /* [CP] Embed Pods Frameworks */ = {
+ 4EB2FFF40BB00AD0C545D7EF /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
+ "${SRCROOT}/Pods/Target Support Files/Pods-InteropTestsLocalSSLCFStream/Pods-InteropTestsLocalSSLCFStream-resources.sh",
+ "${PODS_CONFIGURATION_BUILD_DIR}/gRPC.default-CFStream/gRPCCertificates.bundle",
);
- name = "[CP] Embed Pods Frameworks";
+ name = "[CP] Copy Pods Resources";
outputPaths = (
+ "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/gRPCCertificates.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AllTests/Pods-AllTests-frameworks.sh\"\n";
+ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-InteropTestsLocalSSLCFStream/Pods-InteropTestsLocalSSLCFStream-resources.sh\"\n";
showEnvVarsInLog = 0;
};
- 693DD0B453431D64EA24FD66 /* [CP] Copy Pods Resources */ = {
+ 5C20DCCB71C3991E6FE78C22 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
- "${SRCROOT}/Pods/Target Support Files/Pods-InteropTestsLocalSSL/Pods-InteropTestsLocalSSL-resources.sh",
- "${PODS_CONFIGURATION_BUILD_DIR}/gRPC/gRPCCertificates.bundle",
+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+ "${PODS_ROOT}/Manifest.lock",
);
- name = "[CP] Copy Pods Resources";
+ name = "[CP] Check Pods Manifest.lock";
outputPaths = (
- "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/gRPCCertificates.bundle",
+ "$(DERIVED_FILE_DIR)/Pods-InteropTestsLocalSSL-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-InteropTestsLocalSSL/Pods-InteropTestsLocalSSL-resources.sh\"\n";
+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
- 6DFE9E77CAB5760196D79E0F /* [CP] Copy Pods Resources */ = {
+ 693DD0B453431D64EA24FD66 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
- "${SRCROOT}/Pods/Target Support Files/Pods-CoreCronetEnd2EndTests/Pods-CoreCronetEnd2EndTests-resources.sh",
+ "${SRCROOT}/Pods/Target Support Files/Pods-InteropTestsLocalSSL/Pods-InteropTestsLocalSSL-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/gRPC/gRPCCertificates.bundle",
);
name = "[CP] Copy Pods Resources";
@@ -871,7 +1005,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CoreCronetEnd2EndTests/Pods-CoreCronetEnd2EndTests-resources.sh\"\n";
+ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-InteropTestsLocalSSL/Pods-InteropTestsLocalSSL-resources.sh\"\n";
showEnvVarsInLog = 0;
};
7418AC7B3844B29E48D24FC7 /* [CP] Check Pods Manifest.lock */ = {
@@ -892,24 +1026,6 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
- 796680C7599CB4ED736DD62A /* [CP] Check Pods Manifest.lock */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
- "${PODS_ROOT}/Manifest.lock",
- );
- name = "[CP] Check Pods Manifest.lock";
- outputPaths = (
- "$(DERIVED_FILE_DIR)/Pods-Tests-checkManifestLockResult.txt",
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
- showEnvVarsInLog = 0;
- };
80E2DDD2EC04A4009F45E933 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -946,21 +1062,6 @@
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-InteropTestsLocalCleartext/Pods-InteropTestsLocalCleartext-resources.sh\"\n";
showEnvVarsInLog = 0;
};
- 900B6EDD4D16BE7D765C3885 /* [CP] Embed Pods Frameworks */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- name = "[CP] Embed Pods Frameworks";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-InteropTestsRemote/Pods-InteropTestsRemote-frameworks.sh\"\n";
- showEnvVarsInLog = 0;
- };
914ADDD7106BA9BB8A7E569F /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -979,14 +1080,14 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
- A441F71824DCB9D0CA297748 /* [CP] Copy Pods Resources */ = {
+ 95FBC48B743503845678584F /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
- "${SRCROOT}/Pods/Target Support Files/Pods-AllTests/Pods-AllTests-resources.sh",
- "${PODS_CONFIGURATION_BUILD_DIR}/gRPC/gRPCCertificates.bundle",
+ "${SRCROOT}/Pods/Target Support Files/Pods-InteropTestsRemoteCFStream/Pods-InteropTestsRemoteCFStream-resources.sh",
+ "${PODS_CONFIGURATION_BUILD_DIR}/gRPC.default-CFStream/gRPCCertificates.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
@@ -994,58 +1095,61 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AllTests/Pods-AllTests-resources.sh\"\n";
+ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-InteropTestsRemoteCFStream/Pods-InteropTestsRemoteCFStream-resources.sh\"\n";
showEnvVarsInLog = 0;
};
- A686B9967BB4CB81B1CBF8F8 /* [CP] Embed Pods Frameworks */ = {
+ A023FB55205A7EA37D413549 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
- "${SRCROOT}/Pods/Target Support Files/Pods-CronetUnitTests/Pods-CronetUnitTests-frameworks.sh",
- "${PODS_ROOT}/CronetFramework/Cronet.framework",
+ "${SRCROOT}/Pods/Target Support Files/Pods-InteropTestsLocalCleartextCFStream/Pods-InteropTestsLocalCleartextCFStream-resources.sh",
+ "${PODS_CONFIGURATION_BUILD_DIR}/gRPC.default-CFStream/gRPCCertificates.bundle",
);
- name = "[CP] Embed Pods Frameworks";
+ name = "[CP] Copy Pods Resources";
outputPaths = (
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Cronet.framework",
+ "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/gRPCCertificates.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CronetUnitTests/Pods-CronetUnitTests-frameworks.sh\"\n";
+ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-InteropTestsLocalCleartextCFStream/Pods-InteropTestsLocalCleartextCFStream-resources.sh\"\n";
showEnvVarsInLog = 0;
};
- A8E3AC66DF770B774114A30E /* [CP] Embed Pods Frameworks */ = {
+ A441F71824DCB9D0CA297748 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
+ "${SRCROOT}/Pods/Target Support Files/Pods-AllTests/Pods-AllTests-resources.sh",
+ "${PODS_CONFIGURATION_BUILD_DIR}/gRPC/gRPCCertificates.bundle",
);
- name = "[CP] Embed Pods Frameworks";
+ name = "[CP] Copy Pods Resources";
outputPaths = (
+ "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/gRPCCertificates.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-InteropTestsLocalCleartext/Pods-InteropTestsLocalCleartext-frameworks.sh\"\n";
+ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AllTests/Pods-AllTests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
- AEEBFC914CBAEE347382E8C4 /* [CP] Copy Pods Resources */ = {
+ A686B9967BB4CB81B1CBF8F8 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
- "${SRCROOT}/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh",
- "${PODS_CONFIGURATION_BUILD_DIR}/gRPC/gRPCCertificates.bundle",
+ "${SRCROOT}/Pods/Target Support Files/Pods-CronetUnitTests/Pods-CronetUnitTests-frameworks.sh",
+ "${PODS_ROOT}/CronetFramework/Cronet.framework",
);
- name = "[CP] Copy Pods Resources";
+ name = "[CP] Embed Pods Frameworks";
outputPaths = (
- "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/gRPCCertificates.bundle",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Cronet.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh\"\n";
+ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CronetUnitTests/Pods-CronetUnitTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
B2986CEEE8CDD4901C97598B /* [CP] Check Pods Manifest.lock */ = {
@@ -1102,21 +1206,6 @@
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-InteropTestsRemote/Pods-InteropTestsRemote-resources.sh\"\n";
showEnvVarsInLog = 0;
};
- C591129ACE9F6CC5EE03FCDE /* [CP] Embed Pods Frameworks */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- name = "[CP] Embed Pods Frameworks";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-InteropTestsLocalSSL/Pods-InteropTestsLocalSSL-frameworks.sh\"\n";
- showEnvVarsInLog = 0;
- };
C977426A8727267BBAC7D48E /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -1171,6 +1260,24 @@
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CoreCronetEnd2EndTests/Pods-CoreCronetEnd2EndTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
+ F3D5B2CDA172580341682830 /* [CP] Check Pods Manifest.lock */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+ "${PODS_ROOT}/Manifest.lock",
+ );
+ name = "[CP] Check Pods Manifest.lock";
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/Pods-InteropTestsLocalSSLCFStream-checkManifestLockResult.txt",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
+ showEnvVarsInLog = 0;
+ };
F58F17E425446B15028B9F74 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -1208,6 +1315,34 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ 5EC5E41D208177CC000EF4AD /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 5EC5E42B2081782C000EF4AD /* InteropTestsRemote.m in Sources */,
+ 5EC5E42C20817832000EF4AD /* InteropTests.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 5EC5E42D2081856B000EF4AD /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 5EC5E43B208185A7000EF4AD /* InteropTestsLocalCleartext.m in Sources */,
+ 5EC5E43D208185B0000EF4AD /* GRPCClientTests.m in Sources */,
+ 5EC5E43C208185AD000EF4AD /* InteropTests.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 5EC5E43E208185CE000EF4AD /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 5EC5E44D208185F0000EF4AD /* InteropTestsLocalSSL.m in Sources */,
+ 5EC5E44C208185EC000EF4AD /* InteropTests.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
5EE84BED1D4717E40050C6CC /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -1350,6 +1485,7 @@
"HOST_PORT_LOCALSSL=$(HOST_PORT_LOCALSSL)",
"HOST_PORT_LOCAL=$(HOST_PORT_LOCAL)",
"HOST_PORT_REMOTE=$(HOST_PORT_REMOTE)",
+ "GRPC_TEST_OBJC=1",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
@@ -1368,7 +1504,6 @@
};
5E1228991E4D400F00E8504F /* Test */ = {
isa = XCBuildConfiguration;
- baseConfigurationReference = A0361771A855917162911180 /* Pods-Tests.test.xcconfig */;
buildSettings = {
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -1668,7 +1803,6 @@
};
5EC3C7A11D4FC18C000330E2 /* Cronet */ = {
isa = XCBuildConfiguration;
- baseConfigurationReference = F671D4CAD2864FB203B920B4 /* Pods-Tests.cronet.xcconfig */;
buildSettings = {
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -1797,6 +1931,360 @@
};
name = Cronet;
};
+ 5EC5E426208177CC000EF4AD /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 32748C4078AEB05F8F954361 /* Pods-InteropTestsRemoteCFStream.debug.xcconfig */;
+ buildSettings = {
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ CODE_SIGN_STYLE = Automatic;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ INFOPLIST_FILE = Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.2;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = io.grpc.InteropTestsRemoteCFStream;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ 5EC5E427208177CC000EF4AD /* Test */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = C17F57E5BCB989AB1C2F1F25 /* Pods-InteropTestsRemoteCFStream.test.xcconfig */;
+ buildSettings = {
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ CODE_SIGN_STYLE = Automatic;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ INFOPLIST_FILE = Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.2;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = io.grpc.InteropTestsRemoteCFStream;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Test;
+ };
+ 5EC5E428208177CC000EF4AD /* Cronet */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 4A1A42B2E941CCD453489E5B /* Pods-InteropTestsRemoteCFStream.cronet.xcconfig */;
+ buildSettings = {
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ CODE_SIGN_STYLE = Automatic;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ INFOPLIST_FILE = Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.2;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = io.grpc.InteropTestsRemoteCFStream;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Cronet;
+ };
+ 5EC5E429208177CC000EF4AD /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 303F4A17EB1650FC44603D17 /* Pods-InteropTestsRemoteCFStream.release.xcconfig */;
+ buildSettings = {
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ CODE_SIGN_STYLE = Automatic;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ INFOPLIST_FILE = Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.2;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = io.grpc.InteropTestsRemoteCFStream;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Release;
+ };
+ 5EC5E4372081856C000EF4AD /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 943138072A9605B5B8DC1FC0 /* Pods-InteropTestsLocalCleartextCFStream.debug.xcconfig */;
+ buildSettings = {
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ CODE_SIGN_STYLE = Automatic;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ INFOPLIST_FILE = Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.2;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = io.grpc.InteropTestsLocalCleartextCFStream;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ 5EC5E4382081856C000EF4AD /* Test */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = E4FD4606D4AB8D5A314D72F0 /* Pods-InteropTestsLocalCleartextCFStream.test.xcconfig */;
+ buildSettings = {
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ CODE_SIGN_STYLE = Automatic;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ INFOPLIST_FILE = Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.2;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = io.grpc.InteropTestsLocalCleartextCFStream;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Test;
+ };
+ 5EC5E4392081856C000EF4AD /* Cronet */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 8B498B05C6DA0818B2FA91D4 /* Pods-InteropTestsLocalCleartextCFStream.cronet.xcconfig */;
+ buildSettings = {
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ CODE_SIGN_STYLE = Automatic;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ INFOPLIST_FILE = Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.2;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = io.grpc.InteropTestsLocalCleartextCFStream;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Cronet;
+ };
+ 5EC5E43A2081856C000EF4AD /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 7BA53C6D224288D5870FE6F3 /* Pods-InteropTestsLocalCleartextCFStream.release.xcconfig */;
+ buildSettings = {
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ CODE_SIGN_STYLE = Automatic;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ INFOPLIST_FILE = Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.2;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = io.grpc.InteropTestsLocalCleartextCFStream;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Release;
+ };
+ 5EC5E448208185CE000EF4AD /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 3EB55EF291706E3DDE23C3B7 /* Pods-InteropTestsLocalSSLCFStream.debug.xcconfig */;
+ buildSettings = {
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ CODE_SIGN_STYLE = Automatic;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ INFOPLIST_FILE = Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.2;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = io.grpc.InteropTestsLocalSSLCFStream;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ 5EC5E449208185CE000EF4AD /* Test */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 41AA59529240A6BBBD3DB904 /* Pods-InteropTestsLocalSSLCFStream.test.xcconfig */;
+ buildSettings = {
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ CODE_SIGN_STYLE = Automatic;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ INFOPLIST_FILE = Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.2;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = io.grpc.InteropTestsLocalSSLCFStream;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Test;
+ };
+ 5EC5E44A208185CE000EF4AD /* Cronet */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 55B630C1FF8C36D1EFC4E0A4 /* Pods-InteropTestsLocalSSLCFStream.cronet.xcconfig */;
+ buildSettings = {
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ CODE_SIGN_STYLE = Automatic;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ INFOPLIST_FILE = Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.2;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = io.grpc.InteropTestsLocalSSLCFStream;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Cronet;
+ };
+ 5EC5E44B208185CE000EF4AD /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 5EA908CF4CDA4CE218352A06 /* Pods-InteropTestsLocalSSLCFStream.release.xcconfig */;
+ buildSettings = {
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ CODE_SIGN_STYLE = Automatic;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ INFOPLIST_FILE = Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.2;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = io.grpc.InteropTestsLocalSSLCFStream;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Release;
+ };
5EE84BF91D4717E40050C6CC /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 17F60BF2871F6AF85FB3FA12 /* Pods-InteropTestsRemoteWithCronet.debug.xcconfig */;
@@ -1953,7 +2441,6 @@
};
635697DC1B14FC11007A7283 /* Debug */ = {
isa = XCBuildConfiguration;
- baseConfigurationReference = 060EF32D7EC0DF67ED617507 /* Pods-Tests.debug.xcconfig */;
buildSettings = {
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -1963,7 +2450,6 @@
};
635697DD1B14FC11007A7283 /* Release */ = {
isa = XCBuildConfiguration;
- baseConfigurationReference = E6733B838B28453434B556E2 /* Pods-Tests.release.xcconfig */;
buildSettings = {
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -2100,6 +2586,39 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
+ 5EC5E42A208177CD000EF4AD /* Build configuration list for PBXNativeTarget "InteropTestsRemoteCFStream" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 5EC5E426208177CC000EF4AD /* Debug */,
+ 5EC5E427208177CC000EF4AD /* Test */,
+ 5EC5E428208177CC000EF4AD /* Cronet */,
+ 5EC5E429208177CC000EF4AD /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 5EC5E4362081856C000EF4AD /* Build configuration list for PBXNativeTarget "InteropTestsLocalCleartextCFStream" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 5EC5E4372081856C000EF4AD /* Debug */,
+ 5EC5E4382081856C000EF4AD /* Test */,
+ 5EC5E4392081856C000EF4AD /* Cronet */,
+ 5EC5E43A2081856C000EF4AD /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 5EC5E447208185CE000EF4AD /* Build configuration list for PBXNativeTarget "InteropTestsLocalSSLCFStream" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 5EC5E448208185CE000EF4AD /* Debug */,
+ 5EC5E449208185CE000EF4AD /* Test */,
+ 5EC5E44A208185CE000EF4AD /* Cronet */,
+ 5EC5E44B208185CE000EF4AD /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
5EE84BFB1D4717E40050C6CC /* Build configuration list for PBXNativeTarget "InteropTestsRemoteWithCronet" */ = {
isa = XCConfigurationList;
buildConfigurations = (
diff --git a/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/AllTests.xcscheme b/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/AllTests.xcscheme
index a2560fee02..b0bb933764 100644
--- a/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/AllTests.xcscheme
+++ b/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/AllTests.xcscheme
@@ -26,6 +26,7 @@
buildConfiguration = "Test"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
@@ -66,6 +67,7 @@
buildConfiguration = "Test"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
diff --git a/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsLocalCleartext.xcscheme b/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsLocalCleartext.xcscheme
index 6d85b62fab..510115fc75 100644
--- a/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsLocalCleartext.xcscheme
+++ b/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsLocalCleartext.xcscheme
@@ -26,6 +26,7 @@
buildConfiguration = "Test"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
@@ -57,6 +58,7 @@
buildConfiguration = "Test"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
diff --git a/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsLocalCleartextCFStream.xcscheme b/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsLocalCleartextCFStream.xcscheme
new file mode 100644
index 0000000000..fe766de928
--- /dev/null
+++ b/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsLocalCleartextCFStream.xcscheme
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0920"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ </BuildAction>
+ <TestAction
+ buildConfiguration = "Test"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ language = ""
+ shouldUseLaunchSchemeArgsEnv = "YES">
+ <Testables>
+ <TestableReference
+ skipped = "NO">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "5EC5E4302081856B000EF4AD"
+ BuildableName = "InteropTestsLocalCleartextCFStream.xctest"
+ BlueprintName = "InteropTestsLocalCleartextCFStream"
+ ReferencedContainer = "container:Tests.xcodeproj">
+ </BuildableReference>
+ <SkippedTests>
+ <Test
+ Identifier = "InteropTests">
+ </Test>
+ </SkippedTests>
+ </TestableReference>
+ </Testables>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </TestAction>
+ <LaunchAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ language = ""
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
+ allowLocationSimulation = "YES">
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ buildConfiguration = "Release"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ debugDocumentVersioning = "YES">
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
diff --git a/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsLocalSSLCFStream.xcscheme b/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsLocalSSLCFStream.xcscheme
new file mode 100644
index 0000000000..bd66327649
--- /dev/null
+++ b/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsLocalSSLCFStream.xcscheme
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0920"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ </BuildAction>
+ <TestAction
+ buildConfiguration = "Test"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ language = ""
+ shouldUseLaunchSchemeArgsEnv = "YES">
+ <Testables>
+ <TestableReference
+ skipped = "NO">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "5EC5E441208185CE000EF4AD"
+ BuildableName = "InteropTestsLocalSSLCFStream.xctest"
+ BlueprintName = "InteropTestsLocalSSLCFStream"
+ ReferencedContainer = "container:Tests.xcodeproj">
+ </BuildableReference>
+ <SkippedTests>
+ <Test
+ Identifier = "InteropTests">
+ </Test>
+ </SkippedTests>
+ </TestableReference>
+ </Testables>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </TestAction>
+ <LaunchAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ language = ""
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
+ allowLocationSimulation = "YES">
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ buildConfiguration = "Release"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ debugDocumentVersioning = "YES">
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
diff --git a/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsRemote.xcscheme b/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsRemote.xcscheme
index 412bf6a014..48837e57f9 100644
--- a/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsRemote.xcscheme
+++ b/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsRemote.xcscheme
@@ -26,6 +26,7 @@
buildConfiguration = "Test"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
@@ -60,6 +61,7 @@
buildConfiguration = "Test"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
diff --git a/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsRemoteCFStream.xcscheme b/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsRemoteCFStream.xcscheme
new file mode 100644
index 0000000000..33a5ded038
--- /dev/null
+++ b/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsRemoteCFStream.xcscheme
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0920"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ </BuildAction>
+ <TestAction
+ buildConfiguration = "Test"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES">
+ <Testables>
+ <TestableReference
+ skipped = "NO">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "5EC5E420208177CC000EF4AD"
+ BuildableName = "InteropTestsRemoteCFStream.xctest"
+ BlueprintName = "InteropTestsRemoteCFStream"
+ ReferencedContainer = "container:Tests.xcodeproj">
+ </BuildableReference>
+ <SkippedTests>
+ <Test
+ Identifier = "InteropTests">
+ </Test>
+ </SkippedTests>
+ </TestableReference>
+ </Testables>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </TestAction>
+ <LaunchAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
+ allowLocationSimulation = "YES">
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ buildConfiguration = "Release"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ debugDocumentVersioning = "YES">
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
diff --git a/src/objective-c/tests/analyze_link_map.py b/src/objective-c/tests/analyze_link_map.py
deleted file mode 100755
index 48e3441087..0000000000
--- a/src/objective-c/tests/analyze_link_map.py
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/usr/bin/python
-# Copyright 2018 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# This script analyzes link map file generated by Xcode. It calculates and
-# prints out the sizes of each dependent library and the total sizes of the
-# symbols.
-# The script takes one parameter, which is the path to the link map file.
-
-import sys
-import re
-
-table_tag = {}
-state = "start"
-
-table_stats_symbol = {}
-table_stats_dead = {}
-section_total_size = 0
-symbol_total_size = 0
-
-
-file_import = sys.argv[1]
-lines = list(open(file_import))
-for line in lines:
- line_stripped = line[:-1]
- if "# Object files:" == line_stripped:
- state = "object"
- continue
- elif "# Sections:" == line_stripped:
- state = "section"
- continue
- elif "# Symbols:" == line_stripped:
- state = "symbol"
- continue
- elif "# Dead Stripped Symbols:" == line_stripped:
- state = "dead"
- continue
-
- if state == "object":
- segs = re.search('(\[ *[0-9]*\]) (.*)', line_stripped)
- table_tag[segs.group(1)] = segs.group(2)
-
- if state == "section":
- if len(line_stripped) == 0 or line_stripped[0] == '#':
- continue
- segs = re.search('^(.+?)\s+(.+?)\s+.*', line_stripped)
- section_total_size += int(segs.group(2), 16)
-
- if state == "symbol":
- if len(line_stripped) == 0 or line_stripped[0] == '#':
- continue
- segs = re.search('^.+?\s+(.+?)\s+(\[.+?\]).*', line_stripped)
- target = table_tag[segs.group(2)]
- target_stripped = re.search('^(.*?)(\(.+?\))?$', target).group(1)
- size = int(segs.group(1), 16)
- if not target_stripped in table_stats_symbol:
- table_stats_symbol[target_stripped] = 0
- table_stats_symbol[target_stripped] += size
-
-print("Sections total size: %d" % section_total_size)
-
-for target in table_stats_symbol:
- print(target)
- print(table_stats_symbol[target])
- symbol_total_size += table_stats_symbol[target]
-
-print("Symbols total size: %d" % symbol_total_size)
diff --git a/src/objective-c/tests/build_one_example.sh b/src/objective-c/tests/build_one_example.sh
index 985d55f3cc..1eace541e6 100755
--- a/src/objective-c/tests/build_one_example.sh
+++ b/src/objective-c/tests/build_one_example.sh
@@ -42,6 +42,9 @@ xcodebuild \
build \
-workspace *.xcworkspace \
-scheme $SCHEME \
- -destination name="iPhone 6" \
+ -destination generic/platform=iOS \
+ -derivedDataPath Build \
+ CODE_SIGN_IDENTITY="" \
+ CODE_SIGNING_REQUIRED=NO \
| egrep -v "$XCODEBUILD_FILTER" \
| egrep -v "^$" -
diff --git a/src/objective-c/tests/run_tests.sh b/src/objective-c/tests/run_tests.sh
index 2fe2326207..9dde07d55c 100755
--- a/src/objective-c/tests/run_tests.sh
+++ b/src/objective-c/tests/run_tests.sh
@@ -53,7 +53,7 @@ while [ $retries -lt 3 ]; do
out=$(xcodebuild \
-workspace Tests.xcworkspace \
-scheme AllTests \
- -destination name="iPhone 6" \
+ -destination name="iPhone 8" \
HOST_PORT_LOCALSSL=localhost:5051 \
HOST_PORT_LOCAL=localhost:5050 \
HOST_PORT_REMOTE=grpc-test.sandbox.googleapis.com \
@@ -83,7 +83,7 @@ echo "TIME: $(date)"
xcodebuild \
-workspace Tests.xcworkspace \
-scheme CoreCronetEnd2EndTests \
- -destination name="iPhone 6" \
+ -destination name="iPhone 8" \
test \
| egrep -v "$XCODEBUILD_FILTER" \
| egrep -v '^$' \
@@ -113,7 +113,7 @@ echo "TIME: $(date)"
xcodebuild \
-workspace Tests.xcworkspace \
-scheme CronetUnitTests \
- -destination name="iPhone 6" \
+ -destination name="iPhone 8" \
test \
| egrep -v "$XCODEBUILD_FILTER" \
| egrep -v '^$' \
@@ -123,11 +123,44 @@ echo "TIME: $(date)"
xcodebuild \
-workspace Tests.xcworkspace \
-scheme InteropTestsRemoteWithCronet \
- -destination name="iPhone 6" \
+ -destination name="iPhone 8" \
+ HOST_PORT_REMOTE=grpc-test.sandbox.googleapis.com \
+ test \
+ | egrep -v "$XCODEBUILD_FILTER" \
+ | egrep -v '^$' \
+ | egrep -v "(GPBDictionary|GPBArray)" -
+
+echo "TIME: $(date)"
+xcodebuild \
+ -workspace Tests.xcworkspace \
+ -scheme InteropTestsRemoteCFStream \
+ -destination name="iPhone 8" \
HOST_PORT_REMOTE=grpc-test.sandbox.googleapis.com \
test \
| egrep -v "$XCODEBUILD_FILTER" \
| egrep -v '^$' \
| egrep -v "(GPBDictionary|GPBArray)" -
+echo "TIME: $(date)"
+xcodebuild \
+ -workspace Tests.xcworkspace \
+ -scheme InteropTestsLocalCleartextCFStream \
+ -destination name="iPhone 8" \
+ HOST_PORT_LOCAL=localhost:5050 \
+ test \
+ | egrep -v "$XCODEBUILD_FILTER" \
+ | egrep -v '^$' \
+ | egrep -v "(GPBDictionary|GPBArray)" -
+
+echo "TIME: $(date)"
+xcodebuild \
+ -workspace Tests.xcworkspace \
+ -scheme InteropTestsLocalSSLCFStream \
+ -destination name="iPhone 8" \
+ HOST_PORT_LOCALSSL=localhost:5051 \
+ test \
+ | egrep -v "$XCODEBUILD_FILTER" \
+ | egrep -v '^$' \
+ | egrep -v "(GPBDictionary|GPBArray)" -
+
exit 0
diff --git a/src/objective-c/tests/version.h b/src/objective-c/tests/version.h
index e9637099d9..fafcac6507 100644
--- a/src/objective-c/tests/version.h
+++ b/src/objective-c/tests/version.h
@@ -22,5 +22,5 @@
// instead. This file can be regenerated from the template by running
// `tools/buildgen/generate_projects.sh`.
-#define GRPC_OBJC_VERSION_STRING @"1.13.0-dev"
+#define GRPC_OBJC_VERSION_STRING @"1.14.0-dev"
#define GRPC_C_VERSION_STRING @"6.0.0-dev"
diff --git a/src/php/README.md b/src/php/README.md
index 11f99e134c..5e9fa38763 100644
--- a/src/php/README.md
+++ b/src/php/README.md
@@ -2,11 +2,15 @@
# Overview
This directory contains source code for PHP implementation of gRPC layered on
-shared C library.
+shared C library. The same installation guides with more examples and
+tutorials can be seen at [grpc.io](https://grpc.io/docs/quickstart/php.html).
+gRPC PHP installation instructions for Google Cloud Platform is in
+[cloud.google.com](https://cloud.google.com/php/grpc).
## Environment
-**Prerequisite:**
+### Prerequisite:
+
* `php` 5.5 or above, 7.0 or above
* `pecl`
* `composer`
@@ -25,6 +29,10 @@ For PHP7:
```sh
$ sudo apt-get install php7.0 php7.0-dev php-pear phpunit
```
+or
+```sh
+$ sudo apt-get install php php-dev php-pear phpunit
+```
**Install PHP and PECL on CentOS/RHEL 7:**
```sh
@@ -33,8 +41,9 @@ $ sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
$ sudo yum install php56w php56w-devel php-pear phpunit gcc zlib-devel
```
-**Install PECL on Mac:**
+**Install PHP and PECL on Mac:**
```sh
+$ brew install homebrew/php/php56-grpc
$ curl -O http://pear.php.net/go-pear.phar
$ sudo php -d detect_unicode=0 go-pear.phar
```
@@ -52,50 +61,33 @@ $ chmod +x phpunit-old.phar
$ sudo mv phpunit-old.phar /usr/bin/phpunit
```
-## Quick Install
+## Install the gRPC PHP extension
-**Install the gRPC PHP extension**
+There are two ways to install gRPC PHP extension.
+* `pecl`
+* `build from source`
+
+### Using PECL
```sh
sudo pecl install grpc
```
-This will compile and install the gRPC PHP extension into the standard PHP
-extension directory. You should be able to run the [unit tests](#unit-tests),
-with the PHP extension installed.
-
-Note: For users on CentOS/RHEL 6, unfortunately this step won't work. Please
-follow the instructions below to compile the extension from source.
-
-
-**Update php.ini**
-
-Add this line to your `php.ini` file, e.g. `/etc/php5/cli/php.ini`
+or specific version
```sh
-extension=grpc.so
-```
-
-
-**Add the gRPC PHP library as a Composer dependency**
-
-You need to add this to your project's `composer.json` file.
-
-```
- "require": {
- "grpc/grpc": "v1.1.0"
- }
+sudo pecl install grpc-1.12.0
```
-To run tests with generated stub code from `.proto` files, you will also need
-the `composer` and `protoc` binaries. You can find out how to get these
-[below](#generated-code-tests).
+Note: for users on CentOS/RHEL 6, unfortunately this step won’t work.
+Please follow the instructions below to compile the PECL extension from source.
+#### Install on Windows
-## Build from Source
+You can download the pre-compiled gRPC extension from the PECL
+[website](https://pecl.php.net/package/grpc)
-
-### gRPC C core library
+### Build from Source with gRPC C core library
Clone this repository
@@ -103,16 +95,16 @@ Clone this repository
$ git clone -b $(curl -L https://grpc.io/release) https://github.com/grpc/grpc
```
-Build and install the gRPC C core library
+#### Build and install the gRPC C core library
```sh
$ cd grpc
-$ git pull --recurse-submodules && git submodule update --init --recursive
+$ git submodule update --init
$ make
$ sudo make install
```
-### gRPC PHP extension
+#### Build and install gRPC PHP extension
Compile the gRPC PHP extension
@@ -124,44 +116,69 @@ $ make
$ sudo make install
```
-## Unit Tests
+This will compile and install the gRPC PHP extension into the
+standard PHP extension directory. You should be able to run
+the [unit tests](#unit-tests), with the PHP extension installed.
-You will need the source code to run tests
+
+### Update php.ini
+
+After installing the gRPC extension, make sure you add this line
+to your `php.ini` file, (e.g. `/etc/php5/cli/php.ini`,
+`/etc/php5/apache2/php.ini`, or `/usr/local/etc/php/5.6/php.ini`),
+depending on where your PHP installation is.
```sh
-$ git clone -b $(curl -L https://grpc.io/release) https://github.com/grpc/grpc
-$ cd grpc
-$ git pull --recurse-submodules && git submodule update --init --recursive
+extension=grpc.so
```
-Run unit tests
+**Add the gRPC PHP library as a Composer dependency**
-```sh
-$ cd grpc/src/php
-$ ./bin/run_tests.sh
+You need to add this to your project's `composer.json` file.
+
+```
+ "require": {
+ "grpc/grpc": "v1.12.0"
+ }
```
-## Generated Code Tests
+To run tests with generated stub code from `.proto` files, you will also
+need the `composer` and `protoc` binaries. You can find out how to get these below.
-This section specifies the prerequisites for running the generated code tests,
-as well as how to run the tests themselves.
+## Install other prerequisites for both Mac OS X and Linux
-### Composer
+* `protoc: protobuf compiler`
+* `protobuf.so: protobuf runtime library`
+* `grpc_php_plugin: Generates PHP gRPC service interface out of Protobuf IDL`
-Install the runtime dependencies via `composer install`.
+### Install Protobuf compiler
-```sh
-$ cd grpc/src/php
-$ composer install
-```
+If you don't have it already, you need to install the protobuf compiler
+`protoc`, version 3.5.0+ (the newer the better) for the current gRPC version.
+If you installed already, make the protobuf version is compatible to the
+grpc version you installed. If you build grpc.so from the souce, you can check
+the version of grpc inside package.xml file.
-### Protobuf compiler
+The compatibility between the grpc and protobuf version is listed as table below:
-Again if you don't have it already, you need to install the protobuf compiler
-`protoc`, version 3.1.0+ (the newer the better).
+grpc | protobuf
+--- | ---
+v1.0.0 | 3.0.0(GA)
+v1.0.1 | 3.0.2
+v1.1.0 | 3.1.0
+v1.2.0 | 3.2.0
+v1.2.0 | 3.2.0
+v1.3.4 | 3.3.0
+v1.3.5 | 3.2.0
+v1.4.0 | 3.3.0
+v1.6.0 | 3.4.0
+v1.8.0 | 3.5.0
+v1.12.0 | 3.5.2
If `protoc` hasn't been installed, you can download the `protoc` binaries from
[the protocol buffers Github repository](https://github.com/google/protobuf/releases).
+Then unzip this file and update the environment variable `PATH` to include the path to
+the protoc binary file.
If you really must compile `protoc` from source, you can run the following
commands, but this is risky because there is no easy way to uninstall /
@@ -173,32 +190,44 @@ $ ./autogen.sh && ./configure && make
$ sudo make install
```
-
### Protobuf Runtime library
-There are two protobuf runtime libraries to choose from. They are idenfical in terms of APIs offered.
+There are two protobuf runtime libraries to choose from. They are identical
+in terms of APIs offered. The C implementation provides better performance,
+while the native implementation is easier to install. Make sure the installed
+protobuf version works with grpc version.
-1. C implementation (for better performance)
+#### 1. C implementation (for better performance)
``` sh
$ sudo pecl install protobuf
```
+or specific version
-2. PHP implementation (for easier installation)
+``` sh
+$ sudo pecl install protobuf-3.5.1.1
+```
+Add this to your `php.ini` file:
+
+```sh
+extension=protobuf.so
+```
+
+#### 2. PHP implementation (for easier installation)
Add this to your `composer.json` file:
```
"require": {
- "google/protobuf": "^v3.3.0"
+ "google/protobuf": "^v3.5.0"
}
-```
-
+```
### PHP Protoc Plugin
You need the gRPC PHP protoc plugin to generate the client stub classes.
+It can generate server and client code from .proto service definitions.
It should already been compiled when you run `make` from the root directory
of this repo. The plugin can be found in the `bins/opt` directory. We are
@@ -208,10 +237,47 @@ in the future.
You can also just build the gRPC PHP protoc plugin by running:
```sh
+$ git clone -b $(curl -L https://grpc.io/release) https://github.com/grpc/grpc
$ cd grpc
+$ git submodule update --init
$ make grpc_php_plugin
```
+Plugin may use the new feature of the new protobuf version, thus please also
+make sure that the protobuf version installed is compatible with the grpc version
+you build this plugin.
+
+## Unit Tests
+
+You will need the source code to run tests
+
+```sh
+$ git clone -b $(curl -L https://grpc.io/release) https://github.com/grpc/grpc
+$ cd grpc
+$ git submodule update --init
+```
+
+Run unit tests
+
+```sh
+$ cd grpc/src/php
+$ ./bin/run_tests.sh
+```
+
+## Generated Code Tests
+
+This section specifies the prerequisites for running the generated code tests,
+as well as how to run the tests themselves.
+
+### Composer
+
+Install the runtime dependencies via `composer install`.
+
+```sh
+$ cd grpc/src/php
+$ composer install
+```
+
### Client Stub
diff --git a/src/php/composer.json b/src/php/composer.json
index 03dffb40ab..94918417d9 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": "Apache-2.0",
- "version": "1.13.0",
+ "version": "1.14.0",
"require": {
"php": ">=5.5.0",
"google/protobuf": "^v3.3.0"
diff --git a/src/php/ext/grpc/channel_credentials.c b/src/php/ext/grpc/channel_credentials.c
index 10d7380ca1..af1372878d 100644
--- a/src/php/ext/grpc/channel_credentials.c
+++ b/src/php/ext/grpc/channel_credentials.c
@@ -158,7 +158,7 @@ PHP_METHOD(ChannelCredentials, createSsl) {
grpc_channel_credentials *creds = grpc_ssl_credentials_create(
pem_root_certs,
- pem_key_cert_pair.private_key == NULL ? NULL : &pem_key_cert_pair, NULL);
+ pem_key_cert_pair.private_key == NULL ? NULL : &pem_key_cert_pair, NULL, NULL);
zval *creds_object = grpc_php_wrap_channel_credentials(creds, hashstr, false
TSRMLS_CC);
efree(hashkey);
diff --git a/src/php/ext/grpc/version.h b/src/php/ext/grpc/version.h
index 407d6347e6..c985863cb5 100644
--- a/src/php/ext/grpc/version.h
+++ b/src/php/ext/grpc/version.h
@@ -20,6 +20,6 @@
#ifndef VERSION_H
#define VERSION_H
-#define PHP_GRPC_VERSION "1.13.0dev"
+#define PHP_GRPC_VERSION "1.14.0dev"
#endif /* VERSION_H */
diff --git a/src/php/lib/Grpc/BaseStub.php b/src/php/lib/Grpc/BaseStub.php
index b9c50b1da6..5ae6931b99 100644
--- a/src/php/lib/Grpc/BaseStub.php
+++ b/src/php/lib/Grpc/BaseStub.php
@@ -232,12 +232,13 @@ class BaseStub
*
* @return \Closure
*/
- private function _GrpcUnaryUnary($channel, $deserialize)
+ private function _GrpcUnaryUnary($channel)
{
return function ($method,
$argument,
+ $deserialize,
array $metadata = [],
- array $options = []) use ($channel, $deserialize) {
+ array $options = []) use ($channel) {
$call = new UnaryCall(
$channel,
$method,
@@ -268,11 +269,12 @@ class BaseStub
*
* @return \Closure
*/
- private function _GrpcStreamUnary($channel, $deserialize)
+ private function _GrpcStreamUnary($channel)
{
return function ($method,
+ $deserialize,
array $metadata = [],
- array $options = []) use ($channel, $deserialize) {
+ array $options = []) use ($channel) {
$call = new ClientStreamingCall(
$channel,
$method,
@@ -303,12 +305,13 @@ class BaseStub
*
* @return \Closure
*/
- private function _GrpcUnaryStream($channel, $deserialize)
+ private function _GrpcUnaryStream($channel)
{
return function ($method,
$argument,
+ $deserialize,
array $metadata = [],
- array $options = []) use ($channel, $deserialize) {
+ array $options = []) use ($channel) {
$call = new ServerStreamingCall(
$channel,
$method,
@@ -339,11 +342,12 @@ class BaseStub
*
* @return \Closure
*/
- private function _GrpcStreamStream($channel, $deserialize)
+ private function _GrpcStreamStream($channel)
{
return function ($method,
+ $deserialize,
array $metadata = [],
- array $options = []) use ($channel ,$deserialize) {
+ array $options = []) use ($channel) {
$call = new BidiStreamingCall(
$channel,
$method,
@@ -375,23 +379,25 @@ class BaseStub
*
* @return \Closure
*/
- private function _UnaryUnaryCallFactory($channel, $deserialize)
+ private function _UnaryUnaryCallFactory($channel)
{
if (is_a($channel, 'Grpc\Internal\InterceptorChannel')) {
return function ($method,
$argument,
+ $deserialize,
array $metadata = [],
- array $options = []) use ($channel, $deserialize) {
+ array $options = []) use ($channel) {
return $channel->getInterceptor()->interceptUnaryUnary(
$method,
$argument,
+ $deserialize,
$metadata,
$options,
- $this->_UnaryUnaryCallFactory($channel->getNext(), $deserialize)
+ $this->_UnaryUnaryCallFactory($channel->getNext())
);
};
}
- return $this->_GrpcUnaryUnary($channel, $deserialize);
+ return $this->_GrpcUnaryUnary($channel);
}
/**
@@ -402,23 +408,25 @@ class BaseStub
*
* @return \Closure
*/
- private function _UnaryStreamCallFactory($channel, $deserialize)
+ private function _UnaryStreamCallFactory($channel)
{
if (is_a($channel, 'Grpc\Internal\InterceptorChannel')) {
return function ($method,
$argument,
+ $deserialize,
array $metadata = [],
- array $options = []) use ($channel, $deserialize) {
+ array $options = []) use ($channel) {
return $channel->getInterceptor()->interceptUnaryStream(
$method,
$argument,
+ $deserialize,
$metadata,
$options,
- $this->_UnaryStreamCallFactory($channel->getNext(), $deserialize)
+ $this->_UnaryStreamCallFactory($channel->getNext())
);
};
}
- return $this->_GrpcUnaryStream($channel, $deserialize);
+ return $this->_GrpcUnaryStream($channel);
}
/**
@@ -429,21 +437,23 @@ class BaseStub
*
* @return \Closure
*/
- private function _StreamUnaryCallFactory($channel, $deserialize)
+ private function _StreamUnaryCallFactory($channel)
{
if (is_a($channel, 'Grpc\Internal\InterceptorChannel')) {
return function ($method,
+ $deserialize,
array $metadata = [],
- array $options = []) use ($channel, $deserialize) {
+ array $options = []) use ($channel) {
return $channel->getInterceptor()->interceptStreamUnary(
$method,
+ $deserialize,
$metadata,
$options,
- $this->_StreamUnaryCallFactory($channel->getNext(), $deserialize)
+ $this->_StreamUnaryCallFactory($channel->getNext())
);
};
}
- return $this->_GrpcStreamUnary($channel, $deserialize);
+ return $this->_GrpcStreamUnary($channel);
}
/**
@@ -454,21 +464,23 @@ class BaseStub
*
* @return \Closure
*/
- private function _StreamStreamCallFactory($channel, $deserialize)
+ private function _StreamStreamCallFactory($channel)
{
if (is_a($channel, 'Grpc\Internal\InterceptorChannel')) {
return function ($method,
+ $deserialize,
array $metadata = [],
- array $options = []) use ($channel, $deserialize) {
+ array $options = []) use ($channel) {
return $channel->getInterceptor()->interceptStreamStream(
$method,
+ $deserialize,
$metadata,
$options,
- $this->_StreamStreamCallFactory($channel->getNext(), $deserialize)
+ $this->_StreamStreamCallFactory($channel->getNext())
);
};
}
- return $this->_GrpcStreamStream($channel, $deserialize);
+ return $this->_GrpcStreamStream($channel);
}
/* This class is intended to be subclassed by generated code, so
@@ -493,8 +505,8 @@ class BaseStub
array $metadata = [],
array $options = []
) {
- $call_factory = $this->_UnaryUnaryCallFactory($this->channel, $deserialize);
- $call = $call_factory($method, $argument, $metadata, $options);
+ $call_factory = $this->_UnaryUnaryCallFactory($this->channel);
+ $call = $call_factory($method, $argument, $deserialize, $metadata, $options);
return $call;
}
@@ -516,8 +528,8 @@ class BaseStub
array $metadata = [],
array $options = []
) {
- $call_factory = $this->_StreamUnaryCallFactory($this->channel, $deserialize);
- $call = $call_factory($method, $metadata, $options);
+ $call_factory = $this->_StreamUnaryCallFactory($this->channel);
+ $call = $call_factory($method, $deserialize, $metadata, $options);
return $call;
}
@@ -541,8 +553,8 @@ class BaseStub
array $metadata = [],
array $options = []
) {
- $call_factory = $this->_UnaryStreamCallFactory($this->channel, $deserialize);
- $call = $call_factory($method, $argument, $metadata, $options);
+ $call_factory = $this->_UnaryStreamCallFactory($this->channel);
+ $call = $call_factory($method, $argument, $deserialize, $metadata, $options);
return $call;
}
@@ -563,8 +575,8 @@ class BaseStub
array $metadata = [],
array $options = []
) {
- $call_factory = $this->_StreamStreamCallFactory($this->channel, $deserialize);
- $call = $call_factory($method, $metadata, $options);
+ $call_factory = $this->_StreamStreamCallFactory($this->channel);
+ $call = $call_factory($method, $deserialize, $metadata, $options);
return $call;
}
}
diff --git a/src/php/lib/Grpc/Interceptor.php b/src/php/lib/Grpc/Interceptor.php
index e1b97f2a84..475f017d3d 100644
--- a/src/php/lib/Grpc/Interceptor.php
+++ b/src/php/lib/Grpc/Interceptor.php
@@ -21,6 +21,8 @@ namespace Grpc;
/**
* Represents an interceptor that intercept RPC invocations before call starts.
+ * There is one proposal related to the argument $deserialize under the review.
+ * The proposal link is https://github.com/grpc/proposal/pull/86.
* This is an EXPERIMENTAL API.
*/
class Interceptor
@@ -28,39 +30,43 @@ class Interceptor
public function interceptUnaryUnary(
$method,
$argument,
+ $deserialize,
array $metadata = [],
array $options = [],
$continuation
) {
- return $continuation($method, $argument, $metadata, $options);
+ return $continuation($method, $argument, $deserialize, $metadata, $options);
}
public function interceptStreamUnary(
$method,
+ $deserialize,
array $metadata = [],
array $options = [],
$continuation
) {
- return $continuation($method, $metadata, $options);
+ return $continuation($method, $deserialize, $metadata, $options);
}
public function interceptUnaryStream(
$method,
$argument,
+ $deserialize,
array $metadata = [],
array $options = [],
$continuation
) {
- return $continuation($method, $argument, $metadata, $options);
+ return $continuation($method, $argument, $deserialize, $metadata, $options);
}
public function interceptStreamStream(
$method,
+ $deserialize,
array $metadata = [],
array $options = [],
$continuation
) {
- return $continuation($method, $metadata, $options);
+ return $continuation($method, $deserialize, $metadata, $options);
}
/**
diff --git a/src/php/tests/unit_tests/InterceptorTest.php b/src/php/tests/unit_tests/InterceptorTest.php
index d18c27c2c7..d759ceba6a 100644
--- a/src/php/tests/unit_tests/InterceptorTest.php
+++ b/src/php/tests/unit_tests/InterceptorTest.php
@@ -94,17 +94,18 @@ class ChangeMetadataInterceptor extends Grpc\Interceptor
{
public function interceptUnaryUnary($method,
$argument,
+ $deserialize,
array $metadata = [],
array $options = [],
$continuation)
{
$metadata["foo"] = array('interceptor_from_unary_request');
- return $continuation($method, $argument, $metadata, $options);
+ return $continuation($method, $argument, $deserialize, $metadata, $options);
}
- public function interceptStreamUnary($method, array $metadata = [], array $options = [], $continuation)
+ public function interceptStreamUnary($method, $deserialize, array $metadata = [], array $options = [], $continuation)
{
$metadata["foo"] = array('interceptor_from_stream_request');
- return $continuation($method, $metadata, $options);
+ return $continuation($method, $deserialize, $metadata, $options);
}
}
@@ -112,6 +113,7 @@ class ChangeMetadataInterceptor2 extends Grpc\Interceptor
{
public function interceptUnaryUnary($method,
$argument,
+ $deserialize,
array $metadata = [],
array $options = [],
$continuation)
@@ -121,9 +123,10 @@ class ChangeMetadataInterceptor2 extends Grpc\Interceptor
} else {
$metadata["bar"] = array('interceptor_from_unary_request');
}
- return $continuation($method, $argument, $metadata, $options);
+ return $continuation($method, $argument, $deserialize, $metadata, $options);
}
public function interceptStreamUnary($method,
+ $deserialize,
array $metadata = [],
array $options = [],
$continuation)
@@ -133,7 +136,7 @@ class ChangeMetadataInterceptor2 extends Grpc\Interceptor
} else {
$metadata["bar"] = array('interceptor_from_stream_request');
}
- return $continuation($method, $metadata, $options);
+ return $continuation($method, $deserialize, $metadata, $options);
}
}
@@ -166,17 +169,18 @@ class ChangeRequestInterceptor extends Grpc\Interceptor
{
public function interceptUnaryUnary($method,
$argument,
+ $deserialize,
array $metadata = [],
array $options = [],
$continuation)
{
$argument->setData('intercepted_unary_request');
- return $continuation($method, $argument, $metadata, $options);
+ return $continuation($method, $argument, $deserialize, $metadata, $options);
}
- public function interceptStreamUnary($method, array $metadata = [], array $options = [], $continuation)
+ public function interceptStreamUnary($method, $deserialize, array $metadata = [], array $options = [], $continuation)
{
return new ChangeRequestCall(
- $continuation($method, $metadata, $options)
+ $continuation($method, $deserialize, $metadata, $options)
);
}
}
diff --git a/src/proto/census/census.options b/src/proto/census/census.options
deleted file mode 100644
index a1f80395c7..0000000000
--- a/src/proto/census/census.options
+++ /dev/null
@@ -1,3 +0,0 @@
-google.census.Tag.key max_size:255
-google.census.Tag.value max_size:255
-google.census.View.tag_key max_count:15
diff --git a/src/proto/census/census.proto b/src/proto/census/census.proto
deleted file mode 100644
index ae7d7763e8..0000000000
--- a/src/proto/census/census.proto
+++ /dev/null
@@ -1,307 +0,0 @@
-// Copyright 2016 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-syntax = "proto3";
-
-package google.census;
-
-// All the census protos.
-//
-// Nomenclature note: capitalized names below (like Resource) are protos.
-//
-// Census lets you define a Resource - something which can be measured, like the
-// latency of an RPC, the number of CPU cycles spent on an operation, or
-// anything else you care to measure. You can record individual instances of
-// measurements (a double value) for every Resource of interest. These
-// individual measurements are aggregated together into an Aggregation. There
-// are two Aggregation types available: Distribution (describes the
-// distribution of all measurements, possibly with a histogram) and
-// IntervalStats (the count and mean of measurements across specified time
-// periods). An Aggregation is described by an AggregationDescriptor.
-//
-// You can define how your stats are broken down by Tag values and which
-// Aggregations to use through a View. The corresponding combination of
-// Resource/View/Aggregation which is available to census clients is called a
-// Metric.
-
-
-// The following two types are copied from
-// google/protobuf/{duration,timestamp}.proto. Ideally, we would be able to
-// import them, but this causes compilation issues on C-based systems
-// (e.g. https://koti.kapsi.fi/jpa/nanopb/), which cannot process the C++
-// headers generated from the standard protobuf distribution. See the relevant
-// proto files for full documentation of these types.
-
-message Duration {
- // Signed seconds of the span of time. Must be from -315,576,000,000
- // to +315,576,000,000 inclusive.
- int64 seconds = 1;
-
- // Signed fractions of a second at nanosecond resolution of the span
- // of time. Durations less than one second are represented with a 0
- // `seconds` field and a positive or negative `nanos` field. For durations
- // of one second or more, a non-zero value for the `nanos` field must be
- // of the same sign as the `seconds` field. Must be from -999,999,999
- // to +999,999,999 inclusive.
- int32 nanos = 2;
-}
-
-message Timestamp {
- // Represents seconds of UTC time since Unix epoch
- // 1970-01-01T00:00:00Z. Must be from 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;
-}
-
-// Describes a Resource.
-message Resource {
- // name of resource, e.g. rpc_latency, cpu. Must be unique.
- string name = 1;
-
- // More detailed description of the resource, used in documentation.
- string description = 2;
-
- // Fundamental units of measurement supported by Census
- // TODO(aveitch): expand this to include other S.I. units?
- enum BasicUnit {
- UNKNOWN = 0;
- BITS = 1;
- BYTES = 2;
- SECS = 3;
- CORES = 4;
- MAX_UNITS = 5;
- }
-
- // MeasurementUnit lets you build compound units of the form
- // 10^n * (A * B * ...) / (X * Y * ...),
- // where the elements in the numerator and denominator are all BasicUnits. A
- // MeasurementUnit must have at least one BasicUnit in its numerator.
- //
- // To specify multiplication in the numerator or denominator, simply specify
- // multiple numerator or denominator fields. For example:
- //
- // - byte-seconds (i.e. bytes * seconds):
- // numerator: BYTES
- // numerator: SECS
- //
- // - events/sec^2 (i.e. rate of change of events/sec):
- // numerator: COUNT
- // denominator: SECS
- // denominator: SECS
- //
- // To specify multiples (in power of 10) of units, specify a non-zero prefix
- // value, for example:
- //
- // - MB/s (i.e. megabytes / s):
- // prefix: 6
- // numerator: BYTES
- // denominator: SECS
- //
- // - nanoseconds
- // prefix: -9
- // numerator: SECS
- message MeasurementUnit {
- int32 prefix = 1;
- repeated BasicUnit numerator = 2;
- repeated BasicUnit denominator = 3;
- }
-
- // The units in which Resource values are measured.
- MeasurementUnit unit = 3;
-}
-
-// An Aggregation summarizes a series of individual Resource measurements, an
-// AggregationDescriptor describes an Aggregation.
-message AggregationDescriptor {
- enum AggregationType {
- // Unspecified. Should not be used.
- UNKNOWN = 0;
- // A count of measurements made.
- COUNT = 1;
- // A Distribution.
- DISTRIBUTION = 2;
- // Counts over fixed time intervals.
- INTERVAL = 3;
- }
- // The type of Aggregation.
- AggregationType type = 1;
-
- // At most one set of options. It is illegal to specifiy an option for
- // COUNT Aggregations. interval_boundaries must be set for INTERVAL types.
- // bucket_boundaries are optional for DISTRIBUTION types.
- oneof options {
- // Defines histogram bucket boundaries for Distributions.
- BucketBoundaries bucket_boundaries = 2;
- // Defines the time windows to record for IntervalStats.
- IntervalBoundaries interval_boundaries = 3;
- }
-
- // A Distribution may optionally contain a histogram of the values in the
- // population. The bucket boundaries for that histogram are described by
- // `bucket_boundaries`. This defines `size(bounds) + 1` (= N) buckets. The
- // boundaries for bucket index i are:
- //
- // [-infinity, bounds[i]) for i == 0
- // [bounds[i-1], bounds[i]) for 0 < i < N-2
- // [bounds[i-1], +infinity) for i == N-1
- //
- // i.e. an underflow bucket (number 0), zero or more finite buckets (1
- // through N - 2, and an overflow bucket (N - 1), with inclusive lower
- // bounds and exclusive upper bounds.
- //
- // There must be at least one element in `bounds`. If `bounds` has only one
- // element, there are no finite buckets, and that single element is the
- // common boundary of the overflow and underflow buckets.
- message BucketBoundaries {
- // The values must be monotonically increasing.
- repeated double bounds = 1;
- }
-
- // For Interval stats, describe the size of each window.
- message IntervalBoundaries {
- // For each time window, specify a duration in seconds.
- repeated double window_size = 1;
- }
-}
-
-// Distribution contains summary statistics for a population of values and,
-// optionally, a histogram representing the distribution of those values across
-// a specified set of histogram buckets, as defined in
-// Aggregation.bucket_options.
-//
-// The summary statistics are the count, mean, minimum, and the maximum of the
-// set of population of values.
-//
-// Although it is not forbidden, it is generally a bad idea to include
-// non-finite values (infinities or NaNs) in the population of values, as this
-// will render the `mean` field meaningless.
-message Distribution {
- // The number of values in the population. Must be non-negative.
- int64 count = 1;
-
- // The arithmetic mean of the values in the population. If `count` is zero
- // then this field must be zero.
- double mean = 2;
-
- // Describes a range of population values.
- message Range {
- // The minimum of the population values.
- double min = 1;
- // The maximum of the population values.
- double max = 2;
- }
-
- // The range of the population values. If `count` is zero, this field will not
- // be defined.
- Range range = 3;
-
- // A Distribution may optionally contain a histogram of the values in the
- // population. The histogram is given in `bucket_count` as counts of values
- // that fall into one of a sequence of non-overlapping buckets, as described
- // by `AggregationDescriptor.options.bucket_boundaries`.
- // The sum of the values in `bucket_counts` must equal the value in `count`.
- //
- // Bucket counts are given in order under the numbering scheme described
- // above (the underflow bucket has number 0; the finite buckets, if any,
- // have numbers 1 through N-2; the overflow bucket has number N-1).
- //
- // The size of `bucket_count` must be no greater than N as defined in
- // `bucket_boundaries`.
- //
- // Any suffix of trailing zero bucket_count fields may be omitted.
- repeated int64 bucket_count = 4;
-}
-
-// Record summary stats over various time windows.
-message IntervalStats {
- // Summary statistic over a single time window.
- message Window {
- // The window duration. Must be positive.
- Duration window_size = 1;
- // The number of measurements in this window.
- int64 count = 2;
- // The arithmetic mean of all measurements in the window.
- double mean = 3;
- }
-
- // Full set of windows for this aggregation.
- repeated Window window = 1;
-}
-
-// A Tag: key-value pair.
-message Tag {
- string key = 1;
- string value = 2;
-}
-
-// A View specifies an Aggregation and a set of tag keys. The Aggregation will
-// be broken down by the unique set of matching tag values for each measurement.
-message View {
- // Name of view. Must be unique.
- string name = 1;
-
- // More detailed description, for documentation purposes.
- string description = 2;
-
- // Name of Resource to be broken down for this view.
- string resource_name = 3;
-
- // Aggregation type to associate with this View.
- AggregationDescriptor aggregation = 4;
-
- // Tag keys to match with a given Resource measurement. If no keys are
- // specified, then all stats are recorded. Keys must be unique.
- repeated string tag_key = 5;
-}
-
-// An Aggregation summarizes a series of individual Resource measurements.
-message Aggregation {
- // Name of this aggregation.
- string name = 1;
-
- // More detailed description, for documentation purposes.
- string description = 2;
-
- // The data for this Aggregation.
- oneof data {
- uint64 count = 3;
- Distribution distribution = 4;
- IntervalStats interval_stats = 5;
- }
-
- // Tags associated with this Aggregation.
- repeated Tag tag = 6;
-}
-
-// A Metric represents all the Aggregations for a particular view.
-message Metric {
- // View associated with this Metric.
- string view_name = 1;
-
- // Aggregations - each will have a unique set of tag values for the tag_keys
- // associated with the corresponding View.
- repeated Aggregation aggregation = 2;
-
- // Start and end timestamps over which the metric was accumulated. These
- // values are not relevant/defined for IntervalStats aggregations, which are
- // always accumulated over a fixed time period.
- Timestamp start = 3;
- Timestamp end = 4;
-}
diff --git a/src/proto/census/trace_context.options b/src/proto/census/trace_context.options
deleted file mode 100644
index e69de29bb2..0000000000
--- a/src/proto/census/trace_context.options
+++ /dev/null
diff --git a/src/proto/grpc/channelz/channelz.proto b/src/proto/grpc/channelz/channelz.proto
index 14db66a654..d930dfcfb4 100644
--- a/src/proto/grpc/channelz/channelz.proto
+++ b/src/proto/grpc/channelz/channelz.proto
@@ -1,4 +1,4 @@
-// Copyright 2018 gRPC authors.
+// Copyright 2018 The gRPC Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -12,20 +12,30 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+// This file defines an interface for exporting monitoring information
+// out of gRPC servers. See the full design at
+// https://github.com/grpc/proposal/blob/master/A14-channelz.md
+//
+// The canonical version of this proto can be found at
+// https://github.com/grpc/grpc-proto/blob/master/grpc/channelz/v1/channelz.proto
+
syntax = "proto3";
-package grpc.channelz;
+package grpc.channelz.v1;
import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
-// See go/grpc-channelz.
+option go_package = "google.golang.org/grpc/channelz/grpc_channelz_v1";
+option java_multiple_files = true;
+option java_package = "io.grpc.channelz.v1";
+option java_outer_classname = "ChannelzProto";
// Channel is a logical grouping of channels, subchannels, and sockets.
message Channel {
- // The identifier for this channel.
+ // The identifier for this channel. This should bet set.
ChannelRef ref = 1;
// Data specific to this channel.
ChannelData data = 2;
@@ -43,7 +53,7 @@ message Channel {
repeated SubchannelRef subchannel_ref = 4;
// There are no ordering guarantees on the order of sockets.
- repeated SocketRef socket = 5;
+ repeated SocketRef socket_ref = 5;
}
// Subchannel is a logical grouping of channels, subchannels, and sockets.
@@ -67,7 +77,7 @@ message Subchannel {
repeated SubchannelRef subchannel_ref = 4;
// There are no ordering guarantees on the order of sockets.
- repeated SocketRef socket = 5;
+ repeated SocketRef socket_ref = 5;
}
// These come from the specified states in this document:
@@ -84,20 +94,23 @@ message ChannelConnectivityState {
State state = 1;
}
+// Channel data is data related to a specific Channel or Subchannel.
message ChannelData {
-
+ // The connectivity state of the channel or subchannel. Implementations
+ // should always set this.
ChannelConnectivityState state = 1;
// The target this channel originally tried to connect to. May be absent
string target = 2;
+ // A trace of recent events on the channel. May be absent.
ChannelTrace trace = 3;
// The number of calls started on the channel
int64 calls_started = 4;
// The number of calls that have completed with an OK status
int64 calls_succeeded = 5;
- // The number of calls that have a completed with a non-OK status
+ // The number of calls that have completed with a non-OK status
int64 calls_failed = 6;
// The last time a call was started on the channel.
@@ -130,26 +143,29 @@ message ChannelTraceEvent {
}
}
+// ChannelTrace represents the recent events that have occurred on the channel.
message ChannelTrace {
// Number of events ever logged in this tracing object. This can differ from
// events.size() because events can be overwritten or garbage collected by
// implementations.
int64 num_events_logged = 1;
// Time that this channel was created.
- google.protobuf.Timestamp creation_time = 2;
+ google.protobuf.Timestamp creation_timestamp = 2;
// List of events that have occurred on this channel.
repeated ChannelTraceEvent events = 3;
}
+// ChannelRef is a reference to a Channel.
message ChannelRef {
// The globally unique id for this channel. Must be a positive number.
int64 channel_id = 1;
// An optional name associated with the channel.
string name = 2;
// Intentionally don't use field numbers from other refs.
- reserved 3, 4, 5, 6;
+ reserved 3, 4, 5, 6, 7, 8;
}
+// ChannelRef is a reference to a Subchannel.
message SubchannelRef {
// The globally unique id for this subchannel. Must be a positive number.
int64 subchannel_id = 7;
@@ -159,6 +175,7 @@ message SubchannelRef {
reserved 1, 2, 3, 4, 5, 6;
}
+// SocketRef is a reference to a Socket.
message SocketRef {
int64 socket_id = 3;
// An optional name associated with the socket.
@@ -167,8 +184,9 @@ message SocketRef {
reserved 1, 2, 5, 6, 7, 8;
}
+// ServerRef is a reference to a Server.
message ServerRef {
- // A globally unique identifier for this server. Must be a positive number.
+ // A globally unique identifier for this server. Must be a positive number.
int64 server_id = 5;
// An optional name associated with the server.
string name = 6;
@@ -176,16 +194,22 @@ message ServerRef {
reserved 1, 2, 3, 4, 7, 8;
}
+// Server represents a single server. There may be multiple servers in a single
+// program.
message Server {
+ // The identifier for a Server. This should be set.
ServerRef ref = 1;
+ // The associated data of the Server.
ServerData data = 2;
// The sockets that the server is listening on. There are no ordering
- // guarantees.
+ // guarantees. This may be absent.
repeated SocketRef listen_socket = 3;
}
+// ServerData is data for a specific Server.
message ServerData {
+ // A trace of recent events on the server. May be absent.
ChannelTrace trace = 1;
// The number of incoming calls started on the server
@@ -201,13 +225,17 @@ message ServerData {
// Information about an actual connection. Pronounced "sock-ay".
message Socket {
+ // The identifier for the Socket.
SocketRef ref = 1;
+ // Data specific to this Socket.
SocketData data = 2;
// The locally bound address.
Address local = 3;
// The remote bound address. May be absent.
Address remote = 4;
+ // Security details for this socket. May be absent if not available, or
+ // there is no security on the socket.
Security security = 5;
// Optional, represents the name of the remote endpoint, if different than
@@ -215,17 +243,23 @@ message Socket {
string remote_name = 6;
}
+// SocketData is data associated for a specific Socket. The fields present
+// are specific to the implementation, so there may be minor differences in
+// the semantics. (e.g. flow control windows)
message SocketData {
// The number of streams that have been started.
int64 streams_started = 1;
- // The number of streams that have ended successfully with the EoS bit set for
- // both end points
+ // The number of streams that have ended successfully:
+ // On client side, received frame with eos bit set;
+ // On server side, sent frame with eos bit set.
int64 streams_succeeded = 2;
- // The number of incoming streams that have a completed with a non-OK status
+ // The number of streams that have ended unsuccessfully:
+ // On client side, ended without receiving frame with eos bit set;
+ // On server side, ended without sending frame with eos bit set.
int64 streams_failed = 3;
-
- // The number of messages successfully sent on this socket.
+ // The number of grpc messages successfully sent on this socket.
int64 messages_sent = 4;
+ // The number of grpc messages received on this socket.
int64 messages_received = 5;
// The number of keep alives sent. This is typically implemented with HTTP/2
@@ -254,12 +288,14 @@ message SocketData {
// include stream level or TCP level flow control info.
google.protobuf.Int64Value remote_flow_control_window = 12;
+ // Socket options set on this socket. May be absent.
repeated SocketOption option = 13;
}
+// Address represents the address used to create the socket.
message Address {
message TcpIpAddress {
- // Either the IPv4 or IPv6 address in bytes. Will either be 4 bytes or 16
+ // Either the IPv4 or IPv6 address in bytes. Will be either 4 bytes or 16
// bytes in length.
bytes ip_address = 1;
// 0-64k, or -1 if not appropriate.
@@ -271,7 +307,7 @@ message Address {
}
// An address type not included above.
message OtherAddress {
- // The human readable version of the value.
+ // The human readable version of the value. This value should be set.
string name = 1;
// The actual address message.
google.protobuf.Any value = 2;
@@ -284,12 +320,17 @@ message Address {
}
}
+// Security represents details about how secure the socket is.
message Security {
message Tls {
- // The key exchange used. e.g. X25519
- string key_exchange = 1;
- // The cipher used. e.g. AES_128_GCM.
- string cipher = 2;
+ oneof cipher_suite {
+ // The cipher suite name in the RFC 4346 format:
+ // https://tools.ietf.org/html/rfc4346#appendix-C
+ string standard_name = 1;
+ // Some other way to describe the cipher suite if
+ // the RFC 4346 name is not available.
+ string other_name = 2;
+ }
// the certificate used by this endpoint.
bytes local_certificate = 3;
// the certificate used by the remote endpoint.
@@ -307,7 +348,11 @@ message Security {
}
}
+// SocketOption represents socket options for a socket. Specifically, these
+// are the options returned by getsockopt().
message SocketOption {
+ // The full name of the socket option. Typically this will be the upper case
+ // name, such as "SO_REUSEPORT".
string name = 1;
// The human readable value of this socket option. At least one of value or
// additional will be set.
@@ -323,12 +368,17 @@ message SocketOptionTimeout {
google.protobuf.Duration duration = 1;
}
+// For use with SocketOption's additional field. This is primarily used for
+// SO_LINGER.
message SocketOptionLinger {
+ // active maps to `struct linger.l_onoff`
bool active = 1;
+ // duration maps to `struct linger.l_linger`
google.protobuf.Duration duration = 2;
}
-// Tcp info for SOL_TCP, TCP_INFO
+// For use with SocketOption's additional field. Tcp info for
+// SOL_TCP and TCP_INFO.
message SocketOptionTcpInfo {
uint32 tcpi_state = 1;
@@ -366,8 +416,10 @@ message SocketOptionTcpInfo {
uint32 tcpi_reordering = 29;
}
+// Channelz is a service exposed by gRPC servers that provides detailed debug
+// information.
service Channelz {
- // Gets all root channels (e.g. channels the application has directly
+ // Gets all root channels (i.e. channels the application has directly
// created). This does not include subchannels nor non-top level channels.
rpc GetTopChannels(GetTopChannelsRequest) returns (GetTopChannelsResponse);
// Gets all servers that exist in the process.
@@ -382,6 +434,22 @@ service Channelz {
rpc GetSocket(GetSocketRequest) returns (GetSocketResponse);
}
+message GetTopChannelsRequest {
+ // start_channel_id indicates that only channels at or above this id should be
+ // included in the results.
+ int64 start_channel_id = 1;
+}
+
+message GetTopChannelsResponse {
+ // list of channels that the connection detail service knows about. Sorted in
+ // ascending channel_id order.
+ repeated Channel channel = 1;
+ // If set, indicates that the list of channels is the final list. Requesting
+ // more channels can only return more if they are created after this RPC
+ // completes.
+ bool end = 2;
+}
+
message GetServersRequest {
// start_server_id indicates that only servers at or above this id should be
// included in the results.
@@ -415,42 +483,35 @@ message GetServerSocketsResponse {
bool end = 2;
}
-message GetTopChannelsRequest {
- // start_channel_id indicates that only channels at or above this id should be
- // included in the results.
- int64 start_channel_id = 1;
-}
-
-message GetTopChannelsResponse {
- // list of channels that the connection detail service knows about. Sorted in
- // ascending channel_id order.
- repeated Channel channel = 1;
- // If set, indicates that the list of channels is the final list. Requesting
- // more channels can only return more if they are created after this RPC
- // completes.
- bool end = 2;
-}
-
message GetChannelRequest {
+ // channel_id is the identifier of the specific channel to get.
int64 channel_id = 1;
}
message GetChannelResponse {
+ // The Channel that corresponds to the requested channel_id. This field
+ // should be set.
Channel channel = 1;
}
message GetSubchannelRequest {
+ // subchannel_id is the identifier of the specific subchannel to get.
int64 subchannel_id = 1;
}
message GetSubchannelResponse {
+ // The Subchannel that corresponds to the requested subchannel_id. This
+ // field should be set.
Subchannel subchannel = 1;
}
message GetSocketRequest {
+ // socket_id is the identifier of the specific socket to get.
int64 socket_id = 1;
}
message GetSocketResponse {
+ // The Socket that corresponds to the requested socket_id. This field
+ // should be set.
Socket socket = 1;
}
diff --git a/src/proto/grpc/lb/v1/BUILD b/src/proto/grpc/lb/v1/BUILD
index 15bf3c3233..fd01f847fd 100644
--- a/src/proto/grpc/lb/v1/BUILD
+++ b/src/proto/grpc/lb/v1/BUILD
@@ -14,11 +14,24 @@
licenses(["notice"]) # Apache v2
-load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_package")
+load("//bazel:grpc_build_system.bzl", "grpc_package", "grpc_proto_library")
-grpc_package(name = "lb", visibility = "public")
+grpc_package(
+ name = "lb",
+ visibility = "public",
+)
grpc_proto_library(
name = "load_balancer_proto",
- srcs = ["load_balancer.proto"],
+ srcs = [
+ "load_balancer.proto",
+ ],
+ well_known_protos = True,
+)
+
+grpc_proto_library(
+ name = "load_reporter_proto",
+ srcs = ["load_reporter.proto"],
+ has_services = True,
+ well_known_protos = True,
)
diff --git a/src/proto/grpc/lb/v1/load_balancer.proto b/src/proto/grpc/lb/v1/load_balancer.proto
index 3e0a4b2c97..c9932bcf60 100644
--- a/src/proto/grpc/lb/v1/load_balancer.proto
+++ b/src/proto/grpc/lb/v1/load_balancer.proto
@@ -1,4 +1,4 @@
-// Copyright 2016 gRPC authors.
+// Copyright 2015 The gRPC Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -12,42 +12,25 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+// This file defines the GRPCLB LoadBalancing protocol.
+//
+// The canonical version of this proto can be found at
+// https://github.com/grpc/grpc-proto/blob/master/grpc/lb/v1/load_balancer.proto
syntax = "proto3";
package grpc.lb.v1;
-message Duration {
- // Signed seconds of the span of time. Must be from -315,576,000,000
- // to +315,576,000,000 inclusive.
- int64 seconds = 1;
-
- // Signed fractions of a second at nanosecond resolution of the span
- // of time. Durations less than one second are represented with a 0
- // `seconds` field and a positive or negative `nanos` field. For durations
- // of one second or more, a non-zero value for the `nanos` field must be
- // of the same sign as the `seconds` field. Must be from -999,999,999
- // to +999,999,999 inclusive.
- int32 nanos = 2;
-}
-
-message Timestamp {
+import "google/protobuf/duration.proto";
+import "google/protobuf/timestamp.proto";
- // 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;
-}
+option go_package = "google.golang.org/grpc/balancer/grpclb/grpc_lb_v1";
+option java_multiple_files = true;
+option java_outer_classname = "LoadBalancerProto";
+option java_package = "io.grpc.grpclb";
service LoadBalancer {
// Bidirectional rpc to get a list of servers.
- rpc BalanceLoad(stream LoadBalanceRequest)
- returns (stream LoadBalanceResponse);
+ rpc BalanceLoad(stream LoadBalanceRequest) returns (stream LoadBalanceResponse);
}
message LoadBalanceRequest {
@@ -62,8 +45,8 @@ message LoadBalanceRequest {
}
message InitialLoadBalanceRequest {
- // The name of the load balanced service (e.g., balancer.service.com). The max
- // length of the name is 256 bytes.
+ // The name of the load balanced service (e.g., service.googleapis.com). Its
+ // length should be less than 256 bytes.
// The name might include a port number. How to handle the port number is up
// to the balancer.
string name = 1;
@@ -82,7 +65,7 @@ message ClientStatsPerToken {
// count except the timestamp should be reset to zero after reporting the stats.
message ClientStats {
// The timestamp of generating the report.
- Timestamp timestamp = 1;
+ google.protobuf.Timestamp timestamp = 1;
// The total number of RPCs that started.
int64 num_calls_started = 2;
@@ -125,7 +108,7 @@ message InitialLoadBalanceResponse {
// This interval defines how often the client should send the client stats
// to the load balancer. Stats should only be reported when the duration is
// positive.
- Duration client_stats_report_interval = 2;
+ google.protobuf.Duration client_stats_report_interval = 2;
}
message ServerList {
@@ -149,13 +132,13 @@ message Server {
// A resolved port number for the server.
int32 port = 2;
- // An opaque but printable token given to the frontend for each pick. All
- // frontend requests for that pick must include the token in its initial
- // metadata. The token is used by the backend to verify the request and to
- // allow the backend to report load to the gRPC LB system. The token is also
- // used in client stats for reporting dropped calls.
+ // An opaque but printable token for load reporting. The client must include
+ // the token of the picked server into the initial metadata when it starts a
+ // call to that server. The token is used by the server to verify the request
+ // and to allow the server to report load to the gRPC LB system. The token is
+ // also used in client stats for reporting dropped calls.
//
- // Its length is variable but less than 50 bytes.
+ // Its length can be variable but must be less than 50 bytes.
string load_balance_token = 3;
// Indicates whether this particular request should be dropped by the client.
diff --git a/src/proto/grpc/lb/v1/load_reporter.proto b/src/proto/grpc/lb/v1/load_reporter.proto
new file mode 100644
index 0000000000..c2e4f23f6e
--- /dev/null
+++ b/src/proto/grpc/lb/v1/load_reporter.proto
@@ -0,0 +1,180 @@
+// Copyright 2018 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+syntax = "proto3";
+
+package grpc.lb.v1;
+
+import "google/protobuf/duration.proto";
+
+// The LoadReporter service.
+service LoadReporter {
+ // Report load from server to lb.
+ rpc ReportLoad(stream LoadReportRequest)
+ returns (stream LoadReportResponse) {
+ };
+}
+
+message LoadReportRequest {
+ // This message should be sent on the first request to the gRPC server.
+ InitialLoadReportRequest initial_request = 1;
+}
+
+message InitialLoadReportRequest {
+ // The hostname this load reporter client is requesting load for.
+ string load_balanced_hostname = 1;
+
+ // Additional information to disambiguate orphaned load: load that should have
+ // gone to this load reporter client, but was not able to be sent since the
+ // load reporter client has disconnected. load_key is sent in orphaned load
+ // reports; see Load.load_key.
+ bytes load_key = 2;
+
+ // This interval defines how often the server should send load reports to
+ // the load balancer.
+ google.protobuf.Duration load_report_interval = 3;
+}
+
+message LoadReportResponse {
+ // This message should be sent on the first response to the load balancer.
+ InitialLoadReportResponse initial_response = 1;
+
+ // Reports server-wide statistics for load balancing.
+ // This should be reported with every response.
+ LoadBalancingFeedback load_balancing_feedback = 2;
+
+ // A load report for each <tag, user_id> tuple. This could be considered to be
+ // a multimap indexed by <tag, user_id>. It is not strictly necessary to
+ // aggregate all entries into one entry per <tag, user_id> tuple, although it
+ // is preferred to do so.
+ repeated Load load = 3;
+}
+
+message InitialLoadReportResponse {
+ // Initial response returns the Load balancer ID. This must be plain text
+ // (printable ASCII).
+ string load_balancer_id = 1;
+
+ enum ImplementationIdentifier {
+ IMPL_UNSPECIFIED = 0;
+ CPP = 1; // Standard Google C++ implementation.
+ JAVA = 2; // Standard Google Java implementation.
+ GO = 3; // Standard Google Go implementation.
+ }
+ // Optional identifier of this implementation of the load reporting server.
+ ImplementationIdentifier implementation_id = 2;
+
+ // Optional server_version should be a value that is modified (and
+ // monotonically increased) when changes are made to the server
+ // implementation.
+ int64 server_version = 3;
+}
+
+message LoadBalancingFeedback {
+ // Reports the current utilization of the server (typical range [0.0 - 1.0]).
+ float server_utilization = 1;
+
+ // The total rate of calls handled by this server (including errors).
+ float calls_per_second = 2;
+
+ // The total rate of error responses sent by this server.
+ float errors_per_second = 3;
+}
+
+message Load {
+ // The (plain text) tag used by the calls covered by this load report. The
+ // tag is that part of the load balancer token after removing the load
+ // balancer id. Empty is equivalent to non-existent tag.
+ string load_balance_tag = 1;
+
+ // The user identity authenticated by the calls covered by this load
+ // report. Empty is equivalent to no known user_id.
+ string user_id = 3;
+
+ // IP address of the client that sent these requests, serialized in
+ // network-byte-order. It may either be an IPv4 or IPv6 address.
+ bytes client_ip_address = 15;
+
+ // The number of calls started (since the last report) with the given tag and
+ // user_id.
+ int64 num_calls_started = 4;
+
+ // Indicates whether this load report is an in-progress load report in which
+ // num_calls_in_progress is the only valid entry. If in_progress_report is not
+ // set, num_calls_in_progress will be ignored. If in_progress_report is set,
+ // fields other than num_calls_in_progress and orphaned_load will be ignored.
+ oneof in_progress_report {
+ // The number of calls in progress (instantaneously) per load balancer id.
+ int64 num_calls_in_progress = 5;
+ }
+
+ // The following values are counts or totals of call statistics that finished
+ // with the given tag and user_id.
+ int64 num_calls_finished_without_error = 6; // Calls with status OK.
+ int64 num_calls_finished_with_error = 7; // Calls with status non-OK.
+ // Calls that finished with a status that maps to HTTP 5XX (see
+ // googleapis/google/rpc/code.proto). Note that this is a subset of
+ // num_calls_finished_with_error.
+ int64 num_calls_finished_with_server_error = 16;
+
+ // Totals are from calls that with _and_ without error.
+ int64 total_bytes_sent = 8;
+ int64 total_bytes_received = 9;
+ google.protobuf.Duration total_latency = 10;
+
+ // Optional metrics reported for the call(s). Requires that metric_name is
+ // unique.
+ repeated CallMetricData metric_data = 11;
+
+ // The following two fields are used for reporting orphaned load: load that
+ // could not be reported to the originating balancer either since the balancer
+ // is no longer connected or because the frontend sent an invalid token. These
+ // fields must not be set with normal (unorphaned) load reports.
+ oneof orphaned_load {
+ // Load_key is the load_key from the initial_request from the originating
+ // balancer.
+ bytes load_key = 12 [deprecated=true];
+
+ // If true then this load report is for calls that had an invalid token; the
+ // user is probably abusing the gRPC protocol.
+ // TODO(yankaiz): Rename load_key_unknown.
+ bool load_key_unknown = 13;
+
+ // load_key and balancer_id are included in order to identify orphaned load
+ // from different origins.
+ OrphanedLoadIdentifier orphaned_load_identifier = 14;
+ }
+
+ reserved 2;
+}
+
+message CallMetricData {
+ // Name of the metric; may be empty.
+ string metric_name = 1;
+
+ // Number of calls that finished and included this metric.
+ int64 num_calls_finished_with_metric = 2;
+
+ // Sum of metric values across all calls that finished with this metric.
+ double total_metric_value = 3;
+}
+
+message OrphanedLoadIdentifier {
+ // The load_key from the initial_request from the originating balancer.
+ bytes load_key = 1;
+
+ // The unique ID generated by LoadReporter to identify balancers. Here it
+ // distinguishes orphaned load with a same load_key.
+ string load_balancer_id = 2;
+}
diff --git a/src/proto/grpc/testing/messages.proto b/src/proto/grpc/testing/messages.proto
index 0b8c15711e..7b1b7286dc 100644
--- a/src/proto/grpc/testing/messages.proto
+++ b/src/proto/grpc/testing/messages.proto
@@ -27,7 +27,6 @@ message BoolValue {
bool value = 1;
}
-// DEPRECATED, don't use. To be removed shortly.
// The type of payload that should be returned.
enum PayloadType {
// Compressable text format.
@@ -36,7 +35,6 @@ enum PayloadType {
// A block of data, to simply increase gRPC message size.
message Payload {
- // DEPRECATED, don't use. To be removed shortly.
// The type of data in body.
PayloadType type = 1;
// Primary contents of payload.
@@ -52,7 +50,6 @@ message EchoStatus {
// Unary request.
message SimpleRequest {
- // DEPRECATED, don't use. To be removed shortly.
// Desired payload type in the response from the server.
// If response_type is RANDOM, server randomly chooses one from other formats.
PayloadType response_type = 1;
@@ -131,7 +128,6 @@ message ResponseParameters {
// Server-streaming request.
message StreamingOutputCallRequest {
- // DEPRECATED, don't use. To be removed shortly.
// Desired payload type in the response from the server.
// If response_type is RANDOM, the payload from each response in the stream
// might be of different types. This is to simulate a mixed type of payload
diff --git a/src/python/grpcio/grpc/__init__.py b/src/python/grpcio/grpc/__init__.py
index 0f31119467..863696d236 100644
--- a/src/python/grpcio/grpc/__init__.py
+++ b/src/python/grpcio/grpc/__init__.py
@@ -1482,7 +1482,7 @@ def ssl_server_credentials(private_key_certificate_chain_pairs,
A ServerCredentials for use with an SSL-enabled Server. Typically, this
object is an argument to add_secure_port() method during server setup.
"""
- if len(private_key_certificate_chain_pairs) == 0:
+ if not private_key_certificate_chain_pairs:
raise ValueError(
'At least one private key-certificate chain pair is required!')
elif require_client_auth and root_certificates is None:
@@ -1512,15 +1512,15 @@ def ssl_server_certificate_configuration(private_key_certificate_chain_pairs,
A ServerCertificateConfiguration that can be returned in the certificate
configuration fetching callback.
"""
- if len(private_key_certificate_chain_pairs) == 0:
- raise ValueError(
- 'At least one private key-certificate chain pair is required!')
- else:
+ if private_key_certificate_chain_pairs:
return ServerCertificateConfiguration(
_cygrpc.server_certificate_config_ssl(root_certificates, [
_cygrpc.SslPemKeyCertPair(key, pem)
for key, pem in private_key_certificate_chain_pairs
]))
+ else:
+ raise ValueError(
+ 'At least one private key-certificate chain pair is required!')
def dynamic_ssl_server_credentials(initial_certificate_configuration,
@@ -1572,13 +1572,15 @@ def channel_ready_future(channel):
def insecure_channel(target, options=None):
"""Creates an insecure Channel to a server.
+ The returned Channel is thread-safe.
+
Args:
target: The server address
options: An optional list of key-value pairs (channel args
in gRPC Core runtime) to configure the channel.
Returns:
- A Channel object.
+ A Channel.
"""
from grpc import _channel # pylint: disable=cyclic-import
return _channel.Channel(target, () if options is None else options, None)
@@ -1587,6 +1589,8 @@ def insecure_channel(target, options=None):
def secure_channel(target, credentials, options=None):
"""Creates a secure Channel to a server.
+ The returned Channel is thread-safe.
+
Args:
target: The server address.
credentials: A ChannelCredentials instance.
@@ -1594,7 +1598,7 @@ def secure_channel(target, credentials, options=None):
in gRPC Core runtime) to configure the channel.
Returns:
- A Channel object.
+ A Channel.
"""
from grpc import _channel # pylint: disable=cyclic-import
return _channel.Channel(target, () if options is None else options,
@@ -1656,9 +1660,11 @@ def server(thread_pool,
A Server object.
"""
from grpc import _server # pylint: disable=cyclic-import
- return _server.Server(thread_pool, () if handlers is None else handlers, ()
- if interceptors is None else interceptors, () if
- options is None else options, maximum_concurrent_rpcs)
+ return _server.create_server(thread_pool, ()
+ if handlers is None else handlers, ()
+ if interceptors is None else interceptors, ()
+ if options is None else options,
+ maximum_concurrent_rpcs)
################################### __all__ #################################
diff --git a/src/python/grpcio/grpc/_channel.py b/src/python/grpcio/grpc/_channel.py
index 2017d47130..e9246991df 100644
--- a/src/python/grpcio/grpc/_channel.py
+++ b/src/python/grpcio/grpc/_channel.py
@@ -24,6 +24,8 @@ from grpc import _grpcio_metadata
from grpc._cython import cygrpc
from grpc.framework.foundation import callable_util
+_LOGGER = logging.getLogger(__name__)
+
_USER_AGENT = 'grpc-python/{}'.format(_grpcio_metadata.__version__)
_EMPTY_FLAGS = 0
@@ -181,7 +183,7 @@ def _consume_request_iterator(request_iterator, state, call, request_serializer,
except Exception: # pylint: disable=broad-except
code = grpc.StatusCode.UNKNOWN
details = 'Exception iterating requests!'
- logging.exception(details)
+ _LOGGER.exception(details)
call.cancel(_common.STATUS_CODE_TO_CYGRPC_STATUS_CODE[code],
details)
_abort(state, code, details)
@@ -190,7 +192,7 @@ def _consume_request_iterator(request_iterator, state, call, request_serializer,
with state.condition:
if state.code is None and not state.cancelled:
if serialized_request is None:
- code = grpc.StatusCode.INTERNAL # pylint: disable=redefined-variable-type
+ code = grpc.StatusCode.INTERNAL
details = 'Exception serializing request!'
call.cancel(
_common.STATUS_CODE_TO_CYGRPC_STATUS_CODE[code],
@@ -811,10 +813,7 @@ def _poll_connectivity(state, channel, initial_try_to_connect):
_common.CYGRPC_CONNECTIVITY_STATE_TO_CHANNEL_CONNECTIVITY[
connectivity])
if not state.delivering:
- # NOTE(nathaniel): The field is only ever used as a
- # sequence so it's fine that both lists and tuples are
- # assigned to it.
- callbacks = _deliveries(state) # pylint: disable=redefined-variable-type
+ callbacks = _deliveries(state)
if callbacks:
_spawn_delivery(state, callbacks)
diff --git a/src/python/grpcio/grpc/_common.py b/src/python/grpcio/grpc/_common.py
index 862987a0cd..8358cbec5b 100644
--- a/src/python/grpcio/grpc/_common.py
+++ b/src/python/grpcio/grpc/_common.py
@@ -20,6 +20,8 @@ import six
import grpc
from grpc._cython import cygrpc
+_LOGGER = logging.getLogger(__name__)
+
CYGRPC_CONNECTIVITY_STATE_TO_CHANNEL_CONNECTIVITY = {
cygrpc.ConnectivityState.idle:
grpc.ChannelConnectivity.IDLE,
@@ -73,7 +75,7 @@ def decode(b):
try:
return b.decode('utf8')
except UnicodeDecodeError:
- logging.exception('Invalid encoding on %s', b)
+ _LOGGER.exception('Invalid encoding on %s', b)
return b.decode('latin1')
@@ -84,7 +86,7 @@ def _transform(message, transformer, exception_message):
try:
return transformer(message)
except Exception: # pylint: disable=broad-except
- logging.exception(exception_message)
+ _LOGGER.exception(exception_message)
return None
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/arguments.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/arguments.pyx.pxi
index 65de30884c..aecd3d7b11 100644
--- a/src/python/grpcio/grpc/_cython/_cygrpc/arguments.pyx.pxi
+++ b/src/python/grpcio/grpc/_cython/_cygrpc/arguments.pyx.pxi
@@ -15,10 +15,12 @@
cimport cpython
+# TODO(https://github.com/grpc/grpc/issues/15662): Reform this.
cdef void* _copy_pointer(void* pointer):
return pointer
+# TODO(https://github.com/grpc/grpc/issues/15662): Reform this.
cdef void _destroy_pointer(void* pointer):
pass
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/channel.pxd.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pxd.pxi
index eefc685c0b..f067d76fab 100644
--- a/src/python/grpcio/grpc/_cython/_cygrpc/channel.pxd.pxi
+++ b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pxd.pxi
@@ -69,3 +69,6 @@ cdef class Channel:
cdef grpc_arg_pointer_vtable _vtable
cdef _ChannelState _state
+
+ # TODO(https://github.com/grpc/grpc/issues/15662): Eliminate this.
+ cdef tuple _arguments
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi
index 72e74e84ae..8c37a3cf85 100644
--- a/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi
+++ b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi
@@ -390,6 +390,7 @@ cdef class Channel:
def __cinit__(
self, bytes target, object arguments,
ChannelCredentials channel_credentials):
+ arguments = () if arguments is None else tuple(arguments)
grpc_init()
self._state = _ChannelState()
self._vtable.copy = &_copy_pointer
@@ -410,6 +411,7 @@ cdef class Channel:
grpc_completion_queue_create_for_next(NULL))
self._state.c_connectivity_completion_queue = (
grpc_completion_queue_create_for_next(NULL))
+ self._arguments = arguments
def target(self):
cdef char *c_target
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi
index 7e9ea33ca0..8d73215247 100644
--- a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi
+++ b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi
@@ -57,6 +57,11 @@ cdef class ChannelCredentials:
cdef grpc_channel_credentials *c_credentials
+cdef class SSLSessionCacheLRU:
+
+ cdef grpc_ssl_session_cache *_cache
+
+
cdef class SSLChannelCredentials(ChannelCredentials):
cdef readonly object _pem_root_certificates
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi
index dff9097bf9..d2c0389ca6 100644
--- a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi
+++ b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi
@@ -17,6 +17,9 @@ cimport cpython
import grpc
import threading
+from libc.stdint cimport uintptr_t
+
+
def _spawn_callback_in_thread(cb_func, args):
threading.Thread(target=cb_func, args=args).start()
@@ -29,6 +32,7 @@ def set_async_callback_func(callback_func):
def _spawn_callback_async(callback, args):
async_callback_func(callback, args)
+
cdef class CallCredentials:
cdef grpc_call_credentials *c(self):
@@ -107,6 +111,21 @@ cdef class ChannelCredentials:
raise NotImplementedError()
+cdef class SSLSessionCacheLRU:
+
+ def __cinit__(self, capacity):
+ grpc_init()
+ self._cache = grpc_ssl_session_cache_create_lru(capacity)
+
+ def __int__(self):
+ return <uintptr_t>self._cache
+
+ def __dealloc__(self):
+ if self._cache != NULL:
+ grpc_ssl_session_cache_destroy(self._cache)
+ grpc_shutdown()
+
+
cdef class SSLChannelCredentials(ChannelCredentials):
def __cinit__(self, pem_root_certificates, private_key, certificate_chain):
@@ -123,12 +142,12 @@ cdef class SSLChannelCredentials(ChannelCredentials):
c_pem_root_certificates = self._pem_root_certificates
if self._private_key is None and self._certificate_chain is None:
return grpc_ssl_credentials_create(
- c_pem_root_certificates, NULL, NULL)
+ c_pem_root_certificates, NULL, NULL, NULL)
else:
c_pem_key_certificate_pair.private_key = self._private_key
c_pem_key_certificate_pair.certificate_chain = self._certificate_chain
return grpc_ssl_credentials_create(
- c_pem_root_certificates, &c_pem_key_certificate_pair, NULL)
+ c_pem_root_certificates, &c_pem_key_certificate_pair, NULL, NULL)
cdef class CompositeChannelCredentials(ChannelCredentials):
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi
index 2d6c900c54..bcbfec0c9f 100644
--- a/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi
+++ b/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi
@@ -131,6 +131,7 @@ cdef extern from "grpc/grpc.h":
const char *GRPC_ARG_PRIMARY_USER_AGENT_STRING
const char *GRPC_ARG_SECONDARY_USER_AGENT_STRING
const char *GRPC_SSL_TARGET_NAME_OVERRIDE_ARG
+ const char *GRPC_SSL_SESSION_CACHE_ARG
const char *GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM
const char *GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL
const char *GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET
@@ -452,15 +453,26 @@ cdef extern from "grpc/grpc_security.h":
# We don't care about the internals (and in fact don't know them)
pass
+ ctypedef struct grpc_ssl_session_cache:
+ # We don't care about the internals (and in fact don't know them)
+ pass
+
+ ctypedef struct verify_peer_options:
+ # We don't care about the internals (and in fact don't know them)
+ pass
+
ctypedef void (*grpc_ssl_roots_override_callback)(char **pem_root_certs)
+ grpc_ssl_session_cache *grpc_ssl_session_cache_create_lru(size_t capacity)
+ void grpc_ssl_session_cache_destroy(grpc_ssl_session_cache* cache)
+
void grpc_set_ssl_roots_override_callback(
grpc_ssl_roots_override_callback cb) nogil
grpc_channel_credentials *grpc_google_default_credentials_create() nogil
grpc_channel_credentials *grpc_ssl_credentials_create(
const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pair,
- void *reserved) nogil
+ verify_peer_options *verify_options, void *reserved) nogil
grpc_channel_credentials *grpc_composite_channel_credentials_create(
grpc_channel_credentials *creds1, grpc_call_credentials *creds2,
void *reserved) nogil
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pxd b/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pxd.pxi
index f5688d08cd..f5688d08cd 100644
--- a/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pxd
+++ b/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pxd.pxi
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pyx b/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pyx.pxi
index f9a1b2856d..f9a1b2856d 100644
--- a/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pyx
+++ b/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pyx.pxi
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/grpc_string.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/grpc_string.pyx.pxi
index 53e06a1596..00a1b23a67 100644
--- a/src/python/grpcio/grpc/_cython/_cygrpc/grpc_string.pyx.pxi
+++ b/src/python/grpcio/grpc/_cython/_cygrpc/grpc_string.pyx.pxi
@@ -14,6 +14,7 @@
import logging
+_LOGGER = logging.getLogger(__name__)
# This function will ascii encode unicode string inputs if neccesary.
# In Python3, unicode strings are the default str type.
@@ -49,5 +50,5 @@ cdef str _decode(bytes bytestring):
try:
return bytestring.decode('utf8')
except UnicodeDecodeError:
- logging.exception('Invalid encoding on %s', bytestring)
+ _LOGGER.exception('Invalid encoding on %s', bytestring)
return bytestring.decode('latin1')
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi
index ecd991685f..37b98ebbdb 100644
--- a/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi
+++ b/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi
@@ -51,6 +51,7 @@ class ChannelArgKey:
default_authority = GRPC_ARG_DEFAULT_AUTHORITY
primary_user_agent_string = GRPC_ARG_PRIMARY_USER_AGENT_STRING
secondary_user_agent_string = GRPC_ARG_SECONDARY_USER_AGENT_STRING
+ ssl_session_cache = GRPC_SSL_SESSION_CACHE_ARG
ssl_target_name_override = GRPC_SSL_TARGET_NAME_OVERRIDE_ARG
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/server.pxd.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/server.pxd.pxi
index 4588db30d3..52cfccb677 100644
--- a/src/python/grpcio/grpc/_cython/_cygrpc/server.pxd.pxi
+++ b/src/python/grpcio/grpc/_cython/_cygrpc/server.pxd.pxi
@@ -23,6 +23,7 @@ cdef class Server:
cdef bint is_shutdown # notification of complete shutdown received
# used at dealloc when user forgets to shutdown
cdef CompletionQueue backup_shutdown_queue
+ # TODO(https://github.com/grpc/grpc/issues/15662): Elide this.
cdef list references
cdef list registered_completion_queues
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi
index 707ec742dd..da3dd21244 100644
--- a/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi
+++ b/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi
@@ -18,6 +18,8 @@ import logging
import time
import grpc
+_LOGGER = logging.getLogger(__name__)
+
cdef grpc_ssl_certificate_config_reload_status _server_cert_config_fetcher_wrapper(
void* user_data, grpc_ssl_server_certificate_config **config) with gil:
# This is a credentials.ServerCertificateConfig
@@ -34,13 +36,13 @@ cdef grpc_ssl_certificate_config_reload_status _server_cert_config_fetcher_wrapp
try:
cert_config_wrapper = user_cb()
except Exception:
- logging.exception('Error fetching certificate config')
+ _LOGGER.exception('Error fetching certificate config')
return GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL
if cert_config_wrapper is None:
return GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED
elif not isinstance(
cert_config_wrapper, grpc.ServerCertificateConfiguration):
- logging.error(
+ _LOGGER.error(
'Error fetching certificate configuration: certificate '
'configuration must be of type grpc.ServerCertificateConfiguration, '
'not %s' % type(cert_config_wrapper).__name__)
diff --git a/src/python/grpcio/grpc/_cython/cygrpc.pxd b/src/python/grpcio/grpc/_cython/cygrpc.pxd
index c8ace7c3cc..e33c01c28f 100644
--- a/src/python/grpcio/grpc/_cython/cygrpc.pxd
+++ b/src/python/grpcio/grpc/_cython/cygrpc.pxd
@@ -29,4 +29,4 @@ include "_cygrpc/server.pxd.pxi"
include "_cygrpc/tag.pxd.pxi"
include "_cygrpc/time.pxd.pxi"
-include "_cygrpc/grpc_gevent.pxd"
+include "_cygrpc/grpc_gevent.pxd.pxi"
diff --git a/src/python/grpcio/grpc/_cython/cygrpc.pyx b/src/python/grpcio/grpc/_cython/cygrpc.pyx
index f5f08fc983..fb16fb16bf 100644
--- a/src/python/grpcio/grpc/_cython/cygrpc.pyx
+++ b/src/python/grpcio/grpc/_cython/cygrpc.pyx
@@ -36,7 +36,7 @@ include "_cygrpc/server.pyx.pxi"
include "_cygrpc/tag.pyx.pxi"
include "_cygrpc/time.pyx.pxi"
-include "_cygrpc/grpc_gevent.pyx"
+include "_cygrpc/grpc_gevent.pyx.pxi"
#
# initialize gRPC
diff --git a/src/python/grpcio/grpc/_grpcio_metadata.py b/src/python/grpcio/grpc/_grpcio_metadata.py
index ad53f60ad3..b336e6aae5 100644
--- a/src/python/grpcio/grpc/_grpcio_metadata.py
+++ b/src/python/grpcio/grpc/_grpcio_metadata.py
@@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc/_grpcio_metadata.py.template`!!!
-__version__ = """1.13.0.dev0"""
+__version__ = """1.14.0.dev0"""
diff --git a/src/python/grpcio/grpc/_interceptor.py b/src/python/grpcio/grpc/_interceptor.py
index f465e35a9c..1d2d374ad1 100644
--- a/src/python/grpcio/grpc/_interceptor.py
+++ b/src/python/grpcio/grpc/_interceptor.py
@@ -75,10 +75,10 @@ def _unwrap_client_call_details(call_details, default_details):
return method, timeout, metadata, credentials
-class _LocalFailure(grpc.RpcError, grpc.Future, grpc.Call):
+class _FailureOutcome(grpc.RpcError, grpc.Future, grpc.Call):
def __init__(self, exception, traceback):
- super(_LocalFailure, self).__init__()
+ super(_FailureOutcome, self).__init__()
self._exception = exception
self._traceback = traceback
@@ -100,6 +100,12 @@ class _LocalFailure(grpc.RpcError, grpc.Future, grpc.Call):
def cancelled(self):
return False
+ def is_active(self):
+ return False
+
+ def time_remaining(self):
+ return None
+
def running(self):
return False
@@ -115,6 +121,9 @@ class _LocalFailure(grpc.RpcError, grpc.Future, grpc.Call):
def traceback(self, ignored_timeout=None):
return self._traceback
+ def add_callback(self, callback):
+ return False
+
def add_done_callback(self, fn):
fn(self)
@@ -125,6 +134,58 @@ class _LocalFailure(grpc.RpcError, grpc.Future, grpc.Call):
raise self._exception
+class _UnaryOutcome(grpc.Call, grpc.Future):
+
+ def __init__(self, response, call):
+ self._response = response
+ self._call = call
+
+ def initial_metadata(self):
+ return self._call.initial_metadata()
+
+ def trailing_metadata(self):
+ return self._call.trailing_metadata()
+
+ def code(self):
+ return self._call.code()
+
+ def details(self):
+ return self._call.details()
+
+ def is_active(self):
+ return self._call.is_active()
+
+ def time_remaining(self):
+ return self._call.time_remaining()
+
+ def cancel(self):
+ return self._call.cancel()
+
+ def add_callback(self, callback):
+ return self._call.add_callback(callback)
+
+ def cancelled(self):
+ return False
+
+ def running(self):
+ return False
+
+ def done(self):
+ return True
+
+ def result(self, ignored_timeout=None):
+ return self._response
+
+ def exception(self, ignored_timeout=None):
+ return None
+
+ def traceback(self, ignored_timeout=None):
+ return None
+
+ def add_done_callback(self, fn):
+ fn(self)
+
+
class _UnaryUnaryMultiCallable(grpc.UnaryUnaryMultiCallable):
def __init__(self, thunk, method, interceptor):
@@ -133,23 +194,45 @@ class _UnaryUnaryMultiCallable(grpc.UnaryUnaryMultiCallable):
self._interceptor = interceptor
def __call__(self, request, timeout=None, metadata=None, credentials=None):
- call_future = self.future(
+ response, ignored_call = self._with_call(
request,
timeout=timeout,
metadata=metadata,
credentials=credentials)
- return call_future.result()
+ return response
+
+ def _with_call(self, request, timeout=None, metadata=None,
+ credentials=None):
+ client_call_details = _ClientCallDetails(self._method, timeout,
+ metadata, credentials)
+
+ def continuation(new_details, request):
+ new_method, new_timeout, new_metadata, new_credentials = (
+ _unwrap_client_call_details(new_details, client_call_details))
+ try:
+ response, call = self._thunk(new_method).with_call(
+ request,
+ timeout=new_timeout,
+ metadata=new_metadata,
+ credentials=new_credentials)
+ return _UnaryOutcome(response, call)
+ except grpc.RpcError:
+ raise
+ except Exception as exception: # pylint:disable=broad-except
+ return _FailureOutcome(exception, sys.exc_info()[2])
+
+ call = self._interceptor.intercept_unary_unary(
+ continuation, client_call_details, request)
+ return call.result(), call
def with_call(self, request, timeout=None, metadata=None, credentials=None):
- call_future = self.future(
+ return self._with_call(
request,
timeout=timeout,
metadata=metadata,
credentials=credentials)
- return call_future.result(), call_future
def future(self, request, timeout=None, metadata=None, credentials=None):
-
client_call_details = _ClientCallDetails(self._method, timeout,
metadata, credentials)
@@ -166,7 +249,7 @@ class _UnaryUnaryMultiCallable(grpc.UnaryUnaryMultiCallable):
return self._interceptor.intercept_unary_unary(
continuation, client_call_details, request)
except Exception as exception: # pylint:disable=broad-except
- return _LocalFailure(exception, sys.exc_info()[2])
+ return _FailureOutcome(exception, sys.exc_info()[2])
class _UnaryStreamMultiCallable(grpc.UnaryStreamMultiCallable):
@@ -193,7 +276,7 @@ class _UnaryStreamMultiCallable(grpc.UnaryStreamMultiCallable):
return self._interceptor.intercept_unary_stream(
continuation, client_call_details, request)
except Exception as exception: # pylint:disable=broad-except
- return _LocalFailure(exception, sys.exc_info()[2])
+ return _FailureOutcome(exception, sys.exc_info()[2])
class _StreamUnaryMultiCallable(grpc.StreamUnaryMultiCallable):
@@ -208,24 +291,50 @@ class _StreamUnaryMultiCallable(grpc.StreamUnaryMultiCallable):
timeout=None,
metadata=None,
credentials=None):
- call_future = self.future(
+ response, ignored_call = self._with_call(
request_iterator,
timeout=timeout,
metadata=metadata,
credentials=credentials)
- return call_future.result()
+ return response
+
+ def _with_call(self,
+ request_iterator,
+ timeout=None,
+ metadata=None,
+ credentials=None):
+ client_call_details = _ClientCallDetails(self._method, timeout,
+ metadata, credentials)
+
+ def continuation(new_details, request_iterator):
+ new_method, new_timeout, new_metadata, new_credentials = (
+ _unwrap_client_call_details(new_details, client_call_details))
+ try:
+ response, call = self._thunk(new_method).with_call(
+ request_iterator,
+ timeout=new_timeout,
+ metadata=new_metadata,
+ credentials=new_credentials)
+ return _UnaryOutcome(response, call)
+ except grpc.RpcError:
+ raise
+ except Exception as exception: # pylint:disable=broad-except
+ return _FailureOutcome(exception, sys.exc_info()[2])
+
+ call = self._interceptor.intercept_stream_unary(
+ continuation, client_call_details, request_iterator)
+ return call.result(), call
def with_call(self,
request_iterator,
timeout=None,
metadata=None,
credentials=None):
- call_future = self.future(
+ return self._with_call(
request_iterator,
timeout=timeout,
metadata=metadata,
credentials=credentials)
- return call_future.result(), call_future
def future(self,
request_iterator,
@@ -248,7 +357,7 @@ class _StreamUnaryMultiCallable(grpc.StreamUnaryMultiCallable):
return self._interceptor.intercept_stream_unary(
continuation, client_call_details, request_iterator)
except Exception as exception: # pylint:disable=broad-except
- return _LocalFailure(exception, sys.exc_info()[2])
+ return _FailureOutcome(exception, sys.exc_info()[2])
class _StreamStreamMultiCallable(grpc.StreamStreamMultiCallable):
@@ -279,7 +388,7 @@ class _StreamStreamMultiCallable(grpc.StreamStreamMultiCallable):
return self._interceptor.intercept_stream_stream(
continuation, client_call_details, request_iterator)
except Exception as exception: # pylint:disable=broad-except
- return _LocalFailure(exception, sys.exc_info()[2])
+ return _FailureOutcome(exception, sys.exc_info()[2])
class _Channel(grpc.Channel):
@@ -288,11 +397,11 @@ class _Channel(grpc.Channel):
self._channel = channel
self._interceptor = interceptor
- def subscribe(self, *args, **kwargs):
- self._channel.subscribe(*args, **kwargs)
+ def subscribe(self, callback, try_to_connect=False):
+ self._channel.subscribe(callback, try_to_connect=try_to_connect)
- def unsubscribe(self, *args, **kwargs):
- self._channel.unsubscribe(*args, **kwargs)
+ def unsubscribe(self, callback):
+ self._channel.unsubscribe(callback)
def unary_unary(self,
method,
diff --git a/src/python/grpcio/grpc/_plugin_wrapping.py b/src/python/grpcio/grpc/_plugin_wrapping.py
index 6785e5876a..916ee080b6 100644
--- a/src/python/grpcio/grpc/_plugin_wrapping.py
+++ b/src/python/grpcio/grpc/_plugin_wrapping.py
@@ -20,6 +20,8 @@ import grpc
from grpc import _common
from grpc._cython import cygrpc
+_LOGGER = logging.getLogger(__name__)
+
class _AuthMetadataContext(
collections.namedtuple('AuthMetadataContext', (
@@ -76,7 +78,7 @@ class _Plugin(object):
_AuthMetadataPluginCallback(
callback_state, callback))
except Exception as exception: # pylint: disable=broad-except
- logging.exception(
+ _LOGGER.exception(
'AuthMetadataPluginCallback "%s" raised exception!',
self._metadata_plugin)
with callback_state.lock:
diff --git a/src/python/grpcio/grpc/_server.py b/src/python/grpcio/grpc/_server.py
index d849cadbee..7276a7fd90 100644
--- a/src/python/grpcio/grpc/_server.py
+++ b/src/python/grpcio/grpc/_server.py
@@ -27,6 +27,8 @@ from grpc import _interceptor
from grpc._cython import cygrpc
from grpc.framework.foundation import callable_util
+_LOGGER = logging.getLogger(__name__)
+
_SHUTDOWN_TAG = 'shutdown'
_REQUEST_CALL_TAG = 'request_call'
@@ -279,7 +281,7 @@ class _Context(grpc.ServicerContext):
def abort(self, code, details):
# treat OK like other invalid arguments: fail the RPC
if code == grpc.StatusCode.OK:
- logging.error(
+ _LOGGER.error(
'abort() called with StatusCode.OK; returning UNKNOWN')
code = grpc.StatusCode.UNKNOWN
details = ''
@@ -328,6 +330,8 @@ class _RequestIterator(object):
self._state.request = None
return request
+ raise AssertionError() # should never run
+
def _next(self):
with self._state.condition:
self._raise_or_start_receive_message()
@@ -390,7 +394,7 @@ def _call_behavior(rpc_event, state, behavior, argument, request_deserializer):
b'RPC Aborted')
elif exception not in state.rpc_errors:
details = 'Exception calling application: {}'.format(exception)
- logging.exception(details)
+ _LOGGER.exception(details)
_abort(state, rpc_event.call, cygrpc.StatusCode.unknown,
_common.encode(details))
return None, False
@@ -408,7 +412,7 @@ def _take_response_from_response_iterator(rpc_event, state, response_iterator):
b'RPC Aborted')
elif exception not in state.rpc_errors:
details = 'Exception iterating responses: {}'.format(exception)
- logging.exception(details)
+ _LOGGER.exception(details)
_abort(state, rpc_event.call, cygrpc.StatusCode.unknown,
_common.encode(details))
return None, False
@@ -617,7 +621,7 @@ def _handle_call(rpc_event, generic_handlers, interceptor_pipeline, thread_pool,
interceptor_pipeline)
except Exception as exception: # pylint: disable=broad-except
details = 'Exception servicing handler: {}'.format(exception)
- logging.exception(details)
+ _LOGGER.exception(details)
return _reject_rpc(rpc_event, cygrpc.StatusCode.unknown,
b'Error in service handler!'), None
if method_handler is None:
@@ -785,7 +789,16 @@ def _start(state):
thread.start()
-class Server(grpc.Server):
+def _validate_generic_rpc_handlers(generic_rpc_handlers):
+ for generic_rpc_handler in generic_rpc_handlers:
+ service_attribute = getattr(generic_rpc_handler, 'service', None)
+ if service_attribute is None:
+ raise AttributeError(
+ '"{}" must conform to grpc.GenericRpcHandler type but does '
+ 'not have "service" method!'.format(generic_rpc_handler))
+
+
+class _Server(grpc.Server):
# pylint: disable=too-many-arguments
def __init__(self, thread_pool, generic_handlers, interceptors, options,
@@ -798,6 +811,7 @@ class Server(grpc.Server):
thread_pool, maximum_concurrent_rpcs)
def add_generic_rpc_handlers(self, generic_rpc_handlers):
+ _validate_generic_rpc_handlers(generic_rpc_handlers)
_add_generic_handlers(self._state, generic_rpc_handlers)
def add_insecure_port(self, address):
@@ -815,3 +829,10 @@ class Server(grpc.Server):
def __del__(self):
_stop(self._state, None)
+
+
+def create_server(thread_pool, generic_rpc_handlers, interceptors, options,
+ maximum_concurrent_rpcs):
+ _validate_generic_rpc_handlers(generic_rpc_handlers)
+ return _Server(thread_pool, generic_rpc_handlers, interceptors, options,
+ maximum_concurrent_rpcs)
diff --git a/src/python/grpcio/grpc/_utilities.py b/src/python/grpcio/grpc/_utilities.py
index 25bd1ceae2..d90b34bcbd 100644
--- a/src/python/grpcio/grpc/_utilities.py
+++ b/src/python/grpcio/grpc/_utilities.py
@@ -116,6 +116,8 @@ class _ChannelReadyFuture(grpc.Future):
callable_util.call_logging_exceptions(
done_callback, _DONE_CALLBACK_EXCEPTION_LOG_MESSAGE, self)
+ return True
+
def cancelled(self):
with self._condition:
return self._cancelled
diff --git a/src/python/grpcio/grpc/beta/_server_adaptations.py b/src/python/grpcio/grpc/beta/_server_adaptations.py
index ccafec8951..80ac65b649 100644
--- a/src/python/grpcio/grpc/beta/_server_adaptations.py
+++ b/src/python/grpcio/grpc/beta/_server_adaptations.py
@@ -305,6 +305,7 @@ def _simple_method_handler(implementation, request_deserializer,
response_serializer, None, None, None,
_adapt_stream_stream_event(
implementation.stream_stream_event))
+ raise ValueError()
def _flatten_method_pair_map(method_pair_map):
diff --git a/src/python/grpcio/grpc/beta/utilities.py b/src/python/grpcio/grpc/beta/utilities.py
index b5d8aac71a..fe3ce606c9 100644
--- a/src/python/grpcio/grpc/beta/utilities.py
+++ b/src/python/grpcio/grpc/beta/utilities.py
@@ -85,6 +85,8 @@ class _ChannelReadyFuture(future.Future):
callable_util.call_logging_exceptions(
done_callback, _DONE_CALLBACK_EXCEPTION_LOG_MESSAGE, self)
+ return True
+
def cancelled(self):
with self._condition:
return self._cancelled
diff --git a/src/python/grpcio/grpc/experimental/session_cache.py b/src/python/grpcio/grpc/experimental/session_cache.py
new file mode 100644
index 0000000000..5c55f7c327
--- /dev/null
+++ b/src/python/grpcio/grpc/experimental/session_cache.py
@@ -0,0 +1,45 @@
+# Copyright 2018 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""gRPC's APIs for TLS Session Resumption support"""
+
+from grpc._cython import cygrpc as _cygrpc
+
+
+def ssl_session_cache_lru(capacity):
+ """Creates an SSLSessionCache with LRU replacement policy
+
+ Args:
+ capacity: Size of the cache
+
+ Returns:
+ An SSLSessionCache with LRU replacement policy that can be passed as a value for
+ the grpc.ssl_session_cache option to a grpc.Channel. SSL session caches are used
+ to store session tickets, which clients can present to resume previous TLS sessions
+ with a server.
+ """
+ return SSLSessionCache(_cygrpc.SSLSessionCacheLRU(capacity))
+
+
+class SSLSessionCache(object):
+ """An encapsulation of a session cache used for TLS session resumption.
+
+ Instances of this class can be passed to a Channel as values for the
+ grpc.ssl_session_cache option
+ """
+
+ def __init__(self, cache):
+ self._cache = cache
+
+ def __int__(self):
+ return int(self._cache)
diff --git a/src/python/grpcio/grpc/framework/foundation/callable_util.py b/src/python/grpcio/grpc/framework/foundation/callable_util.py
index b9b9c49f17..24daf3406f 100644
--- a/src/python/grpcio/grpc/framework/foundation/callable_util.py
+++ b/src/python/grpcio/grpc/framework/foundation/callable_util.py
@@ -21,6 +21,8 @@ import logging
import six
+_LOGGER = logging.getLogger(__name__)
+
class Outcome(six.with_metaclass(abc.ABCMeta)):
"""A sum type describing the outcome of some call.
@@ -53,7 +55,7 @@ def _call_logging_exceptions(behavior, message, *args, **kwargs):
return _EasyOutcome(Outcome.Kind.RETURNED, behavior(*args, **kwargs),
None)
except Exception as e: # pylint: disable=broad-except
- logging.exception(message)
+ _LOGGER.exception(message)
return _EasyOutcome(Outcome.Kind.RAISED, None, e)
diff --git a/src/python/grpcio/grpc/framework/foundation/logging_pool.py b/src/python/grpcio/grpc/framework/foundation/logging_pool.py
index f75df10042..216e3990db 100644
--- a/src/python/grpcio/grpc/framework/foundation/logging_pool.py
+++ b/src/python/grpcio/grpc/framework/foundation/logging_pool.py
@@ -17,6 +17,8 @@ import logging
from concurrent import futures
+_LOGGER = logging.getLogger(__name__)
+
def _wrap(behavior):
"""Wraps an arbitrary callable behavior in exception-logging."""
@@ -25,7 +27,7 @@ def _wrap(behavior):
try:
return behavior(*args, **kwargs)
except Exception:
- logging.exception(
+ _LOGGER.exception(
'Unexpected exception from %s executed in logging pool!',
behavior)
raise
diff --git a/src/python/grpcio/grpc/framework/foundation/stream_util.py b/src/python/grpcio/grpc/framework/foundation/stream_util.py
index 04631d9899..1faaf29bd7 100644
--- a/src/python/grpcio/grpc/framework/foundation/stream_util.py
+++ b/src/python/grpcio/grpc/framework/foundation/stream_util.py
@@ -19,6 +19,7 @@ import threading
from grpc.framework.foundation import stream
_NO_VALUE = object()
+_LOGGER = logging.getLogger(__name__)
class TransformingConsumer(stream.Consumer):
@@ -46,10 +47,10 @@ class IterableConsumer(stream.Consumer):
self._values = []
self._active = True
- def consume(self, stock_reply):
+ def consume(self, value):
with self._condition:
if self._active:
- self._values.append(stock_reply)
+ self._values.append(value)
self._condition.notify()
def terminate(self):
@@ -57,10 +58,10 @@ class IterableConsumer(stream.Consumer):
self._active = False
self._condition.notify()
- def consume_and_terminate(self, stock_reply):
+ def consume_and_terminate(self, value):
with self._condition:
if self._active:
- self._values.append(stock_reply)
+ self._values.append(value)
self._active = False
self._condition.notify()
@@ -103,7 +104,7 @@ class ThreadSwitchingConsumer(stream.Consumer):
else:
sink.consume(value)
except Exception as e: # pylint:disable=broad-except
- logging.exception(e)
+ _LOGGER.exception(e)
with self._lock:
if terminate:
diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py
index 5511bf9a32..05d4786f3f 100644
--- a/src/python/grpcio/grpc_core_dependencies.py
+++ b/src/python/grpcio/grpc_core_dependencies.py
@@ -64,6 +64,7 @@ CORE_SOURCE_FILES = [
'src/core/lib/channel/channel_stack.cc',
'src/core/lib/channel/channel_stack_builder.cc',
'src/core/lib/channel/channel_trace.cc',
+ 'src/core/lib/channel/channelz.cc',
'src/core/lib/channel/channelz_registry.cc',
'src/core/lib/channel/connected_channel.cc',
'src/core/lib/channel/handshaker.cc',
@@ -340,19 +341,20 @@ CORE_SOURCE_FILES = [
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc',
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc',
'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc',
+ 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c',
+ 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c',
'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c',
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc',
'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc',
'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc',
+ 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc',
'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc',
'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc',
- 'src/core/ext/filters/load_reporting/server_load_reporting_filter.cc',
- 'src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc',
- 'src/core/ext/census/grpc_context.cc',
+ 'src/cpp/ext/filters/census/grpc_context.cc',
'src/core/ext/filters/max_age/max_age_filter.cc',
'src/core/ext/filters/message_size/message_size_filter.cc',
'src/core/ext/filters/http/client_authority_filter.cc',
diff --git a/src/python/grpcio/grpc_version.py b/src/python/grpcio/grpc_version.py
index 57dc26dbeb..2eeaabc8b8 100644
--- a/src/python/grpcio/grpc_version.py
+++ b/src/python/grpcio/grpc_version.py
@@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!!
-VERSION = '1.13.0.dev0'
+VERSION = '1.14.0.dev0'
diff --git a/src/python/grpcio_health_checking/grpc_version.py b/src/python/grpcio_health_checking/grpc_version.py
index ba0d4a3b6d..f36de8d0fa 100644
--- a/src/python/grpcio_health_checking/grpc_version.py
+++ b/src/python/grpcio_health_checking/grpc_version.py
@@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_health_checking/grpc_version.py.template`!!!
-VERSION = '1.13.0.dev0'
+VERSION = '1.14.0.dev0'
diff --git a/src/python/grpcio_reflection/grpc_version.py b/src/python/grpcio_reflection/grpc_version.py
index ea2878d9ee..2249b07d9d 100644
--- a/src/python/grpcio_reflection/grpc_version.py
+++ b/src/python/grpcio_reflection/grpc_version.py
@@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_reflection/grpc_version.py.template`!!!
-VERSION = '1.13.0.dev0'
+VERSION = '1.14.0.dev0'
diff --git a/src/python/grpcio_testing/MANIFEST.in b/src/python/grpcio_testing/MANIFEST.in
new file mode 100644
index 0000000000..39b3565217
--- /dev/null
+++ b/src/python/grpcio_testing/MANIFEST.in
@@ -0,0 +1,3 @@
+include grpc_version.py
+recursive-include grpc_testing *.py
+global-exclude *.pyc
diff --git a/src/python/grpcio_testing/README.rst b/src/python/grpcio_testing/README.rst
new file mode 100644
index 0000000000..c699b80fb6
--- /dev/null
+++ b/src/python/grpcio_testing/README.rst
@@ -0,0 +1,10 @@
+gRPC Python Testing Package
+===========================
+
+Testing utilities for gRPC Python
+
+Dependencies
+------------
+
+Depends on the `grpcio` package, available from PyPI via `pip install grpcio`.
+
diff --git a/src/python/grpcio_testing/grpc_testing/__init__.py b/src/python/grpcio_testing/grpc_testing/__init__.py
index e87d0ffc96..65fdd1b8ca 100644
--- a/src/python/grpcio_testing/grpc_testing/__init__.py
+++ b/src/python/grpcio_testing/grpc_testing/__init__.py
@@ -14,9 +14,9 @@
"""Objects for use in testing gRPC Python-using application code."""
import abc
+import six
from google.protobuf import descriptor
-import six
import grpc
diff --git a/src/python/grpcio_testing/grpc_testing/_channel/_invocation.py b/src/python/grpcio_testing/grpc_testing/_channel/_invocation.py
index ebce652eeb..191b1c1726 100644
--- a/src/python/grpcio_testing/grpc_testing/_channel/_invocation.py
+++ b/src/python/grpcio_testing/grpc_testing/_channel/_invocation.py
@@ -18,6 +18,7 @@ import threading
import grpc
_NOT_YET_OBSERVED = object()
+_LOGGER = logging.getLogger(__name__)
def _cancel(handler):
@@ -248,7 +249,7 @@ def consume_requests(request_iterator, handler):
break
except Exception: # pylint: disable=broad-except
details = 'Exception iterating requests!'
- logging.exception(details)
+ _LOGGER.exception(details)
handler.cancel(grpc.StatusCode.UNKNOWN, details)
consumption = threading.Thread(target=_consume)
diff --git a/src/python/grpcio_testing/grpc_testing/_server/_handler.py b/src/python/grpcio_testing/grpc_testing/_server/_handler.py
index d4f50f6863..0e3404b0d0 100644
--- a/src/python/grpcio_testing/grpc_testing/_server/_handler.py
+++ b/src/python/grpcio_testing/grpc_testing/_server/_handler.py
@@ -105,10 +105,10 @@ class _Handler(Handler):
self._expiration_future.cancel()
self._condition.notify_all()
- def add_termination_callback(self, termination_callback):
+ def add_termination_callback(self, callback):
with self._condition:
if self._code is None:
- self._termination_callbacks.append(termination_callback)
+ self._termination_callbacks.append(callback)
return True
else:
return False
diff --git a/src/python/grpcio_testing/grpc_testing/_server/_rpc.py b/src/python/grpcio_testing/grpc_testing/_server/_rpc.py
index 2060e8daff..b856da100f 100644
--- a/src/python/grpcio_testing/grpc_testing/_server/_rpc.py
+++ b/src/python/grpcio_testing/grpc_testing/_server/_rpc.py
@@ -18,6 +18,8 @@ import threading
import grpc
from grpc_testing import _common
+_LOGGER = logging.getLogger(__name__)
+
class Rpc(object):
@@ -47,7 +49,7 @@ class Rpc(object):
try:
callback()
except Exception: # pylint: disable=broad-except
- logging.exception('Exception calling server-side callback!')
+ _LOGGER.exception('Exception calling server-side callback!')
callback_calling_thread = threading.Thread(target=call_back)
callback_calling_thread.start()
@@ -86,7 +88,7 @@ class Rpc(object):
def application_exception_abort(self, exception):
with self._condition:
if exception not in self._rpc_errors:
- logging.exception('Exception calling application!')
+ _LOGGER.exception('Exception calling application!')
self._abort(
grpc.StatusCode.UNKNOWN,
'Exception calling application: {}'.format(exception))
diff --git a/src/python/grpcio_testing/grpc_testing/_time.py b/src/python/grpcio_testing/grpc_testing/_time.py
index afbdad3524..75e6db3458 100644
--- a/src/python/grpcio_testing/grpc_testing/_time.py
+++ b/src/python/grpcio_testing/grpc_testing/_time.py
@@ -21,13 +21,15 @@ import time as _time
import grpc
import grpc_testing
+_LOGGER = logging.getLogger(__name__)
+
def _call(behaviors):
for behavior in behaviors:
try:
behavior()
except Exception: # pylint: disable=broad-except
- logging.exception('Exception calling behavior "%r"!', behavior)
+ _LOGGER.exception('Exception calling behavior "%r"!', behavior)
def _call_in_thread(behaviors):
diff --git a/src/python/grpcio_testing/grpc_version.py b/src/python/grpcio_testing/grpc_version.py
index 02f19f2283..a5b275aff6 100644
--- a/src/python/grpcio_testing/grpc_version.py
+++ b/src/python/grpcio_testing/grpc_version.py
@@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_testing/grpc_version.py.template`!!!
-VERSION = '1.13.0.dev0'
+VERSION = '1.14.0.dev0'
diff --git a/src/python/grpcio_tests/commands.py b/src/python/grpcio_tests/commands.py
index 42e01c18d3..a23c980017 100644
--- a/src/python/grpcio_tests/commands.py
+++ b/src/python/grpcio_tests/commands.py
@@ -119,6 +119,8 @@ class TestGevent(setuptools.Command):
# I have no idea why this doesn't work in gevent, but it shouldn't even be
# using the c-core
'testing._client_test.ClientTest.test_infinite_request_stream_real_time',
+ # TODO(https://github.com/grpc/grpc/issues/15743) enable this test
+ 'unit._session_cache_test.SSLSessionCacheTest.testSSLSessionCacheLRU',
# TODO(https://github.com/grpc/grpc/issues/14789) enable this test
'unit._server_ssl_cert_config_test',
# TODO(https://github.com/grpc/grpc/issues/14901) enable this test
diff --git a/src/python/grpcio_tests/grpc_version.py b/src/python/grpcio_tests/grpc_version.py
index 9d2e41644e..816dfb55bc 100644
--- a/src/python/grpcio_tests/grpc_version.py
+++ b/src/python/grpcio_tests/grpc_version.py
@@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_tests/grpc_version.py.template`!!!
-VERSION = '1.13.0.dev0'
+VERSION = '1.14.0.dev0'
diff --git a/src/python/grpcio_tests/tests/_loader.py b/src/python/grpcio_tests/tests/_loader.py
index be0af64646..80c107aa8e 100644
--- a/src/python/grpcio_tests/tests/_loader.py
+++ b/src/python/grpcio_tests/tests/_loader.py
@@ -48,12 +48,13 @@ class Loader(object):
# measure unnecessarily suffers)
coverage_context = coverage.Coverage(data_suffix=True)
coverage_context.start()
- modules = [importlib.import_module(name) for name in names]
- for module in modules:
- self.visit_module(module)
- for module in modules:
+ imported_modules = tuple(
+ importlib.import_module(name) for name in names)
+ for imported_module in imported_modules:
+ self.visit_module(imported_module)
+ for imported_module in imported_modules:
try:
- package_paths = module.__path__
+ package_paths = imported_module.__path__
except AttributeError:
continue
self.walk_packages(package_paths)
diff --git a/src/python/grpcio_tests/tests/_result.py b/src/python/grpcio_tests/tests/_result.py
index b105f18e78..e5378b7ea3 100644
--- a/src/python/grpcio_tests/tests/_result.py
+++ b/src/python/grpcio_tests/tests/_result.py
@@ -144,10 +144,6 @@ class AugmentedResult(unittest.TestResult):
super(AugmentedResult, self).startTestRun()
self.cases = dict()
- def stopTestRun(self):
- """See unittest.TestResult.stopTestRun."""
- super(AugmentedResult, self).stopTestRun()
-
def startTest(self, test):
"""See unittest.TestResult.startTest."""
super(AugmentedResult, self).startTest(test)
@@ -155,19 +151,19 @@ class AugmentedResult(unittest.TestResult):
self.cases[case_id] = CaseResult(
id=case_id, name=test.id(), kind=CaseResult.Kind.RUNNING)
- def addError(self, test, error):
+ def addError(self, test, err):
"""See unittest.TestResult.addError."""
- super(AugmentedResult, self).addError(test, error)
+ super(AugmentedResult, self).addError(test, err)
case_id = self.id_map(test)
self.cases[case_id] = self.cases[case_id].updated(
- kind=CaseResult.Kind.ERROR, traceback=error)
+ kind=CaseResult.Kind.ERROR, traceback=err)
- def addFailure(self, test, error):
+ def addFailure(self, test, err):
"""See unittest.TestResult.addFailure."""
- super(AugmentedResult, self).addFailure(test, error)
+ super(AugmentedResult, self).addFailure(test, err)
case_id = self.id_map(test)
self.cases[case_id] = self.cases[case_id].updated(
- kind=CaseResult.Kind.FAILURE, traceback=error)
+ kind=CaseResult.Kind.FAILURE, traceback=err)
def addSuccess(self, test):
"""See unittest.TestResult.addSuccess."""
@@ -183,12 +179,12 @@ class AugmentedResult(unittest.TestResult):
self.cases[case_id] = self.cases[case_id].updated(
kind=CaseResult.Kind.SKIP, skip_reason=reason)
- def addExpectedFailure(self, test, error):
+ def addExpectedFailure(self, test, err):
"""See unittest.TestResult.addExpectedFailure."""
- super(AugmentedResult, self).addExpectedFailure(test, error)
+ super(AugmentedResult, self).addExpectedFailure(test, err)
case_id = self.id_map(test)
self.cases[case_id] = self.cases[case_id].updated(
- kind=CaseResult.Kind.EXPECTED_FAILURE, traceback=error)
+ kind=CaseResult.Kind.EXPECTED_FAILURE, traceback=err)
def addUnexpectedSuccess(self, test):
"""See unittest.TestResult.addUnexpectedSuccess."""
@@ -249,13 +245,6 @@ class CoverageResult(AugmentedResult):
self.coverage_context.save()
self.coverage_context = None
- def stopTestRun(self):
- """See unittest.TestResult.stopTestRun."""
- super(CoverageResult, self).stopTestRun()
- # TODO(atash): Dig deeper into why the following line fails to properly
- # combine coverage data from the Cython plugin.
- #coverage.Coverage().combine()
-
class _Colors(object):
"""Namespaced constants for terminal color magic numbers."""
@@ -295,16 +284,16 @@ class TerminalResult(CoverageResult):
self.out.write(summary(self))
self.out.flush()
- def addError(self, test, error):
+ def addError(self, test, err):
"""See unittest.TestResult.addError."""
- super(TerminalResult, self).addError(test, error)
+ super(TerminalResult, self).addError(test, err)
self.out.write(
_Colors.FAIL + 'ERROR {}\n'.format(test.id()) + _Colors.END)
self.out.flush()
- def addFailure(self, test, error):
+ def addFailure(self, test, err):
"""See unittest.TestResult.addFailure."""
- super(TerminalResult, self).addFailure(test, error)
+ super(TerminalResult, self).addFailure(test, err)
self.out.write(
_Colors.FAIL + 'FAILURE {}\n'.format(test.id()) + _Colors.END)
self.out.flush()
@@ -323,9 +312,9 @@ class TerminalResult(CoverageResult):
_Colors.INFO + 'SKIP {}\n'.format(test.id()) + _Colors.END)
self.out.flush()
- def addExpectedFailure(self, test, error):
+ def addExpectedFailure(self, test, err):
"""See unittest.TestResult.addExpectedFailure."""
- super(TerminalResult, self).addExpectedFailure(test, error)
+ super(TerminalResult, self).addExpectedFailure(test, err)
self.out.write(
_Colors.INFO + 'FAILURE_OK {}\n'.format(test.id()) + _Colors.END)
self.out.flush()
diff --git a/src/python/grpcio_tests/tests/interop/methods.py b/src/python/grpcio_tests/tests/interop/methods.py
index b728ffd704..cda15a68a3 100644
--- a/src/python/grpcio_tests/tests/interop/methods.py
+++ b/src/python/grpcio_tests/tests/interop/methods.py
@@ -144,8 +144,8 @@ def _large_unary_common_behavior(stub, fill_username, fill_oauth_scope,
def _empty_unary(stub):
response = stub.EmptyCall(empty_pb2.Empty())
if not isinstance(response, empty_pb2.Empty):
- raise TypeError('response is of type "%s", not empty_pb2.Empty!',
- type(response))
+ raise TypeError(
+ 'response is of type "%s", not empty_pb2.Empty!' % type(response))
def _large_unary(stub):
diff --git a/src/python/grpcio_tests/tests/interop/server.py b/src/python/grpcio_tests/tests/interop/server.py
index 0810de2394..fd28d498a1 100644
--- a/src/python/grpcio_tests/tests/interop/server.py
+++ b/src/python/grpcio_tests/tests/interop/server.py
@@ -26,6 +26,7 @@ from tests.interop import resources
from tests.unit import test_common
_ONE_DAY_IN_SECONDS = 60 * 60 * 24
+_LOGGER = logging.getLogger(__name__)
def serve():
@@ -52,14 +53,14 @@ def serve():
server.add_insecure_port('[::]:{}'.format(args.port))
server.start()
- logging.info('Server serving.')
+ _LOGGER.info('Server serving.')
try:
while True:
time.sleep(_ONE_DAY_IN_SECONDS)
except BaseException as e:
- logging.info('Caught exception "%s"; stopping server...', e)
+ _LOGGER.info('Caught exception "%s"; stopping server...', e)
server.stop(None)
- logging.info('Server stopped; exiting.')
+ _LOGGER.info('Server stopped; exiting.')
if __name__ == '__main__':
diff --git a/src/python/grpcio_tests/tests/tests.json b/src/python/grpcio_tests/tests/tests.json
index 0d94426413..ebc41c63f0 100644
--- a/src/python/grpcio_tests/tests/tests.json
+++ b/src/python/grpcio_tests/tests/tests.json
@@ -53,6 +53,8 @@
"unit._server_ssl_cert_config_test.ServerSSLCertReloadTestCertConfigReuse",
"unit._server_ssl_cert_config_test.ServerSSLCertReloadTestWithClientAuth",
"unit._server_ssl_cert_config_test.ServerSSLCertReloadTestWithoutClientAuth",
+ "unit._server_test.ServerTest",
+ "unit._session_cache_test.SSLSessionCacheTest",
"unit.beta._beta_features_test.BetaFeaturesTest",
"unit.beta._beta_features_test.ContextManagementAndLifecycleTest",
"unit.beta._connectivity_channel_test.ConnectivityStatesTest",
diff --git a/src/python/grpcio_tests/tests/unit/_auth_context_test.py b/src/python/grpcio_tests/tests/unit/_auth_context_test.py
index 8c1a30e032..d174051070 100644
--- a/src/python/grpcio_tests/tests/unit/_auth_context_test.py
+++ b/src/python/grpcio_tests/tests/unit/_auth_context_test.py
@@ -18,6 +18,7 @@ import unittest
import grpc
from grpc import _channel
+from grpc.experimental import session_cache
import six
from tests.unit import test_common
@@ -140,6 +141,50 @@ class AuthContextTest(unittest.TestCase):
self.assertSequenceEqual([b'*.test.google.com'],
auth_ctx['x509_common_name'])
+ def _do_one_shot_client_rpc(self, channel_creds, channel_options, port,
+ expect_ssl_session_reused):
+ channel = grpc.secure_channel(
+ 'localhost:{}'.format(port), channel_creds, options=channel_options)
+ response = channel.unary_unary(_UNARY_UNARY)(_REQUEST)
+ auth_data = pickle.loads(response)
+ self.assertEqual(expect_ssl_session_reused,
+ auth_data[_AUTH_CTX]['ssl_session_reused'])
+ channel.close()
+
+ def testSessionResumption(self):
+ # Set up a secure server
+ handler = grpc.method_handlers_generic_handler('test', {
+ 'UnaryUnary':
+ grpc.unary_unary_rpc_method_handler(handle_unary_unary)
+ })
+ server = test_common.test_server()
+ server.add_generic_rpc_handlers((handler,))
+ server_cred = grpc.ssl_server_credentials(_SERVER_CERTS)
+ port = server.add_secure_port('[::]:0', server_cred)
+ server.start()
+
+ # Create a cache for TLS session tickets
+ cache = session_cache.ssl_session_cache_lru(1)
+ channel_creds = grpc.ssl_channel_credentials(
+ root_certificates=_TEST_ROOT_CERTIFICATES)
+ channel_options = _PROPERTY_OPTIONS + (
+ ('grpc.ssl_session_cache', cache),)
+
+ # Initial connection has no session to resume
+ self._do_one_shot_client_rpc(
+ channel_creds,
+ channel_options,
+ port,
+ expect_ssl_session_reused=[b'false'])
+
+ # Subsequent connections resume sessions
+ self._do_one_shot_client_rpc(
+ channel_creds,
+ channel_options,
+ port,
+ expect_ssl_session_reused=[b'true'])
+ server.stop(None)
+
if __name__ == '__main__':
unittest.main(verbosity=2)
diff --git a/src/python/grpcio_tests/tests/unit/_junkdrawer/stock_pb2.py b/src/python/grpcio_tests/tests/unit/_junkdrawer/stock_pb2.py
deleted file mode 100644
index 2bf1e1cc0d..0000000000
--- a/src/python/grpcio_tests/tests/unit/_junkdrawer/stock_pb2.py
+++ /dev/null
@@ -1,164 +0,0 @@
-# Copyright 2015 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# TODO(nathaniel): Remove this from source control after having made
-# generation from the stock.proto source part of GRPC's build-and-test
-# process.
-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: stock.proto
-
-import sys
-_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode('latin1'))
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-from google.protobuf import descriptor_pb2
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-DESCRIPTOR = _descriptor.FileDescriptor(
- name='stock.proto',
- package='stock',
- serialized_pb=_b(
- '\n\x0bstock.proto\x12\x05stock\">\n\x0cStockRequest\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\x1e\n\x13num_trades_to_watch\x18\x02 \x01(\x05:\x01\x30\"+\n\nStockReply\x12\r\n\x05price\x18\x01 \x01(\x02\x12\x0e\n\x06symbol\x18\x02 \x01(\t2\x96\x02\n\x05Stock\x12=\n\x11GetLastTradePrice\x12\x13.stock.StockRequest\x1a\x11.stock.StockReply\"\x00\x12I\n\x19GetLastTradePriceMultiple\x12\x13.stock.StockRequest\x1a\x11.stock.StockReply\"\x00(\x01\x30\x01\x12?\n\x11WatchFutureTrades\x12\x13.stock.StockRequest\x1a\x11.stock.StockReply\"\x00\x30\x01\x12\x42\n\x14GetHighestTradePrice\x12\x13.stock.StockRequest\x1a\x11.stock.StockReply\"\x00(\x01'
- ))
-_sym_db.RegisterFileDescriptor(DESCRIPTOR)
-
-_STOCKREQUEST = _descriptor.Descriptor(
- name='StockRequest',
- full_name='stock.StockRequest',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='symbol',
- full_name='stock.StockRequest.symbol',
- index=0,
- number=1,
- type=9,
- cpp_type=9,
- label=1,
- has_default_value=False,
- default_value=_b("").decode('utf-8'),
- message_type=None,
- enum_type=None,
- containing_type=None,
- is_extension=False,
- extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='num_trades_to_watch',
- full_name='stock.StockRequest.num_trades_to_watch',
- index=1,
- number=2,
- type=5,
- cpp_type=1,
- label=1,
- has_default_value=True,
- default_value=0,
- message_type=None,
- enum_type=None,
- containing_type=None,
- is_extension=False,
- extension_scope=None,
- options=None),
- ],
- extensions=[],
- nested_types=[],
- enum_types=[],
- options=None,
- is_extendable=False,
- extension_ranges=[],
- oneofs=[],
- serialized_start=22,
- serialized_end=84,)
-
-_STOCKREPLY = _descriptor.Descriptor(
- name='StockReply',
- full_name='stock.StockReply',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='price',
- full_name='stock.StockReply.price',
- index=0,
- number=1,
- type=2,
- cpp_type=6,
- label=1,
- has_default_value=False,
- default_value=0,
- message_type=None,
- enum_type=None,
- containing_type=None,
- is_extension=False,
- extension_scope=None,
- options=None),
- _descriptor.FieldDescriptor(
- name='symbol',
- full_name='stock.StockReply.symbol',
- index=1,
- number=2,
- type=9,
- cpp_type=9,
- label=1,
- has_default_value=False,
- default_value=_b("").decode('utf-8'),
- message_type=None,
- enum_type=None,
- containing_type=None,
- is_extension=False,
- extension_scope=None,
- options=None),
- ],
- extensions=[],
- nested_types=[],
- enum_types=[],
- options=None,
- is_extendable=False,
- extension_ranges=[],
- oneofs=[],
- serialized_start=86,
- serialized_end=129,)
-
-DESCRIPTOR.message_types_by_name['StockRequest'] = _STOCKREQUEST
-DESCRIPTOR.message_types_by_name['StockReply'] = _STOCKREPLY
-
-StockRequest = _reflection.GeneratedProtocolMessageType(
- 'StockRequest',
- (_message.Message,),
- dict(
- DESCRIPTOR=_STOCKREQUEST,
- __module__='stock_pb2'
- # @@protoc_insertion_point(class_scope:stock.StockRequest)
- ))
-_sym_db.RegisterMessage(StockRequest)
-
-StockReply = _reflection.GeneratedProtocolMessageType(
- 'StockReply',
- (_message.Message,),
- dict(
- DESCRIPTOR=_STOCKREPLY,
- __module__='stock_pb2'
- # @@protoc_insertion_point(class_scope:stock.StockReply)
- ))
-_sym_db.RegisterMessage(StockReply)
-
-# @@protoc_insertion_point(module_scope)
diff --git a/src/python/grpcio_tests/tests/unit/_server_test.py b/src/python/grpcio_tests/tests/unit/_server_test.py
new file mode 100644
index 0000000000..acf4a17921
--- /dev/null
+++ b/src/python/grpcio_tests/tests/unit/_server_test.py
@@ -0,0 +1,52 @@
+# Copyright 2018 The gRPC Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from concurrent import futures
+import unittest
+
+import grpc
+
+
+class _ActualGenericRpcHandler(grpc.GenericRpcHandler):
+
+ def service(self, handler_call_details):
+ return None
+
+
+class ServerTest(unittest.TestCase):
+
+ def test_not_a_generic_rpc_handler_at_construction(self):
+ with self.assertRaises(AttributeError) as exception_context:
+ grpc.server(
+ futures.ThreadPoolExecutor(max_workers=5),
+ handlers=[
+ _ActualGenericRpcHandler(),
+ object(),
+ ])
+ self.assertIn('grpc.GenericRpcHandler',
+ str(exception_context.exception))
+
+ def test_not_a_generic_rpc_handler_after_construction(self):
+ server = grpc.server(futures.ThreadPoolExecutor(max_workers=5))
+ with self.assertRaises(AttributeError) as exception_context:
+ server.add_generic_rpc_handlers([
+ _ActualGenericRpcHandler(),
+ object(),
+ ])
+ self.assertIn('grpc.GenericRpcHandler',
+ str(exception_context.exception))
+
+
+if __name__ == '__main__':
+ unittest.main(verbosity=2)
diff --git a/src/python/grpcio_tests/tests/unit/_session_cache_test.py b/src/python/grpcio_tests/tests/unit/_session_cache_test.py
new file mode 100644
index 0000000000..b4e4670fa7
--- /dev/null
+++ b/src/python/grpcio_tests/tests/unit/_session_cache_test.py
@@ -0,0 +1,145 @@
+# Copyright 2018 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Tests experimental TLS Session Resumption API"""
+
+import pickle
+import unittest
+
+import grpc
+from grpc import _channel
+from grpc.experimental import session_cache
+
+from tests.unit import test_common
+from tests.unit import resources
+
+_REQUEST = b'\x00\x00\x00'
+_RESPONSE = b'\x00\x00\x00'
+
+_UNARY_UNARY = '/test/UnaryUnary'
+
+_SERVER_HOST_OVERRIDE = 'foo.test.google.fr'
+_ID = 'id'
+_ID_KEY = 'id_key'
+_AUTH_CTX = 'auth_ctx'
+
+_PRIVATE_KEY = resources.private_key()
+_CERTIFICATE_CHAIN = resources.certificate_chain()
+_TEST_ROOT_CERTIFICATES = resources.test_root_certificates()
+_SERVER_CERTS = ((_PRIVATE_KEY, _CERTIFICATE_CHAIN),)
+_PROPERTY_OPTIONS = ((
+ 'grpc.ssl_target_name_override',
+ _SERVER_HOST_OVERRIDE,
+),)
+
+
+def handle_unary_unary(request, servicer_context):
+ return pickle.dumps({
+ _ID: servicer_context.peer_identities(),
+ _ID_KEY: servicer_context.peer_identity_key(),
+ _AUTH_CTX: servicer_context.auth_context()
+ })
+
+
+def start_secure_server():
+ handler = grpc.method_handlers_generic_handler('test', {
+ 'UnaryUnary':
+ grpc.unary_unary_rpc_method_handler(handle_unary_unary)
+ })
+ server = test_common.test_server()
+ server.add_generic_rpc_handlers((handler,))
+ server_cred = grpc.ssl_server_credentials(_SERVER_CERTS)
+ port = server.add_secure_port('[::]:0', server_cred)
+ server.start()
+
+ return server, port
+
+
+class SSLSessionCacheTest(unittest.TestCase):
+
+ def _do_one_shot_client_rpc(self, channel_creds, channel_options, port,
+ expect_ssl_session_reused):
+ channel = grpc.secure_channel(
+ 'localhost:{}'.format(port), channel_creds, options=channel_options)
+ response = channel.unary_unary(_UNARY_UNARY)(_REQUEST)
+ auth_data = pickle.loads(response)
+ self.assertEqual(expect_ssl_session_reused,
+ auth_data[_AUTH_CTX]['ssl_session_reused'])
+ channel.close()
+
+ def testSSLSessionCacheLRU(self):
+ server_1, port_1 = start_secure_server()
+
+ cache = session_cache.ssl_session_cache_lru(1)
+ channel_creds = grpc.ssl_channel_credentials(
+ root_certificates=_TEST_ROOT_CERTIFICATES)
+ channel_options = _PROPERTY_OPTIONS + (
+ ('grpc.ssl_session_cache', cache),)
+
+ # Initial connection has no session to resume
+ self._do_one_shot_client_rpc(
+ channel_creds,
+ channel_options,
+ port_1,
+ expect_ssl_session_reused=[b'false'])
+
+ # Connection to server_1 resumes from initial session
+ self._do_one_shot_client_rpc(
+ channel_creds,
+ channel_options,
+ port_1,
+ expect_ssl_session_reused=[b'true'])
+
+ # Connection to a different server with the same name overwrites the cache entry
+ server_2, port_2 = start_secure_server()
+ self._do_one_shot_client_rpc(
+ channel_creds,
+ channel_options,
+ port_2,
+ expect_ssl_session_reused=[b'false'])
+ self._do_one_shot_client_rpc(
+ channel_creds,
+ channel_options,
+ port_2,
+ expect_ssl_session_reused=[b'true'])
+ server_2.stop(None)
+
+ # Connection to server_1 now falls back to full TLS handshake
+ self._do_one_shot_client_rpc(
+ channel_creds,
+ channel_options,
+ port_1,
+ expect_ssl_session_reused=[b'false'])
+
+ # Re-creating server_1 causes old sessions to become invalid
+ server_1.stop(None)
+ server_1, port_1 = start_secure_server()
+
+ # Old sessions should no longer be valid
+ self._do_one_shot_client_rpc(
+ channel_creds,
+ channel_options,
+ port_1,
+ expect_ssl_session_reused=[b'false'])
+
+ # Resumption should work for subsequent connections
+ self._do_one_shot_client_rpc(
+ channel_creds,
+ channel_options,
+ port_1,
+ expect_ssl_session_reused=[b'true'])
+ server_1.stop(None)
+
+
+if __name__ == '__main__':
+ unittest.main(verbosity=2)
diff --git a/src/ruby/end2end/multiple_killed_watching_threads_driver.rb b/src/ruby/end2end/multiple_killed_watching_threads_driver.rb
index 8ec2073d98..7b39f5a347 100755
--- a/src/ruby/end2end/multiple_killed_watching_threads_driver.rb
+++ b/src/ruby/end2end/multiple_killed_watching_threads_driver.rb
@@ -58,10 +58,6 @@ def main
run_multiple_killed_watches(10, 0.1)
STDERR.puts '1000 iterations, sleep 0.001 before killing thread'
run_multiple_killed_watches(1000, 0.001)
- STDERR.puts '10000 iterations, sleep 0.00001 before killing thread'
- run_multiple_killed_watches(10_000, 0.00001)
- STDERR.puts '20000 iterations, sleep 0.00001 before killing thread'
- run_multiple_killed_watches(20_000, 0.00001)
end
main
diff --git a/src/ruby/end2end/package_with_underscore_checker.rb b/src/ruby/end2end/package_with_underscore_checker.rb
new file mode 100644
index 0000000000..27ea00ffa7
--- /dev/null
+++ b/src/ruby/end2end/package_with_underscore_checker.rb
@@ -0,0 +1,54 @@
+# Copyright 2018 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+require 'open3'
+require 'tmpdir'
+
+def main
+ root_dir = File.join(File.dirname(__FILE__), '..', '..', '..')
+ pb_dir = File.join(root_dir, 'src', 'ruby', 'end2end', 'protos')
+
+ fail 'CONFIG env variable unexpectedly unset' unless ENV['CONFIG']
+ bins_sub_dir = ENV['CONFIG']
+ bins_dir = File.join(root_dir, 'bins', bins_sub_dir)
+
+ plugin = File.join(bins_dir, 'grpc_ruby_plugin')
+ protoc = File.join(bins_dir, 'protobuf', 'protoc')
+
+ got = nil
+
+ Dir.mktmpdir do |tmp_dir|
+ gen_out = File.join(tmp_dir, 'package_with_underscore', 'service_services_pb.rb')
+
+ pid = spawn(
+ protoc,
+ "--proto_path=#{pb_dir}",
+ 'package_with_underscore/service.proto',
+ "--grpc_out=#{tmp_dir}",
+ "--plugin=protoc-gen-grpc=#{plugin}"
+ )
+ Process.waitpid2(pid)
+ File.open(gen_out) { |f| got = f.read }
+ end
+
+ correct_modularized_rpc = 'rpc :TestOne, ' \
+ 'Grpc::Testing::PackageWithUnderscore::Data::Request, ' \
+ 'Grpc::Testing::PackageWithUnderscore::Data::Response'
+
+ return if got.include?(correct_modularized_rpc)
+
+ fail 'generated file does not match with correct_modularized_rpc'
+end
+
+main
diff --git a/src/ruby/spec/pb/package_with_underscore/data.proto b/src/ruby/end2end/protos/package_with_underscore/data.proto
index 2706f1d7be..2706f1d7be 100644
--- a/src/ruby/spec/pb/package_with_underscore/data.proto
+++ b/src/ruby/end2end/protos/package_with_underscore/data.proto
diff --git a/src/ruby/spec/pb/package_with_underscore/service.proto b/src/ruby/end2end/protos/package_with_underscore/service.proto
index 814c7898cd..814c7898cd 100644
--- a/src/ruby/spec/pb/package_with_underscore/service.proto
+++ b/src/ruby/end2end/protos/package_with_underscore/service.proto
diff --git a/src/ruby/ext/grpc/rb_channel_credentials.c b/src/ruby/ext/grpc/rb_channel_credentials.c
index b23a32caf1..178224c6e0 100644
--- a/src/ruby/ext/grpc/rb_channel_credentials.c
+++ b/src/ruby/ext/grpc/rb_channel_credentials.c
@@ -159,12 +159,12 @@ static VALUE grpc_rb_channel_credentials_init(int argc, VALUE* argv,
pem_root_certs_cstr = RSTRING_PTR(pem_root_certs);
}
if (pem_private_key == Qnil && pem_cert_chain == Qnil) {
- creds = grpc_ssl_credentials_create(pem_root_certs_cstr, NULL, NULL);
+ creds = grpc_ssl_credentials_create(pem_root_certs_cstr, NULL, NULL, NULL);
} 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, NULL);
}
if (creds == NULL) {
rb_raise(rb_eRuntimeError, "could not create a credentials, not sure why");
diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.c b/src/ruby/ext/grpc/rb_grpc_imports.generated.c
index 02f84c0b96..031699ce8e 100644
--- a/src/ruby/ext/grpc/rb_grpc_imports.generated.c
+++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.c
@@ -68,8 +68,6 @@ grpc_channel_get_info_type grpc_channel_get_info_import;
grpc_insecure_channel_create_type grpc_insecure_channel_create_import;
grpc_lame_client_channel_create_type grpc_lame_client_channel_create_import;
grpc_channel_destroy_type grpc_channel_destroy_import;
-grpc_channel_get_trace_type grpc_channel_get_trace_import;
-grpc_channel_get_uuid_type grpc_channel_get_uuid_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;
@@ -316,8 +314,6 @@ void grpc_rb_load_imports(HMODULE library) {
grpc_insecure_channel_create_import = (grpc_insecure_channel_create_type) GetProcAddress(library, "grpc_insecure_channel_create");
grpc_lame_client_channel_create_import = (grpc_lame_client_channel_create_type) GetProcAddress(library, "grpc_lame_client_channel_create");
grpc_channel_destroy_import = (grpc_channel_destroy_type) GetProcAddress(library, "grpc_channel_destroy");
- grpc_channel_get_trace_import = (grpc_channel_get_trace_type) GetProcAddress(library, "grpc_channel_get_trace");
- grpc_channel_get_uuid_import = (grpc_channel_get_uuid_type) GetProcAddress(library, "grpc_channel_get_uuid");
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");
diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.h b/src/ruby/ext/grpc/rb_grpc_imports.generated.h
index b2186a69aa..474405ae3f 100644
--- a/src/ruby/ext/grpc/rb_grpc_imports.generated.h
+++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.h
@@ -179,12 +179,6 @@ extern grpc_lame_client_channel_create_type grpc_lame_client_channel_create_impo
typedef void(*grpc_channel_destroy_type)(grpc_channel* channel);
extern grpc_channel_destroy_type grpc_channel_destroy_import;
#define grpc_channel_destroy grpc_channel_destroy_import
-typedef char*(*grpc_channel_get_trace_type)(grpc_channel* channel);
-extern grpc_channel_get_trace_type grpc_channel_get_trace_import;
-#define grpc_channel_get_trace grpc_channel_get_trace_import
-typedef intptr_t(*grpc_channel_get_uuid_type)(grpc_channel* channel);
-extern grpc_channel_get_uuid_type grpc_channel_get_uuid_import;
-#define grpc_channel_get_uuid grpc_channel_get_uuid_import
typedef grpc_call_error(*grpc_call_cancel_type)(grpc_call* call, void* reserved);
extern grpc_call_cancel_type grpc_call_cancel_import;
#define grpc_call_cancel grpc_call_cancel_import
@@ -317,7 +311,7 @@ extern grpc_google_default_credentials_create_type grpc_google_default_credentia
typedef void(*grpc_set_ssl_roots_override_callback_type)(grpc_ssl_roots_override_callback cb);
extern grpc_set_ssl_roots_override_callback_type grpc_set_ssl_roots_override_callback_import;
#define grpc_set_ssl_roots_override_callback grpc_set_ssl_roots_override_callback_import
-typedef grpc_channel_credentials*(*grpc_ssl_credentials_create_type)(const char* pem_root_certs, grpc_ssl_pem_key_cert_pair* pem_key_cert_pair, void* reserved);
+typedef grpc_channel_credentials*(*grpc_ssl_credentials_create_type)(const char* pem_root_certs, grpc_ssl_pem_key_cert_pair* pem_key_cert_pair, const verify_peer_options* verify_options, void* reserved);
extern grpc_ssl_credentials_create_type grpc_ssl_credentials_create_import;
#define grpc_ssl_credentials_create grpc_ssl_credentials_create_import
typedef void(*grpc_call_credentials_release_type)(grpc_call_credentials* creds);
diff --git a/src/ruby/lib/grpc/generic/active_call.rb b/src/ruby/lib/grpc/generic/active_call.rb
index 8c3aa284aa..688726ef4a 100644
--- a/src/ruby/lib/grpc/generic/active_call.rb
+++ b/src/ruby/lib/grpc/generic/active_call.rb
@@ -116,10 +116,11 @@ module GRPC
# Sends the initial metadata that has yet to be sent.
# Does nothing if metadata has already been sent for this call.
- def send_initial_metadata
+ def send_initial_metadata(new_metadata = {})
@send_initial_md_mutex.synchronize do
return if @metadata_sent
- @metadata_tag = ActiveCall.client_invoke(@call, @metadata_to_send)
+ @metadata_to_send.merge!(new_metadata)
+ ActiveCall.client_invoke(@call, @metadata_to_send)
@metadata_sent = true
end
end
@@ -321,18 +322,22 @@ module GRPC
# @return [Enumerator] if no block was given
def each_remote_read_then_finish
return enum_for(:each_remote_read_then_finish) unless block_given?
- begin
- loop do
- resp = remote_read
- if resp.nil? # the last response was received
- receive_and_check_status
- break
+ loop do
+ resp =
+ begin
+ remote_read
+ rescue GRPC::Core::CallError => e
+ GRPC.logger.warn("In each_remote_read_then_finish: #{e}")
+ nil
end
- yield resp
- end
- ensure
- set_input_stream_done
+
+ break if resp.nil? # the last response was received
+ yield resp
end
+
+ receive_and_check_status
+ ensure
+ set_input_stream_done
end
# request_response sends a request to a GRPC server, and returns the
@@ -388,7 +393,7 @@ module GRPC
def client_streamer(requests, metadata: {})
raise_error_if_already_executed
begin
- merge_metadata_and_send_if_not_already_sent(metadata)
+ send_initial_metadata(metadata)
requests.each { |r| @call.run_batch(SEND_MESSAGE => @marshal.call(r)) }
rescue GRPC::Core::CallError => e
receive_and_check_status # check for Cancelled
@@ -490,7 +495,7 @@ module GRPC
raise_error_if_already_executed
# Metadata might have already been sent if this is an operation view
begin
- merge_metadata_and_send_if_not_already_sent(metadata)
+ send_initial_metadata(metadata)
rescue GRPC::Core::CallError => e
batch_result = @call.run_batch(RECV_STATUS_ON_CLIENT => nil)
set_input_stream_done
@@ -571,15 +576,6 @@ module GRPC
end
end
- def merge_metadata_and_send_if_not_already_sent(new_metadata = {})
- @send_initial_md_mutex.synchronize do
- return if @metadata_sent
- @metadata_to_send.merge!(new_metadata)
- @call.run_batch(SEND_INITIAL_METADATA => @metadata_to_send)
- @metadata_sent = true
- end
- end
-
def attach_peer_cert(peer_cert)
@peer_cert = peer_cert
end
diff --git a/src/ruby/lib/grpc/version.rb b/src/ruby/lib/grpc/version.rb
index 15f375100a..902d59bd71 100644
--- a/src/ruby/lib/grpc/version.rb
+++ b/src/ruby/lib/grpc/version.rb
@@ -14,5 +14,5 @@
# GRPC contains the General RPC module.
module GRPC
- VERSION = '1.13.0.dev'
+ VERSION = '1.14.0.dev'
end
diff --git a/src/ruby/spec/call_credentials_spec.rb b/src/ruby/spec/call_credentials_spec.rb
index 86f30b46f1..d949ba2235 100644
--- a/src/ruby/spec/call_credentials_spec.rb
+++ b/src/ruby/spec/call_credentials_spec.rb
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require 'grpc'
+require 'spec_helper'
describe GRPC::Core::CallCredentials do
CallCredentials = GRPC::Core::CallCredentials
diff --git a/src/ruby/spec/call_spec.rb b/src/ruby/spec/call_spec.rb
index 1cc0500242..22d345f658 100644
--- a/src/ruby/spec/call_spec.rb
+++ b/src/ruby/spec/call_spec.rb
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require 'grpc'
+require 'spec_helper'
include GRPC::Core::StatusCodes
diff --git a/src/ruby/spec/channel_credentials_spec.rb b/src/ruby/spec/channel_credentials_spec.rb
index e53f316208..b05e5aebf8 100644
--- a/src/ruby/spec/channel_credentials_spec.rb
+++ b/src/ruby/spec/channel_credentials_spec.rb
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require 'grpc'
+require 'spec_helper'
describe GRPC::Core::ChannelCredentials do
ChannelCredentials = GRPC::Core::ChannelCredentials
diff --git a/src/ruby/spec/channel_spec.rb b/src/ruby/spec/channel_spec.rb
index 5b2e355963..3c9eca47ec 100644
--- a/src/ruby/spec/channel_spec.rb
+++ b/src/ruby/spec/channel_spec.rb
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require 'grpc'
+require 'spec_helper'
def load_test_certs
test_root = File.join(File.dirname(__FILE__), 'testdata')
diff --git a/src/ruby/spec/client_auth_spec.rb b/src/ruby/spec/client_auth_spec.rb
index b955ad231e..c563ed3227 100644
--- a/src/ruby/spec/client_auth_spec.rb
+++ b/src/ruby/spec/client_auth_spec.rb
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require 'grpc'
+require 'spec_helper'
def create_channel_creds
test_root = File.join(File.dirname(__FILE__), 'testdata')
@@ -39,17 +39,6 @@ def create_server_creds
true) # force client auth
end
-# A test message
-class EchoMsg
- def self.marshal(_o)
- ''
- end
-
- def self.unmarshal(_o)
- EchoMsg.new
- end
-end
-
# a test service that checks the cert of its peer
class SslTestService
include GRPC::GenericService
diff --git a/src/ruby/spec/client_server_spec.rb b/src/ruby/spec/client_server_spec.rb
index afbfb0bc43..afde5073a6 100644
--- a/src/ruby/spec/client_server_spec.rb
+++ b/src/ruby/spec/client_server_spec.rb
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require 'grpc'
+require 'spec_helper'
include GRPC::Core
diff --git a/src/ruby/spec/compression_options_spec.rb b/src/ruby/spec/compression_options_spec.rb
index 03c3cd9f07..05318e6686 100644
--- a/src/ruby/spec/compression_options_spec.rb
+++ b/src/ruby/spec/compression_options_spec.rb
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require 'grpc'
+require 'spec_helper'
describe GRPC::Core::CompressionOptions do
# Note these constants should be updated
diff --git a/src/ruby/spec/error_sanity_spec.rb b/src/ruby/spec/error_sanity_spec.rb
index b8f0638695..c36635ea26 100644
--- a/src/ruby/spec/error_sanity_spec.rb
+++ b/src/ruby/spec/error_sanity_spec.rb
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require 'grpc'
+require 'spec_helper'
StatusCodes = GRPC::Core::StatusCodes
diff --git a/src/ruby/spec/generic/client_stub_spec.rb b/src/ruby/spec/generic/client_stub_spec.rb
index da50f8d0c9..fbf594a655 100644
--- a/src/ruby/spec/generic/client_stub_spec.rb
+++ b/src/ruby/spec/generic/client_stub_spec.rb
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require 'grpc'
+require 'spec_helper'
Thread.abort_on_exception = true
@@ -589,6 +589,18 @@ describe 'ClientStub' do # rubocop:disable Metrics/BlockLength
responses.each { |r| p r }
end
end
+
+ it 'raises GRPC::Cancelled after the call has been cancelled' do
+ server_port = create_test_server
+ host = "localhost:#{server_port}"
+ th = run_server_streamer(@sent_msg, @replys, @pass)
+ stub = GRPC::ClientStub.new(host, :this_channel_is_insecure)
+ resp = get_responses(stub, run_start_call_first: false)
+ expect(resp.next).to eq('reply_1')
+ @op.cancel
+ expect { resp.next }.to raise_error(GRPC::Cancelled)
+ th.join
+ end
end
end
diff --git a/src/ruby/spec/generic/rpc_desc_spec.rb b/src/ruby/spec/generic/rpc_desc_spec.rb
index 6852b9804f..b4ffe5eb92 100644
--- a/src/ruby/spec/generic/rpc_desc_spec.rb
+++ b/src/ruby/spec/generic/rpc_desc_spec.rb
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require 'grpc'
+require 'spec_helper'
require 'grpc/generic/rpc_desc'
describe GRPC::RpcDesc do
diff --git a/src/ruby/spec/generic/rpc_server_pool_spec.rb b/src/ruby/spec/generic/rpc_server_pool_spec.rb
index 27a42c82c1..0f2dac272e 100644
--- a/src/ruby/spec/generic/rpc_server_pool_spec.rb
+++ b/src/ruby/spec/generic/rpc_server_pool_spec.rb
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require 'grpc'
+require 'spec_helper'
Thread.abort_on_exception = true
diff --git a/src/ruby/spec/generic/service_spec.rb b/src/ruby/spec/generic/service_spec.rb
index ad1c268d32..57aec89ce5 100644
--- a/src/ruby/spec/generic/service_spec.rb
+++ b/src/ruby/spec/generic/service_spec.rb
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require 'grpc'
+require 'spec_helper'
require 'grpc/generic/rpc_desc'
require 'grpc/generic/service'
diff --git a/src/ruby/spec/google_rpc_status_utils_spec.rb b/src/ruby/spec/google_rpc_status_utils_spec.rb
index 3263589b6a..740c3794b6 100644
--- a/src/ruby/spec/google_rpc_status_utils_spec.rb
+++ b/src/ruby/spec/google_rpc_status_utils_spec.rb
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require 'grpc'
+require 'spec_helper'
require_relative '../lib/grpc/google_rpc_status_utils'
require_relative '../pb/src/proto/grpc/testing/messages_pb'
require_relative '../pb/src/proto/grpc/testing/messages_pb'
@@ -114,17 +114,6 @@ describe 'conversion from a status struct to a google protobuf status' do
end
end
-# Test message
-class EchoMsg
- def self.marshal(_o)
- ''
- end
-
- def self.unmarshal(_o)
- EchoMsg.new
- end
-end
-
# A test service that fills in the "reserved" grpc-status-details-bin trailer,
# for client-side testing of GoogleRpcStatus protobuf extraction from trailers.
class GoogleRpcStatusTestService
diff --git a/src/ruby/spec/pb/duplicate/codegen_spec.rb b/src/ruby/spec/pb/duplicate/codegen_spec.rb
index 9f82858d15..fed7c1c8be 100644
--- a/src/ruby/spec/pb/duplicate/codegen_spec.rb
+++ b/src/ruby/spec/pb/duplicate/codegen_spec.rb
@@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+require 'spec_helper'
require 'open3'
require 'tmpdir'
diff --git a/src/ruby/spec/pb/health/checker_spec.rb b/src/ruby/spec/pb/health/checker_spec.rb
index 58a602327c..84e63c2e54 100644
--- a/src/ruby/spec/pb/health/checker_spec.rb
+++ b/src/ruby/spec/pb/health/checker_spec.rb
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require 'grpc'
+require 'spec_helper'
require 'grpc/health/v1/health_pb'
require 'grpc/health/checker'
require 'open3'
diff --git a/src/ruby/spec/pb/package_with_underscore/checker_spec.rb b/src/ruby/spec/pb/package_with_underscore/checker_spec.rb
deleted file mode 100644
index dac7c14a9a..0000000000
--- a/src/ruby/spec/pb/package_with_underscore/checker_spec.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-# Copyright 2016 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-require 'open3'
-require 'tmpdir'
-
-describe 'Package with underscore protobuf code generation' do
- it 'should have the same content as created by code generation' do
- root_dir = File.join(File.dirname(__FILE__), '..', '..', '..', '..', '..')
- pb_dir = File.join(root_dir, 'src', 'ruby', 'spec', 'pb')
-
- fail 'CONFIG env variable unexpectedly unset' unless ENV['CONFIG']
- bins_sub_dir = ENV['CONFIG']
- bins_dir = File.join(root_dir, 'bins', bins_sub_dir)
-
- plugin = File.join(bins_dir, 'grpc_ruby_plugin')
- protoc = File.join(bins_dir, 'protobuf', 'protoc')
-
- got = nil
-
- Dir.mktmpdir do |tmp_dir|
- gen_out = File.join(tmp_dir, 'package_with_underscore', 'service_services_pb.rb')
-
- pid = spawn(
- protoc,
- '-I.',
- 'package_with_underscore/service.proto',
- "--grpc_out=#{tmp_dir}",
- "--plugin=protoc-gen-grpc=#{plugin}",
- chdir: pb_dir)
- Process.waitpid2(pid)
- File.open(gen_out) { |f| got = f.read }
- end
-
- correct_modularized_rpc = 'rpc :TestOne, ' \
- 'Grpc::Testing::PackageWithUnderscore::Data::Request, ' \
- 'Grpc::Testing::PackageWithUnderscore::Data::Response'
- expect(got).to include(correct_modularized_rpc)
- end
-end
diff --git a/src/ruby/spec/server_credentials_spec.rb b/src/ruby/spec/server_credentials_spec.rb
index 673d832f62..f773a5f701 100644
--- a/src/ruby/spec/server_credentials_spec.rb
+++ b/src/ruby/spec/server_credentials_spec.rb
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require 'grpc'
+require 'spec_helper'
def load_test_certs
test_root = File.join(File.dirname(__FILE__), 'testdata')
diff --git a/src/ruby/spec/server_spec.rb b/src/ruby/spec/server_spec.rb
index 6eaac5ded1..76038d8b8b 100644
--- a/src/ruby/spec/server_spec.rb
+++ b/src/ruby/spec/server_spec.rb
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require 'grpc'
+require 'spec_helper'
def load_test_certs
test_root = File.join(File.dirname(__FILE__), 'testdata')
diff --git a/src/ruby/spec/spec_helper.rb b/src/ruby/spec/spec_helper.rb
index 8fe9e6e808..8fe2c16b35 100644
--- a/src/ruby/spec/spec_helper.rb
+++ b/src/ruby/spec/spec_helper.rb
@@ -31,6 +31,7 @@ end if ENV['COVERAGE_NAME']
require 'rspec'
require 'logging'
require 'rspec/logging_helper'
+require 'grpc'
require_relative 'support/services'
require_relative 'support/helpers'
diff --git a/src/ruby/spec/support/services.rb b/src/ruby/spec/support/services.rb
index 27cc8e61ac..27239cd66c 100644
--- a/src/ruby/spec/support/services.rb
+++ b/src/ruby/spec/support/services.rb
@@ -13,7 +13,7 @@
# limitations under the License.
# Test stubs for various scenarios
-require 'grpc'
+require 'spec_helper'
# A test message
class EchoMsg
diff --git a/src/ruby/spec/time_consts_spec.rb b/src/ruby/spec/time_consts_spec.rb
index f7afe6b70a..41655ab106 100644
--- a/src/ruby/spec/time_consts_spec.rb
+++ b/src/ruby/spec/time_consts_spec.rb
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require 'grpc'
+require 'spec_helper'
TimeConsts = GRPC::Core::TimeConsts
diff --git a/src/ruby/tools/version.rb b/src/ruby/tools/version.rb
index 09d5c82674..dad09bb965 100644
--- a/src/ruby/tools/version.rb
+++ b/src/ruby/tools/version.rb
@@ -14,6 +14,6 @@
module GRPC
module Tools
- VERSION = '1.13.0.dev'
+ VERSION = '1.14.0.dev'
end
end
diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template
index 06adb33739..de13d02e2a 100644
--- a/templates/CMakeLists.txt.template
+++ b/templates/CMakeLists.txt.template
@@ -35,7 +35,7 @@
def get_deps(target_dict):
deps = []
- if target_dict.get('baselib', False):
+ if target_dict.get('baselib', False) or target_dict['name'] == 'address_sorting':
deps.append("${_gRPC_BASELIB_LIBRARIES}")
if target_dict.get('build', None) in ['protoc']:
deps.append("${_gRPC_PROTOBUF_PROTOC_LIBRARIES}")
@@ -87,6 +87,7 @@
# Options
option(gRPC_BUILD_TESTS "Build tests" OFF)
option(gRPC_BUILD_CODEGEN "Build codegen" ON)
+ option(gRPC_BUILD_CSHARP_EXT "Build C# extensions" ON)
set(gRPC_INSTALL_default ON)
if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
@@ -168,6 +169,7 @@
include(cmake/gflags.cmake)
include(cmake/benchmark.cmake)
include(cmake/address_sorting.cmake)
+ include(cmake/nanopb.cmake)
if(NOT MSVC)
set(CMAKE_C_FLAGS "<%text>${CMAKE_C_FLAGS}</%text> -std=c99")
@@ -297,6 +299,11 @@
if (gRPC_BUILD_TESTS)
${cc_library(lib)}
endif (gRPC_BUILD_TESTS)
+ % elif lib.name in ['grpc_csharp_ext']:
+ if (gRPC_BUILD_CSHARP_EXT)
+ ${cc_library(lib)}
+ ${cc_install(lib)}
+ endif (gRPC_BUILD_CSHARP_EXT)
% else:
${cc_library(lib)}
% if not lib.build in ["tool"]:
@@ -383,6 +390,7 @@
PRIVATE <%text>${_gRPC_CARES_INCLUDE_DIR}</%text>
PRIVATE <%text>${_gRPC_GFLAGS_INCLUDE_DIR}</%text>
PRIVATE <%text>${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}</%text>
+ PRIVATE <%text>${_gRPC_NANOPB_INCLUDE_DIR}</%text>
% if lib.build in ['test', 'private'] and lib.language == 'c++':
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
@@ -464,6 +472,7 @@
PRIVATE <%text>${_gRPC_CARES_INCLUDE_DIR}</%text>
PRIVATE <%text>${_gRPC_GFLAGS_INCLUDE_DIR}</%text>
PRIVATE <%text>${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}</%text>
+ PRIVATE <%text>${_gRPC_NANOPB_INCLUDE_DIR}</%text>
% if tgt.build in ['test', 'private'] and tgt.language == 'c++':
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
diff --git a/templates/Makefile.template b/templates/Makefile.template
index caf6c12646..1027851b7b 100644
--- a/templates/Makefile.template
+++ b/templates/Makefile.template
@@ -227,8 +227,6 @@
% endif
% endfor
- DEFINES += PB_FIELD_16BIT
-
CPPFLAGS += $(CPPFLAGS_$(CONFIG))
CFLAGS += $(CFLAGS_$(CONFIG))
CXXFLAGS += $(CXXFLAGS_$(CONFIG))
diff --git a/templates/config.m4.template b/templates/config.m4.template
index cc19d98375..19f9904911 100644
--- a/templates/config.m4.template
+++ b/templates/config.m4.template
@@ -11,11 +11,12 @@
PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/src/php/ext/grpc)
PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/boringssl/include)
PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/address_sorting/include)
+ PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/nanopb)
LIBS="-lpthread $LIBS"
- CFLAGS="-Wall -Werror -Wno-parentheses-equality -Wno-unused-value -std=c11 -g -O2 -D PB_FIELD_16BIT=1"
- CXXFLAGS="-std=c++11 -fno-exceptions -fno-rtti -g -O2 -D PB_FIELD_16BIT=1"
+ CFLAGS="-Wall -Werror -Wno-parentheses-equality -Wno-unused-value -std=c11 -g -O2 -D PB_FIELD_32BIT=1"
+ CXXFLAGS="-std=c++11 -fno-exceptions -fno-rtti -g -O2 -D PB_FIELD_32BIT=1"
GRPC_SHARED_LIBADD="-lpthread $GRPC_SHARED_LIBADD"
PHP_REQUIRE_CXX()
PHP_ADD_LIBRARY(pthread)
diff --git a/templates/config.w32.template b/templates/config.w32.template
index ef25e55596..5e37cf568c 100644
--- a/templates/config.w32.template
+++ b/templates/config.w32.template
@@ -23,13 +23,14 @@
EXTENSION("grpc", grpc_source, null,
"/DOPENSSL_NO_ASM /D_GNU_SOURCE /DWIN32_LEAN_AND_MEAN "+
"/D_HAS_EXCEPTIONS=0 /DNOMINMAX /DGRPC_ARES=0 /D_WIN32_WINNT=0x600 "+
- "/DPB_FIELD_16BIT "+
+ "/DPB_FIELD_32BIT "+
"/I"+configure_module_dirname+" "+
"/I"+configure_module_dirname+"\\include "+
"/I"+configure_module_dirname+"\\src\\php\\ext\\grpc "+
"/I"+configure_module_dirname+"\\third_party\\boringssl\\include "+
"/I"+configure_module_dirname+"\\third_party\\zlib "+
- "/I"+configure_module_dirname+"\\third_party\\address_sorting\\include");
+ "/I"+configure_module_dirname+"\\third_party\\address_sorting\\include "+
+ "/I"+configure_module_dirname+"\\third_party\\nanopb");
<%
dirs = {}
for lib in libs:
diff --git a/templates/gRPC-C++.podspec.template b/templates/gRPC-C++.podspec.template
index 12d5fc17d4..2853bb63ab 100644
--- a/templates/gRPC-C++.podspec.template
+++ b/templates/gRPC-C++.podspec.template
@@ -196,9 +196,9 @@
end
s.prepare_command = <<-END_OF_COMMAND
- find src/cpp/ -type f -exec sed -E -i'.back' 's;#include "third_party/nanopb/(.*)";#include <nanopb/\\1>;g' {} \\\;
- find src/cpp/ -name "*.back" -type f -delete
- find src/core/ -regex ".*\.h" -type f -exec sed -E -i'.back' 's;#include "third_party/nanopb/(.*)";#include <nanopb/\\1>;g' {} \\\;
- find src/core/ -name "*.back" -type f -delete
+ find src/cpp/ -type f ! -path '*.grpc_back' -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(pb(_.*)?\\.h)";#include <nanopb/\\1>;g'
+ find src/cpp/ -type f -path '*.grpc_back' -print0 | xargs -0 rm
+ find src/core/ -type f ! -path '*.grpc_back' -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(pb(_.*)?\\.h)";#include <nanopb/\\1>;g'
+ find src/core/ -type f -path '*.grpc_back' -print0 | xargs -0 rm
END_OF_COMMAND
end
diff --git a/templates/gRPC-Core.podspec.template b/templates/gRPC-Core.podspec.template
index af97d81834..5098f351db 100644
--- a/templates/gRPC-Core.podspec.template
+++ b/templates/gRPC-Core.podspec.template
@@ -68,6 +68,14 @@
excl = grpc_private_files(libs)
return [file for file in out if not file in excl]
+ def cfstream_private_headers(libs):
+ out = grpc_lib_files(libs, ("grpc_cfstream",), ("own_headers",))
+ return out
+
+ def cfstream_private_files(libs):
+ out = grpc_lib_files(libs, ("grpc_cfstream",), ("own_src", "own_headers"))
+ return out
+
def ruby_multiline_list(files, indent):
return (',\n' + indent*' ').join('\'%s\'' % f for f in files)
%>
@@ -175,6 +183,16 @@
ss.private_header_files = ${ruby_multiline_list(grpc_private_headers(libs), 30)}
end
+ s.subspec 'CFStream-Implementation' do |ss|
+ ss.header_mappings_dir = '.'
+ ss.dependency "#{s.name}/Implementation", version
+ ss.pod_target_xcconfig = {
+ 'GCC_PREPROCESSOR_DEFINITIONS' => 'GRPC_CFSTREAM=1'
+ }
+ ss.source_files = ${ruby_multiline_list(cfstream_private_files(filegroups), 22)}
+ ss.private_header_files = ${ruby_multiline_list(cfstream_private_headers(filegroups), 30)}
+ end
+
s.subspec 'Cronet-Interface' do |ss|
ss.header_mappings_dir = 'include/grpc'
ss.source_files = ${ruby_multiline_list(grpc_cronet_public_headers(libs), 22)}
@@ -202,6 +220,7 @@
# TODO (mxyan): Instead of this hack, add include path "third_party" to C core's include path?
s.prepare_command = <<-END_OF_COMMAND
- find src/core/ -type f ! -path '*.back*' -exec sed -E -i'.back' 's;#include "third_party/nanopb/(.*)";#include <nanopb/\\1>;g' {} \\\;
+ find src/core/ -type f ! -path '*.grpc_back' -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(pb(_.*)?\\.h)";#include <nanopb/\\1>;g'
+ find src/core/ -type f -path '*.grpc_back' -print0 | xargs -0 rm
END_OF_COMMAND
end
diff --git a/templates/gRPC-ProtoRPC.podspec.template b/templates/gRPC-ProtoRPC.podspec.template
index d2dcc429ef..96966784f1 100644
--- a/templates/gRPC-ProtoRPC.podspec.template
+++ b/templates/gRPC-ProtoRPC.podspec.template
@@ -43,12 +43,25 @@
s.header_dir = name
src_dir = 'src/objective-c/ProtoRPC'
- s.source_files = "#{src_dir}/*.{h,m}"
- s.header_mappings_dir = "#{src_dir}"
- s.dependency 'gRPC', version
- s.dependency 'gRPC-RxLibrary', version
- s.dependency 'Protobuf', '~> 3.0'
+ s.default_subspec = 'Main'
+
+ s.subspec 'Main' do |ss|
+ ss.header_mappings_dir = "#{src_dir}"
+ ss.dependency 'gRPC', version
+ ss.dependency 'gRPC-RxLibrary', version
+ ss.dependency 'Protobuf', '~> 3.0'
+
+ ss.source_files = "#{src_dir}/*.{h,m}"
+ end
+ s.subspec 'CFStream' do |ss|
+ ss.dependency 'gRPC/CFStream', version
+ ss.dependency "#{s.name}/Main", version
+ ss.pod_target_xcconfig = {
+ 'GCC_PREPROCESSOR_DEFINITIONS' => 'GRPC_CFSTREAM=1'
+ }
+ end
+
s.pod_target_xcconfig = {
# This is needed by all pods that depend on Protobuf:
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
diff --git a/templates/gRPC.podspec.template b/templates/gRPC.podspec.template
index 6616e74bd7..a3190c2d8e 100644
--- a/templates/gRPC.podspec.template
+++ b/templates/gRPC.podspec.template
@@ -65,6 +65,16 @@
ss.dependency 'gRPC-Core', version
end
+ # This subspec is mutually exclusive with the `Main` subspec
+ s.subspec 'CFStream' do |ss|
+ ss.dependency 'gRPC-Core/CFStream-Implementation', version
+ ss.dependency "#{s.name}/Main", version
+
+ ss.pod_target_xcconfig = {
+ 'GCC_PREPROCESSOR_DEFINITIONS' => 'GRPC_CFSTREAM=1'
+ }
+ end
+
s.subspec 'GID' do |ss|
ss.ios.deployment_target = '7.0'
diff --git a/templates/grpc.gyp.template b/templates/grpc.gyp.template
index 2ea0d06ebd..d71de9f441 100644
--- a/templates/grpc.gyp.template
+++ b/templates/grpc.gyp.template
@@ -70,6 +70,7 @@
'.',
'../..',
'include',
+ '../../third_party/nanopb',
],
'defines': [
'GRPC_ARES=0',
diff --git a/templates/src/csharp/build_packages_dotnetcli.bat.template b/templates/src/csharp/build_packages_dotnetcli.bat.template
index 1bf78c4d23..45010fec74 100755
--- a/templates/src/csharp/build_packages_dotnetcli.bat.template
+++ b/templates/src/csharp/build_packages_dotnetcli.bat.template
@@ -49,6 +49,7 @@
%%DOTNET% pack --configuration Release Grpc.Reflection --output ..\..\..\artifacts || goto :error
%%NUGET% pack Grpc.nuspec -Version %VERSION% -OutputDirectory ..\..\artifacts || goto :error
+ %%NUGET% pack Grpc.Core.NativeDebug.nuspec -Version %VERSION% -OutputDirectory ..\..\artifacts
%%NUGET% pack Grpc.Tools.nuspec -Version %VERSION% -OutputDirectory ..\..\artifacts
@rem copy resulting nuget packages to artifacts directory
diff --git a/templates/src/csharp/build_packages_dotnetcli.sh.template b/templates/src/csharp/build_packages_dotnetcli.sh.template
index ddfea74744..1172582ebd 100755
--- a/templates/src/csharp/build_packages_dotnetcli.sh.template
+++ b/templates/src/csharp/build_packages_dotnetcli.sh.template
@@ -48,6 +48,7 @@
dotnet pack --configuration Release Grpc.Reflection --output ../../../artifacts
nuget pack Grpc.nuspec -Version "${settings.csharp_version}" -OutputDirectory ../../artifacts
+ nuget pack Grpc.Core.NativeDebug.nuspec -Version "${settings.csharp_version}" -OutputDirectory ../../artifacts
nuget pack Grpc.Tools.nuspec -Version "${settings.csharp_version}" -OutputDirectory ../../artifacts
(cd ../../artifacts && zip csharp_nugets_dotnetcli.zip *.nupkg)
diff --git a/test/core/avl/avl_test.cc b/test/core/avl/avl_test.cc
index ecebe833b3..01002fec72 100644
--- a/test/core/avl/avl_test.cc
+++ b/test/core/avl/avl_test.cc
@@ -241,3365 +241,6 @@ static void test_badcase1(void) {
grpc_avl_unref(avl, nullptr);
}
-static void test_badcase2(void) {
- grpc_avl avl;
-
- gpr_log(GPR_DEBUG, "test_badcase2");
-
- avl = grpc_avl_create(&int_int_vtable);
- avl = grpc_avl_add(avl, box(288), box(1), nullptr);
- avl = remove_int(avl, 415);
- avl = grpc_avl_add(avl, box(953), box(3), nullptr);
- avl = grpc_avl_add(avl, box(101), box(4), nullptr);
- avl = grpc_avl_add(avl, box(516), box(5), nullptr);
- avl = grpc_avl_add(avl, box(547), box(6), nullptr);
- avl = grpc_avl_add(avl, box(467), box(7), nullptr);
- avl = grpc_avl_add(avl, box(793), box(8), nullptr);
- avl = remove_int(avl, 190);
- avl = grpc_avl_add(avl, box(687), box(10), nullptr);
- avl = grpc_avl_add(avl, box(242), box(11), nullptr);
- avl = grpc_avl_add(avl, box(142), box(12), nullptr);
- avl = remove_int(avl, 705);
- avl = remove_int(avl, 578);
- avl = remove_int(avl, 767);
- avl = remove_int(avl, 183);
- avl = grpc_avl_add(avl, box(950), box(17), nullptr);
- avl = grpc_avl_add(avl, box(622), box(18), nullptr);
- avl = remove_int(avl, 513);
- avl = remove_int(avl, 429);
- avl = grpc_avl_add(avl, box(205), box(21), nullptr);
- avl = remove_int(avl, 663);
- avl = remove_int(avl, 953);
- avl = remove_int(avl, 892);
- avl = grpc_avl_add(avl, box(236), box(25), nullptr);
- avl = remove_int(avl, 982);
- avl = remove_int(avl, 201);
- avl = remove_int(avl, 684);
- avl = grpc_avl_add(avl, box(572), box(29), nullptr);
- avl = remove_int(avl, 817);
- avl = grpc_avl_add(avl, box(970), box(31), nullptr);
- avl = remove_int(avl, 347);
- avl = remove_int(avl, 574);
- avl = grpc_avl_add(avl, box(752), box(34), nullptr);
- avl = grpc_avl_add(avl, box(670), box(35), nullptr);
- avl = grpc_avl_add(avl, box(69), box(36), nullptr);
- avl = remove_int(avl, 111);
- avl = remove_int(avl, 523);
- avl = grpc_avl_add(avl, box(141), box(39), nullptr);
- avl = remove_int(avl, 159);
- avl = grpc_avl_add(avl, box(947), box(41), nullptr);
- avl = grpc_avl_add(avl, box(855), box(42), nullptr);
- avl = remove_int(avl, 218);
- avl = remove_int(avl, 6);
- avl = grpc_avl_add(avl, box(753), box(45), nullptr);
- avl = remove_int(avl, 82);
- avl = remove_int(avl, 799);
- avl = grpc_avl_add(avl, box(572), box(48), nullptr);
- avl = remove_int(avl, 376);
- avl = remove_int(avl, 413);
- avl = grpc_avl_add(avl, box(458), box(51), nullptr);
- avl = remove_int(avl, 897);
- avl = grpc_avl_add(avl, box(191), box(53), nullptr);
- avl = grpc_avl_add(avl, box(609), box(54), nullptr);
- avl = remove_int(avl, 787);
- avl = remove_int(avl, 710);
- avl = remove_int(avl, 886);
- avl = remove_int(avl, 835);
- avl = remove_int(avl, 33);
- avl = grpc_avl_add(avl, box(871), box(60), nullptr);
- avl = remove_int(avl, 641);
- avl = grpc_avl_add(avl, box(462), box(62), nullptr);
- avl = remove_int(avl, 359);
- avl = remove_int(avl, 767);
- avl = grpc_avl_add(avl, box(310), box(65), nullptr);
- avl = remove_int(avl, 757);
- avl = remove_int(avl, 639);
- avl = remove_int(avl, 314);
- avl = grpc_avl_add(avl, box(2), box(69), nullptr);
- avl = remove_int(avl, 138);
- avl = grpc_avl_add(avl, box(669), box(71), nullptr);
- avl = remove_int(avl, 477);
- avl = grpc_avl_add(avl, box(366), box(73), nullptr);
- avl = grpc_avl_add(avl, box(612), box(74), nullptr);
- avl = grpc_avl_add(avl, box(106), box(75), nullptr);
- avl = remove_int(avl, 161);
- avl = grpc_avl_add(avl, box(388), box(77), nullptr);
- avl = grpc_avl_add(avl, box(141), box(78), nullptr);
- avl = remove_int(avl, 633);
- avl = remove_int(avl, 459);
- avl = grpc_avl_add(avl, box(40), box(81), nullptr);
- avl = remove_int(avl, 689);
- avl = grpc_avl_add(avl, box(823), box(83), nullptr);
- avl = remove_int(avl, 485);
- avl = grpc_avl_add(avl, box(903), box(85), nullptr);
- avl = grpc_avl_add(avl, box(592), box(86), nullptr);
- avl = remove_int(avl, 448);
- avl = grpc_avl_add(avl, box(56), box(88), nullptr);
- avl = remove_int(avl, 333);
- avl = grpc_avl_add(avl, box(189), box(90), nullptr);
- avl = grpc_avl_add(avl, box(103), box(91), nullptr);
- avl = remove_int(avl, 164);
- avl = remove_int(avl, 974);
- avl = grpc_avl_add(avl, box(215), box(94), nullptr);
- avl = remove_int(avl, 189);
- avl = remove_int(avl, 504);
- avl = grpc_avl_add(avl, box(868), box(97), nullptr);
- avl = remove_int(avl, 909);
- avl = remove_int(avl, 148);
- avl = remove_int(avl, 469);
- avl = grpc_avl_add(avl, box(994), box(101), nullptr);
- avl = grpc_avl_add(avl, box(576), box(102), nullptr);
- avl = remove_int(avl, 82);
- avl = remove_int(avl, 209);
- avl = grpc_avl_add(avl, box(276), box(105), nullptr);
- avl = remove_int(avl, 856);
- avl = grpc_avl_add(avl, box(750), box(107), nullptr);
- avl = remove_int(avl, 871);
- avl = grpc_avl_add(avl, box(301), box(109), nullptr);
- avl = remove_int(avl, 260);
- avl = remove_int(avl, 737);
- avl = remove_int(avl, 719);
- avl = grpc_avl_add(avl, box(933), box(113), nullptr);
- avl = grpc_avl_add(avl, box(225), box(114), nullptr);
- avl = grpc_avl_add(avl, box(975), box(115), nullptr);
- avl = grpc_avl_add(avl, box(86), box(116), nullptr);
- avl = remove_int(avl, 732);
- avl = grpc_avl_add(avl, box(340), box(118), nullptr);
- avl = grpc_avl_add(avl, box(271), box(119), nullptr);
- avl = remove_int(avl, 206);
- avl = grpc_avl_add(avl, box(949), box(121), nullptr);
- avl = grpc_avl_add(avl, box(927), box(122), nullptr);
- avl = grpc_avl_add(avl, box(34), box(123), nullptr);
- avl = grpc_avl_add(avl, box(351), box(124), nullptr);
- avl = remove_int(avl, 836);
- avl = grpc_avl_add(avl, box(825), box(126), nullptr);
- avl = grpc_avl_add(avl, box(352), box(127), nullptr);
- avl = remove_int(avl, 107);
- avl = remove_int(avl, 101);
- avl = grpc_avl_add(avl, box(320), box(130), nullptr);
- avl = grpc_avl_add(avl, box(3), box(131), nullptr);
- avl = remove_int(avl, 998);
- avl = remove_int(avl, 44);
- avl = grpc_avl_add(avl, box(525), box(134), nullptr);
- avl = grpc_avl_add(avl, box(864), box(135), nullptr);
- avl = grpc_avl_add(avl, box(863), box(136), nullptr);
- avl = remove_int(avl, 770);
- avl = grpc_avl_add(avl, box(440), box(138), nullptr);
- avl = remove_int(avl, 516);
- avl = grpc_avl_add(avl, box(116), box(140), nullptr);
- avl = remove_int(avl, 380);
- avl = grpc_avl_add(avl, box(878), box(142), nullptr);
- avl = remove_int(avl, 439);
- avl = grpc_avl_add(avl, box(994), box(144), nullptr);
- avl = remove_int(avl, 294);
- avl = remove_int(avl, 593);
- avl = grpc_avl_add(avl, box(696), box(147), nullptr);
- avl = remove_int(avl, 8);
- avl = grpc_avl_add(avl, box(881), box(149), nullptr);
- avl = remove_int(avl, 32);
- avl = remove_int(avl, 242);
- avl = grpc_avl_add(avl, box(487), box(152), nullptr);
- avl = grpc_avl_add(avl, box(637), box(153), nullptr);
- avl = grpc_avl_add(avl, box(793), box(154), nullptr);
- avl = grpc_avl_add(avl, box(696), box(155), nullptr);
- avl = remove_int(avl, 458);
- avl = grpc_avl_add(avl, box(828), box(157), nullptr);
- avl = remove_int(avl, 784);
- avl = remove_int(avl, 274);
- avl = grpc_avl_add(avl, box(783), box(160), nullptr);
- avl = remove_int(avl, 21);
- avl = grpc_avl_add(avl, box(866), box(162), nullptr);
- avl = remove_int(avl, 919);
- avl = grpc_avl_add(avl, box(435), box(164), nullptr);
- avl = remove_int(avl, 385);
- avl = grpc_avl_add(avl, box(475), box(166), nullptr);
- avl = remove_int(avl, 339);
- avl = grpc_avl_add(avl, box(615), box(168), nullptr);
- avl = remove_int(avl, 866);
- avl = remove_int(avl, 82);
- avl = remove_int(avl, 271);
- avl = grpc_avl_add(avl, box(590), box(172), nullptr);
- avl = grpc_avl_add(avl, box(852), box(173), nullptr);
- avl = remove_int(avl, 318);
- avl = remove_int(avl, 82);
- avl = grpc_avl_add(avl, box(672), box(176), nullptr);
- avl = remove_int(avl, 430);
- avl = grpc_avl_add(avl, box(821), box(178), nullptr);
- avl = grpc_avl_add(avl, box(365), box(179), nullptr);
- avl = remove_int(avl, 78);
- avl = grpc_avl_add(avl, box(700), box(181), nullptr);
- avl = grpc_avl_add(avl, box(353), box(182), nullptr);
- avl = remove_int(avl, 492);
- avl = grpc_avl_add(avl, box(991), box(184), nullptr);
- avl = remove_int(avl, 330);
- avl = grpc_avl_add(avl, box(873), box(186), nullptr);
- avl = remove_int(avl, 589);
- avl = grpc_avl_add(avl, box(676), box(188), nullptr);
- avl = grpc_avl_add(avl, box(790), box(189), nullptr);
- avl = remove_int(avl, 521);
- avl = remove_int(avl, 47);
- avl = grpc_avl_add(avl, box(976), box(192), nullptr);
- avl = grpc_avl_add(avl, box(683), box(193), nullptr);
- avl = remove_int(avl, 803);
- avl = remove_int(avl, 1006);
- avl = grpc_avl_add(avl, box(775), box(196), nullptr);
- avl = grpc_avl_add(avl, box(411), box(197), nullptr);
- avl = grpc_avl_add(avl, box(697), box(198), nullptr);
- avl = remove_int(avl, 50);
- avl = grpc_avl_add(avl, box(213), box(200), nullptr);
- avl = remove_int(avl, 714);
- avl = grpc_avl_add(avl, box(981), box(202), nullptr);
- avl = grpc_avl_add(avl, box(502), box(203), nullptr);
- avl = grpc_avl_add(avl, box(697), box(204), nullptr);
- avl = grpc_avl_add(avl, box(603), box(205), nullptr);
- avl = grpc_avl_add(avl, box(117), box(206), nullptr);
- avl = remove_int(avl, 363);
- avl = grpc_avl_add(avl, box(104), box(208), nullptr);
- avl = remove_int(avl, 842);
- avl = grpc_avl_add(avl, box(48), box(210), nullptr);
- avl = remove_int(avl, 764);
- avl = grpc_avl_add(avl, box(482), box(212), nullptr);
- avl = grpc_avl_add(avl, box(928), box(213), nullptr);
- avl = grpc_avl_add(avl, box(30), box(214), nullptr);
- avl = grpc_avl_add(avl, box(820), box(215), nullptr);
- avl = grpc_avl_add(avl, box(334), box(216), nullptr);
- avl = remove_int(avl, 306);
- avl = grpc_avl_add(avl, box(789), box(218), nullptr);
- avl = remove_int(avl, 924);
- avl = grpc_avl_add(avl, box(53), box(220), nullptr);
- avl = remove_int(avl, 657);
- avl = grpc_avl_add(avl, box(130), box(222), nullptr);
- avl = grpc_avl_add(avl, box(239), box(223), nullptr);
- avl = remove_int(avl, 20);
- avl = grpc_avl_add(avl, box(117), box(225), nullptr);
- avl = remove_int(avl, 882);
- avl = remove_int(avl, 891);
- avl = grpc_avl_add(avl, box(9), box(228), nullptr);
- avl = grpc_avl_add(avl, box(496), box(229), nullptr);
- avl = grpc_avl_add(avl, box(750), box(230), nullptr);
- avl = grpc_avl_add(avl, box(283), box(231), nullptr);
- avl = grpc_avl_add(avl, box(802), box(232), nullptr);
- avl = remove_int(avl, 352);
- avl = grpc_avl_add(avl, box(374), box(234), nullptr);
- avl = grpc_avl_add(avl, box(6), box(235), nullptr);
- avl = grpc_avl_add(avl, box(756), box(236), nullptr);
- avl = grpc_avl_add(avl, box(597), box(237), nullptr);
- avl = grpc_avl_add(avl, box(661), box(238), nullptr);
- avl = remove_int(avl, 96);
- avl = grpc_avl_add(avl, box(894), box(240), nullptr);
- avl = remove_int(avl, 749);
- avl = grpc_avl_add(avl, box(71), box(242), nullptr);
- avl = remove_int(avl, 68);
- avl = grpc_avl_add(avl, box(388), box(244), nullptr);
- avl = remove_int(avl, 119);
- avl = remove_int(avl, 856);
- avl = grpc_avl_add(avl, box(176), box(247), nullptr);
- avl = grpc_avl_add(avl, box(993), box(248), nullptr);
- avl = remove_int(avl, 178);
- avl = remove_int(avl, 781);
- avl = remove_int(avl, 771);
- avl = remove_int(avl, 848);
- avl = remove_int(avl, 376);
- avl = remove_int(avl, 157);
- avl = remove_int(avl, 142);
- avl = remove_int(avl, 686);
- avl = grpc_avl_add(avl, box(779), box(257), nullptr);
- avl = grpc_avl_add(avl, box(484), box(258), nullptr);
- avl = remove_int(avl, 837);
- avl = grpc_avl_add(avl, box(388), box(260), nullptr);
- avl = remove_int(avl, 987);
- avl = grpc_avl_add(avl, box(336), box(262), nullptr);
- avl = remove_int(avl, 855);
- avl = grpc_avl_add(avl, box(668), box(264), nullptr);
- avl = remove_int(avl, 648);
- avl = grpc_avl_add(avl, box(193), box(266), nullptr);
- avl = remove_int(avl, 939);
- avl = grpc_avl_add(avl, box(740), box(268), nullptr);
- avl = grpc_avl_add(avl, box(503), box(269), nullptr);
- avl = grpc_avl_add(avl, box(765), box(270), nullptr);
- avl = remove_int(avl, 924);
- avl = remove_int(avl, 513);
- avl = grpc_avl_add(avl, box(161), box(273), nullptr);
- avl = grpc_avl_add(avl, box(502), box(274), nullptr);
- avl = grpc_avl_add(avl, box(846), box(275), nullptr);
- avl = remove_int(avl, 931);
- avl = grpc_avl_add(avl, box(87), box(277), nullptr);
- avl = grpc_avl_add(avl, box(949), box(278), nullptr);
- avl = grpc_avl_add(avl, box(548), box(279), nullptr);
- avl = grpc_avl_add(avl, box(951), box(280), nullptr);
- avl = remove_int(avl, 1018);
- avl = remove_int(avl, 568);
- avl = grpc_avl_add(avl, box(138), box(283), nullptr);
- avl = grpc_avl_add(avl, box(202), box(284), nullptr);
- avl = grpc_avl_add(avl, box(157), box(285), nullptr);
- avl = grpc_avl_add(avl, box(264), box(286), nullptr);
- avl = grpc_avl_add(avl, box(370), box(287), nullptr);
- avl = remove_int(avl, 736);
- avl = remove_int(avl, 751);
- avl = remove_int(avl, 506);
- avl = remove_int(avl, 81);
- avl = remove_int(avl, 358);
- avl = remove_int(avl, 657);
- avl = remove_int(avl, 86);
- avl = grpc_avl_add(avl, box(876), box(295), nullptr);
- avl = remove_int(avl, 354);
- avl = grpc_avl_add(avl, box(134), box(297), nullptr);
- avl = remove_int(avl, 781);
- avl = remove_int(avl, 183);
- avl = grpc_avl_add(avl, box(914), box(300), nullptr);
- avl = remove_int(avl, 926);
- avl = remove_int(avl, 398);
- avl = remove_int(avl, 932);
- avl = remove_int(avl, 804);
- avl = remove_int(avl, 326);
- avl = grpc_avl_add(avl, box(208), box(306), nullptr);
- avl = grpc_avl_add(avl, box(699), box(307), nullptr);
- avl = remove_int(avl, 576);
- avl = remove_int(avl, 850);
- avl = remove_int(avl, 514);
- avl = remove_int(avl, 676);
- avl = remove_int(avl, 549);
- avl = remove_int(avl, 767);
- avl = grpc_avl_add(avl, box(58), box(314), nullptr);
- avl = grpc_avl_add(avl, box(265), box(315), nullptr);
- avl = grpc_avl_add(avl, box(268), box(316), nullptr);
- avl = grpc_avl_add(avl, box(103), box(317), nullptr);
- avl = grpc_avl_add(avl, box(440), box(318), nullptr);
- avl = remove_int(avl, 777);
- avl = grpc_avl_add(avl, box(670), box(320), nullptr);
- avl = remove_int(avl, 506);
- avl = remove_int(avl, 487);
- avl = grpc_avl_add(avl, box(421), box(323), nullptr);
- avl = remove_int(avl, 514);
- avl = grpc_avl_add(avl, box(701), box(325), nullptr);
- avl = remove_int(avl, 949);
- avl = remove_int(avl, 872);
- avl = remove_int(avl, 139);
- avl = grpc_avl_add(avl, box(781), box(329), nullptr);
- avl = grpc_avl_add(avl, box(543), box(330), nullptr);
- avl = grpc_avl_add(avl, box(147), box(331), nullptr);
- avl = remove_int(avl, 190);
- avl = grpc_avl_add(avl, box(453), box(333), nullptr);
- avl = remove_int(avl, 262);
- avl = remove_int(avl, 850);
- avl = remove_int(avl, 286);
- avl = remove_int(avl, 787);
- avl = grpc_avl_add(avl, box(514), box(338), nullptr);
- avl = remove_int(avl, 812);
- avl = grpc_avl_add(avl, box(431), box(340), nullptr);
- avl = grpc_avl_add(avl, box(8), box(341), nullptr);
- avl = remove_int(avl, 843);
- avl = grpc_avl_add(avl, box(831), box(343), nullptr);
- avl = remove_int(avl, 472);
- avl = remove_int(avl, 157);
- avl = grpc_avl_add(avl, box(612), box(346), nullptr);
- avl = grpc_avl_add(avl, box(802), box(347), nullptr);
- avl = remove_int(avl, 554);
- avl = grpc_avl_add(avl, box(409), box(349), nullptr);
- avl = grpc_avl_add(avl, box(439), box(350), nullptr);
- avl = grpc_avl_add(avl, box(725), box(351), nullptr);
- avl = grpc_avl_add(avl, box(568), box(352), nullptr);
- avl = remove_int(avl, 475);
- avl = remove_int(avl, 672);
- avl = remove_int(avl, 62);
- avl = remove_int(avl, 753);
- avl = grpc_avl_add(avl, box(435), box(357), nullptr);
- avl = grpc_avl_add(avl, box(950), box(358), nullptr);
- avl = grpc_avl_add(avl, box(532), box(359), nullptr);
- avl = grpc_avl_add(avl, box(832), box(360), nullptr);
- avl = remove_int(avl, 390);
- avl = grpc_avl_add(avl, box(993), box(362), nullptr);
- avl = remove_int(avl, 198);
- avl = remove_int(avl, 401);
- avl = grpc_avl_add(avl, box(316), box(365), nullptr);
- avl = remove_int(avl, 843);
- avl = grpc_avl_add(avl, box(541), box(367), nullptr);
- avl = grpc_avl_add(avl, box(505), box(368), nullptr);
- avl = remove_int(avl, 445);
- avl = remove_int(avl, 256);
- avl = grpc_avl_add(avl, box(232), box(371), nullptr);
- avl = remove_int(avl, 577);
- avl = remove_int(avl, 558);
- avl = grpc_avl_add(avl, box(910), box(374), nullptr);
- avl = remove_int(avl, 902);
- avl = remove_int(avl, 755);
- avl = remove_int(avl, 114);
- avl = remove_int(avl, 438);
- avl = remove_int(avl, 224);
- avl = grpc_avl_add(avl, box(920), box(380), nullptr);
- avl = grpc_avl_add(avl, box(655), box(381), nullptr);
- avl = remove_int(avl, 557);
- avl = remove_int(avl, 102);
- avl = remove_int(avl, 165);
- avl = grpc_avl_add(avl, box(191), box(385), nullptr);
- avl = remove_int(avl, 30);
- avl = grpc_avl_add(avl, box(406), box(387), nullptr);
- avl = grpc_avl_add(avl, box(66), box(388), nullptr);
- avl = grpc_avl_add(avl, box(87), box(389), nullptr);
- avl = remove_int(avl, 7);
- avl = remove_int(avl, 671);
- avl = grpc_avl_add(avl, box(234), box(392), nullptr);
- avl = remove_int(avl, 463);
- avl = grpc_avl_add(avl, box(75), box(394), nullptr);
- avl = grpc_avl_add(avl, box(487), box(395), nullptr);
- avl = remove_int(avl, 203);
- avl = grpc_avl_add(avl, box(711), box(397), nullptr);
- avl = remove_int(avl, 291);
- avl = remove_int(avl, 798);
- avl = remove_int(avl, 337);
- avl = grpc_avl_add(avl, box(877), box(401), nullptr);
- avl = grpc_avl_add(avl, box(388), box(402), nullptr);
- avl = remove_int(avl, 975);
- avl = grpc_avl_add(avl, box(200), box(404), nullptr);
- avl = grpc_avl_add(avl, box(408), box(405), nullptr);
- avl = grpc_avl_add(avl, box(3), box(406), nullptr);
- avl = grpc_avl_add(avl, box(971), box(407), nullptr);
- avl = remove_int(avl, 841);
- avl = remove_int(avl, 910);
- avl = remove_int(avl, 74);
- avl = remove_int(avl, 888);
- avl = grpc_avl_add(avl, box(492), box(412), nullptr);
- avl = remove_int(avl, 14);
- avl = remove_int(avl, 364);
- avl = grpc_avl_add(avl, box(215), box(415), nullptr);
- avl = remove_int(avl, 778);
- avl = remove_int(avl, 45);
- avl = grpc_avl_add(avl, box(328), box(418), nullptr);
- avl = grpc_avl_add(avl, box(597), box(419), nullptr);
- avl = remove_int(avl, 34);
- avl = grpc_avl_add(avl, box(736), box(421), nullptr);
- avl = remove_int(avl, 37);
- avl = grpc_avl_add(avl, box(275), box(423), nullptr);
- avl = grpc_avl_add(avl, box(70), box(424), nullptr);
- avl = grpc_avl_add(avl, box(771), box(425), nullptr);
- avl = remove_int(avl, 536);
- avl = remove_int(avl, 421);
- avl = grpc_avl_add(avl, box(186), box(428), nullptr);
- avl = grpc_avl_add(avl, box(788), box(429), nullptr);
- avl = grpc_avl_add(avl, box(224), box(430), nullptr);
- avl = remove_int(avl, 228);
- avl = grpc_avl_add(avl, box(48), box(432), nullptr);
- avl = grpc_avl_add(avl, box(120), box(433), nullptr);
- avl = grpc_avl_add(avl, box(269), box(434), nullptr);
- avl = grpc_avl_add(avl, box(904), box(435), nullptr);
- avl = remove_int(avl, 699);
- avl = grpc_avl_add(avl, box(340), box(437), nullptr);
- avl = remove_int(avl, 276);
- avl = grpc_avl_add(avl, box(591), box(439), nullptr);
- avl = grpc_avl_add(avl, box(778), box(440), nullptr);
- avl = remove_int(avl, 490);
- avl = remove_int(avl, 973);
- avl = grpc_avl_add(avl, box(294), box(443), nullptr);
- avl = grpc_avl_add(avl, box(323), box(444), nullptr);
- avl = remove_int(avl, 685);
- avl = grpc_avl_add(avl, box(38), box(446), nullptr);
- avl = grpc_avl_add(avl, box(525), box(447), nullptr);
- avl = remove_int(avl, 162);
- avl = grpc_avl_add(avl, box(462), box(449), nullptr);
- avl = grpc_avl_add(avl, box(340), box(450), nullptr);
- avl = remove_int(avl, 734);
- avl = remove_int(avl, 959);
- avl = grpc_avl_add(avl, box(752), box(453), nullptr);
- avl = grpc_avl_add(avl, box(667), box(454), nullptr);
- avl = remove_int(avl, 558);
- avl = remove_int(avl, 657);
- avl = grpc_avl_add(avl, box(711), box(457), nullptr);
- avl = remove_int(avl, 937);
- avl = grpc_avl_add(avl, box(741), box(459), nullptr);
- avl = grpc_avl_add(avl, box(40), box(460), nullptr);
- avl = remove_int(avl, 784);
- avl = grpc_avl_add(avl, box(292), box(462), nullptr);
- avl = remove_int(avl, 164);
- avl = remove_int(avl, 931);
- avl = remove_int(avl, 886);
- avl = grpc_avl_add(avl, box(968), box(466), nullptr);
- avl = remove_int(avl, 263);
- avl = grpc_avl_add(avl, box(647), box(468), nullptr);
- avl = grpc_avl_add(avl, box(92), box(469), nullptr);
- avl = remove_int(avl, 310);
- avl = grpc_avl_add(avl, box(711), box(471), nullptr);
- avl = grpc_avl_add(avl, box(675), box(472), nullptr);
- avl = remove_int(avl, 549);
- avl = grpc_avl_add(avl, box(380), box(474), nullptr);
- avl = remove_int(avl, 825);
- avl = grpc_avl_add(avl, box(668), box(476), nullptr);
- avl = remove_int(avl, 498);
- avl = grpc_avl_add(avl, box(870), box(478), nullptr);
- avl = grpc_avl_add(avl, box(391), box(479), nullptr);
- avl = grpc_avl_add(avl, box(264), box(480), nullptr);
- avl = remove_int(avl, 1);
- avl = remove_int(avl, 849);
- avl = remove_int(avl, 88);
- avl = remove_int(avl, 255);
- avl = remove_int(avl, 763);
- avl = remove_int(avl, 831);
- avl = grpc_avl_add(avl, box(508), box(487), nullptr);
- avl = remove_int(avl, 849);
- avl = remove_int(avl, 47);
- avl = grpc_avl_add(avl, box(299), box(490), nullptr);
- avl = remove_int(avl, 625);
- avl = remove_int(avl, 433);
- avl = remove_int(avl, 904);
- avl = remove_int(avl, 761);
- avl = grpc_avl_add(avl, box(33), box(495), nullptr);
- avl = grpc_avl_add(avl, box(524), box(496), nullptr);
- avl = remove_int(avl, 210);
- avl = remove_int(avl, 299);
- avl = grpc_avl_add(avl, box(823), box(499), nullptr);
- avl = remove_int(avl, 479);
- avl = remove_int(avl, 96);
- avl = remove_int(avl, 1013);
- avl = grpc_avl_add(avl, box(768), box(503), nullptr);
- avl = remove_int(avl, 638);
- avl = remove_int(avl, 20);
- avl = grpc_avl_add(avl, box(663), box(506), nullptr);
- avl = remove_int(avl, 882);
- avl = grpc_avl_add(avl, box(745), box(508), nullptr);
- avl = remove_int(avl, 352);
- avl = grpc_avl_add(avl, box(10), box(510), nullptr);
- avl = remove_int(avl, 484);
- avl = grpc_avl_add(avl, box(420), box(512), nullptr);
- avl = grpc_avl_add(avl, box(884), box(513), nullptr);
- avl = grpc_avl_add(avl, box(993), box(514), nullptr);
- avl = grpc_avl_add(avl, box(251), box(515), nullptr);
- avl = remove_int(avl, 222);
- avl = grpc_avl_add(avl, box(734), box(517), nullptr);
- avl = grpc_avl_add(avl, box(952), box(518), nullptr);
- avl = remove_int(avl, 26);
- avl = remove_int(avl, 270);
- avl = remove_int(avl, 481);
- avl = remove_int(avl, 693);
- avl = remove_int(avl, 1006);
- avl = grpc_avl_add(avl, box(77), box(524), nullptr);
- avl = remove_int(avl, 897);
- avl = grpc_avl_add(avl, box(719), box(526), nullptr);
- avl = grpc_avl_add(avl, box(622), box(527), nullptr);
- avl = remove_int(avl, 28);
- avl = remove_int(avl, 836);
- avl = remove_int(avl, 142);
- avl = grpc_avl_add(avl, box(445), box(531), nullptr);
- avl = grpc_avl_add(avl, box(410), box(532), nullptr);
- avl = remove_int(avl, 575);
- avl = grpc_avl_add(avl, box(634), box(534), nullptr);
- avl = grpc_avl_add(avl, box(906), box(535), nullptr);
- avl = remove_int(avl, 649);
- avl = grpc_avl_add(avl, box(813), box(537), nullptr);
- avl = remove_int(avl, 702);
- avl = remove_int(avl, 732);
- avl = grpc_avl_add(avl, box(105), box(540), nullptr);
- avl = grpc_avl_add(avl, box(867), box(541), nullptr);
- avl = remove_int(avl, 964);
- avl = remove_int(avl, 941);
- avl = grpc_avl_add(avl, box(947), box(544), nullptr);
- avl = remove_int(avl, 990);
- avl = grpc_avl_add(avl, box(816), box(546), nullptr);
- avl = remove_int(avl, 429);
- avl = remove_int(avl, 567);
- avl = remove_int(avl, 541);
- avl = remove_int(avl, 583);
- avl = grpc_avl_add(avl, box(57), box(551), nullptr);
- avl = grpc_avl_add(avl, box(786), box(552), nullptr);
- avl = grpc_avl_add(avl, box(526), box(553), nullptr);
- avl = remove_int(avl, 642);
- avl = remove_int(avl, 220);
- avl = remove_int(avl, 840);
- avl = remove_int(avl, 548);
- avl = grpc_avl_add(avl, box(528), box(558), nullptr);
- avl = grpc_avl_add(avl, box(749), box(559), nullptr);
- avl = grpc_avl_add(avl, box(194), box(560), nullptr);
- avl = remove_int(avl, 517);
- avl = grpc_avl_add(avl, box(102), box(562), nullptr);
- avl = remove_int(avl, 189);
- avl = grpc_avl_add(avl, box(927), box(564), nullptr);
- avl = remove_int(avl, 846);
- avl = remove_int(avl, 130);
- avl = grpc_avl_add(avl, box(694), box(567), nullptr);
- avl = remove_int(avl, 750);
- avl = grpc_avl_add(avl, box(357), box(569), nullptr);
- avl = remove_int(avl, 431);
- avl = remove_int(avl, 91);
- avl = grpc_avl_add(avl, box(640), box(572), nullptr);
- avl = remove_int(avl, 4);
- avl = grpc_avl_add(avl, box(81), box(574), nullptr);
- avl = grpc_avl_add(avl, box(595), box(575), nullptr);
- avl = remove_int(avl, 444);
- avl = remove_int(avl, 262);
- avl = remove_int(avl, 11);
- avl = grpc_avl_add(avl, box(192), box(579), nullptr);
- avl = grpc_avl_add(avl, box(158), box(580), nullptr);
- avl = remove_int(avl, 401);
- avl = remove_int(avl, 918);
- avl = grpc_avl_add(avl, box(180), box(583), nullptr);
- avl = remove_int(avl, 268);
- avl = grpc_avl_add(avl, box(1012), box(585), nullptr);
- avl = grpc_avl_add(avl, box(90), box(586), nullptr);
- avl = grpc_avl_add(avl, box(946), box(587), nullptr);
- avl = remove_int(avl, 719);
- avl = grpc_avl_add(avl, box(874), box(589), nullptr);
- avl = grpc_avl_add(avl, box(679), box(590), nullptr);
- avl = remove_int(avl, 53);
- avl = remove_int(avl, 534);
- avl = grpc_avl_add(avl, box(646), box(593), nullptr);
- avl = grpc_avl_add(avl, box(767), box(594), nullptr);
- avl = grpc_avl_add(avl, box(460), box(595), nullptr);
- avl = grpc_avl_add(avl, box(852), box(596), nullptr);
- avl = grpc_avl_add(avl, box(189), box(597), nullptr);
- avl = remove_int(avl, 932);
- avl = remove_int(avl, 366);
- avl = remove_int(avl, 907);
- avl = grpc_avl_add(avl, box(875), box(601), nullptr);
- avl = grpc_avl_add(avl, box(434), box(602), nullptr);
- avl = grpc_avl_add(avl, box(704), box(603), nullptr);
- avl = grpc_avl_add(avl, box(724), box(604), nullptr);
- avl = grpc_avl_add(avl, box(930), box(605), nullptr);
- avl = grpc_avl_add(avl, box(1000), box(606), nullptr);
- avl = remove_int(avl, 479);
- avl = grpc_avl_add(avl, box(275), box(608), nullptr);
- avl = remove_int(avl, 32);
- avl = grpc_avl_add(avl, box(939), box(610), nullptr);
- avl = remove_int(avl, 943);
- avl = remove_int(avl, 329);
- avl = grpc_avl_add(avl, box(490), box(613), nullptr);
- avl = remove_int(avl, 477);
- avl = remove_int(avl, 414);
- avl = remove_int(avl, 187);
- avl = remove_int(avl, 334);
- avl = grpc_avl_add(avl, box(40), box(618), nullptr);
- avl = remove_int(avl, 751);
- avl = grpc_avl_add(avl, box(568), box(620), nullptr);
- avl = grpc_avl_add(avl, box(120), box(621), nullptr);
- avl = grpc_avl_add(avl, box(617), box(622), nullptr);
- avl = grpc_avl_add(avl, box(32), box(623), nullptr);
- avl = remove_int(avl, 701);
- avl = grpc_avl_add(avl, box(910), box(625), nullptr);
- avl = remove_int(avl, 557);
- avl = remove_int(avl, 361);
- avl = remove_int(avl, 937);
- avl = remove_int(avl, 100);
- avl = remove_int(avl, 684);
- avl = grpc_avl_add(avl, box(751), box(631), nullptr);
- avl = remove_int(avl, 781);
- avl = remove_int(avl, 469);
- avl = remove_int(avl, 75);
- avl = remove_int(avl, 561);
- avl = grpc_avl_add(avl, box(854), box(636), nullptr);
- avl = remove_int(avl, 164);
- avl = remove_int(avl, 258);
- avl = remove_int(avl, 315);
- avl = remove_int(avl, 261);
- avl = grpc_avl_add(avl, box(552), box(641), nullptr);
- avl = grpc_avl_add(avl, box(6), box(642), nullptr);
- avl = grpc_avl_add(avl, box(680), box(643), nullptr);
- avl = remove_int(avl, 741);
- avl = remove_int(avl, 309);
- avl = remove_int(avl, 272);
- avl = grpc_avl_add(avl, box(249), box(647), nullptr);
- avl = remove_int(avl, 97);
- avl = remove_int(avl, 850);
- avl = grpc_avl_add(avl, box(915), box(650), nullptr);
- avl = grpc_avl_add(avl, box(816), box(651), nullptr);
- avl = grpc_avl_add(avl, box(45), box(652), nullptr);
- avl = grpc_avl_add(avl, box(168), box(653), nullptr);
- avl = remove_int(avl, 153);
- avl = remove_int(avl, 239);
- avl = grpc_avl_add(avl, box(684), box(656), nullptr);
- avl = grpc_avl_add(avl, box(208), box(657), nullptr);
- avl = grpc_avl_add(avl, box(681), box(658), nullptr);
- avl = grpc_avl_add(avl, box(609), box(659), nullptr);
- avl = grpc_avl_add(avl, box(645), box(660), nullptr);
- avl = remove_int(avl, 799);
- avl = grpc_avl_add(avl, box(955), box(662), nullptr);
- avl = grpc_avl_add(avl, box(946), box(663), nullptr);
- avl = grpc_avl_add(avl, box(744), box(664), nullptr);
- avl = grpc_avl_add(avl, box(201), box(665), nullptr);
- avl = grpc_avl_add(avl, box(136), box(666), nullptr);
- avl = remove_int(avl, 357);
- avl = grpc_avl_add(avl, box(974), box(668), nullptr);
- avl = remove_int(avl, 485);
- avl = grpc_avl_add(avl, box(1009), box(670), nullptr);
- avl = grpc_avl_add(avl, box(517), box(671), nullptr);
- avl = remove_int(avl, 491);
- avl = grpc_avl_add(avl, box(336), box(673), nullptr);
- avl = grpc_avl_add(avl, box(589), box(674), nullptr);
- avl = remove_int(avl, 546);
- avl = remove_int(avl, 840);
- avl = remove_int(avl, 104);
- avl = remove_int(avl, 347);
- avl = grpc_avl_add(avl, box(801), box(679), nullptr);
- avl = remove_int(avl, 799);
- avl = remove_int(avl, 702);
- avl = remove_int(avl, 996);
- avl = remove_int(avl, 93);
- avl = grpc_avl_add(avl, box(561), box(684), nullptr);
- avl = grpc_avl_add(avl, box(25), box(685), nullptr);
- avl = remove_int(avl, 278);
- avl = grpc_avl_add(avl, box(191), box(687), nullptr);
- avl = remove_int(avl, 243);
- avl = remove_int(avl, 918);
- avl = remove_int(avl, 449);
- avl = grpc_avl_add(avl, box(19), box(691), nullptr);
- avl = grpc_avl_add(avl, box(762), box(692), nullptr);
- avl = grpc_avl_add(avl, box(13), box(693), nullptr);
- avl = grpc_avl_add(avl, box(151), box(694), nullptr);
- avl = grpc_avl_add(avl, box(152), box(695), nullptr);
- avl = grpc_avl_add(avl, box(793), box(696), nullptr);
- avl = remove_int(avl, 862);
- avl = remove_int(avl, 890);
- avl = grpc_avl_add(avl, box(687), box(699), nullptr);
- avl = grpc_avl_add(avl, box(509), box(700), nullptr);
- avl = grpc_avl_add(avl, box(973), box(701), nullptr);
- avl = remove_int(avl, 230);
- avl = grpc_avl_add(avl, box(532), box(703), nullptr);
- avl = remove_int(avl, 668);
- avl = grpc_avl_add(avl, box(281), box(705), nullptr);
- avl = grpc_avl_add(avl, box(867), box(706), nullptr);
- avl = grpc_avl_add(avl, box(359), box(707), nullptr);
- avl = remove_int(avl, 425);
- avl = grpc_avl_add(avl, box(691), box(709), nullptr);
- avl = grpc_avl_add(avl, box(163), box(710), nullptr);
- avl = grpc_avl_add(avl, box(502), box(711), nullptr);
- avl = remove_int(avl, 674);
- avl = grpc_avl_add(avl, box(697), box(713), nullptr);
- avl = remove_int(avl, 271);
- avl = grpc_avl_add(avl, box(968), box(715), nullptr);
- avl = grpc_avl_add(avl, box(48), box(716), nullptr);
- avl = remove_int(avl, 543);
- avl = grpc_avl_add(avl, box(35), box(718), nullptr);
- avl = grpc_avl_add(avl, box(751), box(719), nullptr);
- avl = grpc_avl_add(avl, box(478), box(720), nullptr);
- avl = remove_int(avl, 797);
- avl = remove_int(avl, 309);
- avl = grpc_avl_add(avl, box(927), box(723), nullptr);
- avl = remove_int(avl, 504);
- avl = grpc_avl_add(avl, box(286), box(725), nullptr);
- avl = grpc_avl_add(avl, box(413), box(726), nullptr);
- avl = grpc_avl_add(avl, box(599), box(727), nullptr);
- avl = remove_int(avl, 105);
- avl = remove_int(avl, 605);
- avl = grpc_avl_add(avl, box(632), box(730), nullptr);
- avl = grpc_avl_add(avl, box(133), box(731), nullptr);
- avl = remove_int(avl, 443);
- avl = grpc_avl_add(avl, box(958), box(733), nullptr);
- avl = grpc_avl_add(avl, box(729), box(734), nullptr);
- avl = remove_int(avl, 158);
- avl = grpc_avl_add(avl, box(694), box(736), nullptr);
- avl = grpc_avl_add(avl, box(505), box(737), nullptr);
- avl = remove_int(avl, 63);
- avl = remove_int(avl, 714);
- avl = grpc_avl_add(avl, box(1002), box(740), nullptr);
- avl = remove_int(avl, 211);
- avl = grpc_avl_add(avl, box(765), box(742), nullptr);
- avl = grpc_avl_add(avl, box(455), box(743), nullptr);
- avl = remove_int(avl, 59);
- avl = remove_int(avl, 224);
- avl = grpc_avl_add(avl, box(586), box(746), nullptr);
- avl = grpc_avl_add(avl, box(348), box(747), nullptr);
- avl = remove_int(avl, 10);
- avl = remove_int(avl, 484);
- avl = grpc_avl_add(avl, box(968), box(750), nullptr);
- avl = grpc_avl_add(avl, box(923), box(751), nullptr);
- avl = remove_int(avl, 573);
- avl = remove_int(avl, 617);
- avl = grpc_avl_add(avl, box(812), box(754), nullptr);
- avl = grpc_avl_add(avl, box(179), box(755), nullptr);
- avl = remove_int(avl, 284);
- avl = remove_int(avl, 157);
- avl = remove_int(avl, 177);
- avl = remove_int(avl, 896);
- avl = grpc_avl_add(avl, box(649), box(760), nullptr);
- avl = grpc_avl_add(avl, box(927), box(761), nullptr);
- avl = grpc_avl_add(avl, box(454), box(762), nullptr);
- avl = grpc_avl_add(avl, box(217), box(763), nullptr);
- avl = remove_int(avl, 534);
- avl = grpc_avl_add(avl, box(180), box(765), nullptr);
- avl = grpc_avl_add(avl, box(319), box(766), nullptr);
- avl = remove_int(avl, 92);
- avl = grpc_avl_add(avl, box(483), box(768), nullptr);
- avl = remove_int(avl, 504);
- avl = remove_int(avl, 1017);
- avl = remove_int(avl, 37);
- avl = remove_int(avl, 50);
- avl = grpc_avl_add(avl, box(302), box(773), nullptr);
- avl = remove_int(avl, 807);
- avl = grpc_avl_add(avl, box(463), box(775), nullptr);
- avl = grpc_avl_add(avl, box(271), box(776), nullptr);
- avl = grpc_avl_add(avl, box(644), box(777), nullptr);
- avl = remove_int(avl, 618);
- avl = grpc_avl_add(avl, box(166), box(779), nullptr);
- avl = grpc_avl_add(avl, box(538), box(780), nullptr);
- avl = remove_int(avl, 606);
- avl = grpc_avl_add(avl, box(425), box(782), nullptr);
- avl = remove_int(avl, 725);
- avl = remove_int(avl, 383);
- avl = grpc_avl_add(avl, box(155), box(785), nullptr);
- avl = remove_int(avl, 889);
- avl = grpc_avl_add(avl, box(653), box(787), nullptr);
- avl = remove_int(avl, 386);
- avl = grpc_avl_add(avl, box(142), box(789), nullptr);
- avl = remove_int(avl, 107);
- avl = remove_int(avl, 603);
- avl = remove_int(avl, 971);
- avl = grpc_avl_add(avl, box(80), box(793), nullptr);
- avl = grpc_avl_add(avl, box(61), box(794), nullptr);
- avl = grpc_avl_add(avl, box(693), box(795), nullptr);
- avl = grpc_avl_add(avl, box(592), box(796), nullptr);
- avl = grpc_avl_add(avl, box(433), box(797), nullptr);
- avl = grpc_avl_add(avl, box(973), box(798), nullptr);
- avl = remove_int(avl, 901);
- avl = remove_int(avl, 340);
- avl = remove_int(avl, 709);
- avl = grpc_avl_add(avl, box(224), box(802), nullptr);
- avl = remove_int(avl, 120);
- avl = remove_int(avl, 271);
- avl = grpc_avl_add(avl, box(780), box(805), nullptr);
- avl = grpc_avl_add(avl, box(867), box(806), nullptr);
- avl = grpc_avl_add(avl, box(756), box(807), nullptr);
- avl = grpc_avl_add(avl, box(583), box(808), nullptr);
- avl = grpc_avl_add(avl, box(356), box(809), nullptr);
- avl = grpc_avl_add(avl, box(58), box(810), nullptr);
- avl = remove_int(avl, 219);
- avl = grpc_avl_add(avl, box(301), box(812), nullptr);
- avl = remove_int(avl, 643);
- avl = remove_int(avl, 787);
- avl = remove_int(avl, 583);
- avl = remove_int(avl, 552);
- avl = remove_int(avl, 308);
- avl = remove_int(avl, 608);
- avl = remove_int(avl, 363);
- avl = remove_int(avl, 690);
- avl = grpc_avl_add(avl, box(233), box(821), nullptr);
- avl = grpc_avl_add(avl, box(479), box(822), nullptr);
- avl = grpc_avl_add(avl, box(323), box(823), nullptr);
- avl = grpc_avl_add(avl, box(802), box(824), nullptr);
- avl = remove_int(avl, 682);
- avl = remove_int(avl, 705);
- avl = remove_int(avl, 487);
- avl = grpc_avl_add(avl, box(530), box(828), nullptr);
- avl = grpc_avl_add(avl, box(232), box(829), nullptr);
- avl = remove_int(avl, 627);
- avl = grpc_avl_add(avl, box(396), box(831), nullptr);
- avl = grpc_avl_add(avl, box(61), box(832), nullptr);
- avl = grpc_avl_add(avl, box(932), box(833), nullptr);
- avl = grpc_avl_add(avl, box(108), box(834), nullptr);
- avl = grpc_avl_add(avl, box(524), box(835), nullptr);
- avl = remove_int(avl, 390);
- avl = remove_int(avl, 307);
- avl = grpc_avl_add(avl, box(722), box(838), nullptr);
- avl = grpc_avl_add(avl, box(907), box(839), nullptr);
- avl = remove_int(avl, 286);
- avl = remove_int(avl, 337);
- avl = remove_int(avl, 443);
- avl = grpc_avl_add(avl, box(973), box(843), nullptr);
- avl = remove_int(avl, 930);
- avl = remove_int(avl, 242);
- avl = grpc_avl_add(avl, box(997), box(846), nullptr);
- avl = grpc_avl_add(avl, box(689), box(847), nullptr);
- avl = remove_int(avl, 318);
- avl = grpc_avl_add(avl, box(703), box(849), nullptr);
- avl = grpc_avl_add(avl, box(868), box(850), nullptr);
- avl = grpc_avl_add(avl, box(200), box(851), nullptr);
- avl = grpc_avl_add(avl, box(960), box(852), nullptr);
- avl = grpc_avl_add(avl, box(80), box(853), nullptr);
- avl = remove_int(avl, 113);
- avl = grpc_avl_add(avl, box(135), box(855), nullptr);
- avl = remove_int(avl, 529);
- avl = grpc_avl_add(avl, box(366), box(857), nullptr);
- avl = remove_int(avl, 272);
- avl = grpc_avl_add(avl, box(921), box(859), nullptr);
- avl = remove_int(avl, 497);
- avl = grpc_avl_add(avl, box(712), box(861), nullptr);
- avl = remove_int(avl, 777);
- avl = remove_int(avl, 505);
- avl = remove_int(avl, 974);
- avl = remove_int(avl, 497);
- avl = grpc_avl_add(avl, box(388), box(866), nullptr);
- avl = grpc_avl_add(avl, box(29), box(867), nullptr);
- avl = grpc_avl_add(avl, box(180), box(868), nullptr);
- avl = grpc_avl_add(avl, box(983), box(869), nullptr);
- avl = grpc_avl_add(avl, box(72), box(870), nullptr);
- avl = grpc_avl_add(avl, box(693), box(871), nullptr);
- avl = grpc_avl_add(avl, box(567), box(872), nullptr);
- avl = remove_int(avl, 549);
- avl = remove_int(avl, 351);
- avl = grpc_avl_add(avl, box(1019), box(875), nullptr);
- avl = remove_int(avl, 585);
- avl = remove_int(avl, 294);
- avl = remove_int(avl, 61);
- avl = grpc_avl_add(avl, box(409), box(879), nullptr);
- avl = grpc_avl_add(avl, box(984), box(880), nullptr);
- avl = grpc_avl_add(avl, box(830), box(881), nullptr);
- avl = remove_int(avl, 579);
- avl = grpc_avl_add(avl, box(672), box(883), nullptr);
- avl = remove_int(avl, 968);
-
- grpc_avl_unref(avl, nullptr);
-}
-
-static void test_badcase3(void) {
- grpc_avl avl;
-
- gpr_log(GPR_DEBUG, "test_badcase3");
-
- avl = grpc_avl_create(&int_int_vtable);
- avl = remove_int(avl, 624);
- avl = grpc_avl_add(avl, box(59), box(2), nullptr);
- avl = grpc_avl_add(avl, box(494), box(3), nullptr);
- avl = grpc_avl_add(avl, box(226), box(4), nullptr);
- avl = remove_int(avl, 524);
- avl = grpc_avl_add(avl, box(540), box(6), nullptr);
- avl = remove_int(avl, 1008);
- avl = grpc_avl_add(avl, box(502), box(8), nullptr);
- avl = remove_int(avl, 267);
- avl = remove_int(avl, 764);
- avl = remove_int(avl, 443);
- avl = grpc_avl_add(avl, box(8), box(12), nullptr);
- avl = remove_int(avl, 291);
- avl = remove_int(avl, 796);
- avl = remove_int(avl, 1002);
- avl = grpc_avl_add(avl, box(778), box(16), nullptr);
- avl = remove_int(avl, 621);
- avl = remove_int(avl, 891);
- avl = remove_int(avl, 880);
- avl = grpc_avl_add(avl, box(197), box(20), nullptr);
- avl = grpc_avl_add(avl, box(441), box(21), nullptr);
- avl = grpc_avl_add(avl, box(719), box(22), nullptr);
- avl = remove_int(avl, 109);
- avl = grpc_avl_add(avl, box(458), box(24), nullptr);
- avl = remove_int(avl, 86);
- avl = grpc_avl_add(avl, box(897), box(26), nullptr);
- avl = grpc_avl_add(avl, box(997), box(27), nullptr);
- avl = remove_int(avl, 235);
- avl = remove_int(avl, 425);
- avl = remove_int(avl, 186);
- avl = grpc_avl_add(avl, box(887), box(31), nullptr);
- avl = grpc_avl_add(avl, box(1005), box(32), nullptr);
- avl = grpc_avl_add(avl, box(778), box(33), nullptr);
- avl = grpc_avl_add(avl, box(575), box(34), nullptr);
- avl = remove_int(avl, 966);
- avl = remove_int(avl, 1015);
- avl = grpc_avl_add(avl, box(486), box(37), nullptr);
- avl = grpc_avl_add(avl, box(809), box(38), nullptr);
- avl = grpc_avl_add(avl, box(907), box(39), nullptr);
- avl = grpc_avl_add(avl, box(971), box(40), nullptr);
- avl = remove_int(avl, 441);
- avl = remove_int(avl, 498);
- avl = grpc_avl_add(avl, box(727), box(43), nullptr);
- avl = remove_int(avl, 679);
- avl = remove_int(avl, 740);
- avl = remove_int(avl, 532);
- avl = grpc_avl_add(avl, box(805), box(47), nullptr);
- avl = remove_int(avl, 64);
- avl = grpc_avl_add(avl, box(362), box(49), nullptr);
- avl = grpc_avl_add(avl, box(170), box(50), nullptr);
- avl = grpc_avl_add(avl, box(389), box(51), nullptr);
- avl = grpc_avl_add(avl, box(689), box(52), nullptr);
- avl = remove_int(avl, 871);
- avl = grpc_avl_add(avl, box(447), box(54), nullptr);
- avl = remove_int(avl, 718);
- avl = grpc_avl_add(avl, box(724), box(56), nullptr);
- avl = remove_int(avl, 215);
- avl = grpc_avl_add(avl, box(550), box(58), nullptr);
- avl = remove_int(avl, 932);
- avl = grpc_avl_add(avl, box(47), box(60), nullptr);
- avl = remove_int(avl, 46);
- avl = remove_int(avl, 229);
- avl = grpc_avl_add(avl, box(68), box(63), nullptr);
- avl = grpc_avl_add(avl, box(387), box(64), nullptr);
- avl = remove_int(avl, 933);
- avl = remove_int(avl, 736);
- avl = remove_int(avl, 719);
- avl = grpc_avl_add(avl, box(150), box(68), nullptr);
- avl = remove_int(avl, 875);
- avl = remove_int(avl, 298);
- avl = grpc_avl_add(avl, box(991), box(71), nullptr);
- avl = remove_int(avl, 705);
- avl = grpc_avl_add(avl, box(197), box(73), nullptr);
- avl = grpc_avl_add(avl, box(101), box(74), nullptr);
- avl = remove_int(avl, 436);
- avl = grpc_avl_add(avl, box(755), box(76), nullptr);
- avl = grpc_avl_add(avl, box(727), box(77), nullptr);
- avl = remove_int(avl, 309);
- avl = remove_int(avl, 253);
- avl = grpc_avl_add(avl, box(203), box(80), nullptr);
- avl = remove_int(avl, 231);
- avl = grpc_avl_add(avl, box(461), box(82), nullptr);
- avl = remove_int(avl, 316);
- avl = remove_int(avl, 493);
- avl = grpc_avl_add(avl, box(184), box(85), nullptr);
- avl = remove_int(avl, 737);
- avl = grpc_avl_add(avl, box(790), box(87), nullptr);
- avl = grpc_avl_add(avl, box(335), box(88), nullptr);
- avl = remove_int(avl, 649);
- avl = grpc_avl_add(avl, box(69), box(90), nullptr);
- avl = remove_int(avl, 585);
- avl = remove_int(avl, 543);
- avl = grpc_avl_add(avl, box(784), box(93), nullptr);
- avl = grpc_avl_add(avl, box(60), box(94), nullptr);
- avl = grpc_avl_add(avl, box(525), box(95), nullptr);
- avl = grpc_avl_add(avl, box(177), box(96), nullptr);
- avl = grpc_avl_add(avl, box(178), box(97), nullptr);
- avl = grpc_avl_add(avl, box(683), box(98), nullptr);
- avl = grpc_avl_add(avl, box(226), box(99), nullptr);
- avl = grpc_avl_add(avl, box(662), box(100), nullptr);
- avl = remove_int(avl, 944);
- avl = grpc_avl_add(avl, box(562), box(102), nullptr);
- avl = grpc_avl_add(avl, box(793), box(103), nullptr);
- avl = remove_int(avl, 673);
- avl = grpc_avl_add(avl, box(310), box(105), nullptr);
- avl = remove_int(avl, 479);
- avl = remove_int(avl, 543);
- avl = remove_int(avl, 159);
- avl = remove_int(avl, 850);
- avl = grpc_avl_add(avl, box(318), box(110), nullptr);
- avl = grpc_avl_add(avl, box(483), box(111), nullptr);
- avl = grpc_avl_add(avl, box(84), box(112), nullptr);
- avl = remove_int(avl, 109);
- avl = grpc_avl_add(avl, box(132), box(114), nullptr);
- avl = grpc_avl_add(avl, box(920), box(115), nullptr);
- avl = remove_int(avl, 746);
- avl = grpc_avl_add(avl, box(145), box(117), nullptr);
- avl = grpc_avl_add(avl, box(526), box(118), nullptr);
- avl = remove_int(avl, 158);
- avl = grpc_avl_add(avl, box(332), box(120), nullptr);
- avl = grpc_avl_add(avl, box(918), box(121), nullptr);
- avl = remove_int(avl, 339);
- avl = grpc_avl_add(avl, box(809), box(123), nullptr);
- avl = grpc_avl_add(avl, box(742), box(124), nullptr);
- avl = grpc_avl_add(avl, box(718), box(125), nullptr);
- avl = remove_int(avl, 988);
- avl = remove_int(avl, 531);
- avl = remove_int(avl, 840);
- avl = grpc_avl_add(avl, box(816), box(129), nullptr);
- avl = grpc_avl_add(avl, box(976), box(130), nullptr);
- avl = remove_int(avl, 743);
- avl = remove_int(avl, 528);
- avl = remove_int(avl, 982);
- avl = grpc_avl_add(avl, box(803), box(134), nullptr);
- avl = grpc_avl_add(avl, box(205), box(135), nullptr);
- avl = grpc_avl_add(avl, box(584), box(136), nullptr);
- avl = remove_int(avl, 923);
- avl = remove_int(avl, 538);
- avl = remove_int(avl, 398);
- avl = remove_int(avl, 320);
- avl = remove_int(avl, 292);
- avl = grpc_avl_add(avl, box(270), box(142), nullptr);
- avl = grpc_avl_add(avl, box(333), box(143), nullptr);
- avl = remove_int(avl, 439);
- avl = grpc_avl_add(avl, box(35), box(145), nullptr);
- avl = grpc_avl_add(avl, box(837), box(146), nullptr);
- avl = remove_int(avl, 65);
- avl = remove_int(avl, 642);
- avl = remove_int(avl, 371);
- avl = remove_int(avl, 140);
- avl = remove_int(avl, 533);
- avl = remove_int(avl, 676);
- avl = grpc_avl_add(avl, box(624), box(153), nullptr);
- avl = grpc_avl_add(avl, box(116), box(154), nullptr);
- avl = grpc_avl_add(avl, box(446), box(155), nullptr);
- avl = remove_int(avl, 91);
- avl = remove_int(avl, 721);
- avl = remove_int(avl, 537);
- avl = grpc_avl_add(avl, box(448), box(159), nullptr);
- avl = remove_int(avl, 155);
- avl = remove_int(avl, 344);
- avl = remove_int(avl, 237);
- avl = grpc_avl_add(avl, box(309), box(163), nullptr);
- avl = grpc_avl_add(avl, box(434), box(164), nullptr);
- avl = grpc_avl_add(avl, box(277), box(165), nullptr);
- avl = remove_int(avl, 233);
- avl = grpc_avl_add(avl, box(275), box(167), nullptr);
- avl = grpc_avl_add(avl, box(218), box(168), nullptr);
- avl = grpc_avl_add(avl, box(76), box(169), nullptr);
- avl = grpc_avl_add(avl, box(898), box(170), nullptr);
- avl = remove_int(avl, 771);
- avl = grpc_avl_add(avl, box(237), box(172), nullptr);
- avl = remove_int(avl, 327);
- avl = grpc_avl_add(avl, box(499), box(174), nullptr);
- avl = remove_int(avl, 727);
- avl = remove_int(avl, 234);
- avl = remove_int(avl, 623);
- avl = remove_int(avl, 458);
- avl = remove_int(avl, 326);
- avl = remove_int(avl, 589);
- avl = grpc_avl_add(avl, box(442), box(181), nullptr);
- avl = remove_int(avl, 389);
- avl = grpc_avl_add(avl, box(708), box(183), nullptr);
- avl = grpc_avl_add(avl, box(594), box(184), nullptr);
- avl = grpc_avl_add(avl, box(942), box(185), nullptr);
- avl = grpc_avl_add(avl, box(282), box(186), nullptr);
- avl = remove_int(avl, 434);
- avl = remove_int(avl, 134);
- avl = remove_int(avl, 270);
- avl = remove_int(avl, 512);
- avl = remove_int(avl, 265);
- avl = remove_int(avl, 21);
- avl = remove_int(avl, 193);
- avl = remove_int(avl, 797);
- avl = remove_int(avl, 347);
- avl = grpc_avl_add(avl, box(99), box(196), nullptr);
- avl = grpc_avl_add(avl, box(161), box(197), nullptr);
- avl = remove_int(avl, 484);
- avl = grpc_avl_add(avl, box(72), box(199), nullptr);
- avl = remove_int(avl, 629);
- avl = grpc_avl_add(avl, box(522), box(201), nullptr);
- avl = remove_int(avl, 679);
- avl = grpc_avl_add(avl, box(407), box(203), nullptr);
- avl = remove_int(avl, 693);
- avl = grpc_avl_add(avl, box(424), box(205), nullptr);
- avl = grpc_avl_add(avl, box(651), box(206), nullptr);
- avl = grpc_avl_add(avl, box(927), box(207), nullptr);
- avl = remove_int(avl, 553);
- avl = grpc_avl_add(avl, box(128), box(209), nullptr);
- avl = grpc_avl_add(avl, box(616), box(210), nullptr);
- avl = grpc_avl_add(avl, box(690), box(211), nullptr);
- avl = remove_int(avl, 241);
- avl = remove_int(avl, 179);
- avl = grpc_avl_add(avl, box(697), box(214), nullptr);
- avl = remove_int(avl, 779);
- avl = grpc_avl_add(avl, box(241), box(216), nullptr);
- avl = remove_int(avl, 190);
- avl = remove_int(avl, 210);
- avl = grpc_avl_add(avl, box(711), box(219), nullptr);
- avl = remove_int(avl, 251);
- avl = remove_int(avl, 61);
- avl = grpc_avl_add(avl, box(800), box(222), nullptr);
- avl = remove_int(avl, 551);
- avl = grpc_avl_add(avl, box(61), box(224), nullptr);
- avl = grpc_avl_add(avl, box(656), box(225), nullptr);
- avl = remove_int(avl, 130);
- avl = remove_int(avl, 368);
- avl = remove_int(avl, 150);
- avl = remove_int(avl, 73);
- avl = grpc_avl_add(avl, box(799), box(230), nullptr);
- avl = grpc_avl_add(avl, box(125), box(231), nullptr);
- avl = remove_int(avl, 107);
- avl = grpc_avl_add(avl, box(938), box(233), nullptr);
- avl = grpc_avl_add(avl, box(914), box(234), nullptr);
- avl = grpc_avl_add(avl, box(197), box(235), nullptr);
- avl = remove_int(avl, 736);
- avl = grpc_avl_add(avl, box(20), box(237), nullptr);
- avl = remove_int(avl, 224);
- avl = remove_int(avl, 841);
- avl = grpc_avl_add(avl, box(226), box(240), nullptr);
- avl = remove_int(avl, 963);
- avl = remove_int(avl, 796);
- avl = remove_int(avl, 728);
- avl = grpc_avl_add(avl, box(855), box(244), nullptr);
- avl = grpc_avl_add(avl, box(769), box(245), nullptr);
- avl = grpc_avl_add(avl, box(631), box(246), nullptr);
- avl = remove_int(avl, 648);
- avl = grpc_avl_add(avl, box(187), box(248), nullptr);
- avl = grpc_avl_add(avl, box(31), box(249), nullptr);
- avl = remove_int(avl, 163);
- avl = grpc_avl_add(avl, box(218), box(251), nullptr);
- avl = grpc_avl_add(avl, box(488), box(252), nullptr);
- avl = grpc_avl_add(avl, box(387), box(253), nullptr);
- avl = grpc_avl_add(avl, box(809), box(254), nullptr);
- avl = grpc_avl_add(avl, box(997), box(255), nullptr);
- avl = remove_int(avl, 678);
- avl = grpc_avl_add(avl, box(368), box(257), nullptr);
- avl = grpc_avl_add(avl, box(220), box(258), nullptr);
- avl = grpc_avl_add(avl, box(373), box(259), nullptr);
- avl = remove_int(avl, 874);
- avl = remove_int(avl, 682);
- avl = remove_int(avl, 1014);
- avl = remove_int(avl, 195);
- avl = grpc_avl_add(avl, box(868), box(264), nullptr);
- avl = remove_int(avl, 254);
- avl = remove_int(avl, 456);
- avl = grpc_avl_add(avl, box(906), box(267), nullptr);
- avl = remove_int(avl, 711);
- avl = grpc_avl_add(avl, box(632), box(269), nullptr);
- avl = remove_int(avl, 474);
- avl = grpc_avl_add(avl, box(508), box(271), nullptr);
- avl = grpc_avl_add(avl, box(518), box(272), nullptr);
- avl = remove_int(avl, 579);
- avl = remove_int(avl, 948);
- avl = grpc_avl_add(avl, box(789), box(275), nullptr);
- avl = grpc_avl_add(avl, box(48), box(276), nullptr);
- avl = grpc_avl_add(avl, box(256), box(277), nullptr);
- avl = grpc_avl_add(avl, box(754), box(278), nullptr);
- avl = remove_int(avl, 215);
- avl = grpc_avl_add(avl, box(679), box(280), nullptr);
- avl = grpc_avl_add(avl, box(606), box(281), nullptr);
- avl = remove_int(avl, 941);
- avl = remove_int(avl, 31);
- avl = grpc_avl_add(avl, box(758), box(284), nullptr);
- avl = remove_int(avl, 101);
- avl = grpc_avl_add(avl, box(244), box(286), nullptr);
- avl = grpc_avl_add(avl, box(337), box(287), nullptr);
- avl = grpc_avl_add(avl, box(461), box(288), nullptr);
- avl = remove_int(avl, 476);
- avl = grpc_avl_add(avl, box(845), box(290), nullptr);
- avl = remove_int(avl, 160);
- avl = grpc_avl_add(avl, box(690), box(292), nullptr);
- avl = remove_int(avl, 931);
- avl = grpc_avl_add(avl, box(869), box(294), nullptr);
- avl = grpc_avl_add(avl, box(1019), box(295), nullptr);
- avl = remove_int(avl, 591);
- avl = remove_int(avl, 635);
- avl = remove_int(avl, 67);
- avl = grpc_avl_add(avl, box(113), box(299), nullptr);
- avl = remove_int(avl, 305);
- avl = grpc_avl_add(avl, box(10), box(301), nullptr);
- avl = remove_int(avl, 823);
- avl = remove_int(avl, 288);
- avl = remove_int(avl, 239);
- avl = grpc_avl_add(avl, box(646), box(305), nullptr);
- avl = grpc_avl_add(avl, box(1006), box(306), nullptr);
- avl = grpc_avl_add(avl, box(954), box(307), nullptr);
- avl = grpc_avl_add(avl, box(199), box(308), nullptr);
- avl = grpc_avl_add(avl, box(69), box(309), nullptr);
- avl = grpc_avl_add(avl, box(984), box(310), nullptr);
- avl = remove_int(avl, 568);
- avl = remove_int(avl, 666);
- avl = remove_int(avl, 37);
- avl = grpc_avl_add(avl, box(845), box(314), nullptr);
- avl = remove_int(avl, 535);
- avl = remove_int(avl, 365);
- avl = remove_int(avl, 676);
- avl = remove_int(avl, 892);
- avl = remove_int(avl, 425);
- avl = remove_int(avl, 704);
- avl = remove_int(avl, 168);
- avl = grpc_avl_add(avl, box(853), box(322), nullptr);
- avl = grpc_avl_add(avl, box(335), box(323), nullptr);
- avl = grpc_avl_add(avl, box(961), box(324), nullptr);
- avl = grpc_avl_add(avl, box(73), box(325), nullptr);
- avl = remove_int(avl, 469);
- avl = grpc_avl_add(avl, box(449), box(327), nullptr);
- avl = remove_int(avl, 821);
- avl = grpc_avl_add(avl, box(845), box(329), nullptr);
- avl = remove_int(avl, 637);
- avl = grpc_avl_add(avl, box(769), box(331), nullptr);
- avl = grpc_avl_add(avl, box(901), box(332), nullptr);
- avl = remove_int(avl, 142);
- avl = remove_int(avl, 361);
- avl = remove_int(avl, 876);
- avl = grpc_avl_add(avl, box(614), box(336), nullptr);
- avl = grpc_avl_add(avl, box(729), box(337), nullptr);
- avl = remove_int(avl, 120);
- avl = remove_int(avl, 473);
- avl = remove_int(avl, 445);
- avl = grpc_avl_add(avl, box(978), box(341), nullptr);
- avl = grpc_avl_add(avl, box(164), box(342), nullptr);
- avl = grpc_avl_add(avl, box(1), box(343), nullptr);
- avl = remove_int(avl, 890);
- avl = grpc_avl_add(avl, box(605), box(345), nullptr);
- avl = grpc_avl_add(avl, box(178), box(346), nullptr);
- avl = grpc_avl_add(avl, box(481), box(347), nullptr);
- avl = grpc_avl_add(avl, box(772), box(348), nullptr);
- avl = remove_int(avl, 824);
- avl = remove_int(avl, 167);
- avl = remove_int(avl, 151);
- avl = grpc_avl_add(avl, box(698), box(352), nullptr);
- avl = grpc_avl_add(avl, box(202), box(353), nullptr);
- avl = grpc_avl_add(avl, box(921), box(354), nullptr);
- avl = grpc_avl_add(avl, box(875), box(355), nullptr);
- avl = remove_int(avl, 197);
- avl = remove_int(avl, 232);
- avl = grpc_avl_add(avl, box(209), box(358), nullptr);
- avl = remove_int(avl, 324);
- avl = remove_int(avl, 56);
- avl = remove_int(avl, 579);
- avl = remove_int(avl, 255);
- avl = remove_int(avl, 290);
- avl = grpc_avl_add(avl, box(661), box(364), nullptr);
- avl = grpc_avl_add(avl, box(113), box(365), nullptr);
- avl = remove_int(avl, 767);
- avl = grpc_avl_add(avl, box(586), box(367), nullptr);
- avl = grpc_avl_add(avl, box(121), box(368), nullptr);
- avl = remove_int(avl, 235);
- avl = remove_int(avl, 439);
- avl = remove_int(avl, 360);
- avl = grpc_avl_add(avl, box(916), box(372), nullptr);
- avl = remove_int(avl, 999);
- avl = grpc_avl_add(avl, box(825), box(374), nullptr);
- avl = grpc_avl_add(avl, box(177), box(375), nullptr);
- avl = remove_int(avl, 204);
- avl = remove_int(avl, 92);
- avl = grpc_avl_add(avl, box(794), box(378), nullptr);
- avl = grpc_avl_add(avl, box(463), box(379), nullptr);
- avl = grpc_avl_add(avl, box(472), box(380), nullptr);
- avl = remove_int(avl, 235);
- avl = grpc_avl_add(avl, box(840), box(382), nullptr);
- avl = remove_int(avl, 657);
- avl = grpc_avl_add(avl, box(586), box(384), nullptr);
- avl = grpc_avl_add(avl, box(979), box(385), nullptr);
- avl = remove_int(avl, 979);
- avl = grpc_avl_add(avl, box(639), box(387), nullptr);
- avl = remove_int(avl, 907);
- avl = remove_int(avl, 973);
- avl = grpc_avl_add(avl, box(913), box(390), nullptr);
- avl = grpc_avl_add(avl, box(566), box(391), nullptr);
- avl = grpc_avl_add(avl, box(883), box(392), nullptr);
- avl = grpc_avl_add(avl, box(552), box(393), nullptr);
- avl = grpc_avl_add(avl, box(16), box(394), nullptr);
- avl = remove_int(avl, 60);
- avl = grpc_avl_add(avl, box(567), box(396), nullptr);
- avl = grpc_avl_add(avl, box(705), box(397), nullptr);
- avl = grpc_avl_add(avl, box(94), box(398), nullptr);
- avl = remove_int(avl, 321);
- avl = grpc_avl_add(avl, box(207), box(400), nullptr);
- avl = grpc_avl_add(avl, box(682), box(401), nullptr);
- avl = grpc_avl_add(avl, box(592), box(402), nullptr);
- avl = grpc_avl_add(avl, box(10), box(403), nullptr);
- avl = remove_int(avl, 911);
- avl = remove_int(avl, 161);
- avl = grpc_avl_add(avl, box(86), box(406), nullptr);
- avl = remove_int(avl, 893);
- avl = remove_int(avl, 362);
- avl = grpc_avl_add(avl, box(599), box(409), nullptr);
- avl = remove_int(avl, 413);
- avl = grpc_avl_add(avl, box(867), box(411), nullptr);
- avl = remove_int(avl, 955);
- avl = grpc_avl_add(avl, box(341), box(413), nullptr);
- avl = grpc_avl_add(avl, box(887), box(414), nullptr);
- avl = remove_int(avl, 706);
- avl = grpc_avl_add(avl, box(939), box(416), nullptr);
- avl = remove_int(avl, 233);
- avl = remove_int(avl, 662);
- avl = remove_int(avl, 984);
- avl = remove_int(avl, 203);
- avl = grpc_avl_add(avl, box(326), box(421), nullptr);
- avl = remove_int(avl, 848);
- avl = grpc_avl_add(avl, box(235), box(423), nullptr);
- avl = remove_int(avl, 617);
- avl = grpc_avl_add(avl, box(565), box(425), nullptr);
- avl = remove_int(avl, 469);
- avl = grpc_avl_add(avl, box(988), box(427), nullptr);
- avl = remove_int(avl, 957);
- avl = grpc_avl_add(avl, box(426), box(429), nullptr);
- avl = remove_int(avl, 967);
- avl = grpc_avl_add(avl, box(890), box(431), nullptr);
- avl = grpc_avl_add(avl, box(473), box(432), nullptr);
- avl = remove_int(avl, 367);
- avl = remove_int(avl, 344);
- avl = remove_int(avl, 660);
- avl = remove_int(avl, 448);
- avl = remove_int(avl, 837);
- avl = remove_int(avl, 158);
- avl = grpc_avl_add(avl, box(459), box(439), nullptr);
- avl = remove_int(avl, 882);
- avl = remove_int(avl, 782);
- avl = grpc_avl_add(avl, box(408), box(442), nullptr);
- avl = grpc_avl_add(avl, box(728), box(443), nullptr);
- avl = remove_int(avl, 27);
- avl = grpc_avl_add(avl, box(137), box(445), nullptr);
- avl = grpc_avl_add(avl, box(239), box(446), nullptr);
- avl = remove_int(avl, 854);
- avl = grpc_avl_add(avl, box(104), box(448), nullptr);
- avl = grpc_avl_add(avl, box(823), box(449), nullptr);
- avl = grpc_avl_add(avl, box(524), box(450), nullptr);
- avl = grpc_avl_add(avl, box(995), box(451), nullptr);
- avl = remove_int(avl, 422);
- avl = remove_int(avl, 220);
- avl = grpc_avl_add(avl, box(856), box(454), nullptr);
- avl = remove_int(avl, 332);
- avl = grpc_avl_add(avl, box(679), box(456), nullptr);
- avl = remove_int(avl, 18);
- avl = grpc_avl_add(avl, box(837), box(458), nullptr);
- avl = remove_int(avl, 405);
- avl = remove_int(avl, 877);
- avl = remove_int(avl, 835);
- avl = grpc_avl_add(avl, box(547), box(462), nullptr);
- avl = remove_int(avl, 805);
- avl = remove_int(avl, 862);
- avl = grpc_avl_add(avl, box(75), box(465), nullptr);
- avl = remove_int(avl, 41);
- avl = grpc_avl_add(avl, box(310), box(467), nullptr);
- avl = remove_int(avl, 855);
- avl = grpc_avl_add(avl, box(20), box(469), nullptr);
- avl = remove_int(avl, 186);
- avl = remove_int(avl, 378);
- avl = remove_int(avl, 442);
- avl = remove_int(avl, 930);
- avl = grpc_avl_add(avl, box(118), box(474), nullptr);
- avl = grpc_avl_add(avl, box(96), box(475), nullptr);
- avl = remove_int(avl, 854);
- avl = grpc_avl_add(avl, box(65), box(477), nullptr);
- avl = grpc_avl_add(avl, box(573), box(478), nullptr);
- avl = grpc_avl_add(avl, box(4), box(479), nullptr);
- avl = grpc_avl_add(avl, box(451), box(480), nullptr);
- avl = grpc_avl_add(avl, box(774), box(481), nullptr);
- avl = grpc_avl_add(avl, box(126), box(482), nullptr);
- avl = remove_int(avl, 956);
- avl = remove_int(avl, 591);
- avl = remove_int(avl, 644);
- avl = grpc_avl_add(avl, box(304), box(486), nullptr);
- avl = remove_int(avl, 620);
- avl = remove_int(avl, 394);
- avl = grpc_avl_add(avl, box(1002), box(489), nullptr);
- avl = grpc_avl_add(avl, box(837), box(490), nullptr);
- avl = remove_int(avl, 485);
- avl = grpc_avl_add(avl, box(1005), box(492), nullptr);
- avl = remove_int(avl, 21);
- avl = grpc_avl_add(avl, box(396), box(494), nullptr);
- avl = remove_int(avl, 966);
- avl = grpc_avl_add(avl, box(105), box(496), nullptr);
- avl = grpc_avl_add(avl, box(316), box(497), nullptr);
- avl = remove_int(avl, 776);
- avl = grpc_avl_add(avl, box(188), box(499), nullptr);
- avl = remove_int(avl, 200);
- avl = grpc_avl_add(avl, box(98), box(501), nullptr);
- avl = grpc_avl_add(avl, box(831), box(502), nullptr);
- avl = grpc_avl_add(avl, box(227), box(503), nullptr);
- avl = grpc_avl_add(avl, box(220), box(504), nullptr);
- avl = remove_int(avl, 715);
- avl = remove_int(avl, 279);
- avl = grpc_avl_add(avl, box(701), box(507), nullptr);
- avl = grpc_avl_add(avl, box(726), box(508), nullptr);
- avl = grpc_avl_add(avl, box(815), box(509), nullptr);
- avl = grpc_avl_add(avl, box(749), box(510), nullptr);
- avl = remove_int(avl, 946);
- avl = remove_int(avl, 449);
- avl = remove_int(avl, 62);
- avl = remove_int(avl, 487);
- avl = grpc_avl_add(avl, box(545), box(515), nullptr);
- avl = remove_int(avl, 59);
- avl = grpc_avl_add(avl, box(168), box(517), nullptr);
- avl = remove_int(avl, 337);
- avl = grpc_avl_add(avl, box(69), box(519), nullptr);
- avl = remove_int(avl, 600);
- avl = grpc_avl_add(avl, box(591), box(521), nullptr);
- avl = grpc_avl_add(avl, box(960), box(522), nullptr);
- avl = grpc_avl_add(avl, box(116), box(523), nullptr);
- avl = remove_int(avl, 991);
- avl = grpc_avl_add(avl, box(760), box(525), nullptr);
- avl = grpc_avl_add(avl, box(664), box(526), nullptr);
- avl = grpc_avl_add(avl, box(547), box(527), nullptr);
- avl = remove_int(avl, 922);
- avl = grpc_avl_add(avl, box(290), box(529), nullptr);
- avl = grpc_avl_add(avl, box(859), box(530), nullptr);
- avl = grpc_avl_add(avl, box(49), box(531), nullptr);
- avl = remove_int(avl, 455);
- avl = remove_int(avl, 786);
- avl = grpc_avl_add(avl, box(613), box(534), nullptr);
- avl = grpc_avl_add(avl, box(326), box(535), nullptr);
- avl = remove_int(avl, 615);
- avl = grpc_avl_add(avl, box(45), box(537), nullptr);
- avl = grpc_avl_add(avl, box(162), box(538), nullptr);
- avl = grpc_avl_add(avl, box(189), box(539), nullptr);
- avl = remove_int(avl, 68);
- avl = remove_int(avl, 846);
- avl = grpc_avl_add(avl, box(608), box(542), nullptr);
- avl = remove_int(avl, 821);
- avl = grpc_avl_add(avl, box(978), box(544), nullptr);
- avl = grpc_avl_add(avl, box(892), box(545), nullptr);
- avl = remove_int(avl, 924);
- avl = grpc_avl_add(avl, box(708), box(547), nullptr);
- avl = remove_int(avl, 135);
- avl = remove_int(avl, 124);
- avl = grpc_avl_add(avl, box(301), box(550), nullptr);
- avl = grpc_avl_add(avl, box(939), box(551), nullptr);
- avl = grpc_avl_add(avl, box(344), box(552), nullptr);
- avl = remove_int(avl, 443);
- avl = remove_int(avl, 122);
- avl = grpc_avl_add(avl, box(636), box(555), nullptr);
- avl = remove_int(avl, 558);
- avl = grpc_avl_add(avl, box(923), box(557), nullptr);
- avl = remove_int(avl, 827);
- avl = grpc_avl_add(avl, box(649), box(559), nullptr);
- avl = grpc_avl_add(avl, box(808), box(560), nullptr);
- avl = remove_int(avl, 570);
- avl = remove_int(avl, 434);
- avl = grpc_avl_add(avl, box(40), box(563), nullptr);
- avl = grpc_avl_add(avl, box(725), box(564), nullptr);
- avl = remove_int(avl, 295);
- avl = remove_int(avl, 615);
- avl = remove_int(avl, 919);
- avl = remove_int(avl, 170);
- avl = remove_int(avl, 442);
- avl = remove_int(avl, 971);
- avl = grpc_avl_add(avl, box(483), box(571), nullptr);
- avl = grpc_avl_add(avl, box(512), box(572), nullptr);
- avl = remove_int(avl, 648);
- avl = remove_int(avl, 78);
- avl = remove_int(avl, 72);
- avl = remove_int(avl, 790);
- avl = remove_int(avl, 571);
- avl = grpc_avl_add(avl, box(898), box(578), nullptr);
- avl = remove_int(avl, 770);
- avl = remove_int(avl, 776);
- avl = grpc_avl_add(avl, box(602), box(581), nullptr);
- avl = remove_int(avl, 251);
- avl = grpc_avl_add(avl, box(303), box(583), nullptr);
- avl = remove_int(avl, 837);
- avl = grpc_avl_add(avl, box(714), box(585), nullptr);
- avl = remove_int(avl, 800);
- avl = grpc_avl_add(avl, box(266), box(587), nullptr);
- avl = grpc_avl_add(avl, box(555), box(588), nullptr);
- avl = remove_int(avl, 604);
- avl = remove_int(avl, 163);
- avl = remove_int(avl, 497);
- avl = grpc_avl_add(avl, box(296), box(592), nullptr);
- avl = remove_int(avl, 129);
- avl = grpc_avl_add(avl, box(656), box(594), nullptr);
- avl = remove_int(avl, 769);
- avl = remove_int(avl, 941);
- avl = grpc_avl_add(avl, box(775), box(597), nullptr);
- avl = grpc_avl_add(avl, box(846), box(598), nullptr);
- avl = remove_int(avl, 591);
- avl = remove_int(avl, 801);
- avl = remove_int(avl, 419);
- avl = remove_int(avl, 455);
- avl = grpc_avl_add(avl, box(866), box(603), nullptr);
- avl = grpc_avl_add(avl, box(575), box(604), nullptr);
- avl = grpc_avl_add(avl, box(620), box(605), nullptr);
- avl = remove_int(avl, 100);
- avl = remove_int(avl, 667);
- avl = grpc_avl_add(avl, box(138), box(608), nullptr);
- avl = grpc_avl_add(avl, box(566), box(609), nullptr);
- avl = grpc_avl_add(avl, box(673), box(610), nullptr);
- avl = grpc_avl_add(avl, box(178), box(611), nullptr);
- avl = remove_int(avl, 659);
- avl = grpc_avl_add(avl, box(759), box(613), nullptr);
- avl = grpc_avl_add(avl, box(1008), box(614), nullptr);
- avl = remove_int(avl, 116);
- avl = grpc_avl_add(avl, box(608), box(616), nullptr);
- avl = grpc_avl_add(avl, box(339), box(617), nullptr);
- avl = grpc_avl_add(avl, box(197), box(618), nullptr);
- avl = remove_int(avl, 25);
- avl = remove_int(avl, 628);
- avl = grpc_avl_add(avl, box(487), box(621), nullptr);
- avl = remove_int(avl, 739);
- avl = remove_int(avl, 100);
- avl = remove_int(avl, 928);
- avl = grpc_avl_add(avl, box(647), box(625), nullptr);
- avl = remove_int(avl, 978);
- avl = remove_int(avl, 143);
- avl = remove_int(avl, 755);
- avl = grpc_avl_add(avl, box(71), box(629), nullptr);
- avl = remove_int(avl, 205);
- avl = grpc_avl_add(avl, box(501), box(631), nullptr);
- avl = remove_int(avl, 723);
- avl = remove_int(avl, 852);
- avl = remove_int(avl, 1021);
- avl = remove_int(avl, 670);
- avl = remove_int(avl, 500);
- avl = grpc_avl_add(avl, box(330), box(637), nullptr);
- avl = remove_int(avl, 264);
- avl = grpc_avl_add(avl, box(69), box(639), nullptr);
- avl = remove_int(avl, 73);
- avl = grpc_avl_add(avl, box(745), box(641), nullptr);
- avl = remove_int(avl, 518);
- avl = remove_int(avl, 641);
- avl = remove_int(avl, 768);
- avl = grpc_avl_add(avl, box(988), box(645), nullptr);
- avl = grpc_avl_add(avl, box(899), box(646), nullptr);
- avl = remove_int(avl, 763);
- avl = remove_int(avl, 281);
- avl = remove_int(avl, 496);
- avl = grpc_avl_add(avl, box(445), box(650), nullptr);
- avl = remove_int(avl, 905);
- avl = grpc_avl_add(avl, box(275), box(652), nullptr);
- avl = grpc_avl_add(avl, box(137), box(653), nullptr);
- avl = remove_int(avl, 642);
- avl = grpc_avl_add(avl, box(708), box(655), nullptr);
- avl = remove_int(avl, 922);
- avl = grpc_avl_add(avl, box(743), box(657), nullptr);
- avl = remove_int(avl, 295);
- avl = remove_int(avl, 665);
- avl = remove_int(avl, 48);
- avl = grpc_avl_add(avl, box(1012), box(661), nullptr);
- avl = remove_int(avl, 71);
- avl = remove_int(avl, 523);
- avl = grpc_avl_add(avl, box(319), box(664), nullptr);
- avl = remove_int(avl, 632);
- avl = grpc_avl_add(avl, box(137), box(666), nullptr);
- avl = grpc_avl_add(avl, box(686), box(667), nullptr);
- avl = grpc_avl_add(avl, box(724), box(668), nullptr);
- avl = grpc_avl_add(avl, box(952), box(669), nullptr);
- avl = grpc_avl_add(avl, box(5), box(670), nullptr);
- avl = remove_int(avl, 35);
- avl = grpc_avl_add(avl, box(43), box(672), nullptr);
- avl = grpc_avl_add(avl, box(320), box(673), nullptr);
- avl = grpc_avl_add(avl, box(115), box(674), nullptr);
- avl = remove_int(avl, 377);
- avl = remove_int(avl, 591);
- avl = remove_int(avl, 87);
- avl = remove_int(avl, 93);
- avl = grpc_avl_add(avl, box(1016), box(679), nullptr);
- avl = grpc_avl_add(avl, box(605), box(680), nullptr);
- avl = grpc_avl_add(avl, box(152), box(681), nullptr);
- avl = grpc_avl_add(avl, box(113), box(682), nullptr);
- avl = remove_int(avl, 131);
- avl = remove_int(avl, 637);
- avl = grpc_avl_add(avl, box(156), box(685), nullptr);
- avl = remove_int(avl, 696);
- avl = grpc_avl_add(avl, box(546), box(687), nullptr);
- avl = remove_int(avl, 970);
- avl = remove_int(avl, 53);
- avl = remove_int(avl, 827);
- avl = remove_int(avl, 224);
- avl = remove_int(avl, 796);
- avl = remove_int(avl, 34);
- avl = remove_int(avl, 922);
- avl = remove_int(avl, 277);
- avl = remove_int(avl, 650);
- avl = remove_int(avl, 222);
- avl = remove_int(avl, 244);
- avl = remove_int(avl, 576);
- avl = remove_int(avl, 413);
- avl = grpc_avl_add(avl, box(500), box(701), nullptr);
- avl = remove_int(avl, 924);
- avl = grpc_avl_add(avl, box(825), box(703), nullptr);
- avl = remove_int(avl, 888);
- avl = remove_int(avl, 931);
- avl = grpc_avl_add(avl, box(285), box(706), nullptr);
- avl = remove_int(avl, 62);
- avl = remove_int(avl, 444);
- avl = remove_int(avl, 946);
- avl = grpc_avl_add(avl, box(122), box(710), nullptr);
- avl = grpc_avl_add(avl, box(846), box(711), nullptr);
- avl = remove_int(avl, 628);
- avl = grpc_avl_add(avl, box(511), box(713), nullptr);
- avl = grpc_avl_add(avl, box(398), box(714), nullptr);
- avl = remove_int(avl, 730);
- avl = grpc_avl_add(avl, box(797), box(716), nullptr);
- avl = remove_int(avl, 897);
- avl = remove_int(avl, 228);
- avl = remove_int(avl, 544);
- avl = remove_int(avl, 552);
- avl = remove_int(avl, 783);
- avl = remove_int(avl, 583);
- avl = remove_int(avl, 894);
- avl = remove_int(avl, 942);
- avl = grpc_avl_add(avl, box(346), box(725), nullptr);
- avl = grpc_avl_add(avl, box(1015), box(726), nullptr);
- avl = remove_int(avl, 813);
- avl = grpc_avl_add(avl, box(213), box(728), nullptr);
- avl = remove_int(avl, 468);
- avl = remove_int(avl, 365);
- avl = remove_int(avl, 399);
- avl = grpc_avl_add(avl, box(380), box(732), nullptr);
- avl = remove_int(avl, 835);
- avl = remove_int(avl, 970);
- avl = grpc_avl_add(avl, box(700), box(735), nullptr);
- avl = grpc_avl_add(avl, box(807), box(736), nullptr);
- avl = remove_int(avl, 312);
- avl = remove_int(avl, 282);
- avl = remove_int(avl, 370);
- avl = remove_int(avl, 999);
- avl = remove_int(avl, 241);
- avl = remove_int(avl, 884);
- avl = grpc_avl_add(avl, box(587), box(743), nullptr);
- avl = grpc_avl_add(avl, box(332), box(744), nullptr);
- avl = remove_int(avl, 686);
- avl = remove_int(avl, 206);
- avl = remove_int(avl, 835);
- avl = grpc_avl_add(avl, box(334), box(748), nullptr);
- avl = remove_int(avl, 171);
- avl = grpc_avl_add(avl, box(1002), box(750), nullptr);
- avl = grpc_avl_add(avl, box(779), box(751), nullptr);
- avl = grpc_avl_add(avl, box(307), box(752), nullptr);
- avl = grpc_avl_add(avl, box(127), box(753), nullptr);
- avl = grpc_avl_add(avl, box(251), box(754), nullptr);
- avl = remove_int(avl, 790);
- avl = remove_int(avl, 189);
- avl = remove_int(avl, 193);
- avl = remove_int(avl, 38);
- avl = remove_int(avl, 124);
- avl = grpc_avl_add(avl, box(812), box(760), nullptr);
- avl = remove_int(avl, 43);
- avl = grpc_avl_add(avl, box(871), box(762), nullptr);
- avl = grpc_avl_add(avl, box(580), box(763), nullptr);
- avl = remove_int(avl, 501);
- avl = remove_int(avl, 462);
- avl = remove_int(avl, 599);
- avl = grpc_avl_add(avl, box(240), box(767), nullptr);
- avl = grpc_avl_add(avl, box(285), box(768), nullptr);
- avl = grpc_avl_add(avl, box(472), box(769), nullptr);
- avl = remove_int(avl, 865);
- avl = remove_int(avl, 763);
- avl = remove_int(avl, 245);
- avl = remove_int(avl, 80);
- avl = remove_int(avl, 713);
- avl = remove_int(avl, 654);
- avl = remove_int(avl, 1014);
- avl = grpc_avl_add(avl, box(495), box(777), nullptr);
- avl = grpc_avl_add(avl, box(552), box(778), nullptr);
- avl = remove_int(avl, 19);
- avl = remove_int(avl, 803);
- avl = grpc_avl_add(avl, box(508), box(781), nullptr);
- avl = remove_int(avl, 699);
- avl = remove_int(avl, 260);
- avl = remove_int(avl, 92);
- avl = remove_int(avl, 497);
- avl = grpc_avl_add(avl, box(970), box(786), nullptr);
- avl = remove_int(avl, 987);
- avl = remove_int(avl, 168);
- avl = remove_int(avl, 476);
- avl = remove_int(avl, 248);
- avl = grpc_avl_add(avl, box(358), box(791), nullptr);
- avl = remove_int(avl, 804);
- avl = remove_int(avl, 77);
- avl = remove_int(avl, 905);
- avl = remove_int(avl, 362);
- avl = grpc_avl_add(avl, box(578), box(796), nullptr);
- avl = remove_int(avl, 38);
- avl = remove_int(avl, 595);
- avl = grpc_avl_add(avl, box(213), box(799), nullptr);
- avl = remove_int(avl, 7);
- avl = remove_int(avl, 620);
- avl = grpc_avl_add(avl, box(946), box(802), nullptr);
- avl = remove_int(avl, 145);
- avl = grpc_avl_add(avl, box(628), box(804), nullptr);
- avl = remove_int(avl, 972);
- avl = grpc_avl_add(avl, box(728), box(806), nullptr);
- avl = remove_int(avl, 91);
- avl = grpc_avl_add(avl, box(136), box(808), nullptr);
- avl = grpc_avl_add(avl, box(841), box(809), nullptr);
- avl = grpc_avl_add(avl, box(265), box(810), nullptr);
- avl = grpc_avl_add(avl, box(701), box(811), nullptr);
- avl = grpc_avl_add(avl, box(27), box(812), nullptr);
- avl = remove_int(avl, 72);
- avl = remove_int(avl, 14);
- avl = grpc_avl_add(avl, box(286), box(815), nullptr);
- avl = remove_int(avl, 996);
- avl = remove_int(avl, 998);
- avl = grpc_avl_add(avl, box(466), box(818), nullptr);
- avl = remove_int(avl, 1009);
- avl = remove_int(avl, 741);
- avl = remove_int(avl, 947);
- avl = remove_int(avl, 241);
- avl = remove_int(avl, 954);
- avl = remove_int(avl, 183);
- avl = remove_int(avl, 395);
- avl = remove_int(avl, 951);
- avl = grpc_avl_add(avl, box(267), box(827), nullptr);
- avl = remove_int(avl, 812);
- avl = grpc_avl_add(avl, box(577), box(829), nullptr);
- avl = remove_int(avl, 624);
- avl = remove_int(avl, 847);
- avl = remove_int(avl, 745);
- avl = grpc_avl_add(avl, box(491), box(833), nullptr);
- avl = grpc_avl_add(avl, box(941), box(834), nullptr);
- avl = remove_int(avl, 258);
- avl = grpc_avl_add(avl, box(410), box(836), nullptr);
- avl = grpc_avl_add(avl, box(80), box(837), nullptr);
- avl = grpc_avl_add(avl, box(196), box(838), nullptr);
- avl = grpc_avl_add(avl, box(5), box(839), nullptr);
- avl = remove_int(avl, 782);
- avl = grpc_avl_add(avl, box(827), box(841), nullptr);
- avl = remove_int(avl, 472);
- avl = remove_int(avl, 664);
- avl = grpc_avl_add(avl, box(409), box(844), nullptr);
- avl = grpc_avl_add(avl, box(62), box(845), nullptr);
- avl = remove_int(avl, 56);
- avl = remove_int(avl, 606);
- avl = remove_int(avl, 707);
- avl = remove_int(avl, 989);
- avl = remove_int(avl, 549);
- avl = remove_int(avl, 259);
- avl = grpc_avl_add(avl, box(405), box(852), nullptr);
- avl = remove_int(avl, 587);
- avl = remove_int(avl, 350);
- avl = grpc_avl_add(avl, box(980), box(855), nullptr);
- avl = grpc_avl_add(avl, box(992), box(856), nullptr);
- avl = grpc_avl_add(avl, box(818), box(857), nullptr);
- avl = remove_int(avl, 853);
- avl = remove_int(avl, 701);
- avl = grpc_avl_add(avl, box(675), box(860), nullptr);
- avl = remove_int(avl, 248);
- avl = remove_int(avl, 649);
- avl = grpc_avl_add(avl, box(508), box(863), nullptr);
- avl = remove_int(avl, 927);
- avl = grpc_avl_add(avl, box(957), box(865), nullptr);
- avl = grpc_avl_add(avl, box(698), box(866), nullptr);
- avl = grpc_avl_add(avl, box(388), box(867), nullptr);
- avl = grpc_avl_add(avl, box(532), box(868), nullptr);
- avl = grpc_avl_add(avl, box(681), box(869), nullptr);
- avl = remove_int(avl, 544);
- avl = remove_int(avl, 991);
- avl = remove_int(avl, 397);
- avl = grpc_avl_add(avl, box(954), box(873), nullptr);
- avl = grpc_avl_add(avl, box(219), box(874), nullptr);
- avl = grpc_avl_add(avl, box(465), box(875), nullptr);
- avl = remove_int(avl, 371);
- avl = grpc_avl_add(avl, box(601), box(877), nullptr);
- avl = grpc_avl_add(avl, box(543), box(878), nullptr);
- avl = remove_int(avl, 329);
- avl = grpc_avl_add(avl, box(560), box(880), nullptr);
- avl = remove_int(avl, 898);
- avl = grpc_avl_add(avl, box(455), box(882), nullptr);
- avl = remove_int(avl, 313);
- avl = grpc_avl_add(avl, box(215), box(884), nullptr);
- avl = remove_int(avl, 846);
- avl = grpc_avl_add(avl, box(608), box(886), nullptr);
- avl = remove_int(avl, 248);
- avl = grpc_avl_add(avl, box(575), box(888), nullptr);
- avl = remove_int(avl, 207);
- avl = remove_int(avl, 810);
- avl = remove_int(avl, 665);
- avl = remove_int(avl, 361);
- avl = grpc_avl_add(avl, box(154), box(893), nullptr);
- avl = grpc_avl_add(avl, box(329), box(894), nullptr);
- avl = grpc_avl_add(avl, box(326), box(895), nullptr);
- avl = remove_int(avl, 746);
- avl = remove_int(avl, 99);
- avl = grpc_avl_add(avl, box(464), box(898), nullptr);
- avl = grpc_avl_add(avl, box(141), box(899), nullptr);
- avl = remove_int(avl, 383);
- avl = grpc_avl_add(avl, box(414), box(901), nullptr);
- avl = grpc_avl_add(avl, box(777), box(902), nullptr);
- avl = remove_int(avl, 972);
- avl = remove_int(avl, 841);
- avl = remove_int(avl, 100);
- avl = grpc_avl_add(avl, box(828), box(906), nullptr);
- avl = remove_int(avl, 785);
- avl = grpc_avl_add(avl, box(1008), box(908), nullptr);
- avl = grpc_avl_add(avl, box(46), box(909), nullptr);
- avl = remove_int(avl, 399);
- avl = grpc_avl_add(avl, box(178), box(911), nullptr);
- avl = grpc_avl_add(avl, box(573), box(912), nullptr);
- avl = remove_int(avl, 299);
- avl = grpc_avl_add(avl, box(690), box(914), nullptr);
- avl = grpc_avl_add(avl, box(692), box(915), nullptr);
- avl = remove_int(avl, 404);
- avl = remove_int(avl, 16);
- avl = remove_int(avl, 746);
- avl = remove_int(avl, 486);
- avl = remove_int(avl, 119);
- avl = grpc_avl_add(avl, box(167), box(921), nullptr);
- avl = remove_int(avl, 328);
- avl = grpc_avl_add(avl, box(89), box(923), nullptr);
- avl = remove_int(avl, 867);
- avl = remove_int(avl, 626);
- avl = remove_int(avl, 507);
- avl = grpc_avl_add(avl, box(365), box(927), nullptr);
- avl = grpc_avl_add(avl, box(58), box(928), nullptr);
- avl = grpc_avl_add(avl, box(70), box(929), nullptr);
- avl = remove_int(avl, 81);
- avl = remove_int(avl, 797);
- avl = grpc_avl_add(avl, box(846), box(932), nullptr);
- avl = remove_int(avl, 642);
- avl = grpc_avl_add(avl, box(777), box(934), nullptr);
- avl = remove_int(avl, 107);
- avl = grpc_avl_add(avl, box(691), box(936), nullptr);
- avl = grpc_avl_add(avl, box(820), box(937), nullptr);
- avl = grpc_avl_add(avl, box(202), box(938), nullptr);
- avl = grpc_avl_add(avl, box(308), box(939), nullptr);
- avl = grpc_avl_add(avl, box(20), box(940), nullptr);
- avl = remove_int(avl, 289);
- avl = grpc_avl_add(avl, box(714), box(942), nullptr);
- avl = grpc_avl_add(avl, box(584), box(943), nullptr);
- avl = remove_int(avl, 294);
- avl = grpc_avl_add(avl, box(496), box(945), nullptr);
- avl = grpc_avl_add(avl, box(394), box(946), nullptr);
- avl = grpc_avl_add(avl, box(860), box(947), nullptr);
- avl = grpc_avl_add(avl, box(58), box(948), nullptr);
- avl = remove_int(avl, 784);
- avl = remove_int(avl, 584);
- avl = remove_int(avl, 708);
- avl = grpc_avl_add(avl, box(142), box(952), nullptr);
- avl = grpc_avl_add(avl, box(247), box(953), nullptr);
- avl = grpc_avl_add(avl, box(389), box(954), nullptr);
- avl = remove_int(avl, 390);
- avl = grpc_avl_add(avl, box(465), box(956), nullptr);
- avl = grpc_avl_add(avl, box(936), box(957), nullptr);
- avl = grpc_avl_add(avl, box(309), box(958), nullptr);
- avl = remove_int(avl, 928);
- avl = remove_int(avl, 128);
- avl = remove_int(avl, 979);
- avl = remove_int(avl, 670);
- avl = remove_int(avl, 738);
- avl = remove_int(avl, 271);
- avl = remove_int(avl, 540);
- avl = grpc_avl_add(avl, box(365), box(966), nullptr);
- avl = remove_int(avl, 82);
- avl = grpc_avl_add(avl, box(728), box(968), nullptr);
- avl = remove_int(avl, 852);
- avl = grpc_avl_add(avl, box(884), box(970), nullptr);
- avl = grpc_avl_add(avl, box(502), box(971), nullptr);
- avl = remove_int(avl, 898);
- avl = remove_int(avl, 481);
- avl = grpc_avl_add(avl, box(911), box(974), nullptr);
- avl = remove_int(avl, 787);
- avl = remove_int(avl, 785);
- avl = remove_int(avl, 537);
- avl = remove_int(avl, 535);
- avl = remove_int(avl, 136);
- avl = remove_int(avl, 749);
- avl = remove_int(avl, 637);
- avl = remove_int(avl, 900);
- avl = grpc_avl_add(avl, box(598), box(983), nullptr);
- avl = remove_int(avl, 25);
- avl = remove_int(avl, 697);
- avl = grpc_avl_add(avl, box(645), box(986), nullptr);
- avl = grpc_avl_add(avl, box(211), box(987), nullptr);
- avl = grpc_avl_add(avl, box(589), box(988), nullptr);
- avl = remove_int(avl, 702);
- avl = grpc_avl_add(avl, box(53), box(990), nullptr);
- avl = remove_int(avl, 492);
- avl = remove_int(avl, 185);
- avl = remove_int(avl, 246);
- avl = remove_int(avl, 257);
- avl = remove_int(avl, 502);
- avl = remove_int(avl, 34);
- avl = grpc_avl_add(avl, box(74), box(997), nullptr);
- avl = grpc_avl_add(avl, box(834), box(998), nullptr);
- avl = grpc_avl_add(avl, box(514), box(999), nullptr);
- avl = grpc_avl_add(avl, box(75), box(1000), nullptr);
- avl = remove_int(avl, 745);
- avl = grpc_avl_add(avl, box(362), box(1002), nullptr);
- avl = remove_int(avl, 215);
- avl = grpc_avl_add(avl, box(624), box(1004), nullptr);
- avl = remove_int(avl, 404);
- avl = remove_int(avl, 359);
- avl = remove_int(avl, 491);
- avl = grpc_avl_add(avl, box(903), box(1008), nullptr);
- avl = grpc_avl_add(avl, box(240), box(1009), nullptr);
- avl = remove_int(avl, 95);
- avl = grpc_avl_add(avl, box(119), box(1011), nullptr);
- avl = grpc_avl_add(avl, box(857), box(1012), nullptr);
- avl = remove_int(avl, 39);
- avl = remove_int(avl, 866);
- avl = grpc_avl_add(avl, box(503), box(1015), nullptr);
- avl = grpc_avl_add(avl, box(740), box(1016), nullptr);
- avl = remove_int(avl, 637);
- avl = remove_int(avl, 156);
- avl = remove_int(avl, 6);
- avl = remove_int(avl, 745);
- avl = remove_int(avl, 433);
- avl = remove_int(avl, 283);
- avl = grpc_avl_add(avl, box(625), box(1023), nullptr);
- avl = remove_int(avl, 638);
- avl = grpc_avl_add(avl, box(299), box(1025), nullptr);
- avl = grpc_avl_add(avl, box(584), box(1026), nullptr);
- avl = remove_int(avl, 863);
- avl = grpc_avl_add(avl, box(612), box(1028), nullptr);
- avl = grpc_avl_add(avl, box(62), box(1029), nullptr);
- avl = grpc_avl_add(avl, box(432), box(1030), nullptr);
- avl = remove_int(avl, 371);
- avl = remove_int(avl, 790);
- avl = remove_int(avl, 227);
- avl = remove_int(avl, 836);
- avl = grpc_avl_add(avl, box(703), box(1035), nullptr);
- avl = grpc_avl_add(avl, box(644), box(1036), nullptr);
- avl = remove_int(avl, 638);
- avl = grpc_avl_add(avl, box(13), box(1038), nullptr);
- avl = remove_int(avl, 66);
- avl = remove_int(avl, 82);
- avl = grpc_avl_add(avl, box(362), box(1041), nullptr);
- avl = grpc_avl_add(avl, box(783), box(1042), nullptr);
- avl = remove_int(avl, 60);
- avl = grpc_avl_add(avl, box(80), box(1044), nullptr);
- avl = grpc_avl_add(avl, box(825), box(1045), nullptr);
- avl = grpc_avl_add(avl, box(688), box(1046), nullptr);
- avl = grpc_avl_add(avl, box(662), box(1047), nullptr);
- avl = remove_int(avl, 156);
- avl = remove_int(avl, 376);
- avl = remove_int(avl, 99);
- avl = grpc_avl_add(avl, box(526), box(1051), nullptr);
- avl = grpc_avl_add(avl, box(168), box(1052), nullptr);
- avl = remove_int(avl, 646);
- avl = remove_int(avl, 380);
- avl = remove_int(avl, 833);
- avl = grpc_avl_add(avl, box(53), box(1056), nullptr);
- avl = remove_int(avl, 105);
- avl = grpc_avl_add(avl, box(373), box(1058), nullptr);
- avl = grpc_avl_add(avl, box(184), box(1059), nullptr);
- avl = remove_int(avl, 288);
- avl = grpc_avl_add(avl, box(966), box(1061), nullptr);
- avl = remove_int(avl, 158);
- avl = grpc_avl_add(avl, box(406), box(1063), nullptr);
- avl = remove_int(avl, 470);
- avl = grpc_avl_add(avl, box(283), box(1065), nullptr);
- avl = grpc_avl_add(avl, box(838), box(1066), nullptr);
- avl = grpc_avl_add(avl, box(288), box(1067), nullptr);
- avl = grpc_avl_add(avl, box(950), box(1068), nullptr);
- avl = grpc_avl_add(avl, box(163), box(1069), nullptr);
- avl = remove_int(avl, 623);
- avl = remove_int(avl, 769);
- avl = grpc_avl_add(avl, box(144), box(1072), nullptr);
- avl = grpc_avl_add(avl, box(489), box(1073), nullptr);
- avl = remove_int(avl, 15);
- avl = grpc_avl_add(avl, box(971), box(1075), nullptr);
- avl = remove_int(avl, 660);
- avl = grpc_avl_add(avl, box(255), box(1077), nullptr);
- avl = remove_int(avl, 494);
- avl = grpc_avl_add(avl, box(109), box(1079), nullptr);
- avl = grpc_avl_add(avl, box(420), box(1080), nullptr);
- avl = grpc_avl_add(avl, box(509), box(1081), nullptr);
- avl = remove_int(avl, 178);
- avl = grpc_avl_add(avl, box(216), box(1083), nullptr);
- avl = grpc_avl_add(avl, box(707), box(1084), nullptr);
- avl = grpc_avl_add(avl, box(411), box(1085), nullptr);
- avl = grpc_avl_add(avl, box(352), box(1086), nullptr);
- avl = remove_int(avl, 983);
- avl = grpc_avl_add(avl, box(6), box(1088), nullptr);
- avl = grpc_avl_add(avl, box(1014), box(1089), nullptr);
- avl = remove_int(avl, 98);
- avl = remove_int(avl, 325);
- avl = grpc_avl_add(avl, box(851), box(1092), nullptr);
- avl = remove_int(avl, 553);
- avl = grpc_avl_add(avl, box(218), box(1094), nullptr);
- avl = grpc_avl_add(avl, box(261), box(1095), nullptr);
- avl = remove_int(avl, 31);
- avl = grpc_avl_add(avl, box(872), box(1097), nullptr);
- avl = remove_int(avl, 543);
- avl = remove_int(avl, 314);
- avl = remove_int(avl, 443);
- avl = grpc_avl_add(avl, box(533), box(1101), nullptr);
- avl = remove_int(avl, 881);
- avl = remove_int(avl, 269);
- avl = remove_int(avl, 940);
- avl = remove_int(avl, 909);
- avl = remove_int(avl, 197);
- avl = remove_int(avl, 773);
- avl = remove_int(avl, 790);
- avl = remove_int(avl, 345);
- avl = grpc_avl_add(avl, box(965), box(1110), nullptr);
- avl = remove_int(avl, 622);
- avl = grpc_avl_add(avl, box(352), box(1112), nullptr);
- avl = remove_int(avl, 182);
- avl = grpc_avl_add(avl, box(534), box(1114), nullptr);
- avl = grpc_avl_add(avl, box(97), box(1115), nullptr);
- avl = grpc_avl_add(avl, box(198), box(1116), nullptr);
- avl = remove_int(avl, 750);
- avl = grpc_avl_add(avl, box(98), box(1118), nullptr);
- avl = remove_int(avl, 943);
- avl = grpc_avl_add(avl, box(254), box(1120), nullptr);
- avl = grpc_avl_add(avl, box(30), box(1121), nullptr);
- avl = remove_int(avl, 14);
- avl = remove_int(avl, 475);
- avl = remove_int(avl, 82);
- avl = grpc_avl_add(avl, box(789), box(1125), nullptr);
- avl = grpc_avl_add(avl, box(402), box(1126), nullptr);
- avl = remove_int(avl, 1019);
- avl = grpc_avl_add(avl, box(858), box(1128), nullptr);
- avl = grpc_avl_add(avl, box(625), box(1129), nullptr);
- avl = remove_int(avl, 675);
- avl = remove_int(avl, 323);
- avl = grpc_avl_add(avl, box(329), box(1132), nullptr);
- avl = remove_int(avl, 929);
- avl = remove_int(avl, 44);
- avl = grpc_avl_add(avl, box(443), box(1135), nullptr);
- avl = grpc_avl_add(avl, box(653), box(1136), nullptr);
- avl = grpc_avl_add(avl, box(750), box(1137), nullptr);
- avl = grpc_avl_add(avl, box(252), box(1138), nullptr);
- avl = grpc_avl_add(avl, box(449), box(1139), nullptr);
- avl = remove_int(avl, 1022);
- avl = remove_int(avl, 357);
- avl = remove_int(avl, 602);
- avl = remove_int(avl, 131);
- avl = grpc_avl_add(avl, box(531), box(1144), nullptr);
- avl = remove_int(avl, 806);
- avl = grpc_avl_add(avl, box(455), box(1146), nullptr);
- avl = remove_int(avl, 31);
- avl = grpc_avl_add(avl, box(154), box(1148), nullptr);
- avl = grpc_avl_add(avl, box(189), box(1149), nullptr);
- avl = remove_int(avl, 786);
- avl = grpc_avl_add(avl, box(496), box(1151), nullptr);
- avl = grpc_avl_add(avl, box(81), box(1152), nullptr);
- avl = grpc_avl_add(avl, box(59), box(1153), nullptr);
- avl = remove_int(avl, 424);
- avl = remove_int(avl, 668);
- avl = grpc_avl_add(avl, box(723), box(1156), nullptr);
- avl = grpc_avl_add(avl, box(822), box(1157), nullptr);
- avl = grpc_avl_add(avl, box(354), box(1158), nullptr);
- avl = remove_int(avl, 738);
- avl = grpc_avl_add(avl, box(686), box(1160), nullptr);
- avl = grpc_avl_add(avl, box(43), box(1161), nullptr);
- avl = grpc_avl_add(avl, box(625), box(1162), nullptr);
- avl = grpc_avl_add(avl, box(902), box(1163), nullptr);
- avl = grpc_avl_add(avl, box(12), box(1164), nullptr);
- avl = grpc_avl_add(avl, box(977), box(1165), nullptr);
- avl = grpc_avl_add(avl, box(699), box(1166), nullptr);
- avl = grpc_avl_add(avl, box(189), box(1167), nullptr);
- avl = remove_int(avl, 672);
- avl = remove_int(avl, 90);
- avl = remove_int(avl, 757);
- avl = remove_int(avl, 494);
- avl = grpc_avl_add(avl, box(759), box(1172), nullptr);
- avl = remove_int(avl, 758);
- avl = remove_int(avl, 222);
- avl = grpc_avl_add(avl, box(975), box(1175), nullptr);
- avl = remove_int(avl, 993);
- avl = grpc_avl_add(avl, box(2), box(1177), nullptr);
- avl = grpc_avl_add(avl, box(70), box(1178), nullptr);
- avl = remove_int(avl, 350);
- avl = remove_int(avl, 972);
- avl = remove_int(avl, 880);
- avl = grpc_avl_add(avl, box(753), box(1182), nullptr);
- avl = remove_int(avl, 404);
- avl = grpc_avl_add(avl, box(294), box(1184), nullptr);
- avl = remove_int(avl, 474);
- avl = grpc_avl_add(avl, box(228), box(1186), nullptr);
- avl = grpc_avl_add(avl, box(484), box(1187), nullptr);
- avl = remove_int(avl, 238);
- avl = remove_int(avl, 53);
- avl = remove_int(avl, 691);
- avl = grpc_avl_add(avl, box(345), box(1191), nullptr);
- avl = remove_int(avl, 0);
- avl = grpc_avl_add(avl, box(230), box(1193), nullptr);
- avl = remove_int(avl, 227);
- avl = remove_int(avl, 152);
- avl = grpc_avl_add(avl, box(884), box(1196), nullptr);
- avl = remove_int(avl, 823);
- avl = remove_int(avl, 53);
- avl = grpc_avl_add(avl, box(1015), box(1199), nullptr);
- avl = grpc_avl_add(avl, box(697), box(1200), nullptr);
- avl = grpc_avl_add(avl, box(376), box(1201), nullptr);
- avl = remove_int(avl, 411);
- avl = grpc_avl_add(avl, box(888), box(1203), nullptr);
- avl = remove_int(avl, 55);
- avl = grpc_avl_add(avl, box(85), box(1205), nullptr);
- avl = remove_int(avl, 947);
- avl = remove_int(avl, 382);
- avl = remove_int(avl, 777);
- avl = grpc_avl_add(avl, box(1017), box(1209), nullptr);
- avl = grpc_avl_add(avl, box(169), box(1210), nullptr);
- avl = grpc_avl_add(avl, box(156), box(1211), nullptr);
- avl = remove_int(avl, 153);
- avl = remove_int(avl, 642);
- avl = remove_int(avl, 158);
- avl = grpc_avl_add(avl, box(554), box(1215), nullptr);
- avl = grpc_avl_add(avl, box(76), box(1216), nullptr);
- avl = grpc_avl_add(avl, box(756), box(1217), nullptr);
- avl = remove_int(avl, 767);
- avl = remove_int(avl, 112);
- avl = remove_int(avl, 539);
- avl = remove_int(avl, 544);
- avl = remove_int(avl, 628);
- avl = remove_int(avl, 385);
- avl = remove_int(avl, 514);
- avl = remove_int(avl, 362);
- avl = grpc_avl_add(avl, box(523), box(1226), nullptr);
- avl = grpc_avl_add(avl, box(712), box(1227), nullptr);
- avl = grpc_avl_add(avl, box(474), box(1228), nullptr);
- avl = grpc_avl_add(avl, box(882), box(1229), nullptr);
- avl = grpc_avl_add(avl, box(965), box(1230), nullptr);
- avl = remove_int(avl, 464);
- avl = grpc_avl_add(avl, box(319), box(1232), nullptr);
- avl = grpc_avl_add(avl, box(504), box(1233), nullptr);
- avl = remove_int(avl, 818);
- avl = grpc_avl_add(avl, box(884), box(1235), nullptr);
- avl = grpc_avl_add(avl, box(813), box(1236), nullptr);
- avl = grpc_avl_add(avl, box(795), box(1237), nullptr);
- avl = remove_int(avl, 306);
- avl = grpc_avl_add(avl, box(799), box(1239), nullptr);
- avl = remove_int(avl, 534);
- avl = grpc_avl_add(avl, box(480), box(1241), nullptr);
- avl = grpc_avl_add(avl, box(656), box(1242), nullptr);
- avl = grpc_avl_add(avl, box(709), box(1243), nullptr);
- avl = grpc_avl_add(avl, box(500), box(1244), nullptr);
- avl = remove_int(avl, 740);
- avl = grpc_avl_add(avl, box(980), box(1246), nullptr);
- avl = grpc_avl_add(avl, box(458), box(1247), nullptr);
- avl = remove_int(avl, 377);
- avl = remove_int(avl, 338);
- avl = grpc_avl_add(avl, box(554), box(1250), nullptr);
- avl = grpc_avl_add(avl, box(504), box(1251), nullptr);
- avl = grpc_avl_add(avl, box(603), box(1252), nullptr);
- avl = grpc_avl_add(avl, box(761), box(1253), nullptr);
- avl = remove_int(avl, 431);
- avl = grpc_avl_add(avl, box(707), box(1255), nullptr);
- avl = grpc_avl_add(avl, box(673), box(1256), nullptr);
- avl = remove_int(avl, 998);
- avl = remove_int(avl, 332);
- avl = remove_int(avl, 413);
- avl = remove_int(avl, 227);
- avl = remove_int(avl, 249);
- avl = remove_int(avl, 309);
- avl = remove_int(avl, 459);
- avl = grpc_avl_add(avl, box(645), box(1264), nullptr);
- avl = remove_int(avl, 858);
- avl = remove_int(avl, 997);
- avl = grpc_avl_add(avl, box(519), box(1267), nullptr);
- avl = remove_int(avl, 614);
- avl = remove_int(avl, 462);
- avl = remove_int(avl, 792);
- avl = grpc_avl_add(avl, box(987), box(1271), nullptr);
- avl = grpc_avl_add(avl, box(309), box(1272), nullptr);
- avl = remove_int(avl, 747);
- avl = grpc_avl_add(avl, box(621), box(1274), nullptr);
- avl = grpc_avl_add(avl, box(450), box(1275), nullptr);
- avl = remove_int(avl, 265);
- avl = remove_int(avl, 8);
- avl = remove_int(avl, 383);
- avl = grpc_avl_add(avl, box(238), box(1279), nullptr);
- avl = remove_int(avl, 241);
- avl = grpc_avl_add(avl, box(180), box(1281), nullptr);
- avl = grpc_avl_add(avl, box(411), box(1282), nullptr);
- avl = grpc_avl_add(avl, box(791), box(1283), nullptr);
- avl = grpc_avl_add(avl, box(955), box(1284), nullptr);
- avl = remove_int(avl, 24);
- avl = remove_int(avl, 375);
- avl = grpc_avl_add(avl, box(140), box(1287), nullptr);
- avl = remove_int(avl, 949);
- avl = grpc_avl_add(avl, box(301), box(1289), nullptr);
- avl = grpc_avl_add(avl, box(0), box(1290), nullptr);
- avl = remove_int(avl, 371);
- avl = remove_int(avl, 427);
- avl = remove_int(avl, 841);
- avl = remove_int(avl, 847);
- avl = grpc_avl_add(avl, box(814), box(1295), nullptr);
- avl = grpc_avl_add(avl, box(127), box(1296), nullptr);
- avl = grpc_avl_add(avl, box(279), box(1297), nullptr);
- avl = remove_int(avl, 669);
- avl = remove_int(avl, 541);
- avl = remove_int(avl, 275);
- avl = remove_int(avl, 299);
- avl = remove_int(avl, 552);
- avl = grpc_avl_add(avl, box(310), box(1303), nullptr);
- avl = grpc_avl_add(avl, box(304), box(1304), nullptr);
- avl = grpc_avl_add(avl, box(1), box(1305), nullptr);
- avl = grpc_avl_add(avl, box(339), box(1306), nullptr);
- avl = remove_int(avl, 570);
- avl = remove_int(avl, 752);
- avl = remove_int(avl, 552);
- avl = remove_int(avl, 442);
- avl = remove_int(avl, 639);
- avl = grpc_avl_add(avl, box(313), box(1312), nullptr);
- avl = remove_int(avl, 85);
- avl = grpc_avl_add(avl, box(964), box(1314), nullptr);
- avl = grpc_avl_add(avl, box(559), box(1315), nullptr);
- avl = remove_int(avl, 167);
- avl = grpc_avl_add(avl, box(866), box(1317), nullptr);
- avl = remove_int(avl, 275);
- avl = grpc_avl_add(avl, box(173), box(1319), nullptr);
- avl = grpc_avl_add(avl, box(765), box(1320), nullptr);
- avl = remove_int(avl, 883);
- avl = grpc_avl_add(avl, box(547), box(1322), nullptr);
- avl = grpc_avl_add(avl, box(847), box(1323), nullptr);
- avl = remove_int(avl, 817);
- avl = remove_int(avl, 850);
- avl = remove_int(avl, 718);
- avl = grpc_avl_add(avl, box(806), box(1327), nullptr);
- avl = grpc_avl_add(avl, box(360), box(1328), nullptr);
- avl = remove_int(avl, 991);
- avl = grpc_avl_add(avl, box(493), box(1330), nullptr);
- avl = remove_int(avl, 516);
- avl = grpc_avl_add(avl, box(361), box(1332), nullptr);
- avl = remove_int(avl, 355);
- avl = grpc_avl_add(avl, box(512), box(1334), nullptr);
- avl = grpc_avl_add(avl, box(191), box(1335), nullptr);
- avl = remove_int(avl, 703);
- avl = grpc_avl_add(avl, box(333), box(1337), nullptr);
- avl = remove_int(avl, 481);
- avl = grpc_avl_add(avl, box(501), box(1339), nullptr);
- avl = remove_int(avl, 532);
- avl = remove_int(avl, 510);
- avl = grpc_avl_add(avl, box(793), box(1342), nullptr);
- avl = grpc_avl_add(avl, box(234), box(1343), nullptr);
- avl = remove_int(avl, 159);
- avl = remove_int(avl, 429);
- avl = remove_int(avl, 728);
- avl = remove_int(avl, 288);
- avl = grpc_avl_add(avl, box(281), box(1348), nullptr);
- avl = grpc_avl_add(avl, box(702), box(1349), nullptr);
- avl = grpc_avl_add(avl, box(149), box(1350), nullptr);
- avl = remove_int(avl, 22);
- avl = remove_int(avl, 944);
- avl = remove_int(avl, 55);
- avl = remove_int(avl, 512);
- avl = remove_int(avl, 676);
- avl = remove_int(avl, 884);
- avl = grpc_avl_add(avl, box(246), box(1357), nullptr);
- avl = grpc_avl_add(avl, box(455), box(1358), nullptr);
- avl = remove_int(avl, 782);
- avl = remove_int(avl, 682);
- avl = grpc_avl_add(avl, box(243), box(1361), nullptr);
- avl = grpc_avl_add(avl, box(109), box(1362), nullptr);
- avl = grpc_avl_add(avl, box(452), box(1363), nullptr);
- avl = remove_int(avl, 151);
- avl = grpc_avl_add(avl, box(159), box(1365), nullptr);
- avl = remove_int(avl, 1023);
- avl = grpc_avl_add(avl, box(129), box(1367), nullptr);
- avl = grpc_avl_add(avl, box(537), box(1368), nullptr);
- avl = remove_int(avl, 321);
- avl = grpc_avl_add(avl, box(740), box(1370), nullptr);
- avl = remove_int(avl, 45);
- avl = remove_int(avl, 136);
- avl = grpc_avl_add(avl, box(229), box(1373), nullptr);
- avl = remove_int(avl, 772);
- avl = grpc_avl_add(avl, box(181), box(1375), nullptr);
- avl = remove_int(avl, 175);
- avl = grpc_avl_add(avl, box(817), box(1377), nullptr);
- avl = remove_int(avl, 956);
- avl = grpc_avl_add(avl, box(675), box(1379), nullptr);
- avl = grpc_avl_add(avl, box(375), box(1380), nullptr);
- avl = remove_int(avl, 384);
- avl = grpc_avl_add(avl, box(1016), box(1382), nullptr);
- avl = remove_int(avl, 295);
- avl = remove_int(avl, 697);
- avl = remove_int(avl, 554);
- avl = remove_int(avl, 590);
- avl = remove_int(avl, 1014);
- avl = grpc_avl_add(avl, box(890), box(1388), nullptr);
- avl = grpc_avl_add(avl, box(293), box(1389), nullptr);
- avl = remove_int(avl, 207);
- avl = remove_int(avl, 46);
- avl = grpc_avl_add(avl, box(899), box(1392), nullptr);
- avl = grpc_avl_add(avl, box(666), box(1393), nullptr);
- avl = grpc_avl_add(avl, box(85), box(1394), nullptr);
- avl = grpc_avl_add(avl, box(914), box(1395), nullptr);
- avl = grpc_avl_add(avl, box(128), box(1396), nullptr);
- avl = grpc_avl_add(avl, box(835), box(1397), nullptr);
- avl = grpc_avl_add(avl, box(787), box(1398), nullptr);
- avl = grpc_avl_add(avl, box(649), box(1399), nullptr);
- avl = grpc_avl_add(avl, box(723), box(1400), nullptr);
- avl = remove_int(avl, 874);
- avl = grpc_avl_add(avl, box(778), box(1402), nullptr);
- avl = grpc_avl_add(avl, box(1015), box(1403), nullptr);
- avl = grpc_avl_add(avl, box(59), box(1404), nullptr);
- avl = grpc_avl_add(avl, box(259), box(1405), nullptr);
- avl = grpc_avl_add(avl, box(758), box(1406), nullptr);
- avl = remove_int(avl, 648);
- avl = grpc_avl_add(avl, box(145), box(1408), nullptr);
- avl = grpc_avl_add(avl, box(440), box(1409), nullptr);
- avl = remove_int(avl, 608);
- avl = remove_int(avl, 690);
- avl = grpc_avl_add(avl, box(605), box(1412), nullptr);
- avl = remove_int(avl, 856);
- avl = remove_int(avl, 608);
- avl = grpc_avl_add(avl, box(829), box(1415), nullptr);
- avl = grpc_avl_add(avl, box(660), box(1416), nullptr);
- avl = remove_int(avl, 596);
- avl = grpc_avl_add(avl, box(519), box(1418), nullptr);
- avl = grpc_avl_add(avl, box(35), box(1419), nullptr);
- avl = grpc_avl_add(avl, box(871), box(1420), nullptr);
- avl = remove_int(avl, 845);
- avl = grpc_avl_add(avl, box(600), box(1422), nullptr);
- avl = grpc_avl_add(avl, box(215), box(1423), nullptr);
- avl = remove_int(avl, 761);
- avl = grpc_avl_add(avl, box(975), box(1425), nullptr);
- avl = remove_int(avl, 987);
- avl = grpc_avl_add(avl, box(58), box(1427), nullptr);
- avl = remove_int(avl, 119);
- avl = grpc_avl_add(avl, box(937), box(1429), nullptr);
- avl = grpc_avl_add(avl, box(372), box(1430), nullptr);
- avl = grpc_avl_add(avl, box(11), box(1431), nullptr);
- avl = grpc_avl_add(avl, box(398), box(1432), nullptr);
- avl = grpc_avl_add(avl, box(423), box(1433), nullptr);
- avl = remove_int(avl, 171);
- avl = grpc_avl_add(avl, box(473), box(1435), nullptr);
- avl = remove_int(avl, 752);
- avl = remove_int(avl, 625);
- avl = remove_int(avl, 764);
- avl = remove_int(avl, 49);
- avl = grpc_avl_add(avl, box(472), box(1440), nullptr);
- avl = remove_int(avl, 847);
- avl = remove_int(avl, 642);
- avl = remove_int(avl, 1004);
- avl = remove_int(avl, 795);
- avl = remove_int(avl, 465);
- avl = grpc_avl_add(avl, box(636), box(1446), nullptr);
- avl = remove_int(avl, 152);
- avl = grpc_avl_add(avl, box(61), box(1448), nullptr);
- avl = remove_int(avl, 929);
- avl = remove_int(avl, 9);
- avl = grpc_avl_add(avl, box(251), box(1451), nullptr);
- avl = grpc_avl_add(avl, box(672), box(1452), nullptr);
- avl = grpc_avl_add(avl, box(66), box(1453), nullptr);
- avl = remove_int(avl, 693);
- avl = remove_int(avl, 914);
- avl = remove_int(avl, 116);
- avl = remove_int(avl, 577);
- avl = grpc_avl_add(avl, box(618), box(1458), nullptr);
- avl = grpc_avl_add(avl, box(495), box(1459), nullptr);
- avl = remove_int(avl, 450);
- avl = grpc_avl_add(avl, box(533), box(1461), nullptr);
- avl = grpc_avl_add(avl, box(414), box(1462), nullptr);
- avl = remove_int(avl, 74);
- avl = remove_int(avl, 236);
- avl = grpc_avl_add(avl, box(707), box(1465), nullptr);
- avl = grpc_avl_add(avl, box(357), box(1466), nullptr);
- avl = grpc_avl_add(avl, box(1007), box(1467), nullptr);
- avl = grpc_avl_add(avl, box(811), box(1468), nullptr);
- avl = grpc_avl_add(avl, box(418), box(1469), nullptr);
- avl = grpc_avl_add(avl, box(164), box(1470), nullptr);
- avl = grpc_avl_add(avl, box(622), box(1471), nullptr);
- avl = remove_int(avl, 22);
- avl = remove_int(avl, 14);
- avl = remove_int(avl, 732);
- avl = remove_int(avl, 7);
- avl = remove_int(avl, 447);
- avl = grpc_avl_add(avl, box(221), box(1477), nullptr);
- avl = grpc_avl_add(avl, box(202), box(1478), nullptr);
- avl = grpc_avl_add(avl, box(312), box(1479), nullptr);
- avl = remove_int(avl, 274);
- avl = grpc_avl_add(avl, box(684), box(1481), nullptr);
- avl = grpc_avl_add(avl, box(954), box(1482), nullptr);
- avl = grpc_avl_add(avl, box(637), box(1483), nullptr);
- avl = remove_int(avl, 716);
- avl = grpc_avl_add(avl, box(198), box(1485), nullptr);
- avl = remove_int(avl, 340);
- avl = remove_int(avl, 137);
- avl = remove_int(avl, 995);
- avl = remove_int(avl, 1004);
- avl = grpc_avl_add(avl, box(661), box(1490), nullptr);
- avl = grpc_avl_add(avl, box(862), box(1491), nullptr);
- avl = remove_int(avl, 527);
- avl = grpc_avl_add(avl, box(945), box(1493), nullptr);
- avl = remove_int(avl, 355);
- avl = remove_int(avl, 144);
- avl = grpc_avl_add(avl, box(229), box(1496), nullptr);
- avl = grpc_avl_add(avl, box(237), box(1497), nullptr);
- avl = remove_int(avl, 471);
- avl = remove_int(avl, 901);
- avl = grpc_avl_add(avl, box(905), box(1500), nullptr);
- avl = remove_int(avl, 19);
- avl = remove_int(avl, 896);
- avl = remove_int(avl, 585);
- avl = remove_int(avl, 308);
- avl = grpc_avl_add(avl, box(547), box(1505), nullptr);
- avl = grpc_avl_add(avl, box(552), box(1506), nullptr);
- avl = grpc_avl_add(avl, box(30), box(1507), nullptr);
- avl = grpc_avl_add(avl, box(445), box(1508), nullptr);
- avl = remove_int(avl, 785);
- avl = remove_int(avl, 185);
- avl = grpc_avl_add(avl, box(405), box(1511), nullptr);
- avl = grpc_avl_add(avl, box(733), box(1512), nullptr);
- avl = grpc_avl_add(avl, box(573), box(1513), nullptr);
- avl = grpc_avl_add(avl, box(492), box(1514), nullptr);
- avl = grpc_avl_add(avl, box(343), box(1515), nullptr);
- avl = grpc_avl_add(avl, box(527), box(1516), nullptr);
- avl = grpc_avl_add(avl, box(596), box(1517), nullptr);
- avl = grpc_avl_add(avl, box(519), box(1518), nullptr);
- avl = remove_int(avl, 243);
- avl = remove_int(avl, 722);
- avl = grpc_avl_add(avl, box(772), box(1521), nullptr);
- avl = remove_int(avl, 152);
- avl = remove_int(avl, 305);
- avl = grpc_avl_add(avl, box(754), box(1524), nullptr);
- avl = grpc_avl_add(avl, box(373), box(1525), nullptr);
- avl = remove_int(avl, 995);
- avl = grpc_avl_add(avl, box(329), box(1527), nullptr);
- avl = remove_int(avl, 397);
- avl = grpc_avl_add(avl, box(884), box(1529), nullptr);
- avl = remove_int(avl, 329);
- avl = remove_int(avl, 240);
- avl = grpc_avl_add(avl, box(566), box(1532), nullptr);
- avl = grpc_avl_add(avl, box(232), box(1533), nullptr);
- avl = remove_int(avl, 993);
- avl = grpc_avl_add(avl, box(888), box(1535), nullptr);
- avl = remove_int(avl, 242);
- avl = grpc_avl_add(avl, box(941), box(1537), nullptr);
- avl = remove_int(avl, 415);
- avl = grpc_avl_add(avl, box(992), box(1539), nullptr);
- avl = remove_int(avl, 289);
- avl = grpc_avl_add(avl, box(60), box(1541), nullptr);
- avl = grpc_avl_add(avl, box(97), box(1542), nullptr);
- avl = remove_int(avl, 965);
- avl = remove_int(avl, 267);
- avl = remove_int(avl, 360);
- avl = grpc_avl_add(avl, box(5), box(1546), nullptr);
- avl = remove_int(avl, 429);
- avl = grpc_avl_add(avl, box(412), box(1548), nullptr);
- avl = remove_int(avl, 632);
- avl = remove_int(avl, 113);
- avl = grpc_avl_add(avl, box(48), box(1551), nullptr);
- avl = grpc_avl_add(avl, box(108), box(1552), nullptr);
- avl = grpc_avl_add(avl, box(750), box(1553), nullptr);
- avl = remove_int(avl, 188);
- avl = grpc_avl_add(avl, box(668), box(1555), nullptr);
- avl = remove_int(avl, 37);
- avl = remove_int(avl, 737);
- avl = grpc_avl_add(avl, box(93), box(1558), nullptr);
- avl = grpc_avl_add(avl, box(628), box(1559), nullptr);
- avl = grpc_avl_add(avl, box(480), box(1560), nullptr);
- avl = remove_int(avl, 958);
- avl = remove_int(avl, 565);
- avl = remove_int(avl, 32);
- avl = remove_int(avl, 1);
- avl = remove_int(avl, 335);
- avl = grpc_avl_add(avl, box(136), box(1566), nullptr);
- avl = grpc_avl_add(avl, box(469), box(1567), nullptr);
- avl = remove_int(avl, 349);
- avl = grpc_avl_add(avl, box(768), box(1569), nullptr);
- avl = grpc_avl_add(avl, box(915), box(1570), nullptr);
- avl = remove_int(avl, 1014);
- avl = grpc_avl_add(avl, box(117), box(1572), nullptr);
- avl = remove_int(avl, 62);
- avl = grpc_avl_add(avl, box(382), box(1574), nullptr);
- avl = remove_int(avl, 571);
- avl = grpc_avl_add(avl, box(655), box(1576), nullptr);
- avl = grpc_avl_add(avl, box(323), box(1577), nullptr);
- avl = remove_int(avl, 869);
- avl = remove_int(avl, 151);
- avl = grpc_avl_add(avl, box(1019), box(1580), nullptr);
- avl = grpc_avl_add(avl, box(984), box(1581), nullptr);
- avl = grpc_avl_add(avl, box(870), box(1582), nullptr);
- avl = grpc_avl_add(avl, box(376), box(1583), nullptr);
- avl = remove_int(avl, 625);
- avl = grpc_avl_add(avl, box(733), box(1585), nullptr);
- avl = remove_int(avl, 532);
- avl = remove_int(avl, 444);
- avl = grpc_avl_add(avl, box(428), box(1588), nullptr);
- avl = grpc_avl_add(avl, box(860), box(1589), nullptr);
- avl = grpc_avl_add(avl, box(173), box(1590), nullptr);
- avl = remove_int(avl, 649);
- avl = remove_int(avl, 913);
- avl = remove_int(avl, 1);
- avl = remove_int(avl, 304);
- avl = grpc_avl_add(avl, box(604), box(1595), nullptr);
- avl = grpc_avl_add(avl, box(639), box(1596), nullptr);
- avl = remove_int(avl, 431);
- avl = grpc_avl_add(avl, box(993), box(1598), nullptr);
- avl = remove_int(avl, 681);
- avl = remove_int(avl, 927);
- avl = grpc_avl_add(avl, box(87), box(1601), nullptr);
- avl = grpc_avl_add(avl, box(91), box(1602), nullptr);
- avl = remove_int(avl, 61);
- avl = remove_int(avl, 14);
- avl = remove_int(avl, 305);
- avl = remove_int(avl, 304);
- avl = remove_int(avl, 1016);
- avl = grpc_avl_add(avl, box(903), box(1608), nullptr);
- avl = grpc_avl_add(avl, box(951), box(1609), nullptr);
- avl = grpc_avl_add(avl, box(146), box(1610), nullptr);
- avl = grpc_avl_add(avl, box(482), box(1611), nullptr);
- avl = grpc_avl_add(avl, box(71), box(1612), nullptr);
- avl = remove_int(avl, 246);
- avl = remove_int(avl, 696);
- avl = grpc_avl_add(avl, box(636), box(1615), nullptr);
- avl = grpc_avl_add(avl, box(295), box(1616), nullptr);
- avl = remove_int(avl, 11);
- avl = remove_int(avl, 231);
- avl = grpc_avl_add(avl, box(905), box(1619), nullptr);
- avl = grpc_avl_add(avl, box(993), box(1620), nullptr);
- avl = grpc_avl_add(avl, box(433), box(1621), nullptr);
- avl = grpc_avl_add(avl, box(117), box(1622), nullptr);
- avl = grpc_avl_add(avl, box(467), box(1623), nullptr);
- avl = remove_int(avl, 419);
- avl = grpc_avl_add(avl, box(179), box(1625), nullptr);
- avl = remove_int(avl, 926);
- avl = remove_int(avl, 326);
- avl = grpc_avl_add(avl, box(551), box(1628), nullptr);
- avl = remove_int(avl, 14);
- avl = remove_int(avl, 476);
- avl = remove_int(avl, 823);
- avl = grpc_avl_add(avl, box(350), box(1632), nullptr);
- avl = grpc_avl_add(avl, box(133), box(1633), nullptr);
- avl = remove_int(avl, 906);
- avl = grpc_avl_add(avl, box(827), box(1635), nullptr);
- avl = grpc_avl_add(avl, box(201), box(1636), nullptr);
- avl = remove_int(avl, 124);
- avl = remove_int(avl, 662);
- avl = grpc_avl_add(avl, box(314), box(1639), nullptr);
- avl = grpc_avl_add(avl, box(986), box(1640), nullptr);
- avl = grpc_avl_add(avl, box(622), box(1641), nullptr);
- avl = remove_int(avl, 130);
- avl = grpc_avl_add(avl, box(861), box(1643), nullptr);
- avl = remove_int(avl, 497);
- avl = remove_int(avl, 905);
- avl = grpc_avl_add(avl, box(502), box(1646), nullptr);
- avl = remove_int(avl, 721);
- avl = grpc_avl_add(avl, box(514), box(1648), nullptr);
- avl = grpc_avl_add(avl, box(410), box(1649), nullptr);
- avl = remove_int(avl, 869);
- avl = remove_int(avl, 247);
- avl = grpc_avl_add(avl, box(450), box(1652), nullptr);
- avl = remove_int(avl, 364);
- avl = grpc_avl_add(avl, box(963), box(1654), nullptr);
- avl = grpc_avl_add(avl, box(146), box(1655), nullptr);
- avl = remove_int(avl, 147);
- avl = remove_int(avl, 789);
- avl = grpc_avl_add(avl, box(693), box(1658), nullptr);
- avl = grpc_avl_add(avl, box(959), box(1659), nullptr);
- avl = remove_int(avl, 478);
- avl = grpc_avl_add(avl, box(116), box(1661), nullptr);
- avl = grpc_avl_add(avl, box(520), box(1662), nullptr);
- avl = grpc_avl_add(avl, box(809), box(1663), nullptr);
- avl = grpc_avl_add(avl, box(667), box(1664), nullptr);
- avl = grpc_avl_add(avl, box(406), box(1665), nullptr);
- avl = remove_int(avl, 409);
- avl = grpc_avl_add(avl, box(558), box(1667), nullptr);
- avl = grpc_avl_add(avl, box(0), box(1668), nullptr);
- avl = grpc_avl_add(avl, box(948), box(1669), nullptr);
- avl = grpc_avl_add(avl, box(576), box(1670), nullptr);
- avl = remove_int(avl, 864);
- avl = remove_int(avl, 840);
- avl = remove_int(avl, 1001);
- avl = grpc_avl_add(avl, box(232), box(1674), nullptr);
- avl = remove_int(avl, 676);
- avl = remove_int(avl, 752);
- avl = remove_int(avl, 667);
- avl = remove_int(avl, 605);
- avl = grpc_avl_add(avl, box(258), box(1679), nullptr);
- avl = grpc_avl_add(avl, box(648), box(1680), nullptr);
- avl = grpc_avl_add(avl, box(761), box(1681), nullptr);
- avl = remove_int(avl, 293);
- avl = remove_int(avl, 893);
- avl = grpc_avl_add(avl, box(194), box(1684), nullptr);
- avl = remove_int(avl, 233);
- avl = grpc_avl_add(avl, box(888), box(1686), nullptr);
- avl = remove_int(avl, 470);
- avl = remove_int(avl, 703);
- avl = remove_int(avl, 190);
- avl = remove_int(avl, 359);
- avl = grpc_avl_add(avl, box(621), box(1691), nullptr);
- avl = remove_int(avl, 634);
- avl = remove_int(avl, 335);
- avl = grpc_avl_add(avl, box(718), box(1694), nullptr);
- avl = grpc_avl_add(avl, box(463), box(1695), nullptr);
- avl = grpc_avl_add(avl, box(233), box(1696), nullptr);
- avl = remove_int(avl, 376);
- avl = remove_int(avl, 496);
- avl = remove_int(avl, 819);
- avl = remove_int(avl, 38);
- avl = remove_int(avl, 436);
- avl = remove_int(avl, 102);
- avl = grpc_avl_add(avl, box(607), box(1703), nullptr);
- avl = remove_int(avl, 329);
- avl = grpc_avl_add(avl, box(716), box(1705), nullptr);
- avl = remove_int(avl, 639);
- avl = remove_int(avl, 775);
- avl = remove_int(avl, 578);
- avl = remove_int(avl, 464);
- avl = remove_int(avl, 679);
- avl = remove_int(avl, 615);
- avl = remove_int(avl, 104);
- avl = grpc_avl_add(avl, box(414), box(1713), nullptr);
- avl = grpc_avl_add(avl, box(212), box(1714), nullptr);
- avl = grpc_avl_add(avl, box(266), box(1715), nullptr);
- avl = grpc_avl_add(avl, box(238), box(1716), nullptr);
- avl = remove_int(avl, 153);
- avl = grpc_avl_add(avl, box(585), box(1718), nullptr);
- avl = remove_int(avl, 121);
- avl = grpc_avl_add(avl, box(534), box(1720), nullptr);
- avl = remove_int(avl, 579);
- avl = grpc_avl_add(avl, box(127), box(1722), nullptr);
- avl = grpc_avl_add(avl, box(399), box(1723), nullptr);
- avl = remove_int(avl, 417);
- avl = grpc_avl_add(avl, box(978), box(1725), nullptr);
- avl = grpc_avl_add(avl, box(768), box(1726), nullptr);
- avl = remove_int(avl, 985);
- avl = grpc_avl_add(avl, box(536), box(1728), nullptr);
- avl = grpc_avl_add(avl, box(449), box(1729), nullptr);
- avl = grpc_avl_add(avl, box(586), box(1730), nullptr);
- avl = remove_int(avl, 998);
- avl = remove_int(avl, 394);
- avl = remove_int(avl, 141);
- avl = grpc_avl_add(avl, box(889), box(1734), nullptr);
- avl = grpc_avl_add(avl, box(871), box(1735), nullptr);
- avl = grpc_avl_add(avl, box(76), box(1736), nullptr);
- avl = grpc_avl_add(avl, box(549), box(1737), nullptr);
- avl = grpc_avl_add(avl, box(757), box(1738), nullptr);
- avl = remove_int(avl, 908);
- avl = grpc_avl_add(avl, box(789), box(1740), nullptr);
- avl = remove_int(avl, 224);
- avl = grpc_avl_add(avl, box(407), box(1742), nullptr);
- avl = grpc_avl_add(avl, box(381), box(1743), nullptr);
- avl = grpc_avl_add(avl, box(561), box(1744), nullptr);
- avl = grpc_avl_add(avl, box(667), box(1745), nullptr);
- avl = grpc_avl_add(avl, box(522), box(1746), nullptr);
- avl = grpc_avl_add(avl, box(948), box(1747), nullptr);
- avl = remove_int(avl, 770);
- avl = grpc_avl_add(avl, box(872), box(1749), nullptr);
- avl = grpc_avl_add(avl, box(327), box(1750), nullptr);
- avl = remove_int(avl, 10);
- avl = grpc_avl_add(avl, box(122), box(1752), nullptr);
- avl = remove_int(avl, 606);
- avl = grpc_avl_add(avl, box(485), box(1754), nullptr);
- avl = remove_int(avl, 6);
- avl = grpc_avl_add(avl, box(329), box(1756), nullptr);
- avl = grpc_avl_add(avl, box(783), box(1757), nullptr);
- avl = remove_int(avl, 416);
- avl = grpc_avl_add(avl, box(656), box(1759), nullptr);
- avl = grpc_avl_add(avl, box(971), box(1760), nullptr);
- avl = grpc_avl_add(avl, box(77), box(1761), nullptr);
- avl = grpc_avl_add(avl, box(942), box(1762), nullptr);
- avl = remove_int(avl, 361);
- avl = grpc_avl_add(avl, box(66), box(1764), nullptr);
- avl = grpc_avl_add(avl, box(299), box(1765), nullptr);
- avl = grpc_avl_add(avl, box(929), box(1766), nullptr);
- avl = grpc_avl_add(avl, box(797), box(1767), nullptr);
- avl = remove_int(avl, 869);
- avl = remove_int(avl, 907);
- avl = grpc_avl_add(avl, box(870), box(1770), nullptr);
- avl = remove_int(avl, 580);
- avl = remove_int(avl, 120);
- avl = grpc_avl_add(avl, box(913), box(1773), nullptr);
- avl = remove_int(avl, 480);
- avl = grpc_avl_add(avl, box(489), box(1775), nullptr);
- avl = remove_int(avl, 845);
- avl = grpc_avl_add(avl, box(896), box(1777), nullptr);
- avl = remove_int(avl, 567);
- avl = remove_int(avl, 427);
- avl = grpc_avl_add(avl, box(443), box(1780), nullptr);
- avl = grpc_avl_add(avl, box(3), box(1781), nullptr);
- avl = remove_int(avl, 12);
- avl = grpc_avl_add(avl, box(376), box(1783), nullptr);
- avl = grpc_avl_add(avl, box(155), box(1784), nullptr);
- avl = grpc_avl_add(avl, box(188), box(1785), nullptr);
- avl = grpc_avl_add(avl, box(149), box(1786), nullptr);
- avl = grpc_avl_add(avl, box(178), box(1787), nullptr);
- avl = remove_int(avl, 84);
- avl = grpc_avl_add(avl, box(805), box(1789), nullptr);
- avl = grpc_avl_add(avl, box(612), box(1790), nullptr);
- avl = remove_int(avl, 991);
- avl = grpc_avl_add(avl, box(837), box(1792), nullptr);
- avl = remove_int(avl, 173);
- avl = remove_int(avl, 72);
- avl = grpc_avl_add(avl, box(1014), box(1795), nullptr);
- avl = remove_int(avl, 303);
- avl = grpc_avl_add(avl, box(865), box(1797), nullptr);
- avl = grpc_avl_add(avl, box(793), box(1798), nullptr);
- avl = remove_int(avl, 173);
- avl = remove_int(avl, 477);
- avl = grpc_avl_add(avl, box(950), box(1801), nullptr);
- avl = grpc_avl_add(avl, box(105), box(1802), nullptr);
- avl = grpc_avl_add(avl, box(895), box(1803), nullptr);
- avl = grpc_avl_add(avl, box(171), box(1804), nullptr);
- avl = grpc_avl_add(avl, box(753), box(1805), nullptr);
- avl = grpc_avl_add(avl, box(946), box(1806), nullptr);
- avl = remove_int(avl, 194);
- avl = remove_int(avl, 559);
- avl = remove_int(avl, 116);
- avl = grpc_avl_add(avl, box(968), box(1810), nullptr);
- avl = remove_int(avl, 124);
- avl = remove_int(avl, 99);
- avl = grpc_avl_add(avl, box(563), box(1813), nullptr);
- avl = remove_int(avl, 182);
- avl = grpc_avl_add(avl, box(816), box(1815), nullptr);
- avl = remove_int(avl, 73);
- avl = remove_int(avl, 261);
- avl = grpc_avl_add(avl, box(847), box(1818), nullptr);
- avl = grpc_avl_add(avl, box(368), box(1819), nullptr);
- avl = grpc_avl_add(avl, box(808), box(1820), nullptr);
- avl = grpc_avl_add(avl, box(779), box(1821), nullptr);
- avl = remove_int(avl, 818);
- avl = grpc_avl_add(avl, box(466), box(1823), nullptr);
- avl = remove_int(avl, 316);
- avl = grpc_avl_add(avl, box(986), box(1825), nullptr);
- avl = grpc_avl_add(avl, box(688), box(1826), nullptr);
- avl = grpc_avl_add(avl, box(509), box(1827), nullptr);
- avl = grpc_avl_add(avl, box(51), box(1828), nullptr);
- avl = remove_int(avl, 655);
- avl = remove_int(avl, 785);
- avl = remove_int(avl, 893);
- avl = grpc_avl_add(avl, box(167), box(1832), nullptr);
- avl = remove_int(avl, 13);
- avl = remove_int(avl, 263);
- avl = grpc_avl_add(avl, box(1009), box(1835), nullptr);
- avl = remove_int(avl, 480);
- avl = remove_int(avl, 778);
- avl = remove_int(avl, 713);
- avl = remove_int(avl, 628);
- avl = grpc_avl_add(avl, box(803), box(1840), nullptr);
- avl = remove_int(avl, 267);
- avl = grpc_avl_add(avl, box(676), box(1842), nullptr);
- avl = grpc_avl_add(avl, box(231), box(1843), nullptr);
- avl = grpc_avl_add(avl, box(824), box(1844), nullptr);
- avl = remove_int(avl, 961);
- avl = grpc_avl_add(avl, box(311), box(1846), nullptr);
- avl = grpc_avl_add(avl, box(420), box(1847), nullptr);
- avl = grpc_avl_add(avl, box(960), box(1848), nullptr);
- avl = grpc_avl_add(avl, box(468), box(1849), nullptr);
- avl = grpc_avl_add(avl, box(815), box(1850), nullptr);
- avl = remove_int(avl, 247);
- avl = remove_int(avl, 194);
- avl = grpc_avl_add(avl, box(546), box(1853), nullptr);
- avl = remove_int(avl, 222);
- avl = remove_int(avl, 914);
- avl = remove_int(avl, 741);
- avl = grpc_avl_add(avl, box(470), box(1857), nullptr);
- avl = grpc_avl_add(avl, box(933), box(1858), nullptr);
- avl = grpc_avl_add(avl, box(97), box(1859), nullptr);
- avl = remove_int(avl, 564);
- avl = remove_int(avl, 295);
- avl = grpc_avl_add(avl, box(864), box(1862), nullptr);
- avl = remove_int(avl, 329);
- avl = grpc_avl_add(avl, box(124), box(1864), nullptr);
- avl = grpc_avl_add(avl, box(1000), box(1865), nullptr);
- avl = grpc_avl_add(avl, box(228), box(1866), nullptr);
- avl = grpc_avl_add(avl, box(187), box(1867), nullptr);
- avl = remove_int(avl, 224);
- avl = remove_int(avl, 306);
- avl = remove_int(avl, 884);
- avl = grpc_avl_add(avl, box(449), box(1871), nullptr);
- avl = grpc_avl_add(avl, box(353), box(1872), nullptr);
- avl = grpc_avl_add(avl, box(994), box(1873), nullptr);
- avl = grpc_avl_add(avl, box(596), box(1874), nullptr);
- avl = grpc_avl_add(avl, box(996), box(1875), nullptr);
- avl = grpc_avl_add(avl, box(101), box(1876), nullptr);
- avl = grpc_avl_add(avl, box(1012), box(1877), nullptr);
- avl = grpc_avl_add(avl, box(982), box(1878), nullptr);
- avl = grpc_avl_add(avl, box(742), box(1879), nullptr);
- avl = remove_int(avl, 92);
- avl = remove_int(avl, 1022);
- avl = grpc_avl_add(avl, box(941), box(1882), nullptr);
- avl = remove_int(avl, 742);
- avl = remove_int(avl, 919);
- avl = grpc_avl_add(avl, box(588), box(1885), nullptr);
- avl = remove_int(avl, 221);
- avl = grpc_avl_add(avl, box(356), box(1887), nullptr);
- avl = grpc_avl_add(avl, box(932), box(1888), nullptr);
- avl = remove_int(avl, 837);
- avl = grpc_avl_add(avl, box(394), box(1890), nullptr);
- avl = grpc_avl_add(avl, box(642), box(1891), nullptr);
- avl = grpc_avl_add(avl, box(52), box(1892), nullptr);
- avl = grpc_avl_add(avl, box(437), box(1893), nullptr);
- avl = grpc_avl_add(avl, box(948), box(1894), nullptr);
- avl = grpc_avl_add(avl, box(93), box(1895), nullptr);
- avl = remove_int(avl, 873);
- avl = remove_int(avl, 336);
- avl = remove_int(avl, 277);
- avl = remove_int(avl, 932);
- avl = grpc_avl_add(avl, box(80), box(1900), nullptr);
- avl = grpc_avl_add(avl, box(952), box(1901), nullptr);
- avl = grpc_avl_add(avl, box(510), box(1902), nullptr);
- avl = remove_int(avl, 876);
- avl = remove_int(avl, 612);
- avl = grpc_avl_add(avl, box(923), box(1905), nullptr);
- avl = grpc_avl_add(avl, box(475), box(1906), nullptr);
- avl = remove_int(avl, 478);
- avl = remove_int(avl, 148);
- avl = grpc_avl_add(avl, box(538), box(1909), nullptr);
- avl = remove_int(avl, 47);
- avl = grpc_avl_add(avl, box(89), box(1911), nullptr);
- avl = remove_int(avl, 723);
- avl = grpc_avl_add(avl, box(687), box(1913), nullptr);
- avl = grpc_avl_add(avl, box(480), box(1914), nullptr);
- avl = grpc_avl_add(avl, box(149), box(1915), nullptr);
- avl = remove_int(avl, 68);
- avl = remove_int(avl, 862);
- avl = remove_int(avl, 363);
- avl = grpc_avl_add(avl, box(996), box(1919), nullptr);
- avl = remove_int(avl, 380);
- avl = grpc_avl_add(avl, box(957), box(1921), nullptr);
- avl = remove_int(avl, 413);
- avl = grpc_avl_add(avl, box(360), box(1923), nullptr);
- avl = grpc_avl_add(avl, box(304), box(1924), nullptr);
- avl = grpc_avl_add(avl, box(634), box(1925), nullptr);
- avl = grpc_avl_add(avl, box(506), box(1926), nullptr);
- avl = remove_int(avl, 248);
- avl = grpc_avl_add(avl, box(124), box(1928), nullptr);
- avl = grpc_avl_add(avl, box(181), box(1929), nullptr);
- avl = remove_int(avl, 507);
- avl = grpc_avl_add(avl, box(141), box(1931), nullptr);
- avl = remove_int(avl, 409);
- avl = remove_int(avl, 129);
- avl = remove_int(avl, 694);
- avl = remove_int(avl, 723);
- avl = grpc_avl_add(avl, box(998), box(1936), nullptr);
- avl = grpc_avl_add(avl, box(906), box(1937), nullptr);
- avl = grpc_avl_add(avl, box(44), box(1938), nullptr);
- avl = remove_int(avl, 949);
- avl = remove_int(avl, 117);
- avl = grpc_avl_add(avl, box(700), box(1941), nullptr);
- avl = grpc_avl_add(avl, box(258), box(1942), nullptr);
- avl = remove_int(avl, 828);
- avl = grpc_avl_add(avl, box(860), box(1944), nullptr);
- avl = grpc_avl_add(avl, box(987), box(1945), nullptr);
- avl = grpc_avl_add(avl, box(316), box(1946), nullptr);
- avl = grpc_avl_add(avl, box(919), box(1947), nullptr);
- avl = remove_int(avl, 84);
- avl = grpc_avl_add(avl, box(473), box(1949), nullptr);
- avl = remove_int(avl, 127);
- avl = remove_int(avl, 829);
- avl = remove_int(avl, 829);
- avl = grpc_avl_add(avl, box(488), box(1953), nullptr);
- avl = grpc_avl_add(avl, box(954), box(1954), nullptr);
- avl = remove_int(avl, 198);
- avl = remove_int(avl, 972);
- avl = remove_int(avl, 670);
- avl = grpc_avl_add(avl, box(822), box(1958), nullptr);
- avl = remove_int(avl, 589);
- avl = remove_int(avl, 459);
- avl = grpc_avl_add(avl, box(1003), box(1961), nullptr);
- avl = grpc_avl_add(avl, box(657), box(1962), nullptr);
- avl = grpc_avl_add(avl, box(477), box(1963), nullptr);
- avl = grpc_avl_add(avl, box(923), box(1964), nullptr);
- avl = remove_int(avl, 496);
- avl = remove_int(avl, 99);
- avl = grpc_avl_add(avl, box(127), box(1967), nullptr);
- avl = grpc_avl_add(avl, box(1013), box(1968), nullptr);
- avl = grpc_avl_add(avl, box(778), box(1969), nullptr);
- avl = remove_int(avl, 5);
- avl = remove_int(avl, 990);
- avl = remove_int(avl, 850);
- avl = remove_int(avl, 160);
- avl = remove_int(avl, 86);
- avl = grpc_avl_add(avl, box(283), box(1975), nullptr);
- avl = remove_int(avl, 278);
- avl = remove_int(avl, 297);
- avl = remove_int(avl, 137);
- avl = remove_int(avl, 653);
- avl = grpc_avl_add(avl, box(702), box(1980), nullptr);
- avl = remove_int(avl, 63);
- avl = remove_int(avl, 427);
- avl = remove_int(avl, 706);
- avl = remove_int(avl, 806);
- avl = grpc_avl_add(avl, box(335), box(1985), nullptr);
- avl = grpc_avl_add(avl, box(412), box(1986), nullptr);
- avl = remove_int(avl, 766);
- avl = remove_int(avl, 937);
- avl = remove_int(avl, 886);
- avl = remove_int(avl, 652);
- avl = grpc_avl_add(avl, box(545), box(1991), nullptr);
- avl = grpc_avl_add(avl, box(408), box(1992), nullptr);
- avl = grpc_avl_add(avl, box(841), box(1993), nullptr);
- avl = remove_int(avl, 593);
- avl = grpc_avl_add(avl, box(582), box(1995), nullptr);
- avl = grpc_avl_add(avl, box(597), box(1996), nullptr);
- avl = remove_int(avl, 49);
- avl = remove_int(avl, 835);
- avl = grpc_avl_add(avl, box(417), box(1999), nullptr);
- avl = grpc_avl_add(avl, box(191), box(2000), nullptr);
- avl = remove_int(avl, 406);
- avl = grpc_avl_add(avl, box(30), box(2002), nullptr);
- avl = remove_int(avl, 841);
- avl = remove_int(avl, 50);
- avl = grpc_avl_add(avl, box(967), box(2005), nullptr);
- avl = grpc_avl_add(avl, box(849), box(2006), nullptr);
- avl = remove_int(avl, 608);
- avl = grpc_avl_add(avl, box(306), box(2008), nullptr);
- avl = remove_int(avl, 779);
- avl = grpc_avl_add(avl, box(897), box(2010), nullptr);
- avl = grpc_avl_add(avl, box(147), box(2011), nullptr);
- avl = remove_int(avl, 982);
- avl = grpc_avl_add(avl, box(470), box(2013), nullptr);
- avl = remove_int(avl, 951);
- avl = grpc_avl_add(avl, box(388), box(2015), nullptr);
- avl = remove_int(avl, 616);
- avl = remove_int(avl, 721);
- avl = remove_int(avl, 942);
- avl = remove_int(avl, 589);
- avl = grpc_avl_add(avl, box(218), box(2020), nullptr);
- avl = remove_int(avl, 671);
- avl = grpc_avl_add(avl, box(1020), box(2022), nullptr);
- avl = remove_int(avl, 277);
- avl = grpc_avl_add(avl, box(681), box(2024), nullptr);
- avl = grpc_avl_add(avl, box(179), box(2025), nullptr);
- avl = grpc_avl_add(avl, box(370), box(2026), nullptr);
- avl = grpc_avl_add(avl, box(0), box(2027), nullptr);
- avl = remove_int(avl, 523);
- avl = grpc_avl_add(avl, box(99), box(2029), nullptr);
- avl = grpc_avl_add(avl, box(334), box(2030), nullptr);
- avl = grpc_avl_add(avl, box(569), box(2031), nullptr);
- avl = grpc_avl_add(avl, box(257), box(2032), nullptr);
- avl = remove_int(avl, 572);
- avl = grpc_avl_add(avl, box(805), box(2034), nullptr);
- avl = grpc_avl_add(avl, box(143), box(2035), nullptr);
- avl = grpc_avl_add(avl, box(670), box(2036), nullptr);
- avl = remove_int(avl, 42);
- avl = grpc_avl_add(avl, box(46), box(2038), nullptr);
- avl = remove_int(avl, 970);
- avl = grpc_avl_add(avl, box(353), box(2040), nullptr);
- avl = remove_int(avl, 258);
- avl = grpc_avl_add(avl, box(451), box(2042), nullptr);
- avl = grpc_avl_add(avl, box(28), box(2043), nullptr);
- avl = grpc_avl_add(avl, box(729), box(2044), nullptr);
- avl = grpc_avl_add(avl, box(401), box(2045), nullptr);
- avl = grpc_avl_add(avl, box(614), box(2046), nullptr);
- avl = remove_int(avl, 990);
- avl = remove_int(avl, 212);
- avl = remove_int(avl, 22);
- avl = remove_int(avl, 677);
- avl = grpc_avl_add(avl, box(1016), box(2051), nullptr);
- avl = grpc_avl_add(avl, box(980), box(2052), nullptr);
- avl = grpc_avl_add(avl, box(990), box(2053), nullptr);
- avl = grpc_avl_add(avl, box(355), box(2054), nullptr);
- avl = remove_int(avl, 730);
- avl = remove_int(avl, 37);
- avl = grpc_avl_add(avl, box(407), box(2057), nullptr);
- avl = grpc_avl_add(avl, box(222), box(2058), nullptr);
- avl = grpc_avl_add(avl, box(439), box(2059), nullptr);
- avl = grpc_avl_add(avl, box(563), box(2060), nullptr);
- avl = remove_int(avl, 992);
- avl = remove_int(avl, 786);
- avl = grpc_avl_add(avl, box(1), box(2063), nullptr);
- avl = grpc_avl_add(avl, box(473), box(2064), nullptr);
- avl = grpc_avl_add(avl, box(992), box(2065), nullptr);
- avl = remove_int(avl, 190);
- avl = remove_int(avl, 450);
- avl = remove_int(avl, 1020);
- avl = remove_int(avl, 149);
- avl = grpc_avl_add(avl, box(329), box(2070), nullptr);
- avl = grpc_avl_add(avl, box(35), box(2071), nullptr);
- avl = remove_int(avl, 843);
- avl = grpc_avl_add(avl, box(855), box(2073), nullptr);
- avl = remove_int(avl, 878);
- avl = grpc_avl_add(avl, box(993), box(2075), nullptr);
- avl = grpc_avl_add(avl, box(87), box(2076), nullptr);
- avl = grpc_avl_add(avl, box(572), box(2077), nullptr);
- avl = remove_int(avl, 896);
- avl = grpc_avl_add(avl, box(849), box(2079), nullptr);
- avl = remove_int(avl, 597);
- avl = grpc_avl_add(avl, box(472), box(2081), nullptr);
- avl = remove_int(avl, 778);
- avl = remove_int(avl, 934);
- avl = remove_int(avl, 314);
- avl = grpc_avl_add(avl, box(101), box(2085), nullptr);
- avl = remove_int(avl, 938);
- avl = remove_int(avl, 1010);
- avl = grpc_avl_add(avl, box(579), box(2088), nullptr);
- avl = remove_int(avl, 798);
- avl = remove_int(avl, 88);
- avl = grpc_avl_add(avl, box(851), box(2091), nullptr);
- avl = remove_int(avl, 705);
- avl = grpc_avl_add(avl, box(26), box(2093), nullptr);
- avl = remove_int(avl, 973);
- avl = grpc_avl_add(avl, box(923), box(2095), nullptr);
- avl = remove_int(avl, 668);
- avl = grpc_avl_add(avl, box(310), box(2097), nullptr);
- avl = grpc_avl_add(avl, box(269), box(2098), nullptr);
- avl = remove_int(avl, 173);
- avl = grpc_avl_add(avl, box(279), box(2100), nullptr);
- avl = remove_int(avl, 203);
- avl = grpc_avl_add(avl, box(411), box(2102), nullptr);
- avl = remove_int(avl, 950);
- avl = grpc_avl_add(avl, box(6), box(2104), nullptr);
- avl = remove_int(avl, 400);
- avl = remove_int(avl, 468);
- avl = remove_int(avl, 271);
- avl = grpc_avl_add(avl, box(627), box(2108), nullptr);
- avl = remove_int(avl, 727);
- avl = remove_int(avl, 148);
- avl = remove_int(avl, 98);
- avl = remove_int(avl, 997);
- avl = remove_int(avl, 215);
- avl = remove_int(avl, 628);
- avl = remove_int(avl, 826);
- avl = remove_int(avl, 664);
- avl = grpc_avl_add(avl, box(76), box(2117), nullptr);
- avl = remove_int(avl, 194);
- avl = remove_int(avl, 18);
- avl = grpc_avl_add(avl, box(727), box(2120), nullptr);
- avl = remove_int(avl, 295);
- avl = grpc_avl_add(avl, box(645), box(2122), nullptr);
- avl = remove_int(avl, 321);
- avl = remove_int(avl, 863);
- avl = grpc_avl_add(avl, box(824), box(2125), nullptr);
- avl = grpc_avl_add(avl, box(651), box(2126), nullptr);
- avl = grpc_avl_add(avl, box(804), box(2127), nullptr);
- avl = remove_int(avl, 307);
- avl = grpc_avl_add(avl, box(867), box(2129), nullptr);
- avl = remove_int(avl, 384);
- avl = grpc_avl_add(avl, box(819), box(2131), nullptr);
- avl = remove_int(avl, 674);
- avl = grpc_avl_add(avl, box(76), box(2133), nullptr);
- avl = remove_int(avl, 898);
- avl = grpc_avl_add(avl, box(45), box(2135), nullptr);
- avl = grpc_avl_add(avl, box(512), box(2136), nullptr);
- avl = remove_int(avl, 773);
- avl = remove_int(avl, 907);
- avl = remove_int(avl, 382);
- avl = remove_int(avl, 95);
- avl = remove_int(avl, 734);
- avl = remove_int(avl, 81);
- avl = grpc_avl_add(avl, box(348), box(2143), nullptr);
- avl = remove_int(avl, 509);
- avl = remove_int(avl, 301);
- avl = grpc_avl_add(avl, box(861), box(2146), nullptr);
- avl = grpc_avl_add(avl, box(918), box(2147), nullptr);
- avl = remove_int(avl, 992);
- avl = grpc_avl_add(avl, box(356), box(2149), nullptr);
- avl = remove_int(avl, 64);
- avl = remove_int(avl, 444);
- avl = remove_int(avl, 741);
- avl = grpc_avl_add(avl, box(710), box(2153), nullptr);
- avl = grpc_avl_add(avl, box(264), box(2154), nullptr);
- avl = remove_int(avl, 347);
- avl = remove_int(avl, 250);
- avl = grpc_avl_add(avl, box(82), box(2157), nullptr);
- avl = grpc_avl_add(avl, box(571), box(2158), nullptr);
- avl = remove_int(avl, 721);
- avl = remove_int(avl, 622);
- avl = grpc_avl_add(avl, box(950), box(2161), nullptr);
- avl = grpc_avl_add(avl, box(94), box(2162), nullptr);
- avl = remove_int(avl, 970);
- avl = grpc_avl_add(avl, box(815), box(2164), nullptr);
- avl = remove_int(avl, 930);
- avl = remove_int(avl, 703);
- avl = grpc_avl_add(avl, box(432), box(2167), nullptr);
- avl = remove_int(avl, 544);
- avl = grpc_avl_add(avl, box(21), box(2169), nullptr);
- avl = grpc_avl_add(avl, box(186), box(2170), nullptr);
- avl = remove_int(avl, 143);
- avl = grpc_avl_add(avl, box(425), box(2172), nullptr);
- avl = remove_int(avl, 769);
- avl = grpc_avl_add(avl, box(656), box(2174), nullptr);
- avl = remove_int(avl, 29);
- avl = grpc_avl_add(avl, box(464), box(2176), nullptr);
- avl = remove_int(avl, 713);
- avl = grpc_avl_add(avl, box(800), box(2178), nullptr);
- avl = remove_int(avl, 621);
- avl = grpc_avl_add(avl, box(962), box(2180), nullptr);
- avl = remove_int(avl, 448);
- avl = grpc_avl_add(avl, box(878), box(2182), nullptr);
- avl = remove_int(avl, 39);
- avl = remove_int(avl, 999);
- avl = grpc_avl_add(avl, box(182), box(2185), nullptr);
- avl = grpc_avl_add(avl, box(429), box(2186), nullptr);
- avl = grpc_avl_add(avl, box(598), box(2187), nullptr);
- avl = remove_int(avl, 551);
- avl = grpc_avl_add(avl, box(827), box(2189), nullptr);
- avl = grpc_avl_add(avl, box(809), box(2190), nullptr);
- avl = remove_int(avl, 438);
- avl = remove_int(avl, 811);
- avl = grpc_avl_add(avl, box(808), box(2193), nullptr);
- avl = grpc_avl_add(avl, box(788), box(2194), nullptr);
- avl = remove_int(avl, 156);
- avl = grpc_avl_add(avl, box(933), box(2196), nullptr);
- avl = grpc_avl_add(avl, box(344), box(2197), nullptr);
- avl = remove_int(avl, 460);
- avl = grpc_avl_add(avl, box(161), box(2199), nullptr);
- avl = grpc_avl_add(avl, box(444), box(2200), nullptr);
- avl = remove_int(avl, 597);
- avl = remove_int(avl, 668);
- avl = grpc_avl_add(avl, box(703), box(2203), nullptr);
- avl = remove_int(avl, 515);
- avl = grpc_avl_add(avl, box(380), box(2205), nullptr);
- avl = grpc_avl_add(avl, box(338), box(2206), nullptr);
- avl = remove_int(avl, 550);
- avl = remove_int(avl, 946);
- avl = remove_int(avl, 714);
- avl = remove_int(avl, 739);
- avl = grpc_avl_add(avl, box(413), box(2211), nullptr);
- avl = remove_int(avl, 450);
- avl = grpc_avl_add(avl, box(411), box(2213), nullptr);
- avl = grpc_avl_add(avl, box(117), box(2214), nullptr);
- avl = grpc_avl_add(avl, box(322), box(2215), nullptr);
- avl = grpc_avl_add(avl, box(915), box(2216), nullptr);
- avl = grpc_avl_add(avl, box(410), box(2217), nullptr);
- avl = grpc_avl_add(avl, box(66), box(2218), nullptr);
- avl = remove_int(avl, 756);
- avl = remove_int(avl, 596);
- avl = grpc_avl_add(avl, box(882), box(2221), nullptr);
- avl = grpc_avl_add(avl, box(930), box(2222), nullptr);
- avl = grpc_avl_add(avl, box(36), box(2223), nullptr);
- avl = remove_int(avl, 742);
- avl = grpc_avl_add(avl, box(539), box(2225), nullptr);
- avl = grpc_avl_add(avl, box(596), box(2226), nullptr);
- avl = remove_int(avl, 82);
- avl = remove_int(avl, 686);
- avl = remove_int(avl, 933);
- avl = remove_int(avl, 42);
- avl = remove_int(avl, 340);
- avl = grpc_avl_add(avl, box(126), box(2232), nullptr);
- avl = grpc_avl_add(avl, box(493), box(2233), nullptr);
- avl = grpc_avl_add(avl, box(839), box(2234), nullptr);
- avl = remove_int(avl, 774);
- avl = grpc_avl_add(avl, box(337), box(2236), nullptr);
- avl = remove_int(avl, 322);
- avl = grpc_avl_add(avl, box(16), box(2238), nullptr);
- avl = remove_int(avl, 73);
- avl = remove_int(avl, 85);
- avl = remove_int(avl, 191);
- avl = remove_int(avl, 541);
- avl = grpc_avl_add(avl, box(704), box(2243), nullptr);
- avl = remove_int(avl, 767);
- avl = remove_int(avl, 1006);
- avl = remove_int(avl, 844);
- avl = remove_int(avl, 742);
- avl = grpc_avl_add(avl, box(48), box(2248), nullptr);
- avl = grpc_avl_add(avl, box(138), box(2249), nullptr);
- avl = grpc_avl_add(avl, box(437), box(2250), nullptr);
- avl = grpc_avl_add(avl, box(275), box(2251), nullptr);
- avl = remove_int(avl, 520);
- avl = grpc_avl_add(avl, box(1019), box(2253), nullptr);
- avl = remove_int(avl, 955);
- avl = grpc_avl_add(avl, box(270), box(2255), nullptr);
- avl = remove_int(avl, 680);
- avl = remove_int(avl, 698);
- avl = grpc_avl_add(avl, box(735), box(2258), nullptr);
- avl = grpc_avl_add(avl, box(400), box(2259), nullptr);
- avl = remove_int(avl, 991);
- avl = grpc_avl_add(avl, box(263), box(2261), nullptr);
- avl = remove_int(avl, 704);
- avl = grpc_avl_add(avl, box(757), box(2263), nullptr);
- avl = remove_int(avl, 194);
- avl = remove_int(avl, 616);
- avl = remove_int(avl, 784);
- avl = grpc_avl_add(avl, box(382), box(2267), nullptr);
- avl = grpc_avl_add(avl, box(464), box(2268), nullptr);
- avl = grpc_avl_add(avl, box(817), box(2269), nullptr);
- avl = remove_int(avl, 445);
- avl = grpc_avl_add(avl, box(412), box(2271), nullptr);
- avl = remove_int(avl, 525);
- avl = grpc_avl_add(avl, box(299), box(2273), nullptr);
- avl = grpc_avl_add(avl, box(464), box(2274), nullptr);
- avl = grpc_avl_add(avl, box(715), box(2275), nullptr);
- avl = remove_int(avl, 58);
- avl = remove_int(avl, 218);
- avl = grpc_avl_add(avl, box(961), box(2278), nullptr);
- avl = grpc_avl_add(avl, box(491), box(2279), nullptr);
- avl = remove_int(avl, 846);
- avl = grpc_avl_add(avl, box(762), box(2281), nullptr);
- avl = remove_int(avl, 974);
- avl = remove_int(avl, 887);
- avl = grpc_avl_add(avl, box(498), box(2284), nullptr);
- avl = remove_int(avl, 810);
- avl = remove_int(avl, 743);
- avl = remove_int(avl, 22);
- avl = remove_int(avl, 284);
- avl = grpc_avl_add(avl, box(482), box(2289), nullptr);
- avl = grpc_avl_add(avl, box(1021), box(2290), nullptr);
- avl = remove_int(avl, 155);
- avl = remove_int(avl, 128);
- avl = grpc_avl_add(avl, box(819), box(2293), nullptr);
- avl = grpc_avl_add(avl, box(324), box(2294), nullptr);
- avl = remove_int(avl, 196);
- avl = remove_int(avl, 370);
- avl = remove_int(avl, 753);
- avl = remove_int(avl, 56);
- avl = remove_int(avl, 735);
- avl = grpc_avl_add(avl, box(272), box(2300), nullptr);
- avl = grpc_avl_add(avl, box(474), box(2301), nullptr);
- avl = grpc_avl_add(avl, box(719), box(2302), nullptr);
- avl = grpc_avl_add(avl, box(236), box(2303), nullptr);
- avl = remove_int(avl, 818);
- avl = grpc_avl_add(avl, box(727), box(2305), nullptr);
- avl = remove_int(avl, 892);
- avl = remove_int(avl, 871);
- avl = remove_int(avl, 231);
- avl = grpc_avl_add(avl, box(62), box(2309), nullptr);
- avl = grpc_avl_add(avl, box(953), box(2310), nullptr);
- avl = remove_int(avl, 701);
- avl = grpc_avl_add(avl, box(193), box(2312), nullptr);
- avl = remove_int(avl, 619);
- avl = remove_int(avl, 22);
- avl = remove_int(avl, 804);
- avl = remove_int(avl, 851);
- avl = grpc_avl_add(avl, box(286), box(2317), nullptr);
- avl = grpc_avl_add(avl, box(751), box(2318), nullptr);
- avl = remove_int(avl, 525);
- avl = grpc_avl_add(avl, box(217), box(2320), nullptr);
- avl = remove_int(avl, 336);
- avl = grpc_avl_add(avl, box(86), box(2322), nullptr);
- avl = grpc_avl_add(avl, box(81), box(2323), nullptr);
- avl = grpc_avl_add(avl, box(850), box(2324), nullptr);
- avl = remove_int(avl, 872);
- avl = grpc_avl_add(avl, box(402), box(2326), nullptr);
- avl = grpc_avl_add(avl, box(54), box(2327), nullptr);
- avl = grpc_avl_add(avl, box(980), box(2328), nullptr);
- avl = grpc_avl_add(avl, box(845), box(2329), nullptr);
- avl = remove_int(avl, 1004);
- avl = remove_int(avl, 273);
- avl = remove_int(avl, 879);
- avl = grpc_avl_add(avl, box(354), box(2333), nullptr);
- avl = grpc_avl_add(avl, box(58), box(2334), nullptr);
- avl = grpc_avl_add(avl, box(127), box(2335), nullptr);
- avl = remove_int(avl, 84);
- avl = grpc_avl_add(avl, box(360), box(2337), nullptr);
- avl = remove_int(avl, 648);
- avl = remove_int(avl, 488);
- avl = remove_int(avl, 585);
- avl = remove_int(avl, 230);
- avl = grpc_avl_add(avl, box(887), box(2342), nullptr);
- avl = remove_int(avl, 558);
- avl = remove_int(avl, 958);
- avl = grpc_avl_add(avl, box(822), box(2345), nullptr);
- avl = remove_int(avl, 1004);
- avl = remove_int(avl, 747);
- avl = grpc_avl_add(avl, box(631), box(2348), nullptr);
- avl = grpc_avl_add(avl, box(442), box(2349), nullptr);
- avl = remove_int(avl, 957);
- avl = remove_int(avl, 964);
- avl = grpc_avl_add(avl, box(10), box(2352), nullptr);
- avl = remove_int(avl, 189);
- avl = grpc_avl_add(avl, box(742), box(2354), nullptr);
- avl = remove_int(avl, 108);
- avl = grpc_avl_add(avl, box(1014), box(2356), nullptr);
- avl = remove_int(avl, 266);
- avl = remove_int(avl, 623);
- avl = remove_int(avl, 697);
- avl = grpc_avl_add(avl, box(180), box(2360), nullptr);
- avl = remove_int(avl, 472);
- avl = grpc_avl_add(avl, box(567), box(2362), nullptr);
- avl = remove_int(avl, 1020);
- avl = remove_int(avl, 273);
- avl = grpc_avl_add(avl, box(864), box(2365), nullptr);
- avl = grpc_avl_add(avl, box(1009), box(2366), nullptr);
- avl = remove_int(avl, 224);
- avl = remove_int(avl, 81);
- avl = grpc_avl_add(avl, box(653), box(2369), nullptr);
- avl = remove_int(avl, 67);
- avl = remove_int(avl, 102);
- avl = remove_int(avl, 76);
- avl = remove_int(avl, 935);
- avl = remove_int(avl, 169);
- avl = remove_int(avl, 232);
- avl = remove_int(avl, 79);
- avl = grpc_avl_add(avl, box(509), box(2377), nullptr);
- avl = remove_int(avl, 900);
- avl = remove_int(avl, 822);
- avl = remove_int(avl, 945);
- avl = remove_int(avl, 356);
- avl = grpc_avl_add(avl, box(443), box(2382), nullptr);
- avl = grpc_avl_add(avl, box(925), box(2383), nullptr);
- avl = remove_int(avl, 994);
- avl = remove_int(avl, 324);
- avl = grpc_avl_add(avl, box(291), box(2386), nullptr);
- avl = remove_int(avl, 94);
- avl = remove_int(avl, 795);
- avl = remove_int(avl, 42);
- avl = grpc_avl_add(avl, box(613), box(2390), nullptr);
- avl = remove_int(avl, 289);
- avl = grpc_avl_add(avl, box(980), box(2392), nullptr);
- avl = remove_int(avl, 316);
- avl = grpc_avl_add(avl, box(281), box(2394), nullptr);
- avl = grpc_avl_add(avl, box(1006), box(2395), nullptr);
- avl = remove_int(avl, 776);
- avl = grpc_avl_add(avl, box(108), box(2397), nullptr);
- avl = grpc_avl_add(avl, box(918), box(2398), nullptr);
- avl = remove_int(avl, 721);
- avl = remove_int(avl, 563);
- avl = grpc_avl_add(avl, box(925), box(2401), nullptr);
- avl = remove_int(avl, 448);
- avl = remove_int(avl, 198);
- avl = remove_int(avl, 1);
- avl = grpc_avl_add(avl, box(160), box(2405), nullptr);
- avl = remove_int(avl, 515);
- avl = grpc_avl_add(avl, box(284), box(2407), nullptr);
- avl = grpc_avl_add(avl, box(225), box(2408), nullptr);
- avl = remove_int(avl, 304);
- avl = grpc_avl_add(avl, box(714), box(2410), nullptr);
- avl = grpc_avl_add(avl, box(708), box(2411), nullptr);
- avl = grpc_avl_add(avl, box(624), box(2412), nullptr);
- avl = remove_int(avl, 662);
- avl = remove_int(avl, 825);
- avl = remove_int(avl, 383);
- avl = remove_int(avl, 381);
- avl = grpc_avl_add(avl, box(194), box(2417), nullptr);
- avl = remove_int(avl, 280);
- avl = remove_int(avl, 25);
- avl = remove_int(avl, 633);
- avl = grpc_avl_add(avl, box(897), box(2421), nullptr);
- avl = remove_int(avl, 636);
- avl = remove_int(avl, 596);
- avl = remove_int(avl, 757);
- avl = remove_int(avl, 343);
- avl = remove_int(avl, 162);
- avl = remove_int(avl, 913);
- avl = remove_int(avl, 843);
- avl = remove_int(avl, 280);
- avl = remove_int(avl, 911);
- avl = grpc_avl_add(avl, box(1008), box(2431), nullptr);
- avl = remove_int(avl, 948);
- avl = remove_int(avl, 74);
- avl = remove_int(avl, 571);
- avl = grpc_avl_add(avl, box(486), box(2435), nullptr);
- avl = grpc_avl_add(avl, box(285), box(2436), nullptr);
- avl = remove_int(avl, 304);
- avl = remove_int(avl, 516);
- avl = grpc_avl_add(avl, box(758), box(2439), nullptr);
- avl = grpc_avl_add(avl, box(776), box(2440), nullptr);
- avl = remove_int(avl, 696);
- avl = grpc_avl_add(avl, box(104), box(2442), nullptr);
- avl = grpc_avl_add(avl, box(700), box(2443), nullptr);
- avl = grpc_avl_add(avl, box(114), box(2444), nullptr);
- avl = grpc_avl_add(avl, box(567), box(2445), nullptr);
- avl = remove_int(avl, 620);
- avl = grpc_avl_add(avl, box(270), box(2447), nullptr);
- avl = remove_int(avl, 730);
- avl = grpc_avl_add(avl, box(749), box(2449), nullptr);
- avl = grpc_avl_add(avl, box(443), box(2450), nullptr);
- avl = remove_int(avl, 457);
- avl = grpc_avl_add(avl, box(571), box(2452), nullptr);
- avl = grpc_avl_add(avl, box(626), box(2453), nullptr);
- avl = remove_int(avl, 638);
- avl = remove_int(avl, 313);
-
- grpc_avl_unref(avl, nullptr);
-}
-
static void test_stress(int amount_of_stress) {
int added[1024];
int i, j;
@@ -3653,8 +294,6 @@ int main(int argc, char* argv[]) {
test_replace();
test_remove();
test_badcase1();
- test_badcase2();
- test_badcase3();
test_stress(10);
return 0;
diff --git a/test/core/bad_ssl/bad_ssl_test.cc b/test/core/bad_ssl/bad_ssl_test.cc
index e2ea7540ef..73d251eff4 100644
--- a/test/core/bad_ssl/bad_ssl_test.cc
+++ b/test/core/bad_ssl/bad_ssl_test.cc
@@ -37,7 +37,7 @@ static void* tag(intptr_t t) { return (void*)t; }
static void run_test(const char* target, size_t nops) {
grpc_channel_credentials* ssl_creds =
- grpc_ssl_credentials_create(nullptr, nullptr, nullptr);
+ grpc_ssl_credentials_create(nullptr, nullptr, nullptr, nullptr);
grpc_channel* channel;
grpc_call* c;
diff --git a/test/core/channel/BUILD b/test/core/channel/BUILD
index c554b20148..da419f00cf 100644
--- a/test/core/channel/BUILD
+++ b/test/core/channel/BUILD
@@ -84,6 +84,23 @@ grpc_cc_test(
)
grpc_cc_test(
+ name = "channelz_test",
+ srcs = ["channelz_test.cc"],
+ language = "C++",
+ deps = [
+ "//:gpr",
+ "//:grpc",
+ "//:grpc++",
+ "//test/core/util:gpr_test_util",
+ "//test/core/util:grpc_test_util",
+ "//test/cpp/util:channel_trace_proto_helper",
+ ],
+ external_deps = [
+ "gtest",
+ ],
+)
+
+grpc_cc_test(
name = "channelz_registry_test",
srcs = ["channelz_registry_test.cc"],
language = "C++",
@@ -105,6 +122,7 @@ grpc_cc_test(
language = "C++",
deps = [
"//:grpc",
+ "//test/core/util:gpr_test_util",
],
external_deps = [
"gtest",
diff --git a/test/core/channel/channel_trace_test.cc b/test/core/channel/channel_trace_test.cc
index 64de05bc0a..bbddee3f14 100644
--- a/test/core/channel/channel_trace_test.cc
+++ b/test/core/channel/channel_trace_test.cc
@@ -25,6 +25,7 @@
#include <grpc/support/log.h>
#include "src/core/lib/channel/channel_trace.h"
+#include "src/core/lib/channel/channelz.h"
#include "src/core/lib/channel/channelz_registry.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/exec_ctx.h"
@@ -39,6 +40,7 @@
#include <string.h>
namespace grpc_core {
+namespace channelz {
namespace testing {
namespace {
@@ -69,7 +71,7 @@ void ValidateChannelTraceData(grpc_json* json,
ASSERT_NE(json, nullptr);
grpc_json* num_events_logged_json = GetJsonChild(json, "numEventsLogged");
ASSERT_NE(num_events_logged_json, nullptr);
- grpc_json* start_time = GetJsonChild(json, "creationTime");
+ grpc_json* start_time = GetJsonChild(json, "creationTimestamp");
ASSERT_NE(start_time, nullptr);
size_t num_events_logged =
(size_t)strtol(num_events_logged_json->value, nullptr, 0);
@@ -77,34 +79,47 @@ void ValidateChannelTraceData(grpc_json* json,
ValidateJsonArraySize(json, "events", actual_num_events_expected);
}
-void AddSimpleTrace(RefCountedPtr<ChannelTrace> tracer) {
+void AddSimpleTrace(ChannelTrace* tracer) {
tracer->AddTraceEvent(ChannelTrace::Severity::Info,
grpc_slice_from_static_string("simple trace"));
}
// checks for the existence of all the required members of the tracer.
-void ValidateChannelTrace(RefCountedPtr<ChannelTrace> tracer,
+void ValidateChannelTrace(ChannelTrace* tracer,
size_t expected_num_event_logged, size_t max_nodes) {
if (!max_nodes) return;
- char* json_str = tracer->RenderTrace();
+ grpc_json* json = tracer->RenderJSON();
+ EXPECT_NE(json, nullptr);
+ char* json_str = grpc_json_dump_to_string(json, 0);
+ grpc_json_destroy(json);
grpc::testing::ValidateChannelTraceProtoJsonTranslation(json_str);
- grpc_json* json = grpc_json_parse_string(json_str);
- ValidateChannelTraceData(json, expected_num_event_logged,
+ grpc_json* parsed_json = grpc_json_parse_string(json_str);
+ ValidateChannelTraceData(parsed_json, expected_num_event_logged,
GPR_MIN(expected_num_event_logged, max_nodes));
- grpc_json_destroy(json);
+ grpc_json_destroy(parsed_json);
gpr_free(json_str);
}
-void ValidateTraceDataMatchedUuidLookup(RefCountedPtr<ChannelTrace> tracer) {
- intptr_t uuid = tracer->GetUuid();
- if (uuid == -1) return; // Doesn't make sense to lookup if tracing disabled
- char* tracer_json_str = tracer->RenderTrace();
- ChannelTrace* uuid_lookup = ChannelzRegistry::Get<ChannelTrace>(uuid);
- char* uuid_lookup_json_str = uuid_lookup->RenderTrace();
- EXPECT_EQ(strcmp(tracer_json_str, uuid_lookup_json_str), 0);
- gpr_free(tracer_json_str);
- gpr_free(uuid_lookup_json_str);
-}
+class ChannelFixture {
+ public:
+ ChannelFixture(int max_trace_nodes) {
+ grpc_arg client_a;
+ client_a.type = GRPC_ARG_INTEGER;
+ client_a.key =
+ const_cast<char*>(GRPC_ARG_MAX_CHANNEL_TRACE_EVENTS_PER_NODE);
+ client_a.value.integer = max_trace_nodes;
+ grpc_channel_args client_args = {1, &client_a};
+ channel_ =
+ grpc_insecure_channel_create("fake_target", &client_args, nullptr);
+ }
+
+ ~ChannelFixture() { grpc_channel_destroy(channel_); }
+
+ grpc_channel* channel() { return channel_; }
+
+ private:
+ grpc_channel* channel_;
+};
} // anonymous namespace
@@ -114,25 +129,22 @@ class ChannelTracerTest : public ::testing::TestWithParam<size_t> {};
// lookups by uuid.
TEST_P(ChannelTracerTest, BasicTest) {
grpc_core::ExecCtx exec_ctx;
- RefCountedPtr<ChannelTrace> tracer = MakeRefCounted<ChannelTrace>(GetParam());
- AddSimpleTrace(tracer);
- AddSimpleTrace(tracer);
- ValidateTraceDataMatchedUuidLookup(tracer);
- tracer->AddTraceEvent(ChannelTrace::Severity::Info,
- grpc_slice_from_static_string("trace three"));
- tracer->AddTraceEvent(ChannelTrace::Severity::Error,
- grpc_slice_from_static_string("trace four error"));
- ValidateChannelTrace(tracer, 4, GetParam());
- AddSimpleTrace(tracer);
- AddSimpleTrace(tracer);
- ValidateChannelTrace(tracer, 6, GetParam());
- AddSimpleTrace(tracer);
- AddSimpleTrace(tracer);
- AddSimpleTrace(tracer);
- AddSimpleTrace(tracer);
- ValidateChannelTrace(tracer, 10, GetParam());
- ValidateTraceDataMatchedUuidLookup(tracer);
- tracer.reset(nullptr);
+ ChannelTrace tracer(GetParam());
+ AddSimpleTrace(&tracer);
+ AddSimpleTrace(&tracer);
+ tracer.AddTraceEvent(ChannelTrace::Severity::Info,
+ grpc_slice_from_static_string("trace three"));
+ tracer.AddTraceEvent(ChannelTrace::Severity::Error,
+ grpc_slice_from_static_string("trace four error"));
+ ValidateChannelTrace(&tracer, 4, GetParam());
+ AddSimpleTrace(&tracer);
+ AddSimpleTrace(&tracer);
+ ValidateChannelTrace(&tracer, 6, GetParam());
+ AddSimpleTrace(&tracer);
+ AddSimpleTrace(&tracer);
+ AddSimpleTrace(&tracer);
+ AddSimpleTrace(&tracer);
+ ValidateChannelTrace(&tracer, 10, GetParam());
}
// Tests more complex functionality, like a parent channel tracking
@@ -140,42 +152,43 @@ TEST_P(ChannelTracerTest, BasicTest) {
// and this function will both hold refs to the subchannel.
TEST_P(ChannelTracerTest, ComplexTest) {
grpc_core::ExecCtx exec_ctx;
- RefCountedPtr<ChannelTrace> tracer = MakeRefCounted<ChannelTrace>(GetParam());
- AddSimpleTrace(tracer);
- AddSimpleTrace(tracer);
- RefCountedPtr<ChannelTrace> sc1 = MakeRefCounted<ChannelTrace>(GetParam());
- tracer->AddTraceEventReferencingSubchannel(
+ ChannelTrace tracer(GetParam());
+ AddSimpleTrace(&tracer);
+ AddSimpleTrace(&tracer);
+ ChannelFixture channel1(GetParam());
+ RefCountedPtr<ChannelNode> sc1 =
+ MakeRefCounted<ChannelNode>(channel1.channel(), GetParam());
+ tracer.AddTraceEventReferencingSubchannel(
ChannelTrace::Severity::Info,
grpc_slice_from_static_string("subchannel one created"), sc1);
- ValidateChannelTrace(tracer, 3, GetParam());
- AddSimpleTrace(sc1);
- AddSimpleTrace(sc1);
- AddSimpleTrace(sc1);
- ValidateChannelTrace(sc1, 3, GetParam());
- AddSimpleTrace(sc1);
- AddSimpleTrace(sc1);
- AddSimpleTrace(sc1);
- ValidateChannelTrace(sc1, 6, GetParam());
- AddSimpleTrace(tracer);
- AddSimpleTrace(tracer);
- ValidateChannelTrace(tracer, 5, GetParam());
- ValidateTraceDataMatchedUuidLookup(tracer);
- RefCountedPtr<ChannelTrace> sc2 = MakeRefCounted<ChannelTrace>(GetParam());
- tracer->AddTraceEventReferencingChannel(
+ ValidateChannelTrace(&tracer, 3, GetParam());
+ AddSimpleTrace(sc1->trace());
+ AddSimpleTrace(sc1->trace());
+ AddSimpleTrace(sc1->trace());
+ ValidateChannelTrace(sc1->trace(), 3, GetParam());
+ AddSimpleTrace(sc1->trace());
+ AddSimpleTrace(sc1->trace());
+ AddSimpleTrace(sc1->trace());
+ ValidateChannelTrace(sc1->trace(), 6, GetParam());
+ AddSimpleTrace(&tracer);
+ AddSimpleTrace(&tracer);
+ ValidateChannelTrace(&tracer, 5, GetParam());
+ ChannelFixture channel2(GetParam());
+ RefCountedPtr<ChannelNode> sc2 =
+ MakeRefCounted<ChannelNode>(channel2.channel(), GetParam());
+ tracer.AddTraceEventReferencingChannel(
ChannelTrace::Severity::Info,
grpc_slice_from_static_string("LB channel two created"), sc2);
- tracer->AddTraceEventReferencingSubchannel(
+ tracer.AddTraceEventReferencingSubchannel(
ChannelTrace::Severity::Warning,
grpc_slice_from_static_string("subchannel one inactive"), sc1);
- ValidateChannelTrace(tracer, 7, GetParam());
- AddSimpleTrace(tracer);
- AddSimpleTrace(tracer);
- AddSimpleTrace(tracer);
- AddSimpleTrace(tracer);
- AddSimpleTrace(tracer);
- AddSimpleTrace(tracer);
- ValidateTraceDataMatchedUuidLookup(tracer);
- tracer.reset(nullptr);
+ ValidateChannelTrace(&tracer, 7, GetParam());
+ AddSimpleTrace(&tracer);
+ AddSimpleTrace(&tracer);
+ AddSimpleTrace(&tracer);
+ AddSimpleTrace(&tracer);
+ AddSimpleTrace(&tracer);
+ AddSimpleTrace(&tracer);
sc1.reset(nullptr);
sc2.reset(nullptr);
}
@@ -185,39 +198,44 @@ TEST_P(ChannelTracerTest, ComplexTest) {
// gets deleted.
TEST_P(ChannelTracerTest, TestNesting) {
grpc_core::ExecCtx exec_ctx;
- RefCountedPtr<ChannelTrace> tracer = MakeRefCounted<ChannelTrace>(GetParam());
- AddSimpleTrace(tracer);
- AddSimpleTrace(tracer);
- ValidateChannelTrace(tracer, 2, GetParam());
- RefCountedPtr<ChannelTrace> sc1 = MakeRefCounted<ChannelTrace>(GetParam());
- tracer->AddTraceEventReferencingChannel(
+ ChannelTrace tracer(GetParam());
+ AddSimpleTrace(&tracer);
+ AddSimpleTrace(&tracer);
+ ValidateChannelTrace(&tracer, 2, GetParam());
+ ChannelFixture channel1(GetParam());
+ RefCountedPtr<ChannelNode> sc1 =
+ MakeRefCounted<ChannelNode>(channel1.channel(), GetParam());
+ tracer.AddTraceEventReferencingChannel(
ChannelTrace::Severity::Info,
grpc_slice_from_static_string("subchannel one created"), sc1);
- ValidateChannelTrace(tracer, 3, GetParam());
- AddSimpleTrace(sc1);
- RefCountedPtr<ChannelTrace> conn1 = MakeRefCounted<ChannelTrace>(GetParam());
+ ValidateChannelTrace(&tracer, 3, GetParam());
+ AddSimpleTrace(sc1->trace());
+ ChannelFixture channel2(GetParam());
+ RefCountedPtr<ChannelNode> conn1 =
+ MakeRefCounted<ChannelNode>(channel2.channel(), GetParam());
// nesting one level deeper.
- sc1->AddTraceEventReferencingSubchannel(
+ sc1->trace()->AddTraceEventReferencingSubchannel(
ChannelTrace::Severity::Info,
grpc_slice_from_static_string("connection one created"), conn1);
- ValidateChannelTrace(tracer, 3, GetParam());
- AddSimpleTrace(conn1);
- AddSimpleTrace(tracer);
- AddSimpleTrace(tracer);
- ValidateChannelTrace(tracer, 5, GetParam());
- ValidateChannelTrace(conn1, 1, GetParam());
- RefCountedPtr<ChannelTrace> sc2 = MakeRefCounted<ChannelTrace>(GetParam());
- tracer->AddTraceEventReferencingSubchannel(
+ ValidateChannelTrace(&tracer, 3, GetParam());
+ AddSimpleTrace(conn1->trace());
+ AddSimpleTrace(&tracer);
+ AddSimpleTrace(&tracer);
+ ValidateChannelTrace(&tracer, 5, GetParam());
+ ValidateChannelTrace(conn1->trace(), 1, GetParam());
+ ChannelFixture channel3(GetParam());
+ RefCountedPtr<ChannelNode> sc2 =
+ MakeRefCounted<ChannelNode>(channel3.channel(), GetParam());
+ tracer.AddTraceEventReferencingSubchannel(
ChannelTrace::Severity::Info,
grpc_slice_from_static_string("subchannel two created"), sc2);
// this trace should not get added to the parents children since it is already
// present in the tracer.
- tracer->AddTraceEventReferencingChannel(
+ tracer.AddTraceEventReferencingChannel(
ChannelTrace::Severity::Warning,
grpc_slice_from_static_string("subchannel one inactive"), sc1);
- AddSimpleTrace(tracer);
- ValidateChannelTrace(tracer, 8, GetParam());
- tracer.reset(nullptr);
+ AddSimpleTrace(&tracer);
+ ValidateChannelTrace(&tracer, 8, GetParam());
sc1.reset(nullptr);
sc2.reset(nullptr);
conn1.reset(nullptr);
@@ -227,6 +245,7 @@ INSTANTIATE_TEST_CASE_P(ChannelTracerTestSweep, ChannelTracerTest,
::testing::Values(0, 1, 2, 6, 10, 15));
} // namespace testing
+} // namespace channelz
} // namespace grpc_core
int main(int argc, char** argv) {
diff --git a/test/core/channel/channelz_registry_test.cc b/test/core/channel/channelz_registry_test.cc
index 37696dc0e8..eb6305eb4e 100644
--- a/test/core/channel/channelz_registry_test.cc
+++ b/test/core/channel/channelz_registry_test.cc
@@ -54,6 +54,7 @@ TEST(ChannelzRegistryTest, UuidStartsAboveZeroTest) {
TEST(ChannelzRegistryTest, UuidsAreIncreasing) {
int object_to_register;
std::vector<intptr_t> uuids;
+ uuids.reserve(10);
for (int i = 0; i < 10; ++i) {
// reregister the same object. It's ok since we are just testing uuids
uuids.push_back(ChannelzRegistry::Register(&object_to_register));
diff --git a/test/core/channel/channelz_test.cc b/test/core/channel/channelz_test.cc
new file mode 100644
index 0000000000..058eea914c
--- /dev/null
+++ b/test/core/channel/channelz_test.cc
@@ -0,0 +1,216 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <gtest/gtest.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/channel/channel_trace.h"
+#include "src/core/lib/channel/channelz.h"
+#include "src/core/lib/channel/channelz_registry.h"
+#include "src/core/lib/gpr/useful.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/json/json.h"
+#include "src/core/lib/surface/channel.h"
+
+#include "test/core/util/test_config.h"
+#include "test/cpp/util/channel_trace_proto_helper.h"
+
+#include <grpc/support/string_util.h>
+#include <stdlib.h>
+#include <string.h>
+
+namespace grpc_core {
+namespace channelz {
+namespace testing {
+
+// testing peer to access channel internals
+class ChannelNodePeer {
+ public:
+ ChannelNodePeer(ChannelNode* channel) : channel_(channel) {}
+ grpc_millis last_call_started_millis() {
+ return (grpc_millis)gpr_atm_no_barrier_load(
+ &channel_->last_call_started_millis_);
+ }
+
+ private:
+ ChannelNode* channel_;
+};
+
+namespace {
+
+grpc_json* GetJsonChild(grpc_json* parent, const char* key) {
+ EXPECT_NE(parent, nullptr);
+ for (grpc_json* child = parent->child; child != nullptr;
+ child = child->next) {
+ if (child->key != nullptr && strcmp(child->key, key) == 0) return child;
+ }
+ return nullptr;
+}
+
+class ChannelFixture {
+ public:
+ ChannelFixture(int max_trace_nodes) {
+ grpc_arg client_a[2];
+ client_a[0].type = GRPC_ARG_INTEGER;
+ client_a[0].key =
+ const_cast<char*>(GRPC_ARG_MAX_CHANNEL_TRACE_EVENTS_PER_NODE);
+ client_a[0].value.integer = max_trace_nodes;
+ client_a[1].type = GRPC_ARG_INTEGER;
+ client_a[1].key = const_cast<char*>(GRPC_ARG_ENABLE_CHANNELZ);
+ client_a[1].value.integer = true;
+ grpc_channel_args client_args = {GPR_ARRAY_SIZE(client_a), client_a};
+ channel_ =
+ grpc_insecure_channel_create("fake_target", &client_args, nullptr);
+ }
+
+ ~ChannelFixture() { grpc_channel_destroy(channel_); }
+
+ grpc_channel* channel() { return channel_; }
+
+ private:
+ grpc_channel* channel_;
+};
+
+struct validate_channel_data_args {
+ int64_t calls_started;
+ int64_t calls_failed;
+ int64_t calls_succeeded;
+};
+
+void ValidateChildInteger(grpc_json* json, int64_t expect, const char* key) {
+ grpc_json* gotten_json = GetJsonChild(json, key);
+ ASSERT_NE(gotten_json, nullptr);
+ int64_t gotten_number = (int64_t)strtol(gotten_json->value, nullptr, 0);
+ EXPECT_EQ(gotten_number, expect);
+}
+
+void ValidateCounters(char* json_str, validate_channel_data_args args) {
+ grpc_json* json = grpc_json_parse_string(json_str);
+ ASSERT_NE(json, nullptr);
+ grpc_json* data = GetJsonChild(json, "data");
+ ValidateChildInteger(data, args.calls_started, "callsStarted");
+ ValidateChildInteger(data, args.calls_failed, "callsFailed");
+ ValidateChildInteger(data, args.calls_succeeded, "callsSucceeded");
+ grpc_json_destroy(json);
+}
+
+void ValidateChannel(ChannelNode* channel, validate_channel_data_args args) {
+ char* json_str = channel->RenderJSON();
+ grpc::testing::ValidateChannelProtoJsonTranslation(json_str);
+ ValidateCounters(json_str, args);
+ gpr_free(json_str);
+}
+
+grpc_millis GetLastCallStartedMillis(ChannelNode* channel) {
+ ChannelNodePeer peer(channel);
+ return peer.last_call_started_millis();
+}
+
+void ChannelzSleep(int64_t sleep_us) {
+ gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
+ gpr_time_from_micros(sleep_us, GPR_TIMESPAN)));
+ grpc_core::ExecCtx::Get()->InvalidateNow();
+}
+
+} // anonymous namespace
+
+class ChannelzChannelTest : public ::testing::TestWithParam<size_t> {};
+
+TEST_P(ChannelzChannelTest, BasicChannel) {
+ grpc_core::ExecCtx exec_ctx;
+ ChannelFixture channel(GetParam());
+ ChannelNode* channelz_channel =
+ grpc_channel_get_channelz_node(channel.channel());
+ char* json_str = channelz_channel->RenderJSON();
+ ValidateCounters(json_str, {0, 0, 0});
+ gpr_free(json_str);
+}
+
+TEST(ChannelzChannelTest, ChannelzDisabled) {
+ grpc_core::ExecCtx exec_ctx;
+ grpc_channel* channel =
+ grpc_insecure_channel_create("fake_target", nullptr, nullptr);
+ ChannelNode* channelz_channel = grpc_channel_get_channelz_node(channel);
+ ASSERT_EQ(channelz_channel, nullptr);
+ grpc_channel_destroy(channel);
+}
+
+TEST_P(ChannelzChannelTest, BasicChannelAPIFunctionality) {
+ grpc_core::ExecCtx exec_ctx;
+ ChannelFixture channel(GetParam());
+ ChannelNode* channelz_channel =
+ grpc_channel_get_channelz_node(channel.channel());
+ channelz_channel->RecordCallStarted();
+ channelz_channel->RecordCallFailed();
+ channelz_channel->RecordCallSucceeded();
+ ValidateChannel(channelz_channel, {1, 1, 1});
+ channelz_channel->RecordCallStarted();
+ channelz_channel->RecordCallFailed();
+ channelz_channel->RecordCallSucceeded();
+ channelz_channel->RecordCallStarted();
+ channelz_channel->RecordCallFailed();
+ channelz_channel->RecordCallSucceeded();
+ ValidateChannel(channelz_channel, {3, 3, 3});
+}
+
+TEST_P(ChannelzChannelTest, LastCallStartedMillis) {
+ grpc_core::ExecCtx exec_ctx;
+ ChannelFixture channel(GetParam());
+ ChannelNode* channelz_channel =
+ grpc_channel_get_channelz_node(channel.channel());
+ // start a call to set the last call started timestamp
+ channelz_channel->RecordCallStarted();
+ grpc_millis millis1 = GetLastCallStartedMillis(channelz_channel);
+ // time gone by should not affect the timestamp
+ ChannelzSleep(100);
+ grpc_millis millis2 = GetLastCallStartedMillis(channelz_channel);
+ EXPECT_EQ(millis1, millis2);
+ // calls succeeded or failed should not affect the timestamp
+ ChannelzSleep(100);
+ channelz_channel->RecordCallFailed();
+ channelz_channel->RecordCallSucceeded();
+ grpc_millis millis3 = GetLastCallStartedMillis(channelz_channel);
+ EXPECT_EQ(millis1, millis3);
+ // another call started should affect the timestamp
+ // sleep for extra long to avoid flakes (since we cache Now())
+ ChannelzSleep(5000);
+ channelz_channel->RecordCallStarted();
+ grpc_millis millis4 = GetLastCallStartedMillis(channelz_channel);
+ EXPECT_NE(millis1, millis4);
+}
+
+INSTANTIATE_TEST_CASE_P(ChannelzChannelTestSweep, ChannelzChannelTest,
+ ::testing::Values(0, 1, 2, 6, 10, 15));
+
+} // namespace testing
+} // namespace channelz
+} // namespace grpc_core
+
+int main(int argc, char** argv) {
+ grpc_test_init(argc, argv);
+ grpc_init();
+ ::testing::InitGoogleTest(&argc, argv);
+ int ret = RUN_ALL_TESTS();
+ grpc_shutdown();
+ return ret;
+}
diff --git a/test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc b/test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc
index e34aa2e676..1c8d0775ab 100644
--- a/test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc
+++ b/test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc
@@ -60,11 +60,11 @@ static void my_resolve_address(const char* addr, const char* default_port,
static grpc_address_resolver_vtable test_resolver = {my_resolve_address,
nullptr};
-static grpc_ares_request* my_dns_lookup_ares(
+static grpc_ares_request* my_dns_lookup_ares_locked(
const char* dns_server, const char* addr, const char* default_port,
grpc_pollset_set* interested_parties, grpc_closure* on_done,
- grpc_lb_addresses** lb_addrs, bool check_grpclb,
- char** service_config_json) {
+ grpc_lb_addresses** lb_addrs, bool check_grpclb, char** service_config_json,
+ grpc_combiner* combiner) {
gpr_mu_lock(&g_mu);
GPR_ASSERT(0 == strcmp("test", addr));
grpc_error* error = GRPC_ERROR_NONE;
@@ -147,7 +147,7 @@ int main(int argc, char** argv) {
gpr_mu_init(&g_mu);
g_combiner = grpc_combiner_create();
grpc_set_resolver_impl(&test_resolver);
- grpc_dns_lookup_ares = my_dns_lookup_ares;
+ grpc_dns_lookup_ares_locked = my_dns_lookup_ares_locked;
grpc_channel_args* result = (grpc_channel_args*)1;
{
diff --git a/test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc b/test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc
index 521fc3107e..b1f3a1c08a 100644
--- a/test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc
+++ b/test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc
@@ -33,10 +33,11 @@ static grpc_address_resolver_vtable* default_resolve_address;
static grpc_combiner* g_combiner;
-grpc_ares_request* (*g_default_dns_lookup_ares)(
+grpc_ares_request* (*g_default_dns_lookup_ares_locked)(
const char* dns_server, const char* name, const char* default_port,
grpc_pollset_set* interested_parties, grpc_closure* on_done,
- grpc_lb_addresses** addrs, bool check_grpclb, char** service_config_json);
+ grpc_lb_addresses** addrs, bool check_grpclb, char** service_config_json,
+ grpc_combiner* combiner);
// Counter incremented by test_resolve_address_impl indicating the number of
// times a system-level resolution has happened.
@@ -72,13 +73,14 @@ static grpc_error* test_blocking_resolve_address_impl(
static grpc_address_resolver_vtable test_resolver = {
test_resolve_address_impl, test_blocking_resolve_address_impl};
-grpc_ares_request* test_dns_lookup_ares(
+grpc_ares_request* test_dns_lookup_ares_locked(
const char* dns_server, const char* name, const char* default_port,
grpc_pollset_set* interested_parties, grpc_closure* on_done,
- grpc_lb_addresses** addrs, bool check_grpclb, char** service_config_json) {
- grpc_ares_request* result = g_default_dns_lookup_ares(
+ grpc_lb_addresses** addrs, bool check_grpclb, char** service_config_json,
+ grpc_combiner* combiner) {
+ grpc_ares_request* result = g_default_dns_lookup_ares_locked(
dns_server, name, default_port, g_iomgr_args.pollset_set, on_done, addrs,
- check_grpclb, service_config_json);
+ check_grpclb, service_config_json, combiner);
++g_resolution_count;
return result;
}
@@ -308,8 +310,8 @@ int main(int argc, char** argv) {
g_combiner = grpc_combiner_create();
- g_default_dns_lookup_ares = grpc_dns_lookup_ares;
- grpc_dns_lookup_ares = test_dns_lookup_ares;
+ g_default_dns_lookup_ares_locked = grpc_dns_lookup_ares_locked;
+ grpc_dns_lookup_ares_locked = test_dns_lookup_ares_locked;
default_resolve_address = grpc_resolve_address_impl;
grpc_set_resolver_impl(&test_resolver);
diff --git a/test/core/end2end/end2end_nosec_tests.cc b/test/core/end2end/end2end_nosec_tests.cc
index 59eb643a93..c6a4005fb3 100644
--- a/test/core/end2end/end2end_nosec_tests.cc
+++ b/test/core/end2end/end2end_nosec_tests.cc
@@ -54,6 +54,8 @@ extern void cancel_in_a_vacuum(grpc_end2end_test_config config);
extern void cancel_in_a_vacuum_pre_init(void);
extern void cancel_with_status(grpc_end2end_test_config config);
extern void cancel_with_status_pre_init(void);
+extern void channelz(grpc_end2end_test_config config);
+extern void channelz_pre_init(void);
extern void compressed_payload(grpc_end2end_test_config config);
extern void compressed_payload_pre_init(void);
extern void connectivity(grpc_end2end_test_config config);
@@ -86,8 +88,6 @@ extern void keepalive_timeout(grpc_end2end_test_config config);
extern void keepalive_timeout_pre_init(void);
extern void large_metadata(grpc_end2end_test_config config);
extern void large_metadata_pre_init(void);
-extern void load_reporting_hook(grpc_end2end_test_config config);
-extern void load_reporting_hook_pre_init(void);
extern void max_concurrent_streams(grpc_end2end_test_config config);
extern void max_concurrent_streams_pre_init(void);
extern void max_connection_age(grpc_end2end_test_config config);
@@ -100,6 +100,8 @@ extern void negative_deadline(grpc_end2end_test_config config);
extern void negative_deadline_pre_init(void);
extern void network_status_change(grpc_end2end_test_config config);
extern void network_status_change_pre_init(void);
+extern void no_error_on_hotpath(grpc_end2end_test_config config);
+extern void no_error_on_hotpath_pre_init(void);
extern void no_logging(grpc_end2end_test_config config);
extern void no_logging_pre_init(void);
extern void no_op(grpc_end2end_test_config config);
@@ -199,6 +201,7 @@ void grpc_end2end_tests_pre_init(void) {
cancel_before_invoke_pre_init();
cancel_in_a_vacuum_pre_init();
cancel_with_status_pre_init();
+ channelz_pre_init();
compressed_payload_pre_init();
connectivity_pre_init();
default_host_pre_init();
@@ -215,13 +218,13 @@ void grpc_end2end_tests_pre_init(void) {
invoke_large_request_pre_init();
keepalive_timeout_pre_init();
large_metadata_pre_init();
- load_reporting_hook_pre_init();
max_concurrent_streams_pre_init();
max_connection_age_pre_init();
max_connection_idle_pre_init();
max_message_length_pre_init();
negative_deadline_pre_init();
network_status_change_pre_init();
+ no_error_on_hotpath_pre_init();
no_logging_pre_init();
no_op_pre_init();
payload_pre_init();
@@ -284,6 +287,7 @@ void grpc_end2end_tests(int argc, char **argv,
cancel_before_invoke(config);
cancel_in_a_vacuum(config);
cancel_with_status(config);
+ channelz(config);
compressed_payload(config);
connectivity(config);
default_host(config);
@@ -300,13 +304,13 @@ void grpc_end2end_tests(int argc, char **argv,
invoke_large_request(config);
keepalive_timeout(config);
large_metadata(config);
- load_reporting_hook(config);
max_concurrent_streams(config);
max_connection_age(config);
max_connection_idle(config);
max_message_length(config);
negative_deadline(config);
network_status_change(config);
+ no_error_on_hotpath(config);
no_logging(config);
no_op(config);
payload(config);
@@ -400,6 +404,10 @@ void grpc_end2end_tests(int argc, char **argv,
cancel_with_status(config);
continue;
}
+ if (0 == strcmp("channelz", argv[i])) {
+ channelz(config);
+ continue;
+ }
if (0 == strcmp("compressed_payload", argv[i])) {
compressed_payload(config);
continue;
@@ -464,10 +472,6 @@ void grpc_end2end_tests(int argc, char **argv,
large_metadata(config);
continue;
}
- if (0 == strcmp("load_reporting_hook", argv[i])) {
- load_reporting_hook(config);
- continue;
- }
if (0 == strcmp("max_concurrent_streams", argv[i])) {
max_concurrent_streams(config);
continue;
@@ -492,6 +496,10 @@ void grpc_end2end_tests(int argc, char **argv,
network_status_change(config);
continue;
}
+ if (0 == strcmp("no_error_on_hotpath", argv[i])) {
+ no_error_on_hotpath(config);
+ continue;
+ }
if (0 == strcmp("no_logging", argv[i])) {
no_logging(config);
continue;
diff --git a/test/core/end2end/end2end_tests.cc b/test/core/end2end/end2end_tests.cc
index 9f164b4ead..7748a39cb5 100644
--- a/test/core/end2end/end2end_tests.cc
+++ b/test/core/end2end/end2end_tests.cc
@@ -56,6 +56,8 @@ extern void cancel_in_a_vacuum(grpc_end2end_test_config config);
extern void cancel_in_a_vacuum_pre_init(void);
extern void cancel_with_status(grpc_end2end_test_config config);
extern void cancel_with_status_pre_init(void);
+extern void channelz(grpc_end2end_test_config config);
+extern void channelz_pre_init(void);
extern void compressed_payload(grpc_end2end_test_config config);
extern void compressed_payload_pre_init(void);
extern void connectivity(grpc_end2end_test_config config);
@@ -88,8 +90,6 @@ extern void keepalive_timeout(grpc_end2end_test_config config);
extern void keepalive_timeout_pre_init(void);
extern void large_metadata(grpc_end2end_test_config config);
extern void large_metadata_pre_init(void);
-extern void load_reporting_hook(grpc_end2end_test_config config);
-extern void load_reporting_hook_pre_init(void);
extern void max_concurrent_streams(grpc_end2end_test_config config);
extern void max_concurrent_streams_pre_init(void);
extern void max_connection_age(grpc_end2end_test_config config);
@@ -102,6 +102,8 @@ extern void negative_deadline(grpc_end2end_test_config config);
extern void negative_deadline_pre_init(void);
extern void network_status_change(grpc_end2end_test_config config);
extern void network_status_change_pre_init(void);
+extern void no_error_on_hotpath(grpc_end2end_test_config config);
+extern void no_error_on_hotpath_pre_init(void);
extern void no_logging(grpc_end2end_test_config config);
extern void no_logging_pre_init(void);
extern void no_op(grpc_end2end_test_config config);
@@ -202,6 +204,7 @@ void grpc_end2end_tests_pre_init(void) {
cancel_before_invoke_pre_init();
cancel_in_a_vacuum_pre_init();
cancel_with_status_pre_init();
+ channelz_pre_init();
compressed_payload_pre_init();
connectivity_pre_init();
default_host_pre_init();
@@ -218,13 +221,13 @@ void grpc_end2end_tests_pre_init(void) {
invoke_large_request_pre_init();
keepalive_timeout_pre_init();
large_metadata_pre_init();
- load_reporting_hook_pre_init();
max_concurrent_streams_pre_init();
max_connection_age_pre_init();
max_connection_idle_pre_init();
max_message_length_pre_init();
negative_deadline_pre_init();
network_status_change_pre_init();
+ no_error_on_hotpath_pre_init();
no_logging_pre_init();
no_op_pre_init();
payload_pre_init();
@@ -288,6 +291,7 @@ void grpc_end2end_tests(int argc, char **argv,
cancel_before_invoke(config);
cancel_in_a_vacuum(config);
cancel_with_status(config);
+ channelz(config);
compressed_payload(config);
connectivity(config);
default_host(config);
@@ -304,13 +308,13 @@ void grpc_end2end_tests(int argc, char **argv,
invoke_large_request(config);
keepalive_timeout(config);
large_metadata(config);
- load_reporting_hook(config);
max_concurrent_streams(config);
max_connection_age(config);
max_connection_idle(config);
max_message_length(config);
negative_deadline(config);
network_status_change(config);
+ no_error_on_hotpath(config);
no_logging(config);
no_op(config);
payload(config);
@@ -408,6 +412,10 @@ void grpc_end2end_tests(int argc, char **argv,
cancel_with_status(config);
continue;
}
+ if (0 == strcmp("channelz", argv[i])) {
+ channelz(config);
+ continue;
+ }
if (0 == strcmp("compressed_payload", argv[i])) {
compressed_payload(config);
continue;
@@ -472,10 +480,6 @@ void grpc_end2end_tests(int argc, char **argv,
large_metadata(config);
continue;
}
- if (0 == strcmp("load_reporting_hook", argv[i])) {
- load_reporting_hook(config);
- continue;
- }
if (0 == strcmp("max_concurrent_streams", argv[i])) {
max_concurrent_streams(config);
continue;
@@ -500,6 +504,10 @@ void grpc_end2end_tests(int argc, char **argv,
network_status_change(config);
continue;
}
+ if (0 == strcmp("no_error_on_hotpath", argv[i])) {
+ no_error_on_hotpath(config);
+ continue;
+ }
if (0 == strcmp("no_logging", argv[i])) {
no_logging(config);
continue;
diff --git a/test/core/end2end/fixtures/h2_load_reporting.cc b/test/core/end2end/fixtures/h2_load_reporting.cc
deleted file mode 100644
index 18ea10a8d2..0000000000
--- a/test/core/end2end/fixtures/h2_load_reporting.cc
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-
-#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/server_load_reporting_plugin.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/gpr/host_port.h"
-#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/server.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-typedef struct load_reporting_fixture_data {
- char* localaddr;
-} load_reporting_fixture_data;
-
-static grpc_end2end_test_fixture chttp2_create_fixture_load_reporting(
- grpc_channel_args* client_args, grpc_channel_args* server_args) {
- grpc_end2end_test_fixture f;
- int port = grpc_pick_unused_port_or_die();
- load_reporting_fixture_data* ffd = static_cast<load_reporting_fixture_data*>(
- gpr_malloc(sizeof(load_reporting_fixture_data)));
- memset(&f, 0, sizeof(f));
-
- gpr_join_host_port(&ffd->localaddr, "localhost", port);
-
- f.fixture_data = ffd;
- f.cq = grpc_completion_queue_create_for_next(nullptr);
- f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
-
- return f;
-}
-
-void chttp2_init_client_load_reporting(grpc_end2end_test_fixture* f,
- grpc_channel_args* client_args) {
- load_reporting_fixture_data* ffd =
- static_cast<load_reporting_fixture_data*>(f->fixture_data);
- f->client =
- grpc_insecure_channel_create(ffd->localaddr, client_args, nullptr);
- GPR_ASSERT(f->client);
-}
-
-void chttp2_init_server_load_reporting(grpc_end2end_test_fixture* f,
- grpc_channel_args* server_args) {
- load_reporting_fixture_data* ffd =
- static_cast<load_reporting_fixture_data*>(f->fixture_data);
- grpc_arg arg = grpc_load_reporting_enable_arg();
- if (f->server) {
- grpc_server_destroy(f->server);
- }
- server_args = grpc_channel_args_copy_and_add(server_args, &arg, 1);
- f->server = grpc_server_create(server_args, nullptr);
- {
- grpc_core::ExecCtx exec_ctx;
- grpc_channel_args_destroy(server_args);
- }
- grpc_server_register_completion_queue(f->server, f->cq, nullptr);
- GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
- grpc_server_start(f->server);
-}
-
-void chttp2_tear_down_load_reporting(grpc_end2end_test_fixture* f) {
- load_reporting_fixture_data* ffd =
- static_cast<load_reporting_fixture_data*>(f->fixture_data);
- gpr_free(ffd->localaddr);
- gpr_free(ffd);
-}
-
-/* All test configurations */
-static grpc_end2end_test_config configs[] = {
- {"chttp2/fullstack+load_reporting",
- FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
- FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
- FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
- nullptr, chttp2_create_fixture_load_reporting,
- chttp2_init_client_load_reporting, chttp2_init_server_load_reporting,
- chttp2_tear_down_load_reporting},
-};
-
-int main(int argc, char** argv) {
- size_t i;
-
- grpc_test_init(argc, argv);
- grpc_end2end_tests_pre_init();
- grpc_init();
-
- for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
- grpc_end2end_tests(argc, argv, configs[i]);
- }
-
- grpc_shutdown();
-
- return 0;
-}
diff --git a/test/core/end2end/fixtures/h2_oauth2.cc b/test/core/end2end/fixtures/h2_oauth2.cc
index d44aafd50a..37397d6450 100644
--- a/test/core/end2end/fixtures/h2_oauth2.cc
+++ b/test/core/end2end/fixtures/h2_oauth2.cc
@@ -146,7 +146,7 @@ static void chttp2_init_client_simple_ssl_with_oauth2_secure_fullstack(
grpc_end2end_test_fixture* f, grpc_channel_args* client_args) {
grpc_core::ExecCtx exec_ctx;
grpc_channel_credentials* ssl_creds =
- grpc_ssl_credentials_create(test_root_cert, nullptr, nullptr);
+ grpc_ssl_credentials_create(test_root_cert, nullptr, nullptr, nullptr);
grpc_call_credentials* oauth2_creds = grpc_md_only_test_credentials_create(
"authorization", oauth2_md, true /* is_async */);
grpc_channel_credentials* ssl_oauth2_creds =
diff --git a/test/core/end2end/fixtures/h2_ssl.cc b/test/core/end2end/fixtures/h2_ssl.cc
index 999cd4cdfb..4d6c815716 100644
--- a/test/core/end2end/fixtures/h2_ssl.cc
+++ b/test/core/end2end/fixtures/h2_ssl.cc
@@ -101,7 +101,7 @@ void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture* f) {
static void chttp2_init_client_simple_ssl_secure_fullstack(
grpc_end2end_test_fixture* f, grpc_channel_args* client_args) {
grpc_channel_credentials* ssl_creds =
- grpc_ssl_credentials_create(nullptr, nullptr, nullptr);
+ grpc_ssl_credentials_create(nullptr, nullptr, nullptr, nullptr);
grpc_arg ssl_name_override = {
GRPC_ARG_STRING,
const_cast<char*>(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG),
diff --git a/test/core/end2end/fixtures/h2_ssl_proxy.cc b/test/core/end2end/fixtures/h2_ssl_proxy.cc
index 9ab50c6217..09cbf974b6 100644
--- a/test/core/end2end/fixtures/h2_ssl_proxy.cc
+++ b/test/core/end2end/fixtures/h2_ssl_proxy.cc
@@ -55,7 +55,7 @@ static grpc_channel* create_proxy_client(const char* target,
grpc_channel_args* client_args) {
grpc_channel* channel;
grpc_channel_credentials* ssl_creds =
- grpc_ssl_credentials_create(nullptr, nullptr, nullptr);
+ grpc_ssl_credentials_create(nullptr, nullptr, nullptr, nullptr);
grpc_arg ssl_name_override = {
GRPC_ARG_STRING,
const_cast<char*>(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG),
@@ -138,7 +138,7 @@ void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture* f) {
static void chttp2_init_client_simple_ssl_secure_fullstack(
grpc_end2end_test_fixture* f, grpc_channel_args* client_args) {
grpc_channel_credentials* ssl_creds =
- grpc_ssl_credentials_create(nullptr, nullptr, nullptr);
+ grpc_ssl_credentials_create(nullptr, nullptr, nullptr, nullptr);
grpc_arg ssl_name_override = {
GRPC_ARG_STRING,
const_cast<char*>(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG),
diff --git a/test/core/end2end/fuzzers/api_fuzzer.cc b/test/core/end2end/fuzzers/api_fuzzer.cc
index 36f257d6da..eacfd4a8c3 100644
--- a/test/core/end2end/fuzzers/api_fuzzer.cc
+++ b/test/core/end2end/fuzzers/api_fuzzer.cc
@@ -222,7 +222,7 @@ static grpc_channel_credentials* read_ssl_channel_creds(input_stream* inp) {
grpc_channel_credentials* creds = grpc_ssl_credentials_create(
root_certs,
private_key != nullptr && certs != nullptr ? &key_cert_pair : nullptr,
- nullptr);
+ nullptr, nullptr);
cred_artifact_ctx_finish(&ctx);
return creds;
}
@@ -374,13 +374,11 @@ void my_resolve_address(const char* addr, const char* default_port,
static grpc_address_resolver_vtable fuzzer_resolver = {my_resolve_address,
nullptr};
-grpc_ares_request* my_dns_lookup_ares(const char* dns_server, const char* addr,
- const char* default_port,
- grpc_pollset_set* interested_parties,
- grpc_closure* on_done,
- grpc_lb_addresses** lb_addrs,
- bool check_grpclb,
- char** service_config_json) {
+grpc_ares_request* my_dns_lookup_ares_locked(
+ const char* dns_server, const char* addr, const char* default_port,
+ grpc_pollset_set* interested_parties, grpc_closure* on_done,
+ grpc_lb_addresses** lb_addrs, bool check_grpclb, char** service_config_json,
+ grpc_combiner* combiner) {
addr_req* r = static_cast<addr_req*>(gpr_malloc(sizeof(*r)));
r->addr = gpr_strdup(addr);
r->on_done = on_done;
@@ -706,7 +704,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
grpc_executor_set_threading(false);
}
grpc_set_resolver_impl(&fuzzer_resolver);
- grpc_dns_lookup_ares = my_dns_lookup_ares;
+ grpc_dns_lookup_ares_locked = my_dns_lookup_ares_locked;
GPR_ASSERT(g_channel == nullptr);
GPR_ASSERT(g_server == nullptr);
@@ -1048,6 +1046,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
op->reserved = nullptr;
op->flags = grpc_fuzzer_get_next_uint32(&inp);
}
+ if (g_channel == nullptr) ok = false;
if (ok) {
validator* v = make_finished_batch_validator(g_active_call, has_ops);
g_active_call->pending_ops++;
diff --git a/test/core/end2end/gen_build_yaml.py b/test/core/end2end/gen_build_yaml.py
index c355fc24b5..d5c23262e3 100755
--- a/test/core/end2end/gen_build_yaml.py
+++ b/test/core/end2end/gen_build_yaml.py
@@ -47,7 +47,9 @@ inproc_fixture_options = default_unsecure_fixture_options._replace(
END2END_FIXTURES = {
'h2_compress': default_unsecure_fixture_options._replace(enables_compression=True),
'h2_census': default_unsecure_fixture_options,
- 'h2_load_reporting': default_unsecure_fixture_options,
+ # This cmake target is disabled for now because it depends on OpenCensus,
+ # which is Bazel-only.
+ # 'h2_load_reporting': default_unsecure_fixture_options,
'h2_fakesec': default_secure_fixture_options._replace(ci_mac=False),
'h2_fd': fd_unsecure_fixture_options,
'h2_full': default_unsecure_fixture_options,
@@ -106,6 +108,7 @@ END2END_TESTS = {
needs_compression=True),
'connectivity': connectivity_test_options._replace(needs_names=True,
proxyable=False, cpu_cost=LOWCPU, exclude_iomgrs=['uv']),
+ 'channelz': default_test_options,
'default_host': default_test_options._replace(
needs_fullstack=True, needs_dns=True, needs_names=True),
'call_host_override': default_test_options._replace(
@@ -138,10 +141,13 @@ END2END_TESTS = {
'max_message_length': default_test_options._replace(cpu_cost=LOWCPU),
'negative_deadline': default_test_options,
'network_status_change': default_test_options._replace(cpu_cost=LOWCPU),
+ 'no_error_on_hotpath': default_test_options._replace(proxyable=False),
'no_logging': default_test_options._replace(traceable=False),
'no_op': default_test_options,
'payload': default_test_options,
- 'load_reporting_hook': default_test_options,
+ # This cmake target is disabled for now because it depends on OpenCensus,
+ # which is Bazel-only.
+ # '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),
diff --git a/test/core/end2end/generate_tests.bzl b/test/core/end2end/generate_tests.bzl
index 11fc576165..39b11d08ad 100755
--- a/test/core/end2end/generate_tests.bzl
+++ b/test/core/end2end/generate_tests.bzl
@@ -45,7 +45,9 @@ def fixture_options(fullstack=True, includes_proxy=False, dns_resolver=True,
END2END_FIXTURES = {
'h2_compress': fixture_options(),
'h2_census': fixture_options(),
- 'h2_load_reporting': fixture_options(),
+ # TODO(juanlishen): This is disabled for now, but should be considered to re-enable once we have
+ # decided how the load reporting service should be enabled.
+ #'h2_load_reporting': fixture_options(),
'h2_fakesec': fixture_options(),
'h2_fd': fixture_options(dns_resolver=False, fullstack=False,
client_channel=False,
@@ -113,6 +115,7 @@ END2END_TESTS = {
'compressed_payload': test_options(proxyable=False, exclude_inproc=True),
'connectivity': test_options(needs_fullstack=True, needs_names=True,
proxyable=False),
+ 'channelz': test_options(),
'default_host': test_options(needs_fullstack=True, needs_dns=True,
needs_names=True),
'disappearing_server': test_options(needs_fullstack=True,needs_names=True),
@@ -134,10 +137,14 @@ END2END_TESTS = {
'max_message_length': test_options(),
'negative_deadline': test_options(),
'network_status_change': test_options(),
+ 'no_error_on_hotpath': test_options(proxyable=False),
'no_logging': test_options(traceable=False),
'no_op': test_options(),
'payload': test_options(),
- 'load_reporting_hook': test_options(),
+ # TODO(juanlishen): This is disabled for now because it depends on some generated functions in
+ # end2end_tests.cc, which are not generated because they would depend on OpenCensus while
+ # OpenCensus can only be built via Bazel so far.
+ # 'load_reporting_hook': test_options(),
'ping_pong_streaming': test_options(),
'ping': test_options(needs_fullstack=True, proxyable=False),
'proxy_auth': test_options(needs_proxy_auth=True),
diff --git a/test/core/end2end/goaway_server_test.cc b/test/core/end2end/goaway_server_test.cc
index 0188698f17..8904c3d325 100644
--- a/test/core/end2end/goaway_server_test.cc
+++ b/test/core/end2end/goaway_server_test.cc
@@ -44,11 +44,11 @@ static void* tag(intptr_t i) { return (void*)i; }
static gpr_mu g_mu;
static int g_resolve_port = -1;
-static grpc_ares_request* (*iomgr_dns_lookup_ares)(
+static grpc_ares_request* (*iomgr_dns_lookup_ares_locked)(
const char* dns_server, const char* addr, const char* default_port,
grpc_pollset_set* interested_parties, grpc_closure* on_done,
grpc_lb_addresses** addresses, bool check_grpclb,
- char** service_config_json);
+ char** service_config_json, grpc_combiner* combiner);
static void set_resolve_port(int port) {
gpr_mu_lock(&g_mu);
@@ -98,15 +98,15 @@ static grpc_error* my_blocking_resolve_address(
static grpc_address_resolver_vtable test_resolver = {
my_resolve_address, my_blocking_resolve_address};
-static grpc_ares_request* my_dns_lookup_ares(
+static grpc_ares_request* my_dns_lookup_ares_locked(
const char* dns_server, const char* addr, const char* default_port,
grpc_pollset_set* interested_parties, grpc_closure* on_done,
- grpc_lb_addresses** lb_addrs, bool check_grpclb,
- char** service_config_json) {
+ grpc_lb_addresses** lb_addrs, bool check_grpclb, char** service_config_json,
+ grpc_combiner* combiner) {
if (0 != strcmp(addr, "test")) {
- return iomgr_dns_lookup_ares(dns_server, addr, default_port,
- interested_parties, on_done, lb_addrs,
- check_grpclb, service_config_json);
+ return iomgr_dns_lookup_ares_locked(
+ dns_server, addr, default_port, interested_parties, on_done, lb_addrs,
+ check_grpclb, service_config_json, combiner);
}
grpc_error* error = GRPC_ERROR_NONE;
@@ -142,8 +142,8 @@ int main(int argc, char** argv) {
grpc_init();
default_resolver = grpc_resolve_address_impl;
grpc_set_resolver_impl(&test_resolver);
- iomgr_dns_lookup_ares = grpc_dns_lookup_ares;
- grpc_dns_lookup_ares = my_dns_lookup_ares;
+ iomgr_dns_lookup_ares_locked = grpc_dns_lookup_ares_locked;
+ grpc_dns_lookup_ares_locked = my_dns_lookup_ares_locked;
int was_cancelled1;
int was_cancelled2;
diff --git a/test/core/end2end/h2_ssl_cert_test.cc b/test/core/end2end/h2_ssl_cert_test.cc
index 9ed6f23798..2c5ee3b156 100644
--- a/test/core/end2end/h2_ssl_cert_test.cc
+++ b/test/core/end2end/h2_ssl_cert_test.cc
@@ -169,8 +169,8 @@ typedef enum { NONE, SELF_SIGNED, SIGNED, BAD_CERT_PAIR } certtype;
default: \
break; \
} \
- ssl_creds = \
- grpc_ssl_credentials_create(test_root_cert, key_cert_pair, NULL); \
+ ssl_creds = grpc_ssl_credentials_create(test_root_cert, key_cert_pair, \
+ NULL, NULL); \
grpc_arg ssl_name_override = { \
GRPC_ARG_STRING, \
const_cast<char*>(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG), \
diff --git a/test/core/end2end/h2_ssl_session_reuse_test.cc b/test/core/end2end/h2_ssl_session_reuse_test.cc
index d5984be93f..b2f398625a 100644
--- a/test/core/end2end/h2_ssl_session_reuse_test.cc
+++ b/test/core/end2end/h2_ssl_session_reuse_test.cc
@@ -66,7 +66,7 @@ grpc_channel* client_create(char* server_addr, grpc_ssl_session_cache* cache) {
grpc_ssl_pem_key_cert_pair signed_client_key_cert_pair = {
test_signed_client_key, test_signed_client_cert};
grpc_channel_credentials* client_creds = grpc_ssl_credentials_create(
- test_root_cert, &signed_client_key_cert_pair, nullptr);
+ test_root_cert, &signed_client_key_cert_pair, nullptr, nullptr);
grpc_arg args[] = {
grpc_channel_arg_string_create(
diff --git a/test/core/end2end/tests/channelz.cc b/test/core/end2end/tests/channelz.cc
new file mode 100644
index 0000000000..eb052119ca
--- /dev/null
+++ b/test/core/end2end/tests/channelz.cc
@@ -0,0 +1,299 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include "src/core/lib/surface/channel.h"
+
+#include <grpc/byte_buffer.h>
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include "src/core/lib/gpr/string.h"
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+ const char* test_name,
+ grpc_channel_args* client_args,
+ grpc_channel_args* server_args) {
+ grpc_end2end_test_fixture f;
+ gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+ f = config.create_fixture(client_args, server_args);
+ config.init_server(&f, server_args);
+ config.init_client(&f, client_args);
+ return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+ return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+ return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+ grpc_event ev;
+ do {
+ ev = grpc_completion_queue_next(cq, five_seconds_from_now(), nullptr);
+ } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+ if (!f->server) return;
+ grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+ grpc_timeout_seconds_to_deadline(5),
+ nullptr)
+ .type == GRPC_OP_COMPLETE);
+ grpc_server_destroy(f->server);
+ f->server = nullptr;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+ if (!f->client) return;
+ grpc_channel_destroy(f->client);
+ f->client = nullptr;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+ shutdown_server(f);
+ shutdown_client(f);
+
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
+ grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void run_one_request(grpc_end2end_test_config config,
+ grpc_end2end_test_fixture f,
+ bool request_is_success) {
+ grpc_call* c;
+ grpc_call* s;
+ cq_verifier* cqv = cq_verifier_create(f.cq);
+ grpc_op ops[6];
+ grpc_op* op;
+ grpc_metadata_array initial_metadata_recv;
+ grpc_metadata_array trailing_metadata_recv;
+ grpc_metadata_array request_metadata_recv;
+ grpc_call_details call_details;
+ grpc_status_code status;
+ grpc_call_error error;
+ grpc_slice details;
+ int was_cancelled = 2;
+
+ gpr_timespec deadline = five_seconds_from_now();
+ c = grpc_channel_create_call(f.client, nullptr, GRPC_PROPAGATE_DEFAULTS, f.cq,
+ grpc_slice_from_static_string("/foo"), nullptr,
+ deadline, nullptr);
+ GPR_ASSERT(c);
+
+ grpc_metadata_array_init(&initial_metadata_recv);
+ grpc_metadata_array_init(&trailing_metadata_recv);
+ grpc_metadata_array_init(&request_metadata_recv);
+ grpc_call_details_init(&call_details);
+
+ memset(ops, 0, sizeof(ops));
+ op = ops;
+ op->op = GRPC_OP_SEND_INITIAL_METADATA;
+ op->data.send_initial_metadata.count = 0;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ op->op = GRPC_OP_RECV_INITIAL_METADATA;
+ op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+ op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+ op->data.recv_status_on_client.status = &status;
+ op->data.recv_status_on_client.status_details = &details;
+ op->data.recv_status_on_client.error_string = nullptr;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1),
+ nullptr);
+ GPR_ASSERT(GRPC_CALL_OK == error);
+
+ error =
+ grpc_server_request_call(f.server, &s, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(101));
+ GPR_ASSERT(GRPC_CALL_OK == error);
+ CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+ cq_verify(cqv);
+
+ memset(ops, 0, sizeof(ops));
+ op = ops;
+ op->op = GRPC_OP_SEND_INITIAL_METADATA;
+ op->data.send_initial_metadata.count = 0;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+ op->data.send_status_from_server.trailing_metadata_count = 0;
+ op->data.send_status_from_server.status =
+ request_is_success ? GRPC_STATUS_OK : GRPC_STATUS_UNIMPLEMENTED;
+ grpc_slice status_details = grpc_slice_from_static_string("xyz");
+ op->data.send_status_from_server.status_details = &status_details;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+ op->data.recv_close_on_server.cancelled = &was_cancelled;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102),
+ nullptr);
+ GPR_ASSERT(GRPC_CALL_OK == error);
+
+ CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+ CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+ cq_verify(cqv);
+
+ GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+ GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+ GPR_ASSERT(0 == call_details.flags);
+
+ grpc_slice_unref(details);
+ grpc_metadata_array_destroy(&initial_metadata_recv);
+ grpc_metadata_array_destroy(&trailing_metadata_recv);
+ grpc_metadata_array_destroy(&request_metadata_recv);
+ grpc_call_details_destroy(&call_details);
+
+ grpc_call_unref(c);
+ grpc_call_unref(s);
+
+ cq_verifier_destroy(cqv);
+}
+
+static void test_channelz(grpc_end2end_test_config config) {
+ grpc_end2end_test_fixture f;
+
+ grpc_arg client_a;
+ client_a.type = GRPC_ARG_INTEGER;
+ client_a.key = const_cast<char*>(GRPC_ARG_ENABLE_CHANNELZ);
+ client_a.value.integer = true;
+ grpc_channel_args client_args = {1, &client_a};
+
+ f = begin_test(config, "test_channelz", &client_args, nullptr);
+ grpc_core::channelz::ChannelNode* channelz_channel =
+ grpc_channel_get_channelz_node(f.client);
+
+ GPR_ASSERT(channelz_channel != nullptr);
+ char* json = channelz_channel->RenderJSON();
+ GPR_ASSERT(json != nullptr);
+ GPR_ASSERT(nullptr != strstr(json, "\"callsStarted\":\"0\""));
+ GPR_ASSERT(nullptr != strstr(json, "\"callsFailed\":\"0\""));
+ GPR_ASSERT(nullptr != strstr(json, "\"callsSucceeded\":\"0\""));
+ gpr_free(json);
+
+ // one successful request
+ run_one_request(config, f, true);
+
+ json = channelz_channel->RenderJSON();
+ GPR_ASSERT(json != nullptr);
+ GPR_ASSERT(nullptr != strstr(json, "\"callsStarted\":\"1\""));
+ GPR_ASSERT(nullptr != strstr(json, "\"callsFailed\":\"0\""));
+ GPR_ASSERT(nullptr != strstr(json, "\"callsSucceeded\":\"1\""));
+ gpr_free(json);
+
+ // one failed request
+ run_one_request(config, f, false);
+
+ json = channelz_channel->RenderJSON();
+ GPR_ASSERT(json != nullptr);
+ gpr_log(GPR_INFO, "%s", json);
+ GPR_ASSERT(nullptr != strstr(json, "\"callsStarted\":\"2\""));
+ GPR_ASSERT(nullptr != strstr(json, "\"callsFailed\":\"1\""));
+ GPR_ASSERT(nullptr != strstr(json, "\"callsSucceeded\":\"1\""));
+ // channel tracing is not enables, so these should not be preset.
+ GPR_ASSERT(nullptr == strstr(json, "\"trace\""));
+ GPR_ASSERT(nullptr == strstr(json, "\"description\":\"Channel created\""));
+ GPR_ASSERT(nullptr == strstr(json, "\"severity\":\"CT_INFO\""));
+ gpr_free(json);
+
+ end_test(&f);
+ config.tear_down_data(&f);
+}
+
+static void test_channelz_with_channel_trace(grpc_end2end_test_config config) {
+ grpc_end2end_test_fixture f;
+
+ grpc_arg client_a[2];
+ client_a[0].type = GRPC_ARG_INTEGER;
+ client_a[0].key =
+ const_cast<char*>(GRPC_ARG_MAX_CHANNEL_TRACE_EVENTS_PER_NODE);
+ client_a[0].value.integer = 5;
+ client_a[1].type = GRPC_ARG_INTEGER;
+ client_a[1].key = const_cast<char*>(GRPC_ARG_ENABLE_CHANNELZ);
+ client_a[1].value.integer = true;
+ grpc_channel_args client_args = {GPR_ARRAY_SIZE(client_a), client_a};
+
+ f = begin_test(config, "test_channelz_with_channel_trace", &client_args,
+ nullptr);
+ grpc_core::channelz::ChannelNode* channelz_channel =
+ grpc_channel_get_channelz_node(f.client);
+
+ GPR_ASSERT(channelz_channel != nullptr);
+ char* json = channelz_channel->RenderJSON();
+ GPR_ASSERT(json != nullptr);
+ gpr_log(GPR_INFO, "%s", json);
+ GPR_ASSERT(nullptr != strstr(json, "\"trace\""));
+ GPR_ASSERT(nullptr != strstr(json, "\"description\":\"Channel created\""));
+ GPR_ASSERT(nullptr != strstr(json, "\"severity\":\"CT_INFO\""));
+ gpr_free(json);
+
+ end_test(&f);
+ config.tear_down_data(&f);
+}
+
+static void test_channelz_disabled(grpc_end2end_test_config config) {
+ grpc_end2end_test_fixture f;
+
+ f = begin_test(config, "test_channelz_disabled", nullptr, nullptr);
+ grpc_core::channelz::ChannelNode* channelz_channel =
+ grpc_channel_get_channelz_node(f.client);
+ GPR_ASSERT(channelz_channel == nullptr);
+ // one successful request
+ run_one_request(config, f, true);
+ GPR_ASSERT(channelz_channel == nullptr);
+ end_test(&f);
+ config.tear_down_data(&f);
+}
+
+void channelz(grpc_end2end_test_config config) {
+ test_channelz(config);
+ test_channelz_with_channel_trace(config);
+ test_channelz_disabled(config);
+}
+
+void channelz_pre_init(void) {}
diff --git a/test/core/end2end/tests/no_error_on_hotpath.cc b/test/core/end2end/tests/no_error_on_hotpath.cc
new file mode 100644
index 0000000000..7afadf7d3a
--- /dev/null
+++ b/test/core/end2end/tests/no_error_on_hotpath.cc
@@ -0,0 +1,246 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/time.h>
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/iomgr/error.h"
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+ const char* test_name,
+ grpc_channel_args* client_args,
+ grpc_channel_args* server_args) {
+ grpc_end2end_test_fixture f;
+ gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+ f = config.create_fixture(client_args, server_args);
+ config.init_server(&f, server_args);
+ config.init_client(&f, client_args);
+ return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+ return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+ return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+ grpc_event ev;
+ do {
+ ev = grpc_completion_queue_next(cq, five_seconds_from_now(), nullptr);
+ } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+ if (!f->server) return;
+ grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+ grpc_timeout_seconds_to_deadline(5),
+ nullptr)
+ .type == GRPC_OP_COMPLETE);
+ grpc_server_destroy(f->server);
+ f->server = nullptr;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+ if (!f->client) return;
+ grpc_channel_destroy(f->client);
+ f->client = nullptr;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+ shutdown_server(f);
+ shutdown_client(f);
+
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
+ grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void simple_request_body(grpc_end2end_test_config config,
+ grpc_end2end_test_fixture f) {
+ grpc_call* c;
+ grpc_call* s;
+ cq_verifier* cqv = cq_verifier_create(f.cq);
+ grpc_op ops[6];
+ grpc_op* op;
+ grpc_metadata_array initial_metadata_recv;
+ grpc_metadata_array trailing_metadata_recv;
+ grpc_metadata_array request_metadata_recv;
+ grpc_call_details call_details;
+ grpc_status_code status;
+ grpc_call_error error;
+ grpc_slice details;
+ int was_cancelled = 2;
+ char* peer;
+
+ gpr_timespec deadline = five_seconds_from_now();
+ c = grpc_channel_create_call(f.client, nullptr, GRPC_PROPAGATE_DEFAULTS, f.cq,
+ grpc_slice_from_static_string("/foo"), nullptr,
+ deadline, nullptr);
+ GPR_ASSERT(c);
+
+ peer = grpc_call_get_peer(c);
+ GPR_ASSERT(peer != nullptr);
+ gpr_free(peer);
+
+ grpc_metadata_array_init(&initial_metadata_recv);
+ grpc_metadata_array_init(&trailing_metadata_recv);
+ grpc_metadata_array_init(&request_metadata_recv);
+ grpc_call_details_init(&call_details);
+
+ memset(ops, 0, sizeof(ops));
+ op = ops;
+ op->op = GRPC_OP_SEND_INITIAL_METADATA;
+ op->data.send_initial_metadata.count = 0;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ op->op = GRPC_OP_RECV_INITIAL_METADATA;
+ op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+ op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+ op->data.recv_status_on_client.status = &status;
+ op->data.recv_status_on_client.status_details = &details;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1),
+ nullptr);
+ GPR_ASSERT(GRPC_CALL_OK == error);
+
+ error =
+ grpc_server_request_call(f.server, &s, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(101));
+ GPR_ASSERT(GRPC_CALL_OK == error);
+ CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+ cq_verify(cqv);
+
+ peer = grpc_call_get_peer(s);
+ GPR_ASSERT(peer != nullptr);
+ gpr_free(peer);
+ peer = grpc_call_get_peer(c);
+ GPR_ASSERT(peer != nullptr);
+ gpr_free(peer);
+
+ memset(ops, 0, sizeof(ops));
+ op = ops;
+ op->op = GRPC_OP_SEND_INITIAL_METADATA;
+ op->data.send_initial_metadata.count = 0;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+ op->data.send_status_from_server.trailing_metadata_count = 0;
+ op->data.send_status_from_server.status = GRPC_STATUS_OK;
+ op->data.send_status_from_server.status_details = nullptr;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+ op->data.recv_close_on_server.cancelled = &was_cancelled;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102),
+ nullptr);
+ GPR_ASSERT(GRPC_CALL_OK == error);
+
+ CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+ CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+ cq_verify(cqv);
+
+ GPR_ASSERT(status == GRPC_STATUS_OK);
+ GPR_ASSERT(GRPC_SLICE_LENGTH(details) == 0);
+ GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+ GPR_ASSERT(0 == call_details.flags);
+ GPR_ASSERT(was_cancelled == 0);
+
+ grpc_slice_unref(details);
+ grpc_metadata_array_destroy(&initial_metadata_recv);
+ grpc_metadata_array_destroy(&trailing_metadata_recv);
+ grpc_metadata_array_destroy(&request_metadata_recv);
+ grpc_call_details_destroy(&call_details);
+
+ grpc_call_unref(c);
+ grpc_call_unref(s);
+
+ cq_verifier_destroy(cqv);
+}
+
+static void test_no_error_on_hotpath_one_request(
+ grpc_end2end_test_config config) {
+ grpc_end2end_test_fixture f;
+
+ f = begin_test(config, "test_invoke_simple_request_with_no_error_logging",
+ nullptr, nullptr);
+ // First RPC is not considered the hotpath, since there are lots of things to
+ // set up.
+ simple_request_body(config, f);
+ grpc_disable_error_creation();
+ simple_request_body(config, f);
+ grpc_enable_error_creation();
+ end_test(&f);
+ config.tear_down_data(&f);
+}
+
+static void test_no_error_on_hotpath_10_requests(
+ grpc_end2end_test_config config) {
+ int i;
+ grpc_end2end_test_fixture f = begin_test(
+ config, "test_no_error_on_hotpath_in_one_request", nullptr, nullptr);
+ // First RPC is not considered the hotpath, since there are lots of things to
+ // set up.
+ simple_request_body(config, f);
+ grpc_disable_error_creation();
+ for (i = 0; i < 10; i++) {
+ simple_request_body(config, f);
+ }
+ grpc_enable_error_creation();
+ end_test(&f);
+ config.tear_down_data(&f);
+}
+
+void no_error_on_hotpath(grpc_end2end_test_config config) {
+ test_no_error_on_hotpath_one_request(config);
+ test_no_error_on_hotpath_10_requests(config);
+}
+
+void no_error_on_hotpath_pre_init(void) {}
diff --git a/test/core/end2end/tests/retry_server_pushback_delay.cc b/test/core/end2end/tests/retry_server_pushback_delay.cc
index f6a979613d..221b416828 100644
--- a/test/core/end2end/tests/retry_server_pushback_delay.cc
+++ b/test/core/end2end/tests/retry_server_pushback_delay.cc
@@ -249,7 +249,7 @@ static void test_retry_server_pushback_delay(grpc_end2end_test_config config) {
retry_delay.tv_sec, retry_delay.tv_nsec);
GPR_ASSERT(retry_delay.tv_sec >= 1);
if (retry_delay.tv_sec == 1) {
- GPR_ASSERT(retry_delay.tv_nsec >= 900000000);
+ GPR_ASSERT(retry_delay.tv_nsec >= 800000000);
}
peer = grpc_call_get_peer(s);
diff --git a/test/core/gpr/arena_test.cc b/test/core/gpr/arena_test.cc
index 111414ea3e..3e7c906591 100644
--- a/test/core/gpr/arena_test.cc
+++ b/test/core/gpr/arena_test.cc
@@ -71,7 +71,7 @@ static void test(const char* name, size_t init_size, const size_t* allocs,
static const size_t allocs_##name[] = {__VA_ARGS__}; \
test(#name, init_size, allocs_##name, GPR_ARRAY_SIZE(allocs_##name))
-#define CONCURRENT_TEST_THREADS 100
+#define CONCURRENT_TEST_THREADS 10
size_t concurrent_test_iterations() {
if (sizeof(void*) < 8) return 1000;
diff --git a/test/core/gprpp/inlined_vector_test.cc b/test/core/gprpp/inlined_vector_test.cc
index ae34947718..41f4338f8a 100644
--- a/test/core/gprpp/inlined_vector_test.cc
+++ b/test/core/gprpp/inlined_vector_test.cc
@@ -27,10 +27,12 @@ namespace testing {
TEST(InlinedVectorTest, CreateAndIterate) {
const int kNumElements = 9;
InlinedVector<int, 2> v;
+ EXPECT_TRUE(v.empty());
for (int i = 0; i < kNumElements; ++i) {
v.push_back(i);
}
EXPECT_EQ(static_cast<size_t>(kNumElements), v.size());
+ EXPECT_FALSE(v.empty());
for (int i = 0; i < kNumElements; ++i) {
EXPECT_EQ(i, v[i]);
EXPECT_EQ(i, &v[i] - &v[0]); // Ensure contiguous allocation.
diff --git a/test/core/gprpp/ref_counted_ptr_test.cc b/test/core/gprpp/ref_counted_ptr_test.cc
index c810345166..aa30b72282 100644
--- a/test/core/gprpp/ref_counted_ptr_test.cc
+++ b/test/core/gprpp/ref_counted_ptr_test.cc
@@ -66,14 +66,14 @@ TEST(RefCountedPtr, MoveAssignment) {
TEST(RefCountedPtr, CopyConstructor) {
RefCountedPtr<Foo> foo(New<Foo>());
- RefCountedPtr<Foo> foo2(foo);
+ const RefCountedPtr<Foo>& foo2(foo);
EXPECT_NE(nullptr, foo.get());
EXPECT_EQ(foo.get(), foo2.get());
}
TEST(RefCountedPtr, CopyAssignment) {
RefCountedPtr<Foo> foo(New<Foo>());
- RefCountedPtr<Foo> foo2 = foo;
+ const RefCountedPtr<Foo>& foo2 = foo;
EXPECT_NE(nullptr, foo.get());
EXPECT_EQ(foo.get(), foo2.get());
}
diff --git a/test/core/handshake/BUILD b/test/core/handshake/BUILD
index a3276b9343..712cd59197 100644
--- a/test/core/handshake/BUILD
+++ b/test/core/handshake/BUILD
@@ -82,3 +82,21 @@ grpc_cc_test(
"//test/core/util:grpc_test_util",
],
)
+
+grpc_cc_test(
+ name = "handshake_verify_peer_options",
+ srcs = ["verify_peer_options.cc"],
+ language = "C++",
+ data = [
+ "//src/core/tsi/test_creds:ca.pem",
+ "//src/core/tsi/test_creds:server1.key",
+ "//src/core/tsi/test_creds:server1.pem",
+ ],
+ deps = [
+ "//:gpr",
+ "//:grpc",
+ "//test/core/util:gpr_test_util",
+ "//test/core/util:grpc_test_util",
+ ],
+)
+
diff --git a/test/core/handshake/client_ssl.cc b/test/core/handshake/client_ssl.cc
index 8ac763ac4b..467df6e229 100644
--- a/test/core/handshake/client_ssl.cc
+++ b/test/core/handshake/client_ssl.cc
@@ -251,8 +251,8 @@ static bool client_ssl_test(char* server_alpn_preferred) {
reinterpret_cast<const char*> GRPC_SLICE_START_PTR(key_slice);
pem_key_cert_pair.cert_chain =
reinterpret_cast<const char*> GRPC_SLICE_START_PTR(cert_slice);
- grpc_channel_credentials* ssl_creds =
- grpc_ssl_credentials_create(ca_cert, &pem_key_cert_pair, nullptr);
+ grpc_channel_credentials* ssl_creds = grpc_ssl_credentials_create(
+ ca_cert, &pem_key_cert_pair, nullptr, nullptr);
// Establish a channel pointing at the TLS server. Since the gRPC runtime is
// lazy, this won't necessarily establish a connection yet.
diff --git a/test/core/handshake/verify_peer_options.cc b/test/core/handshake/verify_peer_options.cc
new file mode 100644
index 0000000000..86c524b4a5
--- /dev/null
+++ b/test/core/handshake/verify_peer_options.cc
@@ -0,0 +1,275 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/port.h"
+
+// This test won't work except with posix sockets enabled
+#ifdef GRPC_POSIX_SOCKET
+
+#include <arpa/inet.h>
+#include <openssl/err.h>
+#include <openssl/ssl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <unistd.h>
+
+#include <grpc/grpc.h>
+#include <grpc/grpc_security.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/gprpp/thd.h"
+#include "src/core/lib/iomgr/load_file.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+#define SSL_CERT_PATH "src/core/tsi/test_creds/server1.pem"
+#define SSL_KEY_PATH "src/core/tsi/test_creds/server1.key"
+#define SSL_CA_PATH "src/core/tsi/test_creds/ca.pem"
+
+// Simple gRPC server. This listens until client_handshake_complete occurs.
+static gpr_event client_handshake_complete;
+
+static void server_thread(void* arg) {
+ const int port = *static_cast<int*>(arg);
+
+ // Load key pair and establish server SSL credentials.
+ grpc_ssl_pem_key_cert_pair pem_key_cert_pair;
+ grpc_slice ca_slice, cert_slice, key_slice;
+ GPR_ASSERT(GRPC_LOG_IF_ERROR("load_file",
+ grpc_load_file(SSL_CA_PATH, 1, &ca_slice)));
+ GPR_ASSERT(GRPC_LOG_IF_ERROR("load_file",
+ grpc_load_file(SSL_CERT_PATH, 1, &cert_slice)));
+ GPR_ASSERT(GRPC_LOG_IF_ERROR("load_file",
+ grpc_load_file(SSL_KEY_PATH, 1, &key_slice)));
+ const char* ca_cert =
+ reinterpret_cast<const char*> GRPC_SLICE_START_PTR(ca_slice);
+ pem_key_cert_pair.private_key =
+ reinterpret_cast<const char*> GRPC_SLICE_START_PTR(key_slice);
+ pem_key_cert_pair.cert_chain =
+ reinterpret_cast<const char*> GRPC_SLICE_START_PTR(cert_slice);
+ grpc_server_credentials* ssl_creds = grpc_ssl_server_credentials_create(
+ ca_cert, &pem_key_cert_pair, 1, 0, nullptr);
+
+ // Start server listening on local port.
+ char* addr;
+ gpr_asprintf(&addr, "127.0.0.1:%d", port);
+ grpc_server* server = grpc_server_create(nullptr, nullptr);
+ GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, ssl_creds));
+ free(addr);
+
+ grpc_completion_queue* cq = grpc_completion_queue_create_for_next(nullptr);
+
+ grpc_server_register_completion_queue(server, cq, nullptr);
+ grpc_server_start(server);
+
+ // Wait a bounded number of time until client_handshake_complete is set,
+ // sleeping between polls. The total time spent (deadline * retries)
+ // should be strictly greater than the client retry limit so that the
+ // client will always timeout first.
+ int retries = 60;
+ while (!gpr_event_get(&client_handshake_complete) && retries-- > 0) {
+ const gpr_timespec cq_deadline = grpc_timeout_seconds_to_deadline(1);
+ grpc_event ev = grpc_completion_queue_next(cq, cq_deadline, nullptr);
+ GPR_ASSERT(ev.type == GRPC_QUEUE_TIMEOUT);
+ }
+
+ gpr_log(GPR_INFO, "Shutting down server");
+ grpc_server_shutdown_and_notify(server, cq, nullptr);
+ grpc_server_cancel_all_calls(server);
+ grpc_completion_queue_shutdown(cq);
+
+ const gpr_timespec cq_deadline = grpc_timeout_seconds_to_deadline(60);
+ grpc_event ev = grpc_completion_queue_next(cq, cq_deadline, nullptr);
+ GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+
+ grpc_server_destroy(server);
+ grpc_completion_queue_destroy(cq);
+ grpc_server_credentials_release(ssl_creds);
+ grpc_slice_unref(cert_slice);
+ grpc_slice_unref(key_slice);
+ grpc_slice_unref(ca_slice);
+}
+
+// This test launches a minimal TLS grpc server on a separate thread and then
+// establishes a TLS handshake via the core library to the server. The client
+// uses the supplied verify options.
+static bool verify_peer_options_test(verify_peer_options* verify_options) {
+ bool success = true;
+
+ grpc_init();
+ int port = grpc_pick_unused_port_or_die();
+ gpr_event_init(&client_handshake_complete);
+
+ // Launch the gRPC server thread.
+ bool ok;
+ grpc_core::Thread thd("grpc_client_ssl_test", server_thread, &port, &ok);
+ GPR_ASSERT(ok);
+ thd.Start();
+
+ // Load key pair and establish client SSL credentials.
+ grpc_ssl_pem_key_cert_pair pem_key_cert_pair;
+ grpc_slice ca_slice, cert_slice, key_slice;
+ GPR_ASSERT(GRPC_LOG_IF_ERROR("load_file",
+ grpc_load_file(SSL_CA_PATH, 1, &ca_slice)));
+ GPR_ASSERT(GRPC_LOG_IF_ERROR("load_file",
+ grpc_load_file(SSL_CERT_PATH, 1, &cert_slice)));
+ GPR_ASSERT(GRPC_LOG_IF_ERROR("load_file",
+ grpc_load_file(SSL_KEY_PATH, 1, &key_slice)));
+ const char* ca_cert =
+ reinterpret_cast<const char*> GRPC_SLICE_START_PTR(ca_slice);
+ pem_key_cert_pair.private_key =
+ reinterpret_cast<const char*> GRPC_SLICE_START_PTR(key_slice);
+ pem_key_cert_pair.cert_chain =
+ reinterpret_cast<const char*> GRPC_SLICE_START_PTR(cert_slice);
+ grpc_channel_credentials* ssl_creds = grpc_ssl_credentials_create(
+ ca_cert, &pem_key_cert_pair, verify_options, nullptr);
+
+ // Establish a channel pointing at the TLS server. Since the gRPC runtime is
+ // lazy, this won't necessarily establish a connection yet.
+ char* target;
+ gpr_asprintf(&target, "127.0.0.1:%d", port);
+ grpc_arg ssl_name_override = {
+ GRPC_ARG_STRING,
+ const_cast<char*>(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG),
+ {const_cast<char*>("foo.test.google.fr")}};
+ grpc_channel_args grpc_args;
+ grpc_args.num_args = 1;
+ grpc_args.args = &ssl_name_override;
+ grpc_channel* channel =
+ grpc_secure_channel_create(ssl_creds, target, &grpc_args, nullptr);
+ GPR_ASSERT(channel);
+ gpr_free(target);
+
+ // Initially the channel will be idle, the
+ // grpc_channel_check_connectivity_state triggers an attempt to connect.
+ GPR_ASSERT(grpc_channel_check_connectivity_state(
+ channel, 1 /* try_to_connect */) == GRPC_CHANNEL_IDLE);
+
+ // Wait a bounded number of times for the channel to be ready. When the
+ // channel is ready, the initial TLS handshake will have successfully
+ // completed. The total time spent on the client side (retries * deadline)
+ // should be greater than the server side time limit.
+ int retries = 10;
+ grpc_connectivity_state state = GRPC_CHANNEL_IDLE;
+ grpc_completion_queue* cq = grpc_completion_queue_create_for_next(nullptr);
+
+ while (state != GRPC_CHANNEL_READY && retries-- > 0) {
+ grpc_channel_watch_connectivity_state(
+ channel, state, grpc_timeout_seconds_to_deadline(3), cq, nullptr);
+ gpr_timespec cq_deadline = grpc_timeout_seconds_to_deadline(5);
+ grpc_event ev = grpc_completion_queue_next(cq, cq_deadline, nullptr);
+ GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+ state =
+ grpc_channel_check_connectivity_state(channel, 0 /* try_to_connect */);
+ }
+ grpc_completion_queue_destroy(cq);
+ if (retries < 0) {
+ success = false;
+ }
+
+ grpc_channel_destroy(channel);
+ grpc_channel_credentials_release(ssl_creds);
+ grpc_slice_unref(cert_slice);
+ grpc_slice_unref(key_slice);
+ grpc_slice_unref(ca_slice);
+
+ // Now that the client is completely cleaned up, trigger the server to
+ // shutdown
+ gpr_event_set(&client_handshake_complete, &client_handshake_complete);
+ // Wait for the server to completely shutdown
+ thd.Join();
+
+ grpc_shutdown();
+
+ return success;
+}
+
+static int callback_return_value = 0;
+static char callback_target_host[4096];
+static char callback_target_pem[4096];
+static void* callback_userdata = nullptr;
+static void* destruct_userdata = nullptr;
+
+static int verify_callback(const char* target_host, const char* target_pem,
+ void* userdata) {
+ if (target_host != nullptr) {
+ snprintf(callback_target_host, sizeof(callback_target_host), "%s",
+ target_host);
+ } else {
+ callback_target_host[0] = '\0';
+ }
+ if (target_pem != nullptr) {
+ snprintf(callback_target_pem, sizeof(callback_target_pem), "%s",
+ target_pem);
+ } else {
+ callback_target_pem[0] = '\0';
+ }
+ callback_userdata = userdata;
+ return callback_return_value;
+}
+
+static void verify_destruct(void* userdata) { destruct_userdata = userdata; }
+
+int main(int argc, char* argv[]) {
+ int userdata = 42;
+ verify_peer_options verify_options;
+
+ // Load the server's cert so that we can assert it gets passed to the callback
+ grpc_slice cert_slice;
+ GPR_ASSERT(GRPC_LOG_IF_ERROR("load_file",
+ grpc_load_file(SSL_CERT_PATH, 1, &cert_slice)));
+ const char* server_cert =
+ reinterpret_cast<const char*> GRPC_SLICE_START_PTR(cert_slice);
+
+ // Running with all-null values should have no effect
+ verify_options.verify_peer_callback = nullptr;
+ verify_options.verify_peer_callback_userdata = nullptr;
+ verify_options.verify_peer_destruct = nullptr;
+ GPR_ASSERT(verify_peer_options_test(&verify_options));
+ GPR_ASSERT(strlen(callback_target_host) == 0);
+ GPR_ASSERT(strlen(callback_target_pem) == 0);
+ GPR_ASSERT(callback_userdata == nullptr);
+ GPR_ASSERT(destruct_userdata == nullptr);
+
+ // Running with the callbacks and verify we get the expected values
+ verify_options.verify_peer_callback = verify_callback;
+ verify_options.verify_peer_callback_userdata = static_cast<void*>(&userdata);
+ verify_options.verify_peer_destruct = verify_destruct;
+ GPR_ASSERT(verify_peer_options_test(&verify_options));
+ GPR_ASSERT(strcmp(callback_target_host, "foo.test.google.fr") == 0);
+ GPR_ASSERT(strcmp(callback_target_pem, server_cert) == 0);
+ GPR_ASSERT(callback_userdata == static_cast<void*>(&userdata));
+ GPR_ASSERT(destruct_userdata == static_cast<void*>(&userdata));
+
+ // If the callback returns non-zero, initializing the channel should fail.
+ callback_return_value = 1;
+ GPR_ASSERT(!verify_peer_options_test(&verify_options));
+
+ grpc_slice_unref(cert_slice);
+
+ return 0;
+}
+
+#else /* GRPC_POSIX_SOCKET */
+
+int main(int argc, char** argv) { return 1; }
+
+#endif /* GRPC_POSIX_SOCKET */
diff --git a/test/core/iomgr/BUILD b/test/core/iomgr/BUILD
index 349a06d578..cc1b6aee5e 100644
--- a/test/core/iomgr/BUILD
+++ b/test/core/iomgr/BUILD
@@ -18,7 +18,10 @@ licenses(["notice"]) # Apache v2
load("//test/core/util:grpc_fuzzer.bzl", "grpc_fuzzer")
-grpc_package(name = "test/core/iomgr", visibility = "public") # Useful for third party devs to test their io manager implementation.
+grpc_package(
+ name = "test/core/iomgr",
+ visibility = "public",
+) # Useful for third party devs to test their io manager implementation.
grpc_cc_library(
name = "endpoint_tests",
@@ -73,15 +76,27 @@ grpc_cc_test(
)
grpc_cc_test(
+ name = "ev_epollex_linux_test",
+ srcs = ["ev_epollex_linux_test.cc"],
+ language = "C++",
+ deps = [
+ "//:gpr",
+ "//:grpc",
+ "//test/core/util:gpr_test_util",
+ "//test/core/util:grpc_test_util",
+ ],
+)
+
+grpc_cc_test(
name = "ev_epollsig_linux_test",
srcs = ["ev_epollsig_linux_test.cc"],
+ language = "C++",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
- language = "C++",
)
grpc_cc_test(
@@ -221,6 +236,7 @@ grpc_cc_test(
name = "tcp_server_posix_test",
srcs = ["tcp_server_posix_test.cc"],
language = "C++",
+ tags = ["manual"], # TODO(adelez): Remove once this works on Foundry.
deps = [
"//:gpr",
"//:grpc",
diff --git a/test/core/iomgr/ev_epollex_linux_test.cc b/test/core/iomgr/ev_epollex_linux_test.cc
new file mode 100644
index 0000000000..08d1e68b39
--- /dev/null
+++ b/test/core/iomgr/ev_epollex_linux_test.cc
@@ -0,0 +1,115 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "src/core/lib/iomgr/port.h"
+
+/* This test only relevant on linux systems where epoll() is available */
+#if defined(GRPC_LINUX_EPOLL_CREATE1) && defined(GRPC_LINUX_EVENTFD)
+#include "src/core/lib/iomgr/ev_epollex_linux.h"
+
+#include <grpc/grpc.h>
+#include <string.h>
+#include <sys/eventfd.h>
+
+#include "test/core/util/test_config.h"
+
+static void pollset_destroy(void* ps, grpc_error* error) {
+ grpc_pollset_destroy(static_cast<grpc_pollset*>(ps));
+ gpr_free(ps);
+}
+
+// This test is added to cover the case found in bug:
+// https://github.com/grpc/grpc/issues/15760
+static void test_pollable_owner_fd() {
+ grpc_core::ExecCtx exec_ctx;
+ int ev_fd1;
+ int ev_fd2;
+ grpc_fd* grpc_fd1;
+ grpc_fd* grpc_fd2;
+ grpc_pollset* ps;
+ gpr_mu* mu;
+
+ // == Create two grpc_fds ==
+ // All we need is two file descriptors. Doesn't matter what type. We use
+ // eventfd type here for the purpose of this test
+ ev_fd1 = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
+ ev_fd2 = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
+ if (ev_fd1 < 0 || ev_fd2 < 0) {
+ gpr_log(GPR_ERROR, "Error in creating event fds for the test");
+ return;
+ }
+ grpc_fd1 = grpc_fd_create(ev_fd1, "epollex-test-fd1", false);
+ grpc_fd2 = grpc_fd_create(ev_fd2, "epollex-test-fd2", false);
+ grpc_core::ExecCtx::Get()->Flush();
+
+ // == Create a pollset ==
+ ps = static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
+ grpc_pollset_init(ps, &mu);
+ grpc_core::ExecCtx::Get()->Flush();
+
+ // == Add fd1 to pollset ==
+ grpc_pollset_add_fd(ps, grpc_fd1);
+ grpc_core::ExecCtx::Get()->Flush();
+
+ // == Destroy fd1 ==
+ grpc_fd_orphan(grpc_fd1, nullptr, nullptr, "test fd1 orphan");
+ grpc_core::ExecCtx::Get()->Flush();
+
+ // = Add fd2 to pollset ==
+ //
+ // Before https://github.com/grpc/grpc/issues/15760, the following line caused
+ // unexpected behavior (The previous grpc_pollset_add_fd(ps, grpc_fd1) created
+ // an underlying structure in epollex that held a reference to grpc_fd1 which
+ // was being accessed here even after grpc_fd_orphan(grpc_fd1) was called
+ grpc_pollset_add_fd(ps, grpc_fd2);
+ grpc_core::ExecCtx::Get()->Flush();
+
+ // == Destroy fd2 ==
+ grpc_fd_orphan(grpc_fd2, nullptr, nullptr, "test fd2 orphan");
+ grpc_core::ExecCtx::Get()->Flush();
+
+ // == Destroy pollset
+ grpc_closure ps_destroy_closure;
+ GRPC_CLOSURE_INIT(&ps_destroy_closure, pollset_destroy, ps,
+ grpc_schedule_on_exec_ctx);
+ grpc_pollset_shutdown(ps, &ps_destroy_closure);
+ grpc_core::ExecCtx::Get()->Flush();
+}
+
+int main(int argc, char** argv) {
+ const char* poll_strategy = nullptr;
+ grpc_test_init(argc, argv);
+ grpc_init();
+ {
+ grpc_core::ExecCtx exec_ctx;
+ poll_strategy = grpc_get_poll_strategy_name();
+ if (poll_strategy != nullptr && strcmp(poll_strategy, "epollex") == 0) {
+ test_pollable_owner_fd();
+ } else {
+ gpr_log(GPR_INFO,
+ "Skipping the test. The test is only relevant for 'epollex' "
+ "strategy. and the current strategy is: '%s'",
+ poll_strategy);
+ }
+ }
+
+ grpc_shutdown();
+ return 0;
+}
+#else /* defined(GRPC_LINUX_EPOLL_CREATE1) && defined(GRPC_LINUX_EVENTFD) */
+int main(int argc, char** argv) { return 0; }
+#endif
diff --git a/test/core/iomgr/ev_epollsig_linux_test.cc b/test/core/iomgr/ev_epollsig_linux_test.cc
index c3ba6d7c14..28c9dd408c 100644
--- a/test/core/iomgr/ev_epollsig_linux_test.cc
+++ b/test/core/iomgr/ev_epollsig_linux_test.cc
@@ -66,7 +66,7 @@ static void test_fd_init(test_fd* tfds, int* fds, int num_fds) {
for (i = 0; i < num_fds; i++) {
tfds[i].inner_fd = fds[i];
- tfds[i].fd = grpc_fd_create(fds[i], "test_fd");
+ tfds[i].fd = grpc_fd_create(fds[i], "test_fd", false);
}
}
@@ -79,8 +79,7 @@ static void test_fd_cleanup(test_fd* tfds, int num_fds) {
GRPC_ERROR_CREATE_FROM_STATIC_STRING("test_fd_cleanup"));
grpc_core::ExecCtx::Get()->Flush();
- grpc_fd_orphan(tfds[i].fd, nullptr, &release_fd, false /* already_closed */,
- "test_fd_cleanup");
+ grpc_fd_orphan(tfds[i].fd, nullptr, &release_fd, "test_fd_cleanup");
grpc_core::ExecCtx::Get()->Flush();
GPR_ASSERT(release_fd == tfds[i].inner_fd);
@@ -267,7 +266,7 @@ static void test_threading(void) {
grpc_wakeup_fd fd;
GPR_ASSERT(GRPC_LOG_IF_ERROR("wakeup_fd_init", grpc_wakeup_fd_init(&fd)));
shared.wakeup_fd = &fd;
- shared.wakeup_desc = grpc_fd_create(fd.read_fd, "wakeup");
+ shared.wakeup_desc = grpc_fd_create(fd.read_fd, "wakeup", false);
shared.wakeups = 0;
{
grpc_core::ExecCtx exec_ctx;
@@ -287,8 +286,7 @@ static void test_threading(void) {
{
grpc_core::ExecCtx exec_ctx;
grpc_fd_shutdown(shared.wakeup_desc, GRPC_ERROR_CANCELLED);
- grpc_fd_orphan(shared.wakeup_desc, nullptr, nullptr,
- false /* already_closed */, "done");
+ grpc_fd_orphan(shared.wakeup_desc, nullptr, nullptr, "done");
grpc_pollset_shutdown(shared.pollset,
GRPC_CLOSURE_CREATE(destroy_pollset, shared.pollset,
grpc_schedule_on_exec_ctx));
diff --git a/test/core/iomgr/fd_posix_test.cc b/test/core/iomgr/fd_posix_test.cc
index b81c73b2c0..4ea2389bbd 100644
--- a/test/core/iomgr/fd_posix_test.cc
+++ b/test/core/iomgr/fd_posix_test.cc
@@ -115,7 +115,7 @@ static void session_shutdown_cb(void* arg, /*session */
bool success) {
session* se = static_cast<session*>(arg);
server* sv = se->sv;
- grpc_fd_orphan(se->em_fd, nullptr, nullptr, false /* already_closed */, "a");
+ grpc_fd_orphan(se->em_fd, nullptr, nullptr, "a");
gpr_free(se);
/* Start to shutdown listen fd. */
grpc_fd_shutdown(sv->em_fd,
@@ -171,7 +171,7 @@ static void session_read_cb(void* arg, /*session */
static void listen_shutdown_cb(void* arg /*server */, int success) {
server* sv = static_cast<server*>(arg);
- grpc_fd_orphan(sv->em_fd, nullptr, nullptr, false /* already_closed */, "b");
+ grpc_fd_orphan(sv->em_fd, nullptr, nullptr, "b");
gpr_mu_lock(g_mu);
sv->done = 1;
@@ -204,7 +204,7 @@ static void listen_cb(void* arg, /*=sv_arg*/
fcntl(fd, F_SETFL, flags | O_NONBLOCK);
se = static_cast<session*>(gpr_malloc(sizeof(*se)));
se->sv = sv;
- se->em_fd = grpc_fd_create(fd, "listener");
+ se->em_fd = grpc_fd_create(fd, "listener", false);
grpc_pollset_add_fd(g_pollset, se->em_fd);
GRPC_CLOSURE_INIT(&se->session_read_closure, session_read_cb, se,
grpc_schedule_on_exec_ctx);
@@ -233,7 +233,7 @@ static int server_start(server* sv) {
port = ntohs(sin.sin_port);
GPR_ASSERT(listen(fd, MAX_NUM_FD) == 0);
- sv->em_fd = grpc_fd_create(fd, "server");
+ sv->em_fd = grpc_fd_create(fd, "server", false);
grpc_pollset_add_fd(g_pollset, sv->em_fd);
/* Register to be interested in reading from listen_fd. */
GRPC_CLOSURE_INIT(&sv->listen_closure, listen_cb, sv,
@@ -289,7 +289,7 @@ static void client_init(client* cl) {
/* Called when a client upload session is ready to shutdown. */
static void client_session_shutdown_cb(void* arg /*client */, int success) {
client* cl = static_cast<client*>(arg);
- grpc_fd_orphan(cl->em_fd, nullptr, nullptr, false /* already_closed */, "c");
+ grpc_fd_orphan(cl->em_fd, nullptr, nullptr, "c");
cl->done = 1;
GPR_ASSERT(
GRPC_LOG_IF_ERROR("pollset_kick", grpc_pollset_kick(g_pollset, nullptr)));
@@ -353,7 +353,7 @@ static void client_start(client* cl, int port) {
}
}
- cl->em_fd = grpc_fd_create(fd, "client");
+ cl->em_fd = grpc_fd_create(fd, "client", false);
grpc_pollset_add_fd(g_pollset, cl->em_fd);
client_session_write(cl, GRPC_ERROR_NONE);
@@ -454,7 +454,7 @@ static void test_grpc_fd_change(void) {
flags = fcntl(sv[1], F_GETFL, 0);
GPR_ASSERT(fcntl(sv[1], F_SETFL, flags | O_NONBLOCK) == 0);
- em_fd = grpc_fd_create(sv[0], "test_grpc_fd_change");
+ em_fd = grpc_fd_create(sv[0], "test_grpc_fd_change", false);
grpc_pollset_add_fd(g_pollset, em_fd);
/* Register the first callback, then make its FD readable */
@@ -502,7 +502,7 @@ static void test_grpc_fd_change(void) {
GPR_ASSERT(b.cb_that_ran == second_read_callback);
gpr_mu_unlock(g_mu);
- grpc_fd_orphan(em_fd, nullptr, nullptr, false /* already_closed */, "d");
+ grpc_fd_orphan(em_fd, nullptr, nullptr, "d");
destroy_change_data(&a);
destroy_change_data(&b);
diff --git a/test/core/iomgr/ios/CFStreamTests/CFStreamClientTests.mm b/test/core/iomgr/ios/CFStreamTests/CFStreamClientTests.mm
new file mode 100644
index 0000000000..414b6c78c0
--- /dev/null
+++ b/test/core/iomgr/ios/CFStreamTests/CFStreamClientTests.mm
@@ -0,0 +1,201 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#import <XCTest/XCTest.h>
+
+#include "src/core/lib/iomgr/port.h"
+
+#ifdef GRPC_CFSTREAM
+
+#include <netinet/in.h>
+
+#include <grpc/impl/codegen/sync.h>
+#include <grpc/support/sync.h>
+
+#include "src/core/lib/iomgr/endpoint.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/tcp_client.h"
+#include "test/core/util/test_config.h"
+
+// static int g_connections_complete = 0;
+static gpr_mu g_mu;
+static int g_connections_complete = 0;
+static grpc_endpoint* g_connecting = nullptr;
+
+static void finish_connection() {
+ gpr_mu_lock(&g_mu);
+ g_connections_complete++;
+ gpr_mu_unlock(&g_mu);
+}
+
+static void must_succeed(void* arg, grpc_error* error) {
+ GPR_ASSERT(g_connecting != nullptr);
+ GPR_ASSERT(error == GRPC_ERROR_NONE);
+ grpc_endpoint_shutdown(g_connecting, GRPC_ERROR_CREATE_FROM_STATIC_STRING("must_succeed called"));
+ grpc_endpoint_destroy(g_connecting);
+ g_connecting = nullptr;
+ finish_connection();
+}
+
+static void must_fail(void* arg, grpc_error* error) {
+ GPR_ASSERT(g_connecting == nullptr);
+ GPR_ASSERT(error != GRPC_ERROR_NONE);
+ const char* error_str = grpc_error_string(error);
+ NSLog(@"%s", error_str);
+ finish_connection();
+}
+
+@interface CFStreamClientTests : XCTestCase
+
+@end
+
+@implementation CFStreamClientTests
+
++ (void)setUp {
+ grpc_init();
+ gpr_mu_init(&g_mu);
+}
+
++ (void)tearDown {
+ grpc_shutdown();
+}
+
+- (void)testSucceeds {
+ grpc_resolved_address resolved_addr;
+ struct sockaddr_in* addr = reinterpret_cast<struct sockaddr_in*>(resolved_addr.addr);
+ int svr_fd;
+ int r;
+ int connections_complete_before;
+ grpc_closure done;
+ grpc_core::ExecCtx exec_ctx;
+
+ gpr_log(GPR_DEBUG, "test_succeeds");
+
+ memset(&resolved_addr, 0, sizeof(resolved_addr));
+ resolved_addr.len = sizeof(struct sockaddr_in);
+ addr->sin_family = AF_INET;
+
+ /* create a dummy server */
+ svr_fd = socket(AF_INET, SOCK_STREAM, 0);
+ GPR_ASSERT(svr_fd >= 0);
+ GPR_ASSERT(0 == bind(svr_fd, (struct sockaddr*)addr, (socklen_t)resolved_addr.len));
+ GPR_ASSERT(0 == listen(svr_fd, 1));
+
+ gpr_mu_lock(&g_mu);
+ connections_complete_before = g_connections_complete;
+ gpr_mu_unlock(&g_mu);
+
+ /* connect to it */
+ GPR_ASSERT(getsockname(svr_fd, (struct sockaddr*)addr, (socklen_t*)&resolved_addr.len) == 0);
+ GRPC_CLOSURE_INIT(&done, must_succeed, nullptr, grpc_schedule_on_exec_ctx);
+ grpc_tcp_client_connect(&done, &g_connecting, nullptr, nullptr, &resolved_addr,
+ GRPC_MILLIS_INF_FUTURE);
+
+ /* await the connection */
+ do {
+ resolved_addr.len = sizeof(addr);
+ r = accept(svr_fd, reinterpret_cast<struct sockaddr*>(addr),
+ reinterpret_cast<socklen_t*>(&resolved_addr.len));
+ } while (r == -1 && errno == EINTR);
+ GPR_ASSERT(r >= 0);
+ close(r);
+
+ grpc_core::ExecCtx::Get()->Flush();
+
+ /* wait for the connection callback to finish */
+ gpr_mu_lock(&g_mu);
+ NSDate* deadline = [NSDate dateWithTimeIntervalSinceNow:5];
+ while (connections_complete_before == g_connections_complete) {
+ gpr_mu_unlock(&g_mu);
+ [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:deadline];
+ gpr_mu_lock(&g_mu);
+ }
+ XCTAssertGreaterThan(g_connections_complete, connections_complete_before);
+
+ gpr_mu_unlock(&g_mu);
+}
+
+- (void)testFails {
+ grpc_core::ExecCtx exec_ctx;
+
+ grpc_resolved_address resolved_addr;
+ struct sockaddr_in* addr = reinterpret_cast<struct sockaddr_in*>(resolved_addr.addr);
+ int connections_complete_before;
+ grpc_closure done;
+ int svr_fd;
+
+ gpr_log(GPR_DEBUG, "test_fails");
+
+ memset(&resolved_addr, 0, sizeof(resolved_addr));
+ resolved_addr.len = static_cast<socklen_t>(sizeof(struct sockaddr_in));
+ addr->sin_family = AF_INET;
+
+ svr_fd = socket(AF_INET, SOCK_STREAM, 0);
+ GPR_ASSERT(svr_fd >= 0);
+ GPR_ASSERT(0 == bind(svr_fd, (struct sockaddr*)addr, (socklen_t)resolved_addr.len));
+ GPR_ASSERT(0 == listen(svr_fd, 1));
+ GPR_ASSERT(getsockname(svr_fd, (struct sockaddr*)addr, (socklen_t*)&resolved_addr.len) == 0);
+ close(svr_fd);
+
+ gpr_mu_lock(&g_mu);
+ connections_complete_before = g_connections_complete;
+ gpr_mu_unlock(&g_mu);
+
+ /* connect to a broken address */
+ GRPC_CLOSURE_INIT(&done, must_fail, nullptr, grpc_schedule_on_exec_ctx);
+ grpc_tcp_client_connect(&done, &g_connecting, nullptr, nullptr, &resolved_addr,
+ GRPC_MILLIS_INF_FUTURE);
+
+ grpc_core::ExecCtx::Get()->Flush();
+
+ /* wait for the connection callback to finish */
+ gpr_mu_lock(&g_mu);
+ NSDate* deadline = [NSDate dateWithTimeIntervalSinceNow:5];
+ while (g_connections_complete == connections_complete_before) {
+ gpr_mu_unlock(&g_mu);
+ [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:deadline];
+ gpr_mu_lock(&g_mu);
+ }
+
+ XCTAssertGreaterThan(g_connections_complete, connections_complete_before);
+
+ gpr_mu_unlock(&g_mu);
+}
+
+@end
+
+#else // GRPC_CFSTREAM
+
+// Dummy test suite
+@interface CFStreamClientTests : XCTestCase
+
+@end
+
+@implementation CFStreamClientTests
+
+- (void)setUp {
+ [super setUp];
+}
+
+- (void)tearDown {
+ [super tearDown];
+}
+
+@end
+
+#endif // GRPC_CFSTREAM
diff --git a/test/core/iomgr/ios/CFStreamTests/CFStreamEndpointTests.mm b/test/core/iomgr/ios/CFStreamTests/CFStreamEndpointTests.mm
new file mode 100644
index 0000000000..fbc34c74d6
--- /dev/null
+++ b/test/core/iomgr/ios/CFStreamTests/CFStreamEndpointTests.mm
@@ -0,0 +1,344 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#import <XCTest/XCTest.h>
+
+#include "src/core/lib/iomgr/port.h"
+
+#ifdef GRPC_CFSTREAM
+
+#include <netinet/in.h>
+
+#include <grpc/impl/codegen/sync.h>
+#include <grpc/support/sync.h>
+
+#include "src/core/lib/iomgr/endpoint.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/tcp_client.h"
+#include "test/core/util/test_config.h"
+
+static const int kConnectTimeout = 5;
+static const int kWriteTimeout = 5;
+static const int kReadTimeout = 5;
+
+static const int kBufferSize = 10000;
+
+static const int kRunLoopTimeout = 1;
+
+static void set_atm(void *arg, grpc_error *error) {
+ gpr_atm *p = static_cast<gpr_atm *>(arg);
+ gpr_atm_full_cas(p, -1, reinterpret_cast<gpr_atm>(error));
+}
+
+static void init_event_closure(grpc_closure *closure, gpr_atm *atm) {
+ *atm = -1;
+ GRPC_CLOSURE_INIT(closure, set_atm, static_cast<void *>(atm), grpc_schedule_on_exec_ctx);
+}
+
+static bool compare_slice_buffer_with_buffer(grpc_slice_buffer *slices, const char *buffer,
+ size_t buffer_len) {
+ if (slices->length != buffer_len) {
+ return false;
+ }
+
+ for (int i = 0; i < slices->count; i++) {
+ grpc_slice slice = slices->slices[i];
+ if (0 != memcmp(buffer, GRPC_SLICE_START_PTR(slice), GRPC_SLICE_LENGTH(slice))) {
+ return false;
+ }
+ buffer += GRPC_SLICE_LENGTH(slice);
+ }
+
+ return true;
+}
+
+@interface CFStreamEndpointTests : XCTestCase
+
+@end
+
+@implementation CFStreamEndpointTests {
+ grpc_endpoint *ep_;
+ int svr_fd_;
+}
+
+- (BOOL)waitForEvent:(gpr_atm *)event timeout:(int)timeout {
+ grpc_core::ExecCtx::Get()->Flush();
+
+ NSDate *deadline = [NSDate dateWithTimeIntervalSinceNow:kConnectTimeout];
+ while (gpr_atm_acq_load(event) == -1 && [deadline timeIntervalSinceNow] > 0) {
+ NSDate *deadline = [NSDate dateWithTimeIntervalSinceNow:kRunLoopTimeout];
+ [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:deadline];
+ }
+
+ return (gpr_atm_acq_load(event) != -1);
+}
+
++ (void)setUp {
+ grpc_init();
+}
+
++ (void)tearDown {
+ grpc_shutdown();
+}
+
+- (void)setUp {
+ self.continueAfterFailure = NO;
+
+ // Set up CFStream connection before testing the endpoint
+
+ grpc_core::ExecCtx exec_ctx;
+
+ grpc_resolved_address resolved_addr;
+ struct sockaddr_in *addr = reinterpret_cast<struct sockaddr_in *>(resolved_addr.addr);
+ int svr_fd;
+ int r;
+ gpr_atm connected = -1;
+ grpc_closure done;
+
+ gpr_log(GPR_DEBUG, "test_succeeds");
+
+ memset(&resolved_addr, 0, sizeof(resolved_addr));
+ resolved_addr.len = sizeof(struct sockaddr_in);
+ addr->sin_family = AF_INET;
+
+ /* create a dummy server */
+ svr_fd = socket(AF_INET, SOCK_STREAM, 0);
+ XCTAssertGreaterThanOrEqual(svr_fd, 0);
+ XCTAssertEqual(bind(svr_fd, (struct sockaddr *)addr, (socklen_t)resolved_addr.len), 0);
+ XCTAssertEqual(listen(svr_fd, 1), 0);
+
+ /* connect to it */
+ XCTAssertEqual(getsockname(svr_fd, (struct sockaddr *)addr, (socklen_t *)&resolved_addr.len), 0);
+ init_event_closure(&done, &connected);
+ grpc_tcp_client_connect(&done, &ep_, nullptr, nullptr, &resolved_addr, GRPC_MILLIS_INF_FUTURE);
+
+ /* await the connection */
+ do {
+ resolved_addr.len = sizeof(addr);
+ r = accept(svr_fd, reinterpret_cast<struct sockaddr *>(addr),
+ reinterpret_cast<socklen_t *>(&resolved_addr.len));
+ } while (r == -1 && errno == EINTR);
+ XCTAssertGreaterThanOrEqual(r, 0);
+ svr_fd_ = r;
+
+ /* wait for the connection callback to finish */
+ XCTAssertEqual([self waitForEvent:&connected timeout:kConnectTimeout], YES);
+ XCTAssertEqual(reinterpret_cast<grpc_error *>(connected), GRPC_ERROR_NONE);
+}
+
+- (void)tearDown {
+ grpc_core::ExecCtx exec_ctx;
+ close(svr_fd_);
+ grpc_endpoint_destroy(ep_);
+}
+
+- (void)testReadWrite {
+ grpc_core::ExecCtx exec_ctx;
+
+ gpr_atm read;
+ grpc_closure read_done;
+ grpc_slice_buffer read_slices;
+ grpc_slice_buffer read_one_slice;
+ gpr_atm write;
+ grpc_closure write_done;
+ grpc_slice_buffer write_slices;
+
+ grpc_slice slice;
+ char write_buffer[kBufferSize];
+ char read_buffer[kBufferSize];
+ size_t recv_size = 0;
+
+ grpc_slice_buffer_init(&write_slices);
+ slice = grpc_slice_from_static_buffer(write_buffer, kBufferSize);
+ grpc_slice_buffer_add(&write_slices, slice);
+ init_event_closure(&write_done, &write);
+ grpc_endpoint_write(ep_, &write_slices, &write_done);
+
+ XCTAssertEqual([self waitForEvent:&write timeout:kWriteTimeout], YES);
+ XCTAssertEqual(reinterpret_cast<grpc_error *>(write), GRPC_ERROR_NONE);
+
+ while (recv_size < kBufferSize) {
+ ssize_t size = recv(svr_fd_, read_buffer, kBufferSize, 0);
+ XCTAssertGreaterThanOrEqual(size, 0);
+ recv_size += size;
+ }
+
+ XCTAssertEqual(recv_size, kBufferSize);
+ XCTAssertEqual(memcmp(read_buffer, write_buffer, kBufferSize), 0);
+ ssize_t send_size = send(svr_fd_, read_buffer, kBufferSize, 0);
+ XCTAssertGreaterThanOrEqual(send_size, 0);
+
+ grpc_slice_buffer_init(&read_slices);
+ grpc_slice_buffer_init(&read_one_slice);
+ while (read_slices.length < kBufferSize) {
+ init_event_closure(&read_done, &read);
+ grpc_endpoint_read(ep_, &read_one_slice, &read_done);
+ XCTAssertEqual([self waitForEvent:&read timeout:kReadTimeout], YES);
+ XCTAssertEqual(reinterpret_cast<grpc_error *>(read), GRPC_ERROR_NONE);
+ grpc_slice_buffer_move_into(&read_one_slice, &read_slices);
+ XCTAssertLessThanOrEqual(read_slices.length, kBufferSize);
+ }
+ XCTAssertTrue(compare_slice_buffer_with_buffer(&read_slices, read_buffer, kBufferSize));
+
+ grpc_endpoint_shutdown(ep_, GRPC_ERROR_NONE);
+ grpc_slice_buffer_reset_and_unref(&read_slices);
+ grpc_slice_buffer_reset_and_unref(&write_slices);
+ grpc_slice_buffer_reset_and_unref(&read_one_slice);
+}
+
+- (void)testShutdownBeforeRead {
+ grpc_core::ExecCtx exec_ctx;
+
+ gpr_atm read;
+ grpc_closure read_done;
+ grpc_slice_buffer read_slices;
+ gpr_atm write;
+ grpc_closure write_done;
+ grpc_slice_buffer write_slices;
+
+ grpc_slice slice;
+ char write_buffer[kBufferSize];
+ char read_buffer[kBufferSize];
+ size_t recv_size = 0;
+
+ grpc_slice_buffer_init(&read_slices);
+ init_event_closure(&read_done, &read);
+ grpc_endpoint_read(ep_, &read_slices, &read_done);
+
+ grpc_slice_buffer_init(&write_slices);
+ slice = grpc_slice_from_static_buffer(write_buffer, kBufferSize);
+ grpc_slice_buffer_add(&write_slices, slice);
+ init_event_closure(&write_done, &write);
+ grpc_endpoint_write(ep_, &write_slices, &write_done);
+
+ XCTAssertEqual([self waitForEvent:&write timeout:kWriteTimeout], YES);
+ XCTAssertEqual(reinterpret_cast<grpc_error *>(write), GRPC_ERROR_NONE);
+
+ while (recv_size < kBufferSize) {
+ ssize_t size = recv(svr_fd_, read_buffer, kBufferSize, 0);
+ XCTAssertGreaterThanOrEqual(size, 0);
+ recv_size += size;
+ }
+
+ XCTAssertEqual(recv_size, kBufferSize);
+ XCTAssertEqual(memcmp(read_buffer, write_buffer, kBufferSize), 0);
+
+ XCTAssertEqual([self waitForEvent:&read timeout:kReadTimeout], NO);
+
+ grpc_endpoint_shutdown(ep_, GRPC_ERROR_NONE);
+
+ grpc_core::ExecCtx::Get()->Flush();
+ XCTAssertEqual([self waitForEvent:&read timeout:kReadTimeout], YES);
+ XCTAssertNotEqual(reinterpret_cast<grpc_error *>(read), GRPC_ERROR_NONE);
+
+ grpc_slice_buffer_reset_and_unref(&read_slices);
+ grpc_slice_buffer_reset_and_unref(&write_slices);
+}
+
+- (void)testRemoteClosed {
+ grpc_core::ExecCtx exec_ctx;
+
+ gpr_atm read;
+ grpc_closure read_done;
+ grpc_slice_buffer read_slices;
+ gpr_atm write;
+ grpc_closure write_done;
+ grpc_slice_buffer write_slices;
+
+ grpc_slice slice;
+ char write_buffer[kBufferSize];
+ char read_buffer[kBufferSize];
+ size_t recv_size = 0;
+
+ init_event_closure(&read_done, &read);
+ grpc_slice_buffer_init(&read_slices);
+ grpc_endpoint_read(ep_, &read_slices, &read_done);
+
+ grpc_slice_buffer_init(&write_slices);
+ slice = grpc_slice_from_static_buffer(write_buffer, kBufferSize);
+ grpc_slice_buffer_add(&write_slices, slice);
+ init_event_closure(&write_done, &write);
+ grpc_endpoint_write(ep_, &write_slices, &write_done);
+
+ XCTAssertEqual([self waitForEvent:&write timeout:kWriteTimeout], YES);
+ XCTAssertEqual(reinterpret_cast<grpc_error *>(write), GRPC_ERROR_NONE);
+
+ while (recv_size < kBufferSize) {
+ ssize_t size = recv(svr_fd_, read_buffer, kBufferSize, 0);
+ XCTAssertGreaterThanOrEqual(size, 0);
+ recv_size += size;
+ }
+
+ XCTAssertEqual(recv_size, kBufferSize);
+ XCTAssertEqual(memcmp(read_buffer, write_buffer, kBufferSize), 0);
+
+ close(svr_fd_);
+
+ XCTAssertEqual([self waitForEvent:&read timeout:kReadTimeout], YES);
+ XCTAssertNotEqual(reinterpret_cast<grpc_error *>(read), GRPC_ERROR_NONE);
+
+ grpc_endpoint_shutdown(ep_, GRPC_ERROR_NONE);
+ grpc_slice_buffer_reset_and_unref(&read_slices);
+ grpc_slice_buffer_reset_and_unref(&write_slices);
+}
+
+- (void)testRemoteReset {
+ grpc_core::ExecCtx exec_ctx;
+
+ gpr_atm read;
+ grpc_closure read_done;
+ grpc_slice_buffer read_slices;
+
+ init_event_closure(&read_done, &read);
+ grpc_slice_buffer_init(&read_slices);
+ grpc_endpoint_read(ep_, &read_slices, &read_done);
+
+ struct linger so_linger;
+ so_linger.l_onoff = 1;
+ so_linger.l_linger = 0;
+ setsockopt(svr_fd_, SOL_SOCKET, SO_LINGER, &so_linger, sizeof(so_linger));
+
+ close(svr_fd_);
+
+ XCTAssertEqual([self waitForEvent:&read timeout:kReadTimeout], YES);
+ XCTAssertNotEqual(reinterpret_cast<grpc_error *>(read), GRPC_ERROR_NONE);
+
+ grpc_endpoint_shutdown(ep_, GRPC_ERROR_NONE);
+ grpc_slice_buffer_reset_and_unref(&read_slices);
+}
+
+@end
+
+#else // GRPC_CFSTREAM
+
+// Dummy test suite
+@interface CFStreamEndpointTests : XCTestCase
+@end
+
+@implementation CFStreamEndpointTests
+- (void)setUp {
+ [super setUp];
+}
+
+- (void)tearDown {
+ [super tearDown];
+}
+
+@end
+
+#endif // GRPC_CFSTREAM
diff --git a/test/core/iomgr/ios/CFStreamTests/CFStreamTests.xcodeproj/project.pbxproj b/test/core/iomgr/ios/CFStreamTests/CFStreamTests.xcodeproj/project.pbxproj
new file mode 100644
index 0000000000..2218f129ae
--- /dev/null
+++ b/test/core/iomgr/ios/CFStreamTests/CFStreamTests.xcodeproj/project.pbxproj
@@ -0,0 +1,338 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 48;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 5E143B892069D72200715A6E /* CFStreamClientTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5E143B882069D72200715A6E /* CFStreamClientTests.mm */; };
+ 5E143B8C206B5F9F00715A6E /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 5E143B8A2069D72700715A6E /* Info.plist */; };
+ 5E143B8E206C5B9A00715A6E /* CFStreamEndpointTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5E143B8D206C5B9A00715A6E /* CFStreamEndpointTests.mm */; };
+ 604EA96D9CD477A8EA411BDF /* libPods-CFStreamTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AFFA154D492751CEAC05D591 /* libPods-CFStreamTests.a */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 5E143B792069D67300715A6E /* CFStreamTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CFStreamTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+ 5E143B882069D72200715A6E /* CFStreamClientTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CFStreamClientTests.mm; sourceTree = "<group>"; };
+ 5E143B8A2069D72700715A6E /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ 5E143B8D206C5B9A00715A6E /* CFStreamEndpointTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CFStreamEndpointTests.mm; sourceTree = "<group>"; };
+ 8CB4409E07E180CCA59987DF /* Pods-CFStreamTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CFStreamTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-CFStreamTests/Pods-CFStreamTests.release.xcconfig"; sourceTree = "<group>"; };
+ 9E3FAF9DA6B98ED4FE6D6848 /* Pods-CFStreamTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CFStreamTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CFStreamTests/Pods-CFStreamTests.debug.xcconfig"; sourceTree = "<group>"; };
+ AFFA154D492751CEAC05D591 /* libPods-CFStreamTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-CFStreamTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 5E143B762069D67300715A6E /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 604EA96D9CD477A8EA411BDF /* libPods-CFStreamTests.a in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 5E143B582069D67300715A6E = {
+ isa = PBXGroup;
+ children = (
+ 5E143B8D206C5B9A00715A6E /* CFStreamEndpointTests.mm */,
+ 5E143B8A2069D72700715A6E /* Info.plist */,
+ 5E143B882069D72200715A6E /* CFStreamClientTests.mm */,
+ 5E143B622069D67300715A6E /* Products */,
+ A331D95F7F230B507FBF6D22 /* Pods */,
+ 6AC36F6C5DB5CA8F717D1B67 /* Frameworks */,
+ );
+ sourceTree = "<group>";
+ };
+ 5E143B622069D67300715A6E /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 5E143B792069D67300715A6E /* CFStreamTests.xctest */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 6AC36F6C5DB5CA8F717D1B67 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ AFFA154D492751CEAC05D591 /* libPods-CFStreamTests.a */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ A331D95F7F230B507FBF6D22 /* Pods */ = {
+ isa = PBXGroup;
+ children = (
+ 9E3FAF9DA6B98ED4FE6D6848 /* Pods-CFStreamTests.debug.xcconfig */,
+ 8CB4409E07E180CCA59987DF /* Pods-CFStreamTests.release.xcconfig */,
+ );
+ name = Pods;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 5E143B782069D67300715A6E /* CFStreamTests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 5E143B852069D67300715A6E /* Build configuration list for PBXNativeTarget "CFStreamTests" */;
+ buildPhases = (
+ 4EBA55D3E23FC6C84596E3D5 /* [CP] Check Pods Manifest.lock */,
+ 5E143B752069D67300715A6E /* Sources */,
+ 5E143B762069D67300715A6E /* Frameworks */,
+ 5E143B772069D67300715A6E /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = CFStreamTests;
+ productName = CFStreamTestsTests;
+ productReference = 5E143B792069D67300715A6E /* CFStreamTests.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 5E143B592069D67300715A6E /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0920;
+ ORGANIZATIONNAME = gRPC;
+ TargetAttributes = {
+ 5E143B782069D67300715A6E = {
+ CreatedOnToolsVersion = 9.2;
+ ProvisioningStyle = Automatic;
+ };
+ };
+ };
+ buildConfigurationList = 5E143B5C2069D67300715A6E /* Build configuration list for PBXProject "CFStreamTests" */;
+ compatibilityVersion = "Xcode 8.0";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ Base,
+ );
+ mainGroup = 5E143B582069D67300715A6E;
+ productRefGroup = 5E143B622069D67300715A6E /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 5E143B782069D67300715A6E /* CFStreamTests */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 5E143B772069D67300715A6E /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 5E143B8C206B5F9F00715A6E /* Info.plist in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ 4EBA55D3E23FC6C84596E3D5 /* [CP] Check Pods Manifest.lock */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+ "${PODS_ROOT}/Manifest.lock",
+ );
+ name = "[CP] Check Pods Manifest.lock";
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/Pods-CFStreamTests-checkManifestLockResult.txt",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
+ showEnvVarsInLog = 0;
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 5E143B752069D67300715A6E /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 5E143B892069D72200715A6E /* CFStreamClientTests.mm in Sources */,
+ 5E143B8E206C5B9A00715A6E /* CFStreamEndpointTests.mm in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ 5E143B802069D67300715A6E /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.2;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ };
+ name = Debug;
+ };
+ 5E143B812069D67300715A6E /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.2;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ SDKROOT = iphoneos;
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 5E143B862069D67300715A6E /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 9E3FAF9DA6B98ED4FE6D6848 /* Pods-CFStreamTests.debug.xcconfig */;
+ buildSettings = {
+ CODE_SIGN_STYLE = Automatic;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "$(inherited)",
+ "COCOAPODS=1",
+ "$(inherited)",
+ "PB_FIELD_32BIT=1",
+ "PB_NO_PACKED_STRUCTS=1",
+ "GRPC_CFSTREAM=1",
+ );
+ INFOPLIST_FILE = Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = io.grpc.CFStreamTestsTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ USER_HEADER_SEARCH_PATHS = ../../../../..;
+ };
+ name = Debug;
+ };
+ 5E143B872069D67300715A6E /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 8CB4409E07E180CCA59987DF /* Pods-CFStreamTests.release.xcconfig */;
+ buildSettings = {
+ CODE_SIGN_STYLE = Automatic;
+ INFOPLIST_FILE = Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = io.grpc.CFStreamTestsTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ USER_HEADER_SEARCH_PATHS = ../../../../..;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 5E143B5C2069D67300715A6E /* Build configuration list for PBXProject "CFStreamTests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 5E143B802069D67300715A6E /* Debug */,
+ 5E143B812069D67300715A6E /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 5E143B852069D67300715A6E /* Build configuration list for PBXNativeTarget "CFStreamTests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 5E143B862069D67300715A6E /* Debug */,
+ 5E143B872069D67300715A6E /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 5E143B592069D67300715A6E /* Project object */;
+}
diff --git a/test/core/iomgr/ios/CFStreamTests/CFStreamTests.xcodeproj/xcshareddata/xcschemes/CFStreamTests.xcscheme b/test/core/iomgr/ios/CFStreamTests/CFStreamTests.xcodeproj/xcshareddata/xcschemes/CFStreamTests.xcscheme
new file mode 100644
index 0000000000..25d6f780a1
--- /dev/null
+++ b/test/core/iomgr/ios/CFStreamTests/CFStreamTests.xcodeproj/xcshareddata/xcschemes/CFStreamTests.xcscheme
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0920"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ </BuildAction>
+ <TestAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES">
+ <Testables>
+ <TestableReference
+ skipped = "NO">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "5E143B782069D67300715A6E"
+ BuildableName = "CFStreamTests.xctest"
+ BlueprintName = "CFStreamTests"
+ ReferencedContainer = "container:CFStreamTests.xcodeproj">
+ </BuildableReference>
+ </TestableReference>
+ </Testables>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </TestAction>
+ <LaunchAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
+ allowLocationSimulation = "YES">
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ buildConfiguration = "Release"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ debugDocumentVersioning = "YES">
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
diff --git a/test/core/iomgr/ios/CFStreamTests/CFStreamTests.xcodeproj/xcshareddata/xcschemes/CFStreamTests_Asan.xcscheme b/test/core/iomgr/ios/CFStreamTests/CFStreamTests.xcodeproj/xcshareddata/xcschemes/CFStreamTests_Asan.xcscheme
new file mode 100644
index 0000000000..6c5c43aa72
--- /dev/null
+++ b/test/core/iomgr/ios/CFStreamTests/CFStreamTests.xcodeproj/xcshareddata/xcschemes/CFStreamTests_Asan.xcscheme
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0920"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ </BuildAction>
+ <TestAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ enableAddressSanitizer = "YES"
+ enableASanStackUseAfterReturn = "YES"
+ language = ""
+ shouldUseLaunchSchemeArgsEnv = "YES">
+ <Testables>
+ <TestableReference
+ skipped = "NO">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "5E143B782069D67300715A6E"
+ BuildableName = "CFStreamTests.xctest"
+ BlueprintName = "CFStreamTests"
+ ReferencedContainer = "container:CFStreamTests.xcodeproj">
+ </BuildableReference>
+ </TestableReference>
+ </Testables>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </TestAction>
+ <LaunchAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ enableASanStackUseAfterReturn = "YES"
+ language = ""
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
+ allowLocationSimulation = "YES">
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ buildConfiguration = "Release"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ debugDocumentVersioning = "YES">
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
diff --git a/test/core/iomgr/ios/CFStreamTests/CFStreamTests.xcodeproj/xcshareddata/xcschemes/CFStreamTests_Msan.xcscheme b/test/core/iomgr/ios/CFStreamTests/CFStreamTests.xcodeproj/xcshareddata/xcschemes/CFStreamTests_Msan.xcscheme
new file mode 100644
index 0000000000..3e39ff84d0
--- /dev/null
+++ b/test/core/iomgr/ios/CFStreamTests/CFStreamTests.xcodeproj/xcshareddata/xcschemes/CFStreamTests_Msan.xcscheme
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0920"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ </BuildAction>
+ <TestAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ language = ""
+ shouldUseLaunchSchemeArgsEnv = "YES">
+ <Testables>
+ <TestableReference
+ skipped = "NO">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "5E143B782069D67300715A6E"
+ BuildableName = "CFStreamTests.xctest"
+ BlueprintName = "CFStreamTests"
+ ReferencedContainer = "container:CFStreamTests.xcodeproj">
+ </BuildableReference>
+ </TestableReference>
+ </Testables>
+ <AdditionalOptions>
+ <AdditionalOption
+ key = "DYLD_INSERT_LIBRARIES"
+ value = "/usr/lib/libgmalloc.dylib"
+ isEnabled = "YES">
+ </AdditionalOption>
+ <AdditionalOption
+ key = "NSZombieEnabled"
+ value = "YES"
+ isEnabled = "YES">
+ </AdditionalOption>
+ <AdditionalOption
+ key = "MallocGuardEdges"
+ value = ""
+ isEnabled = "YES">
+ </AdditionalOption>
+ <AdditionalOption
+ key = "MallocScribble"
+ value = ""
+ isEnabled = "YES">
+ </AdditionalOption>
+ </AdditionalOptions>
+ </TestAction>
+ <LaunchAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ language = ""
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
+ allowLocationSimulation = "YES">
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ buildConfiguration = "Release"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ debugDocumentVersioning = "YES">
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
diff --git a/test/core/iomgr/ios/CFStreamTests/CFStreamTests.xcodeproj/xcshareddata/xcschemes/CFStreamTests_Tsan.xcscheme b/test/core/iomgr/ios/CFStreamTests/CFStreamTests.xcodeproj/xcshareddata/xcschemes/CFStreamTests_Tsan.xcscheme
new file mode 100644
index 0000000000..f0bde837c5
--- /dev/null
+++ b/test/core/iomgr/ios/CFStreamTests/CFStreamTests.xcodeproj/xcshareddata/xcschemes/CFStreamTests_Tsan.xcscheme
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0920"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ </BuildAction>
+ <TestAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ enableThreadSanitizer = "YES"
+ language = ""
+ shouldUseLaunchSchemeArgsEnv = "YES">
+ <Testables>
+ <TestableReference
+ skipped = "NO">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "5E143B782069D67300715A6E"
+ BuildableName = "CFStreamTests.xctest"
+ BlueprintName = "CFStreamTests"
+ ReferencedContainer = "container:CFStreamTests.xcodeproj">
+ </BuildableReference>
+ </TestableReference>
+ </Testables>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </TestAction>
+ <LaunchAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ language = ""
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ stopOnEveryThreadSanitizerIssue = "YES"
+ debugServiceExtension = "internal"
+ allowLocationSimulation = "YES">
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ buildConfiguration = "Release"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ debugDocumentVersioning = "YES">
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
diff --git a/test/core/iomgr/ios/CFStreamTests/Info.plist b/test/core/iomgr/ios/CFStreamTests/Info.plist
new file mode 100644
index 0000000000..6c40a6cd0c
--- /dev/null
+++ b/test/core/iomgr/ios/CFStreamTests/Info.plist
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>$(DEVELOPMENT_LANGUAGE)</string>
+ <key>CFBundleExecutable</key>
+ <string>$(EXECUTABLE_NAME)</string>
+ <key>CFBundleIdentifier</key>
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>$(PRODUCT_NAME)</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+</dict>
+</plist>
diff --git a/test/core/iomgr/ios/CFStreamTests/Podfile b/test/core/iomgr/ios/CFStreamTests/Podfile
new file mode 100644
index 0000000000..630168a363
--- /dev/null
+++ b/test/core/iomgr/ios/CFStreamTests/Podfile
@@ -0,0 +1,50 @@
+source 'https://github.com/CocoaPods/Specs.git'
+platform :ios, '8.0'
+
+install! 'cocoapods', :deterministic_uuids => false
+
+# Location of gRPC's repo root relative to this file.
+GRPC_LOCAL_SRC = '../../../../..'
+
+# Install the dependencies in the main target plus all test targets.
+target 'CFStreamTests' do
+ pod 'gRPC-Core/CFStream-Implementation', :path => GRPC_LOCAL_SRC
+end
+
+pre_install do |installer|
+ # This is the gRPC-Core podspec object, as initialized by its podspec file.
+ grpc_core_spec = installer.pod_targets.find{|t| t.name == 'gRPC-Core'}.root_spec
+
+ # Copied from gRPC-Core.podspec, except for the adjusted src_root:
+ src_root = "$(PODS_ROOT)/../#{GRPC_LOCAL_SRC}"
+ grpc_core_spec.pod_target_xcconfig = {
+ 'GRPC_SRC_ROOT' => src_root,
+ 'HEADER_SEARCH_PATHS' => '"$(inherited)" "$(GRPC_SRC_ROOT)/include"',
+ 'USER_HEADER_SEARCH_PATHS' => '"$(GRPC_SRC_ROOT)"',
+ # If we don't set these two settings, `include/grpc/support/time.h` and
+ # `src/core/lib/gpr/string.h` shadow the system `<time.h>` and `<string.h>`, breaking the
+ # build.
+ 'USE_HEADERMAP' => 'NO',
+ 'ALWAYS_SEARCH_USER_PATHS' => 'NO',
+ }
+end
+
+post_install do |installer|
+ installer.pods_project.targets.each do |target|
+ target.build_configurations.each do |config|
+ config.build_settings['GCC_TREAT_WARNINGS_AS_ERRORS'] = 'YES'
+ end
+
+ # CocoaPods creates duplicated library targets of gRPC-Core when the test targets include
+ # non-default subspecs of gRPC-Core. All of these library targets start with prefix 'gRPC-Core'
+ # and require the same error suppresion.
+ if target.name.start_with?('gRPC-Core')
+ target.build_configurations.each do |config|
+ # TODO(zyc): Remove this setting after the issue is resolved
+ # GPR_UNREACHABLE_CODE causes "Control may reach end of non-void
+ # function" warning
+ config.build_settings['GCC_WARN_ABOUT_RETURN_TYPE'] = 'NO'
+ end
+ end
+ end
+end
diff --git a/test/core/iomgr/ios/CFStreamTests/build_tests.sh b/test/core/iomgr/ios/CFStreamTests/build_tests.sh
new file mode 100755
index 0000000000..d23f26f5db
--- /dev/null
+++ b/test/core/iomgr/ios/CFStreamTests/build_tests.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+# Copyright 2018 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Don't run this script standalone. Instead, run from the repository root:
+# ./tools/run_tests/run_tests.py -l objc
+
+set -e
+
+# CocoaPods requires the terminal to be using UTF-8 encoding.
+export LANG=en_US.UTF-8
+
+cd "$(dirname "$0")"
+
+hash pod 2>/dev/null || { echo >&2 "Cocoapods needs to be installed."; exit 1; }
+hash xcodebuild 2>/dev/null || {
+ echo >&2 "XCode command-line tools need to be installed."
+ exit 1
+}
+
+# clean the directory
+rm -rf Pods
+rm -rf CFStreamTests.xcworkspace
+rm -f Podfile.lock
+
+echo "TIME: $(date)"
+pod install
+
diff --git a/test/core/iomgr/ios/CFStreamTests/run_tests.sh b/test/core/iomgr/ios/CFStreamTests/run_tests.sh
new file mode 100755
index 0000000000..1045ec10a8
--- /dev/null
+++ b/test/core/iomgr/ios/CFStreamTests/run_tests.sh
@@ -0,0 +1,67 @@
+#!/bin/bash
+# Copyright 2018 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Don't run this script standalone. Instead, run from the repository root:
+# ./tools/run_tests/run_tests.py -l objc
+
+set -ev
+
+cd "$(dirname "$0")"
+
+echo "TIME: $(date)"
+
+XCODEBUILD_FILTER='(^CompileC |^Ld |^ *[^ ]*clang |^ *cd |^ *export |^Libtool |^ *[^ ]*libtool |^CpHeader |^ *builtin-copy )'
+
+xcodebuild \
+ -workspace CFStreamTests.xcworkspace \
+ -scheme CFStreamTests \
+ -destination name="iPhone 8" \
+ test \
+ | egrep -v "$XCODEBUILD_FILTER" \
+ | egrep -v '^$' \
+ | egrep -v "(GPBDictionary|GPBArray)" -
+
+echo "TIME: $(date)"
+
+xcodebuild \
+ -workspace CFStreamTests.xcworkspace \
+ -scheme CFStreamTests_Asan \
+ -destination name="iPhone 8" \
+ test \
+ | egrep -v "$XCODEBUILD_FILTER" \
+ | egrep -v '^$' \
+ | egrep -v "(GPBDictionary|GPBArray)" -
+
+echo "TIME: $(date)"
+
+xcodebuild \
+ -workspace CFStreamTests.xcworkspace \
+ -scheme CFStreamTests_Tsan \
+ -destination name="iPhone 8" \
+ test \
+ | egrep -v "$XCODEBUILD_FILTER" \
+ | egrep -v '^$' \
+ | egrep -v "(GPBDictionary|GPBArray)" -
+
+echo "TIME: $(date)"
+
+xcodebuild \
+ -workspace CFStreamTests.xcworkspace \
+ -scheme CFStreamTests_Msan \
+ -destination name="iPhone 8" \
+ test \
+ | egrep -v "$XCODEBUILD_FILTER" \
+ | egrep -v '^$' \
+ | egrep -v "(GPBDictionary|GPBArray)" -
diff --git a/test/core/iomgr/pollset_set_test.cc b/test/core/iomgr/pollset_set_test.cc
index 0dc75a5f3f..1aae1daa02 100644
--- a/test/core/iomgr/pollset_set_test.cc
+++ b/test/core/iomgr/pollset_set_test.cc
@@ -118,7 +118,7 @@ static void init_test_fds(test_fd* tfds, const int num_fds) {
for (int i = 0; i < num_fds; i++) {
GPR_ASSERT(GRPC_ERROR_NONE == grpc_wakeup_fd_init(&tfds[i].wakeup_fd));
tfds[i].fd = grpc_fd_create(GRPC_WAKEUP_FD_GET_READ_FD(&tfds[i].wakeup_fd),
- "test_fd");
+ "test_fd", false);
reset_test_fd(&tfds[i]);
}
}
@@ -136,8 +136,7 @@ static void cleanup_test_fds(test_fd* tfds, const int num_fds) {
* grpc_wakeup_fd and we would like to destroy it ourselves (by calling
* grpc_wakeup_fd_destroy). To prevent grpc_fd from calling close() on the
* underlying fd, call it with a non-NULL 'release_fd' parameter */
- grpc_fd_orphan(tfds[i].fd, nullptr, &release_fd, false /* already_closed */,
- "test_fd_cleanup");
+ grpc_fd_orphan(tfds[i].fd, nullptr, &release_fd, "test_fd_cleanup");
grpc_core::ExecCtx::Get()->Flush();
grpc_wakeup_fd_destroy(&tfds[i].wakeup_fd);
diff --git a/test/core/iomgr/tcp_posix_test.cc b/test/core/iomgr/tcp_posix_test.cc
index f4df6fca23..3e87831e44 100644
--- a/test/core/iomgr/tcp_posix_test.cc
+++ b/test/core/iomgr/tcp_posix_test.cc
@@ -176,7 +176,8 @@ static void read_test(size_t num_bytes, size_t slice_size) {
a[0].type = GRPC_ARG_INTEGER,
a[0].value.integer = static_cast<int>(slice_size);
grpc_channel_args args = {GPR_ARRAY_SIZE(a), a};
- ep = grpc_tcp_create(grpc_fd_create(sv[1], "read_test"), &args, "test");
+ ep =
+ grpc_tcp_create(grpc_fd_create(sv[1], "read_test", false), &args, "test");
grpc_endpoint_add_to_pollset(ep, g_pollset);
written_bytes = fill_socket_partial(sv[0], num_bytes);
@@ -226,7 +227,8 @@ static void large_read_test(size_t slice_size) {
a[0].type = GRPC_ARG_INTEGER;
a[0].value.integer = static_cast<int>(slice_size);
grpc_channel_args args = {GPR_ARRAY_SIZE(a), a};
- ep = grpc_tcp_create(grpc_fd_create(sv[1], "large_read_test"), &args, "test");
+ ep = grpc_tcp_create(grpc_fd_create(sv[1], "large_read_test", false), &args,
+ "test");
grpc_endpoint_add_to_pollset(ep, g_pollset);
written_bytes = fill_socket(sv[0]);
@@ -365,7 +367,8 @@ static void write_test(size_t num_bytes, size_t slice_size) {
a[0].type = GRPC_ARG_INTEGER,
a[0].value.integer = static_cast<int>(slice_size);
grpc_channel_args args = {GPR_ARRAY_SIZE(a), a};
- ep = grpc_tcp_create(grpc_fd_create(sv[1], "write_test"), &args, "test");
+ ep = grpc_tcp_create(grpc_fd_create(sv[1], "write_test", false), &args,
+ "test");
grpc_endpoint_add_to_pollset(ep, g_pollset);
state.ep = ep;
@@ -433,7 +436,8 @@ static void release_fd_test(size_t num_bytes, size_t slice_size) {
a[0].type = GRPC_ARG_INTEGER;
a[0].value.integer = static_cast<int>(slice_size);
grpc_channel_args args = {GPR_ARRAY_SIZE(a), a};
- ep = grpc_tcp_create(grpc_fd_create(sv[1], "read_test"), &args, "test");
+ ep =
+ grpc_tcp_create(grpc_fd_create(sv[1], "read_test", false), &args, "test");
GPR_ASSERT(grpc_tcp_fd(ep) == sv[1] && sv[1] >= 0);
grpc_endpoint_add_to_pollset(ep, g_pollset);
@@ -522,10 +526,10 @@ static grpc_endpoint_test_fixture create_fixture_tcp_socketpair(
a[0].type = GRPC_ARG_INTEGER;
a[0].value.integer = static_cast<int>(slice_size);
grpc_channel_args args = {GPR_ARRAY_SIZE(a), a};
- f.client_ep =
- grpc_tcp_create(grpc_fd_create(sv[0], "fixture:client"), &args, "test");
- f.server_ep =
- grpc_tcp_create(grpc_fd_create(sv[1], "fixture:server"), &args, "test");
+ f.client_ep = grpc_tcp_create(grpc_fd_create(sv[0], "fixture:client", false),
+ &args, "test");
+ f.server_ep = grpc_tcp_create(grpc_fd_create(sv[1], "fixture:server", false),
+ &args, "test");
grpc_resource_quota_unref_internal(resource_quota);
grpc_endpoint_add_to_pollset(f.client_ep, g_pollset);
grpc_endpoint_add_to_pollset(f.server_ep, g_pollset);
diff --git a/test/core/security/BUILD b/test/core/security/BUILD
index 70bcc8c9c3..12aa84d93b 100644
--- a/test/core/security/BUILD
+++ b/test/core/security/BUILD
@@ -183,6 +183,7 @@ grpc_cc_test(
"//:gpr",
"//:gpr_base",
"//:grpc",
+ "//test/core/util:gpr_test_util",
],
)
@@ -195,6 +196,7 @@ grpc_cc_test(
"//:gpr",
"//:gpr_base",
"//:grpc",
+ "//test/core/util:gpr_test_util",
],
)
@@ -206,6 +208,7 @@ grpc_cc_test(
"//:alts_util",
"//:gpr",
"//:grpc",
+ "//test/core/util:gpr_test_util",
],
)
@@ -220,5 +223,6 @@ grpc_cc_test(
"//:grpc_secure",
"//:tsi",
"//:tsi_interface",
+ "//test/core/util:gpr_test_util",
],
)
diff --git a/test/core/statistics/census_log_tests.h b/test/core/statistics/census_log_tests.h
deleted file mode 100644
index ed808636e3..0000000000
--- a/test/core/statistics/census_log_tests.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_TEST_CORE_STATISTICS_CENSUS_LOG_TESTS_H
-#define GRPC_TEST_CORE_STATISTICS_CENSUS_LOG_TESTS_H
-
-void test_invalid_record_size();
-void test_end_write_with_different_size();
-void test_read_pending_record();
-void test_read_beyond_pending_record();
-void test_detached_while_reading();
-void test_fill_log_no_fragmentation();
-void test_fill_circular_log_no_fragmentation();
-void test_fill_log_with_straddling_records();
-void test_fill_circular_log_with_straddling_records();
-void test_multiple_writers_circular_log();
-void test_multiple_writers();
-void test_performance();
-void test_small_log();
-
-#endif /* GRPC_TEST_CORE_STATISTICS_CENSUS_LOG_TESTS_H */
diff --git a/test/core/statistics/census_stub_test.cc b/test/core/statistics/census_stub_test.cc
deleted file mode 100644
index 507ae0a9fa..0000000000
--- a/test/core/statistics/census_stub_test.cc
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include "src/core/ext/census/census_interface.h"
-#include "src/core/ext/census/census_rpc_stats.h"
-#include "test/core/util/test_config.h"
-
-/* Tests census noop stubs in a simulated rpc flow */
-void test_census_stubs(void) {
- census_op_id op_id;
- census_rpc_stats* stats = census_rpc_stats_create_empty();
- census_aggregated_rpc_stats data_map = {0, NULL};
-
- /* Initializes census library at server start up time. */
- census_init();
- /* Starts tracing at the beginning of a rpc. */
- op_id = census_tracing_start_op();
- /* Appends custom annotations on a trace object. */
- census_tracing_print(op_id, "annotation foo");
- census_tracing_print(op_id, "annotation bar");
- /* Appends method tag on the trace object. */
- census_add_method_tag(op_id, "service_foo/method.bar");
- /* Either record client side stats or server side stats associated with the
- op_id. Here for testing purpose, we record both. */
- census_record_rpc_client_stats(op_id, stats);
- census_record_rpc_server_stats(op_id, stats);
- /* Ends a tracing. */
- census_tracing_end_op(op_id);
- /* In process stats queries. */
- census_get_server_stats(&data_map);
- census_aggregated_rpc_stats_set_empty(&data_map);
- census_get_client_stats(&data_map);
- census_aggregated_rpc_stats_set_empty(&data_map);
- gpr_free(stats);
- census_shutdown();
-}
-
-int main(int argc, char** argv) {
- grpc_test_init(argc, argv);
- test_census_stubs();
- return 0;
-}
diff --git a/test/core/statistics/performance_test.cc b/test/core/statistics/performance_test.cc
deleted file mode 100644
index 9d4fd6ef90..0000000000
--- a/test/core/statistics/performance_test.cc
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/statistics/census_log_tests.h"
-
-#include <stdlib.h>
-
-#include <grpc/support/time.h>
-#include "test/core/util/test_config.h"
-
-int main(int argc, char** argv) {
- grpc_test_init(argc, argv);
- srand(gpr_now(GPR_CLOCK_REALTIME).tv_nsec);
- test_performance();
- return 0;
-}
diff --git a/test/core/statistics/quick_test.cc b/test/core/statistics/quick_test.cc
deleted file mode 100644
index 91ecdde818..0000000000
--- a/test/core/statistics/quick_test.cc
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/statistics/census_log_tests.h"
-
-#include <stdlib.h>
-
-#include <grpc/support/time.h>
-#include "test/core/util/test_config.h"
-
-int main(int argc, char** argv) {
- grpc_test_init(argc, argv);
- srand(gpr_now(GPR_CLOCK_REALTIME).tv_nsec);
- test_invalid_record_size();
- test_end_write_with_different_size();
- test_read_pending_record();
- test_read_beyond_pending_record();
- test_detached_while_reading();
- test_fill_log_no_fragmentation();
- test_fill_circular_log_no_fragmentation();
- test_fill_log_with_straddling_records();
- test_fill_circular_log_with_straddling_records();
- return 0;
-}
diff --git a/test/core/statistics/rpc_stats_test.cc b/test/core/statistics/rpc_stats_test.cc
deleted file mode 100644
index a2a648e2ad..0000000000
--- a/test/core/statistics/rpc_stats_test.cc
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/port_platform.h>
-#include <grpc/support/string.h>
-#include <grpc/support/time.h>
-
-#include "src/core/ext/census/census_interface.h"
-#include "src/core/ext/census/census_rpc_stats.h"
-#include "src/core/ext/census/census_tracing.h"
-#include "test/core/util/test_config.h"
-
-/* Ensure all possible state transitions are called without causing problem */
-static void test_init_shutdown(void) {
- census_stats_store_init();
- census_stats_store_init();
- census_stats_store_shutdown();
- census_stats_store_shutdown();
- census_stats_store_init();
-}
-
-static void test_create_and_destroy(void) {
- census_rpc_stats* stats = NULL;
- census_aggregated_rpc_stats agg_stats = {0, NULL};
-
- stats = census_rpc_stats_create_empty();
- GPR_ASSERT(stats != NULL);
- GPR_ASSERT(stats->cnt == 0 && stats->rpc_error_cnt == 0 &&
- stats->app_error_cnt == 0 && stats->elapsed_time_ms == 0.0 &&
- stats->api_request_bytes == 0 && stats->wire_request_bytes == 0 &&
- stats->api_response_bytes == 0 && stats->wire_response_bytes == 0);
- gpr_free(stats);
-
- census_aggregated_rpc_stats_set_empty(&agg_stats);
- GPR_ASSERT(agg_stats.num_entries == 0);
- GPR_ASSERT(agg_stats.stats == NULL);
- agg_stats.num_entries = 1;
- agg_stats.stats = (census_per_method_rpc_stats*)gpr_malloc(
- sizeof(census_per_method_rpc_stats));
- agg_stats.stats[0].method = gpr_strdup("foo");
- census_aggregated_rpc_stats_set_empty(&agg_stats);
- GPR_ASSERT(agg_stats.num_entries == 0);
- GPR_ASSERT(agg_stats.stats == NULL);
-}
-
-#define ASSERT_NEAR(a, b) \
- GPR_ASSERT((a - b) * (a - b) < 1e-24 * (a + b) * (a + b))
-
-static void test_record_and_get_stats(void) {
- census_rpc_stats stats = {1, 2, 3, 4, 5.1, 6.2, 7.3, 8.4};
- census_op_id id;
- census_aggregated_rpc_stats agg_stats = {0, NULL};
-
- /* Record client stats twice with the same op_id. */
- census_init();
- id = census_tracing_start_op();
- census_add_method_tag(id, "m1");
- census_record_rpc_client_stats(id, &stats);
- census_record_rpc_client_stats(id, &stats);
- census_tracing_end_op(id);
- /* Server stats expect to be empty */
- census_get_server_stats(&agg_stats);
- GPR_ASSERT(agg_stats.num_entries == 0);
- GPR_ASSERT(agg_stats.stats == NULL);
- /* Client stats expect to have one entry */
- census_get_client_stats(&agg_stats);
- GPR_ASSERT(agg_stats.num_entries == 1);
- GPR_ASSERT(agg_stats.stats != NULL);
- GPR_ASSERT(strcmp(agg_stats.stats[0].method, "m1") == 0);
- GPR_ASSERT(agg_stats.stats[0].minute_stats.cnt == 2 &&
- agg_stats.stats[0].hour_stats.cnt == 2 &&
- agg_stats.stats[0].total_stats.cnt == 2);
- ASSERT_NEAR(agg_stats.stats[0].minute_stats.wire_response_bytes, 16.8);
- ASSERT_NEAR(agg_stats.stats[0].hour_stats.wire_response_bytes, 16.8);
- ASSERT_NEAR(agg_stats.stats[0].total_stats.wire_response_bytes, 16.8);
- /* Get stats again, results should be the same. */
- census_get_client_stats(&agg_stats);
- GPR_ASSERT(agg_stats.num_entries == 1);
- census_aggregated_rpc_stats_set_empty(&agg_stats);
- census_shutdown();
-
- /* Record both server (once) and client (twice) stats with different op_ids.
- */
- census_init();
- id = census_tracing_start_op();
- census_add_method_tag(id, "m2");
- census_record_rpc_client_stats(id, &stats);
- census_tracing_end_op(id);
- id = census_tracing_start_op();
- census_add_method_tag(id, "m3");
- census_record_rpc_server_stats(id, &stats);
- census_tracing_end_op(id);
- id = census_tracing_start_op();
- census_add_method_tag(id, "m4");
- census_record_rpc_client_stats(id, &stats);
- census_tracing_end_op(id);
- /* Check server stats */
- census_get_server_stats(&agg_stats);
- GPR_ASSERT(agg_stats.num_entries == 1);
- GPR_ASSERT(strcmp(agg_stats.stats[0].method, "m3") == 0);
- GPR_ASSERT(agg_stats.stats[0].minute_stats.app_error_cnt == 3 &&
- agg_stats.stats[0].hour_stats.app_error_cnt == 3 &&
- agg_stats.stats[0].total_stats.app_error_cnt == 3);
- census_aggregated_rpc_stats_set_empty(&agg_stats);
- /* Check client stats */
- census_get_client_stats(&agg_stats);
- GPR_ASSERT(agg_stats.num_entries == 2);
- GPR_ASSERT(agg_stats.stats != NULL);
- GPR_ASSERT((strcmp(agg_stats.stats[0].method, "m2") == 0 &&
- strcmp(agg_stats.stats[1].method, "m4") == 0) ||
- (strcmp(agg_stats.stats[0].method, "m4") == 0 &&
- strcmp(agg_stats.stats[1].method, "m2") == 0));
- GPR_ASSERT(agg_stats.stats[0].minute_stats.cnt == 1 &&
- agg_stats.stats[1].minute_stats.cnt == 1);
- census_aggregated_rpc_stats_set_empty(&agg_stats);
- census_shutdown();
-}
-
-static void test_record_stats_on_unknown_op_id(void) {
- census_op_id unknown_id = {0xDEAD, 0xBEEF};
- census_rpc_stats stats = {1, 2, 3, 4, 5.1, 6.2, 7.3, 8.4};
- census_aggregated_rpc_stats agg_stats = {0, NULL};
-
- census_init();
- /* Tests that recording stats against unknown id is noop. */
- census_record_rpc_client_stats(unknown_id, &stats);
- census_record_rpc_server_stats(unknown_id, &stats);
- census_get_server_stats(&agg_stats);
- GPR_ASSERT(agg_stats.num_entries == 0);
- GPR_ASSERT(agg_stats.stats == NULL);
- census_get_client_stats(&agg_stats);
- GPR_ASSERT(agg_stats.num_entries == 0);
- GPR_ASSERT(agg_stats.stats == NULL);
- census_aggregated_rpc_stats_set_empty(&agg_stats);
- census_shutdown();
-}
-
-/* Test that record stats is noop when trace store is uninitialized. */
-static void test_record_stats_with_trace_store_uninitialized(void) {
- census_rpc_stats stats = {1, 2, 3, 4, 5.1, 6.2, 7.3, 8.4};
- census_op_id id = {0, 0};
- census_aggregated_rpc_stats agg_stats = {0, NULL};
-
- census_init();
- id = census_tracing_start_op();
- census_add_method_tag(id, "m");
- census_tracing_end_op(id);
- /* shuts down trace store only. */
- census_tracing_shutdown();
- census_record_rpc_client_stats(id, &stats);
- census_get_client_stats(&agg_stats);
- GPR_ASSERT(agg_stats.num_entries == 0);
- census_stats_store_shutdown();
-}
-
-int main(int argc, char** argv) {
- grpc_test_init(argc, argv);
- test_init_shutdown();
- test_create_and_destroy();
- test_record_and_get_stats();
- test_record_stats_on_unknown_op_id();
- test_record_stats_with_trace_store_uninitialized();
- return 0;
-}
diff --git a/test/core/statistics/small_log_test.cc b/test/core/statistics/small_log_test.cc
deleted file mode 100644
index fb8dfc9988..0000000000
--- a/test/core/statistics/small_log_test.cc
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/statistics/census_log_tests.h"
-
-#include <stdlib.h>
-
-#include <grpc/support/time.h>
-#include "test/core/util/test_config.h"
-
-int main(int argc, char** argv) {
- grpc_test_init(argc, argv);
- srand(gpr_now(GPR_CLOCK_REALTIME).tv_nsec);
- test_small_log();
- return 0;
-}
diff --git a/test/core/surface/num_external_connectivity_watchers_test.cc b/test/core/surface/num_external_connectivity_watchers_test.cc
index 467deeeaec..7b7a0b6dfc 100644
--- a/test/core/surface/num_external_connectivity_watchers_test.cc
+++ b/test/core/surface/num_external_connectivity_watchers_test.cc
@@ -168,7 +168,7 @@ static const test_fixture insecure_test = {
static grpc_channel* secure_test_create_channel(const char* addr) {
grpc_channel_credentials* ssl_creds =
- grpc_ssl_credentials_create(test_root_cert, nullptr, nullptr);
+ grpc_ssl_credentials_create(test_root_cert, nullptr, nullptr, nullptr);
grpc_arg ssl_name_override = {
GRPC_ARG_STRING,
const_cast<char*>(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG),
diff --git a/test/core/surface/public_headers_must_be_c89.c b/test/core/surface/public_headers_must_be_c89.c
index 52a1b03998..bad28fef5b 100644
--- a/test/core/surface/public_headers_must_be_c89.c
+++ b/test/core/surface/public_headers_must_be_c89.c
@@ -40,7 +40,6 @@
#include <grpc/impl/codegen/sync.h>
#include <grpc/impl/codegen/sync_custom.h>
#include <grpc/impl/codegen/sync_generic.h>
-#include <grpc/load_reporting.h>
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
#include <grpc/status.h>
@@ -106,8 +105,6 @@ int main(int argc, char **argv) {
printf("%lx", (unsigned long) grpc_insecure_channel_create);
printf("%lx", (unsigned long) grpc_lame_client_channel_create);
printf("%lx", (unsigned long) grpc_channel_destroy);
- printf("%lx", (unsigned long) grpc_channel_get_trace);
- printf("%lx", (unsigned long) grpc_channel_get_uuid);
printf("%lx", (unsigned long) grpc_call_cancel);
printf("%lx", (unsigned long) grpc_call_cancel_with_status);
printf("%lx", (unsigned long) grpc_call_ref);
diff --git a/test/core/surface/sequential_connectivity_test.cc b/test/core/surface/sequential_connectivity_test.cc
index 9aba4c499e..10562b3be9 100644
--- a/test/core/surface/sequential_connectivity_test.cc
+++ b/test/core/surface/sequential_connectivity_test.cc
@@ -144,7 +144,7 @@ static void secure_test_add_port(grpc_server* server, const char* addr) {
static grpc_channel* secure_test_create_channel(const char* addr) {
grpc_channel_credentials* ssl_creds =
- grpc_ssl_credentials_create(test_root_cert, nullptr, nullptr);
+ grpc_ssl_credentials_create(test_root_cert, nullptr, nullptr, nullptr);
grpc_arg ssl_name_override = {
GRPC_ARG_STRING,
const_cast<char*>(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG),
diff --git a/test/core/transport/BUILD b/test/core/transport/BUILD
index 84fb3a1421..7ca1c1d943 100644
--- a/test/core/transport/BUILD
+++ b/test/core/transport/BUILD
@@ -129,6 +129,7 @@ grpc_cc_test(
language = "C++",
deps = [
"//:grpc",
+ "//test/core/util:gpr_test_util",
],
external_deps = [
"gtest",
diff --git a/test/core/transport/status_conversion_test.cc b/test/core/transport/status_conversion_test.cc
index 1ed6ccfba6..f7b3c62a40 100644
--- a/test/core/transport/status_conversion_test.cc
+++ b/test/core/transport/status_conversion_test.cc
@@ -33,12 +33,7 @@
#define HTTP2_STATUS_TO_GRPC_STATUS(a, b) \
GPR_ASSERT(grpc_http2_status_to_grpc_status(a) == (b))
-int main(int argc, char** argv) {
- int i;
-
- grpc_test_init(argc, argv);
- grpc_init();
-
+static void test_grpc_status_to_http2_error() {
GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_OK, GRPC_HTTP2_NO_ERROR);
GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_CANCELLED, GRPC_HTTP2_CANCEL);
GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_UNKNOWN, GRPC_HTTP2_INTERNAL_ERROR);
@@ -65,7 +60,9 @@ int main(int argc, char** argv) {
GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_UNAVAILABLE,
GRPC_HTTP2_REFUSED_STREAM);
GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_DATA_LOSS, GRPC_HTTP2_INTERNAL_ERROR);
+}
+static void test_grpc_status_to_http2_status() {
GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_OK, 200);
GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_CANCELLED, 200);
GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_UNKNOWN, 200);
@@ -83,7 +80,9 @@ int main(int argc, char** argv) {
GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_INTERNAL, 200);
GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_UNAVAILABLE, 200);
GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_DATA_LOSS, 200);
+}
+static void test_http2_error_to_grpc_status() {
const grpc_millis before_deadline = GRPC_MILLIS_INF_FUTURE;
HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_NO_ERROR, before_deadline,
GRPC_STATUS_INTERNAL);
@@ -144,7 +143,9 @@ int main(int argc, char** argv) {
GRPC_STATUS_RESOURCE_EXHAUSTED);
HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_INADEQUATE_SECURITY, after_deadline,
GRPC_STATUS_PERMISSION_DENIED);
+}
+static void test_http2_status_to_grpc_status() {
HTTP2_STATUS_TO_GRPC_STATUS(200, GRPC_STATUS_OK);
HTTP2_STATUS_TO_GRPC_STATUS(400, GRPC_STATUS_INVALID_ARGUMENT);
HTTP2_STATUS_TO_GRPC_STATUS(401, GRPC_STATUS_UNAUTHENTICATED);
@@ -157,6 +158,18 @@ int main(int argc, char** argv) {
HTTP2_STATUS_TO_GRPC_STATUS(500, GRPC_STATUS_UNKNOWN);
HTTP2_STATUS_TO_GRPC_STATUS(503, GRPC_STATUS_UNAVAILABLE);
HTTP2_STATUS_TO_GRPC_STATUS(504, GRPC_STATUS_DEADLINE_EXCEEDED);
+}
+
+int main(int argc, char** argv) {
+ int i;
+
+ grpc_test_init(argc, argv);
+ grpc_init();
+
+ test_grpc_status_to_http2_error();
+ test_grpc_status_to_http2_status();
+ test_http2_error_to_grpc_status();
+ test_http2_status_to_grpc_status();
/* check all status values can be converted */
for (i = 0; i <= 999; i++) {
diff --git a/test/core/tsi/alts/crypt/BUILD b/test/core/tsi/alts/crypt/BUILD
index cf9dbca316..abe1e83656 100644
--- a/test/core/tsi/alts/crypt/BUILD
+++ b/test/core/tsi/alts/crypt/BUILD
@@ -27,6 +27,7 @@ grpc_cc_test(
"//:alts_frame_protector",
"//:gpr",
"//:grpc",
+ "//test/core/util:gpr_test_util",
],
)
diff --git a/test/core/tsi/alts/frame_protector/BUILD b/test/core/tsi/alts/frame_protector/BUILD
index dd1966b379..6ff3015f4d 100644
--- a/test/core/tsi/alts/frame_protector/BUILD
+++ b/test/core/tsi/alts/frame_protector/BUILD
@@ -27,6 +27,7 @@ grpc_cc_test(
"//:gpr",
"//:grpc",
"//test/core/tsi/alts/crypt:alts_crypt_test_util",
+ "//test/core/util:gpr_test_util",
],
)
@@ -39,6 +40,7 @@ grpc_cc_test(
"//:gpr",
"//:grpc",
"//test/core/tsi/alts/crypt:alts_crypt_test_util",
+ "//test/core/util:gpr_test_util",
],
)
@@ -54,6 +56,7 @@ grpc_cc_test(
"//:tsi_interface",
"//test/core/tsi/alts/crypt:alts_crypt_test_util",
"//test/core/tsi:transport_security_test_lib",
+ "//test/core/util:gpr_test_util",
],
)
@@ -67,5 +70,6 @@ grpc_cc_test(
"//:gpr_base",
"//:grpc",
"//test/core/tsi/alts/crypt:alts_crypt_test_util",
+ "//test/core/util:gpr_test_util",
],
)
diff --git a/test/core/tsi/alts/handshaker/BUILD b/test/core/tsi/alts/handshaker/BUILD
index 809742744c..3f1a681c1a 100644
--- a/test/core/tsi/alts/handshaker/BUILD
+++ b/test/core/tsi/alts/handshaker/BUILD
@@ -37,6 +37,7 @@ grpc_cc_test(
"//:tsi",
"//:tsi_interface",
"//:grpc",
+ "//test/core/util:gpr_test_util",
],
)
@@ -47,6 +48,7 @@ grpc_cc_test(
deps = [
":alts_handshaker_service_api_test_lib",
"//:grpc",
+ "//test/core/util:gpr_test_util",
],
)
@@ -60,6 +62,7 @@ grpc_cc_test(
"//:gpr_base",
"//:grpc",
"//:tsi",
+ "//test/core/util:gpr_test_util",
],
)
@@ -71,6 +74,7 @@ grpc_cc_test(
":alts_handshaker_service_api_test_lib",
"//:grpc",
"//:tsi",
+ "//test/core/util:gpr_test_util",
],
)
@@ -81,6 +85,7 @@ grpc_cc_test(
deps = [
"//:alts_util",
"//:grpc",
+ "//test/core/util:gpr_test_util",
],
)
diff --git a/test/core/tsi/alts/zero_copy_frame_protector/BUILD b/test/core/tsi/alts/zero_copy_frame_protector/BUILD
index 2b41dae043..a3b797327e 100644
--- a/test/core/tsi/alts/zero_copy_frame_protector/BUILD
+++ b/test/core/tsi/alts/zero_copy_frame_protector/BUILD
@@ -28,6 +28,7 @@ grpc_cc_test(
"//:grpc",
"//:grpc_base_c",
"//test/core/tsi/alts/crypt:alts_crypt_test_util",
+ "//test/core/util:gpr_test_util",
],
)
@@ -40,6 +41,7 @@ grpc_cc_test(
"//:gpr",
"//:grpc",
"//test/core/tsi/alts/crypt:alts_crypt_test_util",
+ "//test/core/util:gpr_test_util",
],
)
@@ -53,5 +55,6 @@ grpc_cc_test(
"//:grpc",
"//:grpc_base_c",
"//test/core/tsi/alts/crypt:alts_crypt_test_util",
+ "//test/core/util:gpr_test_util",
],
)
diff --git a/test/core/util/BUILD b/test/core/util/BUILD
index f52570cde5..5492dcfa79 100644
--- a/test/core/util/BUILD
+++ b/test/core/util/BUILD
@@ -32,6 +32,11 @@ grpc_cc_library(
"test_config.h",
],
deps = ["//:gpr"],
+ data = [
+ "lsan_suppressions.txt",
+ "tsan_suppressions.txt",
+ "ubsan_suppressions.txt",
+ ],
)
grpc_cc_library(
diff --git a/tools/lsan_suppressions.txt b/test/core/util/lsan_suppressions.txt
index 204ddbef5e..204ddbef5e 100644
--- a/tools/lsan_suppressions.txt
+++ b/test/core/util/lsan_suppressions.txt
diff --git a/tools/tsan_suppressions.txt b/test/core/util/tsan_suppressions.txt
index e0c7907228..e0c7907228 100644
--- a/tools/tsan_suppressions.txt
+++ b/test/core/util/tsan_suppressions.txt
diff --git a/tools/ubsan_suppressions.txt b/test/core/util/ubsan_suppressions.txt
index 2268adc169..2268adc169 100644
--- a/tools/ubsan_suppressions.txt
+++ b/test/core/util/ubsan_suppressions.txt
diff --git a/test/cpp/client/BUILD b/test/cpp/client/BUILD
index 12825e88c2..c03ea92d34 100644
--- a/test/cpp/client/BUILD
+++ b/test/cpp/client/BUILD
@@ -28,6 +28,7 @@ grpc_cc_test(
"//:gpr",
"//:grpc",
"//:grpc++",
+ "//test/core/util:gpr_test_util",
],
)
diff --git a/test/cpp/codegen/golden_file_test.cc b/test/cpp/codegen/golden_file_test.cc
index 7e4d15a7c9..bfd3649494 100644
--- a/test/cpp/codegen/golden_file_test.cc
+++ b/test/cpp/codegen/golden_file_test.cc
@@ -37,8 +37,8 @@ DEFINE_string(
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<char> generated_file,
- std::basic_string<char> golden_file) {
+void run_test(const std::basic_string<char>& generated_file,
+ const std::basic_string<char>& golden_file) {
std::ifstream generated(generated_file);
std::ifstream golden(golden_file);
diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc
index e8d2325b7d..3d31c9d810 100644
--- a/test/cpp/end2end/async_end2end_test.cc
+++ b/test/cpp/end2end/async_end2end_test.cc
@@ -142,7 +142,7 @@ class Verifier {
// to call the lambda
void Verify(CompletionQueue* cq,
std::chrono::system_clock::time_point deadline,
- std::function<void(void)> lambda) {
+ const std::function<void(void)>& lambda) {
if (expectations_.empty()) {
bool ok;
void* got_tag;
@@ -891,7 +891,7 @@ TEST_P(AsyncEnd2endTest, ClientInitialMetadataRpc) {
cq_.get(), tag(2));
Verifier().Expect(2, true).Verify(cq_.get());
EXPECT_EQ(send_request.message(), recv_request.message());
- auto client_initial_metadata = srv_ctx.client_metadata();
+ const auto& client_initial_metadata = srv_ctx.client_metadata();
EXPECT_EQ(meta1.second,
ToString(client_initial_metadata.find(meta1.first)->second));
EXPECT_EQ(meta2.second,
@@ -937,7 +937,7 @@ TEST_P(AsyncEnd2endTest, ServerInitialMetadataRpc) {
srv_ctx.AddInitialMetadata(meta2.first, meta2.second);
response_writer.SendInitialMetadata(tag(3));
Verifier().Expect(3, true).Expect(4, true).Verify(cq_.get());
- auto server_initial_metadata = cli_ctx.GetServerInitialMetadata();
+ const auto& server_initial_metadata = cli_ctx.GetServerInitialMetadata();
EXPECT_EQ(meta1.second,
ToString(server_initial_metadata.find(meta1.first)->second));
EXPECT_EQ(meta2.second,
@@ -990,7 +990,7 @@ TEST_P(AsyncEnd2endTest, ServerTrailingMetadataRpc) {
EXPECT_EQ(send_response.message(), recv_response.message());
EXPECT_TRUE(recv_status.ok());
- auto server_trailing_metadata = cli_ctx.GetServerTrailingMetadata();
+ const auto& server_trailing_metadata = cli_ctx.GetServerTrailingMetadata();
EXPECT_EQ(meta1.second,
ToString(server_trailing_metadata.find(meta1.first)->second));
EXPECT_EQ(meta2.second,
@@ -1038,7 +1038,7 @@ TEST_P(AsyncEnd2endTest, MetadataRpc) {
cq_.get(), tag(2));
Verifier().Expect(2, true).Verify(cq_.get());
EXPECT_EQ(send_request.message(), recv_request.message());
- auto client_initial_metadata = srv_ctx.client_metadata();
+ const auto& client_initial_metadata = srv_ctx.client_metadata();
EXPECT_EQ(meta1.second,
ToString(client_initial_metadata.find(meta1.first)->second));
EXPECT_EQ(meta2.second,
@@ -1049,7 +1049,7 @@ TEST_P(AsyncEnd2endTest, MetadataRpc) {
srv_ctx.AddInitialMetadata(meta4.first, meta4.second);
response_writer.SendInitialMetadata(tag(3));
Verifier().Expect(3, true).Expect(4, true).Verify(cq_.get());
- auto server_initial_metadata = cli_ctx.GetServerInitialMetadata();
+ const auto& server_initial_metadata = cli_ctx.GetServerInitialMetadata();
EXPECT_EQ(meta3.second,
ToString(server_initial_metadata.find(meta3.first)->second));
EXPECT_EQ(meta4.second,
@@ -1066,7 +1066,7 @@ TEST_P(AsyncEnd2endTest, MetadataRpc) {
EXPECT_EQ(send_response.message(), recv_response.message());
EXPECT_TRUE(recv_status.ok());
- auto server_trailing_metadata = cli_ctx.GetServerTrailingMetadata();
+ const auto& server_trailing_metadata = cli_ctx.GetServerTrailingMetadata();
EXPECT_EQ(meta5.second,
ToString(server_trailing_metadata.find(meta5.first)->second));
EXPECT_EQ(meta6.second,
@@ -1144,7 +1144,7 @@ TEST_P(AsyncEnd2endTest, ServerCheckDone) {
TEST_P(AsyncEnd2endTest, UnimplementedRpc) {
ChannelArguments args;
- auto channel_creds = GetCredentialsProvider()->GetChannelCredentials(
+ const auto& channel_creds = GetCredentialsProvider()->GetChannelCredentials(
GetParam().credentials_type, &args);
std::shared_ptr<Channel> channel =
!(GetParam().inproc)
diff --git a/test/cpp/end2end/client_lb_end2end_test.cc b/test/cpp/end2end/client_lb_end2end_test.cc
index eeec8e90bd..feea7c3907 100644
--- a/test/cpp/end2end/client_lb_end2end_test.cc
+++ b/test/cpp/end2end/client_lb_end2end_test.cc
@@ -686,9 +686,11 @@ TEST_F(ClientLbEnd2endTest, RoundRobinReresolve) {
const int kNumServers = 3;
std::vector<int> first_ports;
std::vector<int> second_ports;
+ first_ports.reserve(kNumServers);
for (int i = 0; i < kNumServers; ++i) {
first_ports.push_back(grpc_pick_unused_port_or_die());
}
+ second_ports.reserve(kNumServers);
for (int i = 0; i < kNumServers; ++i) {
second_ports.push_back(grpc_pick_unused_port_or_die());
}
diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc
index 60238e930d..fc07681535 100644
--- a/test/cpp/end2end/end2end_test.cc
+++ b/test/cpp/end2end/end2end_test.cc
@@ -71,8 +71,8 @@ class TestMetadataCredentialsPlugin : public MetadataCredentialsPlugin {
static const char kGoodMetadataKey[];
static const char kBadMetadataKey[];
- TestMetadataCredentialsPlugin(grpc::string_ref metadata_key,
- grpc::string_ref metadata_value,
+ TestMetadataCredentialsPlugin(const grpc::string_ref& metadata_key,
+ const grpc::string_ref& metadata_value,
bool is_blocking, bool is_successful)
: metadata_key_(metadata_key.data(), metadata_key.length()),
metadata_value_(metadata_value.data(), metadata_value.length()),
@@ -168,7 +168,7 @@ const char TestAuthMetadataProcessor::kIdentityPropName[] = "novel identity";
class Proxy : public ::grpc::testing::EchoTestService::Service {
public:
- Proxy(std::shared_ptr<Channel> channel)
+ Proxy(const std::shared_ptr<Channel>& channel)
: stub_(grpc::testing::EchoTestService::NewStub(channel)) {}
Status Echo(ServerContext* server_context, const EchoRequest* request,
@@ -683,6 +683,7 @@ TEST_P(End2endTest, SimpleRpcWithCustomUserAgentPrefix) {
TEST_P(End2endTest, MultipleRpcsWithVariedBinaryMetadataValue) {
ResetStub();
std::vector<std::thread> threads;
+ threads.reserve(10);
for (int i = 0; i < 10; ++i) {
threads.emplace_back(SendRpc, stub_.get(), 10, true);
}
@@ -694,6 +695,7 @@ TEST_P(End2endTest, MultipleRpcsWithVariedBinaryMetadataValue) {
TEST_P(End2endTest, MultipleRpcs) {
ResetStub();
std::vector<std::thread> threads;
+ threads.reserve(10);
for (int i = 0; i < 10; ++i) {
threads.emplace_back(SendRpc, stub_.get(), 10, false);
}
@@ -1209,8 +1211,13 @@ TEST_P(End2endTest, ExpectErrorTest) {
std::vector<ErrorStatus> expected_status;
expected_status.emplace_back();
expected_status.back().set_code(13); // INTERNAL
+ // No Error message or details
+
+ expected_status.emplace_back();
+ expected_status.back().set_code(13); // INTERNAL
expected_status.back().set_error_message("text error message");
expected_status.back().set_binary_error_details("text error details");
+
expected_status.emplace_back();
expected_status.back().set_code(13); // INTERNAL
expected_status.back().set_error_message("text error message");
@@ -1267,6 +1274,7 @@ TEST_P(ProxyEnd2endTest, SimpleRpcWithEmptyMessages) {
TEST_P(ProxyEnd2endTest, MultipleRpcs) {
ResetStub();
std::vector<std::thread> threads;
+ threads.reserve(10);
for (int i = 0; i < 10; ++i) {
threads.emplace_back(SendRpc, stub_.get(), 10, false);
}
diff --git a/test/cpp/end2end/grpclb_end2end_test.cc b/test/cpp/end2end/grpclb_end2end_test.cc
index 7aab035e76..28f9ae6f40 100644
--- a/test/cpp/end2end/grpclb_end2end_test.cc
+++ b/test/cpp/end2end/grpclb_end2end_test.cc
@@ -1380,7 +1380,7 @@ TEST_F(SingleBalancerTest, DropAll) {
class SingleBalancerWithClientLoadReportingTest : public GrpclbEnd2endTest {
public:
- SingleBalancerWithClientLoadReportingTest() : GrpclbEnd2endTest(4, 1, 2) {}
+ SingleBalancerWithClientLoadReportingTest() : GrpclbEnd2endTest(4, 1, 3) {}
};
TEST_F(SingleBalancerWithClientLoadReportingTest, Vanilla) {
diff --git a/test/cpp/end2end/mock_test.cc b/test/cpp/end2end/mock_test.cc
index ff49902fea..ba3122c895 100644
--- a/test/cpp/end2end/mock_test.cc
+++ b/test/cpp/end2end/mock_test.cc
@@ -186,7 +186,7 @@ class TestServiceImpl : public EchoTestService::Service {
ServerWriter<EchoResponse>* writer) override {
EchoResponse response;
vector<grpc::string> tokens = split(request->message());
- for (grpc::string token : tokens) {
+ for (const grpc::string& token : tokens) {
response.set_message(token);
writer->Write(response);
}
diff --git a/test/cpp/end2end/thread_stress_test.cc b/test/cpp/end2end/thread_stress_test.cc
index e709a25356..ccf8400a87 100644
--- a/test/cpp/end2end/thread_stress_test.cc
+++ b/test/cpp/end2end/thread_stress_test.cc
@@ -322,6 +322,7 @@ TYPED_TEST_CASE(End2endTest, CommonTypes);
TYPED_TEST(End2endTest, ThreadStress) {
this->common_.ResetStub();
std::vector<std::thread> threads;
+ threads.reserve(kNumThreads);
for (int i = 0; i < kNumThreads; ++i) {
threads.emplace_back(SendRpc, this->common_.GetStub(), kNumRpcs);
}
diff --git a/test/cpp/ext/filters/census/BUILD b/test/cpp/ext/filters/census/BUILD
new file mode 100644
index 0000000000..6567dc667a
--- /dev/null
+++ b/test/cpp/ext/filters/census/BUILD
@@ -0,0 +1,42 @@
+# Copyright 2018 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_package")
+load("//bazel:cc_grpc_library.bzl", "cc_grpc_library")
+
+licenses(["notice"]) # Apache v2
+
+grpc_package(name = "test/core/ext/census")
+
+grpc_cc_test(
+ name = "grpc_opencensus_plugin_test",
+ srcs = [
+ "stats_plugin_end2end_test.cc",
+ ],
+ language = "C++",
+ external_deps = [
+ "gtest",
+ "gmock",
+ "opencensus-stats-test",
+ ],
+ deps = [
+ "//:grpc++",
+ "//:grpc_opencensus_plugin",
+ "//src/proto/grpc/testing:echo_proto",
+ "//test/core/util:gpr_test_util",
+ "//test/core/util:grpc_test_util",
+ "//test/cpp/util:test_util",
+ "//test/cpp/util:test_config",
+ ],
+)
diff --git a/test/cpp/ext/filters/census/stats_plugin_end2end_test.cc b/test/cpp/ext/filters/census/stats_plugin_end2end_test.cc
new file mode 100644
index 0000000000..664504a090
--- /dev/null
+++ b/test/cpp/ext/filters/census/stats_plugin_end2end_test.cc
@@ -0,0 +1,376 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <string>
+#include <thread> // NOLINT
+#include <vector>
+
+#include "absl/strings/str_cat.h"
+#include "absl/strings/string_view.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "include/grpc++/grpc++.h"
+#include "opencensus/stats/stats.h"
+#include "opencensus/stats/testing/test_utils.h"
+#include "src/cpp/ext/filters/census/grpc_plugin.h"
+#include "src/proto/grpc/testing/echo.grpc.pb.h"
+#include "test/core/util/test_config.h"
+
+namespace grpc {
+namespace testing {
+namespace {
+
+using ::opencensus::stats::Aggregation;
+using ::opencensus::stats::Distribution;
+using ::opencensus::stats::View;
+using ::opencensus::stats::ViewDescriptor;
+using ::opencensus::stats::testing::TestUtils;
+
+class EchoServer final : public EchoTestService::Service {
+ ::grpc::Status Echo(::grpc::ServerContext* context,
+ const EchoRequest* request,
+ EchoResponse* response) override {
+ if (request->param().expected_error().code() == 0) {
+ response->set_message(request->message());
+ return ::grpc::Status::OK;
+ } else {
+ return ::grpc::Status(static_cast<::grpc::StatusCode>(
+ request->param().expected_error().code()),
+ "");
+ }
+ }
+};
+
+class StatsPluginEnd2EndTest : public ::testing::Test {
+ protected:
+ static void SetUpTestCase() { RegisterOpenCensusPlugin(); }
+
+ void SetUp() {
+ // Set up a synchronous server on a different thread to avoid the asynch
+ // interface.
+ ::grpc::ServerBuilder builder;
+ int port;
+ // Use IPv4 here because it's less flaky than IPv6 ("[::]:0") on Travis.
+ builder.AddListeningPort("0.0.0.0:0", ::grpc::InsecureServerCredentials(),
+ &port);
+ builder.RegisterService(&service_);
+ server_ = builder.BuildAndStart();
+ ASSERT_NE(nullptr, server_);
+ ASSERT_NE(0, port);
+ server_address_ = absl::StrCat("0.0.0.0:", port);
+ server_thread_ = std::thread(&StatsPluginEnd2EndTest::RunServerLoop, this);
+
+ stub_ = EchoTestService::NewStub(::grpc::CreateChannel(
+ server_address_, ::grpc::InsecureChannelCredentials()));
+ }
+
+ void TearDown() {
+ server_->Shutdown();
+ server_thread_.join();
+ }
+
+ void RunServerLoop() { server_->Wait(); }
+
+ const std::string client_method_name_ = "grpc.testing.EchoTestService/Echo";
+ const std::string server_method_name_ = "grpc.testing.EchoTestService/Echo";
+
+ std::string server_address_;
+ EchoServer service_;
+ std::unique_ptr<grpc::Server> server_;
+ std::thread server_thread_;
+
+ std::unique_ptr<EchoTestService::Stub> stub_;
+};
+
+TEST_F(StatsPluginEnd2EndTest, ErrorCount) {
+ const auto client_method_descriptor =
+ ViewDescriptor()
+ .set_measure(kRpcClientRoundtripLatencyMeasureName)
+ .set_name("client_method")
+ .set_aggregation(Aggregation::Count())
+ .add_column(ClientMethodTagKey());
+ View client_method_view(client_method_descriptor);
+ const auto server_method_descriptor =
+ ViewDescriptor()
+ .set_measure(kRpcServerServerLatencyMeasureName)
+ .set_name("server_method")
+ .set_aggregation(Aggregation::Count())
+ .add_column(ServerMethodTagKey());
+ View server_method_view(server_method_descriptor);
+
+ const auto client_status_descriptor =
+ ViewDescriptor()
+ .set_measure(kRpcClientRoundtripLatencyMeasureName)
+ .set_name("client_status")
+ .set_aggregation(Aggregation::Count())
+ .add_column(ClientStatusTagKey());
+ View client_status_view(client_status_descriptor);
+ const auto server_status_descriptor =
+ ViewDescriptor()
+ .set_measure(kRpcServerServerLatencyMeasureName)
+ .set_name("server_status")
+ .set_aggregation(Aggregation::Count())
+ .add_column(ServerStatusTagKey());
+ View server_status_view(server_status_descriptor);
+
+ // Cover all valid statuses.
+ for (int i = 0; i <= 16; ++i) {
+ EchoRequest request;
+ request.set_message("foo");
+ request.mutable_param()->mutable_expected_error()->set_code(i);
+ EchoResponse response;
+ ::grpc::ClientContext context;
+ ::grpc::Status status = stub_->Echo(&context, request, &response);
+ }
+ absl::SleepFor(absl::Milliseconds(500));
+ TestUtils::Flush();
+
+ EXPECT_THAT(client_method_view.GetData().int_data(),
+ ::testing::UnorderedElementsAre(::testing::Pair(
+ ::testing::ElementsAre(client_method_name_), 17)));
+ EXPECT_THAT(server_method_view.GetData().int_data(),
+ ::testing::UnorderedElementsAre(::testing::Pair(
+ ::testing::ElementsAre(server_method_name_), 17)));
+
+ auto codes = {
+ ::testing::Pair(::testing::ElementsAre("OK"), 1),
+ ::testing::Pair(::testing::ElementsAre("CANCELLED"), 1),
+ ::testing::Pair(::testing::ElementsAre("UNKNOWN"), 1),
+ ::testing::Pair(::testing::ElementsAre("INVALID_ARGUMENT"), 1),
+ ::testing::Pair(::testing::ElementsAre("DEADLINE_EXCEEDED"), 1),
+ ::testing::Pair(::testing::ElementsAre("NOT_FOUND"), 1),
+ ::testing::Pair(::testing::ElementsAre("ALREADY_EXISTS"), 1),
+ ::testing::Pair(::testing::ElementsAre("PERMISSION_DENIED"), 1),
+ ::testing::Pair(::testing::ElementsAre("UNAUTHENTICATED"), 1),
+ ::testing::Pair(::testing::ElementsAre("RESOURCE_EXHAUSTED"), 1),
+ ::testing::Pair(::testing::ElementsAre("FAILED_PRECONDITION"), 1),
+ ::testing::Pair(::testing::ElementsAre("ABORTED"), 1),
+ ::testing::Pair(::testing::ElementsAre("OUT_OF_RANGE"), 1),
+ ::testing::Pair(::testing::ElementsAre("UNIMPLEMENTED"), 1),
+ ::testing::Pair(::testing::ElementsAre("INTERNAL"), 1),
+ ::testing::Pair(::testing::ElementsAre("UNAVAILABLE"), 1),
+ ::testing::Pair(::testing::ElementsAre("DATA_LOSS"), 1),
+ };
+
+ EXPECT_THAT(client_status_view.GetData().int_data(),
+ ::testing::UnorderedElementsAreArray(codes));
+ EXPECT_THAT(server_status_view.GetData().int_data(),
+ ::testing::UnorderedElementsAreArray(codes));
+}
+
+TEST_F(StatsPluginEnd2EndTest, RequestReceivedBytesPerRpc) {
+ View client_sent_bytes_per_rpc_view(ClientSentBytesPerRpcCumulative());
+ View client_received_bytes_per_rpc_view(
+ ClientReceivedBytesPerRpcCumulative());
+ View server_sent_bytes_per_rpc_view(ServerSentBytesPerRpcCumulative());
+ View server_received_bytes_per_rpc_view(
+ ServerReceivedBytesPerRpcCumulative());
+
+ {
+ EchoRequest request;
+ request.set_message("foo");
+ EchoResponse response;
+ ::grpc::ClientContext context;
+ ::grpc::Status status = stub_->Echo(&context, request, &response);
+ ASSERT_TRUE(status.ok());
+ EXPECT_EQ("foo", response.message());
+ }
+ absl::SleepFor(absl::Milliseconds(500));
+ TestUtils::Flush();
+
+ EXPECT_THAT(client_received_bytes_per_rpc_view.GetData().distribution_data(),
+ ::testing::UnorderedElementsAre(::testing::Pair(
+ ::testing::ElementsAre(client_method_name_),
+ ::testing::AllOf(::testing::Property(&Distribution::count, 1),
+ ::testing::Property(&Distribution::mean,
+ ::testing::Gt(0.0))))));
+ EXPECT_THAT(client_sent_bytes_per_rpc_view.GetData().distribution_data(),
+ ::testing::UnorderedElementsAre(::testing::Pair(
+ ::testing::ElementsAre(client_method_name_),
+ ::testing::AllOf(::testing::Property(&Distribution::count, 1),
+ ::testing::Property(&Distribution::mean,
+ ::testing::Gt(0.0))))));
+ EXPECT_THAT(server_received_bytes_per_rpc_view.GetData().distribution_data(),
+ ::testing::UnorderedElementsAre(::testing::Pair(
+ ::testing::ElementsAre(server_method_name_),
+ ::testing::AllOf(::testing::Property(&Distribution::count, 1),
+ ::testing::Property(&Distribution::mean,
+ ::testing::Gt(0.0))))));
+ EXPECT_THAT(server_sent_bytes_per_rpc_view.GetData().distribution_data(),
+ ::testing::UnorderedElementsAre(::testing::Pair(
+ ::testing::ElementsAre(server_method_name_),
+ ::testing::AllOf(::testing::Property(&Distribution::count, 1),
+ ::testing::Property(&Distribution::mean,
+ ::testing::Gt(0.0))))));
+}
+
+TEST_F(StatsPluginEnd2EndTest, Latency) {
+ View client_latency_view(ClientRoundtripLatencyCumulative());
+ View client_server_latency_view(ClientServerLatencyCumulative());
+ View server_server_latency_view(ServerServerLatencyCumulative());
+
+ const absl::Time start_time = absl::Now();
+ {
+ EchoRequest request;
+ request.set_message("foo");
+ EchoResponse response;
+ ::grpc::ClientContext context;
+ ::grpc::Status status = stub_->Echo(&context, request, &response);
+ ASSERT_TRUE(status.ok());
+ EXPECT_EQ("foo", response.message());
+ }
+ // We do not know exact latency/elapsed time, but we know it is less than the
+ // entire time spent making the RPC.
+ const double max_time = absl::ToDoubleMilliseconds(absl::Now() - start_time);
+
+ absl::SleepFor(absl::Milliseconds(500));
+ TestUtils::Flush();
+
+ EXPECT_THAT(
+ client_latency_view.GetData().distribution_data(),
+ ::testing::UnorderedElementsAre(::testing::Pair(
+ ::testing::ElementsAre(client_method_name_),
+ ::testing::AllOf(
+ ::testing::Property(&Distribution::count, 1),
+ ::testing::Property(&Distribution::mean, ::testing::Gt(0.0)),
+ ::testing::Property(&Distribution::mean,
+ ::testing::Lt(max_time))))));
+
+ // Elapsed time is a subinterval of total latency.
+ const auto client_latency = client_latency_view.GetData()
+ .distribution_data()
+ .find({client_method_name_})
+ ->second.mean();
+ EXPECT_THAT(
+ client_server_latency_view.GetData().distribution_data(),
+ ::testing::UnorderedElementsAre(::testing::Pair(
+ ::testing::ElementsAre(client_method_name_),
+ ::testing::AllOf(
+ ::testing::Property(&Distribution::count, 1),
+ ::testing::Property(&Distribution::mean, ::testing::Gt(0.0)),
+ ::testing::Property(&Distribution::mean,
+ ::testing::Lt(client_latency))))));
+
+ // client server elapsed time should be the same value propagated to the
+ // client.
+ const auto client_elapsed_time = client_server_latency_view.GetData()
+ .distribution_data()
+ .find({client_method_name_})
+ ->second.mean();
+ EXPECT_THAT(
+ server_server_latency_view.GetData().distribution_data(),
+ ::testing::UnorderedElementsAre(::testing::Pair(
+ ::testing::ElementsAre(server_method_name_),
+ ::testing::AllOf(
+ ::testing::Property(&Distribution::count, 1),
+ ::testing::Property(&Distribution::mean,
+ ::testing::DoubleEq(client_elapsed_time))))));
+}
+
+TEST_F(StatsPluginEnd2EndTest, CompletedRpcs) {
+ View client_completed_rpcs_view(ClientCompletedRpcsCumulative());
+ View server_completed_rpcs_view(ServerCompletedRpcsCumulative());
+
+ EchoRequest request;
+ request.set_message("foo");
+ EchoResponse response;
+ const int count = 5;
+ for (int i = 0; i < count; ++i) {
+ {
+ ::grpc::ClientContext context;
+ ::grpc::Status status = stub_->Echo(&context, request, &response);
+ ASSERT_TRUE(status.ok());
+ EXPECT_EQ("foo", response.message());
+ }
+ absl::SleepFor(absl::Milliseconds(500));
+ TestUtils::Flush();
+
+ EXPECT_THAT(client_completed_rpcs_view.GetData().int_data(),
+ ::testing::UnorderedElementsAre(::testing::Pair(
+ ::testing::ElementsAre(client_method_name_, "OK"), i + 1)));
+ EXPECT_THAT(server_completed_rpcs_view.GetData().int_data(),
+ ::testing::UnorderedElementsAre(::testing::Pair(
+ ::testing::ElementsAre(server_method_name_, "OK"), i + 1)));
+ }
+}
+
+TEST_F(StatsPluginEnd2EndTest, RequestReceivedMessagesPerRpc) {
+ // TODO: Use streaming RPCs.
+ View client_received_messages_per_rpc_view(
+ ClientSentMessagesPerRpcCumulative());
+ View client_sent_messages_per_rpc_view(
+ ClientReceivedMessagesPerRpcCumulative());
+ View server_received_messages_per_rpc_view(
+ ServerSentMessagesPerRpcCumulative());
+ View server_sent_messages_per_rpc_view(
+ ServerReceivedMessagesPerRpcCumulative());
+
+ EchoRequest request;
+ request.set_message("foo");
+ EchoResponse response;
+ const int count = 5;
+ for (int i = 0; i < count; ++i) {
+ {
+ ::grpc::ClientContext context;
+ ::grpc::Status status = stub_->Echo(&context, request, &response);
+ ASSERT_TRUE(status.ok());
+ EXPECT_EQ("foo", response.message());
+ }
+ absl::SleepFor(absl::Milliseconds(500));
+ TestUtils::Flush();
+
+ EXPECT_THAT(
+ client_received_messages_per_rpc_view.GetData().distribution_data(),
+ ::testing::UnorderedElementsAre(::testing::Pair(
+ ::testing::ElementsAre(client_method_name_),
+ ::testing::AllOf(::testing::Property(&Distribution::count, i + 1),
+ ::testing::Property(&Distribution::mean,
+ ::testing::DoubleEq(1.0))))));
+ EXPECT_THAT(
+ client_sent_messages_per_rpc_view.GetData().distribution_data(),
+ ::testing::UnorderedElementsAre(::testing::Pair(
+ ::testing::ElementsAre(client_method_name_),
+ ::testing::AllOf(::testing::Property(&Distribution::count, i + 1),
+ ::testing::Property(&Distribution::mean,
+ ::testing::DoubleEq(1.0))))));
+ EXPECT_THAT(
+ server_received_messages_per_rpc_view.GetData().distribution_data(),
+ ::testing::UnorderedElementsAre(::testing::Pair(
+ ::testing::ElementsAre(server_method_name_),
+ ::testing::AllOf(::testing::Property(&Distribution::count, i + 1),
+ ::testing::Property(&Distribution::mean,
+ ::testing::DoubleEq(1.0))))));
+ EXPECT_THAT(
+ server_sent_messages_per_rpc_view.GetData().distribution_data(),
+ ::testing::UnorderedElementsAre(::testing::Pair(
+ ::testing::ElementsAre(server_method_name_),
+ ::testing::AllOf(::testing::Property(&Distribution::count, i + 1),
+ ::testing::Property(&Distribution::mean,
+ ::testing::DoubleEq(1.0))))));
+ }
+}
+
+} // namespace
+} // namespace testing
+} // namespace grpc
+
+int main(int argc, char** argv) {
+ grpc_test_init(argc, argv);
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
diff --git a/test/cpp/interop/http2_client.cc b/test/cpp/interop/http2_client.cc
index 543f159265..bc7f0f5edb 100644
--- a/test/cpp/interop/http2_client.cc
+++ b/test/cpp/interop/http2_client.cc
@@ -42,16 +42,16 @@ const int kLargeRequestSize = 271828;
const int kLargeResponseSize = 314159;
} // namespace
-Http2Client::ServiceStub::ServiceStub(std::shared_ptr<Channel> channel)
- : channel_(channel) {
+Http2Client::ServiceStub::ServiceStub(const std::shared_ptr<Channel>& channel)
+ : channel_(std::move(channel)) {
stub_ = TestService::NewStub(channel);
}
TestService::Stub* Http2Client::ServiceStub::Get() { return stub_.get(); }
-Http2Client::Http2Client(std::shared_ptr<Channel> channel)
+Http2Client::Http2Client(const std::shared_ptr<Channel>& channel)
: serviceStub_(channel),
- channel_(channel),
+ channel_(std::move(channel)),
defaultRequest_(BuildDefaultRequest()) {}
bool Http2Client::AssertStatusCode(const Status& s, StatusCode expected_code) {
@@ -140,7 +140,8 @@ bool Http2Client::DoPing() {
return true;
}
-void Http2Client::MaxStreamsWorker(std::shared_ptr<grpc::Channel> channel) {
+void Http2Client::MaxStreamsWorker(
+ const std::shared_ptr<grpc::Channel>& channel) {
SimpleResponse response;
AssertStatusCode(SendUnaryCall(&response), grpc::StatusCode::OK);
GPR_ASSERT(response.payload().body() ==
diff --git a/test/cpp/interop/http2_client.h b/test/cpp/interop/http2_client.h
index 2bcfdd69db..269d3b32e2 100644
--- a/test/cpp/interop/http2_client.h
+++ b/test/cpp/interop/http2_client.h
@@ -31,7 +31,7 @@ namespace testing {
class Http2Client {
public:
- explicit Http2Client(std::shared_ptr<Channel> channel);
+ explicit Http2Client(const std::shared_ptr<Channel>& channel);
~Http2Client() {}
bool DoRstAfterHeader();
@@ -44,7 +44,7 @@ class Http2Client {
private:
class ServiceStub {
public:
- ServiceStub(std::shared_ptr<Channel> channel);
+ ServiceStub(const std::shared_ptr<Channel>& channel);
TestService::Stub* Get();
@@ -53,7 +53,7 @@ class Http2Client {
std::shared_ptr<Channel> channel_;
};
- void MaxStreamsWorker(std::shared_ptr<grpc::Channel> channel);
+ void MaxStreamsWorker(const std::shared_ptr<grpc::Channel>& channel);
bool AssertStatusCode(const Status& s, StatusCode expected_code);
Status SendUnaryCall(SimpleResponse* response);
SimpleRequest BuildDefaultRequest();
diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc
index 68bf1e6dc7..fce99a1697 100644
--- a/test/cpp/interop/interop_client.cc
+++ b/test/cpp/interop/interop_client.cc
@@ -19,6 +19,7 @@
#include <cinttypes>
#include <fstream>
#include <memory>
+#include <utility>
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
@@ -73,7 +74,7 @@ void UnaryCompressionChecks(const InteropClientContextInspector& inspector,
}
} // namespace
-InteropClient::ServiceStub::ServiceStub(std::shared_ptr<Channel> channel,
+InteropClient::ServiceStub::ServiceStub(const std::shared_ptr<Channel>& channel,
bool new_stub_every_call)
: channel_(channel), new_stub_every_call_(new_stub_every_call) {
// If new_stub_every_call is false, then this is our chance to initialize
@@ -99,7 +100,8 @@ InteropClient::ServiceStub::GetUnimplementedServiceStub() {
return unimplemented_service_stub_.get();
}
-void InteropClient::ServiceStub::Reset(std::shared_ptr<Channel> channel) {
+void InteropClient::ServiceStub::Reset(
+ const std::shared_ptr<Channel>& channel) {
channel_ = channel;
// Update stub_ as well. Note: If new_stub_every_call_ is true, we can reset
@@ -111,14 +113,14 @@ void InteropClient::ServiceStub::Reset(std::shared_ptr<Channel> channel) {
}
}
-void InteropClient::Reset(std::shared_ptr<Channel> channel) {
- serviceStub_.Reset(channel);
+void InteropClient::Reset(const std::shared_ptr<Channel>& channel) {
+ serviceStub_.Reset(std::move(channel));
}
-InteropClient::InteropClient(std::shared_ptr<Channel> channel,
+InteropClient::InteropClient(const std::shared_ptr<Channel>& channel,
bool new_stub_every_test_case,
bool do_not_abort_on_transient_failures)
- : serviceStub_(channel, new_stub_every_test_case),
+ : serviceStub_(std::move(channel), new_stub_every_test_case),
do_not_abort_on_transient_failures_(do_not_abort_on_transient_failures) {}
bool InteropClient::AssertStatusOk(const Status& s,
@@ -180,7 +182,7 @@ bool InteropClient::PerformLargeUnary(SimpleRequest* request,
bool InteropClient::PerformLargeUnary(SimpleRequest* request,
SimpleResponse* response,
- CheckerFn custom_checks_fn) {
+ const CheckerFn& custom_checks_fn) {
ClientContext context;
InteropClientContextInspector inspector(context);
request->set_response_size(kLargeResponseSize);
diff --git a/test/cpp/interop/interop_client.h b/test/cpp/interop/interop_client.h
index 79ff24fc47..480eb3f4b6 100644
--- a/test/cpp/interop/interop_client.h
+++ b/test/cpp/interop/interop_client.h
@@ -40,12 +40,12 @@ class InteropClient {
/// created for every test case
/// If do_not_abort_on_transient_failures is true, abort() is not called in
/// case of transient failures (like connection failures)
- explicit InteropClient(std::shared_ptr<Channel> channel,
+ explicit InteropClient(const std::shared_ptr<Channel>& channel,
bool new_stub_every_test_case,
bool do_not_abort_on_transient_failures);
~InteropClient() {}
- void Reset(std::shared_ptr<Channel> channel);
+ void Reset(const std::shared_ptr<Channel>& channel);
bool DoEmpty();
bool DoLargeUnary();
@@ -83,12 +83,13 @@ class InteropClient {
public:
// If new_stub_every_call = true, pointer to a new instance of
// TestServce::Stub is returned by Get() everytime it is called
- ServiceStub(std::shared_ptr<Channel> channel, bool new_stub_every_call);
+ ServiceStub(const std::shared_ptr<Channel>& channel,
+ bool new_stub_every_call);
TestService::Stub* Get();
UnimplementedService::Stub* GetUnimplementedServiceStub();
- void Reset(std::shared_ptr<Channel> channel);
+ void Reset(const std::shared_ptr<Channel>& channel);
private:
std::unique_ptr<TestService::Stub> stub_;
@@ -102,7 +103,7 @@ class InteropClient {
/// Run \a custom_check_fn as an additional check.
bool PerformLargeUnary(SimpleRequest* request, SimpleResponse* response,
- CheckerFn custom_checks_fn);
+ const CheckerFn& custom_checks_fn);
bool AssertStatusOk(const Status& s,
const grpc::string& optional_debug_string);
bool AssertStatusCode(const Status& s, StatusCode expected_code,
diff --git a/test/cpp/interop/interop_server.cc b/test/cpp/interop/interop_server.cc
index f55d624b21..6570bbf969 100644
--- a/test/cpp/interop/interop_server.cc
+++ b/test/cpp/interop/interop_server.cc
@@ -317,25 +317,25 @@ class TestServiceImpl : public TestService::Service {
};
void grpc::testing::interop::RunServer(
- std::shared_ptr<ServerCredentials> creds) {
+ const std::shared_ptr<ServerCredentials>& creds) {
RunServer(creds, FLAGS_port, nullptr, nullptr);
}
void grpc::testing::interop::RunServer(
- std::shared_ptr<ServerCredentials> creds,
+ const std::shared_ptr<ServerCredentials>& creds,
std::unique_ptr<std::vector<std::unique_ptr<ServerBuilderOption>>>
server_options) {
RunServer(creds, FLAGS_port, nullptr, std::move(server_options));
}
void grpc::testing::interop::RunServer(
- std::shared_ptr<ServerCredentials> creds, const int port,
+ const std::shared_ptr<ServerCredentials>& creds, const int port,
ServerStartedCondition* server_started_condition) {
RunServer(creds, port, server_started_condition, nullptr);
}
void grpc::testing::interop::RunServer(
- std::shared_ptr<ServerCredentials> creds, const int port,
+ const std::shared_ptr<ServerCredentials>& creds, const int port,
ServerStartedCondition* server_started_condition,
std::unique_ptr<std::vector<std::unique_ptr<ServerBuilderOption>>>
server_options) {
diff --git a/test/cpp/interop/server_helper.h b/test/cpp/interop/server_helper.h
index 265874df70..1bfbf8e474 100644
--- a/test/cpp/interop/server_helper.h
+++ b/test/cpp/interop/server_helper.h
@@ -63,7 +63,7 @@ struct ServerStartedCondition {
/// Run gRPC interop server using port FLAGS_port.
///
/// \param creds The credentials associated with the server.
-void RunServer(std::shared_ptr<ServerCredentials> creds);
+void RunServer(const std::shared_ptr<ServerCredentials>& creds);
/// Run gRPC interop server.
///
@@ -71,7 +71,7 @@ void RunServer(std::shared_ptr<ServerCredentials> creds);
/// \param port Port to use for the server.
/// \param server_started_condition (optional) Struct holding mutex, condition
/// variable, and condition used to notify when the server has started.
-void RunServer(std::shared_ptr<ServerCredentials> creds, int port,
+void RunServer(const std::shared_ptr<ServerCredentials>& creds, int port,
ServerStartedCondition* server_started_condition);
/// Run gRPC interop server.
@@ -79,7 +79,7 @@ void RunServer(std::shared_ptr<ServerCredentials> creds, int port,
/// \param creds The credentials associated with the server.
/// \param server_options List of options to set when building the server.
void RunServer(
- std::shared_ptr<ServerCredentials> creds,
+ const std::shared_ptr<ServerCredentials>& creds,
std::unique_ptr<std::vector<std::unique_ptr<ServerBuilderOption>>>
server_options);
@@ -91,7 +91,7 @@ void RunServer(
/// \param server_started_condition (optional) Struct holding mutex, condition
// variable, and condition used to notify when the server has started.
void RunServer(
- std::shared_ptr<ServerCredentials> creds, const int port,
+ const std::shared_ptr<ServerCredentials>& creds, const int port,
ServerStartedCondition* server_started_condition,
std::unique_ptr<std::vector<std::unique_ptr<grpc::ServerBuilderOption>>>
server_options);
diff --git a/test/cpp/interop/stress_interop_client.cc b/test/cpp/interop/stress_interop_client.cc
index 30a8351cfe..9d373c3cd9 100644
--- a/test/cpp/interop/stress_interop_client.cc
+++ b/test/cpp/interop/stress_interop_client.cc
@@ -68,7 +68,7 @@ TestCaseType WeightedRandomTestSelector::GetNextTest() const {
StressTestInteropClient::StressTestInteropClient(
int test_id, const grpc::string& server_address,
- std::shared_ptr<Channel> channel,
+ const std::shared_ptr<Channel>& channel,
const WeightedRandomTestSelector& test_selector, long test_duration_secs,
long sleep_duration_ms, bool do_not_abort_on_transient_failures)
: test_id_(test_id),
@@ -80,7 +80,8 @@ StressTestInteropClient::StressTestInteropClient(
test_duration_secs_(test_duration_secs),
sleep_duration_ms_(sleep_duration_ms) {}
-void StressTestInteropClient::MainLoop(std::shared_ptr<QpsGauge> qps_gauge) {
+void StressTestInteropClient::MainLoop(
+ const std::shared_ptr<QpsGauge>& qps_gauge) {
gpr_log(GPR_INFO, "Running test %d. ServerAddr: %s", test_id_,
server_address_.c_str());
diff --git a/test/cpp/interop/stress_interop_client.h b/test/cpp/interop/stress_interop_client.h
index a306dc3565..e4fa7d0973 100644
--- a/test/cpp/interop/stress_interop_client.h
+++ b/test/cpp/interop/stress_interop_client.h
@@ -91,14 +91,14 @@ class WeightedRandomTestSelector {
class StressTestInteropClient {
public:
StressTestInteropClient(int test_id, const grpc::string& server_address,
- std::shared_ptr<Channel> channel,
+ const std::shared_ptr<Channel>& channel,
const WeightedRandomTestSelector& test_selector,
long test_duration_secs, long sleep_duration_ms,
bool do_not_abort_on_transient_failures);
// The main function. Use this as the thread entry point.
// qps_gauge is the QpsGauge to record the requests per second metric
- void MainLoop(std::shared_ptr<QpsGauge> qps_gauge);
+ void MainLoop(const std::shared_ptr<QpsGauge>& qps_gauge);
private:
bool RunTest(TestCaseType test_case);
diff --git a/test/cpp/microbenchmarks/BUILD b/test/cpp/microbenchmarks/BUILD
index 5dcfd94ed3..0c3b9ef816 100644
--- a/test/cpp/microbenchmarks/BUILD
+++ b/test/cpp/microbenchmarks/BUILD
@@ -24,6 +24,7 @@ grpc_cc_test(
external_deps = [
"benchmark",
],
+ deps = ["//test/core/util:gpr_test_util",]
)
grpc_cc_library(
@@ -54,6 +55,20 @@ grpc_cc_binary(
)
grpc_cc_binary(
+ name = "bm_arena",
+ testonly = 1,
+ srcs = ["bm_arena.cc"],
+ deps = [":helpers"],
+)
+
+grpc_cc_binary(
+ name = "bm_channel",
+ testonly = 1,
+ srcs = ["bm_channel.cc"],
+ deps = [":helpers"],
+)
+
+grpc_cc_binary(
name = "bm_cq",
testonly = 1,
srcs = ["bm_cq.cc"],
@@ -148,3 +163,15 @@ grpc_cc_binary(
srcs = ["bm_chttp2_hpack.cc"],
deps = [":helpers"],
)
+
+grpc_cc_binary(
+ name = "bm_opencensus_plugin",
+ testonly = 1,
+ srcs = ["bm_opencensus_plugin.cc"],
+ language = "C++",
+ deps = [
+ ":helpers",
+ "//:grpc_opencensus_plugin",
+ "//src/proto/grpc/testing:echo_proto",
+ ],
+)
diff --git a/test/cpp/microbenchmarks/bm_call_create.cc b/test/cpp/microbenchmarks/bm_call_create.cc
index 831b29c506..9516b2e3e2 100644
--- a/test/cpp/microbenchmarks/bm_call_create.cc
+++ b/test/cpp/microbenchmarks/bm_call_create.cc
@@ -604,10 +604,13 @@ BENCHMARK_TEMPLATE(BM_IsolatedFilter, HttpServerFilter, SendEmptyMetadata);
typedef Fixture<&grpc_message_size_filter, CHECKS_NOT_LAST> MessageSizeFilter;
BENCHMARK_TEMPLATE(BM_IsolatedFilter, MessageSizeFilter, NoOp);
BENCHMARK_TEMPLATE(BM_IsolatedFilter, MessageSizeFilter, SendEmptyMetadata);
-typedef Fixture<&grpc_server_load_reporting_filter, CHECKS_NOT_LAST>
- LoadReportingFilter;
-BENCHMARK_TEMPLATE(BM_IsolatedFilter, LoadReportingFilter, NoOp);
-BENCHMARK_TEMPLATE(BM_IsolatedFilter, LoadReportingFilter, SendEmptyMetadata);
+// This cmake target is disabled for now because it depends on OpenCensus, which
+// is Bazel-only.
+// typedef Fixture<&grpc_server_load_reporting_filter, CHECKS_NOT_LAST>
+// LoadReportingFilter;
+// BENCHMARK_TEMPLATE(BM_IsolatedFilter, LoadReportingFilter, NoOp);
+// BENCHMARK_TEMPLATE(BM_IsolatedFilter, LoadReportingFilter,
+// SendEmptyMetadata);
////////////////////////////////////////////////////////////////////////////////
// Benchmarks isolating grpc_call
@@ -621,18 +624,26 @@ typedef struct {
static void StartTransportStreamOp(grpc_call_element* elem,
grpc_transport_stream_op_batch* op) {
call_data* calld = static_cast<call_data*>(elem->call_data);
+ // Construct list of closures to return.
+ grpc_core::CallCombinerClosureList closures;
if (op->recv_initial_metadata) {
- GRPC_CALL_COMBINER_START(
- calld->call_combiner,
- op->payload->recv_initial_metadata.recv_initial_metadata_ready,
- GRPC_ERROR_NONE, "recv_initial_metadata");
+ closures.Add(op->payload->recv_initial_metadata.recv_initial_metadata_ready,
+ GRPC_ERROR_NONE, "recv_initial_metadata");
}
if (op->recv_message) {
- GRPC_CALL_COMBINER_START(calld->call_combiner,
- op->payload->recv_message.recv_message_ready,
- GRPC_ERROR_NONE, "recv_message");
+ closures.Add(op->payload->recv_message.recv_message_ready, GRPC_ERROR_NONE,
+ "recv_message");
}
- GRPC_CLOSURE_SCHED(op->on_complete, GRPC_ERROR_NONE);
+ if (op->recv_trailing_metadata) {
+ closures.Add(
+ op->payload->recv_trailing_metadata.recv_trailing_metadata_ready,
+ GRPC_ERROR_NONE, "recv_trailing_metadata");
+ }
+ if (op->on_complete != nullptr) {
+ closures.Add(op->on_complete, GRPC_ERROR_NONE, "on_complete");
+ }
+ // Execute closures.
+ closures.RunClosures(calld->call_combiner);
}
static void StartTransportOp(grpc_channel_element* elem,
diff --git a/test/cpp/microbenchmarks/bm_channel.cc b/test/cpp/microbenchmarks/bm_channel.cc
new file mode 100644
index 0000000000..15ac997540
--- /dev/null
+++ b/test/cpp/microbenchmarks/bm_channel.cc
@@ -0,0 +1,90 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/* Benchmark channel */
+
+#include <benchmark/benchmark.h>
+#include <grpc/grpc.h>
+#include "test/cpp/microbenchmarks/helpers.h"
+#include "test/cpp/util/test_config.h"
+
+auto& force_library_initialization = Library::get();
+
+class ChannelDestroyerFixture {
+ public:
+ ChannelDestroyerFixture() {}
+ virtual ~ChannelDestroyerFixture() {
+ if (channel_) {
+ grpc_channel_destroy(channel_);
+ }
+ }
+ virtual void Init() = 0;
+
+ protected:
+ grpc_channel* channel_ = nullptr;
+};
+
+class InsecureChannelFixture : public ChannelDestroyerFixture {
+ public:
+ InsecureChannelFixture() {}
+ void Init() override {
+ channel_ = grpc_insecure_channel_create("localhost:1234", nullptr, nullptr);
+ }
+};
+
+class LameChannelFixture : public ChannelDestroyerFixture {
+ public:
+ LameChannelFixture() {}
+ void Init() override {
+ channel_ = grpc_lame_client_channel_create(
+ "localhost:1234", GRPC_STATUS_UNAUTHENTICATED, "blah");
+ }
+};
+
+template <class Fixture>
+static void BM_InsecureChannelCreateDestroy(benchmark::State& state) {
+ // In order to test if channel creation time is affected by the number of
+ // already existing channels, we create some initial channels here.
+ Fixture initial_channels[512];
+ for (int i = 0; i < state.range(0); i++) {
+ initial_channels[i].Init();
+ }
+ while (state.KeepRunning()) {
+ Fixture channel;
+ channel.Init();
+ }
+}
+BENCHMARK_TEMPLATE(BM_InsecureChannelCreateDestroy, InsecureChannelFixture)
+ ->Range(0, 512);
+;
+BENCHMARK_TEMPLATE(BM_InsecureChannelCreateDestroy, LameChannelFixture)
+ ->Range(0, 512);
+;
+
+// Some distros have RunSpecifiedBenchmarks under the benchmark namespace,
+// and others do not. This allows us to support both modes.
+namespace benchmark {
+void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); }
+} // namespace benchmark
+
+int main(int argc, char** argv) {
+ ::benchmark::Initialize(&argc, argv);
+ ::grpc::testing::InitTest(&argc, &argv, false);
+ benchmark::RunTheBenchmarksNamespaced();
+ return 0;
+}
diff --git a/test/cpp/microbenchmarks/bm_chttp2_hpack.cc b/test/cpp/microbenchmarks/bm_chttp2_hpack.cc
index 823c76f755..6fcf048bf3 100644
--- a/test/cpp/microbenchmarks/bm_chttp2_hpack.cc
+++ b/test/cpp/microbenchmarks/bm_chttp2_hpack.cc
@@ -208,6 +208,7 @@ class SingleInternedBinaryElem {
private:
static grpc_slice MakeBytes() {
std::vector<char> v;
+ v.reserve(kLength);
for (int i = 0; i < kLength; i++) {
v.push_back(static_cast<char>(rand()));
}
@@ -246,6 +247,7 @@ class SingleNonInternedBinaryElem {
private:
static grpc_slice MakeBytes() {
std::vector<char> v;
+ v.reserve(kLength);
for (int i = 0; i < kLength; i++) {
v.push_back(static_cast<char>(rand()));
}
diff --git a/test/cpp/microbenchmarks/bm_opencensus_plugin.cc b/test/cpp/microbenchmarks/bm_opencensus_plugin.cc
new file mode 100644
index 0000000000..9d42eb891d
--- /dev/null
+++ b/test/cpp/microbenchmarks/bm_opencensus_plugin.cc
@@ -0,0 +1,118 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <benchmark/benchmark.h>
+#include <string>
+#include <thread> // NOLINT
+
+#include "absl/base/call_once.h"
+#include "absl/strings/str_cat.h"
+#include "include/grpc++/grpc++.h"
+#include "opencensus/stats/stats.h"
+#include "src/cpp/ext/filters/census/grpc_plugin.h"
+#include "src/proto/grpc/testing/echo.grpc.pb.h"
+#include "test/cpp/microbenchmarks/helpers.h"
+
+absl::once_flag once;
+void RegisterOnce() { absl::call_once(once, grpc::RegisterOpenCensusPlugin); }
+
+class EchoServer final : public grpc::testing::EchoTestService::Service {
+ grpc::Status Echo(grpc::ServerContext* context,
+ const grpc::testing::EchoRequest* request,
+ grpc::testing::EchoResponse* response) override {
+ if (request->param().expected_error().code() == 0) {
+ response->set_message(request->message());
+ return grpc::Status::OK;
+ } else {
+ return grpc::Status(static_cast<grpc::StatusCode>(
+ request->param().expected_error().code()),
+ "");
+ }
+ }
+};
+
+// An EchoServerThread object creates an EchoServer on a separate thread and
+// shuts down the server and thread when it goes out of scope.
+class EchoServerThread final {
+ public:
+ EchoServerThread() {
+ grpc::ServerBuilder builder;
+ int port;
+ builder.AddListeningPort("[::]:0", grpc::InsecureServerCredentials(),
+ &port);
+ builder.RegisterService(&service_);
+ server_ = builder.BuildAndStart();
+ if (server_ == nullptr || port == 0) {
+ std::abort();
+ }
+ server_address_ = absl::StrCat("[::]:", port);
+ server_thread_ = std::thread(&EchoServerThread::RunServerLoop, this);
+ }
+
+ ~EchoServerThread() {
+ server_->Shutdown();
+ server_thread_.join();
+ }
+
+ const std::string& address() { return server_address_; }
+
+ private:
+ void RunServerLoop() { server_->Wait(); }
+
+ std::string server_address_;
+ EchoServer service_;
+ std::unique_ptr<grpc::Server> server_;
+ std::thread server_thread_;
+};
+
+static void BM_E2eLatencyCensusDisabled(benchmark::State& state) {
+ EchoServerThread server;
+ std::unique_ptr<grpc::testing::EchoTestService::Stub> stub =
+ grpc::testing::EchoTestService::NewStub(grpc::CreateChannel(
+ server.address(), grpc::InsecureChannelCredentials()));
+
+ grpc::testing::EchoResponse response;
+ for (auto _ : state) {
+ grpc::testing::EchoRequest request;
+ grpc::ClientContext context;
+ grpc::Status status = stub->Echo(&context, request, &response);
+ }
+}
+BENCHMARK(BM_E2eLatencyCensusDisabled);
+
+static void BM_E2eLatencyCensusEnabled(benchmark::State& state) {
+ RegisterOnce();
+ // This we can safely repeat, and doing so clears accumulated data to avoid
+ // initialization costs varying between runs.
+ grpc::RegisterOpenCensusViewsForExport();
+
+ EchoServerThread server;
+ std::unique_ptr<grpc::testing::EchoTestService::Stub> stub =
+ grpc::testing::EchoTestService::NewStub(grpc::CreateChannel(
+ server.address(), grpc::InsecureChannelCredentials()));
+
+ grpc::testing::EchoResponse response;
+ for (auto _ : state) {
+ grpc::testing::EchoRequest request;
+ grpc::ClientContext context;
+ grpc::Status status = stub->Echo(&context, request, &response);
+ }
+}
+BENCHMARK(BM_E2eLatencyCensusEnabled);
+
+BENCHMARK_MAIN();
diff --git a/test/cpp/microbenchmarks/bm_pollset.cc b/test/cpp/microbenchmarks/bm_pollset.cc
index bcb68ff229..050c7f7c17 100644
--- a/test/cpp/microbenchmarks/bm_pollset.cc
+++ b/test/cpp/microbenchmarks/bm_pollset.cc
@@ -141,12 +141,12 @@ static void BM_PollAddFd(benchmark::State& state) {
grpc_wakeup_fd wakeup_fd;
GPR_ASSERT(
GRPC_LOG_IF_ERROR("wakeup_fd_init", grpc_wakeup_fd_init(&wakeup_fd)));
- grpc_fd* fd = grpc_fd_create(wakeup_fd.read_fd, "xxx");
+ grpc_fd* fd = grpc_fd_create(wakeup_fd.read_fd, "xxx", false);
while (state.KeepRunning()) {
grpc_pollset_add_fd(ps, fd);
grpc_core::ExecCtx::Get()->Flush();
}
- grpc_fd_orphan(fd, nullptr, nullptr, false /* already_closed */, "xxx");
+ grpc_fd_orphan(fd, nullptr, nullptr, "xxx");
grpc_closure shutdown_ps_closure;
GRPC_CLOSURE_INIT(&shutdown_ps_closure, shutdown_ps, ps,
grpc_schedule_on_exec_ctx);
@@ -222,7 +222,7 @@ static void BM_SingleThreadPollOneFd(benchmark::State& state) {
grpc_core::ExecCtx exec_ctx;
grpc_wakeup_fd wakeup_fd;
GRPC_ERROR_UNREF(grpc_wakeup_fd_init(&wakeup_fd));
- grpc_fd* wakeup = grpc_fd_create(wakeup_fd.read_fd, "wakeup_read");
+ grpc_fd* wakeup = grpc_fd_create(wakeup_fd.read_fd, "wakeup_read", false);
grpc_pollset_add_fd(ps, wakeup);
bool done = false;
Closure* continue_closure = MakeClosure(
@@ -242,7 +242,7 @@ static void BM_SingleThreadPollOneFd(benchmark::State& state) {
while (!done) {
GRPC_ERROR_UNREF(grpc_pollset_work(ps, nullptr, GRPC_MILLIS_INF_FUTURE));
}
- grpc_fd_orphan(wakeup, nullptr, nullptr, false /* already_closed */, "done");
+ grpc_fd_orphan(wakeup, nullptr, nullptr, "done");
wakeup_fd.read_fd = 0;
grpc_closure shutdown_ps_closure;
GRPC_CLOSURE_INIT(&shutdown_ps_closure, shutdown_ps, ps,
diff --git a/test/cpp/naming/BUILD b/test/cpp/naming/BUILD
index fa0b216f8f..2925e8fbcf 100644
--- a/test/cpp/naming/BUILD
+++ b/test/cpp/naming/BUILD
@@ -22,7 +22,7 @@ package(
licenses(["notice"]) # Apache v2
-load("//bazel:grpc_build_system.bzl", "grpc_py_binary")
+load("//bazel:grpc_build_system.bzl", "grpc_py_binary", "grpc_cc_test")
load(":generate_resolver_component_tests.bzl", "generate_resolver_component_tests")
@@ -35,4 +35,20 @@ grpc_py_binary(
testonly = True,
)
+grpc_cc_test(
+ name = "cancel_ares_query_test",
+ srcs = ["cancel_ares_query_test.cc"],
+ external_deps = ["gmock"],
+ deps = [
+ "//test/cpp/util:test_util",
+ "//test/core/util:grpc_test_util",
+ "//test/core/util:gpr_test_util",
+ "//:grpc++",
+ "//:grpc",
+ "//:gpr",
+ "//test/cpp/util:test_config",
+ "//test/core/end2end:cq_verifier",
+ ],
+)
+
generate_resolver_component_tests()
diff --git a/test/cpp/naming/cancel_ares_query_test.cc b/test/cpp/naming/cancel_ares_query_test.cc
new file mode 100644
index 0000000000..11cdc0b774
--- /dev/null
+++ b/test/cpp/naming/cancel_ares_query_test.cc
@@ -0,0 +1,289 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include <gflags/gflags.h>
+#include <gmock/gmock.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include "include/grpc/support/string_util.h"
+#include "src/core/ext/filters/client_channel/resolver.h"
+#include "src/core/ext/filters/client_channel/resolver_registry.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/debug/stats.h"
+#include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gpr/host_port.h"
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/gprpp/orphanable.h"
+#include "src/core/lib/gprpp/thd.h"
+#include "src/core/lib/iomgr/combiner.h"
+#include "src/core/lib/iomgr/pollset.h"
+#include "src/core/lib/iomgr/pollset_set.h"
+#include "test/core/end2end/cq_verifier.h"
+#include "test/core/util/cmdline.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+// TODO: pull in different headers when enabling this
+// test on windows. Also set BAD_SOCKET_RETURN_VAL
+// to INVALID_SOCKET on windows.
+#include "src/core/lib/iomgr/sockaddr_posix.h"
+#define BAD_SOCKET_RETURN_VAL -1
+
+namespace {
+
+void* Tag(intptr_t t) { return (void*)t; }
+
+gpr_timespec FiveSecondsFromNow(void) {
+ return grpc_timeout_seconds_to_deadline(5);
+}
+
+void DrainCq(grpc_completion_queue* cq) {
+ grpc_event ev;
+ do {
+ ev = grpc_completion_queue_next(cq, FiveSecondsFromNow(), nullptr);
+ } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+void EndTest(grpc_channel* client, grpc_completion_queue* cq) {
+ grpc_channel_destroy(client);
+ grpc_completion_queue_shutdown(cq);
+ DrainCq(cq);
+ grpc_completion_queue_destroy(cq);
+}
+
+class FakeNonResponsiveDNSServer {
+ public:
+ FakeNonResponsiveDNSServer(int port) {
+ socket_ = socket(AF_INET6, SOCK_DGRAM, 0);
+ if (socket_ == BAD_SOCKET_RETURN_VAL) {
+ gpr_log(GPR_DEBUG, "Failed to create UDP ipv6 socket");
+ abort();
+ }
+ sockaddr_in6 addr;
+ memset(&addr, 0, sizeof(addr));
+ addr.sin6_family = AF_INET6;
+ addr.sin6_port = htons(port);
+ ((char*)&addr.sin6_addr)[15] = 1;
+ if (bind(socket_, (const sockaddr*)&addr, sizeof(addr)) != 0) {
+ gpr_log(GPR_DEBUG, "Failed to bind UDP ipv6 socket to [::1]:%d", port);
+ abort();
+ }
+ }
+ ~FakeNonResponsiveDNSServer() { close(socket_); }
+
+ private:
+ int socket_;
+};
+
+struct ArgsStruct {
+ gpr_atm done_atm;
+ gpr_mu* mu;
+ grpc_pollset* pollset;
+ grpc_pollset_set* pollset_set;
+ grpc_combiner* lock;
+ grpc_channel_args* channel_args;
+};
+
+void ArgsInit(ArgsStruct* args) {
+ args->pollset = (grpc_pollset*)gpr_zalloc(grpc_pollset_size());
+ grpc_pollset_init(args->pollset, &args->mu);
+ args->pollset_set = grpc_pollset_set_create();
+ grpc_pollset_set_add_pollset(args->pollset_set, args->pollset);
+ args->lock = grpc_combiner_create();
+ gpr_atm_rel_store(&args->done_atm, 0);
+ args->channel_args = nullptr;
+}
+
+void DoNothing(void* arg, grpc_error* error) {}
+
+void ArgsFinish(ArgsStruct* args) {
+ grpc_pollset_set_del_pollset(args->pollset_set, args->pollset);
+ grpc_pollset_set_destroy(args->pollset_set);
+ grpc_closure DoNothing_cb;
+ GRPC_CLOSURE_INIT(&DoNothing_cb, DoNothing, nullptr,
+ grpc_schedule_on_exec_ctx);
+ grpc_pollset_shutdown(args->pollset, &DoNothing_cb);
+ // exec_ctx needs to be flushed before calling grpc_pollset_destroy()
+ grpc_channel_args_destroy(args->channel_args);
+ grpc_core::ExecCtx::Get()->Flush();
+ grpc_pollset_destroy(args->pollset);
+ gpr_free(args->pollset);
+ GRPC_COMBINER_UNREF(args->lock, nullptr);
+}
+
+void PollPollsetUntilRequestDone(ArgsStruct* args) {
+ while (true) {
+ bool done = gpr_atm_acq_load(&args->done_atm) != 0;
+ if (done) {
+ break;
+ }
+ grpc_pollset_worker* worker = nullptr;
+ grpc_core::ExecCtx exec_ctx;
+ gpr_mu_lock(args->mu);
+ GRPC_LOG_IF_ERROR(
+ "pollset_work",
+ grpc_pollset_work(args->pollset, &worker,
+ grpc_timespec_to_millis_round_up(
+ gpr_inf_future(GPR_CLOCK_REALTIME))));
+ gpr_mu_unlock(args->mu);
+ }
+}
+
+void CheckResolverResultAssertFailureLocked(void* arg, grpc_error* error) {
+ EXPECT_NE(error, GRPC_ERROR_NONE);
+ ArgsStruct* args = static_cast<ArgsStruct*>(arg);
+ gpr_atm_rel_store(&args->done_atm, 1);
+ gpr_mu_lock(args->mu);
+ GRPC_LOG_IF_ERROR("pollset_kick", grpc_pollset_kick(args->pollset, nullptr));
+ gpr_mu_unlock(args->mu);
+}
+
+TEST(CancelDuringAresQuery, TestCancelActiveDNSQuery) {
+ grpc_core::ExecCtx exec_ctx;
+ ArgsStruct args;
+ ArgsInit(&args);
+ int fake_dns_port = grpc_pick_unused_port_or_die();
+ FakeNonResponsiveDNSServer fake_dns_server(fake_dns_port);
+ char* client_target;
+ GPR_ASSERT(gpr_asprintf(
+ &client_target,
+ "dns://[::1]:%d/dont-care-since-wont-be-resolved.test.com:1234",
+ fake_dns_port));
+ // create resolver and resolve
+ grpc_core::OrphanablePtr<grpc_core::Resolver> resolver =
+ grpc_core::ResolverRegistry::CreateResolver(client_target, nullptr,
+ args.pollset_set, args.lock);
+ gpr_free(client_target);
+ grpc_closure on_resolver_result_changed;
+ GRPC_CLOSURE_INIT(&on_resolver_result_changed,
+ CheckResolverResultAssertFailureLocked, (void*)&args,
+ grpc_combiner_scheduler(args.lock));
+ resolver->NextLocked(&args.channel_args, &on_resolver_result_changed);
+ // Without resetting and causing resolver shutdown, the
+ // PollPollsetUntilRequestDone call should never finish.
+ resolver.reset();
+ grpc_core::ExecCtx::Get()->Flush();
+ PollPollsetUntilRequestDone(&args);
+ ArgsFinish(&args);
+}
+
+TEST(CancelDuringAresQuery,
+ TestHitDeadlineAndDestroyChannelDuringAresResolutionIsGraceful) {
+ // Start up fake non responsive DNS server
+ int fake_dns_port = grpc_pick_unused_port_or_die();
+ FakeNonResponsiveDNSServer fake_dns_server(fake_dns_port);
+ // Create a call that will try to use the fake DNS server
+ char* client_target = nullptr;
+ GPR_ASSERT(gpr_asprintf(
+ &client_target,
+ "dns://[::1]:%d/dont-care-since-wont-be-resolved.test.com:1234",
+ fake_dns_port));
+ grpc_channel* client =
+ grpc_insecure_channel_create(client_target,
+ /* client_args */ nullptr, nullptr);
+ gpr_free(client_target);
+ grpc_completion_queue* cq = grpc_completion_queue_create_for_next(nullptr);
+ cq_verifier* cqv = cq_verifier_create(cq);
+ gpr_timespec deadline = grpc_timeout_milliseconds_to_deadline(10);
+ grpc_call* call = grpc_channel_create_call(
+ client, nullptr, GRPC_PROPAGATE_DEFAULTS, cq,
+ grpc_slice_from_static_string("/foo"), nullptr, deadline, nullptr);
+ GPR_ASSERT(call);
+ grpc_metadata_array initial_metadata_recv;
+ grpc_metadata_array trailing_metadata_recv;
+ grpc_metadata_array request_metadata_recv;
+ grpc_metadata_array_init(&initial_metadata_recv);
+ grpc_metadata_array_init(&trailing_metadata_recv);
+ grpc_metadata_array_init(&request_metadata_recv);
+ grpc_call_details call_details;
+ grpc_call_details_init(&call_details);
+ grpc_status_code status;
+ const char* error_string;
+ grpc_slice details;
+ // Set ops for client the request
+ grpc_op ops_base[6];
+ memset(ops_base, 0, sizeof(ops_base));
+ grpc_op* op = ops_base;
+ op->op = GRPC_OP_SEND_INITIAL_METADATA;
+ op->data.send_initial_metadata.count = 0;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ op->op = GRPC_OP_RECV_INITIAL_METADATA;
+ op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+ op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+ op->data.recv_status_on_client.status = &status;
+ op->data.recv_status_on_client.status_details = &details;
+ op->data.recv_status_on_client.error_string = &error_string;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ // Run the call and sanity check it failed as expected
+ grpc_call_error error = grpc_call_start_batch(
+ call, ops_base, static_cast<size_t>(op - ops_base), Tag(1), nullptr);
+ EXPECT_EQ(GRPC_CALL_OK, error);
+ CQ_EXPECT_COMPLETION(cqv, Tag(1), 1);
+ cq_verify(cqv);
+ EXPECT_EQ(status, GRPC_STATUS_DEADLINE_EXCEEDED);
+ // Teardown
+ grpc_slice_unref(details);
+ gpr_free((void*)error_string);
+ grpc_metadata_array_destroy(&initial_metadata_recv);
+ grpc_metadata_array_destroy(&trailing_metadata_recv);
+ grpc_metadata_array_destroy(&request_metadata_recv);
+ grpc_call_details_destroy(&call_details);
+ grpc_call_unref(call);
+ cq_verifier_destroy(cqv);
+ EndTest(client, cq);
+}
+
+} // namespace
+
+int main(int argc, char** argv) {
+ grpc_test_init(argc, argv);
+ ::testing::InitGoogleTest(&argc, argv);
+ gpr_setenv("GRPC_DNS_RESOLVER", "ares");
+ // Sanity check the time that it takes to run the test
+ // including the teardown time (the teardown
+ // part of the test involves cancelling the DNS query,
+ // which is the main point of interest for this test).
+ gpr_timespec overall_deadline = grpc_timeout_seconds_to_deadline(4);
+ grpc_init();
+ auto result = RUN_ALL_TESTS();
+ grpc_shutdown();
+ if (gpr_time_cmp(gpr_now(GPR_CLOCK_MONOTONIC), overall_deadline) > 0) {
+ gpr_log(GPR_ERROR, "Test took too long");
+ abort();
+ }
+ return result;
+}
diff --git a/test/cpp/naming/gen_build_yaml.py b/test/cpp/naming/gen_build_yaml.py
index a0767b21cf..baa6512f62 100755
--- a/test/cpp/naming/gen_build_yaml.py
+++ b/test/cpp/naming/gen_build_yaml.py
@@ -121,6 +121,25 @@ def main():
'grpc++_test_config',
],
} for unsecure_build_config_suffix in ['_unsecure', '']
+ ] + [
+ {
+ 'name': 'cancel_ares_query_test',
+ 'build': 'test',
+ 'language': 'c++',
+ 'gtest': True,
+ 'run': True,
+ 'src': ['test/cpp/naming/cancel_ares_query_test.cc'],
+ 'platforms': ['linux', 'posix', 'mac'],
+ 'deps': [
+ 'grpc++_test_util',
+ 'grpc_test_util',
+ 'gpr_test_util',
+ 'grpc++',
+ 'grpc',
+ 'gpr',
+ 'grpc++_test_config',
+ ],
+ },
]
}
diff --git a/test/cpp/naming/resolver_component_test.cc b/test/cpp/naming/resolver_component_test.cc
index f4be064305..6ac548120c 100644
--- a/test/cpp/naming/resolver_component_test.cc
+++ b/test/cpp/naming/resolver_component_test.cc
@@ -22,10 +22,14 @@
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
+
#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
#include <gflags/gflags.h>
#include <gmock/gmock.h>
+#include <thread>
#include <vector>
#include "test/cpp/util/subprocess.h"
@@ -48,6 +52,12 @@
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
+// TODO: pull in different headers when enabling this
+// test on windows. Also set BAD_SOCKET_RETURN_VAL
+// to INVALID_SOCKET on windows.
+#include "src/core/lib/iomgr/sockaddr_posix.h"
+#define BAD_SOCKET_RETURN_VAL -1
+
using grpc::SubProcess;
using std::vector;
using testing::UnorderedElementsAreArray;
@@ -80,7 +90,7 @@ namespace {
class GrpcLBAddress final {
public:
GrpcLBAddress(std::string address, bool is_balancer)
- : is_balancer(is_balancer), address(address) {}
+ : is_balancer(is_balancer), address(std::move(address)) {}
bool operator==(const GrpcLBAddress& other) const {
return this->is_balancer == other.is_balancer &&
@@ -99,7 +109,7 @@ vector<GrpcLBAddress> ParseExpectedAddrs(std::string expected_addrs) {
std::vector<GrpcLBAddress> out;
while (expected_addrs.size() != 0) {
// get the next <ip>,<port> (v4 or v6)
- size_t next_comma = expected_addrs.find(",");
+ size_t next_comma = expected_addrs.find(',');
if (next_comma == std::string::npos) {
gpr_log(GPR_ERROR,
"Missing ','. Expected_addrs arg should be a semicolon-separated "
@@ -110,7 +120,7 @@ vector<GrpcLBAddress> ParseExpectedAddrs(std::string expected_addrs) {
std::string next_addr = expected_addrs.substr(0, next_comma);
expected_addrs = expected_addrs.substr(next_comma + 1, std::string::npos);
// get the next is_balancer 'bool' associated with this address
- size_t next_semicolon = expected_addrs.find(";");
+ size_t next_semicolon = expected_addrs.find(';');
bool is_balancer =
gpr_is_true(expected_addrs.substr(0, next_semicolon).c_str());
out.emplace_back(GrpcLBAddress(next_addr, is_balancer));
@@ -231,7 +241,79 @@ void CheckLBPolicyResultLocked(grpc_channel_args* channel_args,
}
}
+void OpenAndCloseSocketsStressLoop(int dummy_port, gpr_event* done_ev) {
+ // The goal of this loop is to catch socket
+ // "use after close" bugs within the c-ares resolver by acting
+ // like some separate thread doing I/O.
+ // It's goal is to try to hit race conditions whereby:
+ // 1) The c-ares resolver closes a socket.
+ // 2) This loop opens a socket with (coincidentally) the same handle.
+ // 3) the c-ares resolver mistakenly uses that same socket without
+ // realizing that its closed.
+ // 4) This loop performs an operation on that socket that should
+ // succeed but instead fails because of what the c-ares
+ // resolver did in the meantime.
+ sockaddr_in6 addr;
+ memset(&addr, 0, sizeof(addr));
+ addr.sin6_family = AF_INET6;
+ addr.sin6_port = htons(dummy_port);
+ ((char*)&addr.sin6_addr)[15] = 1;
+ for (;;) {
+ if (gpr_event_get(done_ev)) {
+ return;
+ }
+ std::vector<int> sockets;
+ // First open a bunch of sockets, bind and listen
+ // '50' is an arbitrary number that, experimentally,
+ // has a good chance of catching bugs.
+ for (size_t i = 0; i < 50; i++) {
+ int s = socket(AF_INET6, SOCK_STREAM, 0);
+ int val = 1;
+ ASSERT_TRUE(setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &val, sizeof(val)) ==
+ 0)
+ << "Failed to set socketopt reuseport";
+ ASSERT_TRUE(setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) ==
+ 0)
+ << "Failed to set socket reuseaddr";
+ ASSERT_TRUE(fcntl(s, F_SETFL, O_NONBLOCK) == 0)
+ << "Failed to set socket non-blocking";
+ ASSERT_TRUE(s != BAD_SOCKET_RETURN_VAL)
+ << "Failed to create TCP ipv6 socket";
+ gpr_log(GPR_DEBUG, "Opened fd: %d", s);
+ ASSERT_TRUE(bind(s, (const sockaddr*)&addr, sizeof(addr)) == 0)
+ << "Failed to bind socket " + std::to_string(s) +
+ " to [::1]:" + std::to_string(dummy_port) +
+ ". errno: " + std::to_string(errno);
+ ASSERT_TRUE(listen(s, 1) == 0) << "Failed to listen on socket " +
+ std::to_string(s) +
+ ". errno: " + std::to_string(errno);
+ sockets.push_back(s);
+ }
+ // Do a non-blocking accept followed by a close on all of those sockets.
+ // Do this in a separate loop to try to induce a time window to hit races.
+ for (size_t i = 0; i < sockets.size(); i++) {
+ gpr_log(GPR_DEBUG, "non-blocking accept then close on %d", sockets[i]);
+ if (accept(sockets[i], nullptr, nullptr)) {
+ // If e.g. a "shutdown" was called on this fd from another thread,
+ // then this accept call should fail with an unexpected error.
+ ASSERT_TRUE(errno == EAGAIN || errno == EWOULDBLOCK)
+ << "OpenAndCloseSocketsStressLoop accept on socket " +
+ std::to_string(sockets[i]) +
+ " failed in "
+ "an unexpected way. "
+ "errno: " +
+ std::to_string(errno) +
+ ". Socket use-after-close bugs are likely.";
+ }
+ ASSERT_TRUE(close(sockets[i]) == 0)
+ << "Failed to close socket: " + std::to_string(sockets[i]) +
+ ". errno: " + std::to_string(errno);
+ }
+ }
+}
+
void CheckResolverResultLocked(void* argsp, grpc_error* err) {
+ EXPECT_EQ(err, GRPC_ERROR_NONE);
ArgsStruct* args = (ArgsStruct*)argsp;
grpc_channel_args* channel_args = args->channel_args;
const grpc_arg* channel_arg =
@@ -271,7 +353,17 @@ void CheckResolverResultLocked(void* argsp, grpc_error* err) {
gpr_mu_unlock(args->mu);
}
-TEST(ResolverComponentTest, TestResolvesRelevantRecords) {
+void CheckResolvedWithoutErrorLocked(void* argsp, grpc_error* err) {
+ EXPECT_EQ(err, GRPC_ERROR_NONE);
+ ArgsStruct* args = (ArgsStruct*)argsp;
+ gpr_atm_rel_store(&args->done_atm, 1);
+ gpr_mu_lock(args->mu);
+ GRPC_LOG_IF_ERROR("pollset_kick", grpc_pollset_kick(args->pollset, nullptr));
+ gpr_mu_unlock(args->mu);
+}
+
+void RunResolvesRelevantRecordsTest(void (*OnDoneLocked)(void* arg,
+ grpc_error* error)) {
grpc_core::ExecCtx exec_ctx;
ArgsStruct args;
ArgsInit(&args);
@@ -289,14 +381,32 @@ TEST(ResolverComponentTest, TestResolvesRelevantRecords) {
args.pollset_set, args.lock);
gpr_free(whole_uri);
grpc_closure on_resolver_result_changed;
- GRPC_CLOSURE_INIT(&on_resolver_result_changed, CheckResolverResultLocked,
- (void*)&args, grpc_combiner_scheduler(args.lock));
+ GRPC_CLOSURE_INIT(&on_resolver_result_changed, OnDoneLocked, (void*)&args,
+ grpc_combiner_scheduler(args.lock));
resolver->NextLocked(&args.channel_args, &on_resolver_result_changed);
grpc_core::ExecCtx::Get()->Flush();
PollPollsetUntilRequestDone(&args);
ArgsFinish(&args);
}
+TEST(ResolverComponentTest, TestResolvesRelevantRecords) {
+ RunResolvesRelevantRecordsTest(CheckResolverResultLocked);
+}
+
+TEST(ResolverComponentTest, TestResolvesRelevantRecordsWithConcurrentFdStress) {
+ // Start up background stress thread
+ int dummy_port = grpc_pick_unused_port_or_die();
+ gpr_event done_ev;
+ gpr_event_init(&done_ev);
+ std::thread socket_stress_thread(OpenAndCloseSocketsStressLoop, dummy_port,
+ &done_ev);
+ // Run the resolver test
+ RunResolvesRelevantRecordsTest(CheckResolvedWithoutErrorLocked);
+ // Shutdown and join stress thread
+ gpr_event_set(&done_ev, (void*)1);
+ socket_stress_thread.join();
+}
+
} // namespace
int main(int argc, char** argv) {
diff --git a/test/cpp/naming/resolver_component_tests_runner_invoker.cc b/test/cpp/naming/resolver_component_tests_runner_invoker.cc
index 45c1029caa..68be00a67d 100644
--- a/test/cpp/naming/resolver_component_tests_runner_invoker.cc
+++ b/test/cpp/naming/resolver_component_tests_runner_invoker.cc
@@ -99,21 +99,21 @@ namespace grpc {
namespace testing {
-void InvokeResolverComponentTestsRunner(std::string test_runner_bin_path,
- std::string test_bin_path,
- std::string dns_server_bin_path,
- std::string records_config_path,
- std::string dns_resolver_bin_path,
- std::string tcp_connect_bin_path) {
+void InvokeResolverComponentTestsRunner(
+ std::string test_runner_bin_path, const std::string& test_bin_path,
+ const std::string& dns_server_bin_path,
+ const std::string& records_config_path,
+ const std::string& dns_resolver_bin_path,
+ const std::string& tcp_connect_bin_path) {
int dns_server_port = grpc_pick_unused_port_or_die();
- SubProcess* test_driver =
- new SubProcess({test_runner_bin_path, "--test_bin_path=" + test_bin_path,
- "--dns_server_bin_path=" + dns_server_bin_path,
- "--records_config_path=" + records_config_path,
- "--dns_server_port=" + std::to_string(dns_server_port),
- "--dns_resolver_bin_path=" + dns_resolver_bin_path,
- "--tcp_connect_bin_path=" + tcp_connect_bin_path});
+ SubProcess* test_driver = new SubProcess(
+ {std::move(test_runner_bin_path), "--test_bin_path=" + test_bin_path,
+ "--dns_server_bin_path=" + dns_server_bin_path,
+ "--records_config_path=" + records_config_path,
+ "--dns_server_port=" + std::to_string(dns_server_port),
+ "--dns_resolver_bin_path=" + dns_resolver_bin_path,
+ "--tcp_connect_bin_path=" + tcp_connect_bin_path});
gpr_mu test_driver_mu;
gpr_mu_init(&test_driver_mu);
gpr_cv test_driver_cv;
diff --git a/test/cpp/qps/client.h b/test/cpp/qps/client.h
index 31ae6ca1fb..9d58ea8882 100644
--- a/test/cpp/qps/client.h
+++ b/test/cpp/qps/client.h
@@ -450,7 +450,7 @@ class ClientImpl : public Client {
private:
void set_channel_args(const ClientConfig& config, ChannelArguments* args) {
- for (auto channel_arg : config.channel_args()) {
+ for (const auto& channel_arg : config.channel_args()) {
if (channel_arg.value_case() == ChannelArg::kStrValue) {
args->SetString(channel_arg.name(), channel_arg.str_value());
} else if (channel_arg.value_case() == ChannelArg::kIntValue) {
diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc
index c79a10d1b4..bad24cf04a 100644
--- a/test/cpp/qps/client_async.cc
+++ b/test/cpp/qps/client_async.cc
@@ -24,6 +24,7 @@
#include <sstream>
#include <string>
#include <thread>
+#include <utility>
#include <vector>
#include <grpc/grpc.h>
@@ -78,7 +79,7 @@ class ClientRpcContextUnaryImpl : public ClientRpcContext {
response_(),
next_state_(State::READY),
callback_(on_done),
- next_issue_(next_issue),
+ next_issue_(std::move(next_issue)),
prepare_req_(prepare_req) {}
~ClientRpcContextUnaryImpl() override {}
void Start(CompletionQueue* cq, const ClientConfig& config) override {
@@ -298,7 +299,7 @@ class AsyncClient : public ClientImpl<StubType, RequestType> {
};
static std::unique_ptr<BenchmarkService::Stub> BenchmarkStubCreator(
- std::shared_ptr<Channel> ch) {
+ const std::shared_ptr<Channel>& ch) {
return BenchmarkService::NewStub(ch);
}
@@ -313,7 +314,7 @@ class AsyncUnaryClient final
~AsyncUnaryClient() override {}
private:
- static void CheckDone(grpc::Status s, SimpleResponse* response,
+ static void CheckDone(const grpc::Status& s, SimpleResponse* response,
HistogramEntry* entry) {
entry->set_status(s.error_code());
}
@@ -326,7 +327,7 @@ class AsyncUnaryClient final
std::function<gpr_timespec()> next_issue,
const SimpleRequest& req) {
return new ClientRpcContextUnaryImpl<SimpleRequest, SimpleResponse>(
- stub, req, next_issue, AsyncUnaryClient::PrepareReq,
+ stub, req, std::move(next_issue), AsyncUnaryClient::PrepareReq,
AsyncUnaryClient::CheckDone);
}
};
@@ -349,7 +350,7 @@ class ClientRpcContextStreamingPingPongImpl : public ClientRpcContext {
response_(),
next_state_(State::INVALID),
callback_(on_done),
- next_issue_(next_issue),
+ next_issue_(std::move(next_issue)),
prepare_req_(prepare_req),
coalesce_(false) {}
~ClientRpcContextStreamingPingPongImpl() override {}
@@ -497,7 +498,7 @@ class AsyncStreamingPingPongClient final
~AsyncStreamingPingPongClient() override {}
private:
- static void CheckDone(grpc::Status s, SimpleResponse* response) {}
+ static void CheckDone(const grpc::Status& s, SimpleResponse* response) {}
static std::unique_ptr<
grpc::ClientAsyncReaderWriter<SimpleRequest, SimpleResponse>>
PrepareReq(BenchmarkService::Stub* stub, grpc::ClientContext* ctx,
@@ -510,7 +511,8 @@ class AsyncStreamingPingPongClient final
const SimpleRequest& req) {
return new ClientRpcContextStreamingPingPongImpl<SimpleRequest,
SimpleResponse>(
- stub, req, next_issue, AsyncStreamingPingPongClient::PrepareReq,
+ stub, req, std::move(next_issue),
+ AsyncStreamingPingPongClient::PrepareReq,
AsyncStreamingPingPongClient::CheckDone);
}
};
@@ -533,7 +535,7 @@ class ClientRpcContextStreamingFromClientImpl : public ClientRpcContext {
response_(),
next_state_(State::INVALID),
callback_(on_done),
- next_issue_(next_issue),
+ next_issue_(std::move(next_issue)),
prepare_req_(prepare_req) {}
~ClientRpcContextStreamingFromClientImpl() override {}
void Start(CompletionQueue* cq, const ClientConfig& config) override {
@@ -628,7 +630,7 @@ class AsyncStreamingFromClientClient final
~AsyncStreamingFromClientClient() override {}
private:
- static void CheckDone(grpc::Status s, SimpleResponse* response) {}
+ static void CheckDone(const grpc::Status& s, SimpleResponse* response) {}
static std::unique_ptr<grpc::ClientAsyncWriter<SimpleRequest>> PrepareReq(
BenchmarkService::Stub* stub, grpc::ClientContext* ctx,
SimpleResponse* resp, CompletionQueue* cq) {
@@ -640,7 +642,8 @@ class AsyncStreamingFromClientClient final
const SimpleRequest& req) {
return new ClientRpcContextStreamingFromClientImpl<SimpleRequest,
SimpleResponse>(
- stub, req, next_issue, AsyncStreamingFromClientClient::PrepareReq,
+ stub, req, std::move(next_issue),
+ AsyncStreamingFromClientClient::PrepareReq,
AsyncStreamingFromClientClient::CheckDone);
}
};
@@ -663,7 +666,7 @@ class ClientRpcContextStreamingFromServerImpl : public ClientRpcContext {
response_(),
next_state_(State::INVALID),
callback_(on_done),
- next_issue_(next_issue),
+ next_issue_(std::move(next_issue)),
prepare_req_(prepare_req) {}
~ClientRpcContextStreamingFromServerImpl() override {}
void Start(CompletionQueue* cq, const ClientConfig& config) override {
@@ -742,7 +745,7 @@ class AsyncStreamingFromServerClient final
~AsyncStreamingFromServerClient() override {}
private:
- static void CheckDone(grpc::Status s, SimpleResponse* response) {}
+ static void CheckDone(const grpc::Status& s, SimpleResponse* response) {}
static std::unique_ptr<grpc::ClientAsyncReader<SimpleResponse>> PrepareReq(
BenchmarkService::Stub* stub, grpc::ClientContext* ctx,
const SimpleRequest& req, CompletionQueue* cq) {
@@ -754,7 +757,8 @@ class AsyncStreamingFromServerClient final
const SimpleRequest& req) {
return new ClientRpcContextStreamingFromServerImpl<SimpleRequest,
SimpleResponse>(
- stub, req, next_issue, AsyncStreamingFromServerClient::PrepareReq,
+ stub, req, std::move(next_issue),
+ AsyncStreamingFromServerClient::PrepareReq,
AsyncStreamingFromServerClient::CheckDone);
}
};
@@ -775,9 +779,9 @@ class ClientRpcContextGenericStreamingImpl : public ClientRpcContext {
req_(req),
response_(),
next_state_(State::INVALID),
- callback_(on_done),
- next_issue_(next_issue),
- prepare_req_(prepare_req) {}
+ callback_(std::move(on_done)),
+ next_issue_(std::move(next_issue)),
+ prepare_req_(std::move(prepare_req)) {}
~ClientRpcContextGenericStreamingImpl() override {}
void Start(CompletionQueue* cq, const ClientConfig& config) override {
GPR_ASSERT(!config.use_coalesce_api()); // not supported yet.
@@ -891,7 +895,7 @@ class ClientRpcContextGenericStreamingImpl : public ClientRpcContext {
};
static std::unique_ptr<grpc::GenericStub> GenericStubCreator(
- std::shared_ptr<Channel> ch) {
+ const std::shared_ptr<Channel>& ch) {
return std::unique_ptr<grpc::GenericStub>(new grpc::GenericStub(ch));
}
@@ -907,7 +911,7 @@ class GenericAsyncStreamingClient final
~GenericAsyncStreamingClient() override {}
private:
- static void CheckDone(grpc::Status s, ByteBuffer* response) {}
+ static void CheckDone(const grpc::Status& s, ByteBuffer* response) {}
static std::unique_ptr<grpc::GenericClientAsyncReaderWriter> PrepareReq(
grpc::GenericStub* stub, grpc::ClientContext* ctx,
const grpc::string& method_name, CompletionQueue* cq) {
@@ -918,7 +922,8 @@ class GenericAsyncStreamingClient final
std::function<gpr_timespec()> next_issue,
const ByteBuffer& req) {
return new ClientRpcContextGenericStreamingImpl(
- stub, req, next_issue, GenericAsyncStreamingClient::PrepareReq,
+ stub, req, std::move(next_issue),
+ GenericAsyncStreamingClient::PrepareReq,
GenericAsyncStreamingClient::CheckDone);
}
};
diff --git a/test/cpp/qps/client_sync.cc b/test/cpp/qps/client_sync.cc
index e65e3b43f3..668d9abf5c 100644
--- a/test/cpp/qps/client_sync.cc
+++ b/test/cpp/qps/client_sync.cc
@@ -44,7 +44,7 @@ namespace grpc {
namespace testing {
static std::unique_ptr<BenchmarkService::Stub> BenchmarkStubCreator(
- std::shared_ptr<Channel> ch) {
+ const std::shared_ptr<Channel>& ch) {
return BenchmarkService::NewStub(ch);
}
@@ -192,7 +192,7 @@ class SynchronousStreamingClient : public SynchronousClient {
new (&context_[thread_idx]) ClientContext();
}
- void CleanupAllStreams(std::function<void(size_t)> cleaner) {
+ void CleanupAllStreams(const std::function<void(size_t)>& cleaner) {
std::vector<std::thread> cleanup_threads;
for (size_t i = 0; i < num_threads_; i++) {
cleanup_threads.emplace_back([this, i, cleaner] {
diff --git a/test/cpp/qps/driver.cc b/test/cpp/qps/driver.cc
index 34f1291576..cabbd51843 100644
--- a/test/cpp/qps/driver.cc
+++ b/test/cpp/qps/driver.cc
@@ -96,16 +96,20 @@ static deque<string> get_workers(const string& env_name) {
}
// helpers for postprocess_scenario_result
-static double WallTime(ClientStats s) { return s.time_elapsed(); }
-static double SystemTime(ClientStats s) { return s.time_system(); }
-static double UserTime(ClientStats s) { return s.time_user(); }
-static double CliPollCount(ClientStats s) { return s.cq_poll_count(); }
-static double SvrPollCount(ServerStats s) { return s.cq_poll_count(); }
-static double ServerWallTime(ServerStats s) { return s.time_elapsed(); }
-static double ServerSystemTime(ServerStats s) { return s.time_system(); }
-static double ServerUserTime(ServerStats s) { return s.time_user(); }
-static double ServerTotalCpuTime(ServerStats s) { return s.total_cpu_time(); }
-static double ServerIdleCpuTime(ServerStats s) { return s.idle_cpu_time(); }
+static double WallTime(const ClientStats& s) { return s.time_elapsed(); }
+static double SystemTime(const ClientStats& s) { return s.time_system(); }
+static double UserTime(const ClientStats& s) { return s.time_user(); }
+static double CliPollCount(const ClientStats& s) { return s.cq_poll_count(); }
+static double SvrPollCount(const ServerStats& s) { return s.cq_poll_count(); }
+static double ServerWallTime(const ServerStats& s) { return s.time_elapsed(); }
+static double ServerSystemTime(const ServerStats& s) { return s.time_system(); }
+static double ServerUserTime(const ServerStats& s) { return s.time_user(); }
+static double ServerTotalCpuTime(const ServerStats& s) {
+ return s.total_cpu_time();
+}
+static double ServerIdleCpuTime(const ServerStats& s) {
+ return s.idle_cpu_time();
+}
static int Cores(int n) { return n; }
// Postprocess ScenarioResult and populate result summary.
@@ -156,7 +160,7 @@ static void postprocess_scenario_result(ScenarioResult* result) {
int64_t successes = 0;
int64_t failures = 0;
for (int i = 0; i < result->request_results_size(); i++) {
- RequestResultCount rrc = result->request_results(i);
+ const RequestResultCount& rrc = result->request_results(i);
if (rrc.status_code() == 0) {
successes += rrc.count();
} else {
@@ -213,7 +217,6 @@ std::unique_ptr<ScenarioResult> RunScenario(
// To be added to the result, containing the final configuration used for
// client and config (including host, etc.)
ClientConfig result_client_config;
- const ServerConfig result_server_config = initial_server_config;
// Get client, server lists; ignore if inproc test
auto workers = (!run_inproc) ? get_workers("QPS_WORKERS") : deque<string>();
@@ -280,7 +283,7 @@ std::unique_ptr<ScenarioResult> RunScenario(
local_workers[i]->InProcessChannel(channel_args));
}
- ServerConfig server_config = initial_server_config;
+ const ServerConfig& server_config = initial_server_config;
if (server_config.core_limit() != 0) {
gpr_log(GPR_ERROR,
"server config core limit is set but ignored by driver");
diff --git a/test/cpp/qps/qps_interarrival_test.cc b/test/cpp/qps/qps_interarrival_test.cc
index 625b7db426..2cc22e9985 100644
--- a/test/cpp/qps/qps_interarrival_test.cc
+++ b/test/cpp/qps/qps_interarrival_test.cc
@@ -28,7 +28,8 @@
using grpc::testing::InterarrivalTimer;
using grpc::testing::RandomDistInterface;
-static void RunTest(RandomDistInterface&& r, int threads, std::string title) {
+static void RunTest(RandomDistInterface&& r, int threads,
+ const std::string& title) {
InterarrivalTimer timer;
timer.init(r, threads);
grpc_histogram* h(grpc_histogram_create(0.01, 60e9));
diff --git a/test/cpp/qps/report.h b/test/cpp/qps/report.h
index 8e62f4f449..b00b0a311f 100644
--- a/test/cpp/qps/report.h
+++ b/test/cpp/qps/report.h
@@ -129,7 +129,7 @@ class JsonReporter : public Reporter {
class RpcReporter : public Reporter {
public:
- RpcReporter(const string& name, std::shared_ptr<grpc::Channel> channel)
+ RpcReporter(const string& name, const std::shared_ptr<grpc::Channel>& channel)
: Reporter(name), stub_(ReportQpsScenarioService::NewStub(channel)) {}
private:
diff --git a/test/cpp/qps/server_sync.cc b/test/cpp/qps/server_sync.cc
index 82a9186989..b8facf9b56 100644
--- a/test/cpp/qps/server_sync.cc
+++ b/test/cpp/qps/server_sync.cc
@@ -129,7 +129,7 @@ class BenchmarkServiceImpl final : public BenchmarkService::Service {
template <class W>
static Status ServerPush(ServerContext* context, W* stream,
const SimpleResponse& response,
- std::function<bool()> done) {
+ const std::function<bool()>& done) {
while ((done == nullptr) || !done()) {
// TODO(vjpai): Add potential for rate-pacing on this
if (!stream->Write(response)) {
diff --git a/test/cpp/server/load_reporter/BUILD b/test/cpp/server/load_reporter/BUILD
index 5cb3a00f82..ebfcfbb348 100644
--- a/test/cpp/server/load_reporter/BUILD
+++ b/test/cpp/server/load_reporter/BUILD
@@ -14,7 +14,7 @@
licenses(["notice"]) # Apache v2
-load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_cc_library", "grpc_cc_binary", "grpc_package")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_binary", "grpc_cc_library", "grpc_cc_test", "grpc_package")
grpc_package(name = "test/cpp/server/load_reporter")
@@ -29,3 +29,35 @@ grpc_cc_test(
"//test/core/util:grpc_test_util",
],
)
+
+grpc_cc_test(
+ name = "lb_load_reporter_test",
+ srcs = ["load_reporter_test.cc"],
+ external_deps = [
+ "gtest",
+ "gmock",
+ "opencensus-stats-test",
+ ],
+ deps = [
+ "//:gpr",
+ "//:grpc",
+ "//:lb_load_reporter",
+ "//test/core/util:gpr_test_util",
+ "//test/core/util:grpc_test_util",
+ ],
+)
+
+grpc_cc_test(
+ name = "lb_get_cpu_stats_test",
+ srcs = ["get_cpu_stats_test.cc"],
+ external_deps = [
+ "gtest",
+ ],
+ deps = [
+ "//:gpr",
+ "//:grpc",
+ "//:lb_get_cpu_stats",
+ "//test/core/util:gpr_test_util",
+ "//test/core/util:grpc_test_util",
+ ],
+)
diff --git a/test/cpp/server/load_reporter/get_cpu_stats_test.cc b/test/cpp/server/load_reporter/get_cpu_stats_test.cc
new file mode 100644
index 0000000000..5b1d5fa3a4
--- /dev/null
+++ b/test/cpp/server/load_reporter/get_cpu_stats_test.cc
@@ -0,0 +1,61 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/impl/codegen/port_platform.h>
+
+#include <grpc/grpc.h>
+#include <gtest/gtest.h>
+
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+#include "src/cpp/server/load_reporter/get_cpu_stats.h"
+
+namespace grpc {
+namespace testing {
+namespace {
+
+TEST(GetCpuStatsTest, ReadOnce) { ::grpc::load_reporter::GetCpuStatsImpl(); }
+
+TEST(GetCpuStatsTest, BusyNoLargerThanTotal) {
+ auto p = ::grpc::load_reporter::GetCpuStatsImpl();
+ uint64_t busy = p.first;
+ uint64_t total = p.second;
+ ASSERT_LE(busy, total);
+}
+
+TEST(GetCpuStatsTest, Ascending) {
+ const size_t kRuns = 100;
+ auto prev = ::grpc::load_reporter::GetCpuStatsImpl();
+ for (size_t i = 0; i < kRuns; ++i) {
+ auto cur = ::grpc::load_reporter::GetCpuStatsImpl();
+ ASSERT_LE(prev.first, cur.first);
+ ASSERT_LE(prev.second, cur.second);
+ prev = cur;
+ }
+}
+
+} // namespace
+} // namespace testing
+} // namespace grpc
+
+int main(int argc, char** argv) {
+ grpc_test_init(argc, argv);
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
diff --git a/test/cpp/server/load_reporter/load_data_store_test.cc b/test/cpp/server/load_reporter/load_data_store_test.cc
index 8280dee6a4..c92c407e4f 100644
--- a/test/cpp/server/load_reporter/load_data_store_test.cc
+++ b/test/cpp/server/load_reporter/load_data_store_test.cc
@@ -50,8 +50,8 @@ class LoadDataStoreTest : public ::testing::Test {
bool PerBalancerStoresContains(
const LoadDataStore& load_data_store,
const std::set<PerBalancerStore*>* per_balancer_stores,
- const grpc::string hostname, const grpc::string lb_id,
- const grpc::string load_key) {
+ const grpc::string& hostname, const grpc::string& lb_id,
+ const grpc::string& load_key) {
auto original_per_balancer_store =
load_data_store.FindPerBalancerStore(hostname, lb_id);
EXPECT_NE(original_per_balancer_store, nullptr);
@@ -155,7 +155,7 @@ TEST_F(LoadDataStoreTest, OrphanAssignmentIsSticky) {
active_lb_ids.erase(orphaned_lb_id);
// Find which LB is assigned the orphaned store.
grpc::string assigned_lb_id = "";
- for (auto lb_id : active_lb_ids) {
+ for (const auto& lb_id : active_lb_ids) {
if (PerBalancerStoresContains(
load_data_store,
load_data_store.GetAssignedStores(kHostname1, lb_id), kHostname1,
@@ -169,7 +169,7 @@ TEST_F(LoadDataStoreTest, OrphanAssignmentIsSticky) {
// orphaned_lb_id shouldn't change.
for (size_t _ = 0; _ < 10; ++_) {
grpc::string lb_id_to_close = "";
- for (auto lb_id : active_lb_ids) {
+ for (const auto& lb_id : active_lb_ids) {
if (lb_id != assigned_lb_id) {
lb_id_to_close = lb_id;
break;
@@ -187,7 +187,7 @@ TEST_F(LoadDataStoreTest, OrphanAssignmentIsSticky) {
load_data_store.ReportStreamClosed(kHostname1, assigned_lb_id);
active_lb_ids.erase(assigned_lb_id);
size_t orphaned_lb_id_occurences = 0;
- for (auto lb_id : active_lb_ids) {
+ for (const auto& lb_id : active_lb_ids) {
if (PerBalancerStoresContains(
load_data_store,
load_data_store.GetAssignedStores(kHostname1, lb_id), kHostname1,
@@ -393,9 +393,9 @@ TEST_F(PerBalancerStoreTest, Suspend) {
TEST_F(PerBalancerStoreTest, DataAggregation) {
PerBalancerStore per_balancer_store(kLbId1, kLoadKey1);
// Construct some Values.
- LoadRecordValue v1(992, 34, 13, 234.0, 164.0, 173467.38);
+ LoadRecordValue v1(992, 34, 13, 234, 164, 173467);
v1.InsertCallMetric(kMetric1, CallMetricValue(3, 2773.2));
- LoadRecordValue v2(4842, 213, 9, 393.0, 974.0, 1345.2398);
+ LoadRecordValue v2(4842, 213, 9, 393, 974, 1345);
v2.InsertCallMetric(kMetric1, CallMetricValue(7, 25.234));
v2.InsertCallMetric(kMetric2, CallMetricValue(2, 387.08));
// v3 doesn't change the number of in-progress RPCs.
diff --git a/test/cpp/server/load_reporter/load_reporter_test.cc b/test/cpp/server/load_reporter/load_reporter_test.cc
new file mode 100644
index 0000000000..3264dba134
--- /dev/null
+++ b/test/cpp/server/load_reporter/load_reporter_test.cc
@@ -0,0 +1,498 @@
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/impl/codegen/port_platform.h>
+
+#include <set>
+#include <vector>
+
+#include <gmock/gmock.h>
+#include <grpc/grpc.h>
+#include <gtest/gtest.h>
+
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/cpp/server/load_reporter/constants.h"
+#include "src/cpp/server/load_reporter/load_reporter.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+#include "opencensus/stats/testing/test_utils.h"
+
+namespace grpc {
+namespace testing {
+namespace {
+
+using ::grpc::lb::v1::LoadBalancingFeedback;
+using ::grpc::load_reporter::CensusViewProvider;
+using ::grpc::load_reporter::CpuStatsProvider;
+using ::grpc::load_reporter::LoadReporter;
+using ::opencensus::stats::View;
+using ::opencensus::stats::ViewData;
+using ::opencensus::stats::ViewDataImpl;
+using ::opencensus::stats::ViewDescriptor;
+using ::testing::DoubleNear;
+using ::testing::Return;
+
+constexpr uint64_t kFeedbackSampleWindowSeconds = 5;
+constexpr uint64_t kFetchAndSampleIntervalSeconds = 1;
+constexpr uint64_t kNumFeedbackSamplesInWindow =
+ kFeedbackSampleWindowSeconds / kFetchAndSampleIntervalSeconds;
+
+class MockCensusViewProvider : public CensusViewProvider {
+ public:
+ MOCK_METHOD0(FetchViewData, CensusViewProvider::ViewDataMap());
+
+ const ::opencensus::stats::ViewDescriptor& FindViewDescriptor(
+ const grpc::string& view_name) {
+ auto it = view_descriptor_map().find(view_name);
+ GPR_ASSERT(it != view_descriptor_map().end());
+ return it->second;
+ }
+};
+
+class MockCpuStatsProvider : public CpuStatsProvider {
+ public:
+ MOCK_METHOD0(GetCpuStats, CpuStatsProvider::CpuStatsSample());
+};
+
+class LoadReporterTest : public ::testing::Test {
+ public:
+ LoadReporterTest() {}
+
+ MockCensusViewProvider* mock_census_view_provider() {
+ return static_cast<MockCensusViewProvider*>(
+ load_reporter_->census_view_provider());
+ }
+
+ void PrepareCpuExpectation(size_t call_num) {
+ auto mock_cpu_stats_provider = static_cast<MockCpuStatsProvider*>(
+ load_reporter_->cpu_stats_provider());
+ ::testing::InSequence s;
+ for (size_t i = 0; i < call_num; ++i) {
+ EXPECT_CALL(*mock_cpu_stats_provider, GetCpuStats())
+ .WillOnce(Return(kCpuStatsSamples[i]))
+ .RetiresOnSaturation();
+ }
+ }
+
+ CpuStatsProvider::CpuStatsSample initial_cpu_stats_{2, 20};
+ const std::vector<CpuStatsProvider::CpuStatsSample> kCpuStatsSamples = {
+ {13, 53}, {64, 96}, {245, 345}, {314, 785},
+ {874, 1230}, {1236, 2145}, {1864, 2974}};
+
+ std::unique_ptr<LoadReporter> load_reporter_;
+
+ const grpc::string kHostname1 = "kHostname1";
+ const grpc::string kHostname2 = "kHostname2";
+ const grpc::string kHostname3 = "kHostname3";
+ // Pad to the length of a valid LB ID.
+ const grpc::string kLbId1 = "kLbId111";
+ const grpc::string kLbId2 = "kLbId222";
+ const grpc::string kLbId3 = "kLbId333";
+ const grpc::string kLbId4 = "kLbId444";
+ const grpc::string kLoadKey1 = "kLoadKey1";
+ const grpc::string kLoadKey2 = "kLoadKey2";
+ const grpc::string kLoadKey3 = "kLoadKey3";
+ const grpc::string kLbTag1 = "kLbTag1";
+ const grpc::string kLbTag2 = "kLbTag2";
+ const grpc::string kLbToken1 = "kLbId111kLbTag1";
+ const grpc::string kLbToken2 = "kLbId222kLbTag2";
+ const grpc::string kUser1 = "kUser1";
+ const grpc::string kUser2 = "kUser2";
+ const grpc::string kUser3 = "kUser3";
+ const grpc::string kClientIp0 = "00";
+ const grpc::string kClientIp1 = "0800000001";
+ const grpc::string kClientIp2 = "3200000000000000000000000000000002";
+ const grpc::string kMetric1 = "kMetric1";
+ const grpc::string kMetric2 = "kMetric2";
+
+ private:
+ void SetUp() override {
+ auto mock_cpu = new MockCpuStatsProvider();
+ auto mock_census = new MockCensusViewProvider();
+ // Prepare the initial CPU stats data. Note that the expectation should be
+ // set up before the load reporter is initialized, because CPU stats is
+ // sampled at that point.
+ EXPECT_CALL(*mock_cpu, GetCpuStats())
+ .WillOnce(Return(initial_cpu_stats_))
+ .RetiresOnSaturation();
+ load_reporter_ = std::unique_ptr<LoadReporter>(
+ new LoadReporter(kFeedbackSampleWindowSeconds,
+ std::unique_ptr<CensusViewProvider>(mock_census),
+ std::unique_ptr<CpuStatsProvider>(mock_cpu)));
+ }
+};
+
+class LbFeedbackTest : public LoadReporterTest {
+ public:
+ // Note that [start, start + count) of the fake samples (maybe plus the
+ // initial record) are in the window now.
+ void VerifyLbFeedback(const LoadBalancingFeedback& lb_feedback, size_t start,
+ size_t count) {
+ const CpuStatsProvider::CpuStatsSample* base =
+ start == 0 ? &initial_cpu_stats_ : &kCpuStatsSamples[start - 1];
+ double expected_cpu_util =
+ static_cast<double>(kCpuStatsSamples[start + count - 1].first -
+ base->first) /
+ static_cast<double>(kCpuStatsSamples[start + count - 1].second -
+ base->second);
+ ASSERT_THAT(static_cast<double>(lb_feedback.server_utilization()),
+ DoubleNear(expected_cpu_util, 0.00001));
+ double qps_sum = 0, eps_sum = 0;
+ for (size_t i = 0; i < count; ++i) {
+ qps_sum += kQpsEpsSamples[start + i].first;
+ eps_sum += kQpsEpsSamples[start + i].second;
+ }
+ double expected_qps = qps_sum / count;
+ double expected_eps = eps_sum / count;
+ // TODO(juanlishen): The error is big because we use sleep(). It should be
+ // much smaller when we use fake clock.
+ ASSERT_THAT(static_cast<double>(lb_feedback.calls_per_second()),
+ DoubleNear(expected_qps, expected_qps / 50));
+ ASSERT_THAT(static_cast<double>(lb_feedback.errors_per_second()),
+ DoubleNear(expected_eps, expected_eps / 50));
+ gpr_log(GPR_INFO,
+ "Verified LB feedback matches the samples of index [%lu, %lu).",
+ start, start + count);
+ }
+
+ const std::vector<std::pair<double, double>> kQpsEpsSamples = {
+ {546.1, 153.1}, {62.1, 54.1}, {578.1, 154.2}, {978.1, 645.1},
+ {1132.1, 846.4}, {531.5, 315.4}, {874.1, 324.9}};
+};
+
+TEST_F(LbFeedbackTest, ZeroDuration) {
+ PrepareCpuExpectation(kCpuStatsSamples.size());
+ EXPECT_CALL(*mock_census_view_provider(), FetchViewData())
+ .WillRepeatedly(
+ Return(::grpc::load_reporter::CensusViewProvider::ViewDataMap()));
+ // Verify that divide-by-zero exception doesn't happen.
+ for (size_t i = 0; i < kCpuStatsSamples.size(); ++i) {
+ load_reporter_->FetchAndSample();
+ }
+ load_reporter_->GenerateLoadBalancingFeedback();
+}
+
+TEST_F(LbFeedbackTest, Normal) {
+ // Prepare view data list using the <QPS, EPS> samples.
+ std::vector<CensusViewProvider::ViewDataMap> view_data_map_list;
+ for (const auto& p : LbFeedbackTest::kQpsEpsSamples) {
+ double qps = p.first;
+ double eps = p.second;
+ double ok_count = (qps - eps) * kFetchAndSampleIntervalSeconds;
+ double error_count = eps * kFetchAndSampleIntervalSeconds;
+ double ok_count_1 = ok_count / 3.0;
+ double ok_count_2 = ok_count - ok_count_1;
+ auto end_count_vd = ::opencensus::stats::testing::TestUtils::MakeViewData(
+ mock_census_view_provider()->FindViewDescriptor(
+ ::grpc::load_reporter::kViewEndCount),
+ {{{kClientIp0 + kLbToken1, kHostname1, kUser1,
+ ::grpc::load_reporter::kCallStatusOk},
+ ok_count_1},
+ {{kClientIp0 + kLbToken1, kHostname1, kUser2,
+ ::grpc::load_reporter::kCallStatusOk},
+ ok_count_2},
+ {{kClientIp0 + kLbToken1, kHostname1, kUser1,
+ ::grpc::load_reporter::kCallStatusClientError},
+ error_count}});
+ // Values for other view data don't matter.
+ auto end_bytes_sent_vd =
+ ::opencensus::stats::testing::TestUtils::MakeViewData(
+ mock_census_view_provider()->FindViewDescriptor(
+ ::grpc::load_reporter::kViewEndBytesSent),
+ {{{kClientIp0 + kLbToken1, kHostname1, kUser1,
+ ::grpc::load_reporter::kCallStatusOk},
+ 0},
+ {{kClientIp0 + kLbToken1, kHostname1, kUser2,
+ ::grpc::load_reporter::kCallStatusOk},
+ 0},
+ {{kClientIp0 + kLbToken1, kHostname1, kUser1,
+ ::grpc::load_reporter::kCallStatusClientError},
+ 0}});
+ auto end_bytes_received_vd =
+ ::opencensus::stats::testing::TestUtils::MakeViewData(
+ mock_census_view_provider()->FindViewDescriptor(
+ ::grpc::load_reporter::kViewEndBytesReceived),
+ {{{kClientIp0 + kLbToken1, kHostname1, kUser1,
+ ::grpc::load_reporter::kCallStatusOk},
+ 0},
+ {{kClientIp0 + kLbToken1, kHostname1, kUser2,
+ ::grpc::load_reporter::kCallStatusOk},
+ 0},
+ {{kClientIp0 + kLbToken1, kHostname1, kUser1,
+ ::grpc::load_reporter::kCallStatusClientError},
+ 0}});
+ auto end_latency_vd = ::opencensus::stats::testing::TestUtils::MakeViewData(
+ mock_census_view_provider()->FindViewDescriptor(
+ ::grpc::load_reporter::kViewEndLatencyMs),
+ {{{kClientIp0 + kLbToken1, kHostname1, kUser1,
+ ::grpc::load_reporter::kCallStatusOk},
+ 0},
+ {{kClientIp0 + kLbToken1, kHostname1, kUser2,
+ ::grpc::load_reporter::kCallStatusOk},
+ 0},
+ {{kClientIp0 + kLbToken1, kHostname1, kUser1,
+ ::grpc::load_reporter::kCallStatusClientError},
+ 0}});
+ view_data_map_list.push_back(
+ {{::grpc::load_reporter::kViewEndCount, end_count_vd},
+ {::grpc::load_reporter::kViewEndBytesSent, end_bytes_sent_vd},
+ {::grpc::load_reporter::kViewEndBytesReceived, end_bytes_received_vd},
+ {::grpc::load_reporter::kViewEndLatencyMs, end_latency_vd}});
+ }
+ {
+ ::testing::InSequence s;
+ for (size_t i = 0; i < view_data_map_list.size(); ++i) {
+ EXPECT_CALL(*mock_census_view_provider(), FetchViewData())
+ .WillOnce(Return(view_data_map_list[i]))
+ .RetiresOnSaturation();
+ }
+ }
+ PrepareCpuExpectation(kNumFeedbackSamplesInWindow + 2);
+ // When the load reporter is created, a trivial LB feedback record is added.
+ // But that's not enough for generating an LB feedback.
+ // Fetch some view data so that non-trivial LB feedback can be generated.
+ for (size_t i = 0; i < kNumFeedbackSamplesInWindow / 2; ++i) {
+ // TODO(juanlishen): Find some fake clock to speed up testing.
+ sleep(1);
+ load_reporter_->FetchAndSample();
+ }
+ VerifyLbFeedback(load_reporter_->GenerateLoadBalancingFeedback(), 0,
+ kNumFeedbackSamplesInWindow / 2);
+ // Fetch more view data so that the feedback record window is just full (the
+ // initial record just falls out of the window).
+ for (size_t i = 0; i < (kNumFeedbackSamplesInWindow + 1) / 2; ++i) {
+ sleep(1);
+ load_reporter_->FetchAndSample();
+ }
+ VerifyLbFeedback(load_reporter_->GenerateLoadBalancingFeedback(), 0,
+ kNumFeedbackSamplesInWindow);
+ // Further fetching will cause the old records to fall out of the window.
+ for (size_t i = 0; i < 2; ++i) {
+ sleep(1);
+ load_reporter_->FetchAndSample();
+ }
+ VerifyLbFeedback(load_reporter_->GenerateLoadBalancingFeedback(), 2,
+ kNumFeedbackSamplesInWindow);
+}
+
+using LoadReportTest = LoadReporterTest;
+
+TEST_F(LoadReportTest, BasicReport) {
+ // Make up the first view data map.
+ CensusViewProvider::ViewDataMap vdm1;
+ vdm1.emplace(
+ ::grpc::load_reporter::kViewStartCount,
+ ::opencensus::stats::testing::TestUtils::MakeViewData(
+ mock_census_view_provider()->FindViewDescriptor(
+ ::grpc::load_reporter::kViewStartCount),
+ {{{kClientIp1 + kLbToken1, kHostname1, kUser1}, 1234},
+ {{kClientIp2 + kLbToken1, kHostname1, kUser1}, 1225},
+ {{kClientIp0 + kLbToken1, kHostname1, kUser1}, 10},
+ {{kClientIp2 + kLbToken1, kHostname1, kUser2}, 464},
+ {{kClientIp1 + kLbId2 + kLbTag1, kHostname2, kUser3}, 101},
+ {{kClientIp1 + kLbToken2, kHostname2, kUser3}, 17},
+ {{kClientIp2 + kLbId3 + kLbTag2, kHostname2, kUser3}, 23}}));
+ vdm1.emplace(::grpc::load_reporter::kViewEndCount,
+ ::opencensus::stats::testing::TestUtils::MakeViewData(
+ mock_census_view_provider()->FindViewDescriptor(
+ ::grpc::load_reporter::kViewEndCount),
+ {{{kClientIp1 + kLbToken1, kHostname1, kUser1,
+ ::grpc::load_reporter::kCallStatusOk},
+ 641},
+ {{kClientIp2 + kLbToken1, kHostname1, kUser1,
+ ::grpc::load_reporter::kCallStatusClientError},
+ 272},
+ {{kClientIp2 + kLbToken1, kHostname1, kUser2,
+ ::grpc::load_reporter::kCallStatusOk},
+ 996},
+ {{kClientIp1 + kLbId2 + kLbTag1, kHostname2, kUser3,
+ ::grpc::load_reporter::kCallStatusClientError},
+ 34},
+ {{kClientIp1 + kLbToken2, kHostname2, kUser2,
+ ::grpc::load_reporter::kCallStatusOk},
+ 18}}));
+ vdm1.emplace(::grpc::load_reporter::kViewEndBytesSent,
+ ::opencensus::stats::testing::TestUtils::MakeViewData(
+ mock_census_view_provider()->FindViewDescriptor(
+ ::grpc::load_reporter::kViewEndBytesSent),
+ {{{kClientIp1 + kLbToken1, kHostname1, kUser1,
+ ::grpc::load_reporter::kCallStatusOk},
+ 8977},
+ {{kClientIp2 + kLbToken1, kHostname1, kUser1,
+ ::grpc::load_reporter::kCallStatusClientError},
+ 266},
+ {{kClientIp2 + kLbToken1, kHostname1, kUser2,
+ ::grpc::load_reporter::kCallStatusOk},
+ 1276},
+ {{kClientIp1 + kLbId2 + kLbTag1, kHostname2, kUser3,
+ ::grpc::load_reporter::kCallStatusClientError},
+ 77823},
+ {{kClientIp1 + kLbToken2, kHostname2, kUser2,
+ ::grpc::load_reporter::kCallStatusOk},
+ 48}}));
+ vdm1.emplace(::grpc::load_reporter::kViewEndBytesReceived,
+ ::opencensus::stats::testing::TestUtils::MakeViewData(
+ mock_census_view_provider()->FindViewDescriptor(
+ ::grpc::load_reporter::kViewEndBytesReceived),
+ {{{kClientIp1 + kLbToken1, kHostname1, kUser1,
+ ::grpc::load_reporter::kCallStatusOk},
+ 2341},
+ {{kClientIp2 + kLbToken1, kHostname1, kUser1,
+ ::grpc::load_reporter::kCallStatusClientError},
+ 466},
+ {{kClientIp2 + kLbToken1, kHostname1, kUser2,
+ ::grpc::load_reporter::kCallStatusOk},
+ 518},
+ {{kClientIp1 + kLbId2 + kLbTag1, kHostname2, kUser3,
+ ::grpc::load_reporter::kCallStatusClientError},
+ 81},
+ {{kClientIp1 + kLbToken2, kHostname2, kUser2,
+ ::grpc::load_reporter::kCallStatusOk},
+ 27}}));
+ vdm1.emplace(::grpc::load_reporter::kViewEndLatencyMs,
+ ::opencensus::stats::testing::TestUtils::MakeViewData(
+ mock_census_view_provider()->FindViewDescriptor(
+ ::grpc::load_reporter::kViewEndLatencyMs),
+ {{{kClientIp1 + kLbToken1, kHostname1, kUser1,
+ ::grpc::load_reporter::kCallStatusOk},
+ 3.14},
+ {{kClientIp2 + kLbToken1, kHostname1, kUser1,
+ ::grpc::load_reporter::kCallStatusClientError},
+ 5.26},
+ {{kClientIp2 + kLbToken1, kHostname1, kUser2,
+ ::grpc::load_reporter::kCallStatusOk},
+ 45.4},
+ {{kClientIp1 + kLbId2 + kLbTag1, kHostname2, kUser3,
+ ::grpc::load_reporter::kCallStatusClientError},
+ 4.4},
+ {{kClientIp1 + kLbToken2, kHostname2, kUser2,
+ ::grpc::load_reporter::kCallStatusOk},
+ 2348.0}}));
+ vdm1.emplace(
+ ::grpc::load_reporter::kViewOtherCallMetricCount,
+ ::opencensus::stats::testing::TestUtils::MakeViewData(
+ mock_census_view_provider()->FindViewDescriptor(
+ ::grpc::load_reporter::kViewOtherCallMetricCount),
+ {{{kClientIp1 + kLbToken1, kHostname1, kUser2, kMetric1}, 1},
+ {{kClientIp1 + kLbToken1, kHostname1, kUser2, kMetric1}, 1},
+ {{kClientIp1 + kLbId2 + kLbTag1, kHostname2, kUser3, kMetric2},
+ 1}}));
+ vdm1.emplace(
+ ::grpc::load_reporter::kViewOtherCallMetricValue,
+ ::opencensus::stats::testing::TestUtils::MakeViewData(
+ mock_census_view_provider()->FindViewDescriptor(
+ ::grpc::load_reporter::kViewOtherCallMetricValue),
+ {{{kClientIp1 + kLbToken1, kHostname1, kUser2, kMetric1}, 1.2},
+ {{kClientIp1 + kLbToken1, kHostname1, kUser2, kMetric1}, 1.2},
+ {{kClientIp1 + kLbId2 + kLbTag1, kHostname2, kUser3, kMetric2},
+ 3.2}}));
+ // Make up the second view data map.
+ CensusViewProvider::ViewDataMap vdm2;
+ vdm2.emplace(
+ ::grpc::load_reporter::kViewStartCount,
+ ::opencensus::stats::testing::TestUtils::MakeViewData(
+ mock_census_view_provider()->FindViewDescriptor(
+ ::grpc::load_reporter::kViewStartCount),
+ {{{kClientIp2 + kLbToken1, kHostname1, kUser1}, 3},
+ {{kClientIp1 + kLbId2 + kLbTag1, kHostname2, kUser3}, 778}}));
+ vdm2.emplace(::grpc::load_reporter::kViewEndCount,
+ ::opencensus::stats::testing::TestUtils::MakeViewData(
+ mock_census_view_provider()->FindViewDescriptor(
+ ::grpc::load_reporter::kViewEndCount),
+ {{{kClientIp1 + kLbToken1, kHostname1, kUser1,
+ ::grpc::load_reporter::kCallStatusOk},
+ 24},
+ {{kClientIp1 + kLbToken2, kHostname2, kUser3,
+ ::grpc::load_reporter::kCallStatusClientError},
+ 546}}));
+ vdm2.emplace(::grpc::load_reporter::kViewEndBytesSent,
+ ::opencensus::stats::testing::TestUtils::MakeViewData(
+ mock_census_view_provider()->FindViewDescriptor(
+ ::grpc::load_reporter::kViewEndBytesSent),
+ {{{kClientIp1 + kLbToken1, kHostname1, kUser1,
+ ::grpc::load_reporter::kCallStatusOk},
+ 747},
+ {{kClientIp1 + kLbToken2, kHostname2, kUser3,
+ ::grpc::load_reporter::kCallStatusClientError},
+ 229}}));
+ vdm2.emplace(::grpc::load_reporter::kViewEndBytesReceived,
+ ::opencensus::stats::testing::TestUtils::MakeViewData(
+ mock_census_view_provider()->FindViewDescriptor(
+ ::grpc::load_reporter::kViewEndBytesReceived),
+ {{{kClientIp1 + kLbToken1, kHostname1, kUser1,
+ ::grpc::load_reporter::kCallStatusOk},
+ 173},
+ {{kClientIp1 + kLbToken2, kHostname2, kUser3,
+ ::grpc::load_reporter::kCallStatusClientError},
+ 438}}));
+ vdm2.emplace(::grpc::load_reporter::kViewEndLatencyMs,
+ ::opencensus::stats::testing::TestUtils::MakeViewData(
+ mock_census_view_provider()->FindViewDescriptor(
+ ::grpc::load_reporter::kViewEndLatencyMs),
+ {{{kClientIp1 + kLbToken1, kHostname1, kUser1,
+ ::grpc::load_reporter::kCallStatusOk},
+ 187},
+ {{kClientIp1 + kLbToken2, kHostname2, kUser3,
+ ::grpc::load_reporter::kCallStatusClientError},
+ 34}}));
+ vdm2.emplace(
+ ::grpc::load_reporter::kViewOtherCallMetricCount,
+ ::opencensus::stats::testing::TestUtils::MakeViewData(
+ mock_census_view_provider()->FindViewDescriptor(
+ ::grpc::load_reporter::kViewOtherCallMetricCount),
+ {{{kClientIp1 + kLbId2 + kLbTag1, kHostname2, kUser3, kMetric1}, 1},
+ {{kClientIp1 + kLbId2 + kLbTag1, kHostname2, kUser3, kMetric2},
+ 1}}));
+ vdm2.emplace(
+ ::grpc::load_reporter::kViewOtherCallMetricValue,
+ ::opencensus::stats::testing::TestUtils::MakeViewData(
+ mock_census_view_provider()->FindViewDescriptor(
+ ::grpc::load_reporter::kViewOtherCallMetricValue),
+ {{{kClientIp1 + kLbId2 + kLbTag1, kHostname2, kUser3, kMetric1}, 9.6},
+ {{kClientIp1 + kLbId2 + kLbTag1, kHostname2, kUser3, kMetric2},
+ 5.7}}));
+ // Set up mock expectation.
+ EXPECT_CALL(*mock_census_view_provider(), FetchViewData())
+ .WillOnce(Return(vdm1))
+ .WillOnce(Return(vdm2));
+ PrepareCpuExpectation(2);
+ // Start testing.
+ load_reporter_->ReportStreamCreated(kHostname1, kLbId1, kLoadKey1);
+ load_reporter_->ReportStreamCreated(kHostname2, kLbId2, kLoadKey2);
+ load_reporter_->ReportStreamCreated(kHostname2, kLbId3, kLoadKey3);
+ // First fetch.
+ load_reporter_->FetchAndSample();
+ load_reporter_->GenerateLoads(kHostname1, kLbId1);
+ gpr_log(GPR_INFO, "First load generated.");
+ // Second fetch.
+ load_reporter_->FetchAndSample();
+ load_reporter_->GenerateLoads(kHostname2, kLbId2);
+ gpr_log(GPR_INFO, "Second load generated.");
+ // TODO(juanlishen): Verify the data.
+}
+
+} // namespace
+} // namespace testing
+} // namespace grpc
+
+int main(int argc, char** argv) {
+ grpc_test_init(argc, argv);
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
diff --git a/test/cpp/util/.clang-tidy b/test/cpp/util/.clang-tidy
new file mode 100644
index 0000000000..f951ee5fea
--- /dev/null
+++ b/test/cpp/util/.clang-tidy
@@ -0,0 +1,6 @@
+---
+Checks: 'modernize-use-nullptr,google-build-namespaces,google-build-explicit-make-pair,readability-function-size,performance-*,-performance-unnecessary-copy-initialization'
+WarningsAsErrors: 'modernize-use-nullptr,google-build-namespaces,google-build-explicit-make-pair,readability-function-size,performance-*,-performance-unnecessary-copy-initialization'
+CheckOptions:
+ - key: readability-function-size.StatementThreshold
+ value: '450'
diff --git a/test/cpp/util/BUILD b/test/cpp/util/BUILD
index b1153d2df3..9b42bb28b1 100644
--- a/test/cpp/util/BUILD
+++ b/test/cpp/util/BUILD
@@ -217,6 +217,7 @@ grpc_cc_test(
],
deps = [
"//:grpc++",
+ "//test/core/util:gpr_test_util",
],
)
@@ -260,6 +261,7 @@ grpc_cc_test(
deps = [
"//:grpc++_error_details",
"//src/proto/grpc/testing:echo_messages_proto",
+ "//test/core/util:gpr_test_util",
],
)
diff --git a/test/cpp/util/byte_buffer_test.cc b/test/cpp/util/byte_buffer_test.cc
index b48a53eed1..9bffbf7ac1 100644
--- a/test/cpp/util/byte_buffer_test.cc
+++ b/test/cpp/util/byte_buffer_test.cc
@@ -41,7 +41,7 @@ class ByteBufferTest : public ::testing::Test {};
TEST_F(ByteBufferTest, CopyCtor) {
ByteBuffer buffer1;
EXPECT_FALSE(buffer1.Valid());
- ByteBuffer buffer2 = buffer1;
+ const ByteBuffer& buffer2 = buffer1;
EXPECT_FALSE(buffer2.Valid());
}
diff --git a/test/cpp/util/channel_trace_proto_helper.cc b/test/cpp/util/channel_trace_proto_helper.cc
index fbc9f1501c..ee310784c2 100644
--- a/test/cpp/util/channel_trace_proto_helper.cc
+++ b/test/cpp/util/channel_trace_proto_helper.cc
@@ -30,26 +30,47 @@
namespace grpc {
namespace testing {
-void ValidateChannelTraceProtoJsonTranslation(char* tracer_json_c_str) {
- std::string tracer_json_str(tracer_json_c_str);
- grpc::channelz::ChannelTrace channel_trace;
+namespace {
+
+// Generic helper that takes in a json string, converts it to a proto, and
+// then back to json. This ensures that the json string was correctly formatted
+// according to https://developers.google.com/protocol-buffers/docs/proto3#json
+template <typename Message>
+void VaidateProtoJsonTranslation(char* json_c_str) {
+ std::string json_str(json_c_str);
+ Message msg;
google::protobuf::util::JsonParseOptions parse_options;
// If the following line is failing, then uncomment the last line of the
// comment, and uncomment the lines that print the two strings. You can
// then compare the output, and determine what fields are missing.
//
- // options.ignore_unknown_fields = true;
- ASSERT_EQ(google::protobuf::util::JsonStringToMessage(
- tracer_json_str, &channel_trace, parse_options),
+ // parse_options.ignore_unknown_fields = true;
+ EXPECT_EQ(google::protobuf::util::JsonStringToMessage(json_str, &msg,
+ parse_options),
google::protobuf::util::Status::OK);
std::string proto_json_str;
- ASSERT_EQ(google::protobuf::util::MessageToJsonString(channel_trace,
- &proto_json_str),
+ google::protobuf::util::JsonPrintOptions print_options;
+ // We usually do not want this to be true, however it can be helpful to
+ // uncomment and see the output produced then all fields are printed.
+ // print_options.always_print_primitive_fields = true;
+ EXPECT_EQ(google::protobuf::util::MessageToJsonString(msg, &proto_json_str,
+ print_options),
google::protobuf::util::Status::OK);
// uncomment these to compare the the json strings.
- // gpr_log(GPR_ERROR, "tracer json: %s", tracer_json_str.c_str());
+ // gpr_log(GPR_ERROR, "tracer json: %s", json_str.c_str());
// gpr_log(GPR_ERROR, "proto json: %s", proto_json_str.c_str());
- ASSERT_EQ(tracer_json_str, proto_json_str);
+ EXPECT_EQ(json_str, proto_json_str);
+}
+
+} // namespace
+
+void ValidateChannelTraceProtoJsonTranslation(char* tracer_json_c_str) {
+ VaidateProtoJsonTranslation<grpc::channelz::v1::ChannelTrace>(
+ tracer_json_c_str);
+}
+
+void ValidateChannelProtoJsonTranslation(char* channel_json_c_str) {
+ VaidateProtoJsonTranslation<grpc::channelz::v1::Channel>(channel_json_c_str);
}
} // namespace testing
diff --git a/test/cpp/util/channel_trace_proto_helper.h b/test/cpp/util/channel_trace_proto_helper.h
index d7043d9f06..d1a3603372 100644
--- a/test/cpp/util/channel_trace_proto_helper.h
+++ b/test/cpp/util/channel_trace_proto_helper.h
@@ -23,6 +23,7 @@ namespace grpc {
namespace testing {
void ValidateChannelTraceProtoJsonTranslation(char* tracer_json_c_str);
+void ValidateChannelProtoJsonTranslation(char* channel_json_c_str);
} // namespace testing
} // namespace grpc
diff --git a/test/cpp/util/cli_call.cc b/test/cpp/util/cli_call.cc
index a3992ab278..c258bde908 100644
--- a/test/cpp/util/cli_call.cc
+++ b/test/cpp/util/cli_call.cc
@@ -19,6 +19,7 @@
#include "test/cpp/util/cli_call.h"
#include <iostream>
+#include <utility>
#include <grpc/grpc.h>
#include <grpc/slice.h>
@@ -39,7 +40,7 @@ Status CliCall::Call(std::shared_ptr<grpc::Channel> channel,
const OutgoingMetadataContainer& metadata,
IncomingMetadataContainer* server_initial_metadata,
IncomingMetadataContainer* server_trailing_metadata) {
- CliCall call(channel, method, metadata);
+ CliCall call(std::move(channel), method, metadata);
call.Write(request);
call.WritesDone();
if (!call.Read(response, server_initial_metadata)) {
@@ -48,7 +49,7 @@ Status CliCall::Call(std::shared_ptr<grpc::Channel> channel,
return call.Finish(server_trailing_metadata);
}
-CliCall::CliCall(std::shared_ptr<grpc::Channel> channel,
+CliCall::CliCall(const std::shared_ptr<grpc::Channel>& channel,
const grpc::string& method,
const OutgoingMetadataContainer& metadata)
: stub_(new grpc::GenericStub(channel)) {
diff --git a/test/cpp/util/cli_call.h b/test/cpp/util/cli_call.h
index 51ffafd29f..3f279095a4 100644
--- a/test/cpp/util/cli_call.h
+++ b/test/cpp/util/cli_call.h
@@ -42,7 +42,8 @@ class CliCall final {
typedef std::multimap<grpc::string_ref, grpc::string_ref>
IncomingMetadataContainer;
- CliCall(std::shared_ptr<grpc::Channel> channel, const grpc::string& method,
+ CliCall(const std::shared_ptr<grpc::Channel>& channel,
+ const grpc::string& method,
const OutgoingMetadataContainer& metadata);
~CliCall();
diff --git a/test/cpp/util/grpc_tool.cc b/test/cpp/util/grpc_tool.cc
index 195b6bd304..840ca07d2b 100644
--- a/test/cpp/util/grpc_tool.cc
+++ b/test/cpp/util/grpc_tool.cc
@@ -471,17 +471,26 @@ bool GrpcTool::CallMethod(int argc, const char** argv,
std::shared_ptr<grpc::Channel> channel =
grpc::CreateChannel(server_address, cred.GetCredentials());
- parser.reset(new grpc::testing::ProtoFileParser(
- FLAGS_remotedb ? channel : nullptr, FLAGS_proto_path, FLAGS_protofiles));
+ if (!FLAGS_binary_input || !FLAGS_binary_output) {
+ parser.reset(
+ new grpc::testing::ProtoFileParser(FLAGS_remotedb ? channel : nullptr,
+ FLAGS_proto_path, FLAGS_protofiles));
+ if (parser->HasError()) {
+ fprintf(
+ stderr,
+ "Failed to find remote reflection service and local proto files.\n");
+ return false;
+ }
+ }
if (FLAGS_binary_input) {
formatted_method_name = method_name;
} else {
formatted_method_name = parser->GetFormattedMethodName(method_name);
- }
-
- if (parser->HasError()) {
- return false;
+ if (parser->HasError()) {
+ fprintf(stderr, "Failed to find method %s in proto files.\n",
+ method_name.c_str());
+ }
}
if (argc == 3) {
@@ -711,6 +720,7 @@ bool GrpcTool::CallMethod(int argc, const char** argv,
serialized_request_proto = parser->GetSerializedProtoFromMethod(
method_name, request_text, true /* is_request */);
if (parser->HasError()) {
+ fprintf(stderr, "Failed to parse request.\n");
return false;
}
}
@@ -735,6 +745,7 @@ bool GrpcTool::CallMethod(int argc, const char** argv,
serialized_response_proto = parser->GetTextFormatFromMethod(
method_name, serialized_response_proto, false /* is_request */);
if (parser->HasError()) {
+ fprintf(stderr, "Failed to parse response.\n");
return false;
}
}
@@ -814,6 +825,9 @@ bool GrpcTool::ParseMessage(int argc, const char** argv,
new grpc::testing::ProtoFileParser(FLAGS_remotedb ? channel : nullptr,
FLAGS_proto_path, FLAGS_protofiles));
if (parser->HasError()) {
+ fprintf(
+ stderr,
+ "Failed to find remote reflection service and local proto files.\n");
return false;
}
}
@@ -824,6 +838,7 @@ bool GrpcTool::ParseMessage(int argc, const char** argv,
serialized_request_proto =
parser->GetSerializedProtoFromMessageType(type_name, message_text);
if (parser->HasError()) {
+ fprintf(stderr, "Failed to serialize the message.\n");
return false;
}
}
@@ -834,6 +849,7 @@ bool GrpcTool::ParseMessage(int argc, const char** argv,
grpc::string output_text = parser->GetTextFormatFromMessageType(
type_name, serialized_request_proto);
if (parser->HasError()) {
+ fprintf(stderr, "Failed to deserialize the message.\n");
return false;
}
output_ss << output_text << std::endl;
diff --git a/test/cpp/util/proto_file_parser.cc b/test/cpp/util/proto_file_parser.cc
index 3fc96f38ae..a530ed1ffc 100644
--- a/test/cpp/util/proto_file_parser.cc
+++ b/test/cpp/util/proto_file_parser.cc
@@ -63,7 +63,7 @@ class ErrorPrinter : public protobuf::compiler::MultiFileErrorCollector {
ProtoFileParser* parser_; // not owned
};
-ProtoFileParser::ProtoFileParser(std::shared_ptr<grpc::Channel> channel,
+ProtoFileParser::ProtoFileParser(const std::shared_ptr<grpc::Channel>& channel,
const grpc::string& proto_path,
const grpc::string& protofiles)
: has_error_(false),
diff --git a/test/cpp/util/proto_file_parser.h b/test/cpp/util/proto_file_parser.h
index 2236b59451..eb1d793c2b 100644
--- a/test/cpp/util/proto_file_parser.h
+++ b/test/cpp/util/proto_file_parser.h
@@ -36,7 +36,7 @@ class ProtoFileParser {
// The parser will search proto files using the server reflection service
// provided on the given channel. The given protofiles in a source tree rooted
// from proto_path will also be searched.
- ProtoFileParser(std::shared_ptr<grpc::Channel> channel,
+ ProtoFileParser(const std::shared_ptr<grpc::Channel>& channel,
const grpc::string& proto_path,
const grpc::string& protofiles);
diff --git a/test/cpp/util/proto_reflection_descriptor_database.cc b/test/cpp/util/proto_reflection_descriptor_database.cc
index 0adbf20ce6..119272ca42 100644
--- a/test/cpp/util/proto_reflection_descriptor_database.cc
+++ b/test/cpp/util/proto_reflection_descriptor_database.cc
@@ -35,7 +35,7 @@ ProtoReflectionDescriptorDatabase::ProtoReflectionDescriptorDatabase(
: stub_(std::move(stub)) {}
ProtoReflectionDescriptorDatabase::ProtoReflectionDescriptorDatabase(
- std::shared_ptr<grpc::Channel> channel)
+ const std::shared_ptr<grpc::Channel>& channel)
: stub_(ServerReflection::NewStub(channel)) {}
ProtoReflectionDescriptorDatabase::~ProtoReflectionDescriptorDatabase() {
@@ -79,7 +79,7 @@ bool ProtoReflectionDescriptorDatabase::FindFileByName(
AddFileFromResponse(response.file_descriptor_response());
} else if (response.message_response_case() ==
ServerReflectionResponse::MessageResponseCase::kErrorResponse) {
- const ErrorResponse error = response.error_response();
+ const ErrorResponse& error = response.error_response();
if (error.error_code() == StatusCode::NOT_FOUND) {
gpr_log(GPR_INFO, "NOT_FOUND from server for FindFileByName(%s)",
filename.c_str());
@@ -126,7 +126,7 @@ bool ProtoReflectionDescriptorDatabase::FindFileContainingSymbol(
AddFileFromResponse(response.file_descriptor_response());
} else if (response.message_response_case() ==
ServerReflectionResponse::MessageResponseCase::kErrorResponse) {
- const ErrorResponse error = response.error_response();
+ const ErrorResponse& error = response.error_response();
if (error.error_code() == StatusCode::NOT_FOUND) {
missing_symbols_.insert(symbol_name);
gpr_log(GPR_INFO,
@@ -182,7 +182,7 @@ bool ProtoReflectionDescriptorDatabase::FindFileContainingExtension(
AddFileFromResponse(response.file_descriptor_response());
} else if (response.message_response_case() ==
ServerReflectionResponse::MessageResponseCase::kErrorResponse) {
- const ErrorResponse error = response.error_response();
+ const ErrorResponse& error = response.error_response();
if (error.error_code() == StatusCode::NOT_FOUND) {
if (missing_extensions_.find(containing_type) ==
missing_extensions_.end()) {
@@ -238,7 +238,7 @@ bool ProtoReflectionDescriptorDatabase::FindAllExtensionNumbers(
return true;
} else if (response.message_response_case() ==
ServerReflectionResponse::MessageResponseCase::kErrorResponse) {
- const ErrorResponse error = response.error_response();
+ const ErrorResponse& error = response.error_response();
if (error.error_code() == StatusCode::NOT_FOUND) {
gpr_log(GPR_INFO, "NOT_FOUND from server for FindAllExtensionNumbers(%s)",
extendee_type.c_str());
@@ -265,14 +265,14 @@ bool ProtoReflectionDescriptorDatabase::GetServices(
if (response.message_response_case() ==
ServerReflectionResponse::MessageResponseCase::kListServicesResponse) {
- const ListServiceResponse ls_response = response.list_services_response();
+ const ListServiceResponse& ls_response = response.list_services_response();
for (int i = 0; i < ls_response.service_size(); ++i) {
(*output).push_back(ls_response.service(i).name());
}
return true;
} else if (response.message_response_case() ==
ServerReflectionResponse::MessageResponseCase::kErrorResponse) {
- const ErrorResponse error = response.error_response();
+ const ErrorResponse& error = response.error_response();
gpr_log(GPR_INFO,
"Error on GetServices()\n\tError code: %d\n"
"\tError Message: %s",
diff --git a/test/cpp/util/proto_reflection_descriptor_database.h b/test/cpp/util/proto_reflection_descriptor_database.h
index e4cf2f207e..46190b3217 100644
--- a/test/cpp/util/proto_reflection_descriptor_database.h
+++ b/test/cpp/util/proto_reflection_descriptor_database.h
@@ -38,7 +38,7 @@ class ProtoReflectionDescriptorDatabase : public protobuf::DescriptorDatabase {
std::unique_ptr<reflection::v1alpha::ServerReflection::Stub> stub);
explicit ProtoReflectionDescriptorDatabase(
- std::shared_ptr<grpc::Channel> channel);
+ const std::shared_ptr<grpc::Channel>& channel);
virtual ~ProtoReflectionDescriptorDatabase();
diff --git a/test/cpp/util/string_ref_test.cc b/test/cpp/util/string_ref_test.cc
index 8f7986e64e..031ec33241 100644
--- a/test/cpp/util/string_ref_test.cc
+++ b/test/cpp/util/string_ref_test.cc
@@ -60,7 +60,7 @@ TEST_F(StringRefTest, FromString) {
TEST_F(StringRefTest, CopyConstructor) {
string_ref s1(kTestString);
;
- string_ref s2(s1);
+ const string_ref& s2(s1);
EXPECT_EQ(s1.length(), s2.length());
EXPECT_EQ(s1.data(), s2.data());
}
diff --git a/test/distrib/csharp/DistribTest/packages.config b/test/distrib/csharp/DistribTest/packages.config
index 84be8f76b5..3cb2c46bcf 100644
--- a/test/distrib/csharp/DistribTest/packages.config
+++ b/test/distrib/csharp/DistribTest/packages.config
@@ -6,6 +6,7 @@
<package id="Grpc" version="__GRPC_NUGET_VERSION__" targetFramework="net45" />
<package id="Grpc.Auth" version="__GRPC_NUGET_VERSION__" targetFramework="net45" />
<package id="Grpc.Core" version="__GRPC_NUGET_VERSION__" targetFramework="net45" />
+ <package id="Grpc.Tools" version="__GRPC_NUGET_VERSION__" targetFramework="net45" />
<package id="System.Interactive.Async" version="3.0.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
</packages> \ No newline at end of file
diff --git a/test/distrib/csharp/run_distrib_test.sh b/test/distrib/csharp/run_distrib_test.sh
index eee24d0e57..f9371410e7 100755
--- a/test/distrib/csharp/run_distrib_test.sh
+++ b/test/distrib/csharp/run_distrib_test.sh
@@ -26,3 +26,6 @@ nuget restore
xbuild DistribTest.sln
mono DistribTest/bin/Debug/DistribTest.exe
+
+# test that codegen work
+test_codegen/test_codegen.sh
diff --git a/test/distrib/csharp/test_codegen/test_codegen.sh b/test/distrib/csharp/test_codegen/test_codegen.sh
new file mode 100755
index 0000000000..fa101889f6
--- /dev/null
+++ b/test/distrib/csharp/test_codegen/test_codegen.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+# Copyright 2018 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -ex
+
+cd "$(dirname "$0")"
+
+ls -lR "../packages/Grpc.Tools.__GRPC_NUGET_VERSION__/tools"
+
+PLATFORM_ARCH=linux_x64
+if [ "$(uname)" == "Darwin" ]
+then
+ PLATFORM_ARCH=macosx_x64
+elif [ "$(getconf LONG_BIT)" == "32" ]
+then
+ PLATFORM_ARCH=linux_x86
+fi
+
+PROTOC=../packages/Grpc.Tools.__GRPC_NUGET_VERSION__/tools/${PLATFORM_ARCH}/protoc
+PLUGIN=../packages/Grpc.Tools.__GRPC_NUGET_VERSION__/tools/${PLATFORM_ARCH}/grpc_csharp_plugin
+
+"${PROTOC}" --plugin="protoc-gen-grpc=${PLUGIN}" --csharp_out=. --grpc_out=. -I . testcodegen.proto
+
+ls ./*.cs
+
+echo 'Code generation works.'
diff --git a/src/proto/census/trace_context.proto b/test/distrib/csharp/test_codegen/testcodegen.proto
index 7e5087dbee..5c228b81db 100644
--- a/src/proto/census/trace_context.proto
+++ b/test/distrib/csharp/test_codegen/testcodegen.proto
@@ -1,4 +1,4 @@
-// Copyright 2016 gRPC authors.
+// Copyright 2018 The gRPC Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,16 +14,16 @@
syntax = "proto3";
-package google.trace;
+package testcodegen;
-// Tracing information that is propagated with RPC's.
-message TraceContext {
- // A TraceId uniquely represents a single Trace. It is a 128-bit nonce.
- // The 128-bit ID is split into 2 64-bit chunks. (REQUIRED)
- fixed64 trace_id_hi = 1;
- fixed64 trace_id_lo = 2;
- // ID of parent (client) span. (REQUIRED)
- fixed64 span_id = 3;
- // Span option flags. First bit is true if this trace is sampled. (OPTIONAL)
- fixed32 span_options = 4;
+service Greeter {
+ rpc SayHello (HelloRequest) returns (HelloReply) {}
+}
+
+message HelloRequest {
+ string name = 1;
+}
+
+message HelloReply {
+ string message = 1;
}
diff --git a/test/distrib/csharp/update_version.sh b/test/distrib/csharp/update_version.sh
index 9759cc5648..0e47ed3abd 100755
--- a/test/distrib/csharp/update_version.sh
+++ b/test/distrib/csharp/update_version.sh
@@ -28,4 +28,4 @@ then
fi
# Replaces version placeholder with value provided as first argument.
-sed -ibak "s/__GRPC_NUGET_VERSION__/${CSHARP_VERSION}/g" DistribTest/packages.config DistribTest/DistribTest.csproj DistribTest/DistribTestDotNet.csproj
+sed -ibak "s/__GRPC_NUGET_VERSION__/${CSHARP_VERSION}/g" DistribTest/packages.config DistribTest/DistribTest.csproj DistribTest/DistribTestDotNet.csproj test_codegen/test_codegen.sh
diff --git a/test/distrib/python/test_packages.sh b/test/distrib/python/test_packages.sh
index 6bf49d45b9..755daa1021 100755
--- a/test/distrib/python/test_packages.sh
+++ b/test/distrib/python/test_packages.sh
@@ -28,10 +28,12 @@ else
echo "Testing Python source distribution"
ARCHIVES=("$EXTERNAL_GIT_ROOT"/input_artifacts/grpcio-[0-9]*.tar.gz)
TOOLS_ARCHIVES=("$EXTERNAL_GIT_ROOT"/input_artifacts/grpcio-tools-[0-9]*.tar.gz)
- HEALTH_ARCHIVES=("$EXTERNAL_GIT_ROOT"/input_artifacts/grpcio-health-checking-[0-9]*.tar.gz)
- REFLECTION_ARCHIVES=("$EXTERNAL_GIT_ROOT"/input_artifacts/grpcio-reflection-[0-9]*.tar.gz)
fi
+HEALTH_ARCHIVES=("$EXTERNAL_GIT_ROOT"/input_artifacts/grpcio-health-checking-[0-9]*.tar.gz)
+REFLECTION_ARCHIVES=("$EXTERNAL_GIT_ROOT"/input_artifacts/grpcio-reflection-[0-9]*.tar.gz)
+TESTING_ARCHIVES=("$EXTERNAL_GIT_ROOT"/input_artifacts/grpcio-testing-[0-9]*.tar.gz)
+
VIRTUAL_ENV=$(mktemp -d)
virtualenv "$VIRTUAL_ENV"
PYTHON=$VIRTUAL_ENV/bin/python
@@ -53,13 +55,9 @@ function at_least_one_installs() {
at_least_one_installs "${ARCHIVES[@]}"
at_least_one_installs "${TOOLS_ARCHIVES[@]}"
-
-if [[ "$1" == "source" ]]
-then
- echo "Testing Python health and reflection packages"
- at_least_one_installs "${HEALTH_ARCHIVES[@]}"
- at_least_one_installs "${REFLECTION_ARCHIVES[@]}"
-fi
+at_least_one_installs "${HEALTH_ARCHIVES[@]}"
+at_least_one_installs "${REFLECTION_ARCHIVES[@]}"
+at_least_one_installs "${TESTING_ARCHIVES[@]}"
#
diff --git a/third_party/cares/BUILD b/third_party/cares/BUILD
index ad27d93c0f..d73f5516bc 100644
--- a/third_party/cares/BUILD
+++ b/third_party/cares/BUILD
@@ -6,4 +6,5 @@ exports_files([
"config_freebsd/ares_config.h",
"config_linux/ares_config.h",
"config_openbsd/ares_config.h",
+ "config_windows/ares_config.h",
])
diff --git a/third_party/cares/cares.BUILD b/third_party/cares/cares.BUILD
index 3ac02875e6..fd14007e80 100644
--- a/third_party/cares/cares.BUILD
+++ b/third_party/cares/cares.BUILD
@@ -3,6 +3,11 @@ config_setting(
values = {"cpu": "darwin"},
)
+config_setting(
+ name = "windows",
+ values = {"cpu": "x64_windows"},
+)
+
# Android is not officially supported through C++.
# This just helps with the build for now.
config_setting(
@@ -49,6 +54,7 @@ genrule(
":ios_armv7s": ["@com_github_grpc_grpc//third_party/cares:config_darwin/ares_config.h"],
":ios_arm64": ["@com_github_grpc_grpc//third_party/cares:config_darwin/ares_config.h"],
":darwin": ["@com_github_grpc_grpc//third_party/cares:config_darwin/ares_config.h"],
+ ":windows": ["@com_github_grpc_grpc//third_party/cares:config_windows/ares_config.h"],
":android": ["@com_github_grpc_grpc//third_party/cares:config_android/ares_config.h"],
"//conditions:default": ["@com_github_grpc_grpc//third_party/cares:config_linux/ares_config.h"],
}),
@@ -138,10 +144,22 @@ cc_library(
copts = [
"-D_GNU_SOURCE",
"-D_HAS_EXCEPTIONS=0",
- "-DNOMINMAX",
"-DHAVE_CONFIG_H",
- ],
+ ] + select({
+ ":windows": [
+ "-DNOMINMAX",
+ "-D_CRT_SECURE_NO_DEPRECATE",
+ "-D_CRT_NONSTDC_NO_DEPRECATE",
+ "-D_WIN32_WINNT=0x0600",
+ ],
+ "//conditions:default": [],
+ }),
+ defines = ["CARES_STATICLIB"],
includes = ["."],
+ linkopts = select({
+ ":windows": ["-defaultlib:ws2_32.lib"],
+ "//conditions:default": [],
+ }),
linkstatic = 1,
visibility = [
"//visibility:public",
diff --git a/third_party/cares/config_windows/ares_config.h b/third_party/cares/config_windows/ares_config.h
new file mode 100644
index 0000000000..a128faac37
--- /dev/null
+++ b/third_party/cares/config_windows/ares_config.h
@@ -0,0 +1,423 @@
+/* Generated from ares_config.h.cmake*/
+
+/* 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. */
+#undef CARES_SYMBOL_HIDING
+
+/* Definition to make a library symbol externally visible. */
+#undef CARES_SYMBOL_SCOPE_EXTERN
+
+/* 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 int
+
+/* Define to the type qualifier of arg 1 for getnameinfo. */
+#define GETNAMEINFO_QUAL_ARG1
+
+/* 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 socklen_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
+
+/* Define to 1 if you have AF_INET6. */
+#define HAVE_AF_INET6
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+/* #undef HAVE_ARPA_INET_H */
+
+/* Define to 1 if you have the <arpa/nameser_compat.h> header file. */
+/* #undef HAVE_ARPA_NAMESER_COMPAT_H */
+
+/* Define to 1 if you have the <arpa/nameser.h> header file. */
+/* #undef HAVE_ARPA_NAMESER_H */
+
+/* Define to 1 if you have the <assert.h> header file. */
+#define HAVE_ASSERT_H
+
+/* 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
+
+/* Define to 1 if you have the clock_gettime function and monotonic timer. */
+/* #undef HAVE_CLOCK_GETTIME_MONOTONIC */
+
+/* Define to 1 if you have the closesocket function. */
+#define 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
+
+/* define if the compiler supports basic C++11 syntax */
+/* #undef HAVE_CXX11 */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+/* #undef HAVE_DLFCN_H */
+
+/* Define to 1 if you have the <errno.h> header file. */
+#define HAVE_ERRNO_H
+
+/* Define to 1 if you have the fcntl function. */
+/* #undef HAVE_FCNTL */
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H
+
+/* Define to 1 if you have a working fcntl O_NONBLOCK function. */
+/* #undef HAVE_FCNTL_O_NONBLOCK */
+
+/* Define to 1 if you have the freeaddrinfo function. */
+#define HAVE_FREEADDRINFO
+
+/* Define to 1 if you have a working getaddrinfo function. */
+#define HAVE_GETADDRINFO
+
+/* Define to 1 if the getaddrinfo function is threadsafe. */
+#define HAVE_GETADDRINFO_THREADSAFE
+
+/* Define to 1 if you have the getenv function. */
+#define HAVE_GETENV
+
+/* Define to 1 if you have the gethostbyaddr function. */
+#define HAVE_GETHOSTBYADDR
+
+/* Define to 1 if you have the gethostbyname function. */
+#define HAVE_GETHOSTBYNAME
+
+/* Define to 1 if you have the gethostname function. */
+#define HAVE_GETHOSTNAME
+
+/* Define to 1 if you have the getnameinfo function. */
+#define HAVE_GETNAMEINFO
+
+/* Define to 1 if you have the getservbyport_r function. */
+/* #undef HAVE_GETSERVBYPORT_R */
+
+/* Define to 1 if you have the `gettimeofday' function. */
+/* #undef HAVE_GETTIMEOFDAY */
+
+/* Define to 1 if you have the `if_indextoname' function. */
+/* #undef HAVE_IF_INDEXTONAME */
+
+/* Define to 1 if you have a IPv6 capable working inet_net_pton function. */
+/* #undef HAVE_INET_NET_PTON */
+
+/* Define to 1 if you have a IPv6 capable working inet_ntop function. */
+/* #undef HAVE_INET_NTOP */
+
+/* Define to 1 if you have a IPv6 capable working inet_pton function. */
+/* #undef HAVE_INET_PTON */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H
+
+/* Define to 1 if you have the ioctl function. */
+/* #undef HAVE_IOCTL */
+
+/* Define to 1 if you have the ioctlsocket function. */
+#define 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. */
+#define HAVE_IOCTLSOCKET_FIONBIO
+
+/* Define to 1 if you have a working ioctl FIONBIO function. */
+/* #undef HAVE_IOCTL_FIONBIO */
+
+/* Define to 1 if you have a working ioctl SIOCGIFADDR function. */
+/* #undef HAVE_IOCTL_SIOCGIFADDR */
+
+/* Define to 1 if you have the `resolve' library (-lresolve). */
+/* #undef HAVE_LIBRESOLV */
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H
+
+/* if your compiler supports LL */
+#define HAVE_LL
+
+/* Define to 1 if the compiler supports the 'long long' data type. */
+#define HAVE_LONGLONG
+
+/* Define to 1 if you have the malloc.h header file. */
+#define HAVE_MALLOC_H
+
+/* Define to 1 if you have the memory.h header file. */
+#define HAVE_MEMORY_H
+
+/* Define to 1 if you have the MSG_NOSIGNAL flag. */
+/* #undef HAVE_MSG_NOSIGNAL */
+
+/* Define to 1 if you have the <netdb.h> header file. */
+/* #undef HAVE_NETDB_H */
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+/* #undef HAVE_NETINET_IN_H */
+
+/* Define to 1 if you have the <netinet/tcp.h> header file. */
+/* #undef HAVE_NETINET_TCP_H */
+
+/* Define to 1 if you have the <net/if.h> header file. */
+/* #undef HAVE_NET_IF_H */
+
+/* Define to 1 if you have PF_INET6. */
+#define HAVE_PF_INET6
+
+/* Define to 1 if you have the recv function. */
+#define HAVE_RECV
+
+/* Define to 1 if you have the recvfrom function. */
+#define HAVE_RECVFROM
+
+/* Define to 1 if you have the send function. */
+#define HAVE_SEND
+
+/* Define to 1 if you have the setsockopt function. */
+#define HAVE_SETSOCKOPT
+
+/* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */
+/* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */
+
+/* Define to 1 if you have the <signal.h> header file. */
+#define HAVE_SIGNAL_H
+
+/* Define to 1 if sig_atomic_t is an available typedef. */
+#define HAVE_SIG_ATOMIC_T
+
+/* 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
+
+/* Define to 1 if you have the socket function. */
+#define HAVE_SOCKET
+
+/* Define to 1 if you have the <socket.h> header file. */
+/* #undef HAVE_SOCKET_H */
+
+/* Define to 1 if you have the <stdbool.h> header file. */
+#define HAVE_STDBOOL_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H
+
+/* Define to 1 if you have the strcasecmp function. */
+/* #undef HAVE_STRCASECMP */
+
+/* Define to 1 if you have the strcmpi function. */
+#define HAVE_STRCMPI
+
+/* Define to 1 if you have the strdup function. */
+#define HAVE_STRDUP
+
+/* Define to 1 if you have the stricmp function. */
+#define HAVE_STRICMP
+
+/* Define to 1 if you have the <strings.h> header file. */
+/* #undef HAVE_STRINGS_H */
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H
+
+/* Define to 1 if you have the strncasecmp function. */
+/* #undef HAVE_STRNCASECMP */
+
+/* Define to 1 if you have the strncmpi function. */
+/* #undef HAVE_STRNCMPI */
+
+/* Define to 1 if you have the strnicmp function. */
+#define HAVE_STRNICMP
+
+/* Define to 1 if you have the <stropts.h> header file. */
+/* #undef HAVE_STROPTS_H */
+
+/* Define to 1 if you have struct addrinfo. */
+#define HAVE_STRUCT_ADDRINFO
+
+/* Define to 1 if you have struct in6_addr. */
+#define HAVE_STRUCT_IN6_ADDR
+
+/* Define to 1 if you have struct sockaddr_in6. */
+#define HAVE_STRUCT_SOCKADDR_IN6
+
+/* if struct sockaddr_storage is defined */
+#define HAVE_STRUCT_SOCKADDR_STORAGE
+
+/* Define to 1 if you have the timeval struct. */
+#define HAVE_STRUCT_TIMEVAL
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+/* #undef HAVE_SYS_IOCTL_H */
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+/* #undef HAVE_SYS_PARAM_H */
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+/* #undef HAVE_SYS_SELECT_H */
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+/* #undef HAVE_SYS_SOCKET_H */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+/* #undef HAVE_SYS_TIME_H */
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+/* #undef HAVE_SYS_UIO_H */
+
+/* Define to 1 if you have the <time.h> header file. */
+#define HAVE_TIME_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+/* #undef HAVE_UNISTD_H */
+
+/* Define to 1 if you have the windows.h header file. */
+#define HAVE_WINDOWS_H
+
+/* Define to 1 if you have the winsock2.h header file. */
+#define HAVE_WINSOCK2_H
+
+/* Define to 1 if you have the winsock.h header file. */
+#define HAVE_WINSOCK_H
+
+/* Define to 1 if you have the writev function. */
+/* #undef HAVE_WRITEV */
+
+/* Define to 1 if you have the ws2tcpip.h header file. */
+#define HAVE_WS2TCPIP_H
+
+/* 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 */
+
+/* a suitable file/device to read random data from */
+/* #undef RANDOM_FILE */
+
+/* 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 SOCKET
+
+/* 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 0
+
+/* Define to the type of arg 3 for recvfrom. */
+#define RECVFROM_TYPE_ARG3 int
+
+/* 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. */
+#define RECVFROM_TYPE_ARG5_IS_VOID 0
+
+/* 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. */
+#define RECVFROM_TYPE_ARG6_IS_VOID 0
+
+/* Define to the function return type for recvfrom. */
+#define RECVFROM_TYPE_RETV int
+
+/* Define to the type of arg 1 for recv. */
+#define RECV_TYPE_ARG1 SOCKET
+
+/* 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 int
+
+/* 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 int
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#define RETSIGTYPE
+
+/* Define to the type qualifier of arg 2 for send. */
+#define SEND_QUAL_ARG2
+
+/* Define to the type of arg 1 for send. */
+#define SEND_TYPE_ARG1 SOCKET
+
+/* 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 int
+
+/* 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 int
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+/* #undef TIME_WITH_SYS_TIME */
+
+/* Define to disable non-blocking sockets. */
+#undef USE_BLOCKING_SOCKETS
+
+/* Define to avoid automatic inclusion of winsock.h */
+#undef WIN32_LEAN_AND_MEAN
+
+/* Type to use in place of in_addr_t when system does not provide it. */
+#undef in_addr_t
+
diff --git a/third_party/nanopb.BUILD b/third_party/nanopb.BUILD
new file mode 100644
index 0000000000..46ca53a8fe
--- /dev/null
+++ b/third_party/nanopb.BUILD
@@ -0,0 +1,19 @@
+cc_library(
+ name = "nanopb",
+ srcs = [
+ "pb_common.c",
+ "pb_decode.c",
+ "pb_encode.c",
+ ],
+ hdrs = [
+ "pb.h",
+ "pb_common.h",
+ "pb_decode.h",
+ "pb_encode.h",
+ ],
+ defines = [
+ "PB_FIELD_32BIT=1",
+ ],
+ visibility = ["//visibility:public"],
+)
+
diff --git a/third_party/nanopb/BUILD b/third_party/nanopb/BUILD
index f9fc57f50a..1dc830eb01 100644
--- a/third_party/nanopb/BUILD
+++ b/third_party/nanopb/BUILD
@@ -5,17 +5,20 @@ exports_files(["LICENSE.txt"])
package(default_visibility = ["//visibility:public"])
cc_library(
- name = "nanopb",
- visibility = ["//visibility:public"],
- hdrs = [
- "pb.h",
- "pb_common.h",
- "pb_decode.h",
- "pb_encode.h",
- ],
- srcs = [
- "pb_common.c",
- "pb_decode.c",
- "pb_encode.c",
- ],
+ name = "nanopb",
+ srcs = [
+ "pb_common.c",
+ "pb_decode.c",
+ "pb_encode.c",
+ ],
+ hdrs = [
+ "pb.h",
+ "pb_common.h",
+ "pb_decode.h",
+ "pb_encode.h",
+ ],
+ defines = [
+ "PB_FIELD_32BIT=1",
+ ],
+ visibility = ["//visibility:public"],
)
diff --git a/tools/bazel.rc b/tools/bazel.rc
index 19e7921ca9..39f8071535 100644
--- a/tools/bazel.rc
+++ b/tools/bazel.rc
@@ -11,7 +11,7 @@ build:asan --copt -fno-omit-frame-pointer
build:asan --copt -DGPR_NO_DIRECT_SYSCALLS
build:asan --linkopt -fsanitize=address
build:asan --action_env=ASAN_OPTIONS=detect_leaks=1:color=always
-build:asan --action_env=LSAN_OPTIONS=suppressions=lsan_suppressions.txt:report_objects=1
+build:asan --action_env=LSAN_OPTIONS=suppressions=test/core/util/lsan_suppressions.txt:report_objects=1
build:msan --strip=never
build:msan --copt -fsanitize-coverage=edge
@@ -32,7 +32,7 @@ build:tsan --copt -fno-omit-frame-pointer
build:tsan --copt -DGPR_NO_DIRECT_SYSCALLS
build:tsan --copt -DGRPC_TSAN
build:tsan --linkopt -fsanitize=thread
-build:tsan --action_env=TSAN_OPTIONS=suppressions=tools/tsan_suppressions.txt:halt_on_error=1:second_deadlock_stack=1
+build:tsan --action_env=TSAN_OPTIONS=suppressions=test/core/util/tsan_suppressions.txt:halt_on_error=1:second_deadlock_stack=1
build:ubsan --strip=never
build:ubsan --copt -fsanitize-coverage=edge
@@ -42,7 +42,7 @@ build:ubsan --copt -DGRPC_UBSAN
build:ubsan --copt -DNDEBUG
build:ubsan --copt -fno-sanitize=function,vptr
build:ubsan --linkopt -fsanitize=undefined
-build:ubsan --action_env=UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1:suppressions=tools/ubsan_suppressions.txt
+build:ubsan --action_env=UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1:suppressions=test/core/util/ubsan_suppressions.txt
build:basicprof --strip=never
build:basicprof --copt -DNDEBUG
diff --git a/tools/codegen/core/gen_nano_proto.sh b/tools/codegen/core/gen_nano_proto.sh
index 6ce15178bd..5c781761ba 100755
--- a/tools/codegen/core/gen_nano_proto.sh
+++ b/tools/codegen/core/gen_nano_proto.sh
@@ -68,31 +68,15 @@ popd
# this should be the same version as the submodule we compile against
# ideally we'd update this as a template to ensure that
-pip install protobuf==3.5.0.post1
+pip install protobuf==3.5.2
pushd "$(dirname $INPUT_PROTO)" > /dev/null
protoc \
--plugin=protoc-gen-nanopb="$GRPC_ROOT/third_party/nanopb/generator/protoc-gen-nanopb" \
---nanopb_out='-T -L#include\ \"third_party/nanopb/pb.h\"'":$OUTPUT_DIR" \
+--nanopb_out='-T -Q#include\ \"'"${GRPC_OUTPUT_DIR}"'/%s\" -L#include\ \"pb.h\"'":$OUTPUT_DIR" \
"$(basename $INPUT_PROTO)"
-readonly PROTO_BASENAME=$(basename $INPUT_PROTO .proto)
-sed -i "s:$PROTO_BASENAME.pb.h:${GRPC_OUTPUT_DIR}/$PROTO_BASENAME.pb.h:g" \
- "$OUTPUT_DIR/$PROTO_BASENAME.pb.c"
-
-if [ $PROTO_BASENAME == "handshaker" ] || [ $PROTO_BASENAME == "altscontext" ]; then
- sed -i "s:transport_security_common.pb.h:${GRPC_OUTPUT_DIR}/transport_security_common.pb.h:g" \
- "$OUTPUT_DIR/$PROTO_BASENAME.pb.h"
-fi
-
-# Fix up the include guards such that they pass the check_include_guards.py
-# test. Assumes that the generated files are being placed in gRPC src dir.
-readonly INCLUDE_GUARD_BASE=`echo $GRPC_OUTPUT_DIR | tr [a-z/] [A-Z_] | sed s:^.*SRC_::`
-readonly UC_PROTO_BASENAME=`echo $PROTO_BASENAME | tr [a-z] [A-Z]`
-sed -i "s:PB_${UC_PROTO_BASENAME}_PB_H_INCLUDED:GRPC_${INCLUDE_GUARD_BASE}_${UC_PROTO_BASENAME}_PB_H:g" \
- "$OUTPUT_DIR/$PROTO_BASENAME.pb.h"
-
deactivate
rm -rf $VENV_DIR
diff --git a/tools/distrib/check_copyright.py b/tools/distrib/check_copyright.py
index 09eecf471b..e6388251cf 100755
--- a/tools/distrib/check_copyright.py
+++ b/tools/distrib/check_copyright.py
@@ -77,6 +77,10 @@ _EXEMPT = frozenset((
'examples/python/route_guide/route_guide_pb2_grpc.py',
'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c',
+ 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h',
+ 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c',
+ 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h',
+ 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c',
'src/core/tsi/alts/handshaker/altscontext.pb.h',
'src/core/tsi/alts/handshaker/altscontext.pb.c',
'src/core/tsi/alts/handshaker/handshaker.pb.h',
diff --git a/tools/distrib/check_include_guards.py b/tools/distrib/check_include_guards.py
index b356a74d2d..56f48af56a 100755
--- a/tools/distrib/check_include_guards.py
+++ b/tools/distrib/check_include_guards.py
@@ -157,6 +157,8 @@ args = argp.parse_args()
KNOWN_BAD = set([
'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h',
+ 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h',
+ 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h',
'src/core/tsi/alts/handshaker/altscontext.pb.h',
'src/core/tsi/alts/handshaker/handshaker.pb.h',
'src/core/tsi/alts/handshaker/transport_security_common.pb.h',
diff --git a/tools/distrib/check_nanopb_output.sh b/tools/distrib/check_nanopb_output.sh
index 8b5823b938..6b98619c32 100755
--- a/tools/distrib/check_nanopb_output.sh
+++ b/tools/distrib/check_nanopb_output.sh
@@ -51,6 +51,16 @@ readonly LOAD_BALANCER_GRPC_OUTPUT_PATH='src/core/ext/filters/client_channel/lb_
"$NANOPB_TMP_OUTPUT" \
"$LOAD_BALANCER_GRPC_OUTPUT_PATH"
+./tools/codegen/core/gen_nano_proto.sh \
+ third_party/protobuf/src/google/protobuf/duration.proto \
+ "$NANOPB_TMP_OUTPUT/google/protobuf" \
+ "$LOAD_BALANCER_GRPC_OUTPUT_PATH/google/protobuf"
+
+./tools/codegen/core/gen_nano_proto.sh \
+ third_party/protobuf/src/google/protobuf/timestamp.proto \
+ "$NANOPB_TMP_OUTPUT/google/protobuf" \
+ "$LOAD_BALANCER_GRPC_OUTPUT_PATH/google/protobuf"
+
# compare outputs to checked compiled code
if ! diff -r "$NANOPB_TMP_OUTPUT" src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1; then
echo "Outputs differ: $NANOPB_TMP_OUTPUT vs $LOAD_BALANCER_GRPC_OUTPUT_PATH"
diff --git a/tools/distrib/pylint_code.sh b/tools/distrib/pylint_code.sh
index 013b6660eb..82a818cce5 100755
--- a/tools/distrib/pylint_code.sh
+++ b/tools/distrib/pylint_code.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 2017 gRPC authors.
+# Copyright 2017 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -35,14 +35,15 @@ python -m virtualenv $VIRTUALENV
PYTHON=$VIRTUALENV/bin/python
$PYTHON -m pip install --upgrade pip==10.0.1
-$PYTHON -m pip install pylint==1.6.5
+$PYTHON -m pip install pylint==1.9.2
+EXIT=0
for dir in "${DIRS[@]}"; do
- $PYTHON -m pylint --rcfile=.pylintrc -rn "$dir" || exit $?
+ $PYTHON -m pylint --rcfile=.pylintrc -rn "$dir" || EXIT=1
done
for dir in "${TEST_DIRS[@]}"; do
- $PYTHON -m pylint --rcfile=.pylintrc-tests -rn "$dir" || exit $?
+ $PYTHON -m pylint --rcfile=.pylintrc-tests -rn "$dir" || EXIT=1
done
-exit 0
+exit $EXIT
diff --git a/tools/distrib/python/grpcio_tools/grpc_version.py b/tools/distrib/python/grpcio_tools/grpc_version.py
index f0367e2af4..ae249e7386 100644
--- a/tools/distrib/python/grpcio_tools/grpc_version.py
+++ b/tools/distrib/python/grpcio_tools/grpc_version.py
@@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!!
-VERSION = '1.13.0.dev0'
+VERSION = '1.14.0.dev0'
diff --git a/tools/distrib/run_clang_tidy.py b/tools/distrib/run_clang_tidy.py
index 337e6b43c8..7ad1c160ba 100755
--- a/tools/distrib/run_clang_tidy.py
+++ b/tools/distrib/run_clang_tidy.py
@@ -24,12 +24,6 @@ sys.path.append(
os.path.dirname(sys.argv[0]), '..', 'run_tests', 'python_utils'))
import jobset
-GRPC_CHECKS = [
- 'modernize-use-nullptr',
- 'google-build-namespaces',
- 'google-build-explicit-make-pair',
-]
-
extra_args = [
'-x',
'c++',
@@ -57,8 +51,6 @@ args = argp.parse_args()
cmdline = [
clang_tidy,
- '--checks=-*,%s' % ','.join(GRPC_CHECKS),
- '--warnings-as-errors=%s' % ','.join(GRPC_CHECKS)
] + ['--extra-arg-before=%s' % arg for arg in extra_args]
if args.fix:
diff --git a/tools/dockerfile/distribtest/csharp_centos7_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_centos7_x64/Dockerfile
index 088635b0ea..3e1faafdc0 100644
--- a/tools/dockerfile/distribtest/csharp_centos7_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/csharp_centos7_x64/Dockerfile
@@ -14,21 +14,11 @@
FROM centos:7
-RUN rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
-RUN yum-config-manager --add-repo http://download.mono-project.com/repo/centos/
+RUN rpm --import "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
+RUN curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo
-RUN yum install -y mono
+RUN yum install -y mono-devel
-RUN yum install -y unzip
-
-# --nogpgcheck because nuget-2.12 package is not signed.
-RUN yum install -y nuget --nogpgcheck
+RUN yum install -y nuget
-# Help mono correctly locate libMonoPosixHelper.so
-# as a workaround for issue https://bugzilla.xamarin.com/show_bug.cgi?id=42820
-# The error message you'll get without this workaround:
-# ```
-# WARNING: /usr/lib/libMonoPosixHelper.so
-# WARNING: Unable to read package from path 'Grpc.1.1.0-dev.nupkg'.
-# ```
-RUN cp /usr/lib64/libMonoPosixHelper.so /usr/lib/
+RUN yum install -y unzip
diff --git a/tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile
index 02ec4c278a..03fb7a5343 100644
--- a/tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile
@@ -14,14 +14,13 @@
FROM debian:jessie
+RUN apt-get update && apt-get install -y apt-transport-https && apt-get clean
+
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
-RUN echo "deb http://download.mono-project.com/repo/debian jessie main" | tee /etc/apt/sources.list.d/mono-official.list
-RUN echo "deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list
-RUN echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list
+RUN echo "deb https://download.mono-project.com/repo/debian stable-jessie main" | tee /etc/apt/sources.list.d/mono-official-stable.list
RUN apt-get update && apt-get install -y \
mono-devel \
- ca-certificates-mono \
nuget \
&& apt-get clean
diff --git a/tools/dockerfile/distribtest/csharp_jessie_x86/Dockerfile b/tools/dockerfile/distribtest/csharp_jessie_x86/Dockerfile
index 758f314572..f2fa61a691 100644
--- a/tools/dockerfile/distribtest/csharp_jessie_x86/Dockerfile
+++ b/tools/dockerfile/distribtest/csharp_jessie_x86/Dockerfile
@@ -14,14 +14,13 @@
FROM 32bit/debian:jessie
+RUN apt-get update && apt-get install -y apt-transport-https && apt-get clean
+
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
-RUN echo "deb http://download.mono-project.com/repo/debian jessie main" | tee /etc/apt/sources.list.d/mono-official.list
-RUN echo "deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list
-RUN echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list
+RUN echo "deb https://download.mono-project.com/repo/debian stable-jessie main" | tee /etc/apt/sources.list.d/mono-official-stable.list
RUN apt-get update && apt-get install -y \
mono-devel \
- ca-certificates-mono \
nuget \
&& apt-get clean
diff --git a/tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile
index 10279c5925..3edc31e170 100644
--- a/tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile
@@ -14,15 +14,17 @@
FROM ubuntu:14.04
-RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
-RUN echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list
+RUN apt-get update && apt-get install -y apt-transport-https && apt-get clean
+
+RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
+RUN echo "deb https://download.mono-project.com/repo/ubuntu stable-trusty main" | tee /etc/apt/sources.list.d/mono-official-stable.list
RUN apt-get update && apt-get install -y \
mono-devel \
- ca-certificates-mono \
- nuget
+ nuget \
+ && apt-get clean
-RUN apt-get update && apt-get install -y unzip
+RUN apt-get update && apt-get install -y unzip && apt-get clean
# Install dotnet CLI
RUN apt-get install -y apt-transport-https
diff --git a/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile
index 0f40f18e38..1a58f9784b 100644
--- a/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile
@@ -14,19 +14,14 @@
FROM ubuntu:16.04
+RUN apt-get update && apt-get install -y apt-transport-https && apt-get clean
+
+RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
+RUN echo "deb https://download.mono-project.com/repo/ubuntu stable-xenial main" | tee /etc/apt/sources.list.d/mono-official-stable.list
+
RUN apt-get update && apt-get install -y \
mono-devel \
- ca-certificates-mono \
nuget \
&& apt-get clean
-# make sure we have nuget 2.12+ (in case there's an older cached docker image)
-RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
-RUN echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list
-RUN apt-get update && apt-get install -y nuget && apt-get clean
-
-# Prevent "Error: SendFailure (Error writing headers)" when fetching nuget packages
-# See https://github.com/tianon/docker-brew-ubuntu-core/issues/86
-RUN apt-get update && apt-get install -y tzdata && apt-get clean
-
RUN apt-get update && apt-get install -y unzip && apt-get clean
diff --git a/tools/dockerfile/distribtest/csharp_wheezy_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_wheezy_x64/Dockerfile
deleted file mode 100644
index fb9c82c92b..0000000000
--- a/tools/dockerfile/distribtest/csharp_wheezy_x64/Dockerfile
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright 2015 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-FROM mono:4.4.2.11
-
-# make sure we have nuget 2.12+ (in case there's an older cached docker image)
-RUN apt-get update && apt-get install -y nuget
-
-RUN apt-get update && apt-get install -y unzip
diff --git a/tools/dockerfile/grpc_artifact_python_manylinux_x64/Dockerfile b/tools/dockerfile/grpc_artifact_python_manylinux_x64/Dockerfile
index 07604c7c42..aeb7b97845 100644
--- a/tools/dockerfile/grpc_artifact_python_manylinux_x64/Dockerfile
+++ b/tools/dockerfile/grpc_artifact_python_manylinux_x64/Dockerfile
@@ -14,7 +14,9 @@
# Docker file for building gRPC manylinux Python artifacts.
-FROM quay.io/pypa/manylinux1_x86_64
+# TODO(mmx): revert to the official manylinux1 docker image
+# after it ships with Python 3.7
+FROM grpctesting/manylinux1_temp_py37rc1_x86_64:79891dc2ec764b62a2dd2ffd083d381efde11a5f
# Update the package manager
RUN yum update -y
@@ -27,6 +29,7 @@ RUN /opt/python/cp27-cp27mu/bin/pip install cython
RUN /opt/python/cp34-cp34m/bin/pip install cython
RUN /opt/python/cp35-cp35m/bin/pip install cython
RUN /opt/python/cp36-cp36m/bin/pip install cython
+RUN /opt/python/cp37-cp37m/bin/pip install cython
####################################################
# Install auditwheel with fix for namespace packages
diff --git a/tools/dockerfile/grpc_artifact_python_manylinux_x86/Dockerfile b/tools/dockerfile/grpc_artifact_python_manylinux_x86/Dockerfile
index 96ab515efe..dcd9c817da 100644
--- a/tools/dockerfile/grpc_artifact_python_manylinux_x86/Dockerfile
+++ b/tools/dockerfile/grpc_artifact_python_manylinux_x86/Dockerfile
@@ -14,7 +14,9 @@
# Docker file for building gRPC manylinux Python artifacts.
-FROM quay.io/pypa/manylinux1_i686
+# TODO(mmx): revert to the official manylinux1 docker image
+# after it ships with Python 3.7
+FROM grpctesting/manylinux1_temp_py37rc1_i686:79891dc2ec764b62a2dd2ffd083d381efde11a5f
# Update the package manager
RUN yum update -y
@@ -27,6 +29,7 @@ RUN /opt/python/cp27-cp27mu/bin/pip install cython
RUN /opt/python/cp34-cp34m/bin/pip install cython
RUN /opt/python/cp35-cp35m/bin/pip install cython
RUN /opt/python/cp36-cp36m/bin/pip install cython
+RUN /opt/python/cp37-cp37m/bin/pip install cython
####################################################
# Install auditwheel with fix for namespace packages
diff --git a/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh
index a8898f85fa..7917e1cd60 100755
--- a/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh
+++ b/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh
@@ -28,4 +28,5 @@ cp -r /var/local/jenkins/service_account $HOME || true
cd /var/local/git/grpc
-tools/run_tests/run_tests.py -l python -c opt --build_only
+# interop tests only run using python2.7 currently (and python build is slow)
+tools/run_tests/run_tests.py -l python --compiler python2.7 -c opt --build_only
diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++
index 09c62462af..efe59c3af3 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.13.0-dev
+PROJECT_NUMBER = 1.14.0-dev
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@@ -900,7 +900,6 @@ include/grpc/impl/codegen/sync_custom.h \
include/grpc/impl/codegen/sync_generic.h \
include/grpc/impl/codegen/sync_posix.h \
include/grpc/impl/codegen/sync_windows.h \
-include/grpc/load_reporting.h \
include/grpc/slice.h \
include/grpc/slice_buffer.h \
include/grpc/status.h \
diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal
index ea2f377c91..6f8a81c926 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.13.0-dev
+PROJECT_NUMBER = 1.14.0-dev
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@@ -901,7 +901,6 @@ include/grpc/impl/codegen/sync_custom.h \
include/grpc/impl/codegen/sync_generic.h \
include/grpc/impl/codegen/sync_posix.h \
include/grpc/impl/codegen/sync_windows.h \
-include/grpc/load_reporting.h \
include/grpc/slice.h \
include/grpc/slice_buffer.h \
include/grpc/status.h \
@@ -1012,6 +1011,7 @@ 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/channel_trace.h \
+src/core/lib/channel/channelz.h \
src/core/lib/channel/channelz_registry.h \
src/core/lib/channel/connected_channel.h \
src/core/lib/channel/context.h \
diff --git a/tools/doxygen/Doxyfile.core b/tools/doxygen/Doxyfile.core
index 592c94e51b..f64bdfc813 100644
--- a/tools/doxygen/Doxyfile.core
+++ b/tools/doxygen/Doxyfile.core
@@ -840,7 +840,6 @@ include/grpc/impl/codegen/sync_posix.h \
include/grpc/impl/codegen/sync_posix.h \
include/grpc/impl/codegen/sync_windows.h \
include/grpc/impl/codegen/sync_windows.h \
-include/grpc/load_reporting.h \
include/grpc/slice.h \
include/grpc/slice_buffer.h \
include/grpc/status.h \
diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal
index 589e862b9a..63da493fee 100644
--- a/tools/doxygen/Doxyfile.core.internal
+++ b/tools/doxygen/Doxyfile.core.internal
@@ -840,7 +840,6 @@ include/grpc/impl/codegen/sync_posix.h \
include/grpc/impl/codegen/sync_posix.h \
include/grpc/impl/codegen/sync_windows.h \
include/grpc/impl/codegen/sync_windows.h \
-include/grpc/load_reporting.h \
include/grpc/slice.h \
include/grpc/slice_buffer.h \
include/grpc/status.h \
@@ -864,7 +863,6 @@ include/grpc/support/time.h \
include/grpc/support/workaround_list.h \
src/core/README.md \
src/core/ext/README.md \
-src/core/ext/census/grpc_context.cc \
src/core/ext/filters/client_channel/README.md \
src/core/ext/filters/client_channel/backup_poller.cc \
src/core/ext/filters/client_channel/backup_poller.h \
@@ -892,6 +890,8 @@ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc \
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h \
src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc \
src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h \
+src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c \
+src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c \
src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c \
src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h \
src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \
@@ -913,6 +913,7 @@ src/core/ext/filters/client_channel/resolver.cc \
src/core/ext/filters/client_channel/resolver.h \
src/core/ext/filters/client_channel/resolver/README.md \
src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \
+src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc \
@@ -946,10 +947,6 @@ src/core/ext/filters/http/message_compress/message_compress_filter.cc \
src/core/ext/filters/http/message_compress/message_compress_filter.h \
src/core/ext/filters/http/server/http_server_filter.cc \
src/core/ext/filters/http/server/http_server_filter.h \
-src/core/ext/filters/load_reporting/server_load_reporting_filter.cc \
-src/core/ext/filters/load_reporting/server_load_reporting_filter.h \
-src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc \
-src/core/ext/filters/load_reporting/server_load_reporting_plugin.h \
src/core/ext/filters/max_age/max_age_filter.cc \
src/core/ext/filters/max_age/max_age_filter.h \
src/core/ext/filters/message_size/message_size_filter.cc \
@@ -1038,6 +1035,8 @@ src/core/lib/channel/channel_stack_builder.cc \
src/core/lib/channel/channel_stack_builder.h \
src/core/lib/channel/channel_trace.cc \
src/core/lib/channel/channel_trace.h \
+src/core/lib/channel/channelz.cc \
+src/core/lib/channel/channelz.h \
src/core/lib/channel/channelz_registry.cc \
src/core/lib/channel/channelz_registry.h \
src/core/lib/channel/connected_channel.cc \
@@ -1499,6 +1498,7 @@ src/core/tsi/transport_security.h \
src/core/tsi/transport_security_grpc.cc \
src/core/tsi/transport_security_grpc.h \
src/core/tsi/transport_security_interface.h \
+src/cpp/ext/filters/census/grpc_context.cc \
third_party/nanopb/pb.h \
third_party/nanopb/pb_common.c \
third_party/nanopb/pb_common.h \
diff --git a/tools/internal_ci/linux/grpc_tsan_on_foundry.sh b/tools/internal_ci/linux/grpc_tsan_on_foundry.sh
index fafa1ceecb..1396fc4e42 100644
--- a/tools/internal_ci/linux/grpc_tsan_on_foundry.sh
+++ b/tools/internal_ci/linux/grpc_tsan_on_foundry.sh
@@ -14,5 +14,5 @@
# limitations under the License.
export UPLOAD_TEST_RESULTS=true
-EXTRA_FLAGS="--copt=-gmlt --strip=never --copt=-fsanitize=thread --linkopt=-fsanitize=thread --test_timeout=3600"
+EXTRA_FLAGS="--copt=-gmlt --strip=never --copt=-fsanitize=thread --linkopt=-fsanitize=thread --test_timeout=3600 --action_env=TSAN_OPTIONS=suppressions=test/core/util/tsan_suppressions.txt:halt_on_error=1:second_deadlock_stack=1"
github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh "${EXTRA_FLAGS}"
diff --git a/tools/interop_matrix/client_matrix.py b/tools/interop_matrix/client_matrix.py
index d6a704681a..1a7c24f44b 100644
--- a/tools/interop_matrix/client_matrix.py
+++ b/tools/interop_matrix/client_matrix.py
@@ -172,6 +172,9 @@ LANG_RELEASE_MATRIX = {
{
'v1.12.0': None
},
+ {
+ 'v1.13.1': None
+ },
],
'python': [
{
diff --git a/tools/profiling/ios_bin/binary_diff.py b/tools/profiling/ios_bin/binary_diff.py
new file mode 100755
index 0000000000..6d5ae65e46
--- /dev/null
+++ b/tools/profiling/ios_bin/binary_diff.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python2.7
+#
+# Copyright 2018 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import argparse
+import glob
+import multiprocessing
+import os
+import shutil
+import subprocess
+import sys
+from parse_link_map import parse_link_map
+
+sys.path.append(
+ os.path.join(
+ os.path.dirname(sys.argv[0]), '..', '..', 'run_tests', 'python_utils'))
+import comment_on_pr
+
+size_labels = ('Core', 'ObjC', 'BoringSSL', 'Protobuf', 'Total')
+
+argp = argparse.ArgumentParser(
+ description='Binary size diff of gRPC Objective-C sample')
+
+argp.add_argument(
+ '-d',
+ '--diff_base',
+ type=str,
+ help='Commit or branch to compare the current one to')
+
+args = argp.parse_args()
+
+
+def dir_size(dir):
+ total = 0
+ for dirpath, dirnames, filenames in os.walk(dir):
+ for f in filenames:
+ fp = os.path.join(dirpath, f)
+ total += os.stat(fp).st_size
+ return total
+
+
+def get_size(where, frameworks):
+ build_dir = 'src/objective-c/examples/Sample/Build-%s/' % where
+ if not frameworks:
+ link_map_filename = 'Build/Intermediates.noindex/Sample.build/Release-iphoneos/Sample.build/Sample-LinkMap-normal-arm64.txt'
+ return parse_link_map(build_dir + link_map_filename)
+ else:
+ framework_dir = 'Build/Products/Release-iphoneos/Sample.app/Frameworks/'
+ boringssl_size = dir_size(
+ build_dir + framework_dir + 'openssl.framework')
+ core_size = dir_size(build_dir + framework_dir + 'grpc.framework')
+ objc_size = dir_size(build_dir + framework_dir + 'GRPCClient.framework') + \
+ dir_size(build_dir + framework_dir + 'RxLibrary.framework') + \
+ dir_size(build_dir + framework_dir + 'ProtoRPC.framework')
+ protobuf_size = dir_size(
+ build_dir + framework_dir + 'Protobuf.framework')
+ app_size = dir_size(
+ build_dir + 'Build/Products/Release-iphoneos/Sample.app')
+ return core_size, objc_size, boringssl_size, protobuf_size, app_size
+
+
+def build(where, frameworks):
+ shutil.rmtree(
+ 'src/objective-c/examples/Sample/Build-%s' % where, ignore_errors=True)
+ subprocess.check_call(
+ 'CONFIG=opt EXAMPLE_PATH=src/objective-c/examples/Sample SCHEME=Sample FRAMEWORKS=%s ./build_one_example.sh'
+ % ('YES' if frameworks else 'NO'),
+ shell=True,
+ cwd='src/objective-c/tests')
+ os.rename('src/objective-c/examples/Sample/Build',
+ 'src/objective-c/examples/Sample/Build-%s' % where)
+
+
+text = ''
+for frameworks in [False, True]:
+ build('new', frameworks)
+ new_size = get_size('new', frameworks)
+ old_size = None
+
+ if args.diff_base:
+ old = 'old'
+ where_am_i = subprocess.check_output(
+ ['git', 'rev-parse', '--abbrev-ref', 'HEAD']).strip()
+ subprocess.check_call(['git', 'checkout', '--', '.'])
+ subprocess.check_call(['git', 'checkout', args.diff_base])
+ subprocess.check_call(['git', 'submodule', 'update'])
+ try:
+ build('old', frameworks)
+ old_size = get_size('old', frameworks)
+ finally:
+ subprocess.check_call(['git', 'checkout', '--', '.'])
+ subprocess.check_call(['git', 'checkout', where_am_i])
+ subprocess.check_call(['git', 'submodule', 'update'])
+
+ text += ('****************FRAMEWORKS*****************\n'
+ if frameworks else '******************STATIC*******************\n')
+ row_format = "{:>10}{:>15}{:>15}" + '\n'
+ text += row_format.format('New size', '', 'Old size')
+ for i in range(0, len(size_labels)):
+ if old_size == None:
+ diff_sign = ' '
+ elif new_size[i] == old_size[i]:
+ diff_sign = ' (=)'
+ elif new_size[i] > old_size[i]:
+ diff_sign = ' (>)'
+ else:
+ diff_sign = ' (<)'
+ text += ('\n' if i == len(size_labels) - 1 else '') + row_format.format(
+ '{:,}'.format(new_size[i]), size_labels[i] + diff_sign,
+ '{:,}'.format(old_size[i]) if old_size != None else '')
+ text += '\n'
+
+print text
+
+comment_on_pr.comment_on_pr('```\n%s\n```' % text)
diff --git a/tools/profiling/ios_bin/parse_link_map.py b/tools/profiling/ios_bin/parse_link_map.py
new file mode 100755
index 0000000000..eaa1d6e060
--- /dev/null
+++ b/tools/profiling/ios_bin/parse_link_map.py
@@ -0,0 +1,104 @@
+#!/usr/bin/python
+# Copyright 2018 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This script analyzes link map file generated by Xcode. It calculates and
+# prints out the sizes of each dependent library and the total sizes of the
+# symbols.
+# The script takes one parameter, which is the path to the link map file.
+
+import sys
+import re
+
+
+def parse_link_map(filename):
+ table_tag = {}
+ state = "start"
+
+ table_stats_symbol = {}
+ table_stats_dead = {}
+ section_total_size = 0
+ symbol_total_size = 0
+
+ boringssl_size = 0
+ core_size = 0
+ objc_size = 0
+ protobuf_size = 0
+
+ lines = list(open(filename))
+ for line in lines:
+ line_stripped = line[:-1]
+ if "# Object files:" == line_stripped:
+ state = "object"
+ continue
+ elif "# Sections:" == line_stripped:
+ state = "section"
+ continue
+ elif "# Symbols:" == line_stripped:
+ state = "symbol"
+ continue
+ elif "# Dead Stripped Symbols:" == line_stripped:
+ state = "dead"
+ continue
+
+ if state == "object":
+ segs = re.search('(\[ *[0-9]*\]) (.*)', line_stripped)
+ table_tag[segs.group(1)] = segs.group(2)
+
+ if state == "section":
+ if len(line_stripped) == 0 or line_stripped[0] == '#':
+ continue
+ segs = re.search('^(.+?)\s+(.+?)\s+.*', line_stripped)
+ section_total_size += int(segs.group(2), 16)
+
+ if state == "symbol":
+ if len(line_stripped) == 0 or line_stripped[0] == '#':
+ continue
+ segs = re.search('^.+?\s+(.+?)\s+(\[.+?\]).*', line_stripped)
+ target = table_tag[segs.group(2)]
+ target_stripped = re.search('^(.*?)(\(.+?\))?$', target).group(1)
+ size = int(segs.group(1), 16)
+ if not target_stripped in table_stats_symbol:
+ table_stats_symbol[target_stripped] = 0
+ table_stats_symbol[target_stripped] += size
+ if 'BoringSSL' in target_stripped:
+ boringssl_size += size
+ elif 'libgRPC-Core' in target_stripped:
+ core_size += size
+ elif 'libgRPC-RxLibrary' in target_stripped or \
+ 'libgRPC' in target_stripped or \
+ 'libgRPC-ProtoLibrary' in target_stripped:
+ objc_size += size
+ elif 'libProtobuf' in target_stripped:
+ protobuf_size += size
+
+ for target in table_stats_symbol:
+ symbol_total_size += table_stats_symbol[target]
+
+ return core_size, objc_size, boringssl_size, protobuf_size, symbol_total_size
+
+
+def main():
+ filename = sys.argv[1]
+ core_size, objc_size, boringssl_size, protobuf_size, total_size = parse_link_map(
+ filename)
+ print('Core size:{:,}'.format(core_size))
+ print('ObjC size:{:,}'.format(objc_size))
+ print('BoringSSL size:{:,}'.format(boringssl_size))
+ print('Protobuf size:{:,}\n'.format(protobuf_size))
+ print('Total size:{:,}'.format(total_size))
+
+
+if __name__ == "__main__":
+ main()
diff --git a/tools/run_tests/artifacts/artifact_targets.py b/tools/run_tests/artifacts/artifact_targets.py
index e4d9e6bdfe..35cbd730c8 100644
--- a/tools/run_tests/artifacts/artifact_targets.py
+++ b/tools/run_tests/artifacts/artifact_targets.py
@@ -354,6 +354,7 @@ def targets():
PythonArtifact('linux', 'x86', 'cp34-cp34m'),
PythonArtifact('linux', 'x86', 'cp35-cp35m'),
PythonArtifact('linux', 'x86', 'cp36-cp36m'),
+ PythonArtifact('linux', 'x86', 'cp37-cp37m'),
PythonArtifact('linux_extra', 'armv7', '2.7'),
PythonArtifact('linux_extra', 'armv7', '3.4'),
PythonArtifact('linux_extra', 'armv7', '3.5'),
@@ -367,6 +368,7 @@ def targets():
PythonArtifact('linux', 'x64', 'cp34-cp34m'),
PythonArtifact('linux', 'x64', 'cp35-cp35m'),
PythonArtifact('linux', 'x64', 'cp36-cp36m'),
+ PythonArtifact('linux', 'x64', 'cp37-cp37m'),
PythonArtifact('macos', 'x64', 'python2.7'),
PythonArtifact('macos', 'x64', 'python3.4'),
PythonArtifact('macos', 'x64', 'python3.5'),
diff --git a/tools/run_tests/artifacts/build_artifact_csharp.bat b/tools/run_tests/artifacts/build_artifact_csharp.bat
index a84bc54157..ac2c92b716 100644
--- a/tools/run_tests/artifacts/build_artifact_csharp.bat
+++ b/tools/run_tests/artifacts/build_artifact_csharp.bat
@@ -19,11 +19,12 @@ set GRPC_SKIP_DOTNET_RESTORE=true
@call tools\run_tests\helper_scripts\pre_build_csharp.bat %ARCHITECTURE% || goto :error
cd cmake\build\%ARCHITECTURE%
-cmake --build . --target grpc_csharp_ext --config Release
+cmake --build . --target grpc_csharp_ext --config RelWithDebInfo
cd ..\..\..
mkdir -p %ARTIFACTS_OUT%
-copy /Y cmake\build\Win32\Release\grpc_csharp_ext.dll %ARTIFACTS_OUT% || copy /Y cmake\build\x64\Release\grpc_csharp_ext.dll %ARTIFACTS_OUT% || goto :error
+copy /Y cmake\build\Win32\RelWithDebInfo\grpc_csharp_ext.dll %ARTIFACTS_OUT% || copy /Y cmake\build\x64\RelWithDebInfo\grpc_csharp_ext.dll %ARTIFACTS_OUT% || goto :error
+copy /Y cmake\build\Win32\RelWithDebInfo\grpc_csharp_ext.pdb %ARTIFACTS_OUT% || copy /Y cmake\build\x64\RelWithDebInfo\grpc_csharp_ext.pdb %ARTIFACTS_OUT% || goto :error
goto :EOF
diff --git a/tools/run_tests/artifacts/build_artifact_python.sh b/tools/run_tests/artifacts/build_artifact_python.sh
index 846a415396..2878005bb2 100755
--- a/tools/run_tests/artifacts/build_artifact_python.sh
+++ b/tools/run_tests/artifacts/build_artifact_python.sh
@@ -99,12 +99,16 @@ then
"${PIP}" install grpcio --no-index --find-links "file://$ARTIFACT_DIR/"
"${PIP}" install grpcio-tools --no-index --find-links "file://$ARTIFACT_DIR/"
- # Build gRPC health-checking source distribution
+ # Build grpcio_testing source distribution
+ ${SETARCH_CMD} "${PYTHON}" src/python/grpcio_testing/setup.py sdist
+ cp -r src/python/grpcio_testing/dist/* "$ARTIFACT_DIR"
+
+ # Build grpcio_health_checking source distribution
${SETARCH_CMD} "${PYTHON}" src/python/grpcio_health_checking/setup.py \
preprocess build_package_protos sdist
cp -r src/python/grpcio_health_checking/dist/* "$ARTIFACT_DIR"
- # Build gRPC reflection source distribution
+ # Build grpcio_reflection source distribution
${SETARCH_CMD} "${PYTHON}" src/python/grpcio_reflection/setup.py \
preprocess build_package_protos sdist
cp -r src/python/grpcio_reflection/dist/* "$ARTIFACT_DIR"
diff --git a/tools/run_tests/artifacts/distribtest_targets.py b/tools/run_tests/artifacts/distribtest_targets.py
index 213325439e..e02f4bffcd 100644
--- a/tools/run_tests/artifacts/distribtest_targets.py
+++ b/tools/run_tests/artifacts/distribtest_targets.py
@@ -303,7 +303,6 @@ def targets():
CppDistribTest('linux', 'x64', 'jessie', 'cmake_as_submodule'),
CppDistribTest('windows', 'x86', testcase='cmake'),
CppDistribTest('windows', 'x86', testcase='cmake_as_externalproject'),
- CSharpDistribTest('linux', 'x64', 'wheezy'),
CSharpDistribTest('linux', 'x64', 'jessie'),
CSharpDistribTest('linux', 'x86', 'jessie'),
CSharpDistribTest('linux', 'x64', 'centos7'),
diff --git a/tools/run_tests/generated/configs.json b/tools/run_tests/generated/configs.json
index a14340cb7b..74c6286240 100644
--- a/tools/run_tests/generated/configs.json
+++ b/tools/run_tests/generated/configs.json
@@ -6,7 +6,7 @@
"config": "asan-trace-cmp",
"environ": {
"ASAN_OPTIONS": "detect_leaks=1:color=always",
- "LSAN_OPTIONS": "suppressions=tools/lsan_suppressions.txt:report_objects=1"
+ "LSAN_OPTIONS": "suppressions=test/core/util/lsan_suppressions.txt:report_objects=1"
}
},
{
@@ -16,7 +16,7 @@
"config": "asan",
"environ": {
"ASAN_OPTIONS": "detect_leaks=1:color=always",
- "LSAN_OPTIONS": "suppressions=tools/lsan_suppressions.txt:report_objects=1"
+ "LSAN_OPTIONS": "suppressions=test/core/util/lsan_suppressions.txt:report_objects=1"
}
},
{
@@ -47,13 +47,13 @@
{
"config": "ubsan",
"environ": {
- "UBSAN_OPTIONS": "halt_on_error=1:print_stacktrace=1:suppressions=tools/ubsan_suppressions.txt"
+ "UBSAN_OPTIONS": "halt_on_error=1:print_stacktrace=1:suppressions=test/core/util/ubsan_suppressions.txt"
}
},
{
"config": "tsan",
"environ": {
- "TSAN_OPTIONS": "suppressions=tools/tsan_suppressions.txt:halt_on_error=1:second_deadlock_stack=1"
+ "TSAN_OPTIONS": "suppressions=test/core/util/tsan_suppressions.txt:halt_on_error=1:second_deadlock_stack=1"
}
},
{
diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json
index bdc6cc101c..35c7e8f981 100644
--- a/tools/run_tests/generated/sources_and_headers.json
+++ b/tools/run_tests/generated/sources_and_headers.json
@@ -459,6 +459,23 @@
"headers": [],
"is_filegroup": false,
"language": "c",
+ "name": "ev_epollex_linux_test",
+ "src": [
+ "test/core/iomgr/ev_epollex_linux_test.cc"
+ ],
+ "third_party": false,
+ "type": "target"
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "is_filegroup": false,
+ "language": "c",
"name": "ev_epollsig_linux_test",
"src": [
"test/core/iomgr/ev_epollsig_linux_test.cc"
@@ -1177,6 +1194,23 @@
{
"deps": [
"gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "is_filegroup": false,
+ "language": "c",
+ "name": "handshake_verify_peer_options",
+ "src": [
+ "test/core/handshake/verify_peer_options.cc"
+ ],
+ "third_party": false,
+ "type": "target"
+ },
+ {
+ "deps": [
+ "gpr",
"grpc_test_util"
],
"headers": [],
@@ -2755,6 +2789,28 @@
"headers": [],
"is_filegroup": false,
"language": "c++",
+ "name": "bm_channel",
+ "src": [
+ "test/cpp/microbenchmarks/bm_channel.cc"
+ ],
+ "third_party": false,
+ "type": "target"
+ },
+ {
+ "deps": [
+ "benchmark",
+ "gpr",
+ "gpr_test_util",
+ "grpc++_test_config",
+ "grpc++_test_util_unsecure",
+ "grpc++_unsecure",
+ "grpc_benchmark",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "is_filegroup": false,
+ "language": "c++",
"name": "bm_chttp2_hpack",
"src": [
"test/cpp/microbenchmarks/bm_chttp2_hpack.cc"
@@ -3106,6 +3162,27 @@
{
"deps": [
"gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_channelz_proto",
+ "grpc++_test",
+ "grpc++_test_util",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "is_filegroup": false,
+ "language": "c++",
+ "name": "channelz_test",
+ "src": [
+ "test/core/channel/channelz_test.cc"
+ ],
+ "third_party": false,
+ "type": "target"
+ },
+ {
+ "deps": [
+ "gpr",
"grpc"
],
"headers": [],
@@ -3961,26 +4038,6 @@
"gpr_test_util",
"grpc",
"grpc++",
- "grpc++_test_util",
- "grpc_test_util",
- "lb_load_data_store"
- ],
- "headers": [],
- "is_filegroup": false,
- "language": "c++",
- "name": "lb_load_data_store_test",
- "src": [
- "test/cpp/server/load_reporter/load_data_store_test.cc"
- ],
- "third_party": false,
- "type": "target"
- },
- {
- "deps": [
- "gpr",
- "gpr_test_util",
- "grpc",
- "grpc++",
"grpc++_test",
"grpc_test_util"
],
@@ -5982,24 +6039,6 @@
"headers": [],
"is_filegroup": false,
"language": "c",
- "name": "h2_load_reporting_test",
- "src": [
- "test/core/end2end/fixtures/h2_load_reporting.cc"
- ],
- "third_party": false,
- "type": "target"
- },
- {
- "deps": [
- "end2end_tests",
- "gpr",
- "gpr_test_util",
- "grpc",
- "grpc_test_util"
- ],
- "headers": [],
- "is_filegroup": false,
- "language": "c",
"name": "h2_oauth2_test",
"src": [
"test/core/end2end/fixtures/h2_oauth2.cc"
@@ -6306,24 +6345,6 @@
"headers": [],
"is_filegroup": false,
"language": "c",
- "name": "h2_load_reporting_nosec_test",
- "src": [
- "test/core/end2end/fixtures/h2_load_reporting.cc"
- ],
- "third_party": false,
- "type": "target"
- },
- {
- "deps": [
- "end2end_nosec_tests",
- "gpr",
- "gpr_test_util",
- "grpc_test_util_unsecure",
- "grpc_unsecure"
- ],
- "headers": [],
- "is_filegroup": false,
- "language": "c",
"name": "h2_proxy_nosec_test",
"src": [
"test/core/end2end/fixtures/h2_proxy.cc"
@@ -6546,6 +6567,26 @@
"gpr",
"gpr_test_util",
"grpc",
+ "grpc++",
+ "grpc++_test_config",
+ "grpc++_test_util",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "is_filegroup": false,
+ "language": "c++",
+ "name": "cancel_ares_query_test",
+ "src": [
+ "test/cpp/naming/cancel_ares_query_test.cc"
+ ],
+ "third_party": false,
+ "type": "target"
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
"grpc_test_util"
],
"headers": [],
@@ -6883,7 +6924,6 @@
"grpc_resolver_sockaddr",
"grpc_secure",
"grpc_server_backward_compatibility",
- "grpc_server_load_reporting",
"grpc_transport_chttp2_client_insecure",
"grpc_transport_chttp2_client_secure",
"grpc_transport_chttp2_server_insecure",
@@ -6905,7 +6945,6 @@
"deps": [
"gpr",
"grpc_base",
- "grpc_server_load_reporting",
"grpc_transport_chttp2_client_secure",
"grpc_transport_cronet_client_secure"
],
@@ -6990,7 +7029,6 @@
"grpc_resolver_fake",
"grpc_resolver_sockaddr",
"grpc_server_backward_compatibility",
- "grpc_server_load_reporting",
"grpc_transport_chttp2_client_insecure",
"grpc_transport_chttp2_server_insecure",
"grpc_transport_inproc",
@@ -7609,23 +7647,6 @@
},
{
"deps": [
- "grpc++"
- ],
- "headers": [
- "src/cpp/server/load_reporter/load_data_store.h"
- ],
- "is_filegroup": false,
- "language": "c++",
- "name": "lb_load_data_store",
- "src": [
- "src/cpp/server/load_reporter/load_data_store.cc",
- "src/cpp/server/load_reporter/load_data_store.h"
- ],
- "third_party": false,
- "type": "lib"
- },
- {
- "deps": [
"grpc",
"grpc++",
"grpc++_core_stats",
@@ -8733,6 +8754,7 @@
"test/core/end2end/tests/cancel_in_a_vacuum.cc",
"test/core/end2end/tests/cancel_test_helpers.h",
"test/core/end2end/tests/cancel_with_status.cc",
+ "test/core/end2end/tests/channelz.cc",
"test/core/end2end/tests/compressed_payload.cc",
"test/core/end2end/tests/connectivity.cc",
"test/core/end2end/tests/default_host.cc",
@@ -8749,13 +8771,13 @@
"test/core/end2end/tests/invoke_large_request.cc",
"test/core/end2end/tests/keepalive_timeout.cc",
"test/core/end2end/tests/large_metadata.cc",
- "test/core/end2end/tests/load_reporting_hook.cc",
"test/core/end2end/tests/max_concurrent_streams.cc",
"test/core/end2end/tests/max_connection_age.cc",
"test/core/end2end/tests/max_connection_idle.cc",
"test/core/end2end/tests/max_message_length.cc",
"test/core/end2end/tests/negative_deadline.cc",
"test/core/end2end/tests/network_status_change.cc",
+ "test/core/end2end/tests/no_error_on_hotpath.cc",
"test/core/end2end/tests/no_logging.cc",
"test/core/end2end/tests/no_op.cc",
"test/core/end2end/tests/payload.cc",
@@ -8832,6 +8854,7 @@
"test/core/end2end/tests/cancel_in_a_vacuum.cc",
"test/core/end2end/tests/cancel_test_helpers.h",
"test/core/end2end/tests/cancel_with_status.cc",
+ "test/core/end2end/tests/channelz.cc",
"test/core/end2end/tests/compressed_payload.cc",
"test/core/end2end/tests/connectivity.cc",
"test/core/end2end/tests/default_host.cc",
@@ -8848,13 +8871,13 @@
"test/core/end2end/tests/invoke_large_request.cc",
"test/core/end2end/tests/keepalive_timeout.cc",
"test/core/end2end/tests/large_metadata.cc",
- "test/core/end2end/tests/load_reporting_hook.cc",
"test/core/end2end/tests/max_concurrent_streams.cc",
"test/core/end2end/tests/max_connection_age.cc",
"test/core/end2end/tests/max_connection_idle.cc",
"test/core/end2end/tests/max_message_length.cc",
"test/core/end2end/tests/negative_deadline.cc",
"test/core/end2end/tests/network_status_change.cc",
+ "test/core/end2end/tests/no_error_on_hotpath.cc",
"test/core/end2end/tests/no_logging.cc",
"test/core/end2end/tests/no_op.cc",
"test/core/end2end/tests/payload.cc",
@@ -9037,8 +9060,7 @@
{
"deps": [
"gpr",
- "grpc_base",
- "nanopb"
+ "grpc_base"
],
"headers": [
"include/grpc/census.h"
@@ -9048,7 +9070,7 @@
"name": "census",
"src": [
"include/grpc/census.h",
- "src/core/ext/census/grpc_context.cc"
+ "src/cpp/ext/filters/census/grpc_context.cc"
],
"third_party": false,
"type": "filegroup"
@@ -9304,6 +9326,7 @@
"src/core/lib/channel/channel_stack.cc",
"src/core/lib/channel/channel_stack_builder.cc",
"src/core/lib/channel/channel_trace.cc",
+ "src/core/lib/channel/channelz.cc",
"src/core/lib/channel/channelz_registry.cc",
"src/core/lib/channel/connected_channel.cc",
"src/core/lib/channel/handshaker.cc",
@@ -9464,7 +9487,6 @@
"include/grpc/grpc.h",
"include/grpc/grpc_posix.h",
"include/grpc/grpc_security_constants.h",
- "include/grpc/load_reporting.h",
"include/grpc/slice.h",
"include/grpc/slice_buffer.h",
"include/grpc/status.h",
@@ -9475,6 +9497,7 @@
"src/core/lib/channel/channel_stack.h",
"src/core/lib/channel/channel_stack_builder.h",
"src/core/lib/channel/channel_trace.h",
+ "src/core/lib/channel/channelz.h",
"src/core/lib/channel/channelz_registry.h",
"src/core/lib/channel/connected_channel.h",
"src/core/lib/channel/context.h",
@@ -9613,7 +9636,6 @@
"include/grpc/grpc.h",
"include/grpc/grpc_posix.h",
"include/grpc/grpc_security_constants.h",
- "include/grpc/load_reporting.h",
"include/grpc/slice.h",
"include/grpc/slice_buffer.h",
"include/grpc/status.h",
@@ -9624,6 +9646,7 @@
"src/core/lib/channel/channel_stack.h",
"src/core/lib/channel/channel_stack_builder.h",
"src/core/lib/channel/channel_trace.h",
+ "src/core/lib/channel/channelz.h",
"src/core/lib/channel/channelz_registry.h",
"src/core/lib/channel/connected_channel.h",
"src/core/lib/channel/context.h",
@@ -9757,6 +9780,32 @@
{
"deps": [
"gpr",
+ "gpr_base_headers",
+ "grpc_base_headers"
+ ],
+ "headers": [
+ "src/core/lib/iomgr/cfstream_handle.h",
+ "src/core/lib/iomgr/endpoint_cfstream.h",
+ "src/core/lib/iomgr/error_cfstream.h"
+ ],
+ "is_filegroup": true,
+ "language": "c",
+ "name": "grpc_cfstream",
+ "src": [
+ "src/core/lib/iomgr/cfstream_handle.cc",
+ "src/core/lib/iomgr/cfstream_handle.h",
+ "src/core/lib/iomgr/endpoint_cfstream.cc",
+ "src/core/lib/iomgr/endpoint_cfstream.h",
+ "src/core/lib/iomgr/error_cfstream.cc",
+ "src/core/lib/iomgr/error_cfstream.h",
+ "src/core/lib/iomgr/tcp_client_cfstream.cc"
+ ],
+ "third_party": false,
+ "type": "filegroup"
+ },
+ {
+ "deps": [
+ "gpr",
"grpc_base"
],
"headers": [
@@ -9952,6 +10001,8 @@
"src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h",
"src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc",
"src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h",
+ "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c",
+ "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c",
"src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c",
"src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h"
],
@@ -9989,6 +10040,8 @@
"src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h",
"src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc",
"src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h",
+ "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c",
+ "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c",
"src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c",
"src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h"
],
@@ -10098,6 +10151,7 @@
"name": "grpc_resolver_dns_ares",
"src": [
"src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc",
+ "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc",
"src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h",
"src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc",
"src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc",
@@ -10268,27 +10322,6 @@
},
{
"deps": [
- "gpr",
- "grpc_base"
- ],
- "headers": [
- "src/core/ext/filters/load_reporting/server_load_reporting_filter.h",
- "src/core/ext/filters/load_reporting/server_load_reporting_plugin.h"
- ],
- "is_filegroup": true,
- "language": "c",
- "name": "grpc_server_load_reporting",
- "src": [
- "src/core/ext/filters/load_reporting/server_load_reporting_filter.cc",
- "src/core/ext/filters/load_reporting/server_load_reporting_filter.h",
- "src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc",
- "src/core/ext/filters/load_reporting/server_load_reporting_plugin.h"
- ],
- "third_party": false,
- "type": "filegroup"
- },
- {
- "deps": [
"cmdline",
"gpr",
"gpr_test_util",
diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json
index 00604f181c..094ba13ad3 100644
--- a/tools/run_tests/generated/tests.json
+++ b/tools/run_tests/generated/tests.json
@@ -82,7 +82,7 @@
"posix",
"windows"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 10,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -575,6 +575,26 @@
"flaky": false,
"gtest": false,
"language": "c",
+ "name": "ev_epollex_linux_test",
+ "platforms": [
+ "linux"
+ ],
+ "uses_polling": true
+ },
+ {
+ "args": [],
+ "benchmark": false,
+ "ci_platforms": [
+ "linux"
+ ],
+ "cpu_cost": 3,
+ "exclude_configs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
+ "flaky": false,
+ "gtest": false,
+ "language": "c",
"name": "ev_epollsig_linux_test",
"platforms": [
"linux"
@@ -1451,6 +1471,26 @@
"args": [],
"benchmark": false,
"ci_platforms": [
+ "linux"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
+ "flaky": false,
+ "gtest": false,
+ "language": "c",
+ "name": "handshake_verify_peer_options",
+ "platforms": [
+ "linux"
+ ],
+ "uses_polling": true
+ },
+ {
+ "args": [],
+ "benchmark": false,
+ "ci_platforms": [
"linux",
"mac",
"posix",
@@ -3301,6 +3341,28 @@
"flaky": false,
"gtest": false,
"language": "c++",
+ "name": "bm_channel",
+ "platforms": [
+ "linux",
+ "mac",
+ "posix"
+ ],
+ "uses_polling": false
+ },
+ {
+ "args": [],
+ "benchmark": true,
+ "ci_platforms": [
+ "linux",
+ "mac",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [],
+ "flaky": false,
+ "gtest": false,
+ "language": "c++",
"name": "bm_chttp2_hpack",
"platforms": [
"linux",
@@ -3706,6 +3768,30 @@
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
+ "gtest": true,
+ "language": "c++",
+ "name": "channelz_test",
+ "platforms": [
+ "linux",
+ "mac",
+ "posix",
+ "windows"
+ ],
+ "uses_polling": true
+ },
+ {
+ "args": [],
+ "benchmark": false,
+ "ci_platforms": [
+ "linux",
+ "mac",
+ "posix",
+ "windows"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [],
+ "flaky": false,
"gtest": false,
"language": "c++",
"name": "check_gcp_environment_linux_test",
@@ -4448,30 +4534,6 @@
"flaky": false,
"gtest": true,
"language": "c++",
- "name": "lb_load_data_store_test",
- "platforms": [
- "linux",
- "mac",
- "posix",
- "windows"
- ],
- "uses_polling": true
- },
- {
- "args": [],
- "benchmark": false,
- "ci_platforms": [
- "linux",
- "mac",
- "posix",
- "windows"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "gtest": true,
- "language": "c++",
"name": "memory_test",
"platforms": [
"linux",
@@ -5640,6 +5702,28 @@
},
{
"args": [],
+ "benchmark": false,
+ "ci_platforms": [
+ "linux",
+ "mac",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [],
+ "flaky": false,
+ "gtest": true,
+ "language": "c++",
+ "name": "cancel_ares_query_test",
+ "platforms": [
+ "linux",
+ "mac",
+ "posix"
+ ],
+ "uses_polling": true
+ },
+ {
+ "args": [],
"boringssl": true,
"ci_platforms": [
"linux",
@@ -7265,6 +7349,29 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_census_test",
+ "platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -7635,7 +7742,7 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"windows",
@@ -7643,7 +7750,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -7658,7 +7765,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"windows",
@@ -7681,7 +7788,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_connection_idle"
],
"ci_platforms": [
"windows",
@@ -7691,7 +7798,9 @@
],
"cpu_cost": 0.1,
"exclude_configs": [],
- "exclude_iomgrs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
"flaky": false,
"language": "c",
"name": "h2_census_test",
@@ -7704,7 +7813,7 @@
},
{
"args": [
- "max_connection_idle"
+ "max_message_length"
],
"ci_platforms": [
"windows",
@@ -7714,9 +7823,7 @@
],
"cpu_cost": 0.1,
"exclude_configs": [],
- "exclude_iomgrs": [
- "uv"
- ],
+ "exclude_iomgrs": [],
"flaky": false,
"language": "c",
"name": "h2_census_test",
@@ -7729,7 +7836,7 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"windows",
@@ -7737,7 +7844,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -7752,7 +7859,7 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"windows",
@@ -7760,7 +7867,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -7775,7 +7882,7 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"windows",
@@ -7783,7 +7890,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -9017,6 +9124,29 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_compress_test",
+ "platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -9387,7 +9517,7 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"windows",
@@ -9395,7 +9525,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -9410,7 +9540,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"windows",
@@ -9433,7 +9563,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_connection_idle"
],
"ci_platforms": [
"windows",
@@ -9443,7 +9573,9 @@
],
"cpu_cost": 0.1,
"exclude_configs": [],
- "exclude_iomgrs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
"flaky": false,
"language": "c",
"name": "h2_compress_test",
@@ -9456,7 +9588,7 @@
},
{
"args": [
- "max_connection_idle"
+ "max_message_length"
],
"ci_platforms": [
"windows",
@@ -9466,9 +9598,7 @@
],
"cpu_cost": 0.1,
"exclude_configs": [],
- "exclude_iomgrs": [
- "uv"
- ],
+ "exclude_iomgrs": [],
"flaky": false,
"language": "c",
"name": "h2_compress_test",
@@ -9481,7 +9611,7 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"windows",
@@ -9489,7 +9619,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -9504,7 +9634,7 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"windows",
@@ -9512,7 +9642,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -9527,7 +9657,7 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"windows",
@@ -9535,7 +9665,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -10733,6 +10863,28 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "windows",
+ "linux",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_fakesec_test",
+ "platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -11087,14 +11239,14 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -11109,7 +11261,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"windows",
@@ -11131,7 +11283,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_connection_idle"
],
"ci_platforms": [
"windows",
@@ -11140,7 +11292,9 @@
],
"cpu_cost": 0.1,
"exclude_configs": [],
- "exclude_iomgrs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
"flaky": false,
"language": "c",
"name": "h2_fakesec_test",
@@ -11153,7 +11307,7 @@
},
{
"args": [
- "max_connection_idle"
+ "max_message_length"
],
"ci_platforms": [
"windows",
@@ -11162,9 +11316,7 @@
],
"cpu_cost": 0.1,
"exclude_configs": [],
- "exclude_iomgrs": [
- "uv"
- ],
+ "exclude_iomgrs": [],
"flaky": false,
"language": "c",
"name": "h2_fakesec_test",
@@ -11177,14 +11329,14 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -11199,14 +11351,14 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -11221,14 +11373,14 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -12376,6 +12528,29 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "linux",
+ "mac",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_fd_test",
+ "platforms": [
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -12675,14 +12850,14 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"linux",
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -12698,7 +12873,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"linux",
@@ -12721,7 +12896,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_message_length"
],
"ci_platforms": [
"linux",
@@ -12744,14 +12919,14 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"linux",
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -12767,14 +12942,14 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"linux",
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -12790,14 +12965,14 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"linux",
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -13618,6 +13793,29 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_full_test",
+ "platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -13988,7 +14186,7 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"windows",
@@ -13996,7 +14194,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -14011,7 +14209,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"windows",
@@ -14034,7 +14232,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_connection_idle"
],
"ci_platforms": [
"windows",
@@ -14044,7 +14242,9 @@
],
"cpu_cost": 0.1,
"exclude_configs": [],
- "exclude_iomgrs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
"flaky": false,
"language": "c",
"name": "h2_full_test",
@@ -14057,7 +14257,7 @@
},
{
"args": [
- "max_connection_idle"
+ "max_message_length"
],
"ci_platforms": [
"windows",
@@ -14067,9 +14267,7 @@
],
"cpu_cost": 0.1,
"exclude_configs": [],
- "exclude_iomgrs": [
- "uv"
- ],
+ "exclude_iomgrs": [],
"flaky": false,
"language": "c",
"name": "h2_full_test",
@@ -14082,7 +14280,7 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"windows",
@@ -14090,7 +14288,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -14105,7 +14303,7 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"windows",
@@ -14113,7 +14311,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -14128,7 +14326,7 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"windows",
@@ -14136,7 +14334,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -15318,6 +15516,25 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "linux"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_full+pipe_test",
+ "platforms": [
+ "linux"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -15622,12 +15839,12 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"linux"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -15641,7 +15858,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"linux"
@@ -15660,7 +15877,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_connection_idle"
],
"ci_platforms": [
"linux"
@@ -15679,7 +15896,7 @@
},
{
"args": [
- "max_connection_idle"
+ "max_message_length"
],
"ci_platforms": [
"linux"
@@ -15698,12 +15915,12 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"linux"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -15717,12 +15934,12 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"linux"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -15736,12 +15953,12 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"linux"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -16814,6 +17031,29 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_full+trace_test",
+ "platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -17161,7 +17401,7 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"windows",
@@ -17169,7 +17409,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -17184,7 +17424,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"windows",
@@ -17207,7 +17447,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_connection_idle"
],
"ci_platforms": [
"windows",
@@ -17217,7 +17457,9 @@
],
"cpu_cost": 0.1,
"exclude_configs": [],
- "exclude_iomgrs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
"flaky": false,
"language": "c",
"name": "h2_full+trace_test",
@@ -17230,7 +17472,7 @@
},
{
"args": [
- "max_connection_idle"
+ "max_message_length"
],
"ci_platforms": [
"windows",
@@ -17240,9 +17482,7 @@
],
"cpu_cost": 0.1,
"exclude_configs": [],
- "exclude_iomgrs": [
- "uv"
- ],
+ "exclude_iomgrs": [],
"flaky": false,
"language": "c",
"name": "h2_full+trace_test",
@@ -17255,7 +17495,7 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"windows",
@@ -17263,7 +17503,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -17278,7 +17518,7 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"windows",
@@ -17286,7 +17526,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -17301,7 +17541,7 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"windows",
@@ -17309,7 +17549,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -18520,6 +18760,29 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_full+workarounds_test",
+ "platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -18890,7 +19153,7 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"windows",
@@ -18898,7 +19161,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -18913,7 +19176,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"windows",
@@ -18936,7 +19199,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_connection_idle"
],
"ci_platforms": [
"windows",
@@ -18946,7 +19209,9 @@
],
"cpu_cost": 0.1,
"exclude_configs": [],
- "exclude_iomgrs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
"flaky": false,
"language": "c",
"name": "h2_full+workarounds_test",
@@ -18959,7 +19224,7 @@
},
{
"args": [
- "max_connection_idle"
+ "max_message_length"
],
"ci_platforms": [
"windows",
@@ -18969,9 +19234,7 @@
],
"cpu_cost": 0.1,
"exclude_configs": [],
- "exclude_iomgrs": [
- "uv"
- ],
+ "exclude_iomgrs": [],
"flaky": false,
"language": "c",
"name": "h2_full+workarounds_test",
@@ -18984,7 +19247,7 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"windows",
@@ -18992,7 +19255,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -19007,7 +19270,7 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"windows",
@@ -19015,7 +19278,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -19030,7 +19293,7 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"windows",
@@ -19038,7 +19301,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -20285,6 +20548,30 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "windows",
+ "linux",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_http_proxy_test",
+ "platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -20669,14 +20956,14 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -20693,7 +20980,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"windows",
@@ -20717,7 +21004,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_connection_idle"
],
"ci_platforms": [
"windows",
@@ -20741,7 +21028,7 @@
},
{
"args": [
- "max_connection_idle"
+ "max_message_length"
],
"ci_platforms": [
"windows",
@@ -20765,14 +21052,14 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -20789,14 +21076,14 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -20813,14 +21100,14 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -21826,1744 +22113,16 @@
"ci_platforms": [
"windows",
"linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "bad_hostname"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "bad_ping"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "binary_metadata"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "call_creds"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "call_host_override"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "cancel_after_accept"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "cancel_after_client_done"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "cancel_after_invoke"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "cancel_after_round_trip"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "cancel_before_invoke"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "cancel_in_a_vacuum"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "cancel_with_status"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "compressed_payload"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "connectivity"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [
- "uv"
- ],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "default_host"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "disappearing_server"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": true,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "empty_batch"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "filter_call_init_fails"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "filter_causes_close"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "filter_latency"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "filter_status_code"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "graceful_server_shutdown"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "high_initial_seqno"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "hpack_size"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "idempotent_request"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "invoke_large_request"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
"posix"
],
"cpu_cost": 1.0,
"exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "keepalive_timeout"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "large_metadata"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "load_reporting_hook"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "max_concurrent_streams"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "max_connection_age"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "max_connection_idle"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
"exclude_iomgrs": [
"uv"
],
"flaky": false,
"language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "max_message_length"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "negative_deadline"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "network_status_change"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "no_logging"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "no_op"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "payload"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "ping"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "ping_pong_streaming"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "registered_call"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "request_with_flags"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "request_with_payload"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_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,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_cancellation"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_disabled"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_exceeds_buffer_size_in_initial_batch"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_exceeds_buffer_size_in_subsequent_batch"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_non_retriable_status"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_non_retriable_status_before_recv_trailing_metadata_started"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_recv_initial_metadata"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_recv_message"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_server_pushback_delay"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_server_pushback_disabled"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_streaming"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_streaming_after_commit"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_streaming_succeeds_before_replay_finished"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_throttled"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_too_many_attempts"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "server_finishes_request"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "shutdown_finishes_calls"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "shutdown_finishes_tags"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "simple_cacheable_request"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "simple_delayed_request"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "simple_metadata"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "simple_request"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "stream_compression_compressed_payload"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "stream_compression_payload"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "stream_compression_ping_pong_streaming"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "streaming_error_response"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "trailing_metadata"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "workaround_cronet_compression"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "write_buffering"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "write_buffering_at_end"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_test",
+ "name": "h2_oauth2_test",
"platforms": [
"windows",
"linux",
@@ -23573,7 +22132,7 @@
},
{
"args": [
- "authority_not_supported"
+ "bad_hostname"
],
"ci_platforms": [
"windows",
@@ -23597,7 +22156,7 @@
},
{
"args": [
- "bad_hostname"
+ "bad_ping"
],
"ci_platforms": [
"windows",
@@ -23621,14 +22180,14 @@
},
{
"args": [
- "bad_ping"
+ "binary_metadata"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -23645,14 +22204,14 @@
},
{
"args": [
- "binary_metadata"
+ "call_creds"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -23669,7 +22228,7 @@
},
{
"args": [
- "call_creds"
+ "call_host_override"
],
"ci_platforms": [
"windows",
@@ -23693,14 +22252,14 @@
},
{
"args": [
- "call_host_override"
+ "cancel_after_accept"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -23717,7 +22276,7 @@
},
{
"args": [
- "cancel_after_accept"
+ "cancel_after_client_done"
],
"ci_platforms": [
"windows",
@@ -23741,7 +22300,7 @@
},
{
"args": [
- "cancel_after_client_done"
+ "cancel_after_invoke"
],
"ci_platforms": [
"windows",
@@ -23765,7 +22324,7 @@
},
{
"args": [
- "cancel_after_invoke"
+ "cancel_after_round_trip"
],
"ci_platforms": [
"windows",
@@ -23789,7 +22348,7 @@
},
{
"args": [
- "cancel_after_round_trip"
+ "cancel_before_invoke"
],
"ci_platforms": [
"windows",
@@ -23813,7 +22372,7 @@
},
{
"args": [
- "cancel_before_invoke"
+ "cancel_in_a_vacuum"
],
"ci_platforms": [
"windows",
@@ -23837,7 +22396,7 @@
},
{
"args": [
- "cancel_in_a_vacuum"
+ "cancel_with_status"
],
"ci_platforms": [
"windows",
@@ -23861,14 +22420,14 @@
},
{
"args": [
- "cancel_with_status"
+ "channelz"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -24269,14 +22828,14 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -24293,7 +22852,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"windows",
@@ -24317,7 +22876,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_connection_idle"
],
"ci_platforms": [
"windows",
@@ -24341,7 +22900,7 @@
},
{
"args": [
- "max_connection_idle"
+ "max_message_length"
],
"ci_platforms": [
"windows",
@@ -24365,14 +22924,14 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -24389,14 +22948,14 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -24413,14 +22972,14 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -25685,7 +24244,7 @@
},
{
"args": [
- "default_host"
+ "channelz"
],
"ci_platforms": [
"windows",
@@ -25709,7 +24268,7 @@
},
{
"args": [
- "disappearing_server"
+ "default_host"
],
"ci_platforms": [
"windows",
@@ -25721,7 +24280,7 @@
"exclude_iomgrs": [
"uv"
],
- "flaky": true,
+ "flaky": false,
"language": "c",
"name": "h2_proxy_test",
"platforms": [
@@ -25733,19 +24292,19 @@
},
{
"args": [
- "empty_batch"
+ "disappearing_server"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
],
- "flaky": false,
+ "flaky": true,
"language": "c",
"name": "h2_proxy_test",
"platforms": [
@@ -25757,14 +24316,14 @@
},
{
"args": [
- "filter_call_init_fails"
+ "empty_batch"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -25781,14 +24340,14 @@
},
{
"args": [
- "filter_causes_close"
+ "filter_call_init_fails"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -25805,7 +24364,7 @@
},
{
"args": [
- "filter_latency"
+ "filter_causes_close"
],
"ci_platforms": [
"windows",
@@ -25829,7 +24388,7 @@
},
{
"args": [
- "filter_status_code"
+ "filter_latency"
],
"ci_platforms": [
"windows",
@@ -25853,7 +24412,7 @@
},
{
"args": [
- "graceful_server_shutdown"
+ "filter_status_code"
],
"ci_platforms": [
"windows",
@@ -25877,7 +24436,7 @@
},
{
"args": [
- "high_initial_seqno"
+ "graceful_server_shutdown"
],
"ci_platforms": [
"windows",
@@ -25901,14 +24460,14 @@
},
{
"args": [
- "idempotent_request"
+ "high_initial_seqno"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -25925,7 +24484,7 @@
},
{
"args": [
- "invoke_large_request"
+ "idempotent_request"
],
"ci_platforms": [
"windows",
@@ -25949,7 +24508,7 @@
},
{
"args": [
- "large_metadata"
+ "invoke_large_request"
],
"ci_platforms": [
"windows",
@@ -25973,7 +24532,7 @@
},
{
"args": [
- "load_reporting_hook"
+ "large_metadata"
],
"ci_platforms": [
"windows",
@@ -26837,6 +25396,30 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "windows",
+ "linux",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_sockpair_test",
+ "platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -27149,14 +25732,14 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -27173,7 +25756,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"windows",
@@ -27197,7 +25780,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_message_length"
],
"ci_platforms": [
"windows",
@@ -27221,14 +25804,14 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -27245,14 +25828,14 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -27269,14 +25852,14 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -28085,6 +26668,30 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "windows",
+ "linux",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_sockpair+trace_test",
+ "platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -28373,14 +26980,14 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -28397,7 +27004,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"windows",
@@ -28421,7 +27028,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_message_length"
],
"ci_platforms": [
"windows",
@@ -28445,14 +27052,14 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -28469,14 +27076,14 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -28493,14 +27100,14 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -29283,6 +27890,32 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "windows",
+ "linux",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [
+ "msan"
+ ],
+ "exclude_iomgrs": [
+ "uv"
+ ],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_sockpair_1byte_test",
+ "platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -29621,14 +28254,14 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [
"msan"
],
@@ -29647,7 +28280,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"windows",
@@ -29673,7 +28306,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_message_length"
],
"ci_platforms": [
"windows",
@@ -29699,14 +28332,14 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [
"msan"
],
@@ -29725,14 +28358,14 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [
"msan"
],
@@ -29751,14 +28384,14 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [
"msan"
],
@@ -30622,6 +29255,29 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_ssl_test",
+ "platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -30992,7 +29648,7 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"windows",
@@ -31000,7 +29656,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -31015,7 +29671,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"windows",
@@ -31038,7 +29694,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_connection_idle"
],
"ci_platforms": [
"windows",
@@ -31048,7 +29704,9 @@
],
"cpu_cost": 0.1,
"exclude_configs": [],
- "exclude_iomgrs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
"flaky": false,
"language": "c",
"name": "h2_ssl_test",
@@ -31061,7 +29719,7 @@
},
{
"args": [
- "max_connection_idle"
+ "max_message_length"
],
"ci_platforms": [
"windows",
@@ -31071,9 +29729,7 @@
],
"cpu_cost": 0.1,
"exclude_configs": [],
- "exclude_iomgrs": [
- "uv"
- ],
+ "exclude_iomgrs": [],
"flaky": false,
"language": "c",
"name": "h2_ssl_test",
@@ -31086,7 +29742,7 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"windows",
@@ -31094,7 +29750,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -31109,7 +29765,7 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"windows",
@@ -31117,7 +29773,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -31132,7 +29788,7 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"windows",
@@ -31140,7 +29796,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -32363,7 +31019,7 @@
},
{
"args": [
- "default_host"
+ "channelz"
],
"ci_platforms": [
"windows",
@@ -32387,7 +31043,7 @@
},
{
"args": [
- "disappearing_server"
+ "default_host"
],
"ci_platforms": [
"windows",
@@ -32399,7 +31055,7 @@
"exclude_iomgrs": [
"uv"
],
- "flaky": true,
+ "flaky": false,
"language": "c",
"name": "h2_ssl_proxy_test",
"platforms": [
@@ -32411,19 +31067,19 @@
},
{
"args": [
- "empty_batch"
+ "disappearing_server"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
],
- "flaky": false,
+ "flaky": true,
"language": "c",
"name": "h2_ssl_proxy_test",
"platforms": [
@@ -32435,14 +31091,14 @@
},
{
"args": [
- "filter_call_init_fails"
+ "empty_batch"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -32459,14 +31115,14 @@
},
{
"args": [
- "filter_causes_close"
+ "filter_call_init_fails"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -32483,7 +31139,7 @@
},
{
"args": [
- "filter_latency"
+ "filter_causes_close"
],
"ci_platforms": [
"windows",
@@ -32507,7 +31163,7 @@
},
{
"args": [
- "filter_status_code"
+ "filter_latency"
],
"ci_platforms": [
"windows",
@@ -32531,7 +31187,7 @@
},
{
"args": [
- "graceful_server_shutdown"
+ "filter_status_code"
],
"ci_platforms": [
"windows",
@@ -32555,7 +31211,7 @@
},
{
"args": [
- "high_initial_seqno"
+ "graceful_server_shutdown"
],
"ci_platforms": [
"windows",
@@ -32579,14 +31235,14 @@
},
{
"args": [
- "idempotent_request"
+ "high_initial_seqno"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -32603,7 +31259,7 @@
},
{
"args": [
- "invoke_large_request"
+ "idempotent_request"
],
"ci_platforms": [
"windows",
@@ -32627,7 +31283,7 @@
},
{
"args": [
- "large_metadata"
+ "invoke_large_request"
],
"ci_platforms": [
"windows",
@@ -32651,7 +31307,7 @@
},
{
"args": [
- "load_reporting_hook"
+ "large_metadata"
],
"ci_platforms": [
"windows",
@@ -33527,6 +32183,29 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "linux",
+ "mac",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_uds_test",
+ "platforms": [
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -33872,14 +32551,14 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"linux",
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -33895,7 +32574,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"linux",
@@ -33918,7 +32597,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_connection_idle"
],
"ci_platforms": [
"linux",
@@ -33941,7 +32620,7 @@
},
{
"args": [
- "max_connection_idle"
+ "max_message_length"
],
"ci_platforms": [
"linux",
@@ -33964,14 +32643,14 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"linux",
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -33987,14 +32666,14 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"linux",
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -34010,14 +32689,14 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"linux",
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -35183,6 +33862,29 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [],
+ "flaky": false,
+ "language": "c",
+ "name": "inproc_test",
+ "platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"empty_batch"
],
"ci_platforms": [
@@ -35413,7 +34115,7 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_message_length"
],
"ci_platforms": [
"windows",
@@ -35421,7 +34123,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -35436,7 +34138,7 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"windows",
@@ -35444,7 +34146,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -35459,7 +34161,7 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"windows",
@@ -35467,7 +34169,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -35482,7 +34184,7 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"windows",
@@ -35490,7 +34192,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -36172,6 +34874,29 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_census_nosec_test",
+ "platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -36542,7 +35267,7 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"windows",
@@ -36550,7 +35275,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -36565,7 +35290,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"windows",
@@ -36588,7 +35313,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_connection_idle"
],
"ci_platforms": [
"windows",
@@ -36598,7 +35323,9 @@
],
"cpu_cost": 0.1,
"exclude_configs": [],
- "exclude_iomgrs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
"flaky": false,
"language": "c",
"name": "h2_census_nosec_test",
@@ -36611,7 +35338,7 @@
},
{
"args": [
- "max_connection_idle"
+ "max_message_length"
],
"ci_platforms": [
"windows",
@@ -36621,9 +35348,7 @@
],
"cpu_cost": 0.1,
"exclude_configs": [],
- "exclude_iomgrs": [
- "uv"
- ],
+ "exclude_iomgrs": [],
"flaky": false,
"language": "c",
"name": "h2_census_nosec_test",
@@ -36636,7 +35361,7 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"windows",
@@ -36644,7 +35369,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -36659,7 +35384,7 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"windows",
@@ -36667,7 +35392,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -36682,7 +35407,7 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"windows",
@@ -36690,7 +35415,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -37901,6 +36626,29 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_compress_nosec_test",
+ "platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -38271,7 +37019,7 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"windows",
@@ -38279,7 +37027,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -38294,7 +37042,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"windows",
@@ -38317,7 +37065,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_connection_idle"
],
"ci_platforms": [
"windows",
@@ -38327,7 +37075,9 @@
],
"cpu_cost": 0.1,
"exclude_configs": [],
- "exclude_iomgrs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
"flaky": false,
"language": "c",
"name": "h2_compress_nosec_test",
@@ -38340,7 +37090,7 @@
},
{
"args": [
- "max_connection_idle"
+ "max_message_length"
],
"ci_platforms": [
"windows",
@@ -38350,9 +37100,7 @@
],
"cpu_cost": 0.1,
"exclude_configs": [],
- "exclude_iomgrs": [
- "uv"
- ],
+ "exclude_iomgrs": [],
"flaky": false,
"language": "c",
"name": "h2_compress_nosec_test",
@@ -38365,7 +37113,7 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"windows",
@@ -38373,7 +37121,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -38388,7 +37136,7 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"windows",
@@ -38396,7 +37144,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -38411,7 +37159,7 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"windows",
@@ -38419,7 +37167,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -39561,6 +38309,29 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "linux",
+ "mac",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_fd_nosec_test",
+ "platforms": [
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -39860,14 +38631,14 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"linux",
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -39883,7 +38654,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"linux",
@@ -39906,7 +38677,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_message_length"
],
"ci_platforms": [
"linux",
@@ -39929,14 +38700,14 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"linux",
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -39952,14 +38723,14 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"linux",
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -39975,14 +38746,14 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"linux",
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -40780,6 +39551,29 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_full_nosec_test",
+ "platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -41150,7 +39944,7 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"windows",
@@ -41158,7 +39952,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -41173,7 +39967,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"windows",
@@ -41196,7 +39990,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_connection_idle"
],
"ci_platforms": [
"windows",
@@ -41206,7 +40000,9 @@
],
"cpu_cost": 0.1,
"exclude_configs": [],
- "exclude_iomgrs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
"flaky": false,
"language": "c",
"name": "h2_full_nosec_test",
@@ -41219,7 +40015,7 @@
},
{
"args": [
- "max_connection_idle"
+ "max_message_length"
],
"ci_platforms": [
"windows",
@@ -41229,9 +40025,7 @@
],
"cpu_cost": 0.1,
"exclude_configs": [],
- "exclude_iomgrs": [
- "uv"
- ],
+ "exclude_iomgrs": [],
"flaky": false,
"language": "c",
"name": "h2_full_nosec_test",
@@ -41244,7 +40038,7 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"windows",
@@ -41252,7 +40046,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -41267,7 +40061,7 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"windows",
@@ -41275,7 +40069,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -41290,7 +40084,7 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"windows",
@@ -41298,7 +40092,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -42461,6 +41255,25 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "linux"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_full+pipe_nosec_test",
+ "platforms": [
+ "linux"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -42765,12 +41578,12 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"linux"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -42784,7 +41597,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"linux"
@@ -42803,7 +41616,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_connection_idle"
],
"ci_platforms": [
"linux"
@@ -42822,7 +41635,7 @@
},
{
"args": [
- "max_connection_idle"
+ "max_message_length"
],
"ci_platforms": [
"linux"
@@ -42841,12 +41654,12 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"linux"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -42860,12 +41673,12 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"linux"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -42879,12 +41692,12 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"linux"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -43934,6 +42747,29 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_full+trace_nosec_test",
+ "platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -44281,7 +43117,7 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"windows",
@@ -44289,7 +43125,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -44304,7 +43140,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"windows",
@@ -44327,7 +43163,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_connection_idle"
],
"ci_platforms": [
"windows",
@@ -44337,7 +43173,9 @@
],
"cpu_cost": 0.1,
"exclude_configs": [],
- "exclude_iomgrs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
"flaky": false,
"language": "c",
"name": "h2_full+trace_nosec_test",
@@ -44350,7 +43188,7 @@
},
{
"args": [
- "max_connection_idle"
+ "max_message_length"
],
"ci_platforms": [
"windows",
@@ -44360,9 +43198,7 @@
],
"cpu_cost": 0.1,
"exclude_configs": [],
- "exclude_iomgrs": [
- "uv"
- ],
+ "exclude_iomgrs": [],
"flaky": false,
"language": "c",
"name": "h2_full+trace_nosec_test",
@@ -44375,7 +43211,7 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"windows",
@@ -44383,7 +43219,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -44398,7 +43234,7 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"windows",
@@ -44406,7 +43242,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -44421,7 +43257,7 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"windows",
@@ -44429,7 +43265,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -45617,6 +44453,29 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_full+workarounds_nosec_test",
+ "platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -45987,7 +44846,7 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"windows",
@@ -45995,7 +44854,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -46010,7 +44869,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"windows",
@@ -46033,7 +44892,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_connection_idle"
],
"ci_platforms": [
"windows",
@@ -46043,7 +44902,9 @@
],
"cpu_cost": 0.1,
"exclude_configs": [],
- "exclude_iomgrs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
"flaky": false,
"language": "c",
"name": "h2_full+workarounds_nosec_test",
@@ -46056,7 +44917,7 @@
},
{
"args": [
- "max_connection_idle"
+ "max_message_length"
],
"ci_platforms": [
"windows",
@@ -46066,9 +44927,7 @@
],
"cpu_cost": 0.1,
"exclude_configs": [],
- "exclude_iomgrs": [
- "uv"
- ],
+ "exclude_iomgrs": [],
"flaky": false,
"language": "c",
"name": "h2_full+workarounds_nosec_test",
@@ -46081,7 +44940,7 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"windows",
@@ -46089,7 +44948,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -46104,7 +44963,7 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"windows",
@@ -46112,7 +44971,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -46127,7 +44986,7 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"windows",
@@ -46135,7 +44994,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -47358,6 +46217,30 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "windows",
+ "linux",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_http_proxy_nosec_test",
+ "platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -47742,14 +46625,14 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -47766,7 +46649,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"windows",
@@ -47790,7 +46673,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_connection_idle"
],
"ci_platforms": [
"windows",
@@ -47814,7 +46697,7 @@
},
{
"args": [
- "max_connection_idle"
+ "max_message_length"
],
"ci_platforms": [
"windows",
@@ -47838,14 +46721,14 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -47862,14 +46745,14 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -47886,14 +46769,14 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -48899,638 +47782,16 @@
"ci_platforms": [
"windows",
"linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "bad_hostname"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "bad_ping"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "binary_metadata"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "call_host_override"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "cancel_after_accept"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "cancel_after_client_done"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "cancel_after_invoke"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "cancel_after_round_trip"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "cancel_before_invoke"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "cancel_in_a_vacuum"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "cancel_with_status"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "compressed_payload"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
"posix"
],
"cpu_cost": 1.0,
"exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "connectivity"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
"exclude_iomgrs": [
"uv"
],
"flaky": false,
"language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "default_host"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "disappearing_server"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": true,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "empty_batch"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "filter_call_init_fails"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "filter_causes_close"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "filter_latency"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "filter_status_code"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "graceful_server_shutdown"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "high_initial_seqno"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "hpack_size"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "idempotent_request"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "invoke_large_request"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "keepalive_timeout"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "large_metadata"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
+ "name": "h2_proxy_nosec_test",
"platforms": [
"windows",
"linux",
@@ -49540,1057 +47801,21 @@
},
{
"args": [
- "load_reporting_hook"
+ "bad_hostname"
],
"ci_platforms": [
"windows",
"linux",
- "mac",
"posix"
],
"cpu_cost": 1.0,
"exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "max_concurrent_streams"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "max_connection_age"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "max_connection_idle"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
"exclude_iomgrs": [
"uv"
],
"flaky": false,
"language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "max_message_length"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "negative_deadline"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "network_status_change"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "no_logging"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "no_op"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "payload"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "ping"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "ping_pong_streaming"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "registered_call"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "request_with_flags"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "request_with_payload"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_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,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_cancellation"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_disabled"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_exceeds_buffer_size_in_initial_batch"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_exceeds_buffer_size_in_subsequent_batch"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_non_retriable_status"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_non_retriable_status_before_recv_trailing_metadata_started"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_recv_initial_metadata"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_recv_message"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_server_pushback_delay"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_server_pushback_disabled"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_streaming"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_streaming_after_commit"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_streaming_succeeds_before_replay_finished"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_throttled"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "retry_too_many_attempts"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "server_finishes_request"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "shutdown_finishes_calls"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "shutdown_finishes_tags"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "simple_cacheable_request"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "simple_delayed_request"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "simple_metadata"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "simple_request"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "stream_compression_compressed_payload"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "stream_compression_payload"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "stream_compression_ping_pong_streaming"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "streaming_error_response"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "trailing_metadata"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "workaround_cronet_compression"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "write_buffering"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ],
- "cpu_cost": 0.1,
- "exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
+ "name": "h2_proxy_nosec_test",
"platforms": [
"windows",
"linux",
@@ -50600,38 +47825,15 @@
},
{
"args": [
- "write_buffering_at_end"
+ "binary_metadata"
],
"ci_platforms": [
"windows",
"linux",
- "mac",
"posix"
],
"cpu_cost": 0.1,
"exclude_configs": [],
- "exclude_iomgrs": [],
- "flaky": false,
- "language": "c",
- "name": "h2_load_reporting_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "authority_not_supported"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
"exclude_iomgrs": [
"uv"
],
@@ -50647,7 +47849,7 @@
},
{
"args": [
- "bad_hostname"
+ "call_host_override"
],
"ci_platforms": [
"windows",
@@ -50671,7 +47873,7 @@
},
{
"args": [
- "binary_metadata"
+ "cancel_after_accept"
],
"ci_platforms": [
"windows",
@@ -50695,31 +47897,7 @@
},
{
"args": [
- "call_host_override"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [
- "uv"
- ],
- "flaky": false,
- "language": "c",
- "name": "h2_proxy_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
- "cancel_after_accept"
+ "cancel_after_client_done"
],
"ci_platforms": [
"windows",
@@ -50743,7 +47921,7 @@
},
{
"args": [
- "cancel_after_client_done"
+ "cancel_after_invoke"
],
"ci_platforms": [
"windows",
@@ -50767,7 +47945,7 @@
},
{
"args": [
- "cancel_after_invoke"
+ "cancel_after_round_trip"
],
"ci_platforms": [
"windows",
@@ -50791,7 +47969,7 @@
},
{
"args": [
- "cancel_after_round_trip"
+ "cancel_before_invoke"
],
"ci_platforms": [
"windows",
@@ -50815,7 +47993,7 @@
},
{
"args": [
- "cancel_before_invoke"
+ "cancel_in_a_vacuum"
],
"ci_platforms": [
"windows",
@@ -50839,7 +48017,7 @@
},
{
"args": [
- "cancel_in_a_vacuum"
+ "cancel_with_status"
],
"ci_platforms": [
"windows",
@@ -50863,14 +48041,14 @@
},
{
"args": [
- "cancel_with_status"
+ "channelz"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -51175,30 +48353,6 @@
},
{
"args": [
- "load_reporting_hook"
- ],
- "ci_platforms": [
- "windows",
- "linux",
- "posix"
- ],
- "cpu_cost": 1.0,
- "exclude_configs": [],
- "exclude_iomgrs": [
- "uv"
- ],
- "flaky": false,
- "language": "c",
- "name": "h2_proxy_nosec_test",
- "platforms": [
- "windows",
- "linux",
- "mac",
- "posix"
- ]
- },
- {
- "args": [
"max_connection_age"
],
"ci_platforms": [
@@ -52015,6 +49169,30 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "windows",
+ "linux",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_sockpair_nosec_test",
+ "platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -52327,14 +49505,14 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -52351,7 +49529,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"windows",
@@ -52375,7 +49553,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_message_length"
],
"ci_platforms": [
"windows",
@@ -52399,14 +49577,14 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -52423,14 +49601,14 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -52447,14 +49625,14 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -53239,6 +50417,30 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "windows",
+ "linux",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_sockpair+trace_nosec_test",
+ "platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -53527,14 +50729,14 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -53551,7 +50753,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"windows",
@@ -53575,7 +50777,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_message_length"
],
"ci_platforms": [
"windows",
@@ -53599,14 +50801,14 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -53623,14 +50825,14 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -53647,14 +50849,14 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -54411,6 +51613,32 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "windows",
+ "linux",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [
+ "msan"
+ ],
+ "exclude_iomgrs": [
+ "uv"
+ ],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_sockpair_1byte_nosec_test",
+ "platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -54749,14 +51977,14 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [
"msan"
],
@@ -54775,7 +52003,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"windows",
@@ -54801,7 +52029,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_message_length"
],
"ci_platforms": [
"windows",
@@ -54827,14 +52055,14 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [
"msan"
],
@@ -54853,14 +52081,14 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [
"msan"
],
@@ -54879,14 +52107,14 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"windows",
"linux",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [
"msan"
],
@@ -55704,6 +52932,29 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "linux",
+ "mac",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
+ "flaky": false,
+ "language": "c",
+ "name": "h2_uds_nosec_test",
+ "platforms": [
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"compressed_payload"
],
"ci_platforms": [
@@ -56049,14 +53300,14 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_concurrent_streams"
],
"ci_platforms": [
"linux",
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -56072,7 +53323,7 @@
},
{
"args": [
- "max_concurrent_streams"
+ "max_connection_age"
],
"ci_platforms": [
"linux",
@@ -56095,7 +53346,7 @@
},
{
"args": [
- "max_connection_age"
+ "max_connection_idle"
],
"ci_platforms": [
"linux",
@@ -56118,7 +53369,7 @@
},
{
"args": [
- "max_connection_idle"
+ "max_message_length"
],
"ci_platforms": [
"linux",
@@ -56141,14 +53392,14 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"linux",
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -56164,14 +53415,14 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"linux",
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -56187,14 +53438,14 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"linux",
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [
"uv"
@@ -57337,6 +54588,29 @@
},
{
"args": [
+ "channelz"
+ ],
+ "ci_platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [],
+ "flaky": false,
+ "language": "c",
+ "name": "inproc_nosec_test",
+ "platforms": [
+ "windows",
+ "linux",
+ "mac",
+ "posix"
+ ]
+ },
+ {
+ "args": [
"empty_batch"
],
"ci_platforms": [
@@ -57567,7 +54841,7 @@
},
{
"args": [
- "load_reporting_hook"
+ "max_message_length"
],
"ci_platforms": [
"windows",
@@ -57575,7 +54849,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -57590,7 +54864,7 @@
},
{
"args": [
- "max_message_length"
+ "negative_deadline"
],
"ci_platforms": [
"windows",
@@ -57598,7 +54872,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -57613,7 +54887,7 @@
},
{
"args": [
- "negative_deadline"
+ "network_status_change"
],
"ci_platforms": [
"windows",
@@ -57621,7 +54895,7 @@
"mac",
"posix"
],
- "cpu_cost": 1.0,
+ "cpu_cost": 0.1,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
@@ -57636,7 +54910,7 @@
},
{
"args": [
- "network_status_change"
+ "no_error_on_hotpath"
],
"ci_platforms": [
"windows",
@@ -57644,7 +54918,7 @@
"mac",
"posix"
],
- "cpu_cost": 0.1,
+ "cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
diff --git a/tools/run_tests/helper_scripts/build_ruby.sh b/tools/run_tests/helper_scripts/build_ruby.sh
index b15a8639d9..38f99d80ab 100755
--- a/tools/run_tests/helper_scripts/build_ruby.sh
+++ b/tools/run_tests/helper_scripts/build_ruby.sh
@@ -23,3 +23,6 @@ cd "$(dirname "$0")/../../.."
rm -rf ./tmp
rake compile
+
+# build grpc_ruby_plugin
+make grpc_ruby_plugin -j8
diff --git a/tools/run_tests/helper_scripts/run_ruby.sh b/tools/run_tests/helper_scripts/run_ruby.sh
index 03eaeb0ec7..4e9c212877 100755
--- a/tools/run_tests/helper_scripts/run_ruby.sh
+++ b/tools/run_tests/helper_scripts/run_ruby.sh
@@ -18,7 +18,4 @@ set -ex
# change to grpc repo root
cd "$(dirname "$0")/../../.."
-# build grpc_ruby_plugin
-make grpc_ruby_plugin -j8
-
rake
diff --git a/tools/run_tests/helper_scripts/run_ruby_end2end_tests.sh b/tools/run_tests/helper_scripts/run_ruby_end2end_tests.sh
index 5784745bac..7ff877e830 100755
--- a/tools/run_tests/helper_scripts/run_ruby_end2end_tests.sh
+++ b/tools/run_tests/helper_scripts/run_ruby_end2end_tests.sh
@@ -19,14 +19,15 @@ set -ex
cd "$(dirname "$0")/../../.."
EXIT_CODE=0
-ruby src/ruby/end2end/sig_handling_driver.rb || EXIT_CODE=1
-ruby src/ruby/end2end/channel_state_driver.rb || EXIT_CODE=1
-ruby src/ruby/end2end/channel_closing_driver.rb || EXIT_CODE=1
-ruby src/ruby/end2end/sig_int_during_channel_watch_driver.rb || EXIT_CODE=1
-ruby src/ruby/end2end/killed_client_thread_driver.rb || EXIT_CODE=1
-ruby src/ruby/end2end/forking_client_driver.rb || EXIT_CODE=1
-ruby src/ruby/end2end/grpc_class_init_driver.rb || EXIT_CODE=1
-ruby src/ruby/end2end/multiple_killed_watching_threads_driver.rb || EXIT_CODE=1
-ruby src/ruby/end2end/load_grpc_with_gc_stress_driver.rb || EXIT_CODE=1
-ruby src/ruby/end2end/client_memory_usage_driver.rb || EXIT_CODE=1
+time ruby src/ruby/end2end/sig_handling_driver.rb || EXIT_CODE=1
+time ruby src/ruby/end2end/channel_state_driver.rb || EXIT_CODE=1
+time ruby src/ruby/end2end/channel_closing_driver.rb || EXIT_CODE=1
+time ruby src/ruby/end2end/sig_int_during_channel_watch_driver.rb || EXIT_CODE=1
+time ruby src/ruby/end2end/killed_client_thread_driver.rb || EXIT_CODE=1
+time ruby src/ruby/end2end/forking_client_driver.rb || EXIT_CODE=1
+time ruby src/ruby/end2end/grpc_class_init_driver.rb || EXIT_CODE=1
+time ruby src/ruby/end2end/multiple_killed_watching_threads_driver.rb || EXIT_CODE=1
+time ruby src/ruby/end2end/load_grpc_with_gc_stress_driver.rb || EXIT_CODE=1
+time ruby src/ruby/end2end/client_memory_usage_driver.rb || EXIT_CODE=1
+time ruby src/ruby/end2end/package_with_underscore_checker.rb || EXIT_CODE=1
exit $EXIT_CODE
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 4c09b3414e..98a17fd1a7 100644
--- a/tools/run_tests/python_utils/filter_pull_request_tests.py
+++ b/tools/run_tests/python_utils/filter_pull_request_tests.py
@@ -96,7 +96,7 @@ _WHITELIST_DICT = {
'gRPC\-Core\.podspec$': [_OBJC_TEST_SUITE],
'gRPC\-ProtoRPC\.podspec$': [_OBJC_TEST_SUITE],
'gRPC\-RxLibrary\.podspec$': [_OBJC_TEST_SUITE],
- 'INSTALL\.md$': [],
+ 'BUILDING\.md$': [],
'LICENSE$': [],
'MANIFEST\.md$': [],
'package\.json$': [_PHP_TEST_SUITE],
diff --git a/tools/run_tests/python_utils/upload_rbe_results.py b/tools/run_tests/python_utils/upload_rbe_results.py
index 5955b3792f..cbeb1ad941 100644
--- a/tools/run_tests/python_utils/upload_rbe_results.py
+++ b/tools/run_tests/python_utils/upload_rbe_results.py
@@ -125,7 +125,7 @@ def _get_resultstore_data(api_key, invocation_id):
if __name__ == "__main__":
- # Arguments are necessary if running in a non-Kokoro envrionment.
+ # Arguments are necessary if running in a non-Kokoro environment.
argp = argparse.ArgumentParser(description='Upload RBE results.')
argp.add_argument('--api_key', default='', type=str)
argp.add_argument('--invocation_id', default='', type=str)
@@ -161,7 +161,7 @@ if __name__ == "__main__":
test_cases = action['testAction']['testSuite']['tests'][0][
'testSuite']['tests']
for test_case in test_cases:
- if 'errors' in test_case['testCase']:
+ if any(s in test_case['testCase'] for s in ['errors', 'failures']):
result = 'FAILED'
elif 'timedOut' in test_case['testCase']:
result = 'TIMEOUT'
@@ -175,8 +175,8 @@ if __name__ == "__main__":
'build_id':
os.getenv('KOKORO_BUILD_NUMBER'),
'build_url':
- 'https://sponge.corp.google.com/invocation?id=%s' %
- os.getenv('KOKORO_BUILD_ID'),
+ 'https://source.cloud.google.com/results/invocations/%s' %
+ invocation_id,
'test_target':
action['id']['targetId'],
'test_case':
diff --git a/tools/run_tests/python_utils/upload_test_results.py b/tools/run_tests/python_utils/upload_test_results.py
index 09dcd57ad4..cbb4c32a2a 100644
--- a/tools/run_tests/python_utils/upload_test_results.py
+++ b/tools/run_tests/python_utils/upload_test_results.py
@@ -86,6 +86,26 @@ def _get_build_metadata(test_results):
test_results['job_name'] = job_name
+def _insert_rows_with_retries(bq, bq_table, bq_rows):
+ """Insert rows to bq table. Retry on error."""
+ # BigQuery sometimes fails with large uploads, so batch 1,000 rows at a time.
+ for i in range((len(bq_rows) / 1000) + 1):
+ max_retries = 3
+ for attempt in range(max_retries):
+ if big_query_utils.insert_rows(bq, _PROJECT_ID, _DATASET_ID,
+ bq_table,
+ bq_rows[i * 1000:(i + 1) * 1000]):
+ break
+ else:
+ if attempt < max_retries - 1:
+ print('Error uploading result to bigquery, will retry.')
+ else:
+ print(
+ 'Error uploading result to bigquery, all attempts failed.'
+ )
+ sys.exit(1)
+
+
def upload_results_to_bq(resultset, bq_table, args, platform):
"""Upload test results to a BQ table.
@@ -106,6 +126,7 @@ def upload_results_to_bq(resultset, bq_table, args, platform):
partition_type=_PARTITION_TYPE,
expiration_ms=_EXPIRATION_MS)
+ bq_rows = []
for shortname, results in six.iteritems(resultset):
for result in results:
test_results = {}
@@ -124,23 +145,9 @@ def upload_results_to_bq(resultset, bq_table, args, platform):
test_results['return_code'] = result.returncode
test_results['test_name'] = shortname
test_results['timestamp'] = time.strftime('%Y-%m-%d %H:%M:%S')
-
row = big_query_utils.make_row(str(uuid.uuid4()), test_results)
-
- # TODO(jtattermusch): rows are inserted one by one, very inefficient
- max_retries = 3
- for attempt in range(max_retries):
- if big_query_utils.insert_rows(bq, _PROJECT_ID, _DATASET_ID,
- bq_table, [row]):
- break
- else:
- if attempt < max_retries - 1:
- print('Error uploading result to bigquery, will retry.')
- else:
- print(
- 'Error uploading result to bigquery, all attempts failed.'
- )
- sys.exit(1)
+ bq_rows.append(row)
+ _insert_rows_with_retries(bq, bq_table, bq_rows)
def upload_interop_results_to_bq(resultset, bq_table, args):
@@ -162,6 +169,7 @@ def upload_interop_results_to_bq(resultset, bq_table, args):
partition_type=_PARTITION_TYPE,
expiration_ms=_EXPIRATION_MS)
+ bq_rows = []
for shortname, results in six.iteritems(resultset):
for result in results:
test_results = {}
@@ -175,17 +183,5 @@ def upload_interop_results_to_bq(resultset, bq_table, args):
test_results['test_case'] = shortname.split(':')[3]
test_results['timestamp'] = time.strftime('%Y-%m-%d %H:%M:%S')
row = big_query_utils.make_row(str(uuid.uuid4()), test_results)
- # TODO(jtattermusch): rows are inserted one by one, very inefficient
- max_retries = 3
- for attempt in range(max_retries):
- if big_query_utils.insert_rows(bq, _PROJECT_ID, _DATASET_ID,
- bq_table, [row]):
- break
- else:
- if attempt < max_retries - 1:
- print('Error uploading result to bigquery, will retry.')
- else:
- print(
- 'Error uploading result to bigquery, all attempts failed.'
- )
- sys.exit(1)
+ bq_rows.append(row)
+ _insert_rows_with_retries(bq, bq_table, bq_rows)
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py
index ea4c7c3c65..e04b13b24c 100755
--- a/tools/run_tests/run_tests.py
+++ b/tools/run_tests/run_tests.py
@@ -883,7 +883,7 @@ class RubyLanguage(object):
tests.append(
self.config.job_spec(
['tools/run_tests/helper_scripts/run_ruby_end2end_tests.sh'],
- timeout_seconds=10 * 60,
+ timeout_seconds=20 * 60,
environ=_FORCE_ENVIRON_FOR_WRAPPERS))
return tests
@@ -1114,6 +1114,12 @@ class ObjCLanguage(object):
'SCHEME': 'SwiftSample',
'EXAMPLE_PATH': 'src/objective-c/examples/SwiftSample'
}),
+ self.config.job_spec(
+ ['test/core/iomgr/ios/CFStreamTests/run_tests.sh'],
+ timeout_seconds=10 * 60,
+ shortname='cfstream-tests',
+ cpu_cost=1e6,
+ environ=_FORCE_ENVIRON_FOR_WRAPPERS),
]
def pre_build_steps(self):
@@ -1126,7 +1132,10 @@ class ObjCLanguage(object):
return []
def build_steps(self):
- return [['src/objective-c/tests/build_tests.sh']]
+ return [
+ ['src/objective-c/tests/build_tests.sh'],
+ ['test/core/iomgr/ios/CFStreamTests/build_tests.sh'],
+ ]
def post_tests_steps(self):
return []
diff --git a/tools/run_tests/sanity/check_bazel_workspace.py b/tools/run_tests/sanity/check_bazel_workspace.py
index 555149c820..d562fffc8a 100755
--- a/tools/run_tests/sanity/check_bazel_workspace.py
+++ b/tools/run_tests/sanity/check_bazel_workspace.py
@@ -47,9 +47,11 @@ _GRPC_DEP_NAMES = [
'com_google_protobuf',
'com_github_google_googletest',
'com_github_gflags_gflags',
+ 'com_github_nanopb_nanopb',
'com_github_google_benchmark',
'com_github_cares_cares',
'com_google_absl',
+ 'io_opencensus_cpp',
_BAZEL_TOOLCHAINS_DEP_NAME,
_TWISTED_TWISTED_DEP_NAME,
_YAML_PYYAML_DEP_NAME,
@@ -120,9 +122,12 @@ names_without_bazel_only_deps = names_and_urls.keys()
for dep_name in _GRPC_BAZEL_ONLY_DEPS:
names_without_bazel_only_deps.remove(dep_name)
archive_urls = [names_and_urls[name] for name in names_without_bazel_only_deps]
+# Exclude nanopb from the check: it's not a submodule for distribution reasons,
+# but it's a workspace dependency to enable users to use their own version.
workspace_git_hashes = {
re.search(git_hash_pattern, url).group()
for url in archive_urls
+ if 'nanopb' not in url
}
if len(workspace_git_hashes) == 0:
print("(Likely) parse error, did not find any bazel git dependencies.")
@@ -136,7 +141,6 @@ if len(workspace_git_hashes - git_submodule_hashes) > 0:
print(
"Found discrepancies between git submodules and Bazel WORKSPACE dependencies"
)
- sys.exit(1)
# Also check that we can override each dependency
for name in _GRPC_DEP_NAMES:
diff --git a/tools/run_tests/sanity/check_sources_and_headers.py b/tools/run_tests/sanity/check_sources_and_headers.py
deleted file mode 100755
index 57ae5c5acc..0000000000
--- a/tools/run_tests/sanity/check_sources_and_headers.py
+++ /dev/null
@@ -1,126 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2015 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from __future__ import print_function
-
-import json
-import os
-import re
-import sys
-
-root = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../../..'))
-with open(
- os.path.join(root, 'tools', 'run_tests', 'generated',
- 'sources_and_headers.json')) as f:
- js = json.loads(f.read())
-
-re_inc1 = re.compile(r'^#\s*include\s*"([^"]*)"')
-assert re_inc1.match('#include "foo"').group(1) == 'foo'
-re_inc2 = re.compile(r'^#\s*include\s*<((grpc|grpc\+\+)/[^"]*)>')
-assert re_inc2.match('#include <grpc++/foo>').group(1) == 'grpc++/foo'
-
-
-def get_target(name):
- for target in js:
- if target['name'] == name:
- return target
- assert False, 'no target %s' % name
-
-
-def get_headers_transitive():
- """Computes set of headers transitively provided by each target"""
- target_headers_transitive = {}
- for target in js:
- target_name = target['name']
- assert not target_headers_transitive.has_key(target_name)
- target_headers_transitive[target_name] = set(target['headers'])
-
- # Make sure each target's transitive headers contain those
- # of their dependencies. If not, add them and continue doing
- # so until we get a full pass over all targets without any updates.
- closure_changed = True
- while closure_changed:
- closure_changed = False
- for target in js:
- target_name = target['name']
- for dep in target['deps']:
- headers = target_headers_transitive[target_name]
- old_count = len(headers)
- headers.update(target_headers_transitive[dep])
- if old_count != len(headers):
- closure_changed = True
- return target_headers_transitive
-
-
-# precompute transitive closure of headers provided by each target
-target_headers_transitive = get_headers_transitive()
-
-
-def target_has_header(target, name):
- if name in target_headers_transitive[target['name']]:
- return True
- if name.startswith('absl/'):
- return True
- if name in [
- 'src/core/lib/profiling/stap_probes.h',
- 'src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h'
- ]:
- return True
- return False
-
-
-def produces_object(name):
- return os.path.splitext(name)[1] in ['.c', '.cc']
-
-
-c_ish = {}
-obj_producer_to_source = {'c': c_ish, 'c++': c_ish, 'csharp': {}}
-
-errors = 0
-for target in js:
- if not target['third_party']:
- for fn in target['src']:
- with open(os.path.join(root, fn)) as f:
- src = f.read().splitlines()
- for line in src:
- m = re_inc1.match(line)
- if m:
- if not target_has_header(target, m.group(1)):
- print(
- 'target %s (%s) does not name header %s as a dependency'
- % (target['name'], fn, m.group(1)))
- errors += 1
- m = re_inc2.match(line)
- if m:
- if not target_has_header(target, 'include/' + m.group(1)):
- print(
- 'target %s (%s) does not name header %s as a dependency'
- % (target['name'], fn, m.group(1)))
- errors += 1
- if target['type'] in ['lib', 'filegroup']:
- for fn in target['src']:
- language = target['language']
- if produces_object(fn):
- obj_base = os.path.splitext(os.path.basename(fn))[0]
- if obj_base in obj_producer_to_source[language]:
- if obj_producer_to_source[language][obj_base] != fn:
- print(
- 'target %s (%s) produces an aliased object file with %s'
- % (target['name'], fn,
- obj_producer_to_source[language][obj_base]))
- else:
- obj_producer_to_source[language][obj_base] = fn
-
-assert errors == 0
diff --git a/tools/run_tests/sanity/core_banned_functions.py b/tools/run_tests/sanity/core_banned_functions.py
index 1d3f2eba8a..8afd826453 100755
--- a/tools/run_tests/sanity/core_banned_functions.py
+++ b/tools/run_tests/sanity/core_banned_functions.py
@@ -30,7 +30,8 @@ BANNED_EXCEPT = {
['src/core/lib/slice/slice_buffer.cc'],
'grpc_slice_ref(': ['src/core/lib/slice/slice.cc'],
'grpc_slice_unref(': ['src/core/lib/slice/slice.cc'],
- 'grpc_error_create(': ['src/core/lib/iomgr/error.cc'],
+ 'grpc_error_create(':
+ ['src/core/lib/iomgr/error.cc', 'src/core/lib/iomgr/error_cfstream.cc'],
'grpc_error_ref(': ['src/core/lib/iomgr/error.cc'],
'grpc_error_unref(': ['src/core/lib/iomgr/error.cc'],
'grpc_os_error(': ['src/core/lib/iomgr/error.cc'],
diff --git a/tools/run_tests/sanity/sanity_tests.yaml b/tools/run_tests/sanity/sanity_tests.yaml
index a15473db0f..ac0d4c70e5 100644
--- a/tools/run_tests/sanity/sanity_tests.yaml
+++ b/tools/run_tests/sanity/sanity_tests.yaml
@@ -2,7 +2,6 @@
- script: tools/run_tests/sanity/check_bazel_workspace.py
- script: tools/run_tests/sanity/check_cache_mk.sh
- script: tools/run_tests/sanity/check_owners.sh
-- script: tools/run_tests/sanity/check_sources_and_headers.py
- script: tools/run_tests/sanity/check_shellcheck.sh
- script: tools/run_tests/sanity/check_submodules.sh
- script: tools/run_tests/sanity/check_test_filtering.py
diff --git a/vsprojects/.gitignore b/vsprojects/.gitignore
deleted file mode 100644
index 8df1dcf0bf..0000000000
--- a/vsprojects/.gitignore
+++ /dev/null
@@ -1,12 +0,0 @@
-Debug
-Debug-DLL
-Release
-Release-DLL
-*.suo
-*.user
-test_bin
-*.opensdf
-*.sdf
-third_party/*.user
-/packages
-/IntDir
diff --git a/vsprojects/README.md b/vsprojects/README.md
deleted file mode 100644
index ee32ecab9a..0000000000
--- a/vsprojects/README.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# Pre-generated MS Visual Studio project & solution files: DELETED
-
-**The pre-generated MS Visual Studio project & solution files are no longer available, please use cmake instead (it can generate Visual Studio projects for you).**
-
-**Pre-generated MS Visual Studio projects used to be the recommended way to build on Windows, but there were some limitations:**
-- **hard to build dependencies, expecially boringssl (deps usually support cmake quite well)**
-- **the nuget-based openssl & zlib dependencies are hard to maintain and update. We've received issues indicating that they are flawed.**
-- **.proto codegen is hard to support in Visual Studio directly (but we have a pretty decent support in cmake)**
-- **It's a LOT of generated files. We prefer not to have too much generated code in our github repo.**
-
-See [INSTALL.md](/INSTALL.md) for detailed instructions how to build using cmake on Windows.