grpc 1.31.1 → 1.35.0.pre1
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 +719 -17819
- data/etc/roots.pem +257 -573
- data/include/grpc/compression.h +1 -1
- data/include/grpc/grpc.h +15 -7
- data/include/grpc/grpc_security.h +254 -186
- data/include/grpc/impl/codegen/README.md +22 -0
- data/include/grpc/impl/codegen/atm_windows.h +4 -0
- data/include/grpc/impl/codegen/byte_buffer.h +1 -1
- data/include/grpc/impl/codegen/grpc_types.h +10 -8
- data/include/grpc/impl/codegen/log.h +0 -2
- data/include/grpc/impl/codegen/port_platform.h +28 -56
- data/include/grpc/impl/codegen/sync_windows.h +4 -0
- data/include/grpc/slice_buffer.h +3 -3
- data/include/grpc/support/sync.h +3 -3
- data/include/grpc/support/time.h +7 -7
- data/src/core/ext/filters/client_channel/backend_metric.cc +2 -4
- data/src/core/ext/filters/client_channel/backup_poller.cc +3 -2
- data/src/core/ext/filters/client_channel/client_channel.cc +2831 -1540
- data/src/core/ext/filters/client_channel/client_channel.h +1 -5
- data/src/core/ext/filters/client_channel/client_channel_channelz.h +0 -3
- data/src/core/ext/filters/client_channel/client_channel_plugin.cc +1 -1
- data/src/core/ext/filters/client_channel/config_selector.cc +0 -4
- data/src/core/ext/filters/client_channel/config_selector.h +40 -8
- data/src/core/ext/filters/client_channel/dynamic_filters.cc +186 -0
- data/src/core/ext/filters/client_channel/dynamic_filters.h +99 -0
- data/src/core/ext/filters/client_channel/health/health_check_client.cc +16 -8
- data/src/core/ext/filters/client_channel/health/health_check_client.h +4 -4
- data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +7 -9
- data/src/core/ext/filters/client_channel/http_proxy.cc +21 -20
- data/src/core/ext/filters/client_channel/lb_policy.cc +6 -2
- data/src/core/ext/filters/client_channel/lb_policy.h +8 -7
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc +48 -35
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.h +7 -5
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc +10 -7
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +210 -192
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc +0 -13
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h +0 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +1 -37
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc +3 -1
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +23 -17
- data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +79 -30
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +10 -9
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +14 -34
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +26 -15
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +350 -130
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds.h +52 -24
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h +24 -0
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +812 -0
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +722 -0
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +1262 -0
- data/src/core/ext/filters/client_channel/lb_policy_registry.cc +8 -1
- data/src/core/ext/filters/client_channel/resolver.cc +3 -1
- data/src/core/ext/filters/client_channel/resolver.h +4 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +9 -16
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +1 -32
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +3 -3
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +457 -19
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +5 -0
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +7 -10
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +4 -4
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +1 -1
- data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +35 -28
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +664 -63
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h +28 -0
- data/src/core/ext/filters/client_channel/resolver_factory.h +6 -6
- data/src/core/ext/filters/client_channel/resolver_registry.cc +40 -39
- data/src/core/ext/filters/client_channel/resolver_registry.h +2 -2
- data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +29 -74
- data/src/core/ext/filters/client_channel/resolver_result_parsing.h +12 -11
- data/src/core/ext/filters/client_channel/retry_throttle.cc +5 -3
- data/src/core/ext/filters/client_channel/retry_throttle.h +4 -2
- data/src/core/ext/filters/client_channel/server_address.cc +120 -7
- data/src/core/ext/filters/client_channel/server_address.h +44 -21
- data/src/core/ext/filters/client_channel/service_config.cc +18 -13
- data/src/core/ext/filters/client_channel/service_config.h +8 -5
- data/src/core/ext/filters/client_channel/service_config_call_data.h +19 -1
- data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +2 -2
- data/src/core/ext/filters/client_channel/service_config_parser.cc +8 -6
- data/src/core/ext/filters/client_channel/service_config_parser.h +8 -5
- data/src/core/ext/filters/client_channel/subchannel.cc +115 -87
- data/src/core/ext/filters/client_channel/subchannel.h +30 -24
- data/src/core/ext/filters/client_channel/subchannel_interface.h +41 -5
- data/src/core/ext/filters/client_channel/subchannel_pool_interface.h +6 -2
- data/src/core/ext/filters/deadline/deadline_filter.cc +87 -79
- data/src/core/ext/filters/deadline/deadline_filter.h +7 -11
- data/src/core/ext/filters/http/client/http_client_filter.cc +1 -1
- data/src/core/ext/filters/http/client_authority_filter.cc +6 -6
- data/src/core/ext/filters/http/http_filters_plugin.cc +6 -3
- data/src/core/ext/filters/http/server/http_server_filter.cc +3 -3
- data/src/core/ext/filters/max_age/max_age_filter.cc +3 -2
- data/src/core/ext/filters/message_size/message_size_filter.cc +3 -2
- data/src/core/ext/filters/message_size/message_size_filter.h +2 -1
- data/src/core/ext/filters/workarounds/workaround_utils.cc +1 -1
- data/src/core/ext/transport/chttp2/client/authority.cc +3 -3
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +87 -31
- data/src/core/ext/transport/chttp2/client/chttp2_connector.h +19 -2
- data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +20 -8
- data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc +21 -10
- data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +34 -47
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +200 -100
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +2 -1
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +2 -2
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +16 -9
- data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc +3 -2
- data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +7 -7
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +267 -319
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +11 -3
- data/src/core/ext/transport/chttp2/transport/flow_control.h +13 -3
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +2 -1
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_settings.h +2 -1
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +6 -6
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +12 -8
- data/src/core/ext/transport/chttp2/transport/internal.h +10 -2
- data/src/core/ext/transport/chttp2/transport/parsing.cc +19 -31
- data/src/core/ext/transport/chttp2/transport/writing.cc +8 -8
- data/src/core/ext/transport/inproc/inproc_transport.cc +52 -18
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +1 -0
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +1 -1
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +7 -0
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +244 -0
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +865 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c +74 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h +253 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +458 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +1818 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c +35 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h +77 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +55 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +349 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +124 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +428 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c +35 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h +88 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +310 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +991 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +103 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +388 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c +34 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h +78 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c +53 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h +149 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +241 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +839 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +170 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +752 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c +36 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h +88 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +176 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +730 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +28 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h +65 -0
- data/src/core/ext/upb-generated/envoy/{api/v2/core → config/core/v3}/socket_option.upb.c +8 -8
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +95 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +36 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +92 -0
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +91 -0
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h +243 -0
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +91 -0
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +305 -0
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c +112 -0
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h +367 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c +33 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h +73 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +128 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +512 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +155 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +591 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +41 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +107 -0
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +178 -0
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +662 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +63 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +220 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +900 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +3640 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c +60 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h +159 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +50 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h +122 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +364 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +1475 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c +20 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h +35 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +110 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +426 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +76 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +236 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +147 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +621 -0
- data/src/core/ext/upb-generated/envoy/{api/v2 → service/cluster/v3}/cds.upb.c +6 -7
- data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h +56 -0
- data/src/core/ext/upb-generated/envoy/service/discovery/{v2 → v3}/ads.upb.c +6 -5
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h +56 -0
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +139 -0
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +487 -0
- data/src/core/ext/upb-generated/envoy/{api/v2 → service/endpoint/v3}/eds.upb.c +6 -7
- data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h +56 -0
- data/src/core/ext/upb-generated/envoy/{api/v2 → service/listener/v3}/lds.upb.c +6 -7
- data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h +56 -0
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +55 -0
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h +151 -0
- data/src/core/ext/upb-generated/envoy/{api/v2 → service/route/v3}/rds.upb.c +6 -7
- data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h +56 -0
- data/src/core/ext/upb-generated/envoy/{api/v2 → service/route/v3}/srds.upb.c +6 -7
- data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h +56 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c +47 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h +128 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c +35 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h +84 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c +34 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h +78 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +64 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h +166 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +54 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h +146 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c +63 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h +207 -0
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c +88 -0
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h +301 -0
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c +90 -0
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h +283 -0
- data/src/core/ext/upb-generated/envoy/type/{http.upb.c → v3/http.upb.c} +2 -2
- data/src/core/ext/upb-generated/envoy/type/{http.upb.h → v3/http.upb.h} +9 -8
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c +40 -0
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h +99 -0
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.c +51 -0
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.h +130 -0
- data/src/core/ext/upb-generated/envoy/type/{semantic_version.upb.c → v3/semantic_version.upb.c} +7 -6
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h +68 -0
- data/src/core/ext/upb-generated/google/api/annotations.upb.h +1 -0
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c +242 -0
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h +830 -0
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +234 -0
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +842 -0
- data/src/core/ext/upb-generated/google/api/http.upb.c +3 -3
- data/src/core/ext/upb-generated/google/api/http.upb.h +25 -6
- data/src/core/ext/upb-generated/google/protobuf/any.upb.c +1 -1
- data/src/core/ext/upb-generated/google/protobuf/any.upb.h +7 -0
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +103 -103
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +455 -292
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.c +1 -1
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +7 -0
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.c +1 -1
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.h +7 -0
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +4 -4
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +23 -4
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +1 -1
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +7 -0
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +9 -9
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +55 -0
- data/src/core/ext/upb-generated/google/rpc/status.upb.c +1 -1
- data/src/core/ext/upb-generated/google/rpc/status.upb.h +10 -3
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +4 -4
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +11 -3
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +41 -41
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +149 -76
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c +5 -5
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +21 -6
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c +2 -2
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +13 -0
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +17 -17
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +82 -25
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +3 -3
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +19 -0
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.c +31 -0
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.h +64 -0
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +1 -0
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.c +2 -2
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.h +9 -2
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c +27 -0
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h +60 -0
- data/src/core/ext/upb-generated/udpa/core/v1/authority.upb.c +28 -0
- data/src/core/ext/upb-generated/udpa/core/v1/authority.upb.h +60 -0
- data/src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.c +52 -0
- data/src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.h +143 -0
- data/src/core/ext/upb-generated/udpa/core/v1/context_params.upb.c +42 -0
- data/src/core/ext/upb-generated/udpa/core/v1/context_params.upb.h +84 -0
- data/src/core/ext/upb-generated/udpa/core/v1/resource.upb.c +36 -0
- data/src/core/ext/upb-generated/udpa/core/v1/resource.upb.h +94 -0
- data/src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.c +54 -0
- data/src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.h +173 -0
- data/src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.c +36 -0
- data/src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.h +92 -0
- data/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c +3 -3
- data/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h +7 -0
- data/src/core/ext/upb-generated/validate/validate.upb.c +68 -68
- data/src/core/ext/upb-generated/validate/validate.upb.h +296 -157
- data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c +38 -0
- data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h +30 -0
- data/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c +41 -0
- data/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c +254 -0
- data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h +105 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c +100 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +558 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h +145 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c +53 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c +133 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c +127 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h +65 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c +56 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +266 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h +125 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +143 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h +55 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c +56 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c +66 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c +263 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h +100 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +233 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h +70 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c +56 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +228 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h +80 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c +46 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c +59 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c +55 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c +110 -0
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h +50 -0
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +113 -0
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h +50 -0
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c +146 -0
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h +55 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c +50 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +190 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h +55 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c +185 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h +65 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c +62 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +97 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +915 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h +280 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c +71 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c +64 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +511 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +115 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c +48 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h +30 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +166 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h +55 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c +105 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +249 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h +60 -0
- data/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c +72 -0
- data/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c +60 -0
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c +152 -0
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h +60 -0
- data/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c +83 -0
- data/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c +82 -0
- data/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c +83 -0
- data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c +86 -0
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c +74 -0
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c +64 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c +54 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c +53 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c +73 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c +72 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c +81 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c +92 -0
- data/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h +65 -0
- data/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c +95 -0
- data/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h +55 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c +34 -0
- data/src/core/ext/{upb-generated/gogoproto/gogo.upb.h → upbdefs-generated/envoy/type/v3/http.upbdefs.h} +10 -9
- data/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c +59 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c +54 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c +47 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c +40 -0
- data/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h +30 -0
- data/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c +61 -0
- data/src/core/ext/upbdefs-generated/google/api/http.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c +38 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c +386 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h +165 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c +39 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c +37 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c +65 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h +50 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c +39 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c +66 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h +75 -0
- data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c +42 -0
- data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c +70 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c +56 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c +33 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h +30 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c +49 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c +43 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/udpa/core/v1/authority.upbdefs.c +42 -0
- data/src/core/ext/upbdefs-generated/udpa/core/v1/authority.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/udpa/core/v1/collection_entry.upbdefs.c +62 -0
- data/src/core/ext/upbdefs-generated/udpa/core/v1/collection_entry.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/udpa/core/v1/context_params.upbdefs.c +45 -0
- data/src/core/ext/upbdefs-generated/udpa/core/v1/context_params.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource.upbdefs.c +49 -0
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_locator.upbdefs.c +68 -0
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_locator.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_name.upbdefs.c +51 -0
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_name.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c +307 -0
- data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.h +145 -0
- data/src/core/ext/xds/certificate_provider_factory.h +61 -0
- data/src/core/ext/xds/certificate_provider_registry.cc +103 -0
- data/src/core/ext/xds/certificate_provider_registry.h +57 -0
- data/src/core/ext/xds/certificate_provider_store.cc +87 -0
- data/src/core/ext/xds/certificate_provider_store.h +112 -0
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +144 -0
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +69 -0
- data/src/core/ext/xds/xds_api.cc +2308 -0
- data/src/core/ext/xds/xds_api.h +469 -0
- data/src/core/ext/{filters/client_channel/xds → xds}/xds_bootstrap.cc +208 -19
- data/src/core/ext/{filters/client_channel/xds → xds}/xds_bootstrap.h +31 -11
- data/src/core/ext/xds/xds_certificate_provider.cc +299 -0
- data/src/core/ext/xds/xds_certificate_provider.h +112 -0
- data/src/core/ext/{filters/client_channel/xds → xds}/xds_channel_args.h +9 -6
- data/src/core/ext/{filters/client_channel/xds → xds}/xds_client.cc +656 -865
- data/src/core/ext/{filters/client_channel/xds → xds}/xds_client.h +126 -99
- data/src/core/ext/{filters/client_channel/xds → xds}/xds_client_stats.cc +61 -18
- data/src/core/ext/{filters/client_channel/xds → xds}/xds_client_stats.h +38 -10
- data/src/core/ext/xds/xds_server_config_fetcher.cc +131 -0
- data/src/core/lib/channel/channel_args.cc +9 -8
- data/src/core/lib/channel/channel_args.h +0 -1
- data/src/core/lib/channel/channel_trace.cc +4 -2
- data/src/core/lib/channel/channel_trace.h +1 -1
- data/src/core/lib/channel/channelz.cc +37 -74
- data/src/core/lib/channel/channelz.h +14 -23
- data/src/core/lib/channel/channelz_registry.cc +15 -12
- data/src/core/lib/channel/channelz_registry.h +3 -1
- data/src/core/lib/channel/handshaker.cc +2 -2
- data/src/core/lib/channel/handshaker.h +2 -2
- data/src/core/lib/compression/compression.cc +8 -4
- data/src/core/lib/compression/compression_args.cc +3 -2
- data/src/core/lib/compression/compression_internal.cc +10 -5
- data/src/core/lib/compression/compression_internal.h +2 -1
- data/src/core/lib/compression/stream_compression_identity.cc +1 -3
- data/src/core/lib/debug/stats.h +2 -2
- data/src/core/lib/debug/stats_data.cc +1 -0
- data/src/core/lib/debug/stats_data.h +13 -13
- data/src/core/lib/gpr/alloc.cc +3 -2
- data/src/core/lib/gpr/cpu_iphone.cc +10 -2
- data/src/core/lib/gpr/log.cc +53 -16
- data/src/core/lib/gpr/log_linux.cc +19 -3
- data/src/core/lib/gpr/log_posix.cc +15 -1
- data/src/core/lib/gpr/log_windows.cc +18 -4
- data/src/core/lib/gpr/murmur_hash.cc +1 -1
- data/src/core/lib/gpr/spinlock.h +10 -2
- data/src/core/lib/gpr/string.cc +23 -22
- data/src/core/lib/gpr/string.h +5 -6
- data/src/core/lib/gpr/sync.cc +4 -4
- data/src/core/lib/gpr/sync_posix.cc +2 -8
- data/src/core/lib/gpr/time.cc +12 -12
- data/src/core/lib/gpr/time_precise.cc +5 -2
- data/src/core/lib/gpr/time_precise.h +6 -2
- data/src/core/lib/gpr/tls.h +4 -0
- data/src/core/lib/gpr/tls_msvc.h +2 -0
- data/src/core/lib/gpr/tls_stdcpp.h +48 -0
- data/src/core/lib/gpr/useful.h +5 -4
- data/src/core/lib/gprpp/arena.h +3 -2
- data/src/core/lib/gprpp/dual_ref_counted.h +331 -0
- data/src/core/lib/gprpp/examine_stack.cc +43 -0
- data/src/core/lib/gprpp/examine_stack.h +46 -0
- data/src/core/lib/gprpp/fork.cc +2 -2
- data/src/core/lib/gprpp/manual_constructor.h +1 -1
- data/src/core/lib/gprpp/orphanable.h +4 -8
- data/src/core/lib/gprpp/ref_counted.h +91 -68
- data/src/core/lib/gprpp/ref_counted_ptr.h +166 -7
- data/src/core/lib/gprpp/stat.h +38 -0
- data/src/core/lib/gprpp/stat_posix.cc +49 -0
- data/src/core/lib/gprpp/stat_windows.cc +48 -0
- data/src/core/lib/gprpp/thd.h +2 -2
- data/src/core/lib/gprpp/thd_posix.cc +42 -37
- data/src/core/lib/gprpp/thd_windows.cc +3 -1
- data/src/core/lib/http/httpcli.cc +1 -1
- data/src/core/lib/http/httpcli.h +2 -3
- data/src/core/lib/http/httpcli_security_connector.cc +1 -1
- data/src/core/lib/http/parser.cc +47 -27
- data/src/core/lib/iomgr/call_combiner.cc +8 -5
- data/src/core/lib/iomgr/combiner.cc +2 -1
- data/src/core/lib/iomgr/endpoint.cc +5 -1
- data/src/core/lib/iomgr/endpoint.h +8 -4
- data/src/core/lib/iomgr/endpoint_cfstream.cc +36 -11
- data/src/core/lib/iomgr/error.cc +17 -12
- data/src/core/lib/iomgr/error_internal.h +1 -1
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +20 -13
- data/src/core/lib/iomgr/ev_epollex_linux.cc +25 -17
- data/src/core/lib/iomgr/ev_poll_posix.cc +9 -7
- data/src/core/lib/iomgr/ev_posix.cc +0 -2
- data/src/core/lib/iomgr/exec_ctx.cc +1 -1
- data/src/core/lib/iomgr/exec_ctx.h +16 -12
- data/src/core/lib/iomgr/executor.cc +2 -1
- data/src/core/lib/iomgr/executor.h +1 -1
- data/src/core/lib/iomgr/executor/mpmcqueue.h +5 -5
- data/src/core/lib/iomgr/executor/threadpool.h +4 -4
- data/src/core/lib/iomgr/iomgr.cc +1 -11
- data/src/core/lib/iomgr/iomgr.h +0 -10
- data/src/core/lib/iomgr/load_file.h +1 -1
- data/src/core/lib/iomgr/lockfree_event.cc +19 -14
- data/src/core/lib/iomgr/lockfree_event.h +2 -2
- data/src/core/{ext/filters/client_channel → lib/iomgr}/parse_address.cc +128 -44
- data/src/core/lib/iomgr/parse_address.h +77 -0
- data/src/core/lib/iomgr/poller/eventmanager_libuv.cc +2 -1
- data/src/core/lib/iomgr/poller/eventmanager_libuv.h +1 -1
- data/src/core/lib/iomgr/pollset_set_custom.cc +1 -1
- data/src/core/lib/iomgr/python_util.h +4 -4
- data/src/core/lib/iomgr/resolve_address.cc +4 -4
- data/src/core/lib/iomgr/resolve_address_posix.cc +1 -5
- data/src/core/lib/iomgr/resource_quota.cc +4 -4
- data/src/core/lib/iomgr/sockaddr_utils.cc +12 -11
- data/src/core/lib/iomgr/sockaddr_utils.h +3 -2
- data/src/core/lib/iomgr/socket_factory_posix.cc +3 -2
- data/src/core/lib/iomgr/socket_mutator.cc +3 -2
- data/src/core/lib/iomgr/tcp_client.cc +3 -3
- data/src/core/lib/iomgr/tcp_client_custom.cc +7 -6
- data/src/core/lib/iomgr/tcp_custom.cc +53 -32
- data/src/core/lib/iomgr/tcp_posix.cc +43 -21
- data/src/core/lib/iomgr/tcp_server_custom.cc +28 -22
- data/src/core/lib/iomgr/tcp_windows.cc +26 -10
- data/src/core/lib/iomgr/timer_custom.cc +5 -5
- data/src/core/lib/iomgr/timer_generic.cc +3 -3
- data/src/core/lib/iomgr/timer_manager.cc +2 -2
- data/src/core/lib/iomgr/udp_server.cc +1 -2
- data/src/core/lib/iomgr/udp_server.h +1 -2
- data/src/core/lib/iomgr/unix_sockets_posix.cc +32 -21
- data/src/core/lib/iomgr/unix_sockets_posix.h +5 -0
- data/src/core/lib/iomgr/unix_sockets_posix_noop.cc +7 -0
- data/src/core/lib/iomgr/wakeup_fd_pipe.cc +2 -2
- data/src/core/lib/json/json.h +12 -2
- data/src/core/lib/json/json_reader.cc +8 -4
- data/src/core/lib/json/json_util.cc +58 -0
- data/src/core/lib/json/json_util.h +204 -0
- data/src/core/lib/json/json_writer.cc +2 -1
- data/src/core/lib/security/authorization/authorization_engine.cc +177 -0
- data/src/core/lib/security/authorization/authorization_engine.h +84 -0
- data/src/core/lib/security/authorization/evaluate_args.cc +148 -0
- data/src/core/lib/security/authorization/evaluate_args.h +59 -0
- data/src/core/lib/security/authorization/mock_cel/activation.h +57 -0
- data/src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h +44 -0
- data/src/core/lib/security/authorization/mock_cel/cel_expression.h +69 -0
- data/src/core/lib/security/authorization/mock_cel/cel_value.h +97 -0
- data/src/core/lib/security/authorization/mock_cel/evaluator_core.h +67 -0
- data/src/core/lib/security/authorization/mock_cel/flat_expr_builder.h +57 -0
- data/src/core/lib/security/context/security_context.cc +4 -3
- data/src/core/lib/security/context/security_context.h +3 -1
- data/src/core/lib/security/credentials/alts/check_gcp_environment.cc +1 -1
- data/src/core/lib/security/credentials/credentials.cc +7 -7
- data/src/core/lib/security/credentials/credentials.h +3 -3
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +413 -0
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.h +80 -0
- data/src/core/lib/security/credentials/external/aws_request_signer.cc +213 -0
- data/src/core/lib/security/credentials/external/aws_request_signer.h +72 -0
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +497 -0
- data/src/core/lib/security/credentials/external/external_account_credentials.h +120 -0
- data/src/core/lib/security/credentials/external/file_external_account_credentials.cc +135 -0
- data/src/core/lib/security/credentials/external/file_external_account_credentials.h +48 -0
- data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +213 -0
- data/src/core/lib/security/credentials/external/url_external_account_credentials.h +58 -0
- data/src/core/lib/security/credentials/fake/fake_credentials.cc +2 -1
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +74 -50
- data/src/core/lib/security/credentials/insecure/insecure_credentials.cc +64 -0
- data/src/core/lib/security/credentials/jwt/json_token.cc +6 -3
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +4 -3
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +8 -4
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +39 -46
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +5 -4
- data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +1 -1
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +5 -5
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +1 -1
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc +346 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h +213 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +399 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +138 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +78 -150
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +57 -187
- data/src/core/lib/security/credentials/tls/tls_credentials.cc +16 -12
- data/src/core/lib/security/credentials/tls/tls_credentials.h +2 -2
- data/src/core/lib/security/credentials/tls/tls_utils.cc +91 -0
- data/src/core/lib/security/credentials/tls/tls_utils.h +38 -0
- data/src/core/lib/security/credentials/xds/xds_credentials.cc +175 -0
- data/src/core/lib/security/credentials/xds/xds_credentials.h +69 -0
- data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +1 -1
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +10 -15
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc +121 -0
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +87 -0
- data/src/core/lib/security/security_connector/load_system_roots.h +4 -0
- data/src/core/lib/security/security_connector/load_system_roots_linux.h +2 -0
- data/src/core/lib/security/security_connector/local/local_security_connector.cc +3 -3
- data/src/core/lib/security/security_connector/security_connector.cc +4 -3
- data/src/core/lib/security/security_connector/security_connector.h +4 -2
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +4 -4
- data/src/core/lib/security/security_connector/ssl_utils.cc +2 -2
- data/src/core/lib/security/security_connector/ssl_utils.h +19 -19
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +342 -279
- data/src/core/lib/security/security_connector/tls/tls_security_connector.h +105 -61
- data/src/core/lib/security/transport/secure_endpoint.cc +9 -3
- data/src/core/lib/security/transport/security_handshaker.cc +3 -3
- data/src/core/lib/security/transport/server_auth_filter.cc +2 -1
- data/src/core/lib/security/util/json_util.h +1 -0
- data/src/core/lib/slice/slice.cc +7 -4
- data/src/core/lib/slice/slice_buffer.cc +2 -1
- data/src/core/lib/slice/slice_intern.cc +6 -7
- data/src/core/lib/slice/slice_internal.h +2 -2
- data/src/core/lib/surface/call.cc +53 -44
- data/src/core/lib/surface/call.h +2 -1
- data/src/core/lib/surface/call_details.cc +8 -8
- data/src/core/lib/surface/channel.cc +53 -61
- data/src/core/lib/surface/channel.h +21 -5
- data/src/core/lib/surface/channel_init.cc +1 -1
- data/src/core/lib/surface/completion_queue.cc +38 -294
- data/src/core/lib/surface/completion_queue.h +16 -24
- data/src/core/lib/surface/init.cc +32 -16
- data/src/core/lib/surface/lame_client.cc +20 -46
- data/src/core/lib/surface/lame_client.h +4 -0
- data/src/core/lib/surface/server.cc +1107 -1239
- data/src/core/lib/surface/server.h +394 -86
- data/src/core/lib/surface/validate_metadata.h +3 -0
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/authority_override.cc +40 -0
- data/src/core/lib/transport/authority_override.h +37 -0
- data/src/core/lib/transport/bdp_estimator.cc +1 -1
- data/src/core/lib/transport/bdp_estimator.h +2 -1
- data/src/core/lib/transport/byte_stream.h +3 -3
- data/src/core/lib/transport/connectivity_state.cc +18 -13
- data/src/core/lib/transport/connectivity_state.h +26 -12
- data/src/core/lib/transport/error_utils.cc +13 -0
- data/src/core/lib/transport/error_utils.h +7 -1
- data/src/core/lib/transport/metadata.cc +11 -1
- data/src/core/lib/transport/metadata.h +2 -2
- data/src/core/lib/transport/metadata_batch.h +4 -4
- data/src/core/lib/transport/static_metadata.cc +296 -277
- data/src/core/lib/transport/static_metadata.h +80 -73
- data/src/core/lib/transport/status_metadata.cc +4 -3
- data/src/core/lib/transport/timeout_encoding.cc +4 -4
- data/src/core/lib/transport/transport.cc +5 -3
- data/src/core/lib/transport/transport.h +15 -8
- data/src/core/lib/uri/uri_parser.cc +131 -247
- data/src/core/lib/uri/uri_parser.h +58 -20
- data/src/core/plugin_registry/grpc_plugin_registry.cc +41 -20
- data/src/core/tsi/alts/crypt/gsec.cc +5 -4
- data/src/core/tsi/alts/frame_protector/frame_handler.cc +8 -6
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +1 -1
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +49 -26
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.cc +8 -6
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +4 -4
- data/src/core/tsi/fake_transport_security.cc +6 -3
- data/src/core/tsi/local_transport_security.cc +5 -1
- data/src/core/tsi/local_transport_security.h +6 -7
- data/src/core/tsi/ssl/session_cache/ssl_session.h +3 -0
- data/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc +1 -1
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +4 -1
- data/src/core/tsi/ssl_transport_security.cc +81 -67
- data/src/core/tsi/ssl_transport_security.h +9 -6
- data/src/core/tsi/transport_security.cc +10 -8
- data/src/core/tsi/transport_security_interface.h +1 -1
- data/src/ruby/ext/grpc/extconf.rb +1 -1
- data/src/ruby/ext/grpc/rb_channel_credentials.c +9 -0
- data/src/ruby/ext/grpc/rb_event_thread.c +2 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +38 -18
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +74 -44
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +28 -0
- data/src/ruby/pb/src/proto/grpc/testing/test_services_pb.rb +18 -0
- data/src/ruby/spec/channel_credentials_spec.rb +10 -0
- data/src/ruby/spec/generic/active_call_spec.rb +19 -8
- data/src/ruby/spec/pb/codegen/package_option_spec.rb +2 -6
- data/third_party/abseil-cpp/absl/algorithm/container.h +1764 -0
- data/third_party/abseil-cpp/absl/base/attributes.h +99 -38
- data/third_party/abseil-cpp/absl/base/call_once.h +1 -1
- data/third_party/abseil-cpp/absl/base/casts.h +9 -6
- data/third_party/abseil-cpp/absl/base/config.h +60 -17
- data/third_party/abseil-cpp/absl/base/dynamic_annotations.h +428 -335
- data/third_party/abseil-cpp/absl/base/internal/bits.h +17 -16
- data/third_party/abseil-cpp/absl/base/internal/direct_mmap.h +166 -0
- data/third_party/abseil-cpp/absl/base/internal/dynamic_annotations.h +398 -0
- data/third_party/abseil-cpp/absl/base/internal/exponential_biased.cc +93 -0
- data/third_party/abseil-cpp/absl/base/internal/exponential_biased.h +130 -0
- data/third_party/abseil-cpp/absl/base/internal/invoke.h +4 -4
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc +620 -0
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.h +126 -0
- data/third_party/abseil-cpp/absl/base/internal/low_level_scheduling.h +29 -1
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +2 -2
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +7 -5
- data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +25 -38
- data/third_party/abseil-cpp/absl/base/internal/spinlock.h +19 -25
- data/third_party/abseil-cpp/absl/base/internal/spinlock_linux.inc +8 -0
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +28 -5
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.h +8 -0
- data/third_party/abseil-cpp/absl/base/internal/tsan_mutex_interface.h +3 -1
- data/third_party/abseil-cpp/absl/base/internal/unaligned_access.h +2 -2
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +3 -3
- data/third_party/abseil-cpp/absl/base/macros.h +36 -109
- data/third_party/abseil-cpp/absl/base/optimization.h +61 -1
- data/third_party/abseil-cpp/absl/base/options.h +31 -4
- data/third_party/abseil-cpp/absl/base/policy_checks.h +1 -1
- data/third_party/abseil-cpp/absl/base/thread_annotations.h +94 -39
- data/third_party/abseil-cpp/absl/container/fixed_array.h +532 -0
- data/third_party/abseil-cpp/absl/container/flat_hash_map.h +606 -0
- data/third_party/abseil-cpp/absl/container/flat_hash_set.h +504 -0
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +33 -36
- data/third_party/abseil-cpp/absl/container/internal/common.h +206 -0
- data/third_party/abseil-cpp/absl/container/internal/compressed_tuple.h +33 -8
- data/third_party/abseil-cpp/absl/container/internal/container_memory.h +460 -0
- data/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h +161 -0
- data/third_party/abseil-cpp/absl/container/internal/hash_policy_traits.h +208 -0
- data/third_party/abseil-cpp/absl/container/internal/hashtable_debug_hooks.h +85 -0
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +270 -0
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +321 -0
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler_force_weak_definition.cc +30 -0
- data/third_party/abseil-cpp/absl/container/internal/have_sse.h +50 -0
- data/third_party/abseil-cpp/absl/container/internal/layout.h +743 -0
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +197 -0
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +48 -0
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +1903 -0
- data/third_party/abseil-cpp/absl/debugging/internal/address_is_readable.cc +139 -0
- data/third_party/abseil-cpp/absl/debugging/internal/address_is_readable.h +32 -0
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +1945 -0
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.h +71 -0
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc +382 -0
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h +134 -0
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +196 -0
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_arm-inl.inc +134 -0
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h +89 -0
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_generic-inl.inc +108 -0
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +248 -0
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_unimplemented-inl.inc +24 -0
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_win32-inl.inc +93 -0
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +346 -0
- data/third_party/abseil-cpp/absl/debugging/internal/symbolize.h +149 -0
- data/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc +173 -0
- data/third_party/abseil-cpp/absl/debugging/internal/vdso_support.h +158 -0
- data/third_party/abseil-cpp/absl/debugging/stacktrace.cc +140 -0
- data/third_party/abseil-cpp/absl/debugging/stacktrace.h +231 -0
- data/third_party/abseil-cpp/absl/debugging/symbolize.cc +36 -0
- data/third_party/abseil-cpp/absl/debugging/symbolize.h +99 -0
- data/third_party/abseil-cpp/absl/debugging/symbolize_darwin.inc +101 -0
- data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +1560 -0
- data/third_party/abseil-cpp/absl/debugging/symbolize_unimplemented.inc +40 -0
- data/third_party/abseil-cpp/absl/debugging/symbolize_win32.inc +81 -0
- data/third_party/abseil-cpp/absl/functional/bind_front.h +184 -0
- data/third_party/abseil-cpp/absl/functional/function_ref.h +139 -0
- data/third_party/abseil-cpp/absl/functional/internal/front_binder.h +95 -0
- data/third_party/abseil-cpp/absl/functional/internal/function_ref.h +106 -0
- data/third_party/abseil-cpp/absl/hash/hash.h +325 -0
- data/third_party/abseil-cpp/absl/hash/internal/city.cc +346 -0
- data/third_party/abseil-cpp/absl/hash/internal/city.h +96 -0
- data/third_party/abseil-cpp/absl/hash/internal/hash.cc +55 -0
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +996 -0
- data/third_party/abseil-cpp/absl/memory/memory.h +4 -0
- data/third_party/abseil-cpp/absl/meta/type_traits.h +2 -8
- data/third_party/abseil-cpp/absl/numeric/int128.cc +13 -27
- data/third_party/abseil-cpp/absl/numeric/int128.h +16 -15
- data/third_party/abseil-cpp/absl/status/internal/status_internal.h +51 -0
- data/third_party/abseil-cpp/absl/status/internal/statusor_internal.h +399 -0
- data/third_party/abseil-cpp/absl/status/status.cc +445 -0
- data/third_party/abseil-cpp/absl/status/status.h +817 -0
- data/third_party/abseil-cpp/absl/status/status_payload_printer.cc +38 -0
- data/third_party/abseil-cpp/absl/status/status_payload_printer.h +51 -0
- data/third_party/abseil-cpp/absl/status/statusor.cc +71 -0
- data/third_party/abseil-cpp/absl/status/statusor.h +760 -0
- data/third_party/abseil-cpp/absl/strings/charconv.cc +2 -2
- data/third_party/abseil-cpp/absl/strings/cord.cc +1998 -0
- data/third_party/abseil-cpp/absl/strings/cord.h +1276 -0
- data/third_party/abseil-cpp/absl/strings/escaping.cc +9 -9
- data/third_party/abseil-cpp/absl/strings/internal/char_map.h +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.h +2 -2
- data/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc +2 -2
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +173 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +222 -136
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +136 -64
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +14 -21
- data/third_party/abseil-cpp/absl/strings/internal/str_format/checker.h +7 -14
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +31 -7
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +147 -135
- data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +999 -87
- data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.h +3 -3
- data/third_party/abseil-cpp/absl/strings/internal/str_format/output.h +4 -12
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc +8 -6
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +13 -11
- data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +2 -2
- data/third_party/abseil-cpp/absl/strings/str_cat.cc +4 -4
- data/third_party/abseil-cpp/absl/strings/str_cat.h +1 -1
- data/third_party/abseil-cpp/absl/strings/str_format.h +289 -13
- data/third_party/abseil-cpp/absl/strings/str_split.cc +2 -2
- data/third_party/abseil-cpp/absl/strings/str_split.h +1 -0
- data/third_party/abseil-cpp/absl/strings/string_view.h +26 -19
- data/third_party/abseil-cpp/absl/strings/substitute.cc +5 -5
- data/third_party/abseil-cpp/absl/strings/substitute.h +32 -29
- data/third_party/abseil-cpp/absl/synchronization/barrier.cc +52 -0
- data/third_party/abseil-cpp/absl/synchronization/barrier.h +79 -0
- data/third_party/abseil-cpp/absl/synchronization/blocking_counter.cc +57 -0
- data/third_party/abseil-cpp/absl/synchronization/blocking_counter.h +99 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.cc +140 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.h +60 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc +697 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.h +141 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h +155 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/mutex_nonprod.inc +249 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.cc +106 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.h +115 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc +492 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter.h +159 -0
- data/third_party/abseil-cpp/absl/synchronization/mutex.cc +2739 -0
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +1065 -0
- data/third_party/abseil-cpp/absl/synchronization/notification.cc +78 -0
- data/third_party/abseil-cpp/absl/synchronization/notification.h +123 -0
- data/third_party/abseil-cpp/absl/time/civil_time.cc +9 -9
- data/third_party/abseil-cpp/absl/time/clock.cc +3 -3
- data/third_party/abseil-cpp/absl/time/duration.cc +90 -59
- data/third_party/abseil-cpp/absl/time/format.cc +43 -36
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time_detail.h +26 -16
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h +4 -2
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/zone_info_source.h +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc +136 -29
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.cc +13 -21
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.h +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc +136 -129
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.h +4 -5
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.cc +8 -7
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h +6 -6
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc +2 -1
- data/third_party/abseil-cpp/absl/time/time.h +15 -16
- data/third_party/abseil-cpp/absl/types/bad_variant_access.cc +64 -0
- data/third_party/abseil-cpp/absl/types/bad_variant_access.h +82 -0
- data/third_party/abseil-cpp/absl/types/internal/variant.h +1646 -0
- data/third_party/abseil-cpp/absl/types/optional.h +9 -9
- data/third_party/abseil-cpp/absl/types/span.h +49 -36
- data/third_party/abseil-cpp/absl/types/variant.h +861 -0
- data/third_party/abseil-cpp/absl/utility/utility.h +2 -2
- data/third_party/address_sorting/include/address_sorting/address_sorting.h +2 -0
- data/third_party/boringssl-with-bazel/err_data.c +479 -467
- data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_lib.c +0 -6
- data/third_party/boringssl-with-bazel/src/crypto/bio/bio.c +2 -0
- data/third_party/boringssl-with-bazel/src/crypto/dsa/dsa.c +9 -43
- data/third_party/boringssl-with-bazel/src/crypto/dsa/dsa_asn1.c +55 -4
- data/third_party/boringssl-with-bazel/src/crypto/dsa/internal.h +34 -0
- data/third_party/boringssl-with-bazel/src/crypto/evp/evp.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/evp/evp_asn1.c +16 -0
- data/third_party/boringssl-with-bazel/src/crypto/evp/p_dsa_asn1.c +6 -2
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/e_aes.c +173 -35
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/digest/digest.c +2 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/internal.h +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa.c +30 -10
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa_impl.c +56 -22
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/self_check.c +8 -2
- data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +543 -0
- data/third_party/boringssl-with-bazel/src/crypto/hpke/internal.h +237 -0
- data/third_party/boringssl-with-bazel/src/crypto/trust_token/internal.h +118 -49
- data/third_party/boringssl-with-bazel/src/crypto/trust_token/pmbtoken.c +267 -95
- data/third_party/boringssl-with-bazel/src/crypto/trust_token/trust_token.c +210 -34
- data/third_party/boringssl-with-bazel/src/crypto/trust_token/voprf.c +766 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/a_strex.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509/algorithm.c +6 -4
- data/third_party/boringssl-with-bazel/src/crypto/x509/t_crl.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509/t_x509.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_cmp.c +7 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_ext.c +21 -18
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_obj.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_set.c +24 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_trs.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_txt.c +67 -67
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_v3.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_vfy.c +29 -35
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509cset.c +13 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509name.c +9 -8
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_all.c +10 -10
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_crl.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_name.c +28 -40
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_sig.c +20 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_x509.c +3 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/ext_dat.h +1 -4
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_data.c +5 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_alt.c +14 -14
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_conf.c +7 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_genn.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_info.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_prn.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_purp.c +55 -8
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_skey.c +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/aead.h +24 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/arm_arch.h +54 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1.h +0 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/base.h +6 -3
- data/third_party/boringssl-with-bazel/src/include/openssl/bio.h +4 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/cipher.h +6 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/crypto.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/des.h +6 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/dh.h +12 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/digest.h +9 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +4 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/opensslconf.h +3 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/pem.h +202 -134
- data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +103 -10
- data/third_party/boringssl-with-bazel/src/include/openssl/tls1.h +5 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/trust_token.h +42 -14
- data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +199 -78
- data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +482 -432
- data/third_party/boringssl-with-bazel/src/ssl/bio_ssl.cc +18 -5
- data/third_party/boringssl-with-bazel/src/ssl/handoff.cc +35 -0
- data/third_party/boringssl-with-bazel/src/ssl/handshake.cc +18 -18
- data/third_party/boringssl-with-bazel/src/ssl/handshake_client.cc +2 -3
- data/third_party/boringssl-with-bazel/src/ssl/handshake_server.cc +1 -1
- data/third_party/boringssl-with-bazel/src/ssl/internal.h +49 -10
- data/third_party/boringssl-with-bazel/src/ssl/ssl_asn1.cc +42 -1
- data/third_party/boringssl-with-bazel/src/ssl/ssl_cert.cc +3 -6
- data/third_party/boringssl-with-bazel/src/ssl/ssl_cipher.cc +8 -9
- data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +77 -0
- data/third_party/boringssl-with-bazel/src/ssl/ssl_session.cc +11 -14
- data/third_party/boringssl-with-bazel/src/ssl/t1_lib.cc +250 -20
- data/third_party/boringssl-with-bazel/src/ssl/tls13_both.cc +1 -2
- data/third_party/boringssl-with-bazel/src/ssl/tls13_client.cc +57 -19
- data/third_party/boringssl-with-bazel/src/ssl/tls13_server.cc +140 -41
- data/third_party/boringssl-with-bazel/src/ssl/tls_record.cc +5 -3
- data/third_party/upb/third_party/wyhash/wyhash.h +145 -0
- data/third_party/upb/upb/decode.c +275 -145
- data/third_party/upb/upb/decode.h +20 -1
- data/third_party/upb/upb/decode.int.h +163 -0
- data/third_party/upb/upb/decode_fast.c +1040 -0
- data/third_party/upb/upb/decode_fast.h +126 -0
- data/third_party/upb/upb/def.c +2178 -0
- data/third_party/upb/upb/def.h +315 -0
- data/third_party/upb/upb/def.hpp +439 -0
- data/third_party/upb/upb/encode.c +229 -171
- data/third_party/upb/upb/encode.h +27 -2
- data/third_party/upb/upb/json_decode.c +1443 -0
- data/third_party/upb/upb/json_decode.h +23 -0
- data/third_party/upb/upb/json_encode.c +713 -0
- data/third_party/upb/upb/json_encode.h +36 -0
- data/third_party/upb/upb/msg.c +167 -88
- data/third_party/upb/upb/msg.h +175 -35
- data/third_party/upb/upb/port_def.inc +75 -62
- data/third_party/upb/upb/port_undef.inc +3 -7
- data/third_party/upb/upb/reflection.c +408 -0
- data/third_party/upb/upb/reflection.h +168 -0
- data/third_party/upb/upb/table.c +34 -208
- data/third_party/upb/upb/table.int.h +14 -14
- data/third_party/upb/upb/text_encode.c +421 -0
- data/third_party/upb/upb/text_encode.h +38 -0
- data/third_party/upb/upb/upb.c +33 -54
- data/third_party/upb/upb/upb.h +56 -1
- data/third_party/upb/upb/upb.hpp +6 -4
- data/third_party/upb/upb/upb.int.h +29 -0
- metadata +508 -172
- data/src/core/ext/filters/client_channel/lb_policy/xds/eds.cc +0 -938
- data/src/core/ext/filters/client_channel/lb_policy/xds/lrs.cc +0 -528
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_routing.cc +0 -1143
- data/src/core/ext/filters/client_channel/parse_address.h +0 -53
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc +0 -485
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc +0 -68
- data/src/core/ext/filters/client_channel/resolving_lb_policy.cc +0 -353
- data/src/core/ext/filters/client_channel/resolving_lb_policy.h +0 -142
- data/src/core/ext/filters/client_channel/xds/xds_api.cc +0 -2110
- data/src/core/ext/filters/client_channel/xds/xds_api.h +0 -345
- data/src/core/ext/filters/client_channel/xds/xds_channel.h +0 -46
- data/src/core/ext/filters/client_channel/xds/xds_channel_secure.cc +0 -106
- data/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c +0 -21
- data/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h +0 -34
- data/src/core/ext/upb-generated/envoy/api/v2/auth/common.upb.c +0 -114
- data/src/core/ext/upb-generated/envoy/api/v2/auth/common.upb.h +0 -429
- data/src/core/ext/upb-generated/envoy/api/v2/auth/secret.upb.c +0 -72
- data/src/core/ext/upb-generated/envoy/api/v2/auth/secret.upb.h +0 -198
- data/src/core/ext/upb-generated/envoy/api/v2/auth/tls.upb.c +0 -105
- data/src/core/ext/upb-generated/envoy/api/v2/auth/tls.upb.h +0 -388
- data/src/core/ext/upb-generated/envoy/api/v2/cds.upb.h +0 -52
- data/src/core/ext/upb-generated/envoy/api/v2/cluster.upb.c +0 -403
- data/src/core/ext/upb-generated/envoy/api/v2/cluster.upb.h +0 -1453
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c +0 -74
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h +0 -226
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c +0 -35
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h +0 -69
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c +0 -55
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h +0 -323
- data/src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c +0 -112
- data/src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h +0 -334
- data/src/core/ext/upb-generated/envoy/api/v2/core/backoff.upb.c +0 -35
- data/src/core/ext/upb-generated/envoy/api/v2/core/backoff.upb.h +0 -79
- data/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c +0 -313
- data/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h +0 -891
- data/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c +0 -96
- data/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h +0 -328
- data/src/core/ext/upb-generated/envoy/api/v2/core/event_service_config.upb.c +0 -34
- data/src/core/ext/upb-generated/envoy/api/v2/core/event_service_config.upb.h +0 -71
- data/src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c +0 -197
- data/src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h +0 -649
- data/src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c +0 -172
- data/src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h +0 -693
- data/src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c +0 -36
- data/src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h +0 -80
- data/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c +0 -152
- data/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h +0 -536
- data/src/core/ext/upb-generated/envoy/api/v2/core/socket_option.upb.h +0 -88
- data/src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c +0 -129
- data/src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h +0 -386
- data/src/core/ext/upb-generated/envoy/api/v2/eds.upb.h +0 -52
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint.upb.c +0 -92
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint.upb.h +0 -224
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c +0 -18
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h +0 -32
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint_components.upb.c +0 -91
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint_components.upb.h +0 -273
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c +0 -112
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h +0 -332
- data/src/core/ext/upb-generated/envoy/api/v2/lds.upb.h +0 -52
- data/src/core/ext/upb-generated/envoy/api/v2/listener.upb.c +0 -109
- data/src/core/ext/upb-generated/envoy/api/v2/listener.upb.h +0 -415
- data/src/core/ext/upb-generated/envoy/api/v2/listener/listener.upb.c +0 -18
- data/src/core/ext/upb-generated/envoy/api/v2/listener/listener.upb.h +0 -32
- data/src/core/ext/upb-generated/envoy/api/v2/listener/listener_components.upb.c +0 -145
- data/src/core/ext/upb-generated/envoy/api/v2/listener/listener_components.upb.h +0 -538
- data/src/core/ext/upb-generated/envoy/api/v2/listener/udp_listener_config.upb.c +0 -43
- data/src/core/ext/upb-generated/envoy/api/v2/listener/udp_listener_config.upb.h +0 -111
- data/src/core/ext/upb-generated/envoy/api/v2/rds.upb.h +0 -52
- data/src/core/ext/upb-generated/envoy/api/v2/route.upb.c +0 -63
- data/src/core/ext/upb-generated/envoy/api/v2/route.upb.h +0 -204
- data/src/core/ext/upb-generated/envoy/api/v2/route/route.upb.c +0 -18
- data/src/core/ext/upb-generated/envoy/api/v2/route/route.upb.h +0 -32
- data/src/core/ext/upb-generated/envoy/api/v2/route/route_components.upb.c +0 -815
- data/src/core/ext/upb-generated/envoy/api/v2/route/route_components.upb.h +0 -2984
- data/src/core/ext/upb-generated/envoy/api/v2/scoped_route.upb.c +0 -59
- data/src/core/ext/upb-generated/envoy/api/v2/scoped_route.upb.h +0 -135
- data/src/core/ext/upb-generated/envoy/api/v2/srds.upb.h +0 -52
- data/src/core/ext/upb-generated/envoy/config/filter/accesslog/v2/accesslog.upb.c +0 -228
- data/src/core/ext/upb-generated/envoy/config/filter/accesslog/v2/accesslog.upb.h +0 -732
- data/src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.upb.c +0 -316
- data/src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.upb.h +0 -1167
- data/src/core/ext/upb-generated/envoy/config/listener/v2/api_listener.upb.c +0 -33
- data/src/core/ext/upb-generated/envoy/config/listener/v2/api_listener.upb.h +0 -65
- data/src/core/ext/upb-generated/envoy/config/trace/v2/http_tracer.upb.c +0 -51
- data/src/core/ext/upb-generated/envoy/config/trace/v2/http_tracer.upb.h +0 -125
- data/src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h +0 -49
- data/src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c +0 -54
- data/src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h +0 -136
- data/src/core/ext/upb-generated/envoy/type/matcher/regex.upb.c +0 -63
- data/src/core/ext/upb-generated/envoy/type/matcher/regex.upb.h +0 -145
- data/src/core/ext/upb-generated/envoy/type/matcher/string.upb.c +0 -53
- data/src/core/ext/upb-generated/envoy/type/matcher/string.upb.h +0 -133
- data/src/core/ext/upb-generated/envoy/type/metadata/v2/metadata.upb.c +0 -88
- data/src/core/ext/upb-generated/envoy/type/metadata/v2/metadata.upb.h +0 -258
- data/src/core/ext/upb-generated/envoy/type/percent.upb.c +0 -39
- data/src/core/ext/upb-generated/envoy/type/percent.upb.h +0 -86
- data/src/core/ext/upb-generated/envoy/type/range.upb.c +0 -50
- data/src/core/ext/upb-generated/envoy/type/range.upb.h +0 -111
- data/src/core/ext/upb-generated/envoy/type/semantic_version.upb.h +0 -61
- data/src/core/ext/upb-generated/envoy/type/tracing/v2/custom_tag.upb.c +0 -89
- data/src/core/ext/upb-generated/envoy/type/tracing/v2/custom_tag.upb.h +0 -250
- data/src/core/ext/upb-generated/gogoproto/gogo.upb.c +0 -17
- data/src/core/lib/gprpp/map.h +0 -53
- data/src/core/lib/security/transport/target_authority_table.cc +0 -75
- data/src/core/lib/security/transport/target_authority_table.h +0 -40
- data/src/core/lib/slice/slice_hash_table.h +0 -199
- data/src/core/lib/slice/slice_weak_hash_table.h +0 -102
- data/third_party/abseil-cpp/absl/base/dynamic_annotations.cc +0 -129
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_pku.c +0 -110
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_sxnet.c +0 -274
- data/third_party/upb/upb/port.c +0 -26
@@ -0,0 +1,112 @@
|
|
1
|
+
//
|
2
|
+
//
|
3
|
+
// Copyright 2020 gRPC authors.
|
4
|
+
//
|
5
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
// you may not use this file except in compliance with the License.
|
7
|
+
// You may obtain a copy of the License at
|
8
|
+
//
|
9
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
//
|
11
|
+
// Unless required by applicable law or agreed to in writing, software
|
12
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
// See the License for the specific language governing permissions and
|
15
|
+
// limitations under the License.
|
16
|
+
//
|
17
|
+
//
|
18
|
+
|
19
|
+
#ifndef GRPC_CORE_EXT_XDS_XDS_CERTIFICATE_PROVIDER_H
|
20
|
+
#define GRPC_CORE_EXT_XDS_XDS_CERTIFICATE_PROVIDER_H
|
21
|
+
|
22
|
+
#include <grpc/support/port_platform.h>
|
23
|
+
|
24
|
+
#include "src/core/ext/xds/xds_api.h"
|
25
|
+
#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h"
|
26
|
+
|
27
|
+
#define GRPC_ARG_XDS_CERTIFICATE_PROVIDER \
|
28
|
+
"grpc.internal.xds_certificate_provider"
|
29
|
+
|
30
|
+
namespace grpc_core {
|
31
|
+
|
32
|
+
class XdsCertificateProvider : public grpc_tls_certificate_provider {
|
33
|
+
public:
|
34
|
+
XdsCertificateProvider(
|
35
|
+
absl::string_view root_cert_name,
|
36
|
+
RefCountedPtr<grpc_tls_certificate_distributor> root_cert_distributor,
|
37
|
+
absl::string_view identity_cert_name,
|
38
|
+
RefCountedPtr<grpc_tls_certificate_distributor> identity_cert_distributor,
|
39
|
+
std::vector<XdsApi::StringMatcher> san_matchers);
|
40
|
+
|
41
|
+
~XdsCertificateProvider() override;
|
42
|
+
|
43
|
+
void UpdateRootCertNameAndDistributor(
|
44
|
+
absl::string_view root_cert_name,
|
45
|
+
RefCountedPtr<grpc_tls_certificate_distributor> root_cert_distributor);
|
46
|
+
void UpdateIdentityCertNameAndDistributor(
|
47
|
+
absl::string_view identity_cert_name,
|
48
|
+
RefCountedPtr<grpc_tls_certificate_distributor>
|
49
|
+
identity_cert_distributor);
|
50
|
+
void UpdateSubjectAlternativeNameMatchers(
|
51
|
+
std::vector<XdsApi::StringMatcher> matchers);
|
52
|
+
|
53
|
+
grpc_core::RefCountedPtr<grpc_tls_certificate_distributor> distributor()
|
54
|
+
const override {
|
55
|
+
return distributor_;
|
56
|
+
}
|
57
|
+
|
58
|
+
bool ProvidesRootCerts() {
|
59
|
+
MutexLock lock(&mu_);
|
60
|
+
return root_cert_distributor_ != nullptr;
|
61
|
+
}
|
62
|
+
|
63
|
+
bool ProvidesIdentityCerts() {
|
64
|
+
MutexLock lock(&mu_);
|
65
|
+
return identity_cert_distributor_ != nullptr;
|
66
|
+
}
|
67
|
+
|
68
|
+
std::vector<XdsApi::StringMatcher> subject_alternative_name_matchers() {
|
69
|
+
MutexLock lock(&san_matchers_mu_);
|
70
|
+
return san_matchers_;
|
71
|
+
}
|
72
|
+
|
73
|
+
grpc_arg MakeChannelArg() const;
|
74
|
+
|
75
|
+
static RefCountedPtr<XdsCertificateProvider> GetFromChannelArgs(
|
76
|
+
const grpc_channel_args* args);
|
77
|
+
|
78
|
+
private:
|
79
|
+
void WatchStatusCallback(std::string cert_name, bool root_being_watched,
|
80
|
+
bool identity_being_watched);
|
81
|
+
void UpdateRootCertWatcher(
|
82
|
+
grpc_tls_certificate_distributor* root_cert_distributor);
|
83
|
+
void UpdateIdentityCertWatcher(
|
84
|
+
grpc_tls_certificate_distributor* identity_cert_distributor);
|
85
|
+
|
86
|
+
Mutex mu_;
|
87
|
+
// Use a separate mutex for san_matchers_ to avoid deadlocks since
|
88
|
+
// san_matchers_ needs to be accessed when a handshake is being done and we
|
89
|
+
// run into a possible deadlock scenario if using the same mutex. The mutex
|
90
|
+
// deadlock cycle is formed as -
|
91
|
+
// WatchStatusCallback() -> SetKeyMaterials() ->
|
92
|
+
// TlsChannelSecurityConnector::TlsChannelCertificateWatcher::OnCertificatesChanged()
|
93
|
+
// -> HandshakeManager::Add() -> SecurityHandshaker::DoHandshake() ->
|
94
|
+
// subject_alternative_names_matchers()
|
95
|
+
Mutex san_matchers_mu_;
|
96
|
+
bool watching_root_certs_ = false;
|
97
|
+
bool watching_identity_certs_ = false;
|
98
|
+
std::string root_cert_name_;
|
99
|
+
std::string identity_cert_name_;
|
100
|
+
RefCountedPtr<grpc_tls_certificate_distributor> root_cert_distributor_;
|
101
|
+
RefCountedPtr<grpc_tls_certificate_distributor> identity_cert_distributor_;
|
102
|
+
std::vector<XdsApi::StringMatcher> san_matchers_;
|
103
|
+
RefCountedPtr<grpc_tls_certificate_distributor> distributor_;
|
104
|
+
grpc_tls_certificate_distributor::TlsCertificatesWatcherInterface*
|
105
|
+
root_cert_watcher_ = nullptr;
|
106
|
+
grpc_tls_certificate_distributor::TlsCertificatesWatcherInterface*
|
107
|
+
identity_cert_watcher_ = nullptr;
|
108
|
+
};
|
109
|
+
|
110
|
+
} // namespace grpc_core
|
111
|
+
|
112
|
+
#endif // GRPC_CORE_EXT_XDS_XDS_CERTIFICATE_PROVIDER_H
|
@@ -14,13 +14,16 @@
|
|
14
14
|
// limitations under the License.
|
15
15
|
//
|
16
16
|
|
17
|
-
#ifndef
|
18
|
-
#define
|
19
|
-
|
20
|
-
// Boolean channel arg indicating whether the target is an xds server.
|
21
|
-
#define GRPC_ARG_ADDRESS_IS_XDS_SERVER "grpc.address_is_xds_server"
|
17
|
+
#ifndef GRPC_CORE_EXT_XDS_XDS_CHANNEL_ARGS_H
|
18
|
+
#define GRPC_CORE_EXT_XDS_XDS_CHANNEL_ARGS_H
|
22
19
|
|
23
20
|
// Pointer channel arg containing a ref to the XdsClient object.
|
24
21
|
#define GRPC_ARG_XDS_CLIENT "grpc.xds_client"
|
25
22
|
|
26
|
-
|
23
|
+
// Timeout in milliseconds to wait for a resource to be returned from
|
24
|
+
// the xds server before assuming that it does not exist.
|
25
|
+
// The default is 15 seconds.
|
26
|
+
#define GRPC_ARG_XDS_RESOURCE_DOES_NOT_EXIST_TIMEOUT_MS \
|
27
|
+
"grpc.xds_resource_does_not_exist_timeout_ms"
|
28
|
+
|
29
|
+
#endif /* GRPC_CORE_EXT_XDS_XDS_CHANNEL_ARGS_H */
|
@@ -33,19 +33,15 @@
|
|
33
33
|
#include <grpc/support/time.h>
|
34
34
|
|
35
35
|
#include "src/core/ext/filters/client_channel/client_channel.h"
|
36
|
-
#include "src/core/ext/filters/client_channel/parse_address.h"
|
37
|
-
#include "src/core/ext/filters/client_channel/server_address.h"
|
38
36
|
#include "src/core/ext/filters/client_channel/service_config.h"
|
39
|
-
#include "src/core/ext/
|
40
|
-
#include "src/core/ext/
|
41
|
-
#include "src/core/ext/
|
42
|
-
#include "src/core/ext/
|
43
|
-
#include "src/core/ext/filters/client_channel/xds/xds_client_stats.h"
|
37
|
+
#include "src/core/ext/xds/xds_api.h"
|
38
|
+
#include "src/core/ext/xds/xds_channel_args.h"
|
39
|
+
#include "src/core/ext/xds/xds_client.h"
|
40
|
+
#include "src/core/ext/xds/xds_client_stats.h"
|
44
41
|
#include "src/core/lib/backoff/backoff.h"
|
45
42
|
#include "src/core/lib/channel/channel_args.h"
|
46
43
|
#include "src/core/lib/channel/channel_stack.h"
|
47
44
|
#include "src/core/lib/gpr/string.h"
|
48
|
-
#include "src/core/lib/gprpp/map.h"
|
49
45
|
#include "src/core/lib/gprpp/memory.h"
|
50
46
|
#include "src/core/lib/gprpp/orphanable.h"
|
51
47
|
#include "src/core/lib/gprpp/ref_counted_ptr.h"
|
@@ -53,8 +49,6 @@
|
|
53
49
|
#include "src/core/lib/iomgr/sockaddr.h"
|
54
50
|
#include "src/core/lib/iomgr/sockaddr_utils.h"
|
55
51
|
#include "src/core/lib/iomgr/timer.h"
|
56
|
-
#include "src/core/lib/iomgr/work_serializer.h"
|
57
|
-
#include "src/core/lib/slice/slice_hash_table.h"
|
58
52
|
#include "src/core/lib/slice/slice_internal.h"
|
59
53
|
#include "src/core/lib/slice/slice_string_helpers.h"
|
60
54
|
#include "src/core/lib/surface/call.h"
|
@@ -71,6 +65,15 @@
|
|
71
65
|
namespace grpc_core {
|
72
66
|
|
73
67
|
TraceFlag grpc_xds_client_trace(false, "xds_client");
|
68
|
+
TraceFlag grpc_xds_client_refcount_trace(false, "xds_client_refcount");
|
69
|
+
|
70
|
+
namespace {
|
71
|
+
|
72
|
+
Mutex* g_mu = nullptr;
|
73
|
+
const grpc_channel_args* g_channel_args = nullptr;
|
74
|
+
XdsClient* g_xds_client = nullptr;
|
75
|
+
|
76
|
+
} // namespace
|
74
77
|
|
75
78
|
//
|
76
79
|
// Internal class declarations
|
@@ -138,22 +141,25 @@ class XdsClient::ChannelState::AdsCallState
|
|
138
141
|
private:
|
139
142
|
class ResourceState : public InternallyRefCounted<ResourceState> {
|
140
143
|
public:
|
141
|
-
ResourceState(const std::string& type_url, const std::string& name
|
142
|
-
|
144
|
+
ResourceState(const std::string& type_url, const std::string& name,
|
145
|
+
bool sent_initial_request)
|
146
|
+
: type_url_(type_url),
|
147
|
+
name_(name),
|
148
|
+
sent_initial_request_(sent_initial_request) {
|
143
149
|
GRPC_CLOSURE_INIT(&timer_callback_, OnTimer, this,
|
144
150
|
grpc_schedule_on_exec_ctx);
|
145
151
|
}
|
146
152
|
|
147
153
|
void Orphan() override {
|
148
154
|
Finish();
|
149
|
-
Unref();
|
155
|
+
Unref(DEBUG_LOCATION, "Orphan");
|
150
156
|
}
|
151
157
|
|
152
158
|
void Start(RefCountedPtr<AdsCallState> ads_calld) {
|
153
|
-
if (
|
154
|
-
|
159
|
+
if (sent_initial_request_) return;
|
160
|
+
sent_initial_request_ = true;
|
155
161
|
ads_calld_ = std::move(ads_calld);
|
156
|
-
Ref().release();
|
162
|
+
Ref(DEBUG_LOCATION, "timer").release();
|
157
163
|
timer_pending_ = true;
|
158
164
|
grpc_timer_init(
|
159
165
|
&timer_,
|
@@ -171,9 +177,12 @@ class XdsClient::ChannelState::AdsCallState
|
|
171
177
|
private:
|
172
178
|
static void OnTimer(void* arg, grpc_error* error) {
|
173
179
|
ResourceState* self = static_cast<ResourceState*>(arg);
|
174
|
-
|
175
|
-
|
176
|
-
|
180
|
+
{
|
181
|
+
MutexLock lock(&self->ads_calld_->xds_client()->mu_);
|
182
|
+
self->OnTimerLocked(GRPC_ERROR_REF(error));
|
183
|
+
}
|
184
|
+
self->ads_calld_.reset();
|
185
|
+
self->Unref(DEBUG_LOCATION, "timer");
|
177
186
|
}
|
178
187
|
|
179
188
|
void OnTimerLocked(grpc_error* error) {
|
@@ -188,28 +197,32 @@ class XdsClient::ChannelState::AdsCallState
|
|
188
197
|
gpr_log(GPR_INFO, "[xds_client %p] %s", ads_calld_->xds_client(),
|
189
198
|
grpc_error_string(watcher_error));
|
190
199
|
}
|
191
|
-
if (type_url_ == XdsApi::kLdsTypeUrl
|
192
|
-
|
193
|
-
|
194
|
-
|
200
|
+
if (type_url_ == XdsApi::kLdsTypeUrl) {
|
201
|
+
ListenerState& state = ads_calld_->xds_client()->listener_map_[name_];
|
202
|
+
for (const auto& p : state.watchers) {
|
203
|
+
p.first->OnError(GRPC_ERROR_REF(watcher_error));
|
204
|
+
}
|
205
|
+
} else if (type_url_ == XdsApi::kRdsTypeUrl) {
|
206
|
+
RouteConfigState& state =
|
207
|
+
ads_calld_->xds_client()->route_config_map_[name_];
|
208
|
+
for (const auto& p : state.watchers) {
|
209
|
+
p.first->OnError(GRPC_ERROR_REF(watcher_error));
|
210
|
+
}
|
195
211
|
} else if (type_url_ == XdsApi::kCdsTypeUrl) {
|
196
212
|
ClusterState& state = ads_calld_->xds_client()->cluster_map_[name_];
|
197
213
|
for (const auto& p : state.watchers) {
|
198
214
|
p.first->OnError(GRPC_ERROR_REF(watcher_error));
|
199
215
|
}
|
200
|
-
GRPC_ERROR_UNREF(watcher_error);
|
201
216
|
} else if (type_url_ == XdsApi::kEdsTypeUrl) {
|
202
217
|
EndpointState& state = ads_calld_->xds_client()->endpoint_map_[name_];
|
203
218
|
for (const auto& p : state.watchers) {
|
204
219
|
p.first->OnError(GRPC_ERROR_REF(watcher_error));
|
205
220
|
}
|
206
|
-
GRPC_ERROR_UNREF(watcher_error);
|
207
221
|
} else {
|
208
222
|
GPR_UNREACHABLE_CODE(return );
|
209
223
|
}
|
224
|
+
GRPC_ERROR_UNREF(watcher_error);
|
210
225
|
}
|
211
|
-
ads_calld_.reset();
|
212
|
-
Unref();
|
213
226
|
GRPC_ERROR_UNREF(error);
|
214
227
|
}
|
215
228
|
|
@@ -217,7 +230,7 @@ class XdsClient::ChannelState::AdsCallState
|
|
217
230
|
const std::string name_;
|
218
231
|
|
219
232
|
RefCountedPtr<AdsCallState> ads_calld_;
|
220
|
-
bool
|
233
|
+
bool sent_initial_request_;
|
221
234
|
bool timer_pending_ = false;
|
222
235
|
grpc_timer timer_;
|
223
236
|
grpc_closure timer_callback_;
|
@@ -226,8 +239,7 @@ class XdsClient::ChannelState::AdsCallState
|
|
226
239
|
struct ResourceTypeState {
|
227
240
|
~ResourceTypeState() { GRPC_ERROR_UNREF(error); }
|
228
241
|
|
229
|
-
//
|
230
|
-
std::string version;
|
242
|
+
// Nonce and error for this resource type.
|
231
243
|
std::string nonce;
|
232
244
|
grpc_error* error = GRPC_ERROR_NONE;
|
233
245
|
|
@@ -238,15 +250,15 @@ class XdsClient::ChannelState::AdsCallState
|
|
238
250
|
|
239
251
|
void SendMessageLocked(const std::string& type_url);
|
240
252
|
|
241
|
-
void AcceptLdsUpdate(
|
242
|
-
void AcceptRdsUpdate(
|
253
|
+
void AcceptLdsUpdate(XdsApi::LdsUpdateMap lds_update_map);
|
254
|
+
void AcceptRdsUpdate(XdsApi::RdsUpdateMap rds_update_map);
|
243
255
|
void AcceptCdsUpdate(XdsApi::CdsUpdateMap cds_update_map);
|
244
256
|
void AcceptEdsUpdate(XdsApi::EdsUpdateMap eds_update_map);
|
245
257
|
|
246
258
|
static void OnRequestSent(void* arg, grpc_error* error);
|
247
259
|
void OnRequestSentLocked(grpc_error* error);
|
248
260
|
static void OnResponseReceived(void* arg, grpc_error* error);
|
249
|
-
|
261
|
+
bool OnResponseReceivedLocked();
|
250
262
|
static void OnStatusReceived(void* arg, grpc_error* error);
|
251
263
|
void OnStatusReceivedLocked(grpc_error* error);
|
252
264
|
|
@@ -323,10 +335,10 @@ class XdsClient::ChannelState::LrsCallState
|
|
323
335
|
private:
|
324
336
|
void ScheduleNextReportLocked();
|
325
337
|
static void OnNextReportTimer(void* arg, grpc_error* error);
|
326
|
-
|
327
|
-
|
338
|
+
bool OnNextReportTimerLocked(grpc_error* error);
|
339
|
+
bool SendReportLocked();
|
328
340
|
static void OnReportDone(void* arg, grpc_error* error);
|
329
|
-
|
341
|
+
bool OnReportDoneLocked(grpc_error* error);
|
330
342
|
|
331
343
|
bool IsCurrentReporterOnCall() const {
|
332
344
|
return this == parent_->reporter_.get();
|
@@ -348,7 +360,7 @@ class XdsClient::ChannelState::LrsCallState
|
|
348
360
|
static void OnInitialRequestSent(void* arg, grpc_error* error);
|
349
361
|
void OnInitialRequestSentLocked();
|
350
362
|
static void OnResponseReceived(void* arg, grpc_error* error);
|
351
|
-
|
363
|
+
bool OnResponseReceivedLocked();
|
352
364
|
static void OnStatusReceived(void* arg, grpc_error* error);
|
353
365
|
void OnStatusReceivedLocked(grpc_error* error);
|
354
366
|
|
@@ -393,20 +405,22 @@ class XdsClient::ChannelState::StateWatcher
|
|
393
405
|
: public AsyncConnectivityStateWatcherInterface {
|
394
406
|
public:
|
395
407
|
explicit StateWatcher(RefCountedPtr<ChannelState> parent)
|
396
|
-
:
|
397
|
-
parent->xds_client()->work_serializer_),
|
398
|
-
parent_(std::move(parent)) {}
|
408
|
+
: parent_(std::move(parent)) {}
|
399
409
|
|
400
410
|
private:
|
401
|
-
void OnConnectivityStateChange(grpc_connectivity_state new_state
|
411
|
+
void OnConnectivityStateChange(grpc_connectivity_state new_state,
|
412
|
+
const absl::Status& status) override {
|
413
|
+
MutexLock lock(&parent_->xds_client_->mu_);
|
402
414
|
if (!parent_->shutting_down_ &&
|
403
415
|
new_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
|
404
416
|
// In TRANSIENT_FAILURE. Notify all watchers of error.
|
405
417
|
gpr_log(GPR_INFO,
|
406
|
-
"[xds_client %p] xds channel in state
|
407
|
-
|
408
|
-
|
409
|
-
|
418
|
+
"[xds_client %p] xds channel in state:TRANSIENT_FAILURE "
|
419
|
+
"status_message:(%s)",
|
420
|
+
parent_->xds_client(), status.ToString().c_str());
|
421
|
+
parent_->xds_client()->NotifyOnErrorLocked(
|
422
|
+
GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
423
|
+
"xds channel in TRANSIENT_FAILURE"));
|
410
424
|
}
|
411
425
|
}
|
412
426
|
|
@@ -419,69 +433,43 @@ class XdsClient::ChannelState::StateWatcher
|
|
419
433
|
|
420
434
|
namespace {
|
421
435
|
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
GRPC_ARG_SERVICE_CONFIG,
|
431
|
-
// The channel arg for the server URI, since that will be different for
|
432
|
-
// the xds channel than for the parent channel. The client channel
|
433
|
-
// factory will re-add this arg with the right value.
|
434
|
-
GRPC_ARG_SERVER_URI,
|
435
|
-
// The xds channel should use the authority indicated by the target
|
436
|
-
// authority table (see \a ModifyXdsChannelArgs),
|
437
|
-
// as opposed to the authority from the parent channel.
|
438
|
-
GRPC_ARG_DEFAULT_AUTHORITY,
|
439
|
-
// Just as for \a GRPC_ARG_DEFAULT_AUTHORITY, the xds channel should be
|
440
|
-
// treated as a stand-alone channel and not inherit this argument from the
|
441
|
-
// args of the parent channel.
|
442
|
-
GRPC_SSL_TARGET_NAME_OVERRIDE_ARG,
|
443
|
-
// Don't want to pass down channelz node from parent; the balancer
|
444
|
-
// channel will get its own.
|
445
|
-
GRPC_ARG_CHANNELZ_CHANNEL_NODE,
|
446
|
-
// Keepalive interval. We are explicitly setting our own value below.
|
447
|
-
GRPC_ARG_KEEPALIVE_TIME_MS,
|
436
|
+
grpc_channel* CreateXdsChannel(const XdsBootstrap::XdsServer& server) {
|
437
|
+
// Build channel args.
|
438
|
+
absl::InlinedVector<grpc_arg, 2> args_to_add = {
|
439
|
+
grpc_channel_arg_integer_create(
|
440
|
+
const_cast<char*>(GRPC_ARG_KEEPALIVE_TIME_MS),
|
441
|
+
5 * 60 * GPR_MS_PER_SEC),
|
442
|
+
grpc_channel_arg_integer_create(
|
443
|
+
const_cast<char*>(GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL), 1),
|
448
444
|
};
|
449
|
-
|
450
|
-
|
451
|
-
//
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
//
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
// The parent channel's channelz uuid.
|
461
|
-
channelz::ChannelNode* channelz_node = nullptr;
|
462
|
-
const grpc_arg* arg =
|
463
|
-
grpc_channel_args_find(&args, GRPC_ARG_CHANNELZ_CHANNEL_NODE);
|
464
|
-
if (arg != nullptr && arg->type == GRPC_ARG_POINTER &&
|
465
|
-
arg->value.pointer.p != nullptr) {
|
466
|
-
channelz_node = static_cast<channelz::ChannelNode*>(arg->value.pointer.p);
|
467
|
-
args_to_add.emplace_back(
|
468
|
-
channelz::MakeParentUuidArg(channelz_node->uuid()));
|
469
|
-
}
|
470
|
-
// Construct channel args.
|
471
|
-
grpc_channel_args* new_args = grpc_channel_args_copy_and_add_and_remove(
|
472
|
-
&args, args_to_remove, GPR_ARRAY_SIZE(args_to_remove), args_to_add.data(),
|
473
|
-
args_to_add.size());
|
474
|
-
// Make any necessary modifications for security.
|
475
|
-
return ModifyXdsChannelArgs(new_args);
|
445
|
+
grpc_channel_args* new_args = grpc_channel_args_copy_and_add(
|
446
|
+
g_channel_args, args_to_add.data(), args_to_add.size());
|
447
|
+
// Create channel creds.
|
448
|
+
RefCountedPtr<grpc_channel_credentials> channel_creds =
|
449
|
+
XdsChannelCredsRegistry::MakeChannelCreds(server.channel_creds_type,
|
450
|
+
server.channel_creds_config);
|
451
|
+
// Create channel.
|
452
|
+
grpc_channel* channel = grpc_secure_channel_create(
|
453
|
+
channel_creds.get(), server.server_uri.c_str(), new_args, nullptr);
|
454
|
+
grpc_channel_args_destroy(new_args);
|
455
|
+
return channel;
|
476
456
|
}
|
477
457
|
|
478
458
|
} // namespace
|
479
459
|
|
480
|
-
XdsClient::ChannelState::ChannelState(
|
481
|
-
|
482
|
-
: InternallyRefCounted<ChannelState>(
|
460
|
+
XdsClient::ChannelState::ChannelState(WeakRefCountedPtr<XdsClient> xds_client,
|
461
|
+
const XdsBootstrap::XdsServer& server)
|
462
|
+
: InternallyRefCounted<ChannelState>(
|
463
|
+
GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace)
|
464
|
+
? "ChannelState"
|
465
|
+
: nullptr),
|
483
466
|
xds_client_(std::move(xds_client)),
|
484
|
-
|
467
|
+
server_(server) {
|
468
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
469
|
+
gpr_log(GPR_INFO, "[xds_client %p] creating channel to %s",
|
470
|
+
xds_client_.get(), server.server_uri.c_str());
|
471
|
+
}
|
472
|
+
channel_ = CreateXdsChannel(server);
|
485
473
|
GPR_ASSERT(channel_ != nullptr);
|
486
474
|
StartConnectivityWatchLocked();
|
487
475
|
}
|
@@ -492,6 +480,7 @@ XdsClient::ChannelState::~ChannelState() {
|
|
492
480
|
this);
|
493
481
|
}
|
494
482
|
grpc_channel_destroy(channel_);
|
483
|
+
xds_client_.reset(DEBUG_LOCATION, "ChannelState");
|
495
484
|
}
|
496
485
|
|
497
486
|
void XdsClient::ChannelState::Orphan() {
|
@@ -528,7 +517,7 @@ void XdsClient::ChannelState::StartConnectivityWatchLocked() {
|
|
528
517
|
grpc_channel_element* client_channel_elem =
|
529
518
|
grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel_));
|
530
519
|
GPR_ASSERT(client_channel_elem->filter == &grpc_client_channel_filter);
|
531
|
-
watcher_ = new StateWatcher(Ref());
|
520
|
+
watcher_ = new StateWatcher(Ref(DEBUG_LOCATION, "ChannelState+watch"));
|
532
521
|
grpc_client_channel_start_connectivity_watch(
|
533
522
|
client_channel_elem, GRPC_CHANNEL_IDLE,
|
534
523
|
OrphanablePtr<AsyncConnectivityStateWatcherInterface>(watcher_));
|
@@ -563,8 +552,11 @@ void XdsClient::ChannelState::Unsubscribe(const std::string& type_url,
|
|
563
552
|
const std::string& name,
|
564
553
|
bool delay_unsubscription) {
|
565
554
|
if (ads_calld_ != nullptr) {
|
566
|
-
ads_calld_->calld()
|
567
|
-
if (
|
555
|
+
auto* calld = ads_calld_->calld();
|
556
|
+
if (calld != nullptr) {
|
557
|
+
calld->Unsubscribe(type_url, name, delay_unsubscription);
|
558
|
+
if (!calld->HasSubscribedResources()) ads_calld_.reset();
|
559
|
+
}
|
568
560
|
}
|
569
561
|
}
|
570
562
|
|
@@ -647,9 +639,11 @@ template <typename T>
|
|
647
639
|
void XdsClient::ChannelState::RetryableCall<T>::OnRetryTimer(
|
648
640
|
void* arg, grpc_error* error) {
|
649
641
|
RetryableCall* calld = static_cast<RetryableCall*>(arg);
|
650
|
-
|
651
|
-
|
652
|
-
|
642
|
+
{
|
643
|
+
MutexLock lock(&calld->chand_->xds_client()->mu_);
|
644
|
+
calld->OnRetryTimerLocked(GRPC_ERROR_REF(error));
|
645
|
+
}
|
646
|
+
calld->Unref(DEBUG_LOCATION, "RetryableCall+retry_timer_done");
|
653
647
|
}
|
654
648
|
|
655
649
|
template <typename T>
|
@@ -665,7 +659,6 @@ void XdsClient::ChannelState::RetryableCall<T>::OnRetryTimerLocked(
|
|
665
659
|
}
|
666
660
|
StartNewCallLocked();
|
667
661
|
}
|
668
|
-
this->Unref(DEBUG_LOCATION, "RetryableCall+retry_timer_done");
|
669
662
|
GRPC_ERROR_UNREF(error);
|
670
663
|
}
|
671
664
|
|
@@ -675,19 +668,24 @@ void XdsClient::ChannelState::RetryableCall<T>::OnRetryTimerLocked(
|
|
675
668
|
|
676
669
|
XdsClient::ChannelState::AdsCallState::AdsCallState(
|
677
670
|
RefCountedPtr<RetryableCall<AdsCallState>> parent)
|
678
|
-
: InternallyRefCounted<AdsCallState>(
|
671
|
+
: InternallyRefCounted<AdsCallState>(
|
672
|
+
GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace)
|
673
|
+
? "AdsCallState"
|
674
|
+
: nullptr),
|
679
675
|
parent_(std::move(parent)) {
|
680
676
|
// Init the ADS call. Note that the call will progress every time there's
|
681
677
|
// activity in xds_client()->interested_parties_, which is comprised of
|
682
678
|
// the polling entities from client_channel.
|
683
679
|
GPR_ASSERT(xds_client() != nullptr);
|
684
|
-
GPR_ASSERT(!xds_client()->server_name_.empty());
|
685
680
|
// Create a call with the specified method name.
|
681
|
+
const auto& method =
|
682
|
+
chand()->server_.ShouldUseV3()
|
683
|
+
? GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_DISCOVERY_DOT_V3_DOT_AGGREGATEDDISCOVERYSERVICE_SLASH_STREAMAGGREGATEDRESOURCES
|
684
|
+
: GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_DISCOVERY_DOT_V2_DOT_AGGREGATEDDISCOVERYSERVICE_SLASH_STREAMAGGREGATEDRESOURCES;
|
686
685
|
call_ = grpc_channel_create_pollset_set_call(
|
687
686
|
chand()->channel_, nullptr, GRPC_PROPAGATE_DEFAULTS,
|
688
|
-
xds_client()->interested_parties_,
|
689
|
-
|
690
|
-
nullptr, GRPC_MILLIS_INF_FUTURE, nullptr);
|
687
|
+
xds_client()->interested_parties_, method, nullptr,
|
688
|
+
GRPC_MILLIS_INF_FUTURE, nullptr);
|
691
689
|
GPR_ASSERT(call_ != nullptr);
|
692
690
|
// Init data associated with the call.
|
693
691
|
grpc_metadata_array_init(&initial_metadata_recv_);
|
@@ -711,19 +709,17 @@ XdsClient::ChannelState::AdsCallState::AdsCallState(
|
|
711
709
|
GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET;
|
712
710
|
op->reserved = nullptr;
|
713
711
|
op++;
|
714
|
-
call_error = grpc_call_start_batch_and_execute(
|
715
|
-
|
712
|
+
call_error = grpc_call_start_batch_and_execute(
|
713
|
+
call_, ops, static_cast<size_t>(op - ops), nullptr);
|
716
714
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
717
715
|
// Op: send request message.
|
718
716
|
GRPC_CLOSURE_INIT(&on_request_sent_, OnRequestSent, this,
|
719
717
|
grpc_schedule_on_exec_ctx);
|
720
|
-
|
721
|
-
Subscribe(XdsApi::kLdsTypeUrl,
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
xds_client()->lds_result_->route_config_name);
|
726
|
-
}
|
718
|
+
for (const auto& p : xds_client()->listener_map_) {
|
719
|
+
Subscribe(XdsApi::kLdsTypeUrl, std::string(p.first));
|
720
|
+
}
|
721
|
+
for (const auto& p : xds_client()->route_config_map_) {
|
722
|
+
Subscribe(XdsApi::kRdsTypeUrl, std::string(p.first));
|
727
723
|
}
|
728
724
|
for (const auto& p : xds_client()->cluster_map_) {
|
729
725
|
Subscribe(XdsApi::kCdsTypeUrl, std::string(p.first));
|
@@ -748,8 +744,8 @@ XdsClient::ChannelState::AdsCallState::AdsCallState(
|
|
748
744
|
Ref(DEBUG_LOCATION, "ADS+OnResponseReceivedLocked").release();
|
749
745
|
GRPC_CLOSURE_INIT(&on_response_received_, OnResponseReceived, this,
|
750
746
|
grpc_schedule_on_exec_ctx);
|
751
|
-
call_error = grpc_call_start_batch_and_execute(
|
752
|
-
|
747
|
+
call_error = grpc_call_start_batch_and_execute(
|
748
|
+
call_, ops, static_cast<size_t>(op - ops), &on_response_received_);
|
753
749
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
754
750
|
// Op: recv server status.
|
755
751
|
op = ops;
|
@@ -765,8 +761,8 @@ XdsClient::ChannelState::AdsCallState::AdsCallState(
|
|
765
761
|
// unreffed.
|
766
762
|
GRPC_CLOSURE_INIT(&on_status_received_, OnStatusReceived, this,
|
767
763
|
grpc_schedule_on_exec_ctx);
|
768
|
-
call_error = grpc_call_start_batch_and_execute(
|
769
|
-
|
764
|
+
call_error = grpc_call_start_batch_and_execute(
|
765
|
+
call_, ops, static_cast<size_t>(op - ops), &on_status_received_);
|
770
766
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
771
767
|
}
|
772
768
|
|
@@ -786,7 +782,7 @@ void XdsClient::ChannelState::AdsCallState::Orphan() {
|
|
786
782
|
// on_status_received_ will complete the cancellation and clean up. Otherwise,
|
787
783
|
// we are here because xds_client has to orphan a failed call, then the
|
788
784
|
// following cancellation will be a no-op.
|
789
|
-
|
785
|
+
grpc_call_cancel_internal(call_);
|
790
786
|
state_map_.clear();
|
791
787
|
// Note that the initial ref is hold by on_status_received_. So the
|
792
788
|
// corresponding unref happens in on_status_received_ instead of here.
|
@@ -804,7 +800,8 @@ void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
|
|
804
800
|
std::set<absl::string_view> resource_names =
|
805
801
|
ResourceNamesForRequest(type_url);
|
806
802
|
request_payload_slice = xds_client()->api_.CreateAdsRequest(
|
807
|
-
type_url, resource_names,
|
803
|
+
chand()->server_, type_url, resource_names,
|
804
|
+
xds_client()->resource_version_map_[type_url], state.nonce,
|
808
805
|
GRPC_ERROR_REF(state.error), !sent_initial_message_);
|
809
806
|
if (type_url != XdsApi::kLdsTypeUrl && type_url != XdsApi::kRdsTypeUrl &&
|
810
807
|
type_url != XdsApi::kCdsTypeUrl && type_url != XdsApi::kEdsTypeUrl) {
|
@@ -815,7 +812,8 @@ void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
|
|
815
812
|
gpr_log(GPR_INFO,
|
816
813
|
"[xds_client %p] sending ADS request: type=%s version=%s nonce=%s "
|
817
814
|
"error=%s resources=%s",
|
818
|
-
xds_client(), type_url.c_str(),
|
815
|
+
xds_client(), type_url.c_str(),
|
816
|
+
xds_client()->resource_version_map_[type_url].c_str(),
|
819
817
|
state.nonce.c_str(), grpc_error_string(state.error),
|
820
818
|
absl::StrJoin(resource_names, " ").c_str());
|
821
819
|
}
|
@@ -847,7 +845,8 @@ void XdsClient::ChannelState::AdsCallState::Subscribe(
|
|
847
845
|
const std::string& type_url, const std::string& name) {
|
848
846
|
auto& state = state_map_[type_url].subscribed_resources[name];
|
849
847
|
if (state == nullptr) {
|
850
|
-
state = MakeOrphanable<ResourceState>(
|
848
|
+
state = MakeOrphanable<ResourceState>(
|
849
|
+
type_url, name, !xds_client()->resource_version_map_[type_url].empty());
|
851
850
|
SendMessageLocked(type_url);
|
852
851
|
}
|
853
852
|
}
|
@@ -867,127 +866,139 @@ bool XdsClient::ChannelState::AdsCallState::HasSubscribedResources() const {
|
|
867
866
|
}
|
868
867
|
|
869
868
|
void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdate(
|
870
|
-
|
871
|
-
if (!lds_update.has_value()) {
|
872
|
-
gpr_log(GPR_INFO,
|
873
|
-
"[xds_client %p] LDS update does not include requested resource",
|
874
|
-
xds_client());
|
875
|
-
if (xds_client()->lds_result_.has_value() &&
|
876
|
-
!xds_client()->lds_result_->route_config_name.empty()) {
|
877
|
-
Unsubscribe(XdsApi::kRdsTypeUrl,
|
878
|
-
xds_client()->lds_result_->route_config_name,
|
879
|
-
/*delay_unsubscription=*/false);
|
880
|
-
xds_client()->rds_result_.reset();
|
881
|
-
}
|
882
|
-
xds_client()->lds_result_.reset();
|
883
|
-
xds_client()->service_config_watcher_->OnResourceDoesNotExist();
|
884
|
-
return;
|
885
|
-
}
|
869
|
+
XdsApi::LdsUpdateMap lds_update_map) {
|
886
870
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
887
871
|
gpr_log(GPR_INFO,
|
888
|
-
"[xds_client %p] LDS update received
|
889
|
-
|
890
|
-
(
|
891
|
-
? lds_update->route_config_name.c_str()
|
892
|
-
: "<inlined>"));
|
893
|
-
if (lds_update->rds_update.has_value()) {
|
894
|
-
gpr_log(GPR_INFO, "RouteConfiguration contains %" PRIuPTR " routes",
|
895
|
-
lds_update->rds_update.value().routes.size());
|
896
|
-
for (size_t i = 0; i < lds_update->rds_update.value().routes.size();
|
897
|
-
++i) {
|
898
|
-
gpr_log(GPR_INFO, "Route %" PRIuPTR ":\n%s", i,
|
899
|
-
lds_update->rds_update.value().routes[i].ToString().c_str());
|
900
|
-
}
|
901
|
-
}
|
872
|
+
"[xds_client %p] LDS update received containing %" PRIuPTR
|
873
|
+
" resources",
|
874
|
+
xds_client(), lds_update_map.size());
|
902
875
|
}
|
903
876
|
auto& lds_state = state_map_[XdsApi::kLdsTypeUrl];
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
877
|
+
std::set<std::string> rds_resource_names_seen;
|
878
|
+
for (auto& p : lds_update_map) {
|
879
|
+
const std::string& listener_name = p.first;
|
880
|
+
XdsApi::LdsUpdate& lds_update = p.second;
|
881
|
+
auto& state = lds_state.subscribed_resources[listener_name];
|
882
|
+
if (state != nullptr) state->Finish();
|
908
883
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
909
|
-
gpr_log(GPR_INFO,
|
910
|
-
|
911
|
-
|
884
|
+
gpr_log(GPR_INFO, "[xds_client %p] LDS resource %s: route_config_name=%s",
|
885
|
+
xds_client(), listener_name.c_str(),
|
886
|
+
(!lds_update.route_config_name.empty()
|
887
|
+
? lds_update.route_config_name.c_str()
|
888
|
+
: "<inlined>"));
|
889
|
+
if (lds_update.rds_update.has_value()) {
|
890
|
+
gpr_log(GPR_INFO, "RouteConfiguration: %s",
|
891
|
+
lds_update.rds_update->ToString().c_str());
|
892
|
+
}
|
893
|
+
}
|
894
|
+
// Record the RDS resource names seen.
|
895
|
+
if (!lds_update.route_config_name.empty()) {
|
896
|
+
rds_resource_names_seen.insert(lds_update.route_config_name);
|
897
|
+
}
|
898
|
+
// Ignore identical update.
|
899
|
+
ListenerState& listener_state = xds_client()->listener_map_[listener_name];
|
900
|
+
if (listener_state.update.has_value() &&
|
901
|
+
*listener_state.update == lds_update) {
|
902
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
903
|
+
gpr_log(GPR_INFO,
|
904
|
+
"[xds_client %p] LDS update for %s identical to current, "
|
905
|
+
"ignoring.",
|
906
|
+
xds_client(), listener_name.c_str());
|
907
|
+
}
|
908
|
+
continue;
|
909
|
+
}
|
910
|
+
// Update the listener state.
|
911
|
+
listener_state.update = std::move(lds_update);
|
912
|
+
// Notify watchers.
|
913
|
+
for (const auto& p : listener_state.watchers) {
|
914
|
+
p.first->OnListenerChanged(*listener_state.update);
|
912
915
|
}
|
913
|
-
return;
|
914
916
|
}
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
917
|
+
// For any subscribed resource that is not present in the update,
|
918
|
+
// remove it from the cache and notify watchers that it does not exist.
|
919
|
+
for (const auto& p : lds_state.subscribed_resources) {
|
920
|
+
const std::string& listener_name = p.first;
|
921
|
+
if (lds_update_map.find(listener_name) == lds_update_map.end()) {
|
922
|
+
ListenerState& listener_state =
|
923
|
+
xds_client()->listener_map_[listener_name];
|
924
|
+
// If the resource was newly requested but has not yet been received,
|
925
|
+
// we don't want to generate an error for the watchers, because this LDS
|
926
|
+
// response may be in reaction to an earlier request that did not yet
|
927
|
+
// request the new resource, so its absence from the response does not
|
928
|
+
// necessarily indicate that the resource does not exist.
|
929
|
+
// For that case, we rely on the request timeout instead.
|
930
|
+
if (!listener_state.update.has_value()) continue;
|
931
|
+
listener_state.update.reset();
|
932
|
+
for (const auto& p : listener_state.watchers) {
|
933
|
+
p.first->OnResourceDoesNotExist();
|
934
|
+
}
|
935
|
+
}
|
936
|
+
}
|
937
|
+
// For any RDS resource that is no longer referred to by any LDS
|
938
|
+
// resources, remove it from the cache and notify watchers that it
|
939
|
+
// does not exist.
|
940
|
+
auto& rds_state = state_map_[XdsApi::kRdsTypeUrl];
|
941
|
+
for (const auto& p : rds_state.subscribed_resources) {
|
942
|
+
const std::string& rds_resource_name = p.first;
|
943
|
+
if (rds_resource_names_seen.find(rds_resource_name) ==
|
944
|
+
rds_resource_names_seen.end()) {
|
945
|
+
RouteConfigState& route_config_state =
|
946
|
+
xds_client()->route_config_map_[rds_resource_name];
|
947
|
+
route_config_state.update.reset();
|
948
|
+
for (const auto& p : route_config_state.watchers) {
|
949
|
+
p.first->OnResourceDoesNotExist();
|
950
|
+
}
|
934
951
|
}
|
935
|
-
} else {
|
936
|
-
// Send RDS request for dynamic resolution.
|
937
|
-
Subscribe(XdsApi::kRdsTypeUrl,
|
938
|
-
xds_client()->lds_result_->route_config_name);
|
939
952
|
}
|
940
953
|
}
|
941
954
|
|
942
955
|
void XdsClient::ChannelState::AdsCallState::AcceptRdsUpdate(
|
943
|
-
|
944
|
-
if (!rds_update.has_value()) {
|
945
|
-
gpr_log(GPR_INFO,
|
946
|
-
"[xds_client %p] RDS update does not include requested resource",
|
947
|
-
xds_client());
|
948
|
-
xds_client()->rds_result_.reset();
|
949
|
-
xds_client()->service_config_watcher_->OnResourceDoesNotExist();
|
950
|
-
return;
|
951
|
-
}
|
956
|
+
XdsApi::RdsUpdateMap rds_update_map) {
|
952
957
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
953
958
|
gpr_log(GPR_INFO,
|
954
|
-
"[xds_client %p] RDS update received
|
955
|
-
"
|
956
|
-
|
957
|
-
for (size_t i = 0; i < rds_update.value().routes.size(); ++i) {
|
958
|
-
gpr_log(GPR_INFO, "Route %" PRIuPTR ":\n%s", i,
|
959
|
-
rds_update.value().routes[i].ToString().c_str());
|
960
|
-
}
|
959
|
+
"[xds_client %p] RDS update received containing %" PRIuPTR
|
960
|
+
" resources",
|
961
|
+
xds_client(), rds_update_map.size());
|
961
962
|
}
|
962
963
|
auto& rds_state = state_map_[XdsApi::kRdsTypeUrl];
|
963
|
-
auto&
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
if (xds_client()->rds_result_ == rds_update) {
|
964
|
+
for (auto& p : rds_update_map) {
|
965
|
+
const std::string& route_config_name = p.first;
|
966
|
+
XdsApi::RdsUpdate& rds_update = p.second;
|
967
|
+
auto& state = rds_state.subscribed_resources[route_config_name];
|
968
|
+
if (state != nullptr) state->Finish();
|
969
969
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
970
|
-
gpr_log(GPR_INFO,
|
971
|
-
|
972
|
-
|
970
|
+
gpr_log(GPR_INFO, "[xds_client %p] RDS resource:\n%s", xds_client(),
|
971
|
+
rds_update.ToString().c_str());
|
972
|
+
}
|
973
|
+
RouteConfigState& route_config_state =
|
974
|
+
xds_client()->route_config_map_[route_config_name];
|
975
|
+
// Ignore identical update.
|
976
|
+
if (route_config_state.update.has_value() &&
|
977
|
+
*route_config_state.update == rds_update) {
|
978
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
979
|
+
gpr_log(GPR_INFO,
|
980
|
+
"[xds_client %p] RDS resource identical to current, ignoring",
|
981
|
+
xds_client());
|
982
|
+
}
|
983
|
+
continue;
|
984
|
+
}
|
985
|
+
// Update the cache.
|
986
|
+
route_config_state.update = std::move(rds_update);
|
987
|
+
// Notify all watchers.
|
988
|
+
for (const auto& p : route_config_state.watchers) {
|
989
|
+
p.first->OnRouteConfigChanged(*route_config_state.update);
|
973
990
|
}
|
974
|
-
return;
|
975
|
-
}
|
976
|
-
xds_client()->rds_result_ = std::move(rds_update);
|
977
|
-
// Notify the watcher.
|
978
|
-
RefCountedPtr<ServiceConfig> service_config;
|
979
|
-
grpc_error* error = xds_client()->CreateServiceConfig(
|
980
|
-
xds_client()->rds_result_.value(), &service_config);
|
981
|
-
if (error == GRPC_ERROR_NONE) {
|
982
|
-
xds_client()->service_config_watcher_->OnServiceConfigChanged(
|
983
|
-
std::move(service_config));
|
984
|
-
} else {
|
985
|
-
xds_client()->service_config_watcher_->OnError(error);
|
986
991
|
}
|
987
992
|
}
|
988
993
|
|
989
994
|
void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdate(
|
990
995
|
XdsApi::CdsUpdateMap cds_update_map) {
|
996
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
997
|
+
gpr_log(GPR_INFO,
|
998
|
+
"[xds_client %p] CDS update received containing %" PRIuPTR
|
999
|
+
" resources",
|
1000
|
+
xds_client(), cds_update_map.size());
|
1001
|
+
}
|
991
1002
|
auto& cds_state = state_map_[XdsApi::kCdsTypeUrl];
|
992
1003
|
std::set<std::string> eds_resource_names_seen;
|
993
1004
|
for (auto& p : cds_update_map) {
|
@@ -996,13 +1007,8 @@ void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdate(
|
|
996
1007
|
auto& state = cds_state.subscribed_resources[cluster_name];
|
997
1008
|
if (state != nullptr) state->Finish();
|
998
1009
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
999
|
-
gpr_log(GPR_INFO,
|
1000
|
-
|
1001
|
-
"eds_service_name=%s, lrs_load_reporting_server_name=%s",
|
1002
|
-
xds_client(), cluster_name, cds_update.eds_service_name.c_str(),
|
1003
|
-
cds_update.lrs_load_reporting_server_name.has_value()
|
1004
|
-
? cds_update.lrs_load_reporting_server_name.value().c_str()
|
1005
|
-
: "(N/A)");
|
1010
|
+
gpr_log(GPR_INFO, "[xds_client %p] cluster=%s: %s", xds_client(),
|
1011
|
+
cluster_name, cds_update.ToString().c_str());
|
1006
1012
|
}
|
1007
1013
|
// Record the EDS resource names seen.
|
1008
1014
|
eds_resource_names_seen.insert(cds_update.eds_service_name.empty()
|
@@ -1011,9 +1017,7 @@ void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdate(
|
|
1011
1017
|
// Ignore identical update.
|
1012
1018
|
ClusterState& cluster_state = xds_client()->cluster_map_[cluster_name];
|
1013
1019
|
if (cluster_state.update.has_value() &&
|
1014
|
-
|
1015
|
-
cds_update.lrs_load_reporting_server_name ==
|
1016
|
-
cluster_state.update->lrs_load_reporting_server_name) {
|
1020
|
+
*cluster_state.update == cds_update) {
|
1017
1021
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1018
1022
|
gpr_log(GPR_INFO,
|
1019
1023
|
"[xds_client %p] CDS update identical to current, ignoring.",
|
@@ -1034,6 +1038,13 @@ void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdate(
|
|
1034
1038
|
const std::string& cluster_name = p.first;
|
1035
1039
|
if (cds_update_map.find(cluster_name) == cds_update_map.end()) {
|
1036
1040
|
ClusterState& cluster_state = xds_client()->cluster_map_[cluster_name];
|
1041
|
+
// If the resource was newly requested but has not yet been received,
|
1042
|
+
// we don't want to generate an error for the watchers, because this CDS
|
1043
|
+
// response may be in reaction to an earlier request that did not yet
|
1044
|
+
// request the new resource, so its absence from the response does not
|
1045
|
+
// necessarily indicate that the resource does not exist.
|
1046
|
+
// For that case, we rely on the request timeout instead.
|
1047
|
+
if (!cluster_state.update.has_value()) continue;
|
1037
1048
|
cluster_state.update.reset();
|
1038
1049
|
for (const auto& p : cluster_state.watchers) {
|
1039
1050
|
p.first->OnResourceDoesNotExist();
|
@@ -1060,6 +1071,12 @@ void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdate(
|
|
1060
1071
|
|
1061
1072
|
void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdate(
|
1062
1073
|
XdsApi::EdsUpdateMap eds_update_map) {
|
1074
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1075
|
+
gpr_log(GPR_INFO,
|
1076
|
+
"[xds_client %p] EDS update received containing %" PRIuPTR
|
1077
|
+
" resources",
|
1078
|
+
xds_client(), eds_update_map.size());
|
1079
|
+
}
|
1063
1080
|
auto& eds_state = state_map_[XdsApi::kEdsTypeUrl];
|
1064
1081
|
for (auto& p : eds_update_map) {
|
1065
1082
|
const char* eds_service_name = p.first.c_str();
|
@@ -1067,71 +1084,20 @@ void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdate(
|
|
1067
1084
|
auto& state = eds_state.subscribed_resources[eds_service_name];
|
1068
1085
|
if (state != nullptr) state->Finish();
|
1069
1086
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1070
|
-
gpr_log(GPR_INFO,
|
1071
|
-
|
1072
|
-
" priorities and %" PRIuPTR
|
1073
|
-
" drop categories received (drop_all=%d)",
|
1074
|
-
xds_client(), eds_update.priority_list_update.size(),
|
1075
|
-
eds_update.drop_config->drop_category_list().size(),
|
1076
|
-
eds_update.drop_config->drop_all());
|
1077
|
-
for (size_t priority = 0;
|
1078
|
-
priority < eds_update.priority_list_update.size(); ++priority) {
|
1079
|
-
const auto* locality_map_update = eds_update.priority_list_update.Find(
|
1080
|
-
static_cast<uint32_t>(priority));
|
1081
|
-
gpr_log(GPR_INFO,
|
1082
|
-
"[xds_client %p] Priority %" PRIuPTR " contains %" PRIuPTR
|
1083
|
-
" localities",
|
1084
|
-
xds_client(), priority, locality_map_update->size());
|
1085
|
-
size_t locality_count = 0;
|
1086
|
-
for (const auto& p : locality_map_update->localities) {
|
1087
|
-
const auto& locality = p.second;
|
1088
|
-
gpr_log(GPR_INFO,
|
1089
|
-
"[xds_client %p] Priority %" PRIuPTR ", locality %" PRIuPTR
|
1090
|
-
" %s has weight %d, contains %" PRIuPTR " server addresses",
|
1091
|
-
xds_client(), priority, locality_count,
|
1092
|
-
locality.name->AsHumanReadableString().c_str(),
|
1093
|
-
locality.lb_weight, locality.serverlist.size());
|
1094
|
-
for (size_t i = 0; i < locality.serverlist.size(); ++i) {
|
1095
|
-
std::string ipport = grpc_sockaddr_to_string(
|
1096
|
-
&locality.serverlist[i].address(), false);
|
1097
|
-
gpr_log(GPR_INFO,
|
1098
|
-
"[xds_client %p] Priority %" PRIuPTR ", locality %" PRIuPTR
|
1099
|
-
" %s, server address %" PRIuPTR ": %s",
|
1100
|
-
xds_client(), priority, locality_count,
|
1101
|
-
locality.name->AsHumanReadableString().c_str(), i,
|
1102
|
-
ipport.c_str());
|
1103
|
-
}
|
1104
|
-
++locality_count;
|
1105
|
-
}
|
1106
|
-
}
|
1107
|
-
for (size_t i = 0;
|
1108
|
-
i < eds_update.drop_config->drop_category_list().size(); ++i) {
|
1109
|
-
const XdsApi::DropConfig::DropCategory& drop_category =
|
1110
|
-
eds_update.drop_config->drop_category_list()[i];
|
1111
|
-
gpr_log(GPR_INFO,
|
1112
|
-
"[xds_client %p] Drop category %s has drop rate %d per million",
|
1113
|
-
xds_client(), drop_category.name.c_str(),
|
1114
|
-
drop_category.parts_per_million);
|
1115
|
-
}
|
1087
|
+
gpr_log(GPR_INFO, "[xds_client %p] EDS resource %s: %s", xds_client(),
|
1088
|
+
eds_service_name, eds_update.ToString().c_str());
|
1116
1089
|
}
|
1117
1090
|
EndpointState& endpoint_state =
|
1118
1091
|
xds_client()->endpoint_map_[eds_service_name];
|
1119
1092
|
// Ignore identical update.
|
1120
|
-
if (endpoint_state.update.has_value()
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
*prev_update.drop_config != *eds_update.drop_config;
|
1127
|
-
if (!priority_list_changed && !drop_config_changed) {
|
1128
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1129
|
-
gpr_log(GPR_INFO,
|
1130
|
-
"[xds_client %p] EDS update identical to current, ignoring.",
|
1131
|
-
xds_client());
|
1132
|
-
}
|
1133
|
-
continue;
|
1093
|
+
if (endpoint_state.update.has_value() &&
|
1094
|
+
*endpoint_state.update == eds_update) {
|
1095
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1096
|
+
gpr_log(GPR_INFO,
|
1097
|
+
"[xds_client %p] EDS update identical to current, ignoring.",
|
1098
|
+
xds_client());
|
1134
1099
|
}
|
1100
|
+
continue;
|
1135
1101
|
}
|
1136
1102
|
// Update the cluster state.
|
1137
1103
|
endpoint_state.update = std::move(eds_update);
|
@@ -1145,10 +1111,11 @@ void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdate(
|
|
1145
1111
|
void XdsClient::ChannelState::AdsCallState::OnRequestSent(void* arg,
|
1146
1112
|
grpc_error* error) {
|
1147
1113
|
AdsCallState* ads_calld = static_cast<AdsCallState*>(arg);
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1114
|
+
{
|
1115
|
+
MutexLock lock(&ads_calld->xds_client()->mu_);
|
1116
|
+
ads_calld->OnRequestSentLocked(GRPC_ERROR_REF(error));
|
1117
|
+
}
|
1118
|
+
ads_calld->Unref(DEBUG_LOCATION, "ADS+OnRequestSentLocked");
|
1152
1119
|
}
|
1153
1120
|
|
1154
1121
|
void XdsClient::ChannelState::AdsCallState::OnRequestSentLocked(
|
@@ -1172,22 +1139,24 @@ void XdsClient::ChannelState::AdsCallState::OnRequestSentLocked(
|
|
1172
1139
|
buffered_requests_.erase(it);
|
1173
1140
|
}
|
1174
1141
|
}
|
1175
|
-
Unref(DEBUG_LOCATION, "ADS+OnRequestSentLocked");
|
1176
1142
|
GRPC_ERROR_UNREF(error);
|
1177
1143
|
}
|
1178
1144
|
|
1179
1145
|
void XdsClient::ChannelState::AdsCallState::OnResponseReceived(
|
1180
1146
|
void* arg, grpc_error* /* error */) {
|
1181
1147
|
AdsCallState* ads_calld = static_cast<AdsCallState*>(arg);
|
1182
|
-
|
1183
|
-
|
1148
|
+
bool done;
|
1149
|
+
{
|
1150
|
+
MutexLock lock(&ads_calld->xds_client()->mu_);
|
1151
|
+
done = ads_calld->OnResponseReceivedLocked();
|
1152
|
+
}
|
1153
|
+
if (done) ads_calld->Unref(DEBUG_LOCATION, "ADS+OnResponseReceivedLocked");
|
1184
1154
|
}
|
1185
1155
|
|
1186
|
-
|
1156
|
+
bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
|
1187
1157
|
// Empty payload means the call was cancelled.
|
1188
1158
|
if (!IsCurrentCallOnChannel() || recv_message_payload_ == nullptr) {
|
1189
|
-
|
1190
|
-
return;
|
1159
|
+
return true;
|
1191
1160
|
}
|
1192
1161
|
// Read the response.
|
1193
1162
|
grpc_byte_buffer_reader bbr;
|
@@ -1196,66 +1165,50 @@ void XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
|
|
1196
1165
|
grpc_byte_buffer_reader_destroy(&bbr);
|
1197
1166
|
grpc_byte_buffer_destroy(recv_message_payload_);
|
1198
1167
|
recv_message_payload_ = nullptr;
|
1199
|
-
//
|
1200
|
-
|
1201
|
-
|
1202
|
-
// period of time. We will need to save the timeout value here, and then
|
1203
|
-
// when the balancer call ends, we will need to start a timer for the
|
1204
|
-
// specified period of time, and if the timer fires, we go into fallback
|
1205
|
-
// mode. We will also need to cancel the timer when we receive a serverlist
|
1206
|
-
// from the balancer.
|
1207
|
-
// Parse the response.
|
1208
|
-
absl::optional<XdsApi::LdsUpdate> lds_update;
|
1209
|
-
absl::optional<XdsApi::RdsUpdate> rds_update;
|
1210
|
-
XdsApi::CdsUpdateMap cds_update_map;
|
1211
|
-
XdsApi::EdsUpdateMap eds_update_map;
|
1212
|
-
std::string version;
|
1213
|
-
std::string nonce;
|
1214
|
-
std::string type_url;
|
1215
|
-
// Note that ParseAdsResponse() also validates the response.
|
1216
|
-
grpc_error* parse_error = xds_client()->api_.ParseAdsResponse(
|
1217
|
-
response_slice, xds_client()->server_name_,
|
1168
|
+
// Parse and validate the response.
|
1169
|
+
XdsApi::AdsParseResult result = xds_client()->api_.ParseAdsResponse(
|
1170
|
+
response_slice, ResourceNamesForRequest(XdsApi::kLdsTypeUrl),
|
1218
1171
|
ResourceNamesForRequest(XdsApi::kRdsTypeUrl),
|
1219
1172
|
ResourceNamesForRequest(XdsApi::kCdsTypeUrl),
|
1220
|
-
ResourceNamesForRequest(XdsApi::kEdsTypeUrl)
|
1221
|
-
&cds_update_map, &eds_update_map, &version, &nonce, &type_url);
|
1173
|
+
ResourceNamesForRequest(XdsApi::kEdsTypeUrl));
|
1222
1174
|
grpc_slice_unref_internal(response_slice);
|
1223
|
-
if (type_url.empty()) {
|
1175
|
+
if (result.type_url.empty()) {
|
1224
1176
|
// Ignore unparsable response.
|
1225
1177
|
gpr_log(GPR_ERROR,
|
1226
1178
|
"[xds_client %p] Error parsing ADS response (%s) -- ignoring",
|
1227
|
-
xds_client(), grpc_error_string(parse_error));
|
1228
|
-
GRPC_ERROR_UNREF(parse_error);
|
1179
|
+
xds_client(), grpc_error_string(result.parse_error));
|
1180
|
+
GRPC_ERROR_UNREF(result.parse_error);
|
1229
1181
|
} else {
|
1230
1182
|
// Update nonce.
|
1231
|
-
auto& state = state_map_[type_url];
|
1232
|
-
state.nonce = std::move(nonce);
|
1183
|
+
auto& state = state_map_[result.type_url];
|
1184
|
+
state.nonce = std::move(result.nonce);
|
1233
1185
|
// NACK or ACK the response.
|
1234
|
-
if (parse_error != GRPC_ERROR_NONE) {
|
1186
|
+
if (result.parse_error != GRPC_ERROR_NONE) {
|
1235
1187
|
GRPC_ERROR_UNREF(state.error);
|
1236
|
-
state.error = parse_error;
|
1188
|
+
state.error = result.parse_error;
|
1237
1189
|
// NACK unacceptable update.
|
1238
1190
|
gpr_log(GPR_ERROR,
|
1239
1191
|
"[xds_client %p] ADS response invalid for resource type %s "
|
1240
1192
|
"version %s, will NACK: nonce=%s error=%s",
|
1241
|
-
xds_client(), type_url.c_str(), version.c_str(),
|
1242
|
-
state.nonce.c_str(), grpc_error_string(parse_error));
|
1243
|
-
SendMessageLocked(type_url);
|
1193
|
+
xds_client(), result.type_url.c_str(), result.version.c_str(),
|
1194
|
+
state.nonce.c_str(), grpc_error_string(result.parse_error));
|
1195
|
+
SendMessageLocked(result.type_url);
|
1244
1196
|
} else {
|
1245
1197
|
seen_response_ = true;
|
1246
1198
|
// Accept the ADS response according to the type_url.
|
1247
|
-
if (type_url == XdsApi::kLdsTypeUrl) {
|
1248
|
-
AcceptLdsUpdate(std::move(
|
1249
|
-
} else if (type_url == XdsApi::kRdsTypeUrl) {
|
1250
|
-
AcceptRdsUpdate(std::move(
|
1251
|
-
} else if (type_url == XdsApi::kCdsTypeUrl) {
|
1252
|
-
AcceptCdsUpdate(std::move(cds_update_map));
|
1253
|
-
} else if (type_url == XdsApi::kEdsTypeUrl) {
|
1254
|
-
AcceptEdsUpdate(std::move(eds_update_map));
|
1199
|
+
if (result.type_url == XdsApi::kLdsTypeUrl) {
|
1200
|
+
AcceptLdsUpdate(std::move(result.lds_update_map));
|
1201
|
+
} else if (result.type_url == XdsApi::kRdsTypeUrl) {
|
1202
|
+
AcceptRdsUpdate(std::move(result.rds_update_map));
|
1203
|
+
} else if (result.type_url == XdsApi::kCdsTypeUrl) {
|
1204
|
+
AcceptCdsUpdate(std::move(result.cds_update_map));
|
1205
|
+
} else if (result.type_url == XdsApi::kEdsTypeUrl) {
|
1206
|
+
AcceptEdsUpdate(std::move(result.eds_update_map));
|
1255
1207
|
}
|
1256
|
-
|
1208
|
+
xds_client()->resource_version_map_[result.type_url] =
|
1209
|
+
std::move(result.version);
|
1257
1210
|
// ACK the update.
|
1258
|
-
SendMessageLocked(type_url);
|
1211
|
+
SendMessageLocked(result.type_url);
|
1259
1212
|
// Start load reporting if needed.
|
1260
1213
|
auto& lrs_call = chand()->lrs_calld_;
|
1261
1214
|
if (lrs_call != nullptr) {
|
@@ -1264,10 +1217,7 @@ void XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
|
|
1264
1217
|
}
|
1265
1218
|
}
|
1266
1219
|
}
|
1267
|
-
if (xds_client()->shutting_down_)
|
1268
|
-
Unref(DEBUG_LOCATION, "ADS+OnResponseReceivedLocked+xds_shutdown");
|
1269
|
-
return;
|
1270
|
-
}
|
1220
|
+
if (xds_client()->shutting_down_) return true;
|
1271
1221
|
// Keep listening for updates.
|
1272
1222
|
grpc_op op;
|
1273
1223
|
memset(&op, 0, sizeof(op));
|
@@ -1280,15 +1230,17 @@ void XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
|
|
1280
1230
|
const grpc_call_error call_error =
|
1281
1231
|
grpc_call_start_batch_and_execute(call_, &op, 1, &on_response_received_);
|
1282
1232
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
1233
|
+
return false;
|
1283
1234
|
}
|
1284
1235
|
|
1285
1236
|
void XdsClient::ChannelState::AdsCallState::OnStatusReceived(
|
1286
1237
|
void* arg, grpc_error* error) {
|
1287
1238
|
AdsCallState* ads_calld = static_cast<AdsCallState*>(arg);
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1239
|
+
{
|
1240
|
+
MutexLock lock(&ads_calld->xds_client()->mu_);
|
1241
|
+
ads_calld->OnStatusReceivedLocked(GRPC_ERROR_REF(error));
|
1242
|
+
}
|
1243
|
+
ads_calld->Unref(DEBUG_LOCATION, "ADS+OnStatusReceivedLocked");
|
1292
1244
|
}
|
1293
1245
|
|
1294
1246
|
void XdsClient::ChannelState::AdsCallState::OnStatusReceivedLocked(
|
@@ -1307,10 +1259,9 @@ void XdsClient::ChannelState::AdsCallState::OnStatusReceivedLocked(
|
|
1307
1259
|
// Try to restart the call.
|
1308
1260
|
parent_->OnCallFinishedLocked();
|
1309
1261
|
// Send error to all watchers.
|
1310
|
-
xds_client()->
|
1262
|
+
xds_client()->NotifyOnErrorLocked(
|
1311
1263
|
GRPC_ERROR_CREATE_FROM_STATIC_STRING("xds call failed"));
|
1312
1264
|
}
|
1313
|
-
Unref(DEBUG_LOCATION, "ADS+OnStatusReceivedLocked");
|
1314
1265
|
GRPC_ERROR_UNREF(error);
|
1315
1266
|
}
|
1316
1267
|
|
@@ -1330,7 +1281,7 @@ XdsClient::ChannelState::AdsCallState::ResourceNamesForRequest(
|
|
1330
1281
|
for (auto& p : it->second.subscribed_resources) {
|
1331
1282
|
resource_names.insert(p.first);
|
1332
1283
|
OrphanablePtr<ResourceState>& state = p.second;
|
1333
|
-
state->Start(Ref());
|
1284
|
+
state->Start(Ref(DEBUG_LOCATION, "ResourceState"));
|
1334
1285
|
}
|
1335
1286
|
}
|
1336
1287
|
return resource_names;
|
@@ -1357,21 +1308,22 @@ void XdsClient::ChannelState::LrsCallState::Reporter::
|
|
1357
1308
|
void XdsClient::ChannelState::LrsCallState::Reporter::OnNextReportTimer(
|
1358
1309
|
void* arg, grpc_error* error) {
|
1359
1310
|
Reporter* self = static_cast<Reporter*>(arg);
|
1360
|
-
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1311
|
+
bool done;
|
1312
|
+
{
|
1313
|
+
MutexLock lock(&self->xds_client()->mu_);
|
1314
|
+
done = self->OnNextReportTimerLocked(GRPC_ERROR_REF(error));
|
1315
|
+
}
|
1316
|
+
if (done) self->Unref(DEBUG_LOCATION, "Reporter+timer");
|
1364
1317
|
}
|
1365
1318
|
|
1366
|
-
|
1319
|
+
bool XdsClient::ChannelState::LrsCallState::Reporter::OnNextReportTimerLocked(
|
1367
1320
|
grpc_error* error) {
|
1368
1321
|
next_report_timer_callback_pending_ = false;
|
1369
1322
|
if (error != GRPC_ERROR_NONE || !IsCurrentReporterOnCall()) {
|
1370
|
-
|
1371
|
-
|
1372
|
-
SendReportLocked();
|
1323
|
+
GRPC_ERROR_UNREF(error);
|
1324
|
+
return true;
|
1373
1325
|
}
|
1374
|
-
|
1326
|
+
return SendReportLocked();
|
1375
1327
|
}
|
1376
1328
|
|
1377
1329
|
namespace {
|
@@ -1379,9 +1331,7 @@ namespace {
|
|
1379
1331
|
bool LoadReportCountersAreZero(const XdsApi::ClusterLoadReportMap& snapshot) {
|
1380
1332
|
for (const auto& p : snapshot) {
|
1381
1333
|
const XdsApi::ClusterLoadReport& cluster_snapshot = p.second;
|
1382
|
-
|
1383
|
-
if (q.second > 0) return false;
|
1384
|
-
}
|
1334
|
+
if (!cluster_snapshot.dropped_requests.IsZero()) return false;
|
1385
1335
|
for (const auto& q : cluster_snapshot.locality_stats) {
|
1386
1336
|
const XdsClusterLocalityStats::Snapshot& locality_snapshot = q.second;
|
1387
1337
|
if (!locality_snapshot.IsZero()) return false;
|
@@ -1392,17 +1342,22 @@ bool LoadReportCountersAreZero(const XdsApi::ClusterLoadReportMap& snapshot) {
|
|
1392
1342
|
|
1393
1343
|
} // namespace
|
1394
1344
|
|
1395
|
-
|
1345
|
+
bool XdsClient::ChannelState::LrsCallState::Reporter::SendReportLocked() {
|
1396
1346
|
// Construct snapshot from all reported stats.
|
1397
|
-
XdsApi::ClusterLoadReportMap snapshot =
|
1398
|
-
parent_->send_all_clusters_,
|
1347
|
+
XdsApi::ClusterLoadReportMap snapshot =
|
1348
|
+
xds_client()->BuildLoadReportSnapshotLocked(parent_->send_all_clusters_,
|
1349
|
+
parent_->cluster_names_);
|
1399
1350
|
// Skip client load report if the counters were all zero in the last
|
1400
1351
|
// report and they are still zero in this one.
|
1401
1352
|
const bool old_val = last_report_counters_were_zero_;
|
1402
1353
|
last_report_counters_were_zero_ = LoadReportCountersAreZero(snapshot);
|
1403
1354
|
if (old_val && last_report_counters_were_zero_) {
|
1355
|
+
if (xds_client()->load_report_map_.empty()) {
|
1356
|
+
parent_->chand()->StopLrsCall();
|
1357
|
+
return true;
|
1358
|
+
}
|
1404
1359
|
ScheduleNextReportLocked();
|
1405
|
-
return;
|
1360
|
+
return false;
|
1406
1361
|
}
|
1407
1362
|
// Create a request that contains the snapshot.
|
1408
1363
|
grpc_slice request_payload_slice =
|
@@ -1423,37 +1378,41 @@ void XdsClient::ChannelState::LrsCallState::Reporter::SendReportLocked() {
|
|
1423
1378
|
xds_client(), this, call_error);
|
1424
1379
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
1425
1380
|
}
|
1381
|
+
return false;
|
1426
1382
|
}
|
1427
1383
|
|
1428
1384
|
void XdsClient::ChannelState::LrsCallState::Reporter::OnReportDone(
|
1429
1385
|
void* arg, grpc_error* error) {
|
1430
1386
|
Reporter* self = static_cast<Reporter*>(arg);
|
1431
|
-
|
1432
|
-
|
1433
|
-
|
1387
|
+
bool done;
|
1388
|
+
{
|
1389
|
+
MutexLock lock(&self->xds_client()->mu_);
|
1390
|
+
done = self->OnReportDoneLocked(GRPC_ERROR_REF(error));
|
1391
|
+
}
|
1392
|
+
if (done) self->Unref(DEBUG_LOCATION, "Reporter+report_done");
|
1434
1393
|
}
|
1435
1394
|
|
1436
|
-
|
1395
|
+
bool XdsClient::ChannelState::LrsCallState::Reporter::OnReportDoneLocked(
|
1437
1396
|
grpc_error* error) {
|
1438
1397
|
grpc_byte_buffer_destroy(parent_->send_message_payload_);
|
1439
1398
|
parent_->send_message_payload_ = nullptr;
|
1440
1399
|
// If there are no more registered stats to report, cancel the call.
|
1441
1400
|
if (xds_client()->load_report_map_.empty()) {
|
1442
1401
|
parent_->chand()->StopLrsCall();
|
1443
|
-
|
1444
|
-
return;
|
1402
|
+
GRPC_ERROR_UNREF(error);
|
1403
|
+
return true;
|
1445
1404
|
}
|
1446
1405
|
if (error != GRPC_ERROR_NONE || !IsCurrentReporterOnCall()) {
|
1406
|
+
GRPC_ERROR_UNREF(error);
|
1447
1407
|
// If this reporter is no longer the current one on the call, the reason
|
1448
1408
|
// might be that it was orphaned for a new one due to config update.
|
1449
1409
|
if (!IsCurrentReporterOnCall()) {
|
1450
1410
|
parent_->MaybeStartReportingLocked();
|
1451
1411
|
}
|
1452
|
-
|
1453
|
-
} else {
|
1454
|
-
ScheduleNextReportLocked();
|
1412
|
+
return true;
|
1455
1413
|
}
|
1456
|
-
|
1414
|
+
ScheduleNextReportLocked();
|
1415
|
+
return false;
|
1457
1416
|
}
|
1458
1417
|
|
1459
1418
|
//
|
@@ -1462,22 +1421,27 @@ void XdsClient::ChannelState::LrsCallState::Reporter::OnReportDoneLocked(
|
|
1462
1421
|
|
1463
1422
|
XdsClient::ChannelState::LrsCallState::LrsCallState(
|
1464
1423
|
RefCountedPtr<RetryableCall<LrsCallState>> parent)
|
1465
|
-
: InternallyRefCounted<LrsCallState>(
|
1424
|
+
: InternallyRefCounted<LrsCallState>(
|
1425
|
+
GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace)
|
1426
|
+
? "LrsCallState"
|
1427
|
+
: nullptr),
|
1466
1428
|
parent_(std::move(parent)) {
|
1467
1429
|
// Init the LRS call. Note that the call will progress every time there's
|
1468
1430
|
// activity in xds_client()->interested_parties_, which is comprised of
|
1469
1431
|
// the polling entities from client_channel.
|
1470
1432
|
GPR_ASSERT(xds_client() != nullptr);
|
1471
|
-
|
1433
|
+
const auto& method =
|
1434
|
+
chand()->server_.ShouldUseV3()
|
1435
|
+
? GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_LOAD_STATS_DOT_V3_DOT_LOADREPORTINGSERVICE_SLASH_STREAMLOADSTATS
|
1436
|
+
: GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_LOAD_STATS_DOT_V2_DOT_LOADREPORTINGSERVICE_SLASH_STREAMLOADSTATS;
|
1472
1437
|
call_ = grpc_channel_create_pollset_set_call(
|
1473
1438
|
chand()->channel_, nullptr, GRPC_PROPAGATE_DEFAULTS,
|
1474
|
-
xds_client()->interested_parties_,
|
1475
|
-
|
1476
|
-
nullptr, GRPC_MILLIS_INF_FUTURE, nullptr);
|
1439
|
+
xds_client()->interested_parties_, method, nullptr,
|
1440
|
+
GRPC_MILLIS_INF_FUTURE, nullptr);
|
1477
1441
|
GPR_ASSERT(call_ != nullptr);
|
1478
1442
|
// Init the request payload.
|
1479
1443
|
grpc_slice request_payload_slice =
|
1480
|
-
xds_client()->api_.CreateLrsInitialRequest(
|
1444
|
+
xds_client()->api_.CreateLrsInitialRequest(chand()->server_);
|
1481
1445
|
send_message_payload_ =
|
1482
1446
|
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
|
1483
1447
|
grpc_slice_unref_internal(request_payload_slice);
|
@@ -1513,8 +1477,8 @@ XdsClient::ChannelState::LrsCallState::LrsCallState(
|
|
1513
1477
|
Ref(DEBUG_LOCATION, "LRS+OnInitialRequestSentLocked").release();
|
1514
1478
|
GRPC_CLOSURE_INIT(&on_initial_request_sent_, OnInitialRequestSent, this,
|
1515
1479
|
grpc_schedule_on_exec_ctx);
|
1516
|
-
call_error = grpc_call_start_batch_and_execute(
|
1517
|
-
|
1480
|
+
call_error = grpc_call_start_batch_and_execute(
|
1481
|
+
call_, ops, static_cast<size_t>(op - ops), &on_initial_request_sent_);
|
1518
1482
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
1519
1483
|
// Op: recv initial metadata.
|
1520
1484
|
op = ops;
|
@@ -1533,8 +1497,8 @@ XdsClient::ChannelState::LrsCallState::LrsCallState(
|
|
1533
1497
|
Ref(DEBUG_LOCATION, "LRS+OnResponseReceivedLocked").release();
|
1534
1498
|
GRPC_CLOSURE_INIT(&on_response_received_, OnResponseReceived, this,
|
1535
1499
|
grpc_schedule_on_exec_ctx);
|
1536
|
-
call_error = grpc_call_start_batch_and_execute(
|
1537
|
-
|
1500
|
+
call_error = grpc_call_start_batch_and_execute(
|
1501
|
+
call_, ops, static_cast<size_t>(op - ops), &on_response_received_);
|
1538
1502
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
1539
1503
|
// Op: recv server status.
|
1540
1504
|
op = ops;
|
@@ -1550,8 +1514,8 @@ XdsClient::ChannelState::LrsCallState::LrsCallState(
|
|
1550
1514
|
// unreffed.
|
1551
1515
|
GRPC_CLOSURE_INIT(&on_status_received_, OnStatusReceived, this,
|
1552
1516
|
grpc_schedule_on_exec_ctx);
|
1553
|
-
call_error = grpc_call_start_batch_and_execute(
|
1554
|
-
|
1517
|
+
call_error = grpc_call_start_batch_and_execute(
|
1518
|
+
call_, ops, static_cast<size_t>(op - ops), &on_status_received_);
|
1555
1519
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
1556
1520
|
}
|
1557
1521
|
|
@@ -1572,7 +1536,7 @@ void XdsClient::ChannelState::LrsCallState::Orphan() {
|
|
1572
1536
|
// on_status_received_ will complete the cancellation and clean up. Otherwise,
|
1573
1537
|
// we are here because xds_client has to orphan a failed call, then the
|
1574
1538
|
// following cancellation will be a no-op.
|
1575
|
-
|
1539
|
+
grpc_call_cancel_internal(call_);
|
1576
1540
|
// Note that the initial ref is hold by on_status_received_. So the
|
1577
1541
|
// corresponding unref happens in on_status_received_ instead of here.
|
1578
1542
|
}
|
@@ -1601,9 +1565,11 @@ void XdsClient::ChannelState::LrsCallState::MaybeStartReportingLocked() {
|
|
1601
1565
|
void XdsClient::ChannelState::LrsCallState::OnInitialRequestSent(
|
1602
1566
|
void* arg, grpc_error* /*error*/) {
|
1603
1567
|
LrsCallState* lrs_calld = static_cast<LrsCallState*>(arg);
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1568
|
+
{
|
1569
|
+
MutexLock lock(&lrs_calld->xds_client()->mu_);
|
1570
|
+
lrs_calld->OnInitialRequestSentLocked();
|
1571
|
+
}
|
1572
|
+
lrs_calld->Unref(DEBUG_LOCATION, "LRS+OnInitialRequestSentLocked");
|
1607
1573
|
}
|
1608
1574
|
|
1609
1575
|
void XdsClient::ChannelState::LrsCallState::OnInitialRequestSentLocked() {
|
@@ -1611,21 +1577,23 @@ void XdsClient::ChannelState::LrsCallState::OnInitialRequestSentLocked() {
|
|
1611
1577
|
grpc_byte_buffer_destroy(send_message_payload_);
|
1612
1578
|
send_message_payload_ = nullptr;
|
1613
1579
|
MaybeStartReportingLocked();
|
1614
|
-
Unref(DEBUG_LOCATION, "LRS+OnInitialRequestSentLocked");
|
1615
1580
|
}
|
1616
1581
|
|
1617
1582
|
void XdsClient::ChannelState::LrsCallState::OnResponseReceived(
|
1618
1583
|
void* arg, grpc_error* /*error*/) {
|
1619
1584
|
LrsCallState* lrs_calld = static_cast<LrsCallState*>(arg);
|
1620
|
-
|
1621
|
-
|
1585
|
+
bool done;
|
1586
|
+
{
|
1587
|
+
MutexLock lock(&lrs_calld->xds_client()->mu_);
|
1588
|
+
done = lrs_calld->OnResponseReceivedLocked();
|
1589
|
+
}
|
1590
|
+
if (done) lrs_calld->Unref(DEBUG_LOCATION, "LRS+OnResponseReceivedLocked");
|
1622
1591
|
}
|
1623
1592
|
|
1624
|
-
|
1593
|
+
bool XdsClient::ChannelState::LrsCallState::OnResponseReceivedLocked() {
|
1625
1594
|
// Empty payload means the call was cancelled.
|
1626
1595
|
if (!IsCurrentCallOnChannel() || recv_message_payload_ == nullptr) {
|
1627
|
-
|
1628
|
-
return;
|
1596
|
+
return true;
|
1629
1597
|
}
|
1630
1598
|
// Read the response.
|
1631
1599
|
grpc_byte_buffer_reader bbr;
|
@@ -1698,10 +1666,7 @@ void XdsClient::ChannelState::LrsCallState::OnResponseReceivedLocked() {
|
|
1698
1666
|
MaybeStartReportingLocked();
|
1699
1667
|
}();
|
1700
1668
|
grpc_slice_unref_internal(response_slice);
|
1701
|
-
if (xds_client()->shutting_down_)
|
1702
|
-
Unref(DEBUG_LOCATION, "LRS+OnResponseReceivedLocked+xds_shutdown");
|
1703
|
-
return;
|
1704
|
-
}
|
1669
|
+
if (xds_client()->shutting_down_) return true;
|
1705
1670
|
// Keep listening for LRS config updates.
|
1706
1671
|
grpc_op op;
|
1707
1672
|
memset(&op, 0, sizeof(op));
|
@@ -1714,15 +1679,17 @@ void XdsClient::ChannelState::LrsCallState::OnResponseReceivedLocked() {
|
|
1714
1679
|
const grpc_call_error call_error =
|
1715
1680
|
grpc_call_start_batch_and_execute(call_, &op, 1, &on_response_received_);
|
1716
1681
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
1682
|
+
return false;
|
1717
1683
|
}
|
1718
1684
|
|
1719
1685
|
void XdsClient::ChannelState::LrsCallState::OnStatusReceived(
|
1720
1686
|
void* arg, grpc_error* error) {
|
1721
1687
|
LrsCallState* lrs_calld = static_cast<LrsCallState*>(arg);
|
1722
|
-
|
1723
|
-
|
1724
|
-
|
1725
|
-
|
1688
|
+
{
|
1689
|
+
MutexLock lock(&lrs_calld->xds_client()->mu_);
|
1690
|
+
lrs_calld->OnStatusReceivedLocked(GRPC_ERROR_REF(error));
|
1691
|
+
}
|
1692
|
+
lrs_calld->Unref(DEBUG_LOCATION, "LRS+OnStatusReceivedLocked");
|
1726
1693
|
}
|
1727
1694
|
|
1728
1695
|
void XdsClient::ChannelState::LrsCallState::OnStatusReceivedLocked(
|
@@ -1743,7 +1710,6 @@ void XdsClient::ChannelState::LrsCallState::OnStatusReceivedLocked(
|
|
1743
1710
|
// Try to restart the call.
|
1744
1711
|
parent_->OnCallFinishedLocked();
|
1745
1712
|
}
|
1746
|
-
Unref(DEBUG_LOCATION, "LRS+OnStatusReceivedLocked");
|
1747
1713
|
GRPC_ERROR_UNREF(error);
|
1748
1714
|
}
|
1749
1715
|
|
@@ -1760,29 +1726,28 @@ bool XdsClient::ChannelState::LrsCallState::IsCurrentCallOnChannel() const {
|
|
1760
1726
|
|
1761
1727
|
namespace {
|
1762
1728
|
|
1763
|
-
grpc_millis GetRequestTimeout(
|
1729
|
+
grpc_millis GetRequestTimeout() {
|
1764
1730
|
return grpc_channel_args_find_integer(
|
1765
|
-
|
1731
|
+
g_channel_args, GRPC_ARG_XDS_RESOURCE_DOES_NOT_EXIST_TIMEOUT_MS,
|
1766
1732
|
{15000, 0, INT_MAX});
|
1767
1733
|
}
|
1768
1734
|
|
1769
1735
|
} // namespace
|
1770
1736
|
|
1771
|
-
XdsClient::XdsClient(
|
1772
|
-
|
1773
|
-
|
1774
|
-
|
1775
|
-
|
1776
|
-
|
1777
|
-
request_timeout_(GetRequestTimeout(channel_args)),
|
1778
|
-
work_serializer_(std::move(work_serializer)),
|
1779
|
-
interested_parties_(interested_parties),
|
1737
|
+
XdsClient::XdsClient(grpc_error** error)
|
1738
|
+
: DualRefCounted<XdsClient>(
|
1739
|
+
GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace) ? "XdsClient"
|
1740
|
+
: nullptr),
|
1741
|
+
request_timeout_(GetRequestTimeout()),
|
1742
|
+
interested_parties_(grpc_pollset_set_create()),
|
1780
1743
|
bootstrap_(
|
1781
1744
|
XdsBootstrap::ReadFromFile(this, &grpc_xds_client_trace, error)),
|
1745
|
+
certificate_provider_store_(MakeOrphanable<CertificateProviderStore>(
|
1746
|
+
bootstrap_ == nullptr
|
1747
|
+
? CertificateProviderStore::PluginDefinitionMap()
|
1748
|
+
: bootstrap_->certificate_providers())),
|
1782
1749
|
api_(this, &grpc_xds_client_trace,
|
1783
|
-
bootstrap_ == nullptr ? nullptr : bootstrap_->node())
|
1784
|
-
server_name_(server_name),
|
1785
|
-
service_config_watcher_(std::move(watcher)) {
|
1750
|
+
bootstrap_ == nullptr ? nullptr : bootstrap_->node()) {
|
1786
1751
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1787
1752
|
gpr_log(GPR_INFO, "[xds_client %p] creating xds client", this);
|
1788
1753
|
}
|
@@ -1791,58 +1756,150 @@ XdsClient::XdsClient(std::shared_ptr<WorkSerializer> work_serializer,
|
|
1791
1756
|
this, grpc_error_string(*error));
|
1792
1757
|
return;
|
1793
1758
|
}
|
1794
|
-
|
1795
|
-
gpr_log(GPR_INFO, "[xds_client %p] creating channel to %s", this,
|
1796
|
-
bootstrap_->server().server_uri.c_str());
|
1797
|
-
}
|
1798
|
-
grpc_channel_args* new_args = BuildXdsChannelArgs(channel_args);
|
1799
|
-
grpc_channel* channel = CreateXdsChannel(*bootstrap_, *new_args, error);
|
1800
|
-
grpc_channel_args_destroy(new_args);
|
1801
|
-
if (*error != GRPC_ERROR_NONE) {
|
1802
|
-
gpr_log(GPR_ERROR, "[xds_client %p] failed to create xds channel: %s", this,
|
1803
|
-
grpc_error_string(*error));
|
1804
|
-
return;
|
1805
|
-
}
|
1759
|
+
// Create ChannelState object.
|
1806
1760
|
chand_ = MakeOrphanable<ChannelState>(
|
1807
|
-
|
1808
|
-
if (service_config_watcher_ != nullptr) {
|
1809
|
-
chand_->Subscribe(XdsApi::kLdsTypeUrl, std::string(server_name));
|
1810
|
-
}
|
1761
|
+
WeakRef(DEBUG_LOCATION, "XdsClient+ChannelState"), bootstrap_->server());
|
1811
1762
|
}
|
1812
1763
|
|
1813
1764
|
XdsClient::~XdsClient() {
|
1814
1765
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1815
1766
|
gpr_log(GPR_INFO, "[xds_client %p] destroying xds client", this);
|
1816
1767
|
}
|
1768
|
+
grpc_pollset_set_destroy(interested_parties_);
|
1769
|
+
}
|
1770
|
+
|
1771
|
+
void XdsClient::AddChannelzLinkage(
|
1772
|
+
channelz::ChannelNode* parent_channelz_node) {
|
1773
|
+
channelz::ChannelNode* xds_channelz_node =
|
1774
|
+
grpc_channel_get_channelz_node(chand_->channel());
|
1775
|
+
if (xds_channelz_node != nullptr) {
|
1776
|
+
parent_channelz_node->AddChildChannel(xds_channelz_node->uuid());
|
1777
|
+
}
|
1778
|
+
}
|
1779
|
+
|
1780
|
+
void XdsClient::RemoveChannelzLinkage(
|
1781
|
+
channelz::ChannelNode* parent_channelz_node) {
|
1782
|
+
channelz::ChannelNode* xds_channelz_node =
|
1783
|
+
grpc_channel_get_channelz_node(chand_->channel());
|
1784
|
+
if (xds_channelz_node != nullptr) {
|
1785
|
+
parent_channelz_node->RemoveChildChannel(xds_channelz_node->uuid());
|
1786
|
+
}
|
1817
1787
|
}
|
1818
1788
|
|
1819
1789
|
void XdsClient::Orphan() {
|
1820
1790
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1821
1791
|
gpr_log(GPR_INFO, "[xds_client %p] shutting down xds client", this);
|
1822
1792
|
}
|
1823
|
-
|
1824
|
-
|
1825
|
-
|
1826
|
-
|
1827
|
-
|
1828
|
-
|
1829
|
-
|
1830
|
-
|
1831
|
-
|
1832
|
-
cluster_map_
|
1833
|
-
|
1793
|
+
{
|
1794
|
+
MutexLock lock(g_mu);
|
1795
|
+
if (g_xds_client == this) g_xds_client = nullptr;
|
1796
|
+
}
|
1797
|
+
{
|
1798
|
+
MutexLock lock(&mu_);
|
1799
|
+
shutting_down_ = true;
|
1800
|
+
// Orphan ChannelState object.
|
1801
|
+
chand_.reset();
|
1802
|
+
// We do not clear cluster_map_ and endpoint_map_ if the xds client was
|
1803
|
+
// created by the XdsResolver because the maps contain refs for watchers
|
1804
|
+
// which in turn hold refs to the loadbalancing policies. At this point, it
|
1805
|
+
// is possible for ADS calls to be in progress. Unreffing the loadbalancing
|
1806
|
+
// policies before those calls are done would lead to issues such as
|
1807
|
+
// https://github.com/grpc/grpc/issues/20928.
|
1808
|
+
if (!listener_map_.empty()) {
|
1809
|
+
cluster_map_.clear();
|
1810
|
+
endpoint_map_.clear();
|
1811
|
+
}
|
1812
|
+
}
|
1813
|
+
}
|
1814
|
+
|
1815
|
+
void XdsClient::WatchListenerData(
|
1816
|
+
absl::string_view listener_name,
|
1817
|
+
std::unique_ptr<ListenerWatcherInterface> watcher) {
|
1818
|
+
std::string listener_name_str = std::string(listener_name);
|
1819
|
+
MutexLock lock(&mu_);
|
1820
|
+
ListenerState& listener_state = listener_map_[listener_name_str];
|
1821
|
+
ListenerWatcherInterface* w = watcher.get();
|
1822
|
+
listener_state.watchers[w] = std::move(watcher);
|
1823
|
+
// If we've already received an LDS update, notify the new watcher
|
1824
|
+
// immediately.
|
1825
|
+
if (listener_state.update.has_value()) {
|
1826
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1827
|
+
gpr_log(GPR_INFO, "[xds_client %p] returning cached listener data for %s",
|
1828
|
+
this, listener_name_str.c_str());
|
1829
|
+
}
|
1830
|
+
w->OnListenerChanged(*listener_state.update);
|
1831
|
+
}
|
1832
|
+
chand_->Subscribe(XdsApi::kLdsTypeUrl, listener_name_str);
|
1833
|
+
}
|
1834
|
+
|
1835
|
+
void XdsClient::CancelListenerDataWatch(absl::string_view listener_name,
|
1836
|
+
ListenerWatcherInterface* watcher,
|
1837
|
+
bool delay_unsubscription) {
|
1838
|
+
MutexLock lock(&mu_);
|
1839
|
+
if (shutting_down_) return;
|
1840
|
+
std::string listener_name_str = std::string(listener_name);
|
1841
|
+
ListenerState& listener_state = listener_map_[listener_name_str];
|
1842
|
+
auto it = listener_state.watchers.find(watcher);
|
1843
|
+
if (it != listener_state.watchers.end()) {
|
1844
|
+
listener_state.watchers.erase(it);
|
1845
|
+
if (listener_state.watchers.empty()) {
|
1846
|
+
listener_map_.erase(listener_name_str);
|
1847
|
+
chand_->Unsubscribe(XdsApi::kLdsTypeUrl, listener_name_str,
|
1848
|
+
delay_unsubscription);
|
1849
|
+
}
|
1850
|
+
}
|
1851
|
+
}
|
1852
|
+
|
1853
|
+
void XdsClient::WatchRouteConfigData(
|
1854
|
+
absl::string_view route_config_name,
|
1855
|
+
std::unique_ptr<RouteConfigWatcherInterface> watcher) {
|
1856
|
+
std::string route_config_name_str = std::string(route_config_name);
|
1857
|
+
MutexLock lock(&mu_);
|
1858
|
+
RouteConfigState& route_config_state =
|
1859
|
+
route_config_map_[route_config_name_str];
|
1860
|
+
RouteConfigWatcherInterface* w = watcher.get();
|
1861
|
+
route_config_state.watchers[w] = std::move(watcher);
|
1862
|
+
// If we've already received an RDS update, notify the new watcher
|
1863
|
+
// immediately.
|
1864
|
+
if (route_config_state.update.has_value()) {
|
1865
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1866
|
+
gpr_log(GPR_INFO,
|
1867
|
+
"[xds_client %p] returning cached route config data for %s", this,
|
1868
|
+
route_config_name_str.c_str());
|
1869
|
+
}
|
1870
|
+
w->OnRouteConfigChanged(*route_config_state.update);
|
1871
|
+
}
|
1872
|
+
chand_->Subscribe(XdsApi::kRdsTypeUrl, route_config_name_str);
|
1873
|
+
}
|
1874
|
+
|
1875
|
+
void XdsClient::CancelRouteConfigDataWatch(absl::string_view route_config_name,
|
1876
|
+
RouteConfigWatcherInterface* watcher,
|
1877
|
+
bool delay_unsubscription) {
|
1878
|
+
MutexLock lock(&mu_);
|
1879
|
+
if (shutting_down_) return;
|
1880
|
+
std::string route_config_name_str = std::string(route_config_name);
|
1881
|
+
RouteConfigState& route_config_state =
|
1882
|
+
route_config_map_[route_config_name_str];
|
1883
|
+
auto it = route_config_state.watchers.find(watcher);
|
1884
|
+
if (it != route_config_state.watchers.end()) {
|
1885
|
+
route_config_state.watchers.erase(it);
|
1886
|
+
if (route_config_state.watchers.empty()) {
|
1887
|
+
route_config_map_.erase(route_config_name_str);
|
1888
|
+
chand_->Unsubscribe(XdsApi::kRdsTypeUrl, route_config_name_str,
|
1889
|
+
delay_unsubscription);
|
1890
|
+
}
|
1834
1891
|
}
|
1835
|
-
Unref(DEBUG_LOCATION, "XdsClient::Orphan()");
|
1836
1892
|
}
|
1837
1893
|
|
1838
1894
|
void XdsClient::WatchClusterData(
|
1839
1895
|
absl::string_view cluster_name,
|
1840
1896
|
std::unique_ptr<ClusterWatcherInterface> watcher) {
|
1841
1897
|
std::string cluster_name_str = std::string(cluster_name);
|
1898
|
+
MutexLock lock(&mu_);
|
1842
1899
|
ClusterState& cluster_state = cluster_map_[cluster_name_str];
|
1843
1900
|
ClusterWatcherInterface* w = watcher.get();
|
1844
1901
|
cluster_state.watchers[w] = std::move(watcher);
|
1845
|
-
// If we've already received
|
1902
|
+
// If we've already received a CDS update, notify the new watcher
|
1846
1903
|
// immediately.
|
1847
1904
|
if (cluster_state.update.has_value()) {
|
1848
1905
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
@@ -1857,6 +1914,7 @@ void XdsClient::WatchClusterData(
|
|
1857
1914
|
void XdsClient::CancelClusterDataWatch(absl::string_view cluster_name,
|
1858
1915
|
ClusterWatcherInterface* watcher,
|
1859
1916
|
bool delay_unsubscription) {
|
1917
|
+
MutexLock lock(&mu_);
|
1860
1918
|
if (shutting_down_) return;
|
1861
1919
|
std::string cluster_name_str = std::string(cluster_name);
|
1862
1920
|
ClusterState& cluster_state = cluster_map_[cluster_name_str];
|
@@ -1875,6 +1933,7 @@ void XdsClient::WatchEndpointData(
|
|
1875
1933
|
absl::string_view eds_service_name,
|
1876
1934
|
std::unique_ptr<EndpointWatcherInterface> watcher) {
|
1877
1935
|
std::string eds_service_name_str = std::string(eds_service_name);
|
1936
|
+
MutexLock lock(&mu_);
|
1878
1937
|
EndpointState& endpoint_state = endpoint_map_[eds_service_name_str];
|
1879
1938
|
EndpointWatcherInterface* w = watcher.get();
|
1880
1939
|
endpoint_state.watchers[w] = std::move(watcher);
|
@@ -1893,6 +1952,7 @@ void XdsClient::WatchEndpointData(
|
|
1893
1952
|
void XdsClient::CancelEndpointDataWatch(absl::string_view eds_service_name,
|
1894
1953
|
EndpointWatcherInterface* watcher,
|
1895
1954
|
bool delay_unsubscription) {
|
1955
|
+
MutexLock lock(&mu_);
|
1896
1956
|
if (shutting_down_) return;
|
1897
1957
|
std::string eds_service_name_str = std::string(eds_service_name);
|
1898
1958
|
EndpointState& endpoint_state = endpoint_map_[eds_service_name_str];
|
@@ -1914,16 +1974,29 @@ RefCountedPtr<XdsClusterDropStats> XdsClient::AddClusterDropStats(
|
|
1914
1974
|
// server name specified in lrs_server.
|
1915
1975
|
auto key =
|
1916
1976
|
std::make_pair(std::string(cluster_name), std::string(eds_service_name));
|
1977
|
+
MutexLock lock(&mu_);
|
1917
1978
|
// We jump through some hoops here to make sure that the absl::string_views
|
1918
1979
|
// stored in the XdsClusterDropStats object point to the strings
|
1919
1980
|
// in the load_report_map_ key, so that they have the same lifetime.
|
1920
1981
|
auto it = load_report_map_
|
1921
1982
|
.emplace(std::make_pair(std::move(key), LoadReportState()))
|
1922
1983
|
.first;
|
1923
|
-
|
1924
|
-
|
1925
|
-
|
1926
|
-
|
1984
|
+
LoadReportState& load_report_state = it->second;
|
1985
|
+
RefCountedPtr<XdsClusterDropStats> cluster_drop_stats;
|
1986
|
+
if (load_report_state.drop_stats != nullptr) {
|
1987
|
+
cluster_drop_stats = load_report_state.drop_stats->RefIfNonZero();
|
1988
|
+
}
|
1989
|
+
if (cluster_drop_stats == nullptr) {
|
1990
|
+
if (load_report_state.drop_stats != nullptr) {
|
1991
|
+
load_report_state.deleted_drop_stats +=
|
1992
|
+
load_report_state.drop_stats->GetSnapshotAndReset();
|
1993
|
+
}
|
1994
|
+
cluster_drop_stats = MakeRefCounted<XdsClusterDropStats>(
|
1995
|
+
Ref(DEBUG_LOCATION, "DropStats"), lrs_server,
|
1996
|
+
it->first.first /*cluster_name*/,
|
1997
|
+
it->first.second /*eds_service_name*/);
|
1998
|
+
load_report_state.drop_stats = cluster_drop_stats.get();
|
1999
|
+
}
|
1927
2000
|
chand_->MaybeStartLrsCall();
|
1928
2001
|
return cluster_drop_stats;
|
1929
2002
|
}
|
@@ -1932,20 +2005,19 @@ void XdsClient::RemoveClusterDropStats(
|
|
1932
2005
|
absl::string_view /*lrs_server*/, absl::string_view cluster_name,
|
1933
2006
|
absl::string_view eds_service_name,
|
1934
2007
|
XdsClusterDropStats* cluster_drop_stats) {
|
1935
|
-
|
1936
|
-
std::make_pair(std::string(cluster_name), std::string(eds_service_name)));
|
1937
|
-
if (load_report_it == load_report_map_.end()) return;
|
1938
|
-
LoadReportState& load_report_state = load_report_it->second;
|
2008
|
+
MutexLock lock(&mu_);
|
1939
2009
|
// TODO(roth): When we add support for direct federation, use the
|
1940
2010
|
// server name specified in lrs_server.
|
1941
|
-
auto it =
|
1942
|
-
|
1943
|
-
|
2011
|
+
auto it = load_report_map_.find(
|
2012
|
+
std::make_pair(std::string(cluster_name), std::string(eds_service_name)));
|
2013
|
+
if (it == load_report_map_.end()) return;
|
2014
|
+
LoadReportState& load_report_state = it->second;
|
2015
|
+
if (load_report_state.drop_stats == cluster_drop_stats) {
|
2016
|
+
// Record final snapshot in deleted_drop_stats, which will be
|
1944
2017
|
// added to the next load report.
|
1945
|
-
|
1946
|
-
|
1947
|
-
|
1948
|
-
load_report_state.drop_stats.erase(it);
|
2018
|
+
load_report_state.deleted_drop_stats +=
|
2019
|
+
load_report_state.drop_stats->GetSnapshotAndReset();
|
2020
|
+
load_report_state.drop_stats = nullptr;
|
1949
2021
|
}
|
1950
2022
|
}
|
1951
2023
|
|
@@ -1957,18 +2029,31 @@ RefCountedPtr<XdsClusterLocalityStats> XdsClient::AddClusterLocalityStats(
|
|
1957
2029
|
// server name specified in lrs_server.
|
1958
2030
|
auto key =
|
1959
2031
|
std::make_pair(std::string(cluster_name), std::string(eds_service_name));
|
2032
|
+
MutexLock lock(&mu_);
|
1960
2033
|
// We jump through some hoops here to make sure that the absl::string_views
|
1961
2034
|
// stored in the XdsClusterLocalityStats object point to the strings
|
1962
2035
|
// in the load_report_map_ key, so that they have the same lifetime.
|
1963
2036
|
auto it = load_report_map_
|
1964
2037
|
.emplace(std::make_pair(std::move(key), LoadReportState()))
|
1965
2038
|
.first;
|
1966
|
-
|
1967
|
-
|
1968
|
-
|
1969
|
-
|
1970
|
-
|
1971
|
-
|
2039
|
+
LoadReportState& load_report_state = it->second;
|
2040
|
+
LoadReportState::LocalityState& locality_state =
|
2041
|
+
load_report_state.locality_stats[locality];
|
2042
|
+
RefCountedPtr<XdsClusterLocalityStats> cluster_locality_stats;
|
2043
|
+
if (locality_state.locality_stats != nullptr) {
|
2044
|
+
cluster_locality_stats = locality_state.locality_stats->RefIfNonZero();
|
2045
|
+
}
|
2046
|
+
if (cluster_locality_stats == nullptr) {
|
2047
|
+
if (locality_state.locality_stats != nullptr) {
|
2048
|
+
locality_state.deleted_locality_stats +=
|
2049
|
+
locality_state.locality_stats->GetSnapshotAndReset();
|
2050
|
+
}
|
2051
|
+
cluster_locality_stats = MakeRefCounted<XdsClusterLocalityStats>(
|
2052
|
+
Ref(DEBUG_LOCATION, "LocalityStats"), lrs_server,
|
2053
|
+
it->first.first /*cluster_name*/, it->first.second /*eds_service_name*/,
|
2054
|
+
std::move(locality));
|
2055
|
+
locality_state.locality_stats = cluster_locality_stats.get();
|
2056
|
+
}
|
1972
2057
|
chand_->MaybeStartLrsCall();
|
1973
2058
|
return cluster_locality_stats;
|
1974
2059
|
}
|
@@ -1978,349 +2063,65 @@ void XdsClient::RemoveClusterLocalityStats(
|
|
1978
2063
|
absl::string_view eds_service_name,
|
1979
2064
|
const RefCountedPtr<XdsLocalityName>& locality,
|
1980
2065
|
XdsClusterLocalityStats* cluster_locality_stats) {
|
1981
|
-
|
1982
|
-
std::make_pair(std::string(cluster_name), std::string(eds_service_name)));
|
1983
|
-
if (load_report_it == load_report_map_.end()) return;
|
1984
|
-
LoadReportState& load_report_state = load_report_it->second;
|
2066
|
+
MutexLock lock(&mu_);
|
1985
2067
|
// TODO(roth): When we add support for direct federation, use the
|
1986
2068
|
// server name specified in lrs_server.
|
2069
|
+
auto it = load_report_map_.find(
|
2070
|
+
std::make_pair(std::string(cluster_name), std::string(eds_service_name)));
|
2071
|
+
if (it == load_report_map_.end()) return;
|
2072
|
+
LoadReportState& load_report_state = it->second;
|
1987
2073
|
auto locality_it = load_report_state.locality_stats.find(locality);
|
1988
2074
|
if (locality_it == load_report_state.locality_stats.end()) return;
|
1989
|
-
|
1990
|
-
|
1991
|
-
if (it != locality_set.end()) {
|
2075
|
+
LoadReportState::LocalityState& locality_state = locality_it->second;
|
2076
|
+
if (locality_state.locality_stats == cluster_locality_stats) {
|
1992
2077
|
// Record final snapshot in deleted_locality_stats, which will be
|
1993
2078
|
// added to the next load report.
|
1994
|
-
|
1995
|
-
|
1996
|
-
|
2079
|
+
locality_state.deleted_locality_stats +=
|
2080
|
+
locality_state.locality_stats->GetSnapshotAndReset();
|
2081
|
+
locality_state.locality_stats = nullptr;
|
1997
2082
|
}
|
1998
2083
|
}
|
1999
2084
|
|
2000
2085
|
void XdsClient::ResetBackoff() {
|
2086
|
+
MutexLock lock(&mu_);
|
2001
2087
|
if (chand_ != nullptr) {
|
2002
2088
|
grpc_channel_reset_connect_backoff(chand_->channel());
|
2003
2089
|
}
|
2004
2090
|
}
|
2005
2091
|
|
2006
|
-
|
2007
|
-
|
2008
|
-
|
2009
|
-
|
2010
|
-
|
2011
|
-
" \"cds_experimental\":{\n"
|
2012
|
-
" \"cluster\": \"%s\"\n"
|
2013
|
-
" }\n"
|
2014
|
-
" } ]\n"
|
2015
|
-
" }",
|
2016
|
-
cluster_name, cluster_name);
|
2017
|
-
}
|
2018
|
-
|
2019
|
-
std::string CreateServiceConfigRoute(const std::string& action_name,
|
2020
|
-
const XdsApi::RdsUpdate::RdsRoute& route) {
|
2021
|
-
std::vector<std::string> headers;
|
2022
|
-
for (const auto& header : route.matchers.header_matchers) {
|
2023
|
-
std::string header_matcher;
|
2024
|
-
switch (header.type) {
|
2025
|
-
case XdsApi::RdsUpdate::RdsRoute::Matchers::HeaderMatcher::
|
2026
|
-
HeaderMatcherType::EXACT:
|
2027
|
-
header_matcher = absl::StrFormat(" \"exact_match\": \"%s\"",
|
2028
|
-
header.string_matcher);
|
2029
|
-
break;
|
2030
|
-
case XdsApi::RdsUpdate::RdsRoute::Matchers::HeaderMatcher::
|
2031
|
-
HeaderMatcherType::REGEX:
|
2032
|
-
header_matcher = absl::StrFormat(" \"regex_match\": \"%s\"",
|
2033
|
-
header.regex_match->pattern());
|
2034
|
-
break;
|
2035
|
-
case XdsApi::RdsUpdate::RdsRoute::Matchers::HeaderMatcher::
|
2036
|
-
HeaderMatcherType::RANGE:
|
2037
|
-
header_matcher = absl::StrFormat(
|
2038
|
-
" \"range_match\":{\n"
|
2039
|
-
" \"start\":%d,\n"
|
2040
|
-
" \"end\":%d\n"
|
2041
|
-
" }",
|
2042
|
-
header.range_start, header.range_end);
|
2043
|
-
break;
|
2044
|
-
case XdsApi::RdsUpdate::RdsRoute::Matchers::HeaderMatcher::
|
2045
|
-
HeaderMatcherType::PRESENT:
|
2046
|
-
header_matcher =
|
2047
|
-
absl::StrFormat(" \"present_match\": %s",
|
2048
|
-
header.present_match ? "true" : "false");
|
2049
|
-
break;
|
2050
|
-
case XdsApi::RdsUpdate::RdsRoute::Matchers::HeaderMatcher::
|
2051
|
-
HeaderMatcherType::PREFIX:
|
2052
|
-
header_matcher = absl::StrFormat(
|
2053
|
-
" \"prefix_match\": \"%s\"", header.string_matcher);
|
2054
|
-
break;
|
2055
|
-
case XdsApi::RdsUpdate::RdsRoute::Matchers::HeaderMatcher::
|
2056
|
-
HeaderMatcherType::SUFFIX:
|
2057
|
-
header_matcher = absl::StrFormat(
|
2058
|
-
" \"suffix_match\": \"%s\"", header.string_matcher);
|
2059
|
-
break;
|
2060
|
-
default:
|
2061
|
-
break;
|
2062
|
-
}
|
2063
|
-
std::vector<std::string> header_parts;
|
2064
|
-
header_parts.push_back(
|
2065
|
-
absl::StrFormat(" { \n"
|
2066
|
-
" \"name\": \"%s\",\n",
|
2067
|
-
header.name));
|
2068
|
-
header_parts.push_back(header_matcher);
|
2069
|
-
if (header.invert_match) {
|
2070
|
-
header_parts.push_back(
|
2071
|
-
absl::StrFormat(",\n"
|
2072
|
-
" \"invert_match\": true"));
|
2092
|
+
void XdsClient::NotifyOnErrorLocked(grpc_error* error) {
|
2093
|
+
for (const auto& p : listener_map_) {
|
2094
|
+
const ListenerState& listener_state = p.second;
|
2095
|
+
for (const auto& p : listener_state.watchers) {
|
2096
|
+
p.first->OnError(GRPC_ERROR_REF(error));
|
2073
2097
|
}
|
2074
|
-
header_parts.push_back(
|
2075
|
-
absl::StrFormat("\n"
|
2076
|
-
" }"));
|
2077
|
-
headers.push_back(absl::StrJoin(header_parts, ""));
|
2078
|
-
}
|
2079
|
-
std::vector<std::string> headers_service_config;
|
2080
|
-
if (!headers.empty()) {
|
2081
|
-
headers_service_config.push_back("\"headers\":[\n");
|
2082
|
-
headers_service_config.push_back(absl::StrJoin(headers, ","));
|
2083
|
-
headers_service_config.push_back(" ],\n");
|
2084
|
-
}
|
2085
|
-
std::string path_match_str;
|
2086
|
-
switch (route.matchers.path_matcher.type) {
|
2087
|
-
case XdsApi::RdsUpdate::RdsRoute::Matchers::PathMatcher::PathMatcherType::
|
2088
|
-
PREFIX:
|
2089
|
-
path_match_str = absl::StrFormat(
|
2090
|
-
"\"prefix\": \"%s\",\n", route.matchers.path_matcher.string_matcher);
|
2091
|
-
break;
|
2092
|
-
case XdsApi::RdsUpdate::RdsRoute::Matchers::PathMatcher::PathMatcherType::
|
2093
|
-
PATH:
|
2094
|
-
path_match_str = absl::StrFormat(
|
2095
|
-
"\"path\": \"%s\",\n", route.matchers.path_matcher.string_matcher);
|
2096
|
-
break;
|
2097
|
-
case XdsApi::RdsUpdate::RdsRoute::Matchers::PathMatcher::PathMatcherType::
|
2098
|
-
REGEX:
|
2099
|
-
path_match_str =
|
2100
|
-
absl::StrFormat("\"regex\": \"%s\",\n",
|
2101
|
-
route.matchers.path_matcher.regex_matcher->pattern());
|
2102
|
-
break;
|
2103
|
-
}
|
2104
|
-
return absl::StrFormat(
|
2105
|
-
" { \n"
|
2106
|
-
" %s"
|
2107
|
-
" %s"
|
2108
|
-
" %s"
|
2109
|
-
" \"action\": \"%s\"\n"
|
2110
|
-
" }",
|
2111
|
-
path_match_str, absl::StrJoin(headers_service_config, ""),
|
2112
|
-
route.matchers.fraction_per_million.has_value()
|
2113
|
-
? absl::StrFormat("\"match_fraction\":%d,\n",
|
2114
|
-
route.matchers.fraction_per_million.value())
|
2115
|
-
: "",
|
2116
|
-
action_name);
|
2117
|
-
}
|
2118
|
-
|
2119
|
-
// Create the service config for one weighted cluster.
|
2120
|
-
std::string CreateServiceConfigActionWeightedCluster(
|
2121
|
-
const std::string& name,
|
2122
|
-
const std::vector<XdsApi::RdsUpdate::RdsRoute::ClusterWeight>& clusters) {
|
2123
|
-
std::vector<std::string> config_parts;
|
2124
|
-
config_parts.push_back(
|
2125
|
-
absl::StrFormat(" \"weighted:%s\":{\n"
|
2126
|
-
" \"childPolicy\":[ {\n"
|
2127
|
-
" \"weighted_target_experimental\":{\n"
|
2128
|
-
" \"targets\":{\n",
|
2129
|
-
name));
|
2130
|
-
std::vector<std::string> weighted_targets;
|
2131
|
-
weighted_targets.reserve(clusters.size());
|
2132
|
-
for (const auto& cluster_weight : clusters) {
|
2133
|
-
weighted_targets.push_back(absl::StrFormat(
|
2134
|
-
" \"%s\":{\n"
|
2135
|
-
" \"weight\":%d,\n"
|
2136
|
-
" \"childPolicy\":[ {\n"
|
2137
|
-
" \"cds_experimental\":{\n"
|
2138
|
-
" \"cluster\": \"%s\"\n"
|
2139
|
-
" }\n"
|
2140
|
-
" } ]\n"
|
2141
|
-
" }",
|
2142
|
-
cluster_weight.name, cluster_weight.weight, cluster_weight.name));
|
2143
|
-
}
|
2144
|
-
config_parts.push_back(absl::StrJoin(weighted_targets, ",\n"));
|
2145
|
-
config_parts.push_back(
|
2146
|
-
" }\n"
|
2147
|
-
" }\n"
|
2148
|
-
" } ]\n"
|
2149
|
-
" }");
|
2150
|
-
return absl::StrJoin(config_parts, "");
|
2151
|
-
}
|
2152
|
-
|
2153
|
-
struct WeightedClustersKeys {
|
2154
|
-
std::string cluster_names_key;
|
2155
|
-
std::string cluster_weights_key;
|
2156
|
-
};
|
2157
|
-
|
2158
|
-
// Returns the cluster names and weights key or the cluster names only key.
|
2159
|
-
WeightedClustersKeys GetWeightedClustersKey(
|
2160
|
-
const std::vector<XdsApi::RdsUpdate::RdsRoute::ClusterWeight>&
|
2161
|
-
weighted_clusters) {
|
2162
|
-
std::set<std::string> cluster_names;
|
2163
|
-
std::set<std::string> cluster_weights;
|
2164
|
-
for (const auto& cluster_weight : weighted_clusters) {
|
2165
|
-
cluster_names.emplace(absl::StrFormat("%s", cluster_weight.name));
|
2166
|
-
cluster_weights.emplace(
|
2167
|
-
absl::StrFormat("%s_%d", cluster_weight.name, cluster_weight.weight));
|
2168
2098
|
}
|
2169
|
-
|
2170
|
-
|
2171
|
-
|
2172
|
-
|
2173
|
-
} // namespace
|
2174
|
-
|
2175
|
-
std::string XdsClient::WeightedClustersActionName(
|
2176
|
-
const std::vector<XdsApi::RdsUpdate::RdsRoute::ClusterWeight>&
|
2177
|
-
weighted_clusters) {
|
2178
|
-
WeightedClustersKeys keys = GetWeightedClustersKey(weighted_clusters);
|
2179
|
-
auto cluster_names_map_it =
|
2180
|
-
weighted_cluster_index_map_.find(keys.cluster_names_key);
|
2181
|
-
GPR_ASSERT(cluster_names_map_it != weighted_cluster_index_map_.end());
|
2182
|
-
const auto& cluster_weights_map =
|
2183
|
-
cluster_names_map_it->second.cluster_weights_map;
|
2184
|
-
auto cluster_weights_map_it =
|
2185
|
-
cluster_weights_map.find(keys.cluster_weights_key);
|
2186
|
-
GPR_ASSERT(cluster_weights_map_it != cluster_weights_map.end());
|
2187
|
-
return absl::StrFormat("%s_%d", keys.cluster_names_key,
|
2188
|
-
cluster_weights_map_it->second);
|
2189
|
-
}
|
2190
|
-
|
2191
|
-
void XdsClient::UpdateWeightedClusterIndexMap(
|
2192
|
-
const XdsApi::RdsUpdate& rds_update) {
|
2193
|
-
// Construct a list of unique WeightedCluster
|
2194
|
-
// actions which we need to process: to find action names
|
2195
|
-
std::map<std::string /* cluster_weights_key */,
|
2196
|
-
std::string /* cluster_names_key */>
|
2197
|
-
actions_to_process;
|
2198
|
-
for (const auto& route : rds_update.routes) {
|
2199
|
-
if (!route.weighted_clusters.empty()) {
|
2200
|
-
WeightedClustersKeys keys =
|
2201
|
-
GetWeightedClustersKey(route.weighted_clusters);
|
2202
|
-
auto action_it = actions_to_process.find(keys.cluster_weights_key);
|
2203
|
-
if (action_it == actions_to_process.end()) {
|
2204
|
-
actions_to_process[std::move(keys.cluster_weights_key)] =
|
2205
|
-
std::move(keys.cluster_names_key);
|
2206
|
-
}
|
2099
|
+
for (const auto& p : route_config_map_) {
|
2100
|
+
const RouteConfigState& route_config_state = p.second;
|
2101
|
+
for (const auto& p : route_config_state.watchers) {
|
2102
|
+
p.first->OnError(GRPC_ERROR_REF(error));
|
2207
2103
|
}
|
2208
2104
|
}
|
2209
|
-
|
2210
|
-
|
2211
|
-
|
2212
|
-
|
2213
|
-
// reuse.
|
2214
|
-
XdsClient::WeightedClusterIndexMap new_weighted_cluster_index_map;
|
2215
|
-
for (auto action_it = actions_to_process.begin();
|
2216
|
-
action_it != actions_to_process.end();) {
|
2217
|
-
const std::string& cluster_names_key = action_it->second;
|
2218
|
-
const std::string& cluster_weights_key = action_it->first;
|
2219
|
-
auto old_cluster_names_map_it =
|
2220
|
-
weighted_cluster_index_map_.find(cluster_names_key);
|
2221
|
-
if (old_cluster_names_map_it != weighted_cluster_index_map_.end()) {
|
2222
|
-
// Add cluster_names_key to the new map and copy next_index.
|
2223
|
-
auto& new_cluster_names_info =
|
2224
|
-
new_weighted_cluster_index_map[cluster_names_key];
|
2225
|
-
new_cluster_names_info.next_index =
|
2226
|
-
old_cluster_names_map_it->second.next_index;
|
2227
|
-
// Lookup cluster_weights_key in old map.
|
2228
|
-
auto& old_cluster_weights_map =
|
2229
|
-
old_cluster_names_map_it->second.cluster_weights_map;
|
2230
|
-
auto old_cluster_weights_map_it =
|
2231
|
-
old_cluster_weights_map.find(cluster_weights_key);
|
2232
|
-
if (old_cluster_weights_map_it != old_cluster_weights_map.end()) {
|
2233
|
-
// same policy found, move from old map to new map.
|
2234
|
-
new_cluster_names_info.cluster_weights_map[cluster_weights_key] =
|
2235
|
-
old_cluster_weights_map_it->second;
|
2236
|
-
old_cluster_weights_map.erase(old_cluster_weights_map_it);
|
2237
|
-
// This action has been added to new map, so no need to process it
|
2238
|
-
// again.
|
2239
|
-
action_it = actions_to_process.erase(action_it);
|
2240
|
-
continue;
|
2241
|
-
}
|
2242
|
-
}
|
2243
|
-
++action_it;
|
2244
|
-
}
|
2245
|
-
// Second pass of all remaining unique WeightedCluster actions: if clusters
|
2246
|
-
// for a new action are the same as an old unused action, reuse the name. If
|
2247
|
-
// clusters differ, use a brand new name.
|
2248
|
-
for (const auto& action : actions_to_process) {
|
2249
|
-
const std::string& cluster_names_key = action.second;
|
2250
|
-
const std::string& cluster_weights_key = action.first;
|
2251
|
-
auto& new_cluster_names_info =
|
2252
|
-
new_weighted_cluster_index_map[cluster_names_key];
|
2253
|
-
auto& old_cluster_weights_map =
|
2254
|
-
weighted_cluster_index_map_[cluster_names_key].cluster_weights_map;
|
2255
|
-
auto old_cluster_weights_it = old_cluster_weights_map.begin();
|
2256
|
-
if (old_cluster_weights_it != old_cluster_weights_map.end()) {
|
2257
|
-
// There is something to reuse: this action uses the same set
|
2258
|
-
// of clusters as a previous action and that action name is not
|
2259
|
-
// already taken.
|
2260
|
-
new_cluster_names_info.cluster_weights_map[cluster_weights_key] =
|
2261
|
-
old_cluster_weights_it->second;
|
2262
|
-
// Remove the name from being able to reuse again.
|
2263
|
-
old_cluster_weights_map.erase(old_cluster_weights_it);
|
2264
|
-
} else {
|
2265
|
-
// There is nothing to reuse, take the next index to use and
|
2266
|
-
// increment.
|
2267
|
-
new_cluster_names_info.cluster_weights_map[cluster_weights_key] =
|
2268
|
-
new_cluster_names_info.next_index++;
|
2105
|
+
for (const auto& p : cluster_map_) {
|
2106
|
+
const ClusterState& cluster_state = p.second;
|
2107
|
+
for (const auto& p : cluster_state.watchers) {
|
2108
|
+
p.first->OnError(GRPC_ERROR_REF(error));
|
2269
2109
|
}
|
2270
2110
|
}
|
2271
|
-
|
2272
|
-
|
2273
|
-
|
2274
|
-
|
2275
|
-
const XdsApi::RdsUpdate& rds_update,
|
2276
|
-
RefCountedPtr<ServiceConfig>* service_config) {
|
2277
|
-
UpdateWeightedClusterIndexMap(rds_update);
|
2278
|
-
std::vector<std::string> actions_vector;
|
2279
|
-
std::vector<std::string> route_table;
|
2280
|
-
std::set<std::string> actions_set;
|
2281
|
-
for (const auto& route : rds_update.routes) {
|
2282
|
-
const std::string action_name =
|
2283
|
-
route.weighted_clusters.empty()
|
2284
|
-
? route.cluster_name
|
2285
|
-
: WeightedClustersActionName(route.weighted_clusters);
|
2286
|
-
if (actions_set.find(action_name) == actions_set.end()) {
|
2287
|
-
actions_set.emplace(action_name);
|
2288
|
-
actions_vector.push_back(
|
2289
|
-
route.weighted_clusters.empty()
|
2290
|
-
? CreateServiceConfigActionCluster(action_name)
|
2291
|
-
: CreateServiceConfigActionWeightedCluster(
|
2292
|
-
action_name, route.weighted_clusters));
|
2111
|
+
for (const auto& p : endpoint_map_) {
|
2112
|
+
const EndpointState& endpoint_state = p.second;
|
2113
|
+
for (const auto& p : endpoint_state.watchers) {
|
2114
|
+
p.first->OnError(GRPC_ERROR_REF(error));
|
2293
2115
|
}
|
2294
|
-
|
2295
|
-
|
2296
|
-
|
2297
|
-
|
2298
|
-
|
2299
|
-
}
|
2300
|
-
std::vector<std::string> config_parts;
|
2301
|
-
config_parts.push_back(
|
2302
|
-
"{\n"
|
2303
|
-
" \"loadBalancingConfig\":[\n"
|
2304
|
-
" { \"xds_routing_experimental\":{\n"
|
2305
|
-
" \"actions\":{\n");
|
2306
|
-
config_parts.push_back(absl::StrJoin(actions_vector, ",\n"));
|
2307
|
-
config_parts.push_back(
|
2308
|
-
" },\n"
|
2309
|
-
" \"routes\":[\n");
|
2310
|
-
config_parts.push_back(absl::StrJoin(route_table, ",\n"));
|
2311
|
-
config_parts.push_back(
|
2312
|
-
" ]\n"
|
2313
|
-
" } }\n"
|
2314
|
-
" ]\n"
|
2315
|
-
"}");
|
2316
|
-
std::string json = absl::StrJoin(config_parts, "");
|
2317
|
-
grpc_error* error = GRPC_ERROR_NONE;
|
2318
|
-
*service_config = ServiceConfig::Create(json.c_str(), &error);
|
2319
|
-
return error;
|
2320
|
-
}
|
2321
|
-
|
2322
|
-
XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshot(
|
2116
|
+
}
|
2117
|
+
GRPC_ERROR_UNREF(error);
|
2118
|
+
}
|
2119
|
+
|
2120
|
+
XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked(
|
2323
2121
|
bool send_all_clusters, const std::set<std::string>& clusters) {
|
2122
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2123
|
+
gpr_log(GPR_INFO, "[xds_client %p] start building load report", this);
|
2124
|
+
}
|
2324
2125
|
XdsApi::ClusterLoadReportMap snapshot_map;
|
2325
2126
|
for (auto load_report_it = load_report_map_.begin();
|
2326
2127
|
load_report_it != load_report_map_.end();) {
|
@@ -2339,9 +2140,14 @@ XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshot(
|
|
2339
2140
|
XdsApi::ClusterLoadReport snapshot;
|
2340
2141
|
// Aggregate drop stats.
|
2341
2142
|
snapshot.dropped_requests = std::move(load_report.deleted_drop_stats);
|
2342
|
-
|
2343
|
-
|
2344
|
-
|
2143
|
+
if (load_report.drop_stats != nullptr) {
|
2144
|
+
snapshot.dropped_requests +=
|
2145
|
+
load_report.drop_stats->GetSnapshotAndReset();
|
2146
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2147
|
+
gpr_log(GPR_INFO,
|
2148
|
+
"[xds_client %p] cluster=%s eds_service_name=%s drop_stats=%p",
|
2149
|
+
this, cluster_key.first.c_str(), cluster_key.second.c_str(),
|
2150
|
+
load_report.drop_stats);
|
2345
2151
|
}
|
2346
2152
|
}
|
2347
2153
|
// Aggregate locality stats.
|
@@ -2351,34 +2157,39 @@ XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshot(
|
|
2351
2157
|
auto& locality_state = it->second;
|
2352
2158
|
XdsClusterLocalityStats::Snapshot& locality_snapshot =
|
2353
2159
|
snapshot.locality_stats[locality_name];
|
2354
|
-
|
2355
|
-
|
2356
|
-
|
2357
|
-
|
2358
|
-
|
2359
|
-
|
2360
|
-
|
2160
|
+
locality_snapshot = std::move(locality_state.deleted_locality_stats);
|
2161
|
+
if (locality_state.locality_stats != nullptr) {
|
2162
|
+
locality_snapshot +=
|
2163
|
+
locality_state.locality_stats->GetSnapshotAndReset();
|
2164
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2165
|
+
gpr_log(GPR_INFO,
|
2166
|
+
"[xds_client %p] cluster=%s eds_service_name=%s "
|
2167
|
+
"locality=%s locality_stats=%p",
|
2168
|
+
this, cluster_key.first.c_str(), cluster_key.second.c_str(),
|
2169
|
+
locality_name->AsHumanReadableString().c_str(),
|
2170
|
+
locality_state.locality_stats);
|
2171
|
+
}
|
2361
2172
|
}
|
2362
|
-
locality_state.deleted_locality_stats.clear();
|
2363
2173
|
// If the only thing left in this entry was final snapshots from
|
2364
2174
|
// deleted locality stats objects, remove the entry.
|
2365
|
-
if (locality_state.locality_stats
|
2175
|
+
if (locality_state.locality_stats == nullptr) {
|
2366
2176
|
it = load_report.locality_stats.erase(it);
|
2367
2177
|
} else {
|
2368
2178
|
++it;
|
2369
2179
|
}
|
2370
2180
|
}
|
2181
|
+
// Compute load report interval.
|
2182
|
+
const grpc_millis now = ExecCtx::Get()->Now();
|
2183
|
+
snapshot.load_report_interval = now - load_report.last_report_time;
|
2184
|
+
load_report.last_report_time = now;
|
2185
|
+
// Record snapshot.
|
2371
2186
|
if (record_stats) {
|
2372
|
-
// Compute load report interval.
|
2373
|
-
const grpc_millis now = ExecCtx::Get()->Now();
|
2374
|
-
snapshot.load_report_interval = now - load_report.last_report_time;
|
2375
|
-
load_report.last_report_time = now;
|
2376
|
-
// Record snapshot.
|
2377
2187
|
snapshot_map[cluster_key] = std::move(snapshot);
|
2378
2188
|
}
|
2379
2189
|
// If the only thing left in this entry was final snapshots from
|
2380
2190
|
// deleted stats objects, remove the entry.
|
2381
|
-
if (load_report.locality_stats.empty() &&
|
2191
|
+
if (load_report.locality_stats.empty() &&
|
2192
|
+
load_report.drop_stats == nullptr) {
|
2382
2193
|
load_report_it = load_report_map_.erase(load_report_it);
|
2383
2194
|
} else {
|
2384
2195
|
++load_report_it;
|
@@ -2387,60 +2198,40 @@ XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshot(
|
|
2387
2198
|
return snapshot_map;
|
2388
2199
|
}
|
2389
2200
|
|
2390
|
-
|
2391
|
-
|
2392
|
-
|
2393
|
-
}
|
2394
|
-
for (const auto& p : cluster_map_) {
|
2395
|
-
const ClusterState& cluster_state = p.second;
|
2396
|
-
for (const auto& p : cluster_state.watchers) {
|
2397
|
-
p.first->OnError(GRPC_ERROR_REF(error));
|
2398
|
-
}
|
2399
|
-
}
|
2400
|
-
for (const auto& p : endpoint_map_) {
|
2401
|
-
const EndpointState& endpoint_state = p.second;
|
2402
|
-
for (const auto& p : endpoint_state.watchers) {
|
2403
|
-
p.first->OnError(GRPC_ERROR_REF(error));
|
2404
|
-
}
|
2405
|
-
}
|
2406
|
-
GRPC_ERROR_UNREF(error);
|
2407
|
-
}
|
2201
|
+
//
|
2202
|
+
// accessors for global state
|
2203
|
+
//
|
2408
2204
|
|
2409
|
-
void
|
2410
|
-
XdsClient* xds_client = static_cast<XdsClient*>(p);
|
2411
|
-
xds_client->Ref(DEBUG_LOCATION, "channel arg").release();
|
2412
|
-
return p;
|
2413
|
-
}
|
2205
|
+
void XdsClientGlobalInit() { g_mu = new Mutex; }
|
2414
2206
|
|
2415
|
-
void
|
2416
|
-
|
2417
|
-
|
2207
|
+
void XdsClientGlobalShutdown() {
|
2208
|
+
delete g_mu;
|
2209
|
+
g_mu = nullptr;
|
2418
2210
|
}
|
2419
2211
|
|
2420
|
-
|
2212
|
+
RefCountedPtr<XdsClient> XdsClient::GetOrCreate(grpc_error** error) {
|
2213
|
+
MutexLock lock(g_mu);
|
2214
|
+
if (g_xds_client != nullptr) {
|
2215
|
+
auto xds_client = g_xds_client->RefIfNonZero();
|
2216
|
+
if (xds_client != nullptr) return xds_client;
|
2217
|
+
}
|
2218
|
+
auto xds_client = MakeRefCounted<XdsClient>(error);
|
2219
|
+
g_xds_client = xds_client.get();
|
2220
|
+
return xds_client;
|
2221
|
+
}
|
2421
2222
|
|
2422
|
-
|
2423
|
-
XdsClient::ChannelArgCopy, XdsClient::ChannelArgDestroy,
|
2424
|
-
XdsClient::ChannelArgCmp};
|
2223
|
+
namespace internal {
|
2425
2224
|
|
2426
|
-
|
2427
|
-
|
2428
|
-
|
2429
|
-
&XdsClient::kXdsClientVtable);
|
2225
|
+
void SetXdsChannelArgsForTest(grpc_channel_args* args) {
|
2226
|
+
MutexLock lock(g_mu);
|
2227
|
+
g_channel_args = args;
|
2430
2228
|
}
|
2431
2229
|
|
2432
|
-
|
2433
|
-
|
2434
|
-
|
2435
|
-
grpc_channel_args_find_pointer<XdsClient>(&args, GRPC_ARG_XDS_CLIENT);
|
2436
|
-
if (xds_client != nullptr) return xds_client->Ref();
|
2437
|
-
return nullptr;
|
2230
|
+
void UnsetGlobalXdsClientForTest() {
|
2231
|
+
MutexLock lock(g_mu);
|
2232
|
+
g_xds_client = nullptr;
|
2438
2233
|
}
|
2439
2234
|
|
2440
|
-
|
2441
|
-
const grpc_channel_args& args) {
|
2442
|
-
const char* arg_name = GRPC_ARG_XDS_CLIENT;
|
2443
|
-
return grpc_channel_args_copy_and_remove(&args, &arg_name, 1);
|
2444
|
-
}
|
2235
|
+
} // namespace internal
|
2445
2236
|
|
2446
2237
|
} // namespace grpc_core
|