Merge remote-tracking branch 'origin/master' into python_xds_timeout_test

pull/25366/head
Richard Belleville 4 years ago
commit 2c2dd5c047
  1. 2
      .github/ISSUE_TEMPLATE/bug_report.md
  2. 2
      .github/ISSUE_TEMPLATE/cleanup_request.md
  3. 2
      .github/ISSUE_TEMPLATE/feature_request.md
  4. 2
      .github/ISSUE_TEMPLATE/question.md
  5. 2
      .github/pull_request_template.md
  6. 2
      .pylintrc
  7. 2
      .pylintrc-examples
  8. 2
      .pylintrc-tests
  9. 58
      BUILD
  10. 12
      BUILD.gn
  11. 179
      CMakeLists.txt
  12. 60
      Makefile
  13. 3
      Package.swift
  14. 2
      Rakefile
  15. 3
      SECURITY.md
  16. 52
      bazel/copts.bzl
  17. 7
      bazel/grpc_build_system.bzl
  18. 23
      bazel/grpc_deps.bzl
  19. 14
      bazel/grpc_python_deps.bzl
  20. 15
      bazel/update_mirror.sh
  21. 63
      build_autogenerated.yaml
  22. 2
      build_config.rb
  23. 8
      build_handwritten.yaml
  24. 8
      config.m4
  25. 12
      config.w32
  26. 1
      doc/g_stands_for.md
  27. 142
      doc/xds-test-descriptions.md
  28. 123
      examples/cpp/cmake/common.cmake
  29. 229
      examples/cpp/helloworld/CMakeLists.txt
  30. 80
      examples/cpp/route_guide/CMakeLists.txt
  31. 12
      examples/python/async_streaming/server.py
  32. 4
      examples/python/auth/async_customized_auth_server.py
  33. 6
      examples/python/debug/asyncio_debug_server.py
  34. 6
      examples/python/helloworld/async_greeter_server.py
  35. 6
      examples/python/helloworld/async_greeter_server_with_reflection.py
  36. 9
      examples/python/route_guide/asyncio_route_guide_client.py
  37. 11
      examples/python/route_guide/asyncio_route_guide_server.py
  38. 16
      gRPC-C++.podspec
  39. 21
      gRPC-Core.podspec
  40. 2
      gRPC-ProtoRPC.podspec
  41. 2
      gRPC-RxLibrary.podspec
  42. 2
      gRPC.podspec
  43. 14
      grpc.gemspec
  44. 19
      grpc.gyp
  45. 27
      include/grpc/grpc_security.h
  46. 2
      include/grpcpp/impl/codegen/async_unary_call.h
  47. 2
      include/grpcpp/impl/codegen/security/auth_context.h
  48. 18
      include/grpcpp/impl/codegen/server_callback_handlers.h
  49. 41
      include/grpcpp/impl/codegen/server_context.h
  50. 2
      include/grpcpp/impl/codegen/server_interface.h
  51. 5
      include/grpcpp/security/server_credentials.h
  52. 38
      include/grpcpp/security/tls_credentials_options.h
  53. 15
      include/grpcpp/server.h
  54. 6
      include/grpcpp/server_builder.h
  55. 48
      include/grpcpp/support/error_details.h
  56. 16
      package.xml
  57. 18
      requirements.bazel.txt
  58. 14
      setup.py
  59. 24
      src/android/test/interop/app/src/main/cpp/grpc-interop.cc
  60. 53
      src/core/ext/filters/client_channel/client_channel.cc
  61. 2
      src/core/ext/filters/client_channel/client_channel.h
  62. 2
      src/core/ext/filters/client_channel/config_selector.h
  63. 8
      src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
  64. 3
      src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc
  65. 3
      src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h
  66. 3
      src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc
  67. 2
      src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
  68. 14
      src/core/ext/filters/client_channel/lb_policy/priority/priority.cc
  69. 459
      src/core/ext/filters/client_channel/lb_policy/xds/cds.cc
  70. 5
      src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h
  71. 4
      src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc
  72. 340
      src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc
  73. 7
      src/core/ext/filters/client_channel/resolver.cc
  74. 13
      src/core/ext/filters/client_channel/resolver.h
  75. 81
      src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
  76. 70
      src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
  77. 30
      src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
  78. 33
      src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
  79. 362
      src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc
  80. 8
      src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
  81. 96
      src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc
  82. 6
      src/core/ext/filters/client_channel/server_address.cc
  83. 31
      src/core/ext/filters/client_channel/server_address.h
  84. 6
      src/core/ext/filters/load_reporting/server_load_reporting_filter.cc
  85. 2
      src/core/ext/transport/chttp2/client/chttp2_connector.cc
  86. 69
      src/core/ext/transport/chttp2/server/chttp2_server.cc
  87. 13
      src/core/ext/transport/chttp2/server/chttp2_server.h
  88. 12
      src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc
  89. 80
      src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc
  90. 36
      src/core/ext/transport/cronet/transport/cronet_api_dummy.cc
  91. 25
      src/core/ext/transport/cronet/transport/cronet_transport.cc
  92. 29
      src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c
  93. 67
      src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h
  94. 85
      src/core/ext/upb-generated/src/proto/grpc/auth/v1/authz_policy.upb.c
  95. 276
      src/core/ext/upb-generated/src/proto/grpc/auth/v1/authz_policy.upb.h
  96. 51
      src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c
  97. 35
      src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h
  98. 15
      src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c
  99. 18
      src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c
  100. 17
      src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c
  101. Some files were not shown because too many files have changed in this diff Show More

@ -2,7 +2,7 @@
name: Report a bug
about: Create a report to help us improve
labels: kind/bug, priority/P2
assignees: donnadionne
assignees: yashykt
---

@ -2,7 +2,7 @@
name: Request a cleanup
about: Suggest a cleanup in our repository
labels: kind/internal cleanup, priority/P2
assignees: donnadionne
assignees: yashykt
---

@ -2,7 +2,7 @@
name: Request a feature
about: Suggest an idea for this project
labels: kind/enhancement, priority/P2
assignees: donnadionne
assignees: yashykt
---

@ -2,7 +2,7 @@
name: Ask a question
about: Ask a question
labels: kind/question, priority/P3
assignees: donnadionne
assignees: yashykt
---

@ -8,4 +8,4 @@ If you know who should review your pull request, please remove the mentioning be
-->
@donnadionne
@yashykt

@ -95,3 +95,5 @@ disable=
no-else-return,
# NOTE(lidiz): Python 3 make object inheritance default, but not PY2
useless-object-inheritance,
# NOTE(sergiitk): yapf compatibility, ref #25071
bad-continuation,

@ -98,3 +98,5 @@ disable=
no-else-return,
# NOTE(lidiz): Python 3 make object inheritance default, but not PY2
useless-object-inheritance,
# NOTE(sergiitk): yapf compatibility, ref #25071
bad-continuation,

@ -124,3 +124,5 @@ disable=
no-else-return,
# NOTE(lidiz): Python 3 make object inheritance default, but not PY2
useless-object-inheritance,
# NOTE(sergiitk): yapf compatibility, ref #25071
bad-continuation,

58
BUILD

@ -77,14 +77,19 @@ config_setting(
values = {"cpu": "darwin"},
)
config_setting(
name = "use_strict_warning",
values = {"define": "use_strict_warning=true"},
)
python_config_settings()
# This should be updated along with build_handwritten.yaml
g_stands_for = "gecko"
g_stands_for = "gummybear" # @unused
core_version = "14.0.0"
core_version = "15.0.0" # @unused
version = "1.35.0-pre1"
version = "1.36.0-dev" # @unused
GPR_PUBLIC_HDRS = [
"include/grpc/support/alloc.h",
@ -327,12 +332,12 @@ grpc_cc_library(
"grpc_lb_policy_xds_cluster_manager",
"grpc_lb_policy_xds_cluster_resolver",
"grpc_resolver_xds",
"grpc_resolver_c2p",
"grpc_xds_server_config_fetcher",
],
},
standalone = True,
deps = [
"grpc_authorization_engine",
"grpc_common",
"grpc_lb_policy_grpclb_secure",
"grpc_secure",
@ -457,7 +462,6 @@ grpc_cc_library(
standalone = True,
deps = [
"grpc++",
"//src/proto/grpc/status:status_proto",
],
)
@ -562,6 +566,7 @@ grpc_cc_library(
"src/core/lib/gprpp/stat_windows.cc",
"src/core/lib/gprpp/thd_posix.cc",
"src/core/lib/gprpp/thd_windows.cc",
"src/core/lib/gprpp/time_util.cc",
"src/core/lib/profiling/basic_timers.cc",
"src/core/lib/profiling/stap_timers.cc",
],
@ -596,6 +601,7 @@ grpc_cc_library(
"src/core/lib/gprpp/stat.h",
"src/core/lib/gprpp/sync.h",
"src/core/lib/gprpp/thd.h",
"src/core/lib/gprpp/time_util.h",
"src/core/lib/profiling/timers.h",
],
external_deps = [
@ -936,7 +942,6 @@ grpc_cc_library(
"src/core/lib/iomgr/iomgr.h",
"src/core/lib/iomgr/iomgr_custom.h",
"src/core/lib/iomgr/iomgr_internal.h",
"src/core/lib/iomgr/iomgr_posix.h",
"src/core/lib/iomgr/is_epollexclusive_available.h",
"src/core/lib/iomgr/load_file.h",
"src/core/lib/iomgr/lockfree_event.h",
@ -1395,6 +1400,7 @@ grpc_cc_library(
deps = [
"envoy_ads_upb",
"envoy_ads_upbdefs",
"grpc_authorization_engine",
"grpc_base",
"grpc_client_channel",
"grpc_secure",
@ -1475,7 +1481,9 @@ grpc_cc_library(
"grpc_base",
"grpc_client_channel",
"grpc_lb_address_filtering",
"grpc_lb_xds_channel_args",
"grpc_lb_xds_common",
"grpc_resolver_fake",
"grpc_xds_client",
],
)
@ -1817,6 +1825,19 @@ grpc_cc_library(
],
)
grpc_cc_library(
name = "grpc_resolver_c2p",
srcs = [
"src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc",
],
language = "c++",
deps = [
"grpc_base",
"grpc_client_channel",
"grpc_xds_client",
],
)
grpc_cc_library(
name = "grpc_secure",
srcs = [
@ -1944,13 +1965,16 @@ grpc_cc_library(
srcs = [
"src/core/lib/security/authorization/authorization_engine.cc",
"src/core/lib/security/authorization/evaluate_args.cc",
"src/core/lib/security/authorization/matchers.cc",
],
hdrs = [
"src/core/lib/security/authorization/authorization_engine.h",
"src/core/lib/security/authorization/evaluate_args.h",
"src/core/lib/security/authorization/matchers.h",
],
external_deps = [
"absl/container:flat_hash_set",
"re2",
],
language = "c++",
deps = [
@ -2621,6 +2645,7 @@ grpc_cc_library(
"src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c",
"src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c",
"src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c",
"src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c",
"src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c",
"src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c",
"src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c",
@ -2653,6 +2678,7 @@ grpc_cc_library(
"src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h",
"src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h",
"src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h",
"src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h",
"src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h",
"src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h",
"src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h",
@ -2702,6 +2728,7 @@ grpc_cc_library(
"src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c",
"src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c",
"src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c",
"src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c",
"src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c",
"src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c",
"src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c",
@ -2733,6 +2760,7 @@ grpc_cc_library(
"src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h",
"src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h",
"src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h",
"src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h",
"src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h",
"src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h",
"src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h",
@ -2749,7 +2777,7 @@ grpc_cc_library(
],
external_deps = [
"upb_lib",
"upb_lib_descriptor",
"upb_lib_descriptor_reflection",
"upb_textformat_lib",
],
language = "c++",
@ -2797,7 +2825,7 @@ grpc_cc_library(
],
external_deps = [
"upb_lib",
"upb_lib_descriptor",
"upb_lib_descriptor_reflection",
"upb_textformat_lib",
],
language = "c++",
@ -2888,7 +2916,7 @@ grpc_cc_library(
],
external_deps = [
"upb_lib",
"upb_lib_descriptor",
"upb_lib_descriptor_reflection",
"upb_textformat_lib",
],
language = "c++",
@ -2975,7 +3003,7 @@ grpc_cc_library(
],
external_deps = [
"upb_lib",
"upb_lib_descriptor",
"upb_lib_descriptor_reflection",
"upb_textformat_lib",
],
language = "c++",
@ -3014,7 +3042,7 @@ grpc_cc_library(
],
external_deps = [
"upb_lib",
"upb_lib_descriptor",
"upb_lib_descriptor_reflection",
"upb_textformat_lib",
],
language = "c++",
@ -3093,7 +3121,7 @@ grpc_cc_library(
],
external_deps = [
"upb_lib",
"upb_lib_descriptor",
"upb_lib_descriptor_reflection",
"upb_textformat_lib",
],
language = "c++",
@ -3153,7 +3181,7 @@ grpc_cc_library(
],
external_deps = [
"upb_lib",
"upb_lib_descriptor",
"upb_lib_descriptor_reflection",
"upb_textformat_lib",
],
language = "c++",
@ -3228,7 +3256,6 @@ grpc_cc_library(
"src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c",
"src/core/ext/upbdefs-generated/google/api/http.upbdefs.c",
"src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c",
"src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c",
"src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c",
"src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c",
"src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c",
@ -3240,7 +3267,6 @@ grpc_cc_library(
"src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h",
"src/core/ext/upbdefs-generated/google/api/http.upbdefs.h",
"src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h",
"src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h",
"src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h",
"src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h",
"src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h",
@ -3250,7 +3276,7 @@ grpc_cc_library(
],
external_deps = [
"upb_lib",
"upb_lib_descriptor",
"upb_lib_descriptor_reflection",
"upb_textformat_lib",
],
language = "c++",

@ -169,6 +169,8 @@ config("grpc_config") {
"src/core/lib/gprpp/thd.h",
"src/core/lib/gprpp/thd_posix.cc",
"src/core/lib/gprpp/thd_windows.cc",
"src/core/lib/gprpp/time_util.cc",
"src/core/lib/gprpp/time_util.h",
"src/core/lib/profiling/basic_timers.cc",
"src/core/lib/profiling/stap_timers.cc",
"src/core/lib/profiling/timers.h",
@ -287,6 +289,7 @@ config("grpc_config") {
"src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc",
"src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc",
"src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h",
"src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc",
"src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc",
"src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc",
"src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h",
@ -457,6 +460,8 @@ config("grpc_config") {
"src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h",
"src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c",
"src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h",
"src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c",
"src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h",
"src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c",
"src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h",
"src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c",
@ -627,6 +632,8 @@ config("grpc_config") {
"src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h",
"src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c",
"src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h",
"src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c",
"src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h",
"src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c",
"src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h",
"src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c",
@ -683,8 +690,6 @@ config("grpc_config") {
"src/core/ext/upbdefs-generated/google/api/http.upbdefs.h",
"src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c",
"src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h",
"src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c",
"src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h",
"src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c",
"src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h",
"src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c",
@ -863,7 +868,6 @@ config("grpc_config") {
"src/core/lib/iomgr/iomgr_internal.cc",
"src/core/lib/iomgr/iomgr_internal.h",
"src/core/lib/iomgr/iomgr_posix.cc",
"src/core/lib/iomgr/iomgr_posix.h",
"src/core/lib/iomgr/iomgr_posix_cfstream.cc",
"src/core/lib/iomgr/iomgr_uv.cc",
"src/core/lib/iomgr/iomgr_windows.cc",
@ -982,6 +986,8 @@ config("grpc_config") {
"src/core/lib/security/authorization/authorization_engine.h",
"src/core/lib/security/authorization/evaluate_args.cc",
"src/core/lib/security/authorization/evaluate_args.h",
"src/core/lib/security/authorization/matchers.cc",
"src/core/lib/security/authorization/matchers.h",
"src/core/lib/security/authorization/mock_cel/activation.h",
"src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h",
"src/core/lib/security/authorization/mock_cel/cel_expression.h",

@ -25,12 +25,12 @@
cmake_minimum_required(VERSION 3.5.1)
set(PACKAGE_NAME "grpc")
set(PACKAGE_VERSION "1.35.0-pre1")
set(gRPC_CORE_VERSION "14.0.0")
set(gRPC_CORE_SOVERSION "14")
set(gRPC_CPP_VERSION "1.35.0-pre1")
set(PACKAGE_VERSION "1.36.0-dev")
set(gRPC_CORE_VERSION "15.0.0")
set(gRPC_CORE_SOVERSION "15")
set(gRPC_CPP_VERSION "1.36.0-dev")
set(gRPC_CPP_SOVERSION "1")
set(gRPC_CSHARP_VERSION "2.35.0-pre1")
set(gRPC_CSHARP_VERSION "2.36.0-dev")
set(gRPC_CSHARP_SOVERSION "2")
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}")
@ -457,6 +457,9 @@ protobuf_generate_grpc_cpp(
protobuf_generate_grpc_cpp(
src/proto/grpc/testing/xds/v3/ads.proto
)
protobuf_generate_grpc_cpp(
src/proto/grpc/testing/xds/v3/aggregate_cluster.proto
)
protobuf_generate_grpc_cpp(
src/proto/grpc/testing/xds/v3/base.proto
)
@ -813,6 +816,7 @@ if(gRPC_BUILD_TESTS)
add_dependencies(buildtests_cxx codegen_test_minimal)
add_dependencies(buildtests_cxx connection_prefix_bad_client_test)
add_dependencies(buildtests_cxx connectivity_state_test)
add_dependencies(buildtests_cxx context_allocator_end2end_test)
add_dependencies(buildtests_cxx context_list_test)
add_dependencies(buildtests_cxx delegating_channel_test)
add_dependencies(buildtests_cxx destroy_grpclb_channel_with_active_connect_stress_test)
@ -866,6 +870,7 @@ if(gRPC_BUILD_TESTS)
add_dependencies(buildtests_cxx lb_load_data_store_test)
add_dependencies(buildtests_cxx linux_system_roots_test)
add_dependencies(buildtests_cxx log_test)
add_dependencies(buildtests_cxx matchers_test)
add_dependencies(buildtests_cxx message_allocator_end2end_test)
add_dependencies(buildtests_cxx mock_test)
add_dependencies(buildtests_cxx nonblocking_test)
@ -932,6 +937,7 @@ if(gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx time_jump_test)
endif()
add_dependencies(buildtests_cxx time_util_test)
add_dependencies(buildtests_cxx timer_test)
add_dependencies(buildtests_cxx tls_security_connector_test)
add_dependencies(buildtests_cxx too_many_pings_test)
@ -1333,6 +1339,7 @@ add_library(gpr
src/core/lib/gprpp/stat_windows.cc
src/core/lib/gprpp/thd_posix.cc
src/core/lib/gprpp/thd_windows.cc
src/core/lib/gprpp/time_util.cc
src/core/lib/profiling/basic_timers.cc
src/core/lib/profiling/stap_timers.cc
)
@ -1490,6 +1497,7 @@ add_library(grpc
src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc
src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc
src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc
src/core/ext/filters/client_channel/resolver_registry.cc
@ -1580,6 +1588,7 @@ add_library(grpc
src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c
src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c
src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c
src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c
src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c
@ -1665,6 +1674,7 @@ add_library(grpc
src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c
src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c
src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c
@ -1693,7 +1703,6 @@ add_library(grpc
src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c
src/core/ext/upbdefs-generated/google/api/http.upbdefs.c
src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c
src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c
src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c
src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c
src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c
@ -1848,6 +1857,7 @@ add_library(grpc
src/core/lib/json/json_writer.cc
src/core/lib/security/authorization/authorization_engine.cc
src/core/lib/security/authorization/evaluate_args.cc
src/core/lib/security/authorization/matchers.cc
src/core/lib/security/context/security_context.cc
src/core/lib/security/credentials/alts/alts_credentials.cc
src/core/lib/security/credentials/alts/check_gcp_environment.cc
@ -3037,12 +3047,7 @@ if(gRPC_INSTALL)
endif()
if(gRPC_BUILD_CODEGEN)
add_library(grpc++_error_details
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/status/status.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/status/status.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/status/status.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/status/status.grpc.pb.h
src/cpp/util/error_details.cc
)
@ -3095,9 +3100,7 @@ foreach(_hdr
DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}"
)
endforeach()
endif()
if(gRPC_BUILD_CODEGEN)
if(gRPC_INSTALL)
install(TARGETS grpc++_error_details EXPORT gRPCTargets
@ -3107,7 +3110,6 @@ if(gRPC_INSTALL)
)
endif()
endif()
if(gRPC_BUILD_CODEGEN)
add_library(grpc++_reflection
@ -3792,20 +3794,8 @@ add_library(upb
third_party/upb/upb/table.c
third_party/upb/upb/text_encode.c
third_party/upb/upb/upb.c
src/core/ext/upb-generated/google/protobuf/any.upb.c
src/core/ext/upb-generated/google/protobuf/descriptor.upb.c
src/core/ext/upb-generated/google/protobuf/duration.upb.c
src/core/ext/upb-generated/google/protobuf/empty.upb.c
src/core/ext/upb-generated/google/protobuf/struct.upb.c
src/core/ext/upb-generated/google/protobuf/timestamp.upb.c
src/core/ext/upb-generated/google/protobuf/wrappers.upb.c
src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c
src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c
src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c
src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c
src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c
src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c
src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c
)
set_target_properties(upb PROPERTIES
@ -10530,6 +10520,59 @@ target_link_libraries(connectivity_state_test
)
endif()
if(gRPC_BUILD_TESTS)
add_executable(context_allocator_end2end_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.grpc.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.grpc.pb.h
test/cpp/end2end/context_allocator_end2end_test.cc
test/cpp/end2end/test_service_impl.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
target_include_directories(context_allocator_end2end_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
${_gRPC_RE2_INCLUDE_DIR}
${_gRPC_SSL_INCLUDE_DIR}
${_gRPC_UPB_GENERATED_DIR}
${_gRPC_UPB_GRPC_GENERATED_DIR}
${_gRPC_UPB_INCLUDE_DIR}
${_gRPC_ZLIB_INCLUDE_DIR}
third_party/googletest/googletest/include
third_party/googletest/googletest
third_party/googletest/googlemock/include
third_party/googletest/googlemock
${_gRPC_PROTO_GENS_DIR}
)
target_link_libraries(context_allocator_end2end_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
grpc++_test_util
grpc_test_util
grpc++
grpc
gpr
address_sorting
upb
)
endif()
if(gRPC_BUILD_TESTS)
@ -10802,6 +10845,10 @@ endif()
if(gRPC_BUILD_TESTS)
add_executable(error_details_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/status/status.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/status/status.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/status/status.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/status/status.grpc.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.h
@ -12733,6 +12780,44 @@ target_link_libraries(log_test
)
endif()
if(gRPC_BUILD_TESTS)
add_executable(matchers_test
test/core/security/matchers_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
target_include_directories(matchers_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
${_gRPC_RE2_INCLUDE_DIR}
${_gRPC_SSL_INCLUDE_DIR}
${_gRPC_UPB_GENERATED_DIR}
${_gRPC_UPB_GRPC_GENERATED_DIR}
${_gRPC_UPB_INCLUDE_DIR}
${_gRPC_ZLIB_INCLUDE_DIR}
third_party/googletest/googletest/include
third_party/googletest/googletest
third_party/googletest/googlemock/include
third_party/googletest/googlemock
${_gRPC_PROTO_GENS_DIR}
)
target_link_libraries(matchers_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
grpc
gpr
address_sorting
upb
)
endif()
if(gRPC_BUILD_TESTS)
@ -14960,6 +15045,44 @@ endif()
endif()
if(gRPC_BUILD_TESTS)
add_executable(time_util_test
test/core/gprpp/time_util_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
target_include_directories(time_util_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
${_gRPC_RE2_INCLUDE_DIR}
${_gRPC_SSL_INCLUDE_DIR}
${_gRPC_UPB_GENERATED_DIR}
${_gRPC_UPB_GRPC_GENERATED_DIR}
${_gRPC_UPB_INCLUDE_DIR}
${_gRPC_ZLIB_INCLUDE_DIR}
third_party/googletest/googletest/include
third_party/googletest/googletest
third_party/googletest/googlemock/include
third_party/googletest/googlemock
${_gRPC_PROTO_GENS_DIR}
)
target_link_libraries(time_util_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
grpc
gpr
address_sorting
upb
)
endif()
if(gRPC_BUILD_TESTS)
add_executable(timer_test
test/cpp/common/timer_test.cc
third_party/googletest/googletest/src/gtest-all.cc
@ -15527,6 +15650,10 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/ads.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/ads.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/ads.grpc.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/aggregate_cluster.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/aggregate_cluster.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/aggregate_cluster.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/aggregate_cluster.grpc.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/base.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/base.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/base.pb.h

@ -454,9 +454,9 @@ E = @echo
Q = @
endif
CORE_VERSION = 14.0.0
CPP_VERSION = 1.35.0-pre1
CSHARP_VERSION = 2.35.0-pre1
CORE_VERSION = 15.0.0
CPP_VERSION = 1.36.0-dev
CSHARP_VERSION = 2.36.0-dev
CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES))
CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS)
@ -492,7 +492,7 @@ SHARED_EXT_CORE = dll
SHARED_EXT_CPP = dll
SHARED_EXT_CSHARP = dll
SHARED_PREFIX =
SHARED_VERSION_CORE = -14
SHARED_VERSION_CORE = -15
SHARED_VERSION_CPP = -1
SHARED_VERSION_CSHARP = -2
else ifeq ($(SYSTEM),Darwin)
@ -891,8 +891,8 @@ $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE):
ifeq ($(SYSTEM),Darwin)
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBADDRESS_SORTING_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
else
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libaddress_sorting.so.14 -o $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBADDRESS_SORTING_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).so.14
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libaddress_sorting.so.15 -o $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBADDRESS_SORTING_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).so.15
$(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).so
endif
endif
@ -947,6 +947,7 @@ LIBGPR_SRC = \
src/core/lib/gprpp/stat_windows.cc \
src/core/lib/gprpp/thd_posix.cc \
src/core/lib/gprpp/thd_windows.cc \
src/core/lib/gprpp/time_util.cc \
src/core/lib/profiling/basic_timers.cc \
src/core/lib/profiling/stap_timers.cc \
@ -1019,8 +1020,8 @@ $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBGPR_OB
ifeq ($(SYSTEM),Darwin)
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
else
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgpr.so.14 -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so.14
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgpr.so.15 -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so.15
$(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so
endif
endif
@ -1079,6 +1080,7 @@ LIBGRPC_SRC = \
src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc \
src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc \
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \
src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc \
src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc \
src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc \
src/core/ext/filters/client_channel/resolver_registry.cc \
@ -1169,6 +1171,7 @@ LIBGRPC_SRC = \
src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c \
src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c \
src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c \
src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c \
src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c \
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c \
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c \
@ -1254,6 +1257,7 @@ LIBGRPC_SRC = \
src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c \
@ -1282,7 +1286,6 @@ LIBGRPC_SRC = \
src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c \
src/core/ext/upbdefs-generated/google/api/http.upbdefs.c \
src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c \
src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c \
src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c \
src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c \
src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c \
@ -1437,6 +1440,7 @@ LIBGRPC_SRC = \
src/core/lib/json/json_writer.cc \
src/core/lib/security/authorization/authorization_engine.cc \
src/core/lib/security/authorization/evaluate_args.cc \
src/core/lib/security/authorization/matchers.cc \
src/core/lib/security/context/security_context.cc \
src/core/lib/security/credentials/alts/alts_credentials.cc \
src/core/lib/security/credentials/alts/check_gcp_environment.cc \
@ -1611,8 +1615,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBGRPC_
ifeq ($(SYSTEM),Darwin)
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(LIBDIR)/$(CONFIG)/libupb.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
else
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.14 -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(LIBDIR)/$(CONFIG)/libupb.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so.14
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.15 -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(LIBDIR)/$(CONFIG)/libupb.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so.15
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so
endif
endif
@ -1669,8 +1673,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE):
ifeq ($(SYSTEM),Darwin)
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CSHARP_EXT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(LIBDIR)/$(CONFIG)/libupb.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
else
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_csharp_ext.so.14 -o $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CSHARP_EXT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(LIBDIR)/$(CONFIG)/libupb.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CORE).so.14
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_csharp_ext.so.15 -o $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CSHARP_EXT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(LIBDIR)/$(CONFIG)/libupb.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CORE).so.15
$(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CORE).so
endif
endif
@ -2007,8 +2011,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $
ifeq ($(SYSTEM),Darwin)
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(LIBDIR)/$(CONFIG)/libupb.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
else
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_unsecure.so.14 -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(LIBDIR)/$(CONFIG)/libupb.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so.14
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_unsecure.so.15 -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(LIBDIR)/$(CONFIG)/libupb.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so.15
$(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so
endif
endif
@ -2377,20 +2381,8 @@ LIBUPB_SRC = \
third_party/upb/upb/table.c \
third_party/upb/upb/text_encode.c \
third_party/upb/upb/upb.c \
src/core/ext/upb-generated/google/protobuf/any.upb.c \
src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \
src/core/ext/upb-generated/google/protobuf/duration.upb.c \
src/core/ext/upb-generated/google/protobuf/empty.upb.c \
src/core/ext/upb-generated/google/protobuf/struct.upb.c \
src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \
src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \
src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c \
src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c \
src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c \
src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c \
src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c \
src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c \
src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c \
PUBLIC_HEADERS_C += \
@ -2420,8 +2412,8 @@ $(LIBDIR)/$(CONFIG)/libupb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBUPB_OB
ifeq ($(SYSTEM),Darwin)
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)upb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libupb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBUPB_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
else
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libupb.so.14 -o $(LIBDIR)/$(CONFIG)/libupb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBUPB_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)upb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libupb$(SHARED_VERSION_CORE).so.14
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libupb.so.15 -o $(LIBDIR)/$(CONFIG)/libupb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBUPB_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(RE2_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)upb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libupb$(SHARED_VERSION_CORE).so.15
$(Q) ln -sf $(SHARED_PREFIX)upb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libupb$(SHARED_VERSION_CORE).so
endif
endif
@ -2668,6 +2660,7 @@ src/core/ext/filters/client_channel/lb_policy/xds/cds.cc: $(OPENSSL_DEP)
src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc: $(OPENSSL_DEP)
src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc: $(OPENSSL_DEP)
src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc: $(OPENSSL_DEP)
src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc: $(OPENSSL_DEP)
src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc: $(OPENSSL_DEP)
src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc: $(OPENSSL_DEP)
src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc: $(OPENSSL_DEP)
@ -2703,6 +2696,7 @@ src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c: $(OPENSSL_DEP)
src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c: $(OPENSSL_DEP)
src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c: $(OPENSSL_DEP)
src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c: $(OPENSSL_DEP)
src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c: $(OPENSSL_DEP)
src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c: $(OPENSSL_DEP)
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c: $(OPENSSL_DEP)
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c: $(OPENSSL_DEP)
@ -2773,6 +2767,7 @@ src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c: $(OPENSSL_
src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c: $(OPENSSL_DEP)
@ -2800,6 +2795,12 @@ src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/google/api/http.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c: $(OPENSSL_DEP)
@ -2825,6 +2826,7 @@ src/core/ext/xds/xds_server_config_fetcher.cc: $(OPENSSL_DEP)
src/core/lib/http/httpcli_security_connector.cc: $(OPENSSL_DEP)
src/core/lib/security/authorization/authorization_engine.cc: $(OPENSSL_DEP)
src/core/lib/security/authorization/evaluate_args.cc: $(OPENSSL_DEP)
src/core/lib/security/authorization/matchers.cc: $(OPENSSL_DEP)
src/core/lib/security/context/security_context.cc: $(OPENSSL_DEP)
src/core/lib/security/credentials/alts/alts_credentials.cc: $(OPENSSL_DEP)
src/core/lib/security/credentials/alts/check_gcp_environment.cc: $(OPENSSL_DEP)

@ -88,6 +88,7 @@ let package = Package(
.headerSearchPath("src/core/ext/upb-generated/"),
.headerSearchPath("src/core/ext/upbdefs-generated/"),
.define("GRPC_ARES", to: "0"),
.unsafeFlags(["-Wno-module-import-in-extern-c"]),
]
),
.target(
@ -105,7 +106,6 @@ let package = Package(
"src/cpp/server/load_reporter/",
"src/cpp/util/core_stats.cc",
"src/cpp/util/core_stats.h",
"src/cpp/util/error_details.cc",
],
sources: [
"src/cpp/",
@ -116,6 +116,7 @@ let package = Package(
.headerSearchPath("include/"),
.headerSearchPath("third_party/upb/"),
.headerSearchPath("src/core/ext/upb-generated"),
.unsafeFlags(["-Wno-module-import-in-extern-c"]),
]
),
],

@ -121,7 +121,7 @@ task 'gem:native' do
verbose = ENV['V'] || '0'
grpc_config = ENV['GRPC_CONFIG'] || 'opt'
ruby_cc_versions = ['3.0.0', '2.7.0', '2.6.0', '2.5.0', '2.4.0', '2.3.0'].join(':')
ruby_cc_versions = ['3.0.0', '2.7.0', '2.6.0', '2.5.0', '2.4.0'].join(':')
if RUBY_PLATFORM =~ /darwin/
FileUtils.touch 'grpc_c.32.ruby'

@ -0,0 +1,3 @@
# Security Policy
For information on gRPC Security Policy and reporting potentional security issues, please see [gRPC CVE Process](https://github.com/grpc/proposal/blob/master/P4-grpc-cve-process.md).

@ -0,0 +1,52 @@
# Copyright 2021 the gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This is a list of llvm flags to be used when being built with use_strict_warning=1
GRPC_LLVM_WARNING_FLAGS = [
# Enable all & extra waninrgs
"-Wall",
"-Wextra",
# Consider warnings as errors
"-Werror",
# Ignore unknown warning flags
"-Wno-unknown-warning-option",
# A list of flags coming from internal build system
"-Wc++20-extensions",
"-Wctad-maybe-unsupported",
"-Wdeprecated-increment-bool",
"-Wfloat-overflow-conversion",
"-Wfloat-zero-conversion",
"-Wfor-loop-analysis",
"-Wformat-security",
"-Wgnu-redeclared-enum",
"-Winfinite-recursion",
"-Wliteral-conversion",
"-Wnon-virtual-dtor",
"-Woverloaded-virtual",
"-Wself-assign",
"-Wstring-conversion",
"-Wtautological-overlap-compare",
"-Wthread-safety-analysis",
"-Wthread-safety-beta",
"-Wunused-comparison",
"-Wvla",
# Exceptions but will be removed
"-Wno-deprecated-declarations",
"-Wno-unused-function",
]
GRPC_DEFAULT_COPTS = select({
"//:use_strict_warning": GRPC_LLVM_WARNING_FLAGS,
"//conditions:default": [],
})

@ -24,6 +24,7 @@
#
load("//bazel:cc_grpc_library.bzl", "cc_grpc_library")
load("//bazel:copts.bzl", "GRPC_DEFAULT_COPTS")
load("@upb//bazel:upb_proto_library.bzl", "upb_proto_library")
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_unit_test")
@ -109,7 +110,7 @@ def grpc_cc_library(
}),
hdrs = hdrs + public_hdrs,
deps = deps + _get_external_deps(external_deps),
copts = copts,
copts = GRPC_DEFAULT_COPTS + copts,
visibility = visibility,
testonly = testonly,
linkopts = linkopts,
@ -187,7 +188,7 @@ def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data
"args": args,
"data": data,
"deps": deps + _get_external_deps(external_deps),
"copts": copts,
"copts": GRPC_DEFAULT_COPTS + copts,
"linkopts": if_not_windows(["-pthread"]),
"size": size,
"timeout": timeout,
@ -249,7 +250,7 @@ def grpc_cc_binary(name, srcs = [], deps = [], external_deps = [], args = [], da
testonly = testonly,
linkshared = linkshared,
deps = deps + _get_external_deps(external_deps),
copts = copts,
copts = GRPC_DEFAULT_COPTS + copts,
linkopts = if_not_windows(["-pthread"]) + linkopts,
tags = tags,
features = features,

@ -16,6 +16,11 @@ def grpc_deps():
actual = "@upb//:descriptor_upb_proto",
)
native.bind(
name = "upb_lib_descriptor_reflection",
actual = "@upb//:descriptor_upb_proto_reflection",
)
native.bind(
name = "upb_textformat_lib",
actual = "@upb//:textformat",
@ -169,12 +174,14 @@ def grpc_deps():
if "com_google_protobuf" not in native.existing_rules():
http_archive(
name = "com_google_protobuf",
sha256 = "e589e39ef46fb2b3b476b3ca355bd324e5984cbdfac19f0e1625f0042e99c276",
strip_prefix = "protobuf-fde7cf7358ec7cd69e8db9be4f1fa6a5c431386a",
sha256 = "88f7b3d062759e9428394cd2b854722c7142de6d9ea1cc0514a251dcec91bc0b",
strip_prefix = "protobuf-19fb89416f3fdc2d6668f3738f444885575285bc",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/protobuf/archive/fde7cf7358ec7cd69e8db9be4f1fa6a5c431386a.tar.gz",
"https://github.com/google/protobuf/archive/fde7cf7358ec7cd69e8db9be4f1fa6a5c431386a.tar.gz",
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/protobuf/archive/19fb89416f3fdc2d6668f3738f444885575285bc.tar.gz",
"https://github.com/google/protobuf/archive/19fb89416f3fdc2d6668f3738f444885575285bc.tar.gz",
],
patches = ["@com_github_grpc_grpc//third_party:protobuf.patch"],
patch_args = ["-p1"],
)
if "com_google_googletest" not in native.existing_rules():
@ -238,11 +245,11 @@ def grpc_deps():
if "com_google_absl" not in native.existing_rules():
http_archive(
name = "com_google_absl",
sha256 = "3d74cdc98b42fd4257d91f652575206de195e2c824fcd8d6e6d227f85cb143ef",
strip_prefix = "abseil-cpp-0f3bb466b868b523cf1dc9b2aaaed65c77b28862",
sha256 = "62c27e7a633e965a2f40ff16b487c3b778eae440bab64cad83b34ef1cbe3aa93",
strip_prefix = "abseil-cpp-6f9d96a1f41439ac172ee2ef7ccd8edf0e5d068c",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/abseil/abseil-cpp/archive/0f3bb466b868b523cf1dc9b2aaaed65c77b28862.tar.gz",
"https://github.com/abseil/abseil-cpp/archive/0f3bb466b868b523cf1dc9b2aaaed65c77b28862.tar.gz",
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/abseil/abseil-cpp/archive/6f9d96a1f41439ac172ee2ef7ccd8edf0e5d068c.tar.gz",
"https://github.com/abseil/abseil-cpp/archive/6f9d96a1f41439ac172ee2ef7ccd8edf0e5d068c.tar.gz",
],
)

@ -40,14 +40,6 @@ def grpc_python_deps():
sha256 = "aa96a691d3a8177f3215b14b0edc9641787abaaa30363a080165d06ab65e1161",
)
if "rules_python" not in native.existing_rules():
http_archive(
name = "rules_python",
url = "https://github.com/bazelbuild/rules_python/archive/9d68f24659e8ce8b736590ba1e4418af06ec2552.zip",
sha256 = "f7402f11691d657161f871e11968a984e5b48b023321935f5a55d7e56cf4758a",
strip_prefix = "rules_python-9d68f24659e8ce8b736590ba1e4418af06ec2552",
)
python_configure(name = "local_config_python")
native.bind(
@ -59,9 +51,9 @@ def grpc_python_deps():
http_archive(
name = "cython",
build_file = "@com_github_grpc_grpc//third_party:cython.BUILD",
sha256 = "d68138a2381afbdd0876c3cb2a22389043fa01c4badede1228ee073032b07a27",
strip_prefix = "cython-c2b80d87658a8525ce091cbe146cb7eaa29fed5c",
sha256 = "e2e38e1f0572ca54d6085df3dec8b607d20e81515fb80215aed19c81e8fe2079",
strip_prefix = "cython-0.29.21",
urls = [
"https://github.com/cython/cython/archive/c2b80d87658a8525ce091cbe146cb7eaa29fed5c.tar.gz",
"https://github.com/cython/cython/archive/0.29.21.tar.gz",
],
)

@ -34,13 +34,18 @@ trap cleanup EXIT
function upload {
local file="$1"
echo "Downloading https://${file}"
curl -L --fail --output "${tmpdir}/archive" "https://${file}"
if gsutil stat "gs://grpc-bazel-mirror/${file}" > /dev/null
then
echo "Skipping ${file}"
else
echo "Downloading https://${file}"
curl -L --fail --output "${tmpdir}/archive" "https://${file}"
echo "Uploading https://${file} to https://storage.googleapis.com/grpc-bazel-mirror/${file}"
gsutil cp -n "${tmpdir}/archive" "gs://grpc-bazel-mirror/${file}" # "-n" will skip existing files
echo "Uploading https://${file} to https://storage.googleapis.com/grpc-bazel-mirror/${file}"
gsutil cp "${tmpdir}/archive" "gs://grpc-bazel-mirror/${file}"
rm -rf "${tmpdir}/archive"
rm -rf "${tmpdir}/archive"
fi
}
# How to check that all mirror URLs work:

@ -308,6 +308,7 @@ libs:
- src/core/lib/gprpp/stat.h
- src/core/lib/gprpp/sync.h
- src/core/lib/gprpp/thd.h
- src/core/lib/gprpp/time_util.h
- src/core/lib/profiling/timers.h
src:
- src/core/lib/gpr/alloc.cc
@ -352,6 +353,7 @@ libs:
- src/core/lib/gprpp/stat_windows.cc
- src/core/lib/gprpp/thd_posix.cc
- src/core/lib/gprpp/thd_windows.cc
- src/core/lib/gprpp/time_util.cc
- src/core/lib/profiling/basic_timers.cc
- src/core/lib/profiling/stap_timers.cc
deps:
@ -497,6 +499,7 @@ libs:
- src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h
- src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h
- src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h
- src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h
- src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h
- src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h
- src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h
@ -582,6 +585,7 @@ libs:
- src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h
@ -610,7 +614,6 @@ libs:
- src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h
- src/core/ext/upbdefs-generated/google/api/http.upbdefs.h
- src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h
- src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h
- src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h
- src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h
- src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h
@ -701,7 +704,6 @@ libs:
- src/core/lib/iomgr/iomgr.h
- src/core/lib/iomgr/iomgr_custom.h
- src/core/lib/iomgr/iomgr_internal.h
- src/core/lib/iomgr/iomgr_posix.h
- src/core/lib/iomgr/is_epollexclusive_available.h
- src/core/lib/iomgr/load_file.h
- src/core/lib/iomgr/lockfree_event.h
@ -754,6 +756,7 @@ libs:
- src/core/lib/json/json_util.h
- src/core/lib/security/authorization/authorization_engine.h
- src/core/lib/security/authorization/evaluate_args.h
- src/core/lib/security/authorization/matchers.h
- src/core/lib/security/authorization/mock_cel/activation.h
- src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h
- src/core/lib/security/authorization/mock_cel/cel_expression.h
@ -911,6 +914,7 @@ libs:
- src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc
- src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
- src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
- src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc
- src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
- src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc
- src/core/ext/filters/client_channel/resolver_registry.cc
@ -1001,6 +1005,7 @@ libs:
- src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c
- src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c
- src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c
- src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c
- src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c
- src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c
- src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c
@ -1086,6 +1091,7 @@ libs:
- src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c
@ -1114,7 +1120,6 @@ libs:
- src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c
- src/core/ext/upbdefs-generated/google/api/http.upbdefs.c
- src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c
- src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c
- src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c
- src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c
- src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c
@ -1269,6 +1274,7 @@ libs:
- src/core/lib/json/json_writer.cc
- src/core/lib/security/authorization/authorization_engine.cc
- src/core/lib/security/authorization/evaluate_args.cc
- src/core/lib/security/authorization/matchers.cc
- src/core/lib/security/context/security_context.cc
- src/core/lib/security/credentials/alts/alts_credentials.cc
- src/core/lib/security/credentials/alts/check_gcp_environment.cc
@ -1710,7 +1716,6 @@ libs:
- src/core/lib/iomgr/iomgr.h
- src/core/lib/iomgr/iomgr_custom.h
- src/core/lib/iomgr/iomgr_internal.h
- src/core/lib/iomgr/iomgr_posix.h
- src/core/lib/iomgr/is_epollexclusive_available.h
- src/core/lib/iomgr/load_file.h
- src/core/lib/iomgr/lockfree_event.h
@ -2395,7 +2400,6 @@ libs:
- include/grpcpp/support/error_details.h
headers: []
src:
- src/proto/grpc/status/status.proto
- src/cpp/util/error_details.cc
deps:
- grpc++
@ -5786,6 +5790,26 @@ targets:
- gpr
- address_sorting
- upb
- name: context_allocator_end2end_test
gtest: true
build: test
language: c++
headers:
- test/cpp/end2end/test_service_impl.h
src:
- src/proto/grpc/testing/echo.proto
- src/proto/grpc/testing/echo_messages.proto
- src/proto/grpc/testing/simple_messages.proto
- test/cpp/end2end/context_allocator_end2end_test.cc
- test/cpp/end2end/test_service_impl.cc
deps:
- grpc++_test_util
- grpc_test_util
- grpc++
- grpc
- gpr
- address_sorting
- upb
- name: context_list_test
gtest: true
build: test
@ -5896,6 +5920,7 @@ targets:
language: c++
headers: []
src:
- src/proto/grpc/status/status.proto
- src/proto/grpc/testing/echo_messages.proto
- test/cpp/util/error_details_test.cc
deps:
@ -6694,6 +6719,19 @@ targets:
- address_sorting
- upb
uses_polling: false
- name: matchers_test
gtest: true
build: test
language: c++
headers: []
src:
- test/core/security/matchers_test.cc
deps:
- grpc_test_util
- grpc
- gpr
- address_sorting
- upb
- name: message_allocator_end2end_test
gtest: true
build: test
@ -7683,6 +7721,20 @@ targets:
- linux
- posix
- mac
- name: time_util_test
gtest: true
build: test
language: c++
headers: []
src:
- test/core/gprpp/time_util_test.cc
deps:
- grpc_test_util
- grpc
- gpr
- address_sorting
- upb
uses_polling: false
- name: timer_test
gtest: true
build: test
@ -7953,6 +8005,7 @@ targets:
- src/proto/grpc/testing/xds/lrs_for_test.proto
- src/proto/grpc/testing/xds/v3/address.proto
- src/proto/grpc/testing/xds/v3/ads.proto
- src/proto/grpc/testing/xds/v3/aggregate_cluster.proto
- src/proto/grpc/testing/xds/v3/base.proto
- src/proto/grpc/testing/xds/v3/cluster.proto
- src/proto/grpc/testing/xds/v3/config_source.proto

@ -13,5 +13,5 @@
# limitations under the License.
module GrpcBuildConfig
CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-14.dll'
CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-15.dll'
end

@ -12,11 +12,11 @@ settings:
'#08': Use "-preN" suffixes to identify pre-release versions
'#09': Per-language overrides are possible with (eg) ruby_version tag here
'#10': See the expand_version.py for all the quirks here
core_version: 14.0.0
core_version: 15.0.0
csharp_major_version: 2
g_stands_for: gecko
protobuf_version: 3.13.0
version: 1.35.0-pre1
g_stands_for: gummybear
protobuf_version: 3.14.0
version: 1.36.0-dev
targets:
- name: check_epollexclusive
build: tool

@ -85,6 +85,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc \
src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc \
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \
src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc \
src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc \
src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc \
src/core/ext/filters/client_channel/resolver_registry.cc \
@ -175,6 +176,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c \
src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c \
src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c \
src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c \
src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c \
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c \
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c \
@ -261,6 +263,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c \
@ -381,6 +384,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/gprpp/stat_windows.cc \
src/core/lib/gprpp/thd_posix.cc \
src/core/lib/gprpp/thd_windows.cc \
src/core/lib/gprpp/time_util.cc \
src/core/lib/http/format_request.cc \
src/core/lib/http/httpcli.cc \
src/core/lib/http/httpcli_security_connector.cc \
@ -488,6 +492,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/profiling/stap_timers.cc \
src/core/lib/security/authorization/authorization_engine.cc \
src/core/lib/security/authorization/evaluate_args.cc \
src/core/lib/security/authorization/matchers.cc \
src/core/lib/security/context/security_context.cc \
src/core/lib/security/credentials/alts/alts_credentials.cc \
src/core/lib/security/credentials/alts/check_gcp_environment.cc \
@ -1016,6 +1021,7 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/dns/c_ares)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/dns/native)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/fake)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/google_c2p)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/sockaddr)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/xds)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_idle)
@ -1045,6 +1051,7 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/config/rbac/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/config/route/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/config/trace/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/service/cluster/v3)
@ -1076,6 +1083,7 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/config/listener/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/config/route/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/config/trace/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/service/cluster/v3)

@ -52,6 +52,7 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\filters\\client_channel\\resolver\\dns\\dns_resolver_selection.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\dns\\native\\dns_resolver.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\fake\\fake_resolver.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\google_c2p\\google_c2p_resolver.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\sockaddr\\sockaddr_resolver.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\xds\\xds_resolver.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver_registry.cc " +
@ -142,6 +143,7 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\upb-generated\\envoy\\config\\route\\v3\\route_components.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\config\\route\\v3\\scoped_route.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\config\\trace\\v3\\http_tracer.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\extensions\\clusters\\aggregate\\v3\\cluster.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\extensions\\filters\\network\\http_connection_manager\\v3\\http_connection_manager.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\extensions\\transport_sockets\\tls\\v3\\cert.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\extensions\\transport_sockets\\tls\\v3\\common.upb.c " +
@ -228,6 +230,7 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\route\\v3\\route_components.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\route\\v3\\scoped_route.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\trace\\v3\\http_tracer.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\clusters\\aggregate\\v3\\cluster.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters\\network\\http_connection_manager\\v3\\http_connection_manager.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\transport_sockets\\tls\\v3\\cert.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\transport_sockets\\tls\\v3\\common.upbdefs.c " +
@ -348,6 +351,7 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\gprpp\\stat_windows.cc " +
"src\\core\\lib\\gprpp\\thd_posix.cc " +
"src\\core\\lib\\gprpp\\thd_windows.cc " +
"src\\core\\lib\\gprpp\\time_util.cc " +
"src\\core\\lib\\http\\format_request.cc " +
"src\\core\\lib\\http\\httpcli.cc " +
"src\\core\\lib\\http\\httpcli_security_connector.cc " +
@ -455,6 +459,7 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\profiling\\stap_timers.cc " +
"src\\core\\lib\\security\\authorization\\authorization_engine.cc " +
"src\\core\\lib\\security\\authorization\\evaluate_args.cc " +
"src\\core\\lib\\security\\authorization\\matchers.cc " +
"src\\core\\lib\\security\\context\\security_context.cc " +
"src\\core\\lib\\security\\credentials\\alts\\alts_credentials.cc " +
"src\\core\\lib\\security\\credentials\\alts\\check_gcp_environment.cc " +
@ -1017,6 +1022,7 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\dns\\native");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\fake");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\google_c2p");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\sockaddr");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\xds");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_idle");
@ -1060,6 +1066,9 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\config\\trace");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\config\\trace\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions\\clusters");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions\\clusters\\aggregate");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions\\clusters\\aggregate\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions\\filters");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions\\filters\\network");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions\\filters\\network\\http_connection_manager");
@ -1129,6 +1138,9 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\config\\trace");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\config\\trace\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\clusters");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\clusters\\aggregate");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\clusters\\aggregate\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters\\network");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters\\network\\http_connection_manager");

@ -35,3 +35,4 @@
- 1.33 'g' stands for ['geeky'](https://github.com/grpc/grpc/tree/v1.33.x)
- 1.34 'g' stands for ['gauntlet'](https://github.com/grpc/grpc/tree/v1.34.x)
- 1.35 'g' stands for ['gecko'](https://github.com/grpc/grpc/tree/v1.35.x)
- 1.36 'g' stands for ['gummybear'](https://github.com/grpc/grpc/tree/master)

@ -375,25 +375,27 @@ Assert:
1. UnaryCall RPCs are sent to MIG_default
1. EmptyCall RPCs are sent to MIG_default
The test driver adds a route for EmptyCall, routes become:
The test driver changes route and asserts RPCs are sent to expected backends. **Note** that the default route `"/"` is always pointing to MIG_default, so all RPCs not matching the new route will be sent to MIG_default.
1. path{“/grpc.testing.TestService/EmptyCall”}: MIG_2
1. “/”: MIG_default
- {path: `/grpc.testing.TestService/EmptyCall`}: MIG_2
- UnaryCall -> MIG_default
- EmptyCall -> MIG_2
Assert:
1. UnaryCall RPCs are sent to MIG_default
1. EmptyCall RPCs are sent to MIG_2
- {prefix: `/grpc.testing.TestService/Unary`}: MIG_2
- UnaryCall -> MIG_2
- EmptyCall -> MIG_default
The test driver adds a route for prefix Unary, routes become:
- {prefix: `/grpc.testing.TestService/Unary`}: MIG_default & {path: `/grpc.testing.TestService/EmptyCall`}: MIG_2
- UnaryCall -> MIG_default
- EmptyCall -> MIG_2
1. prefix{“/grpc.testing.TestService/Unary”}: MIG_2
1. “/”: MIG_default
- {regex: `^\/.*\/UnaryCall$`}: MIG_2
- UnaryCall -> MIG_2
- EmptyCall -> MIG_default
Assert:
1. UnaryCall RPCs are sent to MIG_2
1. EmptyCall RPCs are sent to MIG_default
- {path: `/gRpC.tEsTinG.tEstseRvice/empTycaLl`, ignoreCase: `True`}: MIG_2
- UnaryCall -> MIG_default
- EmptyCall -> MIG_2
### header_matching
@ -419,15 +421,41 @@ Assert:
1. UnaryCall RPCs are sent to MIG_default
1. EmptyCall RPCs are sent to MIG_default
The test driver adds a route for header exact match, routes become:
The test driver changes route and asserts RPCs are sent to expected backends. **Note** that the default route `"/"` is always pointing to MIG_default, so all RPCs not matching the new route will be sent to MIG_default.
1. header{“xds_md”, exact: “exact_match”}: MIG_2
1. “/”: MIG_default
- {header `xds_md`, exact: `empty_ytpme`}: MIG_2
- Unary -> MIG_default
- Empty -> MIG_2
Assert:
- {header `xds_md`, prefix: `un`}: MIG_2
- `un` is the prefix of metadata sent with UnaryCall
- Unary -> MIG_2
- Empty -> MIG_default
1. UnaryCall RPCs are sent to MIG_default
1. EmptyCall RPCs are sent to MIG_2
- {header `xds_md`, suffix: `me`}: MIG_2
- `me` is the suffix of metadata sent with EmptyCall
- Unary -> MIG_default
- Empty to MIG_2
- {header `xds_md_numeric`, present: `True`}: MIG_2
- Unary is sent with the metadata, so will be sent to alternative
- Unary -> MIG_2
- Empty -> MIG_default
- {header `xds_md`, exact: `unary_yranu`, invert: `True`}: MIG_2
- Unary is sent with the metadata, so this will not match Unary, but will match Empty
- Unary -> MIG_default
- Empty to MIG_2
- {header `xds_md_numeric`, range `[100,200]`}: MIG_2
- Unary is sent with the metadata in range
- Unary -> MIG_2
- Empty -> MIG_default
- {header `xds_md`, regex: `^em.*me$`}: MIG_2
- EmptyCall is sent with the metadata
- Unary -> MIG_default
- Empty -> MIG_2
### gentle_failover
@ -463,6 +491,42 @@ Test driver asserts:
1. All backends in the primary locality receive at least 1 RPC.
1. No backends in the secondary locality receive RPCs.
### load_based_failover
This test verifies that traffic is partially diverted to a secondary locality
when the QPS is greater than the configured RPS in the priority locality.
Client parameters:
1. --num_channels=1
1. --qps=100
Load balancer configuration:
1. The primary MIG with 2 backends in the same zone as the client
1. The secondary MIG with 2 backends in a different zone
Test driver asserts:
1. All backends in the primary locality receive at least 1 RPC.
1. No backends in the secondary locality receive RPCs.
The test driver sets `balancingMode` is `RATE`, and `maxRate` to 20 in the primary locality.
Test driver asserts:
1. All backends in the primary locality receive at least 1 RPC.
1. All backends in the secondary locality receive at least 1 RPC.
The test driver set `maxRate` to 120 in the primary locality.
Test driver asserts:
1. All backends in the primary locality receive at least 1 RPC.
1. No backends in the secondary locality receive RPCs.
### circuit_breaking
This test verifies that the maximum number of outstanding requests is limited
@ -496,4 +560,40 @@ The test driver updates MIG_1's circuit breakers with max_request = 800.
Test driver asserts:
1. After reaching steady state, there are 800 UnaryCall RPCs in-flight.
1. After reaching steady state, there are 800 UnaryCall RPCs in-flight.
### timeout
This test verifies that traffic along a route with a `max_stream_duration` set
will cause timeouts on streams open longer than that duration.
Client parameters:
1. `--num_channels=1`
1. `--qps=100`
Route Configuration:
Two routes:
1. Path match for `/grpc.testing.TestService/UnaryCall`, with a `route_action`
containing `max_stream_duration` of 3 seconds.
1. Default route containing no `max_stream_duration` setting.
There are four sub-tests:
1. `app_timeout_exceeded`
1. Test client configured to send UnaryCall RPCs with a 1s application
timeout, and metadata of `rpc-behavior: sleep-2`.
1. Test driver asserts client recieves ~100% status `DEADLINE_EXCEEDED`.
1. `timeout_not_exceeded`
1. Test client configured to send UnaryCall RPCs with the default
application timeout (20 seconds), and no metadata.
1. Test driver asserts client recieves ~100% status `OK`.
1. `timeout_exceeded` (executed with the below test case)
1. `timeout_different_route`
1. Test client configured to send UnaryCall RPCs and EmptyCall RPCs with
the default application timeout (20 seconds), and metadata of
`rpc-behavior: sleep-4`.
1. Test driver asserts client recieves ~100% status `OK` for EmptyCall
and ~100% status `DEADLINE_EXCEEDED` for UnaryCall.

@ -0,0 +1,123 @@
# 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.
#
# cmake build file for C++ route_guide example.
# Assumes protobuf and gRPC have been installed using cmake.
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building route_guide.
cmake_minimum_required(VERSION 3.5.1)
set (CMAKE_CXX_STANDARD 11)
if(MSVC)
add_definitions(-D_WIN32_WINNT=0x600)
endif()
find_package(Threads REQUIRED)
if(GRPC_AS_SUBMODULE)
# One way to build a projects that uses gRPC is to just include the
# entire gRPC project tree via "add_subdirectory".
# This approach is very simple to use, but the are some potential
# disadvantages:
# * it includes gRPC's CMakeLists.txt directly into your build script
# without and that can make gRPC's internal setting interfere with your
# own build.
# * depending on what's installed on your system, the contents of submodules
# in gRPC's third_party/* might need to be available (and there might be
# additional prerequisites required to build them). Consider using
# the gRPC_*_PROVIDER options to fine-tune the expected behavior.
#
# A more robust approach to add dependency on gRPC is using
# cmake's ExternalProject_Add (see cmake_externalproject/CMakeLists.txt).
# Include the gRPC's cmake build (normally grpc source code would live
# in a git submodule called "third_party/grpc", but this example lives in
# the same repository as gRPC sources, so we just look a few directories up)
add_subdirectory(../../.. ${CMAKE_CURRENT_BINARY_DIR}/grpc EXCLUDE_FROM_ALL)
message(STATUS "Using gRPC via add_subdirectory.")
# After using add_subdirectory, we can now use the grpc targets directly from
# this build.
set(_PROTOBUF_LIBPROTOBUF libprotobuf)
set(_REFLECTION grpc++_reflection)
if(CMAKE_CROSSCOMPILING)
find_program(_PROTOBUF_PROTOC protoc)
else()
set(_PROTOBUF_PROTOC $<TARGET_FILE:protobuf::protoc>)
endif()
set(_GRPC_GRPCPP grpc++)
if(CMAKE_CROSSCOMPILING)
find_program(_GRPC_CPP_PLUGIN_EXECUTABLE grpc_cpp_plugin)
else()
set(_GRPC_CPP_PLUGIN_EXECUTABLE $<TARGET_FILE:grpc_cpp_plugin>)
endif()
elseif(GRPC_FETCHCONTENT)
# Another way is to use CMake's FetchContent module to clone gRPC at
# configure time. This makes gRPC's source code available to your project,
# similar to a git submodule.
message(STATUS "Using gRPC via add_subdirectory (FetchContent).")
include(FetchContent)
FetchContent_Declare(
grpc
GIT_REPOSITORY https://github.com/grpc/grpc.git
# when using gRPC, you will actually set this to an existing tag, such as
# v1.25.0, v1.26.0 etc..
# For the purpose of testing, we override the tag used to the commit
# that's currently under test.
GIT_TAG vGRPC_TAG_VERSION_OF_YOUR_CHOICE)
FetchContent_MakeAvailable(grpc)
# Since FetchContent uses add_subdirectory under the hood, we can use
# the grpc targets directly from this build.
set(_PROTOBUF_LIBPROTOBUF libprotobuf)
set(_REFLECTION grpc++_reflection)
set(_PROTOBUF_PROTOC $<TARGET_FILE:protoc>)
set(_GRPC_GRPCPP grpc++)
if(CMAKE_CROSSCOMPILING)
find_program(_GRPC_CPP_PLUGIN_EXECUTABLE grpc_cpp_plugin)
else()
set(_GRPC_CPP_PLUGIN_EXECUTABLE $<TARGET_FILE:grpc_cpp_plugin>)
endif()
else()
# This branch assumes that gRPC and all its dependencies are already installed
# on this system, so they can be located by find_package().
# Find Protobuf installation
# Looks for protobuf-config.cmake file installed by Protobuf's cmake installation.
set(protobuf_MODULE_COMPATIBLE TRUE)
find_package(Protobuf CONFIG REQUIRED)
message(STATUS "Using protobuf ${Protobuf_VERSION}")
set(_PROTOBUF_LIBPROTOBUF protobuf::libprotobuf)
set(_REFLECTION gRPC::grpc++_reflection)
if(CMAKE_CROSSCOMPILING)
find_program(_PROTOBUF_PROTOC protoc)
else()
set(_PROTOBUF_PROTOC $<TARGET_FILE:protobuf::protoc>)
endif()
# Find gRPC installation
# Looks for gRPCConfig.cmake file installed by gRPC's cmake installation.
find_package(gRPC CONFIG REQUIRED)
message(STATUS "Using gRPC ${gRPC_VERSION}")
set(_GRPC_GRPCPP gRPC::grpc++)
if(CMAKE_CROSSCOMPILING)
find_program(_GRPC_CPP_PLUGIN_EXECUTABLE grpc_cpp_plugin)
else()
set(_GRPC_CPP_PLUGIN_EXECUTABLE $<TARGET_FILE:gRPC::grpc_cpp_plugin>)
endif()
endif()

@ -1,160 +1,69 @@
# 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.
#
# cmake build file for C++ helloworld example.
# Assumes protobuf and gRPC have been installed using cmake.
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building helloworld.
cmake_minimum_required(VERSION 3.5.1)
project(HelloWorld C CXX)
if(NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
else()
add_definitions(-D_WIN32_WINNT=0x600)
endif()
find_package(Threads REQUIRED)
if(GRPC_AS_SUBMODULE)
# One way to build a projects that uses gRPC is to just include the
# entire gRPC project tree via "add_subdirectory".
# This approach is very simple to use, but the are some potential
# disadvantages:
# * it includes gRPC's CMakeLists.txt directly into your build script
# without and that can make gRPC's internal setting interfere with your
# own build.
# * depending on what's installed on your system, the contents of submodules
# in gRPC's third_party/* might need to be available (and there might be
# additional prerequisites required to build them). Consider using
# the gRPC_*_PROVIDER options to fine-tune the expected behavior.
#
# A more robust approach to add dependency on gRPC is using
# cmake's ExternalProject_Add (see cmake_externalproject/CMakeLists.txt).
# Include the gRPC's cmake build (normally grpc source code would live
# in a git submodule called "third_party/grpc", but this example lives in
# the same repository as gRPC sources, so we just look a few directories up)
add_subdirectory(../../.. ${CMAKE_CURRENT_BINARY_DIR}/grpc EXCLUDE_FROM_ALL)
message(STATUS "Using gRPC via add_subdirectory.")
# After using add_subdirectory, we can now use the grpc targets directly from
# this build.
set(_PROTOBUF_LIBPROTOBUF libprotobuf)
set(_REFLECTION grpc++_reflection)
if(CMAKE_CROSSCOMPILING)
find_program(_PROTOBUF_PROTOC protoc)
else()
set(_PROTOBUF_PROTOC $<TARGET_FILE:protobuf::protoc>)
endif()
set(_GRPC_GRPCPP grpc++)
if(CMAKE_CROSSCOMPILING)
find_program(_GRPC_CPP_PLUGIN_EXECUTABLE grpc_cpp_plugin)
else()
set(_GRPC_CPP_PLUGIN_EXECUTABLE $<TARGET_FILE:grpc_cpp_plugin>)
endif()
elseif(GRPC_FETCHCONTENT)
# Another way is to use CMake's FetchContent module to clone gRPC at
# configure time. This makes gRPC's source code available to your project,
# similar to a git submodule.
message(STATUS "Using gRPC via add_subdirectory (FetchContent).")
include(FetchContent)
FetchContent_Declare(
grpc
GIT_REPOSITORY https://github.com/grpc/grpc.git
# when using gRPC, you will actually set this to an existing tag, such as
# v1.25.0, v1.26.0 etc..
# For the purpose of testing, we override the tag used to the commit
# that's currently under test.
GIT_TAG vGRPC_TAG_VERSION_OF_YOUR_CHOICE)
FetchContent_MakeAvailable(grpc)
# Since FetchContent uses add_subdirectory under the hood, we can use
# the grpc targets directly from this build.
set(_PROTOBUF_LIBPROTOBUF libprotobuf)
set(_REFLECTION grpc++_reflection)
set(_PROTOBUF_PROTOC $<TARGET_FILE:protoc>)
set(_GRPC_GRPCPP grpc++)
if(CMAKE_CROSSCOMPILING)
find_program(_GRPC_CPP_PLUGIN_EXECUTABLE grpc_cpp_plugin)
else()
set(_GRPC_CPP_PLUGIN_EXECUTABLE $<TARGET_FILE:grpc_cpp_plugin>)
endif()
else()
# This branch assumes that gRPC and all its dependencies are already installed
# on this system, so they can be located by find_package().
# Find Protobuf installation
# Looks for protobuf-config.cmake file installed by Protobuf's cmake installation.
set(protobuf_MODULE_COMPATIBLE TRUE)
find_package(Protobuf CONFIG REQUIRED)
message(STATUS "Using protobuf ${Protobuf_VERSION}")
set(_PROTOBUF_LIBPROTOBUF protobuf::libprotobuf)
set(_REFLECTION gRPC::grpc++_reflection)
if(CMAKE_CROSSCOMPILING)
find_program(_PROTOBUF_PROTOC protoc)
else()
set(_PROTOBUF_PROTOC $<TARGET_FILE:protobuf::protoc>)
endif()
# Find gRPC installation
# Looks for gRPCConfig.cmake file installed by gRPC's cmake installation.
find_package(gRPC CONFIG REQUIRED)
message(STATUS "Using gRPC ${gRPC_VERSION}")
set(_GRPC_GRPCPP gRPC::grpc++)
if(CMAKE_CROSSCOMPILING)
find_program(_GRPC_CPP_PLUGIN_EXECUTABLE grpc_cpp_plugin)
else()
set(_GRPC_CPP_PLUGIN_EXECUTABLE $<TARGET_FILE:gRPC::grpc_cpp_plugin>)
endif()
endif()
# Proto file
get_filename_component(hw_proto "../../protos/helloworld.proto" ABSOLUTE)
get_filename_component(hw_proto_path "${hw_proto}" PATH)
# Generated sources
set(hw_proto_srcs "${CMAKE_CURRENT_BINARY_DIR}/helloworld.pb.cc")
set(hw_proto_hdrs "${CMAKE_CURRENT_BINARY_DIR}/helloworld.pb.h")
set(hw_grpc_srcs "${CMAKE_CURRENT_BINARY_DIR}/helloworld.grpc.pb.cc")
set(hw_grpc_hdrs "${CMAKE_CURRENT_BINARY_DIR}/helloworld.grpc.pb.h")
add_custom_command(
OUTPUT "${hw_proto_srcs}" "${hw_proto_hdrs}" "${hw_grpc_srcs}" "${hw_grpc_hdrs}"
COMMAND ${_PROTOBUF_PROTOC}
ARGS --grpc_out "${CMAKE_CURRENT_BINARY_DIR}"
--cpp_out "${CMAKE_CURRENT_BINARY_DIR}"
-I "${hw_proto_path}"
--plugin=protoc-gen-grpc="${_GRPC_CPP_PLUGIN_EXECUTABLE}"
"${hw_proto}"
DEPENDS "${hw_proto}")
# Include generated *.pb.h files
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
# Targets greeter_[async_](client|server)
foreach(_target
greeter_client greeter_server
greeter_async_client greeter_async_client2 greeter_async_server)
add_executable(${_target} "${_target}.cc"
${hw_proto_srcs}
${hw_grpc_srcs})
target_link_libraries(${_target}
${_REFLECTION}
${_GRPC_GRPCPP}
${_PROTOBUF_LIBPROTOBUF})
endforeach()
# 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.
#
# cmake build file for C++ helloworld example.
# Assumes protobuf and gRPC have been installed using cmake.
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building helloworld.
cmake_minimum_required(VERSION 3.5.1)
project(HelloWorld C CXX)
include(../cmake/common.cmake)
# Proto file
get_filename_component(hw_proto "../../protos/helloworld.proto" ABSOLUTE)
get_filename_component(hw_proto_path "${hw_proto}" PATH)
# Generated sources
set(hw_proto_srcs "${CMAKE_CURRENT_BINARY_DIR}/helloworld.pb.cc")
set(hw_proto_hdrs "${CMAKE_CURRENT_BINARY_DIR}/helloworld.pb.h")
set(hw_grpc_srcs "${CMAKE_CURRENT_BINARY_DIR}/helloworld.grpc.pb.cc")
set(hw_grpc_hdrs "${CMAKE_CURRENT_BINARY_DIR}/helloworld.grpc.pb.h")
add_custom_command(
OUTPUT "${hw_proto_srcs}" "${hw_proto_hdrs}" "${hw_grpc_srcs}" "${hw_grpc_hdrs}"
COMMAND ${_PROTOBUF_PROTOC}
ARGS --grpc_out "${CMAKE_CURRENT_BINARY_DIR}"
--cpp_out "${CMAKE_CURRENT_BINARY_DIR}"
-I "${hw_proto_path}"
--plugin=protoc-gen-grpc="${_GRPC_CPP_PLUGIN_EXECUTABLE}"
"${hw_proto}"
DEPENDS "${hw_proto}")
# Include generated *.pb.h files
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
# hw_grpc_proto
add_library(hw_grpc_proto
${hw_grpc_srcs}
${hw_grpc_hdrs}
${hw_proto_srcs}
${hw_proto_hdrs})
target_link_libraries(hw_grpc_proto
${_REFLECTION}
${_GRPC_GRPCPP}
${_PROTOBUF_LIBPROTOBUF})
# Targets greeter_[async_](client|server)
foreach(_target
greeter_client greeter_server
greeter_async_client greeter_async_client2 greeter_async_server)
add_executable(${_target} "${_target}.cc")
target_link_libraries(${_target}
hw_grpc_proto
${_REFLECTION}
${_GRPC_GRPCPP}
${_PROTOBUF_LIBPROTOBUF})
endforeach()

@ -0,0 +1,80 @@
# Copyright 2018 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# cmake build file for C++ route_guide example.
# Assumes protobuf and gRPC have been installed using cmake.
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building route_guide.
cmake_minimum_required(VERSION 3.5.1)
project(RouteGuide C CXX)
include(../cmake/common.cmake)
# Proto file
get_filename_component(rg_proto "../../protos/route_guide.proto" ABSOLUTE)
get_filename_component(rg_proto_path "${rg_proto}" PATH)
# Generated sources
set(rg_proto_srcs "${CMAKE_CURRENT_BINARY_DIR}/route_guide.pb.cc")
set(rg_proto_hdrs "${CMAKE_CURRENT_BINARY_DIR}/route_guide.pb.h")
set(rg_grpc_srcs "${CMAKE_CURRENT_BINARY_DIR}/route_guide.grpc.pb.cc")
set(rg_grpc_hdrs "${CMAKE_CURRENT_BINARY_DIR}/route_guide.grpc.pb.h")
add_custom_command(
OUTPUT "${rg_proto_srcs}" "${rg_proto_hdrs}" "${rg_grpc_srcs}" "${rg_grpc_hdrs}"
COMMAND ${_PROTOBUF_PROTOC}
ARGS --grpc_out "${CMAKE_CURRENT_BINARY_DIR}"
--cpp_out "${CMAKE_CURRENT_BINARY_DIR}"
-I "${rg_proto_path}"
--plugin=protoc-gen-grpc="${_GRPC_CPP_PLUGIN_EXECUTABLE}"
"${rg_proto}"
DEPENDS "${rg_proto}")
# Include generated *.pb.h files
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
# rg_grpc_proto
add_library(rg_grpc_proto
${rg_grpc_srcs}
${rg_grpc_hdrs}
${rg_proto_srcs}
${rg_proto_hdrs})
target_link_libraries(rg_grpc_proto
${_REFLECTION}
${_GRPC_GRPCPP}
${_PROTOBUF_LIBPROTOBUF})
# route_guide_helper
add_library(route_guide_helper
"helper.h"
"helper.cc")
target_link_libraries(route_guide_helper
rg_grpc_proto
${_REFLECTION}
${_GRPC_GRPCPP}
${_PROTOBUF_LIBPROTOBUF})
# Targets route_guide_(client|server)
foreach(_target
route_guide_client route_guide_server)
add_executable(${_target}
"${_target}.cc")
target_link_libraries(${_target}
rg_grpc_proto
route_guide_helper
${_REFLECTION}
${_GRPC_GRPCPP}
${_PROTOBUF_LIBPROTOBUF})
endforeach()

@ -25,8 +25,8 @@ import phone_pb2
import phone_pb2_grpc
def create_state_response(call_state: phone_pb2.CallState.State
) -> phone_pb2.StreamCallResponse:
def create_state_response(
call_state: phone_pb2.CallState.State) -> phone_pb2.StreamCallResponse:
response = phone_pb2.StreamCallResponse()
response.call_state.state = call_state
return response
@ -50,10 +50,10 @@ class Phone(phone_pb2_grpc.PhoneServicer):
def _clean_call_session(self, call_info: phone_pb2.CallInfo) -> None:
logging.info("Call session cleaned [%s]", MessageToJson(call_info))
def StreamCall(self,
request_iterator: Iterable[phone_pb2.StreamCallRequest],
context: grpc.ServicerContext
) -> Iterable[phone_pb2.StreamCallResponse]:
def StreamCall(
self, request_iterator: Iterable[phone_pb2.StreamCallRequest],
context: grpc.ServicerContext
) -> Iterable[phone_pb2.StreamCallResponse]:
try:
request = next(request_iterator)
logging.info("Received a phone call request for number [%s]",

@ -42,8 +42,8 @@ class SignatureValidationInterceptor(grpc.aio.ServerInterceptor):
self._abort_handler = grpc.unary_unary_rpc_method_handler(abort)
async def intercept_service(
self, continuation: Callable[[grpc.HandlerCallDetails], Awaitable[
grpc.RpcMethodHandler]],
self, continuation: Callable[[grpc.HandlerCallDetails],
Awaitable[grpc.RpcMethodHandler]],
handler_call_details: grpc.HandlerCallDetails
) -> grpc.RpcMethodHandler:
# Example HandlerCallDetails object:

@ -37,9 +37,9 @@ class FaultInjectGreeter(helloworld_pb2_grpc.GreeterServicer):
def __init__(self, failure_rate):
self._failure_rate = failure_rate
async def SayHello(self, request: helloworld_pb2.HelloRequest,
context: grpc.aio.ServicerContext
) -> helloworld_pb2.HelloReply:
async def SayHello(
self, request: helloworld_pb2.HelloRequest,
context: grpc.aio.ServicerContext) -> helloworld_pb2.HelloReply:
if random.random() < self._failure_rate:
context.abort(grpc.StatusCode.UNAVAILABLE,
'Randomly injected failure.')

@ -23,9 +23,9 @@ import helloworld_pb2_grpc
class Greeter(helloworld_pb2_grpc.GreeterServicer):
async def SayHello(self, request: helloworld_pb2.HelloRequest,
context: grpc.aio.ServicerContext
) -> helloworld_pb2.HelloReply:
async def SayHello(
self, request: helloworld_pb2.HelloRequest,
context: grpc.aio.ServicerContext) -> helloworld_pb2.HelloReply:
return helloworld_pb2.HelloReply(message='Hello, %s!' % request.name)

@ -25,9 +25,9 @@ import helloworld_pb2_grpc
class Greeter(helloworld_pb2_grpc.GreeterServicer):
async def SayHello(self, request: helloworld_pb2.HelloRequest,
context: grpc.aio.ServicerContext
) -> helloworld_pb2.HelloReply:
async def SayHello(
self, request: helloworld_pb2.HelloRequest,
context: grpc.aio.ServicerContext) -> helloworld_pb2.HelloReply:
return helloworld_pb2.HelloReply(message='Hello, %s!' % request.name)

@ -54,8 +54,8 @@ async def guide_get_feature(stub: route_guide_pb2_grpc.RouteGuideStub) -> None:
# Performs a server-streaming call
async def guide_list_features(stub: route_guide_pb2_grpc.RouteGuideStub
) -> None:
async def guide_list_features(
stub: route_guide_pb2_grpc.RouteGuideStub) -> None:
rectangle = route_guide_pb2.Rectangle(
lo=route_guide_pb2.Point(latitude=400000000, longitude=-750000000),
hi=route_guide_pb2.Point(latitude=420000000, longitude=-730000000))
@ -67,8 +67,9 @@ async def guide_list_features(stub: route_guide_pb2_grpc.RouteGuideStub
print(f"Feature called {feature.name} at {feature.location}")
def generate_route(feature_list: List[route_guide_pb2.Feature]
) -> Iterable[route_guide_pb2.Point]:
def generate_route(
feature_list: List[route_guide_pb2.Feature]
) -> Iterable[route_guide_pb2.Point]:
for _ in range(0, 10):
random_feature = random.choice(feature_list)
print(f"Visiting point {random_feature.location}")

@ -72,9 +72,9 @@ class RouteGuideServicer(route_guide_pb2_grpc.RouteGuideServicer):
else:
return feature
async def ListFeatures(self, request: route_guide_pb2.Rectangle,
unused_context
) -> AsyncIterable[route_guide_pb2.Feature]:
async def ListFeatures(
self, request: route_guide_pb2.Rectangle,
unused_context) -> AsyncIterable[route_guide_pb2.Feature]:
left = min(request.lo.longitude, request.hi.longitude)
right = max(request.lo.longitude, request.hi.longitude)
top = max(request.lo.latitude, request.hi.latitude)
@ -86,9 +86,8 @@ class RouteGuideServicer(route_guide_pb2_grpc.RouteGuideServicer):
feature.location.latitude <= top):
yield feature
async def RecordRoute(
self, request_iterator: AsyncIterable[route_guide_pb2.Point],
unused_context) -> route_guide_pb2.RouteSummary:
async def RecordRoute(self, request_iterator: AsyncIterable[
route_guide_pb2.Point], unused_context) -> route_guide_pb2.RouteSummary:
point_count = 0
feature_count = 0
distance = 0.0

@ -22,7 +22,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC-C++'
# TODO (mxyan): use version that match gRPC version when pod is stabilized
version = '1.35.0-pre1'
version = '1.36.0-dev'
s.version = version
s.summary = 'gRPC C++ library'
s.homepage = 'https://grpc.io'
@ -185,7 +185,7 @@ Pod::Spec.new do |s|
ss.header_mappings_dir = '.'
ss.dependency "#{s.name}/Interface", version
ss.dependency 'gRPC-Core', version
abseil_version = '1.20200923.2'
abseil_version = '1.20200923.3'
ss.dependency 'abseil/base/base', abseil_version
ss.dependency 'abseil/container/flat_hash_map', abseil_version
ss.dependency 'abseil/container/flat_hash_set', abseil_version
@ -314,6 +314,7 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h',
'src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h',
'src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h',
'src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h',
@ -400,6 +401,7 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h',
@ -516,6 +518,7 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/stat.h',
'src/core/lib/gprpp/sync.h',
'src/core/lib/gprpp/thd.h',
'src/core/lib/gprpp/time_util.h',
'src/core/lib/http/format_request.h',
'src/core/lib/http/httpcli.h',
'src/core/lib/http/parser.h',
@ -548,7 +551,6 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/iomgr.h',
'src/core/lib/iomgr/iomgr_custom.h',
'src/core/lib/iomgr/iomgr_internal.h',
'src/core/lib/iomgr/iomgr_posix.h',
'src/core/lib/iomgr/is_epollexclusive_available.h',
'src/core/lib/iomgr/load_file.h',
'src/core/lib/iomgr/lockfree_event.h',
@ -602,6 +604,7 @@ Pod::Spec.new do |s|
'src/core/lib/profiling/timers.h',
'src/core/lib/security/authorization/authorization_engine.h',
'src/core/lib/security/authorization/evaluate_args.h',
'src/core/lib/security/authorization/matchers.h',
'src/core/lib/security/authorization/mock_cel/activation.h',
'src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h',
'src/core/lib/security/authorization/mock_cel/cel_expression.h',
@ -932,6 +935,7 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h',
'src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h',
'src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h',
'src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h',
@ -1018,6 +1022,7 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h',
@ -1134,6 +1139,7 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/stat.h',
'src/core/lib/gprpp/sync.h',
'src/core/lib/gprpp/thd.h',
'src/core/lib/gprpp/time_util.h',
'src/core/lib/http/format_request.h',
'src/core/lib/http/httpcli.h',
'src/core/lib/http/parser.h',
@ -1166,7 +1172,6 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/iomgr.h',
'src/core/lib/iomgr/iomgr_custom.h',
'src/core/lib/iomgr/iomgr_internal.h',
'src/core/lib/iomgr/iomgr_posix.h',
'src/core/lib/iomgr/is_epollexclusive_available.h',
'src/core/lib/iomgr/load_file.h',
'src/core/lib/iomgr/lockfree_event.h',
@ -1220,6 +1225,7 @@ Pod::Spec.new do |s|
'src/core/lib/profiling/timers.h',
'src/core/lib/security/authorization/authorization_engine.h',
'src/core/lib/security/authorization/evaluate_args.h',
'src/core/lib/security/authorization/matchers.h',
'src/core/lib/security/authorization/mock_cel/activation.h',
'src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h',
'src/core/lib/security/authorization/mock_cel/cel_expression.h',
@ -1416,7 +1422,7 @@ Pod::Spec.new do |s|
end
s.prepare_command = <<-END_OF_COMMAND
sed -E -i '' 's;#include <openssl/(.*)>;#if COCOAPODS==1\\\n #include <openssl_grpc/\\1>\\\n#else\\\n #include <openssl/\\1>\\\n#endif;g' $(find src/core -type f \\( -path '*.h' -or -path '*.cc' \\) -print | xargs grep -H -c '#include <openssl_grpc/' | grep 0$ | cut -d':' -f1)
find src/core -type f \\( -path '*.h' -or -path '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include <openssl/(.*)>;#if COCOAPODS==1\\\n #include <openssl_grpc/\\1>\\\n#else\\\n #include <openssl/\\1>\\\n#endif;g'
find third_party/upb/ -type f \\( -name '*.h' -or -name '*.hpp' -or -name '*.c' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "third_party/(.*)";#if COCOAPODS==1\\\n #include "third_party/upb/third_party/\\1"\\\n#else\\\n #include "third_party/\\1"\\\n#endif;g'
find src/core/ src/cpp/ third_party/upb/ -type f \\( -name '*.h' -or -name '*.hpp' -or -name '*.c' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "upb/(.*)";#if COCOAPODS==1\\\n #include "third_party/upb/upb/\\1"\\\n#else\\\n #include "upb/\\1"\\\n#endif;g'
find src/core/ src/cpp/ third_party/upb/ -type f -name '*.grpc_back' -print0 | xargs -0 rm

@ -21,7 +21,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC-Core'
version = '1.35.0-pre1'
version = '1.36.0-dev'
s.version = version
s.summary = 'Core cross-platform gRPC library, written in C'
s.homepage = 'https://grpc.io'
@ -46,7 +46,7 @@ Pod::Spec.new do |s|
s.requires_arc = false
name = 'grpc'
abseil_version = '1.20200923.2'
abseil_version = '1.20200923.3'
# When creating a dynamic framework, name it grpc.framework instead of gRPC-Core.framework.
# This lets users write their includes like `#include <grpc/grpc.h>` as opposed to `#include
@ -269,6 +269,7 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc',
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc',
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h',
'src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc',
'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc',
'src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc',
'src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h',
@ -439,6 +440,8 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h',
'src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c',
'src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h',
'src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c',
'src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c',
'src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c',
@ -611,6 +614,8 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c',
@ -847,6 +852,8 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/thd.h',
'src/core/lib/gprpp/thd_posix.cc',
'src/core/lib/gprpp/thd_windows.cc',
'src/core/lib/gprpp/time_util.cc',
'src/core/lib/gprpp/time_util.h',
'src/core/lib/http/format_request.cc',
'src/core/lib/http/format_request.h',
'src/core/lib/http/httpcli.cc',
@ -918,7 +925,6 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/iomgr_internal.cc',
'src/core/lib/iomgr/iomgr_internal.h',
'src/core/lib/iomgr/iomgr_posix.cc',
'src/core/lib/iomgr/iomgr_posix.h',
'src/core/lib/iomgr/iomgr_posix_cfstream.cc',
'src/core/lib/iomgr/iomgr_uv.cc',
'src/core/lib/iomgr/iomgr_windows.cc',
@ -1040,6 +1046,8 @@ Pod::Spec.new do |s|
'src/core/lib/security/authorization/authorization_engine.h',
'src/core/lib/security/authorization/evaluate_args.cc',
'src/core/lib/security/authorization/evaluate_args.h',
'src/core/lib/security/authorization/matchers.cc',
'src/core/lib/security/authorization/matchers.h',
'src/core/lib/security/authorization/mock_cel/activation.h',
'src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h',
'src/core/lib/security/authorization/mock_cel/cel_expression.h',
@ -1463,6 +1471,7 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h',
'src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h',
'src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h',
'src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h',
@ -1549,6 +1558,7 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h',
@ -1665,6 +1675,7 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/stat.h',
'src/core/lib/gprpp/sync.h',
'src/core/lib/gprpp/thd.h',
'src/core/lib/gprpp/time_util.h',
'src/core/lib/http/format_request.h',
'src/core/lib/http/httpcli.h',
'src/core/lib/http/parser.h',
@ -1697,7 +1708,6 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/iomgr.h',
'src/core/lib/iomgr/iomgr_custom.h',
'src/core/lib/iomgr/iomgr_internal.h',
'src/core/lib/iomgr/iomgr_posix.h',
'src/core/lib/iomgr/is_epollexclusive_available.h',
'src/core/lib/iomgr/load_file.h',
'src/core/lib/iomgr/lockfree_event.h',
@ -1751,6 +1761,7 @@ Pod::Spec.new do |s|
'src/core/lib/profiling/timers.h',
'src/core/lib/security/authorization/authorization_engine.h',
'src/core/lib/security/authorization/evaluate_args.h',
'src/core/lib/security/authorization/matchers.h',
'src/core/lib/security/authorization/mock_cel/activation.h',
'src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h',
'src/core/lib/security/authorization/mock_cel/cel_expression.h',
@ -2086,7 +2097,7 @@ Pod::Spec.new do |s|
# TODO (mxyan): Instead of this hack, add include path "third_party" to C core's include path?
s.prepare_command = <<-END_OF_COMMAND
sed -E -i '' 's;#include <openssl/(.*)>;#if COCOAPODS==1\\\n #include <openssl_grpc/\\1>\\\n#else\\\n #include <openssl/\\1>\\\n#endif;g' $(find src/core -type f \\( -path '*.h' -or -path '*.cc' \\) -print | xargs grep -H -c '#include <openssl_grpc/' | grep 0$ | cut -d':' -f1)
find src/core -type f \\( -path '*.h' -or -path '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include <openssl/(.*)>;#if COCOAPODS==1\\\n #include <openssl_grpc/\\1>\\\n#else\\\n #include <openssl/\\1>\\\n#endif;g'
find third_party/upb/ -type f \\( -name '*.h' -or -name '*.hpp' -or -name '*.c' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "third_party/(.*)";#if COCOAPODS==1\\\n #include "third_party/upb/third_party/\\1"\\\n#else\\\n #include "third_party/\\1"\\\n#endif;g'
find src/core/ src/cpp/ third_party/upb/ -type f \\( -name '*.h' -or -name '*.hpp' -or -name '*.c' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "upb/(.*)";#if COCOAPODS==1\\\n #include "third_party/upb/upb/\\1"\\\n#else\\\n #include "upb/\\1"\\\n#endif;g'
find src/core/ src/cpp/ third_party/upb/ -type f -name '*.grpc_back' -print0 | xargs -0 rm

@ -21,7 +21,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC-ProtoRPC'
version = '1.35.0-pre1'
version = '1.36.0-dev'
s.version = version
s.summary = 'RPC library for Protocol Buffers, based on gRPC'
s.homepage = 'https://grpc.io'

@ -21,7 +21,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC-RxLibrary'
version = '1.35.0-pre1'
version = '1.36.0-dev'
s.version = version
s.summary = 'Reactive Extensions library for iOS/OSX.'
s.homepage = 'https://grpc.io'

@ -20,7 +20,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC'
version = '1.35.0-pre1'
version = '1.36.0-dev'
s.version = version
s.summary = 'gRPC client library for iOS/OSX'
s.homepage = 'https://grpc.io'

@ -13,7 +13,7 @@ Gem::Specification.new do |s|
s.description = 'Send RPCs from Ruby using GRPC'
s.license = 'Apache-2.0'
s.required_ruby_version = '>= 2.3.0'
s.required_ruby_version = '>= 2.4.0'
s.files = %w( Makefile .yardopts )
s.files += %w( etc/roots.pem )
@ -32,7 +32,7 @@ Gem::Specification.new do |s|
s.require_paths = %w( src/ruby/lib src/ruby/bin src/ruby/pb )
s.platform = Gem::Platform::RUBY
s.add_dependency 'google-protobuf', '~> 3.13'
s.add_dependency 'google-protobuf', '~> 3.14'
s.add_dependency 'googleapis-common-protos-types', '~> 1.0'
s.add_development_dependency 'bundler', '>= 1.9'
@ -184,6 +184,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h )
s.files += %w( src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h )
@ -354,6 +355,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c )
@ -526,6 +529,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c )
@ -762,6 +767,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/gprpp/thd.h )
s.files += %w( src/core/lib/gprpp/thd_posix.cc )
s.files += %w( src/core/lib/gprpp/thd_windows.cc )
s.files += %w( src/core/lib/gprpp/time_util.cc )
s.files += %w( src/core/lib/gprpp/time_util.h )
s.files += %w( src/core/lib/http/format_request.cc )
s.files += %w( src/core/lib/http/format_request.h )
s.files += %w( src/core/lib/http/httpcli.cc )
@ -833,7 +840,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/iomgr/iomgr_internal.cc )
s.files += %w( src/core/lib/iomgr/iomgr_internal.h )
s.files += %w( src/core/lib/iomgr/iomgr_posix.cc )
s.files += %w( src/core/lib/iomgr/iomgr_posix.h )
s.files += %w( src/core/lib/iomgr/iomgr_posix_cfstream.cc )
s.files += %w( src/core/lib/iomgr/iomgr_uv.cc )
s.files += %w( src/core/lib/iomgr/iomgr_windows.cc )
@ -955,6 +961,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/security/authorization/authorization_engine.h )
s.files += %w( src/core/lib/security/authorization/evaluate_args.cc )
s.files += %w( src/core/lib/security/authorization/evaluate_args.h )
s.files += %w( src/core/lib/security/authorization/matchers.cc )
s.files += %w( src/core/lib/security/authorization/matchers.h )
s.files += %w( src/core/lib/security/authorization/mock_cel/activation.h )
s.files += %w( src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h )
s.files += %w( src/core/lib/security/authorization/mock_cel/cel_expression.h )

@ -431,6 +431,7 @@
'src/core/lib/gprpp/stat_windows.cc',
'src/core/lib/gprpp/thd_posix.cc',
'src/core/lib/gprpp/thd_windows.cc',
'src/core/lib/gprpp/time_util.cc',
'src/core/lib/profiling/basic_timers.cc',
'src/core/lib/profiling/stap_timers.cc',
],
@ -498,6 +499,7 @@
'src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc',
'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc',
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc',
'src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc',
'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc',
'src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc',
'src/core/ext/filters/client_channel/resolver_registry.cc',
@ -588,6 +590,7 @@
'src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c',
'src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c',
'src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c',
'src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c',
'src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c',
@ -673,6 +676,7 @@
'src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c',
@ -701,7 +705,6 @@
'src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c',
'src/core/ext/upbdefs-generated/google/api/http.upbdefs.c',
'src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c',
'src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c',
'src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c',
'src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c',
'src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c',
@ -856,6 +859,7 @@
'src/core/lib/json/json_writer.cc',
'src/core/lib/security/authorization/authorization_engine.cc',
'src/core/lib/security/authorization/evaluate_args.cc',
'src/core/lib/security/authorization/matchers.cc',
'src/core/lib/security/context/security_context.cc',
'src/core/lib/security/credentials/alts/alts_credentials.cc',
'src/core/lib/security/credentials/alts/check_gcp_environment.cc',
@ -1470,7 +1474,6 @@
'upb',
],
'sources': [
'src/proto/grpc/status/status.proto',
'src/cpp/util/error_details.cc',
],
},
@ -1984,20 +1987,8 @@
'third_party/upb/upb/table.c',
'third_party/upb/upb/text_encode.c',
'third_party/upb/upb/upb.c',
'src/core/ext/upb-generated/google/protobuf/any.upb.c',
'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c',
'src/core/ext/upb-generated/google/protobuf/duration.upb.c',
'src/core/ext/upb-generated/google/protobuf/empty.upb.c',
'src/core/ext/upb-generated/google/protobuf/struct.upb.c',
'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c',
'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c',
'src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c',
'src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c',
'src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c',
'src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c',
'src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c',
'src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c',
'src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c',
],
},
{

@ -856,8 +856,8 @@ GRPCAPI grpc_tls_credentials_options* grpc_tls_credentials_options_create(void);
/**
* Sets the options of whether to request and verify client certs. This should
* be called only on the server side. It returns 1 on success and 0 on failure.
* It is used for experimental purpose for now and subject to change.
* be called only on the server side. It is used for experimental purpose for
* now and subject to change.
*/
GRPCAPI void grpc_tls_credentials_options_set_cert_request_type(
grpc_tls_credentials_options* options,
@ -868,8 +868,7 @@ GRPCAPI void grpc_tls_credentials_options_set_cert_request_type(
* hostname check, etc. This should be called only on the client side. If
* |server_verification_option| is not GRPC_TLS_SERVER_VERIFICATION, use of a
* custom authorization check (grpc_tls_server_authorization_check_config) is
* mandatory. It returns 1 on success and 0 on failure. It is used for
* experimental purpose for now and subject to change.
* mandatory. It is used for experimental purpose for now and subject to change.
*/
GRPCAPI void grpc_tls_credentials_options_set_server_verification_option(
grpc_tls_credentials_options* options,
@ -878,7 +877,6 @@ GRPCAPI void grpc_tls_credentials_options_set_server_verification_option(
/**
* Sets the credential provider in the options.
* The |options| will implicitly take a new ref to the |provider|.
* It returns 1 on success and 0 on failure.
* It is used for experimental purpose for now and subject to change.
*/
GRPCAPI void grpc_tls_credentials_options_set_certificate_provider(
@ -887,8 +885,14 @@ GRPCAPI void grpc_tls_credentials_options_set_certificate_provider(
/**
* If set, gRPC stack will keep watching the root certificates with
* name |root_cert_name|. It returns 1 on success and 0 on failure. It is used
* for experimental purpose for now and subject to change.
* name |root_cert_name|.
* If this is not set on the client side, we will use the root certificates
* stored in the default system location, since client side must provide root
* certificates in TLS.
* If this is not set on the server side, we will not watch any root certificate
* updates, and assume no root certificates needed for the server(single-side
* TLS). Default root certs on the server side is not supported.
* It is used for experimental purpose for now and subject to change.
*/
GRPCAPI void grpc_tls_credentials_options_watch_root_certs(
grpc_tls_credentials_options* options);
@ -903,8 +907,9 @@ GRPCAPI void grpc_tls_credentials_options_set_root_cert_name(
/**
* If set, gRPC stack will keep watching the identity key-cert pairs
* with name |identity_cert_name|. It returns 1 on success and 0 on failure. It
* is used for experimental purpose for now and subject to change.
* with name |identity_cert_name|.
* This is required on the server side, and optional on the client side.
* It is used for experimental purpose for now and subject to change.
*/
GRPCAPI void grpc_tls_credentials_options_watch_identity_key_cert_pairs(
grpc_tls_credentials_options* options);
@ -920,8 +925,8 @@ GRPCAPI void grpc_tls_credentials_options_set_identity_cert_name(
/**
* Sets the configuration for a custom authorization check performed at the end
* of the handshake. The |options| will implicitly take a new ref to the
* |config|. It returns 1 on success and 0 on failure. It is used for
* experimental purpose for now and subject to change.
* |config|.
* It is used for experimental purpose for now and subject to change.
*/
GRPCAPI void grpc_tls_credentials_options_set_server_authorization_check_config(
grpc_tls_credentials_options* options,

@ -250,7 +250,7 @@ class ClientAsyncResponseReader final
initial_metadata_read_ = true;
}
/// See \a ClientAysncResponseReaderInterface::Finish for semantics.
/// See \a ClientAsyncResponseReaderInterface::Finish for semantics.
///
/// Side effect:
/// - the \a ClientContext associated with this call is updated with

@ -86,7 +86,7 @@ class AuthContext {
/// Mutation functions: should only be used by an AuthMetadataProcessor.
virtual void AddProperty(const std::string& key, const string_ref& value) = 0;
virtual bool SetPeerIdentityPropertyName(const string& name) = 0;
virtual bool SetPeerIdentityPropertyName(const std::string& name) = 0;
};
} // namespace grpc

@ -210,6 +210,9 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler {
grpc_call* call = call_.call();
auto call_requester = std::move(call_requester_);
allocator_state_->Release();
if (ctx_->context_allocator() != nullptr) {
ctx_->context_allocator()->Release(ctx_);
}
this->~ServerCallbackUnaryImpl(); // explicitly call destructor
::grpc::g_core_codegen_interface->grpc_call_unref(call);
call_requester();
@ -402,6 +405,9 @@ class CallbackClientStreamingHandler : public ::grpc::internal::MethodHandler {
reactor_.load(std::memory_order_relaxed)->OnDone();
grpc_call* call = call_.call();
auto call_requester = std::move(call_requester_);
if (ctx_->context_allocator() != nullptr) {
ctx_->context_allocator()->Release(ctx_);
}
this->~ServerCallbackReaderImpl(); // explicitly call destructor
::grpc::g_core_codegen_interface->grpc_call_unref(call);
call_requester();
@ -616,7 +622,11 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler {
// DefaultReactor (which is unary).
this->MaybeDone(/*inlineable_ondone=*/false);
}
~ServerCallbackWriterImpl() { req_->~RequestType(); }
~ServerCallbackWriterImpl() {
if (req_ != nullptr) {
req_->~RequestType();
}
}
const RequestType* request() { return req_; }
@ -624,6 +634,9 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler {
reactor_.load(std::memory_order_relaxed)->OnDone();
grpc_call* call = call_.call();
auto call_requester = std::move(call_requester_);
if (ctx_->context_allocator() != nullptr) {
ctx_->context_allocator()->Release(ctx_);
}
this->~ServerCallbackWriterImpl(); // explicitly call destructor
::grpc::g_core_codegen_interface->grpc_call_unref(call);
call_requester();
@ -835,6 +848,9 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler {
reactor_.load(std::memory_order_relaxed)->OnDone();
grpc_call* call = call_.call();
auto call_requester = std::move(call_requester_);
if (ctx_->context_allocator() != nullptr) {
ctx_->context_allocator()->Release(ctx_);
}
this->~ServerCallbackReaderWriterImpl(); // explicitly call destructor
::grpc::g_core_codegen_interface->grpc_call_unref(call);
call_requester();

@ -100,6 +100,7 @@ class CompletionQueue;
class GenericServerContext;
class Server;
class ServerInterface;
class ContextAllocator;
// TODO(vjpai): Remove namespace experimental when de-experimentalized fully.
namespace experimental {
@ -340,6 +341,12 @@ class ServerContextBase {
ServerContextBase();
ServerContextBase(gpr_timespec deadline, grpc_metadata_array* arr);
void set_context_allocator(ContextAllocator* context_allocator) {
context_allocator_ = context_allocator;
}
ContextAllocator* context_allocator() const { return context_allocator_; }
private:
friend class ::grpc::testing::InteropServerContextInspector;
friend class ::grpc::testing::ServerContextTestSpouse;
@ -463,6 +470,7 @@ class ServerContextBase {
::grpc::experimental::ServerRpcInfo* rpc_info_ = nullptr;
::grpc::experimental::RpcAllocatorState* message_allocator_state_ = nullptr;
ContextAllocator* context_allocator_ = nullptr;
class Reactor : public ::grpc::ServerUnaryReactor {
public:
@ -590,12 +598,14 @@ class CallbackServerContext : public ServerContextBase {
using ServerContextBase::compression_algorithm;
using ServerContextBase::compression_level;
using ServerContextBase::compression_level_set;
using ServerContextBase::context_allocator;
using ServerContextBase::deadline;
using ServerContextBase::IsCancelled;
using ServerContextBase::peer;
using ServerContextBase::raw_deadline;
using ServerContextBase::set_compression_algorithm;
using ServerContextBase::set_compression_level;
using ServerContextBase::set_context_allocator;
using ServerContextBase::SetLoadReportingCosts;
using ServerContextBase::TryCancel;
@ -612,6 +622,37 @@ class CallbackServerContext : public ServerContextBase {
CallbackServerContext& operator=(const CallbackServerContext&) = delete;
};
/// A CallbackServerContext allows users to use the contents of the
/// CallbackServerContext or GenericCallbackServerContext structure for the
/// callback API.
/// The library will invoke the allocator any time a new call is initiated.
/// and call the Release method after the server OnDone.
class ContextAllocator {
public:
virtual ~ContextAllocator() {}
virtual CallbackServerContext* NewCallbackServerContext() { return nullptr; }
#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
virtual experimental::GenericCallbackServerContext*
NewGenericCallbackServerContext() {
return nullptr;
}
#else
virtual GenericCallbackServerContext* NewGenericCallbackServerContext() {
return nullptr;
}
#endif
virtual void Release(CallbackServerContext*) {}
#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
virtual void Release(experimental::GenericCallbackServerContext*) {}
#else
virtual void Release(GenericCallbackServerContext*) {}
#endif
};
} // namespace grpc
static_assert(

@ -147,6 +147,8 @@ class ServerInterface : public internal::CallHook {
/// May not be abstract since this is a post-1.0 API addition
virtual void RegisterCallbackGenericService(
experimental::CallbackGenericService* /*service*/) {}
virtual void RegisterContextAllocator(
std::unique_ptr<ContextAllocator> context_allocator) {}
};
/// NOTE: The function experimental_registration() is not stable public API.

@ -67,9 +67,10 @@ std::shared_ptr<ServerCredentials> XdsServerCredentials(
} // namespace experimental
/// Wrapper around \a grpc_server_credentials, a way to authenticate a server.
class ServerCredentials {
class ServerCredentials : private grpc::GrpcLibraryCodegen {
public:
virtual ~ServerCredentials();
ServerCredentials();
~ServerCredentials() override;
/// This method is not thread-safe and has to be called before the server is
/// started. The last call to this function wins.

@ -155,13 +155,21 @@ class TlsCredentialsOptions {
//
// @param certificate_provider the provider which fetches TLS credentials that
// will be used in the TLS handshake
explicit TlsCredentialsOptions(
std::shared_ptr<CertificateProviderInterface> certificate_provider);
TlsCredentialsOptions();
// ---- Setters for member fields ----
// Sets the certificate provider used to store root certs and identity certs.
void set_certificate_provider(
std::shared_ptr<CertificateProviderInterface> certificate_provider);
// Watches the updates of root certificates with name |root_cert_name|.
// If used in TLS credentials, it should always be set unless the root
// certificates are not needed(e.g. in the one-side TLS scenario, the server
// is not required to verify the client).
// If used in TLS credentials, setting this field is optional for both the
// client side and the server side.
// If this is not set on the client side, we will use the root certificates
// stored in the default system location, since client side must provide root
// certificates in TLS(no matter single-side TLS or mutual TLS).
// If this is not set on the server side, we will not watch any root
// certificate updates, and assume no root certificates needed for the server
// (in the one-side TLS scenario, the server is not required to provide root
// certs). We don't support default root certs on server side.
void watch_root_certs();
// Sets the name of root certificates being watched, if |watch_root_certs| is
// called. If not set, an empty string will be used as the name.
@ -169,9 +177,9 @@ class TlsCredentialsOptions {
// @param root_cert_name the name of root certs being set.
void set_root_cert_name(const std::string& root_cert_name);
// Watches the updates of identity key-cert pairs with name
// |identity_cert_name|. If used in TLS credentials, it should always be set
// unless the identity certificates are not needed(e.g. in the one-side TLS
// scenario, the client is not required to provide certs).
// |identity_cert_name|. If used in TLS credentials, it is required to be set
// on the server side, and optional for the client side(in the one-side
// TLS scenario, the client is not required to provide identity certs).
void watch_identity_key_cert_pairs();
// Sets the name of identity key-cert pairs being watched, if
// |watch_identity_key_cert_pairs| is called. If not set, an empty string will
@ -192,13 +200,13 @@ class TlsCredentialsOptions {
};
// Contains configurable options on the client side.
// Client side doesn't need to always use certificate provider. When the
// certificate provider is not set, we will use the root certificates stored
// in the system default locations, and assume client won't provide any
// identity certificates(single side TLS).
// It is used for experimental purposes for now and it is subject to change.
class TlsChannelCredentialsOptions final : public TlsCredentialsOptions {
public:
explicit TlsChannelCredentialsOptions(
std::shared_ptr<CertificateProviderInterface> certificate_provider)
: TlsCredentialsOptions(std::move(certificate_provider)) {}
// Sets the option to verify the server.
// The default is GRPC_TLS_SERVER_VERIFICATION.
void set_server_verification_option(
@ -215,9 +223,13 @@ class TlsChannelCredentialsOptions final : public TlsCredentialsOptions {
// It is used for experimental purposes for now and it is subject to change.
class TlsServerCredentialsOptions final : public TlsCredentialsOptions {
public:
// Server side is required to use a provider, because server always needs to
// use identity certs.
explicit TlsServerCredentialsOptions(
std::shared_ptr<CertificateProviderInterface> certificate_provider)
: TlsCredentialsOptions(std::move(certificate_provider)) {}
: TlsCredentialsOptions() {
set_certificate_provider(certificate_provider);
}
// Sets option to request the certificates from the client.
// The default is GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE.

@ -203,6 +203,8 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
health_check_service_ = std::move(service);
}
ContextAllocator* context_allocator() { return context_allocator_.get(); }
/// NOTE: This method is not part of the public API for this class.
bool health_check_service_disabled() const {
return health_check_service_disabled_;
@ -240,6 +242,12 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
/// ownership of theservice. The service must exist for the lifetime of the
/// Server instance.
void RegisterCallbackGenericService(CallbackGenericService* service) override;
void RegisterContextAllocator(
std::unique_ptr<ContextAllocator> context_allocator) {
context_allocator_ = std::move(context_allocator);
}
#else
/// NOTE: class experimental_registration_type is not part of the public API
/// of this class
@ -254,6 +262,11 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
server_->RegisterCallbackGenericService(service);
}
void RegisterContextAllocator(
std::unique_ptr<ContextAllocator> context_allocator) override {
server_->context_allocator_ = std::move(context_allocator);
}
private:
Server* server_;
};
@ -342,6 +355,8 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
std::unique_ptr<ServerInitializer> server_initializer_;
std::unique_ptr<ContextAllocator> context_allocator_;
std::unique_ptr<HealthCheckServiceInterface> health_check_service_;
bool health_check_service_disabled_;

@ -269,6 +269,11 @@ class ServerBuilder {
builder_->interceptor_creators_ = std::move(interceptor_creators);
}
/// Set the allocator for creating and releasing callback server context.
/// Takes the owndership of the allocator.
ServerBuilder& SetContextAllocator(
std::unique_ptr<grpc::ContextAllocator> context_allocator);
#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
/// Register a generic service that uses the callback API.
/// Matches requests with any :authority
@ -389,6 +394,7 @@ class ServerBuilder {
std::vector<std::unique_ptr<grpc::ServerBuilderPlugin>> plugins_;
grpc_resource_quota* resource_quota_;
grpc::AsyncGenericService* generic_service_{nullptr};
std::unique_ptr<ContextAllocator> context_allocator_;
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
grpc::CallbackGenericService* callback_generic_service_{nullptr};
#else

@ -21,12 +21,6 @@
#include <grpcpp/support/status.h>
namespace google {
namespace rpc {
class Status;
} // namespace rpc
} // namespace google
namespace grpc {
/// Map a \a grpc::Status to a \a google::rpc::Status.
@ -34,14 +28,48 @@ namespace grpc {
/// On success, returns status with OK.
/// Returns status with \a INVALID_ARGUMENT, if failed to deserialize.
/// Returns status with \a FAILED_PRECONDITION, if \a to is nullptr.
grpc::Status ExtractErrorDetails(const grpc::Status& from,
::google::rpc::Status* to);
///
/// \note
/// This function is a template to avoid a build dep on \a status.proto.
/// However, this function still requires that \tparam T is of type
/// \a google::rpc::Status, which is defined at
/// https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto
template <typename T>
grpc::Status ExtractErrorDetails(const grpc::Status& from, T* to) {
if (to == nullptr) {
return grpc::Status(grpc::StatusCode::FAILED_PRECONDITION, "");
}
if (!to->ParseFromString(from.error_details())) {
return grpc::Status(grpc::StatusCode::INVALID_ARGUMENT, "");
}
return grpc::Status::OK;
}
inline grpc::Status ExtractErrorDetails(const grpc::Status&, std::nullptr_t) {
return grpc::Status(grpc::StatusCode::FAILED_PRECONDITION, "");
}
/// Map \a google::rpc::Status to a \a grpc::Status.
/// Returns OK on success.
/// Returns status with \a FAILED_PRECONDITION if \a to is nullptr.
grpc::Status SetErrorDetails(const ::google::rpc::Status& from,
grpc::Status* to);
///
/// \note
/// This function is a template to avoid a build dep on \a status.proto.
/// However, this function still requires that \tparam T is of type
/// \a google::rpc::Status, which is defined at
/// https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto
template <typename T>
grpc::Status SetErrorDetails(const T& from, grpc::Status* to) {
if (to == nullptr) {
return grpc::Status(grpc::StatusCode::FAILED_PRECONDITION, "");
}
grpc::StatusCode code = grpc::StatusCode::UNKNOWN;
if (from.code() >= grpc::StatusCode::OK &&
from.code() <= grpc::StatusCode::UNAUTHENTICATED) {
code = static_cast<grpc::StatusCode>(from.code());
}
*to = grpc::Status(code, from.message(), from.SerializeAsString());
return grpc::Status::OK;
}
} // namespace grpc

@ -13,8 +13,8 @@
<date>2019-09-24</date>
<time>16:06:07</time>
<version>
<release>1.35.0RC1</release>
<api>1.35.0RC1</api>
<release>1.36.0dev</release>
<api>1.36.0dev</api>
</version>
<stability>
<release>beta</release>
@ -22,7 +22,7 @@
</stability>
<license>Apache 2.0</license>
<notes>
- gRPC Core 1.35.0 update
- gRPC Core 1.36.0 update
</notes>
<contents>
<dir baseinstalldir="/" name="/">
@ -164,6 +164,7 @@
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h" role="src" />
@ -334,6 +335,8 @@
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c" role="src" />
@ -506,6 +509,8 @@
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c" role="src" />
@ -742,6 +747,8 @@
<file baseinstalldir="/" name="src/core/lib/gprpp/thd.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/thd_posix.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/thd_windows.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/time_util.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/time_util.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/http/format_request.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/http/format_request.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/http/httpcli.cc" role="src" />
@ -813,7 +820,6 @@
<file baseinstalldir="/" name="src/core/lib/iomgr/iomgr_internal.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/iomgr_internal.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/iomgr_posix.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/iomgr_posix.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/iomgr_posix_cfstream.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/iomgr_uv.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/iomgr_windows.cc" role="src" />
@ -935,6 +941,8 @@
<file baseinstalldir="/" name="src/core/lib/security/authorization/authorization_engine.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/authorization/evaluate_args.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/authorization/evaluate_args.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/authorization/matchers.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/authorization/matchers.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/authorization/mock_cel/activation.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/authorization/mock_cel/cel_expression.h" role="src" />

@ -1,15 +1,15 @@
# GRPC Python setup requirements
coverage>=4.0
cython>=0.29.8
enum34>=1.0.4
coverage==4.5.4
cython==0.29.21
enum34==1.1.10
protobuf>=3.5.0.post1, < 4.0dev
six>=1.10
wheel>=0.29
futures>=2.2.0
google-auth>=1.17.2
six==1.15.0
wheel==0.36.2
futures==3.1.1
google-auth==1.24.0
oauth2client==4.1.0
requests>=2.14.2
urllib3>=1.23
requests==2.25.1
urllib3==1.26.3
chardet==3.0.4
certifi==2017.4.17
idna==2.7

@ -354,14 +354,16 @@ if "linux" in sys.platform or "darwin" in sys.platform:
# By default, Python3 distutils enforces compatibility of
# c plugins (.so files) with the OSX version Python was built with.
# We need OSX 10.10, the oldest which supports C++ thread_local.
# Python 3.9: Mac OS Big Sur sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') returns int (11)
if 'darwin' in sys.platform:
mac_target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
if mac_target and (pkg_resources.parse_version(mac_target) <
pkg_resources.parse_version('10.10.0')):
os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.10'
os.environ['_PYTHON_HOST_PLATFORM'] = re.sub(
r'macosx-[0-9]+\.[0-9]+-(.+)', r'macosx-10.10-\1',
util.get_platform())
if mac_target:
mac_target = pkg_resources.parse_version(str(mac_target))
if mac_target < pkg_resources.parse_version('10.10.0'):
os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.10'
os.environ['_PYTHON_HOST_PLATFORM'] = re.sub(
r'macosx-[0-9]+\.[0-9]+-(.+)', r'macosx-10.10-\1',
util.get_platform())
def cython_extensions_and_necessity():

@ -51,7 +51,9 @@ Java_io_grpc_interop_cpp_InteropActivity_doEmpty(JNIEnv* env, jobject obj_this,
int port = static_cast<int>(port_raw);
bool use_tls = static_cast<bool>(use_tls_raw);
return GetClient(host, port, use_tls)->DoEmpty();
jboolean result = GetClient(host, port, use_tls)->DoEmpty();
env->ReleaseStringUTFChars(host_raw, host);
return result;
}
extern "C" JNIEXPORT jboolean JNICALL
@ -64,7 +66,9 @@ Java_io_grpc_interop_cpp_InteropActivity_doLargeUnary(JNIEnv* env,
int port = static_cast<int>(port_raw);
bool use_tls = static_cast<bool>(use_tls_raw);
return GetClient(host, port, use_tls)->DoLargeUnary();
jboolean result = GetClient(host, port, use_tls)->DoLargeUnary();
env->ReleaseStringUTFChars(host_raw, host);
return result;
}
extern "C" JNIEXPORT jboolean JNICALL
@ -77,7 +81,9 @@ Java_io_grpc_interop_cpp_InteropActivity_doEmptyStream(JNIEnv* env,
int port = static_cast<int>(port_raw);
bool use_tls = static_cast<bool>(use_tls_raw);
return GetClient(host, port, use_tls)->DoEmptyStream();
jboolean result = GetClient(host, port, use_tls)->DoEmptyStream();
env->ReleaseStringUTFChars(host_raw, host);
return result;
}
extern "C" JNIEXPORT jboolean JNICALL
@ -88,7 +94,9 @@ Java_io_grpc_interop_cpp_InteropActivity_doRequestStreaming(
int port = static_cast<int>(port_raw);
bool use_tls = static_cast<bool>(use_tls_raw);
return GetClient(host, port, use_tls)->DoRequestStreaming();
jboolean result = GetClient(host, port, use_tls)->DoRequestStreaming();
env->ReleaseStringUTFChars(host_raw, host);
return result;
}
extern "C" JNIEXPORT jboolean JNICALL
@ -99,7 +107,9 @@ Java_io_grpc_interop_cpp_InteropActivity_doResponseStreaming(
int port = static_cast<int>(port_raw);
bool use_tls = static_cast<bool>(use_tls_raw);
return GetClient(host, port, use_tls)->DoResponseStreaming();
jboolean result = GetClient(host, port, use_tls)->DoResponseStreaming();
env->ReleaseStringUTFChars(host_raw, host);
return result;
}
extern "C" JNIEXPORT jboolean JNICALL
@ -112,5 +122,7 @@ Java_io_grpc_interop_cpp_InteropActivity_doPingPong(JNIEnv* env,
int port = static_cast<int>(port_raw);
bool use_tls = static_cast<bool>(use_tls_raw);
return GetClient(host, port, use_tls)->DoPingPong();
jboolean result = GetClient(host, port, use_tls)->DoPingPong();
env->ReleaseStringUTFChars(host_raw, host);
return result;
}

@ -1047,7 +1047,7 @@ class LoadBalancedCall {
// Channel arg pointer vtable for GRPC_ARG_CLIENT_CHANNEL_DATA.
void* ChannelDataArgCopy(void* p) { return p; }
void ChannelDataArgDestroy(void* p) {}
void ChannelDataArgDestroy(void* /*p*/) {}
int ChannelDataArgCmp(void* p, void* q) { return GPR_ICMP(p, q); }
const grpc_arg_pointer_vtable kChannelDataArgPointerVtable = {
ChannelDataArgCopy, ChannelDataArgDestroy, ChannelDataArgCmp};
@ -1079,10 +1079,10 @@ class DynamicTerminationFilterChannelData {
}
// Will never be called.
static void StartTransportOp(grpc_channel_element* elem,
grpc_transport_op* op) {}
static void GetChannelInfo(grpc_channel_element* elem,
const grpc_channel_info* info) {}
static void StartTransportOp(grpc_channel_element* /*elem*/,
grpc_transport_op* /*op*/) {}
static void GetChannelInfo(grpc_channel_element* /*elem*/,
const grpc_channel_info* /*info*/) {}
ChannelData* chand() const { return chand_; }
RefCountedPtr<ServerRetryThrottleData> retry_throttle_data() const {
@ -1117,7 +1117,7 @@ class DynamicTerminationFilterCallData {
}
static void Destroy(grpc_call_element* elem,
const grpc_call_final_info* final_info,
const grpc_call_final_info* /*final_info*/,
grpc_closure* then_schedule_closure) {
auto* calld =
static_cast<DynamicTerminationFilterCallData*>(elem->call_data);
@ -2391,10 +2391,23 @@ void ChannelData::UpdateStateAndPickerLocked(
grpc_connectivity_state state, const absl::Status& status,
const char* reason,
std::unique_ptr<LoadBalancingPolicy::SubchannelPicker> picker) {
// Clean the control plane when entering IDLE.
// Special case for IDLE and SHUTDOWN states.
if (picker == nullptr || state == GRPC_CHANNEL_SHUTDOWN) {
saved_service_config_.reset();
saved_config_selector_.reset();
// Acquire resolution lock to update config selector and associated state.
// To minimize lock contention, we wait to unref these objects until
// after we release the lock.
RefCountedPtr<ServiceConfig> service_config_to_unref;
RefCountedPtr<ConfigSelector> config_selector_to_unref;
RefCountedPtr<DynamicFilters> dynamic_filters_to_unref;
{
MutexLock lock(&resolution_mu_);
received_service_config_data_ = false;
service_config_to_unref = std::move(service_config_);
config_selector_to_unref = std::move(config_selector_);
dynamic_filters_to_unref = std::move(dynamic_filters_);
}
}
// Update connectivity state.
state_tracker_.SetState(state, status, reason);
@ -2414,13 +2427,7 @@ void ChannelData::UpdateStateAndPickerLocked(
// the refs until after we release the lock, and then unref them at
// that point. This includes the following:
// - refs to subchannel wrappers in the keys of pending_subchannel_updates_
// - ref stored in service_config_
// - ref stored in config_selector_
// - ref stored in dynamic_filters_
// - ownership of the existing picker in picker_
RefCountedPtr<ServiceConfig> service_config_to_unref;
RefCountedPtr<ConfigSelector> config_selector_to_unref;
RefCountedPtr<DynamicFilters> dynamic_filters_to_unref;
{
MutexLock lock(&data_plane_mu_);
// Handle subchannel updates.
@ -2439,14 +2446,6 @@ void ChannelData::UpdateStateAndPickerLocked(
// Swap out the picker.
// Note: Original value will be destroyed after the lock is released.
picker_.swap(picker);
// Clean the data plane if the updated picker is nullptr.
if (picker_ == nullptr || state == GRPC_CHANNEL_SHUTDOWN) {
received_service_config_data_ = false;
// Note: We save the objects to unref until after the lock is released.
service_config_to_unref = std::move(service_config_);
config_selector_to_unref = std::move(config_selector_);
dynamic_filters_to_unref = std::move(dynamic_filters_);
}
// Re-process queued picks.
for (LbQueuedCall* call = lb_queued_calls_; call != nullptr;
call = call->next) {
@ -2651,7 +2650,11 @@ CallData::CallData(grpc_call_element* elem, const ChannelData& chand,
arena_(args.arena),
owning_call_(args.call_stack),
call_combiner_(args.call_combiner),
call_context_(args.context) {}
call_context_(args.context) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
gpr_log(GPR_INFO, "chand=%p calld=%p: created call", &chand, this);
}
}
CallData::~CallData() {
grpc_slice_unref_internal(path_);
@ -3166,6 +3169,12 @@ void CallData::CreateDynamicCall(grpc_call_element* elem) {
call_combiner_};
grpc_error* error = GRPC_ERROR_NONE;
DynamicFilters* channel_stack = args.channel_stack.get();
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(
GPR_INFO,
"chand=%p calld=%p: creating dynamic call stack on channel_stack=%p",
chand, this, channel_stack);
}
dynamic_call_ = channel_stack->CreateCall(std::move(args), &error);
if (error != GRPC_ERROR_NONE) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {

@ -26,8 +26,6 @@
#include "src/core/ext/filters/client_channel/resolver.h"
#include "src/core/lib/channel/channel_stack.h"
extern grpc_core::TraceFlag grpc_client_channel_trace;
// Channel arg key for server URI string.
#define GRPC_ARG_SERVER_URI "grpc.server_uri"

@ -106,7 +106,7 @@ class DefaultConfigSelector : public ConfigSelector {
// Only comparing the ConfigSelector itself, not the underlying
// service config, so we always return true.
bool Equals(const ConfigSelector* other) const override { return true; }
bool Equals(const ConfigSelector* /*other*/) const override { return true; }
CallConfig GetCallConfig(GetCallConfigArgs args) override {
CallConfig call_config;

@ -1259,12 +1259,10 @@ ServerAddressList ExtractBalancerAddresses(const grpc_channel_args& args) {
* stream for the reception of load balancing updates.
*
* Inputs:
* - \a addresses: corresponding to the balancers.
* - \a response_generator: in order to propagate updates from the resolver
* above the grpclb policy.
* - \a args: other args inherited from the grpclb policy. */
grpc_channel_args* BuildBalancerChannelArgs(
const ServerAddressList& addresses,
FakeResolverResponseGenerator* response_generator,
const grpc_channel_args* args) {
// Channel args to remove.
@ -1313,7 +1311,7 @@ grpc_channel_args* BuildBalancerChannelArgs(
args, args_to_remove, GPR_ARRAY_SIZE(args_to_remove), args_to_add.data(),
args_to_add.size());
// Make any necessary modifications for security.
return ModifyGrpclbBalancerChannelArgs(addresses, new_args);
return ModifyGrpclbBalancerChannelArgs(new_args);
}
//
@ -1464,8 +1462,8 @@ void GrpcLb::ProcessAddressesAndChannelArgsLocked(
&args, args_to_remove, GPR_ARRAY_SIZE(args_to_remove), &new_arg, 1);
// Construct args for balancer channel.
ServerAddressList balancer_addresses = ExtractBalancerAddresses(args);
grpc_channel_args* lb_channel_args = BuildBalancerChannelArgs(
balancer_addresses, response_generator_.get(), &args);
grpc_channel_args* lb_channel_args =
BuildBalancerChannelArgs(response_generator_.get(), &args);
// Create balancer channel if needed.
if (lb_channel_ == nullptr) {
std::string uri_str = absl::StrCat("fake:///", server_name_);

@ -24,8 +24,7 @@
namespace grpc_core {
grpc_channel_args* ModifyGrpclbBalancerChannelArgs(
const ServerAddressList& /*addresses*/, grpc_channel_args* args) {
grpc_channel_args* ModifyGrpclbBalancerChannelArgs(grpc_channel_args* args) {
return args;
}

@ -33,8 +33,7 @@ namespace grpc_core {
/// Takes ownership of \a args.
///
/// Caller takes ownership of the returned args.
grpc_channel_args* ModifyGrpclbBalancerChannelArgs(
const ServerAddressList& addresses, grpc_channel_args* args);
grpc_channel_args* ModifyGrpclbBalancerChannelArgs(grpc_channel_args* args);
grpc_channel* CreateGrpclbBalancerChannel(const char* target_uri,
const grpc_channel_args& args);

@ -39,8 +39,7 @@
namespace grpc_core {
grpc_channel_args* ModifyGrpclbBalancerChannelArgs(
const ServerAddressList& addresses, grpc_channel_args* args) {
grpc_channel_args* ModifyGrpclbBalancerChannelArgs(grpc_channel_args* args) {
absl::InlinedVector<const char*, 1> args_to_remove;
absl::InlinedVector<grpc_arg, 1> args_to_add;
// Substitute the channel credentials with a version without call

@ -497,7 +497,7 @@ class PickFirstFactory : public LoadBalancingPolicyFactory {
const char* name() const override { return kPickFirst; }
RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
const Json& json, grpc_error** /*error*/) const override {
const Json& /*json*/, grpc_error** /*error*/) const override {
return MakeRefCounted<PickFirstConfig>();
}
};

@ -363,8 +363,10 @@ void PriorityLb::HandleChildConnectivityStateChangeLocked(
// Otherwise, find the child's priority.
uint32_t child_priority = GetChildPriorityLocked(child->name());
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
gpr_log(GPR_INFO, "[priority_lb %p] state update for priority %d, child %s",
this, child_priority, child->name().c_str());
gpr_log(GPR_INFO,
"[priority_lb %p] state update for priority %u, child %s, current "
"priority %u",
this, child_priority, child->name().c_str(), current_priority_);
}
// Ignore priorities not in the current config.
if (child_priority == UINT32_MAX) return;
@ -412,12 +414,13 @@ void PriorityLb::DeleteChild(ChildPriority* child) {
}
void PriorityLb::TryNextPriorityLocked(bool report_connecting) {
current_priority_ = UINT32_MAX;
for (uint32_t priority = 0; priority < config_->priorities().size();
++priority) {
// If the child for the priority does not exist yet, create it.
const std::string& child_name = config_->priorities()[priority];
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
gpr_log(GPR_INFO, "[priority_lb %p] trying priority %d, child %s", this,
gpr_log(GPR_INFO, "[priority_lb %p] trying priority %u, child %s", this,
priority, child_name.c_str());
}
auto& child = children_[child_name];
@ -448,7 +451,7 @@ void PriorityLb::TryNextPriorityLocked(bool report_connecting) {
if (child->failover_timer_callback_pending()) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
gpr_log(GPR_INFO,
"[priority_lb %p] priority %d, child %s: child still "
"[priority_lb %p] priority %u, child %s: child still "
"attempting to connect, will wait",
this, priority, child_name.c_str());
}
@ -468,7 +471,6 @@ void PriorityLb::TryNextPriorityLocked(bool report_connecting) {
"TRANSIENT_FAILURE",
this);
}
current_priority_ = UINT32_MAX;
current_child_from_before_update_ = nullptr;
grpc_error* error = grpc_error_set_int(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("no ready priority"),
@ -480,7 +482,7 @@ void PriorityLb::TryNextPriorityLocked(bool report_connecting) {
void PriorityLb::SelectPriorityLocked(uint32_t priority) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
gpr_log(GPR_INFO, "[priority_lb %p] selected priority %d, child %s", this,
gpr_log(GPR_INFO, "[priority_lb %p] selected priority %u, child %s", this,
priority, config_->priorities()[priority].c_str());
}
current_priority_ = priority;

@ -63,26 +63,31 @@ class CdsLb : public LoadBalancingPolicy {
void UpdateLocked(UpdateArgs args) override;
void ResetBackoffLocked() override;
void ExitIdleLocked() override;
private:
// Watcher for getting cluster data from XdsClient.
class ClusterWatcher : public XdsClient::ClusterWatcherInterface {
public:
explicit ClusterWatcher(RefCountedPtr<CdsLb> parent)
: parent_(std::move(parent)) {}
ClusterWatcher(RefCountedPtr<CdsLb> parent, std::string name)
: parent_(std::move(parent)), name_(std::move(name)) {}
void OnClusterChanged(XdsApi::CdsUpdate cluster_data) override {
new Notifier(parent_, std::move(cluster_data));
new Notifier(parent_, name_, std::move(cluster_data));
}
void OnError(grpc_error* error) override { new Notifier(parent_, error); }
void OnResourceDoesNotExist() override { new Notifier(parent_); }
void OnError(grpc_error* error) override {
new Notifier(parent_, name_, error);
}
void OnResourceDoesNotExist() override { new Notifier(parent_, name_); }
private:
class Notifier {
public:
Notifier(RefCountedPtr<CdsLb> parent, XdsApi::CdsUpdate update);
Notifier(RefCountedPtr<CdsLb> parent, grpc_error* error);
explicit Notifier(RefCountedPtr<CdsLb> parent);
Notifier(RefCountedPtr<CdsLb> parent, std::string name,
XdsApi::CdsUpdate update);
Notifier(RefCountedPtr<CdsLb> parent, std::string name,
grpc_error* error);
explicit Notifier(RefCountedPtr<CdsLb> parent, std::string name);
private:
enum Type { kUpdate, kError, kDoesNotExist };
@ -91,12 +96,22 @@ class CdsLb : public LoadBalancingPolicy {
void RunInWorkSerializer(grpc_error* error);
RefCountedPtr<CdsLb> parent_;
std::string name_;
grpc_closure closure_;
XdsApi::CdsUpdate update_;
Type type_;
};
RefCountedPtr<CdsLb> parent_;
std::string name_;
};
struct WatcherState {
// Pointer to watcher, to be used when cancelling.
// Not owned, so do not dereference.
ClusterWatcher* watcher = nullptr;
// Most recent update obtained from this watcher.
absl::optional<XdsApi::CdsUpdate> update;
};
// Delegating helper to be passed to child policy.
@ -119,12 +134,20 @@ class CdsLb : public LoadBalancingPolicy {
void ShutdownLocked() override;
void OnClusterChanged(XdsApi::CdsUpdate cluster_data);
void OnError(grpc_error* error);
void OnResourceDoesNotExist();
bool GenerateDiscoveryMechanismForCluster(
const std::string& name, Json::Array* discovery_mechanisms,
std::set<std::string>* clusters_needed);
void OnClusterChanged(const std::string& name,
XdsApi::CdsUpdate cluster_data);
void OnError(const std::string& name, grpc_error* error);
void OnResourceDoesNotExist(const std::string& name);
grpc_error* UpdateXdsCertificateProvider(
const XdsApi::CdsUpdate& cluster_data);
const std::string& cluster_name, const XdsApi::CdsUpdate& cluster_data);
void CancelClusterDataWatch(absl::string_view cluster_name,
XdsClient::ClusterWatcherInterface* watcher,
bool delay_unsubscription = false);
void MaybeDestroyChildPolicyLocked();
@ -135,9 +158,10 @@ class CdsLb : public LoadBalancingPolicy {
// The xds client.
RefCountedPtr<XdsClient> xds_client_;
// A pointer to the cluster watcher, to be used when cancelling the watch.
// Note that this is not owned, so this pointer must never be derefernced.
ClusterWatcher* cluster_watcher_ = nullptr;
// Maps from cluster name to the state for that cluster.
// The root of the tree is config_->cluster().
std::map<std::string, WatcherState> watchers_;
RefCountedPtr<grpc_tls_certificate_provider> root_certificate_provider_;
RefCountedPtr<grpc_tls_certificate_provider> identity_certificate_provider_;
@ -155,21 +179,26 @@ class CdsLb : public LoadBalancingPolicy {
//
CdsLb::ClusterWatcher::Notifier::Notifier(RefCountedPtr<CdsLb> parent,
std::string name,
XdsApi::CdsUpdate update)
: parent_(std::move(parent)), update_(std::move(update)), type_(kUpdate) {
: parent_(std::move(parent)),
name_(std::move(name)),
update_(std::move(update)),
type_(kUpdate) {
GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
}
CdsLb::ClusterWatcher::Notifier::Notifier(RefCountedPtr<CdsLb> parent,
grpc_error* error)
: parent_(std::move(parent)), type_(kError) {
std::string name, grpc_error* error)
: parent_(std::move(parent)), name_(std::move(name)), type_(kError) {
GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
ExecCtx::Run(DEBUG_LOCATION, &closure_, error);
}
CdsLb::ClusterWatcher::Notifier::Notifier(RefCountedPtr<CdsLb> parent)
: parent_(std::move(parent)), type_(kDoesNotExist) {
CdsLb::ClusterWatcher::Notifier::Notifier(RefCountedPtr<CdsLb> parent,
std::string name)
: parent_(std::move(parent)), name_(std::move(name)), type_(kDoesNotExist) {
GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
}
@ -185,13 +214,13 @@ void CdsLb::ClusterWatcher::Notifier::RunInExecCtx(void* arg,
void CdsLb::ClusterWatcher::Notifier::RunInWorkSerializer(grpc_error* error) {
switch (type_) {
case kUpdate:
parent_->OnClusterChanged(std::move(update_));
parent_->OnClusterChanged(name_, std::move(update_));
break;
case kError:
parent_->OnError(error);
parent_->OnError(name_, error);
break;
case kDoesNotExist:
parent_->OnResourceDoesNotExist();
parent_->OnResourceDoesNotExist(name_);
break;
};
delete this;
@ -261,13 +290,15 @@ void CdsLb::ShutdownLocked() {
shutting_down_ = true;
MaybeDestroyChildPolicyLocked();
if (xds_client_ != nullptr) {
if (cluster_watcher_ != nullptr) {
for (auto& watcher : watchers_) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
gpr_log(GPR_INFO, "[cdslb %p] cancelling watch for cluster %s", this,
config_->cluster().c_str());
watcher.first.c_str());
}
xds_client_->CancelClusterDataWatch(config_->cluster(), cluster_watcher_);
CancelClusterDataWatch(watcher.first, watcher.second.watcher,
/*delay_unsubscription=*/false);
}
watchers_.clear();
xds_client_.reset(DEBUG_LOCATION, "CdsLb");
}
grpc_channel_args_destroy(args_);
@ -286,6 +317,10 @@ void CdsLb::ResetBackoffLocked() {
if (child_policy_ != nullptr) child_policy_->ResetBackoffLocked();
}
void CdsLb::ExitIdleLocked() {
if (child_policy_ != nullptr) child_policy_->ExitIdleLocked();
}
void CdsLb::UpdateLocked(UpdateArgs args) {
// Update config.
auto old_config = std::move(config_);
@ -301,119 +336,214 @@ void CdsLb::UpdateLocked(UpdateArgs args) {
// If cluster name changed, cancel watcher and restart.
if (old_config == nullptr || old_config->cluster() != config_->cluster()) {
if (old_config != nullptr) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
gpr_log(GPR_INFO, "[cdslb %p] cancelling watch for cluster %s", this,
old_config->cluster().c_str());
for (auto& watcher : watchers_) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
gpr_log(GPR_INFO, "[cdslb %p] cancelling watch for cluster %s", this,
watcher.first.c_str());
}
CancelClusterDataWatch(watcher.first, watcher.second.watcher,
/*delay_unsubscription=*/true);
}
xds_client_->CancelClusterDataWatch(old_config->cluster(),
cluster_watcher_,
/*delay_unsubscription=*/true);
watchers_.clear();
}
if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
gpr_log(GPR_INFO, "[cdslb %p] starting watch for cluster %s", this,
config_->cluster().c_str());
}
auto watcher = absl::make_unique<ClusterWatcher>(Ref());
cluster_watcher_ = watcher.get();
auto watcher = absl::make_unique<ClusterWatcher>(Ref(), config_->cluster());
watchers_[config_->cluster()].watcher = watcher.get();
xds_client_->WatchClusterData(config_->cluster(), std::move(watcher));
}
}
void CdsLb::OnClusterChanged(XdsApi::CdsUpdate cluster_data) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
gpr_log(GPR_INFO, "[cdslb %p] received CDS update from xds client %p: %s",
this, xds_client_.get(), cluster_data.ToString().c_str());
// This method will attempt to generate one or multiple entries of discovery
// mechanism recursively:
// For cluster types EDS or LOGICAL_DNS, one discovery mechanism entry may be
// generated cluster name, type and other data from the CdsUpdate inserted into
// the entry and the entry appended to the array of entries.
// Note, discovery mechanism entry can be generated if an CdsUpdate is
// available; otherwise, just return false. For cluster type AGGREGATE,
// recursively call the method for each child cluster.
bool CdsLb::GenerateDiscoveryMechanismForCluster(
const std::string& name, Json::Array* discovery_mechanisms,
std::set<std::string>* clusters_needed) {
clusters_needed->insert(name);
auto& state = watchers_[name];
// Create a new watcher if needed.
if (state.watcher == nullptr) {
auto watcher = absl::make_unique<ClusterWatcher>(Ref(), name);
if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
gpr_log(GPR_INFO, "[cdslb %p] starting watch for cluster %s", this,
name.c_str());
}
state.watcher = watcher.get();
xds_client_->WatchClusterData(name, std::move(watcher));
return false;
}
grpc_error* error = GRPC_ERROR_NONE;
error = UpdateXdsCertificateProvider(cluster_data);
if (error != GRPC_ERROR_NONE) {
return OnError(error);
// Don't have the update we need yet.
if (!state.update.has_value()) return false;
// For AGGREGATE clusters, recursively expand to child clusters.
if (state.update->cluster_type == XdsApi::CdsUpdate::ClusterType::AGGREGATE) {
bool missing_cluster = false;
for (const std::string& child_name :
state.update->prioritized_cluster_names) {
if (!GenerateDiscoveryMechanismForCluster(
child_name, discovery_mechanisms, clusters_needed)) {
missing_cluster = true;
}
}
return !missing_cluster;
}
std::string type;
switch (state.update->cluster_type) {
case XdsApi::CdsUpdate::ClusterType::EDS:
type = "EDS";
break;
case XdsApi::CdsUpdate::ClusterType::LOGICAL_DNS:
type = "LOGICAL_DNS";
break;
default:
GPR_ASSERT(0);
break;
}
// Construct config for child policy.
Json::Object discovery_mechanism = {
{"clusterName", config_->cluster()},
{"max_concurrent_requests", cluster_data.max_concurrent_requests},
{"type", "EDS"},
Json::Object mechanism = {
{"clusterName", name},
{"max_concurrent_requests", state.update->max_concurrent_requests},
{"type", std::move(type)},
};
if (!cluster_data.eds_service_name.empty()) {
discovery_mechanism["edsServiceName"] = cluster_data.eds_service_name;
if (!state.update->eds_service_name.empty()) {
mechanism["edsServiceName"] = state.update->eds_service_name;
}
if (cluster_data.lrs_load_reporting_server_name.has_value()) {
discovery_mechanism["lrsLoadReportingServerName"] =
cluster_data.lrs_load_reporting_server_name.value();
if (state.update->lrs_load_reporting_server_name.has_value()) {
mechanism["lrsLoadReportingServerName"] =
state.update->lrs_load_reporting_server_name.value();
}
Json::Object child_config = {
{"discoveryMechanisms",
Json::Array{
discovery_mechanism,
}},
{"localityPickingPolicy",
Json::Array{
Json::Object{
{"weighted_target_experimental",
Json::Object{
{"targets", Json::Object()},
}},
},
}},
{"endpointPickingPolicy",
Json::Array{
Json::Object{
{"round_robin", Json::Object()},
},
}},
};
Json json = Json::Array{
Json::Object{
{"xds_cluster_resolver_experimental", std::move(child_config)},
},
};
discovery_mechanisms->emplace_back(std::move(mechanism));
return true;
}
void CdsLb::OnClusterChanged(const std::string& name,
XdsApi::CdsUpdate cluster_data) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
std::string json_str = json.Dump(/*indent=*/1);
gpr_log(GPR_INFO, "[cdslb %p] generated config for child policy: %s", this,
json_str.c_str());
gpr_log(
GPR_INFO,
"[cdslb %p] received CDS update for cluster %s from xds client %p: %s",
this, name.c_str(), xds_client_.get(), cluster_data.ToString().c_str());
}
RefCountedPtr<LoadBalancingPolicy::Config> config =
LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(json, &error);
// Store the update in the map if we are still interested in watching this
// cluster (i.e., it is not cancelled already).
// If we've already deleted this entry, then this is an update notification
// that was scheduled before the deletion, so we can just ignore it.
auto it = watchers_.find(name);
if (it == watchers_.end()) return;
it->second.update = cluster_data;
// Take care of integration with new certificate code.
grpc_error* error = GRPC_ERROR_NONE;
error = UpdateXdsCertificateProvider(name, it->second.update.value());
if (error != GRPC_ERROR_NONE) {
OnError(error);
return;
return OnError(name, error);
}
// Create child policy if not already present.
if (child_policy_ == nullptr) {
LoadBalancingPolicy::Args args;
args.work_serializer = work_serializer();
args.args = args_;
args.channel_control_helper = absl::make_unique<Helper>(Ref());
child_policy_ = LoadBalancingPolicyRegistry::CreateLoadBalancingPolicy(
config->name(), std::move(args));
if (child_policy_ == nullptr) {
OnError(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"failed to create child policy"));
return;
// Scan the map starting from the root cluster to generate the list of
// discovery mechanisms. If we don't have some of the data we need (i.e., we
// just started up and not all watchers have returned data yet), then don't
// update the child policy at all.
Json::Array discovery_mechanisms;
std::set<std::string> clusters_needed;
if (GenerateDiscoveryMechanismForCluster(
config_->cluster(), &discovery_mechanisms, &clusters_needed)) {
// Construct config for child policy.
Json::Object xds_lb_policy;
if (cluster_data.lb_policy == "RING_HASH") {
std::string hash_function;
switch (cluster_data.hash_function) {
case XdsApi::CdsUpdate::HashFunction::XX_HASH:
hash_function = "XX_HASH";
break;
case XdsApi::CdsUpdate::HashFunction::MURMUR_HASH_2:
hash_function = "MURMUR_HASH_2";
break;
default:
GPR_ASSERT(0);
break;
}
xds_lb_policy["RING_HASH"] = Json::Object{
{"min_ring_size", cluster_data.min_ring_size},
{"max_ring_size", cluster_data.max_ring_size},
{"hash_function", hash_function},
};
} else {
xds_lb_policy["ROUND_ROBIN"] = Json::Object();
}
grpc_pollset_set_add_pollset_set(child_policy_->interested_parties(),
interested_parties());
Json::Object child_config = {
{"xdsLbPolicy",
Json::Array{
xds_lb_policy,
}},
{"discoveryMechanisms", std::move(discovery_mechanisms)},
};
Json json = Json::Array{
Json::Object{
{"xds_cluster_resolver_experimental", std::move(child_config)},
},
};
if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
gpr_log(GPR_INFO, "[cdslb %p] created child policy %s (%p)", this,
config->name(), child_policy_.get());
std::string json_str = json.Dump(/*indent=*/1);
gpr_log(GPR_INFO, "[cdslb %p] generated config for child policy: %s",
this, json_str.c_str());
}
RefCountedPtr<LoadBalancingPolicy::Config> config =
LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(json, &error);
if (error != GRPC_ERROR_NONE) {
OnError(name, error);
return;
}
// Create child policy if not already present.
if (child_policy_ == nullptr) {
LoadBalancingPolicy::Args args;
args.work_serializer = work_serializer();
args.args = args_;
args.channel_control_helper = absl::make_unique<Helper>(Ref());
child_policy_ = LoadBalancingPolicyRegistry::CreateLoadBalancingPolicy(
config->name(), std::move(args));
if (child_policy_ == nullptr) {
OnError(name, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"failed to create child policy"));
return;
}
grpc_pollset_set_add_pollset_set(child_policy_->interested_parties(),
interested_parties());
if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
gpr_log(GPR_INFO, "[cdslb %p] created child policy %s (%p)", this,
config->name(), child_policy_.get());
}
}
// Update child policy.
UpdateArgs args;
args.config = std::move(config);
if (xds_certificate_provider_ != nullptr) {
grpc_arg arg_to_add = xds_certificate_provider_->MakeChannelArg();
args.args = grpc_channel_args_copy_and_add(args_, &arg_to_add, 1);
} else {
args.args = grpc_channel_args_copy(args_);
}
child_policy_->UpdateLocked(std::move(args));
}
// Update child policy.
UpdateArgs args;
args.config = std::move(config);
if (xds_certificate_provider_ != nullptr) {
grpc_arg arg_to_add = xds_certificate_provider_->MakeChannelArg();
args.args = grpc_channel_args_copy_and_add(args_, &arg_to_add, 1);
} else {
args.args = grpc_channel_args_copy(args_);
// Remove entries in watchers_ for any clusters not in clusters_needed
for (auto it = watchers_.begin(); it != watchers_.end();) {
const std::string& cluster_name = it->first;
if (clusters_needed.find(cluster_name) != clusters_needed.end()) {
++it;
continue;
}
if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
gpr_log(GPR_INFO, "[cdslb %p] cancelling watch for cluster %s", this,
cluster_name.c_str());
}
CancelClusterDataWatch(cluster_name, it->second.watcher,
/*delay_unsubscription=*/false);
it = watchers_.erase(it);
}
child_policy_->UpdateLocked(std::move(args));
}
void CdsLb::OnError(grpc_error* error) {
void CdsLb::OnError(const std::string& name, grpc_error* error) {
gpr_log(GPR_ERROR, "[cdslb %p] xds error obtaining data for cluster %s: %s",
this, config_->cluster().c_str(), grpc_error_string(error));
this, name.c_str(), grpc_error_string(error));
// Go into TRANSIENT_FAILURE if we have not yet created the child
// policy (i.e., we have not yet received data from xds). Otherwise,
// we keep running with the data we had previously.
@ -426,11 +556,11 @@ void CdsLb::OnError(grpc_error* error) {
}
}
void CdsLb::OnResourceDoesNotExist() {
void CdsLb::OnResourceDoesNotExist(const std::string& name) {
gpr_log(GPR_ERROR,
"[cdslb %p] CDS resource for %s does not exist -- reporting "
"TRANSIENT_FAILURE",
this, config_->cluster().c_str());
this, name.c_str());
grpc_error* error =
grpc_error_set_int(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
absl::StrCat("CDS resource \"", config_->cluster(),
@ -444,7 +574,7 @@ void CdsLb::OnResourceDoesNotExist() {
}
grpc_error* CdsLb::UpdateXdsCertificateProvider(
const XdsApi::CdsUpdate& cluster_data) {
const std::string& cluster_name, const XdsApi::CdsUpdate& cluster_data) {
// Early out if channel is not configured to use xds security.
grpc_channel_credentials* channel_credentials =
grpc_channel_credentials_find_in_args(args_);
@ -453,18 +583,16 @@ grpc_error* CdsLb::UpdateXdsCertificateProvider(
xds_certificate_provider_ = nullptr;
return GRPC_ERROR_NONE;
}
if (xds_certificate_provider_ == nullptr) {
xds_certificate_provider_ = MakeRefCounted<XdsCertificateProvider>();
}
// Configure root cert.
absl::string_view root_provider_instance_name =
cluster_data.common_tls_context.combined_validation_context
.validation_context_certificate_provider_instance.instance_name;
absl::string_view root_provider_cert_name =
cluster_data.common_tls_context.combined_validation_context
.validation_context_certificate_provider_instance.certificate_name;
absl::string_view identity_provider_instance_name =
cluster_data.common_tls_context
.tls_certificate_certificate_provider_instance.instance_name;
absl::string_view identity_provider_cert_name =
cluster_data.common_tls_context
.tls_certificate_certificate_provider_instance.certificate_name;
RefCountedPtr<XdsCertificateProvider> new_root_provider;
if (!root_provider_instance_name.empty()) {
new_root_provider =
@ -491,6 +619,18 @@ grpc_error* CdsLb::UpdateXdsCertificateProvider(
}
root_certificate_provider_ = std::move(new_root_provider);
}
xds_certificate_provider_->UpdateRootCertNameAndDistributor(
cluster_name, root_provider_cert_name,
root_certificate_provider_ == nullptr
? nullptr
: root_certificate_provider_->distributor());
// Configure identity cert.
absl::string_view identity_provider_instance_name =
cluster_data.common_tls_context
.tls_certificate_certificate_provider_instance.instance_name;
absl::string_view identity_provider_cert_name =
cluster_data.common_tls_context
.tls_certificate_certificate_provider_instance.certificate_name;
RefCountedPtr<XdsCertificateProvider> new_identity_provider;
if (!identity_provider_instance_name.empty()) {
new_identity_provider =
@ -517,56 +657,34 @@ grpc_error* CdsLb::UpdateXdsCertificateProvider(
}
identity_certificate_provider_ = std::move(new_identity_provider);
}
const std::vector<XdsApi::StringMatcher>& match_subject_alt_names =
xds_certificate_provider_->UpdateIdentityCertNameAndDistributor(
cluster_name, identity_provider_cert_name,
identity_certificate_provider_ == nullptr
? nullptr
: identity_certificate_provider_->distributor());
// Configure SAN matchers.
const std::vector<StringMatcher>& match_subject_alt_names =
cluster_data.common_tls_context.combined_validation_context
.default_validation_context.match_subject_alt_names;
if (!root_provider_instance_name.empty() &&
!identity_provider_instance_name.empty()) {
// Using mTLS configuration
if (xds_certificate_provider_ != nullptr &&
xds_certificate_provider_->ProvidesRootCerts() &&
xds_certificate_provider_->ProvidesIdentityCerts()) {
xds_certificate_provider_->UpdateRootCertNameAndDistributor(
root_provider_cert_name, root_certificate_provider_->distributor());
xds_certificate_provider_->UpdateIdentityCertNameAndDistributor(
identity_provider_cert_name,
identity_certificate_provider_->distributor());
xds_certificate_provider_->UpdateSubjectAlternativeNameMatchers(
match_subject_alt_names);
} else {
// Existing xDS certificate provider does not have mTLS configuration.
// Create new certificate provider so that new subchannel connectors are
// created.
xds_certificate_provider_ = MakeRefCounted<XdsCertificateProvider>(
root_provider_cert_name, root_certificate_provider_->distributor(),
identity_provider_cert_name,
identity_certificate_provider_->distributor(),
match_subject_alt_names);
}
} else if (!root_provider_instance_name.empty()) {
// Using TLS configuration
if (xds_certificate_provider_ != nullptr &&
xds_certificate_provider_->ProvidesRootCerts() &&
!xds_certificate_provider_->ProvidesIdentityCerts()) {
xds_certificate_provider_->UpdateRootCertNameAndDistributor(
root_provider_cert_name, root_certificate_provider_->distributor());
xds_certificate_provider_->UpdateSubjectAlternativeNameMatchers(
match_subject_alt_names);
} else {
// Existing xDS certificate provider does not have TLS configuration.
// Create new certificate provider so that new subchannel connectors are
// created.
xds_certificate_provider_ = MakeRefCounted<XdsCertificateProvider>(
root_provider_cert_name, root_certificate_provider_->distributor(),
"", nullptr, match_subject_alt_names);
}
} else {
// No configuration provided.
xds_certificate_provider_ = nullptr;
}
xds_certificate_provider_->UpdateSubjectAlternativeNameMatchers(
cluster_name, match_subject_alt_names);
return GRPC_ERROR_NONE;
}
void CdsLb::CancelClusterDataWatch(absl::string_view cluster_name,
XdsClient::ClusterWatcherInterface* watcher,
bool delay_unsubscription) {
if (xds_certificate_provider_ != nullptr) {
std::string name(cluster_name);
xds_certificate_provider_->UpdateRootCertNameAndDistributor(name, "",
nullptr);
xds_certificate_provider_->UpdateIdentityCertNameAndDistributor(name, "",
nullptr);
xds_certificate_provider_->UpdateSubjectAlternativeNameMatchers(name, {});
}
xds_client_->CancelClusterDataWatch(cluster_name, watcher,
delay_unsubscription);
}
//
// factory
//
@ -601,6 +719,7 @@ class CdsLbFactory : public LoadBalancingPolicyFactory {
return nullptr;
}
std::vector<grpc_error*> error_list;
// cluster name.
std::string cluster;
auto it = json.object_value().find("cluster");
if (it == json.object_value().end()) {

@ -21,4 +21,9 @@
// Set by xds_cluster_impl LB policy and used by GoogleDefaultCredentials.
#define GRPC_ARG_XDS_CLUSTER_NAME "grpc.internal.xds_cluster_name"
// For testing purpose, this channel arg indicating xds_cluster_resolver LB
// policy should use the fake DNS resolver to resolve logical dns cluster.
#define GRPC_ARG_XDS_LOGICAL_DNS_CLUSTER_FAKE_RESOLVER_RESPONSE_GENERATOR \
"grpc.internal.xds_logical_dns_cluster_fake_resolver_response_generator"
#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_XDS_XDS_CHANNEL_ARGS_H

@ -145,9 +145,7 @@ class XdsClusterImplLbConfig : public LoadBalancingPolicy::Config {
const absl::optional<std::string>& lrs_load_reporting_server_name() const {
return lrs_load_reporting_server_name_;
};
const uint32_t max_concurrent_requests() const {
return max_concurrent_requests_;
}
uint32_t max_concurrent_requests() const { return max_concurrent_requests_; }
RefCountedPtr<XdsApi::EdsUpdate::DropConfig> drop_config() const {
return drop_config_;
}

@ -29,8 +29,10 @@
#include "src/core/ext/filters/client_channel/lb_policy/address_filtering.h"
#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
#include "src/core/ext/filters/client_channel/lb_policy/xds/xds.h"
#include "src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h"
#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
#include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
#include "src/core/ext/filters/client_channel/resolver_registry.h"
#include "src/core/ext/filters/client_channel/server_address.h"
#include "src/core/ext/xds/xds_channel_args.h"
@ -80,28 +82,20 @@ class XdsClusterResolverLbConfig : public LoadBalancingPolicy::Config {
};
XdsClusterResolverLbConfig(
std::vector<DiscoveryMechanism> discovery_mechanisms,
Json locality_picking_policy, Json endpoint_picking_policy)
std::vector<DiscoveryMechanism> discovery_mechanisms, Json xds_lb_policy)
: discovery_mechanisms_(std::move(discovery_mechanisms)),
locality_picking_policy_(std::move(locality_picking_policy)),
endpoint_picking_policy_(std::move(endpoint_picking_policy)) {}
xds_lb_policy_(std::move(xds_lb_policy)) {}
const char* name() const override { return kXdsClusterResolver; }
const std::vector<DiscoveryMechanism>& discovery_mechanisms() const {
return discovery_mechanisms_;
}
const Json& locality_picking_policy() const {
return locality_picking_policy_;
}
const Json& endpoint_picking_policy() const {
return endpoint_picking_policy_;
}
const Json& xds_lb_policy() const { return xds_lb_policy_; }
private:
std::vector<DiscoveryMechanism> discovery_mechanisms_;
Json locality_picking_policy_;
Json endpoint_picking_policy_;
Json xds_lb_policy_;
};
// Xds Cluster Resolver LB policy.
@ -113,6 +107,7 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
void UpdateLocked(UpdateArgs args) override;
void ResetBackoffLocked() override;
void ExitIdleLocked() override;
private:
// Discovery Mechanism Base class
@ -132,6 +127,8 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
: parent_(std::move(xds_cluster_resolver_lb)), index_(index) {}
virtual void Start() = 0;
void Orphan() override = 0;
virtual Json::Array override_child_policy() = 0;
virtual bool disable_reresolution() = 0;
// Caller must ensure that config_ is set before calling.
const absl::string_view GetXdsClusterResolverResourceName() const {
@ -172,6 +169,8 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
: DiscoveryMechanism(std::move(xds_cluster_resolver_lb), index) {}
void Start() override;
void Orphan() override;
Json::Array override_child_policy() override { return Json::Array{}; }
bool disable_reresolution() override { return true; }
private:
class EndpointWatcher : public XdsClient::EndpointWatcherInterface {
@ -230,6 +229,14 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
: DiscoveryMechanism(std::move(xds_cluster_resolver_lb), index) {}
void Start() override;
void Orphan() override;
Json::Array override_child_policy() override {
return Json::Array{
Json::Object{
{"pick_first", Json::Object()},
},
};
}
bool disable_reresolution() override { return false; };
private:
class ResolverResultHandler : public Resolver::ResultHandler {
@ -469,11 +476,26 @@ void XdsClusterResolverLb::EdsDiscoveryMechanism::EndpointWatcher::Notifier::
//
void XdsClusterResolverLb::LogicalDNSDiscoveryMechanism::Start() {
std::string target = parent()->server_name_;
grpc_channel_args* args = nullptr;
FakeResolverResponseGenerator* fake_resolver_response_generator =
grpc_channel_args_find_pointer<FakeResolverResponseGenerator>(
parent()->args_,
GRPC_ARG_XDS_LOGICAL_DNS_CLUSTER_FAKE_RESOLVER_RESPONSE_GENERATOR);
if (fake_resolver_response_generator != nullptr) {
target = absl::StrCat("fake:", target);
grpc_arg new_arg = FakeResolverResponseGenerator::MakeChannelArg(
fake_resolver_response_generator);
args = grpc_channel_args_copy_and_add(parent()->args_, &new_arg, 1);
} else {
args = grpc_channel_args_copy(parent()->args_);
}
resolver_ = ResolverRegistry::CreateResolver(
parent()->server_name_.c_str(), parent()->args_,
grpc_pollset_set_create(), parent()->work_serializer(),
target.c_str(), args, parent()->interested_parties(),
parent()->work_serializer(),
absl::make_unique<ResolverResultHandler>(
Ref(DEBUG_LOCATION, "LogicalDNSDiscoveryMechanism")));
grpc_channel_args_destroy(args);
if (resolver_ == nullptr) {
parent()->OnResourceDoesNotExist(index());
return;
@ -509,9 +531,11 @@ void XdsClusterResolverLb::LogicalDNSDiscoveryMechanism::ResolverResultHandler::
XdsApi::EdsUpdate update;
XdsApi::EdsUpdate::Priority::Locality locality;
locality.name = MakeRefCounted<XdsLocalityName>("", "", "");
locality.lb_weight = 1;
locality.endpoints = std::move(result.addresses);
update.priorities[0].localities.emplace(locality.name.get(),
std::move(locality));
XdsApi::EdsUpdate::Priority priority;
priority.localities.emplace(locality.name.get(), std::move(locality));
update.priorities.emplace_back(std::move(priority));
discovery_mechanism_->parent()->OnEndpointChanged(
discovery_mechanism_->index(), std::move(update));
}
@ -655,6 +679,10 @@ void XdsClusterResolverLb::ResetBackoffLocked() {
}
}
void XdsClusterResolverLb::ExitIdleLocked() {
if (child_policy_ != nullptr) child_policy_->ExitIdleLocked();
}
void XdsClusterResolverLb::OnEndpointChanged(size_t index,
XdsApi::EdsUpdate update) {
if (shutting_down_) return;
@ -673,10 +701,17 @@ void XdsClusterResolverLb::OnEndpointChanged(size_t index,
discovery_mechanisms_[index].pending_priority_list =
std::move(update.priorities);
discovery_mechanisms_[index].first_update_received = true;
if (!discovery_mechanisms_[0].first_update_received) {
// We have not yet received an update for index 0, so wait until that
// happens to create the child policy.
return;
// If any discovery mechanism has not received its first update,
// wait until that happens before creating the child policy.
// TODO(roth): If this becomes problematic in the future (e.g., a
// secondary discovery mechanism delaying us from starting up at all),
// we can consider some sort of optimization whereby we can create the
// priority policy with only a subset of its children. But we need to
// make sure not to get into a situation where the priority policy
// will put the channel into TRANSIENT_FAILURE instead of CONNECTING
// while we're still waiting for the other discovery mechanism(s).
for (DiscoveryMechanismEntry& mechanism : discovery_mechanisms_) {
if (!mechanism.first_update_received) return;
}
// Construct new priority list.
XdsApi::EdsUpdate::PriorityList priority_list;
@ -813,7 +848,11 @@ ServerAddressList XdsClusterResolverLb::CreateChildPolicyAddressesLocked() {
MakeHierarchicalPathAttribute(hierarchical_path))
.WithAttribute(kXdsLocalityNameAttributeKey,
absl::make_unique<XdsLocalityAttribute>(
locality_name->Ref())));
locality_name->Ref()))
.WithAttribute(ServerAddressWeightAttribute::
kServerAddressWeightAttributeKey,
absl::make_unique<ServerAddressWeightAttribute>(
locality.lb_weight)));
}
}
}
@ -825,53 +864,76 @@ XdsClusterResolverLb::CreateChildPolicyConfigLocked() {
Json::Object priority_children;
Json::Array priority_priorities;
// Setting up index to iterate through the discovery mechanisms and keeping
// track the discovery_mechanism each prioirty belongs to.
// track the discovery_mechanism each priority belongs to.
size_t discovery_index = 0;
// Setting up num_priorities_remaining to track the priorities in each
// discovery_mechanism.
size_t num_priorities_remaining_in_discovery =
discovery_mechanisms_[discovery_index].num_priorities;
for (size_t priority = 0; priority < priority_list_.size(); ++priority) {
// Each prioirty in the priority_list_ should correspond to a priority in a
// discovery mechanism in discovery_mechanisms_ (both in the same order).
// Keeping track of the discovery_mechanism each prioirty belongs to.
if (num_priorities_remaining_in_discovery == 0) {
++discovery_index;
num_priorities_remaining_in_discovery =
discovery_mechanisms_[discovery_index].num_priorities;
Json child_policy;
if (!discovery_mechanisms_[discovery_index]
.discovery_mechanism->override_child_policy()
.empty()) {
child_policy = discovery_mechanisms_[discovery_index]
.discovery_mechanism->override_child_policy();
} else {
--num_priorities_remaining_in_discovery;
}
const auto& localities = priority_list_[priority].localities;
Json::Object weighted_targets;
for (const auto& p : localities) {
XdsLocalityName* locality_name = p.first;
const auto& locality = p.second;
// Construct JSON object containing locality name.
Json::Object locality_name_json;
if (!locality_name->region().empty()) {
locality_name_json["region"] = locality_name->region();
}
if (!locality_name->zone().empty()) {
locality_name_json["zone"] = locality_name->zone();
}
if (!locality_name->sub_zone().empty()) {
locality_name_json["subzone"] = locality_name->sub_zone();
const auto& xds_lb_policy = config_->xds_lb_policy().object_value();
if (xds_lb_policy.find("ROUND_ROBIN") != xds_lb_policy.end()) {
const auto& localities = priority_list_[priority].localities;
Json::Object weighted_targets;
for (const auto& p : localities) {
XdsLocalityName* locality_name = p.first;
const auto& locality = p.second;
// Construct JSON object containing locality name.
Json::Object locality_name_json;
if (!locality_name->region().empty()) {
locality_name_json["region"] = locality_name->region();
}
if (!locality_name->zone().empty()) {
locality_name_json["zone"] = locality_name->zone();
}
if (!locality_name->sub_zone().empty()) {
locality_name_json["subzone"] = locality_name->sub_zone();
}
// Add weighted target entry.
weighted_targets[locality_name->AsHumanReadableString()] =
Json::Object{
{"weight", locality.lb_weight},
{"childPolicy",
Json::Array{
Json::Object{
{"round_robin", Json::Object()},
},
}},
};
}
// Construct locality-picking policy.
// Start with field from our config and add the "targets" field.
child_policy = Json::Array{
Json::Object{
{"weighted_target_experimental",
Json::Object{
{"targets", Json::Object()},
}},
},
};
Json::Object& config =
*(*child_policy.mutable_array())[0].mutable_object();
auto it = config.begin();
GPR_ASSERT(it != config.end());
(*it->second.mutable_object())["targets"] = std::move(weighted_targets);
} else {
auto it = xds_lb_policy.find("RING_HASH");
GPR_ASSERT(it != xds_lb_policy.end());
Json::Object ring_hash_experimental_policy = it->second.object_value();
child_policy = Json::Array{
Json::Object{
{"ring_hash_experimental", ring_hash_experimental_policy},
},
};
}
// Add weighted target entry.
weighted_targets[locality_name->AsHumanReadableString()] = Json::Object{
{"weight", locality.lb_weight},
{"childPolicy", config_->endpoint_picking_policy()},
};
}
// Construct locality-picking policy.
// Start with field from our config and add the "targets" field.
Json locality_picking_config = config_->locality_picking_policy();
Json::Object& config =
*(*locality_picking_config.mutable_array())[0].mutable_object();
auto it = config.begin();
GPR_ASSERT(it != config.end());
(*it->second.mutable_object())["targets"] = std::move(weighted_targets);
// Wrap it in the drop policy.
Json::Array drop_categories;
if (discovery_mechanisms_[discovery_index].drop_config != nullptr) {
@ -887,7 +949,7 @@ XdsClusterResolverLb::CreateChildPolicyConfigLocked() {
.discovery_mechanism->GetLrsClusterKey();
Json::Object xds_cluster_impl_config = {
{"clusterName", std::string(lrs_key.first)},
{"childPolicy", std::move(locality_picking_config)},
{"childPolicy", std::move(child_policy)},
{"dropCategories", std::move(drop_categories)},
{"maxConcurrentRequests",
config_->discovery_mechanisms()[discovery_index]
@ -909,10 +971,24 @@ XdsClusterResolverLb::CreateChildPolicyConfigLocked() {
const size_t child_number = priority_child_numbers_[priority];
std::string child_name = absl::StrCat("child", child_number);
priority_priorities.emplace_back(child_name);
priority_children[child_name] = Json::Object{
Json::Object child_config = {
{"config", std::move(locality_picking_policy)},
{"ignore_reresolution_requests", true},
};
if (discovery_mechanisms_[discovery_index]
.discovery_mechanism->disable_reresolution()) {
child_config["ignore_reresolution_requests"] = true;
}
priority_children[child_name] = std::move(child_config);
// Each priority in the priority_list_ should correspond to a priority in a
// discovery mechanism in discovery_mechanisms_ (both in the same order).
// Keeping track of the discovery_mechanism each priority belongs to.
--num_priorities_remaining_in_discovery;
while (num_priorities_remaining_in_discovery == 0 &&
discovery_index < discovery_mechanisms_.size() - 1) {
++discovery_index;
num_priorities_remaining_in_discovery =
discovery_mechanisms_[discovery_index].num_priorities;
}
}
// There should be matching number of priorities in discovery_mechanisms_ and
// in priority_list_; therefore at the end of looping through all the
@ -1077,58 +1153,104 @@ class XdsClusterResolverLbFactory : public LoadBalancingPolicyFactory {
discovery_mechanisms.emplace_back(std::move(discovery_mechanism));
}
}
// Locality-picking policy.
Json locality_picking_policy;
it = json.object_value().find("localityPickingPolicy");
if (it == json.object_value().end()) {
locality_picking_policy = Json::Array{
Json::Object{
{"weighted_target_experimental",
Json::Object{
{"targets", Json::Object()},
}},
},
};
} else {
locality_picking_policy = it->second;
}
grpc_error* parse_error = GRPC_ERROR_NONE;
if (LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
locality_picking_policy, &parse_error) == nullptr) {
GPR_DEBUG_ASSERT(parse_error != GRPC_ERROR_NONE);
error_list.push_back(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"localityPickingPolicy", &parse_error, 1));
GRPC_ERROR_UNREF(parse_error);
}
// Endpoint-picking policy. Called "childPolicy" for xds policy.
Json endpoint_picking_policy;
it = json.object_value().find("endpointPickingPolicy");
if (it == json.object_value().end()) {
endpoint_picking_policy = Json::Array{
Json::Object{
{"round_robin", Json::Object()},
},
};
} else {
endpoint_picking_policy = it->second;
}
parse_error = GRPC_ERROR_NONE;
if (LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
endpoint_picking_policy, &parse_error) == nullptr) {
GPR_DEBUG_ASSERT(parse_error != GRPC_ERROR_NONE);
error_list.push_back(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"endpointPickingPolicy", &parse_error, 1));
GRPC_ERROR_UNREF(parse_error);
}
if (discovery_mechanisms.empty()) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:discovery_mechanism error:list is missing or empty"));
}
Json xds_lb_policy = Json::Object{
{"ROUND_ROBIN", Json::Object()},
};
it = json.object_value().find("xdsLbPolicy");
if (it != json.object_value().end()) {
if (it->second.type() != Json::Type::ARRAY) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:xdsLbPolicy error:type should be array"));
} else {
const Json::Array& array = it->second.array_value();
for (size_t i = 0; i < array.size(); ++i) {
if (array[i].type() != Json::Type::OBJECT) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:xdsLbPolicy error:element should be of type object"));
continue;
}
const Json::Object& policy = array[i].object_value();
auto policy_it = policy.find("ROUND_ROBIN");
if (policy_it != policy.end()) {
if (policy_it->second.type() != Json::Type::OBJECT) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:ROUND_ROBIN error:type should be object"));
}
break;
}
policy_it = policy.find("RING_HASH");
if (policy_it != policy.end()) {
if (policy_it->second.type() != Json::Type::OBJECT) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:RING_HASH error:type should be object"));
continue;
}
// TODO(donnadionne): Move this to a method in
// ring_hash_experimental and call it here.
const Json::Object& ring_hash = policy_it->second.object_value();
xds_lb_policy = array[i];
size_t min_ring_size = 1024;
size_t max_ring_size = 8388608;
auto ring_hash_it = ring_hash.find("min_ring_size");
if (ring_hash_it == ring_hash.end()) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:min_ring_size missing"));
} else if (ring_hash_it->second.type() != Json::Type::NUMBER) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:min_ring_size error: should be of "
"number"));
} else {
min_ring_size = gpr_parse_nonnegative_int(
ring_hash_it->second.string_value().c_str());
}
ring_hash_it = ring_hash.find("max_ring_size");
if (ring_hash_it == ring_hash.end()) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:max_ring_size missing"));
} else if (ring_hash_it->second.type() != Json::Type::NUMBER) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:max_ring_size error: should be of "
"number"));
} else {
max_ring_size = gpr_parse_nonnegative_int(
ring_hash_it->second.string_value().c_str());
}
if (min_ring_size <= 0 || min_ring_size > 8388608 ||
max_ring_size <= 0 || max_ring_size > 8388608 ||
min_ring_size > max_ring_size) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:max_ring_size and or min_ring_size error: "
"values need to be in the range of 1 to 8388608 "
"and max_ring_size cannot be smaller than "
"min_ring_size"));
}
ring_hash_it = ring_hash.find("hash_function");
if (ring_hash_it == ring_hash.end()) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:hash_function missing"));
} else if (ring_hash_it->second.type() != Json::Type::STRING) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:hash_function error: should be a "
"string"));
} else if (ring_hash_it->second.string_value() != "XX_HASH" &&
ring_hash_it->second.string_value() != "MURMUR_HASH_2") {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:hash_function error: unsupported "
"hash_function"));
}
break;
}
}
}
}
// Construct config.
if (error_list.empty()) {
return MakeRefCounted<XdsClusterResolverLbConfig>(
std::move(discovery_mechanisms), std::move(locality_picking_policy),
std::move(endpoint_picking_policy));
std::move(discovery_mechanisms), std::move(xds_lb_policy));
} else {
*error = GRPC_ERROR_CREATE_FROM_VECTOR(
"xds_cluster_resolver_experimental LB policy config", &error_list);
@ -1236,7 +1358,7 @@ class XdsClusterResolverLbFactory : public LoadBalancingPolicyFactory {
}
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
const char* name, LoadBalancingPolicy::Args args) const override {
const char* /*name*/, LoadBalancingPolicy::Args args) const override {
return MakeOrphanable<XdsClusterResolverLb>(xds_client_, std::move(args));
}

@ -29,13 +29,10 @@ namespace grpc_core {
// Resolver
//
Resolver::Resolver(std::shared_ptr<WorkSerializer> work_serializer,
std::unique_ptr<ResultHandler> result_handler)
Resolver::Resolver()
: InternallyRefCounted(GRPC_TRACE_FLAG_ENABLED(grpc_trace_resolver_refcount)
? "Resolver"
: nullptr),
work_serializer_(std::move(work_serializer)),
result_handler_(std::move(result_handler)) {}
: nullptr) {}
//
// Resolver::Result

@ -125,21 +125,10 @@ class Resolver : public InternallyRefCounted<Resolver> {
}
protected:
Resolver(std::shared_ptr<WorkSerializer> work_serializer,
std::unique_ptr<ResultHandler> result_handler);
Resolver();
/// Shuts down the resolver.
virtual void ShutdownLocked() = 0;
std::shared_ptr<WorkSerializer> work_serializer() const {
return work_serializer_;
}
ResultHandler* result_handler() const { return result_handler_.get(); }
private:
std::shared_ptr<WorkSerializer> work_serializer_;
std::unique_ptr<ResultHandler> result_handler_;
};
} // namespace grpc_core

@ -91,10 +91,20 @@ class AresDnsResolver : public Resolver {
std::string name_to_resolve_;
/// channel args
grpc_channel_args* channel_args_;
/// whether to request the service config
bool request_service_config_;
std::shared_ptr<WorkSerializer> work_serializer_;
std::unique_ptr<ResultHandler> result_handler_;
/// pollset_set to drive the name resolution process
grpc_pollset_set* interested_parties_;
/// whether to request the service config
bool request_service_config_;
// whether or not to enable SRV DNS queries
bool enable_srv_queries_;
// timeout in milliseconds for active DNS queries
int query_timeout_ms_;
/// min interval between DNS requests
grpc_millis min_time_between_resolutions_;
/// closures used by the work_serializer
grpc_closure on_next_resolution_;
grpc_closure on_resolved_;
@ -105,8 +115,6 @@ class AresDnsResolver : public Resolver {
/// next resolution timer
bool have_next_resolution_timer_ = false;
grpc_timer next_resolution_timer_;
/// min interval between DNS requests
grpc_millis min_time_between_resolutions_;
/// timestamp of last DNS request
grpc_millis last_resolution_timestamp_ = -1;
/// retry backoff state
@ -119,14 +127,25 @@ class AresDnsResolver : public Resolver {
char* service_config_json_ = nullptr;
// has shutdown been initiated
bool shutdown_initiated_ = false;
// timeout in milliseconds for active DNS queries
int query_timeout_ms_;
// whether or not to enable SRV DNS queries
bool enable_srv_queries_;
};
AresDnsResolver::AresDnsResolver(ResolverArgs args)
: Resolver(std::move(args.work_serializer), std::move(args.result_handler)),
: dns_server_(args.uri.authority()),
name_to_resolve_(absl::StripPrefix(args.uri.path(), "/")),
channel_args_(grpc_channel_args_copy(args.args)),
work_serializer_(std::move(args.work_serializer)),
result_handler_(std::move(args.result_handler)),
interested_parties_(args.pollset_set),
request_service_config_(!grpc_channel_args_find_bool(
channel_args_, GRPC_ARG_SERVICE_CONFIG_DISABLE_RESOLUTION, true)),
enable_srv_queries_(grpc_channel_args_find_bool(
channel_args_, GRPC_ARG_DNS_ENABLE_SRV_QUERIES, false)),
query_timeout_ms_(grpc_channel_args_find_integer(
channel_args_, GRPC_ARG_DNS_ARES_QUERY_TIMEOUT_MS,
{GRPC_DNS_ARES_DEFAULT_QUERY_TIMEOUT_MS, 0, INT_MAX})),
min_time_between_resolutions_(grpc_channel_args_find_integer(
channel_args_, GRPC_ARG_DNS_MIN_TIME_BETWEEN_RESOLUTIONS_MS,
{1000 * 30, 0, INT_MAX})),
backoff_(
BackOff::Options()
.set_initial_backoff(GRPC_DNS_INITIAL_CONNECT_BACKOFF_SECONDS *
@ -134,42 +153,14 @@ AresDnsResolver::AresDnsResolver(ResolverArgs args)
.set_multiplier(GRPC_DNS_RECONNECT_BACKOFF_MULTIPLIER)
.set_jitter(GRPC_DNS_RECONNECT_JITTER)
.set_max_backoff(GRPC_DNS_RECONNECT_MAX_BACKOFF_SECONDS * 1000)) {
// Closure Initialization
// Closure initialization.
GRPC_CLOSURE_INIT(&on_next_resolution_, OnNextResolution, this,
grpc_schedule_on_exec_ctx);
GRPC_CLOSURE_INIT(&on_resolved_, OnResolved, this, grpc_schedule_on_exec_ctx);
// Get name to resolve from URI path.
name_to_resolve_ = std::string(absl::StripPrefix(args.uri.path(), "/"));
// Get DNS server from URI authority.
dns_server_ = args.uri.authority();
channel_args_ = grpc_channel_args_copy(args.args);
// Disable service config option
const grpc_arg* arg = grpc_channel_args_find(
channel_args_, GRPC_ARG_SERVICE_CONFIG_DISABLE_RESOLUTION);
request_service_config_ = !grpc_channel_arg_get_bool(arg, true);
// Min time b/t resolutions option
arg = grpc_channel_args_find(channel_args_,
GRPC_ARG_DNS_MIN_TIME_BETWEEN_RESOLUTIONS_MS);
min_time_between_resolutions_ =
grpc_channel_arg_get_integer(arg, {1000 * 30, 0, INT_MAX});
// Enable SRV queries option
arg = grpc_channel_args_find(channel_args_, GRPC_ARG_DNS_ENABLE_SRV_QUERIES);
enable_srv_queries_ = grpc_channel_arg_get_bool(arg, false);
interested_parties_ = grpc_pollset_set_create();
if (args.pollset_set != nullptr) {
grpc_pollset_set_add_pollset_set(interested_parties_, args.pollset_set);
}
const grpc_arg* query_timeout_ms_arg =
grpc_channel_args_find(channel_args_, GRPC_ARG_DNS_ARES_QUERY_TIMEOUT_MS);
query_timeout_ms_ = grpc_channel_arg_get_integer(
query_timeout_ms_arg,
{GRPC_DNS_ARES_DEFAULT_QUERY_TIMEOUT_MS, 0, INT_MAX});
}
AresDnsResolver::~AresDnsResolver() {
GRPC_CARES_TRACE_LOG("resolver:%p destroying AresDnsResolver", this);
grpc_pollset_set_destroy(interested_parties_);
grpc_channel_args_destroy(channel_args_);
}
@ -205,8 +196,8 @@ void AresDnsResolver::ShutdownLocked() {
void AresDnsResolver::OnNextResolution(void* arg, grpc_error* error) {
AresDnsResolver* r = static_cast<AresDnsResolver*>(arg);
GRPC_ERROR_REF(error); // ref owned by lambda
r->work_serializer()->Run([r, error]() { r->OnNextResolutionLocked(error); },
DEBUG_LOCATION);
r->work_serializer_->Run([r, error]() { r->OnNextResolutionLocked(error); },
DEBUG_LOCATION);
}
void AresDnsResolver::OnNextResolutionLocked(grpc_error* error) {
@ -317,8 +308,8 @@ std::string ChooseServiceConfig(char* service_config_choice_json,
void AresDnsResolver::OnResolved(void* arg, grpc_error* error) {
AresDnsResolver* r = static_cast<AresDnsResolver*>(arg);
GRPC_ERROR_REF(error); // ref owned by lambda
r->work_serializer()->Run([r, error]() { r->OnResolvedLocked(error); },
DEBUG_LOCATION);
r->work_serializer_->Run([r, error]() { r->OnResolvedLocked(error); },
DEBUG_LOCATION);
}
void AresDnsResolver::OnResolvedLocked(grpc_error* error) {
@ -355,7 +346,7 @@ void AresDnsResolver::OnResolvedLocked(grpc_error* error) {
}
result.args = grpc_channel_args_copy_and_add(channel_args_, new_args.data(),
new_args.size());
result_handler()->ReturnResult(std::move(result));
result_handler_->ReturnResult(std::move(result));
addresses_.reset();
balancer_addresses_.reset();
// Reset backoff state so that we start from the beginning when the
@ -366,7 +357,7 @@ void AresDnsResolver::OnResolvedLocked(grpc_error* error) {
grpc_error_string(error));
std::string error_message =
absl::StrCat("DNS resolution failed for service: ", name_to_resolve_);
result_handler()->ReturnError(grpc_error_set_int(
result_handler_->ReturnError(grpc_error_set_int(
GRPC_ERROR_CREATE_REFERENCING_FROM_COPIED_STRING(error_message.c_str(),
&error, 1),
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE));
@ -436,7 +427,7 @@ void AresDnsResolver::StartResolvingLocked() {
interested_parties_, &on_resolved_, &addresses_,
enable_srv_queries_ ? &balancer_addresses_ : nullptr,
request_service_config_ ? &service_config_json_ : nullptr,
query_timeout_ms_, work_serializer());
query_timeout_ms_, work_serializer_);
last_resolution_timestamp_ = grpc_core::ExecCtx::Get()->Now();
GRPC_CARES_TRACE_LOG("resolver:%p Started resolving. pending_request_:%p",
this, pending_request_);

@ -114,8 +114,6 @@ struct grpc_ares_ev_driver {
std::shared_ptr<grpc_core::WorkSerializer> work_serializer;
/** a list of grpc_fd that this event driver is currently using. */
fd_node* fds;
/** is this event driver currently working? */
bool working;
/** is this event driver being shut down */
bool shutting_down;
/** request object that's using this ev driver */
@ -219,9 +217,9 @@ static void fd_node_shutdown_locked(fd_node* fdn, const char* reason) {
void grpc_ares_ev_driver_on_queries_complete_locked(
grpc_ares_ev_driver* ev_driver) {
// We mark the event driver as being shut down. If the event driver
// is working, grpc_ares_notify_on_event_locked will shut down the
// fds; if it's not working, there are no fds to shut down.
// We mark the event driver as being shut down.
// grpc_ares_notify_on_event_locked will shut down any remaining
// fds.
ev_driver->shutting_down = true;
grpc_timer_cancel(&ev_driver->query_timeout);
grpc_timer_cancel(&ev_driver->ares_backup_poll_alarm);
@ -483,43 +481,34 @@ static void grpc_ares_notify_on_event_locked(grpc_ares_ev_driver* ev_driver) {
}
}
ev_driver->fds = new_list;
// If the ev driver has no working fd, all the tasks are done.
if (new_list == nullptr) {
ev_driver->working = false;
GRPC_CARES_TRACE_LOG("request:%p ev driver stop working",
ev_driver->request);
}
}
void grpc_ares_ev_driver_start_locked(grpc_ares_ev_driver* ev_driver) {
if (!ev_driver->working) {
ev_driver->working = true;
grpc_ares_notify_on_event_locked(ev_driver);
// Initialize overall DNS resolution timeout alarm
grpc_millis timeout =
ev_driver->query_timeout_ms == 0
? GRPC_MILLIS_INF_FUTURE
: ev_driver->query_timeout_ms + grpc_core::ExecCtx::Get()->Now();
GRPC_CARES_TRACE_LOG(
"request:%p ev_driver=%p grpc_ares_ev_driver_start_locked. timeout in "
"%" PRId64 " ms",
ev_driver->request, ev_driver, timeout);
grpc_ares_ev_driver_ref(ev_driver);
GRPC_CLOSURE_INIT(&ev_driver->on_timeout_locked, on_timeout, ev_driver,
grpc_schedule_on_exec_ctx);
grpc_timer_init(&ev_driver->query_timeout, timeout,
&ev_driver->on_timeout_locked);
// Initialize the backup poll alarm
grpc_millis next_ares_backup_poll_alarm =
calculate_next_ares_backup_poll_alarm_ms(ev_driver);
grpc_ares_ev_driver_ref(ev_driver);
GRPC_CLOSURE_INIT(&ev_driver->on_ares_backup_poll_alarm_locked,
on_ares_backup_poll_alarm, ev_driver,
grpc_schedule_on_exec_ctx);
grpc_timer_init(&ev_driver->ares_backup_poll_alarm,
next_ares_backup_poll_alarm,
&ev_driver->on_ares_backup_poll_alarm_locked);
}
grpc_ares_notify_on_event_locked(ev_driver);
// Initialize overall DNS resolution timeout alarm
grpc_millis timeout =
ev_driver->query_timeout_ms == 0
? GRPC_MILLIS_INF_FUTURE
: ev_driver->query_timeout_ms + grpc_core::ExecCtx::Get()->Now();
GRPC_CARES_TRACE_LOG(
"request:%p ev_driver=%p grpc_ares_ev_driver_start_locked. timeout in "
"%" PRId64 " ms",
ev_driver->request, ev_driver, timeout);
grpc_ares_ev_driver_ref(ev_driver);
GRPC_CLOSURE_INIT(&ev_driver->on_timeout_locked, on_timeout, ev_driver,
grpc_schedule_on_exec_ctx);
grpc_timer_init(&ev_driver->query_timeout, timeout,
&ev_driver->on_timeout_locked);
// Initialize the backup poll alarm
grpc_millis next_ares_backup_poll_alarm =
calculate_next_ares_backup_poll_alarm_ms(ev_driver);
grpc_ares_ev_driver_ref(ev_driver);
GRPC_CLOSURE_INIT(&ev_driver->on_ares_backup_poll_alarm_locked,
on_ares_backup_poll_alarm, ev_driver,
grpc_schedule_on_exec_ctx);
grpc_timer_init(&ev_driver->ares_backup_poll_alarm,
next_ares_backup_poll_alarm,
&ev_driver->on_ares_backup_poll_alarm_locked);
}
static void noop_inject_channel_config(ares_channel /*channel*/) {}
@ -551,7 +540,6 @@ grpc_error* grpc_ares_ev_driver_create_locked(
gpr_ref_init(&(*ev_driver)->refs, 1);
(*ev_driver)->pollset_set = pollset_set;
(*ev_driver)->fds = nullptr;
(*ev_driver)->working = false;
(*ev_driver)->shutting_down = false;
(*ev_driver)->request = request;
(*ev_driver)->polled_fd_factory =
@ -757,7 +745,7 @@ static void on_srv_query_done_locked(void* arg, int status, int /*timeouts*/,
r, srv_it->host, htons(srv_it->port), true /* is_balancer */, "A");
ares_gethostbyname(r->ev_driver->channel, hr->host, AF_INET,
on_hostbyname_done_locked, hr);
grpc_ares_ev_driver_start_locked(r->ev_driver);
grpc_ares_notify_on_event_locked(r->ev_driver);
}
}
if (reply != nullptr) {

@ -77,6 +77,8 @@ class NativeDnsResolver : public Resolver {
std::string name_to_resolve_;
/// channel args
grpc_channel_args* channel_args_ = nullptr;
std::shared_ptr<WorkSerializer> work_serializer_;
std::unique_ptr<ResultHandler> result_handler_;
/// pollset_set to drive the name resolution process
grpc_pollset_set* interested_parties_ = nullptr;
/// are we shutting down?
@ -99,7 +101,14 @@ class NativeDnsResolver : public Resolver {
};
NativeDnsResolver::NativeDnsResolver(ResolverArgs args)
: Resolver(std::move(args.work_serializer), std::move(args.result_handler)),
: name_to_resolve_(absl::StripPrefix(args.uri.path(), "/")),
channel_args_(grpc_channel_args_copy(args.args)),
work_serializer_(std::move(args.work_serializer)),
result_handler_(std::move(args.result_handler)),
interested_parties_(grpc_pollset_set_create()),
min_time_between_resolutions_(grpc_channel_args_find_integer(
channel_args_, GRPC_ARG_DNS_MIN_TIME_BETWEEN_RESOLUTIONS_MS,
{1000 * 30, 0, INT_MAX})),
backoff_(
BackOff::Options()
.set_initial_backoff(GRPC_DNS_INITIAL_CONNECT_BACKOFF_SECONDS *
@ -107,13 +116,6 @@ NativeDnsResolver::NativeDnsResolver(ResolverArgs args)
.set_multiplier(GRPC_DNS_RECONNECT_BACKOFF_MULTIPLIER)
.set_jitter(GRPC_DNS_RECONNECT_JITTER)
.set_max_backoff(GRPC_DNS_RECONNECT_MAX_BACKOFF_SECONDS * 1000)) {
name_to_resolve_ = std::string(absl::StripPrefix(args.uri.path(), "/"));
channel_args_ = grpc_channel_args_copy(args.args);
const grpc_arg* arg = grpc_channel_args_find(
args.args, GRPC_ARG_DNS_MIN_TIME_BETWEEN_RESOLUTIONS_MS);
min_time_between_resolutions_ =
grpc_channel_arg_get_integer(arg, {1000 * 30, 0, INT_MAX});
interested_parties_ = grpc_pollset_set_create();
if (args.pollset_set != nullptr) {
grpc_pollset_set_add_pollset_set(interested_parties_, args.pollset_set);
}
@ -149,8 +151,8 @@ void NativeDnsResolver::ShutdownLocked() {
void NativeDnsResolver::OnNextResolution(void* arg, grpc_error* error) {
NativeDnsResolver* r = static_cast<NativeDnsResolver*>(arg);
GRPC_ERROR_REF(error); // ref owned by lambda
r->work_serializer()->Run([r, error]() { r->OnNextResolutionLocked(error); },
DEBUG_LOCATION);
r->work_serializer_->Run([r, error]() { r->OnNextResolutionLocked(error); },
DEBUG_LOCATION);
}
void NativeDnsResolver::OnNextResolutionLocked(grpc_error* error) {
@ -165,8 +167,8 @@ void NativeDnsResolver::OnNextResolutionLocked(grpc_error* error) {
void NativeDnsResolver::OnResolved(void* arg, grpc_error* error) {
NativeDnsResolver* r = static_cast<NativeDnsResolver*>(arg);
GRPC_ERROR_REF(error); // owned by lambda
r->work_serializer()->Run([r, error]() { r->OnResolvedLocked(error); },
DEBUG_LOCATION);
r->work_serializer_->Run([r, error]() { r->OnResolvedLocked(error); },
DEBUG_LOCATION);
}
void NativeDnsResolver::OnResolvedLocked(grpc_error* error) {
@ -186,7 +188,7 @@ void NativeDnsResolver::OnResolvedLocked(grpc_error* error) {
}
grpc_resolved_addresses_destroy(addresses_);
result.args = grpc_channel_args_copy(channel_args_);
result_handler()->ReturnResult(std::move(result));
result_handler_->ReturnResult(std::move(result));
// Reset backoff state so that we start from the beginning when the
// next request gets triggered.
backoff_.Reset();
@ -196,7 +198,7 @@ void NativeDnsResolver::OnResolvedLocked(grpc_error* error) {
// Return transient error.
std::string error_message =
absl::StrCat("DNS resolution failed for service: ", name_to_resolve_);
result_handler()->ReturnError(grpc_error_set_int(
result_handler_->ReturnError(grpc_error_set_int(
GRPC_ERROR_CREATE_REFERENCING_FROM_COPIED_STRING(error_message.c_str(),
&error, 1),
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE));

@ -69,6 +69,8 @@ class FakeResolver : public Resolver {
// passed-in parameters
grpc_channel_args* channel_args_ = nullptr;
std::shared_ptr<WorkSerializer> work_serializer_;
std::unique_ptr<ResultHandler> result_handler_;
RefCountedPtr<FakeResolverResponseGenerator> response_generator_;
// If has_next_result_ is true, next_result_ is the next resolution result
// to be returned.
@ -89,7 +91,8 @@ class FakeResolver : public Resolver {
};
FakeResolver::FakeResolver(ResolverArgs args)
: Resolver(std::move(args.work_serializer), std::move(args.result_handler)),
: work_serializer_(std::move(args.work_serializer)),
result_handler_(std::move(args.result_handler)),
response_generator_(
FakeResolverResponseGenerator::GetFromArgs(args.args)) {
// Channels sharing the same subchannels may have different resolver response
@ -121,8 +124,8 @@ void FakeResolver::RequestReresolutionLocked() {
if (!reresolution_closure_pending_) {
reresolution_closure_pending_ = true;
Ref().release(); // ref held by closure
work_serializer()->Run([this]() { ReturnReresolutionResult(); },
DEBUG_LOCATION);
work_serializer_->Run([this]() { ReturnReresolutionResult(); },
DEBUG_LOCATION);
}
}
}
@ -140,7 +143,7 @@ void FakeResolver::MaybeSendResultLocked() {
if (return_failure_) {
// TODO(roth): Change resolver result generator to be able to inject
// the error to be returned.
result_handler()->ReturnError(grpc_error_set_int(
result_handler_->ReturnError(grpc_error_set_int(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Resolver transient failure"),
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE));
return_failure_ = false;
@ -155,7 +158,7 @@ void FakeResolver::MaybeSendResultLocked() {
// name, only the one in next_results_ will be kept since next_results_ is
// before channel_args_.
result.args = grpc_channel_args_union(next_result_.args, channel_args_);
result_handler()->ReturnResult(std::move(result));
result_handler_->ReturnResult(std::move(result));
has_next_result_ = false;
}
}
@ -236,8 +239,8 @@ void FakeResolverResponseGenerator::SetResponse(Resolver::Result result) {
}
FakeResolverResponseSetter* arg =
new FakeResolverResponseSetter(resolver, std::move(result));
resolver->work_serializer()->Run([arg]() { arg->SetResponseLocked(); },
DEBUG_LOCATION);
resolver->work_serializer_->Run([arg]() { arg->SetResponseLocked(); },
DEBUG_LOCATION);
}
void FakeResolverResponseGenerator::SetReresolutionResponse(
@ -250,7 +253,7 @@ void FakeResolverResponseGenerator::SetReresolutionResponse(
}
FakeResolverResponseSetter* arg = new FakeResolverResponseSetter(
resolver, std::move(result), true /* has_result */);
resolver->work_serializer()->Run(
resolver->work_serializer_->Run(
[arg]() { arg->SetReresolutionResponseLocked(); }, DEBUG_LOCATION);
}
@ -263,7 +266,7 @@ void FakeResolverResponseGenerator::UnsetReresolutionResponse() {
}
FakeResolverResponseSetter* arg =
new FakeResolverResponseSetter(resolver, Resolver::Result());
resolver->work_serializer()->Run(
resolver->work_serializer_->Run(
[arg]() { arg->SetReresolutionResponseLocked(); }, DEBUG_LOCATION);
}
@ -276,8 +279,8 @@ void FakeResolverResponseGenerator::SetFailure() {
}
FakeResolverResponseSetter* arg =
new FakeResolverResponseSetter(resolver, Resolver::Result());
resolver->work_serializer()->Run([arg]() { arg->SetFailureLocked(); },
DEBUG_LOCATION);
resolver->work_serializer_->Run([arg]() { arg->SetFailureLocked(); },
DEBUG_LOCATION);
}
void FakeResolverResponseGenerator::SetFailureOnReresolution() {
@ -290,8 +293,8 @@ void FakeResolverResponseGenerator::SetFailureOnReresolution() {
FakeResolverResponseSetter* arg = new FakeResolverResponseSetter(
resolver, Resolver::Result(), false /* has_result */,
false /* immediate */);
resolver->work_serializer()->Run([arg]() { arg->SetFailureLocked(); },
DEBUG_LOCATION);
resolver->work_serializer_->Run([arg]() { arg->SetFailureLocked(); },
DEBUG_LOCATION);
}
void FakeResolverResponseGenerator::SetFakeResolver(
@ -302,8 +305,8 @@ void FakeResolverResponseGenerator::SetFakeResolver(
if (has_result_) {
FakeResolverResponseSetter* arg =
new FakeResolverResponseSetter(resolver_, std::move(result_));
resolver_->work_serializer()->Run([arg]() { arg->SetResponseLocked(); },
DEBUG_LOCATION);
resolver_->work_serializer_->Run([arg]() { arg->SetResponseLocked(); },
DEBUG_LOCATION);
has_result_ = false;
}
}

@ -0,0 +1,362 @@
//
// Copyright 2021 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/filters/client_channel/resolver_registry.h"
#include "src/core/ext/xds/xds_client.h"
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/http/httpcli.h"
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/security/credentials/alts/check_gcp_environment.h"
namespace grpc_core {
namespace {
class GoogleCloud2ProdResolver : public Resolver {
public:
explicit GoogleCloud2ProdResolver(ResolverArgs args);
void StartLocked() override;
void RequestReresolutionLocked() override;
void ResetBackoffLocked() override;
void ShutdownLocked() override;
private:
// Represents an HTTP request to the metadata server.
class MetadataQuery : public InternallyRefCounted<MetadataQuery> {
public:
MetadataQuery(RefCountedPtr<GoogleCloud2ProdResolver> resolver,
const char* path, grpc_polling_entity* pollent);
~MetadataQuery() override;
void Orphan() override;
private:
static void OnHttpRequestDone(void* arg, grpc_error* error);
// Calls OnDone() if not already called. Releases a ref.
void MaybeCallOnDone(grpc_error* error);
// If error is not GRPC_ERROR_NONE, then it's not safe to look at response.
virtual void OnDone(GoogleCloud2ProdResolver* resolver,
const grpc_http_response* response,
grpc_error* error) = 0;
RefCountedPtr<GoogleCloud2ProdResolver> resolver_;
grpc_httpcli_context context_;
grpc_httpcli_response response_;
grpc_closure on_done_;
Atomic<bool> on_done_called_{false};
};
// A metadata server query to get the zone.
class ZoneQuery : public MetadataQuery {
public:
ZoneQuery(RefCountedPtr<GoogleCloud2ProdResolver> resolver,
grpc_polling_entity* pollent);
private:
void OnDone(GoogleCloud2ProdResolver* resolver,
const grpc_http_response* response, grpc_error* error) override;
};
// A metadata server query to get the IPv6 address.
class IPv6Query : public MetadataQuery {
public:
IPv6Query(RefCountedPtr<GoogleCloud2ProdResolver> resolver,
grpc_polling_entity* pollent);
private:
void OnDone(GoogleCloud2ProdResolver* resolver,
const grpc_http_response* response, grpc_error* error) override;
};
void ZoneQueryDone(std::string zone);
void IPv6QueryDone(bool ipv6_supported);
void StartXdsResolver();
std::shared_ptr<WorkSerializer> work_serializer_;
grpc_polling_entity pollent_;
bool using_dns_ = false;
OrphanablePtr<Resolver> child_resolver_;
OrphanablePtr<ZoneQuery> zone_query_;
absl::optional<std::string> zone_;
OrphanablePtr<IPv6Query> ipv6_query_;
absl::optional<bool> supports_ipv6_;
};
//
// GoogleCloud2ProdResolver::MetadataQuery
//
GoogleCloud2ProdResolver::MetadataQuery::MetadataQuery(
RefCountedPtr<GoogleCloud2ProdResolver> resolver, const char* path,
grpc_polling_entity* pollent)
: resolver_(std::move(resolver)) {
grpc_httpcli_context_init(&context_);
// Start HTTP request.
GRPC_CLOSURE_INIT(&on_done_, OnHttpRequestDone, this, nullptr);
Ref().release(); // Ref held by callback.
grpc_httpcli_request request;
memset(&request, 0, sizeof(grpc_httpcli_request));
grpc_http_header header = {const_cast<char*>("Metadata-Flavor"),
const_cast<char*>("Google")};
request.host = const_cast<char*>("metadata.google.internal");
request.http.path = const_cast<char*>(path);
request.http.hdr_count = 1;
request.http.hdrs = &header;
grpc_resource_quota* resource_quota =
grpc_resource_quota_create("c2p_resolver");
grpc_httpcli_get(&context_, pollent, resource_quota, &request,
ExecCtx::Get()->Now() + 10000, // 10s timeout
&on_done_, &response_);
grpc_resource_quota_unref_internal(resource_quota);
}
GoogleCloud2ProdResolver::MetadataQuery::~MetadataQuery() {
grpc_httpcli_context_destroy(&context_);
grpc_http_response_destroy(&response_);
}
void GoogleCloud2ProdResolver::MetadataQuery::Orphan() {
// TODO(roth): Once the HTTP client library supports cancellation,
// use that here.
MaybeCallOnDone(GRPC_ERROR_CANCELLED);
}
void GoogleCloud2ProdResolver::MetadataQuery::OnHttpRequestDone(
void* arg, grpc_error* error) {
auto* self = static_cast<MetadataQuery*>(arg);
self->MaybeCallOnDone(GRPC_ERROR_REF(error));
}
void GoogleCloud2ProdResolver::MetadataQuery::MaybeCallOnDone(
grpc_error* error) {
bool expected = false;
if (!on_done_called_.CompareExchangeStrong(
&expected, true, MemoryOrder::RELAXED, MemoryOrder::RELAXED)) {
// We've already called OnDone(), so just clean up.
GRPC_ERROR_UNREF(error);
Unref();
return;
}
// Hop back into WorkSerializer to call OnDone().
// Note: We implicitly pass our ref to the callback here.
resolver_->work_serializer_->Run(
[this, error]() {
OnDone(resolver_.get(), &response_, error);
Unref();
},
DEBUG_LOCATION);
}
//
// GoogleCloud2ProdResolver::ZoneQuery
//
GoogleCloud2ProdResolver::ZoneQuery::ZoneQuery(
RefCountedPtr<GoogleCloud2ProdResolver> resolver,
grpc_polling_entity* pollent)
: MetadataQuery(std::move(resolver), "/computeMetadata/v1/instance/zone",
pollent) {}
void GoogleCloud2ProdResolver::ZoneQuery::OnDone(
GoogleCloud2ProdResolver* resolver, const grpc_http_response* response,
grpc_error* error) {
if (error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR, "error fetching zone from metadata server: %s",
grpc_error_string(error));
}
std::string zone;
if (error == GRPC_ERROR_NONE && response->status == 200) {
absl::string_view body(response->body, response->body_length);
size_t i = body.find_last_of('/');
if (i == body.npos) {
gpr_log(GPR_ERROR, "could not parse zone from metadata server: %s",
std::string(body).c_str());
} else {
zone = std::string(body.substr(i));
}
}
resolver->ZoneQueryDone(std::move(zone));
GRPC_ERROR_UNREF(error);
}
//
// GoogleCloud2ProdResolver::IPv6Query
//
GoogleCloud2ProdResolver::IPv6Query::IPv6Query(
RefCountedPtr<GoogleCloud2ProdResolver> resolver,
grpc_polling_entity* pollent)
: MetadataQuery(std::move(resolver),
"/computeMetadata/v1/instance/network-interfaces/0/ipv6s",
pollent) {}
void GoogleCloud2ProdResolver::IPv6Query::OnDone(
GoogleCloud2ProdResolver* resolver, const grpc_http_response* response,
grpc_error* error) {
if (error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR, "error fetching IPv6 address from metadata server: %s",
grpc_error_string(error));
}
resolver->IPv6QueryDone(error == GRPC_ERROR_NONE && response->status == 200);
GRPC_ERROR_UNREF(error);
}
//
// GoogleCloud2ProdResolver
//
GoogleCloud2ProdResolver::GoogleCloud2ProdResolver(ResolverArgs args)
: work_serializer_(std::move(args.work_serializer)),
pollent_(grpc_polling_entity_create_from_pollset_set(args.pollset_set)) {
absl::string_view name_to_resolve = absl::StripPrefix(args.uri.path(), "/");
// If we're not running on GCP, we can't use DirectPath, so delegate
// to the DNS resolver.
if (!grpc_alts_is_running_on_gcp() ||
// If the client is already using xDS, we can't use it here, because
// they may be talking to a completely different xDS server than we
// want to.
// TODO(roth): When we implement xDS federation, remove this constraint.
UniquePtr<char>(gpr_getenv("GRPC_XDS_BOOTSTRAP")) != nullptr ||
UniquePtr<char>(gpr_getenv("GRPC_XDS_BOOTSTRAP_CONFIG")) != nullptr) {
using_dns_ = true;
child_resolver_ = ResolverRegistry::CreateResolver(
absl::StrCat("dns:", name_to_resolve).c_str(), args.args,
args.pollset_set, work_serializer_, std::move(args.result_handler));
GPR_ASSERT(child_resolver_ != nullptr);
return;
}
// Create xds resolver.
child_resolver_ = ResolverRegistry::CreateResolver(
absl::StrCat("xds:", name_to_resolve).c_str(), args.args,
args.pollset_set, work_serializer_, std::move(args.result_handler));
GPR_ASSERT(child_resolver_ != nullptr);
}
void GoogleCloud2ProdResolver::StartLocked() {
if (using_dns_) {
child_resolver_->StartLocked();
return;
}
// Using xDS. Start metadata server queries.
zone_query_ = MakeOrphanable<ZoneQuery>(Ref(), &pollent_);
ipv6_query_ = MakeOrphanable<IPv6Query>(Ref(), &pollent_);
}
void GoogleCloud2ProdResolver::RequestReresolutionLocked() {
if (child_resolver_ != nullptr) {
child_resolver_->RequestReresolutionLocked();
}
}
void GoogleCloud2ProdResolver::ResetBackoffLocked() {
if (child_resolver_ != nullptr) {
child_resolver_->ResetBackoffLocked();
}
}
void GoogleCloud2ProdResolver::ShutdownLocked() {
zone_query_.reset();
ipv6_query_.reset();
child_resolver_.reset();
}
void GoogleCloud2ProdResolver::ZoneQueryDone(std::string zone) {
zone_query_.reset();
zone_ = std::move(zone);
if (supports_ipv6_.has_value()) StartXdsResolver();
}
void GoogleCloud2ProdResolver::IPv6QueryDone(bool ipv6_supported) {
ipv6_query_.reset();
supports_ipv6_ = ipv6_supported;
if (zone_.has_value()) StartXdsResolver();
}
void GoogleCloud2ProdResolver::StartXdsResolver() {
// Construct bootstrap JSON.
Json::Object node = {
{"id", "C2P"},
};
if (!zone_->empty()) {
node["locality"] = Json::Object{
{"zone", *zone_},
};
};
if (*supports_ipv6_) {
node["metadata"] = Json::Object{
{"TRAFFICDIRECTOR_DIRECTPATH_C2P_IPV6_CAPABLE", true},
};
}
Json bootstrap = Json::Object{
{"xds_servers",
Json::Array{
Json::Object{
{"server_uri", "directpath-trafficdirector.googleapis.com"},
{"channel_creds",
Json::Array{
Json::Object{
{"type", "google_default"},
},
}},
},
}},
{"node", std::move(node)},
};
// Inject bootstrap JSON as fallback config.
internal::SetXdsFallbackBootstrapConfig(bootstrap.Dump().c_str());
// Now start xDS resolver.
child_resolver_->StartLocked();
}
//
// Factory
//
class GoogleCloud2ProdResolverFactory : public ResolverFactory {
public:
bool IsValidUri(const URI& uri) const override {
if (GPR_UNLIKELY(!uri.authority().empty())) {
gpr_log(GPR_ERROR, "google-c2p URI scheme does not support authorities");
return false;
}
return true;
}
OrphanablePtr<Resolver> CreateResolver(ResolverArgs args) const override {
if (!IsValidUri(args.uri)) return nullptr;
return MakeOrphanable<GoogleCloud2ProdResolver>(std::move(args));
}
const char* scheme() const override { return "google-c2p"; }
};
} // namespace
void GoogleCloud2ProdResolverInit() {
ResolverRegistry::Builder::RegisterResolverFactory(
absl::make_unique<GoogleCloud2ProdResolverFactory>());
}
void GoogleCloud2ProdResolverShutdown() {}
} // namespace grpc_core

@ -35,7 +35,6 @@
#include "src/core/lib/iomgr/parse_address.h"
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
#include "src/core/lib/iomgr/work_serializer.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
@ -53,13 +52,14 @@ class SockaddrResolver : public Resolver {
void ShutdownLocked() override {}
private:
std::unique_ptr<ResultHandler> result_handler_;
ServerAddressList addresses_;
const grpc_channel_args* channel_args_ = nullptr;
};
SockaddrResolver::SockaddrResolver(ServerAddressList addresses,
ResolverArgs args)
: Resolver(std::move(args.work_serializer), std::move(args.result_handler)),
: result_handler_(std::move(args.result_handler)),
addresses_(std::move(addresses)),
channel_args_(grpc_channel_args_copy(args.args)) {}
@ -73,7 +73,7 @@ void SockaddrResolver::StartLocked() {
// TODO(roth): Use std::move() once channel args is converted to C++.
result.args = channel_args_;
channel_args_ = nullptr;
result_handler()->ReturnResult(std::move(result));
result_handler_->ReturnResult(std::move(result));
}
//
@ -150,7 +150,7 @@ class UnixResolverFactory : public ResolverFactory {
return CreateSockaddrResolver(std::move(args), grpc_parse_unix);
}
std::string GetDefaultAuthority(const URI& uri) const override {
std::string GetDefaultAuthority(const URI& /*uri*/) const override {
return "localhost";
}

@ -46,8 +46,8 @@ namespace {
class XdsResolver : public Resolver {
public:
explicit XdsResolver(ResolverArgs args)
: Resolver(std::move(args.work_serializer),
std::move(args.result_handler)),
: work_serializer_(std::move(args.work_serializer)),
result_handler_(std::move(args.result_handler)),
server_name_(absl::StripPrefix(args.uri.path(), "/")),
args_(grpc_channel_args_copy(args.args)),
interested_parties_(args.pollset_set) {
@ -182,6 +182,8 @@ class XdsResolver : public Resolver {
void GenerateResult();
void MaybeRemoveUnusedClusters();
std::shared_ptr<WorkSerializer> work_serializer_;
std::unique_ptr<ResultHandler> result_handler_;
std::string server_name_;
const grpc_channel_args* args_;
grpc_pollset_set* interested_parties_;
@ -231,7 +233,7 @@ XdsResolver::Notifier::Notifier(RefCountedPtr<XdsResolver> resolver)
void XdsResolver::Notifier::RunInExecCtx(void* arg, grpc_error* error) {
Notifier* self = static_cast<Notifier*>(arg);
GRPC_ERROR_REF(error);
self->resolver_->work_serializer()->Run(
self->resolver_->work_serializer_->Run(
[self, error]() { self->RunInWorkSerializer(error); }, DEBUG_LOCATION);
}
@ -359,28 +361,6 @@ void XdsResolver::XdsConfigSelector::MaybeAddCluster(const std::string& name) {
}
}
bool PathMatch(const absl::string_view& path,
const XdsApi::Route::Matchers::PathMatcher& path_matcher) {
switch (path_matcher.type) {
case XdsApi::Route::Matchers::PathMatcher::PathMatcherType::PREFIX:
return path_matcher.case_sensitive
? absl::StartsWith(path, path_matcher.string_matcher)
: absl::StartsWithIgnoreCase(path,
path_matcher.string_matcher);
case XdsApi::Route::Matchers::PathMatcher::PathMatcherType::PATH:
return path_matcher.case_sensitive
? path == path_matcher.string_matcher
: absl::EqualsIgnoreCase(path, path_matcher.string_matcher);
case XdsApi::Route::Matchers::PathMatcher::PathMatcherType::REGEX:
// Note: Case-sensitive option will already have been set appropriately
// in path_matcher.regex_matcher when it was constructed, so no
// need to check it here.
return RE2::FullMatch(path.data(), *path_matcher.regex_matcher);
default:
return false;
}
}
absl::optional<absl::string_view> GetMetadataValue(
const std::string& target_key, grpc_metadata_batch* initial_metadata,
std::string* concatenated_value) {
@ -404,61 +384,29 @@ absl::optional<absl::string_view> GetMetadataValue(
return *concatenated_value;
}
bool HeaderMatchHelper(
const XdsApi::Route::Matchers::HeaderMatcher& header_matcher,
grpc_metadata_batch* initial_metadata) {
bool HeaderMatchHelper(const HeaderMatcher& header_matcher,
grpc_metadata_batch* initial_metadata) {
std::string concatenated_value;
absl::optional<absl::string_view> value;
// Note: If we ever allow binary headers here, we still need to
// special-case ignore "grpc-tags-bin" and "grpc-trace-bin", since
// they are not visible to the LB policy in grpc-go.
if (absl::EndsWith(header_matcher.name, "-bin") ||
header_matcher.name == "grpc-previous-rpc-attempts") {
if (absl::EndsWith(header_matcher.name(), "-bin") ||
header_matcher.name() == "grpc-previous-rpc-attempts") {
value = absl::nullopt;
} else if (header_matcher.name == "content-type") {
} else if (header_matcher.name() == "content-type") {
value = "application/grpc";
} else {
value = GetMetadataValue(header_matcher.name, initial_metadata,
value = GetMetadataValue(header_matcher.name(), initial_metadata,
&concatenated_value);
}
if (!value.has_value()) {
if (header_matcher.type ==
XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::PRESENT) {
return !header_matcher.present_match;
} else {
// For all other header matcher types, we need the header value to
// exist to consider matches.
return false;
}
}
switch (header_matcher.type) {
case XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::EXACT:
return value.value() == header_matcher.string_matcher;
case XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::REGEX:
return RE2::FullMatch(value.value().data(), *header_matcher.regex_match);
case XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::RANGE:
int64_t int_value;
if (!absl::SimpleAtoi(value.value(), &int_value)) {
return false;
}
return int_value >= header_matcher.range_start &&
int_value < header_matcher.range_end;
case XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::PREFIX:
return absl::StartsWith(value.value(), header_matcher.string_matcher);
case XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::SUFFIX:
return absl::EndsWith(value.value(), header_matcher.string_matcher);
default:
return false;
}
return header_matcher.Match(value);
}
bool HeadersMatch(
const std::vector<XdsApi::Route::Matchers::HeaderMatcher>& header_matchers,
grpc_metadata_batch* initial_metadata) {
bool HeadersMatch(const std::vector<HeaderMatcher>& header_matchers,
grpc_metadata_batch* initial_metadata) {
for (const auto& header_matcher : header_matchers) {
bool match = HeaderMatchHelper(header_matcher, initial_metadata);
if (header_matcher.invert_match) match = !match;
if (!match) return false;
if (!HeaderMatchHelper(header_matcher, initial_metadata)) return false;
}
return true;
}
@ -473,8 +421,8 @@ ConfigSelector::CallConfig XdsResolver::XdsConfigSelector::GetCallConfig(
GetCallConfigArgs args) {
for (const auto& entry : route_table_) {
// Path matching.
if (!PathMatch(StringViewFromSlice(*args.path),
entry.route.matchers.path_matcher)) {
if (!entry.route.matchers.path_matcher.Match(
StringViewFromSlice(*args.path))) {
continue;
}
// Header Matching.
@ -543,7 +491,7 @@ ConfigSelector::CallConfig XdsResolver::XdsConfigSelector::GetCallConfig(
GRPC_CLOSURE_CREATE(
[](void* arg, grpc_error* /*error*/) {
auto* resolver = static_cast<XdsResolver*>(arg);
resolver->work_serializer()->Run(
resolver->work_serializer_->Run(
[resolver]() {
resolver->MaybeRemoveUnusedClusters();
resolver->Unref();
@ -570,7 +518,7 @@ void XdsResolver::StartLocked() {
"Failed to create xds client -- channel will remain in "
"TRANSIENT_FAILURE: %s",
grpc_error_string(error));
result_handler()->ReturnError(error);
result_handler_->ReturnError(error);
return;
}
grpc_pollset_set_add_pollset_set(xds_client_->interested_parties(),
@ -662,7 +610,7 @@ void XdsResolver::OnError(grpc_error* error) {
Result result;
result.args = grpc_channel_args_copy(args_);
result.service_config_error = error;
result_handler()->ReturnResult(std::move(result));
result_handler_->ReturnResult(std::move(result));
}
void XdsResolver::OnResourceDoesNotExist() {
@ -676,7 +624,7 @@ void XdsResolver::OnResourceDoesNotExist() {
ServiceConfig::Create(args_, "{}", &result.service_config_error);
GPR_ASSERT(result.service_config != nullptr);
result.args = grpc_channel_args_copy(args_);
result_handler()->ReturnResult(std::move(result));
result_handler_->ReturnResult(std::move(result));
}
grpc_error* XdsResolver::CreateServiceConfig(
@ -734,7 +682,7 @@ void XdsResolver::GenerateResult() {
}
grpc_arg new_arg = config_selector->MakeChannelArg();
result.args = grpc_channel_args_copy_and_add(args_, &new_arg, 1);
result_handler()->ReturnResult(std::move(result));
result_handler_->ReturnResult(std::move(result));
}
void XdsResolver::MaybeRemoveUnusedClusters() {

@ -31,6 +31,12 @@
namespace grpc_core {
//
// ServerAddressWeightAttribute
//
const char* ServerAddressWeightAttribute::kServerAddressWeightAttributeKey =
"server_address_weight";
//
// ServerAddress
//

@ -25,8 +25,10 @@
#include <memory>
#include "absl/container/inlined_vector.h"
#include "absl/strings/str_format.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/resolve_address.h"
namespace grpc_core {
@ -108,6 +110,35 @@ class ServerAddress {
typedef absl::InlinedVector<ServerAddress, 1> ServerAddressList;
//
// ServerAddressWeightAttribute
//
class ServerAddressWeightAttribute : public ServerAddress::AttributeInterface {
public:
static const char* kServerAddressWeightAttributeKey;
explicit ServerAddressWeightAttribute(uint32_t weight) : weight_(weight) {}
uint32_t weight() const { return weight_; }
std::unique_ptr<AttributeInterface> Copy() const override {
return absl::make_unique<ServerAddressWeightAttribute>(weight_);
}
int Cmp(const AttributeInterface* other) const override {
const auto* other_locality_attr =
static_cast<const ServerAddressWeightAttribute*>(other);
return GPR_ICMP(weight_, other_locality_attr->weight_);
}
std::string ToString() const override {
return absl::StrFormat("%d", weight_);
}
private:
uint32_t weight_;
};
} // namespace grpc_core
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVER_ADDRESS_H */

@ -72,7 +72,7 @@ grpc_error* ServerLoadReportingChannelData::Init(
void ServerLoadReportingCallData::Destroy(
grpc_call_element* elem, const grpc_call_final_info* final_info,
grpc_closure* then_call_closure) {
grpc_closure* /*then_call_closure*/) {
ServerLoadReportingChannelData* chand =
reinterpret_cast<ServerLoadReportingChannelData*>(elem->channel_data);
// Only record an end if we've recorded its corresponding start, which is
@ -200,7 +200,7 @@ void ServerLoadReportingCallData::StoreClientIpAndLrToken(const char* lr_token,
strncpy(cur_pos, lr_token, lr_token_len);
}
GPR_ASSERT(cur_pos + lr_token_len - client_ip_and_lr_token_ ==
client_ip_and_lr_token_len_);
long(client_ip_and_lr_token_len_));
}
grpc_filtered_mdelem ServerLoadReportingCallData::RecvInitialMetadataFilter(
@ -265,7 +265,7 @@ void ServerLoadReportingCallData::RecvInitialMetadataReady(void* arg,
}
grpc_error* ServerLoadReportingCallData::Init(
grpc_call_element* elem, const grpc_call_element_args* args) {
grpc_call_element* elem, const grpc_call_element_args* /*args*/) {
service_method_ = grpc_empty_slice();
GRPC_CLOSURE_INIT(&recv_initial_metadata_ready_, RecvInitialMetadataReady,
elem, grpc_schedule_on_exec_ctx);

@ -220,7 +220,7 @@ void Chttp2Connector::OnReceiveSettings(void* arg, grpc_error* error) {
self->Unref();
}
void Chttp2Connector::OnTimeout(void* arg, grpc_error* error) {
void Chttp2Connector::OnTimeout(void* arg, grpc_error* /*error*/) {
Chttp2Connector* self = static_cast<Chttp2Connector*>(arg);
{
MutexLock lock(&self->mu_);

@ -62,13 +62,17 @@ const char kUnixAbstractUriPrefix[] = "unix-abstract:";
class Chttp2ServerListener : public Server::ListenerInterface {
public:
static grpc_error* Create(Server* server, grpc_resolved_address* addr,
grpc_channel_args* args, int* port_num);
grpc_channel_args* args,
Chttp2ServerArgsModifier args_modifier,
int* port_num);
static grpc_error* CreateWithAcceptor(Server* server, const char* name,
grpc_channel_args* args);
grpc_channel_args* args,
Chttp2ServerArgsModifier args_modifier);
// Do not instantiate directly. Use one of the factory methods above.
Chttp2ServerListener(Server* server, grpc_channel_args* args);
Chttp2ServerListener(Server* server, grpc_channel_args* args,
Chttp2ServerArgsModifier args_modifier);
~Chttp2ServerListener() override;
void Start(Server* server,
@ -92,9 +96,15 @@ class Chttp2ServerListener : public Server::ListenerInterface {
void UpdateConfig(grpc_channel_args* args) override {
{
MutexLock lock(&listener_->mu_);
// TODO(yashykt): Fix this
// grpc_channel_args_destroy(listener_->args_);
// listener_->args_ = args;
grpc_channel_args_destroy(listener_->args_);
grpc_error* error = GRPC_ERROR_NONE;
args = listener_->args_modifier_(args, &error);
if (error != GRPC_ERROR_NONE) {
// TODO(yashykt): Set state to close down connections immediately
// after accepting.
GPR_ASSERT(0);
}
listener_->args_ = args;
if (!listener_->shutdown_) return; // Already started listening.
}
int port_temp;
@ -157,10 +167,11 @@ class Chttp2ServerListener : public Server::ListenerInterface {
grpc_closure* destroy_done);
Server* const server_;
grpc_channel_args* const args_;
grpc_tcp_server* tcp_server_;
grpc_resolved_address resolved_address_;
Chttp2ServerArgsModifier args_modifier_;
Mutex mu_;
grpc_channel_args* args_; // guarded by mu_
ConfigFetcherWatcher* config_fetcher_watcher_ = nullptr;
bool shutdown_ = true;
grpc_closure tcp_server_shutdown_complete_;
@ -328,13 +339,14 @@ void Chttp2ServerListener::ConnectionState::OnHandshakeDone(void* arg,
grpc_error* Chttp2ServerListener::Create(Server* server,
grpc_resolved_address* addr,
grpc_channel_args* args,
Chttp2ServerArgsModifier args_modifier,
int* port_num) {
Chttp2ServerListener* listener = nullptr;
// The bulk of this method is inside of a lambda to make cleanup
// easier without using goto.
grpc_error* error = [&]() {
// Create Chttp2ServerListener.
listener = new Chttp2ServerListener(server, args);
listener = new Chttp2ServerListener(server, args, args_modifier);
error = grpc_tcp_server_create(&listener->tcp_server_shutdown_complete_,
args, &listener->tcp_server_);
if (error != GRPC_ERROR_NONE) return error;
@ -374,10 +386,11 @@ grpc_error* Chttp2ServerListener::Create(Server* server,
return error;
}
grpc_error* Chttp2ServerListener::CreateWithAcceptor(Server* server,
const char* name,
grpc_channel_args* args) {
Chttp2ServerListener* listener = new Chttp2ServerListener(server, args);
grpc_error* Chttp2ServerListener::CreateWithAcceptor(
Server* server, const char* name, grpc_channel_args* args,
Chttp2ServerArgsModifier args_modifier) {
Chttp2ServerListener* listener =
new Chttp2ServerListener(server, args, args_modifier);
grpc_error* error = grpc_tcp_server_create(
&listener->tcp_server_shutdown_complete_, args, &listener->tcp_server_);
if (error != GRPC_ERROR_NONE) {
@ -392,9 +405,10 @@ grpc_error* Chttp2ServerListener::CreateWithAcceptor(Server* server,
return GRPC_ERROR_NONE;
}
Chttp2ServerListener::Chttp2ServerListener(Server* server,
grpc_channel_args* args)
: server_(server), args_(args) {
Chttp2ServerListener::Chttp2ServerListener(
Server* server, grpc_channel_args* args,
Chttp2ServerArgsModifier args_modifier)
: server_(server), args_modifier_(args_modifier), args_(args) {
GRPC_CLOSURE_INIT(&tcp_server_shutdown_complete_, TcpServerShutdownComplete,
this, grpc_schedule_on_exec_ctx);
}
@ -407,13 +421,16 @@ Chttp2ServerListener::~Chttp2ServerListener() {
void Chttp2ServerListener::Start(
Server* /*server*/, const std::vector<grpc_pollset*>* /* pollsets */) {
if (server_->config_fetcher() != nullptr) {
grpc_channel_args* args = nullptr;
auto watcher = absl::make_unique<ConfigFetcherWatcher>(this);
{
MutexLock lock(&mu_);
config_fetcher_watcher_ = watcher.get();
args = grpc_channel_args_copy(args_);
}
server_->config_fetcher()->StartWatch(
grpc_sockaddr_to_string(&resolved_address_, false), std::move(watcher));
grpc_sockaddr_to_string(&resolved_address_, false), args,
std::move(watcher));
} else {
StartListening();
}
@ -459,9 +476,15 @@ void Chttp2ServerListener::OnAccept(void* arg, grpc_endpoint* tcp,
gpr_free(acceptor);
return;
}
grpc_channel_args* args = nullptr;
{
MutexLock lock(&self->mu_);
args = grpc_channel_args_copy(self->args_);
}
// Deletes itself when done.
new ConnectionState(self, accepting_pollset, acceptor,
std::move(handshake_mgr), self->args_, tcp);
std::move(handshake_mgr), args, tcp);
grpc_channel_args_destroy(args);
}
void Chttp2ServerListener::TcpServerShutdownComplete(void* arg,
@ -513,10 +536,12 @@ void Chttp2ServerListener::Orphan() {
//
grpc_error* Chttp2ServerAddPort(Server* server, const char* addr,
grpc_channel_args* args, int* port_num) {
grpc_channel_args* args,
Chttp2ServerArgsModifier args_modifier,
int* port_num) {
if (strncmp(addr, "external:", 9) == 0) {
return grpc_core::Chttp2ServerListener::CreateWithAcceptor(server, addr,
args);
return grpc_core::Chttp2ServerListener::CreateWithAcceptor(
server, addr, args, args_modifier);
}
*port_num = -1;
grpc_resolved_addresses* resolved = nullptr;
@ -540,10 +565,10 @@ grpc_error* Chttp2ServerAddPort(Server* server, const char* addr,
if (*port_num != -1 && grpc_sockaddr_get_port(&resolved->addrs[i]) == 0) {
grpc_sockaddr_set_port(&resolved->addrs[i], *port_num);
}
int port_temp;
int port_temp = -1;
error = grpc_core::Chttp2ServerListener::Create(
server, &resolved->addrs[i], grpc_channel_args_copy(args),
&port_temp);
args_modifier, &port_temp);
if (error != GRPC_ERROR_NONE) {
error_list.push_back(error);
} else {

@ -28,10 +28,19 @@
namespace grpc_core {
// A function to modify channel args for a listening addr:port. Note that this
// is used to create a security connector for listeners when the servers are
// configured with a config fetcher. Not invoked if there is no config fetcher
// added to the server. Takes ownership of the args. Caller takes ownership of
// returned args. On failure, the error parameter will be set.
using Chttp2ServerArgsModifier =
std::function<grpc_channel_args*(grpc_channel_args*, grpc_error**)>;
/// Adds a port to \a server. Sets \a port_num to the port number.
/// Takes ownership of \a args.
grpc_error* Chttp2ServerAddPort(Server* server, const char* addr,
grpc_channel_args* args, int* port_num);
grpc_error* Chttp2ServerAddPort(
Server* server, const char* addr, grpc_channel_args* args,
Chttp2ServerArgsModifier connection_args_modifier, int* port_num);
} // namespace grpc_core

@ -27,6 +27,15 @@
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/server.h"
namespace {
grpc_channel_args* ModifyArgsForConnection(grpc_channel_args* args,
grpc_error** /*error*/) {
return args;
}
} // namespace
int grpc_server_add_insecure_http2_port(grpc_server* server, const char* addr) {
grpc_core::ExecCtx exec_ctx;
int port_num = 0;
@ -34,7 +43,8 @@ int grpc_server_add_insecure_http2_port(grpc_server* server, const char* addr) {
(server, addr));
grpc_error* err = grpc_core::Chttp2ServerAddPort(
server->core_server.get(), addr,
grpc_channel_args_copy(server->core_server->channel_args()), &port_num);
grpc_channel_args_copy(server->core_server->channel_args()),
ModifyArgsForConnection, &port_num);
if (err != GRPC_ERROR_NONE) {
const char* msg = grpc_error_string(err);
gpr_log(GPR_ERROR, "%s", msg);

@ -18,12 +18,11 @@
#include <grpc/support/port_platform.h>
#include <grpc/grpc.h>
#include <string.h>
#include "absl/strings/str_cat.h"
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@ -38,6 +37,35 @@
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/server.h"
namespace {
grpc_channel_args* ModifyArgsForConnection(grpc_channel_args* args,
grpc_error** error) {
grpc_server_credentials* server_credentials =
grpc_find_server_credentials_in_args(args);
if (server_credentials == nullptr) {
*error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Could not find server credentials");
return args;
}
auto security_connector = server_credentials->create_security_connector(args);
if (security_connector == nullptr) {
*error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
absl::StrCat("Unable to create secure server with credentials of type ",
server_credentials->type())
.c_str());
return args;
}
grpc_arg arg_to_add =
grpc_security_connector_to_arg(security_connector.get());
grpc_channel_args* new_args =
grpc_channel_args_copy_and_add(args, &arg_to_add, 1);
grpc_channel_args_destroy(args);
return new_args;
}
} // namespace
int grpc_server_add_secure_http2_port(grpc_server* server, const char* addr,
grpc_server_credentials* creds) {
grpc_core::ExecCtx exec_ctx;
@ -55,27 +83,43 @@ int grpc_server_add_secure_http2_port(grpc_server* server, const char* addr,
"No credentials specified for secure server port (creds==NULL)");
goto done;
}
sc = creds->create_security_connector();
if (sc == nullptr) {
err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
absl::StrCat("Unable to create secure server with credentials of type ",
creds->type())
.c_str());
goto done;
// TODO(yashykt): Ideally, we would not want to have different behavior here
// based on whether a config fetcher is configured or not. Currently, we have
// a feature for SSL credentials reloading with an application callback that
// assumes that there is a single security connector. If we delay the creation
// of the security connector to after the creation of the listener(s), we
// would have potentially multiple security connectors which breaks the
// assumption for SSL creds reloading. When the API for SSL creds reloading is
// rewritten, we would be able to make this workaround go away by removing
// that assumption. As an immediate drawback of this workaround, config
// fetchers need to be registered before adding ports to the server.
if (server->core_server->config_fetcher() != nullptr) {
// Create channel args.
grpc_arg arg_to_add = grpc_server_credentials_to_arg(creds);
args = grpc_channel_args_copy_and_add(server->core_server->channel_args(),
&arg_to_add, 1);
} else {
sc = creds->create_security_connector(nullptr);
if (sc == nullptr) {
err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
absl::StrCat(
"Unable to create secure server with credentials of type ",
creds->type())
.c_str());
goto done;
}
grpc_arg args_to_add[2];
args_to_add[0] = grpc_server_credentials_to_arg(creds);
args_to_add[1] = grpc_security_connector_to_arg(sc.get());
args = grpc_channel_args_copy_and_add(server->core_server->channel_args(),
args_to_add,
GPR_ARRAY_SIZE(args_to_add));
}
// Create channel args.
grpc_arg args_to_add[2];
args_to_add[0] = grpc_server_credentials_to_arg(creds);
args_to_add[1] = grpc_security_connector_to_arg(sc.get());
args =
grpc_channel_args_copy_and_add(server->core_server->channel_args(),
args_to_add, GPR_ARRAY_SIZE(args_to_add));
// Add server port.
err = grpc_core::Chttp2ServerAddPort(server->core_server.get(), addr, args,
&port_num);
ModifyArgsForConnection, &port_num);
done:
sc.reset(DEBUG_LOCATION, "server");
if (err != GRPC_ERROR_NONE) {
const char* msg = grpc_error_string(err);
gpr_log(GPR_ERROR, "%s", msg);

@ -32,51 +32,55 @@ library, so we can build it in all environments */
#else
/* Dummy implementation of cronet API just to test for build-ability */
bidirectional_stream* bidirectional_stream_create(
stream_engine* engine, void* annotation,
bidirectional_stream_callback* callback) {
stream_engine* /*engine*/, void* /*annotation*/,
bidirectional_stream_callback* /*callback*/) {
GPR_ASSERT(0);
return nullptr;
}
int bidirectional_stream_destroy(bidirectional_stream* stream) {
int bidirectional_stream_destroy(bidirectional_stream* /*stream*/) {
GPR_ASSERT(0);
return 0;
}
int bidirectional_stream_start(bidirectional_stream* stream, const char* url,
int priority, const char* method,
const bidirectional_stream_header_array* headers,
bool end_of_stream) {
int bidirectional_stream_start(
bidirectional_stream* /*stream*/, const char* /*url*/, int /*priority*/,
const char* /*method*/,
const bidirectional_stream_header_array* /*headers*/,
bool /*end_of_stream*/) {
GPR_ASSERT(0);
return 0;
}
int bidirectional_stream_read(bidirectional_stream* stream, char* buffer,
int capacity) {
int bidirectional_stream_read(bidirectional_stream* /*stream*/,
char* /*buffer*/, int /*capacity*/) {
GPR_ASSERT(0);
return 0;
}
int bidirectional_stream_write(bidirectional_stream* stream, const char* buffer,
int count, bool end_of_stream) {
int bidirectional_stream_write(bidirectional_stream* /*stream*/,
const char* /*buffer*/, int /*count*/,
bool /*end_of_stream*/) {
GPR_ASSERT(0);
return 0;
}
void bidirectional_stream_cancel(bidirectional_stream* stream) {
void bidirectional_stream_cancel(bidirectional_stream* /*stream*/) {
GPR_ASSERT(0);
}
void bidirectional_stream_disable_auto_flush(bidirectional_stream* stream,
bool disable_auto_flush) {
void bidirectional_stream_disable_auto_flush(bidirectional_stream* /*stream*/,
bool /*disable_auto_flush*/) {
GPR_ASSERT(0);
}
void bidirectional_stream_delay_request_headers_until_flush(
bidirectional_stream* stream, bool delay_headers_until_flush) {
bidirectional_stream* /*stream*/, bool /*delay_headers_until_flush*/) {
GPR_ASSERT(0);
}
void bidirectional_stream_flush(bidirectional_stream* stream) { GPR_ASSERT(0); }
void bidirectional_stream_flush(bidirectional_stream* /*stream*/) {
GPR_ASSERT(0);
}
#endif /* GRPC_COMPILE_WITH_CRONET */

@ -1420,19 +1420,20 @@ inline stream_obj::~stream_obj() {
}
static int init_stream(grpc_transport* gt, grpc_stream* gs,
grpc_stream_refcount* refcount, const void* server_data,
grpc_core::Arena* arena) {
grpc_stream_refcount* refcount,
const void* /*server_data*/, grpc_core::Arena* arena) {
new (gs) stream_obj(gt, gs, refcount, arena);
return 0;
}
static void set_pollset_do_nothing(grpc_transport* gt, grpc_stream* gs,
grpc_pollset* pollset) {}
static void set_pollset_do_nothing(grpc_transport* /*gt*/, grpc_stream* /*gs*/,
grpc_pollset* /*pollset*/) {}
static void set_pollset_set_do_nothing(grpc_transport* gt, grpc_stream* gs,
grpc_pollset_set* pollset_set) {}
static void set_pollset_set_do_nothing(grpc_transport* /*gt*/,
grpc_stream* /*gs*/,
grpc_pollset_set* /*pollset_set*/) {}
static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
static void perform_stream_op(grpc_transport* /*gt*/, grpc_stream* gs,
grpc_transport_stream_op_batch* op) {
CRONET_LOG(GPR_DEBUG, "perform_stream_op");
if (op->send_initial_metadata &&
@ -1466,7 +1467,7 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
execute_from_storage(s);
}
static void destroy_stream(grpc_transport* gt, grpc_stream* gs,
static void destroy_stream(grpc_transport* /*gt*/, grpc_stream* gs,
grpc_closure* then_schedule_closure) {
stream_obj* s = reinterpret_cast<stream_obj*>(gs);
s->~stream_obj();
@ -1474,11 +1475,11 @@ static void destroy_stream(grpc_transport* gt, grpc_stream* gs,
GRPC_ERROR_NONE);
}
static void destroy_transport(grpc_transport* gt) {}
static void destroy_transport(grpc_transport* /*gt*/) {}
static grpc_endpoint* get_endpoint(grpc_transport* gt) { return nullptr; }
static grpc_endpoint* get_endpoint(grpc_transport* /*gt*/) { return nullptr; }
static void perform_op(grpc_transport* gt, grpc_transport_op* op) {}
static void perform_op(grpc_transport* /*gt*/, grpc_transport_op* /*op*/) {}
static const grpc_transport_vtable grpc_cronet_vtable = {
sizeof(stream_obj),
@ -1494,7 +1495,7 @@ static const grpc_transport_vtable grpc_cronet_vtable = {
grpc_transport* grpc_create_cronet_transport(void* engine, const char* target,
const grpc_channel_args* args,
void* reserved) {
void* /*reserved*/) {
grpc_cronet_transport* ct = static_cast<grpc_cronet_transport*>(
gpr_malloc(sizeof(grpc_cronet_transport)));
if (!ct) {

@ -0,0 +1,29 @@
/* This file was generated by upbc (the upb compiler) from the input
* file:
*
* envoy/extensions/clusters/aggregate/v3/cluster.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#include <stddef.h>
#include "upb/msg.h"
#include "envoy/extensions/clusters/aggregate/v3/cluster.upb.h"
#include "udpa/annotations/status.upb.h"
#include "udpa/annotations/versioning.upb.h"
#include "validate/validate.upb.h"
#include "upb/port_def.inc"
static const upb_msglayout_field envoy_extensions_clusters_aggregate_v3_ClusterConfig__fields[1] = {
{1, UPB_SIZE(0, 0), 0, 0, 9, 3},
};
const upb_msglayout envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit = {
NULL,
&envoy_extensions_clusters_aggregate_v3_ClusterConfig__fields[0],
UPB_SIZE(8, 8), 1, false, 255,
};
#include "upb/port_undef.inc"

@ -0,0 +1,67 @@
/* This file was generated by upbc (the upb compiler) from the input
* file:
*
* envoy/extensions/clusters/aggregate/v3/cluster.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#ifndef ENVOY_EXTENSIONS_CLUSTERS_AGGREGATE_V3_CLUSTER_PROTO_UPB_H_
#define ENVOY_EXTENSIONS_CLUSTERS_AGGREGATE_V3_CLUSTER_PROTO_UPB_H_
#include "upb/msg.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
#include "upb/port_def.inc"
#ifdef __cplusplus
extern "C" {
#endif
struct envoy_extensions_clusters_aggregate_v3_ClusterConfig;
typedef struct envoy_extensions_clusters_aggregate_v3_ClusterConfig envoy_extensions_clusters_aggregate_v3_ClusterConfig;
extern const upb_msglayout envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit;
/* envoy.extensions.clusters.aggregate.v3.ClusterConfig */
UPB_INLINE envoy_extensions_clusters_aggregate_v3_ClusterConfig *envoy_extensions_clusters_aggregate_v3_ClusterConfig_new(upb_arena *arena) {
return (envoy_extensions_clusters_aggregate_v3_ClusterConfig *)_upb_msg_new(&envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, arena);
}
UPB_INLINE envoy_extensions_clusters_aggregate_v3_ClusterConfig *envoy_extensions_clusters_aggregate_v3_ClusterConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_clusters_aggregate_v3_ClusterConfig *ret = envoy_extensions_clusters_aggregate_v3_ClusterConfig_new(arena);
return (ret && upb_decode(buf, size, ret, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, arena)) ? ret : NULL;
}
UPB_INLINE envoy_extensions_clusters_aggregate_v3_ClusterConfig *envoy_extensions_clusters_aggregate_v3_ClusterConfig_parse_ex(const char *buf, size_t size,
upb_arena *arena, int options) {
envoy_extensions_clusters_aggregate_v3_ClusterConfig *ret = envoy_extensions_clusters_aggregate_v3_ClusterConfig_new(arena);
return (ret && _upb_decode(buf, size, ret, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, arena, options))
? ret : NULL;
}
UPB_INLINE char *envoy_extensions_clusters_aggregate_v3_ClusterConfig_serialize(const envoy_extensions_clusters_aggregate_v3_ClusterConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, arena, len);
}
UPB_INLINE upb_strview const* envoy_extensions_clusters_aggregate_v3_ClusterConfig_clusters(const envoy_extensions_clusters_aggregate_v3_ClusterConfig *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
UPB_INLINE upb_strview* envoy_extensions_clusters_aggregate_v3_ClusterConfig_mutable_clusters(envoy_extensions_clusters_aggregate_v3_ClusterConfig *msg, size_t *len) {
return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
UPB_INLINE upb_strview* envoy_extensions_clusters_aggregate_v3_ClusterConfig_resize_clusters(envoy_extensions_clusters_aggregate_v3_ClusterConfig *msg, size_t len, upb_arena *arena) {
return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(3, 4), arena);
}
UPB_INLINE bool envoy_extensions_clusters_aggregate_v3_ClusterConfig_add_clusters(envoy_extensions_clusters_aggregate_v3_ClusterConfig *msg, upb_strview val, upb_arena *arena) {
return _upb_array_append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(3, 4), &val,
arena);
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#include "upb/port_undef.inc"
#endif /* ENVOY_EXTENSIONS_CLUSTERS_AGGREGATE_V3_CLUSTER_PROTO_UPB_H_ */

@ -0,0 +1,85 @@
/* This file was generated by upbc (the upb compiler) from the input
* file:
*
* src/proto/grpc/auth/v1/authz_policy.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#include <stddef.h>
#include "upb/msg.h"
#include "src/proto/grpc/auth/v1/authz_policy.upb.h"
#include "upb/port_def.inc"
static const upb_msglayout_field grpc_auth_v1_Peer__fields[1] = {
{1, UPB_SIZE(0, 0), 0, 0, 9, 3},
};
const upb_msglayout grpc_auth_v1_Peer_msginit = {
NULL,
&grpc_auth_v1_Peer__fields[0],
UPB_SIZE(8, 8), 1, false, 255,
};
static const upb_msglayout_field grpc_auth_v1_Header__fields[2] = {
{1, UPB_SIZE(0, 0), 0, 0, 9, 1},
{2, UPB_SIZE(8, 16), 0, 0, 9, 3},
};
const upb_msglayout grpc_auth_v1_Header_msginit = {
NULL,
&grpc_auth_v1_Header__fields[0],
UPB_SIZE(16, 32), 2, false, 255,
};
static const upb_msglayout *const grpc_auth_v1_Request_submsgs[1] = {
&grpc_auth_v1_Header_msginit,
};
static const upb_msglayout_field grpc_auth_v1_Request__fields[2] = {
{1, UPB_SIZE(0, 0), 0, 0, 9, 3},
{3, UPB_SIZE(4, 8), 0, 0, 11, 3},
};
const upb_msglayout grpc_auth_v1_Request_msginit = {
&grpc_auth_v1_Request_submsgs[0],
&grpc_auth_v1_Request__fields[0],
UPB_SIZE(8, 16), 2, false, 255,
};
static const upb_msglayout *const grpc_auth_v1_Rule_submsgs[2] = {
&grpc_auth_v1_Peer_msginit,
&grpc_auth_v1_Request_msginit,
};
static const upb_msglayout_field grpc_auth_v1_Rule__fields[3] = {
{1, UPB_SIZE(4, 8), 0, 0, 9, 1},
{2, UPB_SIZE(12, 24), 1, 0, 11, 1},
{3, UPB_SIZE(16, 32), 2, 1, 11, 1},
};
const upb_msglayout grpc_auth_v1_Rule_msginit = {
&grpc_auth_v1_Rule_submsgs[0],
&grpc_auth_v1_Rule__fields[0],
UPB_SIZE(24, 48), 3, false, 255,
};
static const upb_msglayout *const grpc_auth_v1_AuthorizationPolicy_submsgs[1] = {
&grpc_auth_v1_Rule_msginit,
};
static const upb_msglayout_field grpc_auth_v1_AuthorizationPolicy__fields[3] = {
{1, UPB_SIZE(0, 0), 0, 0, 9, 1},
{2, UPB_SIZE(8, 16), 0, 0, 11, 3},
{3, UPB_SIZE(12, 24), 0, 0, 11, 3},
};
const upb_msglayout grpc_auth_v1_AuthorizationPolicy_msginit = {
&grpc_auth_v1_AuthorizationPolicy_submsgs[0],
&grpc_auth_v1_AuthorizationPolicy__fields[0],
UPB_SIZE(16, 32), 3, false, 255,
};
#include "upb/port_undef.inc"

@ -0,0 +1,276 @@
/* This file was generated by upbc (the upb compiler) from the input
* file:
*
* src/proto/grpc/auth/v1/authz_policy.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#ifndef SRC_PROTO_GRPC_AUTH_V1_AUTHZ_POLICY_PROTO_UPB_H_
#define SRC_PROTO_GRPC_AUTH_V1_AUTHZ_POLICY_PROTO_UPB_H_
#include "upb/msg.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
#include "upb/port_def.inc"
#ifdef __cplusplus
extern "C" {
#endif
struct grpc_auth_v1_Peer;
struct grpc_auth_v1_Header;
struct grpc_auth_v1_Request;
struct grpc_auth_v1_Rule;
struct grpc_auth_v1_AuthorizationPolicy;
typedef struct grpc_auth_v1_Peer grpc_auth_v1_Peer;
typedef struct grpc_auth_v1_Header grpc_auth_v1_Header;
typedef struct grpc_auth_v1_Request grpc_auth_v1_Request;
typedef struct grpc_auth_v1_Rule grpc_auth_v1_Rule;
typedef struct grpc_auth_v1_AuthorizationPolicy grpc_auth_v1_AuthorizationPolicy;
extern const upb_msglayout grpc_auth_v1_Peer_msginit;
extern const upb_msglayout grpc_auth_v1_Header_msginit;
extern const upb_msglayout grpc_auth_v1_Request_msginit;
extern const upb_msglayout grpc_auth_v1_Rule_msginit;
extern const upb_msglayout grpc_auth_v1_AuthorizationPolicy_msginit;
/* grpc.auth.v1.Peer */
UPB_INLINE grpc_auth_v1_Peer *grpc_auth_v1_Peer_new(upb_arena *arena) {
return (grpc_auth_v1_Peer *)_upb_msg_new(&grpc_auth_v1_Peer_msginit, arena);
}
UPB_INLINE grpc_auth_v1_Peer *grpc_auth_v1_Peer_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_auth_v1_Peer *ret = grpc_auth_v1_Peer_new(arena);
return (ret && upb_decode(buf, size, ret, &grpc_auth_v1_Peer_msginit, arena)) ? ret : NULL;
}
UPB_INLINE grpc_auth_v1_Peer *grpc_auth_v1_Peer_parse_ex(const char *buf, size_t size,
upb_arena *arena, int options) {
grpc_auth_v1_Peer *ret = grpc_auth_v1_Peer_new(arena);
return (ret && _upb_decode(buf, size, ret, &grpc_auth_v1_Peer_msginit, arena, options))
? ret : NULL;
}
UPB_INLINE char *grpc_auth_v1_Peer_serialize(const grpc_auth_v1_Peer *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_auth_v1_Peer_msginit, arena, len);
}
UPB_INLINE upb_strview const* grpc_auth_v1_Peer_principals(const grpc_auth_v1_Peer *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
UPB_INLINE upb_strview* grpc_auth_v1_Peer_mutable_principals(grpc_auth_v1_Peer *msg, size_t *len) {
return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
UPB_INLINE upb_strview* grpc_auth_v1_Peer_resize_principals(grpc_auth_v1_Peer *msg, size_t len, upb_arena *arena) {
return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(3, 4), arena);
}
UPB_INLINE bool grpc_auth_v1_Peer_add_principals(grpc_auth_v1_Peer *msg, upb_strview val, upb_arena *arena) {
return _upb_array_append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(3, 4), &val,
arena);
}
/* grpc.auth.v1.Header */
UPB_INLINE grpc_auth_v1_Header *grpc_auth_v1_Header_new(upb_arena *arena) {
return (grpc_auth_v1_Header *)_upb_msg_new(&grpc_auth_v1_Header_msginit, arena);
}
UPB_INLINE grpc_auth_v1_Header *grpc_auth_v1_Header_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_auth_v1_Header *ret = grpc_auth_v1_Header_new(arena);
return (ret && upb_decode(buf, size, ret, &grpc_auth_v1_Header_msginit, arena)) ? ret : NULL;
}
UPB_INLINE grpc_auth_v1_Header *grpc_auth_v1_Header_parse_ex(const char *buf, size_t size,
upb_arena *arena, int options) {
grpc_auth_v1_Header *ret = grpc_auth_v1_Header_new(arena);
return (ret && _upb_decode(buf, size, ret, &grpc_auth_v1_Header_msginit, arena, options))
? ret : NULL;
}
UPB_INLINE char *grpc_auth_v1_Header_serialize(const grpc_auth_v1_Header *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_auth_v1_Header_msginit, arena, len);
}
UPB_INLINE upb_strview grpc_auth_v1_Header_key(const grpc_auth_v1_Header *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
UPB_INLINE upb_strview const* grpc_auth_v1_Header_values(const grpc_auth_v1_Header *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
UPB_INLINE void grpc_auth_v1_Header_set_key(grpc_auth_v1_Header *msg, upb_strview value) {
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
}
UPB_INLINE upb_strview* grpc_auth_v1_Header_mutable_values(grpc_auth_v1_Header *msg, size_t *len) {
return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
}
UPB_INLINE upb_strview* grpc_auth_v1_Header_resize_values(grpc_auth_v1_Header *msg, size_t len, upb_arena *arena) {
return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(3, 4), arena);
}
UPB_INLINE bool grpc_auth_v1_Header_add_values(grpc_auth_v1_Header *msg, upb_strview val, upb_arena *arena) {
return _upb_array_append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(3, 4), &val,
arena);
}
/* grpc.auth.v1.Request */
UPB_INLINE grpc_auth_v1_Request *grpc_auth_v1_Request_new(upb_arena *arena) {
return (grpc_auth_v1_Request *)_upb_msg_new(&grpc_auth_v1_Request_msginit, arena);
}
UPB_INLINE grpc_auth_v1_Request *grpc_auth_v1_Request_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_auth_v1_Request *ret = grpc_auth_v1_Request_new(arena);
return (ret && upb_decode(buf, size, ret, &grpc_auth_v1_Request_msginit, arena)) ? ret : NULL;
}
UPB_INLINE grpc_auth_v1_Request *grpc_auth_v1_Request_parse_ex(const char *buf, size_t size,
upb_arena *arena, int options) {
grpc_auth_v1_Request *ret = grpc_auth_v1_Request_new(arena);
return (ret && _upb_decode(buf, size, ret, &grpc_auth_v1_Request_msginit, arena, options))
? ret : NULL;
}
UPB_INLINE char *grpc_auth_v1_Request_serialize(const grpc_auth_v1_Request *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_auth_v1_Request_msginit, arena, len);
}
UPB_INLINE upb_strview const* grpc_auth_v1_Request_paths(const grpc_auth_v1_Request *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
UPB_INLINE bool grpc_auth_v1_Request_has_headers(const grpc_auth_v1_Request *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
UPB_INLINE const grpc_auth_v1_Header* const* grpc_auth_v1_Request_headers(const grpc_auth_v1_Request *msg, size_t *len) { return (const grpc_auth_v1_Header* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
UPB_INLINE upb_strview* grpc_auth_v1_Request_mutable_paths(grpc_auth_v1_Request *msg, size_t *len) {
return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
UPB_INLINE upb_strview* grpc_auth_v1_Request_resize_paths(grpc_auth_v1_Request *msg, size_t len, upb_arena *arena) {
return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(3, 4), arena);
}
UPB_INLINE bool grpc_auth_v1_Request_add_paths(grpc_auth_v1_Request *msg, upb_strview val, upb_arena *arena) {
return _upb_array_append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(3, 4), &val,
arena);
}
UPB_INLINE grpc_auth_v1_Header** grpc_auth_v1_Request_mutable_headers(grpc_auth_v1_Request *msg, size_t *len) {
return (grpc_auth_v1_Header**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
}
UPB_INLINE grpc_auth_v1_Header** grpc_auth_v1_Request_resize_headers(grpc_auth_v1_Request *msg, size_t len, upb_arena *arena) {
return (grpc_auth_v1_Header**)_upb_array_resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct grpc_auth_v1_Header* grpc_auth_v1_Request_add_headers(grpc_auth_v1_Request *msg, upb_arena *arena) {
struct grpc_auth_v1_Header* sub = (struct grpc_auth_v1_Header*)_upb_msg_new(&grpc_auth_v1_Header_msginit, arena);
bool ok = _upb_array_append_accessor2(
msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* grpc.auth.v1.Rule */
UPB_INLINE grpc_auth_v1_Rule *grpc_auth_v1_Rule_new(upb_arena *arena) {
return (grpc_auth_v1_Rule *)_upb_msg_new(&grpc_auth_v1_Rule_msginit, arena);
}
UPB_INLINE grpc_auth_v1_Rule *grpc_auth_v1_Rule_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_auth_v1_Rule *ret = grpc_auth_v1_Rule_new(arena);
return (ret && upb_decode(buf, size, ret, &grpc_auth_v1_Rule_msginit, arena)) ? ret : NULL;
}
UPB_INLINE grpc_auth_v1_Rule *grpc_auth_v1_Rule_parse_ex(const char *buf, size_t size,
upb_arena *arena, int options) {
grpc_auth_v1_Rule *ret = grpc_auth_v1_Rule_new(arena);
return (ret && _upb_decode(buf, size, ret, &grpc_auth_v1_Rule_msginit, arena, options))
? ret : NULL;
}
UPB_INLINE char *grpc_auth_v1_Rule_serialize(const grpc_auth_v1_Rule *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_auth_v1_Rule_msginit, arena, len);
}
UPB_INLINE upb_strview grpc_auth_v1_Rule_name(const grpc_auth_v1_Rule *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
UPB_INLINE bool grpc_auth_v1_Rule_has_source(const grpc_auth_v1_Rule *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE const grpc_auth_v1_Peer* grpc_auth_v1_Rule_source(const grpc_auth_v1_Rule *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const grpc_auth_v1_Peer*); }
UPB_INLINE bool grpc_auth_v1_Rule_has_request(const grpc_auth_v1_Rule *msg) { return _upb_hasbit(msg, 2); }
UPB_INLINE const grpc_auth_v1_Request* grpc_auth_v1_Rule_request(const grpc_auth_v1_Rule *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const grpc_auth_v1_Request*); }
UPB_INLINE void grpc_auth_v1_Rule_set_name(grpc_auth_v1_Rule *msg, upb_strview value) {
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
}
UPB_INLINE void grpc_auth_v1_Rule_set_source(grpc_auth_v1_Rule *msg, grpc_auth_v1_Peer* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), grpc_auth_v1_Peer*) = value;
}
UPB_INLINE struct grpc_auth_v1_Peer* grpc_auth_v1_Rule_mutable_source(grpc_auth_v1_Rule *msg, upb_arena *arena) {
struct grpc_auth_v1_Peer* sub = (struct grpc_auth_v1_Peer*)grpc_auth_v1_Rule_source(msg);
if (sub == NULL) {
sub = (struct grpc_auth_v1_Peer*)_upb_msg_new(&grpc_auth_v1_Peer_msginit, arena);
if (!sub) return NULL;
grpc_auth_v1_Rule_set_source(msg, sub);
}
return sub;
}
UPB_INLINE void grpc_auth_v1_Rule_set_request(grpc_auth_v1_Rule *msg, grpc_auth_v1_Request* value) {
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(16, 32), grpc_auth_v1_Request*) = value;
}
UPB_INLINE struct grpc_auth_v1_Request* grpc_auth_v1_Rule_mutable_request(grpc_auth_v1_Rule *msg, upb_arena *arena) {
struct grpc_auth_v1_Request* sub = (struct grpc_auth_v1_Request*)grpc_auth_v1_Rule_request(msg);
if (sub == NULL) {
sub = (struct grpc_auth_v1_Request*)_upb_msg_new(&grpc_auth_v1_Request_msginit, arena);
if (!sub) return NULL;
grpc_auth_v1_Rule_set_request(msg, sub);
}
return sub;
}
/* grpc.auth.v1.AuthorizationPolicy */
UPB_INLINE grpc_auth_v1_AuthorizationPolicy *grpc_auth_v1_AuthorizationPolicy_new(upb_arena *arena) {
return (grpc_auth_v1_AuthorizationPolicy *)_upb_msg_new(&grpc_auth_v1_AuthorizationPolicy_msginit, arena);
}
UPB_INLINE grpc_auth_v1_AuthorizationPolicy *grpc_auth_v1_AuthorizationPolicy_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_auth_v1_AuthorizationPolicy *ret = grpc_auth_v1_AuthorizationPolicy_new(arena);
return (ret && upb_decode(buf, size, ret, &grpc_auth_v1_AuthorizationPolicy_msginit, arena)) ? ret : NULL;
}
UPB_INLINE grpc_auth_v1_AuthorizationPolicy *grpc_auth_v1_AuthorizationPolicy_parse_ex(const char *buf, size_t size,
upb_arena *arena, int options) {
grpc_auth_v1_AuthorizationPolicy *ret = grpc_auth_v1_AuthorizationPolicy_new(arena);
return (ret && _upb_decode(buf, size, ret, &grpc_auth_v1_AuthorizationPolicy_msginit, arena, options))
? ret : NULL;
}
UPB_INLINE char *grpc_auth_v1_AuthorizationPolicy_serialize(const grpc_auth_v1_AuthorizationPolicy *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_auth_v1_AuthorizationPolicy_msginit, arena, len);
}
UPB_INLINE upb_strview grpc_auth_v1_AuthorizationPolicy_name(const grpc_auth_v1_AuthorizationPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
UPB_INLINE bool grpc_auth_v1_AuthorizationPolicy_has_deny_rules(const grpc_auth_v1_AuthorizationPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
UPB_INLINE const grpc_auth_v1_Rule* const* grpc_auth_v1_AuthorizationPolicy_deny_rules(const grpc_auth_v1_AuthorizationPolicy *msg, size_t *len) { return (const grpc_auth_v1_Rule* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
UPB_INLINE bool grpc_auth_v1_AuthorizationPolicy_has_allow_rules(const grpc_auth_v1_AuthorizationPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
UPB_INLINE const grpc_auth_v1_Rule* const* grpc_auth_v1_AuthorizationPolicy_allow_rules(const grpc_auth_v1_AuthorizationPolicy *msg, size_t *len) { return (const grpc_auth_v1_Rule* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
UPB_INLINE void grpc_auth_v1_AuthorizationPolicy_set_name(grpc_auth_v1_AuthorizationPolicy *msg, upb_strview value) {
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
}
UPB_INLINE grpc_auth_v1_Rule** grpc_auth_v1_AuthorizationPolicy_mutable_deny_rules(grpc_auth_v1_AuthorizationPolicy *msg, size_t *len) {
return (grpc_auth_v1_Rule**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
}
UPB_INLINE grpc_auth_v1_Rule** grpc_auth_v1_AuthorizationPolicy_resize_deny_rules(grpc_auth_v1_AuthorizationPolicy *msg, size_t len, upb_arena *arena) {
return (grpc_auth_v1_Rule**)_upb_array_resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct grpc_auth_v1_Rule* grpc_auth_v1_AuthorizationPolicy_add_deny_rules(grpc_auth_v1_AuthorizationPolicy *msg, upb_arena *arena) {
struct grpc_auth_v1_Rule* sub = (struct grpc_auth_v1_Rule*)_upb_msg_new(&grpc_auth_v1_Rule_msginit, arena);
bool ok = _upb_array_append_accessor2(
msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE grpc_auth_v1_Rule** grpc_auth_v1_AuthorizationPolicy_mutable_allow_rules(grpc_auth_v1_AuthorizationPolicy *msg, size_t *len) {
return (grpc_auth_v1_Rule**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
}
UPB_INLINE grpc_auth_v1_Rule** grpc_auth_v1_AuthorizationPolicy_resize_allow_rules(grpc_auth_v1_AuthorizationPolicy *msg, size_t len, upb_arena *arena) {
return (grpc_auth_v1_Rule**)_upb_array_resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct grpc_auth_v1_Rule* grpc_auth_v1_AuthorizationPolicy_add_allow_rules(grpc_auth_v1_AuthorizationPolicy *msg, upb_arena *arena) {
struct grpc_auth_v1_Rule* sub = (struct grpc_auth_v1_Rule*)_upb_msg_new(&grpc_auth_v1_Rule_msginit, arena);
bool ok = _upb_array_append_accessor2(
msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#include "upb/port_undef.inc"
#endif /* SRC_PROTO_GRPC_AUTH_V1_AUTHZ_POLICY_PROTO_UPB_H_ */

@ -0,0 +1,51 @@
/* This file was generated by upbc (the upb compiler) from the input
* file:
*
* envoy/extensions/clusters/aggregate/v3/cluster.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#include "upb/def.h"
#include "envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h"
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
extern const upb_msglayout envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit;
static const upb_msglayout *layouts[1] = {
&envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit,
};
static const char descriptor[389] = {'\n', '4', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 'c', 'l', 'u', 's', 't', 'e',
'r', 's', '/', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', '/', 'v', '3', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'p',
'r', 'o', 't', 'o', '\022', '&', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'c', 'l',
'u', 's', 't', 'e', 'r', 's', '.', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', '.', 'v', '3', '\032', '\035', 'u', 'd', 'p', 'a',
'/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o',
'\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o',
'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i',
'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', 'r', '\n', '\r', 'C', 'l', 'u', 's', 't', 'e', 'r', 'C', 'o', 'n', 'f',
'i', 'g', '\022', '$', '\n', '\010', 'c', 'l', 'u', 's', 't', 'e', 'r', 's', '\030', '\001', ' ', '\003', '(', '\t', 'B', '\010', '\372', 'B', '\005',
'\222', '\001', '\002', '\010', '\001', 'R', '\010', 'c', 'l', 'u', 's', 't', 'e', 'r', 's', ':', ';', '\232', '\305', '\210', '\036', '6', '\n', '4', 'e',
'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'a', 'g', 'g', 'r', 'e',
'g', 'a', 't', 'e', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i',
'g', 'B', 'N', '\n', '4', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.',
'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', 's', '.', 'a', 'g', 'g', 'r', 'e',
'g', 'a', 't', 'e', '.', 'v', '3', 'B', '\014', 'C', 'l', 'u', 's', 't', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200',
'\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
static upb_def_init *deps[4] = {
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
NULL
};
upb_def_init envoy_extensions_clusters_aggregate_v3_cluster_proto_upbdefinit = {
deps,
layouts,
"envoy/extensions/clusters/aggregate/v3/cluster.proto",
UPB_STRVIEW_INIT(descriptor, 389)
};

@ -0,0 +1,35 @@
/* This file was generated by upbc (the upb compiler) from the input
* file:
*
* envoy/extensions/clusters/aggregate/v3/cluster.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#ifndef ENVOY_EXTENSIONS_CLUSTERS_AGGREGATE_V3_CLUSTER_PROTO_UPBDEFS_H_
#define ENVOY_EXTENSIONS_CLUSTERS_AGGREGATE_V3_CLUSTER_PROTO_UPBDEFS_H_
#include "upb/def.h"
#include "upb/port_def.inc"
#ifdef __cplusplus
extern "C" {
#endif
#include "upb/def.h"
#include "upb/port_def.inc"
extern upb_def_init envoy_extensions_clusters_aggregate_v3_cluster_proto_upbdefinit;
UPB_INLINE const upb_msgdef *envoy_extensions_clusters_aggregate_v3_ClusterConfig_getmsgdef(upb_symtab *s) {
_upb_symtab_loaddefinit(s, &envoy_extensions_clusters_aggregate_v3_cluster_proto_upbdefinit);
return upb_symtab_lookupmsg(s, "envoy.extensions.clusters.aggregate.v3.ClusterConfig");
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#include "upb/port_undef.inc"
#endif /* ENVOY_EXTENSIONS_CLUSTERS_AGGREGATE_V3_CLUSTER_PROTO_UPBDEFS_H_ */

@ -15,15 +15,16 @@ static const upb_msglayout *layouts[1] = {
&google_protobuf_Any_msginit,
};
static const char descriptor[221] = {'\n', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o',
static const char descriptor[228] = {'\n', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o',
't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '\"', '6', '\n', '\003', 'A', 'n',
'y', '\022', '\031', '\n', '\010', 't', 'y', 'p', 'e', '_', 'u', 'r', 'l', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\007', 't', 'y', 'p', 'e',
'U', 'r', 'l', '\022', '\024', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\014', 'R', '\005', 'v', 'a', 'l', 'u', 'e',
'B', 'o', '\n', '\023', 'c', 'o', 'm', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', 'B', '\010',
'A', 'n', 'y', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '%', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'g', 'o',
'l', 'a', 'n', 'g', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'p', 't', 'y', 'p', 'e', 's', '/', 'a', 'n', 'y', '\242',
'\002', '\003', 'G', 'P', 'B', '\252', '\002', '\036', 'G', 'o', 'o', 'g', 'l', 'e', '.', 'P', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'W',
'e', 'l', 'l', 'K', 'n', 'o', 'w', 'n', 'T', 'y', 'p', 'e', 's', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
'B', 'v', '\n', '\023', 'c', 'o', 'm', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', 'B', '\010',
'A', 'n', 'y', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', ',', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'g', 'o', 'l', 'a', 'n', 'g',
'.', 'o', 'r', 'g', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'y', 'p', 'e', 's', '/', 'k', 'n', 'o', 'w', 'n',
'/', 'a', 'n', 'y', 'p', 'b', '\242', '\002', '\003', 'G', 'P', 'B', '\252', '\002', '\036', 'G', 'o', 'o', 'g', 'l', 'e', '.', 'P', 'r', 'o',
't', 'o', 'b', 'u', 'f', '.', 'W', 'e', 'l', 'l', 'K', 'n', 'o', 'w', 'n', 'T', 'y', 'p', 'e', 's', 'b', '\006', 'p', 'r', 'o',
't', 'o', '3',
};
static upb_def_init *deps[1] = {
@ -34,5 +35,5 @@ upb_def_init google_protobuf_any_proto_upbdefinit = {
deps,
layouts,
"google/protobuf/any.proto",
UPB_STRVIEW_INIT(descriptor, 221)
UPB_STRVIEW_INIT(descriptor, 228)
};

@ -67,7 +67,7 @@ static const upb_msglayout *layouts[27] = {
&google_protobuf_GeneratedCodeInfo_Annotation_msginit,
};
static const char descriptor[7619] = {'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p',
static const char descriptor[7601] = {'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p',
't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
'f', '\"', 'M', '\n', '\021', 'F', 'i', 'l', 'e', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'S', 'e', 't', '\022', '8', '\n',
'\004', 'f', 'i', 'l', 'e', '\030', '\001', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
@ -365,13 +365,13 @@ static const char descriptor[7619] = {'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '
'n', '\022', '\026', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\003', '(', '\005', 'B', '\002', '\020', '\001', 'R', '\004', 'p', 'a', 't', 'h',
'\022', '\037', '\n', '\013', 's', 'o', 'u', 'r', 'c', 'e', '_', 'f', 'i', 'l', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\n', 's', 'o',
'u', 'r', 'c', 'e', 'F', 'i', 'l', 'e', '\022', '\024', '\n', '\005', 'b', 'e', 'g', 'i', 'n', '\030', '\003', ' ', '\001', '(', '\005', 'R', '\005',
'b', 'e', 'g', 'i', 'n', '\022', '\020', '\n', '\003', 'e', 'n', 'd', '\030', '\004', ' ', '\001', '(', '\005', 'R', '\003', 'e', 'n', 'd', 'B', '\217',
'\001', '\n', '\023', 'c', 'o', 'm', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', 'B', '\020', 'D',
'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', 's', 'H', '\001', 'Z', '>', 'g', 'i', 't', 'h', 'u', 'b',
'.', 'c', 'o', 'm', '/', 'g', 'o', 'l', 'a', 'n', 'g', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'p', 'r', 'o', 't',
'o', 'c', '-', 'g', 'e', 'n', '-', 'g', 'o', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', ';', 'd', 'e', 's', 'c',
'r', 'i', 'p', 't', 'o', 'r', '\370', '\001', '\001', '\242', '\002', '\003', 'G', 'P', 'B', '\252', '\002', '\032', 'G', 'o', 'o', 'g', 'l', 'e', '.',
'P', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'R', 'e', 'f', 'l', 'e', 'c', 't', 'i', 'o', 'n',
'b', 'e', 'g', 'i', 'n', '\022', '\020', '\n', '\003', 'e', 'n', 'd', '\030', '\004', ' ', '\001', '(', '\005', 'R', '\003', 'e', 'n', 'd', 'B', '~',
'\n', '\023', 'c', 'o', 'm', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', 'B', '\020', 'D', 'e',
's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', 's', 'H', '\001', 'Z', '-', 'g', 'o', 'o', 'g', 'l', 'e', '.',
'g', 'o', 'l', 'a', 'n', 'g', '.', 'o', 'r', 'g', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'y', 'p', 'e', 's',
'/', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'p', 'b', '\370', '\001', '\001', '\242', '\002', '\003', 'G', 'P', 'B', '\252', '\002', '\032',
'G', 'o', 'o', 'g', 'l', 'e', '.', 'P', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'R', 'e', 'f', 'l', 'e', 'c', 't', 'i', 'o',
'n',
};
static upb_def_init *deps[1] = {
@ -382,5 +382,5 @@ upb_def_init google_protobuf_descriptor_proto_upbdefinit = {
deps,
layouts,
"google/protobuf/descriptor.proto",
UPB_STRVIEW_INIT(descriptor, 7619)
UPB_STRVIEW_INIT(descriptor, 7601)
};

@ -15,16 +15,17 @@ static const upb_msglayout *layouts[1] = {
&google_protobuf_Duration_msginit,
};
static const char descriptor[243] = {'\n', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o',
static const char descriptor[251] = {'\n', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o',
'n', '.', 'p', 'r', 'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '\"',
':', '\n', '\010', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\022', '\030', '\n', '\007', 's', 'e', 'c', 'o', 'n', 'd', 's', '\030', '\001', ' ',
'\001', '(', '\003', 'R', '\007', 's', 'e', 'c', 'o', 'n', 'd', 's', '\022', '\024', '\n', '\005', 'n', 'a', 'n', 'o', 's', '\030', '\002', ' ', '\001',
'(', '\005', 'R', '\005', 'n', 'a', 'n', 'o', 's', 'B', '|', '\n', '\023', 'c', 'o', 'm', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
'r', 'o', 't', 'o', 'b', 'u', 'f', 'B', '\r', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z',
'*', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'g', 'o', 'l', 'a', 'n', 'g', '/', 'p', 'r', 'o', 't', 'o', 'b',
'u', 'f', '/', 'p', 't', 'y', 'p', 'e', 's', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\370', '\001', '\001', '\242', '\002', '\003', 'G',
'P', 'B', '\252', '\002', '\036', 'G', 'o', 'o', 'g', 'l', 'e', '.', 'P', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'W', 'e', 'l', 'l',
'K', 'n', 'o', 'w', 'n', 'T', 'y', 'p', 'e', 's', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
'(', '\005', 'R', '\005', 'n', 'a', 'n', 'o', 's', 'B', '\203', '\001', '\n', '\023', 'c', 'o', 'm', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', 'B', '\r', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'P', '\001',
'Z', '1', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'g', 'o', 'l', 'a', 'n', 'g', '.', 'o', 'r', 'g', '/', 'p', 'r', 'o', 't', 'o',
'b', 'u', 'f', '/', 't', 'y', 'p', 'e', 's', '/', 'k', 'n', 'o', 'w', 'n', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'p',
'b', '\370', '\001', '\001', '\242', '\002', '\003', 'G', 'P', 'B', '\252', '\002', '\036', 'G', 'o', 'o', 'g', 'l', 'e', '.', 'P', 'r', 'o', 't', 'o',
'b', 'u', 'f', '.', 'W', 'e', 'l', 'l', 'K', 'n', 'o', 'w', 'n', 'T', 'y', 'p', 'e', 's', 'b', '\006', 'p', 'r', 'o', 't', 'o',
'3',
};
static upb_def_init *deps[1] = {
@ -35,5 +36,5 @@ upb_def_init google_protobuf_duration_proto_upbdefinit = {
deps,
layouts,
"google/protobuf/duration.proto",
UPB_STRVIEW_INIT(descriptor, 243)
UPB_STRVIEW_INIT(descriptor, 251)
};

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save