centralize handling of channel's default authority (#27544)

* centralize handling of channel's default authority

* clang-format

* fix backup poller bug
reviewable/pr27388/r4
Mark D. Roth 3 years ago committed by GitHub
parent 851517078f
commit f0a0628795
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      BUILD
  2. 4
      CMakeLists.txt
  3. 4
      Makefile
  4. 8
      build_autogenerated.yaml
  5. 2
      config.m4
  6. 2
      config.w32
  7. 4
      gRPC-C++.podspec
  8. 6
      gRPC-Core.podspec
  9. 4
      grpc.gemspec
  10. 4
      grpc.gyp
  11. 4
      package.xml
  12. 88
      src/core/ext/filters/client_channel/client_channel.cc
  13. 4
      src/core/ext/filters/client_channel/client_channel.h
  14. 3
      src/core/ext/filters/client_channel/lb_policy.h
  15. 4
      src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc
  16. 5
      src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
  17. 21
      src/core/ext/filters/client_channel/lb_policy/priority/priority.cc
  18. 6
      src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc
  19. 5
      src/core/ext/filters/client_channel/lb_policy/xds/cds.cc
  20. 5
      src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc
  21. 7
      src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc
  22. 5
      src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc
  23. 5
      src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
  24. 42
      src/core/ext/transport/chttp2/client/authority.cc
  25. 36
      src/core/ext/transport/chttp2/client/authority.h
  26. 8
      src/core/ext/transport/chttp2/client/insecure/channel_create.cc
  27. 38
      src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
  28. 40
      src/core/lib/transport/authority_override.cc
  29. 37
      src/core/lib/transport/authority_override.h
  30. 2
      src/python/grpcio/grpc_core_dependencies.py
  31. 12
      test/core/util/test_lb_policies.cc
  32. 6
      test/cpp/client/client_channel_stress_test.cc
  33. 6
      test/cpp/end2end/grpclb_end2end_test.cc
  34. 4
      tools/doxygen/Doxyfile.c++.internal
  35. 4
      tools/doxygen/Doxyfile.core.internal

@ -1253,7 +1253,6 @@ grpc_cc_library(
"src/core/lib/surface/server.cc", "src/core/lib/surface/server.cc",
"src/core/lib/surface/validate_metadata.cc", "src/core/lib/surface/validate_metadata.cc",
"src/core/lib/surface/version.cc", "src/core/lib/surface/version.cc",
"src/core/lib/transport/authority_override.cc",
"src/core/lib/transport/bdp_estimator.cc", "src/core/lib/transport/bdp_estimator.cc",
"src/core/lib/transport/byte_stream.cc", "src/core/lib/transport/byte_stream.cc",
"src/core/lib/transport/connectivity_state.cc", "src/core/lib/transport/connectivity_state.cc",
@ -1389,7 +1388,6 @@ grpc_cc_library(
"src/core/lib/surface/lame_client.h", "src/core/lib/surface/lame_client.h",
"src/core/lib/surface/server.h", "src/core/lib/surface/server.h",
"src/core/lib/surface/validate_metadata.h", "src/core/lib/surface/validate_metadata.h",
"src/core/lib/transport/authority_override.h",
"src/core/lib/transport/bdp_estimator.h", "src/core/lib/transport/bdp_estimator.h",
"src/core/lib/transport/byte_stream.h", "src/core/lib/transport/byte_stream.h",
"src/core/lib/transport/connectivity_state.h", "src/core/lib/transport/connectivity_state.h",
@ -2926,11 +2924,9 @@ grpc_cc_library(
grpc_cc_library( grpc_cc_library(
name = "grpc_transport_chttp2_client_connector", name = "grpc_transport_chttp2_client_connector",
srcs = [ srcs = [
"src/core/ext/transport/chttp2/client/authority.cc",
"src/core/ext/transport/chttp2/client/chttp2_connector.cc", "src/core/ext/transport/chttp2/client/chttp2_connector.cc",
], ],
hdrs = [ hdrs = [
"src/core/ext/transport/chttp2/client/authority.h",
"src/core/ext/transport/chttp2/client/chttp2_connector.h", "src/core/ext/transport/chttp2/client/chttp2_connector.h",
], ],
language = "c++", language = "c++",

4
CMakeLists.txt generated

@ -1564,7 +1564,6 @@ add_library(grpc
src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc
src/core/ext/filters/workarounds/workaround_utils.cc src/core/ext/filters/workarounds/workaround_utils.cc
src/core/ext/transport/chttp2/alpn/alpn.cc src/core/ext/transport/chttp2/alpn/alpn.cc
src/core/ext/transport/chttp2/client/authority.cc
src/core/ext/transport/chttp2/client/chttp2_connector.cc src/core/ext/transport/chttp2/client/chttp2_connector.cc
src/core/ext/transport/chttp2/client/insecure/channel_create.cc src/core/ext/transport/chttp2/client/insecure/channel_create.cc
src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
@ -2014,7 +2013,6 @@ add_library(grpc
src/core/lib/surface/server.cc src/core/lib/surface/server.cc
src/core/lib/surface/validate_metadata.cc src/core/lib/surface/validate_metadata.cc
src/core/lib/surface/version.cc src/core/lib/surface/version.cc
src/core/lib/transport/authority_override.cc
src/core/lib/transport/bdp_estimator.cc src/core/lib/transport/bdp_estimator.cc
src/core/lib/transport/byte_stream.cc src/core/lib/transport/byte_stream.cc
src/core/lib/transport/connectivity_state.cc src/core/lib/transport/connectivity_state.cc
@ -2399,7 +2397,6 @@ add_library(grpc_unsecure
src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc
src/core/ext/filters/workarounds/workaround_utils.cc src/core/ext/filters/workarounds/workaround_utils.cc
src/core/ext/transport/chttp2/alpn/alpn.cc src/core/ext/transport/chttp2/alpn/alpn.cc
src/core/ext/transport/chttp2/client/authority.cc
src/core/ext/transport/chttp2/client/chttp2_connector.cc src/core/ext/transport/chttp2/client/chttp2_connector.cc
src/core/ext/transport/chttp2/client/insecure/channel_create.cc src/core/ext/transport/chttp2/client/insecure/channel_create.cc
src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
@ -2600,7 +2597,6 @@ add_library(grpc_unsecure
src/core/lib/surface/server.cc src/core/lib/surface/server.cc
src/core/lib/surface/validate_metadata.cc src/core/lib/surface/validate_metadata.cc
src/core/lib/surface/version.cc src/core/lib/surface/version.cc
src/core/lib/transport/authority_override.cc
src/core/lib/transport/bdp_estimator.cc src/core/lib/transport/bdp_estimator.cc
src/core/lib/transport/byte_stream.cc src/core/lib/transport/byte_stream.cc
src/core/lib/transport/connectivity_state.cc src/core/lib/transport/connectivity_state.cc

4
Makefile generated

@ -1121,7 +1121,6 @@ LIBGRPC_SRC = \
src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc \ src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc \
src/core/ext/filters/workarounds/workaround_utils.cc \ src/core/ext/filters/workarounds/workaround_utils.cc \
src/core/ext/transport/chttp2/alpn/alpn.cc \ src/core/ext/transport/chttp2/alpn/alpn.cc \
src/core/ext/transport/chttp2/client/authority.cc \
src/core/ext/transport/chttp2/client/chttp2_connector.cc \ src/core/ext/transport/chttp2/client/chttp2_connector.cc \
src/core/ext/transport/chttp2/client/insecure/channel_create.cc \ src/core/ext/transport/chttp2/client/insecure/channel_create.cc \
src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc \ src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc \
@ -1571,7 +1570,6 @@ LIBGRPC_SRC = \
src/core/lib/surface/server.cc \ src/core/lib/surface/server.cc \
src/core/lib/surface/validate_metadata.cc \ src/core/lib/surface/validate_metadata.cc \
src/core/lib/surface/version.cc \ src/core/lib/surface/version.cc \
src/core/lib/transport/authority_override.cc \
src/core/lib/transport/bdp_estimator.cc \ src/core/lib/transport/bdp_estimator.cc \
src/core/lib/transport/byte_stream.cc \ src/core/lib/transport/byte_stream.cc \
src/core/lib/transport/connectivity_state.cc \ src/core/lib/transport/connectivity_state.cc \
@ -1803,7 +1801,6 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc \ src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc \
src/core/ext/filters/workarounds/workaround_utils.cc \ src/core/ext/filters/workarounds/workaround_utils.cc \
src/core/ext/transport/chttp2/alpn/alpn.cc \ src/core/ext/transport/chttp2/alpn/alpn.cc \
src/core/ext/transport/chttp2/client/authority.cc \
src/core/ext/transport/chttp2/client/chttp2_connector.cc \ src/core/ext/transport/chttp2/client/chttp2_connector.cc \
src/core/ext/transport/chttp2/client/insecure/channel_create.cc \ src/core/ext/transport/chttp2/client/insecure/channel_create.cc \
src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc \ src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc \
@ -2004,7 +2001,6 @@ LIBGRPC_UNSECURE_SRC = \
src/core/lib/surface/server.cc \ src/core/lib/surface/server.cc \
src/core/lib/surface/validate_metadata.cc \ src/core/lib/surface/validate_metadata.cc \
src/core/lib/surface/version.cc \ src/core/lib/surface/version.cc \
src/core/lib/transport/authority_override.cc \
src/core/lib/transport/bdp_estimator.cc \ src/core/lib/transport/bdp_estimator.cc \
src/core/lib/transport/byte_stream.cc \ src/core/lib/transport/byte_stream.cc \
src/core/lib/transport/connectivity_state.cc \ src/core/lib/transport/connectivity_state.cc \

@ -496,7 +496,6 @@ libs:
- src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h - src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h
- src/core/ext/filters/workarounds/workaround_utils.h - src/core/ext/filters/workarounds/workaround_utils.h
- src/core/ext/transport/chttp2/alpn/alpn.h - src/core/ext/transport/chttp2/alpn/alpn.h
- src/core/ext/transport/chttp2/client/authority.h
- src/core/ext/transport/chttp2/client/chttp2_connector.h - src/core/ext/transport/chttp2/client/chttp2_connector.h
- src/core/ext/transport/chttp2/server/chttp2_server.h - src/core/ext/transport/chttp2/server/chttp2_server.h
- src/core/ext/transport/chttp2/transport/bin_decoder.h - src/core/ext/transport/chttp2/transport/bin_decoder.h
@ -916,7 +915,6 @@ libs:
- src/core/lib/surface/lame_client.h - src/core/lib/surface/lame_client.h
- src/core/lib/surface/server.h - src/core/lib/surface/server.h
- src/core/lib/surface/validate_metadata.h - src/core/lib/surface/validate_metadata.h
- src/core/lib/transport/authority_override.h
- src/core/lib/transport/bdp_estimator.h - src/core/lib/transport/bdp_estimator.h
- src/core/lib/transport/byte_stream.h - src/core/lib/transport/byte_stream.h
- src/core/lib/transport/connectivity_state.h - src/core/lib/transport/connectivity_state.h
@ -1037,7 +1035,6 @@ libs:
- src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc - src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc
- src/core/ext/filters/workarounds/workaround_utils.cc - src/core/ext/filters/workarounds/workaround_utils.cc
- src/core/ext/transport/chttp2/alpn/alpn.cc - src/core/ext/transport/chttp2/alpn/alpn.cc
- src/core/ext/transport/chttp2/client/authority.cc
- src/core/ext/transport/chttp2/client/chttp2_connector.cc - src/core/ext/transport/chttp2/client/chttp2_connector.cc
- src/core/ext/transport/chttp2/client/insecure/channel_create.cc - src/core/ext/transport/chttp2/client/insecure/channel_create.cc
- src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc - src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
@ -1487,7 +1484,6 @@ libs:
- src/core/lib/surface/server.cc - src/core/lib/surface/server.cc
- src/core/lib/surface/validate_metadata.cc - src/core/lib/surface/validate_metadata.cc
- src/core/lib/surface/version.cc - src/core/lib/surface/version.cc
- src/core/lib/transport/authority_override.cc
- src/core/lib/transport/bdp_estimator.cc - src/core/lib/transport/bdp_estimator.cc
- src/core/lib/transport/byte_stream.cc - src/core/lib/transport/byte_stream.cc
- src/core/lib/transport/connectivity_state.cc - src/core/lib/transport/connectivity_state.cc
@ -1744,7 +1740,6 @@ libs:
- src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h - src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h
- src/core/ext/filters/workarounds/workaround_utils.h - src/core/ext/filters/workarounds/workaround_utils.h
- src/core/ext/transport/chttp2/alpn/alpn.h - src/core/ext/transport/chttp2/alpn/alpn.h
- src/core/ext/transport/chttp2/client/authority.h
- src/core/ext/transport/chttp2/client/chttp2_connector.h - src/core/ext/transport/chttp2/client/chttp2_connector.h
- src/core/ext/transport/chttp2/server/chttp2_server.h - src/core/ext/transport/chttp2/server/chttp2_server.h
- src/core/ext/transport/chttp2/transport/bin_decoder.h - src/core/ext/transport/chttp2/transport/bin_decoder.h
@ -1924,7 +1919,6 @@ libs:
- src/core/lib/surface/lame_client.h - src/core/lib/surface/lame_client.h
- src/core/lib/surface/server.h - src/core/lib/surface/server.h
- src/core/lib/surface/validate_metadata.h - src/core/lib/surface/validate_metadata.h
- src/core/lib/transport/authority_override.h
- src/core/lib/transport/bdp_estimator.h - src/core/lib/transport/bdp_estimator.h
- src/core/lib/transport/byte_stream.h - src/core/lib/transport/byte_stream.h
- src/core/lib/transport/connectivity_state.h - src/core/lib/transport/connectivity_state.h
@ -2012,7 +2006,6 @@ libs:
- src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc - src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc
- src/core/ext/filters/workarounds/workaround_utils.cc - src/core/ext/filters/workarounds/workaround_utils.cc
- src/core/ext/transport/chttp2/alpn/alpn.cc - src/core/ext/transport/chttp2/alpn/alpn.cc
- src/core/ext/transport/chttp2/client/authority.cc
- src/core/ext/transport/chttp2/client/chttp2_connector.cc - src/core/ext/transport/chttp2/client/chttp2_connector.cc
- src/core/ext/transport/chttp2/client/insecure/channel_create.cc - src/core/ext/transport/chttp2/client/insecure/channel_create.cc
- src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc - src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
@ -2213,7 +2206,6 @@ libs:
- src/core/lib/surface/server.cc - src/core/lib/surface/server.cc
- src/core/lib/surface/validate_metadata.cc - src/core/lib/surface/validate_metadata.cc
- src/core/lib/surface/version.cc - src/core/lib/surface/version.cc
- src/core/lib/transport/authority_override.cc
- src/core/lib/transport/bdp_estimator.cc - src/core/lib/transport/bdp_estimator.cc
- src/core/lib/transport/byte_stream.cc - src/core/lib/transport/byte_stream.cc
- src/core/lib/transport/connectivity_state.cc - src/core/lib/transport/connectivity_state.cc

2
config.m4 generated

@ -116,7 +116,6 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc \ src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc \
src/core/ext/filters/workarounds/workaround_utils.cc \ src/core/ext/filters/workarounds/workaround_utils.cc \
src/core/ext/transport/chttp2/alpn/alpn.cc \ src/core/ext/transport/chttp2/alpn/alpn.cc \
src/core/ext/transport/chttp2/client/authority.cc \
src/core/ext/transport/chttp2/client/chttp2_connector.cc \ src/core/ext/transport/chttp2/client/chttp2_connector.cc \
src/core/ext/transport/chttp2/client/insecure/channel_create.cc \ src/core/ext/transport/chttp2/client/insecure/channel_create.cc \
src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc \ src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc \
@ -624,7 +623,6 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/surface/server.cc \ src/core/lib/surface/server.cc \
src/core/lib/surface/validate_metadata.cc \ src/core/lib/surface/validate_metadata.cc \
src/core/lib/surface/version.cc \ src/core/lib/surface/version.cc \
src/core/lib/transport/authority_override.cc \
src/core/lib/transport/bdp_estimator.cc \ src/core/lib/transport/bdp_estimator.cc \
src/core/lib/transport/byte_stream.cc \ src/core/lib/transport/byte_stream.cc \
src/core/lib/transport/connectivity_state.cc \ src/core/lib/transport/connectivity_state.cc \

2
config.w32 generated

@ -82,7 +82,6 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\filters\\workarounds\\workaround_cronet_compression_filter.cc " + "src\\core\\ext\\filters\\workarounds\\workaround_cronet_compression_filter.cc " +
"src\\core\\ext\\filters\\workarounds\\workaround_utils.cc " + "src\\core\\ext\\filters\\workarounds\\workaround_utils.cc " +
"src\\core\\ext\\transport\\chttp2\\alpn\\alpn.cc " + "src\\core\\ext\\transport\\chttp2\\alpn\\alpn.cc " +
"src\\core\\ext\\transport\\chttp2\\client\\authority.cc " +
"src\\core\\ext\\transport\\chttp2\\client\\chttp2_connector.cc " + "src\\core\\ext\\transport\\chttp2\\client\\chttp2_connector.cc " +
"src\\core\\ext\\transport\\chttp2\\client\\insecure\\channel_create.cc " + "src\\core\\ext\\transport\\chttp2\\client\\insecure\\channel_create.cc " +
"src\\core\\ext\\transport\\chttp2\\client\\insecure\\channel_create_posix.cc " + "src\\core\\ext\\transport\\chttp2\\client\\insecure\\channel_create_posix.cc " +
@ -590,7 +589,6 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\surface\\server.cc " + "src\\core\\lib\\surface\\server.cc " +
"src\\core\\lib\\surface\\validate_metadata.cc " + "src\\core\\lib\\surface\\validate_metadata.cc " +
"src\\core\\lib\\surface\\version.cc " + "src\\core\\lib\\surface\\version.cc " +
"src\\core\\lib\\transport\\authority_override.cc " +
"src\\core\\lib\\transport\\bdp_estimator.cc " + "src\\core\\lib\\transport\\bdp_estimator.cc " +
"src\\core\\lib\\transport\\byte_stream.cc " + "src\\core\\lib\\transport\\byte_stream.cc " +
"src\\core\\lib\\transport\\connectivity_state.cc " + "src\\core\\lib\\transport\\connectivity_state.cc " +

4
gRPC-C++.podspec generated

@ -267,7 +267,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h', 'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h',
'src/core/ext/filters/workarounds/workaround_utils.h', 'src/core/ext/filters/workarounds/workaround_utils.h',
'src/core/ext/transport/chttp2/alpn/alpn.h', 'src/core/ext/transport/chttp2/alpn/alpn.h',
'src/core/ext/transport/chttp2/client/authority.h',
'src/core/ext/transport/chttp2/client/chttp2_connector.h', 'src/core/ext/transport/chttp2/client/chttp2_connector.h',
'src/core/ext/transport/chttp2/server/chttp2_server.h', 'src/core/ext/transport/chttp2/server/chttp2_server.h',
'src/core/ext/transport/chttp2/transport/bin_decoder.h', 'src/core/ext/transport/chttp2/transport/bin_decoder.h',
@ -729,7 +728,6 @@ Pod::Spec.new do |s|
'src/core/lib/surface/lame_client.h', 'src/core/lib/surface/lame_client.h',
'src/core/lib/surface/server.h', 'src/core/lib/surface/server.h',
'src/core/lib/surface/validate_metadata.h', 'src/core/lib/surface/validate_metadata.h',
'src/core/lib/transport/authority_override.h',
'src/core/lib/transport/bdp_estimator.h', 'src/core/lib/transport/bdp_estimator.h',
'src/core/lib/transport/byte_stream.h', 'src/core/lib/transport/byte_stream.h',
'src/core/lib/transport/connectivity_state.h', 'src/core/lib/transport/connectivity_state.h',
@ -940,7 +938,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h', 'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h',
'src/core/ext/filters/workarounds/workaround_utils.h', 'src/core/ext/filters/workarounds/workaround_utils.h',
'src/core/ext/transport/chttp2/alpn/alpn.h', 'src/core/ext/transport/chttp2/alpn/alpn.h',
'src/core/ext/transport/chttp2/client/authority.h',
'src/core/ext/transport/chttp2/client/chttp2_connector.h', 'src/core/ext/transport/chttp2/client/chttp2_connector.h',
'src/core/ext/transport/chttp2/server/chttp2_server.h', 'src/core/ext/transport/chttp2/server/chttp2_server.h',
'src/core/ext/transport/chttp2/transport/bin_decoder.h', 'src/core/ext/transport/chttp2/transport/bin_decoder.h',
@ -1402,7 +1399,6 @@ Pod::Spec.new do |s|
'src/core/lib/surface/lame_client.h', 'src/core/lib/surface/lame_client.h',
'src/core/lib/surface/server.h', 'src/core/lib/surface/server.h',
'src/core/lib/surface/validate_metadata.h', 'src/core/lib/surface/validate_metadata.h',
'src/core/lib/transport/authority_override.h',
'src/core/lib/transport/bdp_estimator.h', 'src/core/lib/transport/bdp_estimator.h',
'src/core/lib/transport/byte_stream.h', 'src/core/lib/transport/byte_stream.h',
'src/core/lib/transport/connectivity_state.h', 'src/core/lib/transport/connectivity_state.h',

6
gRPC-Core.podspec generated

@ -334,8 +334,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/workarounds/workaround_utils.h', 'src/core/ext/filters/workarounds/workaround_utils.h',
'src/core/ext/transport/chttp2/alpn/alpn.cc', 'src/core/ext/transport/chttp2/alpn/alpn.cc',
'src/core/ext/transport/chttp2/alpn/alpn.h', 'src/core/ext/transport/chttp2/alpn/alpn.h',
'src/core/ext/transport/chttp2/client/authority.cc',
'src/core/ext/transport/chttp2/client/authority.h',
'src/core/ext/transport/chttp2/client/chttp2_connector.cc', 'src/core/ext/transport/chttp2/client/chttp2_connector.cc',
'src/core/ext/transport/chttp2/client/chttp2_connector.h', 'src/core/ext/transport/chttp2/client/chttp2_connector.h',
'src/core/ext/transport/chttp2/client/insecure/channel_create.cc', 'src/core/ext/transport/chttp2/client/insecure/channel_create.cc',
@ -1304,8 +1302,6 @@ Pod::Spec.new do |s|
'src/core/lib/surface/validate_metadata.cc', 'src/core/lib/surface/validate_metadata.cc',
'src/core/lib/surface/validate_metadata.h', 'src/core/lib/surface/validate_metadata.h',
'src/core/lib/surface/version.cc', 'src/core/lib/surface/version.cc',
'src/core/lib/transport/authority_override.cc',
'src/core/lib/transport/authority_override.h',
'src/core/lib/transport/bdp_estimator.cc', 'src/core/lib/transport/bdp_estimator.cc',
'src/core/lib/transport/bdp_estimator.h', 'src/core/lib/transport/bdp_estimator.h',
'src/core/lib/transport/byte_stream.cc', 'src/core/lib/transport/byte_stream.cc',
@ -1528,7 +1524,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h', 'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h',
'src/core/ext/filters/workarounds/workaround_utils.h', 'src/core/ext/filters/workarounds/workaround_utils.h',
'src/core/ext/transport/chttp2/alpn/alpn.h', 'src/core/ext/transport/chttp2/alpn/alpn.h',
'src/core/ext/transport/chttp2/client/authority.h',
'src/core/ext/transport/chttp2/client/chttp2_connector.h', 'src/core/ext/transport/chttp2/client/chttp2_connector.h',
'src/core/ext/transport/chttp2/server/chttp2_server.h', 'src/core/ext/transport/chttp2/server/chttp2_server.h',
'src/core/ext/transport/chttp2/transport/bin_decoder.h', 'src/core/ext/transport/chttp2/transport/bin_decoder.h',
@ -1990,7 +1985,6 @@ Pod::Spec.new do |s|
'src/core/lib/surface/lame_client.h', 'src/core/lib/surface/lame_client.h',
'src/core/lib/surface/server.h', 'src/core/lib/surface/server.h',
'src/core/lib/surface/validate_metadata.h', 'src/core/lib/surface/validate_metadata.h',
'src/core/lib/transport/authority_override.h',
'src/core/lib/transport/bdp_estimator.h', 'src/core/lib/transport/bdp_estimator.h',
'src/core/lib/transport/byte_stream.h', 'src/core/lib/transport/byte_stream.h',
'src/core/lib/transport/connectivity_state.h', 'src/core/lib/transport/connectivity_state.h',

4
grpc.gemspec generated

@ -246,8 +246,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/workarounds/workaround_utils.h ) s.files += %w( src/core/ext/filters/workarounds/workaround_utils.h )
s.files += %w( src/core/ext/transport/chttp2/alpn/alpn.cc ) s.files += %w( src/core/ext/transport/chttp2/alpn/alpn.cc )
s.files += %w( src/core/ext/transport/chttp2/alpn/alpn.h ) s.files += %w( src/core/ext/transport/chttp2/alpn/alpn.h )
s.files += %w( src/core/ext/transport/chttp2/client/authority.cc )
s.files += %w( src/core/ext/transport/chttp2/client/authority.h )
s.files += %w( src/core/ext/transport/chttp2/client/chttp2_connector.cc ) s.files += %w( src/core/ext/transport/chttp2/client/chttp2_connector.cc )
s.files += %w( src/core/ext/transport/chttp2/client/chttp2_connector.h ) s.files += %w( src/core/ext/transport/chttp2/client/chttp2_connector.h )
s.files += %w( src/core/ext/transport/chttp2/client/insecure/channel_create.cc ) s.files += %w( src/core/ext/transport/chttp2/client/insecure/channel_create.cc )
@ -1216,8 +1214,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/surface/validate_metadata.cc ) s.files += %w( src/core/lib/surface/validate_metadata.cc )
s.files += %w( src/core/lib/surface/validate_metadata.h ) s.files += %w( src/core/lib/surface/validate_metadata.h )
s.files += %w( src/core/lib/surface/version.cc ) s.files += %w( src/core/lib/surface/version.cc )
s.files += %w( src/core/lib/transport/authority_override.cc )
s.files += %w( src/core/lib/transport/authority_override.h )
s.files += %w( src/core/lib/transport/bdp_estimator.cc ) s.files += %w( src/core/lib/transport/bdp_estimator.cc )
s.files += %w( src/core/lib/transport/bdp_estimator.h ) s.files += %w( src/core/lib/transport/bdp_estimator.h )
s.files += %w( src/core/lib/transport/byte_stream.cc ) s.files += %w( src/core/lib/transport/byte_stream.cc )

4
grpc.gyp generated

@ -563,7 +563,6 @@
'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc', 'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc',
'src/core/ext/filters/workarounds/workaround_utils.cc', 'src/core/ext/filters/workarounds/workaround_utils.cc',
'src/core/ext/transport/chttp2/alpn/alpn.cc', 'src/core/ext/transport/chttp2/alpn/alpn.cc',
'src/core/ext/transport/chttp2/client/authority.cc',
'src/core/ext/transport/chttp2/client/chttp2_connector.cc', 'src/core/ext/transport/chttp2/client/chttp2_connector.cc',
'src/core/ext/transport/chttp2/client/insecure/channel_create.cc', 'src/core/ext/transport/chttp2/client/insecure/channel_create.cc',
'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc', 'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc',
@ -1013,7 +1012,6 @@
'src/core/lib/surface/server.cc', 'src/core/lib/surface/server.cc',
'src/core/lib/surface/validate_metadata.cc', 'src/core/lib/surface/validate_metadata.cc',
'src/core/lib/surface/version.cc', 'src/core/lib/surface/version.cc',
'src/core/lib/transport/authority_override.cc',
'src/core/lib/transport/bdp_estimator.cc', 'src/core/lib/transport/bdp_estimator.cc',
'src/core/lib/transport/byte_stream.cc', 'src/core/lib/transport/byte_stream.cc',
'src/core/lib/transport/connectivity_state.cc', 'src/core/lib/transport/connectivity_state.cc',
@ -1221,7 +1219,6 @@
'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc', 'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc',
'src/core/ext/filters/workarounds/workaround_utils.cc', 'src/core/ext/filters/workarounds/workaround_utils.cc',
'src/core/ext/transport/chttp2/alpn/alpn.cc', 'src/core/ext/transport/chttp2/alpn/alpn.cc',
'src/core/ext/transport/chttp2/client/authority.cc',
'src/core/ext/transport/chttp2/client/chttp2_connector.cc', 'src/core/ext/transport/chttp2/client/chttp2_connector.cc',
'src/core/ext/transport/chttp2/client/insecure/channel_create.cc', 'src/core/ext/transport/chttp2/client/insecure/channel_create.cc',
'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc', 'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc',
@ -1422,7 +1419,6 @@
'src/core/lib/surface/server.cc', 'src/core/lib/surface/server.cc',
'src/core/lib/surface/validate_metadata.cc', 'src/core/lib/surface/validate_metadata.cc',
'src/core/lib/surface/version.cc', 'src/core/lib/surface/version.cc',
'src/core/lib/transport/authority_override.cc',
'src/core/lib/transport/bdp_estimator.cc', 'src/core/lib/transport/bdp_estimator.cc',
'src/core/lib/transport/byte_stream.cc', 'src/core/lib/transport/byte_stream.cc',
'src/core/lib/transport/connectivity_state.cc', 'src/core/lib/transport/connectivity_state.cc',

4
package.xml generated

@ -226,8 +226,6 @@
<file baseinstalldir="/" name="src/core/ext/filters/workarounds/workaround_utils.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/filters/workarounds/workaround_utils.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/alpn/alpn.cc" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/alpn/alpn.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/alpn/alpn.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/alpn/alpn.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/authority.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/authority.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/chttp2_connector.cc" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/chttp2_connector.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/chttp2_connector.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/chttp2_connector.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/insecure/channel_create.cc" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/insecure/channel_create.cc" role="src" />
@ -1196,8 +1194,6 @@
<file baseinstalldir="/" name="src/core/lib/surface/validate_metadata.cc" role="src" /> <file baseinstalldir="/" name="src/core/lib/surface/validate_metadata.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/validate_metadata.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/surface/validate_metadata.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/version.cc" role="src" /> <file baseinstalldir="/" name="src/core/lib/surface/version.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/authority_override.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/authority_override.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/bdp_estimator.cc" role="src" /> <file baseinstalldir="/" name="src/core/lib/transport/bdp_estimator.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/bdp_estimator.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/transport/bdp_estimator.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/byte_stream.cc" role="src" /> <file baseinstalldir="/" name="src/core/lib/transport/byte_stream.cc" role="src" />

@ -952,24 +952,47 @@ class ClientChannel::ClientChannelControlHelper
if (!inhibit_health_checking) { if (!inhibit_health_checking) {
health_check_service_name = chand_->health_check_service_name_; health_check_service_name = chand_->health_check_service_name_;
} }
// Construct channel args for subchannel.
// Remove channel args that should not affect subchannel uniqueness. // Remove channel args that should not affect subchannel uniqueness.
static const char* args_to_remove[] = { absl::InlinedVector<const char*, 3> args_to_remove = {
GRPC_ARG_INHIBIT_HEALTH_CHECKING, GRPC_ARG_INHIBIT_HEALTH_CHECKING,
GRPC_ARG_CHANNELZ_CHANNEL_NODE, GRPC_ARG_CHANNELZ_CHANNEL_NODE,
}; };
// Add channel args needed for the subchannel. // Add channel args needed for the subchannel.
absl::InlinedVector<grpc_arg, 3> args_to_add = { absl::InlinedVector<grpc_arg, 2> args_to_add = {
SubchannelPoolInterface::CreateChannelArg( SubchannelPoolInterface::CreateChannelArg(
chand_->subchannel_pool_.get()), chand_->subchannel_pool_.get()),
}; };
// Check if default authority arg is already set.
const char* default_authority =
grpc_channel_args_find_string(&args, GRPC_ARG_DEFAULT_AUTHORITY);
// Add args from subchannel address.
if (address.args() != nullptr) { if (address.args() != nullptr) {
for (size_t j = 0; j < address.args()->num_args; ++j) { for (size_t j = 0; j < address.args()->num_args; ++j) {
args_to_add.emplace_back(address.args()->args[j]); grpc_arg& arg = address.args()->args[j];
if (strcmp(arg.key, GRPC_ARG_DEFAULT_AUTHORITY) == 0) {
// Don't add default authority arg from subchannel address if
// it's already set at the channel level -- the value from the
// application should take precedence over what is set by the
// resolver.
if (default_authority != nullptr) continue;
default_authority = arg.value.string;
}
args_to_add.emplace_back(arg);
} }
} }
// If we haven't already set the default authority arg, add it from
// the channel.
if (default_authority == nullptr) {
// Remove it, just in case it's actually present but is the wrong type.
args_to_remove.push_back(GRPC_ARG_DEFAULT_AUTHORITY);
args_to_add.push_back(grpc_channel_arg_string_create(
const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY),
const_cast<char*>(chand_->default_authority_.c_str())));
}
grpc_channel_args* new_args = grpc_channel_args_copy_and_add_and_remove( grpc_channel_args* new_args = grpc_channel_args_copy_and_add_and_remove(
&args, args_to_remove, GPR_ARRAY_SIZE(args_to_remove), &args, args_to_remove.data(), args_to_remove.size(), args_to_add.data(),
args_to_add.data(), args_to_add.size()); args_to_add.size());
// Create subchannel. // Create subchannel.
RefCountedPtr<Subchannel> subchannel = RefCountedPtr<Subchannel> subchannel =
chand_->client_channel_factory_->CreateSubchannel(address.address(), chand_->client_channel_factory_->CreateSubchannel(address.address(),
@ -1012,6 +1035,10 @@ class ClientChannel::ClientChannelControlHelper
chand_->resolver_->RequestReresolutionLocked(); chand_->resolver_->RequestReresolutionLocked();
} }
absl::string_view GetAuthority() override {
return chand_->default_authority_;
}
void AddTraceEvent(TraceSeverity severity, absl::string_view message) override void AddTraceEvent(TraceSeverity severity, absl::string_view message) override
ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) { ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
if (chand_->resolver_ == nullptr) return; // Shutting down. if (chand_->resolver_ == nullptr) return; // Shutting down.
@ -1101,15 +1128,6 @@ ClientChannel::ClientChannel(grpc_channel_element_args* args,
"Missing client channel factory in args for client channel filter"); "Missing client channel factory in args for client channel filter");
return; return;
} }
// Get server name to resolve, using proxy mapper if needed.
const char* server_uri =
grpc_channel_args_find_string(args->channel_args, GRPC_ARG_SERVER_URI);
if (server_uri == nullptr) {
*error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"server URI channel arg missing or wrong type in client channel "
"filter");
return;
}
// Get default service config. If none is specified via the client API, // Get default service config. If none is specified via the client API,
// we use an empty config. // we use an empty config.
const char* service_config_json = grpc_channel_args_find_string( const char* service_config_json = grpc_channel_args_find_string(
@ -1122,30 +1140,50 @@ ClientChannel::ClientChannel(grpc_channel_element_args* args,
default_service_config_.reset(); default_service_config_.reset();
return; return;
} }
absl::StatusOr<URI> uri = URI::Parse(server_uri); // Get URI to resolve, using proxy mapper if needed.
if (uri.ok() && !uri->path().empty()) { const char* server_uri =
server_name_ = std::string(absl::StripPrefix(uri->path(), "/")); grpc_channel_args_find_string(args->channel_args, GRPC_ARG_SERVER_URI);
if (server_uri == nullptr) {
*error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"target URI channel arg missing or wrong type in client channel "
"filter");
return;
} }
uri_to_resolve_ = server_uri;
char* proxy_name = nullptr; char* proxy_name = nullptr;
grpc_channel_args* new_args = nullptr; grpc_channel_args* new_args = nullptr;
ProxyMapperRegistry::MapName(server_uri, args->channel_args, &proxy_name, ProxyMapperRegistry::MapName(server_uri, args->channel_args, &proxy_name,
&new_args); &new_args);
target_uri_.reset(proxy_name != nullptr ? proxy_name if (proxy_name != nullptr) {
: gpr_strdup(server_uri)); uri_to_resolve_ = proxy_name;
gpr_free(proxy_name);
}
// Make sure the URI to resolve is valid, so that we know that
// resolver creation will succeed later.
if (!ResolverRegistry::IsValidTarget(uri_to_resolve_)) {
*error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
absl::StrCat("the target uri is not valid: ", uri_to_resolve_.c_str()));
return;
}
// Strip out service config channel arg, so that it doesn't affect // Strip out service config channel arg, so that it doesn't affect
// subchannel uniqueness when the args flow down to that layer. // subchannel uniqueness when the args flow down to that layer.
const char* arg_to_remove = GRPC_ARG_SERVICE_CONFIG; const char* arg_to_remove = GRPC_ARG_SERVICE_CONFIG;
channel_args_ = grpc_channel_args_copy_and_remove( channel_args_ = grpc_channel_args_copy_and_remove(
new_args != nullptr ? new_args : args->channel_args, &arg_to_remove, 1); new_args != nullptr ? new_args : args->channel_args, &arg_to_remove, 1);
grpc_channel_args_destroy(new_args); grpc_channel_args_destroy(new_args);
// Set initial keepalive time.
keepalive_time_ = grpc_channel_args_find_integer( keepalive_time_ = grpc_channel_args_find_integer(
channel_args_, GRPC_ARG_KEEPALIVE_TIME_MS, channel_args_, GRPC_ARG_KEEPALIVE_TIME_MS,
{-1 /* default value, unset */, 1, INT_MAX}); {-1 /* default value, unset */, 1, INT_MAX});
if (!ResolverRegistry::IsValidTarget(target_uri_.get())) { // Set default authority.
*error = GRPC_ERROR_CREATE_FROM_CPP_STRING( const char* default_authority =
absl::StrCat("the target uri is not valid: ", target_uri_.get())); grpc_channel_args_find_string(channel_args_, GRPC_ARG_DEFAULT_AUTHORITY);
return; if (default_authority == nullptr) {
default_authority_ = ResolverRegistry::GetDefaultAuthority(server_uri);
} else {
default_authority_ = default_authority;
} }
// Success.
*error = GRPC_ERROR_NONE; *error = GRPC_ERROR_NONE;
} }
@ -1571,8 +1609,8 @@ void ClientChannel::CreateResolverLocked() {
gpr_log(GPR_INFO, "chand=%p: starting name resolution", this); gpr_log(GPR_INFO, "chand=%p: starting name resolution", this);
} }
resolver_ = ResolverRegistry::CreateResolver( resolver_ = ResolverRegistry::CreateResolver(
target_uri_.get(), channel_args_, interested_parties_, work_serializer_, uri_to_resolve_.c_str(), channel_args_, interested_parties_,
absl::make_unique<ResolverResultHandler>(this)); work_serializer_, absl::make_unique<ResolverResultHandler>(this));
// Since the validity of the args was checked when the channel was created, // Since the validity of the args was checked when the channel was created,
// CreateResolver() must return a non-null result. // CreateResolver() must return a non-null result.
GPR_ASSERT(resolver_ != nullptr); GPR_ASSERT(resolver_ != nullptr);

@ -275,8 +275,8 @@ class ClientChannel {
ClientChannelFactory* client_channel_factory_; ClientChannelFactory* client_channel_factory_;
const grpc_channel_args* channel_args_; const grpc_channel_args* channel_args_;
RefCountedPtr<ServiceConfig> default_service_config_; RefCountedPtr<ServiceConfig> default_service_config_;
std::string server_name_; std::string uri_to_resolve_;
UniquePtr<char> target_uri_; std::string default_authority_;
channelz::ChannelNode* channelz_node_; channelz::ChannelNode* channelz_node_;
grpc_pollset_set* interested_parties_; grpc_pollset_set* interested_parties_;

@ -282,6 +282,9 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
/// Requests that the resolver re-resolve. /// Requests that the resolver re-resolve.
virtual void RequestReresolution() = 0; virtual void RequestReresolution() = 0;
/// Returns the channel authority.
virtual absl::string_view GetAuthority() = 0;
/// Adds a trace message associated with the channel. /// Adds a trace message associated with the channel.
enum TraceSeverity { TRACE_INFO, TRACE_WARNING, TRACE_ERROR }; enum TraceSeverity { TRACE_INFO, TRACE_WARNING, TRACE_ERROR };
virtual void AddTraceEvent(TraceSeverity severity, virtual void AddTraceEvent(TraceSeverity severity,

@ -90,6 +90,10 @@ class ChildPolicyHandler::Helper
parent_->channel_control_helper()->RequestReresolution(); parent_->channel_control_helper()->RequestReresolution();
} }
absl::string_view GetAuthority() override {
return parent_->channel_control_helper()->GetAuthority();
}
void AddTraceEvent(TraceSeverity severity, void AddTraceEvent(TraceSeverity severity,
absl::string_view message) override { absl::string_view message) override {
if (parent_->shutting_down_) return; if (parent_->shutting_down_) return;

@ -352,6 +352,7 @@ class GrpcLb : public LoadBalancingPolicy {
void UpdateState(grpc_connectivity_state state, const absl::Status& status, void UpdateState(grpc_connectivity_state state, const absl::Status& status,
std::unique_ptr<SubchannelPicker> picker) override; std::unique_ptr<SubchannelPicker> picker) override;
void RequestReresolution() override; void RequestReresolution() override;
absl::string_view GetAuthority() override;
void AddTraceEvent(TraceSeverity severity, void AddTraceEvent(TraceSeverity severity,
absl::string_view message) override; absl::string_view message) override;
@ -730,6 +731,10 @@ void GrpcLb::Helper::RequestReresolution() {
} }
} }
absl::string_view GrpcLb::Helper::GetAuthority() {
return parent_->channel_control_helper()->GetAuthority();
}
void GrpcLb::Helper::AddTraceEvent(TraceSeverity severity, void GrpcLb::Helper::AddTraceEvent(TraceSeverity severity,
absl::string_view message) { absl::string_view message) {
if (parent_->shutting_down_) return; if (parent_->shutting_down_) return;

@ -162,6 +162,7 @@ class PriorityLb : public LoadBalancingPolicy {
const absl::Status& status, const absl::Status& status,
std::unique_ptr<SubchannelPicker> picker) override; std::unique_ptr<SubchannelPicker> picker) override;
void RequestReresolution() override; void RequestReresolution() override;
absl::string_view GetAuthority() override;
void AddTraceEvent(TraceSeverity severity, void AddTraceEvent(TraceSeverity severity,
absl::string_view message) override; absl::string_view message) override;
@ -740,14 +741,6 @@ void PriorityLb::ChildPriority::OnDeactivationTimerLocked(
// PriorityLb::ChildPriority::Helper // PriorityLb::ChildPriority::Helper
// //
void PriorityLb::ChildPriority::Helper::RequestReresolution() {
if (priority_->priority_policy_->shutting_down_) return;
if (priority_->ignore_reresolution_requests_) {
return;
}
priority_->priority_policy_->channel_control_helper()->RequestReresolution();
}
RefCountedPtr<SubchannelInterface> RefCountedPtr<SubchannelInterface>
PriorityLb::ChildPriority::Helper::CreateSubchannel( PriorityLb::ChildPriority::Helper::CreateSubchannel(
ServerAddress address, const grpc_channel_args& args) { ServerAddress address, const grpc_channel_args& args) {
@ -764,6 +757,18 @@ void PriorityLb::ChildPriority::Helper::UpdateState(
priority_->OnConnectivityStateUpdateLocked(state, status, std::move(picker)); priority_->OnConnectivityStateUpdateLocked(state, status, std::move(picker));
} }
void PriorityLb::ChildPriority::Helper::RequestReresolution() {
if (priority_->priority_policy_->shutting_down_) return;
if (priority_->ignore_reresolution_requests_) {
return;
}
priority_->priority_policy_->channel_control_helper()->RequestReresolution();
}
absl::string_view PriorityLb::ChildPriority::Helper::GetAuthority() {
return priority_->priority_policy_->channel_control_helper()->GetAuthority();
}
void PriorityLb::ChildPriority::Helper::AddTraceEvent( void PriorityLb::ChildPriority::Helper::AddTraceEvent(
TraceSeverity severity, absl::string_view message) { TraceSeverity severity, absl::string_view message) {
if (priority_->priority_policy_->shutting_down_) return; if (priority_->priority_policy_->shutting_down_) return;

@ -150,6 +150,7 @@ class WeightedTargetLb : public LoadBalancingPolicy {
const absl::Status& status, const absl::Status& status,
std::unique_ptr<SubchannelPicker> picker) override; std::unique_ptr<SubchannelPicker> picker) override;
void RequestReresolution() override; void RequestReresolution() override;
absl::string_view GetAuthority() override;
void AddTraceEvent(TraceSeverity severity, void AddTraceEvent(TraceSeverity severity,
absl::string_view message) override; absl::string_view message) override;
@ -607,6 +608,11 @@ void WeightedTargetLb::WeightedChild::Helper::RequestReresolution() {
->RequestReresolution(); ->RequestReresolution();
} }
absl::string_view WeightedTargetLb::WeightedChild::Helper::GetAuthority() {
return weighted_child_->weighted_target_policy_->channel_control_helper()
->GetAuthority();
}
void WeightedTargetLb::WeightedChild::Helper::AddTraceEvent( void WeightedTargetLb::WeightedChild::Helper::AddTraceEvent(
TraceSeverity severity, absl::string_view message) { TraceSeverity severity, absl::string_view message) {
if (weighted_child_->weighted_target_policy_->shutting_down_) return; if (weighted_child_->weighted_target_policy_->shutting_down_) return;

@ -123,6 +123,7 @@ class CdsLb : public LoadBalancingPolicy {
void UpdateState(grpc_connectivity_state state, const absl::Status& status, void UpdateState(grpc_connectivity_state state, const absl::Status& status,
std::unique_ptr<SubchannelPicker> picker) override; std::unique_ptr<SubchannelPicker> picker) override;
void RequestReresolution() override; void RequestReresolution() override;
absl::string_view GetAuthority() override;
void AddTraceEvent(TraceSeverity severity, void AddTraceEvent(TraceSeverity severity,
absl::string_view message) override; absl::string_view message) override;
@ -261,6 +262,10 @@ void CdsLb::Helper::RequestReresolution() {
parent_->channel_control_helper()->RequestReresolution(); parent_->channel_control_helper()->RequestReresolution();
} }
absl::string_view CdsLb::Helper::GetAuthority() {
return parent_->channel_control_helper()->GetAuthority();
}
void CdsLb::Helper::AddTraceEvent(TraceSeverity severity, void CdsLb::Helper::AddTraceEvent(TraceSeverity severity,
absl::string_view message) { absl::string_view message) {
if (parent_->shutting_down_) return; if (parent_->shutting_down_) return;

@ -222,6 +222,7 @@ class XdsClusterImplLb : public LoadBalancingPolicy {
void UpdateState(grpc_connectivity_state state, const absl::Status& status, void UpdateState(grpc_connectivity_state state, const absl::Status& status,
std::unique_ptr<SubchannelPicker> picker) override; std::unique_ptr<SubchannelPicker> picker) override;
void RequestReresolution() override; void RequestReresolution() override;
absl::string_view GetAuthority() override;
void AddTraceEvent(TraceSeverity severity, void AddTraceEvent(TraceSeverity severity,
absl::string_view message) override; absl::string_view message) override;
@ -576,6 +577,10 @@ void XdsClusterImplLb::Helper::RequestReresolution() {
xds_cluster_impl_policy_->channel_control_helper()->RequestReresolution(); xds_cluster_impl_policy_->channel_control_helper()->RequestReresolution();
} }
absl::string_view XdsClusterImplLb::Helper::GetAuthority() {
return xds_cluster_impl_policy_->channel_control_helper()->GetAuthority();
}
void XdsClusterImplLb::Helper::AddTraceEvent(TraceSeverity severity, void XdsClusterImplLb::Helper::AddTraceEvent(TraceSeverity severity,
absl::string_view message) { absl::string_view message) {
if (xds_cluster_impl_policy_->shutting_down_) return; if (xds_cluster_impl_policy_->shutting_down_) return;

@ -151,6 +151,7 @@ class XdsClusterManagerLb : public LoadBalancingPolicy {
const absl::Status& status, const absl::Status& status,
std::unique_ptr<SubchannelPicker> picker) override; std::unique_ptr<SubchannelPicker> picker) override;
void RequestReresolution() override; void RequestReresolution() override;
absl::string_view GetAuthority() override;
void AddTraceEvent(TraceSeverity severity, void AddTraceEvent(TraceSeverity severity,
absl::string_view message) override; absl::string_view message) override;
@ -570,6 +571,12 @@ void XdsClusterManagerLb::ClusterChild::Helper::RequestReresolution() {
->RequestReresolution(); ->RequestReresolution();
} }
absl::string_view XdsClusterManagerLb::ClusterChild::Helper::GetAuthority() {
return xds_cluster_manager_child_->xds_cluster_manager_policy_
->channel_control_helper()
->GetAuthority();
}
void XdsClusterManagerLb::ClusterChild::Helper::AddTraceEvent( void XdsClusterManagerLb::ClusterChild::Helper::AddTraceEvent(
TraceSeverity severity, absl::string_view message) { TraceSeverity severity, absl::string_view message) {
if (xds_cluster_manager_child_->xds_cluster_manager_policy_->shutting_down_) { if (xds_cluster_manager_child_->xds_cluster_manager_policy_->shutting_down_) {

@ -299,6 +299,7 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
// This is a no-op, because we get the addresses from the xds // This is a no-op, because we get the addresses from the xds
// client, which is a watch-based API. // client, which is a watch-based API.
void RequestReresolution() override {} void RequestReresolution() override {}
absl::string_view GetAuthority() override;
void AddTraceEvent(TraceSeverity severity, void AddTraceEvent(TraceSeverity severity,
absl::string_view message) override; absl::string_view message) override;
@ -380,6 +381,10 @@ void XdsClusterResolverLb::Helper::UpdateState(
state, status, std::move(picker)); state, status, std::move(picker));
} }
absl::string_view XdsClusterResolverLb::Helper::GetAuthority() {
return xds_cluster_resolver_policy_->channel_control_helper()->GetAuthority();
}
void XdsClusterResolverLb::Helper::AddTraceEvent(TraceSeverity severity, void XdsClusterResolverLb::Helper::AddTraceEvent(TraceSeverity severity,
absl::string_view message) { absl::string_view message) {
if (xds_cluster_resolver_policy_->shutting_down_) return; if (xds_cluster_resolver_policy_->shutting_down_) return;

@ -47,7 +47,6 @@
#include "src/core/lib/iomgr/nameser.h" #include "src/core/lib/iomgr/nameser.h"
#include "src/core/lib/iomgr/sockaddr.h" #include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/iomgr/timer.h" #include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/transport/authority_override.h"
using grpc_core::ServerAddress; using grpc_core::ServerAddress;
using grpc_core::ServerAddressList; using grpc_core::ServerAddressList;
@ -670,8 +669,8 @@ static void on_hostbyname_done_locked(void* arg, int status, int /*timeouts*/,
for (size_t i = 0; hostent->h_addr_list[i] != nullptr; ++i) { for (size_t i = 0; hostent->h_addr_list[i] != nullptr; ++i) {
absl::InlinedVector<grpc_arg, 1> args_to_add; absl::InlinedVector<grpc_arg, 1> args_to_add;
if (hr->is_balancer) { if (hr->is_balancer) {
args_to_add.emplace_back( args_to_add.emplace_back(grpc_channel_arg_string_create(
grpc_core::CreateAuthorityOverrideChannelArg(hr->host)); const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY), hr->host));
} }
grpc_channel_args* args = grpc_channel_args_copy_and_add( grpc_channel_args* args = grpc_channel_args_copy_and_add(
nullptr, args_to_add.data(), args_to_add.size()); nullptr, args_to_add.data(), args_to_add.size());

@ -1,42 +0,0 @@
/*
*
* Copyright 2018 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/client/authority.h"
grpc_channel_args* grpc_default_authority_add_if_not_present(
const grpc_channel_args* args) {
const bool has_default_authority =
grpc_channel_args_find(args, GRPC_ARG_DEFAULT_AUTHORITY) != nullptr;
grpc_arg new_args[1];
size_t num_new_args = 0;
std::string default_authority;
if (!has_default_authority) {
const grpc_arg* server_uri_arg =
grpc_channel_args_find(args, GRPC_ARG_SERVER_URI);
const char* server_uri_str = grpc_channel_arg_get_string(server_uri_arg);
GPR_ASSERT(server_uri_str != nullptr);
default_authority =
grpc_core::ResolverRegistry::GetDefaultAuthority(server_uri_str);
new_args[num_new_args++] = grpc_channel_arg_string_create(
const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY),
const_cast<char*>(default_authority.c_str()));
}
return grpc_channel_args_copy_and_add(args, new_args, num_new_args);
}

@ -1,36 +0,0 @@
/*
*
* Copyright 2018 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_CLIENT_AUTHORITY_H
#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_CLIENT_AUTHORITY_H
#include <grpc/support/port_platform.h>
#include <grpc/grpc.h>
#include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/client_channel/resolver_registry.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/memory.h"
/// Returns a copy of \a args with the default authority channel arg set if it
/// wasn't already present.
grpc_channel_args* grpc_default_authority_add_if_not_present(
const grpc_channel_args* args);
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_CLIENT_AUTHORITY_H */

@ -24,7 +24,6 @@
#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/client_channel/resolver_registry.h" #include "src/core/ext/filters/client_channel/resolver_registry.h"
#include "src/core/ext/transport/chttp2/client/authority.h"
#include "src/core/ext/transport/chttp2/client/chttp2_connector.h" #include "src/core/ext/transport/chttp2/client/chttp2_connector.h"
#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/surface/api_trace.h" #include "src/core/lib/surface/api_trace.h"
@ -37,12 +36,7 @@ class Chttp2InsecureClientChannelFactory : public ClientChannelFactory {
RefCountedPtr<Subchannel> CreateSubchannel( RefCountedPtr<Subchannel> CreateSubchannel(
const grpc_resolved_address& address, const grpc_resolved_address& address,
const grpc_channel_args* args) override { const grpc_channel_args* args) override {
grpc_channel_args* new_args = return Subchannel::Create(MakeOrphanable<Chttp2Connector>(), address, args);
grpc_default_authority_add_if_not_present(args);
RefCountedPtr<Subchannel> s = Subchannel::Create(
MakeOrphanable<Chttp2Connector>(), address, new_args);
grpc_channel_args_destroy(new_args);
return s;
} }
}; };

@ -33,7 +33,6 @@
#include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/api_trace.h" #include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/channel.h" #include "src/core/lib/surface/channel.h"
#include "src/core/lib/transport/authority_override.h"
#include "src/core/lib/uri/uri_parser.h" #include "src/core/lib/uri/uri_parser.h"
namespace grpc_core { namespace grpc_core {
@ -74,52 +73,29 @@ class Chttp2SecureClientChannelFactory : public ClientChannelFactory {
return nullptr; return nullptr;
} }
// Find the authority to use in the security connector. // Find the authority to use in the security connector.
// First, check the authority override channel arg. const char* authority =
// Otherwise, get it from the server name used to construct the grpc_channel_args_find_string(args, GRPC_ARG_DEFAULT_AUTHORITY);
// channel. GPR_ASSERT(authority != nullptr);
std::string authority(FindAuthorityOverrideInArgs(args));
if (authority.empty()) {
const char* server_uri_str =
grpc_channel_args_find_string(args, GRPC_ARG_SERVER_URI);
GPR_ASSERT(server_uri_str != nullptr);
authority = ResolverRegistry::GetDefaultAuthority(server_uri_str);
}
grpc_arg args_to_add[2];
size_t num_args_to_add = 0;
if (grpc_channel_args_find(args, GRPC_ARG_DEFAULT_AUTHORITY) == nullptr) {
// If the channel args don't already contain GRPC_ARG_DEFAULT_AUTHORITY,
// add the arg, setting it to the value just obtained.
args_to_add[num_args_to_add++] = grpc_channel_arg_string_create(
const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY),
const_cast<char*>(authority.c_str()));
}
grpc_channel_args* args_with_authority =
grpc_channel_args_copy_and_add(args, args_to_add, num_args_to_add);
// Create the security connector using the credentials and target name. // Create the security connector using the credentials and target name.
grpc_channel_args* new_args_from_connector = nullptr; grpc_channel_args* new_args_from_connector = nullptr;
RefCountedPtr<grpc_channel_security_connector> RefCountedPtr<grpc_channel_security_connector>
subchannel_security_connector = subchannel_security_connector =
channel_credentials->create_security_connector( channel_credentials->create_security_connector(
/*call_creds=*/nullptr, authority.c_str(), args_with_authority, /*call_creds=*/nullptr, authority, args,
&new_args_from_connector); &new_args_from_connector);
if (subchannel_security_connector == nullptr) { if (subchannel_security_connector == nullptr) {
gpr_log(GPR_ERROR, gpr_log(GPR_ERROR,
"Failed to create secure subchannel for secure name '%s'", "Failed to create secure subchannel for secure name '%s'",
authority.c_str()); authority);
grpc_channel_args_destroy(args_with_authority);
return nullptr; return nullptr;
} }
grpc_arg new_security_connector_arg = grpc_arg new_security_connector_arg =
grpc_security_connector_to_arg(subchannel_security_connector.get()); grpc_security_connector_to_arg(subchannel_security_connector.get());
grpc_channel_args* new_args = grpc_channel_args_copy_and_add( grpc_channel_args* new_args = grpc_channel_args_copy_and_add(
new_args_from_connector != nullptr ? new_args_from_connector new_args_from_connector != nullptr ? new_args_from_connector : args,
: args_with_authority,
&new_security_connector_arg, 1); &new_security_connector_arg, 1);
subchannel_security_connector.reset(DEBUG_LOCATION, "lb_channel_create"); subchannel_security_connector.reset(DEBUG_LOCATION, "lb_channel_create");
if (new_args_from_connector != nullptr) { grpc_channel_args_destroy(new_args_from_connector);
grpc_channel_args_destroy(new_args_from_connector);
}
grpc_channel_args_destroy(args_with_authority);
return new_args; return new_args;
} }
}; };

@ -1,40 +0,0 @@
//
// Copyright 2020 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#include <grpc/support/port_platform.h>
#include "absl/strings/string_view.h"
#include "src/core/lib/channel/channel_args.h"
// Channel arg key for the authority override.
#define GRPC_ARG_AUTHORITY_OVERRIDE "grpc.authority_override"
namespace grpc_core {
grpc_arg CreateAuthorityOverrideChannelArg(const char* authority) {
return grpc_channel_arg_string_create(
const_cast<char*>(GRPC_ARG_AUTHORITY_OVERRIDE),
const_cast<char*>(authority));
}
absl::string_view FindAuthorityOverrideInArgs(const grpc_channel_args* args) {
const char* found =
grpc_channel_args_find_string(args, GRPC_ARG_AUTHORITY_OVERRIDE);
return found == nullptr ? "" : found;
}
} // namespace grpc_core

@ -1,37 +0,0 @@
//
// Copyright 2020 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef GRPC_CORE_LIB_TRANSPORT_AUTHORITY_OVERRIDE_H
#define GRPC_CORE_LIB_TRANSPORT_AUTHORITY_OVERRIDE_H
#include <grpc/support/port_platform.h>
#include "absl/strings/string_view.h"
#include <grpc/grpc.h>
namespace grpc_core {
/// Returns a channel argument containing \a authority.
grpc_arg CreateAuthorityOverrideChannelArg(const char* authority);
/// Returns the authority override from \a args or the empty string. The return
/// value is a string_view into the `args` data structure.
absl::string_view FindAuthorityOverrideInArgs(const grpc_channel_args* args);
} // namespace grpc_core
#endif /* GRPC_CORE_LIB_TRANSPORT_AUTHORITY_OVERRIDE_H */

@ -91,7 +91,6 @@ CORE_SOURCE_FILES = [
'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc', 'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc',
'src/core/ext/filters/workarounds/workaround_utils.cc', 'src/core/ext/filters/workarounds/workaround_utils.cc',
'src/core/ext/transport/chttp2/alpn/alpn.cc', 'src/core/ext/transport/chttp2/alpn/alpn.cc',
'src/core/ext/transport/chttp2/client/authority.cc',
'src/core/ext/transport/chttp2/client/chttp2_connector.cc', 'src/core/ext/transport/chttp2/client/chttp2_connector.cc',
'src/core/ext/transport/chttp2/client/insecure/channel_create.cc', 'src/core/ext/transport/chttp2/client/insecure/channel_create.cc',
'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc', 'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc',
@ -599,7 +598,6 @@ CORE_SOURCE_FILES = [
'src/core/lib/surface/server.cc', 'src/core/lib/surface/server.cc',
'src/core/lib/surface/validate_metadata.cc', 'src/core/lib/surface/validate_metadata.cc',
'src/core/lib/surface/version.cc', 'src/core/lib/surface/version.cc',
'src/core/lib/transport/authority_override.cc',
'src/core/lib/transport/bdp_estimator.cc', 'src/core/lib/transport/bdp_estimator.cc',
'src/core/lib/transport/byte_stream.cc', 'src/core/lib/transport/byte_stream.cc',
'src/core/lib/transport/connectivity_state.cc', 'src/core/lib/transport/connectivity_state.cc',

@ -138,6 +138,10 @@ class TestPickArgsLb : public ForwardingLoadBalancingPolicy {
parent_->channel_control_helper()->RequestReresolution(); parent_->channel_control_helper()->RequestReresolution();
} }
absl::string_view GetAuthority() override {
return parent_->channel_control_helper()->GetAuthority();
}
void AddTraceEvent(TraceSeverity severity, void AddTraceEvent(TraceSeverity severity,
absl::string_view message) override { absl::string_view message) override {
parent_->channel_control_helper()->AddTraceEvent(severity, message); parent_->channel_control_helper()->AddTraceEvent(severity, message);
@ -252,6 +256,10 @@ class InterceptRecvTrailingMetadataLoadBalancingPolicy
parent_->channel_control_helper()->RequestReresolution(); parent_->channel_control_helper()->RequestReresolution();
} }
absl::string_view GetAuthority() override {
return parent_->channel_control_helper()->GetAuthority();
}
void AddTraceEvent(TraceSeverity severity, void AddTraceEvent(TraceSeverity severity,
absl::string_view message) override { absl::string_view message) override {
parent_->channel_control_helper()->AddTraceEvent(severity, message); parent_->channel_control_helper()->AddTraceEvent(severity, message);
@ -365,6 +373,10 @@ class AddressTestLoadBalancingPolicy : public ForwardingLoadBalancingPolicy {
parent_->channel_control_helper()->RequestReresolution(); parent_->channel_control_helper()->RequestReresolution();
} }
absl::string_view GetAuthority() override {
return parent_->channel_control_helper()->GetAuthority();
}
void AddTraceEvent(TraceSeverity severity, void AddTraceEvent(TraceSeverity severity,
absl::string_view message) override { absl::string_view message) override {
parent_->channel_control_helper()->AddTraceEvent(severity, message); parent_->channel_control_helper()->AddTraceEvent(severity, message);

@ -45,7 +45,6 @@
#include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/thd.h" #include "src/core/lib/gprpp/thd.h"
#include "src/core/lib/iomgr/sockaddr.h" #include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/transport/authority_override.h"
#include "src/proto/grpc/lb/v1/load_balancer.grpc.pb.h" #include "src/proto/grpc/lb/v1/load_balancer.grpc.pb.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"
@ -228,8 +227,9 @@ class ClientChannelStressTest {
GPR_ASSERT(lb_uri.ok()); GPR_ASSERT(lb_uri.ok());
grpc_resolved_address address; grpc_resolved_address address;
GPR_ASSERT(grpc_parse_uri(*lb_uri, &address)); GPR_ASSERT(grpc_parse_uri(*lb_uri, &address));
grpc_arg arg = grpc_core::CreateAuthorityOverrideChannelArg( grpc_arg arg = grpc_channel_arg_string_create(
addr.balancer_name.c_str()); const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY),
const_cast<char*>(addr.balancer_name.c_str()));
grpc_channel_args* args = grpc_channel_args* args =
grpc_channel_args_copy_and_add(nullptr, &arg, 1); grpc_channel_args_copy_and_add(nullptr, &arg, 1);
addresses.emplace_back(address.addr, address.len, args); addresses.emplace_back(address.addr, address.len, args);

@ -52,7 +52,6 @@
#include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/sockaddr.h" #include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/security/credentials/fake/fake_credentials.h" #include "src/core/lib/security/credentials/fake/fake_credentials.h"
#include "src/core/lib/transport/authority_override.h"
#include "src/cpp/client/secure_credentials.h" #include "src/cpp/client/secure_credentials.h"
#include "src/cpp/server/secure_server_credentials.h" #include "src/cpp/server/secure_server_credentials.h"
#include "src/proto/grpc/lb/v1/load_balancer.grpc.pb.h" #include "src/proto/grpc/lb/v1/load_balancer.grpc.pb.h"
@ -546,8 +545,9 @@ class GrpclbEnd2endTest : public ::testing::Test {
GPR_ASSERT(lb_uri.ok()); GPR_ASSERT(lb_uri.ok());
grpc_resolved_address address; grpc_resolved_address address;
GPR_ASSERT(grpc_parse_uri(*lb_uri, &address)); GPR_ASSERT(grpc_parse_uri(*lb_uri, &address));
grpc_arg arg = grpc_core::CreateAuthorityOverrideChannelArg( grpc_arg arg = grpc_channel_arg_string_create(
addr.balancer_name.c_str()); const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY),
const_cast<char*>(addr.balancer_name.c_str()));
grpc_channel_args* args = grpc_channel_args* args =
grpc_channel_args_copy_and_add(nullptr, &arg, 1); grpc_channel_args_copy_and_add(nullptr, &arg, 1);
addresses.emplace_back(address.addr, address.len, args); addresses.emplace_back(address.addr, address.len, args);

@ -1183,8 +1183,6 @@ src/core/ext/filters/workarounds/workaround_utils.cc \
src/core/ext/filters/workarounds/workaround_utils.h \ src/core/ext/filters/workarounds/workaround_utils.h \
src/core/ext/transport/chttp2/alpn/alpn.cc \ src/core/ext/transport/chttp2/alpn/alpn.cc \
src/core/ext/transport/chttp2/alpn/alpn.h \ src/core/ext/transport/chttp2/alpn/alpn.h \
src/core/ext/transport/chttp2/client/authority.cc \
src/core/ext/transport/chttp2/client/authority.h \
src/core/ext/transport/chttp2/client/chttp2_connector.cc \ src/core/ext/transport/chttp2/client/chttp2_connector.cc \
src/core/ext/transport/chttp2/client/chttp2_connector.h \ src/core/ext/transport/chttp2/client/chttp2_connector.h \
src/core/ext/transport/chttp2/client/insecure/channel_create.cc \ src/core/ext/transport/chttp2/client/insecure/channel_create.cc \
@ -2149,8 +2147,6 @@ src/core/lib/surface/server.h \
src/core/lib/surface/validate_metadata.cc \ src/core/lib/surface/validate_metadata.cc \
src/core/lib/surface/validate_metadata.h \ src/core/lib/surface/validate_metadata.h \
src/core/lib/surface/version.cc \ src/core/lib/surface/version.cc \
src/core/lib/transport/authority_override.cc \
src/core/lib/transport/authority_override.h \
src/core/lib/transport/bdp_estimator.cc \ src/core/lib/transport/bdp_estimator.cc \
src/core/lib/transport/bdp_estimator.h \ src/core/lib/transport/bdp_estimator.h \
src/core/lib/transport/byte_stream.cc \ src/core/lib/transport/byte_stream.cc \

@ -1013,8 +1013,6 @@ src/core/ext/transport/binder/README.md \
src/core/ext/transport/chttp2/README.md \ src/core/ext/transport/chttp2/README.md \
src/core/ext/transport/chttp2/alpn/alpn.cc \ src/core/ext/transport/chttp2/alpn/alpn.cc \
src/core/ext/transport/chttp2/alpn/alpn.h \ src/core/ext/transport/chttp2/alpn/alpn.h \
src/core/ext/transport/chttp2/client/authority.cc \
src/core/ext/transport/chttp2/client/authority.h \
src/core/ext/transport/chttp2/client/chttp2_connector.cc \ src/core/ext/transport/chttp2/client/chttp2_connector.cc \
src/core/ext/transport/chttp2/client/chttp2_connector.h \ src/core/ext/transport/chttp2/client/chttp2_connector.h \
src/core/ext/transport/chttp2/client/insecure/README.md \ src/core/ext/transport/chttp2/client/insecure/README.md \
@ -1991,8 +1989,6 @@ src/core/lib/surface/validate_metadata.cc \
src/core/lib/surface/validate_metadata.h \ src/core/lib/surface/validate_metadata.h \
src/core/lib/surface/version.cc \ src/core/lib/surface/version.cc \
src/core/lib/transport/README.md \ src/core/lib/transport/README.md \
src/core/lib/transport/authority_override.cc \
src/core/lib/transport/authority_override.h \
src/core/lib/transport/bdp_estimator.cc \ src/core/lib/transport/bdp_estimator.cc \
src/core/lib/transport/bdp_estimator.h \ src/core/lib/transport/bdp_estimator.h \
src/core/lib/transport/byte_stream.cc \ src/core/lib/transport/byte_stream.cc \

Loading…
Cancel
Save