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.
- checksums.yaml +4 -4
- data/Makefile +36 -29
- data/include/grpc/impl/codegen/grpc_types.h +7 -13
- data/src/core/ext/filters/channel_idle/channel_idle_filter.cc +309 -0
- data/src/core/ext/filters/channel_idle/channel_idle_filter.h +122 -0
- data/src/core/ext/filters/{client_idle → channel_idle}/idle_filter_state.cc +1 -1
- data/src/core/ext/filters/{client_idle → channel_idle}/idle_filter_state.h +3 -3
- data/src/core/ext/filters/client_channel/client_channel.cc +163 -96
- data/src/core/ext/filters/client_channel/client_channel.h +2 -0
- data/src/core/ext/filters/client_channel/health/health_check_client.cc +124 -581
- data/src/core/ext/filters/client_channel/health/health_check_client.h +24 -160
- data/src/core/ext/filters/client_channel/http_proxy.cc +88 -110
- data/src/core/ext/filters/client_channel/http_proxy.h +17 -0
- data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +182 -142
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +2 -6
- data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +1 -10
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +87 -58
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +51 -48
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +14 -7
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +229 -284
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +92 -257
- data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +51 -221
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.cc +201 -0
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.h +106 -0
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +102 -55
- data/src/core/ext/filters/client_channel/retry_filter.cc +18 -3
- data/src/core/ext/filters/client_channel/subchannel.cc +5 -5
- data/src/core/ext/filters/client_channel/subchannel_stream_client.cc +544 -0
- data/src/core/ext/filters/client_channel/subchannel_stream_client.h +214 -0
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +127 -367
- data/src/core/ext/filters/fault_injection/fault_injection_filter.h +24 -1
- data/src/core/ext/filters/http/client/http_client_filter.cc +78 -458
- data/src/core/ext/filters/http/client/http_client_filter.h +21 -4
- data/src/core/ext/filters/http/client_authority_filter.cc +17 -22
- data/src/core/ext/filters/http/client_authority_filter.h +6 -5
- data/src/core/ext/filters/http/http_filters_plugin.cc +9 -6
- data/src/core/ext/filters/http/server/http_server_filter.cc +2 -116
- data/src/core/ext/filters/server_config_selector/server_config_selector.cc +2 -8
- data/src/core/ext/filters/server_config_selector/server_config_selector.h +2 -2
- data/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc +73 -201
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +2 -1
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +5 -4
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +139 -28
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +2 -6
- data/src/core/ext/transport/chttp2/transport/internal.h +4 -2
- data/src/core/ext/transport/chttp2/transport/parsing.cc +8 -0
- data/src/core/ext/transport/chttp2/transport/writing.cc +24 -13
- data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c +27 -24
- data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h +143 -63
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c +37 -35
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h +177 -77
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c +115 -111
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h +547 -207
- data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h +26 -13
- data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h +23 -9
- data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c +7 -7
- data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h +18 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c +4 -4
- data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h +13 -4
- data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c +4 -4
- data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h +9 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c +49 -46
- data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h +217 -78
- data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c +3 -3
- data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h +10 -2
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c +12 -12
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +40 -8
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +20 -2
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +55 -55
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +289 -110
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +133 -125
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +656 -267
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c +24 -18
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h +96 -23
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +185 -173
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +860 -309
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c +3 -3
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h +10 -2
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +44 -24
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +165 -40
- data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c +72 -63
- data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h +433 -174
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +33 -31
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +154 -52
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c +5 -4
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h +14 -4
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +89 -89
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +460 -166
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +76 -33
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +379 -69
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h +14 -6
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c +5 -25
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h +10 -91
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h +26 -13
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +70 -68
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +369 -131
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +94 -65
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +447 -161
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c +4 -4
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h +27 -11
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +104 -85
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +378 -113
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h +3 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c +6 -6
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h +30 -13
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +7 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +43 -16
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +8 -8
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +58 -24
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c +4 -4
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h +14 -4
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +18 -18
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h +100 -43
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +31 -30
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +171 -71
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c +32 -32
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h +196 -95
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h +7 -2
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +53 -46
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +284 -129
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +56 -50
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +337 -146
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +13 -11
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +49 -14
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +4 -4
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +14 -4
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h +20 -4
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c +33 -32
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h +205 -86
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c +34 -34
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h +175 -74
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +56 -52
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +370 -146
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +27 -23
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +173 -74
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +362 -341
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +2056 -845
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c +11 -11
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h +49 -16
- data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c +56 -50
- data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h +293 -111
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c +3 -3
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h +6 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c +3 -3
- data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h +10 -2
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h +26 -10
- data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h +27 -12
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c +17 -16
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h +83 -36
- data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h +7 -2
- data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c +8 -8
- data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h +46 -17
- data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c +9 -9
- data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h +38 -12
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c +7 -7
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h +30 -10
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +10 -6
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c +15 -15
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h +71 -28
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +25 -25
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +149 -65
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c +8 -7
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +30 -12
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +9 -9
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +42 -15
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +173 -144
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +898 -323
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +51 -45
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +261 -116
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +13 -13
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +70 -25
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +80 -55
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +410 -124
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h +23 -9
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c +1 -1
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +44 -44
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +261 -122
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +8 -8
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h +47 -21
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c +32 -32
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h +175 -66
- data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c +4 -4
- data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h +17 -6
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c +8 -8
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h +38 -17
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c +8 -8
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h +12 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c +7 -7
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h +43 -18
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c +3 -3
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h +20 -9
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c +3 -3
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h +24 -9
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h +14 -6
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +8 -8
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h +40 -16
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +9 -9
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h +70 -25
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h +37 -18
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c +12 -12
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h +81 -30
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c +16 -16
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h +76 -30
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c +20 -20
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h +90 -30
- data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c +7 -7
- data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h +28 -10
- data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h +3 -0
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h +13 -4
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.c +9 -9
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.h +18 -0
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c +4 -4
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h +9 -0
- data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h +17 -4
- data/src/core/ext/upb-generated/google/api/annotations.upb.c +3 -3
- data/src/core/ext/upb-generated/google/api/annotations.upb.h +17 -2
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c +70 -66
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h +410 -162
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +80 -74
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +440 -158
- data/src/core/ext/upb-generated/google/api/http.upb.c +17 -17
- data/src/core/ext/upb-generated/google/api/http.upb.h +116 -43
- data/src/core/ext/upb-generated/google/api/httpbody.upb.c +4 -4
- data/src/core/ext/upb-generated/google/api/httpbody.upb.h +19 -7
- data/src/core/ext/upb-generated/google/protobuf/any.upb.c +3 -3
- data/src/core/ext/upb-generated/google/protobuf/any.upb.h +6 -0
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +163 -162
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +1157 -435
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.c +3 -3
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +10 -4
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.c +1 -1
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +15 -15
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +108 -40
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +3 -3
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +10 -4
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +18 -18
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +27 -0
- data/src/core/ext/upb-generated/google/rpc/status.upb.c +4 -4
- data/src/core/ext/upb-generated/google/rpc/status.upb.h +19 -7
- data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c +15 -15
- data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h +65 -22
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +12 -12
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +49 -12
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +69 -65
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +364 -149
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c +8 -7
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +20 -4
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c +4 -4
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +6 -0
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +31 -31
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +150 -58
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c +11 -11
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h +51 -18
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c +175 -0
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h +764 -0
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +22 -22
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +97 -10
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.c +6 -6
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.h +23 -2
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c +3 -3
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +10 -2
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.c +6 -6
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.h +27 -6
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c +5 -5
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h +20 -2
- data/src/core/ext/upb-generated/validate/validate.upb.c +261 -250
- data/src/core/ext/upb-generated/validate/validate.upb.h +1836 -663
- data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c +22 -22
- data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h +97 -10
- data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.c +6 -6
- data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.h +23 -2
- data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c +3 -3
- data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h +10 -2
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c +18 -18
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h +70 -10
- data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c +5 -5
- data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h +20 -2
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.c +2 -2
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.h +3 -0
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c +8 -8
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h +38 -12
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c +5 -5
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h +27 -10
- data/src/core/ext/upb-generated/xds/core/v3/extension.upb.c +3 -3
- data/src/core/ext/upb-generated/xds/core/v3/extension.upb.h +10 -2
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.c +5 -5
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.h +21 -8
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c +10 -10
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h +71 -30
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c +5 -5
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h +16 -2
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c +12 -12
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h +69 -26
- data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c +43 -39
- data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h +255 -103
- data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c +4 -4
- data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h +19 -8
- data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c +9 -9
- data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h +70 -25
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c +3 -3
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h +10 -2
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c +50 -46
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +195 -185
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c +16 -12
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +129 -94
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c +18 -33
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h +0 -5
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +163 -155
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c +141 -138
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +26 -20
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +738 -730
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +271 -251
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +207 -193
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c +99 -0
- data/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h +75 -0
- data/src/core/ext/xds/certificate_provider_store.cc +8 -0
- data/src/core/ext/xds/certificate_provider_store.h +9 -0
- data/src/core/ext/xds/xds_api.cc +20 -0
- data/src/core/ext/xds/xds_bootstrap.cc +2 -2
- data/src/core/ext/xds/xds_bootstrap.h +2 -0
- data/src/core/ext/xds/xds_certificate_provider.cc +2 -0
- data/src/core/ext/xds/xds_certificate_provider.h +8 -0
- data/src/core/ext/xds/xds_client.cc +87 -95
- data/src/core/ext/xds/xds_client.h +13 -5
- data/src/core/ext/xds/xds_cluster_specifier_plugin.cc +142 -0
- data/src/core/ext/xds/xds_cluster_specifier_plugin.h +79 -0
- data/src/core/ext/xds/xds_common_types.cc +9 -9
- data/src/core/ext/xds/xds_common_types.h +3 -3
- data/src/core/ext/xds/xds_endpoint.cc +12 -5
- data/src/core/ext/xds/xds_http_fault_filter.cc +1 -1
- data/src/core/ext/xds/xds_listener.cc +1 -1
- data/src/core/ext/xds/xds_route_config.cc +162 -25
- data/src/core/ext/xds/xds_route_config.h +13 -10
- data/src/core/ext/xds/xds_server_config_fetcher.cc +17 -22
- data/src/core/lib/avl/avl.h +68 -5
- data/src/core/lib/channel/call_tracer.h +4 -1
- data/src/core/lib/channel/channel_args.cc +138 -59
- data/src/core/lib/channel/channel_args.h +210 -9
- data/src/core/lib/channel/channel_args_preconditioning.cc +3 -9
- data/src/core/lib/channel/channel_args_preconditioning.h +1 -2
- data/src/core/lib/channel/channel_stack.h +2 -5
- data/src/core/lib/channel/channel_stack_builder.cc +0 -65
- data/src/core/lib/channel/channel_stack_builder.h +27 -6
- data/src/core/lib/channel/channel_stack_builder_impl.cc +102 -0
- data/src/core/lib/channel/channel_stack_builder_impl.h +48 -0
- data/src/core/lib/channel/connected_channel.h +1 -0
- data/src/core/lib/channel/promise_based_filter.cc +495 -162
- data/src/core/lib/channel/promise_based_filter.h +55 -41
- data/src/core/lib/compression/compression_internal.cc +1 -7
- data/src/core/lib/debug/stats_data.cc +2 -6
- data/src/core/lib/debug/stats_data.h +18 -21
- data/src/core/lib/gpr/tls.h +1 -0
- data/src/core/lib/gprpp/bitset.h +12 -0
- data/src/core/lib/gprpp/cpp_impl_of.h +4 -0
- data/src/core/lib/gprpp/match.h +73 -0
- data/src/core/lib/gprpp/overload.h +59 -0
- data/src/core/lib/gprpp/ref_counted.h +2 -0
- data/src/core/lib/gprpp/single_set_ptr.h +87 -0
- data/src/core/lib/gprpp/status_helper.cc +18 -2
- data/src/core/lib/gprpp/time.cc +12 -0
- data/src/core/lib/gprpp/time.h +1 -1
- data/src/core/lib/http/format_request.cc +1 -2
- data/src/core/lib/http/httpcli_security_connector.cc +5 -5
- data/src/core/lib/http/parser.cc +80 -9
- data/src/core/lib/http/parser.h +14 -1
- data/src/core/lib/iomgr/ev_posix.cc +6 -7
- data/src/core/lib/iomgr/fork_posix.cc +1 -1
- data/src/core/lib/iomgr/port.h +0 -2
- data/src/core/lib/iomgr/tcp_client_posix.cc +2 -2
- data/src/core/lib/iomgr/tcp_posix.cc +93 -35
- data/src/core/lib/iomgr/tcp_server_posix.cc +26 -17
- data/src/core/lib/json/json_util.h +3 -3
- data/src/core/lib/promise/call_push_pull.h +144 -0
- data/src/core/lib/promise/detail/status.h +2 -1
- data/src/core/lib/promise/intra_activity_waiter.h +49 -0
- data/src/core/lib/promise/latch.h +104 -0
- data/src/core/lib/resource_quota/api.cc +5 -30
- data/src/core/lib/resource_quota/api.h +1 -1
- data/src/core/lib/resource_quota/resource_quota.h +8 -0
- data/src/core/lib/security/authorization/authorization_policy_provider.h +7 -0
- data/src/core/lib/security/authorization/grpc_server_authz_filter.cc +9 -12
- data/src/core/lib/security/authorization/grpc_server_authz_filter.h +5 -6
- data/src/core/lib/security/context/security_context.h +8 -1
- data/src/core/lib/security/credentials/alts/alts_credentials.cc +6 -5
- data/src/core/lib/security/credentials/alts/alts_credentials.h +4 -0
- data/src/core/lib/security/credentials/call_creds_util.cc +3 -3
- data/src/core/lib/security/credentials/call_creds_util.h +2 -2
- data/src/core/lib/security/credentials/composite/composite_credentials.cc +15 -10
- data/src/core/lib/security/credentials/composite/composite_credentials.h +9 -8
- data/src/core/lib/security/credentials/credentials.h +16 -33
- data/src/core/lib/security/credentials/fake/fake_credentials.cc +8 -12
- data/src/core/lib/security/credentials/fake/fake_credentials.h +8 -5
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +4 -0
- data/src/core/lib/security/credentials/google_default/google_default_credentials.h +3 -3
- data/src/core/lib/security/credentials/iam/iam_credentials.cc +5 -4
- data/src/core/lib/security/credentials/iam/iam_credentials.h +6 -2
- data/src/core/lib/security/credentials/insecure/insecure_credentials.cc +22 -29
- data/src/core/lib/security/credentials/insecure/insecure_credentials.h +57 -0
- data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +7 -3
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +6 -2
- data/src/core/lib/security/credentials/local/local_credentials.cc +6 -6
- data/src/core/lib/security/credentials/local/local_credentials.h +4 -0
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +17 -9
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +14 -6
- data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +8 -6
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +8 -6
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +6 -4
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +8 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +49 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc +8 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h +42 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +66 -95
- data/src/core/lib/security/credentials/tls/tls_credentials.cc +9 -6
- data/src/core/lib/security/credentials/tls/tls_credentials.h +5 -5
- data/src/core/lib/security/credentials/xds/xds_credentials.cc +48 -50
- data/src/core/lib/security/credentials/xds/xds_credentials.h +31 -5
- data/src/core/lib/security/security_connector/local/local_security_connector.cc +2 -2
- data/src/core/lib/security/security_connector/security_connector.h +9 -0
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +4 -2
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +4 -2
- data/src/core/lib/security/transport/auth_filters.h +7 -7
- data/src/core/lib/security/transport/client_auth_filter.cc +28 -20
- data/src/core/lib/security/transport/secure_endpoint.cc +198 -129
- data/src/core/lib/security/transport/secure_endpoint.h +1 -1
- data/src/core/lib/security/transport/security_handshaker.cc +6 -4
- data/src/core/lib/surface/call.cc +1023 -903
- data/src/core/lib/surface/call.h +0 -14
- data/src/core/lib/surface/channel.cc +4 -3
- data/src/core/lib/surface/channel_init.cc +2 -3
- data/src/core/lib/surface/channel_init.h +2 -6
- data/src/core/lib/surface/init.cc +1 -1
- data/src/core/lib/surface/server.cc +3 -14
- data/src/core/lib/surface/server.h +1 -2
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/byte_stream.cc +2 -0
- data/src/core/lib/transport/metadata_batch.h +12 -8
- data/src/core/lib/transport/transport.h +20 -5
- data/src/core/lib/transport/transport_impl.h +4 -3
- data/src/core/plugin_registry/grpc_plugin_registry.cc +2 -4
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +2 -2
- data/src/core/tsi/ssl_transport_security.cc +75 -38
- data/src/core/tsi/ssl_transport_security.h +8 -2
- data/src/core/tsi/transport_security_interface.h +2 -0
- data/src/ruby/ext/grpc/extconf.rb +1 -1
- data/src/ruby/lib/grpc/generic/active_call.rb +7 -1
- data/src/ruby/lib/grpc/grpc.rb +1 -1
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/generate_proto_ruby.sh +1 -0
- data/src/ruby/pb/test/client.rb +769 -0
- data/src/ruby/pb/test/server.rb +252 -0
- data/src/ruby/pb/test/xds_client.rb +415 -0
- data/third_party/upb/third_party/utf8_range/utf8_range.h +1 -1
- data/third_party/upb/upb/decode.c +32 -16
- data/third_party/upb/upb/def.c +118 -55
- data/third_party/upb/upb/def.h +12 -3
- data/third_party/upb/upb/encode.c +14 -8
- data/third_party/upb/upb/json_encode.c +776 -0
- data/third_party/upb/upb/json_encode.h +62 -0
- data/third_party/upb/upb/msg.c +5 -7
- data/third_party/upb/upb/msg.h +1 -2
- data/third_party/upb/upb/msg_internal.h +49 -36
- data/third_party/upb/upb/port_def.inc +8 -0
- data/third_party/upb/upb/port_undef.inc +1 -0
- data/third_party/upb/upb/table.c +10 -6
- data/third_party/upb/upb/table_internal.h +2 -0
- data/third_party/upb/upb/upb.h +41 -11
- data/third_party/zlib/crc32.c +966 -292
- data/third_party/zlib/crc32.h +9441 -436
- data/third_party/zlib/deflate.c +78 -30
- data/third_party/zlib/deflate.h +12 -15
- data/third_party/zlib/gzguts.h +3 -2
- data/third_party/zlib/gzlib.c +5 -3
- data/third_party/zlib/gzread.c +5 -7
- data/third_party/zlib/gzwrite.c +25 -13
- data/third_party/zlib/infback.c +2 -1
- data/third_party/zlib/inffast.c +14 -14
- data/third_party/zlib/inflate.c +39 -8
- data/third_party/zlib/inflate.h +3 -2
- data/third_party/zlib/inftrees.c +3 -3
- data/third_party/zlib/trees.c +27 -48
- data/third_party/zlib/zlib.h +123 -100
- data/third_party/zlib/zutil.c +2 -2
- data/third_party/zlib/zutil.h +12 -9
- metadata +66 -45
- data/src/core/ext/filters/client_idle/client_idle_filter.cc +0 -201
- data/src/core/ext/filters/max_age/max_age_filter.cc +0 -566
- data/src/core/ext/filters/max_age/max_age_filter.h +0 -26
- data/src/core/lib/iomgr/ev_epollex_linux.cc +0 -1657
- data/src/core/lib/iomgr/ev_epollex_linux.h +0 -30
- data/src/core/lib/iomgr/is_epollexclusive_available.cc +0 -119
- data/src/core/lib/iomgr/is_epollexclusive_available.h +0 -36
- 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
|
-
|
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
|
-
|
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
|
-
|
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 (
|
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
|
-
|
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
|
-
|
565
|
-
|
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(
|
86
|
+
void OnError(absl::Status status) override {
|
87
87
|
Ref().release(); // Ref held by lambda
|
88
88
|
parent_->work_serializer()->Run(
|
89
|
-
[this,
|
90
|
-
parent_->OnError(name_,
|
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,
|
144
|
+
void OnError(const std::string& name, absl::Status status);
|
145
145
|
void OnResourceDoesNotExist(const std::string& name);
|
146
146
|
|
147
|
-
|
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
|
-
//
|
311
|
-
//
|
312
|
-
//
|
313
|
-
//
|
314
|
-
//
|
315
|
-
//
|
316
|
-
//
|
317
|
-
//
|
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
|
-
|
344
|
-
|
345
|
-
|
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
|
-
|
394
|
-
|
395
|
-
if (
|
396
|
-
return OnError(name,
|
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
|
-
|
405
|
-
|
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,
|
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,
|
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(),
|
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>(
|
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
|
-
|
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() !=
|
533
|
+
channel_credentials->type() != XdsCredentials::Type()) {
|
527
534
|
xds_certificate_provider_ = nullptr;
|
528
|
-
return
|
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
|
547
|
-
|
548
|
-
|
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
|
586
|
-
|
587
|
-
|
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
|
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
|
272
|
-
if (
|
273
|
-
|
274
|
-
|
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
|
-
|
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;
|