grpc 1.40.0 → 1.43.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of grpc might be problematic. Click here for more details.

Files changed (1362) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +137 -82
  3. data/etc/roots.pem +335 -326
  4. data/include/grpc/byte_buffer.h +1 -1
  5. data/include/grpc/byte_buffer_reader.h +1 -1
  6. data/include/grpc/event_engine/endpoint_config.h +6 -11
  7. data/include/grpc/event_engine/event_engine.h +164 -95
  8. data/include/grpc/event_engine/internal/memory_allocator_impl.h +68 -0
  9. data/include/grpc/event_engine/memory_allocator.h +226 -0
  10. data/include/grpc/event_engine/memory_request.h +57 -0
  11. data/include/grpc/event_engine/port.h +1 -3
  12. data/include/grpc/fork.h +1 -1
  13. data/include/grpc/grpc.h +14 -4
  14. data/include/grpc/grpc_posix.h +5 -2
  15. data/include/grpc/grpc_security.h +294 -145
  16. data/include/grpc/grpc_security_constants.h +2 -14
  17. data/include/grpc/impl/codegen/atm.h +5 -3
  18. data/include/grpc/impl/codegen/atm_gcc_atomic.h +2 -0
  19. data/include/grpc/impl/codegen/atm_gcc_sync.h +2 -0
  20. data/include/grpc/impl/codegen/atm_windows.h +2 -0
  21. data/include/grpc/impl/codegen/byte_buffer.h +2 -0
  22. data/include/grpc/impl/codegen/byte_buffer_reader.h +2 -0
  23. data/include/grpc/impl/codegen/compression_types.h +2 -0
  24. data/include/grpc/impl/codegen/connectivity_state.h +2 -0
  25. data/include/grpc/impl/codegen/fork.h +2 -0
  26. data/include/grpc/impl/codegen/gpr_slice.h +2 -0
  27. data/include/grpc/impl/codegen/gpr_types.h +2 -0
  28. data/include/grpc/impl/codegen/grpc_types.h +4 -5
  29. data/include/grpc/impl/codegen/log.h +2 -0
  30. data/include/grpc/impl/codegen/port_platform.h +37 -22
  31. data/include/grpc/impl/codegen/propagation_bits.h +2 -0
  32. data/include/grpc/impl/codegen/slice.h +2 -0
  33. data/include/grpc/impl/codegen/status.h +2 -0
  34. data/include/grpc/impl/codegen/sync.h +8 -5
  35. data/include/grpc/impl/codegen/sync_abseil.h +2 -0
  36. data/include/grpc/impl/codegen/sync_custom.h +2 -0
  37. data/include/grpc/impl/codegen/sync_generic.h +3 -0
  38. data/include/grpc/impl/codegen/sync_posix.h +4 -2
  39. data/include/grpc/impl/codegen/sync_windows.h +2 -0
  40. data/include/grpc/slice.h +1 -1
  41. data/include/grpc/status.h +1 -1
  42. data/include/grpc/support/atm.h +1 -1
  43. data/include/grpc/support/atm_gcc_atomic.h +1 -1
  44. data/include/grpc/support/atm_gcc_sync.h +1 -1
  45. data/include/grpc/support/atm_windows.h +1 -1
  46. data/include/grpc/support/log.h +1 -1
  47. data/include/grpc/support/port_platform.h +1 -1
  48. data/include/grpc/support/sync.h +1 -1
  49. data/include/grpc/support/sync_abseil.h +1 -1
  50. data/include/grpc/support/sync_custom.h +1 -1
  51. data/include/grpc/support/sync_generic.h +1 -1
  52. data/include/grpc/support/sync_posix.h +1 -1
  53. data/include/grpc/support/sync_windows.h +1 -1
  54. data/include/grpc/support/time.h +2 -2
  55. data/src/core/ext/filters/census/grpc_context.cc +1 -0
  56. data/src/core/ext/filters/client_channel/backend_metric.cc +21 -24
  57. data/src/core/ext/filters/client_channel/backend_metric.h +3 -2
  58. data/src/core/ext/filters/client_channel/backup_poller.cc +2 -1
  59. data/src/core/ext/filters/client_channel/backup_poller.h +1 -0
  60. data/src/core/ext/filters/client_channel/channel_connectivity.cc +72 -91
  61. data/src/core/ext/filters/client_channel/client_channel.cc +256 -308
  62. data/src/core/ext/filters/client_channel/client_channel.h +80 -32
  63. data/src/core/ext/filters/client_channel/client_channel_channelz.cc +6 -5
  64. data/src/core/ext/filters/client_channel/client_channel_channelz.h +1 -1
  65. data/src/core/ext/filters/client_channel/client_channel_factory.cc +2 -1
  66. data/src/core/ext/filters/client_channel/client_channel_factory.h +17 -19
  67. data/src/core/ext/filters/client_channel/client_channel_plugin.cc +15 -15
  68. data/src/core/ext/filters/client_channel/config_selector.cc +2 -1
  69. data/src/core/ext/filters/client_channel/config_selector.h +4 -5
  70. data/src/core/ext/filters/client_channel/connector.h +18 -18
  71. data/src/core/ext/filters/client_channel/dynamic_filters.cc +5 -5
  72. data/src/core/ext/filters/client_channel/global_subchannel_pool.h +0 -1
  73. data/src/core/ext/filters/client_channel/health/health_check_client.cc +19 -17
  74. data/src/core/ext/filters/client_channel/health/health_check_client.h +5 -4
  75. data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +20 -21
  76. data/src/core/ext/filters/client_channel/http_connect_handshaker.h +10 -2
  77. data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc +6 -2
  78. data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +6 -15
  79. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +169 -92
  80. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h +4 -0
  81. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc +1 -1
  82. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +1 -2
  83. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc +3 -4
  84. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +4 -4
  85. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +2 -3
  86. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +23 -7
  87. data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +29 -33
  88. data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +5 -6
  89. data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +2502 -0
  90. data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +6 -1
  91. data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +2 -2
  92. data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +9 -9
  93. data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +47 -99
  94. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h +1 -1
  95. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +97 -41
  96. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +10 -9
  97. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +55 -109
  98. data/src/core/ext/filters/client_channel/lb_policy.h +96 -103
  99. data/src/core/ext/filters/client_channel/lb_policy_factory.h +1 -0
  100. data/src/core/ext/filters/client_channel/lb_policy_registry.cc +4 -7
  101. data/src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc +139 -0
  102. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +16 -18
  103. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +3 -2
  104. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +4 -3
  105. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +17 -20
  106. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +26 -58
  107. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +21 -1
  108. data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +10 -5
  109. data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +5 -3
  110. data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +11 -17
  111. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +283 -349
  112. data/src/core/ext/filters/client_channel/resolver.h +1 -1
  113. data/src/core/ext/filters/client_channel/resolver_factory.h +2 -0
  114. data/src/core/ext/filters/client_channel/resolver_registry.cc +12 -15
  115. data/src/core/ext/filters/client_channel/resolver_registry.h +1 -2
  116. data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +3 -4
  117. data/src/core/ext/filters/client_channel/resolver_result_parsing.h +1 -1
  118. data/src/core/ext/filters/client_channel/retry_filter.cc +48 -86
  119. data/src/core/ext/filters/client_channel/retry_service_config.h +1 -1
  120. data/src/core/ext/filters/client_channel/retry_throttle.cc +17 -48
  121. data/src/core/ext/filters/client_channel/server_address.h +1 -1
  122. data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +49 -36
  123. data/src/core/ext/filters/client_channel/subchannel.cc +89 -147
  124. data/src/core/ext/filters/client_channel/subchannel.h +29 -49
  125. data/src/core/ext/filters/client_channel/subchannel_pool_interface.cc +22 -7
  126. data/src/core/ext/filters/client_channel/subchannel_pool_interface.h +11 -2
  127. data/src/core/ext/filters/client_idle/client_idle_filter.cc +29 -206
  128. data/src/core/ext/filters/client_idle/idle_filter_state.cc +96 -0
  129. data/src/core/ext/filters/client_idle/idle_filter_state.h +66 -0
  130. data/src/core/ext/filters/deadline/deadline_filter.cc +23 -26
  131. data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +28 -26
  132. data/src/core/ext/filters/fault_injection/service_config_parser.cc +6 -14
  133. data/src/core/ext/filters/fault_injection/service_config_parser.h +1 -1
  134. data/src/core/ext/filters/http/client/http_client_filter.cc +50 -68
  135. data/src/core/ext/filters/http/client_authority_filter.cc +16 -16
  136. data/src/core/ext/filters/http/http_filters_plugin.cc +51 -71
  137. data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +19 -13
  138. data/src/core/ext/filters/http/message_compress/message_decompress_filter.cc +8 -9
  139. data/src/core/ext/filters/http/server/http_server_filter.cc +72 -84
  140. data/src/core/ext/filters/max_age/max_age_filter.cc +24 -26
  141. data/src/core/ext/filters/message_size/message_size_filter.cc +28 -29
  142. data/src/core/ext/filters/message_size/message_size_filter.h +1 -1
  143. data/src/core/ext/filters/server_config_selector/server_config_selector.cc +67 -0
  144. data/src/core/ext/filters/server_config_selector/server_config_selector.h +70 -0
  145. data/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc +265 -0
  146. data/src/core/ext/filters/{workarounds/workaround_cronet_compression_filter.h → server_config_selector/server_config_selector_filter.h} +11 -6
  147. data/src/core/ext/{filters/client_channel → service_config}/service_config.cc +2 -2
  148. data/src/core/ext/{filters/client_channel → service_config}/service_config.h +4 -4
  149. data/src/core/ext/service_config/service_config_call_data.h +72 -0
  150. data/src/core/ext/{filters/client_channel → service_config}/service_config_parser.cc +3 -3
  151. data/src/core/ext/{filters/client_channel → service_config}/service_config_parser.h +8 -6
  152. data/src/core/ext/transport/chttp2/alpn/alpn.cc +2 -1
  153. data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +10 -12
  154. data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +26 -29
  155. data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc +9 -8
  156. data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +33 -54
  157. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +66 -70
  158. data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +2 -4
  159. data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +7 -5
  160. data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc +11 -15
  161. data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +3 -1
  162. data/src/core/ext/transport/chttp2/transport/bin_decoder.h +2 -1
  163. data/src/core/ext/transport/chttp2/transport/bin_encoder.cc +1 -0
  164. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +120 -134
  165. data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +4 -2
  166. data/src/core/ext/transport/chttp2/transport/context_list.cc +2 -3
  167. data/src/core/ext/transport/chttp2/transport/context_list.h +3 -5
  168. data/src/core/ext/transport/chttp2/transport/flow_control.cc +62 -43
  169. data/src/core/ext/transport/chttp2/transport/flow_control.h +15 -9
  170. data/src/core/ext/transport/chttp2/transport/frame_data.cc +11 -11
  171. data/src/core/ext/transport/chttp2/transport/frame_data.h +1 -0
  172. data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +6 -4
  173. data/src/core/ext/transport/chttp2/transport/frame_goaway.h +1 -0
  174. data/src/core/ext/transport/chttp2/transport/frame_ping.cc +6 -5
  175. data/src/core/ext/transport/chttp2/transport/frame_ping.h +1 -0
  176. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +5 -8
  177. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +1 -0
  178. data/src/core/ext/transport/chttp2/transport/frame_settings.cc +38 -7
  179. data/src/core/ext/transport/chttp2/transport/frame_settings.h +1 -0
  180. data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +12 -7
  181. data/src/core/ext/transport/chttp2/transport/frame_window_update.h +1 -0
  182. data/src/core/ext/transport/chttp2/transport/hpack_constants.h +41 -0
  183. data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +378 -668
  184. data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +272 -70
  185. data/src/core/ext/transport/chttp2/transport/hpack_encoder_index.h +107 -0
  186. data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc +86 -0
  187. data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h +69 -0
  188. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +792 -1041
  189. data/src/core/ext/transport/chttp2/transport/hpack_parser.h +75 -177
  190. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +146 -0
  191. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +137 -0
  192. data/src/core/ext/transport/chttp2/transport/hpack_utils.cc +46 -0
  193. data/src/core/ext/transport/chttp2/transport/hpack_utils.h +30 -0
  194. data/src/core/ext/transport/chttp2/transport/internal.h +14 -9
  195. data/src/core/ext/transport/chttp2/transport/parsing.cc +50 -203
  196. data/src/core/ext/transport/chttp2/transport/popularity_count.h +60 -0
  197. data/src/core/ext/transport/chttp2/transport/stream_lists.cc +2 -2
  198. data/src/core/ext/transport/chttp2/transport/varint.cc +7 -3
  199. data/src/core/ext/transport/chttp2/transport/varint.h +39 -28
  200. data/src/core/ext/transport/chttp2/transport/writing.cc +61 -50
  201. data/src/core/ext/transport/inproc/inproc_transport.cc +126 -119
  202. data/src/core/ext/transport/inproc/inproc_transport.h +1 -1
  203. data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c +198 -166
  204. data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h +223 -89
  205. data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c +42 -1
  206. data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +19 -1
  207. data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +27 -3
  208. data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +18 -5
  209. data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +108 -83
  210. data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +153 -61
  211. data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +189 -161
  212. data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +173 -69
  213. data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c +36 -23
  214. data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h +33 -13
  215. data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +279 -211
  216. data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +370 -102
  217. data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c +17 -6
  218. data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h +13 -5
  219. data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +37 -26
  220. data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +13 -5
  221. data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +57 -40
  222. data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +73 -29
  223. data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c +17 -6
  224. data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h +13 -5
  225. data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +172 -126
  226. data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +256 -85
  227. data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +52 -37
  228. data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +53 -21
  229. data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c +16 -5
  230. data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h +13 -5
  231. data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c +26 -14
  232. data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h +23 -9
  233. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +115 -91
  234. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +133 -53
  235. data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +91 -72
  236. data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +98 -33
  237. data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c +18 -7
  238. data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h +13 -5
  239. data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +122 -93
  240. data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +166 -57
  241. data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +14 -3
  242. data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h +13 -5
  243. data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c +22 -10
  244. data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h +23 -9
  245. data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +19 -8
  246. data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +13 -5
  247. data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +23 -12
  248. data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +13 -5
  249. data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c +18 -7
  250. data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h +13 -5
  251. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +42 -28
  252. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h +33 -13
  253. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +82 -32
  254. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +176 -17
  255. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c +59 -44
  256. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h +53 -21
  257. data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c +16 -5
  258. data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h +13 -5
  259. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +74 -58
  260. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +63 -25
  261. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +82 -65
  262. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +73 -29
  263. data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +26 -15
  264. data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +13 -5
  265. data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +20 -8
  266. data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +23 -9
  267. data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c +64 -46
  268. data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h +83 -33
  269. data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c +76 -45
  270. data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h +143 -43
  271. data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +101 -77
  272. data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +107 -29
  273. data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +42 -29
  274. data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +33 -13
  275. data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +516 -446
  276. data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +620 -267
  277. data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c +27 -14
  278. data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h +33 -13
  279. data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +22 -10
  280. data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h +23 -9
  281. data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c +14 -3
  282. data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +13 -5
  283. data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c +36 -21
  284. data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h +53 -21
  285. data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +45 -32
  286. data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +33 -13
  287. data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +23 -12
  288. data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +13 -5
  289. data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +211 -183
  290. data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +193 -77
  291. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c +8 -1
  292. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h +6 -4
  293. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +75 -45
  294. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +120 -34
  295. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +34 -21
  296. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +33 -13
  297. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +88 -70
  298. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +110 -55
  299. data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c +13 -2
  300. data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h +13 -5
  301. data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c +13 -2
  302. data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h +13 -5
  303. data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +76 -59
  304. data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +63 -25
  305. data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c +13 -2
  306. data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h +13 -5
  307. data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c +13 -2
  308. data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h +13 -5
  309. data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +26 -14
  310. data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h +23 -9
  311. data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c +13 -2
  312. data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h +13 -5
  313. data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c +13 -2
  314. data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h +13 -5
  315. data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c +62 -47
  316. data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h +53 -21
  317. data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c +27 -13
  318. data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h +43 -17
  319. data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c +24 -11
  320. data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h +27 -9
  321. data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c +18 -7
  322. data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h +13 -5
  323. data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c +17 -6
  324. data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h +13 -5
  325. data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c +16 -5
  326. data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h +13 -5
  327. data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +28 -15
  328. data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h +33 -13
  329. data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +26 -14
  330. data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h +23 -9
  331. data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c +21 -9
  332. data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h +23 -9
  333. data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c +31 -18
  334. data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h +33 -13
  335. data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c +39 -22
  336. data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h +73 -29
  337. data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c +42 -27
  338. data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h +53 -21
  339. data/src/core/ext/upb-generated/envoy/type/v3/http.upb.c +8 -1
  340. data/src/core/ext/upb-generated/envoy/type/v3/http.upb.h +3 -1
  341. data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c +18 -6
  342. data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h +23 -9
  343. data/src/core/ext/upb-generated/envoy/type/v3/range.upb.c +23 -10
  344. data/src/core/ext/upb-generated/envoy/type/v3/range.upb.h +33 -13
  345. data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c +16 -5
  346. data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h +13 -5
  347. data/src/core/ext/upb-generated/google/api/annotations.upb.c +21 -1
  348. data/src/core/ext/upb-generated/google/api/annotations.upb.h +8 -1
  349. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c +117 -94
  350. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h +113 -45
  351. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/eval.upb.c +102 -0
  352. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/eval.upb.h +306 -0
  353. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/explain.upb.c +56 -0
  354. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/explain.upb.h +135 -0
  355. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +123 -99
  356. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +123 -49
  357. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/value.upb.c +115 -0
  358. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/value.upb.h +371 -0
  359. data/src/core/ext/upb-generated/google/api/http.upb.c +36 -23
  360. data/src/core/ext/upb-generated/google/api/http.upb.h +33 -13
  361. data/src/core/ext/upb-generated/google/protobuf/any.upb.c +15 -4
  362. data/src/core/ext/upb-generated/google/protobuf/any.upb.h +13 -5
  363. data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +248 -211
  364. data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +273 -109
  365. data/src/core/ext/upb-generated/google/protobuf/duration.upb.c +15 -4
  366. data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +13 -5
  367. data/src/core/ext/upb-generated/google/protobuf/empty.upb.c +13 -2
  368. data/src/core/ext/upb-generated/google/protobuf/empty.upb.h +13 -5
  369. data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +38 -24
  370. data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +33 -13
  371. data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +15 -4
  372. data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +13 -5
  373. data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +38 -19
  374. data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +93 -37
  375. data/src/core/ext/upb-generated/google/rpc/status.upb.c +18 -7
  376. data/src/core/ext/upb-generated/google/rpc/status.upb.h +13 -5
  377. data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +27 -15
  378. data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +13 -5
  379. data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +106 -84
  380. data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +103 -41
  381. data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c +21 -9
  382. data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +23 -9
  383. data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c +17 -5
  384. data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +23 -9
  385. data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +66 -48
  386. data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +115 -63
  387. data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c +68 -0
  388. data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h +156 -0
  389. data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +68 -8
  390. data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +58 -13
  391. data/src/core/ext/upb-generated/udpa/annotations/security.upb.c +28 -6
  392. data/src/core/ext/upb-generated/udpa/annotations/security.upb.h +18 -5
  393. data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c +20 -1
  394. data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +8 -1
  395. data/src/core/ext/upb-generated/udpa/annotations/status.upb.c +28 -4
  396. data/src/core/ext/upb-generated/udpa/annotations/status.upb.h +18 -5
  397. data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c +27 -3
  398. data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h +18 -5
  399. data/src/core/ext/upb-generated/validate/validate.upb.c +321 -252
  400. data/src/core/ext/upb-generated/validate/validate.upb.h +251 -93
  401. data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c +103 -0
  402. data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h +199 -0
  403. data/src/core/ext/upb-generated/xds/core/v3/authority.upb.c +15 -4
  404. data/src/core/ext/upb-generated/xds/core/v3/authority.upb.h +13 -5
  405. data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c +26 -14
  406. data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h +23 -9
  407. data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c +21 -9
  408. data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h +13 -5
  409. data/src/core/ext/upb-generated/xds/core/v3/resource.upb.c +20 -9
  410. data/src/core/ext/upb-generated/xds/core/v3/resource.upb.h +13 -5
  411. data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c +29 -17
  412. data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h +23 -9
  413. data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c +20 -9
  414. data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h +13 -5
  415. data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c +71 -0
  416. data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h +132 -0
  417. data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c +44 -0
  418. data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h +85 -0
  419. data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c +2 -49
  420. data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c +2 -2
  421. data/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c +2 -7
  422. data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c +2 -35
  423. data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +2 -41
  424. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c +2 -11
  425. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +407 -434
  426. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h +10 -0
  427. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c +2 -7
  428. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c +2 -7
  429. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c +2 -19
  430. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c +2 -7
  431. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +100 -138
  432. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h +5 -0
  433. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +2 -15
  434. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c +2 -7
  435. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c +2 -9
  436. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c +2 -33
  437. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +61 -77
  438. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c +2 -7
  439. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +61 -79
  440. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c +2 -7
  441. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c +2 -9
  442. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c +2 -7
  443. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c +2 -7
  444. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c +2 -7
  445. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c +2 -13
  446. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +87 -75
  447. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h +10 -0
  448. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c +2 -15
  449. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c +2 -7
  450. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +2 -17
  451. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c +2 -19
  452. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c +2 -7
  453. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c +2 -9
  454. data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c +2 -21
  455. data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c +29 -39
  456. data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h +5 -0
  457. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +2 -11
  458. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +803 -894
  459. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c +2 -11
  460. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c +2 -9
  461. data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c +2 -7
  462. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c +2 -15
  463. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c +2 -11
  464. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c +2 -7
  465. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +98 -143
  466. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c +2 -2
  467. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +132 -129
  468. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h +5 -0
  469. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c +2 -11
  470. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +180 -190
  471. data/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c +2 -7
  472. data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c +2 -7
  473. data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c +2 -19
  474. data/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c +2 -7
  475. data/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c +2 -7
  476. data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c +2 -9
  477. data/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c +2 -7
  478. data/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c +2 -7
  479. data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c +2 -15
  480. data/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c +2 -13
  481. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c +16 -22
  482. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c +2 -7
  483. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c +2 -7
  484. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c +2 -7
  485. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c +2 -11
  486. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c +2 -9
  487. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c +2 -9
  488. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c +2 -11
  489. data/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c +2 -19
  490. data/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c +2 -15
  491. data/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c +2 -2
  492. data/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c +2 -9
  493. data/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c +2 -11
  494. data/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c +2 -7
  495. data/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c +2 -2
  496. data/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c +2 -11
  497. data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c +2 -7
  498. data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c +105 -162
  499. data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c +2 -7
  500. data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c +2 -7
  501. data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c +2 -13
  502. data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c +2 -7
  503. data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c +2 -23
  504. data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c +2 -7
  505. data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c +7 -15
  506. data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c +21 -30
  507. data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c +6 -5
  508. data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c +7 -10
  509. data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c +7 -11
  510. data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c +2 -51
  511. data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c +64 -0
  512. data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h +50 -0
  513. data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c +15 -19
  514. data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c +27 -33
  515. data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c +18 -24
  516. data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c +19 -23
  517. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c +35 -41
  518. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c +21 -25
  519. data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c +40 -0
  520. data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h +35 -0
  521. data/src/core/ext/xds/certificate_provider_registry.cc +3 -3
  522. data/src/core/ext/xds/certificate_provider_store.h +1 -1
  523. data/src/core/ext/xds/xds_api.cc +1386 -1440
  524. data/src/core/ext/xds/xds_api.h +152 -115
  525. data/src/core/ext/xds/xds_bootstrap.cc +33 -55
  526. data/src/core/ext/xds/xds_bootstrap.h +10 -0
  527. data/src/core/ext/xds/xds_certificate_provider.cc +3 -3
  528. data/src/core/ext/xds/xds_certificate_provider.h +1 -2
  529. data/src/core/ext/xds/xds_channel_stack_modifier.cc +112 -0
  530. data/src/core/ext/xds/xds_channel_stack_modifier.h +52 -0
  531. data/src/core/ext/xds/xds_client.cc +793 -437
  532. data/src/core/ext/xds/xds_client.h +83 -69
  533. data/src/core/ext/xds/xds_client_stats.cc +16 -15
  534. data/src/core/ext/xds/xds_client_stats.h +7 -7
  535. data/src/core/ext/xds/xds_http_fault_filter.cc +4 -3
  536. data/src/core/ext/xds/xds_http_fault_filter.h +3 -2
  537. data/src/core/ext/xds/xds_http_filters.cc +1 -0
  538. data/src/core/ext/xds/xds_routing.cc +247 -0
  539. data/src/core/ext/xds/xds_routing.h +98 -0
  540. data/src/core/ext/xds/xds_server_config_fetcher.cc +976 -264
  541. data/src/core/lib/address_utils/parse_address.cc +6 -8
  542. data/src/core/lib/address_utils/sockaddr_utils.cc +2 -2
  543. data/src/core/lib/avl/avl.h +389 -88
  544. data/src/core/lib/backoff/backoff.cc +3 -3
  545. data/src/core/lib/channel/channel_args.cc +27 -8
  546. data/src/core/lib/channel/channel_args.h +11 -1
  547. data/src/core/lib/channel/channel_args_preconditioning.cc +47 -0
  548. data/src/core/lib/channel/channel_args_preconditioning.h +62 -0
  549. data/src/core/lib/channel/channel_stack.cc +5 -3
  550. data/src/core/lib/channel/channel_stack_builder.cc +3 -15
  551. data/src/core/lib/channel/channel_stack_builder.h +0 -8
  552. data/src/core/lib/channel/channel_trace.cc +11 -10
  553. data/src/core/lib/channel/channel_trace.h +2 -1
  554. data/src/core/lib/channel/channelz.cc +43 -39
  555. data/src/core/lib/channel/channelz.h +29 -29
  556. data/src/core/lib/channel/channelz_registry.cc +8 -7
  557. data/src/core/lib/channel/channelz_registry.h +1 -1
  558. data/src/core/lib/channel/connected_channel.cc +2 -3
  559. data/src/core/lib/channel/connected_channel.h +1 -2
  560. data/src/core/lib/channel/handshaker.cc +2 -1
  561. data/src/core/lib/channel/handshaker.h +1 -2
  562. data/src/core/lib/channel/handshaker_factory.h +10 -2
  563. data/src/core/lib/channel/handshaker_registry.cc +15 -70
  564. data/src/core/lib/channel/handshaker_registry.h +29 -12
  565. data/src/core/lib/channel/status_util.h +2 -2
  566. data/src/core/lib/compression/algorithm_metadata.h +1 -0
  567. data/src/core/lib/compression/compression.cc +2 -2
  568. data/src/core/lib/compression/compression_args.cc +15 -10
  569. data/src/core/lib/compression/compression_args.h +6 -4
  570. data/src/core/lib/compression/compression_internal.cc +4 -6
  571. data/src/core/lib/compression/compression_internal.h +1 -1
  572. data/src/core/lib/compression/message_compress.cc +2 -2
  573. data/src/core/lib/compression/stream_compression.cc +2 -1
  574. data/src/core/lib/compression/stream_compression.h +2 -1
  575. data/src/core/lib/compression/stream_compression_gzip.cc +2 -1
  576. data/src/core/lib/compression/stream_compression_identity.cc +2 -1
  577. data/src/core/lib/config/core_configuration.cc +98 -0
  578. data/src/core/lib/config/core_configuration.h +157 -0
  579. data/src/core/lib/debug/stats.cc +1 -1
  580. data/src/core/lib/debug/stats.h +1 -0
  581. data/src/core/lib/debug/stats_data.cc +15 -14
  582. data/src/core/lib/debug/stats_data.h +1 -0
  583. data/src/core/lib/debug/trace.cc +1 -0
  584. data/src/core/lib/debug/trace.h +4 -3
  585. data/src/core/lib/event_engine/{endpoint_config.cc → channel_args_endpoint_config.cc} +2 -2
  586. data/src/core/lib/event_engine/{endpoint_config_internal.h → channel_args_endpoint_config.h} +3 -3
  587. data/src/core/lib/event_engine/event_engine.cc +0 -13
  588. data/src/core/lib/event_engine/event_engine_factory.cc +49 -0
  589. data/src/core/lib/event_engine/event_engine_factory.h +33 -0
  590. data/src/core/lib/event_engine/memory_allocator.cc +70 -0
  591. data/src/core/lib/event_engine/sockaddr.cc +3 -3
  592. data/src/core/lib/gpr/alloc.cc +4 -3
  593. data/src/core/lib/gpr/atm.cc +1 -1
  594. data/src/core/lib/gpr/cpu_posix.cc +1 -1
  595. data/src/core/lib/gpr/env_linux.cc +1 -2
  596. data/src/core/lib/gpr/env_posix.cc +2 -3
  597. data/src/core/lib/gpr/log.cc +3 -3
  598. data/src/core/lib/gpr/log_android.cc +3 -2
  599. data/src/core/lib/gpr/log_linux.cc +7 -4
  600. data/src/core/lib/gpr/log_posix.cc +6 -3
  601. data/src/core/lib/gpr/string.cc +2 -2
  602. data/src/core/lib/gpr/string.h +2 -2
  603. data/src/core/lib/gpr/sync.cc +2 -2
  604. data/src/core/lib/gpr/sync_abseil.cc +7 -6
  605. data/src/core/lib/gpr/sync_posix.cc +3 -3
  606. data/src/core/lib/gpr/time.cc +3 -2
  607. data/src/core/lib/gpr/time_windows.cc +3 -2
  608. data/src/core/lib/gpr/tls.h +125 -40
  609. data/src/core/lib/gpr/tmpfile_posix.cc +1 -2
  610. data/src/core/lib/gpr/useful.h +79 -32
  611. data/src/core/lib/gprpp/arena.cc +2 -1
  612. data/src/core/lib/gprpp/arena.h +15 -5
  613. data/src/core/lib/gprpp/atomic_utils.h +47 -0
  614. data/src/core/lib/gprpp/bitset.h +188 -0
  615. data/src/core/lib/gprpp/chunked_vector.h +211 -0
  616. data/src/core/lib/{transport/authority_override.cc → gprpp/construct_destruct.h} +16 -17
  617. data/src/core/lib/gprpp/cpp_impl_of.h +45 -0
  618. data/src/core/lib/gprpp/dual_ref_counted.h +25 -26
  619. data/src/core/lib/gprpp/fork.cc +14 -12
  620. data/src/core/lib/gprpp/fork.h +4 -4
  621. data/src/core/lib/gprpp/global_config.h +1 -2
  622. data/src/core/lib/gprpp/global_config_env.cc +14 -14
  623. data/src/core/lib/gprpp/global_config_env.h +2 -2
  624. data/src/core/lib/gprpp/global_config_generic.h +2 -2
  625. data/src/core/lib/gprpp/manual_constructor.h +10 -8
  626. data/src/core/lib/gprpp/memory.h +9 -3
  627. data/src/core/lib/gprpp/mpscq.cc +7 -7
  628. data/src/core/lib/gprpp/mpscq.h +6 -5
  629. data/src/core/lib/gprpp/orphanable.h +4 -4
  630. data/src/core/lib/gprpp/ref_counted.h +19 -19
  631. data/src/core/lib/gprpp/ref_counted_ptr.h +2 -4
  632. data/src/core/lib/gprpp/status_helper.cc +27 -7
  633. data/src/core/lib/gprpp/status_helper.h +13 -2
  634. data/src/core/lib/gprpp/sync.h +3 -1
  635. data/src/core/lib/gprpp/table.h +423 -0
  636. data/src/core/lib/gprpp/thd_posix.cc +5 -5
  637. data/src/core/lib/gprpp/thd_windows.cc +4 -11
  638. data/src/core/lib/gprpp/time_util.cc +2 -2
  639. data/src/core/lib/gprpp/time_util.h +2 -2
  640. data/src/core/lib/http/format_request.cc +1 -0
  641. data/src/core/lib/http/format_request.h +1 -0
  642. data/src/core/lib/http/httpcli.cc +219 -197
  643. data/src/core/lib/http/httpcli.h +14 -9
  644. data/src/core/lib/http/httpcli_security_connector.cc +5 -8
  645. data/src/core/lib/http/parser.cc +2 -2
  646. data/src/core/lib/http/parser.h +1 -0
  647. data/src/core/lib/iomgr/buffer_list.cc +11 -10
  648. data/src/core/lib/iomgr/buffer_list.h +14 -15
  649. data/src/core/lib/iomgr/call_combiner.cc +30 -12
  650. data/src/core/lib/iomgr/cfstream_handle.cc +1 -1
  651. data/src/core/lib/iomgr/combiner.cc +9 -23
  652. data/src/core/lib/iomgr/combiner.h +1 -0
  653. data/src/core/lib/iomgr/dualstack_socket_posix.cc +1 -0
  654. data/src/core/lib/iomgr/endpoint.cc +0 -4
  655. data/src/core/lib/iomgr/endpoint.h +1 -4
  656. data/src/core/lib/iomgr/endpoint_cfstream.cc +15 -42
  657. data/src/core/lib/iomgr/endpoint_cfstream.h +4 -4
  658. data/src/core/lib/iomgr/endpoint_pair.h +1 -0
  659. data/src/core/lib/iomgr/endpoint_pair_event_engine.cc +1 -2
  660. data/src/core/lib/iomgr/endpoint_pair_posix.cc +11 -9
  661. data/src/core/lib/iomgr/endpoint_pair_windows.cc +5 -6
  662. data/src/core/lib/iomgr/error.cc +113 -52
  663. data/src/core/lib/iomgr/error.h +73 -18
  664. data/src/core/lib/iomgr/error_cfstream.cc +7 -2
  665. data/src/core/lib/iomgr/error_internal.h +1 -0
  666. data/src/core/lib/iomgr/ev_epoll1_linux.cc +17 -24
  667. data/src/core/lib/iomgr/ev_epollex_linux.cc +22 -29
  668. data/src/core/lib/iomgr/ev_poll_posix.cc +42 -45
  669. data/src/core/lib/iomgr/ev_posix.cc +1 -2
  670. data/src/core/lib/iomgr/event_engine/closure.cc +41 -18
  671. data/src/core/lib/iomgr/event_engine/closure.h +10 -1
  672. data/src/core/lib/iomgr/event_engine/endpoint.cc +7 -27
  673. data/src/core/lib/iomgr/event_engine/endpoint.h +1 -2
  674. data/src/core/lib/iomgr/event_engine/iomgr.cc +7 -28
  675. data/src/core/lib/iomgr/event_engine/pollset.cc +5 -4
  676. data/src/core/lib/iomgr/event_engine/resolver.cc +14 -9
  677. data/src/core/lib/iomgr/event_engine/tcp.cc +66 -34
  678. data/src/core/lib/iomgr/event_engine/timer.cc +10 -4
  679. data/src/core/lib/iomgr/exec_ctx.cc +4 -13
  680. data/src/core/lib/iomgr/exec_ctx.h +22 -30
  681. data/src/core/lib/iomgr/executor/mpmcqueue.cc +15 -16
  682. data/src/core/lib/iomgr/executor/mpmcqueue.h +7 -11
  683. data/src/core/lib/iomgr/executor/threadpool.cc +2 -2
  684. data/src/core/lib/iomgr/executor/threadpool.h +2 -1
  685. data/src/core/lib/iomgr/executor.cc +20 -38
  686. data/src/core/lib/iomgr/executor.h +1 -1
  687. data/src/core/lib/iomgr/grpc_if_nametoindex_posix.cc +2 -2
  688. data/src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc +2 -2
  689. data/src/core/lib/iomgr/internal_errqueue.cc +3 -2
  690. data/src/core/lib/iomgr/iocp_windows.cc +1 -0
  691. data/src/core/lib/iomgr/iomgr.cc +3 -1
  692. data/src/core/lib/iomgr/iomgr.h +2 -2
  693. data/src/core/lib/iomgr/iomgr_custom.cc +2 -2
  694. data/src/core/lib/iomgr/iomgr_custom.h +2 -2
  695. data/src/core/lib/iomgr/iomgr_internal.cc +6 -10
  696. data/src/core/lib/iomgr/iomgr_internal.h +3 -2
  697. data/src/core/lib/iomgr/iomgr_windows.cc +1 -2
  698. data/src/core/lib/iomgr/is_epollexclusive_available.cc +4 -4
  699. data/src/core/lib/iomgr/load_file.cc +2 -2
  700. data/src/core/lib/iomgr/lockfree_event.cc +18 -0
  701. data/src/core/lib/iomgr/polling_entity.cc +2 -2
  702. data/src/core/lib/iomgr/pollset_custom.cc +4 -5
  703. data/src/core/lib/iomgr/pollset_custom.h +3 -3
  704. data/src/core/lib/iomgr/pollset_set_custom.cc +1 -2
  705. data/src/core/lib/iomgr/pollset_set_windows.cc +1 -0
  706. data/src/core/lib/iomgr/port.h +0 -5
  707. data/src/core/lib/iomgr/python_util.h +1 -0
  708. data/src/core/lib/iomgr/resolve_address.cc +2 -1
  709. data/src/core/lib/iomgr/resolve_address.h +0 -4
  710. data/src/core/lib/iomgr/resolve_address_custom.cc +4 -4
  711. data/src/core/lib/iomgr/resolve_address_custom.h +0 -1
  712. data/src/core/lib/iomgr/resolve_address_posix.cc +7 -11
  713. data/src/core/lib/iomgr/resolve_address_windows.cc +6 -8
  714. data/src/core/lib/iomgr/sockaddr.h +1 -1
  715. data/src/core/lib/iomgr/socket_factory_posix.cc +5 -5
  716. data/src/core/lib/iomgr/socket_factory_posix.h +1 -0
  717. data/src/core/lib/iomgr/socket_mutator.cc +2 -2
  718. data/src/core/lib/iomgr/socket_mutator.h +2 -2
  719. data/src/core/lib/iomgr/socket_utils_common_posix.cc +4 -5
  720. data/src/core/lib/iomgr/socket_utils_linux.cc +4 -4
  721. data/src/core/lib/iomgr/socket_utils_posix.cc +2 -2
  722. data/src/core/lib/iomgr/socket_utils_posix.h +2 -2
  723. data/src/core/lib/iomgr/socket_utils_windows.cc +2 -2
  724. data/src/core/lib/iomgr/tcp_client.h +2 -0
  725. data/src/core/lib/iomgr/tcp_client_cfstream.cc +7 -23
  726. data/src/core/lib/iomgr/tcp_client_custom.cc +6 -20
  727. data/src/core/lib/iomgr/tcp_client_posix.cc +14 -24
  728. data/src/core/lib/iomgr/tcp_client_posix.h +3 -1
  729. data/src/core/lib/iomgr/tcp_client_windows.cc +7 -9
  730. data/src/core/lib/iomgr/tcp_custom.cc +12 -51
  731. data/src/core/lib/iomgr/tcp_custom.h +1 -1
  732. data/src/core/lib/iomgr/tcp_posix.cc +51 -87
  733. data/src/core/lib/iomgr/tcp_posix.h +9 -12
  734. data/src/core/lib/iomgr/tcp_server.h +4 -3
  735. data/src/core/lib/iomgr/tcp_server_custom.cc +7 -34
  736. data/src/core/lib/iomgr/tcp_server_posix.cc +15 -13
  737. data/src/core/lib/iomgr/tcp_server_utils_posix.h +21 -17
  738. data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +1 -2
  739. data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +3 -4
  740. data/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc +4 -4
  741. data/src/core/lib/iomgr/tcp_server_windows.cc +6 -10
  742. data/src/core/lib/iomgr/tcp_windows.cc +5 -29
  743. data/src/core/lib/iomgr/tcp_windows.h +1 -1
  744. data/src/core/lib/iomgr/timer.cc +1 -0
  745. data/src/core/lib/iomgr/timer.h +1 -2
  746. data/src/core/lib/iomgr/timer_custom.cc +2 -2
  747. data/src/core/lib/iomgr/timer_generic.cc +21 -51
  748. data/src/core/lib/iomgr/timer_generic.h +1 -0
  749. data/src/core/lib/iomgr/timer_heap.cc +2 -3
  750. data/src/core/lib/iomgr/unix_sockets_posix.cc +4 -6
  751. data/src/core/lib/iomgr/unix_sockets_posix.h +3 -4
  752. data/src/core/lib/iomgr/unix_sockets_posix_noop.cc +1 -1
  753. data/src/core/lib/iomgr/wakeup_fd_nospecial.cc +1 -0
  754. data/src/core/lib/iomgr/wakeup_fd_pipe.cc +2 -3
  755. data/src/core/lib/iomgr/wakeup_fd_posix.cc +1 -0
  756. data/src/core/lib/iomgr/work_serializer.cc +115 -44
  757. data/src/core/lib/iomgr/work_serializer.h +17 -5
  758. data/src/core/lib/json/json_reader.cc +92 -52
  759. data/src/core/lib/json/json_util.cc +69 -1
  760. data/src/core/lib/json/json_util.h +65 -115
  761. data/src/core/lib/json/json_writer.cc +0 -3
  762. data/src/core/lib/matchers/matchers.h +0 -1
  763. data/src/core/lib/profiling/basic_timers.cc +8 -6
  764. data/src/core/lib/profiling/stap_timers.cc +2 -2
  765. data/src/core/lib/promise/activity.cc +115 -0
  766. data/src/core/lib/promise/activity.h +499 -0
  767. data/src/core/lib/promise/context.h +86 -0
  768. data/src/core/lib/promise/detail/basic_seq.h +407 -0
  769. data/src/core/lib/promise/detail/promise_factory.h +189 -0
  770. data/src/core/lib/promise/detail/promise_like.h +85 -0
  771. data/src/core/lib/promise/detail/status.h +44 -0
  772. data/src/core/lib/promise/detail/switch.h +1455 -0
  773. data/src/core/lib/promise/exec_ctx_wakeup_scheduler.h +48 -0
  774. data/src/core/lib/promise/loop.h +108 -0
  775. data/src/core/lib/promise/map.h +88 -0
  776. data/src/core/lib/promise/poll.h +60 -0
  777. data/src/core/lib/promise/race.h +84 -0
  778. data/src/core/lib/promise/seq.h +71 -0
  779. data/src/core/lib/resource_quota/api.cc +108 -0
  780. data/src/core/lib/resource_quota/api.h +41 -0
  781. data/src/core/lib/resource_quota/memory_quota.cc +454 -0
  782. data/src/core/lib/resource_quota/memory_quota.h +421 -0
  783. data/src/core/lib/resource_quota/resource_quota.cc +33 -0
  784. data/src/core/lib/resource_quota/resource_quota.h +58 -0
  785. data/src/core/lib/{transport/authority_override.h → resource_quota/thread_quota.cc} +22 -16
  786. data/src/core/lib/resource_quota/thread_quota.h +57 -0
  787. data/src/core/lib/{iomgr/event_engine/iomgr.h → resource_quota/trace.cc} +4 -9
  788. data/src/core/lib/resource_quota/trace.h +24 -0
  789. data/src/core/lib/security/authorization/authorization_policy_provider.h +5 -4
  790. data/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc +1 -1
  791. data/src/core/lib/security/authorization/evaluate_args.cc +22 -24
  792. data/src/core/lib/security/authorization/evaluate_args.h +2 -1
  793. data/src/core/lib/security/authorization/sdk_server_authz_filter.cc +173 -0
  794. data/src/core/lib/security/authorization/sdk_server_authz_filter.h +67 -0
  795. data/src/core/lib/security/context/security_context.cc +11 -8
  796. data/src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc +2 -2
  797. data/src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc +2 -2
  798. data/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc +2 -2
  799. data/src/core/lib/security/credentials/composite/composite_credentials.cc +5 -4
  800. data/src/core/lib/security/credentials/credentials.cc +10 -8
  801. data/src/core/lib/security/credentials/credentials.h +7 -2
  802. data/src/core/lib/security/credentials/credentials_metadata.cc +2 -3
  803. data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +24 -38
  804. data/src/core/lib/security/credentials/external/aws_external_account_credentials.h +1 -2
  805. data/src/core/lib/security/credentials/external/aws_request_signer.cc +3 -3
  806. data/src/core/lib/security/credentials/external/external_account_credentials.cc +69 -43
  807. data/src/core/lib/security/credentials/external/external_account_credentials.h +1 -0
  808. data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +5 -8
  809. data/src/core/lib/security/credentials/google_default/credentials_generic.cc +1 -2
  810. data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +60 -10
  811. data/src/core/lib/security/credentials/iam/iam_credentials.cc +2 -1
  812. data/src/core/lib/security/credentials/jwt/json_token.cc +1 -1
  813. data/src/core/lib/security/credentials/jwt/json_token.h +2 -1
  814. data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +31 -14
  815. data/src/core/lib/security/credentials/jwt/jwt_credentials.h +11 -3
  816. data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +9 -17
  817. data/src/core/lib/security/credentials/jwt/jwt_verifier.h +3 -3
  818. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +21 -29
  819. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +1 -0
  820. data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +4 -6
  821. data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +4 -4
  822. data/src/core/lib/security/credentials/ssl/ssl_credentials.h +0 -1
  823. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc +3 -2
  824. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h +10 -6
  825. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +13 -13
  826. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +13 -12
  827. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc +201 -0
  828. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h +106 -0
  829. data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +11 -90
  830. data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +21 -84
  831. data/src/core/lib/security/credentials/tls/tls_credentials.cc +21 -10
  832. data/src/core/lib/security/credentials/xds/xds_credentials.cc +28 -33
  833. data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +3 -3
  834. data/src/core/lib/security/security_connector/alts/alts_security_connector.h +2 -2
  835. data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +9 -12
  836. data/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc +2 -2
  837. data/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +7 -7
  838. data/src/core/lib/security/security_connector/load_system_roots_fallback.cc +1 -0
  839. data/src/core/lib/security/security_connector/load_system_roots_linux.cc +4 -5
  840. data/src/core/lib/security/security_connector/local/local_security_connector.cc +4 -1
  841. data/src/core/lib/security/security_connector/security_connector.cc +9 -4
  842. data/src/core/lib/security/security_connector/security_connector.h +1 -1
  843. data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +4 -7
  844. data/src/core/lib/security/security_connector/ssl/ssl_security_connector.h +1 -2
  845. data/src/core/lib/security/security_connector/ssl_utils.cc +13 -6
  846. data/src/core/lib/security/security_connector/ssl_utils.h +1 -1
  847. data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +345 -200
  848. data/src/core/lib/security/security_connector/tls/tls_security_connector.h +64 -43
  849. data/src/core/lib/security/transport/auth_filters.h +1 -0
  850. data/src/core/lib/security/transport/client_auth_filter.cc +9 -11
  851. data/src/core/lib/security/transport/secure_endpoint.cc +4 -14
  852. data/src/core/lib/security/transport/secure_endpoint.h +1 -0
  853. data/src/core/lib/security/transport/security_handshaker.cc +80 -49
  854. data/src/core/lib/security/transport/security_handshaker.h +2 -1
  855. data/src/core/lib/security/transport/server_auth_filter.cc +3 -5
  856. data/src/core/lib/security/transport/tsi_error.cc +3 -5
  857. data/src/core/lib/security/util/json_util.cc +6 -8
  858. data/src/core/lib/slice/percent_encoding.cc +84 -97
  859. data/src/core/lib/slice/percent_encoding.h +23 -28
  860. data/src/core/lib/slice/slice.cc +9 -26
  861. data/src/core/lib/slice/slice.h +341 -0
  862. data/src/core/lib/{gpr/tls_pthread.cc → slice/slice_api.cc} +15 -6
  863. data/src/core/lib/slice/slice_buffer.cc +10 -7
  864. data/src/core/lib/slice/slice_intern.cc +11 -17
  865. data/src/core/lib/slice/slice_internal.h +3 -246
  866. data/src/core/lib/slice/slice_refcount.cc +17 -0
  867. data/src/core/lib/slice/slice_refcount.h +125 -0
  868. data/src/core/lib/slice/slice_refcount_base.h +181 -0
  869. data/src/core/lib/slice/slice_split.cc +100 -0
  870. data/src/core/lib/slice/slice_split.h +40 -0
  871. data/src/core/lib/slice/slice_string_helpers.cc +0 -83
  872. data/src/core/lib/slice/slice_string_helpers.h +0 -11
  873. data/src/core/lib/slice/static_slice.cc +377 -0
  874. data/src/core/lib/slice/static_slice.h +300 -0
  875. data/src/core/lib/surface/api_trace.cc +2 -1
  876. data/src/core/lib/surface/api_trace.h +1 -0
  877. data/src/core/lib/surface/builtins.cc +49 -0
  878. data/src/core/lib/surface/builtins.h +26 -0
  879. data/src/core/lib/surface/byte_buffer_reader.cc +1 -1
  880. data/src/core/lib/surface/call.cc +180 -170
  881. data/src/core/lib/surface/call.h +3 -9
  882. data/src/core/lib/surface/call_details.cc +2 -2
  883. data/src/core/lib/surface/call_log_batch.cc +2 -2
  884. data/src/core/lib/surface/channel.cc +20 -45
  885. data/src/core/lib/surface/channel.h +6 -13
  886. data/src/core/lib/surface/channel_init.cc +23 -76
  887. data/src/core/lib/surface/channel_init.h +52 -44
  888. data/src/core/lib/surface/channel_ping.cc +1 -2
  889. data/src/core/lib/surface/channel_stack_type.cc +2 -1
  890. data/src/core/lib/surface/completion_queue.cc +60 -69
  891. data/src/core/lib/surface/completion_queue_factory.cc +2 -1
  892. data/src/core/lib/surface/completion_queue_factory.h +1 -0
  893. data/src/core/lib/surface/event_string.cc +1 -0
  894. data/src/core/lib/surface/init.cc +4 -49
  895. data/src/core/lib/surface/init.h +0 -1
  896. data/src/core/lib/surface/init_secure.cc +36 -14
  897. data/src/core/lib/surface/lame_client.cc +46 -31
  898. data/src/core/lib/surface/lame_client.h +1 -1
  899. data/src/core/lib/surface/metadata_array.cc +2 -2
  900. data/src/core/lib/surface/server.cc +57 -65
  901. data/src/core/lib/surface/server.h +34 -30
  902. data/src/core/lib/surface/validate_metadata.cc +49 -18
  903. data/src/core/lib/surface/version.cc +2 -2
  904. data/src/core/lib/transport/bdp_estimator.cc +2 -2
  905. data/src/core/lib/transport/byte_stream.cc +4 -0
  906. data/src/core/lib/transport/byte_stream.h +1 -0
  907. data/src/core/lib/transport/connectivity_state.cc +8 -5
  908. data/src/core/lib/transport/connectivity_state.h +2 -2
  909. data/src/core/lib/transport/error_utils.cc +43 -17
  910. data/src/core/lib/transport/error_utils.h +1 -1
  911. data/src/core/lib/transport/metadata.cc +41 -20
  912. data/src/core/lib/transport/metadata.h +19 -16
  913. data/src/core/lib/transport/metadata_batch.cc +40 -371
  914. data/src/core/lib/transport/metadata_batch.h +986 -69
  915. data/src/core/lib/transport/parsed_metadata.cc +35 -0
  916. data/src/core/lib/transport/parsed_metadata.h +382 -0
  917. data/src/core/lib/transport/pid_controller.cc +4 -4
  918. data/src/core/lib/transport/static_metadata.cc +632 -849
  919. data/src/core/lib/transport/static_metadata.h +115 -397
  920. data/src/core/lib/transport/status_metadata.cc +1 -0
  921. data/src/core/lib/transport/transport.cc +8 -31
  922. data/src/core/lib/transport/transport.h +0 -1
  923. data/src/core/lib/transport/transport_op_string.cc +40 -20
  924. data/src/core/lib/uri/uri_parser.cc +19 -19
  925. data/src/core/lib/uri/uri_parser.h +2 -0
  926. data/src/core/plugin_registry/grpc_plugin_registry.cc +78 -41
  927. data/src/core/tsi/alts/crypt/aes_gcm.cc +6 -3
  928. data/src/core/tsi/alts/crypt/gsec.h +2 -3
  929. data/src/core/tsi/alts/frame_protector/alts_frame_protector.cc +13 -12
  930. data/src/core/tsi/alts/frame_protector/frame_handler.cc +10 -11
  931. data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +4 -5
  932. data/src/core/tsi/alts/handshaker/alts_handshaker_client.h +2 -3
  933. data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +12 -2
  934. data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc +2 -2
  935. data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc +1 -1
  936. data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +2 -2
  937. data/src/core/tsi/fake_transport_security.cc +15 -7
  938. data/src/core/tsi/local_transport_security.cc +43 -80
  939. data/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +20 -53
  940. data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +4 -3
  941. data/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc +2 -2
  942. data/src/core/tsi/ssl_transport_security.cc +51 -12
  943. data/src/core/tsi/ssl_transport_security.h +4 -1
  944. data/src/core/tsi/transport_security.cc +15 -3
  945. data/src/core/tsi/transport_security.h +16 -1
  946. data/src/core/tsi/transport_security_grpc.h +1 -0
  947. data/src/core/tsi/transport_security_interface.h +26 -0
  948. data/src/ruby/ext/grpc/extconf.rb +12 -9
  949. data/src/ruby/ext/grpc/rb_byte_buffer.c +2 -1
  950. data/src/ruby/ext/grpc/rb_call.c +5 -5
  951. data/src/ruby/ext/grpc/rb_call_credentials.c +5 -5
  952. data/src/ruby/ext/grpc/rb_channel.c +10 -8
  953. data/src/ruby/ext/grpc/rb_channel_args.c +2 -2
  954. data/src/ruby/ext/grpc/rb_channel_credentials.c +4 -4
  955. data/src/ruby/ext/grpc/rb_channel_credentials.h +1 -0
  956. data/src/ruby/ext/grpc/rb_completion_queue.c +3 -2
  957. data/src/ruby/ext/grpc/rb_compression_options.c +5 -4
  958. data/src/ruby/ext/grpc/rb_event_thread.c +4 -4
  959. data/src/ruby/ext/grpc/rb_grpc.c +5 -4
  960. data/src/ruby/ext/grpc/rb_grpc.h +1 -0
  961. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +10 -10
  962. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +15 -15
  963. data/src/ruby/ext/grpc/rb_server.c +6 -5
  964. data/src/ruby/ext/grpc/rb_server_credentials.c +3 -3
  965. data/src/ruby/ext/grpc/rb_server_credentials.h +1 -0
  966. data/src/ruby/ext/grpc/rb_xds_channel_credentials.c +8 -5
  967. data/src/ruby/ext/grpc/rb_xds_channel_credentials.h +3 -1
  968. data/src/ruby/ext/grpc/rb_xds_server_credentials.c +6 -5
  969. data/src/ruby/ext/grpc/rb_xds_server_credentials.h +3 -1
  970. data/src/ruby/lib/grpc/version.rb +1 -1
  971. data/src/ruby/pb/src/proto/grpc/testing/test_pb.rb +2 -2
  972. data/src/ruby/spec/client_server_spec.rb +1 -1
  973. data/third_party/abseil-cpp/absl/algorithm/container.h +101 -91
  974. data/third_party/abseil-cpp/absl/base/attributes.h +64 -31
  975. data/third_party/abseil-cpp/absl/base/config.h +67 -37
  976. data/third_party/abseil-cpp/absl/base/dynamic_annotations.h +1 -26
  977. data/third_party/abseil-cpp/absl/base/internal/spinlock.h +3 -1
  978. data/third_party/abseil-cpp/absl/base/internal/spinlock_wait.h +2 -0
  979. data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +69 -0
  980. data/third_party/abseil-cpp/absl/base/internal/thread_identity.cc +4 -4
  981. data/third_party/abseil-cpp/absl/base/internal/thread_identity.h +15 -10
  982. data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +16 -0
  983. data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +4 -4
  984. data/third_party/abseil-cpp/absl/base/options.h +1 -1
  985. data/third_party/abseil-cpp/absl/container/fixed_array.h +0 -5
  986. data/third_party/abseil-cpp/absl/container/inlined_vector.h +105 -97
  987. data/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h +17 -15
  988. data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +18 -102
  989. data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +37 -78
  990. data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +388 -423
  991. data/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +3 -2
  992. data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +14 -8
  993. data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +251 -120
  994. data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +11 -1
  995. data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc +12 -11
  996. data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h +6 -2
  997. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h +12 -5
  998. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc +110 -0
  999. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +234 -0
  1000. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +25 -7
  1001. data/third_party/abseil-cpp/absl/debugging/internal/symbolize.h +8 -2
  1002. data/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc +21 -3
  1003. data/third_party/abseil-cpp/absl/debugging/stacktrace.cc +2 -0
  1004. data/third_party/abseil-cpp/absl/debugging/symbolize.cc +2 -0
  1005. data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +14 -0
  1006. data/third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc +72 -0
  1007. data/third_party/abseil-cpp/absl/functional/function_ref.h +4 -1
  1008. data/third_party/abseil-cpp/absl/hash/hash.h +22 -0
  1009. data/third_party/abseil-cpp/absl/hash/internal/hash.cc +15 -16
  1010. data/third_party/abseil-cpp/absl/hash/internal/hash.h +88 -37
  1011. data/third_party/abseil-cpp/absl/hash/internal/{wyhash.cc → low_level_hash.cc} +23 -11
  1012. data/third_party/abseil-cpp/absl/hash/internal/{wyhash.h → low_level_hash.h} +14 -12
  1013. data/third_party/abseil-cpp/absl/memory/memory.h +1 -1
  1014. data/third_party/abseil-cpp/absl/meta/type_traits.h +32 -2
  1015. data/third_party/abseil-cpp/absl/numeric/int128.cc +3 -10
  1016. data/third_party/abseil-cpp/absl/numeric/int128.h +146 -73
  1017. data/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc +19 -25
  1018. data/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc +73 -70
  1019. data/third_party/abseil-cpp/absl/{base → profiling}/internal/exponential_biased.cc +4 -4
  1020. data/third_party/abseil-cpp/absl/{base → profiling}/internal/exponential_biased.h +6 -6
  1021. data/third_party/abseil-cpp/absl/profiling/internal/sample_recorder.h +230 -0
  1022. data/third_party/abseil-cpp/absl/status/internal/status_internal.h +5 -5
  1023. data/third_party/abseil-cpp/absl/status/status.cc +9 -17
  1024. data/third_party/abseil-cpp/absl/status/status.h +19 -15
  1025. data/third_party/abseil-cpp/absl/status/statusor.cc +34 -2
  1026. data/third_party/abseil-cpp/absl/status/statusor.h +31 -21
  1027. data/third_party/abseil-cpp/absl/strings/charconv.cc +3 -3
  1028. data/third_party/abseil-cpp/absl/strings/charconv.h +3 -2
  1029. data/third_party/abseil-cpp/absl/strings/cord.cc +453 -359
  1030. data/third_party/abseil-cpp/absl/strings/cord.h +197 -70
  1031. data/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc +1 -1
  1032. data/third_party/abseil-cpp/absl/strings/internal/cord_internal.cc +6 -0
  1033. data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +140 -63
  1034. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +1128 -0
  1035. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h +939 -0
  1036. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc +185 -0
  1037. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.h +265 -0
  1038. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.cc +68 -0
  1039. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.h +211 -0
  1040. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.cc +129 -0
  1041. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.h +50 -0
  1042. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h +7 -7
  1043. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.cc +55 -181
  1044. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.h +42 -24
  1045. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring_reader.h +4 -0
  1046. data/third_party/abseil-cpp/absl/strings/internal/cordz_functions.cc +96 -0
  1047. data/third_party/abseil-cpp/absl/strings/internal/cordz_functions.h +85 -0
  1048. data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.cc +139 -0
  1049. data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.h +131 -0
  1050. data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +445 -0
  1051. data/third_party/abseil-cpp/absl/strings/internal/cordz_info.h +298 -0
  1052. data/third_party/abseil-cpp/absl/strings/internal/cordz_statistics.h +87 -0
  1053. data/third_party/abseil-cpp/absl/strings/internal/cordz_update_scope.h +71 -0
  1054. data/third_party/abseil-cpp/absl/strings/internal/cordz_update_tracker.h +121 -0
  1055. data/third_party/abseil-cpp/absl/strings/internal/resize_uninitialized.h +48 -2
  1056. data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +8 -0
  1057. data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc +3 -4
  1058. data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +1 -1
  1059. data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +6 -6
  1060. data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +36 -18
  1061. data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc +62 -73
  1062. data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +24 -16
  1063. data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +35 -35
  1064. data/third_party/abseil-cpp/absl/strings/numbers.cc +1 -1
  1065. data/third_party/abseil-cpp/absl/strings/numbers.h +34 -0
  1066. data/third_party/abseil-cpp/absl/strings/str_cat.cc +4 -4
  1067. data/third_party/abseil-cpp/absl/strings/str_format.h +1 -2
  1068. data/third_party/abseil-cpp/absl/strings/string_view.cc +16 -21
  1069. data/third_party/abseil-cpp/absl/strings/string_view.h +120 -39
  1070. data/third_party/abseil-cpp/absl/strings/substitute.cc +2 -1
  1071. data/third_party/abseil-cpp/absl/strings/substitute.h +99 -74
  1072. data/third_party/abseil-cpp/absl/synchronization/blocking_counter.cc +25 -15
  1073. data/third_party/abseil-cpp/absl/synchronization/blocking_counter.h +5 -3
  1074. data/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc +1 -1
  1075. data/third_party/abseil-cpp/absl/synchronization/mutex.h +3 -3
  1076. data/third_party/abseil-cpp/absl/time/civil_time.cc +1 -3
  1077. data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h +93 -20
  1078. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc +1 -1
  1079. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.h +2 -1
  1080. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc +83 -21
  1081. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +49 -0
  1082. data/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h +1 -1
  1083. data/third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc +2 -3
  1084. data/third_party/abseil-cpp/absl/time/time.h +67 -36
  1085. data/third_party/abseil-cpp/absl/types/bad_optional_access.h +1 -1
  1086. data/third_party/abseil-cpp/absl/types/bad_variant_access.h +2 -2
  1087. data/third_party/abseil-cpp/absl/types/span.h +3 -3
  1088. data/third_party/address_sorting/address_sorting_posix.c +1 -0
  1089. data/third_party/boringssl-with-bazel/err_data.c +685 -673
  1090. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_bitstr.c +67 -54
  1091. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_bool.c +21 -22
  1092. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_d2i_fp.c +0 -2
  1093. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_gentm.c +6 -1
  1094. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_mbstr.c +16 -23
  1095. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_object.c +55 -37
  1096. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_print.c +19 -29
  1097. data/third_party/boringssl-with-bazel/src/crypto/{x509 → asn1}/a_strex.c +269 -272
  1098. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_strnid.c +106 -153
  1099. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_time.c +4 -4
  1100. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_type.c +1 -1
  1101. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_utctm.c +1 -40
  1102. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_utf8.c +1 -1
  1103. data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_lib.c +59 -47
  1104. data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_par.c +1 -1
  1105. data/third_party/boringssl-with-bazel/src/crypto/asn1/asn_pack.c +24 -28
  1106. data/third_party/boringssl-with-bazel/src/crypto/{x509 → asn1}/charmap.h +0 -0
  1107. data/third_party/boringssl-with-bazel/src/crypto/asn1/f_int.c +5 -0
  1108. data/third_party/boringssl-with-bazel/src/crypto/asn1/{asn1_locl.h → internal.h} +86 -1
  1109. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_dec.c +57 -281
  1110. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c +290 -199
  1111. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_fre.c +9 -9
  1112. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_new.c +10 -14
  1113. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_typ.c +8 -6
  1114. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_utl.c +2 -1
  1115. data/third_party/boringssl-with-bazel/src/crypto/asn1/time_support.c +1 -1
  1116. data/third_party/boringssl-with-bazel/src/crypto/base64/base64.c +11 -8
  1117. data/third_party/boringssl-with-bazel/src/crypto/bio/bio_mem.c +1 -7
  1118. data/third_party/boringssl-with-bazel/src/crypto/bio/connect.c +1 -5
  1119. data/third_party/boringssl-with-bazel/src/crypto/bio/fd.c +0 -4
  1120. data/third_party/boringssl-with-bazel/src/crypto/bio/file.c +1 -7
  1121. data/third_party/boringssl-with-bazel/src/crypto/bio/pair.c +1 -6
  1122. data/third_party/boringssl-with-bazel/src/crypto/bio/socket.c +3 -17
  1123. data/third_party/boringssl-with-bazel/src/crypto/blake2/blake2.c +4 -6
  1124. data/third_party/boringssl-with-bazel/src/crypto/bytestring/ber.c +3 -1
  1125. data/third_party/boringssl-with-bazel/src/crypto/bytestring/cbb.c +9 -0
  1126. data/third_party/boringssl-with-bazel/src/crypto/bytestring/cbs.c +8 -0
  1127. data/third_party/boringssl-with-bazel/src/crypto/chacha/chacha.c +38 -47
  1128. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/cipher_extra.c +45 -65
  1129. data/third_party/boringssl-with-bazel/src/crypto/conf/conf.c +14 -3
  1130. data/third_party/boringssl-with-bazel/src/crypto/digest_extra/digest_extra.c +6 -3
  1131. data/third_party/boringssl-with-bazel/src/crypto/evp/evp_asn1.c +2 -2
  1132. data/third_party/boringssl-with-bazel/src/crypto/evp/scrypt.c +32 -34
  1133. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/div.c +26 -9
  1134. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/gcd_extra.c +3 -2
  1135. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/internal.h +5 -2
  1136. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/sqrt.c +5 -9
  1137. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/e_aes.c +10 -0
  1138. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/des/des.c +10 -11
  1139. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/des/internal.h +1 -3
  1140. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/digest/digest.c +2 -0
  1141. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/md4/md4.c +4 -7
  1142. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/md5/md5.c +4 -7
  1143. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/gcm_nohw.c +1 -1
  1144. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/internal.h +5 -9
  1145. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/rand.c +2 -2
  1146. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/urandom.c +4 -6
  1147. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa.c +24 -9
  1148. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa_impl.c +4 -2
  1149. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/self_check.c +7 -7
  1150. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha1.c +35 -35
  1151. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha256.c +11 -10
  1152. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha512.c +10 -37
  1153. data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +34 -0
  1154. data/third_party/boringssl-with-bazel/src/crypto/hrss/hrss.c +219 -121
  1155. data/third_party/boringssl-with-bazel/src/crypto/hrss/internal.h +9 -2
  1156. data/third_party/boringssl-with-bazel/src/crypto/internal.h +62 -2
  1157. data/third_party/boringssl-with-bazel/src/crypto/lhash/internal.h +253 -0
  1158. data/third_party/boringssl-with-bazel/src/crypto/lhash/lhash.c +28 -23
  1159. data/third_party/boringssl-with-bazel/src/crypto/mem.c +32 -9
  1160. data/third_party/boringssl-with-bazel/src/crypto/obj/obj.c +7 -3
  1161. data/third_party/boringssl-with-bazel/src/crypto/pem/pem_all.c +0 -9
  1162. data/third_party/boringssl-with-bazel/src/crypto/pem/pem_info.c +0 -2
  1163. data/third_party/boringssl-with-bazel/src/crypto/pem/pem_lib.c +0 -8
  1164. data/third_party/boringssl-with-bazel/src/crypto/pem/pem_pk8.c +0 -2
  1165. data/third_party/boringssl-with-bazel/src/crypto/pem/pem_pkey.c +0 -4
  1166. data/third_party/boringssl-with-bazel/src/crypto/pkcs7/internal.h +16 -7
  1167. data/third_party/boringssl-with-bazel/src/crypto/pkcs7/pkcs7.c +9 -4
  1168. data/third_party/boringssl-with-bazel/src/crypto/pkcs7/pkcs7_x509.c +151 -12
  1169. data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8_x509.c +1 -1
  1170. data/third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305.c +1 -1
  1171. data/third_party/boringssl-with-bazel/src/crypto/pool/internal.h +5 -1
  1172. data/third_party/boringssl-with-bazel/src/crypto/pool/pool.c +59 -22
  1173. data/third_party/boringssl-with-bazel/src/crypto/rand_extra/deterministic.c +4 -0
  1174. data/third_party/boringssl-with-bazel/src/crypto/rand_extra/fuchsia.c +4 -0
  1175. data/third_party/boringssl-with-bazel/src/crypto/rand_extra/windows.c +4 -0
  1176. data/third_party/boringssl-with-bazel/src/crypto/siphash/siphash.c +6 -6
  1177. data/third_party/boringssl-with-bazel/src/crypto/x509/a_verify.c +15 -11
  1178. data/third_party/boringssl-with-bazel/src/crypto/x509/algorithm.c +1 -1
  1179. data/third_party/boringssl-with-bazel/src/crypto/x509/asn1_gen.c +2 -18
  1180. data/third_party/boringssl-with-bazel/src/crypto/x509/by_dir.c +1 -0
  1181. data/third_party/boringssl-with-bazel/src/crypto/x509/by_file.c +2 -0
  1182. data/third_party/boringssl-with-bazel/src/crypto/x509/internal.h +233 -4
  1183. data/third_party/boringssl-with-bazel/src/crypto/x509/name_print.c +246 -0
  1184. data/third_party/boringssl-with-bazel/src/crypto/x509/rsa_pss.c +15 -4
  1185. data/third_party/boringssl-with-bazel/src/crypto/x509/t_crl.c +10 -5
  1186. data/third_party/boringssl-with-bazel/src/crypto/x509/t_x509.c +0 -179
  1187. data/third_party/boringssl-with-bazel/src/crypto/x509/t_x509a.c +4 -2
  1188. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_att.c +6 -23
  1189. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_ext.c +2 -2
  1190. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_lu.c +1 -5
  1191. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_obj.c +1 -0
  1192. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_v3.c +25 -22
  1193. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_vfy.c +11 -54
  1194. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_vpm.c +1 -1
  1195. data/third_party/boringssl-with-bazel/src/crypto/x509/x509cset.c +1 -0
  1196. data/third_party/boringssl-with-bazel/src/crypto/x509/x509name.c +2 -4
  1197. data/third_party/boringssl-with-bazel/src/crypto/x509/x_algor.c +1 -3
  1198. data/third_party/boringssl-with-bazel/src/crypto/x509/x_all.c +0 -16
  1199. data/third_party/boringssl-with-bazel/src/crypto/x509/x_crl.c +9 -11
  1200. data/third_party/boringssl-with-bazel/src/crypto/x509/x_exten.c +2 -0
  1201. data/third_party/boringssl-with-bazel/src/crypto/x509/x_name.c +23 -21
  1202. data/third_party/boringssl-with-bazel/src/crypto/x509/x_x509.c +12 -11
  1203. data/third_party/boringssl-with-bazel/src/crypto/x509v3/internal.h +232 -11
  1204. data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_cache.c +2 -1
  1205. data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_data.c +2 -2
  1206. data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_lib.c +1 -1
  1207. data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_map.c +2 -1
  1208. data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_node.c +1 -1
  1209. data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_tree.c +5 -4
  1210. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_akey.c +24 -5
  1211. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_alt.c +18 -8
  1212. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_bitst.c +3 -0
  1213. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_conf.c +1 -0
  1214. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_cpols.c +6 -7
  1215. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_crld.c +4 -2
  1216. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_enum.c +5 -0
  1217. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_lib.c +23 -4
  1218. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_ncons.c +112 -55
  1219. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_pci.c +2 -1
  1220. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_prn.c +14 -13
  1221. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_purp.c +1 -1
  1222. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_utl.c +76 -31
  1223. data/third_party/boringssl-with-bazel/src/include/openssl/asn1.h +1504 -561
  1224. data/third_party/boringssl-with-bazel/src/include/openssl/asn1t.h +5 -12
  1225. data/third_party/boringssl-with-bazel/src/include/openssl/base.h +10 -6
  1226. data/third_party/boringssl-with-bazel/src/include/openssl/bio.h +3 -1
  1227. data/third_party/boringssl-with-bazel/src/include/openssl/bn.h +3 -3
  1228. data/third_party/boringssl-with-bazel/src/include/openssl/bytestring.h +9 -0
  1229. data/third_party/boringssl-with-bazel/src/include/openssl/cipher.h +8 -2
  1230. data/third_party/boringssl-with-bazel/src/include/openssl/conf.h +8 -5
  1231. data/third_party/boringssl-with-bazel/src/include/openssl/dh.h +4 -12
  1232. data/third_party/boringssl-with-bazel/src/include/openssl/digest.h +3 -0
  1233. data/third_party/boringssl-with-bazel/src/include/openssl/dsa.h +17 -41
  1234. data/third_party/boringssl-with-bazel/src/include/openssl/ec_key.h +12 -27
  1235. data/third_party/boringssl-with-bazel/src/include/openssl/ecdsa.h +8 -10
  1236. data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +35 -55
  1237. data/third_party/boringssl-with-bazel/src/include/openssl/hkdf.h +4 -0
  1238. data/third_party/boringssl-with-bazel/src/include/openssl/hpke.h +25 -0
  1239. data/third_party/boringssl-with-bazel/src/include/openssl/hrss.h +14 -12
  1240. data/third_party/boringssl-with-bazel/src/include/openssl/lhash.h +4 -205
  1241. data/third_party/boringssl-with-bazel/src/include/openssl/mem.h +12 -3
  1242. data/third_party/boringssl-with-bazel/src/include/openssl/obj.h +5 -4
  1243. data/third_party/boringssl-with-bazel/src/include/openssl/pem.h +0 -20
  1244. data/third_party/boringssl-with-bazel/src/include/openssl/pkcs7.h +15 -14
  1245. data/third_party/boringssl-with-bazel/src/include/openssl/pool.h +7 -1
  1246. data/third_party/boringssl-with-bazel/src/include/openssl/rsa.h +29 -28
  1247. data/third_party/boringssl-with-bazel/src/include/openssl/span.h +37 -15
  1248. data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +87 -24
  1249. data/third_party/boringssl-with-bazel/src/include/openssl/tls1.h +31 -32
  1250. data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +725 -189
  1251. data/third_party/boringssl-with-bazel/src/include/openssl/x509_vfy.h +16 -695
  1252. data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +52 -16
  1253. data/third_party/boringssl-with-bazel/src/ssl/d1_both.cc +9 -16
  1254. data/third_party/boringssl-with-bazel/src/ssl/encrypted_client_hello.cc +310 -359
  1255. data/third_party/boringssl-with-bazel/src/ssl/{t1_lib.cc → extensions.cc} +110 -159
  1256. data/third_party/boringssl-with-bazel/src/ssl/handshake.cc +24 -13
  1257. data/third_party/boringssl-with-bazel/src/ssl/handshake_client.cc +145 -142
  1258. data/third_party/boringssl-with-bazel/src/ssl/handshake_server.cc +106 -99
  1259. data/third_party/boringssl-with-bazel/src/ssl/internal.h +90 -51
  1260. data/third_party/boringssl-with-bazel/src/ssl/s3_lib.cc +1 -2
  1261. data/third_party/boringssl-with-bazel/src/ssl/ssl_cipher.cc +2 -2
  1262. data/third_party/boringssl-with-bazel/src/ssl/ssl_key_share.cc +11 -5
  1263. data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +2 -51
  1264. data/third_party/boringssl-with-bazel/src/ssl/ssl_session.cc +121 -65
  1265. data/third_party/boringssl-with-bazel/src/ssl/ssl_transcript.cc +6 -12
  1266. data/third_party/boringssl-with-bazel/src/ssl/ssl_versions.cc +4 -0
  1267. data/third_party/boringssl-with-bazel/src/ssl/ssl_x509.cc +28 -23
  1268. data/third_party/boringssl-with-bazel/src/ssl/tls13_both.cc +14 -27
  1269. data/third_party/boringssl-with-bazel/src/ssl/tls13_client.cc +210 -212
  1270. data/third_party/boringssl-with-bazel/src/ssl/tls13_enc.cc +30 -41
  1271. data/third_party/boringssl-with-bazel/src/ssl/tls13_server.cc +48 -34
  1272. data/third_party/re2/re2/compile.cc +91 -109
  1273. data/third_party/re2/re2/dfa.cc +27 -39
  1274. data/third_party/re2/re2/filtered_re2.cc +18 -2
  1275. data/third_party/re2/re2/filtered_re2.h +10 -5
  1276. data/third_party/re2/re2/nfa.cc +1 -1
  1277. data/third_party/re2/re2/parse.cc +42 -23
  1278. data/third_party/re2/re2/perl_groups.cc +34 -34
  1279. data/third_party/re2/re2/prefilter.cc +3 -2
  1280. data/third_party/re2/re2/prog.cc +182 -4
  1281. data/third_party/re2/re2/prog.h +28 -9
  1282. data/third_party/re2/re2/re2.cc +87 -118
  1283. data/third_party/re2/re2/re2.h +156 -141
  1284. data/third_party/re2/re2/regexp.cc +12 -5
  1285. data/third_party/re2/re2/regexp.h +8 -2
  1286. data/third_party/re2/re2/set.cc +31 -9
  1287. data/third_party/re2/re2/set.h +9 -4
  1288. data/third_party/re2/re2/simplify.cc +11 -3
  1289. data/third_party/re2/re2/tostring.cc +1 -1
  1290. data/third_party/re2/re2/walker-inl.h +1 -1
  1291. data/third_party/re2/util/mutex.h +2 -2
  1292. data/third_party/re2/util/pcre.h +3 -3
  1293. data/third_party/upb/upb/decode.c +383 -183
  1294. data/third_party/upb/upb/decode.h +32 -4
  1295. data/third_party/upb/upb/decode_fast.c +513 -500
  1296. data/third_party/upb/upb/decode_fast.h +27 -0
  1297. data/third_party/upb/upb/{decode.int.h → decode_internal.h} +39 -8
  1298. data/third_party/upb/upb/def.c +489 -254
  1299. data/third_party/upb/upb/def.h +86 -33
  1300. data/third_party/upb/upb/def.hpp +46 -4
  1301. data/third_party/upb/upb/encode.c +137 -44
  1302. data/third_party/upb/upb/encode.h +29 -2
  1303. data/third_party/upb/upb/msg.c +182 -28
  1304. data/third_party/upb/upb/msg.h +75 -580
  1305. data/third_party/upb/upb/msg_internal.h +769 -0
  1306. data/third_party/upb/upb/port_def.inc +85 -24
  1307. data/third_party/upb/upb/port_undef.inc +38 -1
  1308. data/third_party/upb/upb/reflection.c +126 -94
  1309. data/third_party/upb/upb/reflection.h +42 -10
  1310. data/third_party/upb/upb/reflection.hpp +37 -0
  1311. data/third_party/upb/upb/table.c +211 -86
  1312. data/third_party/upb/upb/{table.int.h → table_internal.h} +56 -180
  1313. data/third_party/upb/upb/text_encode.c +35 -7
  1314. data/third_party/upb/upb/text_encode.h +26 -0
  1315. data/third_party/upb/upb/upb.c +67 -8
  1316. data/third_party/upb/upb/upb.h +36 -6
  1317. data/third_party/upb/upb/upb.hpp +24 -0
  1318. data/third_party/upb/upb/upb_internal.h +58 -0
  1319. metadata +182 -107
  1320. data/include/grpc/event_engine/slice_allocator.h +0 -66
  1321. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc +0 -179
  1322. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc +0 -38
  1323. data/src/core/ext/filters/client_channel/service_config_call_data.h +0 -126
  1324. data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc +0 -211
  1325. data/src/core/ext/filters/workarounds/workaround_utils.cc +0 -53
  1326. data/src/core/ext/filters/workarounds/workaround_utils.h +0 -39
  1327. data/src/core/ext/transport/chttp2/client/authority.cc +0 -42
  1328. data/src/core/ext/transport/chttp2/client/authority.h +0 -36
  1329. data/src/core/ext/transport/chttp2/transport/chttp2_slice_allocator.cc +0 -66
  1330. data/src/core/ext/transport/chttp2/transport/chttp2_slice_allocator.h +0 -74
  1331. data/src/core/ext/transport/chttp2/transport/hpack_table.cc +0 -243
  1332. data/src/core/ext/transport/chttp2/transport/hpack_table.h +0 -148
  1333. data/src/core/ext/transport/chttp2/transport/incoming_metadata.cc +0 -66
  1334. data/src/core/ext/transport/chttp2/transport/incoming_metadata.h +0 -58
  1335. data/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c +0 -58
  1336. data/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h +0 -124
  1337. data/src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c +0 -33
  1338. data/src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h +0 -77
  1339. data/src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c +0 -44
  1340. data/src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h +0 -35
  1341. data/src/core/lib/avl/avl.cc +0 -306
  1342. data/src/core/lib/gpr/tls_gcc.h +0 -52
  1343. data/src/core/lib/gpr/tls_msvc.h +0 -54
  1344. data/src/core/lib/gpr/tls_pthread.h +0 -56
  1345. data/src/core/lib/gpr/tls_stdcpp.h +0 -48
  1346. data/src/core/lib/gprpp/atomic.h +0 -104
  1347. data/src/core/lib/iomgr/endpoint_pair_uv.cc +0 -40
  1348. data/src/core/lib/iomgr/iomgr_uv.cc +0 -43
  1349. data/src/core/lib/iomgr/pollset_uv.cc +0 -95
  1350. data/src/core/lib/iomgr/pollset_uv.h +0 -36
  1351. data/src/core/lib/iomgr/resource_quota.cc +0 -1019
  1352. data/src/core/lib/iomgr/resource_quota.h +0 -177
  1353. data/src/core/lib/iomgr/sockaddr_custom.h +0 -54
  1354. data/src/core/lib/iomgr/socket_utils_uv.cc +0 -49
  1355. data/src/core/lib/iomgr/tcp_uv.cc +0 -421
  1356. data/src/core/lib/iomgr/timer_uv.cc +0 -66
  1357. data/src/core/lib/iomgr/udp_server.cc +0 -748
  1358. data/src/core/lib/iomgr/udp_server.h +0 -103
  1359. data/third_party/boringssl-with-bazel/src/crypto/asn1/f_enum.c +0 -93
  1360. data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_int.h +0 -217
  1361. data/third_party/upb/third_party/wyhash/wyhash.h +0 -145
  1362. data/third_party/upb/upb/upb.int.h +0 -29
@@ -16,6 +16,8 @@
16
16
 
17
17
  #include <grpc/support/port_platform.h>
18
18
 
19
+ #include "src/core/ext/xds/xds_client.h"
20
+
19
21
  #include <inttypes.h>
20
22
  #include <limits.h>
21
23
  #include <string.h>
@@ -31,11 +33,9 @@
31
33
  #include <grpc/support/time.h>
32
34
 
33
35
  #include "src/core/ext/filters/client_channel/client_channel.h"
34
- #include "src/core/ext/filters/client_channel/service_config.h"
35
36
  #include "src/core/ext/xds/xds_api.h"
36
37
  #include "src/core/ext/xds/xds_bootstrap.h"
37
38
  #include "src/core/ext/xds/xds_channel_args.h"
38
- #include "src/core/ext/xds/xds_client.h"
39
39
  #include "src/core/ext/xds/xds_client_stats.h"
40
40
  #include "src/core/ext/xds/xds_http_filters.h"
41
41
  #include "src/core/lib/address_utils/sockaddr_utils.h"
@@ -54,8 +54,8 @@
54
54
  #include "src/core/lib/slice/slice_string_helpers.h"
55
55
  #include "src/core/lib/surface/call.h"
56
56
  #include "src/core/lib/surface/channel.h"
57
- #include "src/core/lib/surface/channel_init.h"
58
57
  #include "src/core/lib/transport/static_metadata.h"
58
+ #include "src/core/lib/uri/uri_parser.h"
59
59
 
60
60
  #define GRPC_XDS_INITIAL_CONNECT_BACKOFF_SECONDS 1
61
61
  #define GRPC_XDS_RECONNECT_BACKOFF_MULTIPLIER 1.6
@@ -71,12 +71,50 @@ TraceFlag grpc_xds_client_refcount_trace(false, "xds_client_refcount");
71
71
  namespace {
72
72
 
73
73
  Mutex* g_mu = nullptr;
74
+
74
75
  const grpc_channel_args* g_channel_args ABSL_GUARDED_BY(*g_mu) = nullptr;
75
76
  XdsClient* g_xds_client ABSL_GUARDED_BY(*g_mu) = nullptr;
76
77
  char* g_fallback_bootstrap_config ABSL_GUARDED_BY(*g_mu) = nullptr;
77
78
 
78
79
  } // namespace
79
80
 
81
+ class XdsClient::Notifier {
82
+ public:
83
+ // Helper template function to invoke `OnError()` on a list of watchers \a
84
+ // watchers_list within \a work_serializer. Works with all 4 resource types.
85
+ template <class T>
86
+ static void ScheduleNotifyWatchersOnErrorInWorkSerializer(
87
+ XdsClient* xds_client, const T& watchers_list, grpc_error_handle error,
88
+ const DebugLocation& location) {
89
+ xds_client->work_serializer_.Schedule(
90
+ [watchers_list, error]()
91
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client->work_serializer_) {
92
+ for (const auto& p : watchers_list) {
93
+ p.first->OnError(GRPC_ERROR_REF(error));
94
+ }
95
+ GRPC_ERROR_UNREF(error);
96
+ },
97
+ location);
98
+ }
99
+
100
+ // Helper template function to invoke `OnResourceDoesNotExist()` on a list of
101
+ // watchers \a watchers_list within \a work_serializer. Works with all 4
102
+ // resource types.
103
+ template <class T>
104
+ static void ScheduleNotifyWatchersOnResourceDoesNotExistInWorkSerializer(
105
+ XdsClient* xds_client, const T& watchers_list,
106
+ const DebugLocation& location) {
107
+ xds_client->work_serializer_.Schedule(
108
+ [watchers_list]()
109
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client->work_serializer_) {
110
+ for (const auto& p : watchers_list) {
111
+ p.first->OnResourceDoesNotExist();
112
+ }
113
+ },
114
+ location);
115
+ }
116
+ };
117
+
80
118
  //
81
119
  // Internal class declarations
82
120
  //
@@ -87,7 +125,7 @@ template <typename T>
87
125
  class XdsClient::ChannelState::RetryableCall
88
126
  : public InternallyRefCounted<RetryableCall<T>> {
89
127
  public:
90
- explicit RetryableCall(RefCountedPtr<ChannelState> chand);
128
+ explicit RetryableCall(WeakRefCountedPtr<ChannelState> chand);
91
129
 
92
130
  void Orphan() override;
93
131
 
@@ -108,7 +146,7 @@ class XdsClient::ChannelState::RetryableCall
108
146
  // every time we start a new call. It's null during call retry backoff.
109
147
  OrphanablePtr<T> calld_;
110
148
  // The owning xds channel.
111
- RefCountedPtr<ChannelState> chand_;
149
+ WeakRefCountedPtr<ChannelState> chand_;
112
150
 
113
151
  // Retry state.
114
152
  BackOff backoff_;
@@ -134,9 +172,11 @@ class XdsClient::ChannelState::AdsCallState
134
172
  XdsClient* xds_client() const { return chand()->xds_client(); }
135
173
  bool seen_response() const { return seen_response_; }
136
174
 
137
- void SubscribeLocked(const std::string& type_url, const std::string& name)
175
+ void SubscribeLocked(const std::string& type_url,
176
+ const XdsApi::ResourceName& name)
138
177
  ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
139
- void UnsubscribeLocked(const std::string& type_url, const std::string& name,
178
+ void UnsubscribeLocked(const std::string& type_url,
179
+ const XdsApi::ResourceName& name,
140
180
  bool delay_unsubscription)
141
181
  ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
142
182
 
@@ -145,23 +185,20 @@ class XdsClient::ChannelState::AdsCallState
145
185
  private:
146
186
  class ResourceState : public InternallyRefCounted<ResourceState> {
147
187
  public:
148
- ResourceState(const std::string& type_url, const std::string& name,
149
- bool sent_initial_request)
150
- : type_url_(type_url),
151
- name_(name),
152
- sent_initial_request_(sent_initial_request) {
188
+ ResourceState(const std::string& type_url, const XdsApi::ResourceName& name)
189
+ : type_url_(type_url), name_(name) {
153
190
  GRPC_CLOSURE_INIT(&timer_callback_, OnTimer, this,
154
191
  grpc_schedule_on_exec_ctx);
155
192
  }
156
193
 
157
194
  void Orphan() override {
158
- Finish();
195
+ MaybeCancelTimer();
159
196
  Unref(DEBUG_LOCATION, "Orphan");
160
197
  }
161
198
 
162
- void Start(RefCountedPtr<AdsCallState> ads_calld) {
163
- if (sent_initial_request_) return;
164
- sent_initial_request_ = true;
199
+ void MaybeStartTimer(RefCountedPtr<AdsCallState> ads_calld) {
200
+ if (timer_started_) return;
201
+ timer_started_ = true;
165
202
  ads_calld_ = std::move(ads_calld);
166
203
  Ref(DEBUG_LOCATION, "timer").release();
167
204
  timer_pending_ = true;
@@ -171,7 +208,7 @@ class XdsClient::ChannelState::AdsCallState
171
208
  &timer_callback_);
172
209
  }
173
210
 
174
- void Finish() {
211
+ void MaybeCancelTimer() {
175
212
  if (timer_pending_) {
176
213
  grpc_timer_cancel(&timer_);
177
214
  timer_pending_ = false;
@@ -185,6 +222,7 @@ class XdsClient::ChannelState::AdsCallState
185
222
  MutexLock lock(&self->ads_calld_->xds_client()->mu_);
186
223
  self->OnTimerLocked(GRPC_ERROR_REF(error));
187
224
  }
225
+ self->ads_calld_->xds_client()->work_serializer_.DrainQueue();
188
226
  self->ads_calld_.reset();
189
227
  self->Unref(DEBUG_LOCATION, "timer");
190
228
  }
@@ -193,42 +231,44 @@ class XdsClient::ChannelState::AdsCallState
193
231
  ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_) {
194
232
  if (error == GRPC_ERROR_NONE && timer_pending_) {
195
233
  timer_pending_ = false;
196
- grpc_error_handle watcher_error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
197
- absl::StrFormat(
234
+ grpc_error_handle watcher_error =
235
+ GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
198
236
  "timeout obtaining resource {type=%s name=%s} from xds server",
199
- type_url_, name_)
200
- .c_str());
237
+ type_url_,
238
+ XdsApi::ConstructFullResourceName(name_.authority, type_url_,
239
+ name_.id)));
201
240
  watcher_error = grpc_error_set_int(
202
241
  watcher_error, GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
203
242
  if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
204
243
  gpr_log(GPR_INFO, "[xds_client %p] %s", ads_calld_->xds_client(),
205
244
  grpc_error_std_string(watcher_error).c_str());
206
245
  }
246
+ auto& authority_state =
247
+ ads_calld_->xds_client()->authority_state_map_[name_.authority];
207
248
  if (type_url_ == XdsApi::kLdsTypeUrl) {
208
- ListenerState& state = ads_calld_->xds_client()->listener_map_[name_];
249
+ ListenerState& state = authority_state.listener_map[name_.id];
209
250
  state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
210
- for (const auto& p : state.watchers) {
211
- p.first->OnError(GRPC_ERROR_REF(watcher_error));
212
- }
251
+ Notifier::ScheduleNotifyWatchersOnErrorInWorkSerializer(
252
+ ads_calld_->xds_client(), state.watchers,
253
+ GRPC_ERROR_REF(watcher_error), DEBUG_LOCATION);
213
254
  } else if (type_url_ == XdsApi::kRdsTypeUrl) {
214
- RouteConfigState& state =
215
- ads_calld_->xds_client()->route_config_map_[name_];
255
+ RouteConfigState& state = authority_state.route_config_map[name_.id];
216
256
  state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
217
- for (const auto& p : state.watchers) {
218
- p.first->OnError(GRPC_ERROR_REF(watcher_error));
219
- }
257
+ Notifier::ScheduleNotifyWatchersOnErrorInWorkSerializer(
258
+ ads_calld_->xds_client(), state.watchers,
259
+ GRPC_ERROR_REF(watcher_error), DEBUG_LOCATION);
220
260
  } else if (type_url_ == XdsApi::kCdsTypeUrl) {
221
- ClusterState& state = ads_calld_->xds_client()->cluster_map_[name_];
261
+ ClusterState& state = authority_state.cluster_map[name_.id];
222
262
  state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
223
- for (const auto& p : state.watchers) {
224
- p.first->OnError(GRPC_ERROR_REF(watcher_error));
225
- }
263
+ Notifier::ScheduleNotifyWatchersOnErrorInWorkSerializer(
264
+ ads_calld_->xds_client(), state.watchers,
265
+ GRPC_ERROR_REF(watcher_error), DEBUG_LOCATION);
226
266
  } else if (type_url_ == XdsApi::kEdsTypeUrl) {
227
- EndpointState& state = ads_calld_->xds_client()->endpoint_map_[name_];
267
+ EndpointState& state = authority_state.endpoint_map[name_.id];
228
268
  state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
229
- for (const auto& p : state.watchers) {
230
- p.first->OnError(GRPC_ERROR_REF(watcher_error));
231
- }
269
+ Notifier::ScheduleNotifyWatchersOnErrorInWorkSerializer(
270
+ ads_calld_->xds_client(), state.watchers,
271
+ GRPC_ERROR_REF(watcher_error), DEBUG_LOCATION);
232
272
  } else {
233
273
  GPR_UNREACHABLE_CODE(return );
234
274
  }
@@ -238,10 +278,10 @@ class XdsClient::ChannelState::AdsCallState
238
278
  }
239
279
 
240
280
  const std::string type_url_;
241
- const std::string name_;
281
+ const XdsApi::ResourceName name_;
242
282
 
243
283
  RefCountedPtr<AdsCallState> ads_calld_;
244
- bool sent_initial_request_;
284
+ bool timer_started_ = false;
245
285
  bool timer_pending_ = false;
246
286
  grpc_timer timer_;
247
287
  grpc_closure timer_callback_;
@@ -255,30 +295,41 @@ class XdsClient::ChannelState::AdsCallState
255
295
  grpc_error_handle error = GRPC_ERROR_NONE;
256
296
 
257
297
  // Subscribed resources of this type.
258
- std::map<std::string /* name */, OrphanablePtr<ResourceState>>
298
+ std::map<std::string /*authority*/,
299
+ std::map<std::string /*name*/, OrphanablePtr<ResourceState>>>
259
300
  subscribed_resources;
260
301
  };
261
302
 
262
303
  void SendMessageLocked(const std::string& type_url)
263
304
  ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
264
305
 
265
- void AcceptLdsUpdateLocked(std::string version, grpc_millis update_time,
266
- XdsApi::LdsUpdateMap lds_update_map)
306
+ void AcceptLdsUpdateLocked(
307
+ std::string version, grpc_millis update_time,
308
+ XdsApi::LdsUpdateMap lds_update_map,
309
+ const std::set<XdsApi::ResourceName>& resource_names_failed)
267
310
  ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
268
311
  void AcceptRdsUpdateLocked(std::string version, grpc_millis update_time,
269
312
  XdsApi::RdsUpdateMap rds_update_map)
270
313
  ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
271
- void AcceptCdsUpdateLocked(std::string version, grpc_millis update_time,
272
- XdsApi::CdsUpdateMap cds_update_map)
314
+ void AcceptCdsUpdateLocked(
315
+ std::string version, grpc_millis update_time,
316
+ XdsApi::CdsUpdateMap cds_update_map,
317
+ const std::set<XdsApi::ResourceName>& resource_names_failed)
273
318
  ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
274
319
  void AcceptEdsUpdateLocked(std::string version, grpc_millis update_time,
275
320
  XdsApi::EdsUpdateMap eds_update_map)
276
321
  ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
277
322
 
278
323
  template <typename StateMap>
324
+ void RejectAdsUpdateHelperLocked(const std::string& resource_name,
325
+ grpc_millis update_time,
326
+ const XdsApi::AdsParseResult& result,
327
+ const std::string& error_details,
328
+ StateMap* state_map)
329
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
330
+
279
331
  void RejectAdsUpdateLocked(grpc_millis update_time,
280
- const XdsApi::AdsParseResult& result,
281
- StateMap* state_map)
332
+ const XdsApi::AdsParseResult& result)
282
333
  ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
283
334
 
284
335
  static void OnRequestSent(void* arg, grpc_error_handle error);
@@ -293,8 +344,9 @@ class XdsClient::ChannelState::AdsCallState
293
344
 
294
345
  bool IsCurrentCallOnChannel() const;
295
346
 
296
- std::set<absl::string_view> ResourceNamesForRequest(
297
- const std::string& type_url);
347
+ std::map<absl::string_view /*authority*/,
348
+ std::set<absl::string_view /*name*/>>
349
+ ResourceNamesForRequest(const std::string& type_url);
298
350
 
299
351
  // The owning RetryableCall<>.
300
352
  RefCountedPtr<RetryableCall<AdsCallState>> parent_;
@@ -439,27 +491,30 @@ class XdsClient::ChannelState::LrsCallState
439
491
  class XdsClient::ChannelState::StateWatcher
440
492
  : public AsyncConnectivityStateWatcherInterface {
441
493
  public:
442
- explicit StateWatcher(RefCountedPtr<ChannelState> parent)
494
+ explicit StateWatcher(WeakRefCountedPtr<ChannelState> parent)
443
495
  : parent_(std::move(parent)) {}
444
496
 
445
497
  private:
446
498
  void OnConnectivityStateChange(grpc_connectivity_state new_state,
447
499
  const absl::Status& status) override {
448
- MutexLock lock(&parent_->xds_client_->mu_);
449
- if (!parent_->shutting_down_ &&
450
- new_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
451
- // In TRANSIENT_FAILURE. Notify all watchers of error.
452
- gpr_log(GPR_INFO,
453
- "[xds_client %p] xds channel in state:TRANSIENT_FAILURE "
454
- "status_message:(%s)",
455
- parent_->xds_client(), status.ToString().c_str());
456
- parent_->xds_client_->NotifyOnErrorLocked(
457
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
458
- "xds channel in TRANSIENT_FAILURE"));
500
+ {
501
+ MutexLock lock(&parent_->xds_client_->mu_);
502
+ if (!parent_->shutting_down_ &&
503
+ new_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
504
+ // In TRANSIENT_FAILURE. Notify all watchers of error.
505
+ gpr_log(GPR_INFO,
506
+ "[xds_client %p] xds channel in state:TRANSIENT_FAILURE "
507
+ "status_message:(%s)",
508
+ parent_->xds_client(), status.ToString().c_str());
509
+ parent_->xds_client_->NotifyOnErrorLocked(
510
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING(
511
+ "xds channel in TRANSIENT_FAILURE"));
512
+ }
459
513
  }
514
+ parent_->xds_client()->work_serializer_.DrainQueue();
460
515
  }
461
516
 
462
- RefCountedPtr<ChannelState> parent_;
517
+ WeakRefCountedPtr<ChannelState> parent_;
463
518
  };
464
519
 
465
520
  //
@@ -481,7 +536,7 @@ grpc_channel* CreateXdsChannel(grpc_channel_args* args,
481
536
 
482
537
  XdsClient::ChannelState::ChannelState(WeakRefCountedPtr<XdsClient> xds_client,
483
538
  const XdsBootstrap::XdsServer& server)
484
- : InternallyRefCounted<ChannelState>(
539
+ : DualRefCounted<ChannelState>(
485
540
  GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace)
486
541
  ? "ChannelState"
487
542
  : nullptr),
@@ -505,12 +560,19 @@ XdsClient::ChannelState::~ChannelState() {
505
560
  xds_client_.reset(DEBUG_LOCATION, "ChannelState");
506
561
  }
507
562
 
508
- void XdsClient::ChannelState::Orphan() {
563
+ // This method should only ever be called when holding the lock, but we can't
564
+ // use a ABSL_EXCLUSIVE_LOCKS_REQUIRED annotation, because Orphan() will be
565
+ // called from DualRefCounted::Unref, which cannot have a lock annotation for a
566
+ // lock in this subclass.
567
+ void XdsClient::ChannelState::Orphan() ABSL_NO_THREAD_SAFETY_ANALYSIS {
509
568
  shutting_down_ = true;
510
569
  CancelConnectivityWatchLocked();
570
+ // At this time, all strong refs are removed, remove from channel map to
571
+ // prevent subsequent subscription from trying to use this ChannelState as it
572
+ // is shutting down.
573
+ xds_client_->xds_server_channel_map_.erase(server_);
511
574
  ads_calld_.reset();
512
575
  lrs_calld_.reset();
513
- Unref(DEBUG_LOCATION, "ChannelState+orphaned");
514
576
  }
515
577
 
516
578
  XdsClient::ChannelState::AdsCallState* XdsClient::ChannelState::ads_calld()
@@ -529,8 +591,8 @@ bool XdsClient::ChannelState::HasActiveAdsCall() const {
529
591
 
530
592
  void XdsClient::ChannelState::MaybeStartLrsCall() {
531
593
  if (lrs_calld_ != nullptr) return;
532
- lrs_calld_.reset(
533
- new RetryableCall<LrsCallState>(Ref(DEBUG_LOCATION, "ChannelState+lrs")));
594
+ lrs_calld_.reset(new RetryableCall<LrsCallState>(
595
+ WeakRef(DEBUG_LOCATION, "ChannelState+lrs")));
534
596
  }
535
597
 
536
598
  void XdsClient::ChannelState::StopLrsCall() { lrs_calld_.reset(); }
@@ -538,7 +600,7 @@ void XdsClient::ChannelState::StopLrsCall() { lrs_calld_.reset(); }
538
600
  void XdsClient::ChannelState::StartConnectivityWatchLocked() {
539
601
  ClientChannel* client_channel = ClientChannel::GetFromChannel(channel_);
540
602
  GPR_ASSERT(client_channel != nullptr);
541
- watcher_ = new StateWatcher(Ref(DEBUG_LOCATION, "ChannelState+watch"));
603
+ watcher_ = new StateWatcher(WeakRef(DEBUG_LOCATION, "ChannelState+watch"));
542
604
  client_channel->AddConnectivityWatcher(
543
605
  GRPC_CHANNEL_IDLE,
544
606
  OrphanablePtr<AsyncConnectivityStateWatcherInterface>(watcher_));
@@ -550,12 +612,12 @@ void XdsClient::ChannelState::CancelConnectivityWatchLocked() {
550
612
  client_channel->RemoveConnectivityWatcher(watcher_);
551
613
  }
552
614
 
553
- void XdsClient::ChannelState::SubscribeLocked(const std::string& type_url,
554
- const std::string& name) {
615
+ void XdsClient::ChannelState::SubscribeLocked(
616
+ const std::string& type_url, const XdsApi::ResourceName& name) {
555
617
  if (ads_calld_ == nullptr) {
556
618
  // Start the ADS call if this is the first request.
557
619
  ads_calld_.reset(new RetryableCall<AdsCallState>(
558
- Ref(DEBUG_LOCATION, "ChannelState+ads")));
620
+ WeakRef(DEBUG_LOCATION, "ChannelState+ads")));
559
621
  // Note: AdsCallState's ctor will automatically subscribe to all
560
622
  // resources that the XdsClient already has watchers for, so we can
561
623
  // return here.
@@ -568,14 +630,16 @@ void XdsClient::ChannelState::SubscribeLocked(const std::string& type_url,
568
630
  ads_calld()->SubscribeLocked(type_url, name);
569
631
  }
570
632
 
571
- void XdsClient::ChannelState::UnsubscribeLocked(const std::string& type_url,
572
- const std::string& name,
573
- bool delay_unsubscription) {
633
+ void XdsClient::ChannelState::UnsubscribeLocked(
634
+ const std::string& type_url, const XdsApi::ResourceName& name,
635
+ bool delay_unsubscription) {
574
636
  if (ads_calld_ != nullptr) {
575
637
  auto* calld = ads_calld_->calld();
576
638
  if (calld != nullptr) {
577
639
  calld->UnsubscribeLocked(type_url, name, delay_unsubscription);
578
- if (!calld->HasSubscribedResources()) ads_calld_.reset();
640
+ if (!calld->HasSubscribedResources()) {
641
+ ads_calld_.reset();
642
+ }
579
643
  }
580
644
  }
581
645
  }
@@ -586,7 +650,7 @@ void XdsClient::ChannelState::UnsubscribeLocked(const std::string& type_url,
586
650
 
587
651
  template <typename T>
588
652
  XdsClient::ChannelState::RetryableCall<T>::RetryableCall(
589
- RefCountedPtr<ChannelState> chand)
653
+ WeakRefCountedPtr<ChannelState> chand)
590
654
  : chand_(std::move(chand)),
591
655
  backoff_(
592
656
  BackOff::Options()
@@ -644,7 +708,8 @@ void XdsClient::ChannelState::RetryableCall<T>::StartRetryTimerLocked() {
644
708
  if (shutting_down_) return;
645
709
  const grpc_millis next_attempt_time = backoff_.NextAttemptTime();
646
710
  if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
647
- grpc_millis timeout = GPR_MAX(next_attempt_time - ExecCtx::Get()->Now(), 0);
711
+ grpc_millis timeout =
712
+ std::max(next_attempt_time - ExecCtx::Get()->Now(), grpc_millis(0));
648
713
  gpr_log(GPR_INFO,
649
714
  "[xds_client %p] Failed to connect to xds server (chand: %p) "
650
715
  "retry timer will fire in %" PRId64 "ms.",
@@ -735,17 +800,26 @@ XdsClient::ChannelState::AdsCallState::AdsCallState(
735
800
  // Op: send request message.
736
801
  GRPC_CLOSURE_INIT(&on_request_sent_, OnRequestSent, this,
737
802
  grpc_schedule_on_exec_ctx);
738
- for (const auto& p : xds_client()->listener_map_) {
739
- SubscribeLocked(XdsApi::kLdsTypeUrl, std::string(p.first));
740
- }
741
- for (const auto& p : xds_client()->route_config_map_) {
742
- SubscribeLocked(XdsApi::kRdsTypeUrl, std::string(p.first));
743
- }
744
- for (const auto& p : xds_client()->cluster_map_) {
745
- SubscribeLocked(XdsApi::kCdsTypeUrl, std::string(p.first));
746
- }
747
- for (const auto& p : xds_client()->endpoint_map_) {
748
- SubscribeLocked(XdsApi::kEdsTypeUrl, std::string(p.first));
803
+ for (const auto& a : xds_client()->authority_state_map_) {
804
+ const std::string& authority = a.first;
805
+ // Skip authorities that are not using this xDS channel.
806
+ if (a.second.channel_state != chand()) continue;
807
+ for (const auto& l : a.second.listener_map) {
808
+ const std::string& listener_name = l.first;
809
+ SubscribeLocked(XdsApi::kLdsTypeUrl, {authority, listener_name});
810
+ }
811
+ for (const auto& r : a.second.route_config_map) {
812
+ const std::string& route_config_name = r.first;
813
+ SubscribeLocked(XdsApi::kRdsTypeUrl, {authority, route_config_name});
814
+ }
815
+ for (const auto& c : a.second.cluster_map) {
816
+ const std::string& cluster_name = c.first;
817
+ SubscribeLocked(XdsApi::kCdsTypeUrl, {authority, cluster_name});
818
+ }
819
+ for (const auto& e : a.second.endpoint_map) {
820
+ const std::string& endpoint_name = e.first;
821
+ SubscribeLocked(XdsApi::kEdsTypeUrl, {authority, endpoint_name});
822
+ }
749
823
  }
750
824
  // Op: recv initial metadata.
751
825
  op = ops;
@@ -818,11 +892,12 @@ void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
818
892
  }
819
893
  auto& state = state_map_[type_url];
820
894
  grpc_slice request_payload_slice;
821
- std::set<absl::string_view> resource_names =
822
- ResourceNamesForRequest(type_url);
895
+ std::map<absl::string_view /*authority*/,
896
+ std::set<absl::string_view /*name*/>>
897
+ resource_map = ResourceNamesForRequest(type_url);
823
898
  request_payload_slice = xds_client()->api_.CreateAdsRequest(
824
- chand()->server_, type_url, resource_names,
825
- xds_client()->resource_version_map_[type_url], state.nonce,
899
+ chand()->server_, type_url, resource_map,
900
+ chand()->resource_type_version_map_[type_url], state.nonce,
826
901
  GRPC_ERROR_REF(state.error), !sent_initial_message_);
827
902
  if (type_url != XdsApi::kLdsTypeUrl && type_url != XdsApi::kRdsTypeUrl &&
828
903
  type_url != XdsApi::kCdsTypeUrl && type_url != XdsApi::kEdsTypeUrl) {
@@ -832,11 +907,10 @@ void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
832
907
  if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
833
908
  gpr_log(GPR_INFO,
834
909
  "[xds_client %p] sending ADS request: type=%s version=%s nonce=%s "
835
- "error=%s resources=%s",
910
+ "error=%s",
836
911
  xds_client(), type_url.c_str(),
837
- xds_client()->resource_version_map_[type_url].c_str(),
838
- state.nonce.c_str(), grpc_error_std_string(state.error).c_str(),
839
- absl::StrJoin(resource_names, " ").c_str());
912
+ chand()->resource_type_version_map_[type_url].c_str(),
913
+ state.nonce.c_str(), grpc_error_std_string(state.error).c_str());
840
914
  }
841
915
  GRPC_ERROR_UNREF(state.error);
842
916
  state.error = GRPC_ERROR_NONE;
@@ -863,19 +937,24 @@ void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
863
937
  }
864
938
 
865
939
  void XdsClient::ChannelState::AdsCallState::SubscribeLocked(
866
- const std::string& type_url, const std::string& name) {
867
- auto& state = state_map_[type_url].subscribed_resources[name];
940
+ const std::string& type_url, const XdsApi::ResourceName& name) {
941
+ auto& state =
942
+ state_map_[type_url].subscribed_resources[name.authority][name.id];
868
943
  if (state == nullptr) {
869
- state = MakeOrphanable<ResourceState>(
870
- type_url, name, !xds_client()->resource_version_map_[type_url].empty());
944
+ state = MakeOrphanable<ResourceState>(type_url, name);
871
945
  SendMessageLocked(type_url);
872
946
  }
873
947
  }
874
948
 
875
949
  void XdsClient::ChannelState::AdsCallState::UnsubscribeLocked(
876
- const std::string& type_url, const std::string& name,
950
+ const std::string& type_url, const XdsApi::ResourceName& name,
877
951
  bool delay_unsubscription) {
878
- state_map_[type_url].subscribed_resources.erase(name);
952
+ auto& type_state_map = state_map_[type_url];
953
+ auto& authority_map = type_state_map.subscribed_resources[name.authority];
954
+ authority_map.erase(name.id);
955
+ if (authority_map.empty()) {
956
+ type_state_map.subscribed_resources.erase(name.authority);
957
+ }
879
958
  if (!delay_unsubscription) SendMessageLocked(type_url);
880
959
  }
881
960
 
@@ -904,7 +983,8 @@ XdsApi::ResourceMetadata CreateResourceMetadataAcked(
904
983
 
905
984
  void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdateLocked(
906
985
  std::string version, grpc_millis update_time,
907
- XdsApi::LdsUpdateMap lds_update_map) {
986
+ XdsApi::LdsUpdateMap lds_update_map,
987
+ const std::set<XdsApi::ResourceName>& resource_names_failed) {
908
988
  if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
909
989
  gpr_log(GPR_INFO,
910
990
  "[xds_client %p] LDS update received containing %" PRIuPTR
@@ -912,30 +992,37 @@ void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdateLocked(
912
992
  xds_client(), lds_update_map.size());
913
993
  }
914
994
  auto& lds_state = state_map_[XdsApi::kLdsTypeUrl];
915
- std::set<std::string> rds_resource_names_seen;
916
995
  for (auto& p : lds_update_map) {
917
- const std::string& listener_name = p.first;
996
+ const XdsApi::ResourceName& name = p.first;
918
997
  XdsApi::LdsUpdate& lds_update = p.second.resource;
919
- auto& state = lds_state.subscribed_resources[listener_name];
920
- if (state != nullptr) state->Finish();
998
+ auto it = lds_state.subscribed_resources.find(name.authority);
999
+ if (it != lds_state.subscribed_resources.end()) {
1000
+ auto res_it = it->second.find(name.id);
1001
+ if (res_it != it->second.end()) {
1002
+ res_it->second->MaybeCancelTimer();
1003
+ }
1004
+ }
921
1005
  if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
922
1006
  gpr_log(GPR_INFO, "[xds_client %p] LDS resource %s: %s", xds_client(),
923
- listener_name.c_str(), lds_update.ToString().c_str());
924
- }
925
- // Record the RDS resource names seen.
926
- if (!lds_update.http_connection_manager.route_config_name.empty()) {
927
- rds_resource_names_seen.insert(
928
- lds_update.http_connection_manager.route_config_name);
929
- }
1007
+ XdsApi::ConstructFullResourceName(name.authority,
1008
+ XdsApi::kLdsTypeUrl, name.id)
1009
+ .c_str(),
1010
+ lds_update.ToString().c_str());
1011
+ }
1012
+ ListenerState& listener_state = xds_client()
1013
+ ->authority_state_map_[name.authority]
1014
+ .listener_map[name.id];
930
1015
  // Ignore identical update.
931
- ListenerState& listener_state = xds_client()->listener_map_[listener_name];
932
1016
  if (listener_state.update.has_value() &&
933
1017
  *listener_state.update == lds_update) {
934
1018
  if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
935
1019
  gpr_log(GPR_INFO,
936
1020
  "[xds_client %p] LDS update for %s identical to current, "
937
1021
  "ignoring.",
938
- xds_client(), listener_name.c_str());
1022
+ xds_client(),
1023
+ XdsApi::ConstructFullResourceName(name.authority,
1024
+ XdsApi::kLdsTypeUrl, name.id)
1025
+ .c_str());
939
1026
  }
940
1027
  continue;
941
1028
  }
@@ -944,43 +1031,52 @@ void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdateLocked(
944
1031
  listener_state.meta = CreateResourceMetadataAcked(
945
1032
  std::move(p.second.serialized_proto), version, update_time);
946
1033
  // Notify watchers.
947
- for (const auto& p : listener_state.watchers) {
948
- p.first->OnListenerChanged(*listener_state.update);
1034
+ auto& watchers_list = listener_state.watchers;
1035
+ auto& value = listener_state.update.value();
1036
+ xds_client()->work_serializer_.Schedule(
1037
+ [watchers_list, value]()
1038
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client()->work_serializer_) {
1039
+ for (const auto& p : watchers_list) {
1040
+ p.first->OnListenerChanged(value);
1041
+ }
1042
+ },
1043
+ DEBUG_LOCATION);
1044
+ }
1045
+ // For invalid resources in the update, if they are already in the
1046
+ // cache, pretend that they are present in the update, so that we
1047
+ // don't incorrectly consider them deleted below.
1048
+ for (const auto& name : resource_names_failed) {
1049
+ auto& listener_map =
1050
+ xds_client()->authority_state_map_[name.authority].listener_map;
1051
+ auto it = listener_map.find(name.id);
1052
+ if (it != listener_map.end()) {
1053
+ auto& update = it->second.update;
1054
+ if (!update.has_value()) continue;
1055
+ lds_update_map[name];
949
1056
  }
950
1057
  }
951
1058
  // For any subscribed resource that is not present in the update,
952
1059
  // remove it from the cache and notify watchers that it does not exist.
953
- for (const auto& p : lds_state.subscribed_resources) {
954
- const std::string& listener_name = p.first;
955
- if (lds_update_map.find(listener_name) == lds_update_map.end()) {
956
- ListenerState& listener_state =
957
- xds_client()->listener_map_[listener_name];
958
- // If the resource was newly requested but has not yet been received,
959
- // we don't want to generate an error for the watchers, because this LDS
960
- // response may be in reaction to an earlier request that did not yet
961
- // request the new resource, so its absence from the response does not
962
- // necessarily indicate that the resource does not exist.
963
- // For that case, we rely on the request timeout instead.
964
- if (!listener_state.update.has_value()) continue;
965
- listener_state.update.reset();
966
- for (const auto& p : listener_state.watchers) {
967
- p.first->OnResourceDoesNotExist();
968
- }
969
- }
970
- }
971
- // For any RDS resource that is no longer referred to by any LDS
972
- // resources, remove it from the cache and notify watchers that it
973
- // does not exist.
974
- auto& rds_state = state_map_[XdsApi::kRdsTypeUrl];
975
- for (const auto& p : rds_state.subscribed_resources) {
976
- const std::string& rds_resource_name = p.first;
977
- if (rds_resource_names_seen.find(rds_resource_name) ==
978
- rds_resource_names_seen.end()) {
979
- RouteConfigState& route_config_state =
980
- xds_client()->route_config_map_[rds_resource_name];
981
- route_config_state.update.reset();
982
- for (const auto& p : route_config_state.watchers) {
983
- p.first->OnResourceDoesNotExist();
1060
+ for (const auto& a : lds_state.subscribed_resources) {
1061
+ const std::string& authority_name = a.first;
1062
+ for (const auto& p : a.second) {
1063
+ const std::string& listener_name = p.first;
1064
+ if (lds_update_map.find({authority_name, listener_name}) ==
1065
+ lds_update_map.end()) {
1066
+ ListenerState& listener_state =
1067
+ xds_client()
1068
+ ->authority_state_map_[authority_name]
1069
+ .listener_map[listener_name];
1070
+ // If the resource was newly requested but has not yet been received,
1071
+ // we don't want to generate an error for the watchers, because this LDS
1072
+ // response may be in reaction to an earlier request that did not yet
1073
+ // request the new resource, so its absence from the response does not
1074
+ // necessarily indicate that the resource does not exist.
1075
+ // For that case, we rely on the request timeout instead.
1076
+ if (!listener_state.update.has_value()) continue;
1077
+ listener_state.update.reset();
1078
+ Notifier::ScheduleNotifyWatchersOnResourceDoesNotExistInWorkSerializer(
1079
+ xds_client(), listener_state.watchers, DEBUG_LOCATION);
984
1080
  }
985
1081
  }
986
1082
  }
@@ -997,16 +1093,23 @@ void XdsClient::ChannelState::AdsCallState::AcceptRdsUpdateLocked(
997
1093
  }
998
1094
  auto& rds_state = state_map_[XdsApi::kRdsTypeUrl];
999
1095
  for (auto& p : rds_update_map) {
1000
- const std::string& route_config_name = p.first;
1096
+ const XdsApi::ResourceName& name = p.first;
1001
1097
  XdsApi::RdsUpdate& rds_update = p.second.resource;
1002
- auto& state = rds_state.subscribed_resources[route_config_name];
1003
- if (state != nullptr) state->Finish();
1098
+ auto it = rds_state.subscribed_resources.find(name.authority);
1099
+ if (it != rds_state.subscribed_resources.end()) {
1100
+ auto res_it = it->second.find(name.id);
1101
+ if (res_it != it->second.end()) {
1102
+ res_it->second->MaybeCancelTimer();
1103
+ }
1104
+ }
1004
1105
  if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
1005
1106
  gpr_log(GPR_INFO, "[xds_client %p] RDS resource:\n%s", xds_client(),
1006
1107
  rds_update.ToString().c_str());
1007
1108
  }
1008
1109
  RouteConfigState& route_config_state =
1009
- xds_client()->route_config_map_[route_config_name];
1110
+ xds_client()
1111
+ ->authority_state_map_[name.authority]
1112
+ .route_config_map[name.id];
1010
1113
  // Ignore identical update.
1011
1114
  if (route_config_state.update.has_value() &&
1012
1115
  *route_config_state.update == rds_update) {
@@ -1022,15 +1125,23 @@ void XdsClient::ChannelState::AdsCallState::AcceptRdsUpdateLocked(
1022
1125
  route_config_state.meta = CreateResourceMetadataAcked(
1023
1126
  std::move(p.second.serialized_proto), version, update_time);
1024
1127
  // Notify all watchers.
1025
- for (const auto& p : route_config_state.watchers) {
1026
- p.first->OnRouteConfigChanged(*route_config_state.update);
1027
- }
1128
+ auto& watchers_list = route_config_state.watchers;
1129
+ auto& value = route_config_state.update.value();
1130
+ xds_client()->work_serializer_.Schedule(
1131
+ [watchers_list, value]()
1132
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client()->work_serializer_) {
1133
+ for (const auto& p : watchers_list) {
1134
+ p.first->OnRouteConfigChanged(value);
1135
+ }
1136
+ },
1137
+ DEBUG_LOCATION);
1028
1138
  }
1029
1139
  }
1030
1140
 
1031
1141
  void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdateLocked(
1032
1142
  std::string version, grpc_millis update_time,
1033
- XdsApi::CdsUpdateMap cds_update_map) {
1143
+ XdsApi::CdsUpdateMap cds_update_map,
1144
+ const std::set<XdsApi::ResourceName>& resource_names_failed) {
1034
1145
  if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
1035
1146
  gpr_log(GPR_INFO,
1036
1147
  "[xds_client %p] CDS update received containing %" PRIuPTR
@@ -1038,22 +1149,26 @@ void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdateLocked(
1038
1149
  xds_client(), cds_update_map.size());
1039
1150
  }
1040
1151
  auto& cds_state = state_map_[XdsApi::kCdsTypeUrl];
1041
- std::set<std::string> eds_resource_names_seen;
1042
1152
  for (auto& p : cds_update_map) {
1043
- const char* cluster_name = p.first.c_str();
1153
+ const XdsApi::ResourceName& name = p.first;
1044
1154
  XdsApi::CdsUpdate& cds_update = p.second.resource;
1045
- auto& state = cds_state.subscribed_resources[cluster_name];
1046
- if (state != nullptr) state->Finish();
1155
+ auto it = cds_state.subscribed_resources.find(name.authority);
1156
+ if (it != cds_state.subscribed_resources.end()) {
1157
+ auto res_it = it->second.find(name.id);
1158
+ if (res_it != it->second.end()) {
1159
+ res_it->second->MaybeCancelTimer();
1160
+ }
1161
+ }
1047
1162
  if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
1048
1163
  gpr_log(GPR_INFO, "[xds_client %p] cluster=%s: %s", xds_client(),
1049
- cluster_name, cds_update.ToString().c_str());
1164
+ XdsApi::ConstructFullResourceName(name.authority,
1165
+ XdsApi::kCdsTypeUrl, name.id)
1166
+ .c_str(),
1167
+ cds_update.ToString().c_str());
1050
1168
  }
1051
- // Record the EDS resource names seen.
1052
- eds_resource_names_seen.insert(cds_update.eds_service_name.empty()
1053
- ? cluster_name
1054
- : cds_update.eds_service_name);
1169
+ ClusterState& cluster_state =
1170
+ xds_client()->authority_state_map_[name.authority].cluster_map[name.id];
1055
1171
  // Ignore identical update.
1056
- ClusterState& cluster_state = xds_client()->cluster_map_[cluster_name];
1057
1172
  if (cluster_state.update.has_value() &&
1058
1173
  *cluster_state.update == cds_update) {
1059
1174
  if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
@@ -1068,42 +1183,51 @@ void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdateLocked(
1068
1183
  cluster_state.meta = CreateResourceMetadataAcked(
1069
1184
  std::move(p.second.serialized_proto), version, update_time);
1070
1185
  // Notify all watchers.
1071
- for (const auto& p : cluster_state.watchers) {
1072
- p.first->OnClusterChanged(cluster_state.update.value());
1186
+ auto& watchers_list = cluster_state.watchers;
1187
+ auto& value = cluster_state.update.value();
1188
+ xds_client()->work_serializer_.Schedule(
1189
+ [watchers_list, value]()
1190
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client()->work_serializer_) {
1191
+ for (const auto& p : watchers_list) {
1192
+ p.first->OnClusterChanged(value);
1193
+ }
1194
+ },
1195
+ DEBUG_LOCATION);
1196
+ }
1197
+ // For invalid resources in the update, if they are already in the
1198
+ // cache, pretend that they are present in the update, so that we
1199
+ // don't incorrectly consider them deleted below.
1200
+ for (const auto& name : resource_names_failed) {
1201
+ auto& cluster_map =
1202
+ xds_client()->authority_state_map_[name.authority].cluster_map;
1203
+ auto it = cluster_map.find(name.id);
1204
+ if (it != cluster_map.end()) {
1205
+ auto& update = it->second.update;
1206
+ if (!update.has_value()) continue;
1207
+ cds_update_map[name];
1073
1208
  }
1074
1209
  }
1075
1210
  // For any subscribed resource that is not present in the update,
1076
1211
  // remove it from the cache and notify watchers that it does not exist.
1077
- for (const auto& p : cds_state.subscribed_resources) {
1078
- const std::string& cluster_name = p.first;
1079
- if (cds_update_map.find(cluster_name) == cds_update_map.end()) {
1080
- ClusterState& cluster_state = xds_client()->cluster_map_[cluster_name];
1081
- // If the resource was newly requested but has not yet been received,
1082
- // we don't want to generate an error for the watchers, because this CDS
1083
- // response may be in reaction to an earlier request that did not yet
1084
- // request the new resource, so its absence from the response does not
1085
- // necessarily indicate that the resource does not exist.
1086
- // For that case, we rely on the request timeout instead.
1087
- if (!cluster_state.update.has_value()) continue;
1088
- cluster_state.update.reset();
1089
- for (const auto& p : cluster_state.watchers) {
1090
- p.first->OnResourceDoesNotExist();
1091
- }
1092
- }
1093
- }
1094
- // For any EDS resource that is no longer referred to by any CDS
1095
- // resources, remove it from the cache and notify watchers that it
1096
- // does not exist.
1097
- auto& eds_state = state_map_[XdsApi::kEdsTypeUrl];
1098
- for (const auto& p : eds_state.subscribed_resources) {
1099
- const std::string& eds_resource_name = p.first;
1100
- if (eds_resource_names_seen.find(eds_resource_name) ==
1101
- eds_resource_names_seen.end()) {
1102
- EndpointState& endpoint_state =
1103
- xds_client()->endpoint_map_[eds_resource_name];
1104
- endpoint_state.update.reset();
1105
- for (const auto& p : endpoint_state.watchers) {
1106
- p.first->OnResourceDoesNotExist();
1212
+ for (const auto& a : cds_state.subscribed_resources) {
1213
+ const std::string& authority = a.first;
1214
+ for (const auto& p : a.second) {
1215
+ const std::string& cluster_name = p.first;
1216
+ if (cds_update_map.find({authority, cluster_name}) ==
1217
+ cds_update_map.end()) {
1218
+ ClusterState& cluster_state = xds_client()
1219
+ ->authority_state_map_[authority]
1220
+ .cluster_map[cluster_name];
1221
+ // If the resource was newly requested but has not yet been received,
1222
+ // we don't want to generate an error for the watchers, because this CDS
1223
+ // response may be in reaction to an earlier request that did not yet
1224
+ // request the new resource, so its absence from the response does not
1225
+ // necessarily indicate that the resource does not exist.
1226
+ // For that case, we rely on the request timeout instead.
1227
+ if (!cluster_state.update.has_value()) continue;
1228
+ cluster_state.update.reset();
1229
+ Notifier::ScheduleNotifyWatchersOnResourceDoesNotExistInWorkSerializer(
1230
+ xds_client(), cluster_state.watchers, DEBUG_LOCATION);
1107
1231
  }
1108
1232
  }
1109
1233
  }
@@ -1120,16 +1244,25 @@ void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdateLocked(
1120
1244
  }
1121
1245
  auto& eds_state = state_map_[XdsApi::kEdsTypeUrl];
1122
1246
  for (auto& p : eds_update_map) {
1123
- const char* eds_service_name = p.first.c_str();
1247
+ const XdsApi::ResourceName& name = p.first;
1124
1248
  XdsApi::EdsUpdate& eds_update = p.second.resource;
1125
- auto& state = eds_state.subscribed_resources[eds_service_name];
1126
- if (state != nullptr) state->Finish();
1249
+ auto it = eds_state.subscribed_resources.find(name.authority);
1250
+ if (it != eds_state.subscribed_resources.end()) {
1251
+ auto res_it = it->second.find(name.id);
1252
+ if (res_it != it->second.end()) {
1253
+ res_it->second->MaybeCancelTimer();
1254
+ }
1255
+ }
1127
1256
  if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
1128
1257
  gpr_log(GPR_INFO, "[xds_client %p] EDS resource %s: %s", xds_client(),
1129
- eds_service_name, eds_update.ToString().c_str());
1130
- }
1131
- EndpointState& endpoint_state =
1132
- xds_client()->endpoint_map_[eds_service_name];
1258
+ XdsApi::ConstructFullResourceName(name.authority,
1259
+ XdsApi::kCdsTypeUrl, name.id)
1260
+ .c_str(),
1261
+ eds_update.ToString().c_str());
1262
+ }
1263
+ EndpointState& endpoint_state = xds_client()
1264
+ ->authority_state_map_[name.authority]
1265
+ .endpoint_map[name.id];
1133
1266
  // Ignore identical update.
1134
1267
  if (endpoint_state.update.has_value() &&
1135
1268
  *endpoint_state.update == eds_update) {
@@ -1145,9 +1278,16 @@ void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdateLocked(
1145
1278
  endpoint_state.meta = CreateResourceMetadataAcked(
1146
1279
  std::move(p.second.serialized_proto), version, update_time);
1147
1280
  // Notify all watchers.
1148
- for (const auto& p : endpoint_state.watchers) {
1149
- p.first->OnEndpointChanged(endpoint_state.update.value());
1150
- }
1281
+ auto& watchers_list = endpoint_state.watchers;
1282
+ auto& value = endpoint_state.update.value();
1283
+ xds_client()->work_serializer_.Schedule(
1284
+ [watchers_list, value]()
1285
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client()->work_serializer_) {
1286
+ for (const auto& p : watchers_list) {
1287
+ p.first->OnEndpointChanged(value);
1288
+ }
1289
+ },
1290
+ DEBUG_LOCATION);
1151
1291
  }
1152
1292
  }
1153
1293
 
@@ -1167,28 +1307,50 @@ void UpdateResourceMetadataNacked(const std::string& version,
1167
1307
  } // namespace
1168
1308
 
1169
1309
  template <typename StateMap>
1170
- void XdsClient::ChannelState::AdsCallState::RejectAdsUpdateLocked(
1171
- grpc_millis update_time, const XdsApi::AdsParseResult& result,
1310
+ void XdsClient::ChannelState::AdsCallState::RejectAdsUpdateHelperLocked(
1311
+ const std::string& resource_name, grpc_millis update_time,
1312
+ const XdsApi::AdsParseResult& result, const std::string& error_details,
1172
1313
  StateMap* state_map) {
1314
+ auto it = state_map->find(resource_name);
1315
+ if (it == state_map->end()) return;
1316
+ auto& state = it->second;
1317
+ Notifier::ScheduleNotifyWatchersOnErrorInWorkSerializer(
1318
+ xds_client(), state.watchers, GRPC_ERROR_REF(result.parse_error),
1319
+ DEBUG_LOCATION);
1320
+ UpdateResourceMetadataNacked(result.version, error_details, update_time,
1321
+ &state.meta);
1322
+ }
1323
+
1324
+ void XdsClient::ChannelState::AdsCallState::RejectAdsUpdateLocked(
1325
+ grpc_millis update_time, const XdsApi::AdsParseResult& result) {
1173
1326
  if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
1174
1327
  gpr_log(GPR_INFO,
1175
1328
  "[xds_client %p] %s update NACKed containing %" PRIuPTR
1176
- " resources",
1329
+ " invalid resources",
1177
1330
  xds_client(), result.type_url.c_str(),
1178
1331
  result.resource_names_failed.size());
1179
1332
  }
1180
1333
  std::string details = grpc_error_std_string(result.parse_error);
1181
- for (auto& name : result.resource_names_failed) {
1182
- auto it = state_map->find(name);
1183
- if (it == state_map->end()) continue;
1184
- auto& state = it->second;
1185
- // Notify watchers of error.
1186
- for (const auto& p : state.watchers) {
1187
- p.first->OnError(GRPC_ERROR_REF(result.parse_error));
1334
+ for (auto& resource : result.resource_names_failed) {
1335
+ auto authority_it =
1336
+ xds_client()->authority_state_map_.find(resource.authority);
1337
+ if (authority_it == xds_client()->authority_state_map_.end()) continue;
1338
+ AuthorityState& authority_state = authority_it->second;
1339
+ if (result.type_url == XdsApi::kLdsTypeUrl) {
1340
+ RejectAdsUpdateHelperLocked(resource.id, update_time, result, details,
1341
+ &authority_state.listener_map);
1342
+ } else if (result.type_url == XdsApi::kRdsTypeUrl) {
1343
+ RejectAdsUpdateHelperLocked(resource.id, update_time, result, details,
1344
+ &authority_state.route_config_map);
1345
+ } else if (result.type_url == XdsApi::kCdsTypeUrl) {
1346
+ RejectAdsUpdateHelperLocked(resource.id, update_time, result, details,
1347
+ &authority_state.cluster_map);
1348
+ } else if (result.type_url == XdsApi::kEdsTypeUrl) {
1349
+ RejectAdsUpdateHelperLocked(resource.id, update_time, result, details,
1350
+ &authority_state.endpoint_map);
1351
+ } else {
1352
+ GPR_ASSERT(0);
1188
1353
  }
1189
- // Update resource metadata for CSDS.
1190
- UpdateResourceMetadataNacked(result.version, details, update_time,
1191
- &state.meta);
1192
1354
  }
1193
1355
  }
1194
1356
 
@@ -1234,6 +1396,7 @@ void XdsClient::ChannelState::AdsCallState::OnResponseReceived(
1234
1396
  MutexLock lock(&ads_calld->xds_client()->mu_);
1235
1397
  done = ads_calld->OnResponseReceivedLocked();
1236
1398
  }
1399
+ ads_calld->xds_client()->work_serializer_.DrainQueue();
1237
1400
  if (done) ads_calld->Unref(DEBUG_LOCATION, "ADS+OnResponseReceivedLocked");
1238
1401
  }
1239
1402
 
@@ -1264,13 +1427,12 @@ bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
1264
1427
  xds_client(), grpc_error_std_string(result.parse_error).c_str());
1265
1428
  GRPC_ERROR_UNREF(result.parse_error);
1266
1429
  } else {
1267
- grpc_millis update_time = grpc_core::ExecCtx::Get()->Now();
1430
+ grpc_millis update_time = ExecCtx::Get()->Now();
1268
1431
  // Update nonce.
1269
1432
  auto& state = state_map_[result.type_url];
1270
1433
  state.nonce = std::move(result.nonce);
1271
- // NACK or ACK the response.
1434
+ // If we got an error, we'll NACK the update.
1272
1435
  if (result.parse_error != GRPC_ERROR_NONE) {
1273
- // NACK unacceptable update.
1274
1436
  gpr_log(GPR_ERROR,
1275
1437
  "[xds_client %p] ADS response invalid for resource type %s "
1276
1438
  "version %s, will NACK: nonce=%s error=%s",
@@ -1282,39 +1444,32 @@ bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
1282
1444
  GRPC_STATUS_UNAVAILABLE);
1283
1445
  GRPC_ERROR_UNREF(state.error);
1284
1446
  state.error = result.parse_error;
1285
- if (result.type_url == XdsApi::kLdsTypeUrl) {
1286
- RejectAdsUpdateLocked(update_time, result,
1287
- &xds_client()->listener_map_);
1288
- } else if (result.type_url == XdsApi::kRdsTypeUrl) {
1289
- RejectAdsUpdateLocked(update_time, result,
1290
- &xds_client()->route_config_map_);
1291
- } else if (result.type_url == XdsApi::kCdsTypeUrl) {
1292
- RejectAdsUpdateLocked(update_time, result, &xds_client()->cluster_map_);
1293
- } else if (result.type_url == XdsApi::kEdsTypeUrl) {
1294
- RejectAdsUpdateLocked(update_time, result,
1295
- &xds_client()->endpoint_map_);
1296
- }
1297
- SendMessageLocked(result.type_url);
1298
- } else {
1447
+ RejectAdsUpdateLocked(update_time, result);
1448
+ }
1449
+ // Process any valid resources.
1450
+ bool have_valid_resources = false;
1451
+ if (result.type_url == XdsApi::kLdsTypeUrl) {
1452
+ have_valid_resources = !result.lds_update_map.empty();
1453
+ AcceptLdsUpdateLocked(result.version, update_time,
1454
+ std::move(result.lds_update_map),
1455
+ result.resource_names_failed);
1456
+ } else if (result.type_url == XdsApi::kRdsTypeUrl) {
1457
+ have_valid_resources = !result.rds_update_map.empty();
1458
+ AcceptRdsUpdateLocked(result.version, update_time,
1459
+ std::move(result.rds_update_map));
1460
+ } else if (result.type_url == XdsApi::kCdsTypeUrl) {
1461
+ have_valid_resources = !result.cds_update_map.empty();
1462
+ AcceptCdsUpdateLocked(result.version, update_time,
1463
+ std::move(result.cds_update_map),
1464
+ result.resource_names_failed);
1465
+ } else if (result.type_url == XdsApi::kEdsTypeUrl) {
1466
+ have_valid_resources = !result.eds_update_map.empty();
1467
+ AcceptEdsUpdateLocked(result.version, update_time,
1468
+ std::move(result.eds_update_map));
1469
+ }
1470
+ if (have_valid_resources) {
1299
1471
  seen_response_ = true;
1300
- // Accept the ADS response according to the type_url.
1301
- if (result.type_url == XdsApi::kLdsTypeUrl) {
1302
- AcceptLdsUpdateLocked(result.version, update_time,
1303
- std::move(result.lds_update_map));
1304
- } else if (result.type_url == XdsApi::kRdsTypeUrl) {
1305
- AcceptRdsUpdateLocked(result.version, update_time,
1306
- std::move(result.rds_update_map));
1307
- } else if (result.type_url == XdsApi::kCdsTypeUrl) {
1308
- AcceptCdsUpdateLocked(result.version, update_time,
1309
- std::move(result.cds_update_map));
1310
- } else if (result.type_url == XdsApi::kEdsTypeUrl) {
1311
- AcceptEdsUpdateLocked(result.version, update_time,
1312
- std::move(result.eds_update_map));
1313
- }
1314
- xds_client()->resource_version_map_[result.type_url] =
1315
- std::move(result.version);
1316
- // ACK the update.
1317
- SendMessageLocked(result.type_url);
1472
+ chand()->resource_type_version_map_[result.type_url] = result.version;
1318
1473
  // Start load reporting if needed.
1319
1474
  auto& lrs_call = chand()->lrs_calld_;
1320
1475
  if (lrs_call != nullptr) {
@@ -1322,6 +1477,8 @@ bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
1322
1477
  if (lrs_calld != nullptr) lrs_calld->MaybeStartReportingLocked();
1323
1478
  }
1324
1479
  }
1480
+ // Send ACK or NACK.
1481
+ SendMessageLocked(result.type_url);
1325
1482
  }
1326
1483
  if (xds_client()->shutting_down_) return true;
1327
1484
  // Keep listening for updates.
@@ -1346,6 +1503,7 @@ void XdsClient::ChannelState::AdsCallState::OnStatusReceived(
1346
1503
  MutexLock lock(&ads_calld->xds_client()->mu_);
1347
1504
  ads_calld->OnStatusReceivedLocked(GRPC_ERROR_REF(error));
1348
1505
  }
1506
+ ads_calld->xds_client()->work_serializer_.DrainQueue();
1349
1507
  ads_calld->Unref(DEBUG_LOCATION, "ADS+OnStatusReceivedLocked");
1350
1508
  }
1351
1509
 
@@ -1378,19 +1536,23 @@ bool XdsClient::ChannelState::AdsCallState::IsCurrentCallOnChannel() const {
1378
1536
  return this == chand()->ads_calld_->calld();
1379
1537
  }
1380
1538
 
1381
- std::set<absl::string_view>
1539
+ std::map<absl::string_view /*authority*/, std::set<absl::string_view /*name*/>>
1382
1540
  XdsClient::ChannelState::AdsCallState::ResourceNamesForRequest(
1383
1541
  const std::string& type_url) {
1384
- std::set<absl::string_view> resource_names;
1542
+ std::map<absl::string_view /*authority*/,
1543
+ std::set<absl::string_view /*name*/>>
1544
+ resource_map;
1385
1545
  auto it = state_map_.find(type_url);
1386
1546
  if (it != state_map_.end()) {
1387
- for (auto& p : it->second.subscribed_resources) {
1388
- resource_names.insert(p.first);
1389
- OrphanablePtr<ResourceState>& state = p.second;
1390
- state->Start(Ref(DEBUG_LOCATION, "ResourceState"));
1547
+ for (auto& a : it->second.subscribed_resources) {
1548
+ for (auto& p : a.second) {
1549
+ resource_map[a.first].insert(p.first);
1550
+ OrphanablePtr<ResourceState>& state = p.second;
1551
+ state->MaybeStartTimer(Ref(DEBUG_LOCATION, "ResourceState"));
1552
+ }
1391
1553
  }
1392
1554
  }
1393
- return resource_names;
1555
+ return resource_map;
1394
1556
  }
1395
1557
 
1396
1558
  //
@@ -1839,12 +2001,10 @@ grpc_millis GetRequestTimeout(const grpc_channel_args* args) {
1839
2001
  }
1840
2002
 
1841
2003
  grpc_channel_args* ModifyChannelArgs(const grpc_channel_args* args) {
1842
- absl::InlinedVector<grpc_arg, 2> args_to_add = {
2004
+ absl::InlinedVector<grpc_arg, 1> args_to_add = {
1843
2005
  grpc_channel_arg_integer_create(
1844
2006
  const_cast<char*>(GRPC_ARG_KEEPALIVE_TIME_MS),
1845
2007
  5 * 60 * GPR_MS_PER_SEC),
1846
- grpc_channel_arg_integer_create(
1847
- const_cast<char*>(GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL), 1),
1848
2008
  };
1849
2009
  return grpc_channel_args_copy_and_add(args, args_to_add.data(),
1850
2010
  args_to_add.size());
@@ -1868,9 +2028,9 @@ XdsClient::XdsClient(std::unique_ptr<XdsBootstrap> bootstrap,
1868
2028
  if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
1869
2029
  gpr_log(GPR_INFO, "[xds_client %p] creating xds client", this);
1870
2030
  }
1871
- // Create ChannelState object.
1872
- chand_ = MakeOrphanable<ChannelState>(
1873
- WeakRef(DEBUG_LOCATION, "XdsClient+ChannelState"), bootstrap_->server());
2031
+ // Calling grpc_init to ensure gRPC does not shut down until the XdsClient is
2032
+ // destroyed.
2033
+ grpc_init();
1874
2034
  }
1875
2035
 
1876
2036
  XdsClient::~XdsClient() {
@@ -1879,26 +2039,9 @@ XdsClient::~XdsClient() {
1879
2039
  }
1880
2040
  grpc_channel_args_destroy(args_);
1881
2041
  grpc_pollset_set_destroy(interested_parties_);
1882
- }
1883
-
1884
- void XdsClient::AddChannelzLinkage(
1885
- channelz::ChannelNode* parent_channelz_node) {
1886
- MutexLock lock(&mu_);
1887
- channelz::ChannelNode* xds_channelz_node =
1888
- grpc_channel_get_channelz_node(chand_->channel());
1889
- if (xds_channelz_node != nullptr) {
1890
- parent_channelz_node->AddChildChannel(xds_channelz_node->uuid());
1891
- }
1892
- }
1893
-
1894
- void XdsClient::RemoveChannelzLinkage(
1895
- channelz::ChannelNode* parent_channelz_node) {
1896
- MutexLock lock(&mu_);
1897
- channelz::ChannelNode* xds_channelz_node =
1898
- grpc_channel_get_channelz_node(chand_->channel());
1899
- if (xds_channelz_node != nullptr) {
1900
- parent_channelz_node->RemoveChildChannel(xds_channelz_node->uuid());
1901
- }
2042
+ // Calling grpc_shutdown to ensure gRPC does not shut down until the XdsClient
2043
+ // is destroyed.
2044
+ grpc_shutdown();
1902
2045
  }
1903
2046
 
1904
2047
  void XdsClient::Orphan() {
@@ -1912,39 +2055,94 @@ void XdsClient::Orphan() {
1912
2055
  {
1913
2056
  MutexLock lock(&mu_);
1914
2057
  shutting_down_ = true;
1915
- // Orphan ChannelState object.
1916
- chand_.reset();
1917
2058
  // We do not clear cluster_map_ and endpoint_map_ if the xds client was
1918
2059
  // created by the XdsResolver because the maps contain refs for watchers
1919
2060
  // which in turn hold refs to the loadbalancing policies. At this point, it
1920
2061
  // is possible for ADS calls to be in progress. Unreffing the loadbalancing
1921
2062
  // policies before those calls are done would lead to issues such as
1922
2063
  // https://github.com/grpc/grpc/issues/20928.
1923
- if (!listener_map_.empty()) {
1924
- cluster_map_.clear();
1925
- endpoint_map_.clear();
2064
+ for (auto& a : authority_state_map_) {
2065
+ a.second.channel_state.reset();
2066
+ if (!a.second.listener_map.empty()) {
2067
+ a.second.cluster_map.clear();
2068
+ a.second.endpoint_map.clear();
2069
+ }
1926
2070
  }
2071
+ // We clear these invalid resource watchers as cancel never came.
2072
+ invalid_listener_watchers_.clear();
2073
+ invalid_route_config_watchers_.clear();
2074
+ invalid_cluster_watchers_.clear();
2075
+ invalid_endpoint_watchers_.clear();
2076
+ }
2077
+ }
2078
+
2079
+ RefCountedPtr<XdsClient::ChannelState> XdsClient::GetOrCreateChannelStateLocked(
2080
+ const XdsBootstrap::XdsServer& server) {
2081
+ auto it = xds_server_channel_map_.find(server);
2082
+ if (it != xds_server_channel_map_.end()) {
2083
+ return it->second->Ref(DEBUG_LOCATION, "Authority");
1927
2084
  }
2085
+ // Channel not found, so create a new one.
2086
+ auto channel_state = MakeRefCounted<ChannelState>(
2087
+ WeakRef(DEBUG_LOCATION, "ChannelState"), server);
2088
+ xds_server_channel_map_[server] = channel_state.get();
2089
+ return channel_state;
1928
2090
  }
1929
2091
 
1930
2092
  void XdsClient::WatchListenerData(
1931
2093
  absl::string_view listener_name,
1932
- std::unique_ptr<ListenerWatcherInterface> watcher) {
2094
+ RefCountedPtr<ListenerWatcherInterface> watcher) {
1933
2095
  std::string listener_name_str = std::string(listener_name);
1934
- MutexLock lock(&mu_);
1935
- ListenerState& listener_state = listener_map_[listener_name_str];
1936
2096
  ListenerWatcherInterface* w = watcher.get();
1937
- listener_state.watchers[w] = std::move(watcher);
1938
- // If we've already received an LDS update, notify the new watcher
1939
- // immediately.
1940
- if (listener_state.update.has_value()) {
1941
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
1942
- gpr_log(GPR_INFO, "[xds_client %p] returning cached listener data for %s",
1943
- this, listener_name_str.c_str());
2097
+ auto resource = XdsApi::ParseResourceName(listener_name, XdsApi::IsLds);
2098
+ if (!resource.ok()) {
2099
+ {
2100
+ MutexLock lock(&mu_);
2101
+ invalid_listener_watchers_[w] = watcher;
2102
+ }
2103
+ grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
2104
+ "Unable to parse resource name for listener %s", listener_name));
2105
+ work_serializer_.Run(
2106
+ // TODO(yashykt): When we move to C++14, capture watcher using
2107
+ // std::move()
2108
+ [watcher, error]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) {
2109
+ watcher->OnError(error);
2110
+ },
2111
+ DEBUG_LOCATION);
2112
+ return;
2113
+ }
2114
+ {
2115
+ MutexLock lock(&mu_);
2116
+ AuthorityState& authority_state = authority_state_map_[resource->authority];
2117
+ ListenerState& listener_state = authority_state.listener_map[resource->id];
2118
+ listener_state.watchers[w] = watcher;
2119
+ // If we've already received an LDS update, notify the new watcher
2120
+ // immediately.
2121
+ if (listener_state.update.has_value()) {
2122
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
2123
+ gpr_log(GPR_INFO,
2124
+ "[xds_client %p] returning cached listener data for %s", this,
2125
+ listener_name_str.c_str());
2126
+ }
2127
+ auto& value = listener_state.update.value();
2128
+ work_serializer_.Schedule(
2129
+ // TODO(yashykt): When we move to C++14, capture watcher using
2130
+ // std::move()
2131
+ [watcher, value]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_) {
2132
+ watcher->OnListenerChanged(value);
2133
+ },
2134
+ DEBUG_LOCATION);
1944
2135
  }
1945
- w->OnListenerChanged(*listener_state.update);
2136
+ // If the authority doesn't yet have a channel, set it, creating it if
2137
+ // needed.
2138
+ if (authority_state.channel_state == nullptr) {
2139
+ authority_state.channel_state =
2140
+ GetOrCreateChannelStateLocked(bootstrap_->server());
2141
+ }
2142
+ authority_state.channel_state->SubscribeLocked(XdsApi::kLdsTypeUrl,
2143
+ *resource);
1946
2144
  }
1947
- chand_->SubscribeLocked(XdsApi::kLdsTypeUrl, listener_name_str);
2145
+ work_serializer_.DrainQueue();
1948
2146
  }
1949
2147
 
1950
2148
  void XdsClient::CancelListenerDataWatch(absl::string_view listener_name,
@@ -1952,39 +2150,79 @@ void XdsClient::CancelListenerDataWatch(absl::string_view listener_name,
1952
2150
  bool delay_unsubscription) {
1953
2151
  MutexLock lock(&mu_);
1954
2152
  if (shutting_down_) return;
1955
- std::string listener_name_str = std::string(listener_name);
1956
- ListenerState& listener_state = listener_map_[listener_name_str];
2153
+ auto resource = XdsApi::ParseResourceName(listener_name, XdsApi::IsLds);
2154
+ if (!resource.ok()) return;
2155
+ auto& authority_state = authority_state_map_[resource->authority];
2156
+ ListenerState& listener_state = authority_state.listener_map[resource->id];
1957
2157
  auto it = listener_state.watchers.find(watcher);
1958
- if (it != listener_state.watchers.end()) {
1959
- listener_state.watchers.erase(it);
1960
- if (listener_state.watchers.empty()) {
1961
- listener_map_.erase(listener_name_str);
1962
- chand_->UnsubscribeLocked(XdsApi::kLdsTypeUrl, listener_name_str,
1963
- delay_unsubscription);
1964
- }
2158
+ if (it == listener_state.watchers.end()) {
2159
+ invalid_listener_watchers_.erase(watcher);
2160
+ return;
2161
+ }
2162
+ listener_state.watchers.erase(it);
2163
+ if (!listener_state.watchers.empty()) return;
2164
+ authority_state.listener_map.erase(resource->id);
2165
+ xds_server_channel_map_[bootstrap_->server()]->UnsubscribeLocked(
2166
+ XdsApi::kLdsTypeUrl, *resource, delay_unsubscription);
2167
+ if (!authority_state.HasSubscribedResources()) {
2168
+ authority_state.channel_state.reset();
1965
2169
  }
1966
2170
  }
1967
2171
 
1968
2172
  void XdsClient::WatchRouteConfigData(
1969
2173
  absl::string_view route_config_name,
1970
- std::unique_ptr<RouteConfigWatcherInterface> watcher) {
2174
+ RefCountedPtr<RouteConfigWatcherInterface> watcher) {
1971
2175
  std::string route_config_name_str = std::string(route_config_name);
1972
- MutexLock lock(&mu_);
1973
- RouteConfigState& route_config_state =
1974
- route_config_map_[route_config_name_str];
1975
2176
  RouteConfigWatcherInterface* w = watcher.get();
1976
- route_config_state.watchers[w] = std::move(watcher);
1977
- // If we've already received an RDS update, notify the new watcher
1978
- // immediately.
1979
- if (route_config_state.update.has_value()) {
1980
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
1981
- gpr_log(GPR_INFO,
1982
- "[xds_client %p] returning cached route config data for %s", this,
1983
- route_config_name_str.c_str());
2177
+ auto resource = XdsApi::ParseResourceName(route_config_name, XdsApi::IsRds);
2178
+ if (!resource.ok()) {
2179
+ {
2180
+ MutexLock lock(&mu_);
2181
+ invalid_route_config_watchers_[w] = watcher;
2182
+ }
2183
+ grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
2184
+ absl::StrFormat("Unable to parse resource name for route config %s",
2185
+ route_config_name));
2186
+ work_serializer_.Run(
2187
+ // TODO(yashykt): When we move to C++14, capture watcher using
2188
+ // std::move()
2189
+ [watcher, error]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) {
2190
+ watcher->OnError(error);
2191
+ },
2192
+ DEBUG_LOCATION);
2193
+ return;
2194
+ }
2195
+ {
2196
+ MutexLock lock(&mu_);
2197
+ auto& authority_state = authority_state_map_[resource->authority];
2198
+ RouteConfigState& route_config_state =
2199
+ authority_state.route_config_map[resource->id];
2200
+ route_config_state.watchers[w] = watcher;
2201
+ // If we've already received an RDS update, notify the new watcher
2202
+ // immediately.
2203
+ if (route_config_state.update.has_value()) {
2204
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
2205
+ gpr_log(GPR_INFO,
2206
+ "[xds_client %p] returning cached route config data for %s",
2207
+ this, route_config_name_str.c_str());
2208
+ }
2209
+ auto& value = route_config_state.update.value();
2210
+ work_serializer_.Schedule(
2211
+ [watcher, value]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_) {
2212
+ watcher->OnRouteConfigChanged(value);
2213
+ },
2214
+ DEBUG_LOCATION);
1984
2215
  }
1985
- w->OnRouteConfigChanged(*route_config_state.update);
2216
+ // If the authority doesn't yet have a channel, set it, creating it if
2217
+ // needed.
2218
+ if (authority_state.channel_state == nullptr) {
2219
+ authority_state.channel_state =
2220
+ GetOrCreateChannelStateLocked(bootstrap_->server());
2221
+ }
2222
+ authority_state.channel_state->SubscribeLocked(XdsApi::kRdsTypeUrl,
2223
+ *resource);
1986
2224
  }
1987
- chand_->SubscribeLocked(XdsApi::kRdsTypeUrl, route_config_name_str);
2225
+ work_serializer_.DrainQueue();
1988
2226
  }
1989
2227
 
1990
2228
  void XdsClient::CancelRouteConfigDataWatch(absl::string_view route_config_name,
@@ -1992,38 +2230,76 @@ void XdsClient::CancelRouteConfigDataWatch(absl::string_view route_config_name,
1992
2230
  bool delay_unsubscription) {
1993
2231
  MutexLock lock(&mu_);
1994
2232
  if (shutting_down_) return;
1995
- std::string route_config_name_str = std::string(route_config_name);
2233
+ auto resource = XdsApi::ParseResourceName(route_config_name, XdsApi::IsRds);
2234
+ if (!resource.ok()) return;
2235
+ auto& authority_state = authority_state_map_[resource->authority];
1996
2236
  RouteConfigState& route_config_state =
1997
- route_config_map_[route_config_name_str];
2237
+ authority_state.route_config_map[resource->id];
1998
2238
  auto it = route_config_state.watchers.find(watcher);
1999
- if (it != route_config_state.watchers.end()) {
2000
- route_config_state.watchers.erase(it);
2001
- if (route_config_state.watchers.empty()) {
2002
- route_config_map_.erase(route_config_name_str);
2003
- chand_->UnsubscribeLocked(XdsApi::kRdsTypeUrl, route_config_name_str,
2004
- delay_unsubscription);
2005
- }
2239
+ if (it == route_config_state.watchers.end()) {
2240
+ invalid_route_config_watchers_.erase(watcher);
2241
+ return;
2242
+ }
2243
+ route_config_state.watchers.erase(it);
2244
+ if (!route_config_state.watchers.empty()) return;
2245
+ authority_state.route_config_map.erase(resource->id);
2246
+ xds_server_channel_map_[bootstrap_->server()]->UnsubscribeLocked(
2247
+ XdsApi::kRdsTypeUrl, *resource, delay_unsubscription);
2248
+ if (!authority_state.HasSubscribedResources()) {
2249
+ authority_state.channel_state.reset();
2006
2250
  }
2007
2251
  }
2008
2252
 
2009
2253
  void XdsClient::WatchClusterData(
2010
2254
  absl::string_view cluster_name,
2011
- std::unique_ptr<ClusterWatcherInterface> watcher) {
2255
+ RefCountedPtr<ClusterWatcherInterface> watcher) {
2012
2256
  std::string cluster_name_str = std::string(cluster_name);
2013
- MutexLock lock(&mu_);
2014
- ClusterState& cluster_state = cluster_map_[cluster_name_str];
2015
2257
  ClusterWatcherInterface* w = watcher.get();
2016
- cluster_state.watchers[w] = std::move(watcher);
2017
- // If we've already received a CDS update, notify the new watcher
2018
- // immediately.
2019
- if (cluster_state.update.has_value()) {
2020
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
2021
- gpr_log(GPR_INFO, "[xds_client %p] returning cached cluster data for %s",
2022
- this, cluster_name_str.c_str());
2258
+ auto resource = XdsApi::ParseResourceName(cluster_name, XdsApi::IsCds);
2259
+ if (!resource.ok()) {
2260
+ {
2261
+ MutexLock lock(&mu_);
2262
+ invalid_cluster_watchers_[w] = watcher;
2263
+ }
2264
+ grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
2265
+ "Unable to parse resource name for cluster %s", cluster_name));
2266
+ work_serializer_.Run([watcher, error]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(
2267
+ work_serializer_) { watcher->OnError(error); },
2268
+ DEBUG_LOCATION);
2269
+ return;
2270
+ }
2271
+ {
2272
+ MutexLock lock(&mu_);
2273
+ auto& authority_state = authority_state_map_[resource->authority];
2274
+ ClusterState& cluster_state = authority_state.cluster_map[resource->id];
2275
+ cluster_state.watchers[w] = watcher;
2276
+ // If we've already received a CDS update, notify the new watcher
2277
+ // immediately.
2278
+ if (cluster_state.update.has_value()) {
2279
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
2280
+ gpr_log(GPR_INFO,
2281
+ "[xds_client %p] returning cached cluster data for %s", this,
2282
+ cluster_name_str.c_str());
2283
+ }
2284
+ auto& value = cluster_state.update.value();
2285
+ work_serializer_.Schedule(
2286
+ // TODO(yashykt): When we move to C++14, capture watcher using
2287
+ // std::move()
2288
+ [watcher, value]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_) {
2289
+ watcher->OnClusterChanged(value);
2290
+ },
2291
+ DEBUG_LOCATION);
2292
+ }
2293
+ // If the authority doesn't yet have a channel, set it, creating it if
2294
+ // needed.
2295
+ if (authority_state.channel_state == nullptr) {
2296
+ authority_state.channel_state =
2297
+ GetOrCreateChannelStateLocked(bootstrap_->server());
2023
2298
  }
2024
- w->OnClusterChanged(cluster_state.update.value());
2299
+ authority_state.channel_state->SubscribeLocked(XdsApi::kCdsTypeUrl,
2300
+ *resource);
2025
2301
  }
2026
- chand_->SubscribeLocked(XdsApi::kCdsTypeUrl, cluster_name_str);
2302
+ work_serializer_.DrainQueue();
2027
2303
  }
2028
2304
 
2029
2305
  void XdsClient::CancelClusterDataWatch(absl::string_view cluster_name,
@@ -2031,37 +2307,74 @@ void XdsClient::CancelClusterDataWatch(absl::string_view cluster_name,
2031
2307
  bool delay_unsubscription) {
2032
2308
  MutexLock lock(&mu_);
2033
2309
  if (shutting_down_) return;
2034
- std::string cluster_name_str = std::string(cluster_name);
2035
- ClusterState& cluster_state = cluster_map_[cluster_name_str];
2310
+ auto resource = XdsApi::ParseResourceName(cluster_name, XdsApi::IsCds);
2311
+ if (!resource.ok()) return;
2312
+ auto& authority_state = authority_state_map_[resource->authority];
2313
+ ClusterState& cluster_state = authority_state.cluster_map[resource->id];
2036
2314
  auto it = cluster_state.watchers.find(watcher);
2037
- if (it != cluster_state.watchers.end()) {
2038
- cluster_state.watchers.erase(it);
2039
- if (cluster_state.watchers.empty()) {
2040
- cluster_map_.erase(cluster_name_str);
2041
- chand_->UnsubscribeLocked(XdsApi::kCdsTypeUrl, cluster_name_str,
2042
- delay_unsubscription);
2043
- }
2315
+ if (it == cluster_state.watchers.end()) {
2316
+ invalid_cluster_watchers_.erase(watcher);
2317
+ return;
2318
+ }
2319
+ cluster_state.watchers.erase(it);
2320
+ if (!cluster_state.watchers.empty()) return;
2321
+ authority_state.cluster_map.erase(resource->id);
2322
+ xds_server_channel_map_[bootstrap_->server()]->UnsubscribeLocked(
2323
+ XdsApi::kCdsTypeUrl, *resource, delay_unsubscription);
2324
+ if (!authority_state.HasSubscribedResources()) {
2325
+ authority_state.channel_state.reset();
2044
2326
  }
2045
2327
  }
2046
2328
 
2047
2329
  void XdsClient::WatchEndpointData(
2048
2330
  absl::string_view eds_service_name,
2049
- std::unique_ptr<EndpointWatcherInterface> watcher) {
2331
+ RefCountedPtr<EndpointWatcherInterface> watcher) {
2050
2332
  std::string eds_service_name_str = std::string(eds_service_name);
2051
- MutexLock lock(&mu_);
2052
- EndpointState& endpoint_state = endpoint_map_[eds_service_name_str];
2053
2333
  EndpointWatcherInterface* w = watcher.get();
2054
- endpoint_state.watchers[w] = std::move(watcher);
2055
- // If we've already received an EDS update, notify the new watcher
2056
- // immediately.
2057
- if (endpoint_state.update.has_value()) {
2058
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
2059
- gpr_log(GPR_INFO, "[xds_client %p] returning cached endpoint data for %s",
2060
- this, eds_service_name_str.c_str());
2334
+ auto resource = XdsApi::ParseResourceName(eds_service_name, XdsApi::IsEds);
2335
+ if (!resource.ok()) {
2336
+ {
2337
+ MutexLock lock(&mu_);
2338
+ invalid_endpoint_watchers_[w] = watcher;
2339
+ }
2340
+ grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
2341
+ absl::StrFormat("Unable to parse resource name for endpoint service %s",
2342
+ eds_service_name));
2343
+ work_serializer_.Run([watcher, error]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(
2344
+ work_serializer_) { watcher->OnError(error); },
2345
+ DEBUG_LOCATION);
2346
+ return;
2347
+ }
2348
+ {
2349
+ MutexLock lock(&mu_);
2350
+ auto& authority_state = authority_state_map_[resource->authority];
2351
+ EndpointState& endpoint_state = authority_state.endpoint_map[resource->id];
2352
+ endpoint_state.watchers[w] = watcher;
2353
+ // If we've already received an EDS update, notify the new watcher
2354
+ // immediately.
2355
+ if (endpoint_state.update.has_value()) {
2356
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
2357
+ gpr_log(GPR_INFO,
2358
+ "[xds_client %p] returning cached endpoint data for %s", this,
2359
+ eds_service_name_str.c_str());
2360
+ }
2361
+ auto& value = endpoint_state.update.value();
2362
+ work_serializer_.Schedule(
2363
+ [watcher, value]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_) {
2364
+ watcher->OnEndpointChanged(value);
2365
+ },
2366
+ DEBUG_LOCATION);
2367
+ }
2368
+ // If the authority doesn't yet have a channel, set it, creating it if
2369
+ // needed.
2370
+ if (authority_state.channel_state == nullptr) {
2371
+ authority_state.channel_state =
2372
+ GetOrCreateChannelStateLocked(bootstrap_->server());
2061
2373
  }
2062
- w->OnEndpointChanged(endpoint_state.update.value());
2374
+ authority_state.channel_state->SubscribeLocked(XdsApi::kEdsTypeUrl,
2375
+ *resource);
2063
2376
  }
2064
- chand_->SubscribeLocked(XdsApi::kEdsTypeUrl, eds_service_name_str);
2377
+ work_serializer_.DrainQueue();
2065
2378
  }
2066
2379
 
2067
2380
  void XdsClient::CancelEndpointDataWatch(absl::string_view eds_service_name,
@@ -2069,16 +2382,22 @@ void XdsClient::CancelEndpointDataWatch(absl::string_view eds_service_name,
2069
2382
  bool delay_unsubscription) {
2070
2383
  MutexLock lock(&mu_);
2071
2384
  if (shutting_down_) return;
2072
- std::string eds_service_name_str = std::string(eds_service_name);
2073
- EndpointState& endpoint_state = endpoint_map_[eds_service_name_str];
2385
+ auto resource = XdsApi::ParseResourceName(eds_service_name, XdsApi::IsEds);
2386
+ if (!resource.ok()) return;
2387
+ auto& authority_state = authority_state_map_[resource->authority];
2388
+ EndpointState& endpoint_state = authority_state.endpoint_map[resource->id];
2074
2389
  auto it = endpoint_state.watchers.find(watcher);
2075
- if (it != endpoint_state.watchers.end()) {
2076
- endpoint_state.watchers.erase(it);
2077
- if (endpoint_state.watchers.empty()) {
2078
- endpoint_map_.erase(eds_service_name_str);
2079
- chand_->UnsubscribeLocked(XdsApi::kEdsTypeUrl, eds_service_name_str,
2080
- delay_unsubscription);
2081
- }
2390
+ if (it == endpoint_state.watchers.end()) {
2391
+ invalid_endpoint_watchers_.erase(watcher);
2392
+ return;
2393
+ }
2394
+ endpoint_state.watchers.erase(it);
2395
+ if (!endpoint_state.watchers.empty()) return;
2396
+ authority_state.endpoint_map.erase(resource->id);
2397
+ xds_server_channel_map_[bootstrap_->server()]->UnsubscribeLocked(
2398
+ XdsApi::kEdsTypeUrl, *resource, delay_unsubscription);
2399
+ if (!authority_state.HasSubscribedResources()) {
2400
+ authority_state.channel_state.reset();
2082
2401
  }
2083
2402
  }
2084
2403
 
@@ -2112,7 +2431,12 @@ RefCountedPtr<XdsClusterDropStats> XdsClient::AddClusterDropStats(
2112
2431
  it->first.second /*eds_service_name*/);
2113
2432
  load_report_state.drop_stats = cluster_drop_stats.get();
2114
2433
  }
2115
- chand_->MaybeStartLrsCall();
2434
+ auto resource = XdsApi::ParseResourceName(cluster_name, XdsApi::IsCds);
2435
+ GPR_ASSERT(resource.ok());
2436
+ auto a = authority_state_map_.find(resource->authority);
2437
+ if (a != authority_state_map_.end()) {
2438
+ a->second.channel_state->MaybeStartLrsCall();
2439
+ }
2116
2440
  return cluster_drop_stats;
2117
2441
  }
2118
2442
 
@@ -2169,7 +2493,12 @@ RefCountedPtr<XdsClusterLocalityStats> XdsClient::AddClusterLocalityStats(
2169
2493
  std::move(locality));
2170
2494
  locality_state.locality_stats = cluster_locality_stats.get();
2171
2495
  }
2172
- chand_->MaybeStartLrsCall();
2496
+ auto resource = XdsApi::ParseResourceName(cluster_name, XdsApi::IsCds);
2497
+ GPR_ASSERT(resource.ok());
2498
+ auto a = authority_state_map_.find(resource->authority);
2499
+ if (a != authority_state_map_.end()) {
2500
+ a->second.channel_state->MaybeStartLrsCall();
2501
+ }
2173
2502
  return cluster_locality_stats;
2174
2503
  }
2175
2504
 
@@ -2199,37 +2528,63 @@ void XdsClient::RemoveClusterLocalityStats(
2199
2528
 
2200
2529
  void XdsClient::ResetBackoff() {
2201
2530
  MutexLock lock(&mu_);
2202
- if (chand_ != nullptr) {
2203
- grpc_channel_reset_connect_backoff(chand_->channel());
2531
+ for (auto& p : xds_server_channel_map_) {
2532
+ grpc_channel_reset_connect_backoff(p.second->channel());
2204
2533
  }
2205
2534
  }
2206
2535
 
2207
2536
  void XdsClient::NotifyOnErrorLocked(grpc_error_handle error) {
2208
- for (const auto& p : listener_map_) {
2209
- const ListenerState& listener_state = p.second;
2210
- for (const auto& p : listener_state.watchers) {
2211
- p.first->OnError(GRPC_ERROR_REF(error));
2537
+ std::set<RefCountedPtr<ListenerWatcherInterface>> listener_watchers;
2538
+ std::set<RefCountedPtr<RouteConfigWatcherInterface>> route_config_watchers;
2539
+ std::set<RefCountedPtr<ClusterWatcherInterface>> cluster_watchers;
2540
+ std::set<RefCountedPtr<EndpointWatcherInterface>> endpoint_watchers;
2541
+ for (const auto& a : authority_state_map_) {
2542
+ for (const auto& p : a.second.listener_map) {
2543
+ const ListenerState& listener_state = p.second;
2544
+ for (const auto& q : listener_state.watchers) {
2545
+ listener_watchers.insert(q.second);
2546
+ }
2212
2547
  }
2213
- }
2214
- for (const auto& p : route_config_map_) {
2215
- const RouteConfigState& route_config_state = p.second;
2216
- for (const auto& p : route_config_state.watchers) {
2217
- p.first->OnError(GRPC_ERROR_REF(error));
2548
+ for (const auto& p : a.second.route_config_map) {
2549
+ const RouteConfigState& route_config_state = p.second;
2550
+ for (const auto& q : route_config_state.watchers) {
2551
+ route_config_watchers.insert(q.second);
2552
+ }
2218
2553
  }
2219
- }
2220
- for (const auto& p : cluster_map_) {
2221
- const ClusterState& cluster_state = p.second;
2222
- for (const auto& p : cluster_state.watchers) {
2223
- p.first->OnError(GRPC_ERROR_REF(error));
2554
+ for (const auto& p : a.second.cluster_map) {
2555
+ const ClusterState& cluster_state = p.second;
2556
+ for (const auto& q : cluster_state.watchers) {
2557
+ cluster_watchers.insert(q.second);
2558
+ }
2224
2559
  }
2225
- }
2226
- for (const auto& p : endpoint_map_) {
2227
- const EndpointState& endpoint_state = p.second;
2228
- for (const auto& p : endpoint_state.watchers) {
2229
- p.first->OnError(GRPC_ERROR_REF(error));
2560
+ for (const auto& p : a.second.endpoint_map) {
2561
+ const EndpointState& endpoint_state = p.second;
2562
+ for (const auto& q : endpoint_state.watchers) {
2563
+ endpoint_watchers.insert(q.second);
2564
+ }
2230
2565
  }
2231
2566
  }
2232
- GRPC_ERROR_UNREF(error);
2567
+ work_serializer_.Schedule(
2568
+ // TODO(yashykt): When we move to C++14, capture *_watchers using
2569
+ // std::move()
2570
+ [listener_watchers, route_config_watchers, cluster_watchers,
2571
+ endpoint_watchers, error]()
2572
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_) {
2573
+ for (const auto& watcher : listener_watchers) {
2574
+ watcher->OnError(GRPC_ERROR_REF(error));
2575
+ }
2576
+ for (const auto& watcher : route_config_watchers) {
2577
+ watcher->OnError(GRPC_ERROR_REF(error));
2578
+ }
2579
+ for (const auto& watcher : cluster_watchers) {
2580
+ watcher->OnError(GRPC_ERROR_REF(error));
2581
+ }
2582
+ for (const auto& watcher : endpoint_watchers) {
2583
+ watcher->OnError(GRPC_ERROR_REF(error));
2584
+ }
2585
+ GRPC_ERROR_UNREF(error);
2586
+ },
2587
+ DEBUG_LOCATION);
2233
2588
  }
2234
2589
 
2235
2590
  XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked(
@@ -2316,34 +2671,36 @@ XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked(
2316
2671
  std::string XdsClient::DumpClientConfigBinary() {
2317
2672
  MutexLock lock(&mu_);
2318
2673
  XdsApi::ResourceTypeMetadataMap resource_type_metadata_map;
2319
- // Update per-xds-type version if available, this version corresponding to the
2320
- // last successful ADS update version.
2321
- for (auto& p : resource_version_map_) {
2322
- resource_type_metadata_map[p.first].version = p.second;
2323
- }
2324
- // Collect resource metadata from listeners
2325
- auto& lds_map =
2326
- resource_type_metadata_map[XdsApi::kLdsTypeUrl].resource_metadata_map;
2327
- for (auto& p : listener_map_) {
2328
- lds_map[p.first] = &p.second.meta;
2329
- }
2330
- // Collect resource metadata from route configs
2331
- auto& rds_map =
2332
- resource_type_metadata_map[XdsApi::kRdsTypeUrl].resource_metadata_map;
2333
- for (auto& p : route_config_map_) {
2334
- rds_map[p.first] = &p.second.meta;
2335
- }
2336
- // Collect resource metadata from clusters
2337
- auto& cds_map =
2338
- resource_type_metadata_map[XdsApi::kCdsTypeUrl].resource_metadata_map;
2339
- for (auto& p : cluster_map_) {
2340
- cds_map[p.first] = &p.second.meta;
2341
- }
2342
- // Collect resource metadata from endpoints
2343
- auto& eds_map =
2344
- resource_type_metadata_map[XdsApi::kEdsTypeUrl].resource_metadata_map;
2345
- for (auto& p : endpoint_map_) {
2346
- eds_map[p.first] = &p.second.meta;
2674
+ auto& lds_map = resource_type_metadata_map[XdsApi::kLdsTypeUrl];
2675
+ auto& rds_map = resource_type_metadata_map[XdsApi::kRdsTypeUrl];
2676
+ auto& cds_map = resource_type_metadata_map[XdsApi::kCdsTypeUrl];
2677
+ auto& eds_map = resource_type_metadata_map[XdsApi::kEdsTypeUrl];
2678
+ for (auto& a : authority_state_map_) {
2679
+ const std::string& authority = a.first;
2680
+ // Collect resource metadata from listeners
2681
+ for (auto& p : a.second.listener_map) {
2682
+ const std::string& listener_name = p.first;
2683
+ lds_map[XdsApi::ConstructFullResourceName(
2684
+ authority, XdsApi::kLdsTypeUrl, listener_name)] = &p.second.meta;
2685
+ }
2686
+ // Collect resource metadata from route configs
2687
+ for (auto& p : a.second.route_config_map) {
2688
+ const std::string& route_config_name = p.first;
2689
+ rds_map[XdsApi::ConstructFullResourceName(
2690
+ authority, XdsApi::kRdsTypeUrl, route_config_name)] = &p.second.meta;
2691
+ }
2692
+ // Collect resource metadata from clusters
2693
+ for (auto& p : a.second.cluster_map) {
2694
+ const std::string& cluster_name = p.first;
2695
+ cds_map[XdsApi::ConstructFullResourceName(authority, XdsApi::kCdsTypeUrl,
2696
+ cluster_name)] = &p.second.meta;
2697
+ }
2698
+ // Collect resource metadata from endpoints
2699
+ for (auto& p : a.second.endpoint_map) {
2700
+ const std::string& endpoint_name = p.first;
2701
+ eds_map[XdsApi::ConstructFullResourceName(
2702
+ authority, XdsApi::kEdsTypeUrl, endpoint_name)] = &p.second.meta;
2703
+ }
2347
2704
  }
2348
2705
  // Assemble config dump messages
2349
2706
  return api_.AssembleClientConfig(resource_type_metadata_map);
@@ -2373,7 +2730,7 @@ namespace {
2373
2730
  std::string GetBootstrapContents(const char* fallback_config,
2374
2731
  grpc_error_handle* error) {
2375
2732
  // First, try GRPC_XDS_BOOTSTRAP env var.
2376
- grpc_core::UniquePtr<char> path(gpr_getenv("GRPC_XDS_BOOTSTRAP"));
2733
+ UniquePtr<char> path(gpr_getenv("GRPC_XDS_BOOTSTRAP"));
2377
2734
  if (path != nullptr) {
2378
2735
  if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
2379
2736
  gpr_log(GPR_INFO,
@@ -2390,8 +2747,7 @@ std::string GetBootstrapContents(const char* fallback_config,
2390
2747
  return contents_str;
2391
2748
  }
2392
2749
  // Next, try GRPC_XDS_BOOTSTRAP_CONFIG env var.
2393
- grpc_core::UniquePtr<char> env_config(
2394
- gpr_getenv("GRPC_XDS_BOOTSTRAP_CONFIG"));
2750
+ UniquePtr<char> env_config(gpr_getenv("GRPC_XDS_BOOTSTRAP_CONFIG"));
2395
2751
  if (env_config != nullptr) {
2396
2752
  if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
2397
2753
  gpr_log(GPR_INFO,
@@ -2501,7 +2857,7 @@ void XdsClientArgDestroy(void* p) {
2501
2857
  xds_client->Unref(DEBUG_LOCATION, "channel arg");
2502
2858
  }
2503
2859
 
2504
- int XdsClientArgCmp(void* p, void* q) { return GPR_ICMP(p, q); }
2860
+ int XdsClientArgCmp(void* p, void* q) { return QsortCompare(p, q); }
2505
2861
 
2506
2862
  const grpc_arg_pointer_vtable kXdsClientArgVtable = {
2507
2863
  XdsClientArgCopy, XdsClientArgDestroy, XdsClientArgCmp};