aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--BUILD3
-rw-r--r--CMakeLists.txt102
-rw-r--r--Makefile106
-rw-r--r--bazel/cc_grpc_library.bzl2
-rw-r--r--bazel/generate_cc.bzl2
-rw-r--r--bazel/grpc_build_system.bzl3
-rw-r--r--build.yaml38
-rw-r--r--config.m42
-rw-r--r--config.w322
-rw-r--r--gRPC-C++.podspec2
-rw-r--r--gRPC-Core.podspec4
-rw-r--r--grpc.gemspec3
-rw-r--r--grpc.gyp8
-rw-r--r--include/grpc/impl/codegen/grpc_types.h2
-rw-r--r--include/grpc/impl/codegen/port_platform.h5
-rw-r--r--include/grpcpp/impl/codegen/call_op_set.h58
-rw-r--r--include/grpcpp/impl/codegen/client_callback.h8
-rw-r--r--include/grpcpp/impl/codegen/interceptor.h11
-rw-r--r--include/grpcpp/impl/codegen/interceptor_common.h35
-rw-r--r--package.xml3
-rw-r--r--src/core/ext/filters/client_channel/client_channel_factory.cc2
-rw-r--r--src/core/ext/filters/client_channel/client_channel_factory.h4
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/subchannel_list.h5
-rw-r--r--src/core/ext/filters/client_channel/parse_address.cc29
-rw-r--r--src/core/ext/filters/client_channel/subchannel.cc36
-rw-r--r--src/core/ext/filters/client_channel/subchannel.h15
-rw-r--r--src/core/ext/filters/client_channel/subchannel_index.cc32
-rw-r--r--src/core/ext/filters/client_channel/subchannel_index.h3
-rw-r--r--src/core/ext/transport/chttp2/client/insecure/channel_create.cc10
-rw-r--r--src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc44
-rw-r--r--src/core/lib/iomgr/combiner.cc9
-rw-r--r--src/core/lib/iomgr/ev_epoll1_linux.cc3
-rw-r--r--src/core/lib/iomgr/ev_epollex_linux.cc3
-rw-r--r--src/core/lib/iomgr/ev_poll_posix.cc3
-rw-r--r--src/core/lib/iomgr/ev_posix.cc4
-rw-r--r--src/core/lib/iomgr/ev_posix.h4
-rw-r--r--src/core/lib/iomgr/grpc_if_nametoindex.h30
-rw-r--r--src/core/lib/iomgr/grpc_if_nametoindex_posix.cc42
-rw-r--r--src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc38
-rw-r--r--src/core/lib/iomgr/iomgr.cc4
-rw-r--r--src/core/lib/iomgr/iomgr.h3
-rw-r--r--src/core/lib/iomgr/iomgr_custom.cc6
-rw-r--r--src/core/lib/iomgr/iomgr_internal.cc4
-rw-r--r--src/core/lib/iomgr/iomgr_internal.h4
-rw-r--r--src/core/lib/iomgr/iomgr_posix.cc7
-rw-r--r--src/core/lib/iomgr/iomgr_posix_cfstream.cc7
-rw-r--r--src/core/lib/iomgr/iomgr_windows.cc7
-rw-r--r--src/core/lib/iomgr/port.h1
-rw-r--r--src/core/lib/surface/channel_init.h5
-rw-r--r--src/cpp/common/channel_filter.h5
-rw-r--r--src/csharp/Grpc.Core/Interceptors/ServerServiceDefinitionExtensions.cs2
-rw-r--r--src/python/grpcio/grpc/__init__.py2
-rw-r--r--src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi2
-rw-r--r--src/python/grpcio/grpc_core_dependencies.py2
-rw-r--r--src/ruby/ext/grpc/rb_channel.c8
-rw-r--r--templates/tools/dockerfile/interoptest/grpc_interop_go1.11/Dockerfile.template23
-rw-r--r--templates/tools/dockerfile/interoptest/grpc_interop_go1.11/build_interop.sh.template3
-rw-r--r--test/core/client_channel/BUILD11
-rw-r--r--test/core/client_channel/parse_address_with_named_scope_id_test.cc126
-rw-r--r--test/core/iomgr/BUILD20
-rw-r--r--test/core/iomgr/resolve_address_posix_test.cc81
-rw-r--r--test/core/iomgr/tcp_server_posix_test.cc5
-rw-r--r--test/cpp/end2end/client_interceptors_end2end_test.cc8
-rw-r--r--test/cpp/end2end/server_interceptors_end2end_test.cc71
-rw-r--r--test/cpp/microbenchmarks/bm_call_create.cc2
-rw-r--r--test/cpp/microbenchmarks/bm_cq_multiple_threads.cc1
-rwxr-xr-xtest/cpp/qps/gen_build_yaml.py2
-rw-r--r--tools/dockerfile/interoptest/grpc_interop_go1.11/Dockerfile36
-rw-r--r--tools/dockerfile/interoptest/grpc_interop_go1.11/build_interop.sh33
-rw-r--r--tools/doxygen/Doxyfile.c++.internal1
-rw-r--r--tools/doxygen/Doxyfile.core.internal3
-rw-r--r--tools/internal_ci/helper_scripts/prepare_build_macos_rc2
-rw-r--r--tools/interop_matrix/README.md19
-rw-r--r--tools/interop_matrix/client_matrix.py619
-rwxr-xr-xtools/interop_matrix/create_matrix_images.py18
-rwxr-xr-xtools/interop_matrix/run_interop_matrix_tests.py23
-rw-r--r--tools/run_tests/generated/sources_and_headers.json38
-rw-r--r--tools/run_tests/generated/tests.json54
78 files changed, 1323 insertions, 660 deletions
diff --git a/BUILD b/BUILD
index cd23d9c91f..453c64ab08 100644
--- a/BUILD
+++ b/BUILD
@@ -732,6 +732,8 @@ grpc_cc_library(
"src/core/lib/iomgr/iomgr_posix.cc",
"src/core/lib/iomgr/iomgr_windows.cc",
"src/core/lib/iomgr/is_epollexclusive_available.cc",
+ "src/core/lib/iomgr/grpc_if_nametoindex_posix.cc",
+ "src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc",
"src/core/lib/iomgr/load_file.cc",
"src/core/lib/iomgr/lockfree_event.cc",
"src/core/lib/iomgr/network_status_tracker.cc",
@@ -873,6 +875,7 @@ grpc_cc_library(
"src/core/lib/iomgr/executor.h",
"src/core/lib/iomgr/gethostname.h",
"src/core/lib/iomgr/gevent_util.h",
+ "src/core/lib/iomgr/grpc_if_nametoindex.h",
"src/core/lib/iomgr/internal_errqueue.h",
"src/core/lib/iomgr/iocp_windows.h",
"src/core/lib/iomgr/iomgr.h",
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7e4dddab5b..38f8ad915f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -371,11 +371,17 @@ add_dependencies(buildtests_c murmur_hash_test)
add_dependencies(buildtests_c no_server_test)
add_dependencies(buildtests_c num_external_connectivity_watchers_test)
add_dependencies(buildtests_c parse_address_test)
+if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
+add_dependencies(buildtests_c parse_address_with_named_scope_id_test)
+endif()
add_dependencies(buildtests_c percent_encoding_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
-add_dependencies(buildtests_c resolve_address_posix_test)
+add_dependencies(buildtests_c resolve_address_using_ares_resolver_posix_test)
endif()
add_dependencies(buildtests_c resolve_address_using_ares_resolver_test)
+if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
+add_dependencies(buildtests_c resolve_address_using_native_resolver_posix_test)
+endif()
add_dependencies(buildtests_c resolve_address_using_native_resolver_test)
add_dependencies(buildtests_c resource_quota_test)
add_dependencies(buildtests_c secure_channel_create_test)
@@ -989,6 +995,8 @@ add_library(grpc
src/core/lib/iomgr/gethostname_fallback.cc
src/core/lib/iomgr/gethostname_host_name_max.cc
src/core/lib/iomgr/gethostname_sysconf.cc
+ src/core/lib/iomgr/grpc_if_nametoindex_posix.cc
+ src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc
src/core/lib/iomgr/internal_errqueue.cc
src/core/lib/iomgr/iocp_windows.cc
src/core/lib/iomgr/iomgr.cc
@@ -1411,6 +1419,8 @@ add_library(grpc_cronet
src/core/lib/iomgr/gethostname_fallback.cc
src/core/lib/iomgr/gethostname_host_name_max.cc
src/core/lib/iomgr/gethostname_sysconf.cc
+ src/core/lib/iomgr/grpc_if_nametoindex_posix.cc
+ src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc
src/core/lib/iomgr/internal_errqueue.cc
src/core/lib/iomgr/iocp_windows.cc
src/core/lib/iomgr/iomgr.cc
@@ -1817,6 +1827,8 @@ add_library(grpc_test_util
src/core/lib/iomgr/gethostname_fallback.cc
src/core/lib/iomgr/gethostname_host_name_max.cc
src/core/lib/iomgr/gethostname_sysconf.cc
+ src/core/lib/iomgr/grpc_if_nametoindex_posix.cc
+ src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc
src/core/lib/iomgr/internal_errqueue.cc
src/core/lib/iomgr/iocp_windows.cc
src/core/lib/iomgr/iomgr.cc
@@ -2139,6 +2151,8 @@ add_library(grpc_test_util_unsecure
src/core/lib/iomgr/gethostname_fallback.cc
src/core/lib/iomgr/gethostname_host_name_max.cc
src/core/lib/iomgr/gethostname_sysconf.cc
+ src/core/lib/iomgr/grpc_if_nametoindex_posix.cc
+ src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc
src/core/lib/iomgr/internal_errqueue.cc
src/core/lib/iomgr/iocp_windows.cc
src/core/lib/iomgr/iomgr.cc
@@ -2438,6 +2452,8 @@ add_library(grpc_unsecure
src/core/lib/iomgr/gethostname_fallback.cc
src/core/lib/iomgr/gethostname_host_name_max.cc
src/core/lib/iomgr/gethostname_sysconf.cc
+ src/core/lib/iomgr/grpc_if_nametoindex_posix.cc
+ src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc
src/core/lib/iomgr/internal_errqueue.cc
src/core/lib/iomgr/iocp_windows.cc
src/core/lib/iomgr/iomgr.cc
@@ -3323,6 +3339,8 @@ add_library(grpc++_cronet
src/core/lib/iomgr/gethostname_fallback.cc
src/core/lib/iomgr/gethostname_host_name_max.cc
src/core/lib/iomgr/gethostname_sysconf.cc
+ src/core/lib/iomgr/grpc_if_nametoindex_posix.cc
+ src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc
src/core/lib/iomgr/internal_errqueue.cc
src/core/lib/iomgr/iocp_windows.cc
src/core/lib/iomgr/iomgr.cc
@@ -9132,6 +9150,42 @@ target_link_libraries(parse_address_test
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
+if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
+
+add_executable(parse_address_with_named_scope_id_test
+ test/core/client_channel/parse_address_with_named_scope_id_test.cc
+)
+
+
+target_include_directories(parse_address_with_named_scope_id_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(parse_address_with_named_scope_id_test
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+ grpc
+ gpr
+)
+
+ # avoid dependency on libstdc++
+ if (_gRPC_CORE_NOSTDCXX_FLAGS)
+ set_target_properties(parse_address_with_named_scope_id_test PROPERTIES LINKER_LANGUAGE C)
+ target_compile_options(parse_address_with_named_scope_id_test PRIVATE $<$<COMPILE_LANGUAGE:CXX>:${_gRPC_CORE_NOSTDCXX_FLAGS}>)
+ endif()
+
+endif()
+endif (gRPC_BUILD_TESTS)
+if (gRPC_BUILD_TESTS)
add_executable(percent_encoding_test
test/core/slice/percent_encoding_test.cc
@@ -9168,12 +9222,12 @@ endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
-add_executable(resolve_address_posix_test
+add_executable(resolve_address_using_ares_resolver_posix_test
test/core/iomgr/resolve_address_posix_test.cc
)
-target_include_directories(resolve_address_posix_test
+target_include_directories(resolve_address_using_ares_resolver_posix_test
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
PRIVATE ${_gRPC_SSL_INCLUDE_DIR}
@@ -9186,7 +9240,7 @@ target_include_directories(resolve_address_posix_test
PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR}
)
-target_link_libraries(resolve_address_posix_test
+target_link_libraries(resolve_address_using_ares_resolver_posix_test
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
grpc
@@ -9195,8 +9249,8 @@ target_link_libraries(resolve_address_posix_test
# avoid dependency on libstdc++
if (_gRPC_CORE_NOSTDCXX_FLAGS)
- set_target_properties(resolve_address_posix_test PROPERTIES LINKER_LANGUAGE C)
- target_compile_options(resolve_address_posix_test PRIVATE $<$<COMPILE_LANGUAGE:CXX>:${_gRPC_CORE_NOSTDCXX_FLAGS}>)
+ set_target_properties(resolve_address_using_ares_resolver_posix_test PROPERTIES LINKER_LANGUAGE C)
+ target_compile_options(resolve_address_using_ares_resolver_posix_test PRIVATE $<$<COMPILE_LANGUAGE:CXX>:${_gRPC_CORE_NOSTDCXX_FLAGS}>)
endif()
endif()
@@ -9236,6 +9290,42 @@ target_link_libraries(resolve_address_using_ares_resolver_test
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
+if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
+
+add_executable(resolve_address_using_native_resolver_posix_test
+ test/core/iomgr/resolve_address_posix_test.cc
+)
+
+
+target_include_directories(resolve_address_using_native_resolver_posix_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(resolve_address_using_native_resolver_posix_test
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+ grpc
+ gpr
+)
+
+ # avoid dependency on libstdc++
+ if (_gRPC_CORE_NOSTDCXX_FLAGS)
+ set_target_properties(resolve_address_using_native_resolver_posix_test PROPERTIES LINKER_LANGUAGE C)
+ target_compile_options(resolve_address_using_native_resolver_posix_test PRIVATE $<$<COMPILE_LANGUAGE:CXX>:${_gRPC_CORE_NOSTDCXX_FLAGS}>)
+ endif()
+
+endif()
+endif (gRPC_BUILD_TESTS)
+if (gRPC_BUILD_TESTS)
add_executable(resolve_address_using_native_resolver_test
test/core/iomgr/resolve_address_test.cc
diff --git a/Makefile b/Makefile
index ce56482a0d..504ef40963 100644
--- a/Makefile
+++ b/Makefile
@@ -1076,11 +1076,13 @@ nanopb_fuzzer_serverlist_test: $(BINDIR)/$(CONFIG)/nanopb_fuzzer_serverlist_test
no_server_test: $(BINDIR)/$(CONFIG)/no_server_test
num_external_connectivity_watchers_test: $(BINDIR)/$(CONFIG)/num_external_connectivity_watchers_test
parse_address_test: $(BINDIR)/$(CONFIG)/parse_address_test
+parse_address_with_named_scope_id_test: $(BINDIR)/$(CONFIG)/parse_address_with_named_scope_id_test
percent_decode_fuzzer: $(BINDIR)/$(CONFIG)/percent_decode_fuzzer
percent_encode_fuzzer: $(BINDIR)/$(CONFIG)/percent_encode_fuzzer
percent_encoding_test: $(BINDIR)/$(CONFIG)/percent_encoding_test
-resolve_address_posix_test: $(BINDIR)/$(CONFIG)/resolve_address_posix_test
+resolve_address_using_ares_resolver_posix_test: $(BINDIR)/$(CONFIG)/resolve_address_using_ares_resolver_posix_test
resolve_address_using_ares_resolver_test: $(BINDIR)/$(CONFIG)/resolve_address_using_ares_resolver_test
+resolve_address_using_native_resolver_posix_test: $(BINDIR)/$(CONFIG)/resolve_address_using_native_resolver_posix_test
resolve_address_using_native_resolver_test: $(BINDIR)/$(CONFIG)/resolve_address_using_native_resolver_test
resource_quota_test: $(BINDIR)/$(CONFIG)/resource_quota_test
secure_channel_create_test: $(BINDIR)/$(CONFIG)/secure_channel_create_test
@@ -1527,9 +1529,11 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/no_server_test \
$(BINDIR)/$(CONFIG)/num_external_connectivity_watchers_test \
$(BINDIR)/$(CONFIG)/parse_address_test \
+ $(BINDIR)/$(CONFIG)/parse_address_with_named_scope_id_test \
$(BINDIR)/$(CONFIG)/percent_encoding_test \
- $(BINDIR)/$(CONFIG)/resolve_address_posix_test \
+ $(BINDIR)/$(CONFIG)/resolve_address_using_ares_resolver_posix_test \
$(BINDIR)/$(CONFIG)/resolve_address_using_ares_resolver_test \
+ $(BINDIR)/$(CONFIG)/resolve_address_using_native_resolver_posix_test \
$(BINDIR)/$(CONFIG)/resolve_address_using_native_resolver_test \
$(BINDIR)/$(CONFIG)/resource_quota_test \
$(BINDIR)/$(CONFIG)/secure_channel_create_test \
@@ -2129,12 +2133,16 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/num_external_connectivity_watchers_test || ( echo test num_external_connectivity_watchers_test failed ; exit 1 )
$(E) "[RUN] Testing parse_address_test"
$(Q) $(BINDIR)/$(CONFIG)/parse_address_test || ( echo test parse_address_test failed ; exit 1 )
+ $(E) "[RUN] Testing parse_address_with_named_scope_id_test"
+ $(Q) $(BINDIR)/$(CONFIG)/parse_address_with_named_scope_id_test || ( echo test parse_address_with_named_scope_id_test failed ; exit 1 )
$(E) "[RUN] Testing percent_encoding_test"
$(Q) $(BINDIR)/$(CONFIG)/percent_encoding_test || ( echo test percent_encoding_test failed ; exit 1 )
- $(E) "[RUN] Testing resolve_address_posix_test"
- $(Q) $(BINDIR)/$(CONFIG)/resolve_address_posix_test || ( echo test resolve_address_posix_test failed ; exit 1 )
+ $(E) "[RUN] Testing resolve_address_using_ares_resolver_posix_test"
+ $(Q) $(BINDIR)/$(CONFIG)/resolve_address_using_ares_resolver_posix_test || ( echo test resolve_address_using_ares_resolver_posix_test failed ; exit 1 )
$(E) "[RUN] Testing resolve_address_using_ares_resolver_test"
$(Q) $(BINDIR)/$(CONFIG)/resolve_address_using_ares_resolver_test || ( echo test resolve_address_using_ares_resolver_test failed ; exit 1 )
+ $(E) "[RUN] Testing resolve_address_using_native_resolver_posix_test"
+ $(Q) $(BINDIR)/$(CONFIG)/resolve_address_using_native_resolver_posix_test || ( echo test resolve_address_using_native_resolver_posix_test failed ; exit 1 )
$(E) "[RUN] Testing resolve_address_using_native_resolver_test"
$(Q) $(BINDIR)/$(CONFIG)/resolve_address_using_native_resolver_test || ( echo test resolve_address_using_native_resolver_test failed ; exit 1 )
$(E) "[RUN] Testing resource_quota_test"
@@ -3504,6 +3512,8 @@ LIBGRPC_SRC = \
src/core/lib/iomgr/gethostname_fallback.cc \
src/core/lib/iomgr/gethostname_host_name_max.cc \
src/core/lib/iomgr/gethostname_sysconf.cc \
+ src/core/lib/iomgr/grpc_if_nametoindex_posix.cc \
+ src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc \
src/core/lib/iomgr/internal_errqueue.cc \
src/core/lib/iomgr/iocp_windows.cc \
src/core/lib/iomgr/iomgr.cc \
@@ -3920,6 +3930,8 @@ LIBGRPC_CRONET_SRC = \
src/core/lib/iomgr/gethostname_fallback.cc \
src/core/lib/iomgr/gethostname_host_name_max.cc \
src/core/lib/iomgr/gethostname_sysconf.cc \
+ src/core/lib/iomgr/grpc_if_nametoindex_posix.cc \
+ src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc \
src/core/lib/iomgr/internal_errqueue.cc \
src/core/lib/iomgr/iocp_windows.cc \
src/core/lib/iomgr/iomgr.cc \
@@ -4319,6 +4331,8 @@ LIBGRPC_TEST_UTIL_SRC = \
src/core/lib/iomgr/gethostname_fallback.cc \
src/core/lib/iomgr/gethostname_host_name_max.cc \
src/core/lib/iomgr/gethostname_sysconf.cc \
+ src/core/lib/iomgr/grpc_if_nametoindex_posix.cc \
+ src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc \
src/core/lib/iomgr/internal_errqueue.cc \
src/core/lib/iomgr/iocp_windows.cc \
src/core/lib/iomgr/iomgr.cc \
@@ -4628,6 +4642,8 @@ LIBGRPC_TEST_UTIL_UNSECURE_SRC = \
src/core/lib/iomgr/gethostname_fallback.cc \
src/core/lib/iomgr/gethostname_host_name_max.cc \
src/core/lib/iomgr/gethostname_sysconf.cc \
+ src/core/lib/iomgr/grpc_if_nametoindex_posix.cc \
+ src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc \
src/core/lib/iomgr/internal_errqueue.cc \
src/core/lib/iomgr/iocp_windows.cc \
src/core/lib/iomgr/iomgr.cc \
@@ -4901,6 +4917,8 @@ LIBGRPC_UNSECURE_SRC = \
src/core/lib/iomgr/gethostname_fallback.cc \
src/core/lib/iomgr/gethostname_host_name_max.cc \
src/core/lib/iomgr/gethostname_sysconf.cc \
+ src/core/lib/iomgr/grpc_if_nametoindex_posix.cc \
+ src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc \
src/core/lib/iomgr/internal_errqueue.cc \
src/core/lib/iomgr/iocp_windows.cc \
src/core/lib/iomgr/iomgr.cc \
@@ -5763,6 +5781,8 @@ LIBGRPC++_CRONET_SRC = \
src/core/lib/iomgr/gethostname_fallback.cc \
src/core/lib/iomgr/gethostname_host_name_max.cc \
src/core/lib/iomgr/gethostname_sysconf.cc \
+ src/core/lib/iomgr/grpc_if_nametoindex_posix.cc \
+ src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc \
src/core/lib/iomgr/internal_errqueue.cc \
src/core/lib/iomgr/iocp_windows.cc \
src/core/lib/iomgr/iomgr.cc \
@@ -13988,6 +14008,38 @@ endif
endif
+PARSE_ADDRESS_WITH_NAMED_SCOPE_ID_TEST_SRC = \
+ test/core/client_channel/parse_address_with_named_scope_id_test.cc \
+
+PARSE_ADDRESS_WITH_NAMED_SCOPE_ID_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(PARSE_ADDRESS_WITH_NAMED_SCOPE_ID_TEST_SRC))))
+ifeq ($(NO_SECURE),true)
+
+# You can't build secure targets if you don't have OpenSSL.
+
+$(BINDIR)/$(CONFIG)/parse_address_with_named_scope_id_test: openssl_dep_error
+
+else
+
+
+
+$(BINDIR)/$(CONFIG)/parse_address_with_named_scope_id_test: $(PARSE_ADDRESS_WITH_NAMED_SCOPE_ID_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
+ $(E) "[LD] Linking $@"
+ $(Q) mkdir -p `dirname $@`
+ $(Q) $(LD) $(LDFLAGS) $(PARSE_ADDRESS_WITH_NAMED_SCOPE_ID_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/parse_address_with_named_scope_id_test
+
+endif
+
+$(OBJDIR)/$(CONFIG)/test/core/client_channel/parse_address_with_named_scope_id_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
+
+deps_parse_address_with_named_scope_id_test: $(PARSE_ADDRESS_WITH_NAMED_SCOPE_ID_TEST_OBJS:.o=.dep)
+
+ifneq ($(NO_SECURE),true)
+ifneq ($(NO_DEPS),true)
+-include $(PARSE_ADDRESS_WITH_NAMED_SCOPE_ID_TEST_OBJS:.o=.dep)
+endif
+endif
+
+
PERCENT_DECODE_FUZZER_SRC = \
test/core/slice/percent_decode_fuzzer.cc \
@@ -14084,34 +14136,34 @@ endif
endif
-RESOLVE_ADDRESS_POSIX_TEST_SRC = \
+RESOLVE_ADDRESS_USING_ARES_RESOLVER_POSIX_TEST_SRC = \
test/core/iomgr/resolve_address_posix_test.cc \
-RESOLVE_ADDRESS_POSIX_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(RESOLVE_ADDRESS_POSIX_TEST_SRC))))
+RESOLVE_ADDRESS_USING_ARES_RESOLVER_POSIX_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(RESOLVE_ADDRESS_USING_ARES_RESOLVER_POSIX_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
-$(BINDIR)/$(CONFIG)/resolve_address_posix_test: openssl_dep_error
+$(BINDIR)/$(CONFIG)/resolve_address_using_ares_resolver_posix_test: openssl_dep_error
else
-$(BINDIR)/$(CONFIG)/resolve_address_posix_test: $(RESOLVE_ADDRESS_POSIX_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
+$(BINDIR)/$(CONFIG)/resolve_address_using_ares_resolver_posix_test: $(RESOLVE_ADDRESS_USING_ARES_RESOLVER_POSIX_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
- $(Q) $(LD) $(LDFLAGS) $(RESOLVE_ADDRESS_POSIX_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/resolve_address_posix_test
+ $(Q) $(LD) $(LDFLAGS) $(RESOLVE_ADDRESS_USING_ARES_RESOLVER_POSIX_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/resolve_address_using_ares_resolver_posix_test
endif
$(OBJDIR)/$(CONFIG)/test/core/iomgr/resolve_address_posix_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
-deps_resolve_address_posix_test: $(RESOLVE_ADDRESS_POSIX_TEST_OBJS:.o=.dep)
+deps_resolve_address_using_ares_resolver_posix_test: $(RESOLVE_ADDRESS_USING_ARES_RESOLVER_POSIX_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
--include $(RESOLVE_ADDRESS_POSIX_TEST_OBJS:.o=.dep)
+-include $(RESOLVE_ADDRESS_USING_ARES_RESOLVER_POSIX_TEST_OBJS:.o=.dep)
endif
endif
@@ -14148,6 +14200,38 @@ endif
endif
+RESOLVE_ADDRESS_USING_NATIVE_RESOLVER_POSIX_TEST_SRC = \
+ test/core/iomgr/resolve_address_posix_test.cc \
+
+RESOLVE_ADDRESS_USING_NATIVE_RESOLVER_POSIX_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(RESOLVE_ADDRESS_USING_NATIVE_RESOLVER_POSIX_TEST_SRC))))
+ifeq ($(NO_SECURE),true)
+
+# You can't build secure targets if you don't have OpenSSL.
+
+$(BINDIR)/$(CONFIG)/resolve_address_using_native_resolver_posix_test: openssl_dep_error
+
+else
+
+
+
+$(BINDIR)/$(CONFIG)/resolve_address_using_native_resolver_posix_test: $(RESOLVE_ADDRESS_USING_NATIVE_RESOLVER_POSIX_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
+ $(E) "[LD] Linking $@"
+ $(Q) mkdir -p `dirname $@`
+ $(Q) $(LD) $(LDFLAGS) $(RESOLVE_ADDRESS_USING_NATIVE_RESOLVER_POSIX_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/resolve_address_using_native_resolver_posix_test
+
+endif
+
+$(OBJDIR)/$(CONFIG)/test/core/iomgr/resolve_address_posix_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
+
+deps_resolve_address_using_native_resolver_posix_test: $(RESOLVE_ADDRESS_USING_NATIVE_RESOLVER_POSIX_TEST_OBJS:.o=.dep)
+
+ifneq ($(NO_SECURE),true)
+ifneq ($(NO_DEPS),true)
+-include $(RESOLVE_ADDRESS_USING_NATIVE_RESOLVER_POSIX_TEST_OBJS:.o=.dep)
+endif
+endif
+
+
RESOLVE_ADDRESS_USING_NATIVE_RESOLVER_TEST_SRC = \
test/core/iomgr/resolve_address_test.cc \
diff --git a/bazel/cc_grpc_library.bzl b/bazel/cc_grpc_library.bzl
index 3288565714..6bfcd653f5 100644
--- a/bazel/cc_grpc_library.bzl
+++ b/bazel/cc_grpc_library.bzl
@@ -1,6 +1,6 @@
"""Generates and compiles C++ grpc stubs from proto_library rules."""
-load("//:bazel/generate_cc.bzl", "generate_cc")
+load("//bazel:generate_cc.bzl", "generate_cc")
def cc_grpc_library(name, srcs, deps, proto_only, well_known_protos, generate_mocks = False, use_external = False, **kwargs):
"""Generates C++ grpc classes from a .proto file.
diff --git a/bazel/generate_cc.bzl b/bazel/generate_cc.bzl
index ae747aa42c..2f14071f92 100644
--- a/bazel/generate_cc.bzl
+++ b/bazel/generate_cc.bzl
@@ -83,7 +83,7 @@ _generate_cc = rule(
attrs = {
"srcs": attr.label_list(
mandatory = True,
- non_empty = True,
+ allow_empty = False,
providers = ["proto"],
),
"plugin": attr.label(
diff --git a/bazel/grpc_build_system.bzl b/bazel/grpc_build_system.bzl
index 65fe5a10aa..caeafc76b6 100644
--- a/bazel/grpc_build_system.bzl
+++ b/bazel/grpc_build_system.bzl
@@ -23,6 +23,8 @@
# each change must be ported from one to the other.
#
+load("//bazel:cc_grpc_library.bzl", "cc_grpc_library")
+
# The set of pollers to test against if a test exercises polling
POLLERS = ["epollex", "epoll1", "poll", "poll-cv"]
@@ -111,7 +113,6 @@ def grpc_proto_plugin(name, srcs = [], deps = []):
deps = deps,
)
-load("//:bazel/cc_grpc_library.bzl", "cc_grpc_library")
def grpc_proto_library(
name,
diff --git a/build.yaml b/build.yaml
index 4ccc452ed5..28375c8258 100644
--- a/build.yaml
+++ b/build.yaml
@@ -276,6 +276,8 @@ filegroups:
- src/core/lib/iomgr/gethostname_fallback.cc
- src/core/lib/iomgr/gethostname_host_name_max.cc
- src/core/lib/iomgr/gethostname_sysconf.cc
+ - src/core/lib/iomgr/grpc_if_nametoindex_posix.cc
+ - src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc
- src/core/lib/iomgr/internal_errqueue.cc
- src/core/lib/iomgr/iocp_windows.cc
- src/core/lib/iomgr/iomgr.cc
@@ -452,6 +454,7 @@ filegroups:
- src/core/lib/iomgr/exec_ctx.h
- src/core/lib/iomgr/executor.h
- src/core/lib/iomgr/gethostname.h
+ - src/core/lib/iomgr/grpc_if_nametoindex.h
- src/core/lib/iomgr/internal_errqueue.h
- src/core/lib/iomgr/iocp_windows.h
- src/core/lib/iomgr/iomgr.h
@@ -3241,6 +3244,20 @@ targets:
- grpc
- gpr
uses_polling: false
+- name: parse_address_with_named_scope_id_test
+ build: test
+ language: c
+ src:
+ - test/core/client_channel/parse_address_with_named_scope_id_test.cc
+ deps:
+ - grpc_test_util
+ - grpc
+ - gpr
+ platforms:
+ - mac
+ - linux
+ - posix
+ uses_polling: false
- name: percent_decode_fuzzer
build: fuzzer
language: c
@@ -3275,7 +3292,7 @@ targets:
- grpc
- gpr
uses_polling: false
-- name: resolve_address_posix_test
+- name: resolve_address_using_ares_resolver_posix_test
build: test
language: c
src:
@@ -3284,6 +3301,8 @@ targets:
- grpc_test_util
- grpc
- gpr
+ args:
+ - --resolver=ares
exclude_iomgrs:
- uv
platforms:
@@ -3301,6 +3320,23 @@ targets:
- gpr
args:
- --resolver=ares
+- name: resolve_address_using_native_resolver_posix_test
+ build: test
+ language: c
+ src:
+ - test/core/iomgr/resolve_address_posix_test.cc
+ deps:
+ - grpc_test_util
+ - grpc
+ - gpr
+ args:
+ - --resolver=native
+ exclude_iomgrs:
+ - uv
+ platforms:
+ - mac
+ - linux
+ - posix
- name: resolve_address_using_native_resolver_test
build: test
language: c
diff --git a/config.m4 b/config.m4
index 25ffe2148a..3c3c0210d8 100644
--- a/config.m4
+++ b/config.m4
@@ -128,6 +128,8 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/iomgr/gethostname_fallback.cc \
src/core/lib/iomgr/gethostname_host_name_max.cc \
src/core/lib/iomgr/gethostname_sysconf.cc \
+ src/core/lib/iomgr/grpc_if_nametoindex_posix.cc \
+ src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc \
src/core/lib/iomgr/internal_errqueue.cc \
src/core/lib/iomgr/iocp_windows.cc \
src/core/lib/iomgr/iomgr.cc \
diff --git a/config.w32 b/config.w32
index b6e71dd09a..f87859ad09 100644
--- a/config.w32
+++ b/config.w32
@@ -103,6 +103,8 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\iomgr\\gethostname_fallback.cc " +
"src\\core\\lib\\iomgr\\gethostname_host_name_max.cc " +
"src\\core\\lib\\iomgr\\gethostname_sysconf.cc " +
+ "src\\core\\lib\\iomgr\\grpc_if_nametoindex_posix.cc " +
+ "src\\core\\lib\\iomgr\\grpc_if_nametoindex_unsupported.cc " +
"src\\core\\lib\\iomgr\\internal_errqueue.cc " +
"src\\core\\lib\\iomgr\\iocp_windows.cc " +
"src\\core\\lib\\iomgr\\iomgr.cc " +
diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec
index e830958f79..4e0a471fb4 100644
--- a/gRPC-C++.podspec
+++ b/gRPC-C++.podspec
@@ -423,6 +423,7 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/exec_ctx.h',
'src/core/lib/iomgr/executor.h',
'src/core/lib/iomgr/gethostname.h',
+ 'src/core/lib/iomgr/grpc_if_nametoindex.h',
'src/core/lib/iomgr/internal_errqueue.h',
'src/core/lib/iomgr/iocp_windows.h',
'src/core/lib/iomgr/iomgr.h',
@@ -616,6 +617,7 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/exec_ctx.h',
'src/core/lib/iomgr/executor.h',
'src/core/lib/iomgr/gethostname.h',
+ 'src/core/lib/iomgr/grpc_if_nametoindex.h',
'src/core/lib/iomgr/internal_errqueue.h',
'src/core/lib/iomgr/iocp_windows.h',
'src/core/lib/iomgr/iomgr.h',
diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec
index 7ddef6aa44..4e4c866241 100644
--- a/gRPC-Core.podspec
+++ b/gRPC-Core.podspec
@@ -417,6 +417,7 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/exec_ctx.h',
'src/core/lib/iomgr/executor.h',
'src/core/lib/iomgr/gethostname.h',
+ 'src/core/lib/iomgr/grpc_if_nametoindex.h',
'src/core/lib/iomgr/internal_errqueue.h',
'src/core/lib/iomgr/iocp_windows.h',
'src/core/lib/iomgr/iomgr.h',
@@ -571,6 +572,8 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/gethostname_fallback.cc',
'src/core/lib/iomgr/gethostname_host_name_max.cc',
'src/core/lib/iomgr/gethostname_sysconf.cc',
+ 'src/core/lib/iomgr/grpc_if_nametoindex_posix.cc',
+ 'src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc',
'src/core/lib/iomgr/internal_errqueue.cc',
'src/core/lib/iomgr/iocp_windows.cc',
'src/core/lib/iomgr/iomgr.cc',
@@ -1040,6 +1043,7 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/exec_ctx.h',
'src/core/lib/iomgr/executor.h',
'src/core/lib/iomgr/gethostname.h',
+ 'src/core/lib/iomgr/grpc_if_nametoindex.h',
'src/core/lib/iomgr/internal_errqueue.h',
'src/core/lib/iomgr/iocp_windows.h',
'src/core/lib/iomgr/iomgr.h',
diff --git a/grpc.gemspec b/grpc.gemspec
index 3c680b044f..42b1db35b4 100644
--- a/grpc.gemspec
+++ b/grpc.gemspec
@@ -353,6 +353,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/iomgr/exec_ctx.h )
s.files += %w( src/core/lib/iomgr/executor.h )
s.files += %w( src/core/lib/iomgr/gethostname.h )
+ s.files += %w( src/core/lib/iomgr/grpc_if_nametoindex.h )
s.files += %w( src/core/lib/iomgr/internal_errqueue.h )
s.files += %w( src/core/lib/iomgr/iocp_windows.h )
s.files += %w( src/core/lib/iomgr/iomgr.h )
@@ -507,6 +508,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/iomgr/gethostname_fallback.cc )
s.files += %w( src/core/lib/iomgr/gethostname_host_name_max.cc )
s.files += %w( src/core/lib/iomgr/gethostname_sysconf.cc )
+ s.files += %w( src/core/lib/iomgr/grpc_if_nametoindex_posix.cc )
+ s.files += %w( src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc )
s.files += %w( src/core/lib/iomgr/internal_errqueue.cc )
s.files += %w( src/core/lib/iomgr/iocp_windows.cc )
s.files += %w( src/core/lib/iomgr/iomgr.cc )
diff --git a/grpc.gyp b/grpc.gyp
index 80b6d0315a..13b9c1bc78 100644
--- a/grpc.gyp
+++ b/grpc.gyp
@@ -310,6 +310,8 @@
'src/core/lib/iomgr/gethostname_fallback.cc',
'src/core/lib/iomgr/gethostname_host_name_max.cc',
'src/core/lib/iomgr/gethostname_sysconf.cc',
+ 'src/core/lib/iomgr/grpc_if_nametoindex_posix.cc',
+ 'src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc',
'src/core/lib/iomgr/internal_errqueue.cc',
'src/core/lib/iomgr/iocp_windows.cc',
'src/core/lib/iomgr/iomgr.cc',
@@ -672,6 +674,8 @@
'src/core/lib/iomgr/gethostname_fallback.cc',
'src/core/lib/iomgr/gethostname_host_name_max.cc',
'src/core/lib/iomgr/gethostname_sysconf.cc',
+ 'src/core/lib/iomgr/grpc_if_nametoindex_posix.cc',
+ 'src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc',
'src/core/lib/iomgr/internal_errqueue.cc',
'src/core/lib/iomgr/iocp_windows.cc',
'src/core/lib/iomgr/iomgr.cc',
@@ -914,6 +918,8 @@
'src/core/lib/iomgr/gethostname_fallback.cc',
'src/core/lib/iomgr/gethostname_host_name_max.cc',
'src/core/lib/iomgr/gethostname_sysconf.cc',
+ 'src/core/lib/iomgr/grpc_if_nametoindex_posix.cc',
+ 'src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc',
'src/core/lib/iomgr/internal_errqueue.cc',
'src/core/lib/iomgr/iocp_windows.cc',
'src/core/lib/iomgr/iomgr.cc',
@@ -1133,6 +1139,8 @@
'src/core/lib/iomgr/gethostname_fallback.cc',
'src/core/lib/iomgr/gethostname_host_name_max.cc',
'src/core/lib/iomgr/gethostname_sysconf.cc',
+ 'src/core/lib/iomgr/grpc_if_nametoindex_posix.cc',
+ 'src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc',
'src/core/lib/iomgr/internal_errqueue.cc',
'src/core/lib/iomgr/iocp_windows.cc',
'src/core/lib/iomgr/iomgr.cc',
diff --git a/include/grpc/impl/codegen/grpc_types.h b/include/grpc/impl/codegen/grpc_types.h
index 610548b5f3..5d577eb855 100644
--- a/include/grpc/impl/codegen/grpc_types.h
+++ b/include/grpc/impl/codegen/grpc_types.h
@@ -163,7 +163,7 @@ typedef struct {
/** Maximum time that a channel may exist. Int valued, milliseconds.
* INT_MAX means unlimited. */
#define GRPC_ARG_MAX_CONNECTION_AGE_MS "grpc.max_connection_age_ms"
-/** Grace period after the chennel reaches its max age. Int valued,
+/** Grace period after the channel reaches its max age. Int valued,
milliseconds. INT_MAX means unlimited. */
#define GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS "grpc.max_connection_age_grace_ms"
/** Enable/disable support for per-message compression. Defaults to 1, unless
diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h
index 031c0c36ae..aaeb23694e 100644
--- a/include/grpc/impl/codegen/port_platform.h
+++ b/include/grpc/impl/codegen/port_platform.h
@@ -121,6 +121,7 @@
#else /* _LP64 */
#define GPR_ARCH_32 1
#endif /* _LP64 */
+#include <linux/version.h>
#elif defined(ANDROID) || defined(__ANDROID__)
#define GPR_PLATFORM_STRING "android"
#define GPR_ANDROID 1
@@ -465,6 +466,10 @@ typedef unsigned __int64 uint64_t;
#define GRPC_ARES 1
#endif
+#ifndef GRPC_IF_NAMETOINDEX
+#define GRPC_IF_NAMETOINDEX 1
+#endif
+
#ifndef GRPC_MUST_USE_RESULT
#if defined(__GNUC__) && !defined(__MINGW32__)
#define GRPC_MUST_USE_RESULT __attribute__((warn_unused_result))
diff --git a/include/grpcpp/impl/codegen/call_op_set.h b/include/grpcpp/impl/codegen/call_op_set.h
index 1c75560c04..c0de5ed602 100644
--- a/include/grpcpp/impl/codegen/call_op_set.h
+++ b/include/grpcpp/impl/codegen/call_op_set.h
@@ -317,7 +317,15 @@ class CallOpSendMessage {
protected:
void AddOp(grpc_op* ops, size_t* nops) {
- if (!send_buf_.Valid() || hijacked_) return;
+ if (msg_ == nullptr && !send_buf_.Valid()) return;
+ if (hijacked_) {
+ serializer_ = nullptr;
+ return;
+ }
+ if (msg_ != nullptr) {
+ GPR_CODEGEN_ASSERT(serializer_(msg_).ok());
+ }
+ serializer_ = nullptr;
grpc_op* op = &ops[(*nops)++];
op->op = GRPC_OP_SEND_MESSAGE;
op->flags = write_options_.flags();
@@ -327,9 +335,7 @@ class CallOpSendMessage {
write_options_.Clear();
}
void FinishOp(bool* status) {
- if (!send_buf_.Valid()) {
- return;
- }
+ if (msg_ == nullptr && !send_buf_.Valid()) return;
if (hijacked_ && failed_send_) {
// Hijacking interceptor failed this Op
*status = false;
@@ -341,22 +347,25 @@ class CallOpSendMessage {
void SetInterceptionHookPoint(
InterceptorBatchMethodsImpl* interceptor_methods) {
- if (!send_buf_.Valid()) return;
+ if (msg_ == nullptr && !send_buf_.Valid()) return;
interceptor_methods->AddInterceptionHookPoint(
experimental::InterceptionHookPoints::PRE_SEND_MESSAGE);
- interceptor_methods->SetSendMessage(&send_buf_, msg_, &failed_send_);
+ interceptor_methods->SetSendMessage(&send_buf_, &msg_, &failed_send_,
+ serializer_);
}
void SetFinishInterceptionHookPoint(
InterceptorBatchMethodsImpl* interceptor_methods) {
- if (send_buf_.Valid()) {
+ if (msg_ != nullptr || send_buf_.Valid()) {
interceptor_methods->AddInterceptionHookPoint(
experimental::InterceptionHookPoints::POST_SEND_MESSAGE);
}
send_buf_.Clear();
+ msg_ = nullptr;
// The contents of the SendMessage value that was previously set
// has had its references stolen by core's operations
- interceptor_methods->SetSendMessage(nullptr, nullptr, &failed_send_);
+ interceptor_methods->SetSendMessage(nullptr, nullptr, &failed_send_,
+ nullptr);
}
void SetHijackingState(InterceptorBatchMethodsImpl* interceptor_methods) {
@@ -369,22 +378,33 @@ class CallOpSendMessage {
bool failed_send_ = false;
ByteBuffer send_buf_;
WriteOptions write_options_;
+ std::function<Status(const void*)> serializer_;
};
template <class M>
Status CallOpSendMessage::SendMessage(const M& message, WriteOptions options) {
write_options_ = options;
- bool own_buf;
- // TODO(vjpai): Remove the void below when possible
- // The void in the template parameter below should not be needed
- // (since it should be implicit) but is needed due to an observed
- // difference in behavior between clang and gcc for certain internal users
- Status result = SerializationTraits<M, void>::Serialize(
- message, send_buf_.bbuf_ptr(), &own_buf);
- if (!own_buf) {
- send_buf_.Duplicate();
- }
- return result;
+ serializer_ = [this](const void* message) {
+ bool own_buf;
+ send_buf_.Clear();
+ // TODO(vjpai): Remove the void below when possible
+ // The void in the template parameter below should not be needed
+ // (since it should be implicit) but is needed due to an observed
+ // difference in behavior between clang and gcc for certain internal users
+ Status result = SerializationTraits<M, void>::Serialize(
+ *static_cast<const M*>(message), send_buf_.bbuf_ptr(), &own_buf);
+ if (!own_buf) {
+ send_buf_.Duplicate();
+ }
+ return result;
+ };
+ // Serialize immediately only if we do not have access to the message pointer
+ if (msg_ == nullptr) {
+ Status result = serializer_(&message);
+ serializer_ = nullptr;
+ return result;
+ }
+ return Status();
}
template <class M>
diff --git a/include/grpcpp/impl/codegen/client_callback.h b/include/grpcpp/impl/codegen/client_callback.h
index c20e845810..52bcea9970 100644
--- a/include/grpcpp/impl/codegen/client_callback.h
+++ b/include/grpcpp/impl/codegen/client_callback.h
@@ -340,13 +340,13 @@ class ClientCallbackReaderWriterImpl
context_->initial_metadata_flags());
start_corked_ = false;
}
- // TODO(vjpai): don't assert
- GPR_CODEGEN_ASSERT(write_ops_.SendMessagePtr(msg).ok());
if (options.is_last_message()) {
options.set_buffer_hint();
write_ops_.ClientSendClose();
}
+ // TODO(vjpai): don't assert
+ GPR_CODEGEN_ASSERT(write_ops_.SendMessagePtr(msg, options).ok());
callbacks_outstanding_++;
if (started_) {
call_.PerformOps(&write_ops_);
@@ -649,13 +649,13 @@ class ClientCallbackWriterImpl
context_->initial_metadata_flags());
start_corked_ = false;
}
- // TODO(vjpai): don't assert
- GPR_CODEGEN_ASSERT(write_ops_.SendMessagePtr(msg).ok());
if (options.is_last_message()) {
options.set_buffer_hint();
write_ops_.ClientSendClose();
}
+ // TODO(vjpai): don't assert
+ GPR_CODEGEN_ASSERT(write_ops_.SendMessagePtr(msg, options).ok());
callbacks_outstanding_++;
if (started_) {
call_.PerformOps(&write_ops_);
diff --git a/include/grpcpp/impl/codegen/interceptor.h b/include/grpcpp/impl/codegen/interceptor.h
index a57a3fccbb..5dea796a3b 100644
--- a/include/grpcpp/impl/codegen/interceptor.h
+++ b/include/grpcpp/impl/codegen/interceptor.h
@@ -112,12 +112,19 @@ class InterceptorBatchMethods {
/// A return value of nullptr indicates that this ByteBuffer is not valid.
virtual ByteBuffer* GetSerializedSendMessage() = 0;
- /// Returns a non-modifiable pointer to the original non-serialized form of
- /// the message. Valid for PRE_SEND_MESSAGE interceptions. A return value of
+ /// Returns a non-modifiable pointer to the non-serialized form of the message
+ /// to be sent. Valid for PRE_SEND_MESSAGE interceptions. A return value of
/// nullptr indicates that this field is not valid. Also note that this is
/// only supported for sync and callback APIs at the present moment.
virtual const void* GetSendMessage() = 0;
+ /// Overwrites the message to be sent with \a message. \a message should be in
+ /// the non-serialized form expected by the method. Valid for PRE_SEND_MESSAGE
+ /// interceptions. Note that the interceptor is responsible for maintaining
+ /// the life of the message for the duration on the send operation, i.e., till
+ /// POST_SEND_MESSAGE.
+ virtual void ModifySendMessage(const void* message) = 0;
+
/// Checks whether the SEND MESSAGE op succeeded. Valid for POST_SEND_MESSAGE
/// interceptions.
virtual bool GetSendMessageStatus() = 0;
diff --git a/include/grpcpp/impl/codegen/interceptor_common.h b/include/grpcpp/impl/codegen/interceptor_common.h
index 345127c830..09721343ff 100644
--- a/include/grpcpp/impl/codegen/interceptor_common.h
+++ b/include/grpcpp/impl/codegen/interceptor_common.h
@@ -79,9 +79,24 @@ class InterceptorBatchMethodsImpl
hooks_[static_cast<size_t>(type)] = true;
}
- ByteBuffer* GetSerializedSendMessage() override { return send_message_; }
+ ByteBuffer* GetSerializedSendMessage() override {
+ GPR_CODEGEN_ASSERT(orig_send_message_ != nullptr);
+ if (*orig_send_message_ != nullptr) {
+ GPR_CODEGEN_ASSERT(serializer_(*orig_send_message_).ok());
+ *orig_send_message_ = nullptr;
+ }
+ return send_message_;
+ }
+
+ const void* GetSendMessage() override {
+ GPR_CODEGEN_ASSERT(orig_send_message_ != nullptr);
+ return *orig_send_message_;
+ }
- const void* GetSendMessage() override { return orig_send_message_; }
+ void ModifySendMessage(const void* message) override {
+ GPR_CODEGEN_ASSERT(orig_send_message_ != nullptr);
+ *orig_send_message_ = message;
+ }
bool GetSendMessageStatus() override { return !*fail_send_message_; }
@@ -125,11 +140,13 @@ class InterceptorBatchMethodsImpl
return recv_trailing_metadata_->map();
}
- void SetSendMessage(ByteBuffer* buf, const void* msg,
- bool* fail_send_message) {
+ void SetSendMessage(ByteBuffer* buf, const void** msg,
+ bool* fail_send_message,
+ std::function<Status(const void*)> serializer) {
send_message_ = buf;
orig_send_message_ = msg;
fail_send_message_ = fail_send_message;
+ serializer_ = serializer;
}
void SetSendInitialMetadata(
@@ -359,7 +376,8 @@ class InterceptorBatchMethodsImpl
ByteBuffer* send_message_ = nullptr;
bool* fail_send_message_ = nullptr;
- const void* orig_send_message_ = nullptr;
+ const void** orig_send_message_ = nullptr;
+ std::function<Status(const void*)> serializer_;
std::multimap<grpc::string, grpc::string>* send_initial_metadata_;
@@ -429,6 +447,13 @@ class CancelInterceptorBatchMethods
return nullptr;
}
+ void ModifySendMessage(const void* message) override {
+ GPR_CODEGEN_ASSERT(
+ false &&
+ "It is illegal to call ModifySendMessage on a method which "
+ "has a Cancel notification");
+ }
+
std::multimap<grpc::string, grpc::string>* GetSendInitialMetadata() override {
GPR_CODEGEN_ASSERT(false &&
"It is illegal to call GetSendInitialMetadata on a "
diff --git a/package.xml b/package.xml
index d86c204746..de5c56f451 100644
--- a/package.xml
+++ b/package.xml
@@ -358,6 +358,7 @@
<file baseinstalldir="/" name="src/core/lib/iomgr/exec_ctx.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/executor.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/gethostname.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/iomgr/grpc_if_nametoindex.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/internal_errqueue.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/iocp_windows.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/iomgr.h" role="src" />
@@ -512,6 +513,8 @@
<file baseinstalldir="/" name="src/core/lib/iomgr/gethostname_fallback.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/gethostname_host_name_max.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/gethostname_sysconf.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/iomgr/grpc_if_nametoindex_posix.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/internal_errqueue.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/iocp_windows.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/iomgr.cc" role="src" />
diff --git a/src/core/ext/filters/client_channel/client_channel_factory.cc b/src/core/ext/filters/client_channel/client_channel_factory.cc
index 172e9f03c7..130bbe0418 100644
--- a/src/core/ext/filters/client_channel/client_channel_factory.cc
+++ b/src/core/ext/filters/client_channel/client_channel_factory.cc
@@ -30,7 +30,7 @@ void grpc_client_channel_factory_unref(grpc_client_channel_factory* factory) {
}
grpc_subchannel* grpc_client_channel_factory_create_subchannel(
- grpc_client_channel_factory* factory, const grpc_subchannel_args* args) {
+ grpc_client_channel_factory* factory, const grpc_channel_args* args) {
return factory->vtable->create_subchannel(factory, args);
}
diff --git a/src/core/ext/filters/client_channel/client_channel_factory.h b/src/core/ext/filters/client_channel/client_channel_factory.h
index 601ec46b2a..91dec12282 100644
--- a/src/core/ext/filters/client_channel/client_channel_factory.h
+++ b/src/core/ext/filters/client_channel/client_channel_factory.h
@@ -49,7 +49,7 @@ struct grpc_client_channel_factory_vtable {
void (*ref)(grpc_client_channel_factory* factory);
void (*unref)(grpc_client_channel_factory* factory);
grpc_subchannel* (*create_subchannel)(grpc_client_channel_factory* factory,
- const grpc_subchannel_args* args);
+ const grpc_channel_args* args);
grpc_channel* (*create_client_channel)(grpc_client_channel_factory* factory,
const char* target,
grpc_client_channel_type type,
@@ -61,7 +61,7 @@ void grpc_client_channel_factory_unref(grpc_client_channel_factory* factory);
/** Create a new grpc_subchannel */
grpc_subchannel* grpc_client_channel_factory_create_subchannel(
- grpc_client_channel_factory* factory, const grpc_subchannel_args* args);
+ grpc_client_channel_factory* factory, const grpc_channel_args* args);
/** Create a new grpc_channel */
grpc_channel* grpc_client_channel_factory_create_channel(
diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
index 6f31a643c1..1d0ecbe3f6 100644
--- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
+++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
@@ -509,12 +509,10 @@ SubchannelList<SubchannelListType, SubchannelDataType>::SubchannelList(
GRPC_ARG_SERVER_ADDRESS_LIST,
GRPC_ARG_INHIBIT_HEALTH_CHECKING};
// Create a subchannel for each address.
- grpc_subchannel_args sc_args;
for (size_t i = 0; i < addresses.size(); i++) {
// If there were any balancer addresses, we would have chosen grpclb
// policy, which does not use a SubchannelList.
GPR_ASSERT(!addresses[i].IsBalancer());
- memset(&sc_args, 0, sizeof(grpc_subchannel_args));
InlinedVector<grpc_arg, 4> args_to_add;
args_to_add.emplace_back(
grpc_create_subchannel_address_arg(&addresses[i].address()));
@@ -527,9 +525,8 @@ SubchannelList<SubchannelListType, SubchannelDataType>::SubchannelList(
&args, keys_to_remove, GPR_ARRAY_SIZE(keys_to_remove),
args_to_add.data(), args_to_add.size());
gpr_free(args_to_add[0].value.string);
- sc_args.args = new_args;
grpc_subchannel* subchannel = grpc_client_channel_factory_create_subchannel(
- client_channel_factory, &sc_args);
+ client_channel_factory, new_args);
grpc_channel_args_destroy(new_args);
if (subchannel == nullptr) {
// Subchannel could not be created.
diff --git a/src/core/ext/filters/client_channel/parse_address.cc b/src/core/ext/filters/client_channel/parse_address.cc
index 707beb8876..c5e1ed811b 100644
--- a/src/core/ext/filters/client_channel/parse_address.cc
+++ b/src/core/ext/filters/client_channel/parse_address.cc
@@ -19,6 +19,7 @@
#include <grpc/support/port_platform.h>
#include "src/core/ext/filters/client_channel/parse_address.h"
+#include "src/core/lib/iomgr/grpc_if_nametoindex.h"
#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/iomgr/socket_utils.h"
@@ -35,6 +36,11 @@
#include "src/core/lib/gpr/host_port.h"
#include "src/core/lib/gpr/string.h"
+#ifdef GRPC_POSIX_SOCKET
+#include <errno.h>
+#include <net/if.h>
+#endif
+
#ifdef GRPC_HAVE_UNIX_SOCKET
bool grpc_parse_unix(const grpc_uri* uri,
@@ -69,7 +75,12 @@ bool grpc_parse_ipv4_hostport(const char* hostport, grpc_resolved_address* addr,
// Split host and port.
char* host;
char* port;
- if (!gpr_split_host_port(hostport, &host, &port)) return false;
+ if (!gpr_split_host_port(hostport, &host, &port)) {
+ if (log_errors) {
+ gpr_log(GPR_ERROR, "Failed gpr_split_host_port(%s, ...)", hostport);
+ }
+ return false;
+ }
// Parse IP address.
memset(addr, 0, sizeof(*addr));
addr->len = static_cast<socklen_t>(sizeof(grpc_sockaddr_in));
@@ -115,7 +126,12 @@ bool grpc_parse_ipv6_hostport(const char* hostport, grpc_resolved_address* addr,
// Split host and port.
char* host;
char* port;
- if (!gpr_split_host_port(hostport, &host, &port)) return false;
+ if (!gpr_split_host_port(hostport, &host, &port)) {
+ if (log_errors) {
+ gpr_log(GPR_ERROR, "Failed gpr_split_host_port(%s, ...)", hostport);
+ }
+ return false;
+ }
// Parse IP address.
memset(addr, 0, sizeof(*addr));
addr->len = static_cast<socklen_t>(sizeof(grpc_sockaddr_in6));
@@ -150,10 +166,13 @@ bool grpc_parse_ipv6_hostport(const char* hostport, grpc_resolved_address* addr,
if (gpr_parse_bytes_to_uint32(host_end + 1,
strlen(host) - host_without_scope_len - 1,
&sin6_scope_id) == 0) {
- if (log_errors) {
- gpr_log(GPR_ERROR, "invalid ipv6 scope id: '%s'", host_end + 1);
+ if ((sin6_scope_id = grpc_if_nametoindex(host_end + 1)) == 0) {
+ gpr_log(GPR_ERROR,
+ "Invalid interface name: '%s'. "
+ "Non-numeric and failed if_nametoindex.",
+ host_end + 1);
+ goto done;
}
- goto done;
}
// Handle "sin6_scope_id" being type "u_long". See grpc issue #10027.
in6->sin6_scope_id = sin6_scope_id;
diff --git a/src/core/ext/filters/client_channel/subchannel.cc b/src/core/ext/filters/client_channel/subchannel.cc
index 9077aa9753..640a052e91 100644
--- a/src/core/ext/filters/client_channel/subchannel.cc
+++ b/src/core/ext/filters/client_channel/subchannel.cc
@@ -64,18 +64,6 @@
#define GRPC_SUBCHANNEL_RECONNECT_MAX_BACKOFF_SECONDS 120
#define GRPC_SUBCHANNEL_RECONNECT_JITTER 0.2
-namespace {
-struct state_watcher {
- grpc_closure closure;
- grpc_subchannel* subchannel;
- grpc_connectivity_state connectivity_state;
- grpc_connectivity_state last_connectivity_state;
- grpc_core::OrphanablePtr<grpc_core::HealthCheckClient> health_check_client;
- grpc_closure health_check_closure;
- grpc_connectivity_state health_state;
-};
-} // namespace
-
typedef struct external_state_watcher {
grpc_subchannel* subchannel;
grpc_pollset_set* pollset_set;
@@ -101,9 +89,6 @@ struct grpc_subchannel {
keep the subchannel open */
gpr_atm ref_pair;
- /** non-transport related channel filters */
- const grpc_channel_filter** filters;
- size_t num_filters;
/** channel arguments */
grpc_channel_args* args;
@@ -384,7 +369,6 @@ static void subchannel_destroy(void* arg, grpc_error* error) {
c->channelz_subchannel->MarkSubchannelDestroyed();
c->channelz_subchannel.reset();
}
- gpr_free((void*)c->filters);
c->health_check_service_name.reset();
grpc_channel_args_destroy(c->args);
grpc_connectivity_state_destroy(&c->state_tracker);
@@ -553,7 +537,7 @@ struct HealthCheckParams {
} // namespace grpc_core
grpc_subchannel* grpc_subchannel_create(grpc_connector* connector,
- const grpc_subchannel_args* args) {
+ const grpc_channel_args* args) {
grpc_subchannel_key* key = grpc_subchannel_key_create(args);
grpc_subchannel* c = grpc_subchannel_index_find(key);
if (c) {
@@ -567,23 +551,13 @@ grpc_subchannel* grpc_subchannel_create(grpc_connector* connector,
gpr_atm_no_barrier_store(&c->ref_pair, 1 << INTERNAL_REF_BITS);
c->connector = connector;
grpc_connector_ref(c->connector);
- c->num_filters = args->filter_count;
- if (c->num_filters > 0) {
- c->filters = static_cast<const grpc_channel_filter**>(
- gpr_malloc(sizeof(grpc_channel_filter*) * c->num_filters));
- memcpy((void*)c->filters, args->filters,
- sizeof(grpc_channel_filter*) * c->num_filters);
- } else {
- c->filters = nullptr;
- }
c->pollset_set = grpc_pollset_set_create();
grpc_resolved_address* addr =
static_cast<grpc_resolved_address*>(gpr_malloc(sizeof(*addr)));
- grpc_get_subchannel_address_arg(args->args, addr);
+ grpc_get_subchannel_address_arg(args, addr);
grpc_resolved_address* new_address = nullptr;
grpc_channel_args* new_args = nullptr;
- if (grpc_proxy_mappers_map_address(addr, args->args, &new_address,
- &new_args)) {
+ if (grpc_proxy_mappers_map_address(addr, args, &new_address, &new_args)) {
GPR_ASSERT(new_address != nullptr);
gpr_free(addr);
addr = new_address;
@@ -592,7 +566,7 @@ grpc_subchannel* grpc_subchannel_create(grpc_connector* connector,
grpc_arg new_arg = grpc_create_subchannel_address_arg(addr);
gpr_free(addr);
c->args = grpc_channel_args_copy_and_add_and_remove(
- new_args != nullptr ? new_args : args->args, keys_to_remove,
+ new_args != nullptr ? new_args : args, keys_to_remove,
GPR_ARRAY_SIZE(keys_to_remove), &new_arg, 1);
gpr_free(new_arg.value.string);
if (new_args != nullptr) grpc_channel_args_destroy(new_args);
@@ -605,7 +579,7 @@ grpc_subchannel* grpc_subchannel_create(grpc_connector* connector,
grpc_connectivity_state_init(&c->state_and_health_tracker, GRPC_CHANNEL_IDLE,
"subchannel");
grpc_core::BackOff::Options backoff_options;
- parse_args_for_backoff_values(args->args, &backoff_options,
+ parse_args_for_backoff_values(args, &backoff_options,
&c->min_connect_timeout_ms);
c->backoff.Init(backoff_options);
gpr_mu_init(&c->mu);
diff --git a/src/core/ext/filters/client_channel/subchannel.h b/src/core/ext/filters/client_channel/subchannel.h
index 14f87f2c68..8c994c64f5 100644
--- a/src/core/ext/filters/client_channel/subchannel.h
+++ b/src/core/ext/filters/client_channel/subchannel.h
@@ -38,7 +38,6 @@
address. Provides a target for load balancing. */
typedef struct grpc_subchannel grpc_subchannel;
typedef struct grpc_subchannel_call grpc_subchannel_call;
-typedef struct grpc_subchannel_args grpc_subchannel_args;
typedef struct grpc_subchannel_key grpc_subchannel_key;
#ifndef NDEBUG
@@ -186,21 +185,9 @@ void grpc_subchannel_call_set_cleanup_closure(
grpc_call_stack* grpc_subchannel_call_get_call_stack(
grpc_subchannel_call* subchannel_call);
-struct grpc_subchannel_args {
- /* When updating this struct, also update subchannel_index.c */
-
- /** Channel filters for this channel - wrapped factories will likely
- want to mutate this */
- const grpc_channel_filter** filters;
- /** The number of filters in the above array */
- size_t filter_count;
- /** Channel arguments to be supplied to the newly created channel */
- const grpc_channel_args* args;
-};
-
/** create a subchannel given a connector */
grpc_subchannel* grpc_subchannel_create(grpc_connector* connector,
- const grpc_subchannel_args* args);
+ const grpc_channel_args* args);
/// Sets \a addr from \a args.
void grpc_get_subchannel_address_arg(const grpc_channel_args* args,
diff --git a/src/core/ext/filters/client_channel/subchannel_index.cc b/src/core/ext/filters/client_channel/subchannel_index.cc
index aa8441f17b..d0ceda8312 100644
--- a/src/core/ext/filters/client_channel/subchannel_index.cc
+++ b/src/core/ext/filters/client_channel/subchannel_index.cc
@@ -39,55 +39,37 @@ static gpr_mu g_mu;
static gpr_refcount g_refcount;
struct grpc_subchannel_key {
- grpc_subchannel_args args;
+ grpc_channel_args* args;
};
static bool g_force_creation = false;
static grpc_subchannel_key* create_key(
- const grpc_subchannel_args* args,
+ const grpc_channel_args* args,
grpc_channel_args* (*copy_channel_args)(const grpc_channel_args* args)) {
grpc_subchannel_key* k =
static_cast<grpc_subchannel_key*>(gpr_malloc(sizeof(*k)));
- k->args.filter_count = args->filter_count;
- if (k->args.filter_count > 0) {
- k->args.filters = static_cast<const grpc_channel_filter**>(
- gpr_malloc(sizeof(*k->args.filters) * k->args.filter_count));
- memcpy(reinterpret_cast<grpc_channel_filter*>(k->args.filters),
- args->filters, sizeof(*k->args.filters) * k->args.filter_count);
- } else {
- k->args.filters = nullptr;
- }
- k->args.args = copy_channel_args(args->args);
+ k->args = copy_channel_args(args);
return k;
}
-grpc_subchannel_key* grpc_subchannel_key_create(
- const grpc_subchannel_args* args) {
+grpc_subchannel_key* grpc_subchannel_key_create(const grpc_channel_args* args) {
return create_key(args, grpc_channel_args_normalize);
}
static grpc_subchannel_key* subchannel_key_copy(grpc_subchannel_key* k) {
- return create_key(&k->args, grpc_channel_args_copy);
+ return create_key(k->args, grpc_channel_args_copy);
}
int grpc_subchannel_key_compare(const grpc_subchannel_key* a,
const grpc_subchannel_key* b) {
// To pretend the keys are different, return a non-zero value.
if (GPR_UNLIKELY(g_force_creation)) return 1;
- int c = GPR_ICMP(a->args.filter_count, b->args.filter_count);
- if (c != 0) return c;
- if (a->args.filter_count > 0) {
- c = memcmp(a->args.filters, b->args.filters,
- a->args.filter_count * sizeof(*a->args.filters));
- if (c != 0) return c;
- }
- return grpc_channel_args_compare(a->args.args, b->args.args);
+ return grpc_channel_args_compare(a->args, b->args);
}
void grpc_subchannel_key_destroy(grpc_subchannel_key* k) {
- gpr_free(reinterpret_cast<grpc_channel_args*>(k->args.filters));
- grpc_channel_args_destroy(const_cast<grpc_channel_args*>(k->args.args));
+ grpc_channel_args_destroy(k->args);
gpr_free(k);
}
diff --git a/src/core/ext/filters/client_channel/subchannel_index.h b/src/core/ext/filters/client_channel/subchannel_index.h
index c135613d26..429634bd54 100644
--- a/src/core/ext/filters/client_channel/subchannel_index.h
+++ b/src/core/ext/filters/client_channel/subchannel_index.h
@@ -27,8 +27,7 @@
shared amongst channels */
/** Create a key that can be used to uniquely identify a subchannel */
-grpc_subchannel_key* grpc_subchannel_key_create(
- const grpc_subchannel_args* args);
+grpc_subchannel_key* grpc_subchannel_key_create(const grpc_channel_args* args);
/** Destroy a subchannel key */
void grpc_subchannel_key_destroy(grpc_subchannel_key* key);
diff --git a/src/core/ext/transport/chttp2/client/insecure/channel_create.cc b/src/core/ext/transport/chttp2/client/insecure/channel_create.cc
index e6c8c38260..a5bf1bf21d 100644
--- a/src/core/ext/transport/chttp2/client/insecure/channel_create.cc
+++ b/src/core/ext/transport/chttp2/client/insecure/channel_create.cc
@@ -40,14 +40,12 @@ static void client_channel_factory_unref(
grpc_client_channel_factory* cc_factory) {}
static grpc_subchannel* client_channel_factory_create_subchannel(
- grpc_client_channel_factory* cc_factory, const grpc_subchannel_args* args) {
- grpc_subchannel_args final_sc_args;
- memcpy(&final_sc_args, args, sizeof(*args));
- final_sc_args.args = grpc_default_authority_add_if_not_present(args->args);
+ grpc_client_channel_factory* cc_factory, const grpc_channel_args* args) {
+ grpc_channel_args* new_args = grpc_default_authority_add_if_not_present(args);
grpc_connector* connector = grpc_chttp2_connector_create();
- grpc_subchannel* s = grpc_subchannel_create(connector, &final_sc_args);
+ grpc_subchannel* s = grpc_subchannel_create(connector, new_args);
grpc_connector_unref(connector);
- grpc_channel_args_destroy(const_cast<grpc_channel_args*>(final_sc_args.args));
+ grpc_channel_args_destroy(new_args);
return s;
}
diff --git a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
index 9612698e96..ddd538faa8 100644
--- a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
+++ b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
@@ -46,10 +46,10 @@ static void client_channel_factory_ref(
static void client_channel_factory_unref(
grpc_client_channel_factory* cc_factory) {}
-static grpc_subchannel_args* get_secure_naming_subchannel_args(
- const grpc_subchannel_args* args) {
+static grpc_channel_args* get_secure_naming_channel_args(
+ const grpc_channel_args* args) {
grpc_channel_credentials* channel_credentials =
- grpc_channel_credentials_find_in_args(args->args);
+ grpc_channel_credentials_find_in_args(args);
if (channel_credentials == nullptr) {
gpr_log(GPR_ERROR,
"Can't create subchannel: channel credentials missing for secure "
@@ -57,7 +57,7 @@ static grpc_subchannel_args* get_secure_naming_subchannel_args(
return nullptr;
}
// Make sure security connector does not already exist in args.
- if (grpc_security_connector_find_in_args(args->args) != nullptr) {
+ if (grpc_security_connector_find_in_args(args) != nullptr) {
gpr_log(GPR_ERROR,
"Can't create subchannel: security connector already present in "
"channel args.");
@@ -65,19 +65,18 @@ static grpc_subchannel_args* get_secure_naming_subchannel_args(
}
// To which address are we connecting? By default, use the server URI.
const grpc_arg* server_uri_arg =
- grpc_channel_args_find(args->args, GRPC_ARG_SERVER_URI);
+ grpc_channel_args_find(args, GRPC_ARG_SERVER_URI);
const char* server_uri_str = grpc_channel_arg_get_string(server_uri_arg);
GPR_ASSERT(server_uri_str != nullptr);
grpc_uri* server_uri =
grpc_uri_parse(server_uri_str, true /* supress errors */);
GPR_ASSERT(server_uri != nullptr);
const grpc_core::TargetAuthorityTable* target_authority_table =
- grpc_core::FindTargetAuthorityTableInArgs(args->args);
+ grpc_core::FindTargetAuthorityTableInArgs(args);
grpc_core::UniquePtr<char> authority;
if (target_authority_table != nullptr) {
// Find the authority for the target.
- const char* target_uri_str =
- grpc_get_subchannel_address_uri_arg(args->args);
+ const char* target_uri_str = grpc_get_subchannel_address_uri_arg(args);
grpc_uri* target_uri =
grpc_uri_parse(target_uri_str, false /* suppress errors */);
GPR_ASSERT(target_uri != nullptr);
@@ -100,15 +99,14 @@ static grpc_subchannel_args* get_secure_naming_subchannel_args(
}
grpc_arg args_to_add[2];
size_t num_args_to_add = 0;
- if (grpc_channel_args_find(args->args, GRPC_ARG_DEFAULT_AUTHORITY) ==
- nullptr) {
+ if (grpc_channel_args_find(args, GRPC_ARG_DEFAULT_AUTHORITY) == nullptr) {
// If the channel args don't already contain GRPC_ARG_DEFAULT_AUTHORITY, add
// the arg, setting it to the value just obtained.
args_to_add[num_args_to_add++] = grpc_channel_arg_string_create(
const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY), authority.get());
}
grpc_channel_args* args_with_authority =
- grpc_channel_args_copy_and_add(args->args, args_to_add, num_args_to_add);
+ grpc_channel_args_copy_and_add(args, args_to_add, num_args_to_add);
grpc_uri_destroy(server_uri);
// Create the security connector using the credentials and target name.
grpc_channel_args* new_args_from_connector = nullptr;
@@ -137,29 +135,21 @@ static grpc_subchannel_args* get_secure_naming_subchannel_args(
grpc_channel_args_destroy(new_args_from_connector);
}
grpc_channel_args_destroy(args_with_authority);
- grpc_subchannel_args* final_sc_args =
- static_cast<grpc_subchannel_args*>(gpr_malloc(sizeof(*final_sc_args)));
- memcpy(final_sc_args, args, sizeof(*args));
- final_sc_args->args = new_args;
- return final_sc_args;
+ return new_args;
}
static grpc_subchannel* client_channel_factory_create_subchannel(
- grpc_client_channel_factory* cc_factory, const grpc_subchannel_args* args) {
- grpc_subchannel_args* subchannel_args =
- get_secure_naming_subchannel_args(args);
- if (subchannel_args == nullptr) {
- gpr_log(
- GPR_ERROR,
- "Failed to create subchannel arguments during subchannel creation.");
+ grpc_client_channel_factory* cc_factory, const grpc_channel_args* args) {
+ grpc_channel_args* new_args = get_secure_naming_channel_args(args);
+ if (new_args == nullptr) {
+ gpr_log(GPR_ERROR,
+ "Failed to create channel args during subchannel creation.");
return nullptr;
}
grpc_connector* connector = grpc_chttp2_connector_create();
- grpc_subchannel* s = grpc_subchannel_create(connector, subchannel_args);
+ grpc_subchannel* s = grpc_subchannel_create(connector, new_args);
grpc_connector_unref(connector);
- grpc_channel_args_destroy(
- const_cast<grpc_channel_args*>(subchannel_args->args));
- gpr_free(subchannel_args);
+ grpc_channel_args_destroy(new_args);
return s;
}
diff --git a/src/core/lib/iomgr/combiner.cc b/src/core/lib/iomgr/combiner.cc
index 7c0062eb4e..402f8904ea 100644
--- a/src/core/lib/iomgr/combiner.cc
+++ b/src/core/lib/iomgr/combiner.cc
@@ -29,6 +29,7 @@
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/iomgr/executor.h"
+#include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/profiling/timers.h"
grpc_core::DebugOnlyTraceFlag grpc_combiner_trace(false, "combiner");
@@ -228,8 +229,14 @@ bool grpc_combiner_continue_exec_ctx() {
grpc_core::ExecCtx::Get()->IsReadyToFinish(),
lock->time_to_execute_final_list));
+ // offload only if all the following conditions are true:
+ // 1. the combiner is contended and has more than one closure to execute
+ // 2. the current execution context needs to finish as soon as possible
+ // 3. the DEFAULT executor is threaded
+ // 4. the current thread is not a worker for any background poller
if (contended && grpc_core::ExecCtx::Get()->IsReadyToFinish() &&
- grpc_executor_is_threaded()) {
+ grpc_executor_is_threaded() &&
+ !grpc_iomgr_is_any_background_poller_thread()) {
GPR_TIMER_MARK("offload_from_finished_exec_ctx", 0);
// this execution context wants to move on: schedule remaining work to be
// picked up on the executor
diff --git a/src/core/lib/iomgr/ev_epoll1_linux.cc b/src/core/lib/iomgr/ev_epoll1_linux.cc
index 4b8c891e9b..9eb4c089d8 100644
--- a/src/core/lib/iomgr/ev_epoll1_linux.cc
+++ b/src/core/lib/iomgr/ev_epoll1_linux.cc
@@ -1242,6 +1242,8 @@ static void pollset_set_del_pollset_set(grpc_pollset_set* bag,
* Event engine binding
*/
+static bool is_any_background_poller_thread(void) { return false; }
+
static void shutdown_background_closure(void) {}
static void shutdown_engine(void) {
@@ -1287,6 +1289,7 @@ static const grpc_event_engine_vtable vtable = {
pollset_set_add_fd,
pollset_set_del_fd,
+ is_any_background_poller_thread,
shutdown_background_closure,
shutdown_engine,
};
diff --git a/src/core/lib/iomgr/ev_epollex_linux.cc b/src/core/lib/iomgr/ev_epollex_linux.cc
index 7a4870db78..0a0891013a 100644
--- a/src/core/lib/iomgr/ev_epollex_linux.cc
+++ b/src/core/lib/iomgr/ev_epollex_linux.cc
@@ -1604,6 +1604,8 @@ static void pollset_set_del_pollset_set(grpc_pollset_set* bag,
* Event engine binding
*/
+static bool is_any_background_poller_thread(void) { return false; }
+
static void shutdown_background_closure(void) {}
static void shutdown_engine(void) {
@@ -1644,6 +1646,7 @@ static const grpc_event_engine_vtable vtable = {
pollset_set_add_fd,
pollset_set_del_fd,
+ is_any_background_poller_thread,
shutdown_background_closure,
shutdown_engine,
};
diff --git a/src/core/lib/iomgr/ev_poll_posix.cc b/src/core/lib/iomgr/ev_poll_posix.cc
index 67cbfbbd02..c479206410 100644
--- a/src/core/lib/iomgr/ev_poll_posix.cc
+++ b/src/core/lib/iomgr/ev_poll_posix.cc
@@ -1782,6 +1782,8 @@ static void global_cv_fd_table_shutdown() {
* event engine binding
*/
+static bool is_any_background_poller_thread(void) { return false; }
+
static void shutdown_background_closure(void) {}
static void shutdown_engine(void) {
@@ -1828,6 +1830,7 @@ static const grpc_event_engine_vtable vtable = {
pollset_set_add_fd,
pollset_set_del_fd,
+ is_any_background_poller_thread,
shutdown_background_closure,
shutdown_engine,
};
diff --git a/src/core/lib/iomgr/ev_posix.cc b/src/core/lib/iomgr/ev_posix.cc
index 32d1b6c43e..fb2e70eee4 100644
--- a/src/core/lib/iomgr/ev_posix.cc
+++ b/src/core/lib/iomgr/ev_posix.cc
@@ -399,6 +399,10 @@ void grpc_pollset_set_del_fd(grpc_pollset_set* pollset_set, grpc_fd* fd) {
g_event_engine->pollset_set_del_fd(pollset_set, fd);
}
+bool grpc_is_any_background_poller_thread(void) {
+ return g_event_engine->is_any_background_poller_thread();
+}
+
void grpc_shutdown_background_closure(void) {
g_event_engine->shutdown_background_closure();
}
diff --git a/src/core/lib/iomgr/ev_posix.h b/src/core/lib/iomgr/ev_posix.h
index 812c7a0f0f..94ac9fdba6 100644
--- a/src/core/lib/iomgr/ev_posix.h
+++ b/src/core/lib/iomgr/ev_posix.h
@@ -80,6 +80,7 @@ typedef struct grpc_event_engine_vtable {
void (*pollset_set_add_fd)(grpc_pollset_set* pollset_set, grpc_fd* fd);
void (*pollset_set_del_fd)(grpc_pollset_set* pollset_set, grpc_fd* fd);
+ bool (*is_any_background_poller_thread)(void);
void (*shutdown_background_closure)(void);
void (*shutdown_engine)(void);
} grpc_event_engine_vtable;
@@ -181,6 +182,9 @@ void grpc_pollset_add_fd(grpc_pollset* pollset, struct grpc_fd* fd);
void grpc_pollset_set_add_fd(grpc_pollset_set* pollset_set, grpc_fd* fd);
void grpc_pollset_set_del_fd(grpc_pollset_set* pollset_set, grpc_fd* fd);
+/* Returns true if the caller is a worker thread for any background poller. */
+bool grpc_is_any_background_poller_thread();
+
/* Shut down all the closures registered in the background poller. */
void grpc_shutdown_background_closure();
diff --git a/src/core/lib/iomgr/grpc_if_nametoindex.h b/src/core/lib/iomgr/grpc_if_nametoindex.h
new file mode 100644
index 0000000000..ed9612dcb9
--- /dev/null
+++ b/src/core/lib/iomgr/grpc_if_nametoindex.h
@@ -0,0 +1,30 @@
+/*
+ *
+ * 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_CORE_LIB_IOMGR_GRPC_IF_NAMETOINDEX_H
+#define GRPC_CORE_LIB_IOMGR_GRPC_IF_NAMETOINDEX_H
+
+#include <grpc/support/port_platform.h>
+
+#include <stddef.h>
+
+/* Returns the interface index corresponding to the interface "name" provided.
+ * Returns non-zero upon success, and zero upon failure. */
+uint32_t grpc_if_nametoindex(char* name);
+
+#endif /* GRPC_CORE_LIB_IOMGR_GRPC_IF_NAMETOINDEX_H */
diff --git a/src/core/lib/iomgr/grpc_if_nametoindex_posix.cc b/src/core/lib/iomgr/grpc_if_nametoindex_posix.cc
new file mode 100644
index 0000000000..f1ba20dcec
--- /dev/null
+++ b/src/core/lib/iomgr/grpc_if_nametoindex_posix.cc
@@ -0,0 +1,42 @@
+/*
+ *
+ * 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_IF_NAMETOINDEX == 1 && defined(GRPC_POSIX_SOCKET_IF_NAMETOINDEX)
+
+#include "src/core/lib/iomgr/grpc_if_nametoindex.h"
+
+#include <errno.h>
+#include <net/if.h>
+
+#include <grpc/support/log.h>
+
+uint32_t grpc_if_nametoindex(char* name) {
+ uint32_t out = if_nametoindex(name);
+ if (out == 0) {
+ gpr_log(GPR_DEBUG, "if_nametoindex failed for name %s. errno %d", name,
+ errno);
+ }
+ return out;
+}
+
+#endif /* GRPC_IF_NAMETOINDEX == 1 && \
+ defined(GRPC_POSIX_SOCKET_IF_NAMETOINDEX) */
diff --git a/src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc b/src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc
new file mode 100644
index 0000000000..08644cccf3
--- /dev/null
+++ b/src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc
@@ -0,0 +1,38 @@
+/*
+ *
+ * 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_IF_NAMETOINDEX == 0 || !defined(GRPC_POSIX_SOCKET_IF_NAMETOINDEX)
+
+#include "src/core/lib/iomgr/grpc_if_nametoindex.h"
+
+#include <grpc/support/log.h>
+
+uint32_t grpc_if_nametoindex(char* name) {
+ gpr_log(GPR_DEBUG,
+ "Not attempting to convert interface name %s to index for current "
+ "platform.",
+ name);
+ return 0;
+}
+
+#endif /* GRPC_IF_NAMETOINDEX == 0 || \
+ !defined(GRPC_POSIX_SOCKET_IF_NAMETOINDEX) */
diff --git a/src/core/lib/iomgr/iomgr.cc b/src/core/lib/iomgr/iomgr.cc
index eb29973514..a492146857 100644
--- a/src/core/lib/iomgr/iomgr.cc
+++ b/src/core/lib/iomgr/iomgr.cc
@@ -161,6 +161,10 @@ void grpc_iomgr_shutdown_background_closure() {
grpc_iomgr_platform_shutdown_background_closure();
}
+bool grpc_iomgr_is_any_background_poller_thread() {
+ return grpc_iomgr_platform_is_any_background_poller_thread();
+}
+
void grpc_iomgr_register_object(grpc_iomgr_object* obj, const char* name) {
obj->name = gpr_strdup(name);
gpr_mu_lock(&g_mu);
diff --git a/src/core/lib/iomgr/iomgr.h b/src/core/lib/iomgr/iomgr.h
index 8ea9289e06..6261aa550c 100644
--- a/src/core/lib/iomgr/iomgr.h
+++ b/src/core/lib/iomgr/iomgr.h
@@ -39,6 +39,9 @@ void grpc_iomgr_shutdown();
* background poller. */
void grpc_iomgr_shutdown_background_closure();
+/** Returns true if the caller is a worker thread for any background poller. */
+bool grpc_iomgr_is_any_background_poller_thread();
+
/* Exposed only for testing */
size_t grpc_iomgr_count_objects_for_testing();
diff --git a/src/core/lib/iomgr/iomgr_custom.cc b/src/core/lib/iomgr/iomgr_custom.cc
index 4b112c9097..e1cd8f7310 100644
--- a/src/core/lib/iomgr/iomgr_custom.cc
+++ b/src/core/lib/iomgr/iomgr_custom.cc
@@ -41,10 +41,14 @@ static void iomgr_platform_init(void) {
static void iomgr_platform_flush(void) {}
static void iomgr_platform_shutdown(void) { grpc_pollset_global_shutdown(); }
static void iomgr_platform_shutdown_background_closure(void) {}
+static bool iomgr_platform_is_any_background_poller_thread(void) {
+ return false;
+}
static grpc_iomgr_platform_vtable vtable = {
iomgr_platform_init, iomgr_platform_flush, iomgr_platform_shutdown,
- iomgr_platform_shutdown_background_closure};
+ iomgr_platform_shutdown_background_closure,
+ iomgr_platform_is_any_background_poller_thread};
void grpc_custom_iomgr_init(grpc_socket_vtable* socket,
grpc_custom_resolver_vtable* resolver,
diff --git a/src/core/lib/iomgr/iomgr_internal.cc b/src/core/lib/iomgr/iomgr_internal.cc
index b6c9211865..e68b1cf581 100644
--- a/src/core/lib/iomgr/iomgr_internal.cc
+++ b/src/core/lib/iomgr/iomgr_internal.cc
@@ -45,3 +45,7 @@ void grpc_iomgr_platform_shutdown() { iomgr_platform_vtable->shutdown(); }
void grpc_iomgr_platform_shutdown_background_closure() {
iomgr_platform_vtable->shutdown_background_closure();
}
+
+bool grpc_iomgr_platform_is_any_background_poller_thread() {
+ return iomgr_platform_vtable->is_any_background_poller_thread();
+}
diff --git a/src/core/lib/iomgr/iomgr_internal.h b/src/core/lib/iomgr/iomgr_internal.h
index bca7409907..2250ad9a18 100644
--- a/src/core/lib/iomgr/iomgr_internal.h
+++ b/src/core/lib/iomgr/iomgr_internal.h
@@ -36,6 +36,7 @@ typedef struct grpc_iomgr_platform_vtable {
void (*flush)(void);
void (*shutdown)(void);
void (*shutdown_background_closure)(void);
+ bool (*is_any_background_poller_thread)(void);
} grpc_iomgr_platform_vtable;
void grpc_iomgr_register_object(grpc_iomgr_object* obj, const char* name);
@@ -56,6 +57,9 @@ void grpc_iomgr_platform_shutdown(void);
/** shut down all the closures registered in the background poller */
void grpc_iomgr_platform_shutdown_background_closure(void);
+/** return true is the caller is a worker thread for any background poller */
+bool grpc_iomgr_platform_is_any_background_poller_thread(void);
+
bool grpc_iomgr_abort_on_leaks(void);
#endif /* GRPC_CORE_LIB_IOMGR_IOMGR_INTERNAL_H */
diff --git a/src/core/lib/iomgr/iomgr_posix.cc b/src/core/lib/iomgr/iomgr_posix.cc
index 9386adf060..278c8de688 100644
--- a/src/core/lib/iomgr/iomgr_posix.cc
+++ b/src/core/lib/iomgr/iomgr_posix.cc
@@ -55,9 +55,14 @@ static void iomgr_platform_shutdown_background_closure(void) {
grpc_shutdown_background_closure();
}
+static bool iomgr_platform_is_any_background_poller_thread(void) {
+ return grpc_is_any_background_poller_thread();
+}
+
static grpc_iomgr_platform_vtable vtable = {
iomgr_platform_init, iomgr_platform_flush, iomgr_platform_shutdown,
- iomgr_platform_shutdown_background_closure};
+ iomgr_platform_shutdown_background_closure,
+ iomgr_platform_is_any_background_poller_thread};
void grpc_set_default_iomgr_platform() {
grpc_set_tcp_client_impl(&grpc_posix_tcp_client_vtable);
diff --git a/src/core/lib/iomgr/iomgr_posix_cfstream.cc b/src/core/lib/iomgr/iomgr_posix_cfstream.cc
index 552ef4309c..462ac41fcd 100644
--- a/src/core/lib/iomgr/iomgr_posix_cfstream.cc
+++ b/src/core/lib/iomgr/iomgr_posix_cfstream.cc
@@ -58,9 +58,14 @@ static void iomgr_platform_shutdown_background_closure(void) {
grpc_shutdown_background_closure();
}
+static bool iomgr_platform_is_any_background_poller_thread(void) {
+ return grpc_is_any_background_poller_thread();
+}
+
static grpc_iomgr_platform_vtable vtable = {
iomgr_platform_init, iomgr_platform_flush, iomgr_platform_shutdown,
- iomgr_platform_shutdown_background_closure};
+ iomgr_platform_shutdown_background_closure,
+ iomgr_platform_is_any_background_poller_thread};
void grpc_set_default_iomgr_platform() {
char* enable_cfstream = getenv(grpc_cfstream_env_var);
diff --git a/src/core/lib/iomgr/iomgr_windows.cc b/src/core/lib/iomgr/iomgr_windows.cc
index 24ef0dba7b..0579e16aa7 100644
--- a/src/core/lib/iomgr/iomgr_windows.cc
+++ b/src/core/lib/iomgr/iomgr_windows.cc
@@ -73,9 +73,14 @@ static void iomgr_platform_shutdown(void) {
static void iomgr_platform_shutdown_background_closure(void) {}
+static bool iomgr_platform_is_any_background_poller_thread(void) {
+ return false;
+}
+
static grpc_iomgr_platform_vtable vtable = {
iomgr_platform_init, iomgr_platform_flush, iomgr_platform_shutdown,
- iomgr_platform_shutdown_background_closure};
+ iomgr_platform_shutdown_background_closure,
+ iomgr_platform_is_any_background_poller_thread};
void grpc_set_default_iomgr_platform() {
grpc_set_tcp_client_impl(&grpc_windows_tcp_client_vtable);
diff --git a/src/core/lib/iomgr/port.h b/src/core/lib/iomgr/port.h
index c8046b21dc..7b6ca1bc0e 100644
--- a/src/core/lib/iomgr/port.h
+++ b/src/core/lib/iomgr/port.h
@@ -184,6 +184,7 @@
#define GRPC_POSIX_SOCKET_EV_EPOLLEX 1
#define GRPC_POSIX_SOCKET_EV_POLL 1
#define GRPC_POSIX_SOCKET_EV_EPOLL1 1
+#define GRPC_POSIX_SOCKET_IF_NAMETOINDEX 1
#define GRPC_POSIX_SOCKET_IOMGR 1
#define GRPC_POSIX_SOCKET_RESOLVE_ADDRESS 1
#define GRPC_POSIX_SOCKET_SOCKADDR 1
diff --git a/src/core/lib/surface/channel_init.h b/src/core/lib/surface/channel_init.h
index f01852473b..d17a721606 100644
--- a/src/core/lib/surface/channel_init.h
+++ b/src/core/lib/surface/channel_init.h
@@ -45,6 +45,11 @@ void grpc_channel_init_init(void);
/// registration order (in the case of a tie).
/// Stages are registered against one of the pre-determined channel stack
/// types.
+/// If the channel stack type is GRPC_CLIENT_SUBCHANNEL, the caller should
+/// ensure that subchannels with different filter lists will always have
+/// different channel args. This requires setting a channel arg in case the
+/// registration function relies on some condition other than channel args to
+/// decide whether to add a filter or not.
void grpc_channel_init_register_stage(grpc_channel_stack_type type,
int priority,
grpc_channel_init_stage stage_fn,
diff --git a/src/cpp/common/channel_filter.h b/src/cpp/common/channel_filter.h
index 5e569c97e6..1a3295fc80 100644
--- a/src/cpp/common/channel_filter.h
+++ b/src/cpp/common/channel_filter.h
@@ -366,6 +366,11 @@ void ChannelFilterPluginShutdown();
/// The \a include_filter argument specifies a function that will be called
/// to determine at run-time whether or not to add the filter. If the
/// value is nullptr, the filter will be added unconditionally.
+/// If the channel stack type is GRPC_CLIENT_SUBCHANNEL, the caller should
+/// ensure that subchannels with different filter lists will always have
+/// different channel args. This requires setting a channel arg in case the
+/// registration function relies on some condition other than channel args to
+/// decide whether to add a filter or not.
template <typename ChannelDataType, typename CallDataType>
void RegisterChannelFilter(
const char* name, grpc_channel_stack_type stack_type, int priority,
diff --git a/src/csharp/Grpc.Core/Interceptors/ServerServiceDefinitionExtensions.cs b/src/csharp/Grpc.Core/Interceptors/ServerServiceDefinitionExtensions.cs
index 8987544f7f..56ead8a6a1 100644
--- a/src/csharp/Grpc.Core/Interceptors/ServerServiceDefinitionExtensions.cs
+++ b/src/csharp/Grpc.Core/Interceptors/ServerServiceDefinitionExtensions.cs
@@ -76,4 +76,4 @@ namespace Grpc.Core.Interceptors
return serverServiceDefinition;
}
}
-} \ No newline at end of file
+}
diff --git a/src/python/grpcio/grpc/__init__.py b/src/python/grpcio/grpc/__init__.py
index 70d7618e05..8613bc501f 100644
--- a/src/python/grpcio/grpc/__init__.py
+++ b/src/python/grpcio/grpc/__init__.py
@@ -24,7 +24,7 @@ from grpc._cython import cygrpc as _cygrpc
logging.getLogger(__name__).addHandler(logging.NullHandler())
try:
- from ._grpcio_metadata import __version__
+ from grpc._grpcio_metadata import __version__
except ImportError:
__version__ = "dev0"
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi
index d72648a35d..ef74f61e04 100644
--- a/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi
+++ b/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi
@@ -149,6 +149,6 @@ cdef class Server:
grpc_server_destroy(self.c_server)
self.c_server = NULL
- def __dealloc(self):
+ def __dealloc__(self):
if self.c_server == NULL:
grpc_shutdown()
diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py
index 6a1fd676ca..06de23903c 100644
--- a/src/python/grpcio/grpc_core_dependencies.py
+++ b/src/python/grpcio/grpc_core_dependencies.py
@@ -102,6 +102,8 @@ CORE_SOURCE_FILES = [
'src/core/lib/iomgr/gethostname_fallback.cc',
'src/core/lib/iomgr/gethostname_host_name_max.cc',
'src/core/lib/iomgr/gethostname_sysconf.cc',
+ 'src/core/lib/iomgr/grpc_if_nametoindex_posix.cc',
+ 'src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc',
'src/core/lib/iomgr/internal_errqueue.cc',
'src/core/lib/iomgr/iocp_windows.cc',
'src/core/lib/iomgr/iomgr.cc',
diff --git a/src/ruby/ext/grpc/rb_channel.c b/src/ruby/ext/grpc/rb_channel.c
index 6d4b2293a2..5bde962f78 100644
--- a/src/ruby/ext/grpc/rb_channel.c
+++ b/src/ruby/ext/grpc/rb_channel.c
@@ -153,7 +153,7 @@ static void grpc_rb_channel_free(void* p) {
if (ch->bg_wrapped != NULL) {
/* assumption made here: it's ok to directly gpr_mu_lock the global
- * connection polling mutex becuse we're in a finalizer,
+ * connection polling mutex because we're in a finalizer,
* and we can count on this thread to not be interrupted or
* yield the gil. */
grpc_rb_channel_safe_destroy(ch->bg_wrapped);
@@ -292,7 +292,7 @@ static void* get_state_without_gil(void* arg) {
Indicates the current state of the channel, whose value is one of the
constants defined in GRPC::Core::ConnectivityStates.
- It also tries to connect if the chennel is idle in the second form. */
+ It also tries to connect if the channel is idle in the second form. */
static VALUE grpc_rb_channel_get_connectivity_state(int argc, VALUE* argv,
VALUE self) {
VALUE try_to_connect_param = Qfalse;
@@ -327,8 +327,8 @@ static void* wait_for_watch_state_op_complete_without_gvl(void* arg) {
void* success = (void*)0;
gpr_mu_lock(&global_connection_polling_mu);
- // its unsafe to do a "watch" after "channel polling abort" because the cq has
- // been shut down.
+ // it's unsafe to do a "watch" after "channel polling abort" because the cq
+ // has been shut down.
if (abort_channel_polling || stack->bg_wrapped->channel_destroyed) {
gpr_mu_unlock(&global_connection_polling_mu);
return (void*)0;
diff --git a/templates/tools/dockerfile/interoptest/grpc_interop_go1.11/Dockerfile.template b/templates/tools/dockerfile/interoptest/grpc_interop_go1.11/Dockerfile.template
new file mode 100644
index 0000000000..4921d93f49
--- /dev/null
+++ b/templates/tools/dockerfile/interoptest/grpc_interop_go1.11/Dockerfile.template
@@ -0,0 +1,23 @@
+%YAML 1.2
+--- |
+ # 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 golang:1.11
+
+ <%include file="../../go_path.include"/>
+ <%include file="../../python_deps.include"/>
+ # Define the default command.
+ CMD ["bash"]
+
diff --git a/templates/tools/dockerfile/interoptest/grpc_interop_go1.11/build_interop.sh.template b/templates/tools/dockerfile/interoptest/grpc_interop_go1.11/build_interop.sh.template
new file mode 100644
index 0000000000..a08798b1d6
--- /dev/null
+++ b/templates/tools/dockerfile/interoptest/grpc_interop_go1.11/build_interop.sh.template
@@ -0,0 +1,3 @@
+%YAML 1.2
+--- |
+ <%include file="../../go_build_interop.sh.include"/>
diff --git a/test/core/client_channel/BUILD b/test/core/client_channel/BUILD
index 04485f5240..57e5191af4 100644
--- a/test/core/client_channel/BUILD
+++ b/test/core/client_channel/BUILD
@@ -44,6 +44,17 @@ grpc_cc_test(
)
grpc_cc_test(
+ name = "parse_address_with_named_scope_id_test",
+ srcs = ["parse_address_with_named_scope_id_test.cc"],
+ language = "C++",
+ deps = [
+ "//:gpr",
+ "//:grpc",
+ "//test/core/util:grpc_test_util",
+ ],
+)
+
+grpc_cc_test(
name = "uri_parser_test",
srcs = ["uri_parser_test.cc"],
language = "C++",
diff --git a/test/core/client_channel/parse_address_with_named_scope_id_test.cc b/test/core/client_channel/parse_address_with_named_scope_id_test.cc
new file mode 100644
index 0000000000..bfafa74517
--- /dev/null
+++ b/test/core/client_channel/parse_address_with_named_scope_id_test.cc
@@ -0,0 +1,126 @@
+/*
+ *
+ * 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 "src/core/ext/filters/client_channel/parse_address.h"
+#include "src/core/lib/iomgr/sockaddr.h"
+#include "src/core/lib/iomgr/socket_utils.h"
+
+#include <net/if.h>
+#include <string.h>
+#ifdef GRPC_HAVE_UNIX_SOCKET
+#include <sys/un.h>
+#endif
+
+#include <grpc/grpc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/gpr/host_port.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/iomgr/socket_utils.h"
+#include "test/core/util/test_config.h"
+
+static void test_grpc_parse_ipv6_parity_with_getaddrinfo(
+ const char* target, const struct sockaddr_in6 result_from_getaddrinfo) {
+ // Get the sockaddr that gRPC's ipv6 resolver resolves this too.
+ grpc_core::ExecCtx exec_ctx;
+ grpc_uri* uri = grpc_uri_parse(target, 0);
+ grpc_resolved_address addr;
+ GPR_ASSERT(1 == grpc_parse_ipv6(uri, &addr));
+ grpc_sockaddr_in6* result_from_grpc_parser =
+ reinterpret_cast<grpc_sockaddr_in6*>(addr.addr);
+ // Compare the sockaddr returned from gRPC's ipv6 resolver with that returned
+ // from getaddrinfo.
+ GPR_ASSERT(result_from_grpc_parser->sin6_family == AF_INET6);
+ GPR_ASSERT(result_from_getaddrinfo.sin6_family == AF_INET6);
+ GPR_ASSERT(memcmp(&result_from_grpc_parser->sin6_addr,
+ &result_from_getaddrinfo.sin6_addr, sizeof(in6_addr)) == 0);
+ GPR_ASSERT(result_from_grpc_parser->sin6_scope_id ==
+ result_from_getaddrinfo.sin6_scope_id);
+ GPR_ASSERT(result_from_grpc_parser->sin6_scope_id != 0);
+ // TODO: compare sin6_flow_info fields? parse_ipv6 zero's this field as is.
+ // Cleanup
+ grpc_uri_destroy(uri);
+}
+
+struct sockaddr_in6 resolve_with_gettaddrinfo(const char* uri_text) {
+ grpc_uri* uri = grpc_uri_parse(uri_text, 0);
+ char* host = nullptr;
+ char* port = nullptr;
+ gpr_split_host_port(uri->path, &host, &port);
+ struct addrinfo hints;
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = AF_INET6;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_flags = AI_NUMERICHOST;
+ struct addrinfo* result;
+ int res = getaddrinfo(host, port, &hints, &result);
+ if (res != 0) {
+ gpr_log(GPR_ERROR,
+ "getaddrinfo failed to resolve host:%s port:%s. Error: %d.", host,
+ port, res);
+ abort();
+ }
+ size_t num_addrs_from_getaddrinfo = 0;
+ for (struct addrinfo* resp = result; resp != nullptr; resp = resp->ai_next) {
+ num_addrs_from_getaddrinfo++;
+ }
+ GPR_ASSERT(num_addrs_from_getaddrinfo == 1);
+ GPR_ASSERT(result->ai_family == AF_INET6);
+ struct sockaddr_in6 out =
+ *reinterpret_cast<struct sockaddr_in6*>(result->ai_addr);
+ // Cleanup
+ freeaddrinfo(result);
+ gpr_free(host);
+ gpr_free(port);
+ grpc_uri_destroy(uri);
+ return out;
+}
+
+int main(int argc, char** argv) {
+ grpc_test_init(argc, argv);
+ grpc_init();
+ char* arbitrary_interface_name = static_cast<char*>(gpr_zalloc(IF_NAMESIZE));
+ // Per RFC 3493, an interface index is a "small positive integer starts at 1".
+ // Probe candidate interface index numbers until we find one that the
+ // system recognizes, and then use that for the test.
+ for (size_t i = 1; i < 65536; i++) {
+ if (if_indextoname(i, arbitrary_interface_name) != nullptr) {
+ gpr_log(
+ GPR_DEBUG,
+ "Found interface at index %d named %s. Will use this for the test",
+ (int)i, arbitrary_interface_name);
+ break;
+ }
+ }
+ GPR_ASSERT(strlen(arbitrary_interface_name) > 0);
+ char* target = nullptr;
+ gpr_asprintf(&target, "ipv6:[fe80::1234%%%s]:12345",
+ arbitrary_interface_name);
+ struct sockaddr_in6 result_from_getaddrinfo =
+ resolve_with_gettaddrinfo(target);
+ // Run the test
+ gpr_log(GPR_DEBUG,
+ "Run test_grpc_parse_ipv6_parity_with_getaddrinfo with target: %s",
+ target);
+ test_grpc_parse_ipv6_parity_with_getaddrinfo(target, result_from_getaddrinfo);
+ // Cleanup
+ gpr_free(target);
+ gpr_free(arbitrary_interface_name);
+ grpc_shutdown();
+}
diff --git a/test/core/iomgr/BUILD b/test/core/iomgr/BUILD
index e920ceacf0..7daabd5052 100644
--- a/test/core/iomgr/BUILD
+++ b/test/core/iomgr/BUILD
@@ -128,8 +128,25 @@ grpc_cc_test(
)
grpc_cc_test(
- name = "resolve_address_posix_test",
+ name = "resolve_address_using_ares_resolver_posix_test",
srcs = ["resolve_address_posix_test.cc"],
+ args = [
+ "--resolver=ares",
+ ],
+ language = "C++",
+ deps = [
+ "//:gpr",
+ "//:grpc",
+ "//test/core/util:grpc_test_util",
+ ],
+)
+
+grpc_cc_test(
+ name = "resolve_address_using_native_resolver_posix_test",
+ srcs = ["resolve_address_posix_test.cc"],
+ args = [
+ "--resolver=native",
+ ],
language = "C++",
deps = [
"//:gpr",
@@ -237,7 +254,6 @@ 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/resolve_address_posix_test.cc b/test/core/iomgr/resolve_address_posix_test.cc
index 5785c73e22..826c7e1faf 100644
--- a/test/core/iomgr/resolve_address_posix_test.cc
+++ b/test/core/iomgr/resolve_address_posix_test.cc
@@ -18,12 +18,14 @@
#include "src/core/lib/iomgr/resolve_address.h"
+#include <net/if.h>
#include <string.h>
#include <sys/un.h>
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
@@ -33,6 +35,7 @@
#include "src/core/lib/gprpp/thd.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/iomgr.h"
+#include "test/core/util/cmdline.h"
#include "test/core/util/test_config.h"
static gpr_timespec test_deadline(void) {
@@ -117,12 +120,18 @@ static void must_succeed(void* argsp, grpc_error* err) {
GPR_ASSERT(args->addrs != nullptr);
GPR_ASSERT(args->addrs->naddrs > 0);
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);
}
static void must_fail(void* argsp, grpc_error* err) {
args_struct* args = static_cast<args_struct*>(argsp);
GPR_ASSERT(err != GRPC_ERROR_NONE);
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);
}
static void test_unix_socket(void) {
@@ -159,22 +168,92 @@ static void test_unix_socket_path_name_too_long(void) {
args_finish(&args);
}
+static void resolve_address_must_succeed(const char* target) {
+ grpc_core::ExecCtx exec_ctx;
+ args_struct args;
+ args_init(&args);
+ poll_pollset_until_request_done(&args);
+ grpc_resolve_address(
+ target, "1" /* port number */, args.pollset_set,
+ GRPC_CLOSURE_CREATE(must_succeed, &args, grpc_schedule_on_exec_ctx),
+ &args.addrs);
+ grpc_core::ExecCtx::Get()->Flush();
+ args_finish(&args);
+}
+
+static void test_named_and_numeric_scope_ids(void) {
+ char* arbitrary_interface_name = static_cast<char*>(gpr_zalloc(IF_NAMESIZE));
+ int interface_index = 0;
+ // Probe candidate interface index numbers until we find one that the
+ // system recognizes, and then use that for the test.
+ for (size_t i = 1; i < 65536; i++) {
+ if (if_indextoname(i, arbitrary_interface_name) != nullptr) {
+ gpr_log(
+ GPR_DEBUG,
+ "Found interface at index %d named %s. Will use this for the test",
+ (int)i, arbitrary_interface_name);
+ interface_index = (int)i;
+ break;
+ }
+ }
+ GPR_ASSERT(strlen(arbitrary_interface_name) > 0);
+ // Test resolution of an ipv6 address with a named scope ID
+ gpr_log(GPR_DEBUG, "test resolution with a named scope ID");
+ char* target_with_named_scope_id = nullptr;
+ gpr_asprintf(&target_with_named_scope_id, "fe80::1234%%%s",
+ arbitrary_interface_name);
+ resolve_address_must_succeed(target_with_named_scope_id);
+ gpr_free(target_with_named_scope_id);
+ gpr_free(arbitrary_interface_name);
+ // Test resolution of an ipv6 address with a numeric scope ID
+ gpr_log(GPR_DEBUG, "test resolution with a numeric scope ID");
+ char* target_with_numeric_scope_id = nullptr;
+ gpr_asprintf(&target_with_numeric_scope_id, "fe80::1234%%%d",
+ interface_index);
+ resolve_address_must_succeed(target_with_numeric_scope_id);
+ gpr_free(target_with_numeric_scope_id);
+}
+
int main(int argc, char** argv) {
+ // First set the resolver type based off of --resolver
+ const char* resolver_type = nullptr;
+ gpr_cmdline* cl = gpr_cmdline_create("resolve address test");
+ gpr_cmdline_add_string(cl, "resolver", "Resolver type (ares or native)",
+ &resolver_type);
+ // In case that there are more than one argument on the command line,
+ // --resolver will always be the first one, so only parse the first argument
+ // (other arguments may be unknown to cl)
+ gpr_cmdline_parse(cl, argc > 2 ? 2 : argc, argv);
+ const char* cur_resolver = gpr_getenv("GRPC_DNS_RESOLVER");
+ if (cur_resolver != nullptr && strlen(cur_resolver) != 0) {
+ gpr_log(GPR_INFO, "Warning: overriding resolver setting of %s",
+ cur_resolver);
+ }
+ if (gpr_stricmp(resolver_type, "native") == 0) {
+ gpr_setenv("GRPC_DNS_RESOLVER", "native");
+ } else if (gpr_stricmp(resolver_type, "ares") == 0) {
+ gpr_setenv("GRPC_DNS_RESOLVER", "ares");
+ } else {
+ gpr_log(GPR_ERROR, "--resolver_type was not set to ares or native");
+ abort();
+ }
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
{
grpc_core::ExecCtx exec_ctx;
- char* resolver_env = gpr_getenv("GRPC_DNS_RESOLVER");
+ test_named_and_numeric_scope_ids();
// c-ares resolver doesn't support UDS (ability for native DNS resolver
// to handle this is only expected to be used by servers, which
// unconditionally use the native DNS resolver).
+ char* resolver_env = gpr_getenv("GRPC_DNS_RESOLVER");
if (resolver_env == nullptr || gpr_stricmp(resolver_env, "native") == 0) {
test_unix_socket();
test_unix_socket_path_name_too_long();
}
gpr_free(resolver_env);
}
+ gpr_cmdline_destroy(cl);
grpc_shutdown();
return 0;
diff --git a/test/core/iomgr/tcp_server_posix_test.cc b/test/core/iomgr/tcp_server_posix_test.cc
index 2c66cdec77..81e26b20cd 100644
--- a/test/core/iomgr/tcp_server_posix_test.cc
+++ b/test/core/iomgr/tcp_server_posix_test.cc
@@ -439,6 +439,11 @@ int main(int argc, char** argv) {
static_cast<test_addrs*>(gpr_zalloc(sizeof(*dst_addrs)));
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
+ // wait a few seconds to make sure IPv6 link-local addresses can be bound
+ // if we are running under docker container that has just started.
+ // See https://github.com/moby/moby/issues/38491
+ // See https://github.com/grpc/grpc/issues/15610
+ gpr_sleep_until(grpc_timeout_seconds_to_deadline(4));
{
grpc_core::ExecCtx exec_ctx;
g_pollset = static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
diff --git a/test/cpp/end2end/client_interceptors_end2end_test.cc b/test/cpp/end2end/client_interceptors_end2end_test.cc
index 9fbfd8c84a..177922f457 100644
--- a/test/cpp/end2end/client_interceptors_end2end_test.cc
+++ b/test/cpp/end2end/client_interceptors_end2end_test.cc
@@ -516,16 +516,16 @@ class LoggingInterceptor : public experimental::Interceptor {
if (methods->QueryInterceptionHookPoint(
experimental::InterceptionHookPoints::PRE_SEND_MESSAGE)) {
EchoRequest req;
+ EXPECT_EQ(static_cast<const EchoRequest*>(methods->GetSendMessage())
+ ->message()
+ .find("Hello"),
+ 0u);
auto* buffer = methods->GetSerializedSendMessage();
auto copied_buffer = *buffer;
EXPECT_TRUE(
SerializationTraits<EchoRequest>::Deserialize(&copied_buffer, &req)
.ok());
EXPECT_TRUE(req.message().find("Hello") == 0u);
- EXPECT_EQ(static_cast<const EchoRequest*>(methods->GetSendMessage())
- ->message()
- .find("Hello"),
- 0u);
}
if (methods->QueryInterceptionHookPoint(
experimental::InterceptionHookPoints::PRE_SEND_CLOSE)) {
diff --git a/test/cpp/end2end/server_interceptors_end2end_test.cc b/test/cpp/end2end/server_interceptors_end2end_test.cc
index 09e855b0d0..82f142ba91 100644
--- a/test/cpp/end2end/server_interceptors_end2end_test.cc
+++ b/test/cpp/end2end/server_interceptors_end2end_test.cc
@@ -142,29 +142,68 @@ class LoggingInterceptorFactory
}
};
-// Test if GetSendMessage works as expected
-class GetSendMessageTester : public experimental::Interceptor {
+// Test if SendMessage function family works as expected for sync/callback apis
+class SyncSendMessageTester : public experimental::Interceptor {
public:
- GetSendMessageTester(experimental::ServerRpcInfo* info) {}
+ SyncSendMessageTester(experimental::ServerRpcInfo* info) {}
void Intercept(experimental::InterceptorBatchMethods* methods) override {
if (methods->QueryInterceptionHookPoint(
experimental::InterceptionHookPoints::PRE_SEND_MESSAGE)) {
- EXPECT_EQ(static_cast<const EchoRequest*>(methods->GetSendMessage())
- ->message()
- .find("Hello"),
- 0u);
+ string old_msg =
+ static_cast<const EchoRequest*>(methods->GetSendMessage())->message();
+ EXPECT_EQ(old_msg.find("Hello"), 0u);
+ new_msg_.set_message("World" + old_msg);
+ methods->ModifySendMessage(&new_msg_);
}
methods->Proceed();
}
+
+ private:
+ EchoRequest new_msg_;
};
-class GetSendMessageTesterFactory
+class SyncSendMessageTesterFactory
: public experimental::ServerInterceptorFactoryInterface {
public:
virtual experimental::Interceptor* CreateServerInterceptor(
experimental::ServerRpcInfo* info) override {
- return new GetSendMessageTester(info);
+ return new SyncSendMessageTester(info);
+ }
+};
+
+// Test if SendMessage function family works as expected for sync/callback apis
+class SyncSendMessageVerifier : public experimental::Interceptor {
+ public:
+ SyncSendMessageVerifier(experimental::ServerRpcInfo* info) {}
+
+ void Intercept(experimental::InterceptorBatchMethods* methods) override {
+ if (methods->QueryInterceptionHookPoint(
+ experimental::InterceptionHookPoints::PRE_SEND_MESSAGE)) {
+ // Make sure that the changes made in SyncSendMessageTester persisted
+ string old_msg =
+ static_cast<const EchoRequest*>(methods->GetSendMessage())->message();
+ EXPECT_EQ(old_msg.find("World"), 0u);
+
+ // Remove the "World" part of the string that we added earlier
+ new_msg_.set_message(old_msg.erase(0, 5));
+ methods->ModifySendMessage(&new_msg_);
+
+ // LoggingInterceptor verifies that changes got reverted
+ }
+ methods->Proceed();
+ }
+
+ private:
+ EchoRequest new_msg_;
+};
+
+class SyncSendMessageVerifierFactory
+ : public experimental::ServerInterceptorFactoryInterface {
+ public:
+ virtual experimental::Interceptor* CreateServerInterceptor(
+ experimental::ServerRpcInfo* info) override {
+ return new SyncSendMessageVerifier(info);
}
};
@@ -201,10 +240,13 @@ class ServerInterceptorsEnd2endSyncUnaryTest : public ::testing::Test {
creators;
creators.push_back(
std::unique_ptr<experimental::ServerInterceptorFactoryInterface>(
- new LoggingInterceptorFactory()));
+ new SyncSendMessageTesterFactory()));
creators.push_back(
std::unique_ptr<experimental::ServerInterceptorFactoryInterface>(
- new GetSendMessageTesterFactory()));
+ new SyncSendMessageVerifierFactory()));
+ creators.push_back(
+ std::unique_ptr<experimental::ServerInterceptorFactoryInterface>(
+ new LoggingInterceptorFactory()));
// Add 20 dummy interceptor factories and null interceptor factories
for (auto i = 0; i < 20; i++) {
creators.push_back(std::unique_ptr<DummyInterceptorFactory>(
@@ -244,10 +286,13 @@ class ServerInterceptorsEnd2endSyncStreamingTest : public ::testing::Test {
creators;
creators.push_back(
std::unique_ptr<experimental::ServerInterceptorFactoryInterface>(
- new LoggingInterceptorFactory()));
+ new SyncSendMessageTesterFactory()));
creators.push_back(
std::unique_ptr<experimental::ServerInterceptorFactoryInterface>(
- new GetSendMessageTesterFactory()));
+ new SyncSendMessageVerifierFactory()));
+ creators.push_back(
+ std::unique_ptr<experimental::ServerInterceptorFactoryInterface>(
+ new LoggingInterceptorFactory()));
for (auto i = 0; i < 20; i++) {
creators.push_back(std::unique_ptr<DummyInterceptorFactory>(
new DummyInterceptorFactory()));
diff --git a/test/cpp/microbenchmarks/bm_call_create.cc b/test/cpp/microbenchmarks/bm_call_create.cc
index 8d12606434..125b1ce5c4 100644
--- a/test/cpp/microbenchmarks/bm_call_create.cc
+++ b/test/cpp/microbenchmarks/bm_call_create.cc
@@ -326,7 +326,7 @@ class FakeClientChannelFactory : public grpc_client_channel_factory {
static void NoRef(grpc_client_channel_factory* factory) {}
static void NoUnref(grpc_client_channel_factory* factory) {}
static grpc_subchannel* CreateSubchannel(grpc_client_channel_factory* factory,
- const grpc_subchannel_args* args) {
+ const grpc_channel_args* args) {
return nullptr;
}
static grpc_channel* CreateClientChannel(grpc_client_channel_factory* factory,
diff --git a/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc b/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc
index dca97c85b1..7aa197b597 100644
--- a/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc
+++ b/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc
@@ -94,6 +94,7 @@ static const grpc_event_engine_vtable* init_engine_vtable(bool) {
g_vtable.pollset_destroy = pollset_destroy;
g_vtable.pollset_work = pollset_work;
g_vtable.pollset_kick = pollset_kick;
+ g_vtable.is_any_background_poller_thread = [] { return false; };
g_vtable.shutdown_background_closure = [] {};
g_vtable.shutdown_engine = [] {};
diff --git a/test/cpp/qps/gen_build_yaml.py b/test/cpp/qps/gen_build_yaml.py
index fb2caf5486..8ca0dc6a62 100755
--- a/test/cpp/qps/gen_build_yaml.py
+++ b/test/cpp/qps/gen_build_yaml.py
@@ -131,4 +131,4 @@ def generate_yaml():
}
-print(yaml.dump(generate_yaml())) \ No newline at end of file
+print(yaml.dump(generate_yaml()))
diff --git a/tools/dockerfile/interoptest/grpc_interop_go1.11/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_go1.11/Dockerfile
new file mode 100644
index 0000000000..0892bc3459
--- /dev/null
+++ b/tools/dockerfile/interoptest/grpc_interop_go1.11/Dockerfile
@@ -0,0 +1,36 @@
+# 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 golang:1.11
+
+# Using login shell removes Go from path, so we add it.
+RUN ln -s /usr/local/go/bin/go /usr/local/bin
+
+#====================
+# Python dependencies
+
+# Install dependencies
+
+RUN apt-get update && apt-get install -y \
+ python-all-dev \
+ python3-all-dev \
+ python-pip
+
+# Install Python packages from PyPI
+RUN pip install --upgrade pip==10.0.1
+RUN pip install virtualenv
+RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0
+
+# Define the default command.
+CMD ["bash"]
diff --git a/tools/dockerfile/interoptest/grpc_interop_go1.11/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_go1.11/build_interop.sh
new file mode 100644
index 0000000000..b11ace3a4e
--- /dev/null
+++ b/tools/dockerfile/interoptest/grpc_interop_go1.11/build_interop.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+# 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.
+#
+# Builds Go interop server and client in a base image.
+set -e
+
+# Clone just the grpc-go source code without any dependencies.
+# We are cloning from a local git repo that contains the right revision
+# to test instead of using "go get" to download from Github directly.
+git clone --recursive /var/local/jenkins/grpc-go src/google.golang.org/grpc
+
+# Get all gRPC Go dependencies
+(cd src/google.golang.org/grpc && make deps && make testdeps)
+
+# copy service account keys if available
+cp -r /var/local/jenkins/service_account $HOME || true
+
+# Build the interop client and server
+(cd src/google.golang.org/grpc/interop/client && go install)
+(cd src/google.golang.org/grpc/interop/server && go install)
+
diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal
index 6c31a46768..a76a261d07 100644
--- a/tools/doxygen/Doxyfile.c++.internal
+++ b/tools/doxygen/Doxyfile.c++.internal
@@ -1100,6 +1100,7 @@ src/core/lib/iomgr/ev_posix.h \
src/core/lib/iomgr/exec_ctx.h \
src/core/lib/iomgr/executor.h \
src/core/lib/iomgr/gethostname.h \
+src/core/lib/iomgr/grpc_if_nametoindex.h \
src/core/lib/iomgr/internal_errqueue.h \
src/core/lib/iomgr/iocp_windows.h \
src/core/lib/iomgr/iomgr.h \
diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal
index ba2eaecafd..38d17b6f21 100644
--- a/tools/doxygen/Doxyfile.core.internal
+++ b/tools/doxygen/Doxyfile.core.internal
@@ -1214,6 +1214,9 @@ src/core/lib/iomgr/gethostname.h \
src/core/lib/iomgr/gethostname_fallback.cc \
src/core/lib/iomgr/gethostname_host_name_max.cc \
src/core/lib/iomgr/gethostname_sysconf.cc \
+src/core/lib/iomgr/grpc_if_nametoindex.h \
+src/core/lib/iomgr/grpc_if_nametoindex_posix.cc \
+src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc \
src/core/lib/iomgr/internal_errqueue.cc \
src/core/lib/iomgr/internal_errqueue.h \
src/core/lib/iomgr/iocp_windows.cc \
diff --git a/tools/internal_ci/helper_scripts/prepare_build_macos_rc b/tools/internal_ci/helper_scripts/prepare_build_macos_rc
index 632db5ae14..5b6b256939 100644
--- a/tools/internal_ci/helper_scripts/prepare_build_macos_rc
+++ b/tools/internal_ci/helper_scripts/prepare_build_macos_rc
@@ -38,6 +38,8 @@ if [ -n "$KOKORO_GITHUB_PULL_REQUEST_NUMBER" ]; then
fi
set +ex # rvm script is very verbose and exits with errorcode
+# Advice from https://github.com/Homebrew/homebrew-cask/issues/8629#issuecomment-68641176
+brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup
source $HOME/.rvm/scripts/rvm
set -e # rvm commands are very verbose
time rvm install 2.5.0
diff --git a/tools/interop_matrix/README.md b/tools/interop_matrix/README.md
index db84d9b454..ecd71be7f8 100644
--- a/tools/interop_matrix/README.md
+++ b/tools/interop_matrix/README.md
@@ -1,6 +1,6 @@
# Overview
-This directory contains scripts that facilitate building and running gRPC tests for combinations of language/runtimes (known as matrix).
+This directory contains scripts that facilitate building and running gRPC interoperability tests for combinations of language/runtimes (known as matrix).
The setup builds gRPC docker images for each language/runtime and upload it to Google Container Registry (GCR). These images, encapsulating gRPC stack
from specific releases/tag, are used to test version compatiblity between gRPC release versions.
@@ -11,8 +11,9 @@ We have continuous nightly test setup to test gRPC backward compatibility betwee
- Build new client docker image(s). For example, for C and wrapper languages release `v1.9.9`, do
- `tools/interop_matrix/create_matrix_images.py --git_checkout --release=v1.9.9 --upload_images --language cxx csharp python ruby php`
- Verify that the new docker image was built successfully and uploaded to GCR. For example,
- - `gcloud beta container images list --repository gcr.io/grpc-testing` shows image repos.
- - `gcloud beta container images list-tags gcr.io/grpc-testing/grpc_interop_java_oracle8` should show an image entry with tag `v1.9.9`.
+ - `gcloud container images list --repository gcr.io/grpc-testing` lists available images.
+ - `gcloud container images list-tags gcr.io/grpc-testing/grpc_interop_java_oracle8` should show an image entry with tag `v1.9.9`.
+ - images can also be viewed in https://pantheon.corp.google.com/gcr/images/grpc-testing?project=grpc-testing
- Verify the just-created docker client image would pass backward compatibility test (it should). For example,
- `gcloud docker -- pull gcr.io/grpc-testing/grpc_interop_java_oracle8:v1.9.9` followed by
- `docker_image=gcr.io/grpc-testing/grpc_interop_java_oracle8:v1.9.9 tools/interop_matrix/testcases/java__master`
@@ -20,13 +21,11 @@ We have continuous nightly test setup to test gRPC backward compatibility betwee
- (Optional) clean up the tmp directory to where grpc source is cloned at `/export/hda3/tmp/grpc_matrix/`.
For more details on each step, refer to sections below.
-## Instructions for adding new language/runtimes*
+## Instructions for adding new language/runtimes
- Create new `Dockerfile.template`, `build_interop.sh.template` for the language/runtime under `template/tools/dockerfile/`.
- Run `tools/buildgen/generate_projects.sh` to create corresponding files under `tools/dockerfile/`.
- Add language/runtimes to `client_matrix.py` following existing language/runtimes examples.
-- Run `tools/interop_matrix/create_matrix_images.py` which will build and upload images to GCR. Unless you are also building images for a gRPC release, make sure not to set `--release` (the default release 'master' is used for testing).
-
-*: Please delete your docker images at https://pantheon.corp.google.com/gcr/images/grpc-testing?project=grpc-testing afterwards. Permissions to access GrpcTesting project is required for this step.
+- Run `tools/interop_matrix/create_matrix_images.py` which will build (and upload) images to GCR.
## Instructions for creating new test cases
- Create test cases by running `LANG=<lang> [RELEASE=<release>] ./create_testcases.sh`. For example,
@@ -39,13 +38,13 @@ For more details on each step, refer to sections below.
- `--release` specifies a git release tag. Defaults to `--release=all`. Make sure the GCR images with the tag have been created using `create_matrix_images.py` above.
- `--language` specifies a language. Defaults to `--language=all`.
For example, To test all languages for all gRPC releases across all runtimes, do `tools/interop_matrix/run_interop_matrix_test.py --release=all`.
-- The output for all the test cases is recorded in a junit style xml file (default to 'report.xml').
+- The output for all the test cases is recorded in a junit style xml file (defaults to 'report.xml').
## Instructions for running test cases against a GCR image manually
-- Download docker image from GCR. For example: `gcloud docker -- pull gcr.io/grpc-testing/grpc_interop_go1.7:master`.
+- Download docker image from GCR. For example: `gcloud docker -- pull gcr.io/grpc-testing/grpc_interop_go1.8:v1.16.0`.
- Run test cases by specifying `docker_image` variable inline with the test case script created above.
For example:
- - `docker_image=gcr.io/grpc-testing/grpc_interop_go1.7:master ./testcases/go__master` will run go__master test cases against `go1.7` with gRPC release `master` docker image in GCR.
+ - `docker_image=gcr.io/grpc-testing/grpc_interop_go1.8:v1.16.0 ./testcases/go__master` will run go__master test cases against `go1.8` with gRPC release `v1.16.0` docker image in GCR.
Note:
- File path starting with `tools/` or `template/` are relative to the grpc repo root dir. File path starting with `./` are relative to current directory (`tools/interop_matrix`).
diff --git a/tools/interop_matrix/client_matrix.py b/tools/interop_matrix/client_matrix.py
index c0b08a59b2..655c7c7b6b 100644
--- a/tools/interop_matrix/client_matrix.py
+++ b/tools/interop_matrix/client_matrix.py
@@ -15,6 +15,8 @@
# Defines languages, runtimes and releases for backward compatibility testing
+from collections import OrderedDict
+
def get_github_repo(lang):
return {
@@ -27,15 +29,27 @@ def get_github_repo(lang):
def get_release_tags(lang):
- return map(lambda r: get_release_tag_name(r), LANG_RELEASE_MATRIX[lang])
+ """Returns list of known releases for given language."""
+ return list(LANG_RELEASE_MATRIX[lang].keys())
+
+def get_runtimes_for_lang_release(lang, release):
+ """Get list of valid runtimes for given release of lang."""
+ runtimes = list(LANG_RUNTIME_MATRIX[lang])
+ release_info = LANG_RELEASE_MATRIX[lang].get(release)
+ if release_info and release_info.runtime_subset:
+ runtimes = list(release_info.runtime_subset)
-def get_release_tag_name(release_info):
- assert len(release_info.keys()) == 1
- return release_info.keys()[0]
+ # check that all selected runtimes are valid for given language
+ for runtime in runtimes:
+ assert runtime in LANG_RUNTIME_MATRIX[lang]
+ return runtimes
def should_build_docker_interop_image_from_release_tag(lang):
+ # All dockerfile definitions live in grpc/grpc repository.
+ # For language that have a separate repo, we need to use
+ # dockerfile definitions from head of grpc/grpc.
if lang in ['go', 'java', 'node']:
return False
return True
@@ -44,7 +58,7 @@ def should_build_docker_interop_image_from_release_tag(lang):
# Dictionary of runtimes per language
LANG_RUNTIME_MATRIX = {
'cxx': ['cxx'], # This is actually debian8.
- 'go': ['go1.7', 'go1.8'],
+ 'go': ['go1.8', 'go1.11'],
'java': ['java_oracle8'],
'python': ['python'],
'node': ['node'],
@@ -53,428 +67,183 @@ LANG_RUNTIME_MATRIX = {
'csharp': ['csharp', 'csharpcoreclr'],
}
+
+class ReleaseInfo:
+ """Info about a single release of a language"""
+
+ def __init__(self, patch=[], runtime_subset=[], testcases_file=None):
+ self.patch = patch
+ self.runtime_subset = runtime_subset
+ self.testcases_file = None
+
+
# Dictionary of known releases for given language.
LANG_RELEASE_MATRIX = {
- 'cxx': [
- {
- 'v1.0.1': None
- },
- {
- 'v1.1.4': None
- },
- {
- 'v1.2.5': None
- },
- {
- 'v1.3.9': None
- },
- {
- 'v1.4.2': None
- },
- {
- 'v1.6.6': None
- },
- {
- 'v1.7.2': None
- },
- {
- 'v1.8.0': None
- },
- {
- 'v1.9.1': None
- },
- {
- 'v1.10.1': None
- },
- {
- 'v1.11.1': None
- },
- {
- 'v1.12.0': None
- },
- {
- 'v1.13.0': None
- },
- {
- 'v1.14.1': None
- },
- {
- 'v1.15.0': None
- },
- {
- 'v1.16.0': None
- },
- {
- 'v1.17.1': None
- },
- ],
- 'go': [
- {
- 'v1.0.5': None
- },
- {
- 'v1.2.1': None
- },
- {
- 'v1.3.0': None
- },
- {
- 'v1.4.2': None
- },
- {
- 'v1.5.2': None
- },
- {
- 'v1.6.0': None
- },
- {
- 'v1.7.4': None
- },
- {
- 'v1.8.2': None
- },
- {
- 'v1.9.2': None
- },
- {
- 'v1.10.1': None
- },
- {
- 'v1.11.3': None
- },
- {
- 'v1.12.2': None
- },
- {
- 'v1.13.0': None
- },
- {
- 'v1.14.0': None
- },
- {
- 'v1.15.0': None
- },
- {
- 'v1.16.0': None
- },
- ],
- 'java': [
- {
- 'v1.0.3': None
- },
- {
- 'v1.1.2': None
- },
- {
- 'v1.2.0': None
- },
- {
- 'v1.3.1': None
- },
- {
- 'v1.4.0': None
- },
- {
- 'v1.5.0': None
- },
- {
- 'v1.6.1': None
- },
- {
- 'v1.7.0': None
- },
- {
- 'v1.8.0': None
- },
- {
- 'v1.9.1': None
- },
- {
- 'v1.10.1': None
- },
- {
- 'v1.11.0': None
- },
- {
- 'v1.12.0': None
- },
- {
- 'v1.13.1': None
- },
- {
- 'v1.14.0': None
- },
- {
- 'v1.15.0': None
- },
- {
- 'v1.16.1': None
- },
- {
- 'v1.17.1': None
- },
- ],
- 'python': [
- {
- 'v1.0.x': None
- },
- {
- 'v1.1.4': None
- },
- {
- 'v1.2.5': None
- },
- {
- 'v1.3.9': None
- },
- {
- 'v1.4.2': None
- },
- {
- 'v1.6.6': None
- },
- {
- 'v1.7.2': None
- },
- {
- 'v1.8.1': None # first python 1.8 release is 1.8.1
- },
- {
- 'v1.9.1': None
- },
- {
- 'v1.10.1': None
- },
- {
- 'v1.11.1': None
- },
- {
- 'v1.12.0': None
- },
- {
- 'v1.13.0': None
- },
- {
- 'v1.14.1': None
- },
- {
- 'v1.15.0': None
- },
- {
- 'v1.16.0': None
- },
- {
- 'v1.17.1': None
- },
- ],
- 'node': [
- {
- 'v1.0.1': None
- },
- {
- 'v1.1.4': None
- },
- {
- 'v1.2.5': None
- },
- {
- 'v1.3.9': None
- },
- {
- 'v1.4.2': None
- },
- {
- 'v1.6.6': None
- },
+ 'cxx':
+ OrderedDict([
+ ('v1.0.1', ReleaseInfo()),
+ ('v1.1.4', ReleaseInfo()),
+ ('v1.2.5', ReleaseInfo()),
+ ('v1.3.9', ReleaseInfo()),
+ ('v1.4.2', ReleaseInfo()),
+ ('v1.6.6', ReleaseInfo()),
+ ('v1.7.2', ReleaseInfo()),
+ ('v1.8.0', ReleaseInfo()),
+ ('v1.9.1', ReleaseInfo()),
+ ('v1.10.1', ReleaseInfo()),
+ ('v1.11.1', ReleaseInfo()),
+ ('v1.12.0', ReleaseInfo()),
+ ('v1.13.0', ReleaseInfo()),
+ ('v1.14.1', ReleaseInfo()),
+ ('v1.15.0', ReleaseInfo()),
+ ('v1.16.0', ReleaseInfo()),
+ ('v1.17.1', ReleaseInfo()),
+ ]),
+ 'go':
+ OrderedDict([
+ ('v1.0.5', ReleaseInfo(runtime_subset=['go1.8'])),
+ ('v1.2.1', ReleaseInfo(runtime_subset=['go1.8'])),
+ ('v1.3.0', ReleaseInfo(runtime_subset=['go1.8'])),
+ ('v1.4.2', ReleaseInfo(runtime_subset=['go1.8'])),
+ ('v1.5.2', ReleaseInfo(runtime_subset=['go1.8'])),
+ ('v1.6.0', ReleaseInfo(runtime_subset=['go1.8'])),
+ ('v1.7.4', ReleaseInfo(runtime_subset=['go1.8'])),
+ ('v1.8.2', ReleaseInfo(runtime_subset=['go1.8'])),
+ ('v1.9.2', ReleaseInfo(runtime_subset=['go1.8'])),
+ ('v1.10.1', ReleaseInfo(runtime_subset=['go1.8'])),
+ ('v1.11.3', ReleaseInfo(runtime_subset=['go1.8'])),
+ ('v1.12.2', ReleaseInfo(runtime_subset=['go1.8'])),
+ ('v1.13.0', ReleaseInfo(runtime_subset=['go1.8'])),
+ ('v1.14.0', ReleaseInfo(runtime_subset=['go1.8'])),
+ ('v1.15.0', ReleaseInfo(runtime_subset=['go1.8'])),
+ ('v1.16.0', ReleaseInfo(runtime_subset=['go1.8'])),
+ ('v1.17.0', ReleaseInfo(runtime_subset=['go1.11'])),
+ ]),
+ 'java':
+ OrderedDict([
+ ('v1.0.3', ReleaseInfo()),
+ ('v1.1.2', ReleaseInfo()),
+ ('v1.2.0', ReleaseInfo()),
+ ('v1.3.1', ReleaseInfo()),
+ ('v1.4.0', ReleaseInfo()),
+ ('v1.5.0', ReleaseInfo()),
+ ('v1.6.1', ReleaseInfo()),
+ ('v1.7.0', ReleaseInfo()),
+ ('v1.8.0', ReleaseInfo()),
+ ('v1.9.1', ReleaseInfo()),
+ ('v1.10.1', ReleaseInfo()),
+ ('v1.11.0', ReleaseInfo()),
+ ('v1.12.0', ReleaseInfo()),
+ ('v1.13.1', ReleaseInfo()),
+ ('v1.14.0', ReleaseInfo()),
+ ('v1.15.0', ReleaseInfo()),
+ ('v1.16.1', ReleaseInfo()),
+ ('v1.17.1', ReleaseInfo()),
+ ]),
+ 'python':
+ OrderedDict([
+ ('v1.0.x', ReleaseInfo()),
+ ('v1.1.4', ReleaseInfo()),
+ ('v1.2.5', ReleaseInfo()),
+ ('v1.3.9', ReleaseInfo()),
+ ('v1.4.2', ReleaseInfo()),
+ ('v1.6.6', ReleaseInfo()),
+ ('v1.7.2', ReleaseInfo()),
+ ('v1.8.1', ReleaseInfo()),
+ ('v1.9.1', ReleaseInfo()),
+ ('v1.10.1', ReleaseInfo()),
+ ('v1.11.1', ReleaseInfo()),
+ ('v1.12.0', ReleaseInfo()),
+ ('v1.13.0', ReleaseInfo()),
+ ('v1.14.1', ReleaseInfo()),
+ ('v1.15.0', ReleaseInfo()),
+ ('v1.16.0', ReleaseInfo()),
+ ('v1.17.1', ReleaseInfo()),
+ ]),
+ 'node':
+ OrderedDict([
+ ('v1.0.1', ReleaseInfo()),
+ ('v1.1.4', ReleaseInfo()),
+ ('v1.2.5', ReleaseInfo()),
+ ('v1.3.9', ReleaseInfo()),
+ ('v1.4.2', ReleaseInfo()),
+ ('v1.6.6', ReleaseInfo()),
# TODO: https://github.com/grpc/grpc-node/issues/235.
- #{
- # 'v1.7.2': None
- #},
- {
- 'v1.8.4': None
- },
- {
- 'v1.9.1': None
- },
- {
- 'v1.10.0': None
- },
- {
- 'v1.11.3': None
- },
- {
- 'v1.12.4': None
- },
- ],
- 'ruby': [
- {
- 'v1.0.1': {
- 'patch': [
- 'tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile',
- 'tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh',
- ]
- }
- },
- {
- 'v1.1.4': None
- },
- {
- 'v1.2.5': None
- },
- {
- 'v1.3.9': None
- },
- {
- 'v1.4.2': None
- },
- {
- 'v1.6.6': None
- },
- {
- 'v1.7.2': None
- },
- {
- 'v1.8.0': None
- },
- {
- 'v1.9.1': None
- },
- {
- 'v1.10.1': None
- },
- {
- 'v1.11.1': None
- },
- {
- 'v1.12.0': None
- },
- {
- 'v1.13.0': None
- },
- {
- 'v1.14.1': None
- },
- {
- 'v1.15.0': None
- },
- {
- 'v1.16.0': None
- },
- {
- 'v1.17.1': None
- },
- ],
- 'php': [
- {
- 'v1.0.1': None
- },
- {
- 'v1.1.4': None
- },
- {
- 'v1.2.5': None
- },
- {
- 'v1.3.9': None
- },
- {
- 'v1.4.2': None
- },
- {
- 'v1.6.6': None
- },
- {
- 'v1.7.2': None
- },
- {
- 'v1.8.0': None
- },
- {
- 'v1.9.1': None
- },
- {
- 'v1.10.1': None
- },
- {
- 'v1.11.1': None
- },
- {
- 'v1.12.0': None
- },
- {
- 'v1.13.0': None
- },
- {
- 'v1.14.1': None
- },
- {
- 'v1.15.0': None
- },
- {
- 'v1.16.0': None
- },
- {
- 'v1.17.1': None
- },
- ],
- 'csharp': [
- {
- 'v1.0.1': {
- 'patch': [
- 'tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile',
- 'tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile',
- ]
- }
- },
- {
- 'v1.1.4': None
- },
- {
- 'v1.2.5': None
- },
- {
- 'v1.3.9': None
- },
- {
- 'v1.4.2': None
- },
- {
- 'v1.6.6': None
- },
- {
- 'v1.7.2': None
- },
- {
- 'v1.8.0': None
- },
- {
- 'v1.9.1': None
- },
- {
- 'v1.10.1': None
- },
- {
- 'v1.11.1': None
- },
- {
- 'v1.12.0': None
- },
- {
- 'v1.13.0': None
- },
- {
- 'v1.14.1': None
- },
- {
- 'v1.15.0': None
- },
- {
- 'v1.16.0': None
- },
- {
- 'v1.17.1': None
- },
- ],
+ # ('v1.7.2', ReleaseInfo()),
+ ('v1.8.4', ReleaseInfo()),
+ ('v1.9.1', ReleaseInfo()),
+ ('v1.10.0', ReleaseInfo()),
+ ('v1.11.3', ReleaseInfo()),
+ ('v1.12.4', ReleaseInfo()),
+ ]),
+ 'ruby':
+ OrderedDict([
+ ('v1.0.1',
+ ReleaseInfo(patch=[
+ 'tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile',
+ 'tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh',
+ ])),
+ ('v1.1.4', ReleaseInfo()),
+ ('v1.2.5', ReleaseInfo()),
+ ('v1.3.9', ReleaseInfo()),
+ ('v1.4.2', ReleaseInfo()),
+ ('v1.6.6', ReleaseInfo()),
+ ('v1.7.2', ReleaseInfo()),
+ ('v1.8.0', ReleaseInfo()),
+ ('v1.9.1', ReleaseInfo()),
+ ('v1.10.1', ReleaseInfo()),
+ ('v1.11.1', ReleaseInfo()),
+ ('v1.12.0', ReleaseInfo()),
+ ('v1.13.0', ReleaseInfo()),
+ ('v1.14.1', ReleaseInfo()),
+ ('v1.15.0', ReleaseInfo()),
+ ('v1.16.0', ReleaseInfo()),
+ ('v1.17.1', ReleaseInfo()),
+ ]),
+ 'php':
+ OrderedDict([
+ ('v1.0.1', ReleaseInfo()),
+ ('v1.1.4', ReleaseInfo()),
+ ('v1.2.5', ReleaseInfo()),
+ ('v1.3.9', ReleaseInfo()),
+ ('v1.4.2', ReleaseInfo()),
+ ('v1.6.6', ReleaseInfo()),
+ ('v1.7.2', ReleaseInfo()),
+ ('v1.8.0', ReleaseInfo()),
+ ('v1.9.1', ReleaseInfo()),
+ ('v1.10.1', ReleaseInfo()),
+ ('v1.11.1', ReleaseInfo()),
+ ('v1.12.0', ReleaseInfo()),
+ ('v1.13.0', ReleaseInfo()),
+ ('v1.14.1', ReleaseInfo()),
+ ('v1.15.0', ReleaseInfo()),
+ ('v1.16.0', ReleaseInfo()),
+ ('v1.17.1', ReleaseInfo()),
+ ]),
+ 'csharp':
+ OrderedDict([
+ ('v1.0.1',
+ ReleaseInfo(patch=[
+ 'tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile',
+ 'tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile',
+ ])),
+ ('v1.1.4', ReleaseInfo()),
+ ('v1.2.5', ReleaseInfo()),
+ ('v1.3.9', ReleaseInfo()),
+ ('v1.4.2', ReleaseInfo()),
+ ('v1.6.6', ReleaseInfo()),
+ ('v1.7.2', ReleaseInfo()),
+ ('v1.8.0', ReleaseInfo()),
+ ('v1.9.1', ReleaseInfo()),
+ ('v1.10.1', ReleaseInfo()),
+ ('v1.11.1', ReleaseInfo()),
+ ('v1.12.0', ReleaseInfo()),
+ ('v1.13.0', ReleaseInfo()),
+ ('v1.14.1', ReleaseInfo()),
+ ('v1.15.0', ReleaseInfo()),
+ ('v1.16.0', ReleaseInfo()),
+ ('v1.17.1', ReleaseInfo()),
+ ]),
}
# This matrix lists the version of testcases to use for a release. As new
@@ -483,6 +252,8 @@ LANG_RELEASE_MATRIX = {
# particular version in some cases. If not specified, xxx__master file will be
# used. For example, all java versions will run the commands in java__master.
# The testcases files exist under the testcases directory.
+# TODO(jtattermusch): make this data part of LANG_RELEASE_MATRIX,
+# there is no reason for this to be a separate data structure.
TESTCASES_VERSION_MATRIX = {
'node_v1.0.1': 'node__v1.0.1',
'node_v1.1.4': 'node__v1.1.4',
diff --git a/tools/interop_matrix/create_matrix_images.py b/tools/interop_matrix/create_matrix_images.py
index c2568efba0..28dc4be0f4 100755
--- a/tools/interop_matrix/create_matrix_images.py
+++ b/tools/interop_matrix/create_matrix_images.py
@@ -39,10 +39,9 @@ _LANGUAGES = client_matrix.LANG_RUNTIME_MATRIX.keys()
# All gRPC release tags, flattened, deduped and sorted.
_RELEASES = sorted(
list(
- set(
- client_matrix.get_release_tag_name(info)
- for lang in client_matrix.LANG_RELEASE_MATRIX.values()
- for info in lang)))
+ set(release
+ for release_dict in client_matrix.LANG_RELEASE_MATRIX.values()
+ for release in release_dict.keys())))
# Destination directory inside docker image to keep extra info from build time.
_BUILD_INFO = '/var/local/build_info'
@@ -217,7 +216,7 @@ def build_all_images_for_release(lang, release):
}.get(lang, 'GRPC_ROOT')
env[var] = stack_base
- for runtime in client_matrix.LANG_RUNTIME_MATRIX[lang]:
+ for runtime in client_matrix.get_runtimes_for_lang_release(lang, release):
job = build_image_jobspec(runtime, env, release, stack_base)
docker_images.append(job.tag)
build_jobs.append(job)
@@ -260,11 +259,10 @@ atexit.register(cleanup)
def maybe_apply_patches_on_git_tag(stack_base, lang, release):
files_to_patch = []
- for release_info in client_matrix.LANG_RELEASE_MATRIX[lang]:
- if client_matrix.get_release_tag_name(release_info) == release:
- if release_info[release] is not None:
- files_to_patch = release_info[release].get('patch')
- break
+
+ release_info = client_matrix.LANG_RELEASE_MATRIX[lang].get(release)
+ if release_info:
+ files_to_patch = release_info.patch
if not files_to_patch:
return
patch_file_relative_path = 'patches/%s_%s/git_repo.patch' % (lang, release)
diff --git a/tools/interop_matrix/run_interop_matrix_tests.py b/tools/interop_matrix/run_interop_matrix_tests.py
index d47b0ee0f7..c855de3b1e 100755
--- a/tools/interop_matrix/run_interop_matrix_tests.py
+++ b/tools/interop_matrix/run_interop_matrix_tests.py
@@ -44,10 +44,9 @@ _LANGUAGES = client_matrix.LANG_RUNTIME_MATRIX.keys()
# All gRPC release tags, flattened, deduped and sorted.
_RELEASES = sorted(
list(
- set(
- client_matrix.get_release_tag_name(info)
- for lang in client_matrix.LANG_RELEASE_MATRIX.values()
- for info in lang)))
+ set(release
+ for release_dict in client_matrix.LANG_RELEASE_MATRIX.values()
+ for release in release_dict.keys())))
argp = argparse.ArgumentParser(description='Run interop tests.')
argp.add_argument('-j', '--jobs', default=multiprocessing.cpu_count(), type=int)
@@ -113,13 +112,17 @@ def _get_test_images_for_lang(lang, release_arg, image_path_prefix):
return {}
releases = [release_arg]
- # Images tuples keyed by runtime.
+ # Image tuples keyed by runtime.
images = {}
- for runtime in client_matrix.LANG_RUNTIME_MATRIX[lang]:
- image_path = '%s/grpc_interop_%s' % (image_path_prefix, runtime)
- images[runtime] = [
- (tag, '%s:%s' % (image_path, tag)) for tag in releases
- ]
+ for tag in releases:
+ for runtime in client_matrix.get_runtimes_for_lang_release(lang, tag):
+ image_name = '%s/grpc_interop_%s:%s' % (image_path_prefix, runtime,
+ tag)
+ image_tuple = (tag, image_name)
+
+ if not images.has_key(runtime):
+ images[runtime] = []
+ images[runtime].append(image_tuple)
return images
diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json
index 8d1bca22be..1478ac2cd5 100644
--- a/tools/run_tests/generated/sources_and_headers.json
+++ b/tools/run_tests/generated/sources_and_headers.json
@@ -1731,6 +1731,22 @@
"headers": [],
"is_filegroup": false,
"language": "c",
+ "name": "parse_address_with_named_scope_id_test",
+ "src": [
+ "test/core/client_channel/parse_address_with_named_scope_id_test.cc"
+ ],
+ "third_party": false,
+ "type": "target"
+ },
+ {
+ "deps": [
+ "gpr",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "is_filegroup": false,
+ "language": "c",
"name": "percent_decode_fuzzer",
"src": [
"test/core/slice/percent_decode_fuzzer.cc"
@@ -1779,7 +1795,7 @@
"headers": [],
"is_filegroup": false,
"language": "c",
- "name": "resolve_address_posix_test",
+ "name": "resolve_address_using_ares_resolver_posix_test",
"src": [
"test/core/iomgr/resolve_address_posix_test.cc"
],
@@ -1811,6 +1827,22 @@
"headers": [],
"is_filegroup": false,
"language": "c",
+ "name": "resolve_address_using_native_resolver_posix_test",
+ "src": [
+ "test/core/iomgr/resolve_address_posix_test.cc"
+ ],
+ "third_party": false,
+ "type": "target"
+ },
+ {
+ "deps": [
+ "gpr",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "is_filegroup": false,
+ "language": "c",
"name": "resolve_address_using_native_resolver_test",
"src": [
"test/core/iomgr/resolve_address_test.cc"
@@ -9371,6 +9403,8 @@
"src/core/lib/iomgr/gethostname_fallback.cc",
"src/core/lib/iomgr/gethostname_host_name_max.cc",
"src/core/lib/iomgr/gethostname_sysconf.cc",
+ "src/core/lib/iomgr/grpc_if_nametoindex_posix.cc",
+ "src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc",
"src/core/lib/iomgr/internal_errqueue.cc",
"src/core/lib/iomgr/iocp_windows.cc",
"src/core/lib/iomgr/iomgr.cc",
@@ -9548,6 +9582,7 @@
"src/core/lib/iomgr/exec_ctx.h",
"src/core/lib/iomgr/executor.h",
"src/core/lib/iomgr/gethostname.h",
+ "src/core/lib/iomgr/grpc_if_nametoindex.h",
"src/core/lib/iomgr/internal_errqueue.h",
"src/core/lib/iomgr/iocp_windows.h",
"src/core/lib/iomgr/iomgr.h",
@@ -9701,6 +9736,7 @@
"src/core/lib/iomgr/exec_ctx.h",
"src/core/lib/iomgr/executor.h",
"src/core/lib/iomgr/gethostname.h",
+ "src/core/lib/iomgr/grpc_if_nametoindex.h",
"src/core/lib/iomgr/internal_errqueue.h",
"src/core/lib/iomgr/iocp_windows.h",
"src/core/lib/iomgr/iomgr.h",
diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json
index e35d4db276..f2d0cab5ed 100644
--- a/tools/run_tests/generated/tests.json
+++ b/tools/run_tests/generated/tests.json
@@ -2063,6 +2063,28 @@
"ci_platforms": [
"linux",
"mac",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [],
+ "flaky": false,
+ "gtest": false,
+ "language": "c",
+ "name": "parse_address_with_named_scope_id_test",
+ "platforms": [
+ "linux",
+ "mac",
+ "posix"
+ ],
+ "uses_polling": false
+ },
+ {
+ "args": [],
+ "benchmark": false,
+ "ci_platforms": [
+ "linux",
+ "mac",
"posix",
"windows"
],
@@ -2082,7 +2104,9 @@
"uses_polling": false
},
{
- "args": [],
+ "args": [
+ "--resolver=ares"
+ ],
"benchmark": false,
"ci_platforms": [
"linux",
@@ -2097,7 +2121,7 @@
"flaky": false,
"gtest": false,
"language": "c",
- "name": "resolve_address_posix_test",
+ "name": "resolve_address_using_ares_resolver_posix_test",
"platforms": [
"linux",
"mac",
@@ -2139,6 +2163,32 @@
"ci_platforms": [
"linux",
"mac",
+ "posix"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [
+ "uv"
+ ],
+ "flaky": false,
+ "gtest": false,
+ "language": "c",
+ "name": "resolve_address_using_native_resolver_posix_test",
+ "platforms": [
+ "linux",
+ "mac",
+ "posix"
+ ],
+ "uses_polling": true
+ },
+ {
+ "args": [
+ "--resolver=native"
+ ],
+ "benchmark": false,
+ "ci_platforms": [
+ "linux",
+ "mac",
"posix",
"windows"
],