grpc 1.53.0 → 1.56.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 (1668) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +218 -143
  3. data/include/grpc/event_engine/event_engine.h +34 -17
  4. data/include/grpc/grpc_audit_logging.h +96 -0
  5. data/include/grpc/grpc_security.h +4 -0
  6. data/include/grpc/impl/grpc_types.h +13 -2
  7. data/include/grpc/module.modulemap +2 -0
  8. data/include/grpc/support/json.h +218 -0
  9. data/include/grpc/support/port_platform.h +4 -4
  10. data/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +17 -1
  11. data/src/core/ext/filters/client_channel/backend_metric.cc +10 -1
  12. data/src/core/ext/filters/client_channel/backup_poller.cc +2 -11
  13. data/src/core/ext/filters/client_channel/backup_poller.h +0 -3
  14. data/src/core/ext/filters/client_channel/channel_connectivity.cc +4 -4
  15. data/src/core/ext/filters/client_channel/client_channel.cc +911 -898
  16. data/src/core/ext/filters/client_channel/client_channel.h +145 -177
  17. data/src/core/ext/filters/client_channel/client_channel_channelz.cc +20 -19
  18. data/src/core/ext/filters/client_channel/client_channel_internal.h +77 -0
  19. data/src/core/ext/filters/client_channel/client_channel_service_config.cc +2 -2
  20. data/src/core/ext/filters/client_channel/config_selector.h +13 -39
  21. data/src/core/ext/filters/client_channel/http_proxy.cc +35 -2
  22. data/src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h +9 -1
  23. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +24 -24
  24. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +1 -1
  25. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +1 -1
  26. data/src/core/ext/filters/client_channel/lb_policy/health_check_client.cc +455 -0
  27. data/src/core/ext/filters/client_channel/lb_policy/health_check_client.h +54 -0
  28. data/src/core/ext/filters/client_channel/lb_policy/health_check_client_internal.h +186 -0
  29. data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.cc +2 -7
  30. data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.cc +56 -24
  31. data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.h +23 -2
  32. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +19 -6
  33. data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +3 -11
  34. data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +150 -158
  35. data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h +18 -1
  36. data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +54 -66
  37. data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +20 -14
  38. data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +36 -13
  39. data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/static_stride_scheduler.cc +76 -6
  40. data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/weighted_round_robin.cc +83 -53
  41. data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +17 -15
  42. data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +54 -49
  43. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +12 -13
  44. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +18 -23
  45. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +48 -51
  46. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_override_host.cc +12 -17
  47. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_wrr_locality.cc +16 -22
  48. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +46 -153
  49. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.h +30 -0
  50. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +4 -4
  51. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +35 -33
  52. data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_plugin.cc +60 -0
  53. data/src/core/ext/filters/client_channel/resolver/dns/{dns_resolver_selection.h → dns_resolver_plugin.h} +10 -12
  54. data/src/core/ext/filters/client_channel/resolver/dns/event_engine/event_engine_client_channel_resolver.cc +549 -0
  55. data/src/core/ext/filters/client_channel/resolver/dns/event_engine/event_engine_client_channel_resolver.h +35 -0
  56. data/src/core/ext/filters/client_channel/resolver/dns/event_engine/service_config_helper.cc +97 -0
  57. data/src/core/ext/filters/client_channel/resolver/dns/event_engine/service_config_helper.h +32 -0
  58. data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +19 -36
  59. data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.h +24 -0
  60. data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +61 -207
  61. data/src/core/ext/filters/client_channel/resolver/polling_resolver.cc +1 -2
  62. data/src/core/ext/filters/client_channel/resolver/polling_resolver.h +1 -2
  63. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +160 -68
  64. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h +16 -1
  65. data/src/core/ext/filters/client_channel/retry_filter.cc +117 -156
  66. data/src/core/ext/filters/client_channel/retry_service_config.cc +9 -8
  67. data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +10 -40
  68. data/src/core/ext/filters/client_channel/subchannel.cc +12 -200
  69. data/src/core/ext/filters/client_channel/subchannel.h +3 -43
  70. data/src/core/ext/filters/client_channel/subchannel_stream_client.cc +26 -27
  71. data/src/core/ext/filters/client_channel/subchannel_stream_client.h +8 -5
  72. data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.cc +1 -1
  73. data/src/core/ext/filters/http/client/http_client_filter.cc +3 -3
  74. data/src/core/ext/filters/http/http_filters_plugin.cc +1 -12
  75. data/src/core/ext/filters/http/message_compress/compression_filter.cc +30 -14
  76. data/src/core/ext/filters/message_size/message_size_filter.cc +141 -224
  77. data/src/core/ext/filters/message_size/message_size_filter.h +48 -3
  78. data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +168 -75
  79. data/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc +6 -8
  80. data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +10 -9
  81. data/src/core/ext/filters/stateful_session/stateful_session_filter.h +16 -1
  82. data/src/core/ext/gcp/metadata_query.cc +137 -0
  83. data/src/core/ext/gcp/metadata_query.h +87 -0
  84. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +70 -55
  85. data/src/core/ext/transport/chttp2/transport/bin_encoder.cc +12 -8
  86. data/src/core/ext/transport/chttp2/transport/bin_encoder.h +5 -1
  87. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +226 -82
  88. data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +21 -0
  89. data/src/core/ext/transport/chttp2/transport/context_list_entry.h +70 -0
  90. data/src/core/ext/transport/chttp2/transport/flow_control.cc +51 -97
  91. data/src/core/ext/transport/chttp2/transport/flow_control.h +2 -1
  92. data/src/core/ext/transport/chttp2/transport/frame_ping.cc +1 -7
  93. data/src/core/ext/transport/chttp2/transport/frame_ping.h +0 -3
  94. data/src/core/ext/transport/chttp2/transport/frame_settings.cc +4 -1
  95. data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +118 -222
  96. data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +296 -113
  97. data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc +2 -0
  98. data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h +2 -0
  99. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +466 -273
  100. data/src/core/ext/transport/chttp2/transport/hpack_parser.h +7 -3
  101. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +15 -12
  102. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +9 -1
  103. data/src/core/ext/transport/chttp2/transport/internal.h +21 -21
  104. data/src/core/ext/transport/chttp2/transport/parsing.cc +9 -2
  105. data/src/core/ext/transport/chttp2/transport/writing.cc +24 -8
  106. data/src/core/ext/transport/inproc/inproc_transport.cc +20 -14
  107. data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c +87 -52
  108. data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h +414 -181
  109. data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c +121 -60
  110. data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h +481 -224
  111. data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c +90 -55
  112. data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h +415 -188
  113. data/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.c +357 -210
  114. data/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.h +1572 -729
  115. data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c +30 -17
  116. data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h +144 -47
  117. data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c +34 -21
  118. data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h +160 -62
  119. data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c +27 -14
  120. data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h +78 -38
  121. data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c +20 -11
  122. data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h +48 -26
  123. data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c +20 -11
  124. data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h +48 -26
  125. data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c +109 -62
  126. data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h +566 -244
  127. data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c +21 -12
  128. data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h +45 -30
  129. data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c +22 -19
  130. data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +82 -29
  131. data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +23 -16
  132. data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +45 -30
  133. data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +230 -143
  134. data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +733 -404
  135. data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +417 -262
  136. data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +1850 -888
  137. data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c +74 -41
  138. data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h +286 -148
  139. data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +531 -334
  140. data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +2017 -1131
  141. data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c +21 -12
  142. data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h +45 -30
  143. data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +89 -52
  144. data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +347 -232
  145. data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c +264 -165
  146. data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h +888 -476
  147. data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +139 -80
  148. data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +527 -274
  149. data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c +22 -13
  150. data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h +50 -36
  151. data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +380 -221
  152. data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +1168 -611
  153. data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +166 -94
  154. data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +666 -292
  155. data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c +18 -11
  156. data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h +37 -26
  157. data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c +21 -12
  158. data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h +45 -30
  159. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c +30 -17
  160. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h +144 -47
  161. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +274 -167
  162. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +789 -440
  163. data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +228 -137
  164. data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +1100 -501
  165. data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c +22 -13
  166. data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h +60 -37
  167. data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +350 -209
  168. data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +1083 -635
  169. data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +44 -11
  170. data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h +175 -18
  171. data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c +34 -19
  172. data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h +118 -56
  173. data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +38 -21
  174. data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +148 -64
  175. data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +31 -18
  176. data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +143 -65
  177. data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c +22 -13
  178. data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h +51 -37
  179. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +78 -43
  180. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h +265 -127
  181. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +145 -88
  182. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +438 -241
  183. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c +115 -62
  184. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h +559 -227
  185. data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c +18 -11
  186. data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h +35 -26
  187. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +187 -109
  188. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +956 -421
  189. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +172 -95
  190. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +864 -374
  191. data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +49 -25
  192. data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +171 -100
  193. data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +39 -18
  194. data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +74 -56
  195. data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c +28 -15
  196. data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h +71 -45
  197. data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c +131 -74
  198. data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h +489 -249
  199. data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c +135 -80
  200. data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h +505 -245
  201. data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +256 -129
  202. data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +996 -397
  203. data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +80 -49
  204. data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +616 -201
  205. data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +1283 -774
  206. data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +5430 -2509
  207. data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c +49 -28
  208. data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h +164 -84
  209. data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c +228 -141
  210. data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h +738 -399
  211. data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c +20 -11
  212. data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h +48 -26
  213. data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c +21 -12
  214. data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h +45 -30
  215. data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +32 -19
  216. data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h +70 -49
  217. data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c +27 -14
  218. data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h +110 -43
  219. data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c +46 -25
  220. data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h +259 -100
  221. data/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.c +21 -13
  222. data/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.h +45 -30
  223. data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c +18 -11
  224. data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h +35 -26
  225. data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c +42 -23
  226. data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h +108 -70
  227. data/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c +7 -4
  228. data/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h +21 -16
  229. data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c +43 -24
  230. data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h +110 -75
  231. data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c +30 -17
  232. data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h +95 -50
  233. data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c +16 -9
  234. data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +73 -23
  235. data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c +60 -37
  236. data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h +150 -108
  237. data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +74 -43
  238. data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +357 -167
  239. data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c +44 -25
  240. data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +114 -80
  241. data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +41 -20
  242. data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +245 -82
  243. data/src/core/ext/upb-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.c +32 -19
  244. data/src/core/ext/upb-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h +73 -51
  245. data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +474 -292
  246. data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +2144 -1055
  247. data/src/core/ext/upb-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.c +18 -11
  248. data/src/core/ext/upb-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.h +35 -26
  249. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.c +34 -19
  250. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h +125 -67
  251. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.c +72 -45
  252. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +193 -138
  253. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.c +34 -19
  254. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h +131 -66
  255. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.c +18 -11
  256. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.h +35 -26
  257. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c +7 -4
  258. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h +15 -10
  259. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +184 -96
  260. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +907 -360
  261. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +56 -33
  262. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +150 -101
  263. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +188 -111
  264. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +816 -419
  265. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c +32 -19
  266. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h +109 -53
  267. data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c +10 -7
  268. data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h +18 -14
  269. data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +300 -177
  270. data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +1284 -522
  271. data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +42 -23
  272. data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h +188 -75
  273. data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c +130 -83
  274. data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h +510 -238
  275. data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c +22 -13
  276. data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h +55 -34
  277. data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c +39 -26
  278. data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h +124 -68
  279. data/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.c +21 -12
  280. data/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.h +47 -30
  281. data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c +60 -26
  282. data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h +130 -51
  283. data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c +37 -20
  284. data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h +133 -63
  285. data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c +22 -13
  286. data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h +91 -40
  287. data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c +21 -12
  288. data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h +50 -32
  289. data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c +18 -11
  290. data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h +37 -26
  291. data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +46 -27
  292. data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h +101 -70
  293. data/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.c +13 -10
  294. data/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.h +25 -22
  295. data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +40 -23
  296. data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h +161 -75
  297. data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c +31 -18
  298. data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h +114 -56
  299. data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c +46 -29
  300. data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h +139 -91
  301. data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c +65 -42
  302. data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h +200 -121
  303. data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c +80 -45
  304. data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h +208 -131
  305. data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c +34 -21
  306. data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h +74 -53
  307. data/src/core/ext/upb-generated/envoy/type/v3/http.upb.c +7 -4
  308. data/src/core/ext/upb-generated/envoy/type/v3/http.upb.h +13 -8
  309. data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c +16 -9
  310. data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h +28 -18
  311. data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c +28 -15
  312. data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h +55 -34
  313. data/src/core/ext/upb-generated/envoy/type/v3/range.upb.c +43 -22
  314. data/src/core/ext/upb-generated/envoy/type/v3/range.upb.h +91 -53
  315. data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_strategy.upb.c +35 -20
  316. data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_strategy.upb.h +92 -57
  317. data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.c +7 -4
  318. data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h +13 -8
  319. data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c +20 -11
  320. data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h +48 -26
  321. data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c +23 -14
  322. data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h +61 -41
  323. data/src/core/ext/upb-generated/google/api/annotations.upb.c +14 -11
  324. data/src/core/ext/upb-generated/google/api/annotations.upb.h +30 -20
  325. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c +255 -154
  326. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h +934 -450
  327. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +299 -180
  328. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +946 -483
  329. data/src/core/ext/upb-generated/google/api/http.upb.c +68 -35
  330. data/src/core/ext/upb-generated/google/api/http.upb.h +284 -120
  331. data/src/core/ext/upb-generated/google/api/httpbody.upb.c +22 -13
  332. data/src/core/ext/upb-generated/google/api/httpbody.upb.h +95 -37
  333. data/src/core/ext/upb-generated/google/protobuf/any.upb.c +19 -10
  334. data/src/core/ext/upb-generated/google/protobuf/any.upb.h +38 -22
  335. data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +1018 -424
  336. data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +3851 -1412
  337. data/src/core/ext/upb-generated/google/protobuf/duration.upb.c +19 -10
  338. data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +38 -22
  339. data/src/core/ext/upb-generated/google/protobuf/empty.upb.c +10 -7
  340. data/src/core/ext/upb-generated/google/protobuf/empty.upb.h +18 -14
  341. data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +62 -39
  342. data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +207 -102
  343. data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +19 -10
  344. data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +38 -22
  345. data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +90 -51
  346. data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +157 -107
  347. data/src/core/ext/upb-generated/google/rpc/status.upb.c +22 -13
  348. data/src/core/ext/upb-generated/google/rpc/status.upb.h +95 -37
  349. data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c +59 -34
  350. data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h +154 -92
  351. data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +43 -24
  352. data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +118 -60
  353. data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +250 -145
  354. data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +919 -415
  355. data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c +34 -19
  356. data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +76 -51
  357. data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c +25 -14
  358. data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +45 -30
  359. data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +144 -81
  360. data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +405 -217
  361. data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c +51 -26
  362. data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h +153 -61
  363. data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c +173 -102
  364. data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h +855 -298
  365. data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +68 -49
  366. data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +155 -104
  367. data/src/core/ext/upb-generated/udpa/annotations/security.upb.c +26 -17
  368. data/src/core/ext/upb-generated/udpa/annotations/security.upb.h +55 -34
  369. data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c +12 -9
  370. data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +31 -14
  371. data/src/core/ext/upb-generated/udpa/annotations/status.upb.c +26 -17
  372. data/src/core/ext/upb-generated/udpa/annotations/status.upb.h +55 -34
  373. data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c +23 -16
  374. data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h +45 -30
  375. data/src/core/ext/upb-generated/validate/validate.upb.c +845 -455
  376. data/src/core/ext/upb-generated/validate/validate.upb.h +4347 -1908
  377. data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c +68 -49
  378. data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h +155 -104
  379. data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.c +26 -17
  380. data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.h +55 -34
  381. data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c +12 -9
  382. data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h +31 -14
  383. data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c +65 -44
  384. data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h +137 -91
  385. data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c +23 -16
  386. data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h +45 -30
  387. data/src/core/ext/upb-generated/xds/core/v3/authority.upb.c +16 -9
  388. data/src/core/ext/upb-generated/xds/core/v3/authority.upb.h +28 -18
  389. data/src/core/ext/upb-generated/xds/core/v3/cidr.upb.c +21 -12
  390. data/src/core/ext/upb-generated/xds/core/v3/cidr.upb.h +45 -30
  391. data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c +37 -22
  392. data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h +96 -63
  393. data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c +26 -17
  394. data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h +52 -29
  395. data/src/core/ext/upb-generated/xds/core/v3/extension.upb.c +21 -12
  396. data/src/core/ext/upb-generated/xds/core/v3/extension.upb.h +45 -30
  397. data/src/core/ext/upb-generated/xds/core/v3/resource.upb.c +23 -14
  398. data/src/core/ext/upb-generated/xds/core/v3/resource.upb.h +62 -42
  399. data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c +44 -25
  400. data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h +169 -79
  401. data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c +27 -14
  402. data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h +65 -38
  403. data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c +86 -31
  404. data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h +218 -58
  405. data/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.c +21 -12
  406. data/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.h +89 -34
  407. data/src/core/ext/upb-generated/xds/type/matcher/v3/cel.upb.c +18 -11
  408. data/src/core/ext/upb-generated/xds/type/matcher/v3/cel.upb.h +35 -26
  409. data/src/core/ext/upb-generated/xds/type/matcher/v3/domain.upb.c +32 -19
  410. data/src/core/ext/upb-generated/xds/type/matcher/v3/domain.upb.h +150 -54
  411. data/src/core/ext/upb-generated/xds/type/matcher/v3/http_inputs.upb.c +10 -7
  412. data/src/core/ext/upb-generated/xds/type/matcher/v3/http_inputs.upb.h +18 -14
  413. data/src/core/ext/upb-generated/xds/type/matcher/v3/ip.upb.c +34 -21
  414. data/src/core/ext/upb-generated/xds/type/matcher/v3/ip.upb.h +161 -63
  415. data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c +162 -101
  416. data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h +501 -293
  417. data/src/core/ext/upb-generated/xds/type/matcher/v3/range.upb.c +85 -52
  418. data/src/core/ext/upb-generated/xds/type/matcher/v3/range.upb.h +430 -164
  419. data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c +24 -15
  420. data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h +53 -37
  421. data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c +40 -23
  422. data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h +161 -75
  423. data/src/core/ext/upb-generated/xds/type/v3/cel.upb.c +37 -22
  424. data/src/core/ext/upb-generated/xds/type/v3/cel.upb.h +92 -66
  425. data/src/core/ext/upb-generated/xds/type/v3/range.upb.c +43 -22
  426. data/src/core/ext/upb-generated/xds/type/v3/range.upb.h +91 -53
  427. data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c +21 -12
  428. data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h +45 -30
  429. data/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.c +1 -1
  430. data/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.h +6 -5
  431. data/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c +1 -1
  432. data/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.h +6 -5
  433. data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c +1 -1
  434. data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h +6 -5
  435. data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.c +1 -1
  436. data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.h +6 -5
  437. data/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.c +1 -1
  438. data/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.h +6 -5
  439. data/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.c +1 -1
  440. data/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.h +6 -5
  441. data/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.c +1 -1
  442. data/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.h +6 -5
  443. data/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.c +1 -1
  444. data/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.h +6 -5
  445. data/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.c +1 -1
  446. data/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.h +6 -5
  447. data/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.c +1 -1
  448. data/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.h +6 -5
  449. data/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.c +1 -1
  450. data/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.h +6 -5
  451. data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c +1 -1
  452. data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h +6 -5
  453. data/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c +1 -1
  454. data/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h +6 -5
  455. data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c +1 -1
  456. data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h +6 -5
  457. data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +251 -248
  458. data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h +6 -5
  459. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c +1 -1
  460. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.h +6 -5
  461. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +1 -1
  462. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h +6 -5
  463. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c +1 -1
  464. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h +6 -5
  465. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c +1 -1
  466. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h +6 -5
  467. data/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.c +1 -1
  468. data/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.h +6 -5
  469. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c +1 -1
  470. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h +6 -5
  471. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c +1 -1
  472. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h +6 -5
  473. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +1 -1
  474. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h +6 -5
  475. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +13 -12
  476. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h +11 -5
  477. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c +1 -1
  478. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h +6 -5
  479. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c +1 -1
  480. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h +6 -5
  481. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.c +1 -1
  482. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.h +6 -5
  483. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c +1 -1
  484. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h +6 -5
  485. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +1 -1
  486. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h +6 -5
  487. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c +1 -1
  488. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h +6 -5
  489. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +140 -137
  490. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h +6 -5
  491. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c +32 -16
  492. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h +11 -5
  493. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c +1 -1
  494. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h +6 -5
  495. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c +1 -1
  496. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h +6 -5
  497. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c +1 -1
  498. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h +6 -5
  499. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c +1 -1
  500. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h +6 -5
  501. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c +1 -1
  502. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h +6 -5
  503. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +1 -1
  504. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h +6 -5
  505. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c +1 -1
  506. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h +6 -5
  507. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c +1 -1
  508. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h +6 -5
  509. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +13 -10
  510. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h +21 -5
  511. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c +1 -1
  512. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h +6 -5
  513. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c +55 -46
  514. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h +6 -5
  515. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c +1 -1
  516. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h +6 -5
  517. data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c +1 -1
  518. data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.h +6 -5
  519. data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c +1 -1
  520. data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h +6 -5
  521. data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c +1 -1
  522. data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h +6 -5
  523. data/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c +142 -120
  524. data/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h +16 -5
  525. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +1 -1
  526. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h +6 -5
  527. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +101 -98
  528. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h +6 -5
  529. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c +1 -1
  530. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h +6 -5
  531. data/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.c +1 -1
  532. data/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.h +6 -5
  533. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c +1 -1
  534. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.h +6 -5
  535. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.c +1 -1
  536. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.h +6 -5
  537. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c +1 -1
  538. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h +6 -5
  539. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.c +1 -1
  540. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.h +6 -5
  541. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.c +1 -1
  542. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.h +6 -5
  543. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opentelemetry.upbdefs.c +16 -19
  544. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opentelemetry.upbdefs.h +6 -5
  545. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.c +1 -1
  546. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.h +6 -5
  547. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.c +1 -1
  548. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.h +6 -5
  549. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.c +1 -1
  550. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.h +6 -5
  551. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.c +1 -1
  552. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.h +6 -5
  553. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c +1 -1
  554. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.h +6 -5
  555. data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c +1 -1
  556. data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h +6 -5
  557. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c +1 -1
  558. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h +6 -5
  559. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c +1 -1
  560. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h +6 -5
  561. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c +1 -1
  562. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h +6 -5
  563. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c +1 -1
  564. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h +6 -5
  565. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.c +1 -1
  566. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.h +6 -5
  567. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +126 -115
  568. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +6 -5
  569. data/src/core/ext/upbdefs-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upbdefs.c +1 -1
  570. data/src/core/ext/upbdefs-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upbdefs.h +6 -5
  571. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c +1 -1
  572. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h +6 -5
  573. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +138 -136
  574. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h +6 -5
  575. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c +1 -1
  576. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h +6 -5
  577. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +118 -118
  578. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h +6 -5
  579. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c +1 -1
  580. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h +6 -5
  581. data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c +6 -6
  582. data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h +6 -5
  583. data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c +1 -1
  584. data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h +6 -5
  585. data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c +6 -6
  586. data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h +6 -5
  587. data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c +12 -13
  588. data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h +6 -5
  589. data/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.c +1 -1
  590. data/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.h +6 -5
  591. data/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c +1 -1
  592. data/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h +6 -5
  593. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/filter_state.upbdefs.c +1 -1
  594. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/filter_state.upbdefs.h +6 -5
  595. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.c +13 -10
  596. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.h +11 -5
  597. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c +1 -1
  598. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h +6 -5
  599. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c +1 -1
  600. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h +6 -5
  601. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c +1 -1
  602. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h +6 -5
  603. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c +1 -1
  604. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.h +6 -5
  605. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c +1 -1
  606. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.h +6 -5
  607. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/status_code_input.upbdefs.c +1 -1
  608. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/status_code_input.upbdefs.h +6 -5
  609. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c +1 -1
  610. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.h +6 -5
  611. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c +1 -1
  612. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.h +6 -5
  613. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c +1 -1
  614. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h +6 -5
  615. data/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c +1 -1
  616. data/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h +6 -5
  617. data/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c +1 -1
  618. data/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h +6 -5
  619. data/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.c +1 -1
  620. data/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.h +6 -5
  621. data/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c +1 -1
  622. data/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h +6 -5
  623. data/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.c +1 -1
  624. data/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.h +6 -5
  625. data/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c +1 -1
  626. data/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h +6 -5
  627. data/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c +1 -1
  628. data/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h +6 -5
  629. data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_strategy.upbdefs.c +1 -1
  630. data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_strategy.upbdefs.h +6 -5
  631. data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c +1 -1
  632. data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.h +6 -5
  633. data/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c +1 -1
  634. data/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h +6 -5
  635. data/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.c +1 -1
  636. data/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.h +6 -5
  637. data/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c +1 -1
  638. data/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h +6 -5
  639. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c +1 -1
  640. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h +6 -5
  641. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c +1 -1
  642. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h +6 -5
  643. data/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c +1 -1
  644. data/src/core/ext/upbdefs-generated/google/api/http.upbdefs.h +6 -5
  645. data/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.c +1 -1
  646. data/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.h +6 -5
  647. data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c +1 -1
  648. data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h +6 -5
  649. data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c +329 -273
  650. data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h +11 -5
  651. data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c +1 -1
  652. data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h +6 -5
  653. data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c +1 -1
  654. data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h +6 -5
  655. data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c +1 -1
  656. data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h +6 -5
  657. data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c +1 -1
  658. data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h +6 -5
  659. data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c +1 -1
  660. data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h +6 -5
  661. data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c +1 -1
  662. data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h +6 -5
  663. data/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.c +1 -1
  664. data/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.h +6 -5
  665. data/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c +1 -1
  666. data/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h +6 -5
  667. data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c +1 -1
  668. data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h +6 -5
  669. data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c +1 -1
  670. data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h +6 -5
  671. data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c +1 -1
  672. data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h +6 -5
  673. data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c +1 -1
  674. data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h +6 -5
  675. data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c +1 -1
  676. data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h +6 -5
  677. data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c +1 -1
  678. data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.h +6 -5
  679. data/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.c +1 -1
  680. data/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.h +6 -5
  681. data/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.c +1 -1
  682. data/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.h +6 -5
  683. data/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.c +1 -1
  684. data/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.h +6 -5
  685. data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c +1 -1
  686. data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h +6 -5
  687. data/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.c +1 -1
  688. data/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.h +6 -5
  689. data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c +1 -1
  690. data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h +6 -5
  691. data/src/core/ext/upbdefs-generated/xds/core/v3/cidr.upbdefs.c +1 -1
  692. data/src/core/ext/upbdefs-generated/xds/core/v3/cidr.upbdefs.h +6 -5
  693. data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c +1 -1
  694. data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h +6 -5
  695. data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c +1 -1
  696. data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h +6 -5
  697. data/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.c +1 -1
  698. data/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.h +6 -5
  699. data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c +1 -1
  700. data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h +6 -5
  701. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c +1 -1
  702. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h +6 -5
  703. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c +1 -1
  704. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h +6 -5
  705. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/cel.upbdefs.c +1 -1
  706. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/cel.upbdefs.h +6 -5
  707. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/domain.upbdefs.c +1 -1
  708. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/domain.upbdefs.h +6 -5
  709. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/http_inputs.upbdefs.c +1 -1
  710. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/http_inputs.upbdefs.h +6 -5
  711. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/ip.upbdefs.c +1 -1
  712. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/ip.upbdefs.h +6 -5
  713. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.c +1 -1
  714. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.h +6 -5
  715. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/range.upbdefs.c +1 -1
  716. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/range.upbdefs.h +6 -5
  717. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.c +1 -1
  718. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.h +6 -5
  719. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.c +1 -1
  720. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.h +6 -5
  721. data/src/core/ext/upbdefs-generated/xds/type/v3/cel.upbdefs.c +1 -1
  722. data/src/core/ext/upbdefs-generated/xds/type/v3/cel.upbdefs.h +6 -5
  723. data/src/core/ext/upbdefs-generated/xds/type/v3/range.upbdefs.c +1 -1
  724. data/src/core/ext/upbdefs-generated/xds/type/v3/range.upbdefs.h +6 -5
  725. data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c +1 -1
  726. data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h +6 -5
  727. data/src/core/ext/xds/certificate_provider_store.cc +8 -13
  728. data/src/core/ext/xds/certificate_provider_store.h +1 -1
  729. data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +30 -42
  730. data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +14 -9
  731. data/src/core/ext/xds/upb_utils.h +1 -1
  732. data/src/core/ext/xds/xds_api.cc +41 -18
  733. data/src/core/ext/xds/xds_api.h +5 -4
  734. data/src/core/ext/xds/xds_audit_logger_registry.cc +122 -0
  735. data/src/core/ext/xds/xds_audit_logger_registry.h +68 -0
  736. data/src/core/ext/xds/xds_bootstrap.cc +3 -3
  737. data/src/core/ext/xds/xds_bootstrap_grpc.cc +35 -23
  738. data/src/core/ext/xds/xds_bootstrap_grpc.h +5 -0
  739. data/src/core/ext/xds/xds_channel_stack_modifier.cc +1 -2
  740. data/src/core/ext/xds/xds_client.cc +29 -7
  741. data/src/core/ext/xds/xds_client.h +1 -1
  742. data/src/core/ext/xds/xds_client_stats.cc +29 -15
  743. data/src/core/ext/xds/xds_client_stats.h +24 -20
  744. data/src/core/ext/xds/xds_cluster.cc +44 -51
  745. data/src/core/ext/xds/xds_cluster.h +1 -2
  746. data/src/core/ext/xds/xds_cluster_specifier_plugin.cc +15 -11
  747. data/src/core/ext/xds/xds_cluster_specifier_plugin.h +2 -2
  748. data/src/core/ext/xds/xds_common_types.cc +8 -5
  749. data/src/core/ext/xds/xds_endpoint.cc +10 -4
  750. data/src/core/ext/xds/xds_endpoint.h +10 -2
  751. data/src/core/ext/xds/xds_http_fault_filter.cc +18 -15
  752. data/src/core/ext/xds/xds_http_fault_filter.h +3 -2
  753. data/src/core/ext/xds/xds_http_filters.h +7 -4
  754. data/src/core/ext/xds/xds_http_rbac_filter.cc +159 -74
  755. data/src/core/ext/xds/xds_http_rbac_filter.h +3 -2
  756. data/src/core/ext/xds/xds_http_stateful_session_filter.cc +17 -13
  757. data/src/core/ext/xds/xds_http_stateful_session_filter.h +3 -2
  758. data/src/core/ext/xds/xds_lb_policy_registry.cc +36 -35
  759. data/src/core/ext/xds/xds_listener.cc +11 -4
  760. data/src/core/ext/xds/xds_listener.h +1 -1
  761. data/src/core/ext/xds/xds_resource_type.h +2 -2
  762. data/src/core/ext/xds/xds_route_config.cc +48 -8
  763. data/src/core/ext/xds/xds_route_config.h +1 -1
  764. data/src/core/ext/xds/xds_routing.cc +2 -2
  765. data/src/core/ext/xds/xds_transport_grpc.cc +4 -2
  766. data/src/core/lib/avl/avl.h +5 -0
  767. data/src/core/lib/backoff/random_early_detection.cc +31 -0
  768. data/src/core/lib/backoff/random_early_detection.h +59 -0
  769. data/src/core/lib/channel/call_finalization.h +1 -1
  770. data/src/core/lib/channel/call_tracer.cc +51 -0
  771. data/src/core/lib/channel/call_tracer.h +101 -38
  772. data/src/core/lib/channel/channel_args.cc +80 -22
  773. data/src/core/lib/channel/channel_args.h +34 -1
  774. data/src/core/lib/channel/channel_trace.cc +16 -12
  775. data/src/core/lib/channel/channelz.cc +163 -135
  776. data/src/core/lib/channel/channelz.h +42 -35
  777. data/src/core/lib/channel/channelz_registry.cc +24 -20
  778. data/src/core/lib/channel/connected_channel.cc +542 -1043
  779. data/src/core/lib/channel/context.h +8 -1
  780. data/src/core/lib/channel/promise_based_filter.cc +100 -46
  781. data/src/core/lib/channel/promise_based_filter.h +29 -13
  782. data/src/core/lib/channel/server_call_tracer_filter.cc +110 -0
  783. data/src/core/lib/compression/compression_internal.cc +2 -5
  784. data/src/core/lib/config/config_vars.cc +153 -0
  785. data/src/core/lib/config/config_vars.h +127 -0
  786. data/src/core/lib/config/config_vars_non_generated.cc +51 -0
  787. data/src/core/lib/config/load_config.cc +79 -0
  788. data/src/core/lib/config/load_config.h +55 -0
  789. data/src/core/lib/debug/event_log.h +1 -1
  790. data/src/core/lib/debug/stats_data.h +1 -1
  791. data/src/core/lib/debug/trace.cc +38 -61
  792. data/src/core/lib/debug/trace.h +14 -9
  793. data/src/core/lib/event_engine/cf_engine/cf_engine.cc +211 -0
  794. data/src/core/lib/event_engine/cf_engine/cf_engine.h +86 -0
  795. data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc +354 -0
  796. data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.h +146 -0
  797. data/src/core/lib/event_engine/cf_engine/cftype_unique_ref.h +79 -0
  798. data/src/core/lib/event_engine/default_event_engine.cc +13 -1
  799. data/src/core/lib/event_engine/default_event_engine_factory.cc +14 -2
  800. data/src/core/lib/event_engine/event_engine.cc +37 -2
  801. data/src/core/lib/event_engine/handle_containers.h +7 -22
  802. data/src/core/lib/event_engine/memory_allocator_factory.h +47 -0
  803. data/src/core/lib/event_engine/poller.h +2 -2
  804. data/src/core/lib/event_engine/posix.h +4 -0
  805. data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +1 -1
  806. data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +0 -4
  807. data/src/core/lib/event_engine/posix_engine/event_poller_posix_default.cc +3 -9
  808. data/src/core/lib/event_engine/posix_engine/lockfree_event.cc +7 -18
  809. data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +48 -15
  810. data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +17 -8
  811. data/src/core/lib/event_engine/posix_engine/posix_engine.cc +47 -50
  812. data/src/core/lib/event_engine/posix_engine/posix_engine.h +1 -1
  813. data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +9 -6
  814. data/src/core/lib/event_engine/posix_engine/posix_engine_listener.h +7 -8
  815. data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +33 -19
  816. data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h +3 -3
  817. data/src/core/lib/event_engine/posix_engine/timer_manager.h +1 -1
  818. data/src/core/lib/event_engine/resolved_address.cc +2 -1
  819. data/src/core/lib/event_engine/shim.cc +9 -1
  820. data/src/core/lib/event_engine/{thread_pool.cc → thread_pool/original_thread_pool.cc} +28 -25
  821. data/src/core/lib/event_engine/{thread_pool.h → thread_pool/original_thread_pool.h} +11 -15
  822. data/src/core/lib/event_engine/thread_pool/thread_pool.h +50 -0
  823. data/src/core/lib/event_engine/{executor/executor.h → thread_pool/thread_pool_factory.cc} +17 -15
  824. data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +489 -0
  825. data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h +249 -0
  826. data/src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc +166 -0
  827. data/src/core/lib/event_engine/thready_event_engine/thready_event_engine.h +108 -0
  828. data/src/core/lib/event_engine/trace.cc +1 -0
  829. data/src/core/lib/event_engine/trace.h +6 -0
  830. data/src/core/lib/event_engine/windows/iocp.cc +4 -3
  831. data/src/core/lib/event_engine/windows/iocp.h +3 -3
  832. data/src/core/lib/event_engine/windows/win_socket.cc +6 -7
  833. data/src/core/lib/event_engine/windows/win_socket.h +4 -4
  834. data/src/core/lib/event_engine/windows/windows_endpoint.cc +135 -87
  835. data/src/core/lib/event_engine/windows/windows_endpoint.h +23 -6
  836. data/src/core/lib/event_engine/windows/windows_engine.cc +55 -32
  837. data/src/core/lib/event_engine/windows/windows_engine.h +8 -7
  838. data/src/core/lib/event_engine/windows/windows_listener.cc +370 -0
  839. data/src/core/lib/event_engine/windows/windows_listener.h +156 -0
  840. data/src/core/lib/event_engine/work_queue/basic_work_queue.cc +63 -0
  841. data/src/core/lib/event_engine/work_queue/basic_work_queue.h +71 -0
  842. data/src/core/lib/event_engine/work_queue/work_queue.h +62 -0
  843. data/src/core/lib/experiments/config.cc +41 -17
  844. data/src/core/lib/experiments/config.h +16 -0
  845. data/src/core/lib/experiments/experiments.cc +74 -17
  846. data/src/core/lib/experiments/experiments.h +35 -18
  847. data/src/core/lib/gpr/log.cc +15 -28
  848. data/src/core/lib/gpr/log_internal.h +55 -0
  849. data/src/core/lib/gpr/{time_posix.cc → posix/time.cc} +5 -0
  850. data/src/core/lib/gprpp/crash.cc +10 -0
  851. data/src/core/lib/gprpp/crash.h +3 -0
  852. data/src/core/lib/gprpp/fork.cc +8 -14
  853. data/src/core/lib/gprpp/orphanable.h +4 -3
  854. data/src/core/lib/gprpp/per_cpu.cc +33 -0
  855. data/src/core/lib/gprpp/per_cpu.h +33 -4
  856. data/src/core/lib/gprpp/{thd_posix.cc → posix/thd.cc} +49 -37
  857. data/src/core/lib/gprpp/ref_counted.h +33 -34
  858. data/src/core/lib/gprpp/status_helper.cc +2 -2
  859. data/src/core/lib/gprpp/thd.h +16 -0
  860. data/src/core/lib/gprpp/time.cc +2 -0
  861. data/src/core/lib/gprpp/time.h +4 -4
  862. data/src/core/lib/gprpp/validation_errors.cc +8 -3
  863. data/src/core/lib/gprpp/validation_errors.h +16 -9
  864. data/src/core/lib/gprpp/{thd_windows.cc → windows/thd.cc} +2 -2
  865. data/src/core/lib/iomgr/buffer_list.h +0 -1
  866. data/src/core/lib/iomgr/call_combiner.h +2 -2
  867. data/src/core/lib/iomgr/cfstream_handle.cc +1 -1
  868. data/src/core/lib/iomgr/endpoint_cfstream.cc +14 -10
  869. data/src/core/lib/iomgr/endpoint_pair.h +2 -2
  870. data/src/core/lib/iomgr/endpoint_pair_posix.cc +2 -2
  871. data/src/core/lib/iomgr/endpoint_pair_windows.cc +1 -1
  872. data/src/core/lib/iomgr/ev_apple.cc +12 -12
  873. data/src/core/lib/iomgr/ev_epoll1_linux.cc +10 -3
  874. data/src/core/lib/iomgr/ev_posix.cc +13 -53
  875. data/src/core/lib/iomgr/ev_posix.h +0 -3
  876. data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +118 -77
  877. data/src/core/lib/iomgr/iocp_windows.cc +24 -3
  878. data/src/core/lib/iomgr/iocp_windows.h +11 -0
  879. data/src/core/lib/iomgr/iomgr.cc +4 -8
  880. data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +1 -1
  881. data/src/core/lib/iomgr/iomgr_windows.cc +8 -2
  882. data/src/core/lib/iomgr/pollset_set_windows.cc +9 -9
  883. data/src/core/lib/iomgr/pollset_windows.cc +1 -1
  884. data/src/core/lib/iomgr/socket_utils_common_posix.cc +20 -5
  885. data/src/core/lib/iomgr/socket_utils_posix.cc +3 -0
  886. data/src/core/lib/iomgr/socket_utils_posix.h +3 -0
  887. data/src/core/lib/iomgr/socket_windows.cc +61 -7
  888. data/src/core/lib/iomgr/socket_windows.h +9 -2
  889. data/src/core/lib/iomgr/tcp_client_cfstream.cc +14 -3
  890. data/src/core/lib/iomgr/tcp_client_posix.cc +4 -0
  891. data/src/core/lib/iomgr/tcp_client_windows.cc +2 -2
  892. data/src/core/lib/iomgr/tcp_posix.cc +0 -1
  893. data/src/core/lib/iomgr/tcp_server_posix.cc +150 -120
  894. data/src/core/lib/iomgr/tcp_server_utils_posix.h +1 -1
  895. data/src/core/lib/iomgr/tcp_server_windows.cc +176 -9
  896. data/src/core/lib/iomgr/tcp_windows.cc +12 -8
  897. data/src/core/lib/iomgr/timer_generic.cc +17 -16
  898. data/src/core/lib/json/json.h +2 -218
  899. data/src/core/lib/json/json_object_loader.cc +24 -25
  900. data/src/core/lib/json/json_object_loader.h +30 -18
  901. data/src/core/lib/json/json_reader.cc +69 -42
  902. data/src/core/{ext/filters/client_channel/lb_call_state_internal.h → lib/json/json_reader.h} +7 -12
  903. data/src/core/lib/json/json_util.cc +10 -15
  904. data/src/core/lib/json/json_util.h +5 -4
  905. data/src/core/lib/json/json_writer.cc +24 -25
  906. data/src/core/lib/{security/security_connector/ssl_utils_config.h → json/json_writer.h} +14 -10
  907. data/src/core/lib/load_balancing/lb_policy.cc +9 -13
  908. data/src/core/lib/load_balancing/lb_policy.h +17 -2
  909. data/src/core/lib/load_balancing/lb_policy_registry.cc +9 -8
  910. data/src/core/lib/matchers/matchers.cc +3 -4
  911. data/src/core/lib/matchers/matchers.h +2 -1
  912. data/src/core/lib/promise/activity.cc +27 -6
  913. data/src/core/lib/promise/activity.h +71 -24
  914. data/src/core/lib/promise/cancel_callback.h +77 -0
  915. data/src/core/lib/promise/detail/basic_seq.h +1 -1
  916. data/src/core/lib/promise/detail/promise_factory.h +5 -1
  917. data/src/core/lib/promise/for_each.h +176 -0
  918. data/src/core/lib/promise/if.h +9 -0
  919. data/src/core/lib/promise/interceptor_list.h +23 -2
  920. data/src/core/lib/promise/latch.h +89 -3
  921. data/src/core/lib/promise/loop.h +13 -9
  922. data/src/core/lib/promise/map.h +7 -0
  923. data/src/core/lib/promise/party.cc +304 -0
  924. data/src/core/lib/promise/party.h +508 -0
  925. data/src/core/lib/promise/pipe.h +213 -59
  926. data/src/core/lib/promise/poll.h +48 -0
  927. data/src/core/lib/promise/prioritized_race.h +95 -0
  928. data/src/core/lib/promise/promise.h +2 -2
  929. data/src/core/lib/promise/sleep.cc +2 -1
  930. data/src/core/lib/resolver/server_address.cc +0 -8
  931. data/src/core/lib/resolver/server_address.h +0 -6
  932. data/src/core/lib/resource_quota/arena.cc +19 -3
  933. data/src/core/lib/resource_quota/arena.h +119 -5
  934. data/src/core/lib/resource_quota/memory_quota.cc +8 -8
  935. data/src/core/lib/resource_quota/memory_quota.h +1 -2
  936. data/src/core/lib/security/authorization/audit_logging.cc +98 -0
  937. data/src/core/lib/security/authorization/audit_logging.h +73 -0
  938. data/src/core/lib/security/authorization/grpc_authorization_engine.cc +47 -2
  939. data/src/core/lib/security/authorization/grpc_authorization_engine.h +18 -1
  940. data/src/core/lib/security/authorization/rbac_policy.cc +36 -4
  941. data/src/core/lib/security/authorization/rbac_policy.h +19 -2
  942. data/src/core/lib/security/authorization/stdout_logger.cc +75 -0
  943. data/src/core/lib/security/authorization/stdout_logger.h +61 -0
  944. data/src/core/lib/security/certificate_provider/certificate_provider_factory.h +8 -4
  945. data/src/core/lib/security/certificate_provider/certificate_provider_registry.cc +8 -18
  946. data/src/core/lib/security/certificate_provider/certificate_provider_registry.h +14 -8
  947. data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +66 -84
  948. data/src/core/lib/security/credentials/external/aws_external_account_credentials.h +1 -0
  949. data/src/core/lib/security/credentials/external/external_account_credentials.cc +64 -64
  950. data/src/core/lib/security/credentials/external/file_external_account_credentials.cc +23 -21
  951. data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +29 -27
  952. data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +5 -61
  953. data/src/core/lib/security/credentials/jwt/json_token.cc +19 -16
  954. data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +10 -5
  955. data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +40 -38
  956. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +28 -21
  957. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +1 -1
  958. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +13 -0
  959. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +2 -0
  960. data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +1 -5
  961. data/src/core/lib/security/security_connector/load_system_roots_supported.cc +5 -9
  962. data/src/core/lib/security/security_connector/ssl_utils.cc +11 -25
  963. data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +12 -0
  964. data/src/core/lib/security/transport/secure_endpoint.cc +4 -2
  965. data/src/core/lib/security/transport/server_auth_filter.cc +20 -2
  966. data/src/core/lib/security/util/json_util.cc +6 -5
  967. data/src/core/lib/service_config/service_config_call_data.h +49 -20
  968. data/src/core/lib/service_config/service_config_impl.cc +13 -6
  969. data/src/core/lib/slice/slice.cc +1 -1
  970. data/src/core/lib/slice/slice.h +2 -0
  971. data/src/core/lib/surface/builtins.cc +2 -0
  972. data/src/core/lib/surface/call.cc +1011 -1049
  973. data/src/core/lib/surface/call.h +11 -5
  974. data/src/core/lib/surface/completion_queue.cc +8 -3
  975. data/src/core/lib/surface/lame_client.cc +1 -0
  976. data/src/core/lib/surface/server.cc +47 -19
  977. data/src/core/lib/surface/validate_metadata.cc +43 -42
  978. data/src/core/lib/surface/validate_metadata.h +9 -0
  979. data/src/core/lib/surface/version.cc +2 -2
  980. data/src/core/lib/transport/batch_builder.cc +182 -0
  981. data/src/core/lib/transport/batch_builder.h +480 -0
  982. data/src/core/lib/transport/bdp_estimator.cc +7 -7
  983. data/src/core/lib/transport/bdp_estimator.h +10 -6
  984. data/src/core/lib/transport/custom_metadata.h +30 -0
  985. data/src/core/lib/transport/metadata_batch.cc +9 -6
  986. data/src/core/lib/transport/metadata_batch.h +124 -31
  987. data/src/core/lib/transport/metadata_compression_traits.h +67 -0
  988. data/src/core/lib/transport/parsed_metadata.h +19 -9
  989. data/src/core/lib/transport/simple_slice_based_metadata.h +48 -0
  990. data/src/core/lib/transport/timeout_encoding.cc +6 -1
  991. data/src/core/lib/transport/transport.cc +30 -2
  992. data/src/core/lib/transport/transport.h +73 -14
  993. data/src/core/lib/transport/transport_impl.h +7 -0
  994. data/src/core/lib/transport/transport_op_string.cc +52 -42
  995. data/src/core/plugin_registry/grpc_plugin_registry.cc +4 -8
  996. data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +2 -0
  997. data/src/core/tsi/alts/frame_protector/alts_frame_protector.cc +1 -0
  998. data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +21 -4
  999. data/src/core/tsi/alts/handshaker/alts_handshaker_client.h +5 -0
  1000. data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +1 -1
  1001. data/src/core/tsi/ssl_transport_security.cc +4 -2
  1002. data/src/ruby/ext/grpc/extconf.rb +8 -9
  1003. data/src/ruby/lib/grpc/version.rb +1 -1
  1004. data/third_party/abseil-cpp/absl/base/config.h +1 -1
  1005. data/third_party/abseil-cpp/absl/flags/commandlineflag.cc +34 -0
  1006. data/third_party/abseil-cpp/absl/flags/commandlineflag.h +200 -0
  1007. data/third_party/abseil-cpp/absl/flags/config.h +68 -0
  1008. data/third_party/abseil-cpp/absl/flags/declare.h +73 -0
  1009. data/third_party/abseil-cpp/absl/flags/flag.cc +38 -0
  1010. data/third_party/abseil-cpp/absl/flags/flag.h +310 -0
  1011. data/{src/core/lib/gprpp/global_config_custom.h → third_party/abseil-cpp/absl/flags/internal/commandlineflag.cc} +11 -14
  1012. data/third_party/abseil-cpp/absl/flags/internal/commandlineflag.h +68 -0
  1013. data/third_party/abseil-cpp/absl/flags/internal/flag.cc +615 -0
  1014. data/third_party/abseil-cpp/absl/flags/internal/flag.h +800 -0
  1015. data/third_party/abseil-cpp/absl/flags/internal/flag_msvc.inc +116 -0
  1016. data/third_party/abseil-cpp/absl/flags/internal/path_util.h +62 -0
  1017. data/third_party/abseil-cpp/absl/flags/internal/private_handle_accessor.cc +65 -0
  1018. data/third_party/abseil-cpp/absl/flags/internal/private_handle_accessor.h +61 -0
  1019. data/third_party/abseil-cpp/absl/flags/internal/program_name.cc +60 -0
  1020. data/third_party/abseil-cpp/absl/flags/internal/program_name.h +50 -0
  1021. data/third_party/abseil-cpp/absl/flags/internal/registry.h +97 -0
  1022. data/third_party/abseil-cpp/absl/flags/internal/sequence_lock.h +187 -0
  1023. data/third_party/abseil-cpp/absl/flags/marshalling.cc +241 -0
  1024. data/third_party/abseil-cpp/absl/flags/marshalling.h +356 -0
  1025. data/third_party/abseil-cpp/absl/flags/reflection.cc +354 -0
  1026. data/third_party/abseil-cpp/absl/flags/reflection.h +90 -0
  1027. data/third_party/abseil-cpp/absl/flags/usage_config.cc +165 -0
  1028. data/third_party/abseil-cpp/absl/flags/usage_config.h +135 -0
  1029. data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +12 -8
  1030. data/third_party/boringssl-with-bazel/err_data.c +728 -712
  1031. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_bitstr.c +177 -177
  1032. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_bool.c +28 -55
  1033. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_d2i_fp.c +21 -23
  1034. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_dup.c +20 -23
  1035. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_gentm.c +66 -185
  1036. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_i2d_fp.c +18 -21
  1037. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_int.c +356 -311
  1038. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_mbstr.c +177 -196
  1039. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_object.c +146 -210
  1040. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_octet.c +6 -9
  1041. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_strex.c +346 -526
  1042. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_strnid.c +110 -131
  1043. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_time.c +130 -116
  1044. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_type.c +93 -60
  1045. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_utctm.c +93 -181
  1046. data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_lib.c +242 -305
  1047. data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_par.c +41 -18
  1048. data/third_party/boringssl-with-bazel/src/crypto/asn1/asn_pack.c +30 -33
  1049. data/third_party/boringssl-with-bazel/src/crypto/asn1/f_int.c +36 -33
  1050. data/third_party/boringssl-with-bazel/src/crypto/asn1/f_string.c +29 -26
  1051. data/third_party/boringssl-with-bazel/src/crypto/asn1/internal.h +135 -90
  1052. data/third_party/boringssl-with-bazel/src/crypto/asn1/posix_time.c +230 -0
  1053. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_dec.c +797 -793
  1054. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c +529 -526
  1055. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_fre.c +114 -135
  1056. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_new.c +201 -207
  1057. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_typ.c +21 -26
  1058. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_utl.c +55 -68
  1059. data/third_party/boringssl-with-bazel/src/crypto/base64/base64.c +2 -4
  1060. data/third_party/boringssl-with-bazel/src/crypto/bio/bio.c +17 -11
  1061. data/third_party/boringssl-with-bazel/src/crypto/bio/bio_mem.c +37 -51
  1062. data/third_party/boringssl-with-bazel/src/crypto/bio/connect.c +15 -9
  1063. data/third_party/boringssl-with-bazel/src/crypto/bio/fd.c +13 -9
  1064. data/third_party/boringssl-with-bazel/src/crypto/bio/file.c +22 -19
  1065. data/third_party/boringssl-with-bazel/src/crypto/bio/pair.c +5 -5
  1066. data/third_party/boringssl-with-bazel/src/crypto/bio/printf.c +0 -13
  1067. data/third_party/boringssl-with-bazel/src/crypto/bio/socket.c +3 -6
  1068. data/third_party/boringssl-with-bazel/src/crypto/bio/socket_helper.c +2 -0
  1069. data/third_party/boringssl-with-bazel/src/crypto/blake2/blake2.c +40 -27
  1070. data/third_party/boringssl-with-bazel/src/crypto/bn_extra/convert.c +10 -23
  1071. data/third_party/boringssl-with-bazel/src/crypto/buf/buf.c +2 -6
  1072. data/third_party/boringssl-with-bazel/src/crypto/bytestring/asn1_compat.c +2 -1
  1073. data/third_party/boringssl-with-bazel/src/crypto/bytestring/ber.c +29 -28
  1074. data/third_party/boringssl-with-bazel/src/crypto/bytestring/cbb.c +161 -201
  1075. data/third_party/boringssl-with-bazel/src/crypto/bytestring/cbs.c +254 -39
  1076. data/third_party/boringssl-with-bazel/src/crypto/bytestring/internal.h +2 -2
  1077. data/third_party/boringssl-with-bazel/src/crypto/chacha/chacha.c +0 -2
  1078. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/derive_key.c +4 -4
  1079. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_aesctrhmac.c +9 -8
  1080. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_aesgcmsiv.c +37 -75
  1081. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_chacha20poly1305.c +8 -10
  1082. data/third_party/boringssl-with-bazel/src/crypto/{fipsmodule/cipher → cipher_extra}/e_des.c +100 -78
  1083. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_null.c +1 -0
  1084. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_rc2.c +1 -0
  1085. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_rc4.c +2 -0
  1086. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_tls.c +34 -37
  1087. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/internal.h +22 -11
  1088. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/tls_cbc.c +189 -13
  1089. data/third_party/boringssl-with-bazel/src/crypto/conf/conf.c +6 -10
  1090. data/third_party/boringssl-with-bazel/src/crypto/conf/conf_def.h +0 -1
  1091. data/third_party/boringssl-with-bazel/src/crypto/conf/internal.h +12 -0
  1092. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_apple.c +74 -0
  1093. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_freebsd.c +62 -0
  1094. data/third_party/boringssl-with-bazel/src/crypto/{cpu-aarch64-fuchsia.c → cpu_aarch64_fuchsia.c} +8 -7
  1095. data/third_party/boringssl-with-bazel/src/crypto/{cpu-aarch64-linux.c → cpu_aarch64_linux.c} +6 -4
  1096. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_openbsd.c +62 -0
  1097. data/third_party/boringssl-with-bazel/src/crypto/{cpu-aarch64-win.c → cpu_aarch64_win.c} +4 -4
  1098. data/third_party/boringssl-with-bazel/src/crypto/{cpu-arm.c → cpu_arm.c} +1 -1
  1099. data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_freebsd.c +55 -0
  1100. data/third_party/boringssl-with-bazel/src/crypto/{cpu-arm-linux.c → cpu_arm_linux.c} +11 -90
  1101. data/third_party/boringssl-with-bazel/src/crypto/{cpu-arm-linux.h → cpu_arm_linux.h} +0 -38
  1102. data/third_party/boringssl-with-bazel/src/crypto/{cpu-ppc64le.c → cpu_arm_openbsd.c} +10 -17
  1103. data/third_party/boringssl-with-bazel/src/crypto/{cpu-intel.c → cpu_intel.c} +1 -2
  1104. data/third_party/boringssl-with-bazel/src/crypto/crypto.c +25 -20
  1105. data/third_party/boringssl-with-bazel/src/crypto/curve25519/curve25519.c +22 -31
  1106. data/third_party/boringssl-with-bazel/src/crypto/curve25519/curve25519_tables.h +795 -795
  1107. data/third_party/boringssl-with-bazel/src/crypto/curve25519/internal.h +1 -5
  1108. data/third_party/boringssl-with-bazel/src/crypto/curve25519/spake25519.c +17 -32
  1109. data/third_party/boringssl-with-bazel/src/crypto/{fipsmodule/des → des}/des.c +232 -232
  1110. data/third_party/boringssl-with-bazel/src/crypto/{fipsmodule/des → des}/internal.h +1 -1
  1111. data/third_party/boringssl-with-bazel/src/crypto/dh_extra/dh_asn1.c +1 -0
  1112. data/third_party/boringssl-with-bazel/src/crypto/dh_extra/params.c +232 -29
  1113. data/third_party/boringssl-with-bazel/src/crypto/digest_extra/digest_extra.c +0 -3
  1114. data/third_party/boringssl-with-bazel/src/crypto/dsa/dsa.c +43 -16
  1115. data/third_party/boringssl-with-bazel/src/crypto/dsa/dsa_asn1.c +37 -7
  1116. data/third_party/boringssl-with-bazel/src/crypto/dsa/internal.h +3 -3
  1117. data/third_party/boringssl-with-bazel/src/crypto/ec_extra/ec_asn1.c +11 -36
  1118. data/third_party/boringssl-with-bazel/src/crypto/ec_extra/hash_to_curve.c +229 -102
  1119. data/third_party/boringssl-with-bazel/src/crypto/ec_extra/internal.h +31 -7
  1120. data/third_party/boringssl-with-bazel/src/crypto/ecdh_extra/ecdh_extra.c +1 -1
  1121. data/third_party/boringssl-with-bazel/src/crypto/ecdsa_extra/ecdsa_asn1.c +2 -4
  1122. data/third_party/boringssl-with-bazel/src/crypto/err/err.c +83 -60
  1123. data/third_party/boringssl-with-bazel/src/crypto/evp/evp.c +46 -12
  1124. data/third_party/boringssl-with-bazel/src/crypto/evp/evp_asn1.c +3 -3
  1125. data/third_party/boringssl-with-bazel/src/crypto/evp/evp_ctx.c +25 -23
  1126. data/third_party/boringssl-with-bazel/src/crypto/evp/internal.h +43 -9
  1127. data/third_party/boringssl-with-bazel/src/crypto/evp/p_dsa_asn1.c +75 -44
  1128. data/third_party/boringssl-with-bazel/src/crypto/evp/p_ec.c +19 -25
  1129. data/third_party/boringssl-with-bazel/src/crypto/evp/p_ec_asn1.c +96 -45
  1130. data/third_party/boringssl-with-bazel/src/crypto/evp/p_ed25519.c +7 -8
  1131. data/third_party/boringssl-with-bazel/src/crypto/evp/p_ed25519_asn1.c +26 -23
  1132. data/third_party/boringssl-with-bazel/src/crypto/evp/p_hkdf.c +233 -0
  1133. data/third_party/boringssl-with-bazel/src/crypto/evp/p_rsa.c +6 -6
  1134. data/third_party/boringssl-with-bazel/src/crypto/evp/p_rsa_asn1.c +42 -25
  1135. data/third_party/boringssl-with-bazel/src/crypto/evp/p_x25519.c +4 -5
  1136. data/third_party/boringssl-with-bazel/src/crypto/evp/p_x25519_asn1.c +35 -47
  1137. data/third_party/boringssl-with-bazel/src/crypto/evp/print.c +135 -244
  1138. data/third_party/boringssl-with-bazel/src/crypto/evp/scrypt.c +2 -4
  1139. data/third_party/boringssl-with-bazel/src/crypto/evp/sign.c +15 -10
  1140. data/third_party/boringssl-with-bazel/src/crypto/ex_data.c +29 -15
  1141. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/aes.c +0 -2
  1142. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/aes_nohw.c +13 -14
  1143. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/internal.h +3 -13
  1144. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/key_wrap.c +13 -7
  1145. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/mode_wrappers.c +9 -7
  1146. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bcm.c +36 -27
  1147. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/bn.c +16 -26
  1148. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/bytes.c +88 -60
  1149. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/cmp.c +4 -3
  1150. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/ctx.c +0 -2
  1151. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/div.c +1 -1
  1152. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/div_extra.c +1 -1
  1153. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/exponentiation.c +99 -113
  1154. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/gcd.c +0 -1
  1155. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/gcd_extra.c +5 -3
  1156. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/generic.c +112 -168
  1157. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/internal.h +86 -31
  1158. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/montgomery.c +11 -6
  1159. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/montgomery_inv.c +4 -5
  1160. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/mul.c +4 -5
  1161. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/prime.c +13 -0
  1162. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/random.c +13 -5
  1163. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/rsaz_exp.c +19 -108
  1164. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/rsaz_exp.h +19 -15
  1165. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/shift.c +15 -16
  1166. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/sqrt.c +22 -21
  1167. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/aead.c +3 -0
  1168. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/cipher.c +79 -19
  1169. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/e_aes.c +102 -99
  1170. data/third_party/boringssl-with-bazel/src/crypto/{cipher_extra → fipsmodule/cipher}/e_aesccm.c +52 -46
  1171. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/internal.h +39 -0
  1172. data/third_party/boringssl-with-bazel/src/crypto/{cmac → fipsmodule/cmac}/cmac.c +55 -11
  1173. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/check.c +2 -3
  1174. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/dh.c +24 -6
  1175. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/internal.h +56 -0
  1176. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/digest/digest.c +5 -3
  1177. data/third_party/boringssl-with-bazel/src/crypto/{evp → fipsmodule/digestsign}/digestsign.c +51 -15
  1178. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec.c +49 -49
  1179. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec_key.c +92 -18
  1180. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec_montgomery.c +12 -12
  1181. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/internal.h +108 -86
  1182. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/oct.c +55 -25
  1183. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p224-64.c +55 -71
  1184. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{p256-x86_64-table.h → p256-nistz-table.h} +1 -1
  1185. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{p256-x86_64.c → p256-nistz.c} +72 -65
  1186. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{p256-x86_64.h → p256-nistz.h} +5 -13
  1187. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p256.c +62 -51
  1188. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p256_table.h +1 -1
  1189. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/scalar.c +2 -8
  1190. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/simple.c +12 -17
  1191. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/simple_mul.c +25 -26
  1192. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/wnaf.c +13 -14
  1193. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdh/ecdh.c +9 -1
  1194. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/ecdsa.c +44 -16
  1195. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/internal.h +6 -0
  1196. data/third_party/boringssl-with-bazel/src/crypto/{hkdf → fipsmodule/hkdf}/hkdf.c +1 -1
  1197. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/hmac/hmac.c +52 -24
  1198. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/cbc.c +9 -23
  1199. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/cfb.c +1 -4
  1200. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/ctr.c +3 -8
  1201. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/gcm.c +170 -160
  1202. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/gcm_nohw.c +12 -14
  1203. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/internal.h +69 -61
  1204. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/ofb.c +2 -12
  1205. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/polyval.c +27 -28
  1206. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/ctrdrbg.c +31 -13
  1207. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/fork_detect.c +16 -8
  1208. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/fork_detect.h +3 -2
  1209. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/getrandom_fillin.h +2 -2
  1210. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/internal.h +9 -38
  1211. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/rand.c +73 -59
  1212. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/urandom.c +22 -68
  1213. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/blinding.c +0 -1
  1214. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/internal.h +43 -16
  1215. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/padding.c +42 -314
  1216. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa.c +244 -139
  1217. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa_impl.c +144 -205
  1218. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/fips.c +41 -0
  1219. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/self_check.c +593 -421
  1220. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/service_indicator/internal.h +89 -0
  1221. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/service_indicator/service_indicator.c +334 -0
  1222. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/internal.h +3 -12
  1223. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha1.c +2 -0
  1224. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha256.c +12 -8
  1225. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha512.c +14 -12
  1226. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/tls/internal.h +8 -0
  1227. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/tls/kdf.c +52 -6
  1228. data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +192 -18
  1229. data/third_party/boringssl-with-bazel/src/crypto/hrss/hrss.c +65 -29
  1230. data/third_party/boringssl-with-bazel/src/crypto/internal.h +391 -18
  1231. data/third_party/boringssl-with-bazel/src/crypto/kyber/internal.h +91 -0
  1232. data/third_party/boringssl-with-bazel/src/crypto/kyber/keccak.c +204 -0
  1233. data/third_party/boringssl-with-bazel/src/crypto/kyber/kyber.c +833 -0
  1234. data/third_party/boringssl-with-bazel/src/crypto/lhash/internal.h +13 -1
  1235. data/third_party/boringssl-with-bazel/src/crypto/mem.c +220 -13
  1236. data/third_party/boringssl-with-bazel/src/crypto/obj/obj.c +19 -7
  1237. data/third_party/boringssl-with-bazel/src/crypto/obj/obj_dat.h +9 -4
  1238. data/third_party/boringssl-with-bazel/src/crypto/pem/pem_all.c +81 -90
  1239. data/third_party/boringssl-with-bazel/src/crypto/pem/pem_info.c +150 -245
  1240. data/third_party/boringssl-with-bazel/src/crypto/pem/pem_lib.c +633 -613
  1241. data/third_party/boringssl-with-bazel/src/crypto/pem/pem_oth.c +17 -17
  1242. data/third_party/boringssl-with-bazel/src/crypto/pem/pem_pk8.c +142 -149
  1243. data/third_party/boringssl-with-bazel/src/crypto/pem/pem_pkey.c +99 -131
  1244. data/third_party/boringssl-with-bazel/src/crypto/pem/pem_x509.c +0 -1
  1245. data/third_party/boringssl-with-bazel/src/crypto/pem/pem_xaux.c +0 -1
  1246. data/third_party/boringssl-with-bazel/src/crypto/pkcs7/pkcs7_x509.c +0 -1
  1247. data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8.c +0 -3
  1248. data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8_x509.c +36 -66
  1249. data/third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305.c +31 -38
  1250. data/third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_arm.c +2 -1
  1251. data/third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_vec.c +18 -31
  1252. data/third_party/boringssl-with-bazel/src/crypto/pool/internal.h +1 -0
  1253. data/third_party/boringssl-with-bazel/src/crypto/pool/pool.c +8 -1
  1254. data/third_party/boringssl-with-bazel/src/crypto/rand_extra/passive.c +129 -5
  1255. data/third_party/boringssl-with-bazel/src/crypto/refcount_c11.c +0 -2
  1256. data/third_party/boringssl-with-bazel/src/crypto/{refcount_lock.c → refcount_no_threads.c} +6 -17
  1257. data/third_party/boringssl-with-bazel/src/crypto/refcount_win.c +89 -0
  1258. data/third_party/boringssl-with-bazel/src/crypto/{asn1/a_print.c → rsa_extra/internal.h} +15 -21
  1259. data/third_party/boringssl-with-bazel/src/crypto/rsa_extra/rsa_crypt.c +568 -0
  1260. data/third_party/boringssl-with-bazel/src/crypto/siphash/siphash.c +8 -11
  1261. data/third_party/boringssl-with-bazel/src/crypto/stack/stack.c +61 -27
  1262. data/third_party/boringssl-with-bazel/src/crypto/thread_pthread.c +10 -13
  1263. data/third_party/boringssl-with-bazel/src/crypto/thread_win.c +10 -13
  1264. data/third_party/boringssl-with-bazel/src/crypto/trust_token/internal.h +128 -34
  1265. data/third_party/boringssl-with-bazel/src/crypto/trust_token/pmbtoken.c +418 -133
  1266. data/third_party/boringssl-with-bazel/src/crypto/trust_token/trust_token.c +116 -284
  1267. data/third_party/boringssl-with-bazel/src/crypto/trust_token/voprf.c +701 -87
  1268. data/third_party/boringssl-with-bazel/src/crypto/x509/a_digest.c +22 -24
  1269. data/third_party/boringssl-with-bazel/src/crypto/x509/a_sign.c +63 -55
  1270. data/third_party/boringssl-with-bazel/src/crypto/x509/a_verify.c +32 -34
  1271. data/third_party/boringssl-with-bazel/src/crypto/x509/algorithm.c +32 -16
  1272. data/third_party/boringssl-with-bazel/src/crypto/x509/asn1_gen.c +465 -704
  1273. data/third_party/boringssl-with-bazel/src/crypto/x509/by_dir.c +285 -331
  1274. data/third_party/boringssl-with-bazel/src/crypto/x509/by_file.c +183 -178
  1275. data/third_party/boringssl-with-bazel/src/crypto/x509/i2d_pr.c +11 -15
  1276. data/third_party/boringssl-with-bazel/src/crypto/x509/internal.h +68 -50
  1277. data/third_party/boringssl-with-bazel/src/crypto/x509/name_print.c +132 -151
  1278. data/third_party/boringssl-with-bazel/src/crypto/x509/policy.c +790 -0
  1279. data/third_party/boringssl-with-bazel/src/crypto/x509/rsa_pss.c +95 -102
  1280. data/third_party/boringssl-with-bazel/src/crypto/x509/t_crl.c +72 -57
  1281. data/third_party/boringssl-with-bazel/src/crypto/x509/t_req.c +12 -10
  1282. data/third_party/boringssl-with-bazel/src/crypto/x509/t_x509.c +220 -254
  1283. data/third_party/boringssl-with-bazel/src/crypto/x509/t_x509a.c +52 -47
  1284. data/third_party/boringssl-with-bazel/src/crypto/x509/x509.c +3 -4
  1285. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_att.c +136 -270
  1286. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_cmp.c +161 -327
  1287. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_d2.c +37 -33
  1288. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_def.c +14 -31
  1289. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_ext.c +55 -85
  1290. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_lu.c +528 -616
  1291. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_obj.c +129 -122
  1292. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_req.c +164 -181
  1293. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_set.c +132 -132
  1294. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_trs.c +186 -203
  1295. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_txt.c +64 -79
  1296. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_v3.c +175 -160
  1297. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_vfy.c +1864 -2050
  1298. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_vpm.c +380 -480
  1299. data/third_party/boringssl-with-bazel/src/crypto/x509/x509cset.c +156 -163
  1300. data/third_party/boringssl-with-bazel/src/crypto/x509/x509name.c +266 -265
  1301. data/third_party/boringssl-with-bazel/src/crypto/x509/x509rset.c +40 -15
  1302. data/third_party/boringssl-with-bazel/src/crypto/x509/x509spki.c +59 -63
  1303. data/third_party/boringssl-with-bazel/src/crypto/x509/x_algor.c +63 -67
  1304. data/third_party/boringssl-with-bazel/src/crypto/x509/x_all.c +114 -144
  1305. data/third_party/boringssl-with-bazel/src/crypto/x509/x_attrib.c +25 -26
  1306. data/third_party/boringssl-with-bazel/src/crypto/x509/x_crl.c +329 -416
  1307. data/third_party/boringssl-with-bazel/src/crypto/x509/x_exten.c +8 -7
  1308. data/third_party/boringssl-with-bazel/src/crypto/x509/x_info.c +30 -28
  1309. data/third_party/boringssl-with-bazel/src/crypto/x509/x_name.c +354 -370
  1310. data/third_party/boringssl-with-bazel/src/crypto/x509/x_pkey.c +37 -32
  1311. data/third_party/boringssl-with-bazel/src/crypto/x509/x_pubkey.c +116 -119
  1312. data/third_party/boringssl-with-bazel/src/crypto/x509/x_req.c +36 -26
  1313. data/third_party/boringssl-with-bazel/src/crypto/x509/x_sig.c +3 -4
  1314. data/third_party/boringssl-with-bazel/src/crypto/x509/x_spki.c +10 -13
  1315. data/third_party/boringssl-with-bazel/src/crypto/x509/x_val.c +3 -4
  1316. data/third_party/boringssl-with-bazel/src/crypto/x509/x_x509.c +419 -261
  1317. data/third_party/boringssl-with-bazel/src/crypto/x509/x_x509a.c +113 -105
  1318. data/third_party/boringssl-with-bazel/src/crypto/x509v3/ext_dat.h +11 -15
  1319. data/third_party/boringssl-with-bazel/src/crypto/x509v3/internal.h +79 -171
  1320. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_akey.c +126 -131
  1321. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_akeya.c +3 -4
  1322. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_alt.c +465 -469
  1323. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_bcons.c +56 -54
  1324. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_bitst.c +46 -49
  1325. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_conf.c +294 -344
  1326. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_cpols.c +342 -365
  1327. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_crld.c +429 -393
  1328. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_enum.c +29 -24
  1329. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_extku.c +65 -59
  1330. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_genn.c +125 -121
  1331. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_ia5.c +43 -42
  1332. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_info.c +120 -125
  1333. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_int.c +50 -20
  1334. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_lib.c +228 -265
  1335. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_ncons.c +386 -389
  1336. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_ocsp.c +45 -32
  1337. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_pcons.c +57 -54
  1338. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_pmaps.c +63 -67
  1339. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_prn.c +130 -135
  1340. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_purp.c +652 -691
  1341. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_skey.c +90 -75
  1342. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_utl.c +1063 -1145
  1343. data/third_party/boringssl-with-bazel/src/include/openssl/aead.h +13 -11
  1344. data/third_party/boringssl-with-bazel/src/include/openssl/arm_arch.h +28 -48
  1345. data/third_party/boringssl-with-bazel/src/include/openssl/asn1.h +217 -191
  1346. data/third_party/boringssl-with-bazel/src/include/openssl/asn1t.h +26 -78
  1347. data/third_party/boringssl-with-bazel/src/include/openssl/base.h +50 -14
  1348. data/third_party/boringssl-with-bazel/src/include/openssl/bio.h +29 -14
  1349. data/third_party/boringssl-with-bazel/src/include/openssl/blake2.h +1 -4
  1350. data/third_party/boringssl-with-bazel/src/include/openssl/bn.h +49 -17
  1351. data/third_party/boringssl-with-bazel/src/include/openssl/bytestring.h +99 -29
  1352. data/third_party/boringssl-with-bazel/src/include/openssl/cipher.h +49 -60
  1353. data/third_party/boringssl-with-bazel/src/include/openssl/conf.h +2 -15
  1354. data/third_party/boringssl-with-bazel/src/include/openssl/cpu.h +16 -200
  1355. data/third_party/boringssl-with-bazel/src/include/openssl/crypto.h +34 -0
  1356. data/third_party/boringssl-with-bazel/src/include/openssl/ctrdrbg.h +82 -0
  1357. data/third_party/boringssl-with-bazel/src/include/openssl/dh.h +32 -30
  1358. data/third_party/boringssl-with-bazel/src/include/openssl/digest.h +7 -0
  1359. data/third_party/boringssl-with-bazel/src/include/openssl/dsa.h +4 -0
  1360. data/third_party/boringssl-with-bazel/src/include/openssl/ec.h +48 -5
  1361. data/third_party/boringssl-with-bazel/src/include/openssl/ec_key.h +37 -8
  1362. data/third_party/boringssl-with-bazel/src/include/openssl/ecdsa.h +1 -0
  1363. data/third_party/boringssl-with-bazel/src/include/openssl/err.h +33 -5
  1364. data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +25 -33
  1365. data/third_party/boringssl-with-bazel/src/include/openssl/ex_data.h +1 -1
  1366. data/third_party/boringssl-with-bazel/src/include/openssl/hmac.h +7 -0
  1367. data/third_party/boringssl-with-bazel/src/include/openssl/hpke.h +69 -16
  1368. data/third_party/boringssl-with-bazel/src/include/openssl/kdf.h +91 -0
  1369. data/third_party/boringssl-with-bazel/src/include/openssl/kyber.h +128 -0
  1370. data/third_party/boringssl-with-bazel/src/include/openssl/mem.h +74 -8
  1371. data/third_party/boringssl-with-bazel/src/include/openssl/nid.h +7 -3
  1372. data/third_party/boringssl-with-bazel/src/include/openssl/obj.h +8 -1
  1373. data/third_party/boringssl-with-bazel/src/include/openssl/opensslconf.h +1 -0
  1374. data/third_party/boringssl-with-bazel/src/include/openssl/pem.h +11 -18
  1375. data/third_party/boringssl-with-bazel/src/include/openssl/pkcs8.h +8 -0
  1376. data/third_party/boringssl-with-bazel/src/include/openssl/rand.h +12 -1
  1377. data/third_party/boringssl-with-bazel/src/include/openssl/rsa.h +98 -5
  1378. data/third_party/boringssl-with-bazel/src/include/openssl/service_indicator.h +96 -0
  1379. data/third_party/boringssl-with-bazel/src/include/openssl/span.h +18 -21
  1380. data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +285 -92
  1381. data/third_party/boringssl-with-bazel/src/include/openssl/ssl3.h +1 -6
  1382. data/third_party/boringssl-with-bazel/src/include/openssl/stack.h +381 -287
  1383. data/third_party/boringssl-with-bazel/src/include/openssl/thread.h +9 -6
  1384. data/third_party/boringssl-with-bazel/src/include/openssl/time.h +41 -0
  1385. data/third_party/boringssl-with-bazel/src/include/openssl/tls1.h +22 -7
  1386. data/third_party/boringssl-with-bazel/src/include/openssl/trust_token.h +57 -23
  1387. data/third_party/boringssl-with-bazel/src/include/openssl/type_check.h +0 -11
  1388. data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +2075 -1407
  1389. data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +241 -212
  1390. data/third_party/boringssl-with-bazel/src/ssl/bio_ssl.cc +2 -2
  1391. data/third_party/boringssl-with-bazel/src/ssl/d1_both.cc +6 -13
  1392. data/third_party/boringssl-with-bazel/src/ssl/d1_pkt.cc +17 -18
  1393. data/third_party/boringssl-with-bazel/src/ssl/dtls_method.cc +4 -5
  1394. data/third_party/boringssl-with-bazel/src/ssl/dtls_record.cc +25 -33
  1395. data/third_party/boringssl-with-bazel/src/ssl/encrypted_client_hello.cc +45 -26
  1396. data/third_party/boringssl-with-bazel/src/ssl/extensions.cc +64 -35
  1397. data/third_party/boringssl-with-bazel/src/ssl/handoff.cc +198 -54
  1398. data/third_party/boringssl-with-bazel/src/ssl/handshake.cc +5 -5
  1399. data/third_party/boringssl-with-bazel/src/ssl/handshake_client.cc +53 -34
  1400. data/third_party/boringssl-with-bazel/src/ssl/handshake_server.cc +76 -44
  1401. data/third_party/boringssl-with-bazel/src/ssl/internal.h +200 -121
  1402. data/third_party/boringssl-with-bazel/src/ssl/s3_both.cc +47 -12
  1403. data/third_party/boringssl-with-bazel/src/ssl/s3_lib.cc +2 -2
  1404. data/third_party/boringssl-with-bazel/src/ssl/s3_pkt.cc +91 -75
  1405. data/third_party/boringssl-with-bazel/src/ssl/ssl_aead_ctx.cc +8 -10
  1406. data/third_party/boringssl-with-bazel/src/ssl/ssl_asn1.cc +47 -69
  1407. data/third_party/boringssl-with-bazel/src/ssl/ssl_buffer.cc +1 -0
  1408. data/third_party/boringssl-with-bazel/src/ssl/ssl_cert.cc +5 -9
  1409. data/third_party/boringssl-with-bazel/src/ssl/ssl_cipher.cc +217 -226
  1410. data/third_party/boringssl-with-bazel/src/ssl/ssl_file.cc +78 -101
  1411. data/third_party/boringssl-with-bazel/src/ssl/ssl_key_share.cc +106 -142
  1412. data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +244 -35
  1413. data/third_party/boringssl-with-bazel/src/ssl/ssl_privkey.cc +167 -64
  1414. data/third_party/boringssl-with-bazel/src/ssl/ssl_session.cc +41 -32
  1415. data/third_party/boringssl-with-bazel/src/ssl/ssl_versions.cc +27 -19
  1416. data/third_party/boringssl-with-bazel/src/ssl/ssl_x509.cc +22 -6
  1417. data/third_party/boringssl-with-bazel/src/ssl/t1_enc.cc +15 -13
  1418. data/third_party/boringssl-with-bazel/src/ssl/tls13_both.cc +7 -44
  1419. data/third_party/boringssl-with-bazel/src/ssl/tls13_client.cc +7 -4
  1420. data/third_party/boringssl-with-bazel/src/ssl/tls13_enc.cc +7 -23
  1421. data/third_party/boringssl-with-bazel/src/ssl/tls13_server.cc +25 -34
  1422. data/third_party/boringssl-with-bazel/src/ssl/tls_method.cc +2 -2
  1423. data/third_party/boringssl-with-bazel/src/ssl/tls_record.cc +16 -98
  1424. data/third_party/boringssl-with-bazel/src/third_party/fiat/curve25519_32.h +1241 -657
  1425. data/third_party/boringssl-with-bazel/src/third_party/fiat/curve25519_64.h +751 -398
  1426. data/third_party/boringssl-with-bazel/src/third_party/fiat/curve25519_64_msvc.h +1281 -0
  1427. data/third_party/boringssl-with-bazel/src/third_party/fiat/p256_32.h +3551 -1938
  1428. data/third_party/boringssl-with-bazel/src/third_party/fiat/p256_64.h +1272 -487
  1429. data/third_party/boringssl-with-bazel/src/third_party/fiat/p256_64_msvc.h +2002 -0
  1430. data/third_party/cares/cares/include/ares.h +23 -1
  1431. data/third_party/cares/cares/{src/lib → include}/ares_nameser.h +9 -7
  1432. data/third_party/cares/cares/include/ares_rules.h +2 -2
  1433. data/third_party/cares/cares/include/ares_version.h +3 -3
  1434. data/third_party/cares/cares/src/lib/ares__addrinfo2hostent.c +266 -0
  1435. data/third_party/cares/cares/src/lib/ares__addrinfo_localhost.c +240 -0
  1436. data/third_party/cares/cares/src/lib/ares__parse_into_addrinfo.c +49 -80
  1437. data/third_party/cares/cares/src/lib/ares__readaddrinfo.c +37 -43
  1438. data/third_party/cares/cares/src/lib/ares__sortaddrinfo.c +12 -4
  1439. data/third_party/cares/cares/src/lib/ares_data.c +16 -0
  1440. data/third_party/cares/cares/src/lib/ares_data.h +7 -0
  1441. data/third_party/cares/cares/src/lib/ares_destroy.c +8 -0
  1442. data/third_party/cares/cares/src/lib/ares_expand_name.c +17 -6
  1443. data/third_party/cares/cares/src/lib/ares_freeaddrinfo.c +1 -0
  1444. data/third_party/cares/cares/src/lib/ares_getaddrinfo.c +156 -78
  1445. data/third_party/cares/cares/src/lib/ares_gethostbyname.c +130 -326
  1446. data/third_party/cares/cares/src/lib/ares_init.c +97 -485
  1447. data/third_party/cares/cares/src/lib/ares_library_init.c +2 -89
  1448. data/third_party/cares/cares/src/lib/ares_parse_a_reply.c +23 -142
  1449. data/third_party/cares/cares/src/lib/ares_parse_aaaa_reply.c +22 -142
  1450. data/third_party/cares/cares/src/lib/ares_parse_uri_reply.c +184 -0
  1451. data/third_party/cares/cares/src/lib/ares_private.h +30 -16
  1452. data/third_party/cares/cares/src/lib/ares_process.c +55 -16
  1453. data/third_party/cares/cares/src/lib/ares_query.c +1 -35
  1454. data/third_party/cares/cares/src/lib/ares_rand.c +279 -0
  1455. data/third_party/cares/cares/src/lib/ares_send.c +5 -7
  1456. data/third_party/cares/cares/src/lib/ares_strdup.c +12 -19
  1457. data/third_party/cares/cares/src/lib/ares_strsplit.c +44 -128
  1458. data/third_party/cares/cares/src/lib/ares_strsplit.h +9 -10
  1459. data/third_party/cares/cares/src/lib/inet_net_pton.c +78 -116
  1460. data/third_party/cares/cares/src/tools/ares_getopt.h +53 -0
  1461. data/third_party/upb/upb/{table_internal.h → alloc.h} +6 -6
  1462. data/third_party/upb/upb/arena.h +4 -193
  1463. data/third_party/upb/upb/array.h +4 -51
  1464. data/third_party/upb/upb/base/descriptor_constants.h +104 -0
  1465. data/third_party/upb/upb/base/log2.h +57 -0
  1466. data/third_party/upb/upb/{status.c → base/status.c} +2 -7
  1467. data/third_party/upb/upb/base/status.h +66 -0
  1468. data/third_party/upb/upb/base/string_view.h +75 -0
  1469. data/third_party/upb/upb/{array.c → collections/array.c} +67 -36
  1470. data/third_party/upb/upb/collections/array.h +85 -0
  1471. data/third_party/upb/upb/collections/array_internal.h +135 -0
  1472. data/third_party/upb/upb/{map.c → collections/map.c} +53 -26
  1473. data/third_party/upb/upb/collections/map.h +135 -0
  1474. data/third_party/upb/upb/collections/map_gencode_util.h +78 -0
  1475. data/third_party/upb/upb/collections/map_internal.h +170 -0
  1476. data/third_party/upb/upb/collections/map_sorter.c +166 -0
  1477. data/third_party/upb/upb/collections/map_sorter_internal.h +109 -0
  1478. data/third_party/upb/upb/{message_value.h → collections/message_value.h} +12 -13
  1479. data/third_party/upb/upb/decode.h +3 -62
  1480. data/third_party/upb/upb/def.h +4 -384
  1481. data/third_party/upb/upb/def.hpp +3 -411
  1482. data/third_party/upb/upb/encode.h +3 -48
  1483. data/third_party/upb/upb/extension_registry.h +3 -52
  1484. data/third_party/upb/upb/{table.c → hash/common.c} +52 -110
  1485. data/third_party/upb/upb/hash/common.h +199 -0
  1486. data/third_party/upb/upb/hash/int_table.h +102 -0
  1487. data/third_party/upb/upb/hash/str_table.h +161 -0
  1488. data/third_party/upb/upb/{json_decode.c → json/decode.c} +63 -98
  1489. data/third_party/upb/upb/json/decode.h +52 -0
  1490. data/third_party/upb/upb/{json_encode.c → json/encode.c} +69 -45
  1491. data/third_party/upb/upb/json/encode.h +70 -0
  1492. data/third_party/upb/upb/json_decode.h +4 -15
  1493. data/third_party/upb/upb/json_encode.h +4 -33
  1494. data/third_party/upb/upb/lex/atoi.c +68 -0
  1495. data/third_party/upb/upb/lex/atoi.h +53 -0
  1496. data/third_party/upb/upb/{upb.c → lex/round_trip.c} +2 -11
  1497. data/third_party/upb/upb/{internal/upb.h → lex/round_trip.h} +17 -30
  1498. data/third_party/upb/upb/lex/strtod.c +97 -0
  1499. data/third_party/upb/upb/lex/strtod.h +46 -0
  1500. data/third_party/upb/upb/lex/unicode.c +57 -0
  1501. data/third_party/upb/upb/lex/unicode.h +77 -0
  1502. data/third_party/upb/upb/map.h +4 -85
  1503. data/third_party/upb/upb/mem/alloc.c +47 -0
  1504. data/third_party/upb/upb/mem/alloc.h +98 -0
  1505. data/third_party/upb/upb/mem/arena.c +367 -0
  1506. data/third_party/upb/upb/mem/arena.h +160 -0
  1507. data/third_party/upb/upb/mem/arena_internal.h +114 -0
  1508. data/third_party/upb/upb/message/accessors.c +68 -0
  1509. data/third_party/upb/upb/message/accessors.h +379 -0
  1510. data/third_party/upb/upb/message/accessors_internal.h +325 -0
  1511. data/third_party/upb/upb/message/extension_internal.h +83 -0
  1512. data/third_party/upb/upb/message/internal.h +135 -0
  1513. data/third_party/upb/upb/message/message.c +180 -0
  1514. data/third_party/upb/upb/message/message.h +69 -0
  1515. data/third_party/upb/upb/mini_table/common.c +128 -0
  1516. data/third_party/upb/upb/mini_table/common.h +170 -0
  1517. data/third_party/upb/upb/mini_table/common_internal.h +111 -0
  1518. data/third_party/upb/upb/{mini_table.c → mini_table/decode.c} +513 -533
  1519. data/third_party/upb/upb/mini_table/decode.h +179 -0
  1520. data/third_party/upb/upb/mini_table/encode.c +300 -0
  1521. data/third_party/upb/upb/mini_table/encode_internal.h +111 -0
  1522. data/third_party/upb/upb/{mini_table.hpp → mini_table/encode_internal.hpp} +32 -8
  1523. data/third_party/upb/upb/mini_table/enum_internal.h +88 -0
  1524. data/third_party/upb/upb/mini_table/extension_internal.h +47 -0
  1525. data/third_party/upb/upb/{extension_registry.c → mini_table/extension_registry.c} +27 -24
  1526. data/third_party/upb/upb/mini_table/extension_registry.h +104 -0
  1527. data/third_party/upb/upb/mini_table/field_internal.h +192 -0
  1528. data/third_party/upb/upb/mini_table/file_internal.h +47 -0
  1529. data/third_party/upb/upb/mini_table/message_internal.h +136 -0
  1530. data/third_party/upb/upb/mini_table/sub_internal.h +38 -0
  1531. data/third_party/upb/upb/mini_table/types.h +40 -0
  1532. data/third_party/upb/upb/mini_table.h +4 -157
  1533. data/third_party/upb/upb/msg.h +3 -38
  1534. data/third_party/upb/upb/port/atomic.h +101 -0
  1535. data/third_party/upb/upb/{port_def.inc → port/def.inc} +94 -27
  1536. data/third_party/upb/upb/{port_undef.inc → port/undef.inc} +13 -3
  1537. data/third_party/upb/upb/{internal → port}/vsnprintf_compat.h +5 -7
  1538. data/third_party/upb/upb/reflection/common.h +67 -0
  1539. data/third_party/upb/upb/reflection/def.h +42 -0
  1540. data/third_party/upb/upb/reflection/def.hpp +610 -0
  1541. data/third_party/upb/upb/reflection/def_builder.c +357 -0
  1542. data/third_party/upb/upb/reflection/def_builder_internal.h +157 -0
  1543. data/third_party/upb/upb/reflection/def_pool.c +462 -0
  1544. data/third_party/upb/upb/reflection/def_pool.h +108 -0
  1545. data/third_party/upb/upb/reflection/def_pool_internal.h +77 -0
  1546. data/third_party/upb/upb/reflection/def_type.c +50 -0
  1547. data/third_party/upb/upb/reflection/def_type.h +81 -0
  1548. data/third_party/upb/upb/reflection/desc_state.c +53 -0
  1549. data/third_party/upb/upb/reflection/desc_state_internal.h +64 -0
  1550. data/third_party/upb/upb/reflection/enum_def.c +310 -0
  1551. data/third_party/upb/upb/reflection/enum_def.h +80 -0
  1552. data/third_party/upb/upb/reflection/enum_def_internal.h +56 -0
  1553. data/third_party/upb/upb/reflection/enum_reserved_range.c +84 -0
  1554. data/third_party/upb/upb/reflection/enum_reserved_range.h +51 -0
  1555. data/third_party/upb/upb/reflection/enum_reserved_range_internal.h +55 -0
  1556. data/third_party/upb/upb/reflection/enum_value_def.c +144 -0
  1557. data/third_party/upb/upb/reflection/enum_value_def.h +57 -0
  1558. data/third_party/upb/upb/reflection/enum_value_def_internal.h +57 -0
  1559. data/third_party/upb/upb/reflection/extension_range.c +93 -0
  1560. data/third_party/upb/upb/reflection/extension_range.h +55 -0
  1561. data/third_party/upb/upb/reflection/extension_range_internal.h +54 -0
  1562. data/third_party/upb/upb/reflection/field_def.c +930 -0
  1563. data/third_party/upb/upb/reflection/field_def.h +91 -0
  1564. data/third_party/upb/upb/reflection/field_def_internal.h +76 -0
  1565. data/third_party/upb/upb/reflection/file_def.c +370 -0
  1566. data/third_party/upb/upb/reflection/file_def.h +77 -0
  1567. data/third_party/upb/upb/reflection/file_def_internal.h +57 -0
  1568. data/third_party/upb/upb/reflection/message.c +233 -0
  1569. data/third_party/upb/upb/reflection/message.h +102 -0
  1570. data/third_party/upb/upb/reflection/message.hpp +37 -0
  1571. data/third_party/upb/upb/reflection/message_def.c +718 -0
  1572. data/third_party/upb/upb/reflection/message_def.h +174 -0
  1573. data/third_party/upb/upb/reflection/message_def_internal.h +63 -0
  1574. data/third_party/upb/upb/reflection/message_reserved_range.c +81 -0
  1575. data/third_party/upb/upb/reflection/message_reserved_range.h +51 -0
  1576. data/third_party/upb/upb/reflection/message_reserved_range_internal.h +55 -0
  1577. data/third_party/upb/upb/reflection/method_def.c +124 -0
  1578. data/third_party/upb/upb/reflection/method_def.h +59 -0
  1579. data/third_party/upb/upb/reflection/method_def_internal.h +53 -0
  1580. data/third_party/upb/upb/reflection/oneof_def.c +226 -0
  1581. data/third_party/upb/upb/reflection/oneof_def.h +66 -0
  1582. data/third_party/upb/upb/reflection/oneof_def_internal.h +57 -0
  1583. data/third_party/upb/upb/reflection/service_def.c +128 -0
  1584. data/third_party/upb/upb/reflection/service_def.h +60 -0
  1585. data/third_party/upb/upb/reflection/service_def_internal.h +53 -0
  1586. data/third_party/upb/upb/reflection.h +4 -78
  1587. data/third_party/upb/upb/reflection.hpp +3 -7
  1588. data/third_party/upb/upb/status.h +4 -34
  1589. data/third_party/upb/upb/{collections.h → string_view.h} +7 -7
  1590. data/third_party/upb/upb/{text_encode.c → text/encode.c} +74 -70
  1591. data/third_party/upb/upb/text/encode.h +69 -0
  1592. data/third_party/upb/upb/text_encode.h +4 -32
  1593. data/third_party/upb/upb/upb.h +6 -151
  1594. data/third_party/upb/upb/upb.hpp +10 -18
  1595. data/third_party/upb/upb/wire/common.h +44 -0
  1596. data/third_party/upb/upb/wire/common_internal.h +50 -0
  1597. data/third_party/upb/upb/wire/decode.c +1343 -0
  1598. data/third_party/upb/upb/wire/decode.h +108 -0
  1599. data/third_party/upb/upb/{decode_fast.c → wire/decode_fast.c} +184 -225
  1600. data/third_party/upb/upb/{decode_fast.h → wire/decode_fast.h} +21 -7
  1601. data/third_party/upb/upb/{internal/decode.h → wire/decode_internal.h} +44 -92
  1602. data/third_party/upb/upb/{encode.c → wire/encode.c} +114 -95
  1603. data/third_party/upb/upb/wire/encode.h +92 -0
  1604. data/third_party/upb/upb/wire/eps_copy_input_stream.c +39 -0
  1605. data/third_party/upb/upb/wire/eps_copy_input_stream.h +425 -0
  1606. data/third_party/upb/upb/wire/reader.c +67 -0
  1607. data/third_party/upb/upb/wire/reader.h +227 -0
  1608. data/third_party/upb/upb/wire/swap_internal.h +63 -0
  1609. data/third_party/upb/upb/wire/types.h +41 -0
  1610. data/third_party/{upb/third_party/utf8_range → utf8_range}/range2-neon.c +1 -1
  1611. data/third_party/{upb/third_party/utf8_range → utf8_range}/utf8_range.h +12 -0
  1612. metadata +302 -116
  1613. data/src/core/ext/filters/client_channel/health/health_check_client.cc +0 -175
  1614. data/src/core/ext/filters/client_channel/health/health_check_client.h +0 -43
  1615. data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc +0 -30
  1616. data/src/core/ext/transport/chttp2/transport/context_list.cc +0 -71
  1617. data/src/core/ext/transport/chttp2/transport/context_list.h +0 -54
  1618. data/src/core/lib/gprpp/global_config.h +0 -93
  1619. data/src/core/lib/gprpp/global_config_env.cc +0 -140
  1620. data/src/core/lib/gprpp/global_config_env.h +0 -133
  1621. data/src/core/lib/gprpp/global_config_generic.h +0 -40
  1622. data/src/core/lib/promise/intra_activity_waiter.h +0 -55
  1623. data/src/core/lib/security/security_connector/ssl_utils_config.cc +0 -32
  1624. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_enum.c +0 -195
  1625. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_utf8.c +0 -236
  1626. data/third_party/boringssl-with-bazel/src/crypto/asn1/charmap.h +0 -15
  1627. data/third_party/boringssl-with-bazel/src/crypto/asn1/time_support.c +0 -206
  1628. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha1-altivec.c +0 -361
  1629. data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_cache.c +0 -287
  1630. data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_data.c +0 -132
  1631. data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_lib.c +0 -155
  1632. data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_map.c +0 -131
  1633. data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_node.c +0 -189
  1634. data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_tree.c +0 -843
  1635. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_pci.c +0 -289
  1636. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_pcia.c +0 -57
  1637. data/third_party/cares/cares/src/lib/ares_library_init.h +0 -43
  1638. data/third_party/upb/upb/arena.c +0 -277
  1639. data/third_party/upb/upb/decode.c +0 -1221
  1640. data/third_party/upb/upb/def.c +0 -3269
  1641. data/third_party/upb/upb/internal/table.h +0 -385
  1642. data/third_party/upb/upb/msg.c +0 -368
  1643. data/third_party/upb/upb/msg_internal.h +0 -837
  1644. data/third_party/upb/upb/reflection.c +0 -323
  1645. /data/src/core/lib/gpr/{log_android.cc → android/log.cc} +0 -0
  1646. /data/src/core/lib/gpr/{cpu_iphone.cc → iphone/cpu.cc} +0 -0
  1647. /data/src/core/lib/gpr/{cpu_linux.cc → linux/cpu.cc} +0 -0
  1648. /data/src/core/lib/gpr/{log_linux.cc → linux/log.cc} +0 -0
  1649. /data/src/core/lib/gpr/{tmpfile_msys.cc → msys/tmpfile.cc} +0 -0
  1650. /data/src/core/lib/gpr/{cpu_posix.cc → posix/cpu.cc} +0 -0
  1651. /data/src/core/lib/gpr/{log_posix.cc → posix/log.cc} +0 -0
  1652. /data/src/core/lib/gpr/{string_posix.cc → posix/string.cc} +0 -0
  1653. /data/src/core/lib/gpr/{sync_posix.cc → posix/sync.cc} +0 -0
  1654. /data/src/core/lib/gpr/{tmpfile_posix.cc → posix/tmpfile.cc} +0 -0
  1655. /data/src/core/lib/gpr/{cpu_windows.cc → windows/cpu.cc} +0 -0
  1656. /data/src/core/lib/gpr/{log_windows.cc → windows/log.cc} +0 -0
  1657. /data/src/core/lib/gpr/{string_windows.cc → windows/string.cc} +0 -0
  1658. /data/src/core/lib/gpr/{string_util_windows.cc → windows/string_util.cc} +0 -0
  1659. /data/src/core/lib/gpr/{sync_windows.cc → windows/sync.cc} +0 -0
  1660. /data/src/core/lib/gpr/{time_windows.cc → windows/time.cc} +0 -0
  1661. /data/src/core/lib/gpr/{tmpfile_windows.cc → windows/tmpfile.cc} +0 -0
  1662. /data/src/core/lib/gprpp/{env_linux.cc → linux/env.cc} +0 -0
  1663. /data/src/core/lib/gprpp/{env_posix.cc → posix/env.cc} +0 -0
  1664. /data/src/core/lib/gprpp/{stat_posix.cc → posix/stat.cc} +0 -0
  1665. /data/src/core/lib/gprpp/{env_windows.cc → windows/env.cc} +0 -0
  1666. /data/src/core/lib/gprpp/{stat_windows.cc → windows/stat.cc} +0 -0
  1667. /data/third_party/{upb/third_party/utf8_range → utf8_range}/naive.c +0 -0
  1668. /data/third_party/{upb/third_party/utf8_range → utf8_range}/range2-sse.c +0 -0
@@ -24,9 +24,11 @@
24
24
  #include <algorithm>
25
25
  #include <functional>
26
26
  #include <new>
27
- #include <set>
27
+ #include <type_traits>
28
+ #include <utility>
28
29
  #include <vector>
29
30
 
31
+ #include "absl/cleanup/cleanup.h"
30
32
  #include "absl/status/status.h"
31
33
  #include "absl/status/statusor.h"
32
34
  #include "absl/strings/cord.h"
@@ -40,6 +42,7 @@
40
42
  #include <grpc/event_engine/event_engine.h>
41
43
  #include <grpc/slice.h>
42
44
  #include <grpc/status.h>
45
+ #include <grpc/support/json.h>
43
46
  #include <grpc/support/log.h>
44
47
  #include <grpc/support/string_util.h>
45
48
  #include <grpc/support/time.h>
@@ -47,6 +50,7 @@
47
50
  #include "src/core/ext/filters/client_channel/backend_metric.h"
48
51
  #include "src/core/ext/filters/client_channel/backup_poller.h"
49
52
  #include "src/core/ext/filters/client_channel/client_channel_channelz.h"
53
+ #include "src/core/ext/filters/client_channel/client_channel_internal.h"
50
54
  #include "src/core/ext/filters/client_channel/client_channel_service_config.h"
51
55
  #include "src/core/ext/filters/client_channel/config_selector.h"
52
56
  #include "src/core/ext/filters/client_channel/dynamic_filters.h"
@@ -67,6 +71,7 @@
67
71
  #include "src/core/lib/gprpp/debug_location.h"
68
72
  #include "src/core/lib/gprpp/status_helper.h"
69
73
  #include "src/core/lib/gprpp/sync.h"
74
+ #include "src/core/lib/gprpp/unique_type_name.h"
70
75
  #include "src/core/lib/gprpp/work_serializer.h"
71
76
  #include "src/core/lib/handshaker/proxy_mapper_registry.h"
72
77
  #include "src/core/lib/iomgr/exec_ctx.h"
@@ -79,6 +84,7 @@
79
84
  #include "src/core/lib/resolver/server_address.h"
80
85
  #include "src/core/lib/service_config/service_config_call_data.h"
81
86
  #include "src/core/lib/service_config/service_config_impl.h"
87
+ #include "src/core/lib/slice/slice.h"
82
88
  #include "src/core/lib/slice/slice_internal.h"
83
89
  #include "src/core/lib/surface/channel.h"
84
90
  #include "src/core/lib/transport/connectivity_state.h"
@@ -89,9 +95,6 @@
89
95
  // Client channel filter
90
96
  //
91
97
 
92
- #define GRPC_ARG_HEALTH_CHECK_SERVICE_NAME \
93
- "grpc.internal.health_check_service_name"
94
-
95
98
  namespace grpc_core {
96
99
 
97
100
  using internal::ClientChannelMethodParsedConfig;
@@ -105,6 +108,75 @@ TraceFlag grpc_client_channel_lb_call_trace(false, "client_channel_lb_call");
105
108
  //
106
109
 
107
110
  class ClientChannel::CallData {
111
+ public:
112
+ // Removes the call from the channel's list of calls queued
113
+ // for name resolution.
114
+ void RemoveCallFromResolverQueuedCallsLocked()
115
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::resolution_mu_);
116
+
117
+ // Called by the channel for each queued call when a new resolution
118
+ // result becomes available.
119
+ virtual void RetryCheckResolutionLocked()
120
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::resolution_mu_) = 0;
121
+
122
+ RefCountedPtr<DynamicFilters> dynamic_filters() const {
123
+ return dynamic_filters_;
124
+ }
125
+
126
+ protected:
127
+ CallData() = default;
128
+ virtual ~CallData() = default;
129
+
130
+ // Checks whether a resolver result is available. The following
131
+ // outcomes are possible:
132
+ // - No resolver result is available yet. The call will be queued and
133
+ // absl::nullopt will be returned. Later, when a resolver result
134
+ // becomes available, RetryCheckResolutionLocked() will be called.
135
+ // - The resolver has returned a transient failure. If the call is
136
+ // not wait_for_ready, a non-OK status will be returned. (If the
137
+ // call *is* wait_for_ready, it will be queued instead.)
138
+ // - There is a valid resolver result. The service config will be
139
+ // stored in the call context and an OK status will be returned.
140
+ absl::optional<absl::Status> CheckResolution(bool was_queued);
141
+
142
+ private:
143
+ // Accessors for data stored in the subclass.
144
+ virtual ClientChannel* chand() const = 0;
145
+ virtual Arena* arena() const = 0;
146
+ virtual grpc_polling_entity* pollent() const = 0;
147
+ virtual grpc_metadata_batch* send_initial_metadata() = 0;
148
+ virtual grpc_call_context_element* call_context() const = 0;
149
+
150
+ // Helper function for CheckResolution(). Returns true if the call
151
+ // can continue (i.e., there is a valid resolution result, or there is
152
+ // an invalid resolution result but the call is not wait_for_ready).
153
+ bool CheckResolutionLocked(
154
+ absl::StatusOr<RefCountedPtr<ConfigSelector>>* config_selector)
155
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::resolution_mu_);
156
+
157
+ // Adds the call to the channel's list of calls queued for name resolution.
158
+ void AddCallToResolverQueuedCallsLocked()
159
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::resolution_mu_);
160
+
161
+ // Called when adding the call to the resolver queue.
162
+ virtual void OnAddToQueueLocked()
163
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::resolution_mu_) {}
164
+
165
+ // Applies service config to the call. Must be invoked once we know
166
+ // that the resolver has returned results to the channel.
167
+ // If an error is returned, the error indicates the status with which
168
+ // the call should be failed.
169
+ grpc_error_handle ApplyServiceConfigToCallLocked(
170
+ const absl::StatusOr<RefCountedPtr<ConfigSelector>>& config_selector);
171
+
172
+ // Called to reset the deadline based on the service config obtained
173
+ // from the resolver.
174
+ virtual void ResetDeadline(Duration timeout) = 0;
175
+
176
+ RefCountedPtr<DynamicFilters> dynamic_filters_;
177
+ };
178
+
179
+ class ClientChannel::FilterBasedCallData : public ClientChannel::CallData {
108
180
  public:
109
181
  static grpc_error_handle Init(grpc_call_element* elem,
110
182
  const grpc_call_element_args* args);
@@ -115,31 +187,33 @@ class ClientChannel::CallData {
115
187
  grpc_call_element* elem, grpc_transport_stream_op_batch* batch);
116
188
  static void SetPollent(grpc_call_element* elem, grpc_polling_entity* pollent);
117
189
 
118
- // Invoked by channel for queued calls when name resolution is completed.
119
- static void CheckResolution(void* arg, grpc_error_handle error);
120
- // Helper function for applying the service config to a call while
121
- // holding ClientChannel::resolution_mu_.
122
- // Returns true if the service config has been applied to the call, in which
123
- // case the caller must invoke ResolutionDone() or AsyncResolutionDone()
124
- // with the returned error.
125
- bool CheckResolutionLocked(grpc_call_element* elem, grpc_error_handle* error)
126
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::resolution_mu_);
127
- // Schedules a callback to continue processing the call once
128
- // resolution is complete. The callback will not run until after this
129
- // method returns.
130
- void AsyncResolutionDone(grpc_call_element* elem, grpc_error_handle error);
131
-
132
190
  private:
133
191
  class ResolverQueuedCallCanceller;
134
192
 
135
- CallData(grpc_call_element* elem, const ClientChannel& chand,
136
- const grpc_call_element_args& args);
137
- ~CallData();
193
+ FilterBasedCallData(grpc_call_element* elem,
194
+ const grpc_call_element_args& args);
195
+ ~FilterBasedCallData() override;
196
+
197
+ grpc_call_element* elem() const { return deadline_state_.elem; }
198
+ grpc_call_stack* owning_call() const { return deadline_state_.call_stack; }
199
+ CallCombiner* call_combiner() const { return deadline_state_.call_combiner; }
200
+
201
+ ClientChannel* chand() const override {
202
+ return static_cast<ClientChannel*>(elem()->channel_data);
203
+ }
204
+ Arena* arena() const override { return deadline_state_.arena; }
205
+ grpc_polling_entity* pollent() const override { return pollent_; }
206
+ grpc_metadata_batch* send_initial_metadata() override {
207
+ return pending_batches_[0]
208
+ ->payload->send_initial_metadata.send_initial_metadata;
209
+ }
210
+ grpc_call_context_element* call_context() const override {
211
+ return call_context_;
212
+ }
138
213
 
139
214
  // Returns the index into pending_batches_ to be used for batch.
140
215
  static size_t GetBatchIndex(grpc_transport_stream_op_batch* batch);
141
- void PendingBatchesAdd(grpc_call_element* elem,
142
- grpc_transport_stream_op_batch* batch);
216
+ void PendingBatchesAdd(grpc_transport_stream_op_batch* batch);
143
217
  static void FailPendingBatchInCallCombiner(void* arg,
144
218
  grpc_error_handle error);
145
219
  // A predicate type and some useful implementations for PendingBatchesFail().
@@ -159,67 +233,55 @@ class ClientChannel::CallData {
159
233
  // If yield_call_combiner_predicate returns true, assumes responsibility for
160
234
  // yielding the call combiner.
161
235
  void PendingBatchesFail(
162
- grpc_call_element* elem, grpc_error_handle error,
236
+ grpc_error_handle error,
163
237
  YieldCallCombinerPredicate yield_call_combiner_predicate);
164
238
  static void ResumePendingBatchInCallCombiner(void* arg,
165
239
  grpc_error_handle ignored);
166
- // Resumes all pending batches on lb_call_.
167
- void PendingBatchesResume(grpc_call_element* elem);
240
+ // Resumes all pending batches on dynamic_call_.
241
+ void PendingBatchesResume();
168
242
 
169
- // Applies service config to the call. Must be invoked once we know
170
- // that the resolver has returned results to the channel.
171
- // If an error is returned, the error indicates the status with which
172
- // the call should be failed.
173
- grpc_error_handle ApplyServiceConfigToCallLocked(
174
- grpc_call_element* elem, grpc_metadata_batch* initial_metadata)
175
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::resolution_mu_);
176
- // Invoked when the resolver result is applied to the caller, on both
177
- // success or failure.
178
- static void ResolutionDone(void* arg, grpc_error_handle error);
179
- // Removes the call (if present) from the channel's list of calls queued
180
- // for name resolution.
181
- void MaybeRemoveCallFromResolverQueuedCallsLocked(grpc_call_element* elem)
182
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::resolution_mu_);
183
- // Adds the call (if not already present) to the channel's list of
184
- // calls queued for name resolution.
185
- void MaybeAddCallToResolverQueuedCallsLocked(grpc_call_element* elem)
243
+ // Called to check for a resolution result, both when the call is
244
+ // initially started and when it is queued and the channel gets a new
245
+ // resolution result.
246
+ void TryCheckResolution(bool was_queued);
247
+
248
+ void OnAddToQueueLocked() override
186
249
  ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::resolution_mu_);
187
250
 
188
- static void RecvTrailingMetadataReadyForConfigSelectorCommitCallback(
189
- void* arg, grpc_error_handle error);
251
+ void RetryCheckResolutionLocked() override
252
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::resolution_mu_);
190
253
 
191
- void CreateDynamicCall(grpc_call_element* elem);
254
+ void ResetDeadline(Duration timeout) override {
255
+ const Timestamp per_method_deadline =
256
+ Timestamp::FromCycleCounterRoundUp(call_start_time_) + timeout;
257
+ if (per_method_deadline < deadline_) {
258
+ deadline_ = per_method_deadline;
259
+ grpc_deadline_state_reset(&deadline_state_, deadline_);
260
+ }
261
+ }
192
262
 
193
- Arena* arena() const { return deadline_state_.arena; }
194
- grpc_call_stack* owning_call() const { return deadline_state_.call_stack; }
195
- CallCombiner* call_combiner() const { return deadline_state_.call_combiner; }
263
+ void CreateDynamicCall();
196
264
 
197
- // State for handling deadlines.
198
- grpc_deadline_state deadline_state_;
265
+ static void RecvTrailingMetadataReadyForConfigSelectorCommitCallback(
266
+ void* arg, grpc_error_handle error);
199
267
 
200
268
  grpc_slice path_; // Request path.
269
+ grpc_call_context_element* call_context_;
201
270
  gpr_cycle_counter call_start_time_;
202
271
  Timestamp deadline_;
203
- grpc_call_context_element* call_context_;
204
272
 
205
- grpc_polling_entity* pollent_ = nullptr;
273
+ // State for handling deadlines.
274
+ grpc_deadline_state deadline_state_;
206
275
 
207
- grpc_closure resolution_done_closure_;
276
+ grpc_polling_entity* pollent_ = nullptr;
208
277
 
209
278
  // Accessed while holding ClientChannel::resolution_mu_.
210
- bool service_config_applied_ ABSL_GUARDED_BY(&ClientChannel::resolution_mu_) =
211
- false;
212
- bool queued_pending_resolver_result_
213
- ABSL_GUARDED_BY(&ClientChannel::resolution_mu_) = false;
214
- ClientChannel::ResolverQueuedCall resolver_queued_call_
215
- ABSL_GUARDED_BY(&ClientChannel::resolution_mu_);
216
279
  ResolverQueuedCallCanceller* resolver_call_canceller_
217
280
  ABSL_GUARDED_BY(&ClientChannel::resolution_mu_) = nullptr;
218
281
 
219
282
  grpc_closure* original_recv_trailing_metadata_ready_ = nullptr;
220
283
  grpc_closure recv_trailing_metadata_ready_;
221
284
 
222
- RefCountedPtr<DynamicFilters> dynamic_filters_;
223
285
  RefCountedPtr<DynamicFilters::Call> dynamic_call_;
224
286
 
225
287
  // Batches are added to this list when received from above.
@@ -238,13 +300,13 @@ class ClientChannel::CallData {
238
300
  //
239
301
 
240
302
  const grpc_channel_filter ClientChannel::kFilterVtable = {
241
- ClientChannel::CallData::StartTransportStreamOpBatch,
303
+ ClientChannel::FilterBasedCallData::StartTransportStreamOpBatch,
242
304
  nullptr,
243
305
  ClientChannel::StartTransportOp,
244
- sizeof(ClientChannel::CallData),
245
- ClientChannel::CallData::Init,
246
- ClientChannel::CallData::SetPollent,
247
- ClientChannel::CallData::Destroy,
306
+ sizeof(ClientChannel::FilterBasedCallData),
307
+ ClientChannel::FilterBasedCallData::Init,
308
+ ClientChannel::FilterBasedCallData::SetPollent,
309
+ ClientChannel::FilterBasedCallData::Destroy,
248
310
  sizeof(ClientChannel),
249
311
  ClientChannel::Init,
250
312
  grpc_channel_stack_no_post_init,
@@ -336,7 +398,7 @@ class DynamicTerminationFilter::CallData {
336
398
  calld->call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
337
399
  calld->lb_call_ = client_channel->CreateLoadBalancedCall(
338
400
  args, pollent, nullptr,
339
- service_config_call_data->call_dispatch_controller(),
401
+ [service_config_call_data]() { service_config_call_data->Commit(); },
340
402
  /*is_transparent_retry=*/false);
341
403
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
342
404
  gpr_log(GPR_INFO,
@@ -363,7 +425,7 @@ class DynamicTerminationFilter::CallData {
363
425
  CallCombiner* call_combiner_;
364
426
  grpc_call_context_element* call_context_;
365
427
 
366
- OrphanablePtr<ClientChannel::LoadBalancedCall> lb_call_;
428
+ OrphanablePtr<ClientChannel::FilterBasedLoadBalancedCall> lb_call_;
367
429
  };
368
430
 
369
431
  const grpc_channel_filter DynamicTerminationFilter::kFilterVtable = {
@@ -415,8 +477,8 @@ class ClientChannel::ResolverResultHandler : public Resolver::ResultHandler {
415
477
  //
416
478
 
417
479
  // This class is a wrapper for Subchannel that hides details of the
418
- // channel's implementation (such as the health check service name and
419
- // connected subchannel) from the LB policy API.
480
+ // channel's implementation (such as the connected subchannel) from the
481
+ // LB policy API.
420
482
  //
421
483
  // Note that no synchronization is needed here, because even if the
422
484
  // underlying subchannel is shared between channels, this wrapper will only
@@ -424,14 +486,12 @@ class ClientChannel::ResolverResultHandler : public Resolver::ResultHandler {
424
486
  // control plane work_serializer.
425
487
  class ClientChannel::SubchannelWrapper : public SubchannelInterface {
426
488
  public:
427
- SubchannelWrapper(ClientChannel* chand, RefCountedPtr<Subchannel> subchannel,
428
- absl::optional<std::string> health_check_service_name)
489
+ SubchannelWrapper(ClientChannel* chand, RefCountedPtr<Subchannel> subchannel)
429
490
  : SubchannelInterface(GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)
430
491
  ? "SubchannelWrapper"
431
492
  : nullptr),
432
493
  chand_(chand),
433
- subchannel_(std::move(subchannel)),
434
- health_check_service_name_(std::move(health_check_service_name)) {
494
+ subchannel_(std::move(subchannel)) {
435
495
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
436
496
  gpr_log(GPR_INFO,
437
497
  "chand=%p: creating subchannel wrapper %p for subchannel %p",
@@ -484,7 +544,6 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
484
544
  watcher_wrapper = new WatcherWrapper(std::move(watcher),
485
545
  Ref(DEBUG_LOCATION, "WatcherWrapper"));
486
546
  subchannel_->WatchConnectivityState(
487
- health_check_service_name_,
488
547
  RefCountedPtr<Subchannel::ConnectivityStateWatcherInterface>(
489
548
  watcher_wrapper));
490
549
  }
@@ -493,8 +552,7 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
493
552
  override ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
494
553
  auto it = watcher_map_.find(watcher);
495
554
  GPR_ASSERT(it != watcher_map_.end());
496
- subchannel_->CancelConnectivityStateWatch(health_check_service_name_,
497
- it->second);
555
+ subchannel_->CancelConnectivityStateWatch(it->second);
498
556
  watcher_map_.erase(it);
499
557
  }
500
558
 
@@ -520,20 +578,18 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
520
578
  }
521
579
 
522
580
  private:
523
- // Subchannel and SubchannelInterface have different interfaces for
524
- // their respective ConnectivityStateWatcherInterface classes.
525
- // The one in Subchannel updates the ConnectedSubchannel along with
526
- // the state, whereas the one in SubchannelInterface does not expose
527
- // the ConnectedSubchannel.
528
- //
529
- // This wrapper provides a bridge between the two. It implements
530
- // Subchannel::ConnectivityStateWatcherInterface and wraps
581
+ // This wrapper provides a bridge between the internal Subchannel API
582
+ // and the SubchannelInterface API that we expose to LB policies.
583
+ // It implements Subchannel::ConnectivityStateWatcherInterface and wraps
531
584
  // the instance of SubchannelInterface::ConnectivityStateWatcherInterface
532
585
  // that was passed in by the LB policy. We pass an instance of this
533
586
  // class to the underlying Subchannel, and when we get updates from
534
587
  // the subchannel, we pass those on to the wrapped watcher to return
535
- // the update to the LB policy. This allows us to set the connected
536
- // subchannel before passing the result back to the LB policy.
588
+ // the update to the LB policy.
589
+ //
590
+ // This class handles things like hopping into the WorkSerializer
591
+ // before passing notifications to the LB policy and propagating
592
+ // keepalive information betwen subchannels.
537
593
  class WatcherWrapper : public Subchannel::ConnectivityStateWatcherInterface {
538
594
  public:
539
595
  WatcherWrapper(
@@ -571,16 +627,7 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
571
627
  }
572
628
 
573
629
  grpc_pollset_set* interested_parties() override {
574
- SubchannelInterface::ConnectivityStateWatcherInterface* watcher =
575
- watcher_.get();
576
- if (watcher_ == nullptr) watcher = replacement_->watcher_.get();
577
- return watcher->interested_parties();
578
- }
579
-
580
- WatcherWrapper* MakeReplacement() {
581
- auto* replacement = new WatcherWrapper(std::move(watcher_), parent_);
582
- replacement_ = replacement;
583
- return replacement;
630
+ return watcher_->interested_parties();
584
631
  }
585
632
 
586
633
  private:
@@ -622,28 +669,22 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
622
669
  std::string(keepalive_throttling.value()).c_str());
623
670
  }
624
671
  }
625
- // Ignore update if the parent WatcherWrapper has been replaced
626
- // since this callback was scheduled.
627
- if (watcher_ != nullptr) {
628
- // Propagate status only in state TF.
629
- // We specifically want to avoid propagating the status for
630
- // state IDLE that the real subchannel gave us only for the
631
- // purpose of keepalive propagation.
632
- watcher_->OnConnectivityStateChange(
633
- state, state == GRPC_CHANNEL_TRANSIENT_FAILURE ? status
634
- : absl::OkStatus());
635
- }
672
+ // Propagate status only in state TF.
673
+ // We specifically want to avoid propagating the status for
674
+ // state IDLE that the real subchannel gave us only for the
675
+ // purpose of keepalive propagation.
676
+ watcher_->OnConnectivityStateChange(
677
+ state,
678
+ state == GRPC_CHANNEL_TRANSIENT_FAILURE ? status : absl::OkStatus());
636
679
  }
637
680
 
638
681
  std::unique_ptr<SubchannelInterface::ConnectivityStateWatcherInterface>
639
682
  watcher_;
640
683
  RefCountedPtr<SubchannelWrapper> parent_;
641
- WatcherWrapper* replacement_ = nullptr;
642
684
  };
643
685
 
644
686
  ClientChannel* chand_;
645
687
  RefCountedPtr<Subchannel> subchannel_;
646
- absl::optional<std::string> health_check_service_name_;
647
688
  // Maps from the address of the watcher passed to us by the LB policy
648
689
  // to the address of the WrapperWatcher that we passed to the underlying
649
690
  // subchannel. This is needed so that when the LB policy calls
@@ -856,13 +897,6 @@ class ClientChannel::ClientChannelControlHelper
856
897
  ServerAddress address, const ChannelArgs& args) override
857
898
  ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
858
899
  if (chand_->resolver_ == nullptr) return nullptr; // Shutting down.
859
- // Determine health check service name.
860
- absl::optional<std::string> health_check_service_name;
861
- if (!args.GetBool(GRPC_ARG_INHIBIT_HEALTH_CHECKING).value_or(false)) {
862
- health_check_service_name =
863
- args.GetOwnedString(GRPC_ARG_HEALTH_CHECK_SERVICE_NAME);
864
- }
865
- // Construct channel args for subchannel.
866
900
  ChannelArgs subchannel_args = ClientChannel::MakeSubchannelArgs(
867
901
  args, address.args(), chand_->subchannel_pool_,
868
902
  chand_->default_authority_);
@@ -874,8 +908,7 @@ class ClientChannel::ClientChannelControlHelper
874
908
  // Make sure the subchannel has updated keepalive time.
875
909
  subchannel->ThrottleKeepaliveTime(chand_->keepalive_time_);
876
910
  // Create and return wrapper for the subchannel.
877
- return MakeRefCounted<SubchannelWrapper>(
878
- chand_, std::move(subchannel), std::move(health_check_service_name));
911
+ return MakeRefCounted<SubchannelWrapper>(chand_, std::move(subchannel));
879
912
  }
880
913
 
881
914
  void UpdateState(grpc_connectivity_state state, const absl::Status& status,
@@ -1065,15 +1098,15 @@ ClientChannel::~ClientChannel() {
1065
1098
  grpc_pollset_set_destroy(interested_parties_);
1066
1099
  }
1067
1100
 
1068
- OrphanablePtr<ClientChannel::LoadBalancedCall>
1101
+ OrphanablePtr<ClientChannel::FilterBasedLoadBalancedCall>
1069
1102
  ClientChannel::CreateLoadBalancedCall(
1070
1103
  const grpc_call_element_args& args, grpc_polling_entity* pollent,
1071
1104
  grpc_closure* on_call_destruction_complete,
1072
- ConfigSelector::CallDispatchController* call_dispatch_controller,
1073
- bool is_transparent_retry) {
1074
- return OrphanablePtr<LoadBalancedCall>(args.arena->New<LoadBalancedCall>(
1075
- this, args, pollent, on_call_destruction_complete,
1076
- call_dispatch_controller, is_transparent_retry));
1105
+ absl::AnyInvocable<void()> on_commit, bool is_transparent_retry) {
1106
+ return OrphanablePtr<FilterBasedLoadBalancedCall>(
1107
+ args.arena->New<FilterBasedLoadBalancedCall>(
1108
+ this, args, pollent, on_call_destruction_complete,
1109
+ std::move(on_commit), is_transparent_retry));
1077
1110
  }
1078
1111
 
1079
1112
  ChannelArgs ClientChannel::MakeSubchannelArgs(
@@ -1099,6 +1132,14 @@ ChannelArgs ClientChannel::MakeSubchannelArgs(
1099
1132
  .Remove(GRPC_ARG_CHANNELZ_CHANNEL_NODE);
1100
1133
  }
1101
1134
 
1135
+ void ClientChannel::ReprocessQueuedResolverCalls() {
1136
+ for (CallData* calld : resolver_queued_calls_) {
1137
+ calld->RemoveCallFromResolverQueuedCallsLocked();
1138
+ calld->RetryCheckResolutionLocked();
1139
+ }
1140
+ resolver_queued_calls_.clear();
1141
+ }
1142
+
1102
1143
  namespace {
1103
1144
 
1104
1145
  RefCountedPtr<LoadBalancingPolicy::Config> ChooseLbPolicy(
@@ -1139,9 +1180,9 @@ RefCountedPtr<LoadBalancingPolicy::Config> ChooseLbPolicy(
1139
1180
  // above.
1140
1181
  if (!policy_name.has_value()) policy_name = "pick_first";
1141
1182
  // Now that we have the policy name, construct an empty config for it.
1142
- Json config_json = Json::Array{Json::Object{
1143
- {std::string(*policy_name), Json::Object{}},
1144
- }};
1183
+ Json config_json = Json::FromArray({Json::FromObject({
1184
+ {std::string(*policy_name), Json::FromObject({})},
1185
+ })});
1145
1186
  auto lb_policy_config =
1146
1187
  CoreConfiguration::Get().lb_policy_registry().ParseLoadBalancingConfig(
1147
1188
  config_json);
@@ -1305,26 +1346,16 @@ void ClientChannel::OnResolverErrorLocked(absl::Status status) {
1305
1346
  // result, then we continue to let it set the connectivity state.
1306
1347
  // Otherwise, we go into TRANSIENT_FAILURE.
1307
1348
  if (lb_policy_ == nullptr) {
1349
+ // Update connectivity state.
1350
+ UpdateStateLocked(GRPC_CHANNEL_TRANSIENT_FAILURE, status,
1351
+ "resolver failure");
1308
1352
  {
1309
1353
  MutexLock lock(&resolution_mu_);
1310
1354
  // Update resolver transient failure.
1311
1355
  resolver_transient_failure_error_ =
1312
1356
  MaybeRewriteIllegalStatusCode(status, "resolver");
1313
- // Process calls that were queued waiting for the resolver result.
1314
- for (ResolverQueuedCall* call = resolver_queued_calls_; call != nullptr;
1315
- call = call->next) {
1316
- grpc_call_element* elem = call->elem;
1317
- CallData* calld = static_cast<CallData*>(elem->call_data);
1318
- grpc_error_handle error;
1319
- if (calld->CheckResolutionLocked(elem, &error)) {
1320
- calld->AsyncResolutionDone(elem, error);
1321
- }
1322
- }
1357
+ ReprocessQueuedResolverCalls();
1323
1358
  }
1324
- // Update connectivity state.
1325
- UpdateStateAndPickerLocked(
1326
- GRPC_CHANNEL_TRANSIENT_FAILURE, status, "resolver failure",
1327
- MakeRefCounted<LoadBalancingPolicy::TransientFailurePicker>(status));
1328
1359
  }
1329
1360
  }
1330
1361
 
@@ -1361,6 +1392,14 @@ absl::Status ClientChannel::CreateOrUpdateLbPolicyLocked(
1361
1392
  // Creates a new LB policy.
1362
1393
  OrphanablePtr<LoadBalancingPolicy> ClientChannel::CreateLbPolicyLocked(
1363
1394
  const ChannelArgs& args) {
1395
+ // The LB policy will start in state CONNECTING but will not
1396
+ // necessarily send us an update synchronously, so set state to
1397
+ // CONNECTING (in case the resolver had previously failed and put the
1398
+ // channel into TRANSIENT_FAILURE) and make sure we have a queueing picker.
1399
+ UpdateStateAndPickerLocked(
1400
+ GRPC_CHANNEL_CONNECTING, absl::Status(), "started resolving",
1401
+ MakeRefCounted<LoadBalancingPolicy::QueuePicker>(nullptr));
1402
+ // Now create the LB policy.
1364
1403
  LoadBalancingPolicy::Args lb_policy_args;
1365
1404
  lb_policy_args.work_serializer = work_serializer_;
1366
1405
  lb_policy_args.channel_control_helper =
@@ -1378,30 +1417,6 @@ OrphanablePtr<LoadBalancingPolicy> ClientChannel::CreateLbPolicyLocked(
1378
1417
  return lb_policy;
1379
1418
  }
1380
1419
 
1381
- void ClientChannel::AddResolverQueuedCall(ResolverQueuedCall* call,
1382
- grpc_polling_entity* pollent) {
1383
- // Add call to queued calls list.
1384
- call->next = resolver_queued_calls_;
1385
- resolver_queued_calls_ = call;
1386
- // Add call's pollent to channel's interested_parties, so that I/O
1387
- // can be done under the call's CQ.
1388
- grpc_polling_entity_add_to_pollset_set(pollent, interested_parties_);
1389
- }
1390
-
1391
- void ClientChannel::RemoveResolverQueuedCall(ResolverQueuedCall* to_remove,
1392
- grpc_polling_entity* pollent) {
1393
- // Remove call's pollent from channel's interested_parties.
1394
- grpc_polling_entity_del_from_pollset_set(pollent, interested_parties_);
1395
- // Remove from queued calls list.
1396
- for (ResolverQueuedCall** call = &resolver_queued_calls_; *call != nullptr;
1397
- call = &(*call)->next) {
1398
- if (*call == to_remove) {
1399
- *call = to_remove->next;
1400
- return;
1401
- }
1402
- }
1403
- }
1404
-
1405
1420
  void ClientChannel::UpdateServiceConfigInControlPlaneLocked(
1406
1421
  RefCountedPtr<ServiceConfig> service_config,
1407
1422
  RefCountedPtr<ConfigSelector> config_selector, std::string lb_policy_name) {
@@ -1468,25 +1483,8 @@ void ClientChannel::UpdateServiceConfigInDataPlaneLocked() {
1468
1483
  service_config_.swap(service_config);
1469
1484
  config_selector_.swap(config_selector);
1470
1485
  dynamic_filters_.swap(dynamic_filters);
1471
- // Process calls that were queued waiting for the resolver result.
1472
- for (ResolverQueuedCall* call = resolver_queued_calls_; call != nullptr;
1473
- call = call->next) {
1474
- // If there are a lot of queued calls here, resuming them all may cause us
1475
- // to stay inside C-core for a long period of time. All of that work would
1476
- // be done using the same ExecCtx instance and therefore the same cached
1477
- // value of "now". The longer it takes to finish all of this work and exit
1478
- // from C-core, the more stale the cached value of "now" may become. This
1479
- // can cause problems whereby (e.g.) we calculate a timer deadline based
1480
- // on the stale value, which results in the timer firing too early. To
1481
- // avoid this, we invalidate the cached value for each call we process.
1482
- ExecCtx::Get()->InvalidateNow();
1483
- grpc_call_element* elem = call->elem;
1484
- CallData* calld = static_cast<CallData*>(elem->call_data);
1485
- grpc_error_handle error;
1486
- if (calld->CheckResolutionLocked(elem, &error)) {
1487
- calld->AsyncResolutionDone(elem, error);
1488
- }
1489
- }
1486
+ // Re-process queued calls asynchronously.
1487
+ ReprocessQueuedResolverCalls();
1490
1488
  }
1491
1489
  // Old values will be unreffed after lock is released when they go out
1492
1490
  // of scope.
@@ -1494,17 +1492,17 @@ void ClientChannel::UpdateServiceConfigInDataPlaneLocked() {
1494
1492
 
1495
1493
  void ClientChannel::CreateResolverLocked() {
1496
1494
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
1497
- gpr_log(GPR_INFO, "chand=%p: starting name resolution", this);
1495
+ gpr_log(GPR_INFO, "chand=%p: starting name resolution for %s", this,
1496
+ uri_to_resolve_.c_str());
1498
1497
  }
1499
1498
  resolver_ = CoreConfiguration::Get().resolver_registry().CreateResolver(
1500
- uri_to_resolve_.c_str(), channel_args_, interested_parties_,
1501
- work_serializer_, std::make_unique<ResolverResultHandler>(this));
1499
+ uri_to_resolve_, channel_args_, interested_parties_, work_serializer_,
1500
+ std::make_unique<ResolverResultHandler>(this));
1502
1501
  // Since the validity of the args was checked when the channel was created,
1503
1502
  // CreateResolver() must return a non-null result.
1504
1503
  GPR_ASSERT(resolver_ != nullptr);
1505
- UpdateStateAndPickerLocked(
1506
- GRPC_CHANNEL_CONNECTING, absl::Status(), "started resolving",
1507
- MakeRefCounted<LoadBalancingPolicy::QueuePicker>(nullptr));
1504
+ UpdateStateLocked(GRPC_CHANNEL_CONNECTING, absl::Status(),
1505
+ "started resolving");
1508
1506
  resolver_->StartLocked();
1509
1507
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
1510
1508
  gpr_log(GPR_INFO, "chand=%p: created resolver=%p", this, resolver_.get());
@@ -1518,24 +1516,7 @@ void ClientChannel::DestroyResolverAndLbPolicyLocked() {
1518
1516
  resolver_.get());
1519
1517
  }
1520
1518
  resolver_.reset();
1521
- if (lb_policy_ != nullptr) {
1522
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
1523
- gpr_log(GPR_INFO, "chand=%p: shutting down lb_policy=%p", this,
1524
- lb_policy_.get());
1525
- }
1526
- grpc_pollset_set_del_pollset_set(lb_policy_->interested_parties(),
1527
- interested_parties_);
1528
- lb_policy_.reset();
1529
- }
1530
- }
1531
- }
1532
-
1533
- void ClientChannel::UpdateStateAndPickerLocked(
1534
- grpc_connectivity_state state, const absl::Status& status,
1535
- const char* reason,
1536
- RefCountedPtr<LoadBalancingPolicy::SubchannelPicker> picker) {
1537
- // Special case for IDLE and SHUTDOWN states.
1538
- if (picker == nullptr || state == GRPC_CHANNEL_SHUTDOWN) {
1519
+ // Clear resolution state.
1539
1520
  saved_service_config_.reset();
1540
1521
  saved_config_selector_.reset();
1541
1522
  // Acquire resolution lock to update config selector and associated state.
@@ -1551,8 +1532,22 @@ void ClientChannel::UpdateStateAndPickerLocked(
1551
1532
  config_selector_to_unref = std::move(config_selector_);
1552
1533
  dynamic_filters_to_unref = std::move(dynamic_filters_);
1553
1534
  }
1535
+ // Clear LB policy if set.
1536
+ if (lb_policy_ != nullptr) {
1537
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
1538
+ gpr_log(GPR_INFO, "chand=%p: shutting down lb_policy=%p", this,
1539
+ lb_policy_.get());
1540
+ }
1541
+ grpc_pollset_set_del_pollset_set(lb_policy_->interested_parties(),
1542
+ interested_parties_);
1543
+ lb_policy_.reset();
1544
+ }
1554
1545
  }
1555
- // Update connectivity state.
1546
+ }
1547
+
1548
+ void ClientChannel::UpdateStateLocked(grpc_connectivity_state state,
1549
+ const absl::Status& status,
1550
+ const char* reason) {
1556
1551
  state_tracker_.SetState(state, status, reason);
1557
1552
  if (channelz_node_ != nullptr) {
1558
1553
  channelz_node_->SetConnectivityState(state);
@@ -1562,30 +1557,24 @@ void ClientChannel::UpdateStateAndPickerLocked(
1562
1557
  channelz::ChannelNode::GetChannelConnectivityStateChangeString(
1563
1558
  state)));
1564
1559
  }
1565
- // Grab data plane lock to update the picker.
1566
- {
1567
- MutexLock lock(&data_plane_mu_);
1568
- // Swap out the picker.
1569
- // Note: Original value will be destroyed after the lock is released.
1570
- picker_.swap(picker);
1571
- // Re-process queued picks.
1572
- for (LbQueuedCall* call = lb_queued_calls_; call != nullptr;
1573
- call = call->next) {
1574
- // If there are a lot of queued calls here, resuming them all may cause us
1575
- // to stay inside C-core for a long period of time. All of that work would
1576
- // be done using the same ExecCtx instance and therefore the same cached
1577
- // value of "now". The longer it takes to finish all of this work and exit
1578
- // from C-core, the more stale the cached value of "now" may become. This
1579
- // can cause problems whereby (e.g.) we calculate a timer deadline based
1580
- // on the stale value, which results in the timer firing too early. To
1581
- // avoid this, we invalidate the cached value for each call we process.
1582
- ExecCtx::Get()->InvalidateNow();
1583
- grpc_error_handle error;
1584
- if (call->lb_call->PickSubchannelLocked(&error)) {
1585
- call->lb_call->AsyncPickDone(error);
1586
- }
1587
- }
1560
+ }
1561
+
1562
+ void ClientChannel::UpdateStateAndPickerLocked(
1563
+ grpc_connectivity_state state, const absl::Status& status,
1564
+ const char* reason,
1565
+ RefCountedPtr<LoadBalancingPolicy::SubchannelPicker> picker) {
1566
+ UpdateStateLocked(state, status, reason);
1567
+ // Grab the LB lock to update the picker and trigger reprocessing of the
1568
+ // queued picks.
1569
+ // Old picker will be unreffed after releasing the lock.
1570
+ MutexLock lock(&lb_mu_);
1571
+ picker_.swap(picker);
1572
+ // Reprocess queued picks.
1573
+ for (LoadBalancedCall* call : lb_queued_calls_) {
1574
+ call->RemoveCallFromLbQueuedCallsLocked();
1575
+ call->RetryPickLocked();
1588
1576
  }
1577
+ lb_queued_calls_.clear();
1589
1578
  }
1590
1579
 
1591
1580
  namespace {
@@ -1628,7 +1617,7 @@ grpc_error_handle ClientChannel::DoPingLocked(grpc_transport_op* op) {
1628
1617
  }
1629
1618
  LoadBalancingPolicy::PickResult result;
1630
1619
  {
1631
- MutexLock lock(&data_plane_mu_);
1620
+ MutexLock lock(&lb_mu_);
1632
1621
  result = picker_->Pick(LoadBalancingPolicy::PickArgs());
1633
1622
  }
1634
1623
  return HandlePickResult<grpc_error_handle>(
@@ -1699,10 +1688,13 @@ void ClientChannel::StartTransportOpLocked(grpc_transport_op* op) {
1699
1688
  StatusIntProperty::ChannelConnectivityState,
1700
1689
  &value) &&
1701
1690
  static_cast<grpc_connectivity_state>(value) == GRPC_CHANNEL_IDLE) {
1702
- if (disconnect_error_.ok()) {
1691
+ if (disconnect_error_.ok()) { // Ignore if we're shutting down.
1703
1692
  // Enter IDLE state.
1704
1693
  UpdateStateAndPickerLocked(GRPC_CHANNEL_IDLE, absl::Status(),
1705
1694
  "channel entering IDLE", nullptr);
1695
+ // TODO(roth): Do we need to check for any queued picks here, in
1696
+ // case there's a race condition in the client_idle filter?
1697
+ // And maybe also check for calls in the resolver queue?
1706
1698
  }
1707
1699
  } else {
1708
1700
  // Disconnect.
@@ -1712,6 +1704,9 @@ void ClientChannel::StartTransportOpLocked(grpc_transport_op* op) {
1712
1704
  GRPC_CHANNEL_SHUTDOWN, absl::Status(), "shutdown from API",
1713
1705
  MakeRefCounted<LoadBalancingPolicy::TransientFailurePicker>(
1714
1706
  grpc_error_to_absl_status(op->disconnect_with_error)));
1707
+ // TODO(roth): If this happens when we're still waiting for a
1708
+ // resolver result, we need to trigger failures for all calls in
1709
+ // the resolver queue here.
1715
1710
  }
1716
1711
  }
1717
1712
  GRPC_CHANNEL_STACK_UNREF(owning_stack_, "start_transport_op");
@@ -1748,30 +1743,6 @@ void ClientChannel::GetChannelInfo(grpc_channel_element* elem,
1748
1743
  }
1749
1744
  }
1750
1745
 
1751
- void ClientChannel::AddLbQueuedCall(LbQueuedCall* call,
1752
- grpc_polling_entity* pollent) {
1753
- // Add call to queued picks list.
1754
- call->next = lb_queued_calls_;
1755
- lb_queued_calls_ = call;
1756
- // Add call's pollent to channel's interested_parties, so that I/O
1757
- // can be done under the call's CQ.
1758
- grpc_polling_entity_add_to_pollset_set(pollent, interested_parties_);
1759
- }
1760
-
1761
- void ClientChannel::RemoveLbQueuedCall(LbQueuedCall* to_remove,
1762
- grpc_polling_entity* pollent) {
1763
- // Remove call's pollent from channel's interested_parties.
1764
- grpc_polling_entity_del_from_pollset_set(pollent, interested_parties_);
1765
- // Remove from queued picks list.
1766
- for (LbQueuedCall** call = &lb_queued_calls_; *call != nullptr;
1767
- call = &(*call)->next) {
1768
- if (*call == to_remove) {
1769
- *call = to_remove->next;
1770
- return;
1771
- }
1772
- }
1773
- }
1774
-
1775
1746
  void ClientChannel::TryToConnectLocked() {
1776
1747
  if (lb_policy_ != nullptr) {
1777
1748
  lb_policy_->ExitIdleLocked();
@@ -1812,23 +1783,177 @@ void ClientChannel::RemoveConnectivityWatcher(
1812
1783
  // CallData implementation
1813
1784
  //
1814
1785
 
1815
- ClientChannel::CallData::CallData(grpc_call_element* elem,
1816
- const ClientChannel& chand,
1817
- const grpc_call_element_args& args)
1818
- : deadline_state_(elem, args,
1819
- GPR_LIKELY(chand.deadline_checking_enabled_)
1820
- ? args.deadline
1821
- : Timestamp::InfFuture()),
1822
- path_(CSliceRef(args.path)),
1786
+ void ClientChannel::CallData::RemoveCallFromResolverQueuedCallsLocked() {
1787
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
1788
+ gpr_log(GPR_INFO,
1789
+ "chand=%p calld=%p: removing from resolver queued picks list",
1790
+ chand(), this);
1791
+ }
1792
+ // Remove call's pollent from channel's interested_parties.
1793
+ grpc_polling_entity_del_from_pollset_set(pollent(),
1794
+ chand()->interested_parties_);
1795
+ // Note: There's no need to actually remove the call from the queue
1796
+ // here, because that will be done in
1797
+ // ResolverQueuedCallCanceller::CancelLocked() or
1798
+ // ClientChannel::ReprocessQueuedResolverCalls().
1799
+ }
1800
+
1801
+ void ClientChannel::CallData::AddCallToResolverQueuedCallsLocked() {
1802
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
1803
+ gpr_log(GPR_INFO, "chand=%p calld=%p: adding to resolver queued picks list",
1804
+ chand(), this);
1805
+ }
1806
+ // Add call's pollent to channel's interested_parties, so that I/O
1807
+ // can be done under the call's CQ.
1808
+ grpc_polling_entity_add_to_pollset_set(pollent(),
1809
+ chand()->interested_parties_);
1810
+ // Add to queue.
1811
+ chand()->resolver_queued_calls_.insert(this);
1812
+ OnAddToQueueLocked();
1813
+ }
1814
+
1815
+ grpc_error_handle ClientChannel::CallData::ApplyServiceConfigToCallLocked(
1816
+ const absl::StatusOr<RefCountedPtr<ConfigSelector>>& config_selector) {
1817
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
1818
+ gpr_log(GPR_INFO, "chand=%p calld=%p: applying service config to call",
1819
+ chand(), this);
1820
+ }
1821
+ if (!config_selector.ok()) return config_selector.status();
1822
+ // Create a ClientChannelServiceConfigCallData for the call. This stores
1823
+ // a ref to the ServiceConfig and caches the right set of parsed configs
1824
+ // to use for the call. The ClientChannelServiceConfigCallData will store
1825
+ // itself in the call context, so that it can be accessed by filters
1826
+ // below us in the stack, and it will be cleaned up when the call ends.
1827
+ auto* service_config_call_data =
1828
+ arena()->New<ClientChannelServiceConfigCallData>(arena(), call_context());
1829
+ // Use the ConfigSelector to determine the config for the call.
1830
+ absl::Status call_config_status =
1831
+ (*config_selector)
1832
+ ->GetCallConfig(
1833
+ {send_initial_metadata(), arena(), service_config_call_data});
1834
+ if (!call_config_status.ok()) {
1835
+ return absl_status_to_grpc_error(
1836
+ MaybeRewriteIllegalStatusCode(call_config_status, "ConfigSelector"));
1837
+ }
1838
+ // Apply our own method params to the call.
1839
+ auto* method_params = static_cast<ClientChannelMethodParsedConfig*>(
1840
+ service_config_call_data->GetMethodParsedConfig(
1841
+ chand()->service_config_parser_index_));
1842
+ if (method_params != nullptr) {
1843
+ // If the deadline from the service config is shorter than the one
1844
+ // from the client API, reset the deadline timer.
1845
+ if (chand()->deadline_checking_enabled_ &&
1846
+ method_params->timeout() != Duration::Zero()) {
1847
+ ResetDeadline(method_params->timeout());
1848
+ }
1849
+ // If the service config set wait_for_ready and the application
1850
+ // did not explicitly set it, use the value from the service config.
1851
+ auto* wait_for_ready =
1852
+ send_initial_metadata()->GetOrCreatePointer(WaitForReady());
1853
+ if (method_params->wait_for_ready().has_value() &&
1854
+ !wait_for_ready->explicitly_set) {
1855
+ wait_for_ready->value = method_params->wait_for_ready().value();
1856
+ }
1857
+ }
1858
+ return absl::OkStatus();
1859
+ }
1860
+
1861
+ absl::optional<absl::Status> ClientChannel::CallData::CheckResolution(
1862
+ bool was_queued) {
1863
+ // Check if we have a resolver result to use.
1864
+ absl::StatusOr<RefCountedPtr<ConfigSelector>> config_selector;
1865
+ {
1866
+ MutexLock lock(&chand()->resolution_mu_);
1867
+ bool result_ready = CheckResolutionLocked(&config_selector);
1868
+ // If no result is available, queue the call.
1869
+ if (!result_ready) {
1870
+ AddCallToResolverQueuedCallsLocked();
1871
+ return absl::nullopt;
1872
+ }
1873
+ }
1874
+ // We have a result. Apply service config to call.
1875
+ grpc_error_handle error = ApplyServiceConfigToCallLocked(config_selector);
1876
+ // ConfigSelector must be unreffed inside the WorkSerializer.
1877
+ if (config_selector.ok()) {
1878
+ chand()->work_serializer_->Run(
1879
+ [config_selector = std::move(*config_selector)]() mutable {
1880
+ config_selector.reset();
1881
+ },
1882
+ DEBUG_LOCATION);
1883
+ }
1884
+ // Handle errors.
1885
+ if (!error.ok()) {
1886
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
1887
+ gpr_log(GPR_INFO,
1888
+ "chand=%p calld=%p: error applying config to call: error=%s",
1889
+ chand(), this, StatusToString(error).c_str());
1890
+ }
1891
+ return error;
1892
+ }
1893
+ // If the call was queued, add trace annotation.
1894
+ if (was_queued) {
1895
+ auto* call_tracer = static_cast<CallTracerAnnotationInterface*>(
1896
+ call_context()[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE].value);
1897
+ if (call_tracer != nullptr) {
1898
+ call_tracer->RecordAnnotation("Delayed name resolution complete.");
1899
+ }
1900
+ }
1901
+ return absl::OkStatus();
1902
+ }
1903
+
1904
+ bool ClientChannel::CallData::CheckResolutionLocked(
1905
+ absl::StatusOr<RefCountedPtr<ConfigSelector>>* config_selector) {
1906
+ // If we don't yet have a resolver result, we need to queue the call
1907
+ // until we get one.
1908
+ if (GPR_UNLIKELY(!chand()->received_service_config_data_)) {
1909
+ // If the resolver returned transient failure before returning the
1910
+ // first service config, fail any non-wait_for_ready calls.
1911
+ absl::Status resolver_error = chand()->resolver_transient_failure_error_;
1912
+ if (!resolver_error.ok() &&
1913
+ !send_initial_metadata()->GetOrCreatePointer(WaitForReady())->value) {
1914
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
1915
+ gpr_log(GPR_INFO, "chand=%p calld=%p: resolution failed, failing call",
1916
+ chand(), this);
1917
+ }
1918
+ *config_selector = absl_status_to_grpc_error(resolver_error);
1919
+ return true;
1920
+ }
1921
+ // Either the resolver has not yet returned a result, or it has
1922
+ // returned transient failure but the call is wait_for_ready. In
1923
+ // either case, queue the call.
1924
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
1925
+ gpr_log(GPR_INFO, "chand=%p calld=%p: no resolver result yet", chand(),
1926
+ this);
1927
+ }
1928
+ return false;
1929
+ }
1930
+ // Result found.
1931
+ *config_selector = chand()->config_selector_;
1932
+ dynamic_filters_ = chand()->dynamic_filters_;
1933
+ return true;
1934
+ }
1935
+
1936
+ //
1937
+ // FilterBasedCallData implementation
1938
+ //
1939
+
1940
+ ClientChannel::FilterBasedCallData::FilterBasedCallData(
1941
+ grpc_call_element* elem, const grpc_call_element_args& args)
1942
+ : path_(CSliceRef(args.path)),
1943
+ call_context_(args.context),
1823
1944
  call_start_time_(args.start_time),
1824
1945
  deadline_(args.deadline),
1825
- call_context_(args.context) {
1946
+ deadline_state_(elem, args,
1947
+ GPR_LIKELY(static_cast<ClientChannel*>(elem->channel_data)
1948
+ ->deadline_checking_enabled_)
1949
+ ? args.deadline
1950
+ : Timestamp::InfFuture()) {
1826
1951
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
1827
- gpr_log(GPR_INFO, "chand=%p calld=%p: created call", &chand, this);
1952
+ gpr_log(GPR_INFO, "chand=%p calld=%p: created call", chand(), this);
1828
1953
  }
1829
1954
  }
1830
1955
 
1831
- ClientChannel::CallData::~CallData() {
1956
+ ClientChannel::FilterBasedCallData::~FilterBasedCallData() {
1832
1957
  CSliceUnref(path_);
1833
1958
  // Make sure there are no remaining pending batches.
1834
1959
  for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
@@ -1836,20 +1961,19 @@ ClientChannel::CallData::~CallData() {
1836
1961
  }
1837
1962
  }
1838
1963
 
1839
- grpc_error_handle ClientChannel::CallData::Init(
1964
+ grpc_error_handle ClientChannel::FilterBasedCallData::Init(
1840
1965
  grpc_call_element* elem, const grpc_call_element_args* args) {
1841
- ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
1842
- new (elem->call_data) CallData(elem, *chand, *args);
1966
+ new (elem->call_data) FilterBasedCallData(elem, *args);
1843
1967
  return absl::OkStatus();
1844
1968
  }
1845
1969
 
1846
- void ClientChannel::CallData::Destroy(
1970
+ void ClientChannel::FilterBasedCallData::Destroy(
1847
1971
  grpc_call_element* elem, const grpc_call_final_info* /*final_info*/,
1848
1972
  grpc_closure* then_schedule_closure) {
1849
- CallData* calld = static_cast<CallData*>(elem->call_data);
1973
+ auto* calld = static_cast<FilterBasedCallData*>(elem->call_data);
1850
1974
  RefCountedPtr<DynamicFilters::Call> dynamic_call =
1851
1975
  std::move(calld->dynamic_call_);
1852
- calld->~CallData();
1976
+ calld->~FilterBasedCallData();
1853
1977
  if (GPR_LIKELY(dynamic_call != nullptr)) {
1854
1978
  dynamic_call->SetAfterCallStackDestroy(then_schedule_closure);
1855
1979
  } else {
@@ -1858,28 +1982,27 @@ void ClientChannel::CallData::Destroy(
1858
1982
  }
1859
1983
  }
1860
1984
 
1861
- void ClientChannel::CallData::StartTransportStreamOpBatch(
1985
+ void ClientChannel::FilterBasedCallData::StartTransportStreamOpBatch(
1862
1986
  grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
1863
- CallData* calld = static_cast<CallData*>(elem->call_data);
1987
+ auto* calld = static_cast<FilterBasedCallData*>(elem->call_data);
1864
1988
  ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
1865
1989
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace) &&
1866
1990
  !GRPC_TRACE_FLAG_ENABLED(grpc_trace_channel)) {
1867
1991
  gpr_log(GPR_INFO, "chand=%p calld=%p: batch started from above: %s", chand,
1868
- calld, grpc_transport_stream_op_batch_string(batch).c_str());
1992
+ calld, grpc_transport_stream_op_batch_string(batch, false).c_str());
1869
1993
  }
1870
1994
  if (GPR_LIKELY(chand->deadline_checking_enabled_)) {
1871
1995
  grpc_deadline_state_client_start_transport_stream_op_batch(
1872
1996
  &calld->deadline_state_, batch);
1873
1997
  }
1874
- // Intercept recv_trailing_metadata to call CallDispatchController::Commit(),
1875
- // in case we wind up failing the call before we get down to the retry
1876
- // or LB call layer.
1998
+ // Intercept recv_trailing_metadata to commit the call, in case we wind up
1999
+ // failing the call before we get down to the retry or LB call layer.
1877
2000
  if (batch->recv_trailing_metadata) {
1878
2001
  calld->original_recv_trailing_metadata_ready_ =
1879
2002
  batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready;
1880
2003
  GRPC_CLOSURE_INIT(&calld->recv_trailing_metadata_ready_,
1881
2004
  RecvTrailingMetadataReadyForConfigSelectorCommitCallback,
1882
- elem, nullptr);
2005
+ calld, nullptr);
1883
2006
  batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready =
1884
2007
  &calld->recv_trailing_metadata_ready_;
1885
2008
  }
@@ -1920,14 +2043,14 @@ void ClientChannel::CallData::StartTransportStreamOpBatch(
1920
2043
  calld, StatusToString(calld->cancel_error_).c_str());
1921
2044
  }
1922
2045
  // Fail all pending batches.
1923
- calld->PendingBatchesFail(elem, calld->cancel_error_, NoYieldCallCombiner);
2046
+ calld->PendingBatchesFail(calld->cancel_error_, NoYieldCallCombiner);
1924
2047
  // Note: This will release the call combiner.
1925
2048
  grpc_transport_stream_op_batch_finish_with_failure(
1926
2049
  batch, calld->cancel_error_, calld->call_combiner());
1927
2050
  return;
1928
2051
  }
1929
2052
  // Add the batch to the pending list.
1930
- calld->PendingBatchesAdd(elem, batch);
2053
+ calld->PendingBatchesAdd(batch);
1931
2054
  // For batches containing a send_initial_metadata op, acquire the
1932
2055
  // channel's resolution mutex to apply the service config to the call,
1933
2056
  // after which we will create a dynamic call.
@@ -1938,7 +2061,23 @@ void ClientChannel::CallData::StartTransportStreamOpBatch(
1938
2061
  "config",
1939
2062
  chand, calld);
1940
2063
  }
1941
- CheckResolution(elem, absl::OkStatus());
2064
+ // If we're still in IDLE, we need to start resolving.
2065
+ if (GPR_UNLIKELY(chand->CheckConnectivityState(false) ==
2066
+ GRPC_CHANNEL_IDLE)) {
2067
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2068
+ gpr_log(GPR_INFO, "chand=%p calld=%p: triggering exit idle", chand,
2069
+ calld);
2070
+ }
2071
+ // Bounce into the control plane work serializer to start resolving.
2072
+ GRPC_CHANNEL_STACK_REF(chand->owning_stack_, "ExitIdle");
2073
+ chand->work_serializer_->Run(
2074
+ [chand]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand->work_serializer_) {
2075
+ chand->CheckConnectivityState(/*try_to_connect=*/true);
2076
+ GRPC_CHANNEL_STACK_UNREF(chand->owning_stack_, "ExitIdle");
2077
+ },
2078
+ DEBUG_LOCATION);
2079
+ }
2080
+ calld->TryCheckResolution(/*was_queued=*/false);
1942
2081
  } else {
1943
2082
  // For all other batches, release the call combiner.
1944
2083
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
@@ -1951,21 +2090,16 @@ void ClientChannel::CallData::StartTransportStreamOpBatch(
1951
2090
  }
1952
2091
  }
1953
2092
 
1954
- void ClientChannel::CallData::SetPollent(grpc_call_element* elem,
1955
- grpc_polling_entity* pollent) {
1956
- CallData* calld = static_cast<CallData*>(elem->call_data);
2093
+ void ClientChannel::FilterBasedCallData::SetPollent(
2094
+ grpc_call_element* elem, grpc_polling_entity* pollent) {
2095
+ auto* calld = static_cast<FilterBasedCallData*>(elem->call_data);
1957
2096
  calld->pollent_ = pollent;
1958
2097
  }
1959
2098
 
1960
- //
1961
- // pending_batches management
1962
- //
1963
-
1964
- size_t ClientChannel::CallData::GetBatchIndex(
2099
+ size_t ClientChannel::FilterBasedCallData::GetBatchIndex(
1965
2100
  grpc_transport_stream_op_batch* batch) {
1966
2101
  // Note: It is important the send_initial_metadata be the first entry
1967
- // here, since the code in ApplyServiceConfigToCallLocked() and
1968
- // CheckResolutionLocked() assumes it will be.
2102
+ // here, since the code in CheckResolution() assumes it will be.
1969
2103
  if (batch->send_initial_metadata) return 0;
1970
2104
  if (batch->send_message) return 1;
1971
2105
  if (batch->send_trailing_metadata) return 2;
@@ -1976,14 +2110,13 @@ size_t ClientChannel::CallData::GetBatchIndex(
1976
2110
  }
1977
2111
 
1978
2112
  // This is called via the call combiner, so access to calld is synchronized.
1979
- void ClientChannel::CallData::PendingBatchesAdd(
1980
- grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
1981
- ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
2113
+ void ClientChannel::FilterBasedCallData::PendingBatchesAdd(
2114
+ grpc_transport_stream_op_batch* batch) {
1982
2115
  const size_t idx = GetBatchIndex(batch);
1983
2116
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
1984
2117
  gpr_log(GPR_INFO,
1985
- "chand=%p calld=%p: adding pending batch at index %" PRIuPTR, chand,
1986
- this, idx);
2118
+ "chand=%p calld=%p: adding pending batch at index %" PRIuPTR,
2119
+ chand(), this, idx);
1987
2120
  }
1988
2121
  grpc_transport_stream_op_batch*& pending = pending_batches_[idx];
1989
2122
  GPR_ASSERT(pending == nullptr);
@@ -1991,19 +2124,20 @@ void ClientChannel::CallData::PendingBatchesAdd(
1991
2124
  }
1992
2125
 
1993
2126
  // This is called via the call combiner, so access to calld is synchronized.
1994
- void ClientChannel::CallData::FailPendingBatchInCallCombiner(
2127
+ void ClientChannel::FilterBasedCallData::FailPendingBatchInCallCombiner(
1995
2128
  void* arg, grpc_error_handle error) {
1996
2129
  grpc_transport_stream_op_batch* batch =
1997
2130
  static_cast<grpc_transport_stream_op_batch*>(arg);
1998
- CallData* calld = static_cast<CallData*>(batch->handler_private.extra_arg);
2131
+ auto* calld =
2132
+ static_cast<FilterBasedCallData*>(batch->handler_private.extra_arg);
1999
2133
  // Note: This will release the call combiner.
2000
2134
  grpc_transport_stream_op_batch_finish_with_failure(batch, error,
2001
2135
  calld->call_combiner());
2002
2136
  }
2003
2137
 
2004
2138
  // This is called via the call combiner, so access to calld is synchronized.
2005
- void ClientChannel::CallData::PendingBatchesFail(
2006
- grpc_call_element* elem, grpc_error_handle error,
2139
+ void ClientChannel::FilterBasedCallData::PendingBatchesFail(
2140
+ grpc_error_handle error,
2007
2141
  YieldCallCombinerPredicate yield_call_combiner_predicate) {
2008
2142
  GPR_ASSERT(!error.ok());
2009
2143
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
@@ -2011,9 +2145,9 @@ void ClientChannel::CallData::PendingBatchesFail(
2011
2145
  for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
2012
2146
  if (pending_batches_[i] != nullptr) ++num_batches;
2013
2147
  }
2014
- gpr_log(
2015
- GPR_INFO, "chand=%p calld=%p: failing %" PRIuPTR " pending batches: %s",
2016
- elem->channel_data, this, num_batches, StatusToString(error).c_str());
2148
+ gpr_log(GPR_INFO,
2149
+ "chand=%p calld=%p: failing %" PRIuPTR " pending batches: %s",
2150
+ chand(), this, num_batches, StatusToString(error).c_str());
2017
2151
  }
2018
2152
  CallCombinerClosureList closures;
2019
2153
  for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
@@ -2036,20 +2170,18 @@ void ClientChannel::CallData::PendingBatchesFail(
2036
2170
  }
2037
2171
 
2038
2172
  // This is called via the call combiner, so access to calld is synchronized.
2039
- void ClientChannel::CallData::ResumePendingBatchInCallCombiner(
2173
+ void ClientChannel::FilterBasedCallData::ResumePendingBatchInCallCombiner(
2040
2174
  void* arg, grpc_error_handle /*ignored*/) {
2041
2175
  grpc_transport_stream_op_batch* batch =
2042
2176
  static_cast<grpc_transport_stream_op_batch*>(arg);
2043
- auto* elem =
2044
- static_cast<grpc_call_element*>(batch->handler_private.extra_arg);
2045
- auto* calld = static_cast<CallData*>(elem->call_data);
2177
+ auto* calld =
2178
+ static_cast<FilterBasedCallData*>(batch->handler_private.extra_arg);
2046
2179
  // Note: This will release the call combiner.
2047
2180
  calld->dynamic_call_->StartTransportStreamOpBatch(batch);
2048
2181
  }
2049
2182
 
2050
2183
  // This is called via the call combiner, so access to calld is synchronized.
2051
- void ClientChannel::CallData::PendingBatchesResume(grpc_call_element* elem) {
2052
- ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
2184
+ void ClientChannel::FilterBasedCallData::PendingBatchesResume() {
2053
2185
  // Retries not enabled; send down batches as-is.
2054
2186
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2055
2187
  size_t num_batches = 0;
@@ -2059,13 +2191,13 @@ void ClientChannel::CallData::PendingBatchesResume(grpc_call_element* elem) {
2059
2191
  gpr_log(GPR_INFO,
2060
2192
  "chand=%p calld=%p: starting %" PRIuPTR
2061
2193
  " pending batches on dynamic_call=%p",
2062
- chand, this, num_batches, dynamic_call_.get());
2194
+ chand(), this, num_batches, dynamic_call_.get());
2063
2195
  }
2064
2196
  CallCombinerClosureList closures;
2065
2197
  for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
2066
2198
  grpc_transport_stream_op_batch*& batch = pending_batches_[i];
2067
2199
  if (batch != nullptr) {
2068
- batch->handler_private.extra_arg = elem;
2200
+ batch->handler_private.extra_arg = this;
2069
2201
  GRPC_CLOSURE_INIT(&batch->handler_private.closure,
2070
2202
  ResumePendingBatchInCallCombiner, batch, nullptr);
2071
2203
  closures.Add(&batch->handler_private.closure, absl::OkStatus(),
@@ -2077,16 +2209,12 @@ void ClientChannel::CallData::PendingBatchesResume(grpc_call_element* elem) {
2077
2209
  closures.RunClosures(call_combiner());
2078
2210
  }
2079
2211
 
2080
- //
2081
- // name resolution
2082
- //
2083
-
2084
2212
  // A class to handle the call combiner cancellation callback for a
2085
2213
  // queued pick.
2086
- class ClientChannel::CallData::ResolverQueuedCallCanceller {
2214
+ class ClientChannel::FilterBasedCallData::ResolverQueuedCallCanceller {
2087
2215
  public:
2088
- explicit ResolverQueuedCallCanceller(grpc_call_element* elem) : elem_(elem) {
2089
- auto* calld = static_cast<CallData*>(elem->call_data);
2216
+ explicit ResolverQueuedCallCanceller(FilterBasedCallData* calld)
2217
+ : calld_(calld) {
2090
2218
  GRPC_CALL_STACK_REF(calld->owning_call(), "ResolverQueuedCallCanceller");
2091
2219
  GRPC_CLOSURE_INIT(&closure_, &CancelLocked, this,
2092
2220
  grpc_schedule_on_exec_ctx);
@@ -2096,8 +2224,8 @@ class ClientChannel::CallData::ResolverQueuedCallCanceller {
2096
2224
  private:
2097
2225
  static void CancelLocked(void* arg, grpc_error_handle error) {
2098
2226
  auto* self = static_cast<ResolverQueuedCallCanceller*>(arg);
2099
- auto* chand = static_cast<ClientChannel*>(self->elem_->channel_data);
2100
- auto* calld = static_cast<CallData*>(self->elem_->call_data);
2227
+ auto* calld = self->calld_;
2228
+ auto* chand = calld->chand();
2101
2229
  {
2102
2230
  MutexLock lock(&chand->resolution_mu_);
2103
2231
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
@@ -2109,9 +2237,10 @@ class ClientChannel::CallData::ResolverQueuedCallCanceller {
2109
2237
  }
2110
2238
  if (calld->resolver_call_canceller_ == self && !error.ok()) {
2111
2239
  // Remove pick from list of queued picks.
2112
- calld->MaybeRemoveCallFromResolverQueuedCallsLocked(self->elem_);
2240
+ calld->RemoveCallFromResolverQueuedCallsLocked();
2241
+ chand->resolver_queued_calls_.erase(calld);
2113
2242
  // Fail pending batches on the call.
2114
- calld->PendingBatchesFail(self->elem_, error,
2243
+ calld->PendingBatchesFail(error,
2115
2244
  YieldCallCombinerIfPendingBatchesFound);
2116
2245
  }
2117
2246
  }
@@ -2119,115 +2248,71 @@ class ClientChannel::CallData::ResolverQueuedCallCanceller {
2119
2248
  delete self;
2120
2249
  }
2121
2250
 
2122
- grpc_call_element* elem_;
2251
+ FilterBasedCallData* calld_;
2123
2252
  grpc_closure closure_;
2124
2253
  };
2125
2254
 
2126
- void ClientChannel::CallData::MaybeRemoveCallFromResolverQueuedCallsLocked(
2127
- grpc_call_element* elem) {
2128
- if (!queued_pending_resolver_result_) return;
2129
- auto* chand = static_cast<ClientChannel*>(elem->channel_data);
2130
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2131
- gpr_log(GPR_INFO,
2132
- "chand=%p calld=%p: removing from resolver queued picks list",
2133
- chand, this);
2134
- }
2135
- chand->RemoveResolverQueuedCall(&resolver_queued_call_, pollent_);
2136
- queued_pending_resolver_result_ = false;
2137
- // Lame the call combiner canceller.
2138
- resolver_call_canceller_ = nullptr;
2139
- // Add trace annotation
2140
- auto* call_tracer =
2141
- static_cast<CallTracer*>(call_context_[GRPC_CONTEXT_CALL_TRACER].value);
2142
- if (call_tracer != nullptr) {
2143
- call_tracer->RecordAnnotation("Delayed name resolution complete.");
2255
+ void ClientChannel::FilterBasedCallData::TryCheckResolution(bool was_queued) {
2256
+ auto result = CheckResolution(was_queued);
2257
+ if (result.has_value()) {
2258
+ if (!result->ok()) {
2259
+ PendingBatchesFail(*result, YieldCallCombiner);
2260
+ return;
2261
+ }
2262
+ CreateDynamicCall();
2144
2263
  }
2145
2264
  }
2146
2265
 
2147
- void ClientChannel::CallData::MaybeAddCallToResolverQueuedCallsLocked(
2148
- grpc_call_element* elem) {
2149
- if (queued_pending_resolver_result_) return;
2150
- auto* chand = static_cast<ClientChannel*>(elem->channel_data);
2151
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2152
- gpr_log(GPR_INFO, "chand=%p calld=%p: adding to resolver queued picks list",
2153
- chand, this);
2154
- }
2155
- queued_pending_resolver_result_ = true;
2156
- resolver_queued_call_.elem = elem;
2157
- chand->AddResolverQueuedCall(&resolver_queued_call_, pollent_);
2266
+ void ClientChannel::FilterBasedCallData::OnAddToQueueLocked() {
2158
2267
  // Register call combiner cancellation callback.
2159
- resolver_call_canceller_ = new ResolverQueuedCallCanceller(elem);
2268
+ resolver_call_canceller_ = new ResolverQueuedCallCanceller(this);
2160
2269
  }
2161
2270
 
2162
- grpc_error_handle ClientChannel::CallData::ApplyServiceConfigToCallLocked(
2163
- grpc_call_element* elem, grpc_metadata_batch* initial_metadata) {
2164
- ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
2271
+ void ClientChannel::FilterBasedCallData::RetryCheckResolutionLocked() {
2272
+ // Lame the call combiner canceller.
2273
+ resolver_call_canceller_ = nullptr;
2274
+ // Do an async callback to resume call processing, so that we're not
2275
+ // doing it while holding the channel's resolution mutex.
2276
+ chand()->owning_stack_->EventEngine()->Run([this]() {
2277
+ ApplicationCallbackExecCtx application_exec_ctx;
2278
+ ExecCtx exec_ctx;
2279
+ TryCheckResolution(/*was_queued=*/true);
2280
+ });
2281
+ }
2282
+
2283
+ void ClientChannel::FilterBasedCallData::CreateDynamicCall() {
2284
+ DynamicFilters::Call::Args args = {dynamic_filters(), pollent_, path_,
2285
+ call_start_time_, deadline_, arena(),
2286
+ call_context_, call_combiner()};
2287
+ grpc_error_handle error;
2288
+ DynamicFilters* channel_stack = args.channel_stack.get();
2165
2289
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2166
- gpr_log(GPR_INFO, "chand=%p calld=%p: applying service config to call",
2167
- chand, this);
2168
- }
2169
- ConfigSelector* config_selector = chand->config_selector_.get();
2170
- if (config_selector != nullptr) {
2171
- // Use the ConfigSelector to determine the config for the call.
2172
- auto call_config =
2173
- config_selector->GetCallConfig({&path_, initial_metadata, arena()});
2174
- if (!call_config.ok()) {
2175
- return absl_status_to_grpc_error(MaybeRewriteIllegalStatusCode(
2176
- call_config.status(), "ConfigSelector"));
2177
- }
2178
- // Create a ClientChannelServiceConfigCallData for the call. This stores
2179
- // a ref to the ServiceConfig and caches the right set of parsed configs
2180
- // to use for the call. The ClientChannelServiceConfigCallData will store
2181
- // itself in the call context, so that it can be accessed by filters
2182
- // below us in the stack, and it will be cleaned up when the call ends.
2183
- auto* service_config_call_data =
2184
- arena()->New<ClientChannelServiceConfigCallData>(
2185
- std::move(call_config->service_config), call_config->method_configs,
2186
- std::move(call_config->call_attributes),
2187
- call_config->call_dispatch_controller, call_context_);
2188
- // Apply our own method params to the call.
2189
- auto* method_params = static_cast<ClientChannelMethodParsedConfig*>(
2190
- service_config_call_data->GetMethodParsedConfig(
2191
- chand->service_config_parser_index_));
2192
- if (method_params != nullptr) {
2193
- // If the deadline from the service config is shorter than the one
2194
- // from the client API, reset the deadline timer.
2195
- if (chand->deadline_checking_enabled_ &&
2196
- method_params->timeout() != Duration::Zero()) {
2197
- const Timestamp per_method_deadline =
2198
- Timestamp::FromCycleCounterRoundUp(call_start_time_) +
2199
- method_params->timeout();
2200
- if (per_method_deadline < deadline_) {
2201
- deadline_ = per_method_deadline;
2202
- grpc_deadline_state_reset(&deadline_state_, deadline_);
2203
- }
2204
- }
2205
- // If the service config set wait_for_ready and the application
2206
- // did not explicitly set it, use the value from the service config.
2207
- auto* wait_for_ready =
2208
- pending_batches_[0]
2209
- ->payload->send_initial_metadata.send_initial_metadata
2210
- ->GetOrCreatePointer(WaitForReady());
2211
- if (method_params->wait_for_ready().has_value() &&
2212
- !wait_for_ready->explicitly_set) {
2213
- wait_for_ready->value = method_params->wait_for_ready().value();
2214
- }
2215
- }
2216
- // Set the dynamic filter stack.
2217
- dynamic_filters_ = chand->dynamic_filters_;
2290
+ gpr_log(
2291
+ GPR_INFO,
2292
+ "chand=%p calld=%p: creating dynamic call stack on channel_stack=%p",
2293
+ chand(), this, channel_stack);
2218
2294
  }
2219
- return absl::OkStatus();
2220
- }
2221
-
2222
- void ClientChannel::CallData::
2223
- RecvTrailingMetadataReadyForConfigSelectorCommitCallback(
2224
- void* arg, grpc_error_handle error) {
2225
- auto* elem = static_cast<grpc_call_element*>(arg);
2226
- auto* chand = static_cast<ClientChannel*>(elem->channel_data);
2227
- auto* calld = static_cast<CallData*>(elem->call_data);
2295
+ dynamic_call_ = channel_stack->CreateCall(std::move(args), &error);
2296
+ if (!error.ok()) {
2297
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2298
+ gpr_log(GPR_INFO,
2299
+ "chand=%p calld=%p: failed to create dynamic call: error=%s",
2300
+ chand(), this, StatusToString(error).c_str());
2301
+ }
2302
+ PendingBatchesFail(error, YieldCallCombiner);
2303
+ return;
2304
+ }
2305
+ PendingBatchesResume();
2306
+ }
2307
+
2308
+ void ClientChannel::FilterBasedCallData::
2309
+ RecvTrailingMetadataReadyForConfigSelectorCommitCallback(
2310
+ void* arg, grpc_error_handle error) {
2311
+ auto* calld = static_cast<FilterBasedCallData*>(arg);
2312
+ auto* chand = calld->chand();
2228
2313
  auto* service_config_call_data =
2229
2314
  static_cast<ClientChannelServiceConfigCallData*>(
2230
- calld->call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
2315
+ calld->call_context()[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
2231
2316
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2232
2317
  gpr_log(GPR_INFO,
2233
2318
  "chand=%p calld=%p: got recv_trailing_metadata_ready: error=%s "
@@ -2236,152 +2321,32 @@ void ClientChannel::CallData::
2236
2321
  service_config_call_data);
2237
2322
  }
2238
2323
  if (service_config_call_data != nullptr) {
2239
- service_config_call_data->call_dispatch_controller()->Commit();
2324
+ service_config_call_data->Commit();
2240
2325
  }
2241
2326
  // Chain to original callback.
2242
2327
  Closure::Run(DEBUG_LOCATION, calld->original_recv_trailing_metadata_ready_,
2243
2328
  error);
2244
2329
  }
2245
2330
 
2246
- void ClientChannel::CallData::AsyncResolutionDone(grpc_call_element* elem,
2247
- grpc_error_handle error) {
2248
- // TODO(roth): Does this callback need to hold a ref to the call stack?
2249
- GRPC_CLOSURE_INIT(&resolution_done_closure_, ResolutionDone, elem, nullptr);
2250
- ExecCtx::Run(DEBUG_LOCATION, &resolution_done_closure_, error);
2251
- }
2331
+ //
2332
+ // ClientChannel::LoadBalancedCall::LbCallState
2333
+ //
2252
2334
 
2253
- void ClientChannel::CallData::ResolutionDone(void* arg,
2254
- grpc_error_handle error) {
2255
- grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
2256
- ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
2257
- CallData* calld = static_cast<CallData*>(elem->call_data);
2258
- if (!error.ok()) {
2259
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2260
- gpr_log(GPR_INFO,
2261
- "chand=%p calld=%p: error applying config to call: error=%s",
2262
- chand, calld, StatusToString(error).c_str());
2263
- }
2264
- calld->PendingBatchesFail(elem, error, YieldCallCombiner);
2265
- return;
2266
- }
2267
- calld->CreateDynamicCall(elem);
2268
- }
2335
+ class ClientChannel::LoadBalancedCall::LbCallState
2336
+ : public ClientChannelLbCallState {
2337
+ public:
2338
+ explicit LbCallState(LoadBalancedCall* lb_call) : lb_call_(lb_call) {}
2269
2339
 
2270
- void ClientChannel::CallData::CheckResolution(void* arg,
2271
- grpc_error_handle error) {
2272
- grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
2273
- CallData* calld = static_cast<CallData*>(elem->call_data);
2274
- ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
2275
- bool resolution_complete;
2276
- {
2277
- MutexLock lock(&chand->resolution_mu_);
2278
- resolution_complete = calld->CheckResolutionLocked(elem, &error);
2279
- }
2280
- if (resolution_complete) {
2281
- ResolutionDone(elem, error);
2282
- }
2283
- }
2340
+ void* Alloc(size_t size) override { return lb_call_->arena()->Alloc(size); }
2284
2341
 
2285
- bool ClientChannel::CallData::CheckResolutionLocked(grpc_call_element* elem,
2286
- grpc_error_handle* error) {
2287
- ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
2288
- // If we're still in IDLE, we need to start resolving.
2289
- if (GPR_UNLIKELY(chand->CheckConnectivityState(false) == GRPC_CHANNEL_IDLE)) {
2290
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2291
- gpr_log(GPR_INFO, "chand=%p calld=%p: triggering exit idle", chand, this);
2292
- }
2293
- // Bounce into the control plane work serializer to start resolving,
2294
- // in case we are still in IDLE state. Since we are holding on to the
2295
- // resolution mutex here, we offload it on the ExecCtx so that we don't
2296
- // deadlock with ourselves.
2297
- GRPC_CHANNEL_STACK_REF(chand->owning_stack_, "CheckResolutionLocked");
2298
- ExecCtx::Run(
2299
- DEBUG_LOCATION,
2300
- GRPC_CLOSURE_CREATE(
2301
- [](void* arg, grpc_error_handle /*error*/) {
2302
- auto* chand = static_cast<ClientChannel*>(arg);
2303
- chand->work_serializer_->Run(
2304
- [chand]()
2305
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand->work_serializer_) {
2306
- chand->CheckConnectivityState(/*try_to_connect=*/true);
2307
- GRPC_CHANNEL_STACK_UNREF(chand->owning_stack_,
2308
- "CheckResolutionLocked");
2309
- },
2310
- DEBUG_LOCATION);
2311
- },
2312
- chand, nullptr),
2313
- absl::OkStatus());
2314
- }
2315
- // Get send_initial_metadata batch and flags.
2316
- auto& send_initial_metadata =
2317
- pending_batches_[0]->payload->send_initial_metadata;
2318
- grpc_metadata_batch* initial_metadata_batch =
2319
- send_initial_metadata.send_initial_metadata;
2320
- // If we don't yet have a resolver result, we need to queue the call
2321
- // until we get one.
2322
- if (GPR_UNLIKELY(!chand->received_service_config_data_)) {
2323
- // If the resolver returned transient failure before returning the
2324
- // first service config, fail any non-wait_for_ready calls.
2325
- absl::Status resolver_error = chand->resolver_transient_failure_error_;
2326
- if (!resolver_error.ok() &&
2327
- !initial_metadata_batch->GetOrCreatePointer(WaitForReady())->value) {
2328
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2329
- gpr_log(GPR_INFO, "chand=%p calld=%p: resolution failed, failing call",
2330
- chand, this);
2331
- }
2332
- MaybeRemoveCallFromResolverQueuedCallsLocked(elem);
2333
- *error = absl_status_to_grpc_error(resolver_error);
2334
- return true;
2335
- }
2336
- // Either the resolver has not yet returned a result, or it has
2337
- // returned transient failure but the call is wait_for_ready. In
2338
- // either case, queue the call.
2339
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2340
- gpr_log(GPR_INFO, "chand=%p calld=%p: queuing to wait for resolution",
2341
- chand, this);
2342
- }
2343
- MaybeAddCallToResolverQueuedCallsLocked(elem);
2344
- return false;
2345
- }
2346
- // Apply service config to call if not yet applied.
2347
- if (GPR_LIKELY(!service_config_applied_)) {
2348
- service_config_applied_ = true;
2349
- *error = ApplyServiceConfigToCallLocked(elem, initial_metadata_batch);
2350
- }
2351
- MaybeRemoveCallFromResolverQueuedCallsLocked(elem);
2352
- return true;
2353
- }
2342
+ // Internal API to allow first-party LB policies to access per-call
2343
+ // attributes set by the ConfigSelector.
2344
+ ServiceConfigCallData::CallAttributeInterface* GetCallAttribute(
2345
+ UniqueTypeName type) const override;
2354
2346
 
2355
- void ClientChannel::CallData::CreateDynamicCall(grpc_call_element* elem) {
2356
- auto* chand = static_cast<ClientChannel*>(elem->channel_data);
2357
- DynamicFilters::Call::Args args = {std::move(dynamic_filters_),
2358
- pollent_,
2359
- path_,
2360
- call_start_time_,
2361
- deadline_,
2362
- arena(),
2363
- call_context_,
2364
- call_combiner()};
2365
- grpc_error_handle error;
2366
- DynamicFilters* channel_stack = args.channel_stack.get();
2367
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2368
- gpr_log(
2369
- GPR_INFO,
2370
- "chand=%p calld=%p: creating dynamic call stack on channel_stack=%p",
2371
- chand, this, channel_stack);
2372
- }
2373
- dynamic_call_ = channel_stack->CreateCall(std::move(args), &error);
2374
- if (!error.ok()) {
2375
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
2376
- gpr_log(GPR_INFO,
2377
- "chand=%p calld=%p: failed to create dynamic call: error=%s",
2378
- chand, this, StatusToString(error).c_str());
2379
- }
2380
- PendingBatchesFail(elem, error, YieldCallCombiner);
2381
- return;
2382
- }
2383
- PendingBatchesResume(elem);
2384
- }
2347
+ private:
2348
+ LoadBalancedCall* lb_call_;
2349
+ };
2385
2350
 
2386
2351
  //
2387
2352
  // ClientChannel::LoadBalancedCall::Metadata
@@ -2462,15 +2427,12 @@ class ClientChannel::LoadBalancedCall::Metadata
2462
2427
  // ClientChannel::LoadBalancedCall::LbCallState
2463
2428
  //
2464
2429
 
2465
- absl::string_view
2430
+ ServiceConfigCallData::CallAttributeInterface*
2466
2431
  ClientChannel::LoadBalancedCall::LbCallState::GetCallAttribute(
2467
- UniqueTypeName type) {
2432
+ UniqueTypeName type) const {
2468
2433
  auto* service_config_call_data = static_cast<ServiceConfigCallData*>(
2469
- lb_call_->call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
2470
- auto& call_attributes = service_config_call_data->call_attributes();
2471
- auto it = call_attributes.find(type);
2472
- if (it == call_attributes.end()) return absl::string_view();
2473
- return it->second;
2434
+ lb_call_->call_context()[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
2435
+ return service_config_call_data->GetCallAttribute(type);
2474
2436
  }
2475
2437
 
2476
2438
  //
@@ -2480,15 +2442,16 @@ ClientChannel::LoadBalancedCall::LbCallState::GetCallAttribute(
2480
2442
  class ClientChannel::LoadBalancedCall::BackendMetricAccessor
2481
2443
  : public LoadBalancingPolicy::BackendMetricAccessor {
2482
2444
  public:
2483
- explicit BackendMetricAccessor(LoadBalancedCall* lb_call)
2484
- : lb_call_(lb_call) {}
2445
+ BackendMetricAccessor(LoadBalancedCall* lb_call,
2446
+ grpc_metadata_batch* recv_trailing_metadata)
2447
+ : lb_call_(lb_call), recv_trailing_metadata_(recv_trailing_metadata) {}
2485
2448
 
2486
2449
  const BackendMetricData* GetBackendMetricData() override {
2487
2450
  if (lb_call_->backend_metric_data_ == nullptr &&
2488
- lb_call_->recv_trailing_metadata_ != nullptr) {
2489
- if (const auto* md = lb_call_->recv_trailing_metadata_->get_pointer(
2451
+ recv_trailing_metadata_ != nullptr) {
2452
+ if (const auto* md = recv_trailing_metadata_->get_pointer(
2490
2453
  EndpointLoadMetricsBinMetadata())) {
2491
- BackendMetricAllocator allocator(lb_call_->arena_);
2454
+ BackendMetricAllocator allocator(lb_call_->arena());
2492
2455
  lb_call_->backend_metric_data_ =
2493
2456
  ParseBackendMetricData(md->as_string_view(), &allocator);
2494
2457
  }
@@ -2514,6 +2477,7 @@ class ClientChannel::LoadBalancedCall::BackendMetricAccessor
2514
2477
  };
2515
2478
 
2516
2479
  LoadBalancedCall* lb_call_;
2480
+ grpc_metadata_batch* recv_trailing_metadata_;
2517
2481
  };
2518
2482
 
2519
2483
  //
@@ -2522,37 +2486,28 @@ class ClientChannel::LoadBalancedCall::BackendMetricAccessor
2522
2486
 
2523
2487
  namespace {
2524
2488
 
2525
- CallTracer::CallAttemptTracer* GetCallAttemptTracer(
2489
+ ClientCallTracer::CallAttemptTracer* CreateCallAttemptTracer(
2526
2490
  grpc_call_context_element* context, bool is_transparent_retry) {
2527
- auto* call_tracer =
2528
- static_cast<CallTracer*>(context[GRPC_CONTEXT_CALL_TRACER].value);
2491
+ auto* call_tracer = static_cast<ClientCallTracer*>(
2492
+ context[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE].value);
2529
2493
  if (call_tracer == nullptr) return nullptr;
2530
- return call_tracer->StartNewAttempt(is_transparent_retry);
2494
+ auto* tracer = call_tracer->StartNewAttempt(is_transparent_retry);
2495
+ context[GRPC_CONTEXT_CALL_TRACER].value = tracer;
2496
+ return tracer;
2531
2497
  }
2532
2498
 
2533
2499
  } // namespace
2534
2500
 
2535
2501
  ClientChannel::LoadBalancedCall::LoadBalancedCall(
2536
- ClientChannel* chand, const grpc_call_element_args& args,
2537
- grpc_polling_entity* pollent, grpc_closure* on_call_destruction_complete,
2538
- ConfigSelector::CallDispatchController* call_dispatch_controller,
2539
- bool is_transparent_retry)
2502
+ ClientChannel* chand, grpc_call_context_element* call_context,
2503
+ absl::AnyInvocable<void()> on_commit, bool is_transparent_retry)
2540
2504
  : InternallyRefCounted(
2541
2505
  GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)
2542
2506
  ? "LoadBalancedCall"
2543
2507
  : nullptr),
2544
2508
  chand_(chand),
2545
- path_(CSliceRef(args.path)),
2546
- deadline_(args.deadline),
2547
- arena_(args.arena),
2548
- owning_call_(args.call_stack),
2549
- call_combiner_(args.call_combiner),
2550
- call_context_(args.context),
2551
- pollent_(pollent),
2552
- on_call_destruction_complete_(on_call_destruction_complete),
2553
- call_dispatch_controller_(call_dispatch_controller),
2554
- call_attempt_tracer_(
2555
- GetCallAttemptTracer(args.context, is_transparent_retry)) {
2509
+ on_commit_(std::move(on_commit)) {
2510
+ CreateCallAttemptTracer(call_context, is_transparent_retry);
2556
2511
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2557
2512
  gpr_log(GPR_INFO, "chand=%p lb_call=%p: created", chand_, this);
2558
2513
  }
@@ -2562,6 +2517,244 @@ ClientChannel::LoadBalancedCall::~LoadBalancedCall() {
2562
2517
  if (backend_metric_data_ != nullptr) {
2563
2518
  backend_metric_data_->BackendMetricData::~BackendMetricData();
2564
2519
  }
2520
+ }
2521
+
2522
+ void ClientChannel::LoadBalancedCall::Orphan() {
2523
+ // Compute latency and report it to the tracer.
2524
+ if (call_attempt_tracer() != nullptr) {
2525
+ gpr_timespec latency =
2526
+ gpr_cycle_counter_sub(gpr_get_cycle_counter(), lb_call_start_time_);
2527
+ call_attempt_tracer()->RecordEnd(latency);
2528
+ }
2529
+ Unref();
2530
+ }
2531
+
2532
+ void ClientChannel::LoadBalancedCall::RecordCallCompletion(
2533
+ absl::Status status, grpc_metadata_batch* recv_trailing_metadata,
2534
+ grpc_transport_stream_stats* transport_stream_stats,
2535
+ absl::string_view peer_address) {
2536
+ // If we have a tracer, notify it.
2537
+ if (call_attempt_tracer() != nullptr) {
2538
+ call_attempt_tracer()->RecordReceivedTrailingMetadata(
2539
+ status, recv_trailing_metadata, transport_stream_stats);
2540
+ }
2541
+ // If the LB policy requested a callback for trailing metadata, invoke
2542
+ // the callback.
2543
+ if (lb_subchannel_call_tracker_ != nullptr) {
2544
+ Metadata trailing_metadata(recv_trailing_metadata);
2545
+ BackendMetricAccessor backend_metric_accessor(this, recv_trailing_metadata);
2546
+ LoadBalancingPolicy::SubchannelCallTrackerInterface::FinishArgs args = {
2547
+ peer_address, status, &trailing_metadata, &backend_metric_accessor};
2548
+ lb_subchannel_call_tracker_->Finish(args);
2549
+ lb_subchannel_call_tracker_.reset();
2550
+ }
2551
+ }
2552
+
2553
+ void ClientChannel::LoadBalancedCall::RemoveCallFromLbQueuedCallsLocked() {
2554
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2555
+ gpr_log(GPR_INFO, "chand=%p lb_call=%p: removing from queued picks list",
2556
+ chand_, this);
2557
+ }
2558
+ // Remove pollset_set linkage.
2559
+ grpc_polling_entity_del_from_pollset_set(pollent(),
2560
+ chand_->interested_parties_);
2561
+ // Note: There's no need to actually remove the call from the queue
2562
+ // here, beacuse that will be done in either
2563
+ // LbQueuedCallCanceller::CancelLocked() or
2564
+ // in ClientChannel::UpdateStateAndPickerLocked().
2565
+ }
2566
+
2567
+ void ClientChannel::LoadBalancedCall::AddCallToLbQueuedCallsLocked() {
2568
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2569
+ gpr_log(GPR_INFO, "chand=%p lb_call=%p: adding to queued picks list",
2570
+ chand_, this);
2571
+ }
2572
+ // Add call's pollent to channel's interested_parties, so that I/O
2573
+ // can be done under the call's CQ.
2574
+ grpc_polling_entity_add_to_pollset_set(pollent(),
2575
+ chand_->interested_parties_);
2576
+ // Add to queue.
2577
+ chand_->lb_queued_calls_.insert(this);
2578
+ OnAddToQueueLocked();
2579
+ }
2580
+
2581
+ absl::optional<absl::Status> ClientChannel::LoadBalancedCall::PickSubchannel(
2582
+ bool was_queued) {
2583
+ // We may accumulate multiple pickers here, because if a picker says
2584
+ // to queue the call, we check again to see if the picker has been
2585
+ // updated before we queue it.
2586
+ // We need to unref pickers in the WorkSerializer.
2587
+ std::vector<RefCountedPtr<LoadBalancingPolicy::SubchannelPicker>> pickers;
2588
+ auto cleanup = absl::MakeCleanup([&]() {
2589
+ chand_->work_serializer_->Run(
2590
+ [pickers = std::move(pickers)]() mutable {
2591
+ for (auto& picker : pickers) {
2592
+ picker.reset(DEBUG_LOCATION, "PickSubchannel");
2593
+ }
2594
+ },
2595
+ DEBUG_LOCATION);
2596
+ });
2597
+ // Grab mutex and take a ref to the picker.
2598
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2599
+ gpr_log(GPR_INFO, "chand=%p lb_call=%p: grabbing LB mutex to get picker",
2600
+ chand_, this);
2601
+ }
2602
+ {
2603
+ MutexLock lock(&chand_->lb_mu_);
2604
+ pickers.emplace_back(chand_->picker_);
2605
+ }
2606
+ while (true) {
2607
+ // Do pick.
2608
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2609
+ gpr_log(GPR_INFO, "chand=%p lb_call=%p: performing pick with picker=%p",
2610
+ chand_, this, pickers.back().get());
2611
+ }
2612
+ grpc_error_handle error;
2613
+ bool pick_complete = PickSubchannelImpl(pickers.back().get(), &error);
2614
+ if (!pick_complete) {
2615
+ MutexLock lock(&chand_->lb_mu_);
2616
+ // If picker has been swapped out since we grabbed it, try again.
2617
+ if (chand_->picker_ != pickers.back()) {
2618
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2619
+ gpr_log(GPR_INFO,
2620
+ "chand=%p lb_call=%p: pick not complete, but picker changed",
2621
+ chand_, this);
2622
+ }
2623
+ pickers.emplace_back(chand_->picker_);
2624
+ continue;
2625
+ }
2626
+ // Otherwise queue the pick to try again later when we get a new picker.
2627
+ AddCallToLbQueuedCallsLocked();
2628
+ return absl::nullopt;
2629
+ }
2630
+ // Pick is complete.
2631
+ // If it was queued, add a trace annotation.
2632
+ if (was_queued && call_attempt_tracer() != nullptr) {
2633
+ call_attempt_tracer()->RecordAnnotation("Delayed LB pick complete.");
2634
+ }
2635
+ // If the pick failed, fail the call.
2636
+ if (!error.ok()) {
2637
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2638
+ gpr_log(GPR_INFO,
2639
+ "chand=%p lb_call=%p: failed to pick subchannel: error=%s",
2640
+ chand_, this, StatusToString(error).c_str());
2641
+ }
2642
+ return error;
2643
+ }
2644
+ // Pick succeeded.
2645
+ Commit();
2646
+ return absl::OkStatus();
2647
+ }
2648
+ }
2649
+
2650
+ bool ClientChannel::LoadBalancedCall::PickSubchannelImpl(
2651
+ LoadBalancingPolicy::SubchannelPicker* picker, grpc_error_handle* error) {
2652
+ GPR_ASSERT(connected_subchannel_ == nullptr);
2653
+ // Perform LB pick.
2654
+ LoadBalancingPolicy::PickArgs pick_args;
2655
+ Slice* path = send_initial_metadata()->get_pointer(HttpPathMetadata());
2656
+ GPR_ASSERT(path != nullptr);
2657
+ pick_args.path = path->as_string_view();
2658
+ LbCallState lb_call_state(this);
2659
+ pick_args.call_state = &lb_call_state;
2660
+ Metadata initial_metadata(send_initial_metadata());
2661
+ pick_args.initial_metadata = &initial_metadata;
2662
+ auto result = picker->Pick(pick_args);
2663
+ return HandlePickResult<bool>(
2664
+ &result,
2665
+ // CompletePick
2666
+ [this](LoadBalancingPolicy::PickResult::Complete* complete_pick) {
2667
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2668
+ gpr_log(GPR_INFO,
2669
+ "chand=%p lb_call=%p: LB pick succeeded: subchannel=%p",
2670
+ chand_, this, complete_pick->subchannel.get());
2671
+ }
2672
+ GPR_ASSERT(complete_pick->subchannel != nullptr);
2673
+ // Grab a ref to the connected subchannel while we're still
2674
+ // holding the data plane mutex.
2675
+ SubchannelWrapper* subchannel =
2676
+ static_cast<SubchannelWrapper*>(complete_pick->subchannel.get());
2677
+ connected_subchannel_ = subchannel->connected_subchannel();
2678
+ // If the subchannel has no connected subchannel (e.g., if the
2679
+ // subchannel has moved out of state READY but the LB policy hasn't
2680
+ // yet seen that change and given us a new picker), then just
2681
+ // queue the pick. We'll try again as soon as we get a new picker.
2682
+ if (connected_subchannel_ == nullptr) {
2683
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2684
+ gpr_log(GPR_INFO,
2685
+ "chand=%p lb_call=%p: subchannel returned by LB picker "
2686
+ "has no connected subchannel; queueing pick",
2687
+ chand_, this);
2688
+ }
2689
+ return false;
2690
+ }
2691
+ lb_subchannel_call_tracker_ =
2692
+ std::move(complete_pick->subchannel_call_tracker);
2693
+ if (lb_subchannel_call_tracker_ != nullptr) {
2694
+ lb_subchannel_call_tracker_->Start();
2695
+ }
2696
+ return true;
2697
+ },
2698
+ // QueuePick
2699
+ [this](LoadBalancingPolicy::PickResult::Queue* /*queue_pick*/) {
2700
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2701
+ gpr_log(GPR_INFO, "chand=%p lb_call=%p: LB pick queued", chand_,
2702
+ this);
2703
+ }
2704
+ return false;
2705
+ },
2706
+ // FailPick
2707
+ [this, &error](LoadBalancingPolicy::PickResult::Fail* fail_pick) {
2708
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2709
+ gpr_log(GPR_INFO, "chand=%p lb_call=%p: LB pick failed: %s", chand_,
2710
+ this, fail_pick->status.ToString().c_str());
2711
+ }
2712
+ // If wait_for_ready is false, then the error indicates the RPC
2713
+ // attempt's final status.
2714
+ if (!send_initial_metadata()
2715
+ ->GetOrCreatePointer(WaitForReady())
2716
+ ->value) {
2717
+ *error = absl_status_to_grpc_error(MaybeRewriteIllegalStatusCode(
2718
+ std::move(fail_pick->status), "LB pick"));
2719
+ return true;
2720
+ }
2721
+ // If wait_for_ready is true, then queue to retry when we get a new
2722
+ // picker.
2723
+ return false;
2724
+ },
2725
+ // DropPick
2726
+ [this, &error](LoadBalancingPolicy::PickResult::Drop* drop_pick) {
2727
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2728
+ gpr_log(GPR_INFO, "chand=%p lb_call=%p: LB pick dropped: %s", chand_,
2729
+ this, drop_pick->status.ToString().c_str());
2730
+ }
2731
+ *error = grpc_error_set_int(
2732
+ absl_status_to_grpc_error(MaybeRewriteIllegalStatusCode(
2733
+ std::move(drop_pick->status), "LB drop")),
2734
+ StatusIntProperty::kLbPolicyDrop, 1);
2735
+ return true;
2736
+ });
2737
+ }
2738
+
2739
+ //
2740
+ // ClientChannel::FilterBasedLoadBalancedCall
2741
+ //
2742
+
2743
+ ClientChannel::FilterBasedLoadBalancedCall::FilterBasedLoadBalancedCall(
2744
+ ClientChannel* chand, const grpc_call_element_args& args,
2745
+ grpc_polling_entity* pollent, grpc_closure* on_call_destruction_complete,
2746
+ absl::AnyInvocable<void()> on_commit, bool is_transparent_retry)
2747
+ : LoadBalancedCall(chand, args.context, std::move(on_commit),
2748
+ is_transparent_retry),
2749
+ deadline_(args.deadline),
2750
+ arena_(args.arena),
2751
+ call_context_(args.context),
2752
+ owning_call_(args.call_stack),
2753
+ call_combiner_(args.call_combiner),
2754
+ pollent_(pollent),
2755
+ on_call_destruction_complete_(on_call_destruction_complete) {}
2756
+
2757
+ ClientChannel::FilterBasedLoadBalancedCall::~FilterBasedLoadBalancedCall() {
2565
2758
  // Make sure there are no remaining pending batches.
2566
2759
  for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
2567
2760
  GPR_ASSERT(pending_batches_[i] == nullptr);
@@ -2572,26 +2765,22 @@ ClientChannel::LoadBalancedCall::~LoadBalancedCall() {
2572
2765
  }
2573
2766
  }
2574
2767
 
2575
- void ClientChannel::LoadBalancedCall::Orphan() {
2768
+ void ClientChannel::FilterBasedLoadBalancedCall::Orphan() {
2576
2769
  // If the recv_trailing_metadata op was never started, then notify
2577
2770
  // about call completion here, as best we can. We assume status
2578
2771
  // CANCELLED in this case.
2579
2772
  if (recv_trailing_metadata_ == nullptr) {
2580
- RecordCallCompletion(absl::CancelledError("call cancelled"));
2773
+ RecordCallCompletion(absl::CancelledError("call cancelled"), nullptr,
2774
+ nullptr, "");
2581
2775
  }
2582
- // Compute latency and report it to the tracer.
2583
- if (call_attempt_tracer_ != nullptr) {
2584
- gpr_timespec latency =
2585
- gpr_cycle_counter_sub(gpr_get_cycle_counter(), lb_call_start_time_);
2586
- call_attempt_tracer_->RecordEnd(latency);
2587
- }
2588
- Unref();
2776
+ // Delegate to parent.
2777
+ LoadBalancedCall::Orphan();
2589
2778
  }
2590
2779
 
2591
- size_t ClientChannel::LoadBalancedCall::GetBatchIndex(
2780
+ size_t ClientChannel::FilterBasedLoadBalancedCall::GetBatchIndex(
2592
2781
  grpc_transport_stream_op_batch* batch) {
2593
2782
  // Note: It is important the send_initial_metadata be the first entry
2594
- // here, since the code in PickSubchannelLocked() assumes it will be.
2783
+ // here, since the code in PickSubchannelImpl() assumes it will be.
2595
2784
  if (batch->send_initial_metadata) return 0;
2596
2785
  if (batch->send_message) return 1;
2597
2786
  if (batch->send_trailing_metadata) return 2;
@@ -2602,31 +2791,32 @@ size_t ClientChannel::LoadBalancedCall::GetBatchIndex(
2602
2791
  }
2603
2792
 
2604
2793
  // This is called via the call combiner, so access to calld is synchronized.
2605
- void ClientChannel::LoadBalancedCall::PendingBatchesAdd(
2794
+ void ClientChannel::FilterBasedLoadBalancedCall::PendingBatchesAdd(
2606
2795
  grpc_transport_stream_op_batch* batch) {
2607
2796
  const size_t idx = GetBatchIndex(batch);
2608
2797
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2609
2798
  gpr_log(GPR_INFO,
2610
2799
  "chand=%p lb_call=%p: adding pending batch at index %" PRIuPTR,
2611
- chand_, this, idx);
2800
+ chand(), this, idx);
2612
2801
  }
2613
2802
  GPR_ASSERT(pending_batches_[idx] == nullptr);
2614
2803
  pending_batches_[idx] = batch;
2615
2804
  }
2616
2805
 
2617
2806
  // This is called via the call combiner, so access to calld is synchronized.
2618
- void ClientChannel::LoadBalancedCall::FailPendingBatchInCallCombiner(
2807
+ void ClientChannel::FilterBasedLoadBalancedCall::FailPendingBatchInCallCombiner(
2619
2808
  void* arg, grpc_error_handle error) {
2620
2809
  grpc_transport_stream_op_batch* batch =
2621
2810
  static_cast<grpc_transport_stream_op_batch*>(arg);
2622
- auto* self = static_cast<LoadBalancedCall*>(batch->handler_private.extra_arg);
2811
+ auto* self = static_cast<FilterBasedLoadBalancedCall*>(
2812
+ batch->handler_private.extra_arg);
2623
2813
  // Note: This will release the call combiner.
2624
2814
  grpc_transport_stream_op_batch_finish_with_failure(batch, error,
2625
2815
  self->call_combiner_);
2626
2816
  }
2627
2817
 
2628
2818
  // This is called via the call combiner, so access to calld is synchronized.
2629
- void ClientChannel::LoadBalancedCall::PendingBatchesFail(
2819
+ void ClientChannel::FilterBasedLoadBalancedCall::PendingBatchesFail(
2630
2820
  grpc_error_handle error,
2631
2821
  YieldCallCombinerPredicate yield_call_combiner_predicate) {
2632
2822
  GPR_ASSERT(!error.ok());
@@ -2638,7 +2828,7 @@ void ClientChannel::LoadBalancedCall::PendingBatchesFail(
2638
2828
  }
2639
2829
  gpr_log(GPR_INFO,
2640
2830
  "chand=%p lb_call=%p: failing %" PRIuPTR " pending batches: %s",
2641
- chand_, this, num_batches, StatusToString(error).c_str());
2831
+ chand(), this, num_batches, StatusToString(error).c_str());
2642
2832
  }
2643
2833
  CallCombinerClosureList closures;
2644
2834
  for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
@@ -2661,8 +2851,8 @@ void ClientChannel::LoadBalancedCall::PendingBatchesFail(
2661
2851
  }
2662
2852
 
2663
2853
  // This is called via the call combiner, so access to calld is synchronized.
2664
- void ClientChannel::LoadBalancedCall::ResumePendingBatchInCallCombiner(
2665
- void* arg, grpc_error_handle /*ignored*/) {
2854
+ void ClientChannel::FilterBasedLoadBalancedCall::
2855
+ ResumePendingBatchInCallCombiner(void* arg, grpc_error_handle /*ignored*/) {
2666
2856
  grpc_transport_stream_op_batch* batch =
2667
2857
  static_cast<grpc_transport_stream_op_batch*>(arg);
2668
2858
  SubchannelCall* subchannel_call =
@@ -2672,7 +2862,7 @@ void ClientChannel::LoadBalancedCall::ResumePendingBatchInCallCombiner(
2672
2862
  }
2673
2863
 
2674
2864
  // This is called via the call combiner, so access to calld is synchronized.
2675
- void ClientChannel::LoadBalancedCall::PendingBatchesResume() {
2865
+ void ClientChannel::FilterBasedLoadBalancedCall::PendingBatchesResume() {
2676
2866
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2677
2867
  size_t num_batches = 0;
2678
2868
  for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
@@ -2681,7 +2871,7 @@ void ClientChannel::LoadBalancedCall::PendingBatchesResume() {
2681
2871
  gpr_log(GPR_INFO,
2682
2872
  "chand=%p lb_call=%p: starting %" PRIuPTR
2683
2873
  " pending batches on subchannel_call=%p",
2684
- chand_, this, num_batches, subchannel_call_.get());
2874
+ chand(), this, num_batches, subchannel_call_.get());
2685
2875
  }
2686
2876
  CallCombinerClosureList closures;
2687
2877
  for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
@@ -2700,38 +2890,30 @@ void ClientChannel::LoadBalancedCall::PendingBatchesResume() {
2700
2890
  closures.RunClosures(call_combiner_);
2701
2891
  }
2702
2892
 
2703
- void ClientChannel::LoadBalancedCall::StartTransportStreamOpBatch(
2893
+ void ClientChannel::FilterBasedLoadBalancedCall::StartTransportStreamOpBatch(
2704
2894
  grpc_transport_stream_op_batch* batch) {
2705
2895
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace) ||
2706
2896
  GRPC_TRACE_FLAG_ENABLED(grpc_trace_channel)) {
2707
2897
  gpr_log(GPR_INFO,
2708
2898
  "chand=%p lb_call=%p: batch started from above: %s, "
2709
- "call_attempt_tracer_=%p",
2710
- chand_, this, grpc_transport_stream_op_batch_string(batch).c_str(),
2711
- call_attempt_tracer_);
2899
+ "call_attempt_tracer()=%p",
2900
+ chand(), this,
2901
+ grpc_transport_stream_op_batch_string(batch, false).c_str(),
2902
+ call_attempt_tracer());
2712
2903
  }
2713
2904
  // Handle call tracing.
2714
- if (call_attempt_tracer_ != nullptr) {
2905
+ if (call_attempt_tracer() != nullptr) {
2715
2906
  // Record send ops in tracer.
2716
2907
  if (batch->cancel_stream) {
2717
- call_attempt_tracer_->RecordCancel(
2908
+ call_attempt_tracer()->RecordCancel(
2718
2909
  batch->payload->cancel_stream.cancel_error);
2719
2910
  }
2720
2911
  if (batch->send_initial_metadata) {
2721
- call_attempt_tracer_->RecordSendInitialMetadata(
2912
+ call_attempt_tracer()->RecordSendInitialMetadata(
2722
2913
  batch->payload->send_initial_metadata.send_initial_metadata);
2723
- peer_string_ = batch->payload->send_initial_metadata.peer_string;
2724
- original_send_initial_metadata_on_complete_ = batch->on_complete;
2725
- GRPC_CLOSURE_INIT(&send_initial_metadata_on_complete_,
2726
- SendInitialMetadataOnComplete, this, nullptr);
2727
- batch->on_complete = &send_initial_metadata_on_complete_;
2728
- }
2729
- if (batch->send_message) {
2730
- call_attempt_tracer_->RecordSendMessage(
2731
- *batch->payload->send_message.send_message);
2732
2914
  }
2733
2915
  if (batch->send_trailing_metadata) {
2734
- call_attempt_tracer_->RecordSendTrailingMetadata(
2916
+ call_attempt_tracer()->RecordSendTrailingMetadata(
2735
2917
  batch->payload->send_trailing_metadata.send_trailing_metadata);
2736
2918
  }
2737
2919
  // Intercept recv ops.
@@ -2745,13 +2927,6 @@ void ClientChannel::LoadBalancedCall::StartTransportStreamOpBatch(
2745
2927
  batch->payload->recv_initial_metadata.recv_initial_metadata_ready =
2746
2928
  &recv_initial_metadata_ready_;
2747
2929
  }
2748
- if (batch->recv_message) {
2749
- recv_message_ = batch->payload->recv_message.recv_message;
2750
- original_recv_message_ready_ =
2751
- batch->payload->recv_message.recv_message_ready;
2752
- GRPC_CLOSURE_INIT(&recv_message_ready_, RecvMessageReady, this, nullptr);
2753
- batch->payload->recv_message.recv_message_ready = &recv_message_ready_;
2754
- }
2755
2930
  }
2756
2931
  // Intercept recv_trailing_metadata even if there is no call tracer,
2757
2932
  // since we may need to notify the LB policy about trailing metadata.
@@ -2775,7 +2950,7 @@ void ClientChannel::LoadBalancedCall::StartTransportStreamOpBatch(
2775
2950
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2776
2951
  gpr_log(GPR_INFO,
2777
2952
  "chand=%p lb_call=%p: starting batch on subchannel_call=%p",
2778
- chand_, this, subchannel_call_.get());
2953
+ chand(), this, subchannel_call_.get());
2779
2954
  }
2780
2955
  subchannel_call_->StartTransportStreamOpBatch(batch);
2781
2956
  return;
@@ -2786,7 +2961,7 @@ void ClientChannel::LoadBalancedCall::StartTransportStreamOpBatch(
2786
2961
  if (GPR_UNLIKELY(!cancel_error_.ok())) {
2787
2962
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2788
2963
  gpr_log(GPR_INFO, "chand=%p lb_call=%p: failing batch with error: %s",
2789
- chand_, this, StatusToString(cancel_error_).c_str());
2964
+ chand(), this, StatusToString(cancel_error_).c_str());
2790
2965
  }
2791
2966
  // Note: This will release the call combiner.
2792
2967
  grpc_transport_stream_op_batch_finish_with_failure(batch, cancel_error_,
@@ -2803,7 +2978,7 @@ void ClientChannel::LoadBalancedCall::StartTransportStreamOpBatch(
2803
2978
  cancel_error_ = batch->payload->cancel_stream.cancel_error;
2804
2979
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2805
2980
  gpr_log(GPR_INFO, "chand=%p lb_call=%p: recording cancel_error=%s",
2806
- chand_, this, StatusToString(cancel_error_).c_str());
2981
+ chand(), this, StatusToString(cancel_error_).c_str());
2807
2982
  }
2808
2983
  // Fail all pending batches.
2809
2984
  PendingBatchesFail(cancel_error_, NoYieldCallCombiner);
@@ -2815,86 +2990,55 @@ void ClientChannel::LoadBalancedCall::StartTransportStreamOpBatch(
2815
2990
  // Add the batch to the pending list.
2816
2991
  PendingBatchesAdd(batch);
2817
2992
  // For batches containing a send_initial_metadata op, acquire the
2818
- // channel's data plane mutex to pick a subchannel.
2993
+ // channel's LB mutex to pick a subchannel.
2819
2994
  if (GPR_LIKELY(batch->send_initial_metadata)) {
2820
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2821
- gpr_log(GPR_INFO,
2822
- "chand=%p lb_call=%p: grabbing data plane mutex to perform pick",
2823
- chand_, this);
2824
- }
2825
- PickSubchannel(this, absl::OkStatus());
2995
+ TryPick(/*was_queued=*/false);
2826
2996
  } else {
2827
2997
  // For all other batches, release the call combiner.
2828
2998
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2829
2999
  gpr_log(GPR_INFO,
2830
3000
  "chand=%p lb_call=%p: saved batch, yielding call combiner",
2831
- chand_, this);
3001
+ chand(), this);
2832
3002
  }
2833
3003
  GRPC_CALL_COMBINER_STOP(call_combiner_,
2834
3004
  "batch does not include send_initial_metadata");
2835
3005
  }
2836
3006
  }
2837
3007
 
2838
- void ClientChannel::LoadBalancedCall::SendInitialMetadataOnComplete(
3008
+ void ClientChannel::FilterBasedLoadBalancedCall::RecvInitialMetadataReady(
2839
3009
  void* arg, grpc_error_handle error) {
2840
- auto* self = static_cast<LoadBalancedCall*>(arg);
2841
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2842
- gpr_log(GPR_INFO,
2843
- "chand=%p lb_call=%p: got on_complete for send_initial_metadata: "
2844
- "error=%s",
2845
- self->chand_, self, StatusToString(error).c_str());
2846
- }
2847
- self->call_attempt_tracer_->RecordOnDoneSendInitialMetadata(
2848
- self->peer_string_);
2849
- Closure::Run(DEBUG_LOCATION,
2850
- self->original_send_initial_metadata_on_complete_, error);
2851
- }
2852
-
2853
- void ClientChannel::LoadBalancedCall::RecvInitialMetadataReady(
2854
- void* arg, grpc_error_handle error) {
2855
- auto* self = static_cast<LoadBalancedCall*>(arg);
3010
+ auto* self = static_cast<FilterBasedLoadBalancedCall*>(arg);
2856
3011
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2857
3012
  gpr_log(GPR_INFO,
2858
3013
  "chand=%p lb_call=%p: got recv_initial_metadata_ready: error=%s",
2859
- self->chand_, self, StatusToString(error).c_str());
3014
+ self->chand(), self, StatusToString(error).c_str());
2860
3015
  }
2861
3016
  if (error.ok()) {
2862
3017
  // recv_initial_metadata_flags is not populated for clients
2863
- self->call_attempt_tracer_->RecordReceivedInitialMetadata(
2864
- self->recv_initial_metadata_, 0 /* recv_initial_metadata_flags */);
3018
+ self->call_attempt_tracer()->RecordReceivedInitialMetadata(
3019
+ self->recv_initial_metadata_);
3020
+ auto* peer_string = self->recv_initial_metadata_->get_pointer(PeerString());
3021
+ if (peer_string != nullptr) self->peer_string_ = peer_string->Ref();
2865
3022
  }
2866
3023
  Closure::Run(DEBUG_LOCATION, self->original_recv_initial_metadata_ready_,
2867
3024
  error);
2868
3025
  }
2869
3026
 
2870
- void ClientChannel::LoadBalancedCall::RecvMessageReady(
3027
+ void ClientChannel::FilterBasedLoadBalancedCall::RecvTrailingMetadataReady(
2871
3028
  void* arg, grpc_error_handle error) {
2872
- auto* self = static_cast<LoadBalancedCall*>(arg);
2873
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2874
- gpr_log(GPR_INFO, "chand=%p lb_call=%p: got recv_message_ready: error=%s",
2875
- self->chand_, self, StatusToString(error).c_str());
2876
- }
2877
- if (self->recv_message_->has_value()) {
2878
- self->call_attempt_tracer_->RecordReceivedMessage(**self->recv_message_);
2879
- }
2880
- Closure::Run(DEBUG_LOCATION, self->original_recv_message_ready_, error);
2881
- }
2882
-
2883
- void ClientChannel::LoadBalancedCall::RecvTrailingMetadataReady(
2884
- void* arg, grpc_error_handle error) {
2885
- auto* self = static_cast<LoadBalancedCall*>(arg);
3029
+ auto* self = static_cast<FilterBasedLoadBalancedCall*>(arg);
2886
3030
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2887
3031
  gpr_log(GPR_INFO,
2888
3032
  "chand=%p lb_call=%p: got recv_trailing_metadata_ready: error=%s "
2889
- "call_attempt_tracer_=%p lb_subchannel_call_tracker_=%p "
3033
+ "call_attempt_tracer()=%p lb_subchannel_call_tracker_=%p "
2890
3034
  "failure_error_=%s",
2891
- self->chand_, self, StatusToString(error).c_str(),
2892
- self->call_attempt_tracer_, self->lb_subchannel_call_tracker_.get(),
3035
+ self->chand(), self, StatusToString(error).c_str(),
3036
+ self->call_attempt_tracer(), self->lb_subchannel_call_tracker(),
2893
3037
  StatusToString(self->failure_error_).c_str());
2894
3038
  }
2895
3039
  // Check if we have a tracer or an LB callback to invoke.
2896
- if (self->call_attempt_tracer_ != nullptr ||
2897
- self->lb_subchannel_call_tracker_ != nullptr) {
3040
+ if (self->call_attempt_tracer() != nullptr ||
3041
+ self->lb_subchannel_call_tracker() != nullptr) {
2898
3042
  // Get the call's status.
2899
3043
  absl::Status status;
2900
3044
  if (!error.ok()) {
@@ -2917,7 +3061,12 @@ void ClientChannel::LoadBalancedCall::RecvTrailingMetadataReady(
2917
3061
  status = absl::Status(static_cast<absl::StatusCode>(code), message);
2918
3062
  }
2919
3063
  }
2920
- self->RecordCallCompletion(status);
3064
+ absl::string_view peer_string;
3065
+ if (self->peer_string_.has_value()) {
3066
+ peer_string = self->peer_string_->as_string_view();
3067
+ }
3068
+ self->RecordCallCompletion(status, self->recv_trailing_metadata_,
3069
+ self->transport_stream_stats_, peer_string);
2921
3070
  }
2922
3071
  // Chain to original callback.
2923
3072
  if (!self->failure_error_.ok()) {
@@ -2928,54 +3077,6 @@ void ClientChannel::LoadBalancedCall::RecvTrailingMetadataReady(
2928
3077
  error);
2929
3078
  }
2930
3079
 
2931
- void ClientChannel::LoadBalancedCall::RecordCallCompletion(
2932
- absl::Status status) {
2933
- // If we have a tracer, notify it.
2934
- if (call_attempt_tracer_ != nullptr) {
2935
- call_attempt_tracer_->RecordReceivedTrailingMetadata(
2936
- status, recv_trailing_metadata_, transport_stream_stats_);
2937
- }
2938
- // If the LB policy requested a callback for trailing metadata, invoke
2939
- // the callback.
2940
- if (lb_subchannel_call_tracker_ != nullptr) {
2941
- Metadata trailing_metadata(recv_trailing_metadata_);
2942
- BackendMetricAccessor backend_metric_accessor(this);
2943
- const char* peer_string =
2944
- peer_string_ != nullptr
2945
- ? reinterpret_cast<char*>(gpr_atm_acq_load(peer_string_))
2946
- : "";
2947
- LoadBalancingPolicy::SubchannelCallTrackerInterface::FinishArgs args = {
2948
- peer_string, status, &trailing_metadata, &backend_metric_accessor};
2949
- lb_subchannel_call_tracker_->Finish(args);
2950
- lb_subchannel_call_tracker_.reset();
2951
- }
2952
- }
2953
-
2954
- void ClientChannel::LoadBalancedCall::CreateSubchannelCall() {
2955
- SubchannelCall::Args call_args = {
2956
- std::move(connected_subchannel_), pollent_, path_.Ref(), /*start_time=*/0,
2957
- deadline_, arena_,
2958
- // TODO(roth): When we implement hedging support, we will probably
2959
- // need to use a separate call context for each subchannel call.
2960
- call_context_, call_combiner_};
2961
- grpc_error_handle error;
2962
- subchannel_call_ = SubchannelCall::Create(std::move(call_args), &error);
2963
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
2964
- gpr_log(GPR_INFO,
2965
- "chand=%p lb_call=%p: create subchannel_call=%p: error=%s", chand_,
2966
- this, subchannel_call_.get(), StatusToString(error).c_str());
2967
- }
2968
- if (on_call_destruction_complete_ != nullptr) {
2969
- subchannel_call_->SetAfterCallStackDestroy(on_call_destruction_complete_);
2970
- on_call_destruction_complete_ = nullptr;
2971
- }
2972
- if (GPR_UNLIKELY(!error.ok())) {
2973
- PendingBatchesFail(error, YieldCallCombiner);
2974
- } else {
2975
- PendingBatchesResume();
2976
- }
2977
- }
2978
-
2979
3080
  // A class to handle the call combiner cancellation callback for a
2980
3081
  // queued pick.
2981
3082
  // TODO(roth): When we implement hedging support, we won't be able to
@@ -2983,9 +3084,10 @@ void ClientChannel::LoadBalancedCall::CreateSubchannelCall() {
2983
3084
  // because there may be multiple LB picks happening in parallel.
2984
3085
  // Instead, we will probably need to maintain a list in the CallData
2985
3086
  // object of pending LB picks to be cancelled when the closure runs.
2986
- class ClientChannel::LoadBalancedCall::LbQueuedCallCanceller {
3087
+ class ClientChannel::FilterBasedLoadBalancedCall::LbQueuedCallCanceller {
2987
3088
  public:
2988
- explicit LbQueuedCallCanceller(RefCountedPtr<LoadBalancedCall> lb_call)
3089
+ explicit LbQueuedCallCanceller(
3090
+ RefCountedPtr<FilterBasedLoadBalancedCall> lb_call)
2989
3091
  : lb_call_(std::move(lb_call)) {
2990
3092
  GRPC_CALL_STACK_REF(lb_call_->owning_call_, "LbQueuedCallCanceller");
2991
3093
  GRPC_CLOSURE_INIT(&closure_, &CancelLocked, this, nullptr);
@@ -2996,9 +3098,9 @@ class ClientChannel::LoadBalancedCall::LbQueuedCallCanceller {
2996
3098
  static void CancelLocked(void* arg, grpc_error_handle error) {
2997
3099
  auto* self = static_cast<LbQueuedCallCanceller*>(arg);
2998
3100
  auto* lb_call = self->lb_call_.get();
2999
- auto* chand = lb_call->chand_;
3101
+ auto* chand = lb_call->chand();
3000
3102
  {
3001
- MutexLock lock(&chand->data_plane_mu_);
3103
+ MutexLock lock(&chand->lb_mu_);
3002
3104
  if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
3003
3105
  gpr_log(GPR_INFO,
3004
3106
  "chand=%p lb_call=%p: cancelling queued pick: "
@@ -3007,187 +3109,98 @@ class ClientChannel::LoadBalancedCall::LbQueuedCallCanceller {
3007
3109
  lb_call->lb_call_canceller_);
3008
3110
  }
3009
3111
  if (lb_call->lb_call_canceller_ == self && !error.ok()) {
3010
- lb_call->call_dispatch_controller_->Commit();
3112
+ lb_call->Commit();
3011
3113
  // Remove pick from list of queued picks.
3012
- lb_call->MaybeRemoveCallFromLbQueuedCallsLocked();
3114
+ lb_call->RemoveCallFromLbQueuedCallsLocked();
3115
+ // Remove from queued picks list.
3116
+ chand->lb_queued_calls_.erase(lb_call);
3013
3117
  // Fail pending batches on the call.
3014
3118
  lb_call->PendingBatchesFail(error,
3015
3119
  YieldCallCombinerIfPendingBatchesFound);
3016
3120
  }
3017
3121
  }
3018
- GRPC_CALL_STACK_UNREF(lb_call->owning_call_, "LbQueuedCallCanceller");
3122
+ // Unref lb_call before unreffing the call stack, since unreffing
3123
+ // the call stack may destroy the arena in which lb_call is allocated.
3124
+ auto* owning_call = lb_call->owning_call_;
3125
+ self->lb_call_.reset();
3126
+ GRPC_CALL_STACK_UNREF(owning_call, "LbQueuedCallCanceller");
3019
3127
  delete self;
3020
3128
  }
3021
3129
 
3022
- RefCountedPtr<LoadBalancedCall> lb_call_;
3130
+ RefCountedPtr<FilterBasedLoadBalancedCall> lb_call_;
3023
3131
  grpc_closure closure_;
3024
3132
  };
3025
3133
 
3026
- void ClientChannel::LoadBalancedCall::MaybeRemoveCallFromLbQueuedCallsLocked() {
3027
- if (!queued_pending_lb_pick_) return;
3028
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
3029
- gpr_log(GPR_INFO, "chand=%p lb_call=%p: removing from queued picks list",
3030
- chand_, this);
3031
- }
3032
- chand_->RemoveLbQueuedCall(&queued_call_, pollent_);
3033
- queued_pending_lb_pick_ = false;
3034
- // Lame the call combiner canceller.
3035
- lb_call_canceller_ = nullptr;
3036
- // Add trace annotation
3037
- if (call_attempt_tracer_ != nullptr) {
3038
- call_attempt_tracer_->RecordAnnotation("Delayed LB pick complete.");
3134
+ void ClientChannel::FilterBasedLoadBalancedCall::TryPick(bool was_queued) {
3135
+ auto result = PickSubchannel(was_queued);
3136
+ if (result.has_value()) {
3137
+ if (!result->ok()) {
3138
+ PendingBatchesFail(*result, YieldCallCombiner);
3139
+ return;
3140
+ }
3141
+ CreateSubchannelCall();
3039
3142
  }
3040
3143
  }
3041
3144
 
3042
- void ClientChannel::LoadBalancedCall::MaybeAddCallToLbQueuedCallsLocked() {
3043
- if (queued_pending_lb_pick_) return;
3044
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
3045
- gpr_log(GPR_INFO, "chand=%p lb_call=%p: adding to queued picks list",
3046
- chand_, this);
3047
- }
3048
- queued_pending_lb_pick_ = true;
3049
- queued_call_.lb_call = this;
3050
- chand_->AddLbQueuedCall(&queued_call_, pollent_);
3145
+ void ClientChannel::FilterBasedLoadBalancedCall::OnAddToQueueLocked() {
3051
3146
  // Register call combiner cancellation callback.
3052
3147
  lb_call_canceller_ = new LbQueuedCallCanceller(Ref());
3053
3148
  }
3054
3149
 
3055
- void ClientChannel::LoadBalancedCall::AsyncPickDone(grpc_error_handle error) {
3056
- // TODO(roth): Does this callback need to hold a ref to LoadBalancedCall?
3057
- GRPC_CLOSURE_INIT(&pick_closure_, PickDone, this, grpc_schedule_on_exec_ctx);
3058
- ExecCtx::Run(DEBUG_LOCATION, &pick_closure_, error);
3059
- }
3060
-
3061
- void ClientChannel::LoadBalancedCall::PickDone(void* arg,
3062
- grpc_error_handle error) {
3063
- auto* self = static_cast<LoadBalancedCall*>(arg);
3064
- if (!error.ok()) {
3065
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
3066
- gpr_log(GPR_INFO,
3067
- "chand=%p lb_call=%p: failed to pick subchannel: error=%s",
3068
- self->chand_, self, StatusToString(error).c_str());
3069
- }
3070
- self->PendingBatchesFail(error, YieldCallCombiner);
3071
- return;
3150
+ void ClientChannel::FilterBasedLoadBalancedCall::RetryPickLocked() {
3151
+ // Lame the call combiner canceller.
3152
+ lb_call_canceller_ = nullptr;
3153
+ // Do an async callback to resume call processing, so that we're not
3154
+ // doing it while holding the channel's LB mutex.
3155
+ // TODO(roth): We should really be using EventEngine::Run() here
3156
+ // instead of ExecCtx::Run(). Unfortunately, doing that seems to cause
3157
+ // a flaky TSAN failure for reasons that I do not fully understand.
3158
+ // However, given that we are working toward eliminating this code as
3159
+ // part of the promise conversion, it doesn't seem worth further
3160
+ // investigation right now.
3161
+ ExecCtx::Run(DEBUG_LOCATION, NewClosure([this](grpc_error_handle) {
3162
+ // If there are a lot of queued calls here, resuming them
3163
+ // all may cause us to stay inside C-core for a long period
3164
+ // of time. All of that work would be done using the same
3165
+ // ExecCtx instance and therefore the same cached value of
3166
+ // "now". The longer it takes to finish all of this work
3167
+ // and exit from C-core, the more stale the cached value of
3168
+ // "now" may become. This can cause problems whereby (e.g.)
3169
+ // we calculate a timer deadline based on the stale value,
3170
+ // which results in the timer firing too early. To avoid
3171
+ // this, we invalidate the cached value for each call we
3172
+ // process.
3173
+ ExecCtx::Get()->InvalidateNow();
3174
+ TryPick(/*was_queued=*/true);
3175
+ }),
3176
+ absl::OkStatus());
3177
+ }
3178
+
3179
+ void ClientChannel::FilterBasedLoadBalancedCall::CreateSubchannelCall() {
3180
+ Slice* path = send_initial_metadata()->get_pointer(HttpPathMetadata());
3181
+ GPR_ASSERT(path != nullptr);
3182
+ SubchannelCall::Args call_args = {
3183
+ connected_subchannel()->Ref(), pollent_, path->Ref(), /*start_time=*/0,
3184
+ deadline_, arena_,
3185
+ // TODO(roth): When we implement hedging support, we will probably
3186
+ // need to use a separate call context for each subchannel call.
3187
+ call_context_, call_combiner_};
3188
+ grpc_error_handle error;
3189
+ subchannel_call_ = SubchannelCall::Create(std::move(call_args), &error);
3190
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
3191
+ gpr_log(GPR_INFO,
3192
+ "chand=%p lb_call=%p: create subchannel_call=%p: error=%s", chand(),
3193
+ this, subchannel_call_.get(), StatusToString(error).c_str());
3072
3194
  }
3073
- self->call_dispatch_controller_->Commit();
3074
- self->CreateSubchannelCall();
3075
- }
3076
-
3077
- void ClientChannel::LoadBalancedCall::PickSubchannel(void* arg,
3078
- grpc_error_handle error) {
3079
- auto* self = static_cast<LoadBalancedCall*>(arg);
3080
- bool pick_complete;
3081
- {
3082
- MutexLock lock(&self->chand_->data_plane_mu_);
3083
- pick_complete = self->PickSubchannelLocked(&error);
3195
+ if (on_call_destruction_complete_ != nullptr) {
3196
+ subchannel_call_->SetAfterCallStackDestroy(on_call_destruction_complete_);
3197
+ on_call_destruction_complete_ = nullptr;
3084
3198
  }
3085
- if (pick_complete) {
3086
- PickDone(self, error);
3199
+ if (GPR_UNLIKELY(!error.ok())) {
3200
+ PendingBatchesFail(error, YieldCallCombiner);
3201
+ } else {
3202
+ PendingBatchesResume();
3087
3203
  }
3088
3204
  }
3089
3205
 
3090
- bool ClientChannel::LoadBalancedCall::PickSubchannelLocked(
3091
- grpc_error_handle* error) {
3092
- GPR_ASSERT(connected_subchannel_ == nullptr);
3093
- GPR_ASSERT(subchannel_call_ == nullptr);
3094
- // Grab initial metadata.
3095
- auto& send_initial_metadata =
3096
- pending_batches_[0]->payload->send_initial_metadata;
3097
- grpc_metadata_batch* initial_metadata_batch =
3098
- send_initial_metadata.send_initial_metadata;
3099
- // Perform LB pick.
3100
- LoadBalancingPolicy::PickArgs pick_args;
3101
- pick_args.path = path_.as_string_view();
3102
- LbCallState lb_call_state(this);
3103
- pick_args.call_state = &lb_call_state;
3104
- Metadata initial_metadata(initial_metadata_batch);
3105
- pick_args.initial_metadata = &initial_metadata;
3106
- auto result = chand_->picker_->Pick(pick_args);
3107
- return HandlePickResult<bool>(
3108
- &result,
3109
- // CompletePick
3110
- [this](LoadBalancingPolicy::PickResult::Complete* complete_pick)
3111
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::data_plane_mu_) {
3112
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
3113
- gpr_log(GPR_INFO,
3114
- "chand=%p lb_call=%p: LB pick succeeded: subchannel=%p",
3115
- chand_, this, complete_pick->subchannel.get());
3116
- }
3117
- GPR_ASSERT(complete_pick->subchannel != nullptr);
3118
- // Grab a ref to the connected subchannel while we're still
3119
- // holding the data plane mutex.
3120
- SubchannelWrapper* subchannel = static_cast<SubchannelWrapper*>(
3121
- complete_pick->subchannel.get());
3122
- connected_subchannel_ = subchannel->connected_subchannel();
3123
- // If the subchannel has no connected subchannel (e.g., if the
3124
- // subchannel has moved out of state READY but the LB policy hasn't
3125
- // yet seen that change and given us a new picker), then just
3126
- // queue the pick. We'll try again as soon as we get a new picker.
3127
- if (connected_subchannel_ == nullptr) {
3128
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
3129
- gpr_log(GPR_INFO,
3130
- "chand=%p lb_call=%p: subchannel returned by LB picker "
3131
- "has no connected subchannel; queueing pick",
3132
- chand_, this);
3133
- }
3134
- MaybeAddCallToLbQueuedCallsLocked();
3135
- return false;
3136
- }
3137
- lb_subchannel_call_tracker_ =
3138
- std::move(complete_pick->subchannel_call_tracker);
3139
- if (lb_subchannel_call_tracker_ != nullptr) {
3140
- lb_subchannel_call_tracker_->Start();
3141
- }
3142
- MaybeRemoveCallFromLbQueuedCallsLocked();
3143
- return true;
3144
- },
3145
- // QueuePick
3146
- [this](LoadBalancingPolicy::PickResult::Queue* /*queue_pick*/)
3147
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::data_plane_mu_) {
3148
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
3149
- gpr_log(GPR_INFO, "chand=%p lb_call=%p: LB pick queued", chand_,
3150
- this);
3151
- }
3152
- MaybeAddCallToLbQueuedCallsLocked();
3153
- return false;
3154
- },
3155
- // FailPick
3156
- [this, initial_metadata_batch,
3157
- &error](LoadBalancingPolicy::PickResult::Fail* fail_pick)
3158
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::data_plane_mu_) {
3159
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
3160
- gpr_log(GPR_INFO, "chand=%p lb_call=%p: LB pick failed: %s",
3161
- chand_, this, fail_pick->status.ToString().c_str());
3162
- }
3163
- // If wait_for_ready is false, then the error indicates the RPC
3164
- // attempt's final status.
3165
- if (!initial_metadata_batch->GetOrCreatePointer(WaitForReady())
3166
- ->value) {
3167
- *error = absl_status_to_grpc_error(MaybeRewriteIllegalStatusCode(
3168
- std::move(fail_pick->status), "LB pick"));
3169
- MaybeRemoveCallFromLbQueuedCallsLocked();
3170
- return true;
3171
- }
3172
- // If wait_for_ready is true, then queue to retry when we get a new
3173
- // picker.
3174
- MaybeAddCallToLbQueuedCallsLocked();
3175
- return false;
3176
- },
3177
- // DropPick
3178
- [this, &error](LoadBalancingPolicy::PickResult::Drop* drop_pick)
3179
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::data_plane_mu_) {
3180
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
3181
- gpr_log(GPR_INFO, "chand=%p lb_call=%p: LB pick dropped: %s",
3182
- chand_, this, drop_pick->status.ToString().c_str());
3183
- }
3184
- *error = grpc_error_set_int(
3185
- absl_status_to_grpc_error(MaybeRewriteIllegalStatusCode(
3186
- std::move(drop_pick->status), "LB drop")),
3187
- StatusIntProperty::kLbPolicyDrop, 1);
3188
- MaybeRemoveCallFromLbQueuedCallsLocked();
3189
- return true;
3190
- });
3191
- }
3192
-
3193
3206
  } // namespace grpc_core