فهرست منبع

Merge branch 'master' of https://github.com/grpc/grpc into docfix

Srini Polavarapu 7 سال پیش
والد
کامیت
03fe419381
94فایلهای تغییر یافته به همراه395 افزوده شده و 260 حذف شده
  1. 1 0
      .github/CODEOWNERS
  2. 4 0
      .gitmodules
  3. 1 1
      BUILD
  4. 0 4
      CMakeLists.txt
  5. 0 4
      Makefile
  6. 7 2
      Rakefile
  7. 1 1
      build.yaml
  8. 2 0
      gRPC-C++.podspec
  9. 2 1
      gRPC-Core.podspec
  10. 0 2
      grpc.def
  11. 1 1
      grpc.gemspec
  12. 9 5
      include/grpc++/impl/codegen/proto_utils.h
  13. 0 1
      include/grpc/module.modulemap
  14. 1 1
      package.xml
  15. 20 16
      src/compiler/cpp_generator.cc
  16. 2 0
      src/compiler/cpp_generator.h
  17. 3 0
      src/compiler/cpp_plugin.cc
  18. 1 1
      src/core/ext/filters/client_channel/http_proxy.cc
  19. 1 1
      src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
  20. 51 31
      src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
  21. 9 7
      src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc
  22. 0 2
      src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
  23. 2 1
      src/core/ext/filters/client_channel/parse_address.cc
  24. 1 1
      src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
  25. 1 1
      src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
  26. 1 1
      src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
  27. 1 1
      src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
  28. 1 1
      src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
  29. 1 1
      src/core/ext/transport/cronet/transport/cronet_transport.cc
  30. 2 1
      src/core/lib/gpr/host_port.cc
  31. 5 13
      src/core/lib/gpr/host_port.h
  32. 2 1
      src/core/lib/iomgr/resolve_address_posix.cc
  33. 1 1
      src/core/lib/iomgr/resolve_address_uv.cc
  34. 2 1
      src/core/lib/iomgr/resolve_address_windows.cc
  35. 1 1
      src/core/lib/iomgr/sockaddr_utils.cc
  36. 2 1
      src/core/lib/iomgr/socket_utils_common_posix.cc
  37. 1 1
      src/core/lib/security/transport/security_connector.cc
  38. 1 1
      src/objective-c/tests/CoreCronetEnd2EndTests/CoreCronetEnd2EndTests.mm
  39. 1 1
      src/objective-c/tests/CronetUnitTests/CronetUnitTests.m
  40. 0 4
      src/ruby/ext/grpc/rb_grpc_imports.generated.c
  41. 0 7
      src/ruby/ext/grpc/rb_grpc_imports.generated.h
  42. 2 1
      test/core/bad_ssl/bad_ssl_test.cc
  43. 1 1
      test/core/end2end/bad_server_response_test.cc
  44. 1 1
      test/core/end2end/connection_refused_test.cc
  45. 1 1
      test/core/end2end/dualstack_socket_test.cc
  46. 2 1
      test/core/end2end/fixtures/h2_census.cc
  47. 2 1
      test/core/end2end/fixtures/h2_compress.cc
  48. 2 1
      test/core/end2end/fixtures/h2_fakesec.cc
  49. 2 1
      test/core/end2end/fixtures/h2_full+pipe.cc
  50. 2 1
      test/core/end2end/fixtures/h2_full+trace.cc
  51. 2 1
      test/core/end2end/fixtures/h2_full+workarounds.cc
  52. 2 1
      test/core/end2end/fixtures/h2_full.cc
  53. 2 1
      test/core/end2end/fixtures/h2_http_proxy.cc
  54. 2 1
      test/core/end2end/fixtures/h2_load_reporting.cc
  55. 2 1
      test/core/end2end/fixtures/h2_oauth2.cc
  56. 2 1
      test/core/end2end/fixtures/h2_proxy.cc
  57. 1 1
      test/core/end2end/fixtures/h2_ssl.cc
  58. 1 1
      test/core/end2end/fixtures/h2_ssl_proxy.cc
  59. 1 1
      test/core/end2end/fixtures/h2_uds.cc
  60. 1 1
      test/core/end2end/fixtures/http_proxy_fixture.cc
  61. 2 1
      test/core/end2end/fixtures/inproc.cc
  62. 1 1
      test/core/end2end/fixtures/proxy.cc
  63. 1 1
      test/core/end2end/h2_ssl_cert_test.cc
  64. 1 1
      test/core/end2end/invalid_call_argument_test.cc
  65. 2 1
      test/core/fling/fling_stream_test.cc
  66. 2 1
      test/core/fling/fling_test.cc
  67. 2 1
      test/core/fling/server.cc
  68. 2 1
      test/core/gpr/host_port_test.cc
  69. 2 1
      test/core/memory_usage/memory_usage_test.cc
  70. 2 1
      test/core/memory_usage/server.cc
  71. 1 1
      test/core/surface/num_external_connectivity_watchers_test.cc
  72. 0 3
      test/core/surface/public_headers_must_be_c89.c
  73. 1 1
      test/core/surface/sequential_connectivity_test.cc
  74. 2 1
      test/core/surface/server_chttp2_test.cc
  75. 2 1
      test/core/surface/server_test.cc
  76. 2 1
      test/core/util/reconnect_server.cc
  77. 2 1
      test/core/util/test_tcp_server.cc
  78. 5 0
      test/cpp/end2end/OWNERS
  79. 154 84
      test/cpp/end2end/client_lb_end2end_test.cc
  80. 1 1
      test/cpp/grpclb/grpclb_test.cc
  81. 1 1
      test/cpp/interop/interop_test.cc
  82. 19 2
      test/cpp/microbenchmarks/fullstack_fixtures.h
  83. 1 1
      test/cpp/naming/resolver_component_test.cc
  84. 1 1
      test/cpp/qps/client_sync.cc
  85. 1 1
      test/cpp/qps/driver.cc
  86. 1 1
      test/cpp/qps/qps_worker.cc
  87. 1 1
      test/cpp/qps/server_async.cc
  88. 1 1
      test/cpp/qps/server_sync.cc
  89. 0 1
      tools/doxygen/Doxyfile.c++
  90. 1 1
      tools/doxygen/Doxyfile.c++.internal
  91. 0 1
      tools/doxygen/Doxyfile.core
  92. 1 1
      tools/doxygen/Doxyfile.core.internal
  93. 5 1
      tools/internal_ci/helper_scripts/prepare_build_macos_rc
  94. 2 2
      tools/run_tests/generated/sources_and_headers.json

+ 1 - 0
.github/CODEOWNERS

@@ -5,5 +5,6 @@
 /bazel/** @nicolasnoble @dgquintas @a11r @vjpai
 /bazel/** @nicolasnoble @dgquintas @a11r @vjpai
 /cmake/** @jtattermusch @nicolasnoble @matt-kwong
 /cmake/** @jtattermusch @nicolasnoble @matt-kwong
 /src/core/ext/filters/client_channel/** @markdroth @dgquintas @a11r
 /src/core/ext/filters/client_channel/** @markdroth @dgquintas @a11r
+/test/cpp/end2end/** @vjpai @yang-g @y-zeng
 /tools/dockerfile/** @jtattermusch @matt-kwong @nicolasnoble
 /tools/dockerfile/** @jtattermusch @matt-kwong @nicolasnoble
 /tools/run_tests/performance/** @ncteisen @matt-kwong @jtattermusch
 /tools/run_tests/performance/** @ncteisen @matt-kwong @jtattermusch

+ 4 - 0
.gitmodules

@@ -1,6 +1,10 @@
 [submodule "third_party/zlib"]
 [submodule "third_party/zlib"]
 	path = third_party/zlib
 	path = third_party/zlib
 	url = https://github.com/madler/zlib
 	url = https://github.com/madler/zlib
+	# When using CMake to build, the zlib submodule ends up with a
+	# generated file that makes Git consider the submodule dirty. This
+	# state can be ignored for day-to-day development on gRPC.
+	ignore = dirty
 [submodule "third_party/protobuf"]
 [submodule "third_party/protobuf"]
 	path = third_party/protobuf
 	path = third_party/protobuf
 	url = https://github.com/google/protobuf.git
 	url = https://github.com/google/protobuf.git

+ 1 - 1
BUILD

@@ -69,7 +69,6 @@ GPR_PUBLIC_HDRS = [
     "include/grpc/support/avl.h",
     "include/grpc/support/avl.h",
     "include/grpc/support/cmdline.h",
     "include/grpc/support/cmdline.h",
     "include/grpc/support/cpu.h",
     "include/grpc/support/cpu.h",
-    "include/grpc/support/host_port.h",
     "include/grpc/support/log.h",
     "include/grpc/support/log.h",
     "include/grpc/support/log_windows.h",
     "include/grpc/support/log_windows.h",
     "include/grpc/support/port_platform.h",
     "include/grpc/support/port_platform.h",
@@ -502,6 +501,7 @@ grpc_cc_library(
         "src/core/lib/gpr/arena.h",
         "src/core/lib/gpr/arena.h",
         "src/core/lib/gpr/env.h",
         "src/core/lib/gpr/env.h",
         "src/core/lib/gpr/fork.h",
         "src/core/lib/gpr/fork.h",
+        "src/core/lib/gpr/host_port.h",
         "src/core/lib/gpr/mpscq.h",
         "src/core/lib/gpr/mpscq.h",
         "src/core/lib/gpr/murmur_hash.h",
         "src/core/lib/gpr/murmur_hash.h",
         "src/core/lib/gpr/spinlock.h",
         "src/core/lib/gpr/spinlock.h",

+ 0 - 4
CMakeLists.txt

@@ -707,7 +707,6 @@ foreach(_hdr
   include/grpc/support/avl.h
   include/grpc/support/avl.h
   include/grpc/support/cmdline.h
   include/grpc/support/cmdline.h
   include/grpc/support/cpu.h
   include/grpc/support/cpu.h
-  include/grpc/support/host_port.h
   include/grpc/support/log.h
   include/grpc/support/log.h
   include/grpc/support/log_windows.h
   include/grpc/support/log_windows.h
   include/grpc/support/port_platform.h
   include/grpc/support/port_platform.h
@@ -2490,7 +2489,6 @@ foreach(_hdr
   include/grpc/support/avl.h
   include/grpc/support/avl.h
   include/grpc/support/cmdline.h
   include/grpc/support/cmdline.h
   include/grpc/support/cpu.h
   include/grpc/support/cpu.h
-  include/grpc/support/host_port.h
   include/grpc/support/log.h
   include/grpc/support/log.h
   include/grpc/support/log_windows.h
   include/grpc/support/log_windows.h
   include/grpc/support/port_platform.h
   include/grpc/support/port_platform.h
@@ -2963,7 +2961,6 @@ foreach(_hdr
   include/grpc/support/avl.h
   include/grpc/support/avl.h
   include/grpc/support/cmdline.h
   include/grpc/support/cmdline.h
   include/grpc/support/cpu.h
   include/grpc/support/cpu.h
-  include/grpc/support/host_port.h
   include/grpc/support/log.h
   include/grpc/support/log.h
   include/grpc/support/log_windows.h
   include/grpc/support/log_windows.h
   include/grpc/support/port_platform.h
   include/grpc/support/port_platform.h
@@ -3693,7 +3690,6 @@ foreach(_hdr
   include/grpc/support/avl.h
   include/grpc/support/avl.h
   include/grpc/support/cmdline.h
   include/grpc/support/cmdline.h
   include/grpc/support/cpu.h
   include/grpc/support/cpu.h
-  include/grpc/support/host_port.h
   include/grpc/support/log.h
   include/grpc/support/log.h
   include/grpc/support/log_windows.h
   include/grpc/support/log_windows.h
   include/grpc/support/port_platform.h
   include/grpc/support/port_platform.h

+ 0 - 4
Makefile

@@ -2927,7 +2927,6 @@ PUBLIC_HEADERS_C += \
     include/grpc/support/avl.h \
     include/grpc/support/avl.h \
     include/grpc/support/cmdline.h \
     include/grpc/support/cmdline.h \
     include/grpc/support/cpu.h \
     include/grpc/support/cpu.h \
-    include/grpc/support/host_port.h \
     include/grpc/support/log.h \
     include/grpc/support/log.h \
     include/grpc/support/log_windows.h \
     include/grpc/support/log_windows.h \
     include/grpc/support/port_platform.h \
     include/grpc/support/port_platform.h \
@@ -4648,7 +4647,6 @@ PUBLIC_HEADERS_CXX += \
     include/grpc/support/avl.h \
     include/grpc/support/avl.h \
     include/grpc/support/cmdline.h \
     include/grpc/support/cmdline.h \
     include/grpc/support/cpu.h \
     include/grpc/support/cpu.h \
-    include/grpc/support/host_port.h \
     include/grpc/support/log.h \
     include/grpc/support/log.h \
     include/grpc/support/log_windows.h \
     include/grpc/support/log_windows.h \
     include/grpc/support/port_platform.h \
     include/grpc/support/port_platform.h \
@@ -5134,7 +5132,6 @@ PUBLIC_HEADERS_CXX += \
     include/grpc/support/avl.h \
     include/grpc/support/avl.h \
     include/grpc/support/cmdline.h \
     include/grpc/support/cmdline.h \
     include/grpc/support/cpu.h \
     include/grpc/support/cpu.h \
-    include/grpc/support/host_port.h \
     include/grpc/support/log.h \
     include/grpc/support/log.h \
     include/grpc/support/log_windows.h \
     include/grpc/support/log_windows.h \
     include/grpc/support/port_platform.h \
     include/grpc/support/port_platform.h \
@@ -5853,7 +5850,6 @@ PUBLIC_HEADERS_CXX += \
     include/grpc/support/avl.h \
     include/grpc/support/avl.h \
     include/grpc/support/cmdline.h \
     include/grpc/support/cmdline.h \
     include/grpc/support/cpu.h \
     include/grpc/support/cpu.h \
-    include/grpc/support/host_port.h \
     include/grpc/support/log.h \
     include/grpc/support/log.h \
     include/grpc/support/log_windows.h \
     include/grpc/support/log_windows.h \
     include/grpc/support/port_platform.h \
     include/grpc/support/port_platform.h \

+ 7 - 2
Rakefile

@@ -99,7 +99,7 @@ task 'dlls' do
     env_comp = "CC=#{opt[:cross]}-gcc "
     env_comp = "CC=#{opt[:cross]}-gcc "
     env_comp += "CXX=#{opt[:cross]}-g++ "
     env_comp += "CXX=#{opt[:cross]}-g++ "
     env_comp += "LD=#{opt[:cross]}-gcc "
     env_comp += "LD=#{opt[:cross]}-gcc "
-    docker_for_windows "gem update --system && #{env} #{env_comp} make -j #{out} && #{opt[:cross]}-strip -x -S #{out} && cp #{out} #{opt[:out]}"
+    docker_for_windows "gem update --system --no-ri --no-doc && #{env} #{env_comp} make -j #{out} && #{opt[:cross]}-strip -x -S #{out} && cp #{out} #{opt[:out]}"
   end
   end
 
 
 end
 end
@@ -113,10 +113,15 @@ task 'gem:native' do
   if RUBY_PLATFORM =~ /darwin/
   if RUBY_PLATFORM =~ /darwin/
     FileUtils.touch 'grpc_c.32.ruby'
     FileUtils.touch 'grpc_c.32.ruby'
     FileUtils.touch 'grpc_c.64.ruby'
     FileUtils.touch 'grpc_c.64.ruby'
+    unless '2.5' == /(\d+\.\d+)/.match(RUBY_VERSION).to_s
+      fail "rake gem:native (the rake task to build the binary packages) is being " \
+        "invoked on macos with ruby #{RUBY_VERSION}. The ruby macos artifact " \
+        "build should be running on ruby 2.5."
+    end
     system "rake cross native gem RUBY_CC_VERSION=2.5.0:2.4.0:2.3.0:2.2.2:2.1.6:2.0.0 V=#{verbose} GRPC_CONFIG=#{grpc_config}"
     system "rake cross native gem RUBY_CC_VERSION=2.5.0:2.4.0:2.3.0:2.2.2:2.1.6:2.0.0 V=#{verbose} GRPC_CONFIG=#{grpc_config}"
   else
   else
     Rake::Task['dlls'].execute
     Rake::Task['dlls'].execute
-    docker_for_windows "gem update --system && bundle && rake cross native gem RUBY_CC_VERSION=2.5.0:2.4.0:2.3.0:2.2.2:2.1.6:2.0.0 V=#{verbose} GRPC_CONFIG=#{grpc_config}"
+    docker_for_windows "gem update --system --no-ri --no-doc && bundle && rake cross native gem RUBY_CC_VERSION=2.5.0:2.4.0:2.3.0:2.2.2:2.1.6:2.0.0 V=#{verbose} GRPC_CONFIG=#{grpc_config}"
   end
   end
 end
 end
 
 

+ 1 - 1
build.yaml

@@ -82,7 +82,6 @@ filegroups:
   - include/grpc/support/avl.h
   - include/grpc/support/avl.h
   - include/grpc/support/cmdline.h
   - include/grpc/support/cmdline.h
   - include/grpc/support/cpu.h
   - include/grpc/support/cpu.h
-  - include/grpc/support/host_port.h
   - include/grpc/support/log.h
   - include/grpc/support/log.h
   - include/grpc/support/log_windows.h
   - include/grpc/support/log_windows.h
   - include/grpc/support/port_platform.h
   - include/grpc/support/port_platform.h
@@ -104,6 +103,7 @@ filegroups:
   - src/core/lib/gpr/arena.h
   - src/core/lib/gpr/arena.h
   - src/core/lib/gpr/env.h
   - src/core/lib/gpr/env.h
   - src/core/lib/gpr/fork.h
   - src/core/lib/gpr/fork.h
+  - src/core/lib/gpr/host_port.h
   - src/core/lib/gpr/mpscq.h
   - src/core/lib/gpr/mpscq.h
   - src/core/lib/gpr/murmur_hash.h
   - src/core/lib/gpr/murmur_hash.h
   - src/core/lib/gpr/spinlock.h
   - src/core/lib/gpr/spinlock.h

+ 2 - 0
gRPC-C++.podspec

@@ -206,6 +206,7 @@ Pod::Spec.new do |s|
                       'src/core/lib/gpr/arena.h',
                       'src/core/lib/gpr/arena.h',
                       'src/core/lib/gpr/env.h',
                       'src/core/lib/gpr/env.h',
                       'src/core/lib/gpr/fork.h',
                       'src/core/lib/gpr/fork.h',
+                      'src/core/lib/gpr/host_port.h',
                       'src/core/lib/gpr/mpscq.h',
                       'src/core/lib/gpr/mpscq.h',
                       'src/core/lib/gpr/murmur_hash.h',
                       'src/core/lib/gpr/murmur_hash.h',
                       'src/core/lib/gpr/spinlock.h',
                       'src/core/lib/gpr/spinlock.h',
@@ -451,6 +452,7 @@ Pod::Spec.new do |s|
                               'src/core/lib/gpr/arena.h',
                               'src/core/lib/gpr/arena.h',
                               'src/core/lib/gpr/env.h',
                               'src/core/lib/gpr/env.h',
                               'src/core/lib/gpr/fork.h',
                               'src/core/lib/gpr/fork.h',
+                              'src/core/lib/gpr/host_port.h',
                               'src/core/lib/gpr/mpscq.h',
                               'src/core/lib/gpr/mpscq.h',
                               'src/core/lib/gpr/murmur_hash.h',
                               'src/core/lib/gpr/murmur_hash.h',
                               'src/core/lib/gpr/spinlock.h',
                               'src/core/lib/gpr/spinlock.h',

+ 2 - 1
gRPC-Core.podspec

@@ -117,7 +117,6 @@ Pod::Spec.new do |s|
                       'include/grpc/support/avl.h',
                       'include/grpc/support/avl.h',
                       'include/grpc/support/cmdline.h',
                       'include/grpc/support/cmdline.h',
                       'include/grpc/support/cpu.h',
                       'include/grpc/support/cpu.h',
-                      'include/grpc/support/host_port.h',
                       'include/grpc/support/log.h',
                       'include/grpc/support/log.h',
                       'include/grpc/support/log_windows.h',
                       'include/grpc/support/log_windows.h',
                       'include/grpc/support/port_platform.h',
                       'include/grpc/support/port_platform.h',
@@ -195,6 +194,7 @@ Pod::Spec.new do |s|
     ss.source_files = 'src/core/lib/gpr/arena.h',
     ss.source_files = 'src/core/lib/gpr/arena.h',
                       'src/core/lib/gpr/env.h',
                       'src/core/lib/gpr/env.h',
                       'src/core/lib/gpr/fork.h',
                       'src/core/lib/gpr/fork.h',
+                      'src/core/lib/gpr/host_port.h',
                       'src/core/lib/gpr/mpscq.h',
                       'src/core/lib/gpr/mpscq.h',
                       'src/core/lib/gpr/murmur_hash.h',
                       'src/core/lib/gpr/murmur_hash.h',
                       'src/core/lib/gpr/spinlock.h',
                       'src/core/lib/gpr/spinlock.h',
@@ -721,6 +721,7 @@ Pod::Spec.new do |s|
     ss.private_header_files = 'src/core/lib/gpr/arena.h',
     ss.private_header_files = 'src/core/lib/gpr/arena.h',
                               'src/core/lib/gpr/env.h',
                               'src/core/lib/gpr/env.h',
                               'src/core/lib/gpr/fork.h',
                               'src/core/lib/gpr/fork.h',
+                              'src/core/lib/gpr/host_port.h',
                               'src/core/lib/gpr/mpscq.h',
                               'src/core/lib/gpr/mpscq.h',
                               'src/core/lib/gpr/murmur_hash.h',
                               'src/core/lib/gpr/murmur_hash.h',
                               'src/core/lib/gpr/spinlock.h',
                               'src/core/lib/gpr/spinlock.h',

+ 0 - 2
grpc.def

@@ -195,8 +195,6 @@ EXPORTS
     gpr_cmdline_usage_string
     gpr_cmdline_usage_string
     gpr_cpu_num_cores
     gpr_cpu_num_cores
     gpr_cpu_current_cpu
     gpr_cpu_current_cpu
-    gpr_join_host_port
-    gpr_split_host_port
     gpr_log_severity_string
     gpr_log_severity_string
     gpr_log
     gpr_log
     gpr_log_message
     gpr_log_message

+ 1 - 1
grpc.gemspec

@@ -52,7 +52,6 @@ Gem::Specification.new do |s|
   s.files += %w( include/grpc/support/avl.h )
   s.files += %w( include/grpc/support/avl.h )
   s.files += %w( include/grpc/support/cmdline.h )
   s.files += %w( include/grpc/support/cmdline.h )
   s.files += %w( include/grpc/support/cpu.h )
   s.files += %w( include/grpc/support/cpu.h )
-  s.files += %w( include/grpc/support/host_port.h )
   s.files += %w( include/grpc/support/log.h )
   s.files += %w( include/grpc/support/log.h )
   s.files += %w( include/grpc/support/log_windows.h )
   s.files += %w( include/grpc/support/log_windows.h )
   s.files += %w( include/grpc/support/port_platform.h )
   s.files += %w( include/grpc/support/port_platform.h )
@@ -86,6 +85,7 @@ Gem::Specification.new do |s|
   s.files += %w( src/core/lib/gpr/arena.h )
   s.files += %w( src/core/lib/gpr/arena.h )
   s.files += %w( src/core/lib/gpr/env.h )
   s.files += %w( src/core/lib/gpr/env.h )
   s.files += %w( src/core/lib/gpr/fork.h )
   s.files += %w( src/core/lib/gpr/fork.h )
+  s.files += %w( src/core/lib/gpr/host_port.h )
   s.files += %w( src/core/lib/gpr/mpscq.h )
   s.files += %w( src/core/lib/gpr/mpscq.h )
   s.files += %w( src/core/lib/gpr/murmur_hash.h )
   s.files += %w( src/core/lib/gpr/murmur_hash.h )
   s.files += %w( src/core/lib/gpr/spinlock.h )
   s.files += %w( src/core/lib/gpr/spinlock.h )

+ 9 - 5
include/grpc++/impl/codegen/proto_utils.h

@@ -59,18 +59,22 @@ class GrpcBufferWriter : public ::grpc::protobuf::io::ZeroCopyOutputStream {
   bool Next(void** data, int* size) override {
   bool Next(void** data, int* size) override {
     // Protobuf should not ask for more memory than total_size_.
     // Protobuf should not ask for more memory than total_size_.
     GPR_CODEGEN_ASSERT(byte_count_ < total_size_);
     GPR_CODEGEN_ASSERT(byte_count_ < total_size_);
+    size_t remain = total_size_ - byte_count_;
     if (have_backup_) {
     if (have_backup_) {
       slice_ = backup_slice_;
       slice_ = backup_slice_;
       have_backup_ = false;
       have_backup_ = false;
+      if (GRPC_SLICE_LENGTH(slice_) > remain) {
+        GRPC_SLICE_SET_LENGTH(slice_, remain);
+      }
     } else {
     } else {
       // When less than a whole block is needed, only allocate that much.
       // When less than a whole block is needed, only allocate that much.
       // But make sure the allocated slice is not inlined.
       // But make sure the allocated slice is not inlined.
-      size_t remain = total_size_ - byte_count_ > block_size_
-                          ? block_size_
-                          : total_size_ - byte_count_;
+      size_t allocate_length =
+          remain > static_cast<size_t>(block_size_) ? block_size_ : remain;
       slice_ = g_core_codegen_interface->grpc_slice_malloc(
       slice_ = g_core_codegen_interface->grpc_slice_malloc(
-          remain > GRPC_SLICE_INLINED_SIZE ? remain
-                                           : GRPC_SLICE_INLINED_SIZE + 1);
+          allocate_length > GRPC_SLICE_INLINED_SIZE
+              ? allocate_length
+              : GRPC_SLICE_INLINED_SIZE + 1);
     }
     }
     *data = GRPC_SLICE_START_PTR(slice_);
     *data = GRPC_SLICE_START_PTR(slice_);
     // On win x64, int is only 32bit
     // On win x64, int is only 32bit

+ 0 - 1
include/grpc/module.modulemap

@@ -7,7 +7,6 @@ framework module grpc {
   header "support/avl.h"
   header "support/avl.h"
   header "support/cmdline.h"
   header "support/cmdline.h"
   header "support/cpu.h"
   header "support/cpu.h"
-  header "support/host_port.h"
   header "support/log.h"
   header "support/log.h"
   header "support/log_windows.h"
   header "support/log_windows.h"
   header "support/port_platform.h"
   header "support/port_platform.h"

+ 1 - 1
package.xml

@@ -59,7 +59,6 @@
     <file baseinstalldir="/" name="include/grpc/support/avl.h" role="src" />
     <file baseinstalldir="/" name="include/grpc/support/avl.h" role="src" />
     <file baseinstalldir="/" name="include/grpc/support/cmdline.h" role="src" />
     <file baseinstalldir="/" name="include/grpc/support/cmdline.h" role="src" />
     <file baseinstalldir="/" name="include/grpc/support/cpu.h" role="src" />
     <file baseinstalldir="/" name="include/grpc/support/cpu.h" role="src" />
-    <file baseinstalldir="/" name="include/grpc/support/host_port.h" role="src" />
     <file baseinstalldir="/" name="include/grpc/support/log.h" role="src" />
     <file baseinstalldir="/" name="include/grpc/support/log.h" role="src" />
     <file baseinstalldir="/" name="include/grpc/support/log_windows.h" role="src" />
     <file baseinstalldir="/" name="include/grpc/support/log_windows.h" role="src" />
     <file baseinstalldir="/" name="include/grpc/support/port_platform.h" role="src" />
     <file baseinstalldir="/" name="include/grpc/support/port_platform.h" role="src" />
@@ -93,6 +92,7 @@
     <file baseinstalldir="/" name="src/core/lib/gpr/arena.h" role="src" />
     <file baseinstalldir="/" name="src/core/lib/gpr/arena.h" role="src" />
     <file baseinstalldir="/" name="src/core/lib/gpr/env.h" role="src" />
     <file baseinstalldir="/" name="src/core/lib/gpr/env.h" role="src" />
     <file baseinstalldir="/" name="src/core/lib/gpr/fork.h" role="src" />
     <file baseinstalldir="/" name="src/core/lib/gpr/fork.h" role="src" />
+    <file baseinstalldir="/" name="src/core/lib/gpr/host_port.h" role="src" />
     <file baseinstalldir="/" name="src/core/lib/gpr/mpscq.h" role="src" />
     <file baseinstalldir="/" name="src/core/lib/gpr/mpscq.h" role="src" />
     <file baseinstalldir="/" name="src/core/lib/gpr/murmur_hash.h" role="src" />
     <file baseinstalldir="/" name="src/core/lib/gpr/murmur_hash.h" role="src" />
     <file baseinstalldir="/" name="src/core/lib/gpr/spinlock.h" role="src" />
     <file baseinstalldir="/" name="src/core/lib/gpr/spinlock.h" role="src" />

+ 20 - 16
src/compiler/cpp_generator.cc

@@ -64,16 +64,15 @@ T* array_end(T (&array)[N]) {
 
 
 void PrintIncludes(grpc_generator::Printer* printer,
 void PrintIncludes(grpc_generator::Printer* printer,
                    const std::vector<grpc::string>& headers,
                    const std::vector<grpc::string>& headers,
-                   const Parameters& params) {
+                   bool use_system_headers, const grpc::string& search_path) {
   std::map<grpc::string, grpc::string> vars;
   std::map<grpc::string, grpc::string> vars;
 
 
-  vars["l"] = params.use_system_headers ? '<' : '"';
-  vars["r"] = params.use_system_headers ? '>' : '"';
+  vars["l"] = use_system_headers ? '<' : '"';
+  vars["r"] = use_system_headers ? '>' : '"';
 
 
-  auto& s = params.grpc_search_path;
-  if (!s.empty()) {
-    vars["l"] += s;
-    if (s[s.size() - 1] != '/') {
+  if (!search_path.empty()) {
+    vars["l"] += search_path;
+    if (search_path[search_path.size() - 1] != '/') {
       vars["l"] += '/';
       vars["l"] += '/';
     }
     }
   }
   }
@@ -124,6 +123,10 @@ grpc::string GetHeaderIncludes(grpc_generator::File* file,
     auto printer = file->CreatePrinter(&output);
     auto printer = file->CreatePrinter(&output);
     std::map<grpc::string, grpc::string> vars;
     std::map<grpc::string, grpc::string> vars;
 
 
+    if (!params.additional_header_includes.empty()) {
+      PrintIncludes(printer.get(), params.additional_header_includes, false,
+                    "");
+    }
     static const char* headers_strs[] = {
     static const char* headers_strs[] = {
         "grpc++/impl/codegen/async_stream.h",
         "grpc++/impl/codegen/async_stream.h",
         "grpc++/impl/codegen/async_unary_call.h",
         "grpc++/impl/codegen/async_unary_call.h",
@@ -135,7 +138,8 @@ grpc::string GetHeaderIncludes(grpc_generator::File* file,
         "grpc++/impl/codegen/stub_options.h",
         "grpc++/impl/codegen/stub_options.h",
         "grpc++/impl/codegen/sync_stream.h"};
         "grpc++/impl/codegen/sync_stream.h"};
     std::vector<grpc::string> headers(headers_strs, array_end(headers_strs));
     std::vector<grpc::string> headers(headers_strs, array_end(headers_strs));
-    PrintIncludes(printer.get(), headers, params);
+    PrintIncludes(printer.get(), headers, params.use_system_headers,
+                  params.grpc_search_path);
     printer->Print(vars, "\n");
     printer->Print(vars, "\n");
     printer->Print(vars, "namespace grpc {\n");
     printer->Print(vars, "namespace grpc {\n");
     printer->Print(vars, "class CompletionQueue;\n");
     printer->Print(vars, "class CompletionQueue;\n");
@@ -1153,7 +1157,8 @@ grpc::string GetSourceIncludes(grpc_generator::File* file,
         "grpc++/impl/codegen/service_type.h",
         "grpc++/impl/codegen/service_type.h",
         "grpc++/impl/codegen/sync_stream.h"};
         "grpc++/impl/codegen/sync_stream.h"};
     std::vector<grpc::string> headers(headers_strs, array_end(headers_strs));
     std::vector<grpc::string> headers(headers_strs, array_end(headers_strs));
-    PrintIncludes(printer.get(), headers, params);
+    PrintIncludes(printer.get(), headers, params.use_system_headers,
+                  params.grpc_search_path);
 
 
     if (!file->package().empty()) {
     if (!file->package().empty()) {
       std::vector<grpc::string> parts = file->package_parts();
       std::vector<grpc::string> parts = file->package_parts();
@@ -1570,20 +1575,19 @@ grpc::string GetMockIncludes(grpc_generator::File* file,
         "grpc++/impl/codegen/sync_stream.h",
         "grpc++/impl/codegen/sync_stream.h",
     };
     };
     std::vector<grpc::string> headers(headers_strs, array_end(headers_strs));
     std::vector<grpc::string> headers(headers_strs, array_end(headers_strs));
-    PrintIncludes(printer.get(), headers, params);
+    PrintIncludes(printer.get(), headers, params.use_system_headers,
+                  params.grpc_search_path);
 
 
     std::vector<grpc::string> gmock_header;
     std::vector<grpc::string> gmock_header;
     if (params.gmock_search_path.empty()) {
     if (params.gmock_search_path.empty()) {
       gmock_header.push_back("gmock/gmock.h");
       gmock_header.push_back("gmock/gmock.h");
-      PrintIncludes(printer.get(), gmock_header, params);
+      PrintIncludes(printer.get(), gmock_header, params.use_system_headers,
+                    params.grpc_search_path);
     } else {
     } else {
       gmock_header.push_back("gmock.h");
       gmock_header.push_back("gmock.h");
-      // Copy a params to generate gmock header.
-      Parameters gmock_params(params);
       // We use local includes when a gmock_search_path is given
       // We use local includes when a gmock_search_path is given
-      gmock_params.use_system_headers = false;
-      gmock_params.grpc_search_path = params.gmock_search_path;
-      PrintIncludes(printer.get(), gmock_header, gmock_params);
+      PrintIncludes(printer.get(), gmock_header, false,
+                    params.gmock_search_path);
     }
     }
 
 
     if (!file->package().empty()) {
     if (!file->package().empty()) {

+ 2 - 0
src/compiler/cpp_generator.h

@@ -54,6 +54,8 @@ struct Parameters {
   bool generate_mock_code;
   bool generate_mock_code;
   // Google Mock search path, when non-empty, local includes will be used.
   // Google Mock search path, when non-empty, local includes will be used.
   grpc::string gmock_search_path;
   grpc::string gmock_search_path;
+  // *EXPERIMENTAL* Additional include files in grpc.pb.h
+  std::vector<grpc::string> additional_header_includes;
 };
 };
 
 
 // Return the prologue of the generated header file.
 // Return the prologue of the generated header file.

+ 3 - 0
src/compiler/cpp_plugin.cc

@@ -80,6 +80,9 @@ class CppGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
           }
           }
         } else if (param[0] == "gmock_search_path") {
         } else if (param[0] == "gmock_search_path") {
           generator_parameters.gmock_search_path = param[1];
           generator_parameters.gmock_search_path = param[1];
+        } else if (param[0] == "additional_header_includes") {
+          generator_parameters.additional_header_includes =
+              grpc_generator::tokenize(param[1], ":");
         } else {
         } else {
           *error = grpc::string("Unknown parameter: ") + *parameter_string;
           *error = grpc::string("Unknown parameter: ") + *parameter_string;
           return false;
           return false;

+ 1 - 1
src/core/ext/filters/client_channel/http_proxy.cc

@@ -22,7 +22,6 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 
 
@@ -31,6 +30,7 @@
 #include "src/core/ext/filters/client_channel/uri_parser.h"
 #include "src/core/ext/filters/client_channel/uri_parser.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/gpr/env.h"
 #include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/slice/b64.h"
 #include "src/core/lib/slice/b64.h"
 
 

+ 1 - 1
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc

@@ -87,7 +87,6 @@
 #include <grpc/byte_buffer_reader.h>
 #include <grpc/byte_buffer_reader.h>
 #include <grpc/grpc.h>
 #include <grpc/grpc.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/time.h>
 #include <grpc/support/time.h>
 
 
@@ -106,6 +105,7 @@
 #include "src/core/lib/backoff/backoff.h"
 #include "src/core/lib/backoff/backoff.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/channel_stack.h"
 #include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gprpp/manual_constructor.h"
 #include "src/core/lib/gprpp/manual_constructor.h"
 #include "src/core/lib/iomgr/combiner.h"
 #include "src/core/lib/iomgr/combiner.h"

+ 51 - 31
src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc

@@ -328,18 +328,11 @@ static void update_lb_connectivity_status_locked(grpc_lb_subchannel_data* sd,
    * 2) RULE: ANY subchannel is CONNECTING => policy is CONNECTING.
    * 2) RULE: ANY subchannel is CONNECTING => policy is CONNECTING.
    *    CHECK: sd->curr_connectivity_state == CONNECTING.
    *    CHECK: sd->curr_connectivity_state == CONNECTING.
    *
    *
-   * 3) RULE: ALL subchannels are SHUTDOWN => policy is IDLE (and requests
-   *          re-resolution).
-   *    CHECK: subchannel_list->num_shutdown ==
-   *           subchannel_list->num_subchannels.
-   *
-   * 4) RULE: ALL subchannels are SHUTDOWN or TRANSIENT_FAILURE => policy is
-   *          TRANSIENT_FAILURE.
-   *    CHECK: subchannel_list->num_shutdown +
-   *             subchannel_list->num_transient_failures ==
+   * 3) RULE: ALL subchannels are TRANSIENT_FAILURE => policy is
+   *                                                   TRANSIENT_FAILURE.
+   *    CHECK: subchannel_list->num_transient_failures ==
    *           subchannel_list->num_subchannels.
    *           subchannel_list->num_subchannels.
    */
    */
-  // TODO(juanlishen): For rule 4, we may want to re-resolve instead.
   grpc_lb_subchannel_list* subchannel_list = sd->subchannel_list;
   grpc_lb_subchannel_list* subchannel_list = sd->subchannel_list;
   round_robin_lb_policy* p = (round_robin_lb_policy*)subchannel_list->policy;
   round_robin_lb_policy* p = (round_robin_lb_policy*)subchannel_list->policy;
   GPR_ASSERT(sd->curr_connectivity_state != GRPC_CHANNEL_IDLE);
   GPR_ASSERT(sd->curr_connectivity_state != GRPC_CHANNEL_IDLE);
@@ -351,22 +344,12 @@ static void update_lb_connectivity_status_locked(grpc_lb_subchannel_data* sd,
     /* 2) CONNECTING */
     /* 2) CONNECTING */
     grpc_connectivity_state_set(&p->state_tracker, GRPC_CHANNEL_CONNECTING,
     grpc_connectivity_state_set(&p->state_tracker, GRPC_CHANNEL_CONNECTING,
                                 GRPC_ERROR_NONE, "rr_connecting");
                                 GRPC_ERROR_NONE, "rr_connecting");
-  } else if (subchannel_list->num_shutdown ==
+  } else if (subchannel_list->num_transient_failures ==
              subchannel_list->num_subchannels) {
              subchannel_list->num_subchannels) {
-    /* 3) IDLE and re-resolve */
-    grpc_connectivity_state_set(&p->state_tracker, GRPC_CHANNEL_IDLE,
-                                GRPC_ERROR_NONE,
-                                "rr_exhausted_subchannels+reresolve");
-    p->started_picking = false;
-    grpc_lb_policy_try_reresolve(&p->base, &grpc_lb_round_robin_trace,
-                                 GRPC_ERROR_NONE);
-  } else if (subchannel_list->num_shutdown +
-                 subchannel_list->num_transient_failures ==
-             subchannel_list->num_subchannels) {
-    /* 4) TRANSIENT_FAILURE */
-    grpc_connectivity_state_set(&p->state_tracker,
-                                GRPC_CHANNEL_TRANSIENT_FAILURE,
-                                GRPC_ERROR_REF(error), "rr_transient_failure");
+    /* 3) TRANSIENT_FAILURE */
+    grpc_connectivity_state_set(
+        &p->state_tracker, GRPC_CHANNEL_TRANSIENT_FAILURE,
+        GRPC_ERROR_REF(error), "rr_exhausted_subchannels");
   }
   }
   GRPC_ERROR_UNREF(error);
   GRPC_ERROR_UNREF(error);
 }
 }
@@ -387,6 +370,7 @@ static void rr_connectivity_changed_locked(void* arg, grpc_error* error) {
         p->shutdown, sd->subchannel_list->shutting_down,
         p->shutdown, sd->subchannel_list->shutting_down,
         grpc_error_string(error));
         grpc_error_string(error));
   }
   }
+  GPR_ASSERT(sd->subchannel != nullptr);
   // If the policy is shutting down, unref and return.
   // If the policy is shutting down, unref and return.
   if (p->shutdown) {
   if (p->shutdown) {
     grpc_lb_subchannel_data_stop_connectivity_watch(sd);
     grpc_lb_subchannel_data_stop_connectivity_watch(sd);
@@ -412,14 +396,19 @@ static void rr_connectivity_changed_locked(void* arg, grpc_error* error) {
   // state (which was set by the connectivity state watcher) to
   // state (which was set by the connectivity state watcher) to
   // curr_connectivity_state, which is what we use inside of the combiner.
   // curr_connectivity_state, which is what we use inside of the combiner.
   sd->curr_connectivity_state = sd->pending_connectivity_state_unsafe;
   sd->curr_connectivity_state = sd->pending_connectivity_state_unsafe;
-  // Update state counters and new overall state.
-  update_state_counters_locked(sd);
-  update_lb_connectivity_status_locked(sd, GRPC_ERROR_REF(error));
   // If the sd's new state is TRANSIENT_FAILURE, unref the *connected*
   // If the sd's new state is TRANSIENT_FAILURE, unref the *connected*
   // subchannel, if any.
   // subchannel, if any.
   switch (sd->curr_connectivity_state) {
   switch (sd->curr_connectivity_state) {
     case GRPC_CHANNEL_TRANSIENT_FAILURE: {
     case GRPC_CHANNEL_TRANSIENT_FAILURE: {
       sd->connected_subchannel.reset();
       sd->connected_subchannel.reset();
+      if (grpc_lb_round_robin_trace.enabled()) {
+        gpr_log(GPR_DEBUG,
+                "[RR %p] Subchannel %p has gone into TRANSIENT_FAILURE. "
+                "Requesting re-resolution",
+                p, sd->subchannel);
+      }
+      grpc_lb_policy_try_reresolve(&p->base, &grpc_lb_round_robin_trace,
+                                   GRPC_ERROR_NONE);
       break;
       break;
     }
     }
     case GRPC_CHANNEL_READY: {
     case GRPC_CHANNEL_READY: {
@@ -442,8 +431,8 @@ static void rr_connectivity_changed_locked(void* arg, grpc_error* error) {
           gpr_log(GPR_DEBUG,
           gpr_log(GPR_DEBUG,
                   "[RR %p] phasing out subchannel list %p (size %lu) in favor "
                   "[RR %p] phasing out subchannel list %p (size %lu) in favor "
                   "of %p (size %lu)",
                   "of %p (size %lu)",
-                  (void*)p, (void*)p->subchannel_list, num_subchannels,
-                  (void*)sd->subchannel_list, num_subchannels);
+                  p, p->subchannel_list, num_subchannels, sd->subchannel_list,
+                  num_subchannels);
         }
         }
         if (p->subchannel_list != nullptr) {
         if (p->subchannel_list != nullptr) {
           // dispose of the current subchannel_list
           // dispose of the current subchannel_list
@@ -455,7 +444,8 @@ static void rr_connectivity_changed_locked(void* arg, grpc_error* error) {
       }
       }
       /* at this point we know there's at least one suitable subchannel. Go
       /* at this point we know there's at least one suitable subchannel. Go
        * ahead and pick one and notify the pending suitors in
        * ahead and pick one and notify the pending suitors in
-       * p->pending_picks. This preemptively replicates rr_pick()'s actions. */
+       * p->pending_picks. This preemptively replicates rr_pick()'s actions.
+       */
       const size_t next_ready_index = get_next_ready_subchannel_index_locked(p);
       const size_t next_ready_index = get_next_ready_subchannel_index_locked(p);
       GPR_ASSERT(next_ready_index < p->subchannel_list->num_subchannels);
       GPR_ASSERT(next_ready_index < p->subchannel_list->num_subchannels);
       grpc_lb_subchannel_data* selected =
       grpc_lb_subchannel_data* selected =
@@ -488,6 +478,12 @@ static void rr_connectivity_changed_locked(void* arg, grpc_error* error) {
     case GRPC_CHANNEL_CONNECTING:
     case GRPC_CHANNEL_CONNECTING:
     case GRPC_CHANNEL_IDLE:;  // fallthrough
     case GRPC_CHANNEL_IDLE:;  // fallthrough
   }
   }
+  // Update state counters and new overall state.
+  update_state_counters_locked(sd);
+  // Only update connectivity based on the selected subchannel list.
+  if (sd->subchannel_list == p->subchannel_list) {
+    update_lb_connectivity_status_locked(sd, GRPC_ERROR_REF(error));
+  }
   // Renew notification.
   // Renew notification.
   grpc_lb_subchannel_data_start_connectivity_watch(sd);
   grpc_lb_subchannel_data_start_connectivity_watch(sd);
 }
 }
@@ -562,6 +558,30 @@ static void rr_update_locked(grpc_lb_policy* policy,
     return;
     return;
   }
   }
   if (p->started_picking) {
   if (p->started_picking) {
+    for (size_t i = 0; i < subchannel_list->num_subchannels; ++i) {
+      const grpc_connectivity_state subchannel_state =
+          grpc_subchannel_check_connectivity(
+              subchannel_list->subchannels[i].subchannel, nullptr);
+      // Override the default setting of IDLE for connectivity notification
+      // purposes if the subchannel is already in transient failure. Otherwise
+      // we'd be immediately notified of the IDLE-TRANSIENT_FAILURE
+      // discrepancy, attempt to re-resolve and end up here again.
+      // TODO(roth): As part of C++-ifying the subchannel_list API, design a
+      // better API for notifying the LB policy of subchannel states, which can
+      // be used both for the subchannel's initial state and for subsequent
+      // state changes. This will allow us to handle this more generally instead
+      // of special-casing TRANSIENT_FAILURE (e.g., we can also distribute any
+      // pending picks across all READY subchannels rather than sending them all
+      // to the first one).
+      if (subchannel_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+        subchannel_list->subchannels[i].pending_connectivity_state_unsafe =
+            subchannel_list->subchannels[i].curr_connectivity_state =
+                subchannel_list->subchannels[i].prev_connectivity_state =
+                    subchannel_state;
+        --subchannel_list->num_idle;
+        ++subchannel_list->num_transient_failures;
+      }
+    }
     if (p->latest_pending_subchannel_list != nullptr) {
     if (p->latest_pending_subchannel_list != nullptr) {
       if (grpc_lb_round_robin_trace.enabled()) {
       if (grpc_lb_round_robin_trace.enabled()) {
         gpr_log(GPR_DEBUG,
         gpr_log(GPR_DEBUG,

+ 9 - 7
src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc

@@ -54,13 +54,15 @@ void grpc_lb_subchannel_data_unref_subchannel(grpc_lb_subchannel_data* sd,
 void grpc_lb_subchannel_data_start_connectivity_watch(
 void grpc_lb_subchannel_data_start_connectivity_watch(
     grpc_lb_subchannel_data* sd) {
     grpc_lb_subchannel_data* sd) {
   if (sd->subchannel_list->tracer->enabled()) {
   if (sd->subchannel_list->tracer->enabled()) {
-    gpr_log(GPR_DEBUG,
-            "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR
-            " (subchannel %p): requesting connectivity change notification",
-            sd->subchannel_list->tracer->name(), sd->subchannel_list->policy,
-            sd->subchannel_list,
-            (size_t)(sd - sd->subchannel_list->subchannels),
-            sd->subchannel_list->num_subchannels, sd->subchannel);
+    gpr_log(
+        GPR_DEBUG,
+        "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR
+        " (subchannel %p): requesting connectivity change "
+        "notification (from %s)",
+        sd->subchannel_list->tracer->name(), sd->subchannel_list->policy,
+        sd->subchannel_list, (size_t)(sd - sd->subchannel_list->subchannels),
+        sd->subchannel_list->num_subchannels, sd->subchannel,
+        grpc_connectivity_state_name(sd->pending_connectivity_state_unsafe));
   }
   }
   sd->connectivity_notification_pending = true;
   sd->connectivity_notification_pending = true;
   grpc_subchannel_notify_on_state_change(
   grpc_subchannel_notify_on_state_change(

+ 0 - 2
src/core/ext/filters/client_channel/lb_policy/subchannel_list.h

@@ -101,8 +101,6 @@ struct grpc_lb_subchannel_list {
   size_t num_ready;
   size_t num_ready;
   /** how many subchannels are in state TRANSIENT_FAILURE */
   /** how many subchannels are in state TRANSIENT_FAILURE */
   size_t num_transient_failures;
   size_t num_transient_failures;
-  /** how many subchannels are in state SHUTDOWN */
-  size_t num_shutdown;
   /** how many subchannels are in state IDLE */
   /** how many subchannels are in state IDLE */
   size_t num_idle;
   size_t num_idle;
 
 

+ 2 - 1
src/core/ext/filters/client_channel/parse_address.cc

@@ -26,9 +26,10 @@
 #endif
 #endif
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
+
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 
 
 #ifdef GRPC_HAVE_UNIX_SOCKET
 #ifdef GRPC_HAVE_UNIX_SOCKET

+ 1 - 1
src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc

@@ -25,7 +25,6 @@
 #include <unistd.h>
 #include <unistd.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 
 
 #include "src/core/ext/filters/client_channel/http_connect_handshaker.h"
 #include "src/core/ext/filters/client_channel/http_connect_handshaker.h"
@@ -35,6 +34,7 @@
 #include "src/core/lib/backoff/backoff.h"
 #include "src/core/lib/backoff/backoff.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/gpr/env.h"
 #include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gprpp/manual_constructor.h"
 #include "src/core/lib/gprpp/manual_constructor.h"
 #include "src/core/lib/iomgr/combiner.h"
 #include "src/core/lib/iomgr/combiner.h"

+ 1 - 1
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc

@@ -28,7 +28,6 @@
 
 
 #include <ares.h>
 #include <ares.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/time.h>
 #include <grpc/support/time.h>
@@ -36,6 +35,7 @@
 
 
 #include "src/core/ext/filters/client_channel/parse_address.h"
 #include "src/core/ext/filters/client_channel/parse_address.h"
 #include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h"
 #include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/iomgr/error.h"
 #include "src/core/lib/iomgr/error.h"
 #include "src/core/lib/iomgr/executor.h"
 #include "src/core/lib/iomgr/executor.h"

+ 1 - 1
src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc

@@ -23,7 +23,6 @@
 #include <cstring>
 #include <cstring>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/time.h>
 #include <grpc/support/time.h>
 
 
@@ -32,6 +31,7 @@
 #include "src/core/lib/backoff/backoff.h"
 #include "src/core/lib/backoff/backoff.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/gpr/env.h"
 #include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gprpp/manual_constructor.h"
 #include "src/core/lib/gprpp/manual_constructor.h"
 #include "src/core/lib/iomgr/combiner.h"
 #include "src/core/lib/iomgr/combiner.h"

+ 1 - 1
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc

@@ -24,7 +24,6 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/port_platform.h>
 #include <grpc/support/port_platform.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 
 
@@ -32,6 +31,7 @@
 #include "src/core/ext/filters/client_channel/parse_address.h"
 #include "src/core/ext/filters/client_channel/parse_address.h"
 #include "src/core/ext/filters/client_channel/resolver_registry.h"
 #include "src/core/ext/filters/client_channel/resolver_registry.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/iomgr/closure.h"
 #include "src/core/lib/iomgr/closure.h"
 #include "src/core/lib/iomgr/combiner.h"
 #include "src/core/lib/iomgr/combiner.h"

+ 1 - 1
src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc

@@ -22,7 +22,6 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/port_platform.h>
 #include <grpc/support/port_platform.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 
 
@@ -30,6 +29,7 @@
 #include "src/core/ext/filters/client_channel/parse_address.h"
 #include "src/core/ext/filters/client_channel/parse_address.h"
 #include "src/core/ext/filters/client_channel/resolver_registry.h"
 #include "src/core/ext/filters/client_channel/resolver_registry.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/iomgr/combiner.h"
 #include "src/core/lib/iomgr/combiner.h"
 #include "src/core/lib/iomgr/resolve_address.h"
 #include "src/core/lib/iomgr/resolve_address.h"

+ 1 - 1
src/core/ext/transport/cronet/transport/cronet_transport.cc

@@ -21,13 +21,13 @@
 #include <grpc/impl/codegen/port_platform.h>
 #include <grpc/impl/codegen/port_platform.h>
 #include <grpc/slice_buffer.h>
 #include <grpc/slice_buffer.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/useful.h>
 #include <grpc/support/useful.h>
 
 
 #include "src/core/ext/transport/chttp2/transport/incoming_metadata.h"
 #include "src/core/ext/transport/chttp2/transport/incoming_metadata.h"
 #include "src/core/ext/transport/cronet/transport/cronet_transport.h"
 #include "src/core/ext/transport/cronet/transport/cronet_transport.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/iomgr/endpoint.h"
 #include "src/core/lib/iomgr/endpoint.h"
 #include "src/core/lib/iomgr/exec_ctx.h"
 #include "src/core/lib/iomgr/exec_ctx.h"

+ 2 - 1
src/core/lib/gpr/host_port.cc

@@ -16,13 +16,14 @@
  *
  *
  */
  */
 
 
-#include <grpc/support/host_port.h>
+#include "src/core/lib/gpr/host_port.h"
 
 
 #include <string.h>
 #include <string.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
+
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 
 
 int gpr_join_host_port(char** out, const char* host, int port) {
 int gpr_join_host_port(char** out, const char* host, int port) {

+ 5 - 13
include/grpc/support/host_port.h → src/core/lib/gpr/host_port.h

@@ -16,15 +16,11 @@
  *
  *
  */
  */
 
 
-#ifndef GRPC_SUPPORT_HOST_PORT_H
-#define GRPC_SUPPORT_HOST_PORT_H
+#ifndef GRPC_CORE_LIB_GPR_HOST_PORT_H
+#define GRPC_CORE_LIB_GPR_HOST_PORT_H
 
 
 #include <grpc/support/port_platform.h>
 #include <grpc/support/port_platform.h>
 
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /** Given a host and port, creates a newly-allocated string of the form
 /** Given a host and port, creates a newly-allocated string of the form
    "host:port" or "[ho:st]:port", depending on whether the host contains colons
    "host:port" or "[ho:st]:port", depending on whether the host contains colons
    like an IPv6 literal.  If the host is already bracketed, then additional
    like an IPv6 literal.  If the host is already bracketed, then additional
@@ -35,17 +31,13 @@ extern "C" {
    destroyed using gpr_free().
    destroyed using gpr_free().
 
 
    In the unlikely event of an error, returns -1 and sets *out to NULL. */
    In the unlikely event of an error, returns -1 and sets *out to NULL. */
-GPRAPI int gpr_join_host_port(char** out, const char* host, int port);
+int gpr_join_host_port(char** out, const char* host, int port);
 
 
 /** Given a name in the form "host:port" or "[ho:st]:port", split into hostname
 /** Given a name in the form "host:port" or "[ho:st]:port", split into hostname
    and port number, into newly allocated strings, which must later be
    and port number, into newly allocated strings, which must later be
    destroyed using gpr_free().
    destroyed using gpr_free().
    Return 1 on success, 0 on failure. Guarantees *host and *port == NULL on
    Return 1 on success, 0 on failure. Guarantees *host and *port == NULL on
    failure. */
    failure. */
-GPRAPI int gpr_split_host_port(const char* name, char** host, char** port);
-
-#ifdef __cplusplus
-}
-#endif
+int gpr_split_host_port(const char* name, char** host, char** port);
 
 
-#endif /* GRPC_SUPPORT_HOST_PORT_H */
+#endif /* GRPC_CORE_LIB_GPR_HOST_PORT_H */

+ 2 - 1
src/core/lib/iomgr/resolve_address_posix.cc

@@ -27,12 +27,13 @@
 #include <sys/types.h>
 #include <sys/types.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/time.h>
 #include <grpc/support/time.h>
 #include <grpc/support/useful.h>
 #include <grpc/support/useful.h>
+
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/iomgr/block_annotate.h"
 #include "src/core/lib/iomgr/block_annotate.h"
 #include "src/core/lib/iomgr/executor.h"
 #include "src/core/lib/iomgr/executor.h"

+ 1 - 1
src/core/lib/iomgr/resolve_address_uv.cc

@@ -22,11 +22,11 @@
 #include <uv.h>
 #include <uv.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/useful.h>
 #include <grpc/support/useful.h>
 
 
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/iomgr/closure.h"
 #include "src/core/lib/iomgr/closure.h"
 #include "src/core/lib/iomgr/error.h"
 #include "src/core/lib/iomgr/error.h"
 #include "src/core/lib/iomgr/exec_ctx.h"
 #include "src/core/lib/iomgr/exec_ctx.h"

+ 2 - 1
src/core/lib/iomgr/resolve_address_windows.cc

@@ -28,12 +28,13 @@
 #include <sys/types.h>
 #include <sys/types.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log_windows.h>
 #include <grpc/support/log_windows.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/time.h>
 #include <grpc/support/time.h>
+
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/iomgr/block_annotate.h"
 #include "src/core/lib/iomgr/block_annotate.h"
 #include "src/core/lib/iomgr/executor.h"
 #include "src/core/lib/iomgr/executor.h"

+ 1 - 1
src/core/lib/iomgr/sockaddr_utils.cc

@@ -23,11 +23,11 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/port_platform.h>
 #include <grpc/support/port_platform.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 
 
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/iomgr/sockaddr.h"
 #include "src/core/lib/iomgr/sockaddr.h"
 #include "src/core/lib/iomgr/socket_utils.h"
 #include "src/core/lib/iomgr/socket_utils.h"

+ 2 - 1
src/core/lib/iomgr/socket_utils_common_posix.cc

@@ -36,10 +36,11 @@
 #include <unistd.h>
 #include <unistd.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/port_platform.h>
 #include <grpc/support/port_platform.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/sync.h>
+
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/iomgr/sockaddr_utils.h"
 #include "src/core/lib/iomgr/sockaddr_utils.h"
 
 

+ 1 - 1
src/core/lib/security/transport/security_connector.cc

@@ -23,7 +23,6 @@
 
 
 #include <grpc/slice_buffer.h>
 #include <grpc/slice_buffer.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 
 
@@ -31,6 +30,7 @@
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/handshaker.h"
 #include "src/core/lib/channel/handshaker.h"
 #include "src/core/lib/gpr/env.h"
 #include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/iomgr/load_file.h"
 #include "src/core/lib/iomgr/load_file.h"
 #include "src/core/lib/security/context/security_context.h"
 #include "src/core/lib/security/context/security_context.h"

+ 1 - 1
src/objective-c/tests/CoreCronetEnd2EndTests/CoreCronetEnd2EndTests.mm

@@ -34,12 +34,12 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 
 
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/security/credentials/credentials.h"
 #include "src/core/lib/security/credentials/credentials.h"
 #include "src/core/lib/gpr/env.h"
 #include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/tmpfile.h"
 #include "src/core/lib/gpr/tmpfile.h"
 #include "test/core/end2end/data/ssl_test_data.h"
 #include "test/core/end2end/data/ssl_test_data.h"

+ 1 - 1
src/objective-c/tests/CronetUnitTests/CronetUnitTests.m

@@ -23,7 +23,6 @@
 #import <Cronet/Cronet.h>
 #import <Cronet/Cronet.h>
 #import <grpc/grpc.h>
 #import <grpc/grpc.h>
 #import <grpc/grpc_cronet.h>
 #import <grpc/grpc_cronet.h>
-#import <grpc/support/host_port.h>
 #import "test/core/end2end/cq_verifier.h"
 #import "test/core/end2end/cq_verifier.h"
 #import "test/core/util/port.h"
 #import "test/core/util/port.h"
 
 
@@ -32,6 +31,7 @@
 
 
 #import "src/core/lib/channel/channel_args.h"
 #import "src/core/lib/channel/channel_args.h"
 #import "src/core/lib/gpr/env.h"
 #import "src/core/lib/gpr/env.h"
+#import "src/core/lib/gpr/host_port.h"
 #import "src/core/lib/gpr/string.h"
 #import "src/core/lib/gpr/string.h"
 #import "src/core/lib/gpr/tmpfile.h"
 #import "src/core/lib/gpr/tmpfile.h"
 #import "test/core/end2end/data/ssl_test_data.h"
 #import "test/core/end2end/data/ssl_test_data.h"

+ 0 - 4
src/ruby/ext/grpc/rb_grpc_imports.generated.c

@@ -218,8 +218,6 @@ gpr_cmdline_destroy_type gpr_cmdline_destroy_import;
 gpr_cmdline_usage_string_type gpr_cmdline_usage_string_import;
 gpr_cmdline_usage_string_type gpr_cmdline_usage_string_import;
 gpr_cpu_num_cores_type gpr_cpu_num_cores_import;
 gpr_cpu_num_cores_type gpr_cpu_num_cores_import;
 gpr_cpu_current_cpu_type gpr_cpu_current_cpu_import;
 gpr_cpu_current_cpu_type gpr_cpu_current_cpu_import;
-gpr_join_host_port_type gpr_join_host_port_import;
-gpr_split_host_port_type gpr_split_host_port_import;
 gpr_log_severity_string_type gpr_log_severity_string_import;
 gpr_log_severity_string_type gpr_log_severity_string_import;
 gpr_log_type gpr_log_import;
 gpr_log_type gpr_log_import;
 gpr_log_message_type gpr_log_message_import;
 gpr_log_message_type gpr_log_message_import;
@@ -485,8 +483,6 @@ void grpc_rb_load_imports(HMODULE library) {
   gpr_cmdline_usage_string_import = (gpr_cmdline_usage_string_type) GetProcAddress(library, "gpr_cmdline_usage_string");
   gpr_cmdline_usage_string_import = (gpr_cmdline_usage_string_type) GetProcAddress(library, "gpr_cmdline_usage_string");
   gpr_cpu_num_cores_import = (gpr_cpu_num_cores_type) GetProcAddress(library, "gpr_cpu_num_cores");
   gpr_cpu_num_cores_import = (gpr_cpu_num_cores_type) GetProcAddress(library, "gpr_cpu_num_cores");
   gpr_cpu_current_cpu_import = (gpr_cpu_current_cpu_type) GetProcAddress(library, "gpr_cpu_current_cpu");
   gpr_cpu_current_cpu_import = (gpr_cpu_current_cpu_type) GetProcAddress(library, "gpr_cpu_current_cpu");
-  gpr_join_host_port_import = (gpr_join_host_port_type) GetProcAddress(library, "gpr_join_host_port");
-  gpr_split_host_port_import = (gpr_split_host_port_type) GetProcAddress(library, "gpr_split_host_port");
   gpr_log_severity_string_import = (gpr_log_severity_string_type) GetProcAddress(library, "gpr_log_severity_string");
   gpr_log_severity_string_import = (gpr_log_severity_string_type) GetProcAddress(library, "gpr_log_severity_string");
   gpr_log_import = (gpr_log_type) GetProcAddress(library, "gpr_log");
   gpr_log_import = (gpr_log_type) GetProcAddress(library, "gpr_log");
   gpr_log_message_import = (gpr_log_message_type) GetProcAddress(library, "gpr_log_message");
   gpr_log_message_import = (gpr_log_message_type) GetProcAddress(library, "gpr_log_message");

+ 0 - 7
src/ruby/ext/grpc/rb_grpc_imports.generated.h

@@ -36,7 +36,6 @@
 #include <grpc/support/avl.h>
 #include <grpc/support/avl.h>
 #include <grpc/support/cmdline.h>
 #include <grpc/support/cmdline.h>
 #include <grpc/support/cpu.h>
 #include <grpc/support/cpu.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log_windows.h>
 #include <grpc/support/log_windows.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
@@ -633,12 +632,6 @@ extern gpr_cpu_num_cores_type gpr_cpu_num_cores_import;
 typedef unsigned(*gpr_cpu_current_cpu_type)(void);
 typedef unsigned(*gpr_cpu_current_cpu_type)(void);
 extern gpr_cpu_current_cpu_type gpr_cpu_current_cpu_import;
 extern gpr_cpu_current_cpu_type gpr_cpu_current_cpu_import;
 #define gpr_cpu_current_cpu gpr_cpu_current_cpu_import
 #define gpr_cpu_current_cpu gpr_cpu_current_cpu_import
-typedef int(*gpr_join_host_port_type)(char** out, const char* host, int port);
-extern gpr_join_host_port_type gpr_join_host_port_import;
-#define gpr_join_host_port gpr_join_host_port_import
-typedef int(*gpr_split_host_port_type)(const char* name, char** host, char** port);
-extern gpr_split_host_port_type gpr_split_host_port_import;
-#define gpr_split_host_port gpr_split_host_port_import
 typedef const char*(*gpr_log_severity_string_type)(gpr_log_severity severity);
 typedef const char*(*gpr_log_severity_string_type)(gpr_log_severity severity);
 extern gpr_log_severity_string_type gpr_log_severity_string_import;
 extern gpr_log_severity_string_type gpr_log_severity_string_import;
 #define gpr_log_severity_string gpr_log_severity_string_import
 #define gpr_log_severity_string gpr_log_severity_string_import

+ 2 - 1
test/core/bad_ssl/bad_ssl_test.cc

@@ -22,11 +22,12 @@
 #include <grpc/grpc.h>
 #include <grpc/grpc.h>
 #include <grpc/grpc_security.h>
 #include <grpc/grpc_security.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/subprocess.h>
 #include <grpc/support/subprocess.h>
+
 #include "src/core/lib/gpr/env.h"
 #include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "test/core/end2end/cq_verifier.h"
 #include "test/core/end2end/cq_verifier.h"
 #include "test/core/util/port.h"
 #include "test/core/util/port.h"

+ 1 - 1
test/core/end2end/bad_server_response_test.cc

@@ -27,10 +27,10 @@
 #include <grpc/grpc.h>
 #include <grpc/grpc.h>
 #include <grpc/slice.h>
 #include <grpc/slice.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/thd.h>
 
 
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/iomgr/sockaddr.h"
 #include "src/core/lib/iomgr/sockaddr.h"
 #include "src/core/lib/slice/slice_internal.h"
 #include "src/core/lib/slice/slice_internal.h"

+ 1 - 1
test/core/end2end/connection_refused_test.cc

@@ -20,11 +20,11 @@
 
 
 #include <grpc/grpc.h>
 #include <grpc/grpc.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 
 
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/slice/slice_internal.h"
 #include "src/core/lib/slice/slice_internal.h"
 #include "src/core/lib/transport/metadata.h"
 #include "src/core/lib/transport/metadata.h"
 #include "src/core/lib/transport/service_config.h"
 #include "src/core/lib/transport/service_config.h"

+ 1 - 1
test/core/end2end/dualstack_socket_test.cc

@@ -25,10 +25,10 @@
 
 
 #include <grpc/grpc.h>
 #include <grpc/grpc.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 
 
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/iomgr/error.h"
 #include "src/core/lib/iomgr/error.h"
 #include "src/core/lib/iomgr/resolve_address.h"
 #include "src/core/lib/iomgr/resolve_address.h"

+ 2 - 1
test/core/end2end/fixtures/h2_census.cc

@@ -21,16 +21,17 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/useful.h>
 #include <grpc/support/useful.h>
+
 #include "src/core/ext/filters/client_channel/client_channel.h"
 #include "src/core/ext/filters/client_channel/client_channel.h"
 #include "src/core/ext/filters/http/server/http_server_filter.h"
 #include "src/core/ext/filters/http/server/http_server_filter.h"
 #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
 #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/connected_channel.h"
 #include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/surface/channel.h"
 #include "src/core/lib/surface/channel.h"
 #include "src/core/lib/surface/server.h"
 #include "src/core/lib/surface/server.h"
 #include "test/core/util/port.h"
 #include "test/core/util/port.h"

+ 2 - 1
test/core/end2end/fixtures/h2_compress.cc

@@ -21,16 +21,17 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/useful.h>
 #include <grpc/support/useful.h>
+
 #include "src/core/ext/filters/client_channel/client_channel.h"
 #include "src/core/ext/filters/client_channel/client_channel.h"
 #include "src/core/ext/filters/http/server/http_server_filter.h"
 #include "src/core/ext/filters/http/server/http_server_filter.h"
 #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
 #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/connected_channel.h"
 #include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/surface/channel.h"
 #include "src/core/lib/surface/channel.h"
 #include "src/core/lib/surface/server.h"
 #include "src/core/lib/surface/server.h"
 #include "test/core/util/port.h"
 #include "test/core/util/port.h"

+ 2 - 1
test/core/end2end/fixtures/h2_fakesec.cc

@@ -22,9 +22,10 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
+
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/security/credentials/fake/fake_credentials.h"
 #include "src/core/lib/security/credentials/fake/fake_credentials.h"
 #include "test/core/end2end/data/ssl_test_data.h"
 #include "test/core/end2end/data/ssl_test_data.h"
 #include "test/core/util/port.h"
 #include "test/core/util/port.h"

+ 2 - 1
test/core/end2end/fixtures/h2_full+pipe.cc

@@ -26,15 +26,16 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/useful.h>
 #include <grpc/support/useful.h>
+
 #include "src/core/ext/filters/client_channel/client_channel.h"
 #include "src/core/ext/filters/client_channel/client_channel.h"
 #include "src/core/ext/filters/http/server/http_server_filter.h"
 #include "src/core/ext/filters/http/server/http_server_filter.h"
 #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
 #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
 #include "src/core/lib/channel/connected_channel.h"
 #include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/iomgr/wakeup_fd_posix.h"
 #include "src/core/lib/iomgr/wakeup_fd_posix.h"
 #include "src/core/lib/surface/channel.h"
 #include "src/core/lib/surface/channel.h"
 #include "src/core/lib/surface/server.h"
 #include "src/core/lib/surface/server.h"

+ 2 - 1
test/core/end2end/fixtures/h2_full+trace.cc

@@ -26,16 +26,17 @@
 #endif
 #endif
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/useful.h>
 #include <grpc/support/useful.h>
+
 #include "src/core/ext/filters/client_channel/client_channel.h"
 #include "src/core/ext/filters/client_channel/client_channel.h"
 #include "src/core/ext/filters/http/server/http_server_filter.h"
 #include "src/core/ext/filters/http/server/http_server_filter.h"
 #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
 #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
 #include "src/core/lib/channel/connected_channel.h"
 #include "src/core/lib/channel/connected_channel.h"
 #include "src/core/lib/gpr/env.h"
 #include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/surface/channel.h"
 #include "src/core/lib/surface/channel.h"
 #include "src/core/lib/surface/server.h"
 #include "src/core/lib/surface/server.h"
 #include "test/core/util/port.h"
 #include "test/core/util/port.h"

+ 2 - 1
test/core/end2end/fixtures/h2_full+workarounds.cc

@@ -21,16 +21,17 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/useful.h>
 #include <grpc/support/useful.h>
 #include <grpc/support/workaround_list.h>
 #include <grpc/support/workaround_list.h>
+
 #include "src/core/ext/filters/client_channel/client_channel.h"
 #include "src/core/ext/filters/client_channel/client_channel.h"
 #include "src/core/ext/filters/http/server/http_server_filter.h"
 #include "src/core/ext/filters/http/server/http_server_filter.h"
 #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
 #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
 #include "src/core/lib/channel/connected_channel.h"
 #include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/surface/channel.h"
 #include "src/core/lib/surface/channel.h"
 #include "src/core/lib/surface/server.h"
 #include "src/core/lib/surface/server.h"
 #include "test/core/util/port.h"
 #include "test/core/util/port.h"

+ 2 - 1
test/core/end2end/fixtures/h2_full.cc

@@ -21,15 +21,16 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/useful.h>
 #include <grpc/support/useful.h>
+
 #include "src/core/ext/filters/client_channel/client_channel.h"
 #include "src/core/ext/filters/client_channel/client_channel.h"
 #include "src/core/ext/filters/http/server/http_server_filter.h"
 #include "src/core/ext/filters/http/server/http_server_filter.h"
 #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
 #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
 #include "src/core/lib/channel/connected_channel.h"
 #include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/surface/channel.h"
 #include "src/core/lib/surface/channel.h"
 #include "src/core/lib/surface/server.h"
 #include "src/core/lib/surface/server.h"
 #include "test/core/util/port.h"
 #include "test/core/util/port.h"

+ 2 - 1
test/core/end2end/fixtures/h2_http_proxy.cc

@@ -21,17 +21,18 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/useful.h>
 #include <grpc/support/useful.h>
+
 #include "src/core/ext/filters/client_channel/client_channel.h"
 #include "src/core/ext/filters/client_channel/client_channel.h"
 #include "src/core/ext/filters/http/server/http_server_filter.h"
 #include "src/core/ext/filters/http/server/http_server_filter.h"
 #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
 #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
 #include "src/core/lib/channel/connected_channel.h"
 #include "src/core/lib/channel/connected_channel.h"
 #include "src/core/lib/gpr/env.h"
 #include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/surface/channel.h"
 #include "src/core/lib/surface/channel.h"
 #include "src/core/lib/surface/server.h"
 #include "src/core/lib/surface/server.h"
 #include "test/core/end2end/fixtures/http_proxy_fixture.h"
 #include "test/core/end2end/fixtures/http_proxy_fixture.h"

+ 2 - 1
test/core/end2end/fixtures/h2_load_reporting.cc

@@ -21,17 +21,18 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/useful.h>
 #include <grpc/support/useful.h>
+
 #include "src/core/ext/filters/client_channel/client_channel.h"
 #include "src/core/ext/filters/client_channel/client_channel.h"
 #include "src/core/ext/filters/http/server/http_server_filter.h"
 #include "src/core/ext/filters/http/server/http_server_filter.h"
 #include "src/core/ext/filters/load_reporting/server_load_reporting_plugin.h"
 #include "src/core/ext/filters/load_reporting/server_load_reporting_plugin.h"
 #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
 #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/connected_channel.h"
 #include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/surface/channel.h"
 #include "src/core/lib/surface/channel.h"
 #include "src/core/lib/surface/server.h"
 #include "src/core/lib/surface/server.h"
 #include "test/core/util/port.h"
 #include "test/core/util/port.h"

+ 2 - 1
test/core/end2end/fixtures/h2_oauth2.cc

@@ -22,9 +22,10 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
+
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/iomgr/iomgr.h"
 #include "src/core/lib/iomgr/iomgr.h"
 #include "src/core/lib/security/credentials/credentials.h"
 #include "src/core/lib/security/credentials/credentials.h"
 #include "test/core/end2end/data/ssl_test_data.h"
 #include "test/core/end2end/data/ssl_test_data.h"

+ 2 - 1
test/core/end2end/fixtures/h2_proxy.cc

@@ -21,15 +21,16 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/useful.h>
 #include <grpc/support/useful.h>
+
 #include "src/core/ext/filters/client_channel/client_channel.h"
 #include "src/core/ext/filters/client_channel/client_channel.h"
 #include "src/core/ext/filters/http/server/http_server_filter.h"
 #include "src/core/ext/filters/http/server/http_server_filter.h"
 #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
 #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
 #include "src/core/lib/channel/connected_channel.h"
 #include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/surface/channel.h"
 #include "src/core/lib/surface/channel.h"
 #include "src/core/lib/surface/server.h"
 #include "src/core/lib/surface/server.h"
 #include "test/core/end2end/fixtures/proxy.h"
 #include "test/core/end2end/fixtures/proxy.h"

+ 1 - 1
test/core/end2end/fixtures/h2_ssl.cc

@@ -22,11 +22,11 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 
 
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/gpr/env.h"
 #include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/tmpfile.h"
 #include "src/core/lib/gpr/tmpfile.h"
 #include "src/core/lib/security/credentials/credentials.h"
 #include "src/core/lib/security/credentials/credentials.h"

+ 1 - 1
test/core/end2end/fixtures/h2_ssl_proxy.cc

@@ -22,11 +22,11 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 
 
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/gpr/env.h"
 #include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/tmpfile.h"
 #include "src/core/lib/gpr/tmpfile.h"
 #include "src/core/lib/security/credentials/credentials.h"
 #include "src/core/lib/security/credentials/credentials.h"

+ 1 - 1
test/core/end2end/fixtures/h2_uds.cc

@@ -23,7 +23,6 @@
 #include <unistd.h>
 #include <unistd.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/sync.h>
@@ -33,6 +32,7 @@
 #include "src/core/ext/filters/http/server/http_server_filter.h"
 #include "src/core/ext/filters/http/server/http_server_filter.h"
 #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
 #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
 #include "src/core/lib/channel/connected_channel.h"
 #include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/surface/channel.h"
 #include "src/core/lib/surface/channel.h"
 #include "src/core/lib/surface/server.h"
 #include "src/core/lib/surface/server.h"

+ 1 - 1
test/core/end2end/fixtures/http_proxy_fixture.cc

@@ -26,7 +26,6 @@
 #include <grpc/slice_buffer.h>
 #include <grpc/slice_buffer.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/atm.h>
 #include <grpc/support/atm.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/sync.h>
@@ -34,6 +33,7 @@
 #include <grpc/support/useful.h>
 #include <grpc/support/useful.h>
 
 
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/http/parser.h"
 #include "src/core/lib/http/parser.h"
 #include "src/core/lib/iomgr/closure.h"
 #include "src/core/lib/iomgr/closure.h"

+ 2 - 1
test/core/end2end/fixtures/inproc.cc

@@ -21,15 +21,16 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/useful.h>
 #include <grpc/support/useful.h>
+
 #include "src/core/ext/filters/client_channel/client_channel.h"
 #include "src/core/ext/filters/client_channel/client_channel.h"
 #include "src/core/ext/filters/http/server/http_server_filter.h"
 #include "src/core/ext/filters/http/server/http_server_filter.h"
 #include "src/core/ext/transport/inproc/inproc_transport.h"
 #include "src/core/ext/transport/inproc/inproc_transport.h"
 #include "src/core/lib/channel/connected_channel.h"
 #include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/surface/channel.h"
 #include "src/core/lib/surface/channel.h"
 #include "src/core/lib/surface/server.h"
 #include "src/core/lib/surface/server.h"
 #include "test/core/util/port.h"
 #include "test/core/util/port.h"

+ 1 - 1
test/core/end2end/fixtures/proxy.cc

@@ -21,12 +21,12 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/useful.h>
 #include <grpc/support/useful.h>
 
 
+#include "src/core/lib/gpr/host_port.h"
 #include "test/core/util/port.h"
 #include "test/core/util/port.h"
 
 
 struct grpc_end2end_proxy {
 struct grpc_end2end_proxy {

+ 1 - 1
test/core/end2end/h2_ssl_cert_test.cc

@@ -22,11 +22,11 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 
 
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/gpr/env.h"
 #include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/tmpfile.h"
 #include "src/core/lib/gpr/tmpfile.h"
 #include "src/core/lib/security/credentials/credentials.h"
 #include "src/core/lib/security/credentials/credentials.h"

+ 1 - 1
test/core/end2end/invalid_call_argument_test.cc

@@ -23,9 +23,9 @@
 
 
 #include <grpc/grpc.h>
 #include <grpc/grpc.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 
 
+#include "src/core/lib/gpr/host_port.h"
 #include "test/core/end2end/cq_verifier.h"
 #include "test/core/end2end/cq_verifier.h"
 #include "test/core/util/port.h"
 #include "test/core/util/port.h"
 #include "test/core/util/test_config.h"
 #include "test/core/util/test_config.h"

+ 2 - 1
test/core/fling/fling_stream_test.cc

@@ -20,9 +20,10 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/subprocess.h>
 #include <grpc/support/subprocess.h>
+
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "test/core/util/port.h"
 #include "test/core/util/port.h"
 
 

+ 2 - 1
test/core/fling/fling_test.cc

@@ -20,9 +20,10 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/subprocess.h>
 #include <grpc/support/subprocess.h>
+
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "test/core/util/port.h"
 #include "test/core/util/port.h"
 
 

+ 2 - 1
test/core/fling/server.cc

@@ -31,9 +31,10 @@
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/cmdline.h>
 #include <grpc/support/cmdline.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/time.h>
 #include <grpc/support/time.h>
+
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/profiling/timers.h"
 #include "src/core/lib/profiling/timers.h"
 #include "test/core/end2end/data/ssl_test_data.h"
 #include "test/core/end2end/data/ssl_test_data.h"
 #include "test/core/util/grpc_profiler.h"
 #include "test/core/util/grpc_profiler.h"

+ 2 - 1
test/core/gpr/host_port_test.cc

@@ -19,8 +19,9 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
+
+#include "src/core/lib/gpr/host_port.h"
 #include "test/core/util/test_config.h"
 #include "test/core/util/test_config.h"
 
 
 static void join_host_port_expect(const char* host, int port,
 static void join_host_port_expect(const char* host, int port,

+ 2 - 1
test/core/memory_usage/memory_usage_test.cc

@@ -20,9 +20,10 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/subprocess.h>
 #include <grpc/support/subprocess.h>
+
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "test/core/util/port.h"
 #include "test/core/util/port.h"
 
 

+ 2 - 1
test/core/memory_usage/server.cc

@@ -31,9 +31,10 @@
 
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/cmdline.h>
 #include <grpc/support/cmdline.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/time.h>
 #include <grpc/support/time.h>
+
+#include "src/core/lib/gpr/host_port.h"
 #include "test/core/end2end/data/ssl_test_data.h"
 #include "test/core/end2end/data/ssl_test_data.h"
 #include "test/core/util/memory_counters.h"
 #include "test/core/util/memory_counters.h"
 #include "test/core/util/port.h"
 #include "test/core/util/port.h"

+ 1 - 1
test/core/surface/num_external_connectivity_watchers_test.cc

@@ -19,11 +19,11 @@
 #include <grpc/grpc.h>
 #include <grpc/grpc.h>
 #include <grpc/grpc_security.h>
 #include <grpc/grpc_security.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/thd.h>
 
 
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/iomgr/exec_ctx.h"
 #include "src/core/lib/iomgr/exec_ctx.h"
 #include "test/core/end2end/data/ssl_test_data.h"
 #include "test/core/end2end/data/ssl_test_data.h"
 #include "test/core/util/port.h"
 #include "test/core/util/port.h"

+ 0 - 3
test/core/surface/public_headers_must_be_c89.c

@@ -49,7 +49,6 @@
 #include <grpc/support/avl.h>
 #include <grpc/support/avl.h>
 #include <grpc/support/cmdline.h>
 #include <grpc/support/cmdline.h>
 #include <grpc/support/cpu.h>
 #include <grpc/support/cpu.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/port_platform.h>
 #include <grpc/support/port_platform.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
@@ -259,8 +258,6 @@ int main(int argc, char **argv) {
   printf("%lx", (unsigned long) gpr_cmdline_usage_string);
   printf("%lx", (unsigned long) gpr_cmdline_usage_string);
   printf("%lx", (unsigned long) gpr_cpu_num_cores);
   printf("%lx", (unsigned long) gpr_cpu_num_cores);
   printf("%lx", (unsigned long) gpr_cpu_current_cpu);
   printf("%lx", (unsigned long) gpr_cpu_current_cpu);
-  printf("%lx", (unsigned long) gpr_join_host_port);
-  printf("%lx", (unsigned long) gpr_split_host_port);
   printf("%lx", (unsigned long) gpr_log_severity_string);
   printf("%lx", (unsigned long) gpr_log_severity_string);
   printf("%lx", (unsigned long) gpr_log);
   printf("%lx", (unsigned long) gpr_log);
   printf("%lx", (unsigned long) gpr_log_message);
   printf("%lx", (unsigned long) gpr_log_message);

+ 1 - 1
test/core/surface/sequential_connectivity_test.cc

@@ -19,11 +19,11 @@
 #include <grpc/grpc.h>
 #include <grpc/grpc.h>
 #include <grpc/grpc_security.h>
 #include <grpc/grpc_security.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/thd.h>
 
 
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/iomgr/exec_ctx.h"
 #include "src/core/lib/iomgr/exec_ctx.h"
 #include "test/core/end2end/data/ssl_test_data.h"
 #include "test/core/end2end/data/ssl_test_data.h"
 #include "test/core/util/port.h"
 #include "test/core/util/port.h"

+ 2 - 1
test/core/surface/server_chttp2_test.cc

@@ -19,9 +19,10 @@
 #include <grpc/grpc.h>
 #include <grpc/grpc.h>
 #include <grpc/grpc_security.h>
 #include <grpc/grpc_security.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/time.h>
 #include <grpc/support/time.h>
+
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/security/credentials/credentials.h"
 #include "src/core/lib/security/credentials/credentials.h"
 #include "src/core/lib/security/credentials/fake/fake_credentials.h"
 #include "src/core/lib/security/credentials/fake/fake_credentials.h"
 #include "src/core/tsi/fake_transport_security.h"
 #include "src/core/tsi/fake_transport_security.h"

+ 2 - 1
test/core/surface/server_test.cc

@@ -19,9 +19,10 @@
 #include <grpc/grpc.h>
 #include <grpc/grpc.h>
 #include <grpc/grpc_security.h>
 #include <grpc/grpc_security.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
+
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/iomgr/resolve_address.h"
 #include "src/core/lib/iomgr/resolve_address.h"
 #include "src/core/lib/security/credentials/fake/fake_credentials.h"
 #include "src/core/lib/security/credentials/fake/fake_credentials.h"
 #include "test/core/util/port.h"
 #include "test/core/util/port.h"

+ 2 - 1
test/core/util/reconnect_server.cc

@@ -20,11 +20,12 @@
 
 
 #include <grpc/grpc.h>
 #include <grpc/grpc.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/time.h>
 #include <grpc/support/time.h>
 #include <string.h>
 #include <string.h>
+
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/iomgr/endpoint.h"
 #include "src/core/lib/iomgr/endpoint.h"
 #include "src/core/lib/iomgr/sockaddr.h"
 #include "src/core/lib/iomgr/sockaddr.h"
 #include "src/core/lib/iomgr/tcp_server.h"
 #include "src/core/lib/iomgr/tcp_server.h"

+ 2 - 1
test/core/util/test_tcp_server.cc

@@ -22,11 +22,12 @@
 
 
 #include <grpc/grpc.h>
 #include <grpc/grpc.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/time.h>
 #include <grpc/support/time.h>
 #include <string.h>
 #include <string.h>
+
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/iomgr/endpoint.h"
 #include "src/core/lib/iomgr/endpoint.h"
 #include "src/core/lib/iomgr/resolve_address.h"
 #include "src/core/lib/iomgr/resolve_address.h"
 #include "src/core/lib/iomgr/tcp_server.h"
 #include "src/core/lib/iomgr/tcp_server.h"

+ 5 - 0
test/cpp/end2end/OWNERS

@@ -0,0 +1,5 @@
+set noparent
+@vjpai
+@yang-g
+@y-zeng
+

+ 154 - 84
test/cpp/end2end/client_lb_end2end_test.cc

@@ -39,6 +39,7 @@
 #include "src/core/ext/filters/client_channel/subchannel_index.h"
 #include "src/core/ext/filters/client_channel/subchannel_index.h"
 #include "src/core/lib/backoff/backoff.h"
 #include "src/core/lib/backoff/backoff.h"
 #include "src/core/lib/gpr/env.h"
 #include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gprpp/debug_location.h"
 
 
 #include "src/proto/grpc/testing/echo.grpc.pb.h"
 #include "src/proto/grpc/testing/echo.grpc.pb.h"
 #include "test/core/util/port.h"
 #include "test/core/util/port.h"
@@ -162,44 +163,82 @@ class ClientLbEnd2endTest : public ::testing::Test {
     grpc_lb_addresses_destroy(addresses);
     grpc_lb_addresses_destroy(addresses);
   }
   }
 
 
+  void SetNextResolutionUponError(const std::vector<int>& ports) {
+    grpc_core::ExecCtx exec_ctx;
+    grpc_lb_addresses* addresses =
+        grpc_lb_addresses_create(ports.size(), nullptr);
+    for (size_t i = 0; i < ports.size(); ++i) {
+      char* lb_uri_str;
+      gpr_asprintf(&lb_uri_str, "ipv4:127.0.0.1:%d", ports[i]);
+      grpc_uri* lb_uri = grpc_uri_parse(lb_uri_str, true);
+      GPR_ASSERT(lb_uri != nullptr);
+      grpc_lb_addresses_set_address_from_uri(addresses, i, lb_uri,
+                                             false /* is balancer */,
+                                             "" /* balancer name */, nullptr);
+      grpc_uri_destroy(lb_uri);
+      gpr_free(lb_uri_str);
+    }
+    const grpc_arg fake_addresses =
+        grpc_lb_addresses_create_channel_arg(addresses);
+    grpc_channel_args* fake_result =
+        grpc_channel_args_copy_and_add(nullptr, &fake_addresses, 1);
+    grpc_fake_resolver_response_generator_set_response_upon_error(
+        response_generator_, fake_result);
+    grpc_channel_args_destroy(fake_result);
+    grpc_lb_addresses_destroy(addresses);
+  }
+
   std::vector<int> GetServersPorts() {
   std::vector<int> GetServersPorts() {
     std::vector<int> ports;
     std::vector<int> ports;
     for (const auto& server : servers_) ports.push_back(server->port_);
     for (const auto& server : servers_) ports.push_back(server->port_);
     return ports;
     return ports;
   }
   }
 
 
-  void ResetStub(const grpc::string& lb_policy_name,
-                 ChannelArguments args = ChannelArguments()) {
+  std::unique_ptr<grpc::testing::EchoTestService::Stub> BuildStub(
+      const std::shared_ptr<Channel>& channel) {
+    return grpc::testing::EchoTestService::NewStub(channel);
+  }
+
+  std::shared_ptr<Channel> BuildChannel(
+      const grpc::string& lb_policy_name,
+      ChannelArguments args = ChannelArguments()) {
     if (lb_policy_name.size() > 0) {
     if (lb_policy_name.size() > 0) {
       args.SetLoadBalancingPolicyName(lb_policy_name);
       args.SetLoadBalancingPolicyName(lb_policy_name);
     }  // else, default to pick first
     }  // else, default to pick first
     args.SetPointer(GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR,
     args.SetPointer(GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR,
                     response_generator_);
                     response_generator_);
-    channel_ =
-        CreateCustomChannel("fake:///", InsecureChannelCredentials(), args);
-    stub_ = grpc::testing::EchoTestService::NewStub(channel_);
+    return CreateCustomChannel("fake:///", InsecureChannelCredentials(), args);
   }
   }
 
 
-  bool SendRpc(EchoResponse* response = nullptr) {
+  bool SendRpc(
+      const std::unique_ptr<grpc::testing::EchoTestService::Stub>& stub,
+      EchoResponse* response = nullptr, int timeout_ms = 1000) {
     const bool local_response = (response == nullptr);
     const bool local_response = (response == nullptr);
     if (local_response) response = new EchoResponse;
     if (local_response) response = new EchoResponse;
     EchoRequest request;
     EchoRequest request;
     request.set_message(kRequestMessage_);
     request.set_message(kRequestMessage_);
     ClientContext context;
     ClientContext context;
-    Status status = stub_->Echo(&context, request, response);
+    context.set_deadline(grpc_timeout_milliseconds_to_deadline(timeout_ms));
+    Status status = stub->Echo(&context, request, response);
     if (local_response) delete response;
     if (local_response) delete response;
     return status.ok();
     return status.ok();
   }
   }
 
 
-  void CheckRpcSendOk() {
+  void CheckRpcSendOk(
+      const std::unique_ptr<grpc::testing::EchoTestService::Stub>& stub,
+      const grpc_core::DebugLocation& location) {
     EchoResponse response;
     EchoResponse response;
-    const bool success = SendRpc(&response);
-    EXPECT_TRUE(success);
-    EXPECT_EQ(response.message(), kRequestMessage_);
+    const bool success = SendRpc(stub, &response);
+    if (!success) abort();
+    ASSERT_TRUE(success) << "From " << location.file() << ":"
+                         << location.line();
+    ASSERT_EQ(response.message(), kRequestMessage_)
+        << "From " << location.file() << ":" << location.line();
   }
   }
 
 
-  void CheckRpcSendFailure() {
-    const bool success = SendRpc();
+  void CheckRpcSendFailure(
+      const std::unique_ptr<grpc::testing::EchoTestService::Stub>& stub) {
+    const bool success = SendRpc(stub);
     EXPECT_FALSE(success);
     EXPECT_FALSE(success);
   }
   }
 
 
@@ -238,7 +277,7 @@ class ClientLbEnd2endTest : public ::testing::Test {
     }
     }
 
 
     void Shutdown(bool join = true) {
     void Shutdown(bool join = true) {
-      server_->Shutdown();
+      server_->Shutdown(grpc_timeout_milliseconds_to_deadline(0));
       if (join) thread_->join();
       if (join) thread_->join();
     }
     }
   };
   };
@@ -247,9 +286,11 @@ class ClientLbEnd2endTest : public ::testing::Test {
     for (const auto& server : servers_) server->service_.ResetCounters();
     for (const auto& server : servers_) server->service_.ResetCounters();
   }
   }
 
 
-  void WaitForServer(size_t server_idx) {
+  void WaitForServer(
+      const std::unique_ptr<grpc::testing::EchoTestService::Stub>& stub,
+      size_t server_idx, const grpc_core::DebugLocation& location) {
     do {
     do {
-      CheckRpcSendOk();
+      CheckRpcSendOk(stub, location);
     } while (servers_[server_idx]->service_.request_count() == 0);
     } while (servers_[server_idx]->service_.request_count() == 0);
     ResetCounters();
     ResetCounters();
   }
   }
@@ -280,7 +321,6 @@ class ClientLbEnd2endTest : public ::testing::Test {
   }
   }
 
 
   const grpc::string server_host_;
   const grpc::string server_host_;
-  std::shared_ptr<Channel> channel_;
   std::unique_ptr<grpc::testing::EchoTestService::Stub> stub_;
   std::unique_ptr<grpc::testing::EchoTestService::Stub> stub_;
   std::vector<std::unique_ptr<ServerData>> servers_;
   std::vector<std::unique_ptr<ServerData>> servers_;
   grpc_fake_resolver_response_generator* response_generator_;
   grpc_fake_resolver_response_generator* response_generator_;
@@ -291,14 +331,15 @@ TEST_F(ClientLbEnd2endTest, PickFirst) {
   // Start servers and send one RPC per server.
   // Start servers and send one RPC per server.
   const int kNumServers = 3;
   const int kNumServers = 3;
   StartServers(kNumServers);
   StartServers(kNumServers);
-  ResetStub("");  // test that pick first is the default.
+  auto channel = BuildChannel("");  // test that pick first is the default.
+  auto stub = BuildStub(channel);
   std::vector<int> ports;
   std::vector<int> ports;
   for (size_t i = 0; i < servers_.size(); ++i) {
   for (size_t i = 0; i < servers_.size(); ++i) {
     ports.emplace_back(servers_[i]->port_);
     ports.emplace_back(servers_[i]->port_);
   }
   }
   SetNextResolution(ports);
   SetNextResolution(ports);
   for (size_t i = 0; i < servers_.size(); ++i) {
   for (size_t i = 0; i < servers_.size(); ++i) {
-    CheckRpcSendOk();
+    CheckRpcSendOk(stub, DEBUG_LOCATION);
   }
   }
   // All requests should have gone to a single server.
   // All requests should have gone to a single server.
   bool found = false;
   bool found = false;
@@ -312,7 +353,7 @@ TEST_F(ClientLbEnd2endTest, PickFirst) {
   }
   }
   EXPECT_TRUE(found);
   EXPECT_TRUE(found);
   // Check LB policy name for the channel.
   // Check LB policy name for the channel.
-  EXPECT_EQ("pick_first", channel_->GetLoadBalancingPolicyName());
+  EXPECT_EQ("pick_first", channel->GetLoadBalancingPolicyName());
 }
 }
 
 
 TEST_F(ClientLbEnd2endTest, PickFirstBackOffInitialReconnect) {
 TEST_F(ClientLbEnd2endTest, PickFirstBackOffInitialReconnect) {
@@ -321,15 +362,16 @@ TEST_F(ClientLbEnd2endTest, PickFirstBackOffInitialReconnect) {
   args.SetInt(GRPC_ARG_INITIAL_RECONNECT_BACKOFF_MS, kInitialBackOffMs);
   args.SetInt(GRPC_ARG_INITIAL_RECONNECT_BACKOFF_MS, kInitialBackOffMs);
   const std::vector<int> ports = {grpc_pick_unused_port_or_die()};
   const std::vector<int> ports = {grpc_pick_unused_port_or_die()};
   const gpr_timespec t0 = gpr_now(GPR_CLOCK_MONOTONIC);
   const gpr_timespec t0 = gpr_now(GPR_CLOCK_MONOTONIC);
-  ResetStub("pick_first", args);
+  auto channel = BuildChannel("pick_first", args);
+  auto stub = BuildStub(channel);
   SetNextResolution(ports);
   SetNextResolution(ports);
   // The channel won't become connected (there's no server).
   // The channel won't become connected (there's no server).
-  ASSERT_FALSE(channel_->WaitForConnected(
+  ASSERT_FALSE(channel->WaitForConnected(
       grpc_timeout_milliseconds_to_deadline(kInitialBackOffMs * 2)));
       grpc_timeout_milliseconds_to_deadline(kInitialBackOffMs * 2)));
   // Bring up a server on the chosen port.
   // Bring up a server on the chosen port.
   StartServers(1, ports);
   StartServers(1, ports);
   // Now it will.
   // Now it will.
-  ASSERT_TRUE(channel_->WaitForConnected(
+  ASSERT_TRUE(channel->WaitForConnected(
       grpc_timeout_milliseconds_to_deadline(kInitialBackOffMs * 2)));
       grpc_timeout_milliseconds_to_deadline(kInitialBackOffMs * 2)));
   const gpr_timespec t1 = gpr_now(GPR_CLOCK_MONOTONIC);
   const gpr_timespec t1 = gpr_now(GPR_CLOCK_MONOTONIC);
   const grpc_millis waited_ms = gpr_time_to_millis(gpr_time_sub(t1, t0));
   const grpc_millis waited_ms = gpr_time_to_millis(gpr_time_sub(t1, t0));
@@ -349,14 +391,15 @@ TEST_F(ClientLbEnd2endTest, PickFirstBackOffMinReconnect) {
   constexpr int kMinReconnectBackOffMs = 1000;
   constexpr int kMinReconnectBackOffMs = 1000;
   args.SetInt(GRPC_ARG_MIN_RECONNECT_BACKOFF_MS, kMinReconnectBackOffMs);
   args.SetInt(GRPC_ARG_MIN_RECONNECT_BACKOFF_MS, kMinReconnectBackOffMs);
   const std::vector<int> ports = {grpc_pick_unused_port_or_die()};
   const std::vector<int> ports = {grpc_pick_unused_port_or_die()};
-  ResetStub("pick_first", args);
+  auto channel = BuildChannel("pick_first", args);
+  auto stub = BuildStub(channel);
   SetNextResolution(ports);
   SetNextResolution(ports);
   // Make connection delay a 10% longer than it's willing to in order to make
   // Make connection delay a 10% longer than it's willing to in order to make
   // sure we are hitting the codepath that waits for the min reconnect backoff.
   // sure we are hitting the codepath that waits for the min reconnect backoff.
   gpr_atm_rel_store(&g_connection_delay_ms, kMinReconnectBackOffMs * 1.10);
   gpr_atm_rel_store(&g_connection_delay_ms, kMinReconnectBackOffMs * 1.10);
   grpc_tcp_client_connect_impl = tcp_client_connect_with_delay;
   grpc_tcp_client_connect_impl = tcp_client_connect_with_delay;
   const gpr_timespec t0 = gpr_now(GPR_CLOCK_MONOTONIC);
   const gpr_timespec t0 = gpr_now(GPR_CLOCK_MONOTONIC);
-  channel_->WaitForConnected(
+  channel->WaitForConnected(
       grpc_timeout_milliseconds_to_deadline(kMinReconnectBackOffMs * 2));
       grpc_timeout_milliseconds_to_deadline(kMinReconnectBackOffMs * 2));
   const gpr_timespec t1 = gpr_now(GPR_CLOCK_MONOTONIC);
   const gpr_timespec t1 = gpr_now(GPR_CLOCK_MONOTONIC);
   const grpc_millis waited_ms = gpr_time_to_millis(gpr_time_sub(t1, t0));
   const grpc_millis waited_ms = gpr_time_to_millis(gpr_time_sub(t1, t0));
@@ -371,14 +414,16 @@ TEST_F(ClientLbEnd2endTest, PickFirstUpdates) {
   // Start servers and send one RPC per server.
   // Start servers and send one RPC per server.
   const int kNumServers = 3;
   const int kNumServers = 3;
   StartServers(kNumServers);
   StartServers(kNumServers);
-  ResetStub("pick_first");
+  auto channel = BuildChannel("pick_first");
+  auto stub = BuildStub(channel);
+
   std::vector<int> ports;
   std::vector<int> ports;
 
 
   // Perform one RPC against the first server.
   // Perform one RPC against the first server.
   ports.emplace_back(servers_[0]->port_);
   ports.emplace_back(servers_[0]->port_);
   SetNextResolution(ports);
   SetNextResolution(ports);
   gpr_log(GPR_INFO, "****** SET [0] *******");
   gpr_log(GPR_INFO, "****** SET [0] *******");
-  CheckRpcSendOk();
+  CheckRpcSendOk(stub, DEBUG_LOCATION);
   EXPECT_EQ(servers_[0]->service_.request_count(), 1);
   EXPECT_EQ(servers_[0]->service_.request_count(), 1);
 
 
   // An empty update will result in the channel going into TRANSIENT_FAILURE.
   // An empty update will result in the channel going into TRANSIENT_FAILURE.
@@ -387,7 +432,7 @@ TEST_F(ClientLbEnd2endTest, PickFirstUpdates) {
   gpr_log(GPR_INFO, "****** SET none *******");
   gpr_log(GPR_INFO, "****** SET none *******");
   grpc_connectivity_state channel_state;
   grpc_connectivity_state channel_state;
   do {
   do {
-    channel_state = channel_->GetState(true /* try to connect */);
+    channel_state = channel->GetState(true /* try to connect */);
   } while (channel_state == GRPC_CHANNEL_READY);
   } while (channel_state == GRPC_CHANNEL_READY);
   GPR_ASSERT(channel_state != GRPC_CHANNEL_READY);
   GPR_ASSERT(channel_state != GRPC_CHANNEL_READY);
   servers_[0]->service_.ResetCounters();
   servers_[0]->service_.ResetCounters();
@@ -397,7 +442,7 @@ TEST_F(ClientLbEnd2endTest, PickFirstUpdates) {
   ports.emplace_back(servers_[1]->port_);
   ports.emplace_back(servers_[1]->port_);
   SetNextResolution(ports);
   SetNextResolution(ports);
   gpr_log(GPR_INFO, "****** SET [1] *******");
   gpr_log(GPR_INFO, "****** SET [1] *******");
-  WaitForServer(1);
+  WaitForServer(stub, 1, DEBUG_LOCATION);
   EXPECT_EQ(servers_[0]->service_.request_count(), 0);
   EXPECT_EQ(servers_[0]->service_.request_count(), 0);
 
 
   // And again for servers_[2]
   // And again for servers_[2]
@@ -405,26 +450,28 @@ TEST_F(ClientLbEnd2endTest, PickFirstUpdates) {
   ports.emplace_back(servers_[2]->port_);
   ports.emplace_back(servers_[2]->port_);
   SetNextResolution(ports);
   SetNextResolution(ports);
   gpr_log(GPR_INFO, "****** SET [2] *******");
   gpr_log(GPR_INFO, "****** SET [2] *******");
-  WaitForServer(2);
+  WaitForServer(stub, 2, DEBUG_LOCATION);
   EXPECT_EQ(servers_[0]->service_.request_count(), 0);
   EXPECT_EQ(servers_[0]->service_.request_count(), 0);
   EXPECT_EQ(servers_[1]->service_.request_count(), 0);
   EXPECT_EQ(servers_[1]->service_.request_count(), 0);
 
 
   // Check LB policy name for the channel.
   // Check LB policy name for the channel.
-  EXPECT_EQ("pick_first", channel_->GetLoadBalancingPolicyName());
+  EXPECT_EQ("pick_first", channel->GetLoadBalancingPolicyName());
 }
 }
 
 
 TEST_F(ClientLbEnd2endTest, PickFirstUpdateSuperset) {
 TEST_F(ClientLbEnd2endTest, PickFirstUpdateSuperset) {
   // Start servers and send one RPC per server.
   // Start servers and send one RPC per server.
   const int kNumServers = 3;
   const int kNumServers = 3;
   StartServers(kNumServers);
   StartServers(kNumServers);
-  ResetStub("pick_first");
+  auto channel = BuildChannel("pick_first");
+  auto stub = BuildStub(channel);
+
   std::vector<int> ports;
   std::vector<int> ports;
 
 
   // Perform one RPC against the first server.
   // Perform one RPC against the first server.
   ports.emplace_back(servers_[0]->port_);
   ports.emplace_back(servers_[0]->port_);
   SetNextResolution(ports);
   SetNextResolution(ports);
   gpr_log(GPR_INFO, "****** SET [0] *******");
   gpr_log(GPR_INFO, "****** SET [0] *******");
-  CheckRpcSendOk();
+  CheckRpcSendOk(stub, DEBUG_LOCATION);
   EXPECT_EQ(servers_[0]->service_.request_count(), 1);
   EXPECT_EQ(servers_[0]->service_.request_count(), 1);
   servers_[0]->service_.ResetCounters();
   servers_[0]->service_.ResetCounters();
 
 
@@ -434,20 +481,21 @@ TEST_F(ClientLbEnd2endTest, PickFirstUpdateSuperset) {
   ports.emplace_back(servers_[0]->port_);
   ports.emplace_back(servers_[0]->port_);
   SetNextResolution(ports);
   SetNextResolution(ports);
   gpr_log(GPR_INFO, "****** SET superset *******");
   gpr_log(GPR_INFO, "****** SET superset *******");
-  CheckRpcSendOk();
+  CheckRpcSendOk(stub, DEBUG_LOCATION);
   // We stick to the previously connected server.
   // We stick to the previously connected server.
-  WaitForServer(0);
+  WaitForServer(stub, 0, DEBUG_LOCATION);
   EXPECT_EQ(0, servers_[1]->service_.request_count());
   EXPECT_EQ(0, servers_[1]->service_.request_count());
 
 
   // Check LB policy name for the channel.
   // Check LB policy name for the channel.
-  EXPECT_EQ("pick_first", channel_->GetLoadBalancingPolicyName());
+  EXPECT_EQ("pick_first", channel->GetLoadBalancingPolicyName());
 }
 }
 
 
 TEST_F(ClientLbEnd2endTest, PickFirstManyUpdates) {
 TEST_F(ClientLbEnd2endTest, PickFirstManyUpdates) {
   // Start servers and send one RPC per server.
   // Start servers and send one RPC per server.
   const int kNumServers = 3;
   const int kNumServers = 3;
   StartServers(kNumServers);
   StartServers(kNumServers);
-  ResetStub("pick_first");
+  auto channel = BuildChannel("pick_first");
+  auto stub = BuildStub(channel);
   std::vector<int> ports;
   std::vector<int> ports;
   for (size_t i = 0; i < servers_.size(); ++i) {
   for (size_t i = 0; i < servers_.size(); ++i) {
     ports.emplace_back(servers_[i]->port_);
     ports.emplace_back(servers_[i]->port_);
@@ -459,18 +507,19 @@ TEST_F(ClientLbEnd2endTest, PickFirstManyUpdates) {
       std::shuffle(ports.begin(), ports.end(),
       std::shuffle(ports.begin(), ports.end(),
                    std::mt19937(std::random_device()()));
                    std::mt19937(std::random_device()()));
       SetNextResolution(ports);
       SetNextResolution(ports);
-      if (i % 10 == 0) CheckRpcSendOk();
+      if (i % 10 == 0) CheckRpcSendOk(stub, DEBUG_LOCATION);
     }
     }
   }
   }
   // Check LB policy name for the channel.
   // Check LB policy name for the channel.
-  EXPECT_EQ("pick_first", channel_->GetLoadBalancingPolicyName());
+  EXPECT_EQ("pick_first", channel->GetLoadBalancingPolicyName());
 }
 }
 
 
 TEST_F(ClientLbEnd2endTest, RoundRobin) {
 TEST_F(ClientLbEnd2endTest, RoundRobin) {
   // Start servers and send one RPC per server.
   // Start servers and send one RPC per server.
   const int kNumServers = 3;
   const int kNumServers = 3;
   StartServers(kNumServers);
   StartServers(kNumServers);
-  ResetStub("round_robin");
+  auto channel = BuildChannel("round_robin");
+  auto stub = BuildStub(channel);
   std::vector<int> ports;
   std::vector<int> ports;
   for (const auto& server : servers_) {
   for (const auto& server : servers_) {
     ports.emplace_back(server->port_);
     ports.emplace_back(server->port_);
@@ -478,15 +527,15 @@ TEST_F(ClientLbEnd2endTest, RoundRobin) {
   SetNextResolution(ports);
   SetNextResolution(ports);
   // Wait until all backends are ready.
   // Wait until all backends are ready.
   do {
   do {
-    CheckRpcSendOk();
+    CheckRpcSendOk(stub, DEBUG_LOCATION);
   } while (!SeenAllServers());
   } while (!SeenAllServers());
   ResetCounters();
   ResetCounters();
   // "Sync" to the end of the list. Next sequence of picks will start at the
   // "Sync" to the end of the list. Next sequence of picks will start at the
   // first server (index 0).
   // first server (index 0).
-  WaitForServer(servers_.size() - 1);
+  WaitForServer(stub, servers_.size() - 1, DEBUG_LOCATION);
   std::vector<int> connection_order;
   std::vector<int> connection_order;
   for (size_t i = 0; i < servers_.size(); ++i) {
   for (size_t i = 0; i < servers_.size(); ++i) {
-    CheckRpcSendOk();
+    CheckRpcSendOk(stub, DEBUG_LOCATION);
     UpdateConnectionOrder(servers_, &connection_order);
     UpdateConnectionOrder(servers_, &connection_order);
   }
   }
   // Backends should be iterated over in the order in which the addresses were
   // Backends should be iterated over in the order in which the addresses were
@@ -494,22 +543,23 @@ TEST_F(ClientLbEnd2endTest, RoundRobin) {
   const auto expected = std::vector<int>{0, 1, 2};
   const auto expected = std::vector<int>{0, 1, 2};
   EXPECT_EQ(expected, connection_order);
   EXPECT_EQ(expected, connection_order);
   // Check LB policy name for the channel.
   // Check LB policy name for the channel.
-  EXPECT_EQ("round_robin", channel_->GetLoadBalancingPolicyName());
+  EXPECT_EQ("round_robin", channel->GetLoadBalancingPolicyName());
 }
 }
 
 
 TEST_F(ClientLbEnd2endTest, RoundRobinUpdates) {
 TEST_F(ClientLbEnd2endTest, RoundRobinUpdates) {
   // Start servers and send one RPC per server.
   // Start servers and send one RPC per server.
   const int kNumServers = 3;
   const int kNumServers = 3;
   StartServers(kNumServers);
   StartServers(kNumServers);
-  ResetStub("round_robin");
+  auto channel = BuildChannel("round_robin");
+  auto stub = BuildStub(channel);
   std::vector<int> ports;
   std::vector<int> ports;
 
 
   // Start with a single server.
   // Start with a single server.
   ports.emplace_back(servers_[0]->port_);
   ports.emplace_back(servers_[0]->port_);
   SetNextResolution(ports);
   SetNextResolution(ports);
-  WaitForServer(0);
+  WaitForServer(stub, 0, DEBUG_LOCATION);
   // Send RPCs. They should all go servers_[0]
   // Send RPCs. They should all go servers_[0]
-  for (size_t i = 0; i < 10; ++i) CheckRpcSendOk();
+  for (size_t i = 0; i < 10; ++i) CheckRpcSendOk(stub, DEBUG_LOCATION);
   EXPECT_EQ(10, servers_[0]->service_.request_count());
   EXPECT_EQ(10, servers_[0]->service_.request_count());
   EXPECT_EQ(0, servers_[1]->service_.request_count());
   EXPECT_EQ(0, servers_[1]->service_.request_count());
   EXPECT_EQ(0, servers_[2]->service_.request_count());
   EXPECT_EQ(0, servers_[2]->service_.request_count());
@@ -523,9 +573,9 @@ TEST_F(ClientLbEnd2endTest, RoundRobinUpdates) {
   // Wait until update has been processed, as signaled by the second backend
   // Wait until update has been processed, as signaled by the second backend
   // receiving a request.
   // receiving a request.
   EXPECT_EQ(0, servers_[1]->service_.request_count());
   EXPECT_EQ(0, servers_[1]->service_.request_count());
-  WaitForServer(1);
+  WaitForServer(stub, 1, DEBUG_LOCATION);
 
 
-  for (size_t i = 0; i < 10; ++i) CheckRpcSendOk();
+  for (size_t i = 0; i < 10; ++i) CheckRpcSendOk(stub, DEBUG_LOCATION);
   EXPECT_EQ(0, servers_[0]->service_.request_count());
   EXPECT_EQ(0, servers_[0]->service_.request_count());
   EXPECT_EQ(10, servers_[1]->service_.request_count());
   EXPECT_EQ(10, servers_[1]->service_.request_count());
   EXPECT_EQ(0, servers_[2]->service_.request_count());
   EXPECT_EQ(0, servers_[2]->service_.request_count());
@@ -535,9 +585,9 @@ TEST_F(ClientLbEnd2endTest, RoundRobinUpdates) {
   ports.clear();
   ports.clear();
   ports.emplace_back(servers_[2]->port_);
   ports.emplace_back(servers_[2]->port_);
   SetNextResolution(ports);
   SetNextResolution(ports);
-  WaitForServer(2);
+  WaitForServer(stub, 2, DEBUG_LOCATION);
 
 
-  for (size_t i = 0; i < 10; ++i) CheckRpcSendOk();
+  for (size_t i = 0; i < 10; ++i) CheckRpcSendOk(stub, DEBUG_LOCATION);
   EXPECT_EQ(0, servers_[0]->service_.request_count());
   EXPECT_EQ(0, servers_[0]->service_.request_count());
   EXPECT_EQ(0, servers_[1]->service_.request_count());
   EXPECT_EQ(0, servers_[1]->service_.request_count());
   EXPECT_EQ(10, servers_[2]->service_.request_count());
   EXPECT_EQ(10, servers_[2]->service_.request_count());
@@ -549,12 +599,12 @@ TEST_F(ClientLbEnd2endTest, RoundRobinUpdates) {
   ports.emplace_back(servers_[1]->port_);
   ports.emplace_back(servers_[1]->port_);
   ports.emplace_back(servers_[2]->port_);
   ports.emplace_back(servers_[2]->port_);
   SetNextResolution(ports);
   SetNextResolution(ports);
-  WaitForServer(0);
-  WaitForServer(1);
-  WaitForServer(2);
+  WaitForServer(stub, 0, DEBUG_LOCATION);
+  WaitForServer(stub, 1, DEBUG_LOCATION);
+  WaitForServer(stub, 2, DEBUG_LOCATION);
 
 
   // Send three RPCs, one per server.
   // Send three RPCs, one per server.
-  for (size_t i = 0; i < 3; ++i) CheckRpcSendOk();
+  for (size_t i = 0; i < 3; ++i) CheckRpcSendOk(stub, DEBUG_LOCATION);
   EXPECT_EQ(1, servers_[0]->service_.request_count());
   EXPECT_EQ(1, servers_[0]->service_.request_count());
   EXPECT_EQ(1, servers_[1]->service_.request_count());
   EXPECT_EQ(1, servers_[1]->service_.request_count());
   EXPECT_EQ(1, servers_[2]->service_.request_count());
   EXPECT_EQ(1, servers_[2]->service_.request_count());
@@ -564,7 +614,7 @@ TEST_F(ClientLbEnd2endTest, RoundRobinUpdates) {
   SetNextResolution(ports);
   SetNextResolution(ports);
   grpc_connectivity_state channel_state;
   grpc_connectivity_state channel_state;
   do {
   do {
-    channel_state = channel_->GetState(true /* try to connect */);
+    channel_state = channel->GetState(true /* try to connect */);
   } while (channel_state == GRPC_CHANNEL_READY);
   } while (channel_state == GRPC_CHANNEL_READY);
   GPR_ASSERT(channel_state != GRPC_CHANNEL_READY);
   GPR_ASSERT(channel_state != GRPC_CHANNEL_READY);
   servers_[0]->service_.ResetCounters();
   servers_[0]->service_.ResetCounters();
@@ -573,26 +623,27 @@ TEST_F(ClientLbEnd2endTest, RoundRobinUpdates) {
   ports.clear();
   ports.clear();
   ports.emplace_back(servers_[1]->port_);
   ports.emplace_back(servers_[1]->port_);
   SetNextResolution(ports);
   SetNextResolution(ports);
-  WaitForServer(1);
-  channel_state = channel_->GetState(false /* try to connect */);
+  WaitForServer(stub, 1, DEBUG_LOCATION);
+  channel_state = channel->GetState(false /* try to connect */);
   GPR_ASSERT(channel_state == GRPC_CHANNEL_READY);
   GPR_ASSERT(channel_state == GRPC_CHANNEL_READY);
 
 
   // Check LB policy name for the channel.
   // Check LB policy name for the channel.
-  EXPECT_EQ("round_robin", channel_->GetLoadBalancingPolicyName());
+  EXPECT_EQ("round_robin", channel->GetLoadBalancingPolicyName());
 }
 }
 
 
 TEST_F(ClientLbEnd2endTest, RoundRobinUpdateInError) {
 TEST_F(ClientLbEnd2endTest, RoundRobinUpdateInError) {
   const int kNumServers = 3;
   const int kNumServers = 3;
   StartServers(kNumServers);
   StartServers(kNumServers);
-  ResetStub("round_robin");
+  auto channel = BuildChannel("round_robin");
+  auto stub = BuildStub(channel);
   std::vector<int> ports;
   std::vector<int> ports;
 
 
   // Start with a single server.
   // Start with a single server.
   ports.emplace_back(servers_[0]->port_);
   ports.emplace_back(servers_[0]->port_);
   SetNextResolution(ports);
   SetNextResolution(ports);
-  WaitForServer(0);
+  WaitForServer(stub, 0, DEBUG_LOCATION);
   // Send RPCs. They should all go to servers_[0]
   // Send RPCs. They should all go to servers_[0]
-  for (size_t i = 0; i < 10; ++i) SendRpc();
+  for (size_t i = 0; i < 10; ++i) SendRpc(stub);
   EXPECT_EQ(10, servers_[0]->service_.request_count());
   EXPECT_EQ(10, servers_[0]->service_.request_count());
   EXPECT_EQ(0, servers_[1]->service_.request_count());
   EXPECT_EQ(0, servers_[1]->service_.request_count());
   EXPECT_EQ(0, servers_[2]->service_.request_count());
   EXPECT_EQ(0, servers_[2]->service_.request_count());
@@ -603,11 +654,11 @@ TEST_F(ClientLbEnd2endTest, RoundRobinUpdateInError) {
   ports.emplace_back(servers_[1]->port_);
   ports.emplace_back(servers_[1]->port_);
   ports.emplace_back(servers_[2]->port_);
   ports.emplace_back(servers_[2]->port_);
   SetNextResolution(ports);
   SetNextResolution(ports);
-  WaitForServer(0);
-  WaitForServer(2);
+  WaitForServer(stub, 0, DEBUG_LOCATION);
+  WaitForServer(stub, 2, DEBUG_LOCATION);
 
 
   // Send three RPCs, one per server.
   // Send three RPCs, one per server.
-  for (size_t i = 0; i < kNumServers; ++i) SendRpc();
+  for (size_t i = 0; i < kNumServers; ++i) SendRpc(stub);
   // The server in shutdown shouldn't receive any.
   // The server in shutdown shouldn't receive any.
   EXPECT_EQ(0, servers_[1]->service_.request_count());
   EXPECT_EQ(0, servers_[1]->service_.request_count());
 }
 }
@@ -616,7 +667,8 @@ TEST_F(ClientLbEnd2endTest, RoundRobinManyUpdates) {
   // Start servers and send one RPC per server.
   // Start servers and send one RPC per server.
   const int kNumServers = 3;
   const int kNumServers = 3;
   StartServers(kNumServers);
   StartServers(kNumServers);
-  ResetStub("round_robin");
+  auto channel = BuildChannel("round_robin");
+  auto stub = BuildStub(channel);
   std::vector<int> ports;
   std::vector<int> ports;
   for (size_t i = 0; i < servers_.size(); ++i) {
   for (size_t i = 0; i < servers_.size(); ++i) {
     ports.emplace_back(servers_[i]->port_);
     ports.emplace_back(servers_[i]->port_);
@@ -625,10 +677,10 @@ TEST_F(ClientLbEnd2endTest, RoundRobinManyUpdates) {
     std::shuffle(ports.begin(), ports.end(),
     std::shuffle(ports.begin(), ports.end(),
                  std::mt19937(std::random_device()()));
                  std::mt19937(std::random_device()()));
     SetNextResolution(ports);
     SetNextResolution(ports);
-    if (i % 10 == 0) CheckRpcSendOk();
+    if (i % 10 == 0) CheckRpcSendOk(stub, DEBUG_LOCATION);
   }
   }
   // Check LB policy name for the channel.
   // Check LB policy name for the channel.
-  EXPECT_EQ("round_robin", channel_->GetLoadBalancingPolicyName());
+  EXPECT_EQ("round_robin", channel->GetLoadBalancingPolicyName());
 }
 }
 
 
 TEST_F(ClientLbEnd2endTest, RoundRobinConcurrentUpdates) {
 TEST_F(ClientLbEnd2endTest, RoundRobinConcurrentUpdates) {
@@ -639,16 +691,21 @@ TEST_F(ClientLbEnd2endTest, RoundRobinConcurrentUpdates) {
 TEST_F(ClientLbEnd2endTest, RoundRobinReresolve) {
 TEST_F(ClientLbEnd2endTest, RoundRobinReresolve) {
   // Start servers and send one RPC per server.
   // Start servers and send one RPC per server.
   const int kNumServers = 3;
   const int kNumServers = 3;
-  std::vector<int> ports;
+  std::vector<int> first_ports;
+  std::vector<int> second_ports;
   for (int i = 0; i < kNumServers; ++i) {
   for (int i = 0; i < kNumServers; ++i) {
-    ports.push_back(grpc_pick_unused_port_or_die());
+    first_ports.push_back(grpc_pick_unused_port_or_die());
   }
   }
-  StartServers(kNumServers, ports);
-  ResetStub("round_robin");
-  SetNextResolution(ports);
+  for (int i = 0; i < kNumServers; ++i) {
+    second_ports.push_back(grpc_pick_unused_port_or_die());
+  }
+  StartServers(kNumServers, first_ports);
+  auto channel = BuildChannel("round_robin");
+  auto stub = BuildStub(channel);
+  SetNextResolution(first_ports);
   // Send a number of RPCs, which succeed.
   // Send a number of RPCs, which succeed.
   for (size_t i = 0; i < 100; ++i) {
   for (size_t i = 0; i < 100; ++i) {
-    CheckRpcSendOk();
+    CheckRpcSendOk(stub, DEBUG_LOCATION);
   }
   }
   // Kill all servers
   // Kill all servers
   gpr_log(GPR_INFO, "****** ABOUT TO KILL SERVERS *******");
   gpr_log(GPR_INFO, "****** ABOUT TO KILL SERVERS *******");
@@ -658,18 +715,25 @@ TEST_F(ClientLbEnd2endTest, RoundRobinReresolve) {
   gpr_log(GPR_INFO, "****** SERVERS KILLED *******");
   gpr_log(GPR_INFO, "****** SERVERS KILLED *******");
   gpr_log(GPR_INFO, "****** SENDING DOOMED REQUESTS *******");
   gpr_log(GPR_INFO, "****** SENDING DOOMED REQUESTS *******");
   // Client requests should fail. Send enough to tickle all subchannels.
   // Client requests should fail. Send enough to tickle all subchannels.
-  for (size_t i = 0; i < servers_.size(); ++i) CheckRpcSendFailure();
+  for (size_t i = 0; i < servers_.size(); ++i) CheckRpcSendFailure(stub);
   gpr_log(GPR_INFO, "****** DOOMED REQUESTS SENT *******");
   gpr_log(GPR_INFO, "****** DOOMED REQUESTS SENT *******");
-  // Bring servers back up on the same port (we aren't recreating the channel).
+  // Bring servers back up on a different set of ports. We need to do this to be
+  // sure that the eventual success is *not* due to subchannel reconnection
+  // attempts and that an actual re-resolution has happened as a result of the
+  // RR policy going into transient failure when all its subchannels become
+  // unavailable (in transient failure as well).
   gpr_log(GPR_INFO, "****** RESTARTING SERVERS *******");
   gpr_log(GPR_INFO, "****** RESTARTING SERVERS *******");
-  StartServers(kNumServers, ports);
+  StartServers(kNumServers, second_ports);
+  // Don't notify of the update. Wait for the LB policy's re-resolution to
+  // "pull" the new ports.
+  SetNextResolutionUponError(second_ports);
   gpr_log(GPR_INFO, "****** SERVERS RESTARTED *******");
   gpr_log(GPR_INFO, "****** SERVERS RESTARTED *******");
   gpr_log(GPR_INFO, "****** SENDING REQUEST TO SUCCEED *******");
   gpr_log(GPR_INFO, "****** SENDING REQUEST TO SUCCEED *******");
   // Client request should eventually (but still fairly soon) succeed.
   // Client request should eventually (but still fairly soon) succeed.
   const gpr_timespec deadline = grpc_timeout_seconds_to_deadline(5);
   const gpr_timespec deadline = grpc_timeout_seconds_to_deadline(5);
   gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC);
   gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC);
   while (gpr_time_cmp(deadline, now) > 0) {
   while (gpr_time_cmp(deadline, now) > 0) {
-    if (SendRpc()) break;
+    if (SendRpc(stub)) break;
     now = gpr_now(GPR_CLOCK_MONOTONIC);
     now = gpr_now(GPR_CLOCK_MONOTONIC);
   }
   }
   GPR_ASSERT(gpr_time_cmp(deadline, now) > 0);
   GPR_ASSERT(gpr_time_cmp(deadline, now) > 0);
@@ -679,11 +743,13 @@ TEST_F(ClientLbEnd2endTest, RoundRobinSingleReconnect) {
   const int kNumServers = 3;
   const int kNumServers = 3;
   StartServers(kNumServers);
   StartServers(kNumServers);
   const auto ports = GetServersPorts();
   const auto ports = GetServersPorts();
-  ResetStub("round_robin");
+  auto channel = BuildChannel("round_robin");
+  auto stub = BuildStub(channel);
   SetNextResolution(ports);
   SetNextResolution(ports);
-  for (size_t i = 0; i < kNumServers; ++i) WaitForServer(i);
+  for (size_t i = 0; i < kNumServers; ++i)
+    WaitForServer(stub, i, DEBUG_LOCATION);
   for (size_t i = 0; i < servers_.size(); ++i) {
   for (size_t i = 0; i < servers_.size(); ++i) {
-    CheckRpcSendOk();
+    CheckRpcSendOk(stub, DEBUG_LOCATION);
     EXPECT_EQ(1, servers_[i]->service_.request_count()) << "for backend #" << i;
     EXPECT_EQ(1, servers_[i]->service_.request_count()) << "for backend #" << i;
   }
   }
   // One request should have gone to each server.
   // One request should have gone to each server.
@@ -695,10 +761,14 @@ TEST_F(ClientLbEnd2endTest, RoundRobinSingleReconnect) {
   servers_[0]->Shutdown(true);
   servers_[0]->Shutdown(true);
   // Client request still succeed. May need retrying if RR had returned a pick
   // Client request still succeed. May need retrying if RR had returned a pick
   // before noticing the change in the server's connectivity.
   // before noticing the change in the server's connectivity.
-  while (!SendRpc())
+  while (!SendRpc(stub)) {
     ;  // Retry until success.
     ;  // Retry until success.
+  }
+  gpr_log(GPR_INFO, "------------------------------------------------------");
   // Send a bunch of RPCs that should succeed.
   // Send a bunch of RPCs that should succeed.
-  for (int i = 0; i < 10 * kNumServers; ++i) CheckRpcSendOk();
+  for (int i = 0; i < 10 * kNumServers; ++i) {
+    CheckRpcSendOk(stub, DEBUG_LOCATION);
+  }
   const auto post_death = servers_[0]->service_.request_count();
   const auto post_death = servers_[0]->service_.request_count();
   // No requests have gone to the deceased server.
   // No requests have gone to the deceased server.
   EXPECT_EQ(pre_death, post_death);
   EXPECT_EQ(pre_death, post_death);
@@ -708,7 +778,7 @@ TEST_F(ClientLbEnd2endTest, RoundRobinSingleReconnect) {
   // the server managed to start before the RR policy retried the subchannel) or
   // the server managed to start before the RR policy retried the subchannel) or
   // after the subchannel retry delay otherwise (RR's subchannel retried before
   // after the subchannel retry delay otherwise (RR's subchannel retried before
   // the server was fully back up).
   // the server was fully back up).
-  WaitForServer(0);
+  WaitForServer(stub, 0, DEBUG_LOCATION);
 }
 }
 
 
 }  // namespace
 }  // namespace

+ 1 - 1
test/cpp/grpclb/grpclb_test.cc

@@ -27,7 +27,6 @@
 #include <grpc/grpc.h>
 #include <grpc/grpc.h>
 #include <grpc/impl/codegen/byte_buffer_reader.h>
 #include <grpc/impl/codegen/byte_buffer_reader.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/sync.h>
@@ -41,6 +40,7 @@
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/channel_stack.h"
 #include "src/core/lib/channel/channel_stack.h"
 #include "src/core/lib/gpr/env.h"
 #include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/tmpfile.h"
 #include "src/core/lib/gpr/tmpfile.h"
 #include "src/core/lib/iomgr/sockaddr.h"
 #include "src/core/lib/iomgr/sockaddr.h"

+ 1 - 1
test/cpp/interop/interop_test.cc

@@ -31,12 +31,12 @@
 
 
 #include <gflags/gflags.h>
 #include <gflags/gflags.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 #include "test/core/util/port.h"
 #include "test/core/util/port.h"
 #include "test/cpp/util/test_config.h"
 #include "test/cpp/util/test_config.h"
 
 
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/iomgr/socket_utils_posix.h"
 #include "src/core/lib/iomgr/socket_utils_posix.h"
 
 

+ 19 - 2
test/cpp/microbenchmarks/fullstack_fixtures.h

@@ -61,6 +61,15 @@ class FixtureConfiguration {
 
 
 class BaseFixture : public TrackCounters {};
 class BaseFixture : public TrackCounters {};
 
 
+// Special tag to be used in Server shutdown. This tag is *NEVER* returned when
+// Cq->Next() API is called (This is because FinalizeResult() function in this
+// class always returns 'false'). This is intentional and makes writing shutdown
+// code easier.
+class ShutdownTag : public internal::CompletionQueueTag {
+ public:
+  bool FinalizeResult(void** tag, bool* status) { return false; }
+};
+
 class FullstackFixture : public BaseFixture {
 class FullstackFixture : public BaseFixture {
  public:
  public:
   FullstackFixture(Service* service, const FixtureConfiguration& config,
   FullstackFixture(Service* service, const FixtureConfiguration& config,
@@ -84,7 +93,11 @@ class FullstackFixture : public BaseFixture {
   }
   }
 
 
   virtual ~FullstackFixture() {
   virtual ~FullstackFixture() {
-    server_->Shutdown(gpr_inf_past(GPR_CLOCK_MONOTONIC));
+    // Dummy shutdown tag (this tag is swallowed by cq->Next() and is not
+    // returned to the user) see ShutdownTag definition for more details
+    ShutdownTag shutdown_tag;
+    grpc_server_shutdown_and_notify(server_->c_server(), cq_->cq(),
+                                    &shutdown_tag);
     cq_->Shutdown();
     cq_->Shutdown();
     void* tag;
     void* tag;
     bool ok;
     bool ok;
@@ -208,7 +221,11 @@ class EndpointPairFixture : public BaseFixture {
   }
   }
 
 
   virtual ~EndpointPairFixture() {
   virtual ~EndpointPairFixture() {
-    server_->Shutdown(gpr_inf_past(GPR_CLOCK_MONOTONIC));
+    // Dummy shutdown tag (this tag is swallowed by cq->Next() and is not
+    // returned to the user) see ShutdownTag definition for more details
+    ShutdownTag shutdown_tag;
+    grpc_server_shutdown_and_notify(server_->c_server(), cq_->cq(),
+                                    &shutdown_tag);
     cq_->Shutdown();
     cq_->Shutdown();
     void* tag;
     void* tag;
     bool ok;
     bool ok;

+ 1 - 1
test/cpp/naming/resolver_component_test.cc

@@ -18,7 +18,6 @@
 
 
 #include <grpc/grpc.h>
 #include <grpc/grpc.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/sync.h>
@@ -38,6 +37,7 @@
 #include "src/core/ext/filters/client_channel/resolver_registry.h"
 #include "src/core/ext/filters/client_channel/resolver_registry.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/gpr/env.h"
 #include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/gpr/string.h"
 #include "src/core/lib/iomgr/combiner.h"
 #include "src/core/lib/iomgr/combiner.h"
 #include "src/core/lib/iomgr/executor.h"
 #include "src/core/lib/iomgr/executor.h"

+ 1 - 1
test/cpp/qps/client_sync.cc

@@ -30,10 +30,10 @@
 #include <grpc++/server_builder.h>
 #include <grpc++/server_builder.h>
 #include <grpc/grpc.h>
 #include <grpc/grpc.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/time.h>
 #include <grpc/support/time.h>
 
 
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/profiling/timers.h"
 #include "src/core/lib/profiling/timers.h"
 #include "src/proto/grpc/testing/services.grpc.pb.h"
 #include "src/proto/grpc/testing/services.grpc.pb.h"
 #include "test/cpp/qps/client.h"
 #include "test/cpp/qps/client.h"

+ 1 - 1
test/cpp/qps/driver.cc

@@ -27,11 +27,11 @@
 #include <grpc++/client_context.h>
 #include <grpc++/client_context.h>
 #include <grpc++/create_channel.h>
 #include <grpc++/create_channel.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/string_util.h>
 
 
 #include "src/core/lib/gpr/env.h"
 #include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/profiling/timers.h"
 #include "src/core/lib/profiling/timers.h"
 #include "test/core/util/port.h"
 #include "test/core/util/port.h"
 #include "test/core/util/test_config.h"
 #include "test/core/util/test_config.h"

+ 1 - 1
test/cpp/qps/qps_worker.cc

@@ -32,9 +32,9 @@
 #include <grpc/grpc.h>
 #include <grpc/grpc.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/cpu.h>
 #include <grpc/support/cpu.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 
 
+#include "src/core/lib/gpr/host_port.h"
 #include "src/proto/grpc/testing/services.pb.h"
 #include "src/proto/grpc/testing/services.pb.h"
 #include "test/core/util/grpc_profiler.h"
 #include "test/core/util/grpc_profiler.h"
 #include "test/core/util/histogram.h"
 #include "test/core/util/histogram.h"

+ 1 - 1
test/cpp/qps/server_async.cc

@@ -32,9 +32,9 @@
 #include <grpc++/support/config.h>
 #include <grpc++/support/config.h>
 #include <grpc/grpc.h>
 #include <grpc/grpc.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 #include <grpc/support/log.h>
 
 
+#include "src/core/lib/gpr/host_port.h"
 #include "src/core/lib/surface/completion_queue.h"
 #include "src/core/lib/surface/completion_queue.h"
 #include "src/proto/grpc/testing/services.grpc.pb.h"
 #include "src/proto/grpc/testing/services.grpc.pb.h"
 #include "test/core/util/test_config.h"
 #include "test/core/util/test_config.h"

+ 1 - 1
test/cpp/qps/server_sync.cc

@@ -24,8 +24,8 @@
 #include <grpc++/server_context.h>
 #include <grpc++/server_context.h>
 #include <grpc/grpc.h>
 #include <grpc/grpc.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
 
 
+#include "src/core/lib/gpr/host_port.h"
 #include "src/proto/grpc/testing/services.grpc.pb.h"
 #include "src/proto/grpc/testing/services.grpc.pb.h"
 #include "test/cpp/qps/server.h"
 #include "test/cpp/qps/server.h"
 #include "test/cpp/qps/usage_timer.h"
 #include "test/cpp/qps/usage_timer.h"

+ 0 - 1
tools/doxygen/Doxyfile.c++

@@ -912,7 +912,6 @@ include/grpc/support/atm_windows.h \
 include/grpc/support/avl.h \
 include/grpc/support/avl.h \
 include/grpc/support/cmdline.h \
 include/grpc/support/cmdline.h \
 include/grpc/support/cpu.h \
 include/grpc/support/cpu.h \
-include/grpc/support/host_port.h \
 include/grpc/support/log.h \
 include/grpc/support/log.h \
 include/grpc/support/log_windows.h \
 include/grpc/support/log_windows.h \
 include/grpc/support/port_platform.h \
 include/grpc/support/port_platform.h \

+ 1 - 1
tools/doxygen/Doxyfile.c++.internal

@@ -913,7 +913,6 @@ include/grpc/support/atm_windows.h \
 include/grpc/support/avl.h \
 include/grpc/support/avl.h \
 include/grpc/support/cmdline.h \
 include/grpc/support/cmdline.h \
 include/grpc/support/cpu.h \
 include/grpc/support/cpu.h \
-include/grpc/support/host_port.h \
 include/grpc/support/log.h \
 include/grpc/support/log.h \
 include/grpc/support/log_windows.h \
 include/grpc/support/log_windows.h \
 include/grpc/support/port_platform.h \
 include/grpc/support/port_platform.h \
@@ -954,6 +953,7 @@ src/core/lib/debug/trace.h \
 src/core/lib/gpr/arena.h \
 src/core/lib/gpr/arena.h \
 src/core/lib/gpr/env.h \
 src/core/lib/gpr/env.h \
 src/core/lib/gpr/fork.h \
 src/core/lib/gpr/fork.h \
+src/core/lib/gpr/host_port.h \
 src/core/lib/gpr/mpscq.h \
 src/core/lib/gpr/mpscq.h \
 src/core/lib/gpr/murmur_hash.h \
 src/core/lib/gpr/murmur_hash.h \
 src/core/lib/gpr/spinlock.h \
 src/core/lib/gpr/spinlock.h \

+ 0 - 1
tools/doxygen/Doxyfile.core

@@ -852,7 +852,6 @@ include/grpc/support/atm_windows.h \
 include/grpc/support/avl.h \
 include/grpc/support/avl.h \
 include/grpc/support/cmdline.h \
 include/grpc/support/cmdline.h \
 include/grpc/support/cpu.h \
 include/grpc/support/cpu.h \
-include/grpc/support/host_port.h \
 include/grpc/support/log.h \
 include/grpc/support/log.h \
 include/grpc/support/log_windows.h \
 include/grpc/support/log_windows.h \
 include/grpc/support/port_platform.h \
 include/grpc/support/port_platform.h \

+ 1 - 1
tools/doxygen/Doxyfile.core.internal

@@ -852,7 +852,6 @@ include/grpc/support/atm_windows.h \
 include/grpc/support/avl.h \
 include/grpc/support/avl.h \
 include/grpc/support/cmdline.h \
 include/grpc/support/cmdline.h \
 include/grpc/support/cpu.h \
 include/grpc/support/cpu.h \
-include/grpc/support/host_port.h \
 include/grpc/support/log.h \
 include/grpc/support/log.h \
 include/grpc/support/log_windows.h \
 include/grpc/support/log_windows.h \
 include/grpc/support/port_platform.h \
 include/grpc/support/port_platform.h \
@@ -1084,6 +1083,7 @@ src/core/lib/gpr/env_windows.cc \
 src/core/lib/gpr/fork.cc \
 src/core/lib/gpr/fork.cc \
 src/core/lib/gpr/fork.h \
 src/core/lib/gpr/fork.h \
 src/core/lib/gpr/host_port.cc \
 src/core/lib/gpr/host_port.cc \
+src/core/lib/gpr/host_port.h \
 src/core/lib/gpr/log.cc \
 src/core/lib/gpr/log.cc \
 src/core/lib/gpr/log_android.cc \
 src/core/lib/gpr/log_android.cc \
 src/core/lib/gpr/log_linux.cc \
 src/core/lib/gpr/log_linux.cc \

+ 5 - 1
tools/internal_ci/helper_scripts/prepare_build_macos_rc

@@ -50,7 +50,11 @@ fi
 set +ex  # rvm script is very verbose and exits with errorcode
 set +ex  # rvm script is very verbose and exits with errorcode
 source $HOME/.rvm/scripts/rvm
 source $HOME/.rvm/scripts/rvm
 set -e  # rvm commands are very verbose
 set -e  # rvm commands are very verbose
-rvm use ruby-2.4
+time rvm install 2.5.0
+rvm use 2.5.0 --default
+gem install bundler --no-ri --no-doc
+gem install cocoapods --version 1.3.1 --no-ri --no-doc
+gem install rake-compiler --no-ri --no-doc
 rvm osx-ssl-certs status all
 rvm osx-ssl-certs status all
 rvm osx-ssl-certs update all
 rvm osx-ssl-certs update all
 set -ex
 set -ex

+ 2 - 2
tools/run_tests/generated/sources_and_headers.json

@@ -8230,7 +8230,6 @@
       "include/grpc/support/avl.h", 
       "include/grpc/support/avl.h", 
       "include/grpc/support/cmdline.h", 
       "include/grpc/support/cmdline.h", 
       "include/grpc/support/cpu.h", 
       "include/grpc/support/cpu.h", 
-      "include/grpc/support/host_port.h", 
       "include/grpc/support/log.h", 
       "include/grpc/support/log.h", 
       "include/grpc/support/log_windows.h", 
       "include/grpc/support/log_windows.h", 
       "include/grpc/support/port_platform.h", 
       "include/grpc/support/port_platform.h", 
@@ -8251,6 +8250,7 @@
       "src/core/lib/gpr/arena.h", 
       "src/core/lib/gpr/arena.h", 
       "src/core/lib/gpr/env.h", 
       "src/core/lib/gpr/env.h", 
       "src/core/lib/gpr/fork.h", 
       "src/core/lib/gpr/fork.h", 
+      "src/core/lib/gpr/host_port.h", 
       "src/core/lib/gpr/mpscq.h", 
       "src/core/lib/gpr/mpscq.h", 
       "src/core/lib/gpr/murmur_hash.h", 
       "src/core/lib/gpr/murmur_hash.h", 
       "src/core/lib/gpr/spinlock.h", 
       "src/core/lib/gpr/spinlock.h", 
@@ -8279,7 +8279,6 @@
       "include/grpc/support/avl.h", 
       "include/grpc/support/avl.h", 
       "include/grpc/support/cmdline.h", 
       "include/grpc/support/cmdline.h", 
       "include/grpc/support/cpu.h", 
       "include/grpc/support/cpu.h", 
-      "include/grpc/support/host_port.h", 
       "include/grpc/support/log.h", 
       "include/grpc/support/log.h", 
       "include/grpc/support/log_windows.h", 
       "include/grpc/support/log_windows.h", 
       "include/grpc/support/port_platform.h", 
       "include/grpc/support/port_platform.h", 
@@ -8300,6 +8299,7 @@
       "src/core/lib/gpr/arena.h", 
       "src/core/lib/gpr/arena.h", 
       "src/core/lib/gpr/env.h", 
       "src/core/lib/gpr/env.h", 
       "src/core/lib/gpr/fork.h", 
       "src/core/lib/gpr/fork.h", 
+      "src/core/lib/gpr/host_port.h", 
       "src/core/lib/gpr/mpscq.h", 
       "src/core/lib/gpr/mpscq.h", 
       "src/core/lib/gpr/murmur_hash.h", 
       "src/core/lib/gpr/murmur_hash.h", 
       "src/core/lib/gpr/spinlock.h", 
       "src/core/lib/gpr/spinlock.h",