grpc 1.45.0 → 1.46.3

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 (515) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +36 -29
  3. data/include/grpc/impl/codegen/grpc_types.h +7 -13
  4. data/src/core/ext/filters/channel_idle/channel_idle_filter.cc +309 -0
  5. data/src/core/ext/filters/channel_idle/channel_idle_filter.h +122 -0
  6. data/src/core/ext/filters/{client_idle → channel_idle}/idle_filter_state.cc +1 -1
  7. data/src/core/ext/filters/{client_idle → channel_idle}/idle_filter_state.h +3 -3
  8. data/src/core/ext/filters/client_channel/client_channel.cc +163 -96
  9. data/src/core/ext/filters/client_channel/client_channel.h +2 -0
  10. data/src/core/ext/filters/client_channel/health/health_check_client.cc +124 -581
  11. data/src/core/ext/filters/client_channel/health/health_check_client.h +24 -160
  12. data/src/core/ext/filters/client_channel/http_proxy.cc +88 -110
  13. data/src/core/ext/filters/client_channel/http_proxy.h +17 -0
  14. data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +182 -142
  15. data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +2 -6
  16. data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +1 -10
  17. data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +87 -58
  18. data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +51 -48
  19. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +14 -7
  20. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +229 -284
  21. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +92 -257
  22. data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +51 -221
  23. data/src/core/ext/filters/client_channel/resolver/polling_resolver.cc +201 -0
  24. data/src/core/ext/filters/client_channel/resolver/polling_resolver.h +106 -0
  25. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +102 -55
  26. data/src/core/ext/filters/client_channel/retry_filter.cc +18 -3
  27. data/src/core/ext/filters/client_channel/subchannel.cc +5 -5
  28. data/src/core/ext/filters/client_channel/subchannel_stream_client.cc +544 -0
  29. data/src/core/ext/filters/client_channel/subchannel_stream_client.h +214 -0
  30. data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +127 -367
  31. data/src/core/ext/filters/fault_injection/fault_injection_filter.h +24 -1
  32. data/src/core/ext/filters/http/client/http_client_filter.cc +78 -458
  33. data/src/core/ext/filters/http/client/http_client_filter.h +21 -4
  34. data/src/core/ext/filters/http/client_authority_filter.cc +17 -22
  35. data/src/core/ext/filters/http/client_authority_filter.h +6 -5
  36. data/src/core/ext/filters/http/http_filters_plugin.cc +9 -6
  37. data/src/core/ext/filters/http/server/http_server_filter.cc +2 -116
  38. data/src/core/ext/filters/server_config_selector/server_config_selector.cc +2 -8
  39. data/src/core/ext/filters/server_config_selector/server_config_selector.h +2 -2
  40. data/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc +73 -201
  41. data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +2 -1
  42. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +5 -4
  43. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +139 -28
  44. data/src/core/ext/transport/chttp2/transport/frame_settings.cc +2 -0
  45. data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +2 -6
  46. data/src/core/ext/transport/chttp2/transport/internal.h +4 -2
  47. data/src/core/ext/transport/chttp2/transport/parsing.cc +8 -0
  48. data/src/core/ext/transport/chttp2/transport/writing.cc +24 -13
  49. data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c +27 -24
  50. data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h +143 -63
  51. data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c +37 -35
  52. data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h +177 -77
  53. data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c +115 -111
  54. data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h +547 -207
  55. data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c +5 -5
  56. data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h +26 -13
  57. data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c +5 -5
  58. data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h +23 -9
  59. data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c +7 -7
  60. data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h +18 -0
  61. data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c +4 -4
  62. data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h +13 -4
  63. data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c +4 -4
  64. data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h +9 -0
  65. data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c +49 -46
  66. data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h +217 -78
  67. data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c +3 -3
  68. data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h +10 -2
  69. data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c +12 -12
  70. data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +40 -8
  71. data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +5 -5
  72. data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +20 -2
  73. data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +55 -55
  74. data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +289 -110
  75. data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +133 -125
  76. data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +656 -267
  77. data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c +24 -18
  78. data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h +96 -23
  79. data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +185 -173
  80. data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +860 -309
  81. data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c +3 -3
  82. data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h +10 -2
  83. data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +44 -24
  84. data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +165 -40
  85. data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c +72 -63
  86. data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h +433 -174
  87. data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +33 -31
  88. data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +154 -52
  89. data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c +5 -4
  90. data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h +14 -4
  91. data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +89 -89
  92. data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +460 -166
  93. data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +76 -33
  94. data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +379 -69
  95. data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c +2 -2
  96. data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h +14 -6
  97. data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c +5 -25
  98. data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h +10 -91
  99. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c +5 -5
  100. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h +26 -13
  101. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +70 -68
  102. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +369 -131
  103. data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +94 -65
  104. data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +447 -161
  105. data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c +4 -4
  106. data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h +27 -11
  107. data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +104 -85
  108. data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +378 -113
  109. data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +2 -2
  110. data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h +3 -0
  111. data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c +6 -6
  112. data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h +30 -13
  113. data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +7 -7
  114. data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +43 -16
  115. data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +8 -8
  116. data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +58 -24
  117. data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c +4 -4
  118. data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h +14 -4
  119. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +18 -18
  120. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h +100 -43
  121. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +31 -30
  122. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +171 -71
  123. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c +32 -32
  124. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h +196 -95
  125. data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c +2 -2
  126. data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h +7 -2
  127. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +53 -46
  128. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +284 -129
  129. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +56 -50
  130. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +337 -146
  131. data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +13 -11
  132. data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +49 -14
  133. data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +4 -4
  134. data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +14 -4
  135. data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c +5 -5
  136. data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h +20 -4
  137. data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c +33 -32
  138. data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h +205 -86
  139. data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c +34 -34
  140. data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h +175 -74
  141. data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +56 -52
  142. data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +370 -146
  143. data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +27 -23
  144. data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +173 -74
  145. data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +362 -341
  146. data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +2056 -845
  147. data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c +11 -11
  148. data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h +49 -16
  149. data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c +56 -50
  150. data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h +293 -111
  151. data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c +3 -3
  152. data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h +6 -0
  153. data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c +3 -3
  154. data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h +10 -2
  155. data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +5 -5
  156. data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h +26 -10
  157. data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c +5 -5
  158. data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h +27 -12
  159. data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c +17 -16
  160. data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h +83 -36
  161. data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c +2 -2
  162. data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h +7 -2
  163. data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c +8 -8
  164. data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h +46 -17
  165. data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c +9 -9
  166. data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h +38 -12
  167. data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c +7 -7
  168. data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h +30 -10
  169. data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c +2 -2
  170. data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +10 -6
  171. data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c +15 -15
  172. data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h +71 -28
  173. data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +25 -25
  174. data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +149 -65
  175. data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c +8 -7
  176. data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +30 -12
  177. data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +9 -9
  178. data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +42 -15
  179. data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +173 -144
  180. data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +898 -323
  181. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +51 -45
  182. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +261 -116
  183. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +13 -13
  184. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +70 -25
  185. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +80 -55
  186. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +410 -124
  187. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c +5 -5
  188. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h +23 -9
  189. data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c +1 -1
  190. data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +44 -44
  191. data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +261 -122
  192. data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +8 -8
  193. data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h +47 -21
  194. data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c +32 -32
  195. data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h +175 -66
  196. data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c +4 -4
  197. data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h +17 -6
  198. data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c +8 -8
  199. data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h +38 -17
  200. data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c +8 -8
  201. data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h +12 -0
  202. data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c +7 -7
  203. data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h +43 -18
  204. data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c +3 -3
  205. data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h +20 -9
  206. data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c +3 -3
  207. data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h +24 -9
  208. data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c +2 -2
  209. data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h +14 -6
  210. data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +8 -8
  211. data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h +40 -16
  212. data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +9 -9
  213. data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h +70 -25
  214. data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c +5 -5
  215. data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h +37 -18
  216. data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c +12 -12
  217. data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h +81 -30
  218. data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c +16 -16
  219. data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h +76 -30
  220. data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c +20 -20
  221. data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h +90 -30
  222. data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c +7 -7
  223. data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h +28 -10
  224. data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c +2 -2
  225. data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h +3 -0
  226. data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c +5 -5
  227. data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h +13 -4
  228. data/src/core/ext/upb-generated/envoy/type/v3/range.upb.c +9 -9
  229. data/src/core/ext/upb-generated/envoy/type/v3/range.upb.h +18 -0
  230. data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c +4 -4
  231. data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h +9 -0
  232. data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c +5 -5
  233. data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h +17 -4
  234. data/src/core/ext/upb-generated/google/api/annotations.upb.c +3 -3
  235. data/src/core/ext/upb-generated/google/api/annotations.upb.h +17 -2
  236. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c +70 -66
  237. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h +410 -162
  238. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +80 -74
  239. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +440 -158
  240. data/src/core/ext/upb-generated/google/api/http.upb.c +17 -17
  241. data/src/core/ext/upb-generated/google/api/http.upb.h +116 -43
  242. data/src/core/ext/upb-generated/google/api/httpbody.upb.c +4 -4
  243. data/src/core/ext/upb-generated/google/api/httpbody.upb.h +19 -7
  244. data/src/core/ext/upb-generated/google/protobuf/any.upb.c +3 -3
  245. data/src/core/ext/upb-generated/google/protobuf/any.upb.h +6 -0
  246. data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +163 -162
  247. data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +1157 -435
  248. data/src/core/ext/upb-generated/google/protobuf/duration.upb.c +3 -3
  249. data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +10 -4
  250. data/src/core/ext/upb-generated/google/protobuf/empty.upb.c +1 -1
  251. data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +15 -15
  252. data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +108 -40
  253. data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +3 -3
  254. data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +10 -4
  255. data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +18 -18
  256. data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +27 -0
  257. data/src/core/ext/upb-generated/google/rpc/status.upb.c +4 -4
  258. data/src/core/ext/upb-generated/google/rpc/status.upb.h +19 -7
  259. data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c +15 -15
  260. data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h +65 -22
  261. data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +12 -12
  262. data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +49 -12
  263. data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +69 -65
  264. data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +364 -149
  265. data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c +8 -7
  266. data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +20 -4
  267. data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c +4 -4
  268. data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +6 -0
  269. data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +31 -31
  270. data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +150 -58
  271. data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c +11 -11
  272. data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h +51 -18
  273. data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c +175 -0
  274. data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h +764 -0
  275. data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +22 -22
  276. data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +97 -10
  277. data/src/core/ext/upb-generated/udpa/annotations/security.upb.c +6 -6
  278. data/src/core/ext/upb-generated/udpa/annotations/security.upb.h +23 -2
  279. data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c +3 -3
  280. data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +10 -2
  281. data/src/core/ext/upb-generated/udpa/annotations/status.upb.c +6 -6
  282. data/src/core/ext/upb-generated/udpa/annotations/status.upb.h +27 -6
  283. data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c +5 -5
  284. data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h +20 -2
  285. data/src/core/ext/upb-generated/validate/validate.upb.c +261 -250
  286. data/src/core/ext/upb-generated/validate/validate.upb.h +1836 -663
  287. data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c +22 -22
  288. data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h +97 -10
  289. data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.c +6 -6
  290. data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.h +23 -2
  291. data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c +3 -3
  292. data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h +10 -2
  293. data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c +18 -18
  294. data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h +70 -10
  295. data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c +5 -5
  296. data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h +20 -2
  297. data/src/core/ext/upb-generated/xds/core/v3/authority.upb.c +2 -2
  298. data/src/core/ext/upb-generated/xds/core/v3/authority.upb.h +3 -0
  299. data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c +8 -8
  300. data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h +38 -12
  301. data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c +5 -5
  302. data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h +27 -10
  303. data/src/core/ext/upb-generated/xds/core/v3/extension.upb.c +3 -3
  304. data/src/core/ext/upb-generated/xds/core/v3/extension.upb.h +10 -2
  305. data/src/core/ext/upb-generated/xds/core/v3/resource.upb.c +5 -5
  306. data/src/core/ext/upb-generated/xds/core/v3/resource.upb.h +21 -8
  307. data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c +10 -10
  308. data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h +71 -30
  309. data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c +5 -5
  310. data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h +16 -2
  311. data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c +12 -12
  312. data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h +69 -26
  313. data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c +43 -39
  314. data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h +255 -103
  315. data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c +4 -4
  316. data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h +19 -8
  317. data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c +9 -9
  318. data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h +70 -25
  319. data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c +3 -3
  320. data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h +10 -2
  321. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c +50 -46
  322. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +195 -185
  323. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c +16 -12
  324. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +129 -94
  325. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h +10 -0
  326. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c +18 -33
  327. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h +0 -5
  328. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +163 -155
  329. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h +5 -0
  330. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c +141 -138
  331. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +26 -20
  332. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +738 -730
  333. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +271 -251
  334. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +5 -0
  335. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +207 -193
  336. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h +5 -0
  337. data/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c +99 -0
  338. data/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h +75 -0
  339. data/src/core/ext/xds/certificate_provider_store.cc +8 -0
  340. data/src/core/ext/xds/certificate_provider_store.h +9 -0
  341. data/src/core/ext/xds/xds_api.cc +20 -0
  342. data/src/core/ext/xds/xds_bootstrap.cc +2 -2
  343. data/src/core/ext/xds/xds_bootstrap.h +2 -0
  344. data/src/core/ext/xds/xds_certificate_provider.cc +2 -0
  345. data/src/core/ext/xds/xds_certificate_provider.h +8 -0
  346. data/src/core/ext/xds/xds_client.cc +87 -95
  347. data/src/core/ext/xds/xds_client.h +13 -5
  348. data/src/core/ext/xds/xds_cluster_specifier_plugin.cc +142 -0
  349. data/src/core/ext/xds/xds_cluster_specifier_plugin.h +79 -0
  350. data/src/core/ext/xds/xds_common_types.cc +9 -9
  351. data/src/core/ext/xds/xds_common_types.h +3 -3
  352. data/src/core/ext/xds/xds_endpoint.cc +12 -5
  353. data/src/core/ext/xds/xds_http_fault_filter.cc +1 -1
  354. data/src/core/ext/xds/xds_listener.cc +1 -1
  355. data/src/core/ext/xds/xds_route_config.cc +162 -25
  356. data/src/core/ext/xds/xds_route_config.h +13 -10
  357. data/src/core/ext/xds/xds_server_config_fetcher.cc +17 -22
  358. data/src/core/lib/avl/avl.h +68 -5
  359. data/src/core/lib/channel/call_tracer.h +4 -1
  360. data/src/core/lib/channel/channel_args.cc +138 -59
  361. data/src/core/lib/channel/channel_args.h +210 -9
  362. data/src/core/lib/channel/channel_args_preconditioning.cc +3 -9
  363. data/src/core/lib/channel/channel_args_preconditioning.h +1 -2
  364. data/src/core/lib/channel/channel_stack.h +2 -5
  365. data/src/core/lib/channel/channel_stack_builder.cc +0 -65
  366. data/src/core/lib/channel/channel_stack_builder.h +27 -6
  367. data/src/core/lib/channel/channel_stack_builder_impl.cc +102 -0
  368. data/src/core/lib/channel/channel_stack_builder_impl.h +48 -0
  369. data/src/core/lib/channel/connected_channel.h +1 -0
  370. data/src/core/lib/channel/promise_based_filter.cc +495 -162
  371. data/src/core/lib/channel/promise_based_filter.h +55 -41
  372. data/src/core/lib/compression/compression_internal.cc +1 -7
  373. data/src/core/lib/debug/stats_data.cc +2 -6
  374. data/src/core/lib/debug/stats_data.h +18 -21
  375. data/src/core/lib/gpr/tls.h +1 -0
  376. data/src/core/lib/gprpp/bitset.h +12 -0
  377. data/src/core/lib/gprpp/cpp_impl_of.h +4 -0
  378. data/src/core/lib/gprpp/match.h +73 -0
  379. data/src/core/lib/gprpp/overload.h +59 -0
  380. data/src/core/lib/gprpp/ref_counted.h +2 -0
  381. data/src/core/lib/gprpp/single_set_ptr.h +87 -0
  382. data/src/core/lib/gprpp/status_helper.cc +18 -2
  383. data/src/core/lib/gprpp/time.cc +12 -0
  384. data/src/core/lib/gprpp/time.h +1 -1
  385. data/src/core/lib/http/format_request.cc +1 -2
  386. data/src/core/lib/http/httpcli_security_connector.cc +5 -5
  387. data/src/core/lib/http/parser.cc +80 -9
  388. data/src/core/lib/http/parser.h +14 -1
  389. data/src/core/lib/iomgr/ev_posix.cc +6 -7
  390. data/src/core/lib/iomgr/fork_posix.cc +1 -1
  391. data/src/core/lib/iomgr/port.h +0 -2
  392. data/src/core/lib/iomgr/tcp_client_posix.cc +2 -2
  393. data/src/core/lib/iomgr/tcp_posix.cc +93 -35
  394. data/src/core/lib/iomgr/tcp_server_posix.cc +26 -17
  395. data/src/core/lib/json/json_util.h +3 -3
  396. data/src/core/lib/promise/call_push_pull.h +144 -0
  397. data/src/core/lib/promise/detail/status.h +2 -1
  398. data/src/core/lib/promise/intra_activity_waiter.h +49 -0
  399. data/src/core/lib/promise/latch.h +104 -0
  400. data/src/core/lib/resource_quota/api.cc +5 -30
  401. data/src/core/lib/resource_quota/api.h +1 -1
  402. data/src/core/lib/resource_quota/resource_quota.h +8 -0
  403. data/src/core/lib/security/authorization/authorization_policy_provider.h +7 -0
  404. data/src/core/lib/security/authorization/grpc_server_authz_filter.cc +9 -12
  405. data/src/core/lib/security/authorization/grpc_server_authz_filter.h +5 -6
  406. data/src/core/lib/security/context/security_context.h +8 -1
  407. data/src/core/lib/security/credentials/alts/alts_credentials.cc +6 -5
  408. data/src/core/lib/security/credentials/alts/alts_credentials.h +4 -0
  409. data/src/core/lib/security/credentials/call_creds_util.cc +3 -3
  410. data/src/core/lib/security/credentials/call_creds_util.h +2 -2
  411. data/src/core/lib/security/credentials/composite/composite_credentials.cc +15 -10
  412. data/src/core/lib/security/credentials/composite/composite_credentials.h +9 -8
  413. data/src/core/lib/security/credentials/credentials.h +16 -33
  414. data/src/core/lib/security/credentials/fake/fake_credentials.cc +8 -12
  415. data/src/core/lib/security/credentials/fake/fake_credentials.h +8 -5
  416. data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +4 -0
  417. data/src/core/lib/security/credentials/google_default/google_default_credentials.h +3 -3
  418. data/src/core/lib/security/credentials/iam/iam_credentials.cc +5 -4
  419. data/src/core/lib/security/credentials/iam/iam_credentials.h +6 -2
  420. data/src/core/lib/security/credentials/insecure/insecure_credentials.cc +22 -29
  421. data/src/core/lib/security/credentials/insecure/insecure_credentials.h +57 -0
  422. data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +7 -3
  423. data/src/core/lib/security/credentials/jwt/jwt_credentials.h +6 -2
  424. data/src/core/lib/security/credentials/local/local_credentials.cc +6 -6
  425. data/src/core/lib/security/credentials/local/local_credentials.h +4 -0
  426. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +17 -9
  427. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +14 -6
  428. data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +8 -6
  429. data/src/core/lib/security/credentials/plugin/plugin_credentials.h +8 -6
  430. data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +6 -4
  431. data/src/core/lib/security/credentials/ssl/ssl_credentials.h +8 -0
  432. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +49 -0
  433. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc +8 -0
  434. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h +42 -3
  435. data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +66 -95
  436. data/src/core/lib/security/credentials/tls/tls_credentials.cc +9 -6
  437. data/src/core/lib/security/credentials/tls/tls_credentials.h +5 -5
  438. data/src/core/lib/security/credentials/xds/xds_credentials.cc +48 -50
  439. data/src/core/lib/security/credentials/xds/xds_credentials.h +31 -5
  440. data/src/core/lib/security/security_connector/local/local_security_connector.cc +2 -2
  441. data/src/core/lib/security/security_connector/security_connector.h +9 -0
  442. data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +4 -2
  443. data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +4 -2
  444. data/src/core/lib/security/transport/auth_filters.h +7 -7
  445. data/src/core/lib/security/transport/client_auth_filter.cc +28 -20
  446. data/src/core/lib/security/transport/secure_endpoint.cc +198 -129
  447. data/src/core/lib/security/transport/secure_endpoint.h +1 -1
  448. data/src/core/lib/security/transport/security_handshaker.cc +6 -4
  449. data/src/core/lib/surface/call.cc +1023 -903
  450. data/src/core/lib/surface/call.h +0 -14
  451. data/src/core/lib/surface/channel.cc +4 -3
  452. data/src/core/lib/surface/channel_init.cc +2 -3
  453. data/src/core/lib/surface/channel_init.h +2 -6
  454. data/src/core/lib/surface/init.cc +1 -1
  455. data/src/core/lib/surface/server.cc +3 -14
  456. data/src/core/lib/surface/server.h +1 -2
  457. data/src/core/lib/surface/version.cc +2 -2
  458. data/src/core/lib/transport/byte_stream.cc +2 -0
  459. data/src/core/lib/transport/metadata_batch.h +12 -8
  460. data/src/core/lib/transport/transport.h +20 -5
  461. data/src/core/lib/transport/transport_impl.h +4 -3
  462. data/src/core/plugin_registry/grpc_plugin_registry.cc +2 -4
  463. data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +2 -2
  464. data/src/core/tsi/ssl_transport_security.cc +75 -38
  465. data/src/core/tsi/ssl_transport_security.h +8 -2
  466. data/src/core/tsi/transport_security_interface.h +2 -0
  467. data/src/ruby/ext/grpc/extconf.rb +1 -1
  468. data/src/ruby/lib/grpc/generic/active_call.rb +7 -1
  469. data/src/ruby/lib/grpc/grpc.rb +1 -1
  470. data/src/ruby/lib/grpc/version.rb +1 -1
  471. data/src/ruby/pb/generate_proto_ruby.sh +1 -0
  472. data/src/ruby/pb/test/client.rb +769 -0
  473. data/src/ruby/pb/test/server.rb +252 -0
  474. data/src/ruby/pb/test/xds_client.rb +415 -0
  475. data/third_party/upb/third_party/utf8_range/utf8_range.h +1 -1
  476. data/third_party/upb/upb/decode.c +32 -16
  477. data/third_party/upb/upb/def.c +118 -55
  478. data/third_party/upb/upb/def.h +12 -3
  479. data/third_party/upb/upb/encode.c +14 -8
  480. data/third_party/upb/upb/json_encode.c +776 -0
  481. data/third_party/upb/upb/json_encode.h +62 -0
  482. data/third_party/upb/upb/msg.c +5 -7
  483. data/third_party/upb/upb/msg.h +1 -2
  484. data/third_party/upb/upb/msg_internal.h +49 -36
  485. data/third_party/upb/upb/port_def.inc +8 -0
  486. data/third_party/upb/upb/port_undef.inc +1 -0
  487. data/third_party/upb/upb/table.c +10 -6
  488. data/third_party/upb/upb/table_internal.h +2 -0
  489. data/third_party/upb/upb/upb.h +41 -11
  490. data/third_party/zlib/crc32.c +966 -292
  491. data/third_party/zlib/crc32.h +9441 -436
  492. data/third_party/zlib/deflate.c +78 -30
  493. data/third_party/zlib/deflate.h +12 -15
  494. data/third_party/zlib/gzguts.h +3 -2
  495. data/third_party/zlib/gzlib.c +5 -3
  496. data/third_party/zlib/gzread.c +5 -7
  497. data/third_party/zlib/gzwrite.c +25 -13
  498. data/third_party/zlib/infback.c +2 -1
  499. data/third_party/zlib/inffast.c +14 -14
  500. data/third_party/zlib/inflate.c +39 -8
  501. data/third_party/zlib/inflate.h +3 -2
  502. data/third_party/zlib/inftrees.c +3 -3
  503. data/third_party/zlib/trees.c +27 -48
  504. data/third_party/zlib/zlib.h +123 -100
  505. data/third_party/zlib/zutil.c +2 -2
  506. data/third_party/zlib/zutil.h +12 -9
  507. metadata +66 -45
  508. data/src/core/ext/filters/client_idle/client_idle_filter.cc +0 -201
  509. data/src/core/ext/filters/max_age/max_age_filter.cc +0 -566
  510. data/src/core/ext/filters/max_age/max_age_filter.h +0 -26
  511. data/src/core/lib/iomgr/ev_epollex_linux.cc +0 -1657
  512. data/src/core/lib/iomgr/ev_epollex_linux.h +0 -30
  513. data/src/core/lib/iomgr/is_epollexclusive_available.cc +0 -119
  514. data/src/core/lib/iomgr/is_epollexclusive_available.h +0 -36
  515. data/src/core/lib/iomgr/sys_epoll_wrapper.h +0 -30
@@ -158,6 +158,23 @@ class WeightedTargetLb : public LoadBalancingPolicy {
158
158
  RefCountedPtr<WeightedChild> weighted_child_;
159
159
  };
160
160
 
161
+ class DelayedRemovalTimer
162
+ : public InternallyRefCounted<DelayedRemovalTimer> {
163
+ public:
164
+ explicit DelayedRemovalTimer(RefCountedPtr<WeightedChild> weighted_child);
165
+
166
+ void Orphan() override;
167
+
168
+ private:
169
+ static void OnTimer(void* arg, grpc_error_handle error);
170
+ void OnTimerLocked(grpc_error_handle error);
171
+
172
+ RefCountedPtr<WeightedChild> weighted_child_;
173
+ grpc_timer timer_;
174
+ grpc_closure on_timer_;
175
+ bool timer_pending_ = true;
176
+ };
177
+
161
178
  // Methods for dealing with the child policy.
162
179
  OrphanablePtr<LoadBalancingPolicy> CreateChildPolicyLocked(
163
180
  const grpc_channel_args* args);
@@ -166,9 +183,6 @@ class WeightedTargetLb : public LoadBalancingPolicy {
166
183
  grpc_connectivity_state state, const absl::Status& status,
167
184
  std::unique_ptr<SubchannelPicker> picker);
168
185
 
169
- static void OnDelayedRemovalTimer(void* arg, grpc_error_handle error);
170
- void OnDelayedRemovalTimerLocked(grpc_error_handle error);
171
-
172
186
  // The owning LB policy.
173
187
  RefCountedPtr<WeightedTargetLb> weighted_target_policy_;
174
188
 
@@ -182,11 +196,7 @@ class WeightedTargetLb : public LoadBalancingPolicy {
182
196
  grpc_connectivity_state connectivity_state_ = GRPC_CHANNEL_CONNECTING;
183
197
  bool seen_failure_since_ready_ = false;
184
198
 
185
- // States for delayed removal.
186
- grpc_timer delayed_removal_timer_;
187
- grpc_closure on_delayed_removal_timer_;
188
- bool delayed_removal_timer_callback_pending_ = false;
189
- bool shutdown_ = false;
199
+ OrphanablePtr<DelayedRemovalTimer> delayed_removal_timer_;
190
200
  };
191
201
 
192
202
  ~WeightedTargetLb() override;
@@ -200,6 +210,7 @@ class WeightedTargetLb : public LoadBalancingPolicy {
200
210
 
201
211
  // Internal state.
202
212
  bool shutting_down_ = false;
213
+ bool update_in_progress_ = false;
203
214
 
204
215
  // Children.
205
216
  std::map<std::string, OrphanablePtr<WeightedChild>> targets_;
@@ -271,6 +282,7 @@ void WeightedTargetLb::UpdateLocked(UpdateArgs args) {
271
282
  if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
272
283
  gpr_log(GPR_INFO, "[weighted_target_lb %p] Received update", this);
273
284
  }
285
+ update_in_progress_ = true;
274
286
  // Update config.
275
287
  config_ = std::move(args.config);
276
288
  // Deactivate the targets not in the new config.
@@ -281,38 +293,37 @@ void WeightedTargetLb::UpdateLocked(UpdateArgs args) {
281
293
  child->DeactivateLocked();
282
294
  }
283
295
  }
284
- // Create any children that don't already exist.
285
- // Note that we add all children before updating any of them, because
286
- // an update may trigger a child to immediately update its
287
- // connectivity state (e.g., reporting TRANSIENT_FAILURE immediately when
288
- // receiving an empty address list), and we don't want to return an
289
- // overall state with incomplete data.
290
- for (const auto& p : config_->target_map()) {
291
- const std::string& name = p.first;
292
- auto it = targets_.find(name);
293
- if (it == targets_.end()) {
294
- targets_.emplace(name, MakeOrphanable<WeightedChild>(
295
- Ref(DEBUG_LOCATION, "WeightedChild"), name));
296
- }
297
- }
298
296
  // Update all children.
299
297
  absl::StatusOr<HierarchicalAddressMap> address_map =
300
298
  MakeHierarchicalAddressMap(args.addresses);
301
299
  for (const auto& p : config_->target_map()) {
302
300
  const std::string& name = p.first;
303
301
  const WeightedTargetLbConfig::ChildConfig& config = p.second;
302
+ auto& target = targets_[name];
303
+ // Create child if it does not already exist.
304
+ if (target == nullptr) {
305
+ target = MakeOrphanable<WeightedChild>(
306
+ Ref(DEBUG_LOCATION, "WeightedChild"), name);
307
+ }
304
308
  absl::StatusOr<ServerAddressList> addresses;
305
309
  if (address_map.ok()) {
306
310
  addresses = std::move((*address_map)[name]);
307
311
  } else {
308
312
  addresses = address_map.status();
309
313
  }
310
- targets_[name]->UpdateLocked(config, std::move(addresses), args.args);
314
+ target->UpdateLocked(config, std::move(addresses), args.args);
311
315
  }
316
+ update_in_progress_ = false;
312
317
  UpdateStateLocked();
313
318
  }
314
319
 
315
320
  void WeightedTargetLb::UpdateStateLocked() {
321
+ // If we're in the process of propagating an update from our parent to
322
+ // our children, ignore any updates that come from the children. We
323
+ // will instead return a new picker once the update has been seen by
324
+ // all children. This avoids unnecessary picker churn while an update
325
+ // is being propagated to our children.
326
+ if (update_in_progress_) return;
316
327
  if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
317
328
  gpr_log(GPR_INFO,
318
329
  "[weighted_target_lb %p] scanning children to determine "
@@ -346,6 +357,7 @@ void WeightedTargetLb::UpdateStateLocked() {
346
357
  }
347
358
  switch (child->connectivity_state()) {
348
359
  case GRPC_CHANNEL_READY: {
360
+ GPR_ASSERT(child->weight() > 0);
349
361
  end += child->weight();
350
362
  picker_list.push_back(std::make_pair(end, child->picker_wrapper()));
351
363
  break;
@@ -401,6 +413,53 @@ void WeightedTargetLb::UpdateStateLocked() {
401
413
  std::move(picker));
402
414
  }
403
415
 
416
+ //
417
+ // WeightedTargetLb::WeightedChild::DelayedRemovalTimer
418
+ //
419
+
420
+ WeightedTargetLb::WeightedChild::DelayedRemovalTimer::DelayedRemovalTimer(
421
+ RefCountedPtr<WeightedTargetLb::WeightedChild> weighted_child)
422
+ : weighted_child_(std::move(weighted_child)) {
423
+ GRPC_CLOSURE_INIT(&on_timer_, OnTimer, this, nullptr);
424
+ Ref().release();
425
+ grpc_timer_init(&timer_, ExecCtx::Get()->Now() + kChildRetentionInterval,
426
+ &on_timer_);
427
+ }
428
+
429
+ void WeightedTargetLb::WeightedChild::DelayedRemovalTimer::Orphan() {
430
+ if (timer_pending_) {
431
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
432
+ gpr_log(GPR_INFO,
433
+ "[weighted_target_lb %p] WeightedChild %p %s: cancelling "
434
+ "delayed removal timer",
435
+ weighted_child_->weighted_target_policy_.get(),
436
+ weighted_child_.get(), weighted_child_->name_.c_str());
437
+ }
438
+ timer_pending_ = false;
439
+ grpc_timer_cancel(&timer_);
440
+ }
441
+ Unref();
442
+ }
443
+
444
+ void WeightedTargetLb::WeightedChild::DelayedRemovalTimer::OnTimer(
445
+ void* arg, grpc_error_handle error) {
446
+ auto* self = static_cast<DelayedRemovalTimer*>(arg);
447
+ (void)GRPC_ERROR_REF(error); // ref owned by lambda
448
+ self->weighted_child_->weighted_target_policy_->work_serializer()->Run(
449
+ [self, error]() { self->OnTimerLocked(error); }, DEBUG_LOCATION);
450
+ }
451
+
452
+ void WeightedTargetLb::WeightedChild::DelayedRemovalTimer::OnTimerLocked(
453
+ grpc_error_handle error) {
454
+ if (error == GRPC_ERROR_NONE && timer_pending_) {
455
+ timer_pending_ = false;
456
+ weighted_child_->weighted_target_policy_->targets_.erase(
457
+ weighted_child_->name_);
458
+ }
459
+ GRPC_ERROR_UNREF(error);
460
+ Unref();
461
+ }
462
+
404
463
  //
405
464
  // WeightedTargetLb::WeightedChild
406
465
  //
@@ -413,8 +472,6 @@ WeightedTargetLb::WeightedChild::WeightedChild(
413
472
  gpr_log(GPR_INFO, "[weighted_target_lb %p] created WeightedChild %p for %s",
414
473
  weighted_target_policy_.get(), this, name_.c_str());
415
474
  }
416
- GRPC_CLOSURE_INIT(&on_delayed_removal_timer_, OnDelayedRemovalTimer, this,
417
- grpc_schedule_on_exec_ctx);
418
475
  }
419
476
 
420
477
  WeightedTargetLb::WeightedChild::~WeightedChild() {
@@ -441,11 +498,7 @@ void WeightedTargetLb::WeightedChild::Orphan() {
441
498
  // Drop our ref to the child's picker, in case it's holding a ref to
442
499
  // the child.
443
500
  picker_wrapper_.reset();
444
- if (delayed_removal_timer_callback_pending_) {
445
- delayed_removal_timer_callback_pending_ = false;
446
- grpc_timer_cancel(&delayed_removal_timer_);
447
- }
448
- shutdown_ = true;
501
+ delayed_removal_timer_.reset();
449
502
  Unref();
450
503
  }
451
504
 
@@ -484,14 +537,13 @@ void WeightedTargetLb::WeightedChild::UpdateLocked(
484
537
  // Update child weight.
485
538
  weight_ = config.weight;
486
539
  // Reactivate if needed.
487
- if (delayed_removal_timer_callback_pending_) {
540
+ if (delayed_removal_timer_ != nullptr) {
488
541
  if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
489
542
  gpr_log(GPR_INFO,
490
543
  "[weighted_target_lb %p] WeightedChild %p %s: reactivating",
491
544
  weighted_target_policy_.get(), this, name_.c_str());
492
545
  }
493
- delayed_removal_timer_callback_pending_ = false;
494
- grpc_timer_cancel(&delayed_removal_timer_);
546
+ delayed_removal_timer_.reset();
495
547
  }
496
548
  // Create child policy if needed.
497
549
  if (child_policy_ == nullptr) {
@@ -561,31 +613,8 @@ void WeightedTargetLb::WeightedChild::DeactivateLocked() {
561
613
  // Set the child weight to 0 so that future picker won't contain this child.
562
614
  weight_ = 0;
563
615
  // Start a timer to delete the child.
564
- Ref(DEBUG_LOCATION, "WeightedChild+timer").release();
565
- delayed_removal_timer_callback_pending_ = true;
566
- grpc_timer_init(&delayed_removal_timer_,
567
- ExecCtx::Get()->Now() + kChildRetentionInterval,
568
- &on_delayed_removal_timer_);
569
- }
570
-
571
- void WeightedTargetLb::WeightedChild::OnDelayedRemovalTimer(
572
- void* arg, grpc_error_handle error) {
573
- WeightedChild* self = static_cast<WeightedChild*>(arg);
574
- (void)GRPC_ERROR_REF(error); // ref owned by lambda
575
- self->weighted_target_policy_->work_serializer()->Run(
576
- [self, error]() { self->OnDelayedRemovalTimerLocked(error); },
577
- DEBUG_LOCATION);
578
- }
579
-
580
- void WeightedTargetLb::WeightedChild::OnDelayedRemovalTimerLocked(
581
- grpc_error_handle error) {
582
- if (error == GRPC_ERROR_NONE && delayed_removal_timer_callback_pending_ &&
583
- !shutdown_ && weight_ == 0) {
584
- delayed_removal_timer_callback_pending_ = false;
585
- weighted_target_policy_->targets_.erase(name_);
586
- }
587
- Unref(DEBUG_LOCATION, "WeightedChild+timer");
588
- GRPC_ERROR_UNREF(error);
616
+ delayed_removal_timer_ = MakeOrphanable<DelayedRemovalTimer>(
617
+ Ref(DEBUG_LOCATION, "DelayedRemovalTimer"));
589
618
  }
590
619
 
591
620
  //
@@ -83,11 +83,11 @@ class CdsLb : public LoadBalancingPolicy {
83
83
  },
84
84
  DEBUG_LOCATION);
85
85
  }
86
- void OnError(grpc_error_handle error) override {
86
+ void OnError(absl::Status status) override {
87
87
  Ref().release(); // Ref held by lambda
88
88
  parent_->work_serializer()->Run(
89
- [this, error]() {
90
- parent_->OnError(name_, error);
89
+ [this, status]() {
90
+ parent_->OnError(name_, status);
91
91
  Unref();
92
92
  },
93
93
  DEBUG_LOCATION);
@@ -136,15 +136,15 @@ class CdsLb : public LoadBalancingPolicy {
136
136
 
137
137
  void ShutdownLocked() override;
138
138
 
139
- bool GenerateDiscoveryMechanismForCluster(
139
+ absl::StatusOr<bool> GenerateDiscoveryMechanismForCluster(
140
140
  const std::string& name, Json::Array* discovery_mechanisms,
141
141
  std::set<std::string>* clusters_needed);
142
142
  void OnClusterChanged(const std::string& name,
143
143
  XdsClusterResource cluster_data);
144
- void OnError(const std::string& name, grpc_error_handle error);
144
+ void OnError(const std::string& name, absl::Status status);
145
145
  void OnResourceDoesNotExist(const std::string& name);
146
146
 
147
- grpc_error_handle UpdateXdsCertificateProvider(
147
+ absl::Status UpdateXdsCertificateProvider(
148
148
  const std::string& cluster_name, const XdsClusterResource& cluster_data);
149
149
 
150
150
  void CancelClusterDataWatch(absl::string_view cluster_name,
@@ -307,18 +307,21 @@ void CdsLb::UpdateLocked(UpdateArgs args) {
307
307
  }
308
308
  }
309
309
 
310
- // This method will attempt to generate one or multiple entries of discovery
311
- // mechanism recursively:
312
- // For cluster types EDS or LOGICAL_DNS, one discovery mechanism entry may be
313
- // generated cluster name, type and other data from the CdsUpdate inserted into
314
- // the entry and the entry appended to the array of entries.
315
- // Note, discovery mechanism entry can be generated if an CdsUpdate is
316
- // available; otherwise, just return false. For cluster type AGGREGATE,
317
- // recursively call the method for each child cluster.
318
- bool CdsLb::GenerateDiscoveryMechanismForCluster(
310
+ // Generates the discovery mechanism config for the specified cluster name.
311
+ //
312
+ // If no CdsUpdate has been received for the cluster, starts the watcher
313
+ // if needed, and returns false. Otherwise, generates the discovery
314
+ // mechanism config, adds it to *discovery_mechanisms, and returns true.
315
+ //
316
+ // For aggregate clusters, may call itself recursively. Returns an
317
+ // error if there is a loop in the aggregate cluster graph.
318
+ absl::StatusOr<bool> CdsLb::GenerateDiscoveryMechanismForCluster(
319
319
  const std::string& name, Json::Array* discovery_mechanisms,
320
320
  std::set<std::string>* clusters_needed) {
321
- clusters_needed->insert(name);
321
+ if (!clusters_needed->insert(name).second) {
322
+ return absl::FailedPreconditionError(absl::StrCat(
323
+ "aggregate cluster graph contains a loop for cluster ", name));
324
+ }
322
325
  auto& state = watchers_[name];
323
326
  // Create a new watcher if needed.
324
327
  if (state.watcher == nullptr) {
@@ -340,10 +343,10 @@ bool CdsLb::GenerateDiscoveryMechanismForCluster(
340
343
  bool missing_cluster = false;
341
344
  for (const std::string& child_name :
342
345
  state.update->prioritized_cluster_names) {
343
- if (!GenerateDiscoveryMechanismForCluster(
344
- child_name, discovery_mechanisms, clusters_needed)) {
345
- missing_cluster = true;
346
- }
346
+ auto result = GenerateDiscoveryMechanismForCluster(
347
+ child_name, discovery_mechanisms, clusters_needed);
348
+ if (!result.ok()) return result;
349
+ if (!*result) missing_cluster = true;
347
350
  }
348
351
  return !missing_cluster;
349
352
  }
@@ -390,10 +393,10 @@ void CdsLb::OnClusterChanged(const std::string& name,
390
393
  if (it == watchers_.end()) return;
391
394
  it->second.update = cluster_data;
392
395
  // Take care of integration with new certificate code.
393
- grpc_error_handle error = GRPC_ERROR_NONE;
394
- error = UpdateXdsCertificateProvider(name, it->second.update.value());
395
- if (error != GRPC_ERROR_NONE) {
396
- return OnError(name, error);
396
+ absl::Status status =
397
+ UpdateXdsCertificateProvider(name, it->second.update.value());
398
+ if (!status.ok()) {
399
+ return OnError(name, status);
397
400
  }
398
401
  // Scan the map starting from the root cluster to generate the list of
399
402
  // discovery mechanisms. If we don't have some of the data we need (i.e., we
@@ -401,8 +404,12 @@ void CdsLb::OnClusterChanged(const std::string& name,
401
404
  // update the child policy at all.
402
405
  Json::Array discovery_mechanisms;
403
406
  std::set<std::string> clusters_needed;
404
- if (GenerateDiscoveryMechanismForCluster(
405
- config_->cluster(), &discovery_mechanisms, &clusters_needed)) {
407
+ auto result = GenerateDiscoveryMechanismForCluster(
408
+ config_->cluster(), &discovery_mechanisms, &clusters_needed);
409
+ if (!result.ok()) {
410
+ return OnError(name, result.status());
411
+ }
412
+ if (*result) {
406
413
  // LB policy is configured by aggregate cluster, not by the individual
407
414
  // underlying cluster that we may be processing an update for.
408
415
  auto it = watchers_.find(config_->cluster());
@@ -435,10 +442,12 @@ void CdsLb::OnClusterChanged(const std::string& name,
435
442
  gpr_log(GPR_INFO, "[cdslb %p] generated config for child policy: %s",
436
443
  this, json_str.c_str());
437
444
  }
445
+ grpc_error_handle error = GRPC_ERROR_NONE;
438
446
  RefCountedPtr<LoadBalancingPolicy::Config> config =
439
447
  LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(json, &error);
440
448
  if (error != GRPC_ERROR_NONE) {
441
- OnError(name, error);
449
+ OnError(name, absl::UnavailableError(grpc_error_std_string(error)));
450
+ GRPC_ERROR_UNREF(error);
442
451
  return;
443
452
  }
444
453
  // Create child policy if not already present.
@@ -450,8 +459,7 @@ void CdsLb::OnClusterChanged(const std::string& name,
450
459
  child_policy_ = LoadBalancingPolicyRegistry::CreateLoadBalancingPolicy(
451
460
  config->name(), std::move(args));
452
461
  if (child_policy_ == nullptr) {
453
- OnError(name, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
454
- "failed to create child policy"));
462
+ OnError(name, absl::UnavailableError("failed to create child policy"));
455
463
  return;
456
464
  }
457
465
  grpc_pollset_set_add_pollset_set(child_policy_->interested_parties(),
@@ -489,19 +497,18 @@ void CdsLb::OnClusterChanged(const std::string& name,
489
497
  }
490
498
  }
491
499
 
492
- void CdsLb::OnError(const std::string& name, grpc_error_handle error) {
500
+ void CdsLb::OnError(const std::string& name, absl::Status status) {
493
501
  gpr_log(GPR_ERROR, "[cdslb %p] xds error obtaining data for cluster %s: %s",
494
- this, name.c_str(), grpc_error_std_string(error).c_str());
502
+ this, name.c_str(), status.ToString().c_str());
495
503
  // Go into TRANSIENT_FAILURE if we have not yet created the child
496
504
  // policy (i.e., we have not yet received data from xds). Otherwise,
497
505
  // we keep running with the data we had previously.
498
506
  if (child_policy_ == nullptr) {
499
- absl::Status status = grpc_error_to_absl_status(error);
500
507
  channel_control_helper()->UpdateState(
501
508
  GRPC_CHANNEL_TRANSIENT_FAILURE, status,
502
- absl::make_unique<TransientFailurePicker>(status));
509
+ absl::make_unique<TransientFailurePicker>(
510
+ absl::UnavailableError(status.ToString())));
503
511
  }
504
- GRPC_ERROR_UNREF(error);
505
512
  }
506
513
 
507
514
  void CdsLb::OnResourceDoesNotExist(const std::string& name) {
@@ -517,15 +524,15 @@ void CdsLb::OnResourceDoesNotExist(const std::string& name) {
517
524
  MaybeDestroyChildPolicyLocked();
518
525
  }
519
526
 
520
- grpc_error_handle CdsLb::UpdateXdsCertificateProvider(
527
+ absl::Status CdsLb::UpdateXdsCertificateProvider(
521
528
  const std::string& cluster_name, const XdsClusterResource& cluster_data) {
522
529
  // Early out if channel is not configured to use xds security.
523
530
  grpc_channel_credentials* channel_credentials =
524
531
  grpc_channel_credentials_find_in_args(args_);
525
532
  if (channel_credentials == nullptr ||
526
- channel_credentials->type() != kCredentialsTypeXds) {
533
+ channel_credentials->type() != XdsCredentials::Type()) {
527
534
  xds_certificate_provider_ = nullptr;
528
- return GRPC_ERROR_NONE;
535
+ return absl::OkStatus();
529
536
  }
530
537
  if (xds_certificate_provider_ == nullptr) {
531
538
  xds_certificate_provider_ = MakeRefCounted<XdsCertificateProvider>();
@@ -543,11 +550,9 @@ grpc_error_handle CdsLb::UpdateXdsCertificateProvider(
543
550
  xds_client_->certificate_provider_store()
544
551
  .CreateOrGetCertificateProvider(root_provider_instance_name);
545
552
  if (new_root_provider == nullptr) {
546
- return grpc_error_set_int(
547
- GRPC_ERROR_CREATE_FROM_CPP_STRING(
548
- absl::StrCat("Certificate provider instance name: \"",
549
- root_provider_instance_name, "\" not recognized.")),
550
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
553
+ return absl::UnavailableError(
554
+ absl::StrCat("Certificate provider instance name: \"",
555
+ root_provider_instance_name, "\" not recognized."));
551
556
  }
552
557
  }
553
558
  if (root_certificate_provider_ != new_root_provider) {
@@ -582,11 +587,9 @@ grpc_error_handle CdsLb::UpdateXdsCertificateProvider(
582
587
  xds_client_->certificate_provider_store()
583
588
  .CreateOrGetCertificateProvider(identity_provider_instance_name);
584
589
  if (new_identity_provider == nullptr) {
585
- return grpc_error_set_int(
586
- GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
587
- "Certificate provider instance name: \"",
588
- identity_provider_instance_name, "\" not recognized.")),
589
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
590
+ return absl::UnavailableError(
591
+ absl::StrCat("Certificate provider instance name: \"",
592
+ identity_provider_instance_name, "\" not recognized."));
590
593
  }
591
594
  }
592
595
  if (identity_certificate_provider_ != new_identity_provider) {
@@ -614,7 +617,7 @@ grpc_error_handle CdsLb::UpdateXdsCertificateProvider(
614
617
  .match_subject_alt_names;
615
618
  xds_certificate_provider_->UpdateSubjectAlternativeNameMatchers(
616
619
  cluster_name, match_subject_alt_names);
617
- return GRPC_ERROR_NONE;
620
+ return absl::OkStatus();
618
621
  }
619
622
 
620
623
  void CdsLb::CancelClusterDataWatch(absl::string_view cluster_name,
@@ -196,6 +196,7 @@ class XdsClusterManagerLb : public LoadBalancingPolicy {
196
196
 
197
197
  // Internal state.
198
198
  bool shutting_down_ = false;
199
+ bool update_in_progress_ = false;
199
200
 
200
201
  // Children.
201
202
  std::map<std::string, OrphanablePtr<ClusterChild>> children_;
@@ -254,6 +255,7 @@ void XdsClusterManagerLb::UpdateLocked(UpdateArgs args) {
254
255
  if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
255
256
  gpr_log(GPR_INFO, "[xds_cluster_manager_lb %p] Received update", this);
256
257
  }
258
+ update_in_progress_ = true;
257
259
  // Update config.
258
260
  config_ = std::move(args.config);
259
261
  // Deactivate the children not in the new config.
@@ -268,19 +270,24 @@ void XdsClusterManagerLb::UpdateLocked(UpdateArgs args) {
268
270
  for (const auto& p : config_->cluster_map()) {
269
271
  const std::string& name = p.first;
270
272
  const RefCountedPtr<LoadBalancingPolicy::Config>& config = p.second;
271
- auto it = children_.find(name);
272
- if (it == children_.end()) {
273
- it = children_
274
- .emplace(name, MakeOrphanable<ClusterChild>(
275
- Ref(DEBUG_LOCATION, "ClusterChild"), name))
276
- .first;
273
+ auto& child = children_[name];
274
+ if (child == nullptr) {
275
+ child = MakeOrphanable<ClusterChild>(Ref(DEBUG_LOCATION, "ClusterChild"),
276
+ name);
277
277
  }
278
- it->second->UpdateLocked(config, args.addresses, args.args);
278
+ child->UpdateLocked(config, args.addresses, args.args);
279
279
  }
280
+ update_in_progress_ = false;
280
281
  UpdateStateLocked();
281
282
  }
282
283
 
283
284
  void XdsClusterManagerLb::UpdateStateLocked() {
285
+ // If we're in the process of propagating an update from our parent to
286
+ // our children, ignore any updates that come from the children. We
287
+ // will instead return a new picker once the update has been seen by
288
+ // all children. This avoids unnecessary picker churn while an update
289
+ // is being propagated to our children.
290
+ if (update_in_progress_) return;
284
291
  // Also count the number of children in each state, to determine the
285
292
  // overall state.
286
293
  size_t num_ready = 0;