grpc 1.42.0 → 1.51.0

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 (2080) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +705 -451
  3. data/include/grpc/compression.h +1 -1
  4. data/include/grpc/event_engine/endpoint_config.h +11 -5
  5. data/include/grpc/event_engine/event_engine.h +122 -44
  6. data/include/grpc/event_engine/internal/memory_allocator_impl.h +1 -31
  7. data/include/grpc/event_engine/memory_allocator.h +27 -26
  8. data/include/grpc/event_engine/memory_request.h +57 -0
  9. data/include/grpc/event_engine/port.h +1 -1
  10. data/include/grpc/event_engine/slice.h +286 -0
  11. data/include/grpc/event_engine/slice_buffer.h +135 -0
  12. data/include/grpc/grpc.h +43 -27
  13. data/include/grpc/grpc_posix.h +20 -19
  14. data/include/grpc/grpc_security.h +323 -195
  15. data/include/grpc/grpc_security_constants.h +1 -14
  16. data/include/grpc/impl/codegen/atm_gcc_atomic.h +19 -28
  17. data/include/grpc/impl/codegen/atm_gcc_sync.h +0 -2
  18. data/include/grpc/impl/codegen/atm_windows.h +0 -2
  19. data/include/grpc/impl/codegen/compression_types.h +2 -3
  20. data/include/grpc/impl/codegen/connectivity_state.h +2 -1
  21. data/include/grpc/impl/codegen/gpr_types.h +2 -1
  22. data/include/grpc/impl/codegen/grpc_types.h +31 -30
  23. data/include/grpc/impl/codegen/port_platform.h +107 -47
  24. data/include/grpc/impl/codegen/slice.h +5 -2
  25. data/include/grpc/slice.h +0 -11
  26. data/src/core/ext/filters/census/grpc_context.cc +3 -0
  27. data/src/core/ext/filters/channel_idle/channel_idle_filter.cc +315 -0
  28. data/src/core/ext/filters/channel_idle/channel_idle_filter.h +142 -0
  29. data/src/core/ext/filters/channel_idle/idle_filter_state.cc +96 -0
  30. data/src/core/ext/filters/channel_idle/idle_filter_state.h +68 -0
  31. data/src/core/ext/filters/client_channel/backend_metric.cc +20 -16
  32. data/src/core/ext/filters/client_channel/backend_metric.h +19 -8
  33. data/src/core/ext/filters/client_channel/backup_poller.cc +23 -19
  34. data/src/core/ext/filters/client_channel/backup_poller.h +2 -4
  35. data/src/core/ext/filters/client_channel/channel_connectivity.cc +54 -30
  36. data/src/core/ext/filters/client_channel/client_channel.cc +684 -615
  37. data/src/core/ext/filters/client_channel/client_channel.h +103 -58
  38. data/src/core/ext/filters/client_channel/client_channel_channelz.cc +2 -6
  39. data/src/core/ext/filters/client_channel/client_channel_channelz.h +12 -2
  40. data/src/core/ext/filters/client_channel/client_channel_factory.cc +2 -26
  41. data/src/core/ext/filters/client_channel/client_channel_factory.h +8 -8
  42. data/src/core/ext/filters/client_channel/client_channel_plugin.cc +9 -41
  43. data/src/core/ext/filters/client_channel/client_channel_service_config.cc +153 -0
  44. data/src/core/ext/filters/client_channel/client_channel_service_config.h +111 -0
  45. data/src/core/ext/filters/client_channel/config_selector.cc +1 -0
  46. data/src/core/ext/filters/client_channel/config_selector.h +21 -11
  47. data/src/core/ext/filters/client_channel/connector.h +13 -8
  48. data/src/core/ext/filters/client_channel/dynamic_filters.cc +36 -51
  49. data/src/core/ext/filters/client_channel/dynamic_filters.h +19 -10
  50. data/src/core/ext/filters/client_channel/global_subchannel_pool.cc +4 -22
  51. data/src/core/ext/filters/client_channel/global_subchannel_pool.h +6 -15
  52. data/src/core/ext/filters/client_channel/health/health_check_client.cc +139 -583
  53. data/src/core/ext/filters/client_channel/health/health_check_client.h +26 -160
  54. data/src/core/ext/filters/client_channel/http_proxy.cc +96 -130
  55. data/src/core/ext/filters/client_channel/http_proxy.h +25 -1
  56. data/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc +12 -8
  57. data/src/core/ext/filters/client_channel/lb_policy/address_filtering.h +7 -5
  58. data/src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h +49 -0
  59. data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc +36 -15
  60. data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h +15 -9
  61. data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +21 -19
  62. data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h +1 -0
  63. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +380 -313
  64. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h +0 -7
  65. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc +15 -3
  66. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h +6 -2
  67. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc +2 -5
  68. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +8 -2
  69. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +26 -16
  70. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +10 -8
  71. data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.cc +415 -0
  72. data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.h +57 -0
  73. data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.cc +1152 -0
  74. data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.h +94 -0
  75. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +228 -207
  76. data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +491 -452
  77. data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +523 -391
  78. data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h +16 -6
  79. data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +636 -626
  80. data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +280 -254
  81. data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +147 -134
  82. data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +275 -223
  83. data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +266 -249
  84. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_attributes.cc +42 -0
  85. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_attributes.h +64 -0
  86. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +288 -277
  87. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +213 -182
  88. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +589 -737
  89. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_wrr_locality.cc +364 -0
  90. data/src/core/ext/filters/client_channel/local_subchannel_pool.cc +4 -0
  91. data/src/core/ext/filters/client_channel/local_subchannel_pool.h +1 -0
  92. data/src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc +43 -33
  93. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +676 -334
  94. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +30 -13
  95. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +29 -24
  96. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +51 -71
  97. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +358 -357
  98. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +55 -40
  99. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc +3 -2
  100. data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc +2 -0
  101. data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h +2 -1
  102. data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +124 -255
  103. data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +37 -49
  104. data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +18 -3
  105. data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +190 -102
  106. data/src/core/ext/filters/client_channel/resolver/polling_resolver.cc +258 -0
  107. data/src/core/ext/filters/client_channel/resolver/polling_resolver.h +123 -0
  108. data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +56 -61
  109. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +648 -503
  110. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h +3 -1
  111. data/src/core/ext/filters/client_channel/retry_filter.cc +382 -294
  112. data/src/core/ext/filters/client_channel/retry_filter.h +1 -0
  113. data/src/core/ext/filters/client_channel/retry_service_config.cc +198 -232
  114. data/src/core/ext/filters/client_channel/retry_service_config.h +41 -32
  115. data/src/core/ext/filters/client_channel/retry_throttle.cc +18 -39
  116. data/src/core/ext/filters/client_channel/retry_throttle.h +26 -13
  117. data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +37 -19
  118. data/src/core/ext/filters/client_channel/subchannel.cc +272 -319
  119. data/src/core/ext/filters/client_channel/subchannel.h +100 -47
  120. data/src/core/ext/filters/client_channel/subchannel_interface_internal.h +38 -0
  121. data/src/core/ext/filters/client_channel/subchannel_pool_interface.cc +17 -77
  122. data/src/core/ext/filters/client_channel/subchannel_pool_interface.h +20 -26
  123. data/src/core/ext/filters/client_channel/subchannel_stream_client.cc +470 -0
  124. data/src/core/ext/filters/client_channel/subchannel_stream_client.h +222 -0
  125. data/src/core/ext/filters/deadline/deadline_filter.cc +48 -39
  126. data/src/core/ext/filters/deadline/deadline_filter.h +11 -4
  127. data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +179 -403
  128. data/src/core/ext/filters/fault_injection/fault_injection_filter.h +38 -6
  129. data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.cc +118 -0
  130. data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.h +112 -0
  131. data/src/core/ext/filters/http/client/http_client_filter.cc +106 -551
  132. data/src/core/ext/filters/http/client/http_client_filter.h +35 -5
  133. data/src/core/ext/filters/http/client_authority_filter.cc +43 -112
  134. data/src/core/ext/filters/http/client_authority_filter.h +28 -6
  135. data/src/core/ext/filters/http/http_filters_plugin.cc +35 -28
  136. data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +112 -333
  137. data/src/core/ext/filters/http/message_compress/message_compress_filter.h +1 -2
  138. data/src/core/ext/filters/http/message_compress/message_decompress_filter.cc +85 -161
  139. data/src/core/ext/filters/http/message_compress/message_decompress_filter.h +1 -0
  140. data/src/core/ext/filters/http/server/http_server_filter.cc +100 -476
  141. data/src/core/ext/filters/http/server/http_server_filter.h +37 -3
  142. data/src/core/ext/filters/message_size/message_size_filter.cc +130 -159
  143. data/src/core/ext/filters/message_size/message_size_filter.h +41 -17
  144. data/src/core/ext/filters/rbac/rbac_filter.cc +174 -0
  145. data/src/core/ext/filters/rbac/rbac_filter.h +84 -0
  146. data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +819 -0
  147. data/src/core/ext/filters/rbac/rbac_service_config_parser.h +86 -0
  148. data/src/core/ext/filters/server_config_selector/server_config_selector.cc +62 -0
  149. data/src/core/ext/filters/server_config_selector/server_config_selector.h +85 -0
  150. data/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc +160 -0
  151. data/src/core/ext/filters/server_config_selector/server_config_selector_filter.h +33 -0
  152. data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +268 -110
  153. data/src/core/ext/transport/chttp2/client/chttp2_connector.h +9 -9
  154. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +387 -216
  155. data/src/core/ext/transport/chttp2/server/chttp2_server.h +5 -5
  156. data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +7 -7
  157. data/src/core/ext/transport/chttp2/transport/bin_decoder.h +2 -1
  158. data/src/core/ext/transport/chttp2/transport/bin_encoder.cc +2 -1
  159. data/src/core/ext/transport/chttp2/transport/bin_encoder.h +1 -1
  160. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +791 -1179
  161. data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +16 -5
  162. data/src/core/ext/transport/chttp2/transport/context_list.cc +6 -3
  163. data/src/core/ext/transport/chttp2/transport/context_list.h +6 -4
  164. data/src/core/ext/transport/chttp2/transport/decode_huff.cc +287 -0
  165. data/src/core/ext/transport/chttp2/transport/decode_huff.h +1018 -0
  166. data/src/core/ext/transport/chttp2/transport/flow_control.cc +297 -285
  167. data/src/core/ext/transport/chttp2/transport/flow_control.h +191 -293
  168. data/src/core/ext/transport/chttp2/transport/frame.h +0 -4
  169. data/src/core/ext/transport/chttp2/transport/frame_data.cc +66 -218
  170. data/src/core/ext/transport/chttp2/transport/frame_data.h +13 -36
  171. data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +16 -13
  172. data/src/core/ext/transport/chttp2/transport/frame_goaway.h +3 -1
  173. data/src/core/ext/transport/chttp2/transport/frame_ping.cc +12 -7
  174. data/src/core/ext/transport/chttp2/transport/frame_ping.h +3 -0
  175. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +21 -9
  176. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +3 -0
  177. data/src/core/ext/transport/chttp2/transport/frame_settings.cc +27 -59
  178. data/src/core/ext/transport/chttp2/transport/frame_settings.h +4 -0
  179. data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +15 -16
  180. data/src/core/ext/transport/chttp2/transport/frame_window_update.h +3 -0
  181. data/src/core/ext/transport/chttp2/transport/hpack_constants.h +7 -1
  182. data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +381 -260
  183. data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +106 -147
  184. data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc +5 -2
  185. data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h +12 -1
  186. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +157 -229
  187. data/src/core/ext/transport/chttp2/transport/hpack_parser.h +8 -2
  188. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +143 -42
  189. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +50 -50
  190. data/src/core/ext/transport/chttp2/transport/http2_settings.h +0 -1
  191. data/src/core/ext/transport/chttp2/transport/internal.h +74 -163
  192. data/src/core/ext/transport/chttp2/transport/parsing.cc +170 -91
  193. data/src/core/ext/transport/chttp2/transport/stream_lists.cc +11 -11
  194. data/src/core/ext/transport/chttp2/transport/stream_map.cc +1 -1
  195. data/src/core/ext/transport/chttp2/transport/stream_map.h +1 -0
  196. data/src/core/ext/transport/chttp2/transport/varint.cc +2 -3
  197. data/src/core/ext/transport/chttp2/transport/varint.h +13 -8
  198. data/src/core/ext/transport/chttp2/transport/writing.cc +150 -183
  199. data/src/core/ext/transport/inproc/inproc_plugin.cc +0 -5
  200. data/src/core/ext/transport/inproc/inproc_transport.cc +237 -323
  201. data/src/core/ext/transport/inproc/inproc_transport.h +4 -5
  202. data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c +117 -0
  203. data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h +502 -0
  204. data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c +121 -0
  205. data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h +569 -0
  206. data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c +60 -341
  207. data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h +280 -1355
  208. data/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.c +352 -0
  209. data/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.h +1768 -0
  210. data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c +56 -0
  211. data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h +159 -0
  212. data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c +64 -0
  213. data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h +189 -0
  214. data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c +46 -0
  215. data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h +128 -0
  216. data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c +43 -0
  217. data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h +106 -0
  218. data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c +43 -0
  219. data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h +101 -0
  220. data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c +106 -0
  221. data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h +613 -0
  222. data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c +48 -0
  223. data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h +107 -0
  224. data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c +43 -0
  225. data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +51 -0
  226. data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +30 -4
  227. data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +54 -17
  228. data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +143 -116
  229. data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +730 -385
  230. data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +241 -199
  231. data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +1360 -663
  232. data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c +49 -28
  233. data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h +213 -90
  234. data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +321 -271
  235. data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +1776 -826
  236. data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c +20 -7
  237. data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h +47 -23
  238. data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +60 -27
  239. data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +277 -98
  240. data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c +299 -0
  241. data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h +1437 -0
  242. data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +74 -53
  243. data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +383 -189
  244. data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c +21 -7
  245. data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h +50 -24
  246. data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +215 -176
  247. data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +1179 -583
  248. data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +105 -45
  249. data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +554 -166
  250. data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c +19 -6
  251. data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h +43 -23
  252. data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c +16 -22
  253. data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h +46 -100
  254. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c +58 -0
  255. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h +159 -0
  256. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +145 -117
  257. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +821 -409
  258. data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +141 -92
  259. data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +773 -348
  260. data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c +21 -8
  261. data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h +62 -30
  262. data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +204 -125
  263. data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +1068 -398
  264. data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +17 -4
  265. data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h +33 -16
  266. data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c +27 -13
  267. data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h +92 -48
  268. data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +22 -9
  269. data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +80 -33
  270. data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +26 -13
  271. data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +98 -48
  272. data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c +21 -8
  273. data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h +51 -25
  274. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +51 -35
  275. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h +207 -108
  276. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +74 -55
  277. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +374 -189
  278. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c +70 -53
  279. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h +378 -187
  280. data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c +19 -6
  281. data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h +39 -20
  282. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +122 -71
  283. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +660 -259
  284. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +104 -79
  285. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +589 -300
  286. data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +31 -16
  287. data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +109 -48
  288. data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +27 -10
  289. data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +98 -39
  290. data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c +53 -0
  291. data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h +140 -0
  292. data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c +82 -61
  293. data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h +446 -234
  294. data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c +86 -65
  295. data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h +443 -236
  296. data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +139 -103
  297. data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +649 -293
  298. data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +45 -41
  299. data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +255 -165
  300. data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +706 -570
  301. data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +4125 -1898
  302. data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c +38 -19
  303. data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h +161 -71
  304. data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c +241 -0
  305. data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h +1191 -0
  306. data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c +44 -0
  307. data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h +92 -0
  308. data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c +49 -0
  309. data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h +107 -0
  310. data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +27 -13
  311. data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h +86 -45
  312. data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c +52 -0
  313. data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h +138 -0
  314. data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c +63 -0
  315. data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h +254 -0
  316. data/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.c +46 -0
  317. data/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.h +98 -0
  318. data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c +47 -0
  319. data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h +98 -0
  320. data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c +69 -0
  321. data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h +221 -0
  322. data/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c +33 -0
  323. data/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h +43 -0
  324. data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c +71 -0
  325. data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h +226 -0
  326. data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c +54 -0
  327. data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h +150 -0
  328. data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c +17 -4
  329. data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +39 -23
  330. data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c +45 -28
  331. data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h +208 -111
  332. data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +51 -36
  333. data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +273 -131
  334. data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c +71 -0
  335. data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +237 -0
  336. data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +26 -13
  337. data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +91 -42
  338. data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +292 -224
  339. data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +1679 -733
  340. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.c +52 -0
  341. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h +168 -0
  342. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.c +46 -0
  343. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.h +98 -0
  344. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c +9 -0
  345. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h +6 -3
  346. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +107 -60
  347. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +607 -234
  348. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +41 -26
  349. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +169 -86
  350. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +126 -83
  351. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +651 -262
  352. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c +62 -0
  353. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h +168 -0
  354. data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c +15 -2
  355. data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h +26 -14
  356. data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +206 -72
  357. data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +1095 -255
  358. data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +31 -17
  359. data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h +116 -61
  360. data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c +74 -57
  361. data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h +368 -185
  362. data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c +48 -0
  363. data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h +116 -0
  364. data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c +34 -18
  365. data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h +140 -80
  366. data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c +74 -0
  367. data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h +230 -0
  368. data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c +28 -14
  369. data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h +108 -56
  370. data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c +21 -8
  371. data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h +55 -30
  372. data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c +20 -7
  373. data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h +53 -26
  374. data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c +19 -6
  375. data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h +43 -23
  376. data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +35 -20
  377. data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h +130 -68
  378. data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +31 -17
  379. data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h +132 -64
  380. data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c +26 -12
  381. data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h +94 -52
  382. data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c +37 -22
  383. data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h +163 -82
  384. data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c +50 -31
  385. data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h +258 -144
  386. data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c +53 -36
  387. data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h +256 -130
  388. data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c +66 -0
  389. data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h +213 -0
  390. data/src/core/ext/upb-generated/envoy/type/v3/http.upb.c +9 -0
  391. data/src/core/ext/upb-generated/envoy/type/v3/http.upb.h +3 -0
  392. data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c +42 -0
  393. data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h +143 -0
  394. data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c +23 -9
  395. data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h +71 -35
  396. data/src/core/ext/upb-generated/envoy/type/v3/range.upb.c +30 -15
  397. data/src/core/ext/upb-generated/envoy/type/v3/range.upb.h +111 -51
  398. data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_strategy.upb.c +63 -0
  399. data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_strategy.upb.h +202 -0
  400. data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.c +26 -0
  401. data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h +41 -0
  402. data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c +19 -6
  403. data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h +45 -18
  404. data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c +51 -0
  405. data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h +131 -0
  406. data/src/core/ext/upb-generated/google/api/annotations.upb.c +22 -0
  407. data/src/core/ext/upb-generated/google/api/annotations.upb.h +23 -0
  408. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c +154 -125
  409. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h +765 -381
  410. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +158 -126
  411. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +844 -401
  412. data/src/core/ext/upb-generated/google/api/http.upb.c +43 -28
  413. data/src/core/ext/upb-generated/google/api/http.upb.h +229 -114
  414. data/src/core/ext/upb-generated/google/api/httpbody.upb.c +46 -0
  415. data/src/core/ext/upb-generated/google/api/httpbody.upb.h +115 -0
  416. data/src/core/ext/upb-generated/google/protobuf/any.upb.c +18 -5
  417. data/src/core/ext/upb-generated/google/protobuf/any.upb.h +43 -21
  418. data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +374 -282
  419. data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +2199 -1029
  420. data/src/core/ext/upb-generated/google/protobuf/duration.upb.c +18 -5
  421. data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +41 -19
  422. data/src/core/ext/upb-generated/google/protobuf/empty.upb.c +15 -2
  423. data/src/core/ext/upb-generated/google/protobuf/empty.upb.h +26 -14
  424. data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +47 -31
  425. data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +190 -92
  426. data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +18 -5
  427. data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +41 -19
  428. data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +57 -36
  429. data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +277 -148
  430. data/src/core/ext/upb-generated/google/rpc/status.upb.c +21 -8
  431. data/src/core/ext/upb-generated/google/rpc/status.upb.h +57 -29
  432. data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c +84 -0
  433. data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h +335 -0
  434. data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +32 -18
  435. data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +108 -47
  436. data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +135 -107
  437. data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +726 -358
  438. data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c +27 -12
  439. data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +85 -40
  440. data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c +22 -8
  441. data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +65 -34
  442. data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +81 -61
  443. data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +435 -237
  444. data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c +34 -19
  445. data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h +124 -62
  446. data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c +175 -0
  447. data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h +792 -0
  448. data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +75 -13
  449. data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +206 -56
  450. data/src/core/ext/upb-generated/udpa/annotations/security.upb.c +31 -5
  451. data/src/core/ext/upb-generated/udpa/annotations/security.upb.h +59 -17
  452. data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c +21 -0
  453. data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +16 -0
  454. data/src/core/ext/upb-generated/udpa/annotations/status.upb.c +31 -5
  455. data/src/core/ext/upb-generated/udpa/annotations/status.upb.h +61 -19
  456. data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c +30 -4
  457. data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h +54 -17
  458. data/src/core/ext/upb-generated/validate/validate.upb.c +406 -310
  459. data/src/core/ext/upb-generated/validate/validate.upb.h +2822 -1164
  460. data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c +110 -0
  461. data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h +290 -0
  462. data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.c +55 -0
  463. data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.h +112 -0
  464. data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c +38 -0
  465. data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h +46 -0
  466. data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c +64 -17
  467. data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h +191 -67
  468. data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c +53 -0
  469. data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h +103 -0
  470. data/src/core/ext/upb-generated/xds/core/v3/authority.upb.c +17 -4
  471. data/src/core/ext/upb-generated/xds/core/v3/authority.upb.h +35 -18
  472. data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c +30 -16
  473. data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h +107 -54
  474. data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c +25 -11
  475. data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h +58 -29
  476. data/src/core/ext/upb-generated/xds/core/v3/extension.upb.c +46 -0
  477. data/src/core/ext/upb-generated/xds/core/v3/extension.upb.h +107 -0
  478. data/src/core/ext/upb-generated/xds/core/v3/resource.upb.c +22 -9
  479. data/src/core/ext/upb-generated/xds/core/v3/resource.upb.h +60 -29
  480. data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c +33 -19
  481. data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h +139 -69
  482. data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c +22 -9
  483. data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h +63 -29
  484. data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c +36 -21
  485. data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h +106 -45
  486. data/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.c +47 -0
  487. data/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.h +113 -0
  488. data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c +207 -0
  489. data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h +914 -0
  490. data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c +52 -0
  491. data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h +151 -0
  492. data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c +65 -0
  493. data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h +226 -0
  494. data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c +20 -7
  495. data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h +47 -23
  496. data/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.c +84 -0
  497. data/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.h +55 -0
  498. data/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c +127 -0
  499. data/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.h +50 -0
  500. data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c +75 -327
  501. data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h +16 -101
  502. data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.c +256 -0
  503. data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.h +115 -0
  504. data/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.c +43 -0
  505. data/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.h +40 -0
  506. data/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.c +56 -0
  507. data/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.h +40 -0
  508. data/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.c +49 -0
  509. data/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.h +35 -0
  510. data/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.c +46 -0
  511. data/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.h +35 -0
  512. data/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.c +46 -0
  513. data/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.h +35 -0
  514. data/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.c +142 -0
  515. data/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.h +40 -0
  516. data/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.c +51 -0
  517. data/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.h +35 -0
  518. data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c +10 -8
  519. data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h +1 -1
  520. data/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c +10 -13
  521. data/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h +4 -4
  522. data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c +120 -150
  523. data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h +46 -46
  524. data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +253 -280
  525. data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h +55 -55
  526. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c +60 -62
  527. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.h +10 -10
  528. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +387 -424
  529. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h +76 -76
  530. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c +16 -18
  531. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h +4 -4
  532. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c +25 -23
  533. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h +4 -4
  534. data/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.c +206 -0
  535. data/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.h +105 -0
  536. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c +17 -32
  537. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h +22 -22
  538. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c +17 -19
  539. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h +4 -4
  540. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +203 -246
  541. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h +73 -73
  542. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +140 -116
  543. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h +26 -16
  544. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c +16 -19
  545. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h +4 -4
  546. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c +24 -43
  547. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h +4 -9
  548. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.c +53 -0
  549. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.h +40 -0
  550. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c +23 -51
  551. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h +43 -43
  552. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +179 -187
  553. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h +30 -25
  554. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c +16 -19
  555. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h +4 -4
  556. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +254 -254
  557. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h +53 -43
  558. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c +14 -16
  559. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h +4 -4
  560. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c +16 -20
  561. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h +7 -7
  562. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c +16 -18
  563. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h +4 -4
  564. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c +26 -28
  565. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h +4 -4
  566. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c +15 -18
  567. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h +4 -4
  568. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c +20 -28
  569. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h +13 -13
  570. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +21 -33
  571. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h +19 -19
  572. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c +20 -30
  573. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h +16 -16
  574. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c +16 -18
  575. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h +4 -4
  576. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +180 -165
  577. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h +24 -19
  578. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c +155 -166
  579. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h +22 -22
  580. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c +21 -23
  581. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h +4 -4
  582. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c +46 -42
  583. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h +7 -7
  584. data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c +69 -0
  585. data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.h +35 -0
  586. data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c +19 -35
  587. data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h +25 -25
  588. data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c +19 -37
  589. data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h +28 -28
  590. data/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c +194 -0
  591. data/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h +75 -0
  592. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +82 -85
  593. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h +7 -12
  594. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +874 -917
  595. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h +170 -160
  596. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c +54 -48
  597. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h +10 -10
  598. data/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.c +199 -0
  599. data/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.h +90 -0
  600. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c +54 -0
  601. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.h +35 -0
  602. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.c +57 -0
  603. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.h +35 -0
  604. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c +17 -21
  605. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h +7 -7
  606. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.c +72 -0
  607. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.h +35 -0
  608. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.c +99 -0
  609. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.h +35 -0
  610. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opentelemetry.upbdefs.c +47 -0
  611. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opentelemetry.upbdefs.h +35 -0
  612. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.c +52 -0
  613. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.h +35 -0
  614. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.c +71 -0
  615. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.h +40 -0
  616. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.c +61 -0
  617. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.h +30 -0
  618. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.c +75 -0
  619. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.h +40 -0
  620. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c +77 -0
  621. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.h +35 -0
  622. data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c +17 -18
  623. data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h +4 -4
  624. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c +19 -29
  625. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h +16 -16
  626. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c +20 -26
  627. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h +10 -10
  628. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c +80 -0
  629. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h +40 -0
  630. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c +19 -20
  631. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h +4 -4
  632. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +405 -410
  633. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +63 -58
  634. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c +17 -13
  635. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h +1 -1
  636. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +174 -157
  637. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h +24 -19
  638. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c +21 -27
  639. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h +10 -10
  640. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +219 -216
  641. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h +24 -19
  642. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c +58 -0
  643. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h +40 -0
  644. data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c +16 -18
  645. data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h +4 -4
  646. data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c +162 -107
  647. data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h +57 -22
  648. data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c +18 -22
  649. data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h +7 -7
  650. data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c +125 -135
  651. data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h +16 -16
  652. data/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.c +46 -0
  653. data/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.h +35 -0
  654. data/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c +15 -23
  655. data/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h +13 -13
  656. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.c +52 -0
  657. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.h +50 -0
  658. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c +17 -21
  659. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h +7 -7
  660. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c +17 -19
  661. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h +4 -4
  662. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c +17 -19
  663. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h +4 -4
  664. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c +17 -19
  665. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.h +4 -4
  666. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c +38 -43
  667. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.h +10 -10
  668. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c +17 -21
  669. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.h +7 -7
  670. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c +16 -21
  671. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.h +7 -7
  672. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c +18 -24
  673. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h +10 -10
  674. data/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c +15 -29
  675. data/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h +22 -22
  676. data/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c +16 -26
  677. data/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h +16 -16
  678. data/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.c +53 -0
  679. data/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.h +45 -0
  680. data/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c +12 -10
  681. data/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h +1 -1
  682. data/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.c +94 -0
  683. data/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.h +35 -0
  684. data/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c +14 -19
  685. data/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h +7 -7
  686. data/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c +13 -19
  687. data/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h +10 -10
  688. data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_strategy.upbdefs.c +69 -0
  689. data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_strategy.upbdefs.h +40 -0
  690. data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c +38 -0
  691. data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.h +30 -0
  692. data/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c +13 -16
  693. data/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h +4 -4
  694. data/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.c +57 -0
  695. data/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.h +35 -0
  696. data/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c +7 -7
  697. data/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h +1 -1
  698. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c +154 -0
  699. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h +95 -0
  700. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c +153 -0
  701. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h +100 -0
  702. data/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c +5 -14
  703. data/src/core/ext/upbdefs-generated/google/api/http.upbdefs.h +10 -10
  704. data/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.c +39 -0
  705. data/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.h +35 -0
  706. data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c +5 -10
  707. data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h +4 -4
  708. data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c +96 -151
  709. data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h +82 -82
  710. data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c +5 -10
  711. data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h +4 -4
  712. data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c +5 -10
  713. data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h +4 -4
  714. data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c +5 -16
  715. data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h +13 -13
  716. data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c +5 -10
  717. data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h +4 -4
  718. data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c +5 -26
  719. data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h +28 -28
  720. data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c +6 -11
  721. data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h +4 -4
  722. data/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.c +67 -0
  723. data/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.h +50 -0
  724. data/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c +99 -0
  725. data/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h +75 -0
  726. data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c +6 -15
  727. data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h +10 -10
  728. data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c +7 -12
  729. data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h +4 -4
  730. data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c +6 -6
  731. data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h +1 -1
  732. data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c +6 -11
  733. data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h +4 -4
  734. data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c +6 -11
  735. data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h +4 -4
  736. data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c +8 -57
  737. data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.h +70 -70
  738. data/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.c +63 -0
  739. data/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.h +45 -0
  740. data/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.c +47 -0
  741. data/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.h +35 -0
  742. data/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.c +35 -0
  743. data/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.h +30 -0
  744. data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c +6 -17
  745. data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h +13 -13
  746. data/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.c +40 -0
  747. data/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.h +35 -0
  748. data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c +7 -12
  749. data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h +4 -4
  750. data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c +9 -16
  751. data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h +7 -7
  752. data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c +6 -13
  753. data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h +7 -7
  754. data/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.c +41 -0
  755. data/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.h +35 -0
  756. data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c +8 -13
  757. data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h +4 -4
  758. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c +8 -15
  759. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h +7 -7
  760. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c +8 -13
  761. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h +4 -4
  762. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.c +126 -0
  763. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.h +80 -0
  764. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.c +40 -0
  765. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.h +40 -0
  766. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.c +52 -0
  767. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.h +40 -0
  768. data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c +7 -12
  769. data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h +4 -4
  770. data/src/core/ext/xds/certificate_provider_store.cc +75 -3
  771. data/src/core/ext/xds/certificate_provider_store.h +28 -2
  772. data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +20 -14
  773. data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +11 -3
  774. data/src/core/ext/xds/upb_utils.h +45 -0
  775. data/src/core/ext/xds/xds_api.cc +329 -3648
  776. data/src/core/ext/xds/xds_api.h +78 -630
  777. data/src/core/ext/xds/xds_bootstrap.cc +10 -443
  778. data/src/core/ext/xds/xds_bootstrap.h +44 -81
  779. data/src/core/ext/xds/xds_bootstrap_grpc.cc +361 -0
  780. data/src/core/ext/xds/xds_bootstrap_grpc.h +184 -0
  781. data/src/core/ext/xds/xds_certificate_provider.cc +36 -25
  782. data/src/core/ext/xds/xds_certificate_provider.h +35 -3
  783. data/src/core/ext/xds/xds_channel_stack_modifier.cc +27 -21
  784. data/src/core/ext/xds/xds_channel_stack_modifier.h +17 -4
  785. data/src/core/ext/xds/xds_client.cc +1278 -2037
  786. data/src/core/ext/xds/xds_client.h +158 -197
  787. data/src/core/ext/xds/xds_client_grpc.cc +210 -0
  788. data/src/core/ext/xds/xds_client_grpc.h +79 -0
  789. data/src/core/ext/xds/xds_client_stats.cc +18 -19
  790. data/src/core/ext/xds/xds_client_stats.h +9 -7
  791. data/src/core/ext/xds/xds_cluster.cc +659 -0
  792. data/src/core/ext/xds/xds_cluster.h +116 -0
  793. data/src/core/ext/xds/xds_cluster_specifier_plugin.cc +152 -0
  794. data/src/core/ext/xds/xds_cluster_specifier_plugin.h +92 -0
  795. data/src/core/ext/xds/xds_common_types.cc +501 -0
  796. data/src/core/ext/xds/xds_common_types.h +108 -0
  797. data/src/core/ext/xds/xds_endpoint.cc +468 -0
  798. data/src/core/ext/xds/xds_endpoint.h +139 -0
  799. data/src/core/ext/xds/xds_http_fault_filter.cc +67 -59
  800. data/src/core/ext/xds/xds_http_fault_filter.h +18 -24
  801. data/src/core/ext/xds/xds_http_filters.cc +66 -66
  802. data/src/core/ext/xds/xds_http_filters.h +72 -24
  803. data/src/core/ext/xds/xds_http_rbac_filter.cc +505 -0
  804. data/src/core/ext/xds/xds_http_rbac_filter.h +58 -0
  805. data/src/core/ext/xds/xds_lb_policy_registry.cc +243 -0
  806. data/src/core/ext/xds/xds_lb_policy_registry.h +71 -0
  807. data/src/core/ext/xds/xds_listener.cc +1144 -0
  808. data/src/core/ext/xds/xds_listener.h +224 -0
  809. data/src/core/ext/xds/xds_resource_type.h +104 -0
  810. data/src/core/ext/xds/xds_resource_type_impl.h +86 -0
  811. data/src/core/ext/xds/xds_route_config.cc +1166 -0
  812. data/src/core/ext/xds/xds_route_config.h +241 -0
  813. data/src/core/ext/xds/xds_routing.cc +264 -0
  814. data/src/core/ext/xds/xds_routing.h +106 -0
  815. data/src/core/ext/xds/xds_server_config_fetcher.cc +1155 -324
  816. data/src/core/ext/xds/xds_transport.h +86 -0
  817. data/src/core/ext/xds/xds_transport_grpc.cc +356 -0
  818. data/src/core/ext/xds/xds_transport_grpc.h +135 -0
  819. data/src/core/lib/address_utils/parse_address.cc +36 -16
  820. data/src/core/lib/address_utils/parse_address.h +11 -2
  821. data/src/core/lib/address_utils/sockaddr_utils.cc +82 -51
  822. data/src/core/lib/address_utils/sockaddr_utils.h +9 -19
  823. data/src/core/lib/avl/avl.h +476 -88
  824. data/src/core/lib/backoff/backoff.cc +9 -40
  825. data/src/core/lib/backoff/backoff.h +12 -12
  826. data/src/core/lib/channel/call_finalization.h +88 -0
  827. data/src/core/lib/channel/call_tracer.h +16 -7
  828. data/src/core/lib/channel/channel_args.cc +274 -48
  829. data/src/core/lib/channel/channel_args.h +413 -12
  830. data/src/core/lib/channel/channel_args_preconditioning.cc +43 -0
  831. data/src/core/lib/channel/channel_args_preconditioning.h +62 -0
  832. data/src/core/lib/channel/channel_fwd.h +26 -0
  833. data/src/core/lib/channel/channel_stack.cc +64 -17
  834. data/src/core/lib/channel/channel_stack.h +96 -14
  835. data/src/core/lib/channel/channel_stack_builder.cc +18 -280
  836. data/src/core/lib/channel/channel_stack_builder.h +112 -150
  837. data/src/core/lib/channel/channel_stack_builder_impl.cc +113 -0
  838. data/src/core/lib/channel/channel_stack_builder_impl.h +48 -0
  839. data/src/core/lib/channel/channel_trace.cc +12 -22
  840. data/src/core/lib/channel/channel_trace.h +6 -3
  841. data/src/core/lib/channel/channelz.cc +36 -49
  842. data/src/core/lib/channel/channelz.h +24 -7
  843. data/src/core/lib/channel/channelz_registry.cc +11 -19
  844. data/src/core/lib/channel/channelz_registry.h +10 -9
  845. data/src/core/lib/channel/connected_channel.cc +704 -48
  846. data/src/core/lib/channel/connected_channel.h +3 -4
  847. data/src/core/lib/channel/context.h +11 -0
  848. data/src/core/lib/channel/promise_based_filter.cc +2126 -0
  849. data/src/core/lib/channel/promise_based_filter.h +848 -0
  850. data/src/core/lib/channel/status_util.cc +29 -0
  851. data/src/core/lib/channel/status_util.h +9 -2
  852. data/src/core/lib/compression/compression.cc +26 -113
  853. data/src/core/lib/compression/compression_internal.cc +170 -204
  854. data/src/core/lib/compression/compression_internal.h +68 -72
  855. data/src/core/lib/compression/message_compress.cc +18 -16
  856. data/src/core/lib/compression/message_compress.h +4 -5
  857. data/src/core/lib/config/core_configuration.cc +18 -3
  858. data/src/core/lib/config/core_configuration.h +133 -36
  859. data/src/core/lib/debug/event_log.cc +88 -0
  860. data/src/core/lib/debug/event_log.h +81 -0
  861. data/src/core/lib/debug/histogram_view.cc +69 -0
  862. data/src/core/lib/debug/histogram_view.h +37 -0
  863. data/src/core/lib/debug/stats.cc +31 -135
  864. data/src/core/lib/debug/stats.h +30 -37
  865. data/src/core/lib/debug/stats_data.cc +290 -638
  866. data/src/core/lib/debug/stats_data.h +263 -527
  867. data/src/core/lib/debug/trace.cc +0 -2
  868. data/src/core/lib/debug/trace.h +15 -14
  869. data/src/core/lib/event_engine/channel_args_endpoint_config.cc +40 -0
  870. data/src/core/lib/event_engine/channel_args_endpoint_config.h +49 -0
  871. data/src/core/lib/event_engine/common_closures.h +71 -0
  872. data/src/core/lib/event_engine/default_event_engine.cc +94 -0
  873. data/src/core/lib/event_engine/default_event_engine.h +49 -0
  874. data/src/core/lib/event_engine/default_event_engine_factory.cc +48 -0
  875. data/src/core/lib/event_engine/default_event_engine_factory.h +33 -0
  876. data/src/core/lib/event_engine/executor/executor.h +38 -0
  877. data/src/core/lib/event_engine/forkable.cc +101 -0
  878. data/src/core/lib/event_engine/forkable.h +61 -0
  879. data/src/core/lib/event_engine/handle_containers.h +67 -0
  880. data/src/core/lib/event_engine/memory_allocator.cc +74 -0
  881. data/src/core/lib/event_engine/poller.h +62 -0
  882. data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +618 -0
  883. data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h +129 -0
  884. data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +901 -0
  885. data/src/core/lib/event_engine/posix_engine/ev_poll_posix.h +97 -0
  886. data/src/core/lib/event_engine/posix_engine/event_poller.h +111 -0
  887. data/src/core/lib/event_engine/posix_engine/event_poller_posix_default.cc +74 -0
  888. data/src/core/lib/event_engine/posix_engine/event_poller_posix_default.h +33 -0
  889. data/src/core/lib/event_engine/posix_engine/internal_errqueue.cc +77 -0
  890. data/src/core/lib/event_engine/posix_engine/internal_errqueue.h +179 -0
  891. data/src/core/lib/event_engine/posix_engine/lockfree_event.cc +267 -0
  892. data/src/core/lib/event_engine/posix_engine/lockfree_event.h +73 -0
  893. data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +1270 -0
  894. data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +682 -0
  895. data/src/core/lib/event_engine/posix_engine/posix_engine.cc +577 -0
  896. data/src/core/lib/event_engine/posix_engine/posix_engine.h +245 -0
  897. data/src/core/lib/event_engine/posix_engine/posix_engine_closure.h +80 -0
  898. data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +1081 -0
  899. data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h +361 -0
  900. data/src/core/lib/event_engine/posix_engine/timer.cc +311 -0
  901. data/src/core/lib/event_engine/posix_engine/timer.h +194 -0
  902. data/src/core/lib/event_engine/posix_engine/timer_heap.cc +107 -0
  903. data/src/core/lib/event_engine/posix_engine/timer_heap.h +56 -0
  904. data/src/core/lib/event_engine/posix_engine/timer_manager.cc +174 -0
  905. data/src/core/lib/event_engine/posix_engine/timer_manager.h +114 -0
  906. data/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc +301 -0
  907. data/src/core/lib/event_engine/posix_engine/traced_buffer_list.h +179 -0
  908. data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.cc +126 -0
  909. data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.h +45 -0
  910. data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.cc +151 -0
  911. data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.h +45 -0
  912. data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix.h +76 -0
  913. data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.cc +67 -0
  914. data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.h +37 -0
  915. data/src/core/lib/event_engine/resolved_address.cc +41 -0
  916. data/src/core/lib/event_engine/slice.cc +103 -0
  917. data/src/core/lib/event_engine/slice_buffer.cc +50 -0
  918. data/src/core/lib/event_engine/socket_notifier.h +55 -0
  919. data/src/core/lib/event_engine/thread_pool.cc +276 -0
  920. data/src/core/lib/event_engine/thread_pool.h +137 -0
  921. data/src/core/lib/event_engine/time_util.cc +30 -0
  922. data/src/core/lib/event_engine/time_util.h +32 -0
  923. data/src/core/lib/event_engine/trace.cc +18 -0
  924. data/src/core/lib/event_engine/trace.h +30 -0
  925. data/src/core/lib/event_engine/utils.cc +44 -0
  926. data/src/core/lib/event_engine/utils.h +36 -0
  927. data/src/core/lib/event_engine/windows/iocp.cc +155 -0
  928. data/src/core/lib/event_engine/windows/iocp.h +69 -0
  929. data/src/core/lib/event_engine/windows/win_socket.cc +196 -0
  930. data/src/core/lib/event_engine/windows/win_socket.h +120 -0
  931. data/src/core/lib/event_engine/windows/windows_engine.cc +165 -0
  932. data/src/core/lib/event_engine/windows/windows_engine.h +124 -0
  933. data/src/core/lib/experiments/config.cc +146 -0
  934. data/src/core/lib/experiments/config.h +43 -0
  935. data/src/core/lib/experiments/experiments.cc +86 -0
  936. data/src/core/lib/experiments/experiments.h +63 -0
  937. data/src/core/lib/gpr/alloc.cc +1 -9
  938. data/src/core/lib/gpr/cpu_linux.cc +6 -2
  939. data/src/core/lib/gpr/log.cc +5 -0
  940. data/src/core/lib/gpr/log_linux.cc +3 -4
  941. data/src/core/lib/gpr/log_windows.cc +0 -1
  942. data/src/core/lib/gpr/string.h +1 -1
  943. data/src/core/lib/gpr/string_util_windows.cc +3 -30
  944. data/src/core/lib/gpr/sync_abseil.cc +0 -14
  945. data/src/core/lib/gpr/sync_posix.cc +1 -14
  946. data/src/core/lib/gpr/time.cc +13 -10
  947. data/src/core/lib/gpr/time_posix.cc +6 -15
  948. data/src/core/lib/gpr/time_precise.h +1 -1
  949. data/src/core/lib/gpr/time_windows.cc +10 -7
  950. data/src/core/lib/gpr/tmpfile_posix.cc +3 -2
  951. data/src/core/lib/gpr/tmpfile_windows.cc +5 -7
  952. data/src/core/lib/gpr/useful.h +58 -0
  953. data/src/core/lib/gprpp/bitset.h +27 -14
  954. data/src/core/lib/gprpp/chunked_vector.h +49 -3
  955. data/src/core/lib/gprpp/construct_destruct.h +1 -0
  956. data/src/core/lib/gprpp/cpp_impl_of.h +49 -0
  957. data/src/core/lib/gprpp/debug_location.h +41 -7
  958. data/src/core/lib/gprpp/dual_ref_counted.h +1 -4
  959. data/src/core/lib/gprpp/env.h +53 -0
  960. data/src/core/lib/gprpp/env_linux.cc +80 -0
  961. data/src/core/lib/gprpp/env_posix.cc +47 -0
  962. data/src/core/lib/gprpp/env_windows.cc +56 -0
  963. data/src/core/lib/gprpp/examine_stack.h +0 -1
  964. data/src/core/lib/gprpp/fork.cc +17 -28
  965. data/src/core/lib/gprpp/fork.h +0 -8
  966. data/src/core/lib/gprpp/global_config.h +2 -4
  967. data/src/core/lib/gprpp/global_config_env.cc +16 -14
  968. data/src/core/lib/gprpp/global_config_env.h +5 -3
  969. data/src/core/lib/gprpp/global_config_generic.h +0 -4
  970. data/src/core/lib/gprpp/host_port.cc +2 -0
  971. data/src/core/lib/gprpp/load_file.cc +75 -0
  972. data/src/core/lib/gprpp/load_file.h +33 -0
  973. data/src/core/lib/gprpp/manual_constructor.h +0 -70
  974. data/src/core/lib/gprpp/match.h +2 -0
  975. data/src/core/lib/gprpp/memory.h +1 -5
  976. data/src/core/lib/gprpp/no_destruct.h +94 -0
  977. data/src/core/lib/gprpp/notification.h +67 -0
  978. data/src/core/lib/gprpp/orphanable.h +2 -5
  979. data/src/core/lib/gprpp/packed_table.h +40 -0
  980. data/src/core/lib/gprpp/per_cpu.h +46 -0
  981. data/src/core/lib/gprpp/ref_counted.h +4 -4
  982. data/src/core/lib/gprpp/ref_counted_ptr.h +23 -39
  983. data/src/core/lib/gprpp/single_set_ptr.h +87 -0
  984. data/src/core/lib/gprpp/sorted_pack.h +98 -0
  985. data/src/core/lib/gprpp/stat.h +0 -2
  986. data/src/core/lib/gprpp/stat_posix.cc +10 -4
  987. data/src/core/lib/gprpp/stat_windows.cc +3 -2
  988. data/src/core/lib/gprpp/status_helper.cc +75 -48
  989. data/src/core/lib/gprpp/status_helper.h +16 -21
  990. data/src/core/lib/gprpp/strerror.cc +41 -0
  991. data/src/core/lib/gprpp/strerror.h +29 -0
  992. data/src/core/lib/gprpp/sync.h +3 -1
  993. data/src/core/lib/gprpp/table.h +42 -2
  994. data/src/core/lib/gprpp/tchar.cc +49 -0
  995. data/src/core/lib/gprpp/tchar.h +33 -0
  996. data/src/core/lib/gprpp/thd.h +2 -5
  997. data/src/core/lib/gprpp/thd_posix.cc +4 -2
  998. data/src/core/lib/gprpp/thd_windows.cc +3 -2
  999. data/src/core/lib/gprpp/time.cc +234 -0
  1000. data/src/core/lib/gprpp/time.h +367 -0
  1001. data/src/core/lib/gprpp/time_averaged_stats.cc +60 -0
  1002. data/src/core/lib/gprpp/time_averaged_stats.h +79 -0
  1003. data/src/core/lib/gprpp/time_util.cc +4 -0
  1004. data/src/core/lib/gprpp/time_util.h +1 -1
  1005. data/src/core/lib/gprpp/unique_type_name.h +104 -0
  1006. data/src/core/lib/gprpp/validation_errors.cc +61 -0
  1007. data/src/core/lib/gprpp/validation_errors.h +127 -0
  1008. data/src/core/lib/gprpp/work_serializer.cc +247 -0
  1009. data/src/core/lib/gprpp/work_serializer.h +86 -0
  1010. data/src/core/lib/handshaker/proxy_mapper.h +53 -0
  1011. data/src/core/lib/handshaker/proxy_mapper_registry.cc +71 -0
  1012. data/src/core/lib/handshaker/proxy_mapper_registry.h +75 -0
  1013. data/src/core/lib/http/format_request.cc +62 -29
  1014. data/src/core/lib/http/format_request.h +10 -7
  1015. data/src/core/lib/http/httpcli.cc +313 -244
  1016. data/src/core/lib/http/httpcli.h +234 -90
  1017. data/src/core/lib/http/httpcli_security_connector.cc +84 -86
  1018. data/src/core/lib/http/httpcli_ssl_credentials.h +39 -0
  1019. data/src/core/lib/http/parser.cc +124 -65
  1020. data/src/core/lib/http/parser.h +18 -2
  1021. data/src/core/lib/iomgr/buffer_list.cc +110 -121
  1022. data/src/core/lib/iomgr/buffer_list.h +68 -52
  1023. data/src/core/lib/iomgr/call_combiner.cc +17 -40
  1024. data/src/core/lib/iomgr/call_combiner.h +3 -4
  1025. data/src/core/lib/iomgr/cfstream_handle.cc +13 -16
  1026. data/src/core/lib/iomgr/closure.h +68 -14
  1027. data/src/core/lib/iomgr/combiner.cc +11 -9
  1028. data/src/core/lib/iomgr/endpoint.cc +4 -4
  1029. data/src/core/lib/iomgr/endpoint.h +7 -6
  1030. data/src/core/lib/iomgr/endpoint_cfstream.cc +40 -53
  1031. data/src/core/lib/iomgr/endpoint_cfstream.h +4 -4
  1032. data/src/core/lib/iomgr/endpoint_pair_posix.cc +15 -11
  1033. data/src/core/lib/iomgr/endpoint_pair_windows.cc +5 -14
  1034. data/src/core/lib/iomgr/error.cc +30 -813
  1035. data/src/core/lib/iomgr/error.h +22 -295
  1036. data/src/core/lib/iomgr/error_cfstream.cc +0 -5
  1037. data/src/core/lib/iomgr/ev_apple.cc +10 -9
  1038. data/src/core/lib/iomgr/ev_epoll1_linux.cc +88 -84
  1039. data/src/core/lib/iomgr/ev_epoll1_linux.h +1 -1
  1040. data/src/core/lib/iomgr/ev_poll_posix.cc +123 -109
  1041. data/src/core/lib/iomgr/ev_poll_posix.h +2 -2
  1042. data/src/core/lib/iomgr/ev_posix.cc +58 -100
  1043. data/src/core/lib/iomgr/ev_posix.h +6 -4
  1044. data/src/core/lib/iomgr/exec_ctx.cc +14 -109
  1045. data/src/core/lib/iomgr/exec_ctx.h +24 -66
  1046. data/src/core/lib/iomgr/executor.cc +16 -21
  1047. data/src/core/lib/iomgr/executor.h +1 -4
  1048. data/src/core/lib/iomgr/fork_posix.cc +1 -0
  1049. data/src/core/lib/iomgr/internal_errqueue.cc +40 -47
  1050. data/src/core/lib/iomgr/internal_errqueue.h +1 -6
  1051. data/src/core/lib/iomgr/iocp_windows.cc +10 -10
  1052. data/src/core/lib/iomgr/iocp_windows.h +1 -1
  1053. data/src/core/lib/iomgr/iomgr.cc +6 -2
  1054. data/src/core/lib/iomgr/iomgr_fwd.h +26 -0
  1055. data/src/core/lib/iomgr/iomgr_posix.cc +4 -3
  1056. data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +4 -2
  1057. data/src/core/lib/iomgr/iomgr_windows.cc +3 -2
  1058. data/src/core/lib/iomgr/load_file.cc +5 -9
  1059. data/src/core/lib/iomgr/lockfree_event.cc +10 -27
  1060. data/src/core/lib/iomgr/polling_entity.h +6 -0
  1061. data/src/core/lib/iomgr/pollset.cc +1 -1
  1062. data/src/core/lib/iomgr/pollset.h +5 -5
  1063. data/src/core/lib/iomgr/pollset_set.h +1 -3
  1064. data/src/core/lib/iomgr/pollset_windows.cc +6 -6
  1065. data/src/core/lib/iomgr/port.h +29 -12
  1066. data/src/core/lib/iomgr/python_util.h +2 -2
  1067. data/src/core/lib/iomgr/resolve_address.cc +16 -22
  1068. data/src/core/lib/iomgr/resolve_address.h +79 -46
  1069. data/src/core/lib/iomgr/resolve_address_impl.h +59 -0
  1070. data/src/core/lib/iomgr/resolve_address_posix.cc +112 -78
  1071. data/src/core/lib/iomgr/resolve_address_posix.h +63 -0
  1072. data/src/core/lib/iomgr/resolve_address_windows.cc +125 -81
  1073. data/src/core/lib/iomgr/resolve_address_windows.h +63 -0
  1074. data/src/core/lib/iomgr/resolved_address.h +39 -0
  1075. data/src/core/lib/iomgr/sockaddr.h +2 -3
  1076. data/src/core/lib/iomgr/sockaddr_posix.h +2 -0
  1077. data/src/core/lib/iomgr/sockaddr_utils_posix.cc +63 -0
  1078. data/src/core/lib/iomgr/sockaddr_windows.h +2 -0
  1079. data/src/core/lib/iomgr/socket_utils_common_posix.cc +44 -81
  1080. data/src/core/lib/iomgr/socket_utils_posix.cc +84 -1
  1081. data/src/core/lib/iomgr/socket_utils_posix.h +98 -6
  1082. data/src/core/lib/iomgr/socket_windows.cc +2 -2
  1083. data/src/core/lib/iomgr/socket_windows.h +0 -2
  1084. data/src/core/lib/iomgr/tcp_client.cc +11 -9
  1085. data/src/core/lib/iomgr/tcp_client.h +25 -15
  1086. data/src/core/lib/iomgr/tcp_client_cfstream.cc +28 -26
  1087. data/src/core/lib/iomgr/tcp_client_posix.cc +194 -85
  1088. data/src/core/lib/iomgr/tcp_client_posix.h +14 -12
  1089. data/src/core/lib/iomgr/tcp_client_windows.cc +33 -35
  1090. data/src/core/lib/iomgr/tcp_posix.cc +465 -254
  1091. data/src/core/lib/iomgr/tcp_posix.h +4 -4
  1092. data/src/core/lib/iomgr/tcp_server.cc +3 -4
  1093. data/src/core/lib/iomgr/tcp_server.h +5 -4
  1094. data/src/core/lib/iomgr/tcp_server_posix.cc +109 -101
  1095. data/src/core/lib/iomgr/tcp_server_utils_posix.h +21 -20
  1096. data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +50 -49
  1097. data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +19 -16
  1098. data/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc +1 -1
  1099. data/src/core/lib/iomgr/tcp_server_windows.cc +45 -48
  1100. data/src/core/lib/iomgr/tcp_windows.cc +43 -46
  1101. data/src/core/lib/iomgr/tcp_windows.h +1 -3
  1102. data/src/core/lib/iomgr/timer.cc +2 -2
  1103. data/src/core/lib/iomgr/timer.h +18 -13
  1104. data/src/core/lib/iomgr/timer_generic.cc +108 -97
  1105. data/src/core/lib/iomgr/timer_manager.cc +14 -14
  1106. data/src/core/lib/iomgr/unix_sockets_posix.cc +20 -34
  1107. data/src/core/lib/iomgr/unix_sockets_posix.h +4 -7
  1108. data/src/core/lib/iomgr/unix_sockets_posix_noop.cc +6 -15
  1109. data/src/core/lib/iomgr/wakeup_fd_eventfd.cc +4 -5
  1110. data/src/core/lib/iomgr/wakeup_fd_pipe.cc +10 -8
  1111. data/src/core/lib/iomgr/wakeup_fd_posix.cc +15 -12
  1112. data/src/core/lib/iomgr/wakeup_fd_posix.h +0 -2
  1113. data/src/core/lib/json/json.h +20 -24
  1114. data/src/core/lib/json/json_args.h +34 -0
  1115. data/src/core/lib/json/json_channel_args.h +42 -0
  1116. data/src/core/lib/json/json_object_loader.cc +207 -0
  1117. data/src/core/lib/json/json_object_loader.h +620 -0
  1118. data/src/core/lib/json/json_reader.cc +155 -75
  1119. data/src/core/lib/json/json_util.cc +17 -37
  1120. data/src/core/lib/json/json_util.h +18 -9
  1121. data/src/core/lib/json/json_writer.cc +6 -1
  1122. data/src/core/lib/load_balancing/lb_policy.cc +93 -0
  1123. data/src/core/lib/load_balancing/lb_policy.h +439 -0
  1124. data/src/core/lib/load_balancing/lb_policy_factory.h +49 -0
  1125. data/src/core/lib/load_balancing/lb_policy_registry.cc +141 -0
  1126. data/src/core/lib/load_balancing/lb_policy_registry.h +82 -0
  1127. data/src/core/lib/load_balancing/subchannel_interface.h +133 -0
  1128. data/src/core/lib/matchers/matchers.cc +10 -8
  1129. data/src/core/lib/matchers/matchers.h +2 -0
  1130. data/src/core/lib/promise/activity.cc +134 -0
  1131. data/src/core/lib/promise/activity.h +604 -0
  1132. data/src/core/lib/promise/arena_promise.h +230 -0
  1133. data/src/core/lib/promise/context.h +92 -0
  1134. data/src/core/lib/promise/detail/basic_seq.h +497 -0
  1135. data/src/core/lib/promise/detail/promise_factory.h +235 -0
  1136. data/src/core/lib/promise/detail/promise_like.h +85 -0
  1137. data/src/core/lib/promise/detail/status.h +78 -0
  1138. data/src/core/lib/promise/detail/switch.h +1455 -0
  1139. data/src/core/lib/promise/exec_ctx_wakeup_scheduler.h +50 -0
  1140. data/src/core/lib/promise/for_each.h +129 -0
  1141. data/src/core/lib/promise/intra_activity_waiter.h +49 -0
  1142. data/src/core/lib/promise/latch.h +103 -0
  1143. data/src/core/lib/promise/loop.h +138 -0
  1144. data/src/core/lib/promise/map.h +87 -0
  1145. data/src/core/lib/promise/map_pipe.h +87 -0
  1146. data/src/core/lib/promise/pipe.cc +19 -0
  1147. data/src/core/lib/promise/pipe.h +505 -0
  1148. data/src/core/lib/promise/poll.h +79 -0
  1149. data/src/core/lib/promise/promise.h +96 -0
  1150. data/src/core/lib/promise/race.h +83 -0
  1151. data/src/core/lib/promise/seq.h +106 -0
  1152. data/src/core/lib/promise/sleep.cc +90 -0
  1153. data/src/core/lib/promise/sleep.h +84 -0
  1154. data/src/core/lib/promise/try_concurrently.h +341 -0
  1155. data/src/core/lib/promise/try_seq.h +174 -0
  1156. data/src/core/lib/resolver/resolver.cc +37 -0
  1157. data/src/core/lib/resolver/resolver.h +138 -0
  1158. data/src/core/lib/resolver/resolver_factory.h +77 -0
  1159. data/src/core/lib/resolver/resolver_registry.cc +149 -0
  1160. data/src/core/lib/resolver/resolver_registry.h +123 -0
  1161. data/src/core/lib/resolver/server_address.cc +181 -0
  1162. data/src/core/lib/resolver/server_address.h +145 -0
  1163. data/src/core/lib/resource_quota/api.cc +104 -0
  1164. data/src/core/lib/resource_quota/api.h +49 -0
  1165. data/src/core/lib/resource_quota/arena.cc +138 -0
  1166. data/src/core/lib/resource_quota/arena.h +252 -0
  1167. data/src/core/lib/resource_quota/memory_quota.cc +603 -0
  1168. data/src/core/lib/resource_quota/memory_quota.h +530 -0
  1169. data/src/core/lib/resource_quota/periodic_update.cc +78 -0
  1170. data/src/core/lib/resource_quota/periodic_update.h +71 -0
  1171. data/src/core/lib/resource_quota/resource_quota.cc +33 -0
  1172. data/src/core/lib/resource_quota/resource_quota.h +74 -0
  1173. data/src/core/lib/resource_quota/thread_quota.cc +45 -0
  1174. data/src/core/lib/resource_quota/thread_quota.h +61 -0
  1175. data/src/core/lib/resource_quota/trace.cc +19 -0
  1176. data/src/core/lib/resource_quota/trace.h +24 -0
  1177. data/src/core/lib/security/authorization/authorization_policy_provider.h +14 -0
  1178. data/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc +4 -0
  1179. data/src/core/lib/security/authorization/evaluate_args.cc +53 -45
  1180. data/src/core/lib/security/authorization/evaluate_args.h +9 -5
  1181. data/src/core/lib/security/authorization/grpc_authorization_engine.cc +64 -0
  1182. data/src/core/lib/security/authorization/grpc_authorization_engine.h +69 -0
  1183. data/src/core/lib/security/authorization/grpc_server_authz_filter.cc +122 -0
  1184. data/src/core/lib/security/authorization/grpc_server_authz_filter.h +61 -0
  1185. data/src/core/lib/security/authorization/matchers.cc +241 -0
  1186. data/src/core/lib/security/authorization/matchers.h +218 -0
  1187. data/src/core/lib/security/authorization/rbac_policy.cc +445 -0
  1188. data/src/core/lib/security/authorization/rbac_policy.h +178 -0
  1189. data/src/core/lib/security/certificate_provider/certificate_provider_factory.h +66 -0
  1190. data/src/core/lib/security/certificate_provider/certificate_provider_registry.cc +60 -0
  1191. data/src/core/lib/security/certificate_provider/certificate_provider_registry.h +70 -0
  1192. data/src/core/lib/security/context/security_context.cc +9 -4
  1193. data/src/core/lib/security/context/security_context.h +33 -4
  1194. data/src/core/lib/security/credentials/alts/alts_credentials.cc +18 -10
  1195. data/src/core/lib/security/credentials/alts/alts_credentials.h +18 -4
  1196. data/src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc +1 -3
  1197. data/src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc +1 -4
  1198. data/src/core/lib/security/credentials/call_creds_util.cc +97 -0
  1199. data/src/core/lib/security/credentials/call_creds_util.h +43 -0
  1200. data/src/core/lib/security/credentials/channel_creds_registry.h +103 -0
  1201. data/src/core/lib/security/credentials/channel_creds_registry_init.cc +80 -0
  1202. data/src/core/lib/security/credentials/composite/composite_credentials.cc +32 -91
  1203. data/src/core/lib/security/credentials/composite/composite_credentials.h +42 -16
  1204. data/src/core/lib/security/credentials/credentials.cc +6 -11
  1205. data/src/core/lib/security/credentials/credentials.h +106 -99
  1206. data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +249 -107
  1207. data/src/core/lib/security/credentials/external/aws_external_account_credentials.h +19 -0
  1208. data/src/core/lib/security/credentials/external/aws_request_signer.cc +13 -3
  1209. data/src/core/lib/security/credentials/external/external_account_credentials.cc +137 -103
  1210. data/src/core/lib/security/credentials/external/external_account_credentials.h +16 -9
  1211. data/src/core/lib/security/credentials/external/file_external_account_credentials.cc +29 -27
  1212. data/src/core/lib/security/credentials/external/file_external_account_credentials.h +6 -0
  1213. data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +76 -45
  1214. data/src/core/lib/security/credentials/external/url_external_account_credentials.h +11 -0
  1215. data/src/core/lib/security/credentials/fake/fake_credentials.cc +43 -43
  1216. data/src/core/lib/security/credentials/fake/fake_credentials.h +35 -26
  1217. data/src/core/lib/security/credentials/google_default/credentials_generic.cc +6 -8
  1218. data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +118 -80
  1219. data/src/core/lib/security/credentials/google_default/google_default_credentials.h +20 -7
  1220. data/src/core/lib/security/credentials/iam/iam_credentials.cc +32 -30
  1221. data/src/core/lib/security/credentials/iam/iam_credentials.h +25 -9
  1222. data/src/core/lib/security/credentials/insecure/insecure_credentials.cc +35 -26
  1223. data/src/core/lib/security/credentials/insecure/insecure_credentials.h +61 -0
  1224. data/src/core/lib/security/credentials/jwt/json_token.cc +21 -12
  1225. data/src/core/lib/security/credentials/jwt/json_token.h +2 -2
  1226. data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +46 -55
  1227. data/src/core/lib/security/credentials/jwt/jwt_credentials.h +30 -12
  1228. data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +96 -61
  1229. data/src/core/lib/security/credentials/jwt/jwt_verifier.h +6 -4
  1230. data/src/core/lib/security/credentials/local/local_credentials.cc +19 -13
  1231. data/src/core/lib/security/credentials/local/local_credentials.h +19 -3
  1232. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +214 -222
  1233. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +81 -34
  1234. data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +104 -156
  1235. data/src/core/lib/security/credentials/plugin/plugin_credentials.h +80 -27
  1236. data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +31 -35
  1237. data/src/core/lib/security/credentials/ssl/ssl_credentials.h +29 -6
  1238. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc +21 -29
  1239. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h +13 -14
  1240. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +75 -58
  1241. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +73 -14
  1242. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc +241 -0
  1243. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h +168 -0
  1244. data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +37 -92
  1245. data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +73 -149
  1246. data/src/core/lib/security/credentials/tls/tls_credentials.cc +59 -42
  1247. data/src/core/lib/security/credentials/tls/tls_credentials.h +13 -4
  1248. data/src/core/lib/security/credentials/tls/tls_utils.cc +5 -1
  1249. data/src/core/lib/security/credentials/tls/tls_utils.h +1 -1
  1250. data/src/core/lib/security/credentials/xds/xds_credentials.cc +81 -89
  1251. data/src/core/lib/security/credentials/xds/xds_credentials.h +53 -8
  1252. data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +46 -45
  1253. data/src/core/lib/security/security_connector/alts/alts_security_connector.h +9 -6
  1254. data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +58 -70
  1255. data/src/core/lib/security/security_connector/fake/fake_security_connector.h +3 -5
  1256. data/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc +23 -24
  1257. data/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +34 -27
  1258. data/src/core/lib/security/security_connector/load_system_roots_fallback.cc +5 -3
  1259. data/src/core/lib/security/security_connector/load_system_roots_supported.cc +175 -0
  1260. data/src/core/lib/security/security_connector/load_system_roots_supported.h +46 -0
  1261. data/src/core/lib/security/security_connector/local/local_security_connector.cc +52 -40
  1262. data/src/core/lib/security/security_connector/local/local_security_connector.h +7 -3
  1263. data/src/core/lib/security/security_connector/security_connector.cc +22 -32
  1264. data/src/core/lib/security/security_connector/security_connector.h +49 -31
  1265. data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +39 -34
  1266. data/src/core/lib/security/security_connector/ssl/ssl_security_connector.h +4 -2
  1267. data/src/core/lib/security/security_connector/ssl_utils.cc +54 -40
  1268. data/src/core/lib/security/security_connector/ssl_utils.h +23 -24
  1269. data/src/core/lib/security/security_connector/ssl_utils_config.h +1 -1
  1270. data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +391 -230
  1271. data/src/core/lib/security/security_connector/tls/tls_security_connector.h +97 -54
  1272. data/src/core/lib/security/transport/auth_filters.h +45 -5
  1273. data/src/core/lib/security/transport/client_auth_filter.cc +122 -368
  1274. data/src/core/lib/security/transport/secure_endpoint.cc +282 -158
  1275. data/src/core/lib/security/transport/secure_endpoint.h +5 -4
  1276. data/src/core/lib/security/transport/security_handshaker.cc +123 -92
  1277. data/src/core/lib/security/transport/security_handshaker.h +7 -2
  1278. data/src/core/lib/security/transport/server_auth_filter.cc +87 -58
  1279. data/src/core/lib/security/transport/tsi_error.cc +6 -3
  1280. data/src/core/lib/security/util/json_util.cc +7 -7
  1281. data/src/core/lib/security/util/json_util.h +0 -2
  1282. data/src/core/lib/service_config/service_config.h +89 -0
  1283. data/src/core/lib/service_config/service_config_call_data.h +76 -0
  1284. data/src/core/lib/service_config/service_config_impl.cc +191 -0
  1285. data/src/core/lib/service_config/service_config_impl.h +125 -0
  1286. data/src/core/lib/service_config/service_config_parser.cc +81 -0
  1287. data/src/core/lib/service_config/service_config_parser.h +105 -0
  1288. data/src/core/lib/slice/b64.cc +2 -2
  1289. data/src/core/lib/slice/b64.h +2 -0
  1290. data/src/core/lib/slice/percent_encoding.cc +35 -97
  1291. data/src/core/lib/slice/percent_encoding.h +4 -16
  1292. data/src/core/lib/slice/slice.cc +94 -184
  1293. data/src/core/lib/slice/slice.h +402 -0
  1294. data/src/core/lib/slice/slice_buffer.cc +92 -33
  1295. data/src/core/lib/slice/slice_buffer.h +137 -0
  1296. data/src/core/lib/slice/slice_internal.h +22 -48
  1297. data/src/core/lib/slice/slice_refcount.h +32 -93
  1298. data/src/core/lib/slice/slice_string_helpers.cc +0 -16
  1299. data/src/core/lib/slice/slice_string_helpers.h +1 -8
  1300. data/src/core/lib/surface/builtins.cc +11 -6
  1301. data/src/core/lib/surface/byte_buffer.cc +9 -4
  1302. data/src/core/lib/surface/byte_buffer_reader.cc +7 -7
  1303. data/src/core/lib/surface/call.cc +2324 -1337
  1304. data/src/core/lib/surface/call.h +69 -21
  1305. data/src/core/lib/surface/call_details.cc +6 -6
  1306. data/src/core/lib/surface/call_log_batch.cc +7 -1
  1307. data/src/core/lib/surface/call_test_only.h +4 -1
  1308. data/src/core/lib/surface/call_trace.cc +113 -0
  1309. data/src/core/lib/surface/call_trace.h +30 -0
  1310. data/src/core/lib/surface/channel.cc +230 -328
  1311. data/src/core/lib/surface/channel.h +110 -74
  1312. data/src/core/lib/surface/channel_init.cc +2 -3
  1313. data/src/core/lib/surface/channel_init.h +4 -6
  1314. data/src/core/lib/surface/channel_ping.cc +9 -3
  1315. data/src/core/lib/surface/channel_stack_type.cc +4 -2
  1316. data/src/core/lib/surface/channel_stack_type.h +2 -2
  1317. data/src/core/lib/surface/completion_queue.cc +76 -94
  1318. data/src/core/lib/surface/completion_queue.h +8 -6
  1319. data/src/core/lib/surface/completion_queue_factory.cc +6 -0
  1320. data/src/core/lib/surface/completion_queue_factory.h +1 -3
  1321. data/src/core/lib/surface/event_string.cc +1 -7
  1322. data/src/core/lib/surface/event_string.h +1 -1
  1323. data/src/core/lib/surface/init.cc +87 -78
  1324. data/src/core/lib/surface/init.h +0 -10
  1325. data/src/core/lib/surface/init_internally.cc +24 -0
  1326. data/src/core/lib/surface/init_internally.h +36 -0
  1327. data/src/core/lib/surface/lame_client.cc +69 -107
  1328. data/src/core/lib/surface/lame_client.h +41 -3
  1329. data/src/core/lib/surface/metadata_array.cc +2 -0
  1330. data/src/core/lib/surface/server.cc +153 -206
  1331. data/src/core/lib/surface/server.h +64 -36
  1332. data/src/core/lib/surface/validate_metadata.cc +17 -31
  1333. data/src/core/lib/surface/validate_metadata.h +3 -0
  1334. data/src/core/lib/surface/version.cc +2 -2
  1335. data/src/core/lib/transport/bdp_estimator.cc +11 -12
  1336. data/src/core/lib/transport/bdp_estimator.h +4 -5
  1337. data/src/core/lib/transport/connectivity_state.cc +7 -6
  1338. data/src/core/lib/transport/connectivity_state.h +3 -4
  1339. data/src/core/lib/transport/error_utils.cc +45 -65
  1340. data/src/core/lib/transport/error_utils.h +10 -5
  1341. data/src/core/lib/transport/handshaker.cc +225 -0
  1342. data/src/core/lib/transport/handshaker.h +167 -0
  1343. data/src/core/lib/transport/handshaker_factory.h +74 -0
  1344. data/src/core/lib/transport/handshaker_registry.cc +61 -0
  1345. data/src/core/lib/transport/handshaker_registry.h +69 -0
  1346. data/src/core/lib/transport/http_connect_handshaker.cc +400 -0
  1347. data/src/core/lib/transport/http_connect_handshaker.h +42 -0
  1348. data/src/core/lib/transport/metadata_batch.cc +266 -69
  1349. data/src/core/lib/transport/metadata_batch.h +1108 -837
  1350. data/src/core/lib/transport/parsed_metadata.cc +35 -0
  1351. data/src/core/lib/transport/parsed_metadata.h +239 -93
  1352. data/src/core/lib/transport/pid_controller.cc +4 -4
  1353. data/src/core/lib/transport/status_conversion.cc +3 -3
  1354. data/src/core/lib/transport/status_conversion.h +3 -3
  1355. data/src/core/lib/transport/tcp_connect_handshaker.cc +246 -0
  1356. data/src/core/lib/transport/tcp_connect_handshaker.h +39 -0
  1357. data/src/core/lib/transport/timeout_encoding.cc +203 -70
  1358. data/src/core/lib/transport/timeout_encoding.h +44 -10
  1359. data/src/core/lib/transport/transport.cc +82 -58
  1360. data/src/core/lib/transport/transport.h +154 -35
  1361. data/src/core/lib/transport/transport_fwd.h +20 -0
  1362. data/src/core/lib/transport/transport_impl.h +24 -0
  1363. data/src/core/lib/transport/transport_op_string.cc +24 -66
  1364. data/src/core/lib/uri/uri_parser.cc +248 -66
  1365. data/src/core/lib/uri/uri_parser.h +39 -25
  1366. data/src/core/plugin_registry/grpc_plugin_registry.cc +56 -140
  1367. data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +61 -0
  1368. data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +76 -52
  1369. data/src/core/tsi/alts/handshaker/alts_handshaker_client.h +1 -1
  1370. data/src/core/tsi/alts/handshaker/alts_shared_resource.cc +9 -1
  1371. data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +43 -28
  1372. data/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h +1 -1
  1373. data/src/core/tsi/alts/handshaker/alts_tsi_utils.cc +4 -3
  1374. data/src/core/tsi/alts/handshaker/alts_tsi_utils.h +1 -1
  1375. data/src/core/tsi/alts/handshaker/transport_security_common_api.cc +2 -2
  1376. data/src/core/tsi/alts/handshaker/transport_security_common_api.h +2 -2
  1377. data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc +7 -7
  1378. data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc +7 -6
  1379. data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc +1 -1
  1380. data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +14 -6
  1381. data/src/core/tsi/fake_transport_security.cc +69 -34
  1382. data/src/core/tsi/fake_transport_security.h +6 -0
  1383. data/src/core/tsi/local_transport_security.cc +24 -28
  1384. data/src/core/tsi/local_transport_security.h +1 -4
  1385. data/src/core/tsi/ssl/key_logging/ssl_key_logging.cc +145 -0
  1386. data/src/core/tsi/ssl/key_logging/ssl_key_logging.h +81 -0
  1387. data/src/core/tsi/ssl/session_cache/ssl_session.h +3 -3
  1388. data/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc +3 -1
  1389. data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +13 -6
  1390. data/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc +8 -2
  1391. data/src/core/tsi/ssl_transport_security.cc +249 -68
  1392. data/src/core/tsi/ssl_transport_security.h +47 -8
  1393. data/src/core/tsi/transport_security.cc +18 -6
  1394. data/src/core/tsi/transport_security.h +2 -1
  1395. data/src/core/tsi/transport_security_grpc.cc +3 -2
  1396. data/src/core/tsi/transport_security_grpc.h +5 -2
  1397. data/src/core/tsi/transport_security_interface.h +19 -5
  1398. data/src/ruby/ext/grpc/ext-export-truffleruby.clang +2 -0
  1399. data/src/ruby/ext/grpc/ext-export-truffleruby.gcc +7 -0
  1400. data/src/ruby/ext/grpc/ext-export.clang +1 -0
  1401. data/src/ruby/ext/grpc/ext-export.gcc +1 -0
  1402. data/src/ruby/ext/grpc/extconf.rb +61 -21
  1403. data/src/ruby/ext/grpc/rb_channel.c +5 -2
  1404. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +26 -36
  1405. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +40 -55
  1406. data/src/ruby/ext/grpc/rb_loader.c +6 -2
  1407. data/src/ruby/ext/grpc/rb_server.c +7 -4
  1408. data/src/ruby/lib/grpc/errors.rb +1 -1
  1409. data/src/ruby/lib/grpc/generic/active_call.rb +7 -1
  1410. data/src/ruby/lib/grpc/grpc.rb +1 -1
  1411. data/src/ruby/lib/grpc/version.rb +1 -1
  1412. data/src/ruby/pb/generate_proto_ruby.sh +1 -0
  1413. data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +4 -0
  1414. data/src/ruby/pb/src/proto/grpc/testing/test_pb.rb +2 -1
  1415. data/src/ruby/pb/test/client.rb +769 -0
  1416. data/src/ruby/pb/test/server.rb +252 -0
  1417. data/src/ruby/pb/test/xds_client.rb +415 -0
  1418. data/src/ruby/spec/channel_spec.rb +5 -43
  1419. data/src/ruby/spec/generic/active_call_spec.rb +12 -3
  1420. data/src/ruby/spec/generic/client_stub_spec.rb +23 -23
  1421. data/src/ruby/spec/generic/server_interceptors_spec.rb +1 -1
  1422. data/src/ruby/spec/user_agent_spec.rb +1 -1
  1423. data/third_party/abseil-cpp/absl/algorithm/container.h +102 -92
  1424. data/third_party/abseil-cpp/absl/base/attributes.h +112 -52
  1425. data/third_party/abseil-cpp/absl/base/casts.h +61 -68
  1426. data/third_party/abseil-cpp/absl/base/config.h +245 -74
  1427. data/third_party/abseil-cpp/absl/base/dynamic_annotations.h +1 -26
  1428. data/third_party/abseil-cpp/absl/base/internal/cycleclock.cc +12 -42
  1429. data/third_party/abseil-cpp/absl/base/internal/cycleclock.h +67 -2
  1430. data/third_party/abseil-cpp/absl/base/internal/direct_mmap.h +3 -3
  1431. data/third_party/abseil-cpp/absl/base/internal/endian.h +17 -62
  1432. data/third_party/abseil-cpp/absl/base/internal/fast_type_id.h +50 -0
  1433. data/third_party/abseil-cpp/absl/base/internal/invoke.h +54 -0
  1434. data/third_party/abseil-cpp/absl/base/internal/prefetch.h +138 -0
  1435. data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +29 -22
  1436. data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +13 -12
  1437. data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +3 -0
  1438. data/third_party/abseil-cpp/absl/base/internal/spinlock.h +11 -1
  1439. data/third_party/abseil-cpp/absl/base/internal/spinlock_linux.inc +2 -5
  1440. data/third_party/abseil-cpp/absl/base/internal/spinlock_wait.h +2 -0
  1441. data/third_party/abseil-cpp/absl/base/internal/strerror.cc +88 -0
  1442. data/third_party/abseil-cpp/absl/base/internal/strerror.h +39 -0
  1443. data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +68 -0
  1444. data/third_party/abseil-cpp/absl/base/internal/thread_identity.cc +2 -1
  1445. data/third_party/abseil-cpp/absl/base/internal/thread_identity.h +4 -4
  1446. data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +22 -7
  1447. data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +15 -6
  1448. data/third_party/abseil-cpp/absl/base/log_severity.cc +28 -0
  1449. data/third_party/abseil-cpp/absl/base/log_severity.h +51 -0
  1450. data/third_party/abseil-cpp/absl/base/optimization.h +19 -11
  1451. data/third_party/abseil-cpp/absl/base/options.h +1 -1
  1452. data/third_party/abseil-cpp/absl/base/thread_annotations.h +2 -2
  1453. data/third_party/abseil-cpp/absl/cleanup/cleanup.h +140 -0
  1454. data/third_party/abseil-cpp/absl/cleanup/internal/cleanup.h +100 -0
  1455. data/third_party/abseil-cpp/absl/container/fixed_array.h +2 -5
  1456. data/third_party/abseil-cpp/absl/container/flat_hash_map.h +11 -4
  1457. data/third_party/abseil-cpp/absl/container/flat_hash_set.h +510 -0
  1458. data/third_party/abseil-cpp/absl/container/inlined_vector.h +118 -99
  1459. data/third_party/abseil-cpp/absl/container/internal/common.h +6 -5
  1460. data/third_party/abseil-cpp/absl/container/internal/container_memory.h +10 -28
  1461. data/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h +17 -15
  1462. data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +77 -113
  1463. data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +62 -85
  1464. data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +417 -431
  1465. data/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +3 -2
  1466. data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +18 -8
  1467. data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +724 -262
  1468. data/third_party/abseil-cpp/absl/debugging/internal/address_is_readable.cc +45 -88
  1469. data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +11 -1
  1470. data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc +16 -11
  1471. data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h +7 -2
  1472. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +8 -3
  1473. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_arm-inl.inc +8 -3
  1474. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h +13 -5
  1475. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc +110 -0
  1476. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +8 -3
  1477. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +236 -0
  1478. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +33 -10
  1479. data/third_party/abseil-cpp/absl/debugging/internal/symbolize.h +8 -2
  1480. data/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc +35 -4
  1481. data/third_party/abseil-cpp/absl/debugging/stacktrace.cc +2 -0
  1482. data/third_party/abseil-cpp/absl/debugging/symbolize.cc +7 -0
  1483. data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +60 -7
  1484. data/third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc +72 -0
  1485. data/third_party/abseil-cpp/absl/functional/any_invocable.h +313 -0
  1486. data/third_party/abseil-cpp/absl/functional/bind_front.h +10 -1
  1487. data/third_party/abseil-cpp/absl/functional/function_ref.h +6 -2
  1488. data/third_party/abseil-cpp/absl/functional/internal/any_invocable.h +857 -0
  1489. data/third_party/abseil-cpp/absl/hash/hash.h +104 -8
  1490. data/third_party/abseil-cpp/absl/hash/internal/hash.cc +15 -16
  1491. data/third_party/abseil-cpp/absl/hash/internal/hash.h +297 -51
  1492. data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc +123 -0
  1493. data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.h +50 -0
  1494. data/third_party/abseil-cpp/absl/memory/memory.h +1 -1
  1495. data/third_party/abseil-cpp/absl/meta/type_traits.h +32 -2
  1496. data/third_party/abseil-cpp/absl/numeric/bits.h +2 -1
  1497. data/third_party/abseil-cpp/absl/numeric/int128.cc +7 -12
  1498. data/third_party/abseil-cpp/absl/numeric/int128.h +148 -75
  1499. data/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc +19 -25
  1500. data/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc +73 -70
  1501. data/third_party/abseil-cpp/absl/profiling/internal/exponential_biased.cc +93 -0
  1502. data/third_party/abseil-cpp/absl/profiling/internal/exponential_biased.h +130 -0
  1503. data/third_party/abseil-cpp/absl/profiling/internal/sample_recorder.h +245 -0
  1504. data/third_party/abseil-cpp/absl/random/bernoulli_distribution.h +200 -0
  1505. data/third_party/abseil-cpp/absl/random/beta_distribution.h +427 -0
  1506. data/third_party/abseil-cpp/absl/random/discrete_distribution.cc +98 -0
  1507. data/third_party/abseil-cpp/absl/random/discrete_distribution.h +247 -0
  1508. data/third_party/abseil-cpp/absl/random/distributions.h +452 -0
  1509. data/third_party/abseil-cpp/absl/random/exponential_distribution.h +165 -0
  1510. data/third_party/abseil-cpp/absl/random/gaussian_distribution.cc +104 -0
  1511. data/third_party/abseil-cpp/absl/random/gaussian_distribution.h +275 -0
  1512. data/third_party/abseil-cpp/absl/random/internal/distribution_caller.h +95 -0
  1513. data/third_party/abseil-cpp/absl/random/internal/fast_uniform_bits.h +269 -0
  1514. data/third_party/abseil-cpp/absl/random/internal/fastmath.h +57 -0
  1515. data/third_party/abseil-cpp/absl/random/internal/generate_real.h +144 -0
  1516. data/third_party/abseil-cpp/absl/random/internal/iostream_state_saver.h +245 -0
  1517. data/third_party/abseil-cpp/absl/random/internal/nonsecure_base.h +161 -0
  1518. data/third_party/abseil-cpp/absl/random/internal/pcg_engine.h +308 -0
  1519. data/third_party/abseil-cpp/absl/random/internal/platform.h +171 -0
  1520. data/third_party/abseil-cpp/absl/random/internal/pool_urbg.cc +253 -0
  1521. data/third_party/abseil-cpp/absl/random/internal/pool_urbg.h +131 -0
  1522. data/third_party/abseil-cpp/absl/random/internal/randen.cc +91 -0
  1523. data/third_party/abseil-cpp/absl/random/internal/randen.h +96 -0
  1524. data/third_party/abseil-cpp/absl/random/internal/randen_detect.cc +225 -0
  1525. data/third_party/abseil-cpp/absl/random/internal/randen_detect.h +33 -0
  1526. data/third_party/abseil-cpp/absl/random/internal/randen_engine.h +264 -0
  1527. data/third_party/abseil-cpp/absl/random/internal/randen_hwaes.cc +526 -0
  1528. data/third_party/abseil-cpp/absl/random/internal/randen_hwaes.h +50 -0
  1529. data/third_party/abseil-cpp/absl/random/internal/randen_round_keys.cc +462 -0
  1530. data/third_party/abseil-cpp/absl/random/internal/randen_slow.cc +471 -0
  1531. data/third_party/abseil-cpp/absl/random/internal/randen_slow.h +40 -0
  1532. data/third_party/abseil-cpp/absl/random/internal/randen_traits.h +88 -0
  1533. data/third_party/abseil-cpp/absl/random/internal/salted_seed_seq.h +165 -0
  1534. data/third_party/abseil-cpp/absl/random/internal/seed_material.cc +267 -0
  1535. data/third_party/abseil-cpp/absl/random/internal/seed_material.h +104 -0
  1536. data/third_party/abseil-cpp/absl/random/internal/traits.h +149 -0
  1537. data/third_party/abseil-cpp/absl/random/internal/uniform_helper.h +244 -0
  1538. data/third_party/abseil-cpp/absl/random/internal/wide_multiply.h +96 -0
  1539. data/third_party/abseil-cpp/absl/random/log_uniform_int_distribution.h +256 -0
  1540. data/third_party/abseil-cpp/absl/random/poisson_distribution.h +261 -0
  1541. data/third_party/abseil-cpp/absl/random/random.h +189 -0
  1542. data/third_party/abseil-cpp/absl/random/seed_gen_exception.cc +46 -0
  1543. data/third_party/abseil-cpp/absl/random/seed_gen_exception.h +55 -0
  1544. data/third_party/abseil-cpp/absl/random/seed_sequences.cc +29 -0
  1545. data/third_party/abseil-cpp/absl/random/seed_sequences.h +111 -0
  1546. data/third_party/abseil-cpp/absl/random/uniform_int_distribution.h +275 -0
  1547. data/third_party/abseil-cpp/absl/random/uniform_real_distribution.h +202 -0
  1548. data/third_party/abseil-cpp/absl/random/zipf_distribution.h +272 -0
  1549. data/third_party/abseil-cpp/absl/status/internal/status_internal.h +22 -5
  1550. data/third_party/abseil-cpp/absl/status/status.cc +183 -19
  1551. data/third_party/abseil-cpp/absl/status/status.h +41 -27
  1552. data/third_party/abseil-cpp/absl/status/statusor.cc +34 -2
  1553. data/third_party/abseil-cpp/absl/status/statusor.h +40 -24
  1554. data/third_party/abseil-cpp/absl/strings/ascii.h +4 -4
  1555. data/third_party/abseil-cpp/absl/strings/charconv.cc +3 -3
  1556. data/third_party/abseil-cpp/absl/strings/charconv.h +3 -2
  1557. data/third_party/abseil-cpp/absl/strings/cord.cc +469 -1094
  1558. data/third_party/abseil-cpp/absl/strings/cord.h +392 -144
  1559. data/third_party/abseil-cpp/absl/strings/cord_analysis.cc +188 -0
  1560. data/third_party/abseil-cpp/absl/strings/cord_analysis.h +44 -0
  1561. data/third_party/abseil-cpp/absl/strings/cord_buffer.cc +30 -0
  1562. data/third_party/abseil-cpp/absl/strings/cord_buffer.h +572 -0
  1563. data/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc +1 -1
  1564. data/third_party/abseil-cpp/absl/strings/internal/cord_data_edge.h +63 -0
  1565. data/third_party/abseil-cpp/absl/strings/internal/cord_internal.cc +23 -29
  1566. data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +208 -96
  1567. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +1228 -0
  1568. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h +924 -0
  1569. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc +187 -0
  1570. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.h +267 -0
  1571. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.cc +69 -0
  1572. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.h +212 -0
  1573. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.cc +62 -0
  1574. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.h +50 -0
  1575. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_crc.cc +54 -0
  1576. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_crc.h +102 -0
  1577. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h +60 -19
  1578. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.cc +48 -172
  1579. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.h +42 -24
  1580. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring_reader.h +4 -0
  1581. data/third_party/abseil-cpp/absl/strings/internal/cordz_functions.cc +96 -0
  1582. data/third_party/abseil-cpp/absl/strings/internal/cordz_functions.h +85 -0
  1583. data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.cc +139 -0
  1584. data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.h +131 -0
  1585. data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +418 -0
  1586. data/third_party/abseil-cpp/absl/strings/internal/cordz_info.h +298 -0
  1587. data/third_party/abseil-cpp/absl/strings/internal/cordz_statistics.h +88 -0
  1588. data/third_party/abseil-cpp/absl/strings/internal/cordz_update_scope.h +71 -0
  1589. data/third_party/abseil-cpp/absl/strings/internal/cordz_update_tracker.h +123 -0
  1590. data/third_party/abseil-cpp/absl/strings/internal/escaping.cc +6 -5
  1591. data/third_party/abseil-cpp/absl/strings/internal/ostringstream.cc +1 -1
  1592. data/third_party/abseil-cpp/absl/strings/internal/resize_uninitialized.h +48 -2
  1593. data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +1 -1
  1594. data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +9 -1
  1595. data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc +3 -4
  1596. data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +39 -8
  1597. data/third_party/abseil-cpp/absl/strings/internal/str_format/checker.h +7 -2
  1598. data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +10 -11
  1599. data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +41 -20
  1600. data/third_party/abseil-cpp/absl/strings/internal/str_format/output.h +2 -1
  1601. data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc +62 -73
  1602. data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +28 -18
  1603. data/third_party/abseil-cpp/absl/strings/internal/str_join_internal.h +9 -6
  1604. data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +35 -35
  1605. data/third_party/abseil-cpp/absl/strings/internal/string_constant.h +10 -2
  1606. data/third_party/abseil-cpp/absl/strings/internal/utf8.cc +9 -9
  1607. data/third_party/abseil-cpp/absl/strings/numbers.cc +9 -9
  1608. data/third_party/abseil-cpp/absl/strings/numbers.h +60 -23
  1609. data/third_party/abseil-cpp/absl/strings/str_cat.cc +4 -4
  1610. data/third_party/abseil-cpp/absl/strings/str_cat.h +20 -13
  1611. data/third_party/abseil-cpp/absl/strings/str_format.h +1 -2
  1612. data/third_party/abseil-cpp/absl/strings/str_join.h +9 -15
  1613. data/third_party/abseil-cpp/absl/strings/str_split.h +1 -2
  1614. data/third_party/abseil-cpp/absl/strings/string_view.cc +18 -34
  1615. data/third_party/abseil-cpp/absl/strings/string_view.h +123 -41
  1616. data/third_party/abseil-cpp/absl/strings/strip.h +8 -6
  1617. data/third_party/abseil-cpp/absl/strings/substitute.cc +2 -1
  1618. data/third_party/abseil-cpp/absl/strings/substitute.h +109 -76
  1619. data/third_party/abseil-cpp/absl/synchronization/blocking_counter.cc +25 -15
  1620. data/third_party/abseil-cpp/absl/synchronization/blocking_counter.h +5 -3
  1621. data/third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.cc +9 -6
  1622. data/third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.h +0 -4
  1623. data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.cc +0 -4
  1624. data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.h +1 -6
  1625. data/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc +1 -26
  1626. data/third_party/abseil-cpp/absl/synchronization/internal/waiter.h +10 -4
  1627. data/third_party/abseil-cpp/absl/synchronization/mutex.cc +75 -40
  1628. data/third_party/abseil-cpp/absl/synchronization/mutex.h +20 -12
  1629. data/third_party/abseil-cpp/absl/synchronization/notification.h +3 -2
  1630. data/third_party/abseil-cpp/absl/time/civil_time.cc +1 -3
  1631. data/third_party/abseil-cpp/absl/time/duration.cc +5 -4
  1632. data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time_detail.h +11 -7
  1633. data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h +93 -20
  1634. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc +1 -1
  1635. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.h +2 -1
  1636. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc +83 -21
  1637. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +49 -0
  1638. data/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h +1 -1
  1639. data/third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc +2 -3
  1640. data/third_party/abseil-cpp/absl/time/time.h +82 -47
  1641. data/third_party/abseil-cpp/absl/types/bad_optional_access.h +1 -1
  1642. data/third_party/abseil-cpp/absl/types/bad_variant_access.h +2 -2
  1643. data/third_party/abseil-cpp/absl/types/internal/optional.h +8 -0
  1644. data/third_party/abseil-cpp/absl/types/internal/variant.h +3 -3
  1645. data/third_party/abseil-cpp/absl/types/optional.h +17 -14
  1646. data/third_party/abseil-cpp/absl/types/span.h +5 -4
  1647. data/third_party/boringssl-with-bazel/err_data.c +681 -677
  1648. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_bitstr.c +19 -11
  1649. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_object.c +41 -30
  1650. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_time.c +1 -1
  1651. data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_lib.c +59 -47
  1652. data/third_party/boringssl-with-bazel/src/crypto/asn1/asn_pack.c +24 -28
  1653. data/third_party/boringssl-with-bazel/src/crypto/asn1/f_int.c +5 -0
  1654. data/third_party/boringssl-with-bazel/src/crypto/asn1/internal.h +28 -0
  1655. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_dec.c +48 -272
  1656. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c +1 -0
  1657. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_typ.c +8 -6
  1658. data/third_party/boringssl-with-bazel/src/crypto/base64/base64.c +13 -0
  1659. data/third_party/boringssl-with-bazel/src/crypto/bytestring/ber.c +3 -1
  1660. data/third_party/boringssl-with-bazel/src/crypto/dsa/dsa.c +21 -0
  1661. data/third_party/boringssl-with-bazel/src/crypto/evp/evp_asn1.c +2 -2
  1662. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/cipher.c +12 -0
  1663. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/ecdsa.c +1 -2
  1664. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/self_check.c +7 -7
  1665. data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +2 -2
  1666. data/third_party/boringssl-with-bazel/src/crypto/mem.c +18 -0
  1667. data/third_party/boringssl-with-bazel/src/crypto/pkcs7/pkcs7.c +29 -0
  1668. data/third_party/boringssl-with-bazel/src/crypto/pkcs8/internal.h +0 -1
  1669. data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8.c +1 -1
  1670. data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8_x509.c +1 -1
  1671. data/third_party/boringssl-with-bazel/src/crypto/pool/internal.h +5 -1
  1672. data/third_party/boringssl-with-bazel/src/crypto/pool/pool.c +59 -23
  1673. data/third_party/boringssl-with-bazel/src/crypto/x509/asn1_gen.c +2 -18
  1674. data/third_party/boringssl-with-bazel/src/crypto/x509/internal.h +8 -2
  1675. data/third_party/boringssl-with-bazel/src/crypto/x509v3/internal.h +216 -11
  1676. data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_cache.c +1 -1
  1677. data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_data.c +1 -1
  1678. data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_lib.c +1 -1
  1679. data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_map.c +1 -1
  1680. data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_node.c +1 -1
  1681. data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_tree.c +1 -1
  1682. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_alt.c +1 -0
  1683. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_cpols.c +0 -1
  1684. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_lib.c +21 -4
  1685. data/third_party/boringssl-with-bazel/src/include/openssl/asn1.h +971 -253
  1686. data/third_party/boringssl-with-bazel/src/include/openssl/asn1t.h +3 -3
  1687. data/third_party/boringssl-with-bazel/src/include/openssl/base.h +0 -1
  1688. data/third_party/boringssl-with-bazel/src/include/openssl/base64.h +8 -0
  1689. data/third_party/boringssl-with-bazel/src/include/openssl/cipher.h +13 -1
  1690. data/third_party/boringssl-with-bazel/src/include/openssl/dh.h +4 -12
  1691. data/third_party/boringssl-with-bazel/src/include/openssl/dsa.h +27 -41
  1692. data/third_party/boringssl-with-bazel/src/include/openssl/ec_key.h +12 -27
  1693. data/third_party/boringssl-with-bazel/src/include/openssl/ecdsa.h +8 -10
  1694. data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +29 -55
  1695. data/third_party/boringssl-with-bazel/src/include/openssl/hpke.h +1 -1
  1696. data/third_party/boringssl-with-bazel/src/include/openssl/pkcs7.h +12 -13
  1697. data/third_party/boringssl-with-bazel/src/include/openssl/pkcs8.h +6 -1
  1698. data/third_party/boringssl-with-bazel/src/include/openssl/pool.h +7 -1
  1699. data/third_party/boringssl-with-bazel/src/include/openssl/rsa.h +24 -28
  1700. data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +29 -11
  1701. data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +12 -43
  1702. data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +4 -3
  1703. data/third_party/boringssl-with-bazel/src/ssl/internal.h +3 -3
  1704. data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +4 -0
  1705. data/third_party/boringssl-with-bazel/src/ssl/ssl_versions.cc +4 -0
  1706. data/third_party/cares/cares/include/ares.h +742 -0
  1707. data/third_party/cares/cares/include/ares_dns.h +112 -0
  1708. data/third_party/cares/cares/{ares_rules.h → include/ares_rules.h} +0 -0
  1709. data/third_party/cares/cares/include/ares_version.h +24 -0
  1710. data/third_party/cares/cares/src/lib/ares__close_sockets.c +61 -0
  1711. data/third_party/cares/cares/src/lib/ares__get_hostent.c +260 -0
  1712. data/third_party/cares/cares/src/lib/ares__parse_into_addrinfo.c +260 -0
  1713. data/third_party/cares/cares/{ares__read_line.c → src/lib/ares__read_line.c} +0 -0
  1714. data/third_party/cares/cares/src/lib/ares__readaddrinfo.c +264 -0
  1715. data/third_party/cares/cares/src/lib/ares__sortaddrinfo.c +499 -0
  1716. data/third_party/cares/cares/{ares__timeval.c → src/lib/ares__timeval.c} +0 -0
  1717. data/third_party/cares/cares/src/lib/ares_android.c +444 -0
  1718. data/third_party/cares/cares/src/lib/ares_android.h +27 -0
  1719. data/third_party/cares/cares/{ares_cancel.c → src/lib/ares_cancel.c} +0 -0
  1720. data/third_party/cares/cares/src/lib/ares_create_query.c +197 -0
  1721. data/third_party/cares/cares/src/lib/ares_data.c +240 -0
  1722. data/third_party/cares/cares/src/lib/ares_data.h +74 -0
  1723. data/third_party/cares/cares/{ares_destroy.c → src/lib/ares_destroy.c} +0 -0
  1724. data/third_party/cares/cares/src/lib/ares_expand_name.c +300 -0
  1725. data/third_party/cares/cares/src/lib/ares_expand_string.c +67 -0
  1726. data/third_party/cares/cares/{ares_fds.c → src/lib/ares_fds.c} +0 -0
  1727. data/third_party/cares/cares/src/lib/ares_free_hostent.c +43 -0
  1728. data/third_party/cares/cares/{ares_free_string.c → src/lib/ares_free_string.c} +0 -0
  1729. data/third_party/cares/cares/src/lib/ares_freeaddrinfo.c +59 -0
  1730. data/third_party/cares/cares/src/lib/ares_getaddrinfo.c +772 -0
  1731. data/third_party/cares/cares/src/lib/ares_getenv.c +28 -0
  1732. data/third_party/cares/cares/{ares_getenv.h → src/lib/ares_getenv.h} +0 -0
  1733. data/third_party/cares/cares/src/lib/ares_gethostbyaddr.c +287 -0
  1734. data/third_party/cares/cares/src/lib/ares_gethostbyname.c +534 -0
  1735. data/third_party/cares/cares/src/lib/ares_getnameinfo.c +447 -0
  1736. data/third_party/cares/cares/{ares_getsock.c → src/lib/ares_getsock.c} +0 -0
  1737. data/third_party/cares/cares/{ares_inet_net_pton.h → src/lib/ares_inet_net_pton.h} +0 -0
  1738. data/third_party/cares/cares/src/lib/ares_init.c +2654 -0
  1739. data/third_party/cares/cares/{ares_iphlpapi.h → src/lib/ares_iphlpapi.h} +0 -0
  1740. data/third_party/cares/cares/src/lib/ares_ipv6.h +85 -0
  1741. data/third_party/cares/cares/src/lib/ares_library_init.c +200 -0
  1742. data/third_party/cares/cares/src/lib/ares_library_init.h +43 -0
  1743. data/third_party/cares/cares/{ares_llist.c → src/lib/ares_llist.c} +0 -0
  1744. data/third_party/cares/cares/{ares_llist.h → src/lib/ares_llist.h} +0 -0
  1745. data/third_party/cares/cares/{ares_mkquery.c → src/lib/ares_mkquery.c} +0 -0
  1746. data/third_party/cares/cares/src/lib/ares_nameser.h +482 -0
  1747. data/third_party/cares/cares/{ares_nowarn.c → src/lib/ares_nowarn.c} +0 -0
  1748. data/third_party/cares/cares/{ares_nowarn.h → src/lib/ares_nowarn.h} +0 -0
  1749. data/third_party/cares/cares/{ares_options.c → src/lib/ares_options.c} +0 -0
  1750. data/third_party/cares/cares/src/lib/ares_parse_a_reply.c +209 -0
  1751. data/third_party/cares/cares/src/lib/ares_parse_aaaa_reply.c +212 -0
  1752. data/third_party/cares/cares/src/lib/ares_parse_caa_reply.c +199 -0
  1753. data/third_party/cares/cares/src/lib/ares_parse_mx_reply.c +164 -0
  1754. data/third_party/cares/cares/src/lib/ares_parse_naptr_reply.c +183 -0
  1755. data/third_party/cares/cares/src/lib/ares_parse_ns_reply.c +177 -0
  1756. data/third_party/cares/cares/src/lib/ares_parse_ptr_reply.c +228 -0
  1757. data/third_party/cares/cares/src/lib/ares_parse_soa_reply.c +179 -0
  1758. data/third_party/cares/cares/src/lib/ares_parse_srv_reply.c +168 -0
  1759. data/third_party/cares/cares/src/lib/ares_parse_txt_reply.c +214 -0
  1760. data/third_party/cares/cares/{ares_platform.c → src/lib/ares_platform.c} +0 -0
  1761. data/third_party/cares/cares/{ares_platform.h → src/lib/ares_platform.h} +0 -0
  1762. data/third_party/cares/cares/src/lib/ares_private.h +423 -0
  1763. data/third_party/cares/cares/src/lib/ares_process.c +1548 -0
  1764. data/third_party/cares/cares/src/lib/ares_query.c +180 -0
  1765. data/third_party/cares/cares/src/lib/ares_search.c +321 -0
  1766. data/third_party/cares/cares/src/lib/ares_send.c +131 -0
  1767. data/third_party/cares/cares/src/lib/ares_setup.h +220 -0
  1768. data/third_party/cares/cares/{ares_strcasecmp.c → src/lib/ares_strcasecmp.c} +0 -0
  1769. data/third_party/cares/cares/{ares_strcasecmp.h → src/lib/ares_strcasecmp.h} +0 -0
  1770. data/third_party/cares/cares/{ares_strdup.c → src/lib/ares_strdup.c} +0 -0
  1771. data/third_party/cares/cares/{ares_strdup.h → src/lib/ares_strdup.h} +0 -0
  1772. data/third_party/cares/cares/{ares_strerror.c → src/lib/ares_strerror.c} +0 -0
  1773. data/third_party/cares/cares/src/lib/ares_strsplit.c +178 -0
  1774. data/third_party/cares/cares/{ares_strsplit.h → src/lib/ares_strsplit.h} +0 -0
  1775. data/third_party/cares/cares/{ares_timeout.c → src/lib/ares_timeout.c} +0 -0
  1776. data/third_party/cares/cares/{ares_version.c → src/lib/ares_version.c} +0 -0
  1777. data/third_party/cares/cares/{ares_writev.c → src/lib/ares_writev.c} +0 -0
  1778. data/third_party/cares/cares/src/lib/ares_writev.h +36 -0
  1779. data/third_party/cares/cares/{bitncmp.c → src/lib/bitncmp.c} +0 -0
  1780. data/third_party/cares/cares/{bitncmp.h → src/lib/bitncmp.h} +0 -0
  1781. data/third_party/cares/cares/src/lib/config-dos.h +115 -0
  1782. data/third_party/cares/cares/{config-win32.h → src/lib/config-win32.h} +0 -0
  1783. data/third_party/cares/cares/src/lib/inet_net_pton.c +444 -0
  1784. data/third_party/cares/cares/src/lib/inet_ntop.c +201 -0
  1785. data/third_party/cares/cares/{setup_once.h → src/lib/setup_once.h} +0 -0
  1786. data/third_party/cares/cares/{windows_port.c → src/lib/windows_port.c} +0 -0
  1787. data/third_party/upb/third_party/utf8_range/naive.c +92 -0
  1788. data/third_party/upb/third_party/utf8_range/range2-neon.c +157 -0
  1789. data/third_party/upb/third_party/utf8_range/range2-sse.c +170 -0
  1790. data/third_party/upb/third_party/utf8_range/utf8_range.h +9 -0
  1791. data/third_party/upb/upb/arena.c +277 -0
  1792. data/third_party/upb/upb/arena.h +225 -0
  1793. data/third_party/upb/upb/array.c +114 -0
  1794. data/third_party/upb/upb/array.h +83 -0
  1795. data/third_party/upb/upb/collections.h +36 -0
  1796. data/third_party/upb/upb/decode.c +832 -382
  1797. data/third_party/upb/upb/decode.h +44 -17
  1798. data/third_party/upb/upb/decode_fast.c +304 -302
  1799. data/third_party/upb/upb/decode_fast.h +18 -18
  1800. data/third_party/upb/upb/def.c +2083 -982
  1801. data/third_party/upb/upb/def.h +339 -260
  1802. data/third_party/upb/upb/def.hpp +144 -171
  1803. data/third_party/upb/upb/encode.c +287 -185
  1804. data/third_party/upb/upb/encode.h +24 -16
  1805. data/third_party/upb/upb/extension_registry.c +93 -0
  1806. data/third_party/upb/upb/extension_registry.h +84 -0
  1807. data/third_party/upb/upb/internal/decode.h +211 -0
  1808. data/third_party/upb/upb/internal/table.h +385 -0
  1809. data/third_party/upb/upb/internal/upb.h +68 -0
  1810. data/third_party/upb/upb/internal/vsnprintf_compat.h +52 -0
  1811. data/third_party/upb/upb/json_decode.c +1512 -0
  1812. data/third_party/upb/upb/json_decode.h +47 -0
  1813. data/third_party/upb/upb/json_encode.c +780 -0
  1814. data/third_party/upb/upb/json_encode.h +65 -0
  1815. data/third_party/upb/upb/map.c +108 -0
  1816. data/third_party/upb/upb/map.h +117 -0
  1817. data/third_party/upb/upb/message_value.h +66 -0
  1818. data/third_party/upb/upb/mini_table.c +1147 -0
  1819. data/third_party/upb/upb/mini_table.h +189 -0
  1820. data/third_party/upb/upb/mini_table.hpp +112 -0
  1821. data/third_party/upb/upb/msg.c +132 -161
  1822. data/third_party/upb/upb/msg.h +18 -55
  1823. data/third_party/upb/upb/msg_internal.h +404 -254
  1824. data/third_party/upb/upb/port_def.inc +10 -1
  1825. data/third_party/upb/upb/port_undef.inc +2 -0
  1826. data/third_party/upb/upb/reflection.c +203 -280
  1827. data/third_party/upb/upb/reflection.h +40 -126
  1828. data/third_party/upb/upb/reflection.hpp +6 -6
  1829. data/third_party/upb/upb/status.c +86 -0
  1830. data/third_party/upb/upb/status.h +66 -0
  1831. data/third_party/upb/upb/table.c +233 -149
  1832. data/third_party/upb/upb/table_internal.h +9 -324
  1833. data/third_party/upb/upb/text_encode.c +116 -92
  1834. data/third_party/upb/upb/text_encode.h +10 -10
  1835. data/third_party/upb/upb/upb.c +34 -273
  1836. data/third_party/upb/upb/upb.h +79 -262
  1837. data/third_party/upb/upb/upb.hpp +31 -28
  1838. data/third_party/xxhash/xxhash.h +607 -352
  1839. data/third_party/zlib/compress.c +3 -3
  1840. data/third_party/zlib/crc32.c +975 -292
  1841. data/third_party/zlib/crc32.h +9441 -436
  1842. data/third_party/zlib/deflate.c +183 -129
  1843. data/third_party/zlib/deflate.h +12 -15
  1844. data/third_party/zlib/gzguts.h +3 -2
  1845. data/third_party/zlib/gzlib.c +6 -4
  1846. data/third_party/zlib/gzread.c +8 -12
  1847. data/third_party/zlib/gzwrite.c +26 -14
  1848. data/third_party/zlib/infback.c +12 -8
  1849. data/third_party/zlib/inffast.c +14 -14
  1850. data/third_party/zlib/inflate.c +44 -10
  1851. data/third_party/zlib/inflate.h +3 -2
  1852. data/third_party/zlib/inftrees.c +3 -3
  1853. data/third_party/zlib/inftrees.h +1 -1
  1854. data/third_party/zlib/trees.c +85 -107
  1855. data/third_party/zlib/uncompr.c +2 -2
  1856. data/third_party/zlib/zconf.h +16 -3
  1857. data/third_party/zlib/zlib.h +129 -106
  1858. data/third_party/zlib/zutil.c +11 -9
  1859. data/third_party/zlib/zutil.h +13 -9
  1860. metadata +713 -295
  1861. data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +0 -392
  1862. data/src/core/ext/filters/client_channel/http_connect_handshaker.h +0 -42
  1863. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h +0 -44
  1864. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +0 -83
  1865. data/src/core/ext/filters/client_channel/lb_policy/xds/xds.h +0 -60
  1866. data/src/core/ext/filters/client_channel/lb_policy.cc +0 -131
  1867. data/src/core/ext/filters/client_channel/lb_policy.h +0 -425
  1868. data/src/core/ext/filters/client_channel/lb_policy_factory.h +0 -48
  1869. data/src/core/ext/filters/client_channel/lb_policy_registry.cc +0 -185
  1870. data/src/core/ext/filters/client_channel/lb_policy_registry.h +0 -65
  1871. data/src/core/ext/filters/client_channel/proxy_mapper.h +0 -54
  1872. data/src/core/ext/filters/client_channel/proxy_mapper_registry.cc +0 -89
  1873. data/src/core/ext/filters/client_channel/proxy_mapper_registry.h +0 -50
  1874. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc +0 -31
  1875. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc +0 -28
  1876. data/src/core/ext/filters/client_channel/resolver.cc +0 -87
  1877. data/src/core/ext/filters/client_channel/resolver.h +0 -136
  1878. data/src/core/ext/filters/client_channel/resolver_factory.h +0 -75
  1879. data/src/core/ext/filters/client_channel/resolver_registry.cc +0 -195
  1880. data/src/core/ext/filters/client_channel/resolver_registry.h +0 -89
  1881. data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +0 -189
  1882. data/src/core/ext/filters/client_channel/resolver_result_parsing.h +0 -99
  1883. data/src/core/ext/filters/client_channel/server_address.cc +0 -170
  1884. data/src/core/ext/filters/client_channel/server_address.h +0 -144
  1885. data/src/core/ext/filters/client_channel/subchannel_interface.h +0 -130
  1886. data/src/core/ext/filters/client_idle/client_idle_filter.cc +0 -264
  1887. data/src/core/ext/filters/client_idle/idle_filter_state.cc +0 -96
  1888. data/src/core/ext/filters/client_idle/idle_filter_state.h +0 -66
  1889. data/src/core/ext/filters/fault_injection/service_config_parser.cc +0 -181
  1890. data/src/core/ext/filters/fault_injection/service_config_parser.h +0 -85
  1891. data/src/core/ext/filters/max_age/max_age_filter.cc +0 -560
  1892. data/src/core/ext/filters/max_age/max_age_filter.h +0 -26
  1893. data/src/core/ext/service_config/service_config.cc +0 -227
  1894. data/src/core/ext/service_config/service_config.h +0 -127
  1895. data/src/core/ext/service_config/service_config_call_data.h +0 -72
  1896. data/src/core/ext/service_config/service_config_parser.cc +0 -89
  1897. data/src/core/ext/service_config/service_config_parser.h +0 -97
  1898. data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +0 -119
  1899. data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc +0 -95
  1900. data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +0 -189
  1901. data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +0 -53
  1902. data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +0 -83
  1903. data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc +0 -125
  1904. data/src/core/ext/transport/chttp2/transport/chttp2_plugin.cc +0 -37
  1905. data/src/core/ext/transport/chttp2/transport/hpack_encoder_index.h +0 -107
  1906. data/src/core/ext/transport/chttp2/transport/hpack_utils.cc +0 -46
  1907. data/src/core/ext/transport/chttp2/transport/hpack_utils.h +0 -30
  1908. data/src/core/ext/transport/chttp2/transport/popularity_count.h +0 -60
  1909. data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c +0 -27
  1910. data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h +0 -62
  1911. data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c +0 -27
  1912. data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h +0 -62
  1913. data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c +0 -27
  1914. data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h +0 -62
  1915. data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c +0 -27
  1916. data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h +0 -62
  1917. data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c +0 -27
  1918. data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h +0 -62
  1919. data/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c +0 -72
  1920. data/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.h +0 -35
  1921. data/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c +0 -73
  1922. data/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.h +0 -35
  1923. data/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c +0 -72
  1924. data/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.h +0 -35
  1925. data/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c +0 -80
  1926. data/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.h +0 -35
  1927. data/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c +0 -74
  1928. data/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.h +0 -35
  1929. data/src/core/ext/xds/certificate_provider_factory.h +0 -61
  1930. data/src/core/ext/xds/certificate_provider_registry.cc +0 -103
  1931. data/src/core/ext/xds/certificate_provider_registry.h +0 -57
  1932. data/src/core/lib/avl/avl.cc +0 -306
  1933. data/src/core/lib/channel/handshaker.cc +0 -222
  1934. data/src/core/lib/channel/handshaker.h +0 -161
  1935. data/src/core/lib/channel/handshaker_factory.h +0 -50
  1936. data/src/core/lib/channel/handshaker_registry.cc +0 -50
  1937. data/src/core/lib/channel/handshaker_registry.h +0 -71
  1938. data/src/core/lib/compression/algorithm_metadata.h +0 -62
  1939. data/src/core/lib/compression/compression_args.cc +0 -138
  1940. data/src/core/lib/compression/compression_args.h +0 -56
  1941. data/src/core/lib/compression/stream_compression.cc +0 -81
  1942. data/src/core/lib/compression/stream_compression.h +0 -117
  1943. data/src/core/lib/compression/stream_compression_gzip.cc +0 -231
  1944. data/src/core/lib/compression/stream_compression_gzip.h +0 -28
  1945. data/src/core/lib/compression/stream_compression_identity.cc +0 -91
  1946. data/src/core/lib/compression/stream_compression_identity.h +0 -29
  1947. data/src/core/lib/event_engine/endpoint_config.cc +0 -45
  1948. data/src/core/lib/event_engine/endpoint_config_internal.h +0 -42
  1949. data/src/core/lib/event_engine/event_engine.cc +0 -50
  1950. data/src/core/lib/event_engine/sockaddr.cc +0 -40
  1951. data/src/core/lib/event_engine/sockaddr.h +0 -44
  1952. data/src/core/lib/gpr/env.h +0 -40
  1953. data/src/core/lib/gpr/env_linux.cc +0 -75
  1954. data/src/core/lib/gpr/env_posix.cc +0 -46
  1955. data/src/core/lib/gpr/env_windows.cc +0 -74
  1956. data/src/core/lib/gpr/murmur_hash.cc +0 -82
  1957. data/src/core/lib/gpr/murmur_hash.h +0 -29
  1958. data/src/core/lib/gpr/string_windows.h +0 -32
  1959. data/src/core/lib/gpr/tls.h +0 -151
  1960. data/src/core/lib/gprpp/arena.cc +0 -104
  1961. data/src/core/lib/gprpp/arena.h +0 -131
  1962. data/src/core/lib/iomgr/endpoint_pair_event_engine.cc +0 -32
  1963. data/src/core/lib/iomgr/error_internal.h +0 -66
  1964. data/src/core/lib/iomgr/ev_epollex_linux.cc +0 -1654
  1965. data/src/core/lib/iomgr/ev_epollex_linux.h +0 -30
  1966. data/src/core/lib/iomgr/event_engine/closure.cc +0 -77
  1967. data/src/core/lib/iomgr/event_engine/closure.h +0 -42
  1968. data/src/core/lib/iomgr/event_engine/endpoint.cc +0 -173
  1969. data/src/core/lib/iomgr/event_engine/endpoint.h +0 -52
  1970. data/src/core/lib/iomgr/event_engine/iomgr.cc +0 -104
  1971. data/src/core/lib/iomgr/event_engine/iomgr.h +0 -42
  1972. data/src/core/lib/iomgr/event_engine/pollset.cc +0 -88
  1973. data/src/core/lib/iomgr/event_engine/pollset.h +0 -25
  1974. data/src/core/lib/iomgr/event_engine/promise.h +0 -51
  1975. data/src/core/lib/iomgr/event_engine/resolved_address_internal.cc +0 -41
  1976. data/src/core/lib/iomgr/event_engine/resolved_address_internal.h +0 -35
  1977. data/src/core/lib/iomgr/event_engine/resolver.cc +0 -114
  1978. data/src/core/lib/iomgr/event_engine/tcp.cc +0 -293
  1979. data/src/core/lib/iomgr/event_engine/timer.cc +0 -62
  1980. data/src/core/lib/iomgr/executor/mpmcqueue.cc +0 -182
  1981. data/src/core/lib/iomgr/executor/mpmcqueue.h +0 -171
  1982. data/src/core/lib/iomgr/executor/threadpool.cc +0 -136
  1983. data/src/core/lib/iomgr/executor/threadpool.h +0 -150
  1984. data/src/core/lib/iomgr/iomgr_custom.cc +0 -79
  1985. data/src/core/lib/iomgr/iomgr_custom.h +0 -49
  1986. data/src/core/lib/iomgr/is_epollexclusive_available.cc +0 -119
  1987. data/src/core/lib/iomgr/is_epollexclusive_available.h +0 -36
  1988. data/src/core/lib/iomgr/pollset_custom.cc +0 -105
  1989. data/src/core/lib/iomgr/pollset_custom.h +0 -37
  1990. data/src/core/lib/iomgr/pollset_set_custom.cc +0 -47
  1991. data/src/core/lib/iomgr/pollset_set_custom.h +0 -26
  1992. data/src/core/lib/iomgr/resolve_address_custom.cc +0 -169
  1993. data/src/core/lib/iomgr/resolve_address_custom.h +0 -44
  1994. data/src/core/lib/iomgr/resource_quota.cc +0 -1106
  1995. data/src/core/lib/iomgr/resource_quota.h +0 -226
  1996. data/src/core/lib/iomgr/sys_epoll_wrapper.h +0 -30
  1997. data/src/core/lib/iomgr/tcp_client_custom.cc +0 -152
  1998. data/src/core/lib/iomgr/tcp_custom.cc +0 -377
  1999. data/src/core/lib/iomgr/tcp_custom.h +0 -86
  2000. data/src/core/lib/iomgr/tcp_server_custom.cc +0 -467
  2001. data/src/core/lib/iomgr/time_averaged_stats.cc +0 -64
  2002. data/src/core/lib/iomgr/time_averaged_stats.h +0 -72
  2003. data/src/core/lib/iomgr/timer_custom.cc +0 -96
  2004. data/src/core/lib/iomgr/timer_custom.h +0 -43
  2005. data/src/core/lib/iomgr/work_serializer.cc +0 -155
  2006. data/src/core/lib/iomgr/work_serializer.h +0 -81
  2007. data/src/core/lib/profiling/basic_timers.cc +0 -295
  2008. data/src/core/lib/profiling/stap_timers.cc +0 -50
  2009. data/src/core/lib/profiling/timers.h +0 -94
  2010. data/src/core/lib/security/authorization/sdk_server_authz_filter.cc +0 -171
  2011. data/src/core/lib/security/authorization/sdk_server_authz_filter.h +0 -67
  2012. data/src/core/lib/security/credentials/credentials_metadata.cc +0 -61
  2013. data/src/core/lib/security/security_connector/load_system_roots_linux.cc +0 -171
  2014. data/src/core/lib/security/security_connector/load_system_roots_linux.h +0 -46
  2015. data/src/core/lib/slice/slice_api.cc +0 -39
  2016. data/src/core/lib/slice/slice_intern.cc +0 -367
  2017. data/src/core/lib/slice/slice_refcount.cc +0 -17
  2018. data/src/core/lib/slice/slice_refcount_base.h +0 -173
  2019. data/src/core/lib/slice/slice_split.cc +0 -100
  2020. data/src/core/lib/slice/slice_split.h +0 -40
  2021. data/src/core/lib/slice/slice_utils.h +0 -200
  2022. data/src/core/lib/slice/static_slice.cc +0 -529
  2023. data/src/core/lib/slice/static_slice.h +0 -331
  2024. data/src/core/lib/surface/init_secure.cc +0 -103
  2025. data/src/core/lib/transport/byte_stream.cc +0 -158
  2026. data/src/core/lib/transport/byte_stream.h +0 -166
  2027. data/src/core/lib/transport/metadata.cc +0 -714
  2028. data/src/core/lib/transport/metadata.h +0 -449
  2029. data/src/core/lib/transport/static_metadata.cc +0 -1117
  2030. data/src/core/lib/transport/static_metadata.h +0 -340
  2031. data/src/core/lib/transport/status_metadata.cc +0 -63
  2032. data/src/core/lib/transport/status_metadata.h +0 -48
  2033. data/third_party/abseil-cpp/absl/base/internal/exponential_biased.cc +0 -93
  2034. data/third_party/abseil-cpp/absl/base/internal/exponential_biased.h +0 -130
  2035. data/third_party/abseil-cpp/absl/container/internal/have_sse.h +0 -50
  2036. data/third_party/abseil-cpp/absl/hash/internal/wyhash.cc +0 -111
  2037. data/third_party/abseil-cpp/absl/hash/internal/wyhash.h +0 -48
  2038. data/third_party/boringssl-with-bazel/src/crypto/asn1/f_enum.c +0 -93
  2039. data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_int.h +0 -217
  2040. data/third_party/cares/cares/ares.h +0 -670
  2041. data/third_party/cares/cares/ares__close_sockets.c +0 -61
  2042. data/third_party/cares/cares/ares__get_hostent.c +0 -261
  2043. data/third_party/cares/cares/ares_create_query.c +0 -206
  2044. data/third_party/cares/cares/ares_data.c +0 -222
  2045. data/third_party/cares/cares/ares_data.h +0 -72
  2046. data/third_party/cares/cares/ares_dns.h +0 -103
  2047. data/third_party/cares/cares/ares_expand_name.c +0 -209
  2048. data/third_party/cares/cares/ares_expand_string.c +0 -70
  2049. data/third_party/cares/cares/ares_free_hostent.c +0 -41
  2050. data/third_party/cares/cares/ares_getenv.c +0 -30
  2051. data/third_party/cares/cares/ares_gethostbyaddr.c +0 -294
  2052. data/third_party/cares/cares/ares_gethostbyname.c +0 -529
  2053. data/third_party/cares/cares/ares_getnameinfo.c +0 -453
  2054. data/third_party/cares/cares/ares_getopt.c +0 -122
  2055. data/third_party/cares/cares/ares_getopt.h +0 -53
  2056. data/third_party/cares/cares/ares_init.c +0 -2615
  2057. data/third_party/cares/cares/ares_ipv6.h +0 -78
  2058. data/third_party/cares/cares/ares_library_init.c +0 -195
  2059. data/third_party/cares/cares/ares_library_init.h +0 -43
  2060. data/third_party/cares/cares/ares_parse_a_reply.c +0 -264
  2061. data/third_party/cares/cares/ares_parse_aaaa_reply.c +0 -264
  2062. data/third_party/cares/cares/ares_parse_mx_reply.c +0 -170
  2063. data/third_party/cares/cares/ares_parse_naptr_reply.c +0 -194
  2064. data/third_party/cares/cares/ares_parse_ns_reply.c +0 -183
  2065. data/third_party/cares/cares/ares_parse_ptr_reply.c +0 -221
  2066. data/third_party/cares/cares/ares_parse_soa_reply.c +0 -133
  2067. data/third_party/cares/cares/ares_parse_srv_reply.c +0 -179
  2068. data/third_party/cares/cares/ares_parse_txt_reply.c +0 -220
  2069. data/third_party/cares/cares/ares_private.h +0 -382
  2070. data/third_party/cares/cares/ares_process.c +0 -1473
  2071. data/third_party/cares/cares/ares_query.c +0 -186
  2072. data/third_party/cares/cares/ares_search.c +0 -323
  2073. data/third_party/cares/cares/ares_send.c +0 -137
  2074. data/third_party/cares/cares/ares_setup.h +0 -217
  2075. data/third_party/cares/cares/ares_strsplit.c +0 -174
  2076. data/third_party/cares/cares/ares_version.h +0 -24
  2077. data/third_party/cares/cares/inet_net_pton.c +0 -450
  2078. data/third_party/cares/cares/inet_ntop.c +0 -207
  2079. data/third_party/upb/upb/decode_internal.h +0 -193
  2080. data/third_party/upb/upb/upb_internal.h +0 -58
@@ -20,60 +20,70 @@
20
20
 
21
21
  #include <inttypes.h>
22
22
  #include <limits.h>
23
- #include <stdbool.h>
24
- #include <stdio.h>
25
- #include <string.h>
26
23
 
24
+ #include <algorithm>
25
+ #include <functional>
26
+ #include <new>
27
27
  #include <set>
28
+ #include <vector>
28
29
 
29
- #include "absl/container/inlined_vector.h"
30
+ #include "absl/status/status.h"
31
+ #include "absl/status/statusor.h"
32
+ #include "absl/strings/cord.h"
30
33
  #include "absl/strings/numbers.h"
31
34
  #include "absl/strings/str_cat.h"
32
35
  #include "absl/strings/str_join.h"
33
36
  #include "absl/strings/string_view.h"
34
37
  #include "absl/types/optional.h"
38
+ #include "absl/types/variant.h"
35
39
 
36
- #include <grpc/support/alloc.h>
40
+ #include <grpc/event_engine/event_engine.h>
41
+ #include <grpc/impl/codegen/gpr_types.h>
42
+ #include <grpc/slice.h>
43
+ #include <grpc/status.h>
37
44
  #include <grpc/support/log.h>
38
45
  #include <grpc/support/string_util.h>
39
- #include <grpc/support/sync.h>
40
46
 
41
47
  #include "src/core/ext/filters/client_channel/backend_metric.h"
42
48
  #include "src/core/ext/filters/client_channel/backup_poller.h"
49
+ #include "src/core/ext/filters/client_channel/client_channel_channelz.h"
50
+ #include "src/core/ext/filters/client_channel/client_channel_service_config.h"
43
51
  #include "src/core/ext/filters/client_channel/config_selector.h"
44
52
  #include "src/core/ext/filters/client_channel/dynamic_filters.h"
45
53
  #include "src/core/ext/filters/client_channel/global_subchannel_pool.h"
46
- #include "src/core/ext/filters/client_channel/http_connect_handshaker.h"
47
54
  #include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
48
- #include "src/core/ext/filters/client_channel/lb_policy_registry.h"
49
55
  #include "src/core/ext/filters/client_channel/local_subchannel_pool.h"
50
- #include "src/core/ext/filters/client_channel/proxy_mapper_registry.h"
51
- #include "src/core/ext/filters/client_channel/resolver_registry.h"
52
- #include "src/core/ext/filters/client_channel/resolver_result_parsing.h"
53
56
  #include "src/core/ext/filters/client_channel/retry_filter.h"
54
57
  #include "src/core/ext/filters/client_channel/subchannel.h"
58
+ #include "src/core/ext/filters/client_channel/subchannel_interface_internal.h"
55
59
  #include "src/core/ext/filters/deadline/deadline_filter.h"
56
- #include "src/core/ext/service_config/service_config.h"
57
- #include "src/core/ext/service_config/service_config_call_data.h"
58
- #include "src/core/lib/backoff/backoff.h"
59
60
  #include "src/core/lib/channel/channel_args.h"
60
- #include "src/core/lib/channel/connected_channel.h"
61
+ #include "src/core/lib/channel/channel_stack.h"
62
+ #include "src/core/lib/channel/channel_trace.h"
61
63
  #include "src/core/lib/channel/status_util.h"
62
- #include "src/core/lib/gpr/string.h"
64
+ #include "src/core/lib/config/core_configuration.h"
65
+ #include "src/core/lib/debug/trace.h"
66
+ #include "src/core/lib/gpr/useful.h"
67
+ #include "src/core/lib/gprpp/debug_location.h"
68
+ #include "src/core/lib/gprpp/status_helper.h"
63
69
  #include "src/core/lib/gprpp/sync.h"
64
- #include "src/core/lib/iomgr/iomgr.h"
70
+ #include "src/core/lib/gprpp/work_serializer.h"
71
+ #include "src/core/lib/handshaker/proxy_mapper_registry.h"
72
+ #include "src/core/lib/iomgr/exec_ctx.h"
65
73
  #include "src/core/lib/iomgr/polling_entity.h"
66
- #include "src/core/lib/iomgr/work_serializer.h"
67
- #include "src/core/lib/profiling/timers.h"
74
+ #include "src/core/lib/iomgr/pollset_set.h"
75
+ #include "src/core/lib/json/json.h"
76
+ #include "src/core/lib/load_balancing/lb_policy_registry.h"
77
+ #include "src/core/lib/load_balancing/subchannel_interface.h"
78
+ #include "src/core/lib/resolver/resolver_registry.h"
79
+ #include "src/core/lib/resolver/server_address.h"
80
+ #include "src/core/lib/service_config/service_config_call_data.h"
81
+ #include "src/core/lib/service_config/service_config_impl.h"
68
82
  #include "src/core/lib/slice/slice_internal.h"
69
- #include "src/core/lib/slice/slice_string_helpers.h"
70
83
  #include "src/core/lib/surface/channel.h"
71
84
  #include "src/core/lib/transport/connectivity_state.h"
72
85
  #include "src/core/lib/transport/error_utils.h"
73
- #include "src/core/lib/transport/metadata.h"
74
86
  #include "src/core/lib/transport/metadata_batch.h"
75
- #include "src/core/lib/transport/static_metadata.h"
76
- #include "src/core/lib/transport/status_metadata.h"
77
87
 
78
88
  //
79
89
  // Client channel filter
@@ -84,12 +94,11 @@
84
94
 
85
95
  namespace grpc_core {
86
96
 
87
- using internal::ClientChannelGlobalParsedConfig;
88
97
  using internal::ClientChannelMethodParsedConfig;
89
- using internal::ClientChannelServiceConfigParser;
90
98
 
99
+ TraceFlag grpc_client_channel_trace(false, "client_channel");
91
100
  TraceFlag grpc_client_channel_call_trace(false, "client_channel_call");
92
- TraceFlag grpc_client_channel_routing_trace(false, "client_channel_routing");
101
+ TraceFlag grpc_client_channel_lb_call_trace(false, "client_channel_lb_call");
93
102
 
94
103
  //
95
104
  // ClientChannel::CallData definition
@@ -178,8 +187,6 @@ class ClientChannel::CallData {
178
187
 
179
188
  static void RecvTrailingMetadataReadyForConfigSelectorCommitCallback(
180
189
  void* arg, grpc_error_handle error);
181
- void InjectRecvTrailingMetadataReadyForConfigSelectorCommitCallback(
182
- grpc_transport_stream_op_batch* batch);
183
190
 
184
191
  void CreateDynamicCall(grpc_call_element* elem);
185
192
 
@@ -193,7 +200,7 @@ class ClientChannel::CallData {
193
200
 
194
201
  grpc_slice path_; // Request path.
195
202
  gpr_cycle_counter call_start_time_;
196
- grpc_millis deadline_;
203
+ Timestamp deadline_;
197
204
  Arena* arena_;
198
205
  grpc_call_stack* owning_call_;
199
206
  CallCombiner* call_combiner_;
@@ -227,7 +234,7 @@ class ClientChannel::CallData {
227
234
  grpc_transport_stream_op_batch* pending_batches_[MAX_PENDING_BATCHES] = {};
228
235
 
229
236
  // Set when we get a cancel_stream op.
230
- grpc_error_handle cancel_error_ = GRPC_ERROR_NONE;
237
+ grpc_error_handle cancel_error_;
231
238
  };
232
239
 
233
240
  //
@@ -236,6 +243,7 @@ class ClientChannel::CallData {
236
243
 
237
244
  const grpc_channel_filter ClientChannel::kFilterVtable = {
238
245
  ClientChannel::CallData::StartTransportStreamOpBatch,
246
+ nullptr,
239
247
  ClientChannel::StartTransportOp,
240
248
  sizeof(ClientChannel::CallData),
241
249
  ClientChannel::CallData::Init,
@@ -243,6 +251,7 @@ const grpc_channel_filter ClientChannel::kFilterVtable = {
243
251
  ClientChannel::CallData::Destroy,
244
252
  sizeof(ClientChannel),
245
253
  ClientChannel::Init,
254
+ grpc_channel_stack_no_post_init,
246
255
  ClientChannel::Destroy,
247
256
  ClientChannel::GetChannelInfo,
248
257
  "client-channel",
@@ -254,28 +263,6 @@ const grpc_channel_filter ClientChannel::kFilterVtable = {
254
263
 
255
264
  namespace {
256
265
 
257
- // Channel arg pointer vtable for GRPC_ARG_CLIENT_CHANNEL.
258
- void* ClientChannelArgCopy(void* p) { return p; }
259
- void ClientChannelArgDestroy(void* /*p*/) {}
260
- int ClientChannelArgCmp(void* p, void* q) { return QsortCompare(p, q); }
261
- const grpc_arg_pointer_vtable kClientChannelArgPointerVtable = {
262
- ClientChannelArgCopy, ClientChannelArgDestroy, ClientChannelArgCmp};
263
-
264
- // Channel arg pointer vtable for GRPC_ARG_SERVICE_CONFIG_OBJ.
265
- void* ServiceConfigObjArgCopy(void* p) {
266
- auto* service_config = static_cast<ServiceConfig*>(p);
267
- service_config->Ref().release();
268
- return p;
269
- }
270
- void ServiceConfigObjArgDestroy(void* p) {
271
- auto* service_config = static_cast<ServiceConfig*>(p);
272
- service_config->Unref();
273
- }
274
- int ServiceConfigObjArgCmp(void* p, void* q) { return QsortCompare(p, q); }
275
- const grpc_arg_pointer_vtable kServiceConfigObjArgPointerVtable = {
276
- ServiceConfigObjArgCopy, ServiceConfigObjArgDestroy,
277
- ServiceConfigObjArgCmp};
278
-
279
266
  class DynamicTerminationFilter {
280
267
  public:
281
268
  class CallData;
@@ -287,7 +274,7 @@ class DynamicTerminationFilter {
287
274
  GPR_ASSERT(args->is_last);
288
275
  GPR_ASSERT(elem->filter == &kFilterVtable);
289
276
  new (elem->channel_data) DynamicTerminationFilter(args->channel_args);
290
- return GRPC_ERROR_NONE;
277
+ return absl::OkStatus();
291
278
  }
292
279
 
293
280
  static void Destroy(grpc_channel_element* elem) {
@@ -314,7 +301,7 @@ class DynamicTerminationFilter::CallData {
314
301
  static grpc_error_handle Init(grpc_call_element* elem,
315
302
  const grpc_call_element_args* args) {
316
303
  new (elem->call_data) CallData(*args);
317
- return GRPC_ERROR_NONE;
304
+ return absl::OkStatus();
318
305
  }
319
306
 
320
307
  static void Destroy(grpc_call_element* elem,
@@ -330,7 +317,7 @@ class DynamicTerminationFilter::CallData {
330
317
  subchannel_call->SetAfterCallStackDestroy(then_schedule_closure);
331
318
  } else {
332
319
  // TODO(yashkt) : This can potentially be a Closure::Run
333
- ExecCtx::Run(DEBUG_LOCATION, then_schedule_closure, GRPC_ERROR_NONE);
320
+ ExecCtx::Run(DEBUG_LOCATION, then_schedule_closure, absl::OkStatus());
334
321
  }
335
322
  }
336
323
 
@@ -356,7 +343,7 @@ class DynamicTerminationFilter::CallData {
356
343
  args, pollent, nullptr,
357
344
  service_config_call_data->call_dispatch_controller(),
358
345
  /*is_transparent_retry=*/false);
359
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
346
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
360
347
  gpr_log(GPR_INFO,
361
348
  "chand=%p dynamic_termination_calld=%p: create lb_call=%p", chand,
362
349
  client_channel, calld->lb_call_.get());
@@ -365,17 +352,17 @@ class DynamicTerminationFilter::CallData {
365
352
 
366
353
  private:
367
354
  explicit CallData(const grpc_call_element_args& args)
368
- : path_(grpc_slice_ref_internal(args.path)),
355
+ : path_(CSliceRef(args.path)),
369
356
  deadline_(args.deadline),
370
357
  arena_(args.arena),
371
358
  owning_call_(args.call_stack),
372
359
  call_combiner_(args.call_combiner),
373
360
  call_context_(args.context) {}
374
361
 
375
- ~CallData() { grpc_slice_unref_internal(path_); }
362
+ ~CallData() { CSliceUnref(path_); }
376
363
 
377
364
  grpc_slice path_; // Request path.
378
- grpc_millis deadline_;
365
+ Timestamp deadline_;
379
366
  Arena* arena_;
380
367
  grpc_call_stack* owning_call_;
381
368
  CallCombiner* call_combiner_;
@@ -386,6 +373,7 @@ class DynamicTerminationFilter::CallData {
386
373
 
387
374
  const grpc_channel_filter DynamicTerminationFilter::kFilterVtable = {
388
375
  DynamicTerminationFilter::CallData::StartTransportStreamOpBatch,
376
+ nullptr,
389
377
  DynamicTerminationFilter::StartTransportOp,
390
378
  sizeof(DynamicTerminationFilter::CallData),
391
379
  DynamicTerminationFilter::CallData::Init,
@@ -393,6 +381,7 @@ const grpc_channel_filter DynamicTerminationFilter::kFilterVtable = {
393
381
  DynamicTerminationFilter::CallData::Destroy,
394
382
  sizeof(DynamicTerminationFilter),
395
383
  DynamicTerminationFilter::Init,
384
+ grpc_channel_stack_no_post_init,
396
385
  DynamicTerminationFilter::Destroy,
397
386
  DynamicTerminationFilter::GetChannelInfo,
398
387
  "dynamic_filter_termination",
@@ -411,22 +400,17 @@ class ClientChannel::ResolverResultHandler : public Resolver::ResultHandler {
411
400
  }
412
401
 
413
402
  ~ResolverResultHandler() override {
414
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
403
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
415
404
  gpr_log(GPR_INFO, "chand=%p: resolver shutdown complete", chand_);
416
405
  }
417
406
  GRPC_CHANNEL_STACK_UNREF(chand_->owning_stack_, "ResolverResultHandler");
418
407
  }
419
408
 
420
- void ReturnResult(Resolver::Result result) override
421
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
409
+ void ReportResult(Resolver::Result result) override
410
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
422
411
  chand_->OnResolverResultChangedLocked(std::move(result));
423
412
  }
424
413
 
425
- void ReturnError(grpc_error_handle error) override
426
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
427
- chand_->OnResolverErrorLocked(error);
428
- }
429
-
430
414
  private:
431
415
  ClientChannel* chand_;
432
416
  };
@@ -447,14 +431,13 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
447
431
  public:
448
432
  SubchannelWrapper(ClientChannel* chand, RefCountedPtr<Subchannel> subchannel,
449
433
  absl::optional<std::string> health_check_service_name)
450
- : SubchannelInterface(
451
- GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)
452
- ? "SubchannelWrapper"
453
- : nullptr),
434
+ : SubchannelInterface(GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)
435
+ ? "SubchannelWrapper"
436
+ : nullptr),
454
437
  chand_(chand),
455
438
  subchannel_(std::move(subchannel)),
456
439
  health_check_service_name_(std::move(health_check_service_name)) {
457
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
440
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
458
441
  gpr_log(GPR_INFO,
459
442
  "chand=%p: creating subchannel wrapper %p for subchannel %p",
460
443
  chand, this, subchannel_.get());
@@ -476,7 +459,7 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
476
459
  }
477
460
 
478
461
  ~SubchannelWrapper() override {
479
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
462
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
480
463
  gpr_log(GPR_INFO,
481
464
  "chand=%p: destroying subchannel wrapper %p for subchannel %p",
482
465
  chand_, this, subchannel_.get());
@@ -498,27 +481,21 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
498
481
  GRPC_CHANNEL_STACK_UNREF(chand_->owning_stack_, "SubchannelWrapper");
499
482
  }
500
483
 
501
- grpc_connectivity_state CheckConnectivityState() override {
502
- return subchannel_->CheckConnectivityState(health_check_service_name_);
503
- }
504
-
505
484
  void WatchConnectivityState(
506
- grpc_connectivity_state initial_state,
507
485
  std::unique_ptr<ConnectivityStateWatcherInterface> watcher) override
508
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
486
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
509
487
  auto& watcher_wrapper = watcher_map_[watcher.get()];
510
488
  GPR_ASSERT(watcher_wrapper == nullptr);
511
489
  watcher_wrapper = new WatcherWrapper(std::move(watcher),
512
- Ref(DEBUG_LOCATION, "WatcherWrapper"),
513
- initial_state);
490
+ Ref(DEBUG_LOCATION, "WatcherWrapper"));
514
491
  subchannel_->WatchConnectivityState(
515
- initial_state, health_check_service_name_,
492
+ health_check_service_name_,
516
493
  RefCountedPtr<Subchannel::ConnectivityStateWatcherInterface>(
517
494
  watcher_wrapper));
518
495
  }
519
496
 
520
497
  void CancelConnectivityStateWatch(ConnectivityStateWatcherInterface* watcher)
521
- override ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
498
+ override ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
522
499
  auto it = watcher_map_.find(watcher);
523
500
  GPR_ASSERT(it != watcher_map_.end());
524
501
  subchannel_->CancelConnectivityStateWatch(health_check_service_name_,
@@ -530,12 +507,17 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
530
507
  return subchannel_->connected_subchannel();
531
508
  }
532
509
 
533
- void AttemptToConnect() override { subchannel_->AttemptToConnect(); }
510
+ void RequestConnection() override { subchannel_->RequestConnection(); }
534
511
 
535
512
  void ResetBackoff() override { subchannel_->ResetBackoff(); }
536
513
 
537
- const grpc_channel_args* channel_args() override {
538
- return subchannel_->channel_args();
514
+ void AddDataWatcher(std::unique_ptr<DataWatcherInterface> watcher) override
515
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
516
+ std::unique_ptr<InternalSubchannelDataWatcherInterface> internal_watcher(
517
+ static_cast<InternalSubchannelDataWatcherInterface*>(
518
+ watcher.release()));
519
+ internal_watcher->SetSubchannel(subchannel_.get());
520
+ data_watchers_.push_back(std::move(internal_watcher));
539
521
  }
540
522
 
541
523
  void ThrottleKeepaliveTime(int new_keepalive_time) {
@@ -562,24 +544,21 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
562
544
  WatcherWrapper(
563
545
  std::unique_ptr<SubchannelInterface::ConnectivityStateWatcherInterface>
564
546
  watcher,
565
- RefCountedPtr<SubchannelWrapper> parent,
566
- grpc_connectivity_state initial_state)
567
- : watcher_(std::move(watcher)),
568
- parent_(std::move(parent)),
569
- last_seen_state_(initial_state) {}
547
+ RefCountedPtr<SubchannelWrapper> parent)
548
+ : watcher_(std::move(watcher)), parent_(std::move(parent)) {}
570
549
 
571
550
  ~WatcherWrapper() override {
572
551
  auto* parent = parent_.release(); // ref owned by lambda
573
552
  parent->chand_->work_serializer_->Run(
574
- [parent]()
575
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->chand_->work_serializer_) {
576
- parent->Unref(DEBUG_LOCATION, "WatcherWrapper");
577
- },
553
+ [parent]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(
554
+ *parent_->chand_->work_serializer_) {
555
+ parent->Unref(DEBUG_LOCATION, "WatcherWrapper");
556
+ },
578
557
  DEBUG_LOCATION);
579
558
  }
580
559
 
581
560
  void OnConnectivityStateChange() override {
582
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
561
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
583
562
  gpr_log(GPR_INFO,
584
563
  "chand=%p: connectivity change for subchannel wrapper %p "
585
564
  "subchannel %p; hopping into work_serializer",
@@ -587,11 +566,11 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
587
566
  }
588
567
  Ref().release(); // ref owned by lambda
589
568
  parent_->chand_->work_serializer_->Run(
590
- [this]()
591
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->chand_->work_serializer_) {
592
- ApplyUpdateInControlPlaneWorkSerializer();
593
- Unref();
594
- },
569
+ [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(
570
+ *parent_->chand_->work_serializer_) {
571
+ ApplyUpdateInControlPlaneWorkSerializer();
572
+ Unref();
573
+ },
595
574
  DEBUG_LOCATION);
596
575
  }
597
576
 
@@ -603,18 +582,15 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
603
582
  }
604
583
 
605
584
  WatcherWrapper* MakeReplacement() {
606
- auto* replacement =
607
- new WatcherWrapper(std::move(watcher_), parent_, last_seen_state_);
585
+ auto* replacement = new WatcherWrapper(std::move(watcher_), parent_);
608
586
  replacement_ = replacement;
609
587
  return replacement;
610
588
  }
611
589
 
612
- grpc_connectivity_state last_seen_state() const { return last_seen_state_; }
613
-
614
590
  private:
615
591
  void ApplyUpdateInControlPlaneWorkSerializer()
616
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->chand_->work_serializer_) {
617
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
592
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*parent_->chand_->work_serializer_) {
593
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
618
594
  gpr_log(GPR_INFO,
619
595
  "chand=%p: processing connectivity change in work serializer "
620
596
  "for subchannel wrapper %p subchannel %p "
@@ -631,7 +607,7 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
631
607
  &new_keepalive_time)) {
632
608
  if (new_keepalive_time > parent_->chand_->keepalive_time_) {
633
609
  parent_->chand_->keepalive_time_ = new_keepalive_time;
634
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
610
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
635
611
  gpr_log(GPR_INFO, "chand=%p: throttling keepalive time to %d",
636
612
  parent_->chand_, parent_->chand_->keepalive_time_);
637
613
  }
@@ -652,15 +628,21 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
652
628
  // Ignore update if the parent WatcherWrapper has been replaced
653
629
  // since this callback was scheduled.
654
630
  if (watcher_ != nullptr) {
655
- last_seen_state_ = state_change.state;
656
- watcher_->OnConnectivityStateChange(state_change.state);
631
+ // Propagate status only in state TF.
632
+ // We specifically want to avoid propagating the status for
633
+ // state IDLE that the real subchannel gave us only for the
634
+ // purpose of keepalive propagation.
635
+ if (state_change.state != GRPC_CHANNEL_TRANSIENT_FAILURE) {
636
+ state_change.status = absl::OkStatus();
637
+ }
638
+ watcher_->OnConnectivityStateChange(state_change.state,
639
+ state_change.status);
657
640
  }
658
641
  }
659
642
 
660
643
  std::unique_ptr<SubchannelInterface::ConnectivityStateWatcherInterface>
661
644
  watcher_;
662
645
  RefCountedPtr<SubchannelWrapper> parent_;
663
- grpc_connectivity_state last_seen_state_;
664
646
  WatcherWrapper* replacement_ = nullptr;
665
647
  };
666
648
 
@@ -673,7 +655,9 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
673
655
  // CancelConnectivityStateWatch() with its watcher, we know the
674
656
  // corresponding WrapperWatcher to cancel on the underlying subchannel.
675
657
  std::map<ConnectivityStateWatcherInterface*, WatcherWrapper*> watcher_map_
676
- ABSL_GUARDED_BY(&ClientChannel::work_serializer_);
658
+ ABSL_GUARDED_BY(*chand_->work_serializer_);
659
+ std::vector<std::unique_ptr<InternalSubchannelDataWatcherInterface>>
660
+ data_watchers_ ABSL_GUARDED_BY(*chand_->work_serializer_);
677
661
  };
678
662
 
679
663
  //
@@ -703,7 +687,7 @@ ClientChannel::ExternalConnectivityWatcher::ExternalConnectivityWatcher(
703
687
  }
704
688
  // Pass the ref from creating the object to Start().
705
689
  chand_->work_serializer_->Run(
706
- [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
690
+ [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
707
691
  // The ref is passed to AddWatcherLocked().
708
692
  AddWatcherLocked();
709
693
  },
@@ -747,14 +731,18 @@ void ClientChannel::ExternalConnectivityWatcher::Notify(
747
731
  chand_, on_complete_, /*cancel=*/false);
748
732
  // Report new state to the user.
749
733
  *state_ = state;
750
- ExecCtx::Run(DEBUG_LOCATION, on_complete_, GRPC_ERROR_NONE);
734
+ ExecCtx::Run(DEBUG_LOCATION, on_complete_, absl::OkStatus());
751
735
  // Hop back into the work_serializer to clean up.
752
736
  // Not needed in state SHUTDOWN, because the tracker will
753
737
  // automatically remove all watchers in that case.
738
+ // Note: The callback takes a ref in case the ref inside the state tracker
739
+ // gets removed before the callback runs via a SHUTDOWN notification.
754
740
  if (state != GRPC_CHANNEL_SHUTDOWN) {
741
+ Ref(DEBUG_LOCATION, "RemoveWatcherLocked()").release();
755
742
  chand_->work_serializer_->Run(
756
- [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
743
+ [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
757
744
  RemoveWatcherLocked();
745
+ Unref(DEBUG_LOCATION, "RemoveWatcherLocked()");
758
746
  },
759
747
  DEBUG_LOCATION);
760
748
  }
@@ -766,17 +754,21 @@ void ClientChannel::ExternalConnectivityWatcher::Cancel() {
766
754
  std::memory_order_relaxed)) {
767
755
  return; // Already done.
768
756
  }
769
- ExecCtx::Run(DEBUG_LOCATION, on_complete_, GRPC_ERROR_CANCELLED);
757
+ ExecCtx::Run(DEBUG_LOCATION, on_complete_, absl::CancelledError());
770
758
  // Hop back into the work_serializer to clean up.
759
+ // Note: The callback takes a ref in case the ref inside the state tracker
760
+ // gets removed before the callback runs via a SHUTDOWN notification.
761
+ Ref(DEBUG_LOCATION, "RemoveWatcherLocked()").release();
771
762
  chand_->work_serializer_->Run(
772
- [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
763
+ [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
773
764
  RemoveWatcherLocked();
765
+ Unref(DEBUG_LOCATION, "RemoveWatcherLocked()");
774
766
  },
775
767
  DEBUG_LOCATION);
776
768
  }
777
769
 
778
770
  void ClientChannel::ExternalConnectivityWatcher::AddWatcherLocked() {
779
- Closure::Run(DEBUG_LOCATION, watcher_timer_init_, GRPC_ERROR_NONE);
771
+ Closure::Run(DEBUG_LOCATION, watcher_timer_init_, absl::OkStatus());
780
772
  // Add new watcher. Pass the ref of the object from creation to OrphanablePtr.
781
773
  chand_->state_tracker_.AddWatcher(
782
774
  initial_state_, OrphanablePtr<ConnectivityStateWatcherInterface>(this));
@@ -800,7 +792,7 @@ class ClientChannel::ConnectivityWatcherAdder {
800
792
  watcher_(std::move(watcher)) {
801
793
  GRPC_CHANNEL_STACK_REF(chand_->owning_stack_, "ConnectivityWatcherAdder");
802
794
  chand_->work_serializer_->Run(
803
- [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
795
+ [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
804
796
  AddWatcherLocked();
805
797
  },
806
798
  DEBUG_LOCATION);
@@ -808,7 +800,7 @@ class ClientChannel::ConnectivityWatcherAdder {
808
800
 
809
801
  private:
810
802
  void AddWatcherLocked()
811
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
803
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
812
804
  chand_->state_tracker_.AddWatcher(initial_state_, std::move(watcher_));
813
805
  GRPC_CHANNEL_STACK_UNREF(chand_->owning_stack_, "ConnectivityWatcherAdder");
814
806
  delete this;
@@ -830,7 +822,7 @@ class ClientChannel::ConnectivityWatcherRemover {
830
822
  : chand_(chand), watcher_(watcher) {
831
823
  GRPC_CHANNEL_STACK_REF(chand_->owning_stack_, "ConnectivityWatcherRemover");
832
824
  chand_->work_serializer_->Run(
833
- [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
825
+ [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
834
826
  RemoveWatcherLocked();
835
827
  },
836
828
  DEBUG_LOCATION);
@@ -838,7 +830,7 @@ class ClientChannel::ConnectivityWatcherRemover {
838
830
 
839
831
  private:
840
832
  void RemoveWatcherLocked()
841
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
833
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
842
834
  chand_->state_tracker_.RemoveWatcher(watcher_);
843
835
  GRPC_CHANNEL_STACK_UNREF(chand_->owning_stack_,
844
836
  "ConnectivityWatcherRemover");
@@ -866,67 +858,23 @@ class ClientChannel::ClientChannelControlHelper
866
858
  }
867
859
 
868
860
  RefCountedPtr<SubchannelInterface> CreateSubchannel(
869
- ServerAddress address, const grpc_channel_args& args) override
870
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
861
+ ServerAddress address, const ChannelArgs& args) override
862
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
871
863
  if (chand_->resolver_ == nullptr) return nullptr; // Shutting down.
872
864
  // Determine health check service name.
873
865
  absl::optional<std::string> health_check_service_name;
874
- const char* health_check_service_name_arg = grpc_channel_args_find_string(
875
- &args, GRPC_ARG_HEALTH_CHECK_SERVICE_NAME);
876
- if (health_check_service_name_arg != nullptr) {
877
- bool inhibit_health_checking = grpc_channel_args_find_bool(
878
- &args, GRPC_ARG_INHIBIT_HEALTH_CHECKING, false);
879
- if (!inhibit_health_checking) {
880
- health_check_service_name = health_check_service_name_arg;
881
- }
866
+ if (!args.GetBool(GRPC_ARG_INHIBIT_HEALTH_CHECKING).value_or(false)) {
867
+ health_check_service_name =
868
+ args.GetOwnedString(GRPC_ARG_HEALTH_CHECK_SERVICE_NAME);
882
869
  }
883
870
  // Construct channel args for subchannel.
884
- // Remove channel args that should not affect subchannel uniqueness.
885
- absl::InlinedVector<const char*, 4> args_to_remove = {
886
- GRPC_ARG_HEALTH_CHECK_SERVICE_NAME,
887
- GRPC_ARG_INHIBIT_HEALTH_CHECKING,
888
- GRPC_ARG_CHANNELZ_CHANNEL_NODE,
889
- };
890
- // Add channel args needed for the subchannel.
891
- absl::InlinedVector<grpc_arg, 2> args_to_add = {
892
- SubchannelPoolInterface::CreateChannelArg(
893
- chand_->subchannel_pool_.get()),
894
- };
895
- // Check if default authority arg is already set.
896
- const char* default_authority =
897
- grpc_channel_args_find_string(&args, GRPC_ARG_DEFAULT_AUTHORITY);
898
- // Add args from subchannel address.
899
- if (address.args() != nullptr) {
900
- for (size_t j = 0; j < address.args()->num_args; ++j) {
901
- grpc_arg& arg = address.args()->args[j];
902
- if (strcmp(arg.key, GRPC_ARG_DEFAULT_AUTHORITY) == 0) {
903
- // Don't add default authority arg from subchannel address if
904
- // it's already set at the channel level -- the value from the
905
- // application should take precedence over what is set by the
906
- // resolver.
907
- if (default_authority != nullptr) continue;
908
- default_authority = arg.value.string;
909
- }
910
- args_to_add.emplace_back(arg);
911
- }
912
- }
913
- // If we haven't already set the default authority arg, add it from
914
- // the channel.
915
- if (default_authority == nullptr) {
916
- // Remove it, just in case it's actually present but is the wrong type.
917
- args_to_remove.push_back(GRPC_ARG_DEFAULT_AUTHORITY);
918
- args_to_add.push_back(grpc_channel_arg_string_create(
919
- const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY),
920
- const_cast<char*>(chand_->default_authority_.c_str())));
921
- }
922
- grpc_channel_args* new_args = grpc_channel_args_copy_and_add_and_remove(
923
- &args, args_to_remove.data(), args_to_remove.size(), args_to_add.data(),
924
- args_to_add.size());
871
+ ChannelArgs subchannel_args = ClientChannel::MakeSubchannelArgs(
872
+ args, address.args(), chand_->subchannel_pool_,
873
+ chand_->default_authority_);
925
874
  // Create subchannel.
926
875
  RefCountedPtr<Subchannel> subchannel =
927
876
  chand_->client_channel_factory_->CreateSubchannel(address.address(),
928
- new_args);
929
- grpc_channel_args_destroy(new_args);
877
+ subchannel_args);
930
878
  if (subchannel == nullptr) return nullptr;
931
879
  // Make sure the subchannel has updated keepalive time.
932
880
  subchannel->ThrottleKeepaliveTime(chand_->keepalive_time_);
@@ -938,10 +886,10 @@ class ClientChannel::ClientChannelControlHelper
938
886
  void UpdateState(
939
887
  grpc_connectivity_state state, const absl::Status& status,
940
888
  std::unique_ptr<LoadBalancingPolicy::SubchannelPicker> picker) override
941
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
889
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
942
890
  if (chand_->resolver_ == nullptr) return; // Shutting down.
943
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
944
- const char* extra = chand_->disconnect_error_ == GRPC_ERROR_NONE
891
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
892
+ const char* extra = chand_->disconnect_error_.ok()
945
893
  ? ""
946
894
  : " (ignoring -- channel shutting down)";
947
895
  gpr_log(GPR_INFO, "chand=%p: update: state=%s status=(%s) picker=%p%s",
@@ -949,16 +897,16 @@ class ClientChannel::ClientChannelControlHelper
949
897
  picker.get(), extra);
950
898
  }
951
899
  // Do update only if not shutting down.
952
- if (chand_->disconnect_error_ == GRPC_ERROR_NONE) {
900
+ if (chand_->disconnect_error_.ok()) {
953
901
  chand_->UpdateStateAndPickerLocked(state, status, "helper",
954
902
  std::move(picker));
955
903
  }
956
904
  }
957
905
 
958
906
  void RequestReresolution() override
959
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
907
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
960
908
  if (chand_->resolver_ == nullptr) return; // Shutting down.
961
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
909
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
962
910
  gpr_log(GPR_INFO, "chand=%p: started name re-resolving", chand_);
963
911
  }
964
912
  chand_->resolver_->RequestReresolutionLocked();
@@ -968,8 +916,12 @@ class ClientChannel::ClientChannelControlHelper
968
916
  return chand_->default_authority_;
969
917
  }
970
918
 
919
+ grpc_event_engine::experimental::EventEngine* GetEventEngine() override {
920
+ return chand_->owning_stack_->EventEngine();
921
+ }
922
+
971
923
  void AddTraceEvent(TraceSeverity severity, absl::string_view message) override
972
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
924
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
973
925
  if (chand_->resolver_ == nullptr) return; // Shutting down.
974
926
  if (chand_->channelz_node_ != nullptr) {
975
927
  chand_->channelz_node_->AddTraceEvent(
@@ -993,9 +945,9 @@ class ClientChannel::ClientChannelControlHelper
993
945
  // ClientChannel implementation
994
946
  //
995
947
 
996
- ClientChannel* ClientChannel::GetFromChannel(grpc_channel* channel) {
948
+ ClientChannel* ClientChannel::GetFromChannel(Channel* channel) {
997
949
  grpc_channel_element* elem =
998
- grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel));
950
+ grpc_channel_stack_last_element(channel->channel_stack());
999
951
  if (elem->filter != &kFilterVtable) return nullptr;
1000
952
  return static_cast<ClientChannel*>(elem->channel_data);
1001
953
  }
@@ -1004,7 +956,7 @@ grpc_error_handle ClientChannel::Init(grpc_channel_element* elem,
1004
956
  grpc_channel_element_args* args) {
1005
957
  GPR_ASSERT(args->is_last);
1006
958
  GPR_ASSERT(elem->filter == &kFilterVtable);
1007
- grpc_error_handle error = GRPC_ERROR_NONE;
959
+ grpc_error_handle error;
1008
960
  new (elem->channel_data) ClientChannel(args, &error);
1009
961
  return error;
1010
962
  }
@@ -1017,35 +969,29 @@ void ClientChannel::Destroy(grpc_channel_element* elem) {
1017
969
  namespace {
1018
970
 
1019
971
  RefCountedPtr<SubchannelPoolInterface> GetSubchannelPool(
1020
- const grpc_channel_args* args) {
1021
- const bool use_local_subchannel_pool = grpc_channel_args_find_bool(
1022
- args, GRPC_ARG_USE_LOCAL_SUBCHANNEL_POOL, false);
1023
- if (use_local_subchannel_pool) {
972
+ const ChannelArgs& args) {
973
+ if (args.GetBool(GRPC_ARG_USE_LOCAL_SUBCHANNEL_POOL).value_or(false)) {
1024
974
  return MakeRefCounted<LocalSubchannelPool>();
1025
975
  }
1026
976
  return GlobalSubchannelPool::instance();
1027
977
  }
1028
978
 
1029
- channelz::ChannelNode* GetChannelzNode(const grpc_channel_args* args) {
1030
- return grpc_channel_args_find_pointer<channelz::ChannelNode>(
1031
- args, GRPC_ARG_CHANNELZ_CHANNEL_NODE);
1032
- }
1033
-
1034
979
  } // namespace
1035
980
 
1036
981
  ClientChannel::ClientChannel(grpc_channel_element_args* args,
1037
982
  grpc_error_handle* error)
1038
- : deadline_checking_enabled_(
1039
- grpc_deadline_checking_enabled(args->channel_args)),
983
+ : channel_args_(ChannelArgs::FromC(args->channel_args)),
984
+ deadline_checking_enabled_(grpc_deadline_checking_enabled(channel_args_)),
1040
985
  owning_stack_(args->channel_stack),
1041
- client_channel_factory_(
1042
- ClientChannelFactory::GetFromChannelArgs(args->channel_args)),
1043
- channelz_node_(GetChannelzNode(args->channel_args)),
986
+ client_channel_factory_(channel_args_.GetObject<ClientChannelFactory>()),
987
+ channelz_node_(channel_args_.GetObject<channelz::ChannelNode>()),
1044
988
  interested_parties_(grpc_pollset_set_create()),
989
+ service_config_parser_index_(
990
+ internal::ClientChannelServiceConfigParser::ParserIndex()),
1045
991
  work_serializer_(std::make_shared<WorkSerializer>()),
1046
992
  state_tracker_("client_channel", GRPC_CHANNEL_IDLE),
1047
- subchannel_pool_(GetSubchannelPool(args->channel_args)) {
1048
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
993
+ subchannel_pool_(GetSubchannelPool(channel_args_)) {
994
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
1049
995
  gpr_log(GPR_INFO, "chand=%p: creating client_channel for channel stack %p",
1050
996
  this, owning_stack_);
1051
997
  }
@@ -1053,80 +999,76 @@ ClientChannel::ClientChannel(grpc_channel_element_args* args,
1053
999
  grpc_client_channel_start_backup_polling(interested_parties_);
1054
1000
  // Check client channel factory.
1055
1001
  if (client_channel_factory_ == nullptr) {
1056
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
1002
+ *error = GRPC_ERROR_CREATE(
1057
1003
  "Missing client channel factory in args for client channel filter");
1058
1004
  return;
1059
1005
  }
1060
1006
  // Get default service config. If none is specified via the client API,
1061
1007
  // we use an empty config.
1062
- const char* service_config_json = grpc_channel_args_find_string(
1063
- args->channel_args, GRPC_ARG_SERVICE_CONFIG);
1064
- if (service_config_json == nullptr) service_config_json = "{}";
1065
- *error = GRPC_ERROR_NONE;
1066
- default_service_config_ =
1067
- ServiceConfig::Create(args->channel_args, service_config_json, error);
1068
- if (*error != GRPC_ERROR_NONE) {
1069
- default_service_config_.reset();
1008
+ absl::optional<absl::string_view> service_config_json =
1009
+ channel_args_.GetString(GRPC_ARG_SERVICE_CONFIG);
1010
+ if (!service_config_json.has_value()) service_config_json = "{}";
1011
+ *error = absl::OkStatus();
1012
+ auto service_config =
1013
+ ServiceConfigImpl::Create(channel_args_, *service_config_json);
1014
+ if (!service_config.ok()) {
1015
+ *error = absl_status_to_grpc_error(service_config.status());
1070
1016
  return;
1071
1017
  }
1018
+ default_service_config_ = std::move(*service_config);
1072
1019
  // Get URI to resolve, using proxy mapper if needed.
1073
- const char* server_uri =
1074
- grpc_channel_args_find_string(args->channel_args, GRPC_ARG_SERVER_URI);
1075
- if (server_uri == nullptr) {
1076
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
1020
+ absl::optional<std::string> server_uri =
1021
+ channel_args_.GetOwnedString(GRPC_ARG_SERVER_URI);
1022
+ if (!server_uri.has_value()) {
1023
+ *error = GRPC_ERROR_CREATE(
1077
1024
  "target URI channel arg missing or wrong type in client channel "
1078
1025
  "filter");
1079
1026
  return;
1080
1027
  }
1081
- uri_to_resolve_ = server_uri;
1082
- char* proxy_name = nullptr;
1083
- grpc_channel_args* new_args = nullptr;
1084
- ProxyMapperRegistry::MapName(server_uri, args->channel_args, &proxy_name,
1085
- &new_args);
1086
- if (proxy_name != nullptr) {
1087
- uri_to_resolve_ = proxy_name;
1088
- gpr_free(proxy_name);
1089
- }
1028
+ uri_to_resolve_ = CoreConfiguration::Get()
1029
+ .proxy_mapper_registry()
1030
+ .MapName(*server_uri, &channel_args_)
1031
+ .value_or(*server_uri);
1090
1032
  // Make sure the URI to resolve is valid, so that we know that
1091
1033
  // resolver creation will succeed later.
1092
- if (!ResolverRegistry::IsValidTarget(uri_to_resolve_)) {
1093
- *error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
1094
- absl::StrCat("the target uri is not valid: ", uri_to_resolve_.c_str()));
1034
+ if (!CoreConfiguration::Get().resolver_registry().IsValidTarget(
1035
+ uri_to_resolve_)) {
1036
+ *error = GRPC_ERROR_CREATE(
1037
+ absl::StrCat("the target uri is not valid: ", uri_to_resolve_));
1095
1038
  return;
1096
1039
  }
1097
1040
  // Strip out service config channel arg, so that it doesn't affect
1098
1041
  // subchannel uniqueness when the args flow down to that layer.
1099
- const char* arg_to_remove = GRPC_ARG_SERVICE_CONFIG;
1100
- channel_args_ = grpc_channel_args_copy_and_remove(
1101
- new_args != nullptr ? new_args : args->channel_args, &arg_to_remove, 1);
1102
- grpc_channel_args_destroy(new_args);
1042
+ channel_args_ = channel_args_.Remove(GRPC_ARG_SERVICE_CONFIG);
1103
1043
  // Set initial keepalive time.
1104
- keepalive_time_ = grpc_channel_args_find_integer(
1105
- channel_args_, GRPC_ARG_KEEPALIVE_TIME_MS,
1106
- {-1 /* default value, unset */, 1, INT_MAX});
1044
+ auto keepalive_arg = channel_args_.GetInt(GRPC_ARG_KEEPALIVE_TIME_MS);
1045
+ if (keepalive_arg.has_value()) {
1046
+ keepalive_time_ = Clamp(*keepalive_arg, 1, INT_MAX);
1047
+ } else {
1048
+ keepalive_time_ = -1; // unset
1049
+ }
1107
1050
  // Set default authority.
1108
- const char* default_authority =
1109
- grpc_channel_args_find_string(channel_args_, GRPC_ARG_DEFAULT_AUTHORITY);
1110
- if (default_authority == nullptr) {
1111
- default_authority_ = ResolverRegistry::GetDefaultAuthority(server_uri);
1051
+ absl::optional<std::string> default_authority =
1052
+ channel_args_.GetOwnedString(GRPC_ARG_DEFAULT_AUTHORITY);
1053
+ if (!default_authority.has_value()) {
1054
+ default_authority_ =
1055
+ CoreConfiguration::Get().resolver_registry().GetDefaultAuthority(
1056
+ *server_uri);
1112
1057
  } else {
1113
- default_authority_ = default_authority;
1058
+ default_authority_ = std::move(*default_authority);
1114
1059
  }
1115
1060
  // Success.
1116
- *error = GRPC_ERROR_NONE;
1061
+ *error = absl::OkStatus();
1117
1062
  }
1118
1063
 
1119
1064
  ClientChannel::~ClientChannel() {
1120
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
1065
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
1121
1066
  gpr_log(GPR_INFO, "chand=%p: destroying channel", this);
1122
1067
  }
1123
1068
  DestroyResolverAndLbPolicyLocked();
1124
- grpc_channel_args_destroy(channel_args_);
1125
- GRPC_ERROR_UNREF(resolver_transient_failure_error_);
1126
1069
  // Stop backup polling.
1127
1070
  grpc_client_channel_stop_backup_polling(interested_parties_);
1128
1071
  grpc_pollset_set_destroy(interested_parties_);
1129
- GRPC_ERROR_UNREF(disconnect_error_);
1130
1072
  }
1131
1073
 
1132
1074
  OrphanablePtr<ClientChannel::LoadBalancedCall>
@@ -1140,6 +1082,29 @@ ClientChannel::CreateLoadBalancedCall(
1140
1082
  call_dispatch_controller, is_transparent_retry));
1141
1083
  }
1142
1084
 
1085
+ ChannelArgs ClientChannel::MakeSubchannelArgs(
1086
+ const ChannelArgs& channel_args, const ChannelArgs& address_args,
1087
+ const RefCountedPtr<SubchannelPoolInterface>& subchannel_pool,
1088
+ const std::string& channel_default_authority) {
1089
+ // Note that we start with the channel-level args and then apply the
1090
+ // per-address args, so that if a value is present in both, the one
1091
+ // in the channel-level args is used. This is particularly important
1092
+ // for the GRPC_ARG_DEFAULT_AUTHORITY arg, which we want to allow
1093
+ // resolvers to set on a per-address basis only if the application
1094
+ // did not explicitly set it at the channel level.
1095
+ return channel_args.UnionWith(address_args)
1096
+ .SetObject(subchannel_pool)
1097
+ // If we haven't already set the default authority arg (i.e., it
1098
+ // was not explicitly set by the application nor overridden by
1099
+ // the resolver), add it from the channel's default.
1100
+ .SetIfUnset(GRPC_ARG_DEFAULT_AUTHORITY, channel_default_authority)
1101
+ // Remove channel args that should not affect subchannel
1102
+ // uniqueness.
1103
+ .Remove(GRPC_ARG_HEALTH_CHECK_SERVICE_NAME)
1104
+ .Remove(GRPC_ARG_INHIBIT_HEALTH_CHECKING)
1105
+ .Remove(GRPC_ARG_CHANNELZ_CHANNEL_NODE);
1106
+ }
1107
+
1143
1108
  namespace {
1144
1109
 
1145
1110
  RefCountedPtr<LoadBalancingPolicy::Config> ChooseLbPolicy(
@@ -1151,38 +1116,52 @@ RefCountedPtr<LoadBalancingPolicy::Config> ChooseLbPolicy(
1151
1116
  }
1152
1117
  // Try the deprecated LB policy name from the service config.
1153
1118
  // If not, try the setting from channel args.
1154
- const char* policy_name = nullptr;
1119
+ absl::optional<absl::string_view> policy_name;
1155
1120
  if (!parsed_service_config->parsed_deprecated_lb_policy().empty()) {
1156
- policy_name = parsed_service_config->parsed_deprecated_lb_policy().c_str();
1121
+ policy_name = parsed_service_config->parsed_deprecated_lb_policy();
1157
1122
  } else {
1158
- policy_name = grpc_channel_args_find_string(resolver_result.args,
1159
- GRPC_ARG_LB_POLICY_NAME);
1123
+ policy_name = resolver_result.args.GetString(GRPC_ARG_LB_POLICY_NAME);
1124
+ bool requires_config = false;
1125
+ if (policy_name.has_value() &&
1126
+ (!CoreConfiguration::Get()
1127
+ .lb_policy_registry()
1128
+ .LoadBalancingPolicyExists(*policy_name, &requires_config) ||
1129
+ requires_config)) {
1130
+ if (requires_config) {
1131
+ gpr_log(GPR_ERROR,
1132
+ "LB policy: %s passed through channel_args must not "
1133
+ "require a config. Using pick_first instead.",
1134
+ std::string(*policy_name).c_str());
1135
+ } else {
1136
+ gpr_log(GPR_ERROR,
1137
+ "LB policy: %s passed through channel_args does not exist. "
1138
+ "Using pick_first instead.",
1139
+ std::string(*policy_name).c_str());
1140
+ }
1141
+ policy_name = "pick_first";
1142
+ }
1160
1143
  }
1161
1144
  // Use pick_first if nothing was specified and we didn't select grpclb
1162
1145
  // above.
1163
- if (policy_name == nullptr) policy_name = "pick_first";
1146
+ if (!policy_name.has_value()) policy_name = "pick_first";
1164
1147
  // Now that we have the policy name, construct an empty config for it.
1165
1148
  Json config_json = Json::Array{Json::Object{
1166
- {policy_name, Json::Object{}},
1149
+ {std::string(*policy_name), Json::Object{}},
1167
1150
  }};
1168
- grpc_error_handle parse_error = GRPC_ERROR_NONE;
1169
- auto lb_policy_config = LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
1170
- config_json, &parse_error);
1151
+ auto lb_policy_config =
1152
+ CoreConfiguration::Get().lb_policy_registry().ParseLoadBalancingConfig(
1153
+ config_json);
1171
1154
  // The policy name came from one of three places:
1172
1155
  // - The deprecated loadBalancingPolicy field in the service config,
1173
1156
  // in which case the code in ClientChannelServiceConfigParser
1174
1157
  // already verified that the policy does not require a config.
1175
1158
  // - One of the hard-coded values here, all of which are known to not
1176
1159
  // require a config.
1177
- // - A channel arg, in which case the application did something that
1178
- // is a misuse of our API.
1179
- // In the first two cases, these assertions will always be true. In
1180
- // the last case, this is probably fine for now.
1181
- // TODO(roth): If the last case becomes a problem, add better error
1182
- // handling here.
1183
- GPR_ASSERT(lb_policy_config != nullptr);
1184
- GPR_ASSERT(parse_error == GRPC_ERROR_NONE);
1185
- return lb_policy_config;
1160
+ // - A channel arg, in which case we check that the specified policy exists
1161
+ // and accepts an empty config. If not, we revert to using pick_first
1162
+ // lb_policy
1163
+ GPR_ASSERT(lb_policy_config.ok());
1164
+ return std::move(*lb_policy_config);
1186
1165
  }
1187
1166
 
1188
1167
  } // namespace
@@ -1190,9 +1169,12 @@ RefCountedPtr<LoadBalancingPolicy::Config> ChooseLbPolicy(
1190
1169
  void ClientChannel::OnResolverResultChangedLocked(Resolver::Result result) {
1191
1170
  // Handle race conditions.
1192
1171
  if (resolver_ == nullptr) return;
1193
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
1172
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
1194
1173
  gpr_log(GPR_INFO, "chand=%p: got resolver result", this);
1195
1174
  }
1175
+ // Grab resolver result health callback.
1176
+ auto resolver_callback = std::move(result.result_health_callback);
1177
+ absl::Status resolver_result_status;
1196
1178
  // We only want to trace the address resolution in the follow cases:
1197
1179
  // (a) Address resolution resulted in service config change.
1198
1180
  // (b) Address resolution that causes number of backends to go from
@@ -1202,32 +1184,35 @@ void ClientChannel::OnResolverResultChangedLocked(Resolver::Result result) {
1202
1184
  // (d) Address resolution that causes a new LB policy to be created.
1203
1185
  //
1204
1186
  // We track a list of strings to eventually be concatenated and traced.
1205
- absl::InlinedVector<const char*, 3> trace_strings;
1206
- if (result.addresses.empty() && previous_resolution_contained_addresses_) {
1187
+ std::vector<const char*> trace_strings;
1188
+ const bool resolution_contains_addresses =
1189
+ result.addresses.ok() && !result.addresses->empty();
1190
+ if (!resolution_contains_addresses &&
1191
+ previous_resolution_contained_addresses_) {
1207
1192
  trace_strings.push_back("Address list became empty");
1208
- } else if (!result.addresses.empty() &&
1193
+ } else if (resolution_contains_addresses &&
1209
1194
  !previous_resolution_contained_addresses_) {
1210
1195
  trace_strings.push_back("Address list became non-empty");
1211
1196
  }
1212
- previous_resolution_contained_addresses_ = !result.addresses.empty();
1197
+ previous_resolution_contained_addresses_ = resolution_contains_addresses;
1213
1198
  std::string service_config_error_string_storage;
1214
- if (result.service_config_error != GRPC_ERROR_NONE) {
1199
+ if (!result.service_config.ok()) {
1215
1200
  service_config_error_string_storage =
1216
- grpc_error_std_string(result.service_config_error);
1201
+ result.service_config.status().ToString();
1217
1202
  trace_strings.push_back(service_config_error_string_storage.c_str());
1218
1203
  }
1219
1204
  // Choose the service config.
1220
1205
  RefCountedPtr<ServiceConfig> service_config;
1221
1206
  RefCountedPtr<ConfigSelector> config_selector;
1222
- if (result.service_config_error != GRPC_ERROR_NONE) {
1223
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
1207
+ if (!result.service_config.ok()) {
1208
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
1224
1209
  gpr_log(GPR_INFO, "chand=%p: resolver returned service config error: %s",
1225
- this, grpc_error_std_string(result.service_config_error).c_str());
1210
+ this, result.service_config.status().ToString().c_str());
1226
1211
  }
1227
1212
  // If the service config was invalid, then fallback to the
1228
1213
  // previously returned service config.
1229
1214
  if (saved_service_config_ != nullptr) {
1230
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
1215
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
1231
1216
  gpr_log(GPR_INFO,
1232
1217
  "chand=%p: resolver returned invalid service config. "
1233
1218
  "Continuing to use previous service config.",
@@ -1236,15 +1221,17 @@ void ClientChannel::OnResolverResultChangedLocked(Resolver::Result result) {
1236
1221
  service_config = saved_service_config_;
1237
1222
  config_selector = saved_config_selector_;
1238
1223
  } else {
1239
- // We received an invalid service config and we don't have a
1224
+ // We received a service config error and we don't have a
1240
1225
  // previous service config to fall back to. Put the channel into
1241
1226
  // TRANSIENT_FAILURE.
1242
- OnResolverErrorLocked(GRPC_ERROR_REF(result.service_config_error));
1227
+ OnResolverErrorLocked(result.service_config.status());
1243
1228
  trace_strings.push_back("no valid service config");
1229
+ resolver_result_status =
1230
+ absl::UnavailableError("no valid service config");
1244
1231
  }
1245
- } else if (result.service_config == nullptr) {
1232
+ } else if (*result.service_config == nullptr) {
1246
1233
  // Resolver did not return any service config.
1247
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
1234
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
1248
1235
  gpr_log(GPR_INFO,
1249
1236
  "chand=%p: resolver returned no service config. Using default "
1250
1237
  "service config for channel.",
@@ -1253,15 +1240,18 @@ void ClientChannel::OnResolverResultChangedLocked(Resolver::Result result) {
1253
1240
  service_config = default_service_config_;
1254
1241
  } else {
1255
1242
  // Use ServiceConfig and ConfigSelector returned by resolver.
1256
- service_config = result.service_config;
1257
- config_selector = ConfigSelector::GetFromChannelArgs(*result.args);
1243
+ service_config = std::move(*result.service_config);
1244
+ config_selector = result.args.GetObjectRef<ConfigSelector>();
1258
1245
  }
1246
+ // Note: The only case in which service_config is null here is if the resolver
1247
+ // returned a service config error and we don't have a previous service
1248
+ // config to fall back to.
1259
1249
  if (service_config != nullptr) {
1260
1250
  // Extract global config for client channel.
1261
1251
  const internal::ClientChannelGlobalParsedConfig* parsed_service_config =
1262
1252
  static_cast<const internal::ClientChannelGlobalParsedConfig*>(
1263
1253
  service_config->GetGlobalParsedConfig(
1264
- internal::ClientChannelServiceConfigParser::ParserIndex()));
1254
+ service_config_parser_index_));
1265
1255
  // Choose LB policy config.
1266
1256
  RefCountedPtr<LoadBalancingPolicy::Config> lb_policy_config =
1267
1257
  ChooseLbPolicy(result, parsed_service_config);
@@ -1275,14 +1265,14 @@ void ClientChannel::OnResolverResultChangedLocked(Resolver::Result result) {
1275
1265
  // If either has changed, apply the global parameters now.
1276
1266
  if (service_config_changed || config_selector_changed) {
1277
1267
  // Update service config in control plane.
1278
- UpdateServiceConfigInControlPlaneLocked(std::move(service_config),
1279
- std::move(config_selector),
1280
- lb_policy_config->name());
1281
- } else if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
1268
+ UpdateServiceConfigInControlPlaneLocked(
1269
+ std::move(service_config), std::move(config_selector),
1270
+ std::string(lb_policy_config->name()));
1271
+ } else if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
1282
1272
  gpr_log(GPR_INFO, "chand=%p: service config not changed", this);
1283
1273
  }
1284
1274
  // Create or update LB policy, as needed.
1285
- CreateOrUpdateLbPolicyLocked(
1275
+ resolver_result_status = CreateOrUpdateLbPolicyLocked(
1286
1276
  std::move(lb_policy_config),
1287
1277
  parsed_service_config->health_check_service_name(), std::move(result));
1288
1278
  if (service_config_changed || config_selector_changed) {
@@ -1296,6 +1286,10 @@ void ClientChannel::OnResolverResultChangedLocked(Resolver::Result result) {
1296
1286
  trace_strings.push_back("Service config changed");
1297
1287
  }
1298
1288
  }
1289
+ // Invoke resolver callback if needed.
1290
+ if (resolver_callback != nullptr) {
1291
+ resolver_callback(std::move(resolver_result_status));
1292
+ }
1299
1293
  // Add channel trace event.
1300
1294
  if (!trace_strings.empty()) {
1301
1295
  std::string message =
@@ -1307,34 +1301,28 @@ void ClientChannel::OnResolverResultChangedLocked(Resolver::Result result) {
1307
1301
  }
1308
1302
  }
1309
1303
 
1310
- void ClientChannel::OnResolverErrorLocked(grpc_error_handle error) {
1311
- if (resolver_ == nullptr) {
1312
- GRPC_ERROR_UNREF(error);
1313
- return;
1314
- }
1315
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
1304
+ void ClientChannel::OnResolverErrorLocked(absl::Status status) {
1305
+ if (resolver_ == nullptr) return;
1306
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
1316
1307
  gpr_log(GPR_INFO, "chand=%p: resolver transient failure: %s", this,
1317
- grpc_error_std_string(error).c_str());
1308
+ status.ToString().c_str());
1318
1309
  }
1319
1310
  // If we already have an LB policy from a previous resolution
1320
1311
  // result, then we continue to let it set the connectivity state.
1321
1312
  // Otherwise, we go into TRANSIENT_FAILURE.
1322
1313
  if (lb_policy_ == nullptr) {
1323
- grpc_error_handle state_error =
1324
- GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
1325
- "Resolver transient failure", &error, 1);
1326
- absl::Status status = grpc_error_to_absl_status(state_error);
1314
+ grpc_error_handle error = absl_status_to_grpc_error(status);
1327
1315
  {
1328
1316
  MutexLock lock(&resolution_mu_);
1329
1317
  // Update resolver transient failure.
1330
- GRPC_ERROR_UNREF(resolver_transient_failure_error_);
1331
- resolver_transient_failure_error_ = state_error;
1318
+ resolver_transient_failure_error_ =
1319
+ MaybeRewriteIllegalStatusCode(status, "resolver");
1332
1320
  // Process calls that were queued waiting for the resolver result.
1333
1321
  for (ResolverQueuedCall* call = resolver_queued_calls_; call != nullptr;
1334
1322
  call = call->next) {
1335
1323
  grpc_call_element* elem = call->elem;
1336
1324
  CallData* calld = static_cast<CallData*>(elem->call_data);
1337
- grpc_error_handle error = GRPC_ERROR_NONE;
1325
+ grpc_error_handle error;
1338
1326
  if (calld->CheckResolutionLocked(elem, &error)) {
1339
1327
  calld->AsyncResolutionDone(elem, error);
1340
1328
  }
@@ -1343,12 +1331,11 @@ void ClientChannel::OnResolverErrorLocked(grpc_error_handle error) {
1343
1331
  // Update connectivity state.
1344
1332
  UpdateStateAndPickerLocked(
1345
1333
  GRPC_CHANNEL_TRANSIENT_FAILURE, status, "resolver failure",
1346
- absl::make_unique<LoadBalancingPolicy::TransientFailurePicker>(status));
1334
+ std::make_unique<LoadBalancingPolicy::TransientFailurePicker>(status));
1347
1335
  }
1348
- GRPC_ERROR_UNREF(error);
1349
1336
  }
1350
1337
 
1351
- void ClientChannel::CreateOrUpdateLbPolicyLocked(
1338
+ absl::Status ClientChannel::CreateOrUpdateLbPolicyLocked(
1352
1339
  RefCountedPtr<LoadBalancingPolicy::Config> lb_policy_config,
1353
1340
  const absl::optional<std::string>& health_check_service_name,
1354
1341
  Resolver::Result result) {
@@ -1356,43 +1343,40 @@ void ClientChannel::CreateOrUpdateLbPolicyLocked(
1356
1343
  LoadBalancingPolicy::UpdateArgs update_args;
1357
1344
  update_args.addresses = std::move(result.addresses);
1358
1345
  update_args.config = std::move(lb_policy_config);
1359
- // Add health check service name to channel args.
1360
- absl::InlinedVector<grpc_arg, 1> args_to_add;
1361
- if (health_check_service_name.has_value()) {
1362
- args_to_add.push_back(grpc_channel_arg_string_create(
1363
- const_cast<char*>(GRPC_ARG_HEALTH_CHECK_SERVICE_NAME),
1364
- const_cast<char*>(health_check_service_name->c_str())));
1365
- }
1346
+ update_args.resolution_note = std::move(result.resolution_note);
1366
1347
  // Remove the config selector from channel args so that we're not holding
1367
1348
  // unnecessary refs that cause it to be destroyed somewhere other than in the
1368
1349
  // WorkSerializer.
1369
- const char* arg_to_remove = GRPC_ARG_CONFIG_SELECTOR;
1370
- update_args.args = grpc_channel_args_copy_and_add_and_remove(
1371
- result.args, &arg_to_remove, 1, args_to_add.data(), args_to_add.size());
1350
+ update_args.args = result.args.Remove(GRPC_ARG_CONFIG_SELECTOR);
1351
+ // Add health check service name to channel args.
1352
+ if (health_check_service_name.has_value()) {
1353
+ update_args.args = update_args.args.Set(GRPC_ARG_HEALTH_CHECK_SERVICE_NAME,
1354
+ *health_check_service_name);
1355
+ }
1372
1356
  // Create policy if needed.
1373
1357
  if (lb_policy_ == nullptr) {
1374
- lb_policy_ = CreateLbPolicyLocked(*update_args.args);
1358
+ lb_policy_ = CreateLbPolicyLocked(update_args.args);
1375
1359
  }
1376
1360
  // Update the policy.
1377
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
1361
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
1378
1362
  gpr_log(GPR_INFO, "chand=%p: Updating child policy %p", this,
1379
1363
  lb_policy_.get());
1380
1364
  }
1381
- lb_policy_->UpdateLocked(std::move(update_args));
1365
+ return lb_policy_->UpdateLocked(std::move(update_args));
1382
1366
  }
1383
1367
 
1384
1368
  // Creates a new LB policy.
1385
1369
  OrphanablePtr<LoadBalancingPolicy> ClientChannel::CreateLbPolicyLocked(
1386
- const grpc_channel_args& args) {
1370
+ const ChannelArgs& args) {
1387
1371
  LoadBalancingPolicy::Args lb_policy_args;
1388
1372
  lb_policy_args.work_serializer = work_serializer_;
1389
1373
  lb_policy_args.channel_control_helper =
1390
- absl::make_unique<ClientChannelControlHelper>(this);
1391
- lb_policy_args.args = &args;
1374
+ std::make_unique<ClientChannelControlHelper>(this);
1375
+ lb_policy_args.args = args;
1392
1376
  OrphanablePtr<LoadBalancingPolicy> lb_policy =
1393
1377
  MakeOrphanable<ChildPolicyHandler>(std::move(lb_policy_args),
1394
- &grpc_client_channel_routing_trace);
1395
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
1378
+ &grpc_client_channel_trace);
1379
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
1396
1380
  gpr_log(GPR_INFO, "chand=%p: created new LB policy %p", this,
1397
1381
  lb_policy.get());
1398
1382
  }
@@ -1427,26 +1411,23 @@ void ClientChannel::RemoveResolverQueuedCall(ResolverQueuedCall* to_remove,
1427
1411
 
1428
1412
  void ClientChannel::UpdateServiceConfigInControlPlaneLocked(
1429
1413
  RefCountedPtr<ServiceConfig> service_config,
1430
- RefCountedPtr<ConfigSelector> config_selector, const char* lb_policy_name) {
1431
- UniquePtr<char> service_config_json(
1432
- gpr_strdup(service_config->json_string().c_str()));
1433
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
1434
- gpr_log(GPR_INFO,
1435
- "chand=%p: resolver returned updated service config: \"%s\"", this,
1436
- service_config_json.get());
1414
+ RefCountedPtr<ConfigSelector> config_selector, std::string lb_policy_name) {
1415
+ std::string service_config_json(service_config->json_string());
1416
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
1417
+ gpr_log(GPR_INFO, "chand=%p: using service config: \"%s\"", this,
1418
+ service_config_json.c_str());
1437
1419
  }
1438
1420
  // Save service config.
1439
1421
  saved_service_config_ = std::move(service_config);
1440
1422
  // Swap out the data used by GetChannelInfo().
1441
- UniquePtr<char> lb_policy_name_owned(gpr_strdup(lb_policy_name));
1442
1423
  {
1443
1424
  MutexLock lock(&info_mu_);
1444
- info_lb_policy_name_ = std::move(lb_policy_name_owned);
1425
+ info_lb_policy_name_ = std::move(lb_policy_name);
1445
1426
  info_service_config_json_ = std::move(service_config_json);
1446
1427
  }
1447
1428
  // Save config selector.
1448
1429
  saved_config_selector_ = std::move(config_selector);
1449
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
1430
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
1450
1431
  gpr_log(GPR_INFO, "chand=%p: using ConfigSelector %p", this,
1451
1432
  saved_config_selector_.get());
1452
1433
  }
@@ -1457,7 +1438,7 @@ void ClientChannel::UpdateServiceConfigInDataPlaneLocked() {
1457
1438
  RefCountedPtr<ServiceConfig> service_config = saved_service_config_;
1458
1439
  // Grab ref to config selector. Use default if resolver didn't supply one.
1459
1440
  RefCountedPtr<ConfigSelector> config_selector = saved_config_selector_;
1460
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
1441
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
1461
1442
  gpr_log(GPR_INFO, "chand=%p: switching to ConfigSelector %p", this,
1462
1443
  saved_config_selector_.get());
1463
1444
  }
@@ -1465,19 +1446,11 @@ void ClientChannel::UpdateServiceConfigInDataPlaneLocked() {
1465
1446
  config_selector =
1466
1447
  MakeRefCounted<DefaultConfigSelector>(saved_service_config_);
1467
1448
  }
1468
- absl::InlinedVector<grpc_arg, 2> args_to_add = {
1469
- grpc_channel_arg_pointer_create(
1470
- const_cast<char*>(GRPC_ARG_CLIENT_CHANNEL), this,
1471
- &kClientChannelArgPointerVtable),
1472
- grpc_channel_arg_pointer_create(
1473
- const_cast<char*>(GRPC_ARG_SERVICE_CONFIG_OBJ), service_config.get(),
1474
- &kServiceConfigObjArgPointerVtable),
1475
- };
1476
- grpc_channel_args* new_args = grpc_channel_args_copy_and_add(
1477
- channel_args_, args_to_add.data(), args_to_add.size());
1478
- new_args = config_selector->ModifyChannelArgs(new_args);
1449
+ ChannelArgs new_args = config_selector->ModifyChannelArgs(
1450
+ channel_args_.SetObject(this).SetObject(service_config));
1479
1451
  bool enable_retries =
1480
- grpc_channel_args_find_bool(new_args, GRPC_ARG_ENABLE_RETRIES, true);
1452
+ !new_args.WantMinimalStack() &&
1453
+ new_args.GetBool(GRPC_ARG_ENABLE_RETRIES).value_or(true);
1481
1454
  // Construct dynamic filter stack.
1482
1455
  std::vector<const grpc_channel_filter*> filters =
1483
1456
  config_selector->GetFilters();
@@ -1489,15 +1462,13 @@ void ClientChannel::UpdateServiceConfigInDataPlaneLocked() {
1489
1462
  RefCountedPtr<DynamicFilters> dynamic_filters =
1490
1463
  DynamicFilters::Create(new_args, std::move(filters));
1491
1464
  GPR_ASSERT(dynamic_filters != nullptr);
1492
- grpc_channel_args_destroy(new_args);
1493
1465
  // Grab data plane lock to update service config.
1494
1466
  //
1495
1467
  // We defer unreffing the old values (and deallocating memory) until
1496
1468
  // after releasing the lock to keep the critical section small.
1497
1469
  {
1498
1470
  MutexLock lock(&resolution_mu_);
1499
- GRPC_ERROR_UNREF(resolver_transient_failure_error_);
1500
- resolver_transient_failure_error_ = GRPC_ERROR_NONE;
1471
+ resolver_transient_failure_error_ = absl::OkStatus();
1501
1472
  // Update service config.
1502
1473
  received_service_config_data_ = true;
1503
1474
  // Old values will be unreffed after lock is released.
@@ -1518,7 +1489,7 @@ void ClientChannel::UpdateServiceConfigInDataPlaneLocked() {
1518
1489
  ExecCtx::Get()->InvalidateNow();
1519
1490
  grpc_call_element* elem = call->elem;
1520
1491
  CallData* calld = static_cast<CallData*>(elem->call_data);
1521
- grpc_error_handle error = GRPC_ERROR_NONE;
1492
+ grpc_error_handle error;
1522
1493
  if (calld->CheckResolutionLocked(elem, &error)) {
1523
1494
  calld->AsyncResolutionDone(elem, error);
1524
1495
  }
@@ -1529,33 +1500,33 @@ void ClientChannel::UpdateServiceConfigInDataPlaneLocked() {
1529
1500
  }
1530
1501
 
1531
1502
  void ClientChannel::CreateResolverLocked() {
1532
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
1503
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
1533
1504
  gpr_log(GPR_INFO, "chand=%p: starting name resolution", this);
1534
1505
  }
1535
- resolver_ = ResolverRegistry::CreateResolver(
1506
+ resolver_ = CoreConfiguration::Get().resolver_registry().CreateResolver(
1536
1507
  uri_to_resolve_.c_str(), channel_args_, interested_parties_,
1537
- work_serializer_, absl::make_unique<ResolverResultHandler>(this));
1508
+ work_serializer_, std::make_unique<ResolverResultHandler>(this));
1538
1509
  // Since the validity of the args was checked when the channel was created,
1539
1510
  // CreateResolver() must return a non-null result.
1540
1511
  GPR_ASSERT(resolver_ != nullptr);
1541
1512
  UpdateStateAndPickerLocked(
1542
1513
  GRPC_CHANNEL_CONNECTING, absl::Status(), "started resolving",
1543
- absl::make_unique<LoadBalancingPolicy::QueuePicker>(nullptr));
1514
+ std::make_unique<LoadBalancingPolicy::QueuePicker>(nullptr));
1544
1515
  resolver_->StartLocked();
1545
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
1516
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
1546
1517
  gpr_log(GPR_INFO, "chand=%p: created resolver=%p", this, resolver_.get());
1547
1518
  }
1548
1519
  }
1549
1520
 
1550
1521
  void ClientChannel::DestroyResolverAndLbPolicyLocked() {
1551
1522
  if (resolver_ != nullptr) {
1552
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
1523
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
1553
1524
  gpr_log(GPR_INFO, "chand=%p: shutting down resolver=%p", this,
1554
1525
  resolver_.get());
1555
1526
  }
1556
1527
  resolver_.reset();
1557
1528
  if (lb_policy_ != nullptr) {
1558
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
1529
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
1559
1530
  gpr_log(GPR_INFO, "chand=%p: shutting down lb_policy=%p", this,
1560
1531
  lb_policy_.get());
1561
1532
  }
@@ -1616,7 +1587,7 @@ void ClientChannel::UpdateStateAndPickerLocked(
1616
1587
  // on the stale value, which results in the timer firing too early. To
1617
1588
  // avoid this, we invalidate the cached value for each call we process.
1618
1589
  ExecCtx::Get()->InvalidateNow();
1619
- grpc_error_handle error = GRPC_ERROR_NONE;
1590
+ grpc_error_handle error;
1620
1591
  if (call->lb_call->PickSubchannelLocked(&error)) {
1621
1592
  call->lb_call->AsyncPickDone(error);
1622
1593
  }
@@ -1660,7 +1631,7 @@ T HandlePickResult(
1660
1631
 
1661
1632
  grpc_error_handle ClientChannel::DoPingLocked(grpc_transport_op* op) {
1662
1633
  if (state_tracker_.state() != GRPC_CHANNEL_READY) {
1663
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("channel not connected");
1634
+ return GRPC_ERROR_CREATE("channel not connected");
1664
1635
  }
1665
1636
  LoadBalancingPolicy::PickResult result;
1666
1637
  {
@@ -1671,18 +1642,21 @@ grpc_error_handle ClientChannel::DoPingLocked(grpc_transport_op* op) {
1671
1642
  &result,
1672
1643
  // Complete pick.
1673
1644
  [op](LoadBalancingPolicy::PickResult::Complete* complete_pick)
1674
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::work_serializer_) {
1645
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*ClientChannel::work_serializer_) {
1675
1646
  SubchannelWrapper* subchannel = static_cast<SubchannelWrapper*>(
1676
1647
  complete_pick->subchannel.get());
1677
1648
  RefCountedPtr<ConnectedSubchannel> connected_subchannel =
1678
1649
  subchannel->connected_subchannel();
1650
+ if (connected_subchannel == nullptr) {
1651
+ return GRPC_ERROR_CREATE("LB pick for ping not connected");
1652
+ }
1679
1653
  connected_subchannel->Ping(op->send_ping.on_initiate,
1680
1654
  op->send_ping.on_ack);
1681
- return GRPC_ERROR_NONE;
1655
+ return absl::OkStatus();
1682
1656
  },
1683
1657
  // Queue pick.
1684
1658
  [](LoadBalancingPolicy::PickResult::Queue* /*queue_pick*/) {
1685
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("LB picker queued call");
1659
+ return GRPC_ERROR_CREATE("LB picker queued call");
1686
1660
  },
1687
1661
  // Fail pick.
1688
1662
  [](LoadBalancingPolicy::PickResult::Fail* fail_pick) {
@@ -1706,9 +1680,8 @@ void ClientChannel::StartTransportOpLocked(grpc_transport_op* op) {
1706
1680
  // Ping.
1707
1681
  if (op->send_ping.on_initiate != nullptr || op->send_ping.on_ack != nullptr) {
1708
1682
  grpc_error_handle error = DoPingLocked(op);
1709
- if (error != GRPC_ERROR_NONE) {
1710
- ExecCtx::Run(DEBUG_LOCATION, op->send_ping.on_initiate,
1711
- GRPC_ERROR_REF(error));
1683
+ if (!error.ok()) {
1684
+ ExecCtx::Run(DEBUG_LOCATION, op->send_ping.on_initiate, error);
1712
1685
  ExecCtx::Run(DEBUG_LOCATION, op->send_ping.on_ack, error);
1713
1686
  }
1714
1687
  op->bind_pollset = nullptr;
@@ -1722,34 +1695,34 @@ void ClientChannel::StartTransportOpLocked(grpc_transport_op* op) {
1722
1695
  }
1723
1696
  }
1724
1697
  // Disconnect or enter IDLE.
1725
- if (op->disconnect_with_error != GRPC_ERROR_NONE) {
1726
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
1698
+ if (!op->disconnect_with_error.ok()) {
1699
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
1727
1700
  gpr_log(GPR_INFO, "chand=%p: disconnect_with_error: %s", this,
1728
- grpc_error_std_string(op->disconnect_with_error).c_str());
1701
+ StatusToString(op->disconnect_with_error).c_str());
1729
1702
  }
1730
1703
  DestroyResolverAndLbPolicyLocked();
1731
1704
  intptr_t value;
1732
1705
  if (grpc_error_get_int(op->disconnect_with_error,
1733
- GRPC_ERROR_INT_CHANNEL_CONNECTIVITY_STATE, &value) &&
1706
+ StatusIntProperty::ChannelConnectivityState,
1707
+ &value) &&
1734
1708
  static_cast<grpc_connectivity_state>(value) == GRPC_CHANNEL_IDLE) {
1735
- if (disconnect_error_ == GRPC_ERROR_NONE) {
1709
+ if (disconnect_error_.ok()) {
1736
1710
  // Enter IDLE state.
1737
1711
  UpdateStateAndPickerLocked(GRPC_CHANNEL_IDLE, absl::Status(),
1738
1712
  "channel entering IDLE", nullptr);
1739
1713
  }
1740
- GRPC_ERROR_UNREF(op->disconnect_with_error);
1741
1714
  } else {
1742
1715
  // Disconnect.
1743
- GPR_ASSERT(disconnect_error_ == GRPC_ERROR_NONE);
1716
+ GPR_ASSERT(disconnect_error_.ok());
1744
1717
  disconnect_error_ = op->disconnect_with_error;
1745
1718
  UpdateStateAndPickerLocked(
1746
1719
  GRPC_CHANNEL_SHUTDOWN, absl::Status(), "shutdown from API",
1747
- absl::make_unique<LoadBalancingPolicy::TransientFailurePicker>(
1720
+ std::make_unique<LoadBalancingPolicy::TransientFailurePicker>(
1748
1721
  grpc_error_to_absl_status(op->disconnect_with_error)));
1749
1722
  }
1750
1723
  }
1751
1724
  GRPC_CHANNEL_STACK_UNREF(owning_stack_, "start_transport_op");
1752
- ExecCtx::Run(DEBUG_LOCATION, op->on_consumed, GRPC_ERROR_NONE);
1725
+ ExecCtx::Run(DEBUG_LOCATION, op->on_consumed, absl::OkStatus());
1753
1726
  }
1754
1727
 
1755
1728
  void ClientChannel::StartTransportOp(grpc_channel_element* elem,
@@ -1763,7 +1736,7 @@ void ClientChannel::StartTransportOp(grpc_channel_element* elem,
1763
1736
  // Pop into control plane work_serializer for remaining ops.
1764
1737
  GRPC_CHANNEL_STACK_REF(chand->owning_stack_, "start_transport_op");
1765
1738
  chand->work_serializer_->Run(
1766
- [chand, op]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand->work_serializer_) {
1739
+ [chand, op]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand->work_serializer_) {
1767
1740
  chand->StartTransportOpLocked(op);
1768
1741
  },
1769
1742
  DEBUG_LOCATION);
@@ -1774,11 +1747,11 @@ void ClientChannel::GetChannelInfo(grpc_channel_element* elem,
1774
1747
  ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
1775
1748
  MutexLock lock(&chand->info_mu_);
1776
1749
  if (info->lb_policy_name != nullptr) {
1777
- *info->lb_policy_name = gpr_strdup(chand->info_lb_policy_name_.get());
1750
+ *info->lb_policy_name = gpr_strdup(chand->info_lb_policy_name_.c_str());
1778
1751
  }
1779
1752
  if (info->service_config_json != nullptr) {
1780
1753
  *info->service_config_json =
1781
- gpr_strdup(chand->info_service_config_json_.get());
1754
+ gpr_strdup(chand->info_service_config_json_.c_str());
1782
1755
  }
1783
1756
  }
1784
1757
 
@@ -1825,7 +1798,7 @@ grpc_connectivity_state ClientChannel::CheckConnectivityState(
1825
1798
  if (out == GRPC_CHANNEL_IDLE && try_to_connect) {
1826
1799
  GRPC_CHANNEL_STACK_REF(owning_stack_, "TryToConnect");
1827
1800
  work_serializer_->Run([this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(
1828
- work_serializer_) { TryToConnectLocked(); },
1801
+ *work_serializer_) { TryToConnectLocked(); },
1829
1802
  DEBUG_LOCATION);
1830
1803
  }
1831
1804
  return out;
@@ -1852,8 +1825,8 @@ ClientChannel::CallData::CallData(grpc_call_element* elem,
1852
1825
  : deadline_state_(elem, args,
1853
1826
  GPR_LIKELY(chand.deadline_checking_enabled_)
1854
1827
  ? args.deadline
1855
- : GRPC_MILLIS_INF_FUTURE),
1856
- path_(grpc_slice_ref_internal(args.path)),
1828
+ : Timestamp::InfFuture()),
1829
+ path_(CSliceRef(args.path)),
1857
1830
  call_start_time_(args.start_time),
1858
1831
  deadline_(args.deadline),
1859
1832
  arena_(args.arena),
@@ -1866,8 +1839,7 @@ ClientChannel::CallData::CallData(grpc_call_element* elem,
1866
1839
  }
1867
1840
 
1868
1841
  ClientChannel::CallData::~CallData() {
1869
- grpc_slice_unref_internal(path_);
1870
- GRPC_ERROR_UNREF(cancel_error_);
1842
+ CSliceUnref(path_);
1871
1843
  // Make sure there are no remaining pending batches.
1872
1844
  for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
1873
1845
  GPR_ASSERT(pending_batches_[i] == nullptr);
@@ -1878,7 +1850,7 @@ grpc_error_handle ClientChannel::CallData::Init(
1878
1850
  grpc_call_element* elem, const grpc_call_element_args* args) {
1879
1851
  ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
1880
1852
  new (elem->call_data) CallData(elem, *chand, *args);
1881
- return GRPC_ERROR_NONE;
1853
+ return absl::OkStatus();
1882
1854
  }
1883
1855
 
1884
1856
  void ClientChannel::CallData::Destroy(
@@ -1892,15 +1864,19 @@ void ClientChannel::CallData::Destroy(
1892
1864
  dynamic_call->SetAfterCallStackDestroy(then_schedule_closure);
1893
1865
  } else {
1894
1866
  // TODO(yashkt) : This can potentially be a Closure::Run
1895
- ExecCtx::Run(DEBUG_LOCATION, then_schedule_closure, GRPC_ERROR_NONE);
1867
+ ExecCtx::Run(DEBUG_LOCATION, then_schedule_closure, absl::OkStatus());
1896
1868
  }
1897
1869
  }
1898
1870
 
1899
1871
  void ClientChannel::CallData::StartTransportStreamOpBatch(
1900
1872
  grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
1901
- GPR_TIMER_SCOPE("cc_start_transport_stream_op_batch", 0);
1902
1873
  CallData* calld = static_cast<CallData*>(elem->call_data);
1903
1874
  ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
1875
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace) &&
1876
+ !GRPC_TRACE_FLAG_ENABLED(grpc_trace_channel)) {
1877
+ gpr_log(GPR_INFO, "chand=%p calld=%p: batch started from above: %s", chand,
1878
+ calld, grpc_transport_stream_op_batch_string(batch).c_str());
1879
+ }
1904
1880
  if (GPR_LIKELY(chand->deadline_checking_enabled_)) {
1905
1881
  grpc_deadline_state_client_start_transport_stream_op_batch(elem, batch);
1906
1882
  }
@@ -1908,8 +1884,13 @@ void ClientChannel::CallData::StartTransportStreamOpBatch(
1908
1884
  // in case we wind up failing the call before we get down to the retry
1909
1885
  // or LB call layer.
1910
1886
  if (batch->recv_trailing_metadata) {
1911
- calld->InjectRecvTrailingMetadataReadyForConfigSelectorCommitCallback(
1912
- batch);
1887
+ calld->original_recv_trailing_metadata_ready_ =
1888
+ batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready;
1889
+ GRPC_CLOSURE_INIT(&calld->recv_trailing_metadata_ready_,
1890
+ RecvTrailingMetadataReadyForConfigSelectorCommitCallback,
1891
+ elem, nullptr);
1892
+ batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready =
1893
+ &calld->recv_trailing_metadata_ready_;
1913
1894
  }
1914
1895
  // If we already have a dynamic call, pass the batch down to it.
1915
1896
  // Note that once we have done so, we do not need to acquire the channel's
@@ -1925,15 +1906,14 @@ void ClientChannel::CallData::StartTransportStreamOpBatch(
1925
1906
  // We do not yet have a dynamic call.
1926
1907
  //
1927
1908
  // If we've previously been cancelled, immediately fail any new batches.
1928
- if (GPR_UNLIKELY(calld->cancel_error_ != GRPC_ERROR_NONE)) {
1909
+ if (GPR_UNLIKELY(!calld->cancel_error_.ok())) {
1929
1910
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
1930
1911
  gpr_log(GPR_INFO, "chand=%p calld=%p: failing batch with error: %s",
1931
- chand, calld,
1932
- grpc_error_std_string(calld->cancel_error_).c_str());
1912
+ chand, calld, StatusToString(calld->cancel_error_).c_str());
1933
1913
  }
1934
1914
  // Note: This will release the call combiner.
1935
1915
  grpc_transport_stream_op_batch_finish_with_failure(
1936
- batch, GRPC_ERROR_REF(calld->cancel_error_), calld->call_combiner_);
1916
+ batch, calld->cancel_error_, calld->call_combiner_);
1937
1917
  return;
1938
1918
  }
1939
1919
  // Handle cancellation.
@@ -1943,19 +1923,16 @@ void ClientChannel::CallData::StartTransportStreamOpBatch(
1943
1923
  // cancelled before any batches are passed down (e.g., if the deadline
1944
1924
  // is in the past when the call starts), we can return the right
1945
1925
  // error to the caller when the first batch does get passed down.
1946
- GRPC_ERROR_UNREF(calld->cancel_error_);
1947
- calld->cancel_error_ =
1948
- GRPC_ERROR_REF(batch->payload->cancel_stream.cancel_error);
1926
+ calld->cancel_error_ = batch->payload->cancel_stream.cancel_error;
1949
1927
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
1950
1928
  gpr_log(GPR_INFO, "chand=%p calld=%p: recording cancel_error=%s", chand,
1951
- calld, grpc_error_std_string(calld->cancel_error_).c_str());
1929
+ calld, StatusToString(calld->cancel_error_).c_str());
1952
1930
  }
1953
1931
  // Fail all pending batches.
1954
- calld->PendingBatchesFail(elem, GRPC_ERROR_REF(calld->cancel_error_),
1955
- NoYieldCallCombiner);
1932
+ calld->PendingBatchesFail(elem, calld->cancel_error_, NoYieldCallCombiner);
1956
1933
  // Note: This will release the call combiner.
1957
1934
  grpc_transport_stream_op_batch_finish_with_failure(
1958
- batch, GRPC_ERROR_REF(calld->cancel_error_), calld->call_combiner_);
1935
+ batch, calld->cancel_error_, calld->call_combiner_);
1959
1936
  return;
1960
1937
  }
1961
1938
  // Add the batch to the pending list.
@@ -1970,7 +1947,7 @@ void ClientChannel::CallData::StartTransportStreamOpBatch(
1970
1947
  "config",
1971
1948
  chand, calld);
1972
1949
  }
1973
- CheckResolution(elem, GRPC_ERROR_NONE);
1950
+ CheckResolution(elem, absl::OkStatus());
1974
1951
  } else {
1975
1952
  // For all other batches, release the call combiner.
1976
1953
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
@@ -2029,24 +2006,23 @@ void ClientChannel::CallData::FailPendingBatchInCallCombiner(
2029
2006
  static_cast<grpc_transport_stream_op_batch*>(arg);
2030
2007
  CallData* calld = static_cast<CallData*>(batch->handler_private.extra_arg);
2031
2008
  // Note: This will release the call combiner.
2032
- grpc_transport_stream_op_batch_finish_with_failure(
2033
- batch, GRPC_ERROR_REF(error), calld->call_combiner_);
2009
+ grpc_transport_stream_op_batch_finish_with_failure(batch, error,
2010
+ calld->call_combiner_);
2034
2011
  }
2035
2012
 
2036
2013
  // This is called via the call combiner, so access to calld is synchronized.
2037
2014
  void ClientChannel::CallData::PendingBatchesFail(
2038
2015
  grpc_call_element* elem, grpc_error_handle error,
2039
2016
  YieldCallCombinerPredicate yield_call_combiner_predicate) {
2040
- GPR_ASSERT(error != GRPC_ERROR_NONE);
2017
+ GPR_ASSERT(!error.ok());
2041
2018
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2042
2019
  size_t num_batches = 0;
2043
2020
  for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
2044
2021
  if (pending_batches_[i] != nullptr) ++num_batches;
2045
2022
  }
2046
- gpr_log(GPR_INFO,
2047
- "chand=%p calld=%p: failing %" PRIuPTR " pending batches: %s",
2048
- elem->channel_data, this, num_batches,
2049
- grpc_error_std_string(error).c_str());
2023
+ gpr_log(
2024
+ GPR_INFO, "chand=%p calld=%p: failing %" PRIuPTR " pending batches: %s",
2025
+ elem->channel_data, this, num_batches, StatusToString(error).c_str());
2050
2026
  }
2051
2027
  CallCombinerClosureList closures;
2052
2028
  for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
@@ -2056,7 +2032,7 @@ void ClientChannel::CallData::PendingBatchesFail(
2056
2032
  GRPC_CLOSURE_INIT(&batch->handler_private.closure,
2057
2033
  FailPendingBatchInCallCombiner, batch,
2058
2034
  grpc_schedule_on_exec_ctx);
2059
- closures.Add(&batch->handler_private.closure, GRPC_ERROR_REF(error),
2035
+ closures.Add(&batch->handler_private.closure, error,
2060
2036
  "PendingBatchesFail");
2061
2037
  batch = nullptr;
2062
2038
  }
@@ -2066,7 +2042,6 @@ void ClientChannel::CallData::PendingBatchesFail(
2066
2042
  } else {
2067
2043
  closures.RunClosuresWithoutYielding(call_combiner_);
2068
2044
  }
2069
- GRPC_ERROR_UNREF(error);
2070
2045
  }
2071
2046
 
2072
2047
  // This is called via the call combiner, so access to calld is synchronized.
@@ -2102,7 +2077,7 @@ void ClientChannel::CallData::PendingBatchesResume(grpc_call_element* elem) {
2102
2077
  batch->handler_private.extra_arg = elem;
2103
2078
  GRPC_CLOSURE_INIT(&batch->handler_private.closure,
2104
2079
  ResumePendingBatchInCallCombiner, batch, nullptr);
2105
- closures.Add(&batch->handler_private.closure, GRPC_ERROR_NONE,
2080
+ closures.Add(&batch->handler_private.closure, absl::OkStatus(),
2106
2081
  "resuming pending batch from client channel call");
2107
2082
  batch = nullptr;
2108
2083
  }
@@ -2134,18 +2109,18 @@ class ClientChannel::CallData::ResolverQueuedCallCanceller {
2134
2109
  auto* calld = static_cast<CallData*>(self->elem_->call_data);
2135
2110
  {
2136
2111
  MutexLock lock(&chand->resolution_mu_);
2137
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
2112
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2138
2113
  gpr_log(GPR_INFO,
2139
2114
  "chand=%p calld=%p: cancelling resolver queued pick: "
2140
2115
  "error=%s self=%p calld->resolver_pick_canceller=%p",
2141
- chand, calld, grpc_error_std_string(error).c_str(), self,
2116
+ chand, calld, StatusToString(error).c_str(), self,
2142
2117
  calld->resolver_call_canceller_);
2143
2118
  }
2144
- if (calld->resolver_call_canceller_ == self && error != GRPC_ERROR_NONE) {
2119
+ if (calld->resolver_call_canceller_ == self && !error.ok()) {
2145
2120
  // Remove pick from list of queued picks.
2146
2121
  calld->MaybeRemoveCallFromResolverQueuedCallsLocked(self->elem_);
2147
2122
  // Fail pending batches on the call.
2148
- calld->PendingBatchesFail(self->elem_, GRPC_ERROR_REF(error),
2123
+ calld->PendingBatchesFail(self->elem_, error,
2149
2124
  YieldCallCombinerIfPendingBatchesFound);
2150
2125
  }
2151
2126
  }
@@ -2161,7 +2136,7 @@ void ClientChannel::CallData::MaybeRemoveCallFromResolverQueuedCallsLocked(
2161
2136
  grpc_call_element* elem) {
2162
2137
  if (!queued_pending_resolver_result_) return;
2163
2138
  auto* chand = static_cast<ClientChannel*>(elem->channel_data);
2164
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
2139
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2165
2140
  gpr_log(GPR_INFO,
2166
2141
  "chand=%p calld=%p: removing from resolver queued picks list",
2167
2142
  chand, this);
@@ -2176,7 +2151,7 @@ void ClientChannel::CallData::MaybeAddCallToResolverQueuedCallsLocked(
2176
2151
  grpc_call_element* elem) {
2177
2152
  if (queued_pending_resolver_result_) return;
2178
2153
  auto* chand = static_cast<ClientChannel*>(elem->channel_data);
2179
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
2154
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2180
2155
  gpr_log(GPR_INFO, "chand=%p calld=%p: adding to resolver queued picks list",
2181
2156
  chand, this);
2182
2157
  }
@@ -2190,7 +2165,7 @@ void ClientChannel::CallData::MaybeAddCallToResolverQueuedCallsLocked(
2190
2165
  grpc_error_handle ClientChannel::CallData::ApplyServiceConfigToCallLocked(
2191
2166
  grpc_call_element* elem, grpc_metadata_batch* initial_metadata) {
2192
2167
  ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
2193
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
2168
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2194
2169
  gpr_log(GPR_INFO, "chand=%p calld=%p: applying service config to call",
2195
2170
  chand, this);
2196
2171
  }
@@ -2199,7 +2174,10 @@ grpc_error_handle ClientChannel::CallData::ApplyServiceConfigToCallLocked(
2199
2174
  // Use the ConfigSelector to determine the config for the call.
2200
2175
  ConfigSelector::CallConfig call_config =
2201
2176
  config_selector->GetCallConfig({&path_, initial_metadata, arena_});
2202
- if (call_config.error != GRPC_ERROR_NONE) return call_config.error;
2177
+ if (!call_config.status.ok()) {
2178
+ return absl_status_to_grpc_error(MaybeRewriteIllegalStatusCode(
2179
+ std::move(call_config.status), "ConfigSelector"));
2180
+ }
2203
2181
  // Create a ClientChannelServiceConfigCallData for the call. This stores
2204
2182
  // a ref to the ServiceConfig and caches the right set of parsed configs
2205
2183
  // to use for the call. The ClientChannelServiceConfigCallData will store
@@ -2213,13 +2191,14 @@ grpc_error_handle ClientChannel::CallData::ApplyServiceConfigToCallLocked(
2213
2191
  // Apply our own method params to the call.
2214
2192
  auto* method_params = static_cast<ClientChannelMethodParsedConfig*>(
2215
2193
  service_config_call_data->GetMethodParsedConfig(
2216
- internal::ClientChannelServiceConfigParser::ParserIndex()));
2194
+ chand->service_config_parser_index_));
2217
2195
  if (method_params != nullptr) {
2218
2196
  // If the deadline from the service config is shorter than the one
2219
2197
  // from the client API, reset the deadline timer.
2220
- if (chand->deadline_checking_enabled_ && method_params->timeout() != 0) {
2221
- const grpc_millis per_method_deadline =
2222
- grpc_cycle_counter_to_millis_round_up(call_start_time_) +
2198
+ if (chand->deadline_checking_enabled_ &&
2199
+ method_params->timeout() != Duration::Zero()) {
2200
+ const Timestamp per_method_deadline =
2201
+ Timestamp::FromCycleCounterRoundUp(call_start_time_) +
2223
2202
  method_params->timeout();
2224
2203
  if (per_method_deadline < deadline_) {
2225
2204
  deadline_ = per_method_deadline;
@@ -2228,50 +2207,43 @@ grpc_error_handle ClientChannel::CallData::ApplyServiceConfigToCallLocked(
2228
2207
  }
2229
2208
  // If the service config set wait_for_ready and the application
2230
2209
  // did not explicitly set it, use the value from the service config.
2231
- uint32_t* send_initial_metadata_flags =
2232
- &pending_batches_[0]
2233
- ->payload->send_initial_metadata.send_initial_metadata_flags;
2210
+ auto* wait_for_ready =
2211
+ pending_batches_[0]
2212
+ ->payload->send_initial_metadata.send_initial_metadata
2213
+ ->GetOrCreatePointer(WaitForReady());
2234
2214
  if (method_params->wait_for_ready().has_value() &&
2235
- !(*send_initial_metadata_flags &
2236
- GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET)) {
2237
- if (method_params->wait_for_ready().value()) {
2238
- *send_initial_metadata_flags |= GRPC_INITIAL_METADATA_WAIT_FOR_READY;
2239
- } else {
2240
- *send_initial_metadata_flags &= ~GRPC_INITIAL_METADATA_WAIT_FOR_READY;
2241
- }
2215
+ !wait_for_ready->explicitly_set) {
2216
+ wait_for_ready->value = method_params->wait_for_ready().value();
2242
2217
  }
2243
2218
  }
2244
2219
  // Set the dynamic filter stack.
2245
2220
  dynamic_filters_ = chand->dynamic_filters_;
2246
2221
  }
2247
- return GRPC_ERROR_NONE;
2222
+ return absl::OkStatus();
2248
2223
  }
2249
2224
 
2250
2225
  void ClientChannel::CallData::
2251
2226
  RecvTrailingMetadataReadyForConfigSelectorCommitCallback(
2252
2227
  void* arg, grpc_error_handle error) {
2253
- auto* self = static_cast<CallData*>(arg);
2228
+ auto* elem = static_cast<grpc_call_element*>(arg);
2229
+ auto* chand = static_cast<ClientChannel*>(elem->channel_data);
2230
+ auto* calld = static_cast<CallData*>(elem->call_data);
2254
2231
  auto* service_config_call_data =
2255
2232
  static_cast<ClientChannelServiceConfigCallData*>(
2256
- self->call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
2233
+ calld->call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
2234
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2235
+ gpr_log(GPR_INFO,
2236
+ "chand=%p calld=%p: got recv_trailing_metadata_ready: error=%s "
2237
+ "service_config_call_data=%p",
2238
+ chand, calld, StatusToString(error).c_str(),
2239
+ service_config_call_data);
2240
+ }
2257
2241
  if (service_config_call_data != nullptr) {
2258
2242
  service_config_call_data->call_dispatch_controller()->Commit();
2259
2243
  }
2260
2244
  // Chain to original callback.
2261
- Closure::Run(DEBUG_LOCATION, self->original_recv_trailing_metadata_ready_,
2262
- GRPC_ERROR_REF(error));
2263
- }
2264
-
2265
- void ClientChannel::CallData::
2266
- InjectRecvTrailingMetadataReadyForConfigSelectorCommitCallback(
2267
- grpc_transport_stream_op_batch* batch) {
2268
- original_recv_trailing_metadata_ready_ =
2269
- batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready;
2270
- GRPC_CLOSURE_INIT(&recv_trailing_metadata_ready_,
2271
- RecvTrailingMetadataReadyForConfigSelectorCommitCallback,
2272
- this, nullptr);
2273
- batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready =
2274
- &recv_trailing_metadata_ready_;
2245
+ Closure::Run(DEBUG_LOCATION, calld->original_recv_trailing_metadata_ready_,
2246
+ error);
2275
2247
  }
2276
2248
 
2277
2249
  void ClientChannel::CallData::AsyncResolutionDone(grpc_call_element* elem,
@@ -2286,13 +2258,13 @@ void ClientChannel::CallData::ResolutionDone(void* arg,
2286
2258
  grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
2287
2259
  ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
2288
2260
  CallData* calld = static_cast<CallData*>(elem->call_data);
2289
- if (error != GRPC_ERROR_NONE) {
2290
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
2261
+ if (!error.ok()) {
2262
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2291
2263
  gpr_log(GPR_INFO,
2292
2264
  "chand=%p calld=%p: error applying config to call: error=%s",
2293
- chand, calld, grpc_error_std_string(error).c_str());
2265
+ chand, calld, StatusToString(error).c_str());
2294
2266
  }
2295
- calld->PendingBatchesFail(elem, GRPC_ERROR_REF(error), YieldCallCombiner);
2267
+ calld->PendingBatchesFail(elem, error, YieldCallCombiner);
2296
2268
  return;
2297
2269
  }
2298
2270
  calld->CreateDynamicCall(elem);
@@ -2310,7 +2282,6 @@ void ClientChannel::CallData::CheckResolution(void* arg,
2310
2282
  }
2311
2283
  if (resolution_complete) {
2312
2284
  ResolutionDone(elem, error);
2313
- GRPC_ERROR_UNREF(error);
2314
2285
  }
2315
2286
  }
2316
2287
 
@@ -2319,6 +2290,9 @@ bool ClientChannel::CallData::CheckResolutionLocked(grpc_call_element* elem,
2319
2290
  ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
2320
2291
  // If we're still in IDLE, we need to start resolving.
2321
2292
  if (GPR_UNLIKELY(chand->CheckConnectivityState(false) == GRPC_CHANNEL_IDLE)) {
2293
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2294
+ gpr_log(GPR_INFO, "chand=%p calld=%p: triggering exit idle", chand, this);
2295
+ }
2322
2296
  // Bounce into the control plane work serializer to start resolving,
2323
2297
  // in case we are still in IDLE state. Since we are holding on to the
2324
2298
  // resolution mutex here, we offload it on the ExecCtx so that we don't
@@ -2331,7 +2305,7 @@ bool ClientChannel::CallData::CheckResolutionLocked(grpc_call_element* elem,
2331
2305
  auto* chand = static_cast<ClientChannel*>(arg);
2332
2306
  chand->work_serializer_->Run(
2333
2307
  [chand]()
2334
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand->work_serializer_) {
2308
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand->work_serializer_) {
2335
2309
  chand->CheckConnectivityState(/*try_to_connect=*/true);
2336
2310
  GRPC_CHANNEL_STACK_UNREF(chand->owning_stack_,
2337
2311
  "CheckResolutionLocked");
@@ -2339,31 +2313,36 @@ bool ClientChannel::CallData::CheckResolutionLocked(grpc_call_element* elem,
2339
2313
  DEBUG_LOCATION);
2340
2314
  },
2341
2315
  chand, nullptr),
2342
- GRPC_ERROR_NONE);
2316
+ absl::OkStatus());
2343
2317
  }
2344
2318
  // Get send_initial_metadata batch and flags.
2345
2319
  auto& send_initial_metadata =
2346
2320
  pending_batches_[0]->payload->send_initial_metadata;
2347
2321
  grpc_metadata_batch* initial_metadata_batch =
2348
2322
  send_initial_metadata.send_initial_metadata;
2349
- const uint32_t send_initial_metadata_flags =
2350
- send_initial_metadata.send_initial_metadata_flags;
2351
2323
  // If we don't yet have a resolver result, we need to queue the call
2352
2324
  // until we get one.
2353
2325
  if (GPR_UNLIKELY(!chand->received_service_config_data_)) {
2354
2326
  // If the resolver returned transient failure before returning the
2355
2327
  // first service config, fail any non-wait_for_ready calls.
2356
- grpc_error_handle resolver_error = chand->resolver_transient_failure_error_;
2357
- if (resolver_error != GRPC_ERROR_NONE &&
2358
- (send_initial_metadata_flags & GRPC_INITIAL_METADATA_WAIT_FOR_READY) ==
2359
- 0) {
2328
+ absl::Status resolver_error = chand->resolver_transient_failure_error_;
2329
+ if (!resolver_error.ok() &&
2330
+ !initial_metadata_batch->GetOrCreatePointer(WaitForReady())->value) {
2331
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2332
+ gpr_log(GPR_INFO, "chand=%p calld=%p: resolution failed, failing call",
2333
+ chand, this);
2334
+ }
2360
2335
  MaybeRemoveCallFromResolverQueuedCallsLocked(elem);
2361
- *error = GRPC_ERROR_REF(resolver_error);
2336
+ *error = absl_status_to_grpc_error(resolver_error);
2362
2337
  return true;
2363
2338
  }
2364
2339
  // Either the resolver has not yet returned a result, or it has
2365
2340
  // returned transient failure but the call is wait_for_ready. In
2366
2341
  // either case, queue the call.
2342
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2343
+ gpr_log(GPR_INFO, "chand=%p calld=%p: queuing to wait for resolution",
2344
+ chand, this);
2345
+ }
2367
2346
  MaybeAddCallToResolverQueuedCallsLocked(elem);
2368
2347
  return false;
2369
2348
  }
@@ -2386,20 +2365,20 @@ void ClientChannel::CallData::CreateDynamicCall(grpc_call_element* elem) {
2386
2365
  arena_,
2387
2366
  call_context_,
2388
2367
  call_combiner_};
2389
- grpc_error_handle error = GRPC_ERROR_NONE;
2368
+ grpc_error_handle error;
2390
2369
  DynamicFilters* channel_stack = args.channel_stack.get();
2391
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
2370
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2392
2371
  gpr_log(
2393
2372
  GPR_INFO,
2394
2373
  "chand=%p calld=%p: creating dynamic call stack on channel_stack=%p",
2395
2374
  chand, this, channel_stack);
2396
2375
  }
2397
2376
  dynamic_call_ = channel_stack->CreateCall(std::move(args), &error);
2398
- if (error != GRPC_ERROR_NONE) {
2399
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
2377
+ if (!error.ok()) {
2378
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2400
2379
  gpr_log(GPR_INFO,
2401
2380
  "chand=%p calld=%p: failed to create dynamic call: error=%s",
2402
- chand, this, grpc_error_std_string(error).c_str());
2381
+ chand, this, StatusToString(error).c_str());
2403
2382
  }
2404
2383
  PendingBatchesFail(elem, error, YieldCallCombiner);
2405
2384
  return;
@@ -2414,39 +2393,71 @@ void ClientChannel::CallData::CreateDynamicCall(grpc_call_element* elem) {
2414
2393
  class ClientChannel::LoadBalancedCall::Metadata
2415
2394
  : public LoadBalancingPolicy::MetadataInterface {
2416
2395
  public:
2417
- Metadata(LoadBalancedCall* lb_call, grpc_metadata_batch* batch)
2418
- : lb_call_(lb_call), batch_(batch) {}
2396
+ explicit Metadata(grpc_metadata_batch* batch) : batch_(batch) {}
2419
2397
 
2420
2398
  void Add(absl::string_view key, absl::string_view value) override {
2421
- grpc_linked_mdelem* linked_mdelem = static_cast<grpc_linked_mdelem*>(
2422
- lb_call_->arena_->Alloc(sizeof(grpc_linked_mdelem)));
2423
- linked_mdelem->md = grpc_mdelem_from_slices(
2424
- ExternallyManagedSlice(key.data(), key.size()),
2425
- ExternallyManagedSlice(value.data(), value.size()));
2426
- GPR_ASSERT(batch_->LinkTail(linked_mdelem) == GRPC_ERROR_NONE);
2399
+ if (batch_ == nullptr) return;
2400
+ // Gross, egregious hack to support legacy grpclb behavior.
2401
+ // TODO(ctiller): Use a promise context for this once that plumbing is done.
2402
+ if (key == GrpcLbClientStatsMetadata::key()) {
2403
+ batch_->Set(
2404
+ GrpcLbClientStatsMetadata(),
2405
+ const_cast<GrpcLbClientStats*>(
2406
+ reinterpret_cast<const GrpcLbClientStats*>(value.data())));
2407
+ return;
2408
+ }
2409
+ batch_->Append(key, Slice::FromStaticString(value),
2410
+ [key](absl::string_view error, const Slice& value) {
2411
+ gpr_log(GPR_ERROR, "%s",
2412
+ absl::StrCat(error, " key:", key,
2413
+ " value:", value.as_string_view())
2414
+ .c_str());
2415
+ });
2427
2416
  }
2428
2417
 
2429
2418
  std::vector<std::pair<std::string, std::string>> TestOnlyCopyToVector()
2430
2419
  override {
2431
- std::vector<std::pair<std::string, std::string>> result;
2432
- batch_->ForEach([&](grpc_mdelem md) {
2433
- auto key = std::string(StringViewFromSlice(GRPC_MDKEY(md)));
2434
- if (key != ":path") {
2435
- result.push_back(
2436
- std::make_pair(std::move(key),
2437
- std::string(StringViewFromSlice(GRPC_MDVALUE(md)))));
2438
- }
2439
- });
2440
- return result;
2420
+ if (batch_ == nullptr) return {};
2421
+ Encoder encoder;
2422
+ batch_->Encode(&encoder);
2423
+ return encoder.Take();
2441
2424
  }
2442
2425
 
2443
2426
  absl::optional<absl::string_view> Lookup(absl::string_view key,
2444
2427
  std::string* buffer) const override {
2445
- return batch_->GetValue(key, buffer);
2428
+ if (batch_ == nullptr) return absl::nullopt;
2429
+ return batch_->GetStringValue(key, buffer);
2446
2430
  }
2447
2431
 
2448
2432
  private:
2449
- LoadBalancedCall* lb_call_;
2433
+ class Encoder {
2434
+ public:
2435
+ void Encode(const Slice& key, const Slice& value) {
2436
+ out_.emplace_back(std::string(key.as_string_view()),
2437
+ std::string(value.as_string_view()));
2438
+ }
2439
+
2440
+ template <class Which>
2441
+ void Encode(Which, const typename Which::ValueType& value) {
2442
+ auto value_slice = Which::Encode(value);
2443
+ out_.emplace_back(std::string(Which::key()),
2444
+ std::string(value_slice.as_string_view()));
2445
+ }
2446
+
2447
+ void Encode(GrpcTimeoutMetadata,
2448
+ const typename GrpcTimeoutMetadata::ValueType&) {}
2449
+ void Encode(HttpPathMetadata, const Slice&) {}
2450
+ void Encode(HttpMethodMetadata,
2451
+ const typename HttpMethodMetadata::ValueType&) {}
2452
+
2453
+ std::vector<std::pair<std::string, std::string>> Take() {
2454
+ return std::move(out_);
2455
+ }
2456
+
2457
+ private:
2458
+ std::vector<std::pair<std::string, std::string>> out_;
2459
+ };
2460
+
2450
2461
  grpc_metadata_batch* batch_;
2451
2462
  };
2452
2463
 
@@ -2454,41 +2465,62 @@ class ClientChannel::LoadBalancedCall::Metadata
2454
2465
  // ClientChannel::LoadBalancedCall::LbCallState
2455
2466
  //
2456
2467
 
2457
- class ClientChannel::LoadBalancedCall::LbCallState
2458
- : public LoadBalancingPolicy::CallState {
2459
- public:
2460
- explicit LbCallState(LoadBalancedCall* lb_call) : lb_call_(lb_call) {}
2468
+ absl::string_view
2469
+ ClientChannel::LoadBalancedCall::LbCallState::GetCallAttribute(
2470
+ UniqueTypeName type) {
2471
+ auto* service_config_call_data = static_cast<ServiceConfigCallData*>(
2472
+ lb_call_->call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
2473
+ auto& call_attributes = service_config_call_data->call_attributes();
2474
+ auto it = call_attributes.find(type);
2475
+ if (it == call_attributes.end()) return absl::string_view();
2476
+ return it->second;
2477
+ }
2461
2478
 
2462
- void* Alloc(size_t size) override { return lb_call_->arena_->Alloc(size); }
2479
+ //
2480
+ // ClientChannel::LoadBalancedCall::BackendMetricAccessor
2481
+ //
2463
2482
 
2464
- const LoadBalancingPolicy::BackendMetricData* GetBackendMetricData()
2465
- override {
2466
- if (lb_call_->backend_metric_data_ == nullptr) {
2467
- grpc_linked_mdelem* md = lb_call_->recv_trailing_metadata_->legacy_index()
2468
- ->named.x_endpoint_load_metrics_bin;
2469
- if (md != nullptr) {
2483
+ class ClientChannel::LoadBalancedCall::BackendMetricAccessor
2484
+ : public LoadBalancingPolicy::BackendMetricAccessor {
2485
+ public:
2486
+ explicit BackendMetricAccessor(LoadBalancedCall* lb_call)
2487
+ : lb_call_(lb_call) {}
2488
+
2489
+ const BackendMetricData* GetBackendMetricData() override {
2490
+ if (lb_call_->backend_metric_data_ == nullptr &&
2491
+ lb_call_->recv_trailing_metadata_ != nullptr) {
2492
+ if (const auto* md = lb_call_->recv_trailing_metadata_->get_pointer(
2493
+ EndpointLoadMetricsBinMetadata())) {
2494
+ BackendMetricAllocator allocator(lb_call_->arena_);
2470
2495
  lb_call_->backend_metric_data_ =
2471
- ParseBackendMetricData(GRPC_MDVALUE(md->md), lb_call_->arena_);
2496
+ ParseBackendMetricData(md->as_string_view(), &allocator);
2472
2497
  }
2473
2498
  }
2474
2499
  return lb_call_->backend_metric_data_;
2475
2500
  }
2476
2501
 
2477
- absl::string_view ExperimentalGetCallAttribute(const char* key) override {
2478
- auto* service_config_call_data = static_cast<ServiceConfigCallData*>(
2479
- lb_call_->call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
2480
- auto& call_attributes = service_config_call_data->call_attributes();
2481
- auto it = call_attributes.find(key);
2482
- if (it == call_attributes.end()) return absl::string_view();
2483
- return it->second;
2484
- }
2485
-
2486
2502
  private:
2503
+ class BackendMetricAllocator : public BackendMetricAllocatorInterface {
2504
+ public:
2505
+ explicit BackendMetricAllocator(Arena* arena) : arena_(arena) {}
2506
+
2507
+ BackendMetricData* AllocateBackendMetricData() override {
2508
+ return arena_->New<BackendMetricData>();
2509
+ }
2510
+
2511
+ char* AllocateString(size_t size) override {
2512
+ return static_cast<char*>(arena_->Alloc(size));
2513
+ }
2514
+
2515
+ private:
2516
+ Arena* arena_;
2517
+ };
2518
+
2487
2519
  LoadBalancedCall* lb_call_;
2488
2520
  };
2489
2521
 
2490
2522
  //
2491
- // LoadBalancedCall
2523
+ // ClientChannel::LoadBalancedCall
2492
2524
  //
2493
2525
 
2494
2526
  namespace {
@@ -2509,11 +2541,11 @@ ClientChannel::LoadBalancedCall::LoadBalancedCall(
2509
2541
  ConfigSelector::CallDispatchController* call_dispatch_controller,
2510
2542
  bool is_transparent_retry)
2511
2543
  : InternallyRefCounted(
2512
- GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)
2544
+ GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)
2513
2545
  ? "LoadBalancedCall"
2514
2546
  : nullptr),
2515
2547
  chand_(chand),
2516
- path_(grpc_slice_ref_internal(args.path)),
2548
+ path_(CSliceRef(args.path)),
2517
2549
  deadline_(args.deadline),
2518
2550
  arena_(args.arena),
2519
2551
  owning_call_(args.call_stack),
@@ -2523,15 +2555,15 @@ ClientChannel::LoadBalancedCall::LoadBalancedCall(
2523
2555
  on_call_destruction_complete_(on_call_destruction_complete),
2524
2556
  call_dispatch_controller_(call_dispatch_controller),
2525
2557
  call_attempt_tracer_(
2526
- GetCallAttemptTracer(args.context, is_transparent_retry)) {}
2558
+ GetCallAttemptTracer(args.context, is_transparent_retry)) {
2559
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2560
+ gpr_log(GPR_INFO, "chand=%p lb_call=%p: created", chand_, this);
2561
+ }
2562
+ }
2527
2563
 
2528
2564
  ClientChannel::LoadBalancedCall::~LoadBalancedCall() {
2529
- grpc_slice_unref_internal(path_);
2530
- GRPC_ERROR_UNREF(cancel_error_);
2531
- GRPC_ERROR_UNREF(failure_error_);
2532
2565
  if (backend_metric_data_ != nullptr) {
2533
- backend_metric_data_
2534
- ->LoadBalancingPolicy::BackendMetricData::~BackendMetricData();
2566
+ backend_metric_data_->BackendMetricData::~BackendMetricData();
2535
2567
  }
2536
2568
  // Make sure there are no remaining pending batches.
2537
2569
  for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
@@ -2539,11 +2571,17 @@ ClientChannel::LoadBalancedCall::~LoadBalancedCall() {
2539
2571
  }
2540
2572
  if (on_call_destruction_complete_ != nullptr) {
2541
2573
  ExecCtx::Run(DEBUG_LOCATION, on_call_destruction_complete_,
2542
- GRPC_ERROR_NONE);
2574
+ absl::OkStatus());
2543
2575
  }
2544
2576
  }
2545
2577
 
2546
2578
  void ClientChannel::LoadBalancedCall::Orphan() {
2579
+ // If the recv_trailing_metadata op was never started, then notify
2580
+ // about call completion here, as best we can. We assume status
2581
+ // CANCELLED in this case.
2582
+ if (recv_trailing_metadata_ == nullptr) {
2583
+ RecordCallCompletion(absl::CancelledError("call cancelled"));
2584
+ }
2547
2585
  // Compute latency and report it to the tracer.
2548
2586
  if (call_attempt_tracer_ != nullptr) {
2549
2587
  gpr_timespec latency =
@@ -2570,7 +2608,7 @@ size_t ClientChannel::LoadBalancedCall::GetBatchIndex(
2570
2608
  void ClientChannel::LoadBalancedCall::PendingBatchesAdd(
2571
2609
  grpc_transport_stream_op_batch* batch) {
2572
2610
  const size_t idx = GetBatchIndex(batch);
2573
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2611
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2574
2612
  gpr_log(GPR_INFO,
2575
2613
  "chand=%p lb_call=%p: adding pending batch at index %" PRIuPTR,
2576
2614
  chand_, this, idx);
@@ -2586,25 +2624,24 @@ void ClientChannel::LoadBalancedCall::FailPendingBatchInCallCombiner(
2586
2624
  static_cast<grpc_transport_stream_op_batch*>(arg);
2587
2625
  auto* self = static_cast<LoadBalancedCall*>(batch->handler_private.extra_arg);
2588
2626
  // Note: This will release the call combiner.
2589
- grpc_transport_stream_op_batch_finish_with_failure(
2590
- batch, GRPC_ERROR_REF(error), self->call_combiner_);
2627
+ grpc_transport_stream_op_batch_finish_with_failure(batch, error,
2628
+ self->call_combiner_);
2591
2629
  }
2592
2630
 
2593
2631
  // This is called via the call combiner, so access to calld is synchronized.
2594
2632
  void ClientChannel::LoadBalancedCall::PendingBatchesFail(
2595
2633
  grpc_error_handle error,
2596
2634
  YieldCallCombinerPredicate yield_call_combiner_predicate) {
2597
- GPR_ASSERT(error != GRPC_ERROR_NONE);
2598
- GRPC_ERROR_UNREF(failure_error_);
2635
+ GPR_ASSERT(!error.ok());
2599
2636
  failure_error_ = error;
2600
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2637
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2601
2638
  size_t num_batches = 0;
2602
2639
  for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
2603
2640
  if (pending_batches_[i] != nullptr) ++num_batches;
2604
2641
  }
2605
2642
  gpr_log(GPR_INFO,
2606
2643
  "chand=%p lb_call=%p: failing %" PRIuPTR " pending batches: %s",
2607
- chand_, this, num_batches, grpc_error_std_string(error).c_str());
2644
+ chand_, this, num_batches, StatusToString(error).c_str());
2608
2645
  }
2609
2646
  CallCombinerClosureList closures;
2610
2647
  for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
@@ -2614,7 +2651,7 @@ void ClientChannel::LoadBalancedCall::PendingBatchesFail(
2614
2651
  GRPC_CLOSURE_INIT(&batch->handler_private.closure,
2615
2652
  FailPendingBatchInCallCombiner, batch,
2616
2653
  grpc_schedule_on_exec_ctx);
2617
- closures.Add(&batch->handler_private.closure, GRPC_ERROR_REF(error),
2654
+ closures.Add(&batch->handler_private.closure, error,
2618
2655
  "PendingBatchesFail");
2619
2656
  batch = nullptr;
2620
2657
  }
@@ -2639,7 +2676,7 @@ void ClientChannel::LoadBalancedCall::ResumePendingBatchInCallCombiner(
2639
2676
 
2640
2677
  // This is called via the call combiner, so access to calld is synchronized.
2641
2678
  void ClientChannel::LoadBalancedCall::PendingBatchesResume() {
2642
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2679
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2643
2680
  size_t num_batches = 0;
2644
2681
  for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
2645
2682
  if (pending_batches_[i] != nullptr) ++num_batches;
@@ -2657,7 +2694,7 @@ void ClientChannel::LoadBalancedCall::PendingBatchesResume() {
2657
2694
  GRPC_CLOSURE_INIT(&batch->handler_private.closure,
2658
2695
  ResumePendingBatchInCallCombiner, batch,
2659
2696
  grpc_schedule_on_exec_ctx);
2660
- closures.Add(&batch->handler_private.closure, GRPC_ERROR_NONE,
2697
+ closures.Add(&batch->handler_private.closure, absl::OkStatus(),
2661
2698
  "resuming pending batch from LB call");
2662
2699
  batch = nullptr;
2663
2700
  }
@@ -2668,17 +2705,24 @@ void ClientChannel::LoadBalancedCall::PendingBatchesResume() {
2668
2705
 
2669
2706
  void ClientChannel::LoadBalancedCall::StartTransportStreamOpBatch(
2670
2707
  grpc_transport_stream_op_batch* batch) {
2708
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace) ||
2709
+ GRPC_TRACE_FLAG_ENABLED(grpc_trace_channel)) {
2710
+ gpr_log(GPR_INFO,
2711
+ "chand=%p lb_call=%p: batch started from above: %s, "
2712
+ "call_attempt_tracer_=%p",
2713
+ chand_, this, grpc_transport_stream_op_batch_string(batch).c_str(),
2714
+ call_attempt_tracer_);
2715
+ }
2671
2716
  // Handle call tracing.
2672
2717
  if (call_attempt_tracer_ != nullptr) {
2673
2718
  // Record send ops in tracer.
2674
2719
  if (batch->cancel_stream) {
2675
2720
  call_attempt_tracer_->RecordCancel(
2676
- GRPC_ERROR_REF(batch->payload->cancel_stream.cancel_error));
2721
+ batch->payload->cancel_stream.cancel_error);
2677
2722
  }
2678
2723
  if (batch->send_initial_metadata) {
2679
2724
  call_attempt_tracer_->RecordSendInitialMetadata(
2680
- batch->payload->send_initial_metadata.send_initial_metadata,
2681
- batch->payload->send_initial_metadata.send_initial_metadata_flags);
2725
+ batch->payload->send_initial_metadata.send_initial_metadata);
2682
2726
  peer_string_ = batch->payload->send_initial_metadata.peer_string;
2683
2727
  original_send_initial_metadata_on_complete_ = batch->on_complete;
2684
2728
  GRPC_CLOSURE_INIT(&send_initial_metadata_on_complete_,
@@ -2731,7 +2775,7 @@ void ClientChannel::LoadBalancedCall::StartTransportStreamOpBatch(
2731
2775
  // the channel's data plane mutex, which is more efficient (especially for
2732
2776
  // streaming calls).
2733
2777
  if (subchannel_call_ != nullptr) {
2734
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2778
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2735
2779
  gpr_log(GPR_INFO,
2736
2780
  "chand=%p lb_call=%p: starting batch on subchannel_call=%p",
2737
2781
  chand_, this, subchannel_call_.get());
@@ -2742,14 +2786,14 @@ void ClientChannel::LoadBalancedCall::StartTransportStreamOpBatch(
2742
2786
  // We do not yet have a subchannel call.
2743
2787
  //
2744
2788
  // If we've previously been cancelled, immediately fail any new batches.
2745
- if (GPR_UNLIKELY(cancel_error_ != GRPC_ERROR_NONE)) {
2746
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2789
+ if (GPR_UNLIKELY(!cancel_error_.ok())) {
2790
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2747
2791
  gpr_log(GPR_INFO, "chand=%p lb_call=%p: failing batch with error: %s",
2748
- chand_, this, grpc_error_std_string(cancel_error_).c_str());
2792
+ chand_, this, StatusToString(cancel_error_).c_str());
2749
2793
  }
2750
2794
  // Note: This will release the call combiner.
2751
- grpc_transport_stream_op_batch_finish_with_failure(
2752
- batch, GRPC_ERROR_REF(cancel_error_), call_combiner_);
2795
+ grpc_transport_stream_op_batch_finish_with_failure(batch, cancel_error_,
2796
+ call_combiner_);
2753
2797
  return;
2754
2798
  }
2755
2799
  // Handle cancellation.
@@ -2759,17 +2803,16 @@ void ClientChannel::LoadBalancedCall::StartTransportStreamOpBatch(
2759
2803
  // cancelled before any batches are passed down (e.g., if the deadline
2760
2804
  // is in the past when the call starts), we can return the right
2761
2805
  // error to the caller when the first batch does get passed down.
2762
- GRPC_ERROR_UNREF(cancel_error_);
2763
- cancel_error_ = GRPC_ERROR_REF(batch->payload->cancel_stream.cancel_error);
2764
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2806
+ cancel_error_ = batch->payload->cancel_stream.cancel_error;
2807
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2765
2808
  gpr_log(GPR_INFO, "chand=%p lb_call=%p: recording cancel_error=%s",
2766
- chand_, this, grpc_error_std_string(cancel_error_).c_str());
2809
+ chand_, this, StatusToString(cancel_error_).c_str());
2767
2810
  }
2768
2811
  // Fail all pending batches.
2769
- PendingBatchesFail(GRPC_ERROR_REF(cancel_error_), NoYieldCallCombiner);
2812
+ PendingBatchesFail(cancel_error_, NoYieldCallCombiner);
2770
2813
  // Note: This will release the call combiner.
2771
- grpc_transport_stream_op_batch_finish_with_failure(
2772
- batch, GRPC_ERROR_REF(cancel_error_), call_combiner_);
2814
+ grpc_transport_stream_op_batch_finish_with_failure(batch, cancel_error_,
2815
+ call_combiner_);
2773
2816
  return;
2774
2817
  }
2775
2818
  // Add the batch to the pending list.
@@ -2777,15 +2820,15 @@ void ClientChannel::LoadBalancedCall::StartTransportStreamOpBatch(
2777
2820
  // For batches containing a send_initial_metadata op, acquire the
2778
2821
  // channel's data plane mutex to pick a subchannel.
2779
2822
  if (GPR_LIKELY(batch->send_initial_metadata)) {
2780
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2823
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2781
2824
  gpr_log(GPR_INFO,
2782
2825
  "chand=%p lb_call=%p: grabbing data plane mutex to perform pick",
2783
2826
  chand_, this);
2784
2827
  }
2785
- PickSubchannel(this, GRPC_ERROR_NONE);
2828
+ PickSubchannel(this, absl::OkStatus());
2786
2829
  } else {
2787
2830
  // For all other batches, release the call combiner.
2788
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2831
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2789
2832
  gpr_log(GPR_INFO,
2790
2833
  "chand=%p lb_call=%p: saved batch, yielding call combiner",
2791
2834
  chand_, this);
@@ -2798,44 +2841,66 @@ void ClientChannel::LoadBalancedCall::StartTransportStreamOpBatch(
2798
2841
  void ClientChannel::LoadBalancedCall::SendInitialMetadataOnComplete(
2799
2842
  void* arg, grpc_error_handle error) {
2800
2843
  auto* self = static_cast<LoadBalancedCall*>(arg);
2844
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2845
+ gpr_log(GPR_INFO,
2846
+ "chand=%p lb_call=%p: got on_complete for send_initial_metadata: "
2847
+ "error=%s",
2848
+ self->chand_, self, StatusToString(error).c_str());
2849
+ }
2801
2850
  self->call_attempt_tracer_->RecordOnDoneSendInitialMetadata(
2802
2851
  self->peer_string_);
2803
2852
  Closure::Run(DEBUG_LOCATION,
2804
- self->original_send_initial_metadata_on_complete_,
2805
- GRPC_ERROR_REF(error));
2853
+ self->original_send_initial_metadata_on_complete_, error);
2806
2854
  }
2807
2855
 
2808
2856
  void ClientChannel::LoadBalancedCall::RecvInitialMetadataReady(
2809
2857
  void* arg, grpc_error_handle error) {
2810
2858
  auto* self = static_cast<LoadBalancedCall*>(arg);
2811
- if (error == GRPC_ERROR_NONE) {
2859
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2860
+ gpr_log(GPR_INFO,
2861
+ "chand=%p lb_call=%p: got recv_initial_metadata_ready: error=%s",
2862
+ self->chand_, self, StatusToString(error).c_str());
2863
+ }
2864
+ if (error.ok()) {
2812
2865
  // recv_initial_metadata_flags is not populated for clients
2813
2866
  self->call_attempt_tracer_->RecordReceivedInitialMetadata(
2814
2867
  self->recv_initial_metadata_, 0 /* recv_initial_metadata_flags */);
2815
2868
  }
2816
2869
  Closure::Run(DEBUG_LOCATION, self->original_recv_initial_metadata_ready_,
2817
- GRPC_ERROR_REF(error));
2870
+ error);
2818
2871
  }
2819
2872
 
2820
2873
  void ClientChannel::LoadBalancedCall::RecvMessageReady(
2821
2874
  void* arg, grpc_error_handle error) {
2822
2875
  auto* self = static_cast<LoadBalancedCall*>(arg);
2823
- if (*self->recv_message_ != nullptr) {
2876
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2877
+ gpr_log(GPR_INFO, "chand=%p lb_call=%p: got recv_message_ready: error=%s",
2878
+ self->chand_, self, StatusToString(error).c_str());
2879
+ }
2880
+ if (self->recv_message_->has_value()) {
2824
2881
  self->call_attempt_tracer_->RecordReceivedMessage(**self->recv_message_);
2825
2882
  }
2826
- Closure::Run(DEBUG_LOCATION, self->original_recv_message_ready_,
2827
- GRPC_ERROR_REF(error));
2883
+ Closure::Run(DEBUG_LOCATION, self->original_recv_message_ready_, error);
2828
2884
  }
2829
2885
 
2830
2886
  void ClientChannel::LoadBalancedCall::RecvTrailingMetadataReady(
2831
2887
  void* arg, grpc_error_handle error) {
2832
2888
  auto* self = static_cast<LoadBalancedCall*>(arg);
2889
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2890
+ gpr_log(GPR_INFO,
2891
+ "chand=%p lb_call=%p: got recv_trailing_metadata_ready: error=%s "
2892
+ "call_attempt_tracer_=%p lb_subchannel_call_tracker_=%p "
2893
+ "failure_error_=%s",
2894
+ self->chand_, self, StatusToString(error).c_str(),
2895
+ self->call_attempt_tracer_, self->lb_subchannel_call_tracker_.get(),
2896
+ StatusToString(self->failure_error_).c_str());
2897
+ }
2833
2898
  // Check if we have a tracer or an LB callback to invoke.
2834
2899
  if (self->call_attempt_tracer_ != nullptr ||
2835
- self->lb_recv_trailing_metadata_ready_ != nullptr) {
2900
+ self->lb_subchannel_call_tracker_ != nullptr) {
2836
2901
  // Get the call's status.
2837
2902
  absl::Status status;
2838
- if (error != GRPC_ERROR_NONE) {
2903
+ if (!error.ok()) {
2839
2904
  // Get status from error.
2840
2905
  grpc_status_code code;
2841
2906
  std::string message;
@@ -2844,63 +2909,66 @@ void ClientChannel::LoadBalancedCall::RecvTrailingMetadataReady(
2844
2909
  status = absl::Status(static_cast<absl::StatusCode>(code), message);
2845
2910
  } else {
2846
2911
  // Get status from headers.
2847
- const auto& fields = self->recv_trailing_metadata_->legacy_index()->named;
2848
- GPR_ASSERT(fields.grpc_status != nullptr);
2912
+ const auto& md = *self->recv_trailing_metadata_;
2849
2913
  grpc_status_code code =
2850
- grpc_get_status_code_from_metadata(fields.grpc_status->md);
2914
+ md.get(GrpcStatusMetadata()).value_or(GRPC_STATUS_UNKNOWN);
2851
2915
  if (code != GRPC_STATUS_OK) {
2852
2916
  absl::string_view message;
2853
- if (fields.grpc_message != nullptr) {
2854
- message = StringViewFromSlice(GRPC_MDVALUE(fields.grpc_message->md));
2917
+ if (const auto* grpc_message = md.get_pointer(GrpcMessageMetadata())) {
2918
+ message = grpc_message->as_string_view();
2855
2919
  }
2856
2920
  status = absl::Status(static_cast<absl::StatusCode>(code), message);
2857
2921
  }
2858
2922
  }
2859
- // If we have a tracer, notify it.
2860
- if (self->call_attempt_tracer_ != nullptr) {
2861
- self->call_attempt_tracer_->RecordReceivedTrailingMetadata(
2862
- status, self->recv_trailing_metadata_,
2863
- *self->transport_stream_stats_);
2864
- }
2865
- // If the LB policy requested a callback for trailing metadata, invoke
2866
- // the callback.
2867
- if (self->lb_recv_trailing_metadata_ready_ != nullptr) {
2868
- Metadata trailing_metadata(self, self->recv_trailing_metadata_);
2869
- LbCallState lb_call_state(self);
2870
- self->lb_recv_trailing_metadata_ready_(status, &trailing_metadata,
2871
- &lb_call_state);
2872
- }
2923
+ self->RecordCallCompletion(status);
2873
2924
  }
2874
2925
  // Chain to original callback.
2875
- if (self->failure_error_ != GRPC_ERROR_NONE) {
2926
+ if (!self->failure_error_.ok()) {
2876
2927
  error = self->failure_error_;
2877
- self->failure_error_ = GRPC_ERROR_NONE;
2878
- } else {
2879
- error = GRPC_ERROR_REF(error);
2928
+ self->failure_error_ = absl::OkStatus();
2880
2929
  }
2881
2930
  Closure::Run(DEBUG_LOCATION, self->original_recv_trailing_metadata_ready_,
2882
2931
  error);
2883
2932
  }
2884
2933
 
2934
+ void ClientChannel::LoadBalancedCall::RecordCallCompletion(
2935
+ absl::Status status) {
2936
+ // If we have a tracer, notify it.
2937
+ if (call_attempt_tracer_ != nullptr) {
2938
+ call_attempt_tracer_->RecordReceivedTrailingMetadata(
2939
+ status, recv_trailing_metadata_, transport_stream_stats_);
2940
+ }
2941
+ // If the LB policy requested a callback for trailing metadata, invoke
2942
+ // the callback.
2943
+ if (lb_subchannel_call_tracker_ != nullptr) {
2944
+ Metadata trailing_metadata(recv_trailing_metadata_);
2945
+ BackendMetricAccessor backend_metric_accessor(this);
2946
+ LoadBalancingPolicy::SubchannelCallTrackerInterface::FinishArgs args = {
2947
+ status, &trailing_metadata, &backend_metric_accessor};
2948
+ lb_subchannel_call_tracker_->Finish(args);
2949
+ lb_subchannel_call_tracker_.reset();
2950
+ }
2951
+ }
2952
+
2885
2953
  void ClientChannel::LoadBalancedCall::CreateSubchannelCall() {
2886
2954
  SubchannelCall::Args call_args = {
2887
- std::move(connected_subchannel_), pollent_, path_, /*start_time=*/0,
2955
+ std::move(connected_subchannel_), pollent_, path_.Ref(), /*start_time=*/0,
2888
2956
  deadline_, arena_,
2889
2957
  // TODO(roth): When we implement hedging support, we will probably
2890
2958
  // need to use a separate call context for each subchannel call.
2891
2959
  call_context_, call_combiner_};
2892
- grpc_error_handle error = GRPC_ERROR_NONE;
2960
+ grpc_error_handle error;
2893
2961
  subchannel_call_ = SubchannelCall::Create(std::move(call_args), &error);
2894
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
2962
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2895
2963
  gpr_log(GPR_INFO,
2896
2964
  "chand=%p lb_call=%p: create subchannel_call=%p: error=%s", chand_,
2897
- this, subchannel_call_.get(), grpc_error_std_string(error).c_str());
2965
+ this, subchannel_call_.get(), StatusToString(error).c_str());
2898
2966
  }
2899
2967
  if (on_call_destruction_complete_ != nullptr) {
2900
2968
  subchannel_call_->SetAfterCallStackDestroy(on_call_destruction_complete_);
2901
2969
  on_call_destruction_complete_ = nullptr;
2902
2970
  }
2903
- if (GPR_UNLIKELY(error != GRPC_ERROR_NONE)) {
2971
+ if (GPR_UNLIKELY(!error.ok())) {
2904
2972
  PendingBatchesFail(error, YieldCallCombiner);
2905
2973
  } else {
2906
2974
  PendingBatchesResume();
@@ -2930,19 +2998,19 @@ class ClientChannel::LoadBalancedCall::LbQueuedCallCanceller {
2930
2998
  auto* chand = lb_call->chand_;
2931
2999
  {
2932
3000
  MutexLock lock(&chand->data_plane_mu_);
2933
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
3001
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2934
3002
  gpr_log(GPR_INFO,
2935
3003
  "chand=%p lb_call=%p: cancelling queued pick: "
2936
3004
  "error=%s self=%p calld->pick_canceller=%p",
2937
- chand, lb_call, grpc_error_std_string(error).c_str(), self,
3005
+ chand, lb_call, StatusToString(error).c_str(), self,
2938
3006
  lb_call->lb_call_canceller_);
2939
3007
  }
2940
- if (lb_call->lb_call_canceller_ == self && error != GRPC_ERROR_NONE) {
3008
+ if (lb_call->lb_call_canceller_ == self && !error.ok()) {
2941
3009
  lb_call->call_dispatch_controller_->Commit();
2942
3010
  // Remove pick from list of queued picks.
2943
3011
  lb_call->MaybeRemoveCallFromLbQueuedCallsLocked();
2944
3012
  // Fail pending batches on the call.
2945
- lb_call->PendingBatchesFail(GRPC_ERROR_REF(error),
3013
+ lb_call->PendingBatchesFail(error,
2946
3014
  YieldCallCombinerIfPendingBatchesFound);
2947
3015
  }
2948
3016
  }
@@ -2956,7 +3024,7 @@ class ClientChannel::LoadBalancedCall::LbQueuedCallCanceller {
2956
3024
 
2957
3025
  void ClientChannel::LoadBalancedCall::MaybeRemoveCallFromLbQueuedCallsLocked() {
2958
3026
  if (!queued_pending_lb_pick_) return;
2959
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
3027
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2960
3028
  gpr_log(GPR_INFO, "chand=%p lb_call=%p: removing from queued picks list",
2961
3029
  chand_, this);
2962
3030
  }
@@ -2968,7 +3036,7 @@ void ClientChannel::LoadBalancedCall::MaybeRemoveCallFromLbQueuedCallsLocked() {
2968
3036
 
2969
3037
  void ClientChannel::LoadBalancedCall::MaybeAddCallToLbQueuedCallsLocked() {
2970
3038
  if (queued_pending_lb_pick_) return;
2971
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
3039
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2972
3040
  gpr_log(GPR_INFO, "chand=%p lb_call=%p: adding to queued picks list",
2973
3041
  chand_, this);
2974
3042
  }
@@ -2988,13 +3056,13 @@ void ClientChannel::LoadBalancedCall::AsyncPickDone(grpc_error_handle error) {
2988
3056
  void ClientChannel::LoadBalancedCall::PickDone(void* arg,
2989
3057
  grpc_error_handle error) {
2990
3058
  auto* self = static_cast<LoadBalancedCall*>(arg);
2991
- if (error != GRPC_ERROR_NONE) {
2992
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
3059
+ if (!error.ok()) {
3060
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2993
3061
  gpr_log(GPR_INFO,
2994
3062
  "chand=%p lb_call=%p: failed to pick subchannel: error=%s",
2995
- self->chand_, self, grpc_error_std_string(error).c_str());
3063
+ self->chand_, self, StatusToString(error).c_str());
2996
3064
  }
2997
- self->PendingBatchesFail(GRPC_ERROR_REF(error), YieldCallCombiner);
3065
+ self->PendingBatchesFail(error, YieldCallCombiner);
2998
3066
  return;
2999
3067
  }
3000
3068
  self->call_dispatch_controller_->Commit();
@@ -3011,7 +3079,6 @@ void ClientChannel::LoadBalancedCall::PickSubchannel(void* arg,
3011
3079
  }
3012
3080
  if (pick_complete) {
3013
3081
  PickDone(self, error);
3014
- GRPC_ERROR_UNREF(error);
3015
3082
  }
3016
3083
  }
3017
3084
 
@@ -3024,14 +3091,12 @@ bool ClientChannel::LoadBalancedCall::PickSubchannelLocked(
3024
3091
  pending_batches_[0]->payload->send_initial_metadata;
3025
3092
  grpc_metadata_batch* initial_metadata_batch =
3026
3093
  send_initial_metadata.send_initial_metadata;
3027
- const uint32_t send_initial_metadata_flags =
3028
- send_initial_metadata.send_initial_metadata_flags;
3029
3094
  // Perform LB pick.
3030
3095
  LoadBalancingPolicy::PickArgs pick_args;
3031
- pick_args.path = StringViewFromSlice(path_);
3096
+ pick_args.path = path_.as_string_view();
3032
3097
  LbCallState lb_call_state(this);
3033
3098
  pick_args.call_state = &lb_call_state;
3034
- Metadata initial_metadata(this, initial_metadata_batch);
3099
+ Metadata initial_metadata(initial_metadata_batch);
3035
3100
  pick_args.initial_metadata = &initial_metadata;
3036
3101
  auto result = chand_->picker_->Pick(pick_args);
3037
3102
  return HandlePickResult<bool>(
@@ -3039,7 +3104,7 @@ bool ClientChannel::LoadBalancedCall::PickSubchannelLocked(
3039
3104
  // CompletePick
3040
3105
  [this](LoadBalancingPolicy::PickResult::Complete* complete_pick)
3041
3106
  ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::data_plane_mu_) {
3042
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
3107
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
3043
3108
  gpr_log(GPR_INFO,
3044
3109
  "chand=%p lb_call=%p: LB pick succeeded: subchannel=%p",
3045
3110
  chand_, this, complete_pick->subchannel.get());
@@ -3054,22 +3119,28 @@ bool ClientChannel::LoadBalancedCall::PickSubchannelLocked(
3054
3119
  // subchannel has moved out of state READY but the LB policy hasn't
3055
3120
  // yet seen that change and given us a new picker), then just
3056
3121
  // queue the pick. We'll try again as soon as we get a new picker.
3057
- // TODO(roth): In this case, we need to invoke the LB
3058
- // policy's recv_trailing_metadata_ready callback to tell it
3059
- // that the pick has been abandoned.
3060
3122
  if (connected_subchannel_ == nullptr) {
3123
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
3124
+ gpr_log(GPR_INFO,
3125
+ "chand=%p lb_call=%p: subchannel returned by LB picker "
3126
+ "has no connected subchannel; queueing pick",
3127
+ chand_, this);
3128
+ }
3061
3129
  MaybeAddCallToLbQueuedCallsLocked();
3062
3130
  return false;
3063
3131
  }
3064
- lb_recv_trailing_metadata_ready_ =
3065
- std::move(complete_pick->recv_trailing_metadata_ready);
3132
+ lb_subchannel_call_tracker_ =
3133
+ std::move(complete_pick->subchannel_call_tracker);
3134
+ if (lb_subchannel_call_tracker_ != nullptr) {
3135
+ lb_subchannel_call_tracker_->Start();
3136
+ }
3066
3137
  MaybeRemoveCallFromLbQueuedCallsLocked();
3067
3138
  return true;
3068
3139
  },
3069
3140
  // QueuePick
3070
3141
  [this](LoadBalancingPolicy::PickResult::Queue* /*queue_pick*/)
3071
3142
  ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::data_plane_mu_) {
3072
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
3143
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
3073
3144
  gpr_log(GPR_INFO, "chand=%p lb_call=%p: LB pick queued", chand_,
3074
3145
  this);
3075
3146
  }
@@ -3077,22 +3148,19 @@ bool ClientChannel::LoadBalancedCall::PickSubchannelLocked(
3077
3148
  return false;
3078
3149
  },
3079
3150
  // FailPick
3080
- [this, send_initial_metadata_flags,
3151
+ [this, initial_metadata_batch,
3081
3152
  &error](LoadBalancingPolicy::PickResult::Fail* fail_pick)
3082
3153
  ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::data_plane_mu_) {
3083
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
3154
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
3084
3155
  gpr_log(GPR_INFO, "chand=%p lb_call=%p: LB pick failed: %s",
3085
3156
  chand_, this, fail_pick->status.ToString().c_str());
3086
3157
  }
3087
3158
  // If wait_for_ready is false, then the error indicates the RPC
3088
3159
  // attempt's final status.
3089
- if ((send_initial_metadata_flags &
3090
- GRPC_INITIAL_METADATA_WAIT_FOR_READY) == 0) {
3091
- grpc_error_handle lb_error =
3092
- absl_status_to_grpc_error(fail_pick->status);
3093
- *error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
3094
- "Failed to pick subchannel", &lb_error, 1);
3095
- GRPC_ERROR_UNREF(lb_error);
3160
+ if (!initial_metadata_batch->GetOrCreatePointer(WaitForReady())
3161
+ ->value) {
3162
+ *error = absl_status_to_grpc_error(MaybeRewriteIllegalStatusCode(
3163
+ std::move(fail_pick->status), "LB pick"));
3096
3164
  MaybeRemoveCallFromLbQueuedCallsLocked();
3097
3165
  return true;
3098
3166
  }
@@ -3104,13 +3172,14 @@ bool ClientChannel::LoadBalancedCall::PickSubchannelLocked(
3104
3172
  // DropPick
3105
3173
  [this, &error](LoadBalancingPolicy::PickResult::Drop* drop_pick)
3106
3174
  ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::data_plane_mu_) {
3107
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
3175
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
3108
3176
  gpr_log(GPR_INFO, "chand=%p lb_call=%p: LB pick dropped: %s",
3109
3177
  chand_, this, drop_pick->status.ToString().c_str());
3110
3178
  }
3111
- *error =
3112
- grpc_error_set_int(absl_status_to_grpc_error(drop_pick->status),
3113
- GRPC_ERROR_INT_LB_POLICY_DROP, 1);
3179
+ *error = grpc_error_set_int(
3180
+ absl_status_to_grpc_error(MaybeRewriteIllegalStatusCode(
3181
+ std::move(drop_pick->status), "LB drop")),
3182
+ StatusIntProperty::kLbPolicyDrop, 1);
3114
3183
  MaybeRemoveCallFromLbQueuedCallsLocked();
3115
3184
  return true;
3116
3185
  });