grpc 1.41.1 → 1.44.0.pre2
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 +185 -102
- data/include/grpc/event_engine/event_engine.h +118 -54
- data/include/grpc/event_engine/internal/memory_allocator_impl.h +68 -0
- data/include/grpc/event_engine/memory_allocator.h +226 -0
- data/include/grpc/event_engine/memory_request.h +57 -0
- data/include/grpc/grpc.h +4 -0
- data/include/grpc/grpc_security.h +304 -145
- data/include/grpc/grpc_security_constants.h +2 -14
- data/include/grpc/impl/codegen/compression_types.h +0 -2
- data/include/grpc/impl/codegen/grpc_types.h +6 -0
- data/include/grpc/impl/codegen/port_platform.h +14 -3
- data/src/core/ext/filters/client_channel/backend_metric.cc +21 -23
- data/src/core/ext/filters/client_channel/backend_metric.h +4 -3
- data/src/core/ext/filters/client_channel/backup_poller.cc +2 -1
- data/src/core/ext/filters/client_channel/channel_connectivity.cc +71 -89
- data/src/core/ext/filters/client_channel/client_channel.cc +305 -335
- data/src/core/ext/filters/client_channel/client_channel.h +84 -36
- data/src/core/ext/filters/client_channel/client_channel_factory.cc +1 -1
- data/src/core/ext/filters/client_channel/client_channel_factory.h +17 -19
- data/src/core/ext/filters/client_channel/client_channel_plugin.cc +8 -15
- data/src/core/ext/filters/client_channel/config_selector.cc +1 -1
- data/src/core/ext/filters/client_channel/config_selector.h +5 -6
- data/src/core/ext/filters/client_channel/connector.h +18 -18
- data/src/core/ext/filters/client_channel/dynamic_filters.cc +5 -5
- data/src/core/ext/filters/client_channel/dynamic_filters.h +1 -1
- data/src/core/ext/filters/client_channel/global_subchannel_pool.h +0 -1
- data/src/core/ext/filters/client_channel/health/health_check_client.cc +25 -22
- 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 +13 -15
- data/src/core/ext/filters/client_channel/http_connect_handshaker.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc +4 -3
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.h +6 -5
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc +4 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +5 -18
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +198 -116
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h +3 -6
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc +1 -2
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +2 -2
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +2 -4
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +66 -36
- data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +21 -12
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +124 -74
- data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +2514 -0
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +68 -62
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +16 -11
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +18 -6
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +51 -96
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +101 -46
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +11 -3
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +101 -209
- data/src/core/ext/filters/client_channel/lb_policy.cc +15 -14
- data/src/core/ext/filters/client_channel/lb_policy.h +105 -63
- data/src/core/ext/filters/client_channel/lb_policy_factory.h +1 -0
- data/src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc +139 -0
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +220 -88
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +22 -12
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +19 -15
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +31 -50
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +124 -240
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +38 -25
- 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 +90 -77
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +13 -11
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +2 -1
- data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +7 -16
- data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +5 -5
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +423 -396
- data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +2 -2
- data/src/core/ext/filters/client_channel/resolver_result_parsing.h +2 -2
- data/src/core/ext/filters/client_channel/retry_filter.cc +66 -131
- data/src/core/ext/filters/client_channel/retry_service_config.cc +1 -1
- data/src/core/ext/filters/client_channel/retry_service_config.h +1 -1
- data/src/core/ext/filters/client_channel/retry_throttle.cc +17 -48
- data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +49 -36
- data/src/core/ext/filters/client_channel/subchannel.cc +99 -161
- data/src/core/ext/filters/client_channel/subchannel.h +31 -52
- data/src/core/ext/filters/client_channel/subchannel_pool_interface.cc +22 -7
- data/src/core/ext/filters/client_channel/subchannel_pool_interface.h +11 -2
- data/src/core/ext/filters/client_idle/client_idle_filter.cc +27 -210
- data/src/core/ext/filters/client_idle/idle_filter_state.cc +96 -0
- data/src/core/ext/filters/client_idle/idle_filter_state.h +66 -0
- data/src/core/ext/filters/deadline/deadline_filter.cc +23 -26
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +42 -53
- data/src/core/ext/filters/fault_injection/service_config_parser.cc +6 -9
- data/src/core/ext/filters/fault_injection/service_config_parser.h +1 -1
- data/src/core/ext/filters/http/client/http_client_filter.cc +70 -160
- data/src/core/ext/filters/http/client_authority_filter.cc +19 -36
- data/src/core/ext/filters/http/http_filters_plugin.cc +51 -71
- data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +46 -139
- data/src/core/ext/filters/http/message_compress/message_decompress_filter.cc +5 -25
- data/src/core/ext/filters/http/server/http_server_filter.cc +84 -183
- data/src/core/ext/filters/max_age/max_age_filter.cc +24 -26
- data/src/core/ext/filters/message_size/message_size_filter.cc +19 -16
- data/src/core/ext/filters/message_size/message_size_filter.h +1 -1
- data/src/core/ext/filters/rbac/rbac_filter.cc +157 -0
- data/src/core/ext/filters/rbac/rbac_filter.h +74 -0
- data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +605 -0
- data/src/core/ext/filters/rbac/rbac_service_config_parser.h +70 -0
- data/src/core/ext/filters/server_config_selector/server_config_selector.cc +67 -0
- data/src/core/ext/filters/server_config_selector/server_config_selector.h +71 -0
- data/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc +270 -0
- data/src/core/ext/{transport/chttp2/transport/hpack_utils.h → filters/server_config_selector/server_config_selector_filter.h} +9 -7
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +4 -23
- data/src/core/ext/transport/chttp2/client/chttp2_connector.h +0 -2
- data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +26 -28
- data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc +11 -14
- data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +33 -53
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +146 -113
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +2 -3
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +9 -13
- data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc +6 -6
- data/src/core/ext/transport/chttp2/transport/chttp2_plugin.cc +0 -1
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +129 -278
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +1 -2
- data/src/core/ext/transport/chttp2/transport/context_list.cc +2 -3
- data/src/core/ext/transport/chttp2/transport/context_list.h +2 -3
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +26 -23
- data/src/core/ext/transport/chttp2/transport/flow_control.h +6 -6
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +4 -5
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +2 -1
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +2 -1
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +2 -3
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/hpack_constants.h +1 -1
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +384 -218
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +89 -143
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h +2 -0
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +201 -202
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +27 -9
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +106 -26
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +29 -44
- data/src/core/ext/transport/chttp2/transport/internal.h +10 -38
- data/src/core/ext/transport/chttp2/transport/parsing.cc +30 -179
- data/src/core/ext/transport/chttp2/transport/writing.cc +65 -127
- data/src/core/ext/transport/inproc/inproc_plugin.cc +0 -4
- data/src/core/ext/transport/inproc/inproc_transport.cc +114 -161
- data/src/core/ext/transport/inproc/inproc_transport.h +1 -4
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c +197 -165
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c +41 -0
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +18 -0
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +26 -2
- 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 +107 -82
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +188 -160
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c +35 -22
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +277 -208
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +141 -1
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c +16 -5
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +36 -25
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +56 -39
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c +16 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +171 -125
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +55 -4
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +51 -36
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c +15 -4
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c +25 -13
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +114 -90
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +90 -71
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +17 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c +17 -6
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +121 -92
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +25 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +13 -2
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c +21 -9
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +18 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +22 -11
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c +17 -6
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +41 -27
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +59 -44
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c +58 -43
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c +15 -4
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +73 -57
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +81 -64
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +25 -14
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +19 -7
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c +63 -45
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c +66 -47
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +99 -78
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +19 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +41 -28
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +508 -442
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +51 -19
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c +26 -13
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +21 -9
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c +13 -2
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c +35 -20
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +44 -31
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c +61 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +146 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +22 -11
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +210 -181
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c +7 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h +5 -3
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +64 -48
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +33 -20
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +81 -65
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c +12 -1
- data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c +12 -1
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +75 -58
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c +12 -1
- data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c +12 -1
- data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +25 -13
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c +12 -1
- data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c +12 -1
- data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c +61 -46
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c +26 -12
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c +22 -10
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c +17 -6
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c +16 -5
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c +15 -4
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +27 -14
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +25 -13
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c +20 -8
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c +30 -17
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c +38 -21
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c +41 -26
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/type/v3/http.upb.c +7 -0
- data/src/core/ext/upb-generated/envoy/type/v3/http.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c +17 -5
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.c +22 -9
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.h +2 -0
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c +15 -4
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h +2 -0
- data/src/core/ext/upb-generated/google/api/annotations.upb.c +20 -0
- data/src/core/ext/upb-generated/google/api/annotations.upb.h +7 -0
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c +116 -93
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h +2 -0
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/eval.upb.c +102 -0
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/eval.upb.h +306 -0
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/explain.upb.c +56 -0
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/explain.upb.h +135 -0
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +122 -98
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +2 -0
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/value.upb.c +115 -0
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/value.upb.h +371 -0
- data/src/core/ext/upb-generated/google/api/http.upb.c +35 -22
- data/src/core/ext/upb-generated/google/api/http.upb.h +2 -0
- data/src/core/ext/upb-generated/google/protobuf/any.upb.c +14 -3
- data/src/core/ext/upb-generated/google/protobuf/any.upb.h +2 -0
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +247 -210
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +2 -0
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.c +14 -3
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +2 -0
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.c +12 -1
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.h +2 -0
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +37 -23
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +2 -0
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +14 -3
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +2 -0
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +37 -18
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +2 -0
- data/src/core/ext/upb-generated/google/rpc/status.upb.c +17 -6
- data/src/core/ext/upb-generated/google/rpc/status.upb.h +2 -0
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +26 -14
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +2 -0
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +105 -83
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +2 -0
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c +20 -8
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +2 -0
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c +16 -4
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +2 -0
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +65 -47
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +34 -36
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c +68 -0
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h +156 -0
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +67 -7
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +27 -0
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.c +27 -5
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.h +7 -0
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c +19 -0
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +7 -0
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.c +27 -3
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.h +7 -0
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c +26 -2
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h +7 -0
- data/src/core/ext/upb-generated/validate/validate.upb.c +320 -251
- data/src/core/ext/upb-generated/validate/validate.upb.h +20 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c +103 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h +199 -0
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.c +14 -3
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.h +2 -0
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c +25 -13
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h +2 -0
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c +20 -8
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h +2 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.c +19 -8
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.h +2 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c +28 -16
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h +2 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c +19 -8
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h +2 -0
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c +71 -0
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h +132 -0
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c +44 -0
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h +85 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c +2 -49
- data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c +2 -2
- data/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c +2 -35
- data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +2 -41
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c +2 -11
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +307 -336
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c +2 -19
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +100 -138
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +2 -15
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c +2 -9
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c +2 -33
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +61 -77
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +61 -79
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c +2 -9
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c +2 -13
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +80 -99
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c +2 -15
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +2 -17
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c +2 -19
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c +2 -9
- data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c +2 -21
- data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c +2 -23
- data/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c +188 -0
- data/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h +70 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +2 -11
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +325 -427
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c +2 -11
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c +2 -9
- data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c +2 -15
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c +2 -11
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c +56 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +2 -43
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c +2 -2
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +2 -17
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c +2 -11
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +2 -17
- data/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c +2 -19
- data/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c +2 -9
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c +2 -15
- data/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c +2 -13
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c +2 -9
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c +2 -11
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c +2 -9
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c +2 -9
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c +2 -11
- data/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c +2 -19
- data/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c +2 -15
- data/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c +2 -2
- data/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c +2 -9
- data/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c +2 -11
- data/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c +2 -2
- data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c +154 -0
- data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h +95 -0
- data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/eval.upbdefs.c +58 -0
- data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/eval.upbdefs.h +55 -0
- data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/explain.upbdefs.c +44 -0
- data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/explain.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c +153 -0
- data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h +100 -0
- data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/value.upbdefs.c +75 -0
- data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/value.upbdefs.h +55 -0
- data/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c +2 -11
- data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c +2 -59
- data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c +2 -13
- data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c +2 -23
- data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c +7 -15
- data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c +21 -30
- data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c +6 -5
- data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c +7 -10
- data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c +7 -11
- data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c +2 -51
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c +64 -0
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h +50 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c +15 -19
- data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c +27 -33
- data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c +18 -24
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c +19 -23
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c +35 -41
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c +21 -25
- data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c +40 -0
- data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h +35 -0
- data/src/core/ext/xds/certificate_provider_registry.cc +1 -1
- data/src/core/ext/xds/certificate_provider_store.h +1 -1
- data/src/core/ext/xds/upb_utils.h +65 -0
- data/src/core/ext/xds/xds_api.cc +159 -3468
- data/src/core/ext/xds/xds_api.h +57 -558
- data/src/core/ext/xds/xds_bootstrap.cc +189 -122
- data/src/core/ext/xds/xds_bootstrap.h +30 -15
- data/src/core/ext/xds/xds_certificate_provider.cc +3 -3
- data/src/core/ext/xds/xds_certificate_provider.h +2 -2
- data/src/core/ext/xds/xds_channel_creds.cc +108 -0
- data/src/core/ext/xds/xds_channel_creds.h +50 -0
- data/src/core/ext/xds/xds_channel_stack_modifier.cc +112 -0
- data/src/core/ext/xds/xds_channel_stack_modifier.h +52 -0
- data/src/core/ext/xds/xds_client.cc +751 -844
- data/src/core/ext/xds/xds_client.h +100 -143
- data/src/core/ext/xds/xds_client_stats.h +1 -1
- data/src/core/ext/xds/xds_cluster.cc +451 -0
- data/src/core/ext/xds/xds_cluster.h +111 -0
- data/src/core/ext/xds/xds_common_types.cc +388 -0
- data/src/core/ext/xds/xds_common_types.h +110 -0
- data/src/core/ext/xds/xds_endpoint.cc +364 -0
- data/src/core/ext/xds/xds_endpoint.h +135 -0
- data/src/core/ext/xds/xds_http_filters.cc +5 -0
- data/src/core/ext/xds/xds_http_rbac_filter.cc +563 -0
- data/src/core/ext/xds/xds_http_rbac_filter.h +54 -0
- data/src/core/ext/xds/xds_listener.cc +1036 -0
- data/src/core/ext/xds/xds_listener.h +220 -0
- data/src/core/ext/{filters/workarounds/workaround_cronet_compression_filter.h → xds/xds_resource_type.cc} +14 -8
- data/src/core/ext/xds/xds_resource_type.h +98 -0
- data/src/core/ext/xds/xds_resource_type_impl.h +87 -0
- data/src/core/ext/xds/xds_route_config.cc +993 -0
- data/src/core/ext/xds/xds_route_config.h +215 -0
- data/src/core/ext/xds/xds_routing.cc +250 -0
- data/src/core/ext/xds/xds_routing.h +101 -0
- data/src/core/ext/xds/xds_server_config_fetcher.cc +1061 -289
- data/src/core/lib/address_utils/parse_address.cc +22 -0
- data/src/core/lib/address_utils/parse_address.h +5 -0
- data/src/core/lib/address_utils/sockaddr_utils.cc +33 -36
- data/src/core/lib/address_utils/sockaddr_utils.h +1 -16
- data/src/core/lib/avl/avl.h +389 -88
- data/src/core/lib/backoff/backoff.cc +6 -32
- data/src/core/lib/backoff/backoff.h +3 -3
- data/src/core/lib/channel/channel_args.cc +25 -8
- data/src/core/lib/channel/channel_args.h +11 -1
- data/src/core/lib/channel/channel_args_preconditioning.cc +47 -0
- data/src/core/lib/channel/channel_args_preconditioning.h +62 -0
- data/src/core/lib/channel/channel_stack.cc +8 -0
- data/src/core/lib/channel/channel_stack.h +1 -1
- data/src/core/lib/channel/channel_stack_builder.cc +8 -14
- data/src/core/lib/channel/channel_stack_builder.h +4 -7
- data/src/core/lib/channel/channel_trace.cc +7 -7
- data/src/core/lib/channel/channel_trace.h +1 -1
- data/src/core/lib/channel/channelz.cc +4 -3
- data/src/core/lib/channel/channelz.h +2 -2
- data/src/core/lib/channel/channelz_registry.cc +1 -1
- data/src/core/lib/channel/channelz_registry.h +1 -1
- data/src/core/lib/channel/connected_channel.cc +1 -3
- data/src/core/lib/channel/connected_channel.h +1 -2
- data/src/core/lib/compression/compression.cc +21 -113
- data/src/core/lib/compression/compression_internal.cc +142 -202
- data/src/core/lib/compression/compression_internal.h +64 -69
- data/src/core/lib/compression/message_compress.cc +11 -11
- data/src/core/lib/compression/message_compress.h +2 -2
- data/src/core/lib/config/core_configuration.cc +46 -2
- data/src/core/lib/config/core_configuration.h +50 -1
- data/src/core/lib/debug/stats.cc +1 -1
- data/src/core/lib/debug/stats_data.cc +13 -13
- data/src/core/lib/debug/trace.h +2 -2
- data/src/core/lib/event_engine/{endpoint_config.cc → channel_args_endpoint_config.cc} +2 -1
- data/src/core/lib/event_engine/{endpoint_config_internal.h → channel_args_endpoint_config.h} +3 -3
- data/src/core/lib/event_engine/event_engine.cc +0 -13
- data/src/core/lib/event_engine/event_engine_factory.cc +49 -0
- data/src/core/lib/event_engine/event_engine_factory.h +33 -0
- data/src/core/lib/event_engine/memory_allocator.cc +70 -0
- data/src/core/lib/gpr/atm.cc +1 -1
- data/src/core/lib/gpr/cpu_posix.cc +1 -1
- data/src/core/lib/gpr/string.cc +2 -2
- data/src/core/lib/gpr/tls.h +7 -1
- data/src/core/lib/gpr/useful.h +83 -32
- data/src/core/lib/gprpp/bitset.h +45 -16
- data/src/core/lib/gprpp/chunked_vector.h +253 -0
- data/src/core/lib/gprpp/construct_destruct.h +1 -1
- data/src/core/lib/gprpp/cpp_impl_of.h +45 -0
- data/src/core/lib/gprpp/global_config_env.cc +7 -7
- data/src/core/lib/gprpp/global_config_env.h +2 -2
- data/src/core/lib/gprpp/manual_constructor.h +2 -3
- data/src/core/lib/gprpp/memory.h +6 -0
- data/src/core/lib/gprpp/orphanable.h +1 -1
- data/src/core/lib/gprpp/ref_counted.h +1 -1
- data/src/core/lib/gprpp/ref_counted_ptr.h +2 -4
- data/src/core/lib/gprpp/status_helper.cc +35 -23
- data/src/core/lib/gprpp/status_helper.h +14 -16
- data/src/core/lib/gprpp/table.h +434 -0
- data/src/core/lib/http/httpcli.cc +215 -202
- data/src/core/lib/http/httpcli.h +17 -27
- data/src/core/lib/http/parser.cc +2 -2
- data/src/core/lib/iomgr/buffer_list.cc +9 -9
- data/src/core/lib/iomgr/buffer_list.h +13 -13
- data/src/core/lib/iomgr/call_combiner.cc +44 -16
- data/src/core/lib/iomgr/closure.h +29 -9
- data/src/core/lib/iomgr/combiner.cc +31 -24
- data/src/core/lib/iomgr/endpoint.h +0 -1
- data/src/core/lib/iomgr/endpoint_cfstream.cc +14 -30
- data/src/core/lib/iomgr/endpoint_cfstream.h +4 -4
- data/src/core/lib/iomgr/endpoint_pair_posix.cc +9 -11
- data/src/core/lib/iomgr/endpoint_pair_windows.cc +5 -14
- data/src/core/lib/iomgr/error.cc +115 -52
- data/src/core/lib/iomgr/error.h +53 -9
- data/src/core/lib/iomgr/error_cfstream.cc +5 -0
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +3 -2
- data/src/core/lib/iomgr/ev_epollex_linux.cc +7 -7
- data/src/core/lib/iomgr/ev_poll_posix.cc +29 -20
- data/src/core/lib/iomgr/event_engine/closure.cc +41 -18
- data/src/core/lib/iomgr/event_engine/closure.h +10 -1
- data/src/core/lib/iomgr/event_engine/endpoint.cc +5 -6
- data/src/core/lib/iomgr/event_engine/iomgr.cc +9 -28
- data/src/core/lib/iomgr/event_engine/pollset.cc +5 -4
- data/src/core/lib/iomgr/event_engine/resolved_address_internal.cc +6 -0
- data/src/core/lib/iomgr/event_engine/resolved_address_internal.h +2 -0
- data/src/core/lib/iomgr/event_engine/resolver.cc +68 -46
- data/src/core/lib/iomgr/event_engine/resolver.h +56 -0
- data/src/core/lib/iomgr/event_engine/tcp.cc +16 -13
- data/src/core/lib/iomgr/event_engine/timer.cc +10 -4
- data/src/core/lib/iomgr/exec_ctx.cc +23 -18
- data/src/core/lib/iomgr/exec_ctx.h +11 -11
- data/src/core/lib/iomgr/executor/mpmcqueue.cc +5 -7
- data/src/core/lib/iomgr/executor/mpmcqueue.h +3 -8
- data/src/core/lib/iomgr/executor.cc +26 -34
- data/src/core/lib/iomgr/executor.h +1 -1
- data/src/core/lib/iomgr/fork_posix.cc +3 -2
- data/src/core/lib/iomgr/iomgr.cc +3 -1
- data/src/core/lib/iomgr/iomgr_custom.cc +4 -1
- data/src/core/lib/iomgr/iomgr_internal.cc +4 -9
- data/src/core/lib/iomgr/iomgr_internal.h +3 -2
- data/src/core/lib/iomgr/iomgr_posix.cc +2 -2
- data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +2 -2
- data/src/core/lib/iomgr/iomgr_windows.cc +2 -2
- data/src/core/lib/iomgr/load_file.cc +2 -2
- data/src/core/lib/iomgr/lockfree_event.cc +18 -0
- data/src/core/lib/iomgr/pollset_custom.cc +1 -1
- data/src/core/lib/iomgr/pollset_custom.h +1 -1
- data/src/core/lib/iomgr/port.h +2 -2
- data/src/core/lib/iomgr/resolve_address.cc +5 -24
- data/src/core/lib/iomgr/resolve_address.h +47 -44
- data/src/core/lib/iomgr/resolve_address_custom.cc +131 -109
- data/src/core/lib/iomgr/resolve_address_custom.h +101 -19
- data/src/core/lib/iomgr/resolve_address_impl.h +59 -0
- data/src/core/lib/iomgr/resolve_address_posix.cc +87 -73
- data/src/core/lib/iomgr/resolve_address_posix.h +47 -0
- data/src/core/lib/iomgr/resolve_address_windows.cc +93 -74
- data/src/core/lib/iomgr/resolve_address_windows.h +47 -0
- data/src/core/lib/iomgr/resolved_address.h +39 -0
- data/src/core/lib/iomgr/socket_factory_posix.cc +2 -2
- data/src/core/lib/iomgr/socket_mutator.cc +2 -2
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +1 -2
- data/src/core/lib/iomgr/tcp_client.cc +2 -4
- data/src/core/lib/iomgr/tcp_client.h +1 -3
- data/src/core/lib/iomgr/tcp_client_cfstream.cc +6 -12
- data/src/core/lib/iomgr/tcp_client_custom.cc +5 -11
- data/src/core/lib/iomgr/tcp_client_posix.cc +16 -41
- data/src/core/lib/iomgr/tcp_client_posix.h +3 -4
- data/src/core/lib/iomgr/tcp_client_windows.cc +3 -13
- data/src/core/lib/iomgr/tcp_custom.cc +9 -36
- data/src/core/lib/iomgr/tcp_custom.h +0 -1
- data/src/core/lib/iomgr/tcp_posix.cc +32 -38
- data/src/core/lib/iomgr/tcp_posix.h +1 -3
- data/src/core/lib/iomgr/tcp_server.cc +4 -6
- data/src/core/lib/iomgr/tcp_server.h +6 -8
- data/src/core/lib/iomgr/tcp_server_custom.cc +7 -16
- data/src/core/lib/iomgr/tcp_server_posix.cc +20 -25
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +19 -18
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +1 -0
- data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +1 -0
- data/src/core/lib/iomgr/tcp_server_windows.cc +9 -17
- data/src/core/lib/iomgr/tcp_windows.cc +4 -9
- data/src/core/lib/iomgr/tcp_windows.h +1 -2
- data/src/core/lib/iomgr/timer_generic.cc +13 -13
- data/src/core/lib/iomgr/timer_heap.cc +1 -1
- data/src/core/lib/iomgr/unix_sockets_posix.cc +22 -34
- data/src/core/lib/iomgr/unix_sockets_posix.h +4 -7
- data/src/core/lib/iomgr/unix_sockets_posix_noop.cc +6 -15
- data/src/core/lib/iomgr/work_serializer.cc +115 -44
- data/src/core/lib/iomgr/work_serializer.h +16 -4
- data/src/core/lib/json/json_reader.cc +83 -35
- data/src/core/lib/json/json_util.cc +69 -1
- data/src/core/lib/json/json_util.h +57 -99
- data/src/core/lib/json/json_writer.cc +0 -3
- data/src/core/lib/matchers/matchers.cc +1 -1
- data/src/core/lib/promise/activity.cc +115 -0
- data/src/core/lib/promise/activity.h +528 -0
- data/src/core/lib/promise/context.h +86 -0
- data/src/core/lib/promise/detail/basic_seq.h +407 -0
- data/src/core/lib/promise/detail/promise_factory.h +189 -0
- data/src/core/lib/promise/detail/promise_like.h +85 -0
- data/src/core/lib/promise/detail/status.h +49 -0
- data/src/core/lib/promise/detail/switch.h +1455 -0
- data/src/core/lib/promise/exec_ctx_wakeup_scheduler.h +48 -0
- data/src/core/lib/promise/loop.h +108 -0
- data/src/core/lib/promise/map.h +88 -0
- data/src/core/lib/promise/poll.h +60 -0
- data/src/core/lib/promise/race.h +84 -0
- data/src/core/lib/promise/seq.h +71 -0
- data/src/core/{ext/filters/client_channel → lib/resolver}/resolver.cc +17 -25
- data/src/core/{ext/filters/client_channel → lib/resolver}/resolver.h +43 -44
- data/src/core/{ext/filters/client_channel → lib/resolver}/resolver_factory.h +12 -5
- data/src/core/{ext/filters/client_channel → lib/resolver}/resolver_registry.cc +15 -17
- data/src/core/{ext/filters/client_channel → lib/resolver}/resolver_registry.h +5 -7
- data/src/core/{ext/filters/client_channel → lib/resolver}/server_address.cc +1 -1
- data/src/core/{ext/filters/client_channel → lib/resolver}/server_address.h +5 -5
- data/src/core/lib/resource_quota/api.cc +108 -0
- data/src/core/lib/resource_quota/api.h +40 -0
- data/src/core/lib/{gprpp → resource_quota}/arena.cc +16 -13
- data/src/core/lib/{gprpp → resource_quota}/arena.h +32 -11
- data/src/core/lib/resource_quota/memory_quota.cc +454 -0
- data/src/core/lib/resource_quota/memory_quota.h +421 -0
- data/src/core/lib/resource_quota/resource_quota.cc +33 -0
- data/src/core/lib/resource_quota/resource_quota.h +58 -0
- data/src/core/lib/{transport/authority_override.h → resource_quota/thread_quota.cc} +22 -16
- data/src/core/lib/resource_quota/thread_quota.h +57 -0
- data/src/core/lib/resource_quota/trace.cc +19 -0
- data/src/core/lib/resource_quota/trace.h +24 -0
- data/src/core/lib/security/authorization/authorization_policy_provider.h +1 -1
- data/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc +1 -1
- data/src/core/lib/security/authorization/evaluate_args.cc +41 -30
- data/src/core/lib/security/authorization/evaluate_args.h +3 -1
- data/src/core/lib/security/authorization/grpc_authorization_engine.cc +60 -0
- data/src/core/lib/security/authorization/grpc_authorization_engine.h +62 -0
- data/src/core/lib/security/authorization/matchers.cc +227 -0
- data/src/core/lib/security/authorization/matchers.h +211 -0
- data/src/core/lib/security/authorization/rbac_policy.cc +442 -0
- data/src/core/lib/security/authorization/rbac_policy.h +170 -0
- data/src/core/lib/security/authorization/sdk_server_authz_filter.cc +15 -1
- data/src/core/lib/security/context/security_context.cc +8 -4
- data/src/core/lib/security/context/security_context.h +1 -1
- data/src/core/lib/security/credentials/composite/composite_credentials.cc +6 -6
- data/src/core/lib/security/credentials/composite/composite_credentials.h +4 -3
- data/src/core/lib/security/credentials/credentials.cc +4 -2
- data/src/core/lib/security/credentials/credentials.h +16 -21
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +8 -12
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +57 -24
- data/src/core/lib/security/credentials/external/external_account_credentials.h +3 -7
- data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +2 -4
- data/src/core/lib/security/credentials/fake/fake_credentials.cc +5 -4
- data/src/core/lib/security/credentials/fake/fake_credentials.h +8 -7
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +4 -9
- data/src/core/lib/security/credentials/iam/iam_credentials.cc +16 -19
- data/src/core/lib/security/credentials/iam/iam_credentials.h +6 -5
- data/src/core/lib/security/credentials/jwt/json_token.cc +4 -6
- data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +17 -29
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +8 -8
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +11 -24
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +53 -70
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +13 -15
- data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +8 -9
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +5 -4
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +1 -10
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +11 -12
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +7 -8
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc +201 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h +106 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +15 -88
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +26 -82
- data/src/core/lib/security/credentials/tls/tls_credentials.cc +21 -10
- data/src/core/lib/security/credentials/xds/xds_credentials.cc +28 -33
- data/src/core/lib/security/credentials/xds/xds_credentials.h +1 -1
- data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +3 -3
- data/src/core/lib/security/security_connector/alts/alts_security_connector.h +2 -2
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +5 -6
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc +2 -2
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +7 -7
- data/src/core/lib/security/security_connector/load_system_roots_linux.cc +1 -2
- data/src/core/lib/security/security_connector/local/local_security_connector.cc +4 -1
- data/src/core/lib/security/security_connector/security_connector.cc +9 -8
- data/src/core/lib/security/security_connector/security_connector.h +6 -2
- data/src/core/lib/security/security_connector/ssl_utils.cc +25 -27
- data/src/core/lib/security/security_connector/ssl_utils.h +6 -15
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +347 -198
- data/src/core/lib/security/security_connector/tls/tls_security_connector.h +64 -43
- data/src/core/lib/security/transport/auth_filters.h +7 -0
- data/src/core/lib/security/transport/client_auth_filter.cc +53 -33
- data/src/core/lib/security/transport/security_handshaker.cc +75 -45
- data/src/core/lib/security/transport/server_auth_filter.cc +40 -37
- data/src/core/lib/security/transport/tsi_error.cc +3 -5
- data/src/core/{ext/filters/client_channel → lib/service_config}/service_config.cc +2 -2
- data/src/core/{ext/filters/client_channel → lib/service_config}/service_config.h +4 -4
- data/src/core/lib/service_config/service_config_call_data.h +72 -0
- data/src/core/{ext/filters/client_channel → lib/service_config}/service_config_parser.cc +3 -3
- data/src/core/{ext/filters/client_channel → lib/service_config}/service_config_parser.h +8 -6
- data/src/core/lib/slice/percent_encoding.cc +30 -86
- data/src/core/lib/slice/percent_encoding.h +5 -11
- data/src/core/lib/slice/slice.cc +10 -24
- data/src/core/lib/slice/slice.h +371 -0
- data/src/core/lib/{compression/stream_compression_gzip.h → slice/slice_api.cc} +18 -7
- data/src/core/lib/slice/slice_buffer.cc +9 -5
- data/src/core/lib/slice/slice_intern.cc +4 -107
- data/src/core/lib/slice/slice_internal.h +2 -246
- data/src/core/lib/slice/slice_refcount.cc +17 -0
- data/src/core/lib/slice/slice_refcount.h +116 -0
- data/src/core/lib/slice/slice_refcount_base.h +165 -0
- data/src/core/lib/slice/slice_split.cc +100 -0
- data/src/core/lib/slice/slice_split.h +40 -0
- data/src/core/lib/slice/slice_string_helpers.cc +0 -83
- data/src/core/lib/slice/slice_string_helpers.h +0 -11
- data/src/core/lib/surface/builtins.cc +49 -0
- data/src/core/lib/surface/builtins.h +26 -0
- data/src/core/lib/surface/call.cc +249 -482
- data/src/core/lib/surface/call.h +4 -10
- data/src/core/lib/surface/channel.cc +53 -93
- data/src/core/lib/surface/channel.h +6 -25
- data/src/core/lib/surface/channel_init.cc +23 -76
- data/src/core/lib/surface/channel_init.h +52 -44
- data/src/core/lib/surface/completion_queue.cc +8 -7
- data/src/core/lib/surface/init.cc +0 -42
- data/src/core/lib/surface/init_secure.cc +17 -14
- data/src/core/lib/surface/lame_client.cc +41 -28
- data/src/core/lib/surface/lame_client.h +1 -1
- data/src/core/lib/surface/server.cc +46 -55
- data/src/core/lib/surface/server.h +27 -21
- data/src/core/lib/surface/validate_metadata.cc +7 -4
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/bdp_estimator.cc +2 -2
- data/src/core/lib/transport/byte_stream.cc +4 -0
- data/src/core/lib/transport/error_utils.cc +42 -17
- data/src/core/lib/transport/error_utils.h +15 -1
- data/src/core/lib/transport/metadata_batch.h +1167 -176
- data/src/core/lib/transport/{authority_override.cc → parsed_metadata.cc} +14 -17
- data/src/core/lib/transport/parsed_metadata.h +385 -0
- data/src/core/lib/transport/pid_controller.cc +4 -4
- data/src/core/lib/transport/timeout_encoding.cc +200 -66
- data/src/core/lib/transport/timeout_encoding.h +40 -10
- data/src/core/lib/transport/transport.cc +8 -31
- data/src/core/lib/transport/transport.h +1 -2
- data/src/core/lib/transport/transport_op_string.cc +7 -20
- data/src/core/lib/uri/uri_parser.cc +233 -63
- data/src/core/lib/uri/uri_parser.h +38 -23
- data/src/core/plugin_registry/grpc_plugin_registry.cc +69 -45
- data/src/core/tsi/alts/crypt/aes_gcm.cc +3 -1
- data/src/core/tsi/alts/frame_protector/alts_frame_protector.cc +13 -12
- data/src/core/tsi/alts/frame_protector/frame_handler.cc +10 -11
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +3 -4
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +12 -2
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc +1 -1
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +2 -2
- data/src/core/tsi/fake_transport_security.cc +15 -7
- data/src/core/tsi/local_transport_security.cc +43 -80
- data/src/core/tsi/ssl/session_cache/ssl_session.h +2 -4
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +16 -50
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +6 -7
- data/src/core/tsi/ssl_transport_security.cc +93 -16
- data/src/core/tsi/ssl_transport_security.h +19 -6
- data/src/core/tsi/transport_security.cc +12 -0
- data/src/core/tsi/transport_security.h +16 -1
- data/src/core/tsi/transport_security_interface.h +26 -0
- data/src/ruby/ext/grpc/extconf.rb +21 -11
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +12 -10
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +18 -15
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/src/proto/grpc/testing/test_pb.rb +1 -0
- data/src/ruby/spec/client_server_spec.rb +1 -1
- data/third_party/abseil-cpp/absl/algorithm/container.h +101 -91
- data/third_party/abseil-cpp/absl/base/attributes.h +64 -31
- data/third_party/abseil-cpp/absl/base/config.h +67 -37
- data/third_party/abseil-cpp/absl/base/dynamic_annotations.h +1 -26
- data/third_party/abseil-cpp/absl/base/internal/fast_type_id.h +48 -0
- data/third_party/abseil-cpp/absl/base/internal/spinlock.h +3 -1
- data/third_party/abseil-cpp/absl/base/internal/spinlock_wait.h +2 -0
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +69 -0
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.cc +4 -4
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.h +15 -10
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +16 -0
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +4 -4
- data/third_party/abseil-cpp/absl/base/options.h +1 -1
- data/third_party/abseil-cpp/absl/container/fixed_array.h +0 -5
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +105 -97
- data/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h +17 -15
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +18 -102
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +37 -78
- data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +388 -423
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +3 -2
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +14 -8
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +251 -120
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +11 -1
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc +12 -11
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h +6 -2
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h +12 -5
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc +110 -0
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +234 -0
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +25 -7
- data/third_party/abseil-cpp/absl/debugging/internal/symbolize.h +8 -2
- data/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc +21 -3
- data/third_party/abseil-cpp/absl/debugging/stacktrace.cc +2 -0
- data/third_party/abseil-cpp/absl/debugging/symbolize.cc +2 -0
- data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +14 -0
- data/third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc +72 -0
- data/third_party/abseil-cpp/absl/functional/function_ref.h +4 -1
- data/third_party/abseil-cpp/absl/hash/hash.h +22 -0
- data/third_party/abseil-cpp/absl/hash/internal/hash.cc +15 -16
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +88 -37
- data/third_party/abseil-cpp/absl/hash/internal/{wyhash.cc → low_level_hash.cc} +23 -11
- data/third_party/abseil-cpp/absl/hash/internal/{wyhash.h → low_level_hash.h} +14 -12
- data/third_party/abseil-cpp/absl/memory/memory.h +1 -1
- data/third_party/abseil-cpp/absl/meta/type_traits.h +32 -2
- data/third_party/abseil-cpp/absl/numeric/int128.cc +3 -10
- data/third_party/abseil-cpp/absl/numeric/int128.h +146 -73
- data/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc +19 -25
- data/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc +73 -70
- data/third_party/abseil-cpp/absl/{base → profiling}/internal/exponential_biased.cc +4 -4
- data/third_party/abseil-cpp/absl/{base → profiling}/internal/exponential_biased.h +6 -6
- data/third_party/abseil-cpp/absl/profiling/internal/sample_recorder.h +230 -0
- data/third_party/abseil-cpp/absl/random/bernoulli_distribution.h +200 -0
- data/third_party/abseil-cpp/absl/random/beta_distribution.h +427 -0
- data/third_party/abseil-cpp/absl/random/discrete_distribution.cc +98 -0
- data/third_party/abseil-cpp/absl/random/discrete_distribution.h +247 -0
- data/third_party/abseil-cpp/absl/random/distributions.h +452 -0
- data/third_party/abseil-cpp/absl/random/exponential_distribution.h +165 -0
- data/third_party/abseil-cpp/absl/random/gaussian_distribution.cc +104 -0
- data/third_party/abseil-cpp/absl/random/gaussian_distribution.h +275 -0
- data/third_party/abseil-cpp/absl/random/internal/distribution_caller.h +92 -0
- data/third_party/abseil-cpp/absl/random/internal/fast_uniform_bits.h +268 -0
- data/third_party/abseil-cpp/absl/random/internal/fastmath.h +57 -0
- data/third_party/abseil-cpp/absl/random/internal/generate_real.h +144 -0
- data/third_party/abseil-cpp/absl/random/internal/iostream_state_saver.h +245 -0
- data/third_party/abseil-cpp/absl/random/internal/nonsecure_base.h +150 -0
- data/third_party/abseil-cpp/absl/random/internal/pcg_engine.h +308 -0
- data/third_party/abseil-cpp/absl/random/internal/platform.h +171 -0
- data/third_party/abseil-cpp/absl/random/internal/pool_urbg.cc +253 -0
- data/third_party/abseil-cpp/absl/random/internal/pool_urbg.h +131 -0
- data/third_party/abseil-cpp/absl/random/internal/randen.cc +91 -0
- data/third_party/abseil-cpp/absl/random/internal/randen.h +102 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_detect.cc +221 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_detect.h +33 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_engine.h +239 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_hwaes.cc +526 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_hwaes.h +50 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_round_keys.cc +462 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_slow.cc +471 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_slow.h +40 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_traits.h +88 -0
- data/third_party/abseil-cpp/absl/random/internal/salted_seed_seq.h +167 -0
- data/third_party/abseil-cpp/absl/random/internal/seed_material.cc +267 -0
- data/third_party/abseil-cpp/absl/random/internal/seed_material.h +104 -0
- data/third_party/abseil-cpp/absl/random/internal/traits.h +101 -0
- data/third_party/abseil-cpp/absl/random/internal/uniform_helper.h +244 -0
- data/third_party/abseil-cpp/absl/random/internal/wide_multiply.h +111 -0
- data/third_party/abseil-cpp/absl/random/log_uniform_int_distribution.h +257 -0
- data/third_party/abseil-cpp/absl/random/poisson_distribution.h +258 -0
- data/third_party/abseil-cpp/absl/random/random.h +189 -0
- data/third_party/abseil-cpp/absl/random/seed_gen_exception.cc +46 -0
- data/third_party/abseil-cpp/absl/random/seed_gen_exception.h +55 -0
- data/third_party/abseil-cpp/absl/random/seed_sequences.cc +29 -0
- data/third_party/abseil-cpp/absl/random/seed_sequences.h +110 -0
- data/third_party/abseil-cpp/absl/random/uniform_int_distribution.h +275 -0
- data/third_party/abseil-cpp/absl/random/uniform_real_distribution.h +202 -0
- data/third_party/abseil-cpp/absl/random/zipf_distribution.h +271 -0
- data/third_party/abseil-cpp/absl/status/internal/status_internal.h +5 -5
- data/third_party/abseil-cpp/absl/status/status.cc +9 -17
- data/third_party/abseil-cpp/absl/status/status.h +19 -15
- data/third_party/abseil-cpp/absl/status/statusor.cc +34 -2
- data/third_party/abseil-cpp/absl/status/statusor.h +31 -21
- data/third_party/abseil-cpp/absl/strings/charconv.cc +3 -3
- data/third_party/abseil-cpp/absl/strings/charconv.h +3 -2
- data/third_party/abseil-cpp/absl/strings/cord.cc +453 -359
- data/third_party/abseil-cpp/absl/strings/cord.h +197 -70
- data/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.cc +6 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +140 -63
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +1128 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h +939 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc +185 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.h +265 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.cc +68 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.h +211 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.cc +129 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.h +50 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h +7 -7
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.cc +55 -181
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.h +42 -24
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring_reader.h +4 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_functions.cc +96 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_functions.h +85 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.cc +139 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.h +131 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +445 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.h +298 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_statistics.h +87 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_update_scope.h +71 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_update_tracker.h +121 -0
- data/third_party/abseil-cpp/absl/strings/internal/resize_uninitialized.h +48 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +8 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc +3 -4
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +6 -6
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +36 -18
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc +62 -73
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +24 -16
- data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +35 -35
- data/third_party/abseil-cpp/absl/strings/numbers.cc +1 -1
- data/third_party/abseil-cpp/absl/strings/numbers.h +34 -0
- data/third_party/abseil-cpp/absl/strings/str_cat.cc +4 -4
- data/third_party/abseil-cpp/absl/strings/str_format.h +1 -2
- data/third_party/abseil-cpp/absl/strings/string_view.cc +16 -21
- data/third_party/abseil-cpp/absl/strings/string_view.h +120 -39
- data/third_party/abseil-cpp/absl/strings/substitute.cc +2 -1
- data/third_party/abseil-cpp/absl/strings/substitute.h +99 -74
- data/third_party/abseil-cpp/absl/synchronization/blocking_counter.cc +25 -15
- data/third_party/abseil-cpp/absl/synchronization/blocking_counter.h +5 -3
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc +1 -1
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +3 -3
- data/third_party/abseil-cpp/absl/time/civil_time.cc +1 -3
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h +93 -20
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.h +2 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc +83 -21
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +49 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc +2 -3
- data/third_party/abseil-cpp/absl/time/time.h +67 -36
- data/third_party/abseil-cpp/absl/types/bad_optional_access.h +1 -1
- data/third_party/abseil-cpp/absl/types/bad_variant_access.h +2 -2
- data/third_party/abseil-cpp/absl/types/span.h +3 -3
- data/third_party/address_sorting/address_sorting_posix.c +1 -0
- data/third_party/boringssl-with-bazel/err_data.c +681 -677
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_bitstr.c +19 -11
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_bool.c +20 -21
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_object.c +41 -30
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_strnid.c +104 -114
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_time.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_lib.c +59 -47
- data/third_party/boringssl-with-bazel/src/crypto/asn1/asn_pack.c +24 -28
- data/third_party/boringssl-with-bazel/src/crypto/asn1/f_int.c +5 -0
- data/third_party/boringssl-with-bazel/src/crypto/asn1/internal.h +41 -0
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_dec.c +48 -272
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_typ.c +8 -6
- data/third_party/boringssl-with-bazel/src/crypto/base64/base64.c +13 -0
- data/third_party/boringssl-with-bazel/src/crypto/blake2/blake2.c +4 -6
- data/third_party/boringssl-with-bazel/src/crypto/bytestring/ber.c +3 -1
- data/third_party/boringssl-with-bazel/src/crypto/chacha/chacha.c +38 -47
- data/third_party/boringssl-with-bazel/src/crypto/dsa/dsa.c +21 -0
- data/third_party/boringssl-with-bazel/src/crypto/evp/evp_asn1.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/evp/scrypt.c +32 -34
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/sqrt.c +5 -9
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/cipher.c +12 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/des/des.c +10 -11
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/des/internal.h +1 -3
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/ecdsa.c +1 -2
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/md4/md4.c +3 -6
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/md5/md5.c +4 -7
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/self_check.c +7 -7
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha1.c +35 -35
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha256.c +11 -10
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha512.c +10 -37
- data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/internal.h +39 -0
- data/third_party/boringssl-with-bazel/src/crypto/mem.c +18 -0
- data/third_party/boringssl-with-bazel/src/crypto/pkcs7/pkcs7.c +29 -0
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/internal.h +0 -1
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8_x509.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/pool/internal.h +5 -1
- data/third_party/boringssl-with-bazel/src/crypto/pool/pool.c +59 -23
- data/third_party/boringssl-with-bazel/src/crypto/siphash/siphash.c +6 -6
- data/third_party/boringssl-with-bazel/src/crypto/x509/asn1_gen.c +2 -18
- data/third_party/boringssl-with-bazel/src/crypto/x509/internal.h +8 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/internal.h +216 -11
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_cache.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_data.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_lib.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_map.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_node.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_tree.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_alt.c +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_cpols.c +0 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_lib.c +21 -4
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_purp.c +0 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1.h +1019 -274
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1t.h +3 -3
- data/third_party/boringssl-with-bazel/src/include/openssl/base.h +5 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/base64.h +8 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/cipher.h +13 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/dh.h +4 -12
- data/third_party/boringssl-with-bazel/src/include/openssl/dsa.h +27 -41
- data/third_party/boringssl-with-bazel/src/include/openssl/ec_key.h +12 -27
- data/third_party/boringssl-with-bazel/src/include/openssl/ecdsa.h +8 -10
- data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +29 -55
- data/third_party/boringssl-with-bazel/src/include/openssl/hpke.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/pkcs7.h +12 -13
- data/third_party/boringssl-with-bazel/src/include/openssl/pkcs8.h +6 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/pool.h +7 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/rsa.h +24 -28
- data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +31 -13
- data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +491 -58
- data/third_party/boringssl-with-bazel/src/include/openssl/x509_vfy.h +16 -564
- data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +4 -3
- data/third_party/boringssl-with-bazel/src/ssl/internal.h +3 -3
- data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +4 -0
- data/third_party/boringssl-with-bazel/src/ssl/ssl_versions.cc +4 -0
- data/third_party/boringssl-with-bazel/src/ssl/ssl_x509.cc +0 -1
- data/third_party/re2/re2/compile.cc +91 -109
- data/third_party/re2/re2/dfa.cc +27 -39
- data/third_party/re2/re2/filtered_re2.cc +18 -2
- data/third_party/re2/re2/filtered_re2.h +10 -5
- data/third_party/re2/re2/nfa.cc +1 -1
- data/third_party/re2/re2/parse.cc +42 -23
- data/third_party/re2/re2/perl_groups.cc +34 -34
- data/third_party/re2/re2/prefilter.cc +3 -2
- data/third_party/re2/re2/prog.cc +182 -4
- data/third_party/re2/re2/prog.h +28 -9
- data/third_party/re2/re2/re2.cc +87 -118
- data/third_party/re2/re2/re2.h +156 -141
- data/third_party/re2/re2/regexp.cc +12 -5
- data/third_party/re2/re2/regexp.h +8 -2
- data/third_party/re2/re2/set.cc +31 -9
- data/third_party/re2/re2/set.h +9 -4
- data/third_party/re2/re2/simplify.cc +11 -3
- data/third_party/re2/re2/tostring.cc +1 -1
- data/third_party/re2/re2/walker-inl.h +1 -1
- data/third_party/re2/util/mutex.h +2 -2
- data/third_party/re2/util/pcre.h +3 -3
- data/third_party/upb/upb/decode.c +309 -178
- data/third_party/upb/upb/decode_fast.c +1 -1
- data/third_party/upb/upb/decode_internal.h +1 -0
- data/third_party/upb/upb/def.c +330 -85
- data/third_party/upb/upb/def.h +45 -14
- data/third_party/upb/upb/def.hpp +17 -4
- data/third_party/upb/upb/encode.c +100 -40
- data/third_party/upb/upb/msg.c +22 -9
- data/third_party/upb/upb/msg_internal.h +90 -8
- data/third_party/upb/upb/reflection.c +98 -58
- data/third_party/upb/upb/reflection.h +6 -2
- data/third_party/upb/upb/text_encode.c +3 -3
- data/third_party/upb/upb/upb.c +8 -0
- data/third_party/xxhash/xxhash.h +607 -352
- metadata +259 -115
- data/include/grpc/event_engine/slice_allocator.h +0 -71
- data/src/core/ext/filters/client_channel/service_config_call_data.h +0 -126
- data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc +0 -211
- data/src/core/ext/filters/workarounds/workaround_utils.cc +0 -53
- data/src/core/ext/filters/workarounds/workaround_utils.h +0 -39
- data/src/core/ext/transport/chttp2/client/authority.cc +0 -42
- data/src/core/ext/transport/chttp2/client/authority.h +0 -36
- data/src/core/ext/transport/chttp2/transport/chttp2_slice_allocator.cc +0 -67
- data/src/core/ext/transport/chttp2/transport/chttp2_slice_allocator.h +0 -74
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_index.h +0 -107
- data/src/core/ext/transport/chttp2/transport/hpack_utils.cc +0 -46
- data/src/core/ext/transport/chttp2/transport/incoming_metadata.cc +0 -66
- data/src/core/ext/transport/chttp2/transport/incoming_metadata.h +0 -58
- data/src/core/ext/transport/chttp2/transport/popularity_count.h +0 -60
- data/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c +0 -58
- data/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h +0 -130
- data/src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c +0 -33
- data/src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h +0 -83
- data/src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c +0 -44
- data/src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h +0 -35
- data/src/core/lib/avl/avl.cc +0 -306
- data/src/core/lib/compression/algorithm_metadata.h +0 -62
- data/src/core/lib/compression/compression_args.cc +0 -136
- data/src/core/lib/compression/compression_args.h +0 -56
- data/src/core/lib/compression/stream_compression.cc +0 -81
- data/src/core/lib/compression/stream_compression.h +0 -117
- data/src/core/lib/compression/stream_compression_gzip.cc +0 -231
- data/src/core/lib/compression/stream_compression_identity.cc +0 -91
- data/src/core/lib/compression/stream_compression_identity.h +0 -29
- data/src/core/lib/gprpp/match.h +0 -73
- data/src/core/lib/gprpp/overload.h +0 -59
- data/src/core/lib/iomgr/event_engine/iomgr.h +0 -42
- data/src/core/lib/iomgr/resource_quota.cc +0 -1104
- data/src/core/lib/iomgr/resource_quota.h +0 -226
- data/src/core/lib/iomgr/udp_server.cc +0 -747
- data/src/core/lib/iomgr/udp_server.h +0 -103
- data/src/core/lib/security/credentials/credentials_metadata.cc +0 -61
- data/src/core/lib/transport/metadata.cc +0 -693
- data/src/core/lib/transport/metadata.h +0 -448
- data/src/core/lib/transport/metadata_batch.cc +0 -430
- data/src/core/lib/transport/static_metadata.cc +0 -1249
- data/src/core/lib/transport/static_metadata.h +0 -604
- data/src/core/lib/transport/status_metadata.cc +0 -62
- data/src/core/lib/transport/status_metadata.h +0 -48
- data/third_party/boringssl-with-bazel/src/crypto/asn1/f_enum.c +0 -93
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_int.h +0 -217
@@ -33,12 +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/service_config.h"
|
37
36
|
#include "src/core/ext/xds/xds_api.h"
|
38
37
|
#include "src/core/ext/xds/xds_bootstrap.h"
|
39
38
|
#include "src/core/ext/xds/xds_channel_args.h"
|
39
|
+
#include "src/core/ext/xds/xds_channel_creds.h"
|
40
40
|
#include "src/core/ext/xds/xds_client_stats.h"
|
41
|
+
#include "src/core/ext/xds/xds_cluster.h"
|
42
|
+
#include "src/core/ext/xds/xds_endpoint.h"
|
41
43
|
#include "src/core/ext/xds/xds_http_filters.h"
|
44
|
+
#include "src/core/ext/xds/xds_listener.h"
|
42
45
|
#include "src/core/lib/address_utils/sockaddr_utils.h"
|
43
46
|
#include "src/core/lib/backoff/backoff.h"
|
44
47
|
#include "src/core/lib/channel/channel_args.h"
|
@@ -55,8 +58,7 @@
|
|
55
58
|
#include "src/core/lib/slice/slice_string_helpers.h"
|
56
59
|
#include "src/core/lib/surface/call.h"
|
57
60
|
#include "src/core/lib/surface/channel.h"
|
58
|
-
#include "src/core/lib/
|
59
|
-
#include "src/core/lib/transport/static_metadata.h"
|
61
|
+
#include "src/core/lib/uri/uri_parser.h"
|
60
62
|
|
61
63
|
#define GRPC_XDS_INITIAL_CONNECT_BACKOFF_SECONDS 1
|
62
64
|
#define GRPC_XDS_RECONNECT_BACKOFF_MULTIPLIER 1.6
|
@@ -72,12 +74,50 @@ TraceFlag grpc_xds_client_refcount_trace(false, "xds_client_refcount");
|
|
72
74
|
namespace {
|
73
75
|
|
74
76
|
Mutex* g_mu = nullptr;
|
77
|
+
|
75
78
|
const grpc_channel_args* g_channel_args ABSL_GUARDED_BY(*g_mu) = nullptr;
|
76
79
|
XdsClient* g_xds_client ABSL_GUARDED_BY(*g_mu) = nullptr;
|
77
80
|
char* g_fallback_bootstrap_config ABSL_GUARDED_BY(*g_mu) = nullptr;
|
78
81
|
|
79
82
|
} // namespace
|
80
83
|
|
84
|
+
class XdsClient::Notifier {
|
85
|
+
public:
|
86
|
+
// Helper template function to invoke `OnError()` on a list of watchers \a
|
87
|
+
// watchers_list within \a work_serializer. Works with all 4 resource types.
|
88
|
+
template <class T>
|
89
|
+
static void ScheduleNotifyWatchersOnErrorInWorkSerializer(
|
90
|
+
XdsClient* xds_client, const T& watchers_list, grpc_error_handle error,
|
91
|
+
const DebugLocation& location) {
|
92
|
+
xds_client->work_serializer_.Schedule(
|
93
|
+
[watchers_list, error]()
|
94
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client->work_serializer_) {
|
95
|
+
for (const auto& p : watchers_list) {
|
96
|
+
p.first->OnError(GRPC_ERROR_REF(error));
|
97
|
+
}
|
98
|
+
GRPC_ERROR_UNREF(error);
|
99
|
+
},
|
100
|
+
location);
|
101
|
+
}
|
102
|
+
|
103
|
+
// Helper template function to invoke `OnResourceDoesNotExist()` on a list of
|
104
|
+
// watchers \a watchers_list within \a work_serializer. Works with all 4
|
105
|
+
// resource types.
|
106
|
+
template <class T>
|
107
|
+
static void ScheduleNotifyWatchersOnResourceDoesNotExistInWorkSerializer(
|
108
|
+
XdsClient* xds_client, const T& watchers_list,
|
109
|
+
const DebugLocation& location) {
|
110
|
+
xds_client->work_serializer_.Schedule(
|
111
|
+
[watchers_list]()
|
112
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client->work_serializer_) {
|
113
|
+
for (const auto& p : watchers_list) {
|
114
|
+
p.first->OnResourceDoesNotExist();
|
115
|
+
}
|
116
|
+
},
|
117
|
+
location);
|
118
|
+
}
|
119
|
+
};
|
120
|
+
|
81
121
|
//
|
82
122
|
// Internal class declarations
|
83
123
|
//
|
@@ -88,7 +128,7 @@ template <typename T>
|
|
88
128
|
class XdsClient::ChannelState::RetryableCall
|
89
129
|
: public InternallyRefCounted<RetryableCall<T>> {
|
90
130
|
public:
|
91
|
-
explicit RetryableCall(
|
131
|
+
explicit RetryableCall(WeakRefCountedPtr<ChannelState> chand);
|
92
132
|
|
93
133
|
void Orphan() override;
|
94
134
|
|
@@ -109,7 +149,7 @@ class XdsClient::ChannelState::RetryableCall
|
|
109
149
|
// every time we start a new call. It's null during call retry backoff.
|
110
150
|
OrphanablePtr<T> calld_;
|
111
151
|
// The owning xds channel.
|
112
|
-
|
152
|
+
WeakRefCountedPtr<ChannelState> chand_;
|
113
153
|
|
114
154
|
// Retry state.
|
115
155
|
BackOff backoff_;
|
@@ -135,34 +175,65 @@ class XdsClient::ChannelState::AdsCallState
|
|
135
175
|
XdsClient* xds_client() const { return chand()->xds_client(); }
|
136
176
|
bool seen_response() const { return seen_response_; }
|
137
177
|
|
138
|
-
void SubscribeLocked(const
|
178
|
+
void SubscribeLocked(const XdsResourceType* type, const XdsResourceName& name)
|
139
179
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
140
|
-
void UnsubscribeLocked(const
|
141
|
-
bool delay_unsubscription)
|
180
|
+
void UnsubscribeLocked(const XdsResourceType* type,
|
181
|
+
const XdsResourceName& name, bool delay_unsubscription)
|
142
182
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
143
183
|
|
144
184
|
bool HasSubscribedResources() const;
|
145
185
|
|
146
186
|
private:
|
147
|
-
class
|
187
|
+
class AdsResponseParser : public XdsApi::AdsResponseParserInterface {
|
188
|
+
public:
|
189
|
+
struct Result {
|
190
|
+
const XdsResourceType* type;
|
191
|
+
std::string type_url;
|
192
|
+
std::string version;
|
193
|
+
std::string nonce;
|
194
|
+
std::vector<std::string> errors;
|
195
|
+
std::map<std::string /*authority*/, std::set<XdsResourceKey>>
|
196
|
+
resources_seen;
|
197
|
+
bool have_valid_resources = false;
|
198
|
+
};
|
199
|
+
|
200
|
+
explicit AdsResponseParser(AdsCallState* ads_call_state)
|
201
|
+
: ads_call_state_(ads_call_state) {}
|
202
|
+
|
203
|
+
absl::Status ProcessAdsResponseFields(AdsResponseFields fields) override
|
204
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
205
|
+
|
206
|
+
void ParseResource(const XdsEncodingContext& context, size_t idx,
|
207
|
+
absl::string_view type_url,
|
208
|
+
absl::string_view serialized_resource) override
|
209
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
210
|
+
|
211
|
+
Result TakeResult() { return std::move(result_); }
|
212
|
+
|
213
|
+
private:
|
214
|
+
XdsClient* xds_client() const { return ads_call_state_->xds_client(); }
|
215
|
+
|
216
|
+
AdsCallState* ads_call_state_;
|
217
|
+
const grpc_millis update_time_ = ExecCtx::Get()->Now();
|
218
|
+
Result result_;
|
219
|
+
};
|
220
|
+
|
221
|
+
class ResourceTimer : public InternallyRefCounted<ResourceTimer> {
|
148
222
|
public:
|
149
|
-
|
150
|
-
|
151
|
-
: type_url_(type_url),
|
152
|
-
name_(name),
|
153
|
-
sent_initial_request_(sent_initial_request) {
|
223
|
+
ResourceTimer(const XdsResourceType* type, const XdsResourceName& name)
|
224
|
+
: type_(type), name_(name) {
|
154
225
|
GRPC_CLOSURE_INIT(&timer_callback_, OnTimer, this,
|
155
226
|
grpc_schedule_on_exec_ctx);
|
156
227
|
}
|
157
228
|
|
158
229
|
void Orphan() override {
|
159
|
-
|
230
|
+
MaybeCancelTimer();
|
160
231
|
Unref(DEBUG_LOCATION, "Orphan");
|
161
232
|
}
|
162
233
|
|
163
|
-
void
|
164
|
-
if (
|
165
|
-
|
234
|
+
void MaybeStartTimer(RefCountedPtr<AdsCallState> ads_calld) {
|
235
|
+
if (timer_started_) return;
|
236
|
+
timer_started_ = true;
|
166
237
|
ads_calld_ = std::move(ads_calld);
|
167
238
|
Ref(DEBUG_LOCATION, "timer").release();
|
168
239
|
timer_pending_ = true;
|
@@ -172,7 +243,7 @@ class XdsClient::ChannelState::AdsCallState
|
|
172
243
|
&timer_callback_);
|
173
244
|
}
|
174
245
|
|
175
|
-
void
|
246
|
+
void MaybeCancelTimer() {
|
176
247
|
if (timer_pending_) {
|
177
248
|
grpc_timer_cancel(&timer_);
|
178
249
|
timer_pending_ = false;
|
@@ -181,11 +252,12 @@ class XdsClient::ChannelState::AdsCallState
|
|
181
252
|
|
182
253
|
private:
|
183
254
|
static void OnTimer(void* arg, grpc_error_handle error) {
|
184
|
-
|
255
|
+
ResourceTimer* self = static_cast<ResourceTimer*>(arg);
|
185
256
|
{
|
186
257
|
MutexLock lock(&self->ads_calld_->xds_client()->mu_);
|
187
258
|
self->OnTimerLocked(GRPC_ERROR_REF(error));
|
188
259
|
}
|
260
|
+
self->ads_calld_->xds_client()->work_serializer_.DrainQueue();
|
189
261
|
self->ads_calld_.reset();
|
190
262
|
self->Unref(DEBUG_LOCATION, "timer");
|
191
263
|
}
|
@@ -197,51 +269,33 @@ class XdsClient::ChannelState::AdsCallState
|
|
197
269
|
grpc_error_handle watcher_error =
|
198
270
|
GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
|
199
271
|
"timeout obtaining resource {type=%s name=%s} from xds server",
|
200
|
-
|
272
|
+
type_->type_url(),
|
273
|
+
XdsClient::ConstructFullXdsResourceName(
|
274
|
+
name_.authority, type_->type_url(), name_.key)));
|
201
275
|
watcher_error = grpc_error_set_int(
|
202
276
|
watcher_error, GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
|
203
277
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
204
|
-
gpr_log(GPR_INFO, "[xds_client %p] %s",
|
278
|
+
gpr_log(GPR_INFO, "[xds_client %p] xds server %s: %s",
|
279
|
+
ads_calld_->xds_client(),
|
280
|
+
ads_calld_->chand()->server_.server_uri.c_str(),
|
205
281
|
grpc_error_std_string(watcher_error).c_str());
|
206
282
|
}
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
RouteConfigState& state =
|
215
|
-
ads_calld_->xds_client()->route_config_map_[name_];
|
216
|
-
state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
|
217
|
-
for (const auto& p : state.watchers) {
|
218
|
-
p.first->OnError(GRPC_ERROR_REF(watcher_error));
|
219
|
-
}
|
220
|
-
} else if (type_url_ == XdsApi::kCdsTypeUrl) {
|
221
|
-
ClusterState& state = ads_calld_->xds_client()->cluster_map_[name_];
|
222
|
-
state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
|
223
|
-
for (const auto& p : state.watchers) {
|
224
|
-
p.first->OnError(GRPC_ERROR_REF(watcher_error));
|
225
|
-
}
|
226
|
-
} else if (type_url_ == XdsApi::kEdsTypeUrl) {
|
227
|
-
EndpointState& state = ads_calld_->xds_client()->endpoint_map_[name_];
|
228
|
-
state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
|
229
|
-
for (const auto& p : state.watchers) {
|
230
|
-
p.first->OnError(GRPC_ERROR_REF(watcher_error));
|
231
|
-
}
|
232
|
-
} else {
|
233
|
-
GPR_UNREACHABLE_CODE(return );
|
234
|
-
}
|
235
|
-
GRPC_ERROR_UNREF(watcher_error);
|
283
|
+
auto& authority_state =
|
284
|
+
ads_calld_->xds_client()->authority_state_map_[name_.authority];
|
285
|
+
ResourceState& state = authority_state.resource_map[type_][name_.key];
|
286
|
+
state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
|
287
|
+
Notifier::ScheduleNotifyWatchersOnErrorInWorkSerializer(
|
288
|
+
ads_calld_->xds_client(), state.watchers, watcher_error,
|
289
|
+
DEBUG_LOCATION);
|
236
290
|
}
|
237
291
|
GRPC_ERROR_UNREF(error);
|
238
292
|
}
|
239
293
|
|
240
|
-
const
|
241
|
-
const
|
294
|
+
const XdsResourceType* type_;
|
295
|
+
const XdsResourceName name_;
|
242
296
|
|
243
297
|
RefCountedPtr<AdsCallState> ads_calld_;
|
244
|
-
bool
|
298
|
+
bool timer_started_ = false;
|
245
299
|
bool timer_pending_ = false;
|
246
300
|
grpc_timer timer_;
|
247
301
|
grpc_closure timer_callback_;
|
@@ -255,32 +309,12 @@ class XdsClient::ChannelState::AdsCallState
|
|
255
309
|
grpc_error_handle error = GRPC_ERROR_NONE;
|
256
310
|
|
257
311
|
// Subscribed resources of this type.
|
258
|
-
std::map<std::string /*
|
312
|
+
std::map<std::string /*authority*/,
|
313
|
+
std::map<XdsResourceKey, OrphanablePtr<ResourceTimer>>>
|
259
314
|
subscribed_resources;
|
260
315
|
};
|
261
316
|
|
262
|
-
void SendMessageLocked(const
|
263
|
-
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
264
|
-
|
265
|
-
void AcceptLdsUpdateLocked(std::string version, grpc_millis update_time,
|
266
|
-
XdsApi::LdsUpdateMap lds_update_map,
|
267
|
-
const std::set<std::string>& resource_names_failed)
|
268
|
-
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
269
|
-
void AcceptRdsUpdateLocked(std::string version, grpc_millis update_time,
|
270
|
-
XdsApi::RdsUpdateMap rds_update_map)
|
271
|
-
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
272
|
-
void AcceptCdsUpdateLocked(std::string version, grpc_millis update_time,
|
273
|
-
XdsApi::CdsUpdateMap cds_update_map,
|
274
|
-
const std::set<std::string>& resource_names_failed)
|
275
|
-
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
276
|
-
void AcceptEdsUpdateLocked(std::string version, grpc_millis update_time,
|
277
|
-
XdsApi::EdsUpdateMap eds_update_map)
|
278
|
-
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
279
|
-
|
280
|
-
template <typename StateMap>
|
281
|
-
void RejectAdsUpdateLocked(grpc_millis update_time,
|
282
|
-
const XdsApi::AdsParseResult& result,
|
283
|
-
StateMap* state_map)
|
317
|
+
void SendMessageLocked(const XdsResourceType* type)
|
284
318
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
285
319
|
|
286
320
|
static void OnRequestSent(void* arg, grpc_error_handle error);
|
@@ -295,8 +329,9 @@ class XdsClient::ChannelState::AdsCallState
|
|
295
329
|
|
296
330
|
bool IsCurrentCallOnChannel() const;
|
297
331
|
|
298
|
-
|
299
|
-
|
332
|
+
// Constructs a list of resource names of a given type for an ADS
|
333
|
+
// request. Also starts the timer for each resource if needed.
|
334
|
+
std::vector<std::string> ResourceNamesForRequest(const XdsResourceType* type);
|
300
335
|
|
301
336
|
// The owning RetryableCall<>.
|
302
337
|
RefCountedPtr<RetryableCall<AdsCallState>> parent_;
|
@@ -325,10 +360,10 @@ class XdsClient::ChannelState::AdsCallState
|
|
325
360
|
grpc_closure on_status_received_;
|
326
361
|
|
327
362
|
// Resource types for which requests need to be sent.
|
328
|
-
std::set<
|
363
|
+
std::set<const XdsResourceType*> buffered_requests_;
|
329
364
|
|
330
365
|
// State for each resource type.
|
331
|
-
std::map<
|
366
|
+
std::map<const XdsResourceType*, ResourceTypeState> state_map_;
|
332
367
|
};
|
333
368
|
|
334
369
|
// Contains an LRS call to the xds server.
|
@@ -441,27 +476,31 @@ class XdsClient::ChannelState::LrsCallState
|
|
441
476
|
class XdsClient::ChannelState::StateWatcher
|
442
477
|
: public AsyncConnectivityStateWatcherInterface {
|
443
478
|
public:
|
444
|
-
explicit StateWatcher(
|
479
|
+
explicit StateWatcher(WeakRefCountedPtr<ChannelState> parent)
|
445
480
|
: parent_(std::move(parent)) {}
|
446
481
|
|
447
482
|
private:
|
448
483
|
void OnConnectivityStateChange(grpc_connectivity_state new_state,
|
449
484
|
const absl::Status& status) override {
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
485
|
+
{
|
486
|
+
MutexLock lock(&parent_->xds_client_->mu_);
|
487
|
+
if (!parent_->shutting_down_ &&
|
488
|
+
new_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
|
489
|
+
// In TRANSIENT_FAILURE. Notify all watchers of error.
|
490
|
+
gpr_log(GPR_INFO,
|
491
|
+
"[xds_client %p] xds channel for server %s in "
|
492
|
+
"state TRANSIENT_FAILURE: %s",
|
493
|
+
parent_->xds_client(), parent_->server_.server_uri.c_str(),
|
494
|
+
status.ToString().c_str());
|
495
|
+
parent_->xds_client_->NotifyOnErrorLocked(
|
496
|
+
GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
497
|
+
"xds channel in TRANSIENT_FAILURE"));
|
498
|
+
}
|
461
499
|
}
|
500
|
+
parent_->xds_client()->work_serializer_.DrainQueue();
|
462
501
|
}
|
463
502
|
|
464
|
-
|
503
|
+
WeakRefCountedPtr<ChannelState> parent_;
|
465
504
|
};
|
466
505
|
|
467
506
|
//
|
@@ -473,8 +512,8 @@ namespace {
|
|
473
512
|
grpc_channel* CreateXdsChannel(grpc_channel_args* args,
|
474
513
|
const XdsBootstrap::XdsServer& server) {
|
475
514
|
RefCountedPtr<grpc_channel_credentials> channel_creds =
|
476
|
-
XdsChannelCredsRegistry::
|
477
|
-
|
515
|
+
XdsChannelCredsRegistry::CreateXdsChannelCreds(
|
516
|
+
server.channel_creds_type, server.channel_creds_config);
|
478
517
|
return grpc_secure_channel_create(channel_creds.get(),
|
479
518
|
server.server_uri.c_str(), args, nullptr);
|
480
519
|
}
|
@@ -483,7 +522,7 @@ grpc_channel* CreateXdsChannel(grpc_channel_args* args,
|
|
483
522
|
|
484
523
|
XdsClient::ChannelState::ChannelState(WeakRefCountedPtr<XdsClient> xds_client,
|
485
524
|
const XdsBootstrap::XdsServer& server)
|
486
|
-
:
|
525
|
+
: DualRefCounted<ChannelState>(
|
487
526
|
GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace)
|
488
527
|
? "ChannelState"
|
489
528
|
: nullptr),
|
@@ -500,19 +539,26 @@ XdsClient::ChannelState::ChannelState(WeakRefCountedPtr<XdsClient> xds_client,
|
|
500
539
|
|
501
540
|
XdsClient::ChannelState::~ChannelState() {
|
502
541
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
503
|
-
gpr_log(GPR_INFO, "[xds_client %p]
|
504
|
-
this);
|
542
|
+
gpr_log(GPR_INFO, "[xds_client %p] destroying xds channel %p for server %s",
|
543
|
+
xds_client(), this, server_.server_uri.c_str());
|
505
544
|
}
|
506
545
|
grpc_channel_destroy(channel_);
|
507
546
|
xds_client_.reset(DEBUG_LOCATION, "ChannelState");
|
508
547
|
}
|
509
548
|
|
510
|
-
|
549
|
+
// This method should only ever be called when holding the lock, but we can't
|
550
|
+
// use a ABSL_EXCLUSIVE_LOCKS_REQUIRED annotation, because Orphan() will be
|
551
|
+
// called from DualRefCounted::Unref, which cannot have a lock annotation for a
|
552
|
+
// lock in this subclass.
|
553
|
+
void XdsClient::ChannelState::Orphan() ABSL_NO_THREAD_SAFETY_ANALYSIS {
|
511
554
|
shutting_down_ = true;
|
512
555
|
CancelConnectivityWatchLocked();
|
556
|
+
// At this time, all strong refs are removed, remove from channel map to
|
557
|
+
// prevent subsequent subscription from trying to use this ChannelState as it
|
558
|
+
// is shutting down.
|
559
|
+
xds_client_->xds_server_channel_map_.erase(server_);
|
513
560
|
ads_calld_.reset();
|
514
561
|
lrs_calld_.reset();
|
515
|
-
Unref(DEBUG_LOCATION, "ChannelState+orphaned");
|
516
562
|
}
|
517
563
|
|
518
564
|
XdsClient::ChannelState::AdsCallState* XdsClient::ChannelState::ads_calld()
|
@@ -531,8 +577,8 @@ bool XdsClient::ChannelState::HasActiveAdsCall() const {
|
|
531
577
|
|
532
578
|
void XdsClient::ChannelState::MaybeStartLrsCall() {
|
533
579
|
if (lrs_calld_ != nullptr) return;
|
534
|
-
lrs_calld_.reset(
|
535
|
-
|
580
|
+
lrs_calld_.reset(new RetryableCall<LrsCallState>(
|
581
|
+
WeakRef(DEBUG_LOCATION, "ChannelState+lrs")));
|
536
582
|
}
|
537
583
|
|
538
584
|
void XdsClient::ChannelState::StopLrsCall() { lrs_calld_.reset(); }
|
@@ -540,7 +586,7 @@ void XdsClient::ChannelState::StopLrsCall() { lrs_calld_.reset(); }
|
|
540
586
|
void XdsClient::ChannelState::StartConnectivityWatchLocked() {
|
541
587
|
ClientChannel* client_channel = ClientChannel::GetFromChannel(channel_);
|
542
588
|
GPR_ASSERT(client_channel != nullptr);
|
543
|
-
watcher_ = new StateWatcher(
|
589
|
+
watcher_ = new StateWatcher(WeakRef(DEBUG_LOCATION, "ChannelState+watch"));
|
544
590
|
client_channel->AddConnectivityWatcher(
|
545
591
|
GRPC_CHANNEL_IDLE,
|
546
592
|
OrphanablePtr<AsyncConnectivityStateWatcherInterface>(watcher_));
|
@@ -552,12 +598,12 @@ void XdsClient::ChannelState::CancelConnectivityWatchLocked() {
|
|
552
598
|
client_channel->RemoveConnectivityWatcher(watcher_);
|
553
599
|
}
|
554
600
|
|
555
|
-
void XdsClient::ChannelState::SubscribeLocked(const
|
556
|
-
const
|
601
|
+
void XdsClient::ChannelState::SubscribeLocked(const XdsResourceType* type,
|
602
|
+
const XdsResourceName& name) {
|
557
603
|
if (ads_calld_ == nullptr) {
|
558
604
|
// Start the ADS call if this is the first request.
|
559
605
|
ads_calld_.reset(new RetryableCall<AdsCallState>(
|
560
|
-
|
606
|
+
WeakRef(DEBUG_LOCATION, "ChannelState+ads")));
|
561
607
|
// Note: AdsCallState's ctor will automatically subscribe to all
|
562
608
|
// resources that the XdsClient already has watchers for, so we can
|
563
609
|
// return here.
|
@@ -567,17 +613,19 @@ void XdsClient::ChannelState::SubscribeLocked(const std::string& type_url,
|
|
567
613
|
// because when the call is restarted it will resend all necessary requests.
|
568
614
|
if (ads_calld() == nullptr) return;
|
569
615
|
// Subscribe to this resource if the ADS call is active.
|
570
|
-
ads_calld()->SubscribeLocked(
|
616
|
+
ads_calld()->SubscribeLocked(type, name);
|
571
617
|
}
|
572
618
|
|
573
|
-
void XdsClient::ChannelState::UnsubscribeLocked(const
|
574
|
-
const
|
619
|
+
void XdsClient::ChannelState::UnsubscribeLocked(const XdsResourceType* type,
|
620
|
+
const XdsResourceName& name,
|
575
621
|
bool delay_unsubscription) {
|
576
622
|
if (ads_calld_ != nullptr) {
|
577
623
|
auto* calld = ads_calld_->calld();
|
578
624
|
if (calld != nullptr) {
|
579
|
-
calld->UnsubscribeLocked(
|
580
|
-
if (!calld->HasSubscribedResources())
|
625
|
+
calld->UnsubscribeLocked(type, name, delay_unsubscription);
|
626
|
+
if (!calld->HasSubscribedResources()) {
|
627
|
+
ads_calld_.reset();
|
628
|
+
}
|
581
629
|
}
|
582
630
|
}
|
583
631
|
}
|
@@ -588,7 +636,7 @@ void XdsClient::ChannelState::UnsubscribeLocked(const std::string& type_url,
|
|
588
636
|
|
589
637
|
template <typename T>
|
590
638
|
XdsClient::ChannelState::RetryableCall<T>::RetryableCall(
|
591
|
-
|
639
|
+
WeakRefCountedPtr<ChannelState> chand)
|
592
640
|
: chand_(std::move(chand)),
|
593
641
|
backoff_(
|
594
642
|
BackOff::Options()
|
@@ -632,10 +680,10 @@ void XdsClient::ChannelState::RetryableCall<T>::StartNewCallLocked() {
|
|
632
680
|
GPR_ASSERT(chand_->channel_ != nullptr);
|
633
681
|
GPR_ASSERT(calld_ == nullptr);
|
634
682
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
635
|
-
gpr_log(
|
636
|
-
|
637
|
-
|
638
|
-
|
683
|
+
gpr_log(
|
684
|
+
GPR_INFO,
|
685
|
+
"[xds_client %p] xds server %s: start new call from retryable call %p",
|
686
|
+
chand()->xds_client(), chand()->server_.server_uri.c_str(), this);
|
639
687
|
}
|
640
688
|
calld_ = MakeOrphanable<T>(
|
641
689
|
this->Ref(DEBUG_LOCATION, "RetryableCall+start_new_call"));
|
@@ -646,11 +694,13 @@ void XdsClient::ChannelState::RetryableCall<T>::StartRetryTimerLocked() {
|
|
646
694
|
if (shutting_down_) return;
|
647
695
|
const grpc_millis next_attempt_time = backoff_.NextAttemptTime();
|
648
696
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
649
|
-
grpc_millis timeout =
|
697
|
+
grpc_millis timeout =
|
698
|
+
std::max(next_attempt_time - ExecCtx::Get()->Now(), grpc_millis(0));
|
650
699
|
gpr_log(GPR_INFO,
|
651
|
-
"[xds_client %p]
|
700
|
+
"[xds_client %p] xds server %s: call attempt failed; "
|
652
701
|
"retry timer will fire in %" PRId64 "ms.",
|
653
|
-
chand()->xds_client(), chand(),
|
702
|
+
chand()->xds_client(), chand()->server_.server_uri.c_str(),
|
703
|
+
timeout);
|
654
704
|
}
|
655
705
|
this->Ref(DEBUG_LOCATION, "RetryableCall+retry_timer_start").release();
|
656
706
|
grpc_timer_init(&retry_timer_, next_attempt_time, &on_retry_timer_);
|
@@ -674,16 +724,183 @@ void XdsClient::ChannelState::RetryableCall<T>::OnRetryTimerLocked(
|
|
674
724
|
retry_timer_callback_pending_ = false;
|
675
725
|
if (!shutting_down_ && error == GRPC_ERROR_NONE) {
|
676
726
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
677
|
-
gpr_log(
|
678
|
-
|
679
|
-
|
680
|
-
|
727
|
+
gpr_log(GPR_INFO,
|
728
|
+
"[xds_client %p] xds server %s: retry timer fired (retryable "
|
729
|
+
"call: %p)",
|
730
|
+
chand()->xds_client(), chand()->server_.server_uri.c_str(), this);
|
681
731
|
}
|
682
732
|
StartNewCallLocked();
|
683
733
|
}
|
684
734
|
GRPC_ERROR_UNREF(error);
|
685
735
|
}
|
686
736
|
|
737
|
+
//
|
738
|
+
// XdsClient::ChannelState::AdsCallState::AdsResponseParser
|
739
|
+
//
|
740
|
+
|
741
|
+
absl::Status XdsClient::ChannelState::AdsCallState::AdsResponseParser::
|
742
|
+
ProcessAdsResponseFields(AdsResponseFields fields) {
|
743
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
744
|
+
gpr_log(
|
745
|
+
GPR_INFO,
|
746
|
+
"[xds_client %p] xds server %s: received ADS response: type_url=%s, "
|
747
|
+
"version=%s, nonce=%s, num_resources=%" PRIuPTR,
|
748
|
+
ads_call_state_->xds_client(),
|
749
|
+
ads_call_state_->chand()->server_.server_uri.c_str(),
|
750
|
+
fields.type_url.c_str(), fields.version.c_str(), fields.nonce.c_str(),
|
751
|
+
fields.num_resources);
|
752
|
+
}
|
753
|
+
result_.type =
|
754
|
+
ads_call_state_->xds_client()->GetResourceTypeLocked(fields.type_url);
|
755
|
+
if (result_.type == nullptr) {
|
756
|
+
return absl::InvalidArgumentError(
|
757
|
+
absl::StrCat("unknown resource type ", fields.type_url));
|
758
|
+
}
|
759
|
+
result_.type_url = std::move(fields.type_url);
|
760
|
+
result_.version = std::move(fields.version);
|
761
|
+
result_.nonce = std::move(fields.nonce);
|
762
|
+
return absl::OkStatus();
|
763
|
+
}
|
764
|
+
|
765
|
+
namespace {
|
766
|
+
|
767
|
+
// Build a resource metadata struct for ADS result accepting methods and CSDS.
|
768
|
+
XdsApi::ResourceMetadata CreateResourceMetadataAcked(
|
769
|
+
std::string serialized_proto, std::string version,
|
770
|
+
grpc_millis update_time) {
|
771
|
+
XdsApi::ResourceMetadata resource_metadata;
|
772
|
+
resource_metadata.serialized_proto = std::move(serialized_proto);
|
773
|
+
resource_metadata.update_time = update_time;
|
774
|
+
resource_metadata.version = std::move(version);
|
775
|
+
resource_metadata.client_status = XdsApi::ResourceMetadata::ACKED;
|
776
|
+
return resource_metadata;
|
777
|
+
}
|
778
|
+
|
779
|
+
// Update resource_metadata for NACK.
|
780
|
+
void UpdateResourceMetadataNacked(const std::string& version,
|
781
|
+
const std::string& details,
|
782
|
+
grpc_millis update_time,
|
783
|
+
XdsApi::ResourceMetadata* resource_metadata) {
|
784
|
+
resource_metadata->client_status = XdsApi::ResourceMetadata::NACKED;
|
785
|
+
resource_metadata->failed_version = version;
|
786
|
+
resource_metadata->failed_details = details;
|
787
|
+
resource_metadata->failed_update_time = update_time;
|
788
|
+
}
|
789
|
+
|
790
|
+
} // namespace
|
791
|
+
|
792
|
+
void XdsClient::ChannelState::AdsCallState::AdsResponseParser::ParseResource(
|
793
|
+
const XdsEncodingContext& context, size_t idx, absl::string_view type_url,
|
794
|
+
absl::string_view serialized_resource) {
|
795
|
+
// Check the type_url of the resource.
|
796
|
+
bool is_v2 = false;
|
797
|
+
if (!result_.type->IsType(type_url, &is_v2)) {
|
798
|
+
result_.errors.emplace_back(
|
799
|
+
absl::StrCat("resource index ", idx, ": incorrect resource type ",
|
800
|
+
type_url, " (should be ", result_.type_url, ")"));
|
801
|
+
return;
|
802
|
+
}
|
803
|
+
// Parse the resource.
|
804
|
+
absl::StatusOr<XdsResourceType::DecodeResult> result =
|
805
|
+
result_.type->Decode(context, serialized_resource, is_v2);
|
806
|
+
if (!result.ok()) {
|
807
|
+
result_.errors.emplace_back(
|
808
|
+
absl::StrCat("resource index ", idx, ": ", result.status().ToString()));
|
809
|
+
return;
|
810
|
+
}
|
811
|
+
// Check the resource name.
|
812
|
+
auto resource_name =
|
813
|
+
XdsClient::ParseXdsResourceName(result->name, result_.type);
|
814
|
+
if (!resource_name.ok()) {
|
815
|
+
result_.errors.emplace_back(absl::StrCat(
|
816
|
+
"resource index ", idx, ": Cannot parse xDS resource name \"",
|
817
|
+
result->name, "\""));
|
818
|
+
return;
|
819
|
+
}
|
820
|
+
// Cancel resource-does-not-exist timer, if needed.
|
821
|
+
auto timer_it = ads_call_state_->state_map_.find(result_.type);
|
822
|
+
if (timer_it != ads_call_state_->state_map_.end()) {
|
823
|
+
auto it =
|
824
|
+
timer_it->second.subscribed_resources.find(resource_name->authority);
|
825
|
+
if (it != timer_it->second.subscribed_resources.end()) {
|
826
|
+
auto res_it = it->second.find(resource_name->key);
|
827
|
+
if (res_it != it->second.end()) {
|
828
|
+
res_it->second->MaybeCancelTimer();
|
829
|
+
}
|
830
|
+
}
|
831
|
+
}
|
832
|
+
// Lookup the authority in the cache.
|
833
|
+
auto authority_it =
|
834
|
+
xds_client()->authority_state_map_.find(resource_name->authority);
|
835
|
+
if (authority_it == xds_client()->authority_state_map_.end()) {
|
836
|
+
return; // Skip resource -- we don't have a subscription for it.
|
837
|
+
}
|
838
|
+
// Found authority, so look up type.
|
839
|
+
AuthorityState& authority_state = authority_it->second;
|
840
|
+
auto type_it = authority_state.resource_map.find(result_.type);
|
841
|
+
if (type_it == authority_state.resource_map.end()) {
|
842
|
+
return; // Skip resource -- we don't have a subscription for it.
|
843
|
+
}
|
844
|
+
auto& type_map = type_it->second;
|
845
|
+
// Found type, so look up resource key.
|
846
|
+
auto it = type_map.find(resource_name->key);
|
847
|
+
if (it == type_map.end()) {
|
848
|
+
return; // Skip resource -- we don't have a subscription for it.
|
849
|
+
}
|
850
|
+
ResourceState& resource_state = it->second;
|
851
|
+
// If needed, record that we've seen this resource.
|
852
|
+
if (result_.type->AllResourcesRequiredInSotW()) {
|
853
|
+
result_.resources_seen[resource_name->authority].insert(resource_name->key);
|
854
|
+
}
|
855
|
+
// Update resource state based on whether the resource is valid.
|
856
|
+
if (!result->resource.ok()) {
|
857
|
+
result_.errors.emplace_back(absl::StrCat(
|
858
|
+
"resource index ", idx, ": ", result->name,
|
859
|
+
": validation error: ", result->resource.status().ToString()));
|
860
|
+
Notifier::ScheduleNotifyWatchersOnErrorInWorkSerializer(
|
861
|
+
xds_client(), resource_state.watchers,
|
862
|
+
grpc_error_set_int(
|
863
|
+
GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
|
864
|
+
"invalid resource: ", result->resource.status().ToString())),
|
865
|
+
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE),
|
866
|
+
DEBUG_LOCATION);
|
867
|
+
UpdateResourceMetadataNacked(result_.version,
|
868
|
+
result->resource.status().ToString(),
|
869
|
+
update_time_, &resource_state.meta);
|
870
|
+
return;
|
871
|
+
}
|
872
|
+
// Resource is valid.
|
873
|
+
result_.have_valid_resources = true;
|
874
|
+
// If it didn't change, ignore it.
|
875
|
+
if (resource_state.resource != nullptr &&
|
876
|
+
result_.type->ResourcesEqual(resource_state.resource.get(),
|
877
|
+
result->resource->get())) {
|
878
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
879
|
+
gpr_log(GPR_INFO,
|
880
|
+
"[xds_client %p] %s resource %s identical to current, ignoring.",
|
881
|
+
xds_client(), result_.type_url.c_str(), result->name.c_str());
|
882
|
+
}
|
883
|
+
return;
|
884
|
+
}
|
885
|
+
// Update the resource state.
|
886
|
+
resource_state.resource = std::move(*result->resource);
|
887
|
+
resource_state.meta = CreateResourceMetadataAcked(
|
888
|
+
std::string(serialized_resource), result_.version, update_time_);
|
889
|
+
// Notify watchers.
|
890
|
+
auto& watchers_list = resource_state.watchers;
|
891
|
+
auto* value =
|
892
|
+
result_.type->CopyResource(resource_state.resource.get()).release();
|
893
|
+
xds_client()->work_serializer_.Schedule(
|
894
|
+
[watchers_list, value]()
|
895
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client()->work_serializer_) {
|
896
|
+
for (const auto& p : watchers_list) {
|
897
|
+
p.first->OnGenericResourceChanged(value);
|
898
|
+
}
|
899
|
+
delete value;
|
900
|
+
},
|
901
|
+
DEBUG_LOCATION);
|
902
|
+
}
|
903
|
+
|
687
904
|
//
|
688
905
|
// XdsClient::ChannelState::AdsCallState
|
689
906
|
//
|
@@ -700,13 +917,16 @@ XdsClient::ChannelState::AdsCallState::AdsCallState(
|
|
700
917
|
// the polling entities from client_channel.
|
701
918
|
GPR_ASSERT(xds_client() != nullptr);
|
702
919
|
// Create a call with the specified method name.
|
703
|
-
const
|
920
|
+
const char* method =
|
704
921
|
chand()->server_.ShouldUseV3()
|
705
|
-
?
|
706
|
-
|
922
|
+
? "/envoy.service.discovery.v3.AggregatedDiscoveryService/"
|
923
|
+
"StreamAggregatedResources"
|
924
|
+
: "/envoy.service.discovery.v2.AggregatedDiscoveryService/"
|
925
|
+
"StreamAggregatedResources";
|
707
926
|
call_ = grpc_channel_create_pollset_set_call(
|
708
927
|
chand()->channel_, nullptr, GRPC_PROPAGATE_DEFAULTS,
|
709
|
-
xds_client()->interested_parties_,
|
928
|
+
xds_client()->interested_parties_,
|
929
|
+
StaticSlice::FromStaticString(method).c_slice(), nullptr,
|
710
930
|
GRPC_MILLIS_INF_FUTURE, nullptr);
|
711
931
|
GPR_ASSERT(call_ != nullptr);
|
712
932
|
// Init data associated with the call.
|
@@ -715,9 +935,9 @@ XdsClient::ChannelState::AdsCallState::AdsCallState(
|
|
715
935
|
// Start the call.
|
716
936
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
717
937
|
gpr_log(GPR_INFO,
|
718
|
-
"[xds_client %p]
|
719
|
-
"call: %p)",
|
720
|
-
xds_client(), chand(), this, call_);
|
938
|
+
"[xds_client %p] xds server %s: starting ADS call "
|
939
|
+
"(calld: %p, call: %p)",
|
940
|
+
xds_client(), chand()->server_.server_uri.c_str(), this, call_);
|
721
941
|
}
|
722
942
|
// Create the ops.
|
723
943
|
grpc_call_error call_error;
|
@@ -737,17 +957,17 @@ XdsClient::ChannelState::AdsCallState::AdsCallState(
|
|
737
957
|
// Op: send request message.
|
738
958
|
GRPC_CLOSURE_INIT(&on_request_sent_, OnRequestSent, this,
|
739
959
|
grpc_schedule_on_exec_ctx);
|
740
|
-
for (const auto&
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
960
|
+
for (const auto& a : xds_client()->authority_state_map_) {
|
961
|
+
const std::string& authority = a.first;
|
962
|
+
// Skip authorities that are not using this xDS channel.
|
963
|
+
if (a.second.channel_state != chand()) continue;
|
964
|
+
for (const auto& t : a.second.resource_map) {
|
965
|
+
const XdsResourceType* type = t.first;
|
966
|
+
for (const auto& r : t.second) {
|
967
|
+
const XdsResourceKey& resource_key = r.first;
|
968
|
+
SubscribeLocked(type, {authority, resource_key});
|
969
|
+
}
|
970
|
+
}
|
751
971
|
}
|
752
972
|
// Op: recv initial metadata.
|
753
973
|
op = ops;
|
@@ -811,34 +1031,30 @@ void XdsClient::ChannelState::AdsCallState::Orphan() {
|
|
811
1031
|
}
|
812
1032
|
|
813
1033
|
void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
|
814
|
-
const
|
1034
|
+
const XdsResourceType* type)
|
815
1035
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_) {
|
816
1036
|
// Buffer message sending if an existing message is in flight.
|
817
1037
|
if (send_message_payload_ != nullptr) {
|
818
|
-
buffered_requests_.insert(
|
1038
|
+
buffered_requests_.insert(type);
|
819
1039
|
return;
|
820
1040
|
}
|
821
|
-
auto& state = state_map_[
|
1041
|
+
auto& state = state_map_[type];
|
822
1042
|
grpc_slice request_payload_slice;
|
823
|
-
std::set<absl::string_view> resource_names =
|
824
|
-
ResourceNamesForRequest(type_url);
|
825
1043
|
request_payload_slice = xds_client()->api_.CreateAdsRequest(
|
826
|
-
chand()->server_,
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
state_map_.erase(type_url);
|
832
|
-
}
|
1044
|
+
chand()->server_,
|
1045
|
+
chand()->server_.ShouldUseV3() ? type->type_url() : type->v2_type_url(),
|
1046
|
+
chand()->resource_type_version_map_[type], state.nonce,
|
1047
|
+
ResourceNamesForRequest(type), GRPC_ERROR_REF(state.error),
|
1048
|
+
!sent_initial_message_);
|
833
1049
|
sent_initial_message_ = true;
|
834
1050
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
835
1051
|
gpr_log(GPR_INFO,
|
836
|
-
"[xds_client %p] sending ADS request: type=%s
|
837
|
-
"
|
838
|
-
xds_client(),
|
839
|
-
|
840
|
-
|
841
|
-
|
1052
|
+
"[xds_client %p] xds server %s: sending ADS request: type=%s "
|
1053
|
+
"version=%s nonce=%s error=%s",
|
1054
|
+
xds_client(), chand()->server_.server_uri.c_str(),
|
1055
|
+
std::string(type->type_url()).c_str(),
|
1056
|
+
chand()->resource_type_version_map_[type].c_str(),
|
1057
|
+
state.nonce.c_str(), grpc_error_std_string(state.error).c_str());
|
842
1058
|
}
|
843
1059
|
GRPC_ERROR_UNREF(state.error);
|
844
1060
|
state.error = GRPC_ERROR_NONE;
|
@@ -858,27 +1074,33 @@ void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
|
|
858
1074
|
grpc_call_start_batch_and_execute(call_, &op, 1, &on_request_sent_);
|
859
1075
|
if (GPR_UNLIKELY(call_error != GRPC_CALL_OK)) {
|
860
1076
|
gpr_log(GPR_ERROR,
|
861
|
-
"[xds_client %p]
|
862
|
-
|
1077
|
+
"[xds_client %p] xds server %s: error starting ADS send_message "
|
1078
|
+
"batch on calld=%p: call_error=%d",
|
1079
|
+
xds_client(), chand()->server_.server_uri.c_str(), this,
|
1080
|
+
call_error);
|
863
1081
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
864
1082
|
}
|
865
1083
|
}
|
866
1084
|
|
867
1085
|
void XdsClient::ChannelState::AdsCallState::SubscribeLocked(
|
868
|
-
const
|
869
|
-
auto& state = state_map_[
|
1086
|
+
const XdsResourceType* type, const XdsResourceName& name) {
|
1087
|
+
auto& state = state_map_[type].subscribed_resources[name.authority][name.key];
|
870
1088
|
if (state == nullptr) {
|
871
|
-
state = MakeOrphanable<
|
872
|
-
|
873
|
-
SendMessageLocked(type_url);
|
1089
|
+
state = MakeOrphanable<ResourceTimer>(type, name);
|
1090
|
+
SendMessageLocked(type);
|
874
1091
|
}
|
875
1092
|
}
|
876
1093
|
|
877
1094
|
void XdsClient::ChannelState::AdsCallState::UnsubscribeLocked(
|
878
|
-
const
|
1095
|
+
const XdsResourceType* type, const XdsResourceName& name,
|
879
1096
|
bool delay_unsubscription) {
|
880
|
-
state_map_[
|
881
|
-
|
1097
|
+
auto& type_state_map = state_map_[type];
|
1098
|
+
auto& authority_map = type_state_map.subscribed_resources[name.authority];
|
1099
|
+
authority_map.erase(name.key);
|
1100
|
+
if (authority_map.empty()) {
|
1101
|
+
type_state_map.subscribed_resources.erase(name.authority);
|
1102
|
+
}
|
1103
|
+
if (!delay_unsubscription) SendMessageLocked(type);
|
882
1104
|
}
|
883
1105
|
|
884
1106
|
bool XdsClient::ChannelState::AdsCallState::HasSubscribedResources() const {
|
@@ -888,343 +1110,6 @@ bool XdsClient::ChannelState::AdsCallState::HasSubscribedResources() const {
|
|
888
1110
|
return false;
|
889
1111
|
}
|
890
1112
|
|
891
|
-
namespace {
|
892
|
-
|
893
|
-
// Build a resource metadata struct for ADS result accepting methods and CSDS.
|
894
|
-
XdsApi::ResourceMetadata CreateResourceMetadataAcked(
|
895
|
-
std::string serialized_proto, std::string version,
|
896
|
-
grpc_millis update_time) {
|
897
|
-
XdsApi::ResourceMetadata resource_metadata;
|
898
|
-
resource_metadata.serialized_proto = std::move(serialized_proto);
|
899
|
-
resource_metadata.update_time = update_time;
|
900
|
-
resource_metadata.version = std::move(version);
|
901
|
-
resource_metadata.client_status = XdsApi::ResourceMetadata::ACKED;
|
902
|
-
return resource_metadata;
|
903
|
-
}
|
904
|
-
|
905
|
-
} // namespace
|
906
|
-
|
907
|
-
void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdateLocked(
|
908
|
-
std::string version, grpc_millis update_time,
|
909
|
-
XdsApi::LdsUpdateMap lds_update_map,
|
910
|
-
const std::set<std::string>& resource_names_failed) {
|
911
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
912
|
-
gpr_log(GPR_INFO,
|
913
|
-
"[xds_client %p] LDS update received containing %" PRIuPTR
|
914
|
-
" resources",
|
915
|
-
xds_client(), lds_update_map.size());
|
916
|
-
}
|
917
|
-
auto& lds_state = state_map_[XdsApi::kLdsTypeUrl];
|
918
|
-
std::set<std::string> rds_resource_names_seen;
|
919
|
-
for (auto& p : lds_update_map) {
|
920
|
-
const std::string& listener_name = p.first;
|
921
|
-
XdsApi::LdsUpdate& lds_update = p.second.resource;
|
922
|
-
auto& state = lds_state.subscribed_resources[listener_name];
|
923
|
-
if (state != nullptr) state->Finish();
|
924
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
925
|
-
gpr_log(GPR_INFO, "[xds_client %p] LDS resource %s: %s", xds_client(),
|
926
|
-
listener_name.c_str(), lds_update.ToString().c_str());
|
927
|
-
}
|
928
|
-
// Record the RDS resource names seen.
|
929
|
-
if (!lds_update.http_connection_manager.route_config_name.empty()) {
|
930
|
-
rds_resource_names_seen.insert(
|
931
|
-
lds_update.http_connection_manager.route_config_name);
|
932
|
-
}
|
933
|
-
// Ignore identical update.
|
934
|
-
ListenerState& listener_state = xds_client()->listener_map_[listener_name];
|
935
|
-
if (listener_state.update.has_value() &&
|
936
|
-
*listener_state.update == lds_update) {
|
937
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
938
|
-
gpr_log(GPR_INFO,
|
939
|
-
"[xds_client %p] LDS update for %s identical to current, "
|
940
|
-
"ignoring.",
|
941
|
-
xds_client(), listener_name.c_str());
|
942
|
-
}
|
943
|
-
continue;
|
944
|
-
}
|
945
|
-
// Update the listener state.
|
946
|
-
listener_state.update = std::move(lds_update);
|
947
|
-
listener_state.meta = CreateResourceMetadataAcked(
|
948
|
-
std::move(p.second.serialized_proto), version, update_time);
|
949
|
-
// Notify watchers.
|
950
|
-
for (const auto& p : listener_state.watchers) {
|
951
|
-
p.first->OnListenerChanged(*listener_state.update);
|
952
|
-
}
|
953
|
-
}
|
954
|
-
// For invalid resources in the update, if they are already in the
|
955
|
-
// cache, pretend that they are present in the update, so that we
|
956
|
-
// don't incorrectly consider them deleted below.
|
957
|
-
for (const std::string& listener_name : resource_names_failed) {
|
958
|
-
auto it = xds_client()->listener_map_.find(listener_name);
|
959
|
-
if (it != xds_client()->listener_map_.end()) {
|
960
|
-
auto& resource = it->second.update;
|
961
|
-
if (!resource.has_value()) continue;
|
962
|
-
lds_update_map[listener_name];
|
963
|
-
if (!resource->http_connection_manager.route_config_name.empty()) {
|
964
|
-
rds_resource_names_seen.insert(
|
965
|
-
resource->http_connection_manager.route_config_name);
|
966
|
-
}
|
967
|
-
}
|
968
|
-
}
|
969
|
-
// For any subscribed resource that is not present in the update,
|
970
|
-
// remove it from the cache and notify watchers that it does not exist.
|
971
|
-
for (const auto& p : lds_state.subscribed_resources) {
|
972
|
-
const std::string& listener_name = p.first;
|
973
|
-
if (lds_update_map.find(listener_name) == lds_update_map.end()) {
|
974
|
-
ListenerState& listener_state =
|
975
|
-
xds_client()->listener_map_[listener_name];
|
976
|
-
// If the resource was newly requested but has not yet been received,
|
977
|
-
// we don't want to generate an error for the watchers, because this LDS
|
978
|
-
// response may be in reaction to an earlier request that did not yet
|
979
|
-
// request the new resource, so its absence from the response does not
|
980
|
-
// necessarily indicate that the resource does not exist.
|
981
|
-
// For that case, we rely on the request timeout instead.
|
982
|
-
if (!listener_state.update.has_value()) continue;
|
983
|
-
listener_state.update.reset();
|
984
|
-
for (const auto& p : listener_state.watchers) {
|
985
|
-
p.first->OnResourceDoesNotExist();
|
986
|
-
}
|
987
|
-
}
|
988
|
-
}
|
989
|
-
// For any RDS resource that is no longer referred to by any LDS
|
990
|
-
// resources, remove it from the cache and notify watchers that it
|
991
|
-
// does not exist.
|
992
|
-
auto& rds_state = state_map_[XdsApi::kRdsTypeUrl];
|
993
|
-
for (const auto& p : rds_state.subscribed_resources) {
|
994
|
-
const std::string& rds_resource_name = p.first;
|
995
|
-
if (rds_resource_names_seen.find(rds_resource_name) ==
|
996
|
-
rds_resource_names_seen.end()) {
|
997
|
-
RouteConfigState& route_config_state =
|
998
|
-
xds_client()->route_config_map_[rds_resource_name];
|
999
|
-
route_config_state.update.reset();
|
1000
|
-
for (const auto& p : route_config_state.watchers) {
|
1001
|
-
p.first->OnResourceDoesNotExist();
|
1002
|
-
}
|
1003
|
-
}
|
1004
|
-
}
|
1005
|
-
}
|
1006
|
-
|
1007
|
-
void XdsClient::ChannelState::AdsCallState::AcceptRdsUpdateLocked(
|
1008
|
-
std::string version, grpc_millis update_time,
|
1009
|
-
XdsApi::RdsUpdateMap rds_update_map) {
|
1010
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1011
|
-
gpr_log(GPR_INFO,
|
1012
|
-
"[xds_client %p] RDS update received containing %" PRIuPTR
|
1013
|
-
" resources",
|
1014
|
-
xds_client(), rds_update_map.size());
|
1015
|
-
}
|
1016
|
-
auto& rds_state = state_map_[XdsApi::kRdsTypeUrl];
|
1017
|
-
for (auto& p : rds_update_map) {
|
1018
|
-
const std::string& route_config_name = p.first;
|
1019
|
-
XdsApi::RdsUpdate& rds_update = p.second.resource;
|
1020
|
-
auto& state = rds_state.subscribed_resources[route_config_name];
|
1021
|
-
if (state != nullptr) state->Finish();
|
1022
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1023
|
-
gpr_log(GPR_INFO, "[xds_client %p] RDS resource:\n%s", xds_client(),
|
1024
|
-
rds_update.ToString().c_str());
|
1025
|
-
}
|
1026
|
-
RouteConfigState& route_config_state =
|
1027
|
-
xds_client()->route_config_map_[route_config_name];
|
1028
|
-
// Ignore identical update.
|
1029
|
-
if (route_config_state.update.has_value() &&
|
1030
|
-
*route_config_state.update == rds_update) {
|
1031
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1032
|
-
gpr_log(GPR_INFO,
|
1033
|
-
"[xds_client %p] RDS resource identical to current, ignoring",
|
1034
|
-
xds_client());
|
1035
|
-
}
|
1036
|
-
continue;
|
1037
|
-
}
|
1038
|
-
// Update the cache.
|
1039
|
-
route_config_state.update = std::move(rds_update);
|
1040
|
-
route_config_state.meta = CreateResourceMetadataAcked(
|
1041
|
-
std::move(p.second.serialized_proto), version, update_time);
|
1042
|
-
// Notify all watchers.
|
1043
|
-
for (const auto& p : route_config_state.watchers) {
|
1044
|
-
p.first->OnRouteConfigChanged(*route_config_state.update);
|
1045
|
-
}
|
1046
|
-
}
|
1047
|
-
}
|
1048
|
-
|
1049
|
-
void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdateLocked(
|
1050
|
-
std::string version, grpc_millis update_time,
|
1051
|
-
XdsApi::CdsUpdateMap cds_update_map,
|
1052
|
-
const std::set<std::string>& resource_names_failed) {
|
1053
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1054
|
-
gpr_log(GPR_INFO,
|
1055
|
-
"[xds_client %p] CDS update received containing %" PRIuPTR
|
1056
|
-
" resources",
|
1057
|
-
xds_client(), cds_update_map.size());
|
1058
|
-
}
|
1059
|
-
auto& cds_state = state_map_[XdsApi::kCdsTypeUrl];
|
1060
|
-
std::set<std::string> eds_resource_names_seen;
|
1061
|
-
for (auto& p : cds_update_map) {
|
1062
|
-
const char* cluster_name = p.first.c_str();
|
1063
|
-
XdsApi::CdsUpdate& cds_update = p.second.resource;
|
1064
|
-
auto& state = cds_state.subscribed_resources[cluster_name];
|
1065
|
-
if (state != nullptr) state->Finish();
|
1066
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1067
|
-
gpr_log(GPR_INFO, "[xds_client %p] cluster=%s: %s", xds_client(),
|
1068
|
-
cluster_name, cds_update.ToString().c_str());
|
1069
|
-
}
|
1070
|
-
// Record the EDS resource names seen.
|
1071
|
-
eds_resource_names_seen.insert(cds_update.eds_service_name.empty()
|
1072
|
-
? cluster_name
|
1073
|
-
: cds_update.eds_service_name);
|
1074
|
-
// Ignore identical update.
|
1075
|
-
ClusterState& cluster_state = xds_client()->cluster_map_[cluster_name];
|
1076
|
-
if (cluster_state.update.has_value() &&
|
1077
|
-
*cluster_state.update == cds_update) {
|
1078
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1079
|
-
gpr_log(GPR_INFO,
|
1080
|
-
"[xds_client %p] CDS update identical to current, ignoring.",
|
1081
|
-
xds_client());
|
1082
|
-
}
|
1083
|
-
continue;
|
1084
|
-
}
|
1085
|
-
// Update the cluster state.
|
1086
|
-
cluster_state.update = std::move(cds_update);
|
1087
|
-
cluster_state.meta = CreateResourceMetadataAcked(
|
1088
|
-
std::move(p.second.serialized_proto), version, update_time);
|
1089
|
-
// Notify all watchers.
|
1090
|
-
for (const auto& p : cluster_state.watchers) {
|
1091
|
-
p.first->OnClusterChanged(cluster_state.update.value());
|
1092
|
-
}
|
1093
|
-
}
|
1094
|
-
// For invalid resources in the update, if they are already in the
|
1095
|
-
// cache, pretend that they are present in the update, so that we
|
1096
|
-
// don't incorrectly consider them deleted below.
|
1097
|
-
for (const std::string& cluster_name : resource_names_failed) {
|
1098
|
-
auto it = xds_client()->cluster_map_.find(cluster_name);
|
1099
|
-
if (it != xds_client()->cluster_map_.end()) {
|
1100
|
-
auto& resource = it->second.update;
|
1101
|
-
if (!resource.has_value()) continue;
|
1102
|
-
cds_update_map[cluster_name];
|
1103
|
-
eds_resource_names_seen.insert(resource->eds_service_name.empty()
|
1104
|
-
? cluster_name
|
1105
|
-
: resource->eds_service_name);
|
1106
|
-
}
|
1107
|
-
}
|
1108
|
-
// For any subscribed resource that is not present in the update,
|
1109
|
-
// remove it from the cache and notify watchers that it does not exist.
|
1110
|
-
for (const auto& p : cds_state.subscribed_resources) {
|
1111
|
-
const std::string& cluster_name = p.first;
|
1112
|
-
if (cds_update_map.find(cluster_name) == cds_update_map.end()) {
|
1113
|
-
ClusterState& cluster_state = xds_client()->cluster_map_[cluster_name];
|
1114
|
-
// If the resource was newly requested but has not yet been received,
|
1115
|
-
// we don't want to generate an error for the watchers, because this CDS
|
1116
|
-
// response may be in reaction to an earlier request that did not yet
|
1117
|
-
// request the new resource, so its absence from the response does not
|
1118
|
-
// necessarily indicate that the resource does not exist.
|
1119
|
-
// For that case, we rely on the request timeout instead.
|
1120
|
-
if (!cluster_state.update.has_value()) continue;
|
1121
|
-
cluster_state.update.reset();
|
1122
|
-
for (const auto& p : cluster_state.watchers) {
|
1123
|
-
p.first->OnResourceDoesNotExist();
|
1124
|
-
}
|
1125
|
-
}
|
1126
|
-
}
|
1127
|
-
// For any EDS resource that is no longer referred to by any CDS
|
1128
|
-
// resources, remove it from the cache and notify watchers that it
|
1129
|
-
// does not exist.
|
1130
|
-
auto& eds_state = state_map_[XdsApi::kEdsTypeUrl];
|
1131
|
-
for (const auto& p : eds_state.subscribed_resources) {
|
1132
|
-
const std::string& eds_resource_name = p.first;
|
1133
|
-
if (eds_resource_names_seen.find(eds_resource_name) ==
|
1134
|
-
eds_resource_names_seen.end()) {
|
1135
|
-
EndpointState& endpoint_state =
|
1136
|
-
xds_client()->endpoint_map_[eds_resource_name];
|
1137
|
-
endpoint_state.update.reset();
|
1138
|
-
for (const auto& p : endpoint_state.watchers) {
|
1139
|
-
p.first->OnResourceDoesNotExist();
|
1140
|
-
}
|
1141
|
-
}
|
1142
|
-
}
|
1143
|
-
}
|
1144
|
-
|
1145
|
-
void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdateLocked(
|
1146
|
-
std::string version, grpc_millis update_time,
|
1147
|
-
XdsApi::EdsUpdateMap eds_update_map) {
|
1148
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1149
|
-
gpr_log(GPR_INFO,
|
1150
|
-
"[xds_client %p] EDS update received containing %" PRIuPTR
|
1151
|
-
" resources",
|
1152
|
-
xds_client(), eds_update_map.size());
|
1153
|
-
}
|
1154
|
-
auto& eds_state = state_map_[XdsApi::kEdsTypeUrl];
|
1155
|
-
for (auto& p : eds_update_map) {
|
1156
|
-
const char* eds_service_name = p.first.c_str();
|
1157
|
-
XdsApi::EdsUpdate& eds_update = p.second.resource;
|
1158
|
-
auto& state = eds_state.subscribed_resources[eds_service_name];
|
1159
|
-
if (state != nullptr) state->Finish();
|
1160
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1161
|
-
gpr_log(GPR_INFO, "[xds_client %p] EDS resource %s: %s", xds_client(),
|
1162
|
-
eds_service_name, eds_update.ToString().c_str());
|
1163
|
-
}
|
1164
|
-
EndpointState& endpoint_state =
|
1165
|
-
xds_client()->endpoint_map_[eds_service_name];
|
1166
|
-
// Ignore identical update.
|
1167
|
-
if (endpoint_state.update.has_value() &&
|
1168
|
-
*endpoint_state.update == eds_update) {
|
1169
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1170
|
-
gpr_log(GPR_INFO,
|
1171
|
-
"[xds_client %p] EDS update identical to current, ignoring.",
|
1172
|
-
xds_client());
|
1173
|
-
}
|
1174
|
-
continue;
|
1175
|
-
}
|
1176
|
-
// Update the cluster state.
|
1177
|
-
endpoint_state.update = std::move(eds_update);
|
1178
|
-
endpoint_state.meta = CreateResourceMetadataAcked(
|
1179
|
-
std::move(p.second.serialized_proto), version, update_time);
|
1180
|
-
// Notify all watchers.
|
1181
|
-
for (const auto& p : endpoint_state.watchers) {
|
1182
|
-
p.first->OnEndpointChanged(endpoint_state.update.value());
|
1183
|
-
}
|
1184
|
-
}
|
1185
|
-
}
|
1186
|
-
|
1187
|
-
namespace {
|
1188
|
-
|
1189
|
-
// Update resource_metadata for NACK.
|
1190
|
-
void UpdateResourceMetadataNacked(const std::string& version,
|
1191
|
-
const std::string& details,
|
1192
|
-
grpc_millis update_time,
|
1193
|
-
XdsApi::ResourceMetadata* resource_metadata) {
|
1194
|
-
resource_metadata->client_status = XdsApi::ResourceMetadata::NACKED;
|
1195
|
-
resource_metadata->failed_version = version;
|
1196
|
-
resource_metadata->failed_details = details;
|
1197
|
-
resource_metadata->failed_update_time = update_time;
|
1198
|
-
}
|
1199
|
-
|
1200
|
-
} // namespace
|
1201
|
-
|
1202
|
-
template <typename StateMap>
|
1203
|
-
void XdsClient::ChannelState::AdsCallState::RejectAdsUpdateLocked(
|
1204
|
-
grpc_millis update_time, const XdsApi::AdsParseResult& result,
|
1205
|
-
StateMap* state_map) {
|
1206
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1207
|
-
gpr_log(GPR_INFO,
|
1208
|
-
"[xds_client %p] %s update NACKed containing %" PRIuPTR
|
1209
|
-
" invalid resources",
|
1210
|
-
xds_client(), result.type_url.c_str(),
|
1211
|
-
result.resource_names_failed.size());
|
1212
|
-
}
|
1213
|
-
std::string details = grpc_error_std_string(result.parse_error);
|
1214
|
-
for (auto& name : result.resource_names_failed) {
|
1215
|
-
auto it = state_map->find(name);
|
1216
|
-
if (it == state_map->end()) continue;
|
1217
|
-
auto& state = it->second;
|
1218
|
-
// Notify watchers of error.
|
1219
|
-
for (const auto& p : state.watchers) {
|
1220
|
-
p.first->OnError(GRPC_ERROR_REF(result.parse_error));
|
1221
|
-
}
|
1222
|
-
// Update resource metadata for CSDS.
|
1223
|
-
UpdateResourceMetadataNacked(result.version, details, update_time,
|
1224
|
-
&state.meta);
|
1225
|
-
}
|
1226
|
-
}
|
1227
|
-
|
1228
1113
|
void XdsClient::ChannelState::AdsCallState::OnRequestSent(
|
1229
1114
|
void* arg, grpc_error_handle error) {
|
1230
1115
|
AdsCallState* ads_calld = static_cast<AdsCallState*>(arg);
|
@@ -1267,6 +1152,7 @@ void XdsClient::ChannelState::AdsCallState::OnResponseReceived(
|
|
1267
1152
|
MutexLock lock(&ads_calld->xds_client()->mu_);
|
1268
1153
|
done = ads_calld->OnResponseReceivedLocked();
|
1269
1154
|
}
|
1155
|
+
ads_calld->xds_client()->work_serializer_.DrainQueue();
|
1270
1156
|
if (done) ads_calld->Unref(DEBUG_LOCATION, "ADS+OnResponseReceivedLocked");
|
1271
1157
|
}
|
1272
1158
|
|
@@ -1283,74 +1169,75 @@ bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
|
|
1283
1169
|
grpc_byte_buffer_destroy(recv_message_payload_);
|
1284
1170
|
recv_message_payload_ = nullptr;
|
1285
1171
|
// Parse and validate the response.
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
ResourceNamesForRequest(XdsApi::kRdsTypeUrl),
|
1290
|
-
ResourceNamesForRequest(XdsApi::kCdsTypeUrl),
|
1291
|
-
ResourceNamesForRequest(XdsApi::kEdsTypeUrl));
|
1172
|
+
AdsResponseParser parser(this);
|
1173
|
+
absl::Status status = xds_client()->api_.ParseAdsResponse(
|
1174
|
+
chand()->server_, response_slice, &parser);
|
1292
1175
|
grpc_slice_unref_internal(response_slice);
|
1293
|
-
if (
|
1176
|
+
if (!status.ok()) {
|
1294
1177
|
// Ignore unparsable response.
|
1295
1178
|
gpr_log(GPR_ERROR,
|
1296
|
-
"[xds_client %p]
|
1297
|
-
|
1298
|
-
|
1179
|
+
"[xds_client %p] xds server %s: error parsing ADS response (%s) "
|
1180
|
+
"-- ignoring",
|
1181
|
+
xds_client(), chand()->server_.server_uri.c_str(),
|
1182
|
+
status.ToString().c_str());
|
1299
1183
|
} else {
|
1300
|
-
|
1184
|
+
AdsResponseParser::Result result = parser.TakeResult();
|
1301
1185
|
// Update nonce.
|
1302
|
-
auto& state = state_map_[result.
|
1303
|
-
state.nonce =
|
1304
|
-
// If we got an error, we'll NACK the update.
|
1305
|
-
if (result.
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
GRPC_STATUS_UNAVAILABLE);
|
1186
|
+
auto& state = state_map_[result.type];
|
1187
|
+
state.nonce = result.nonce;
|
1188
|
+
// If we got an error, set state.error so that we'll NACK the update.
|
1189
|
+
if (!result.errors.empty()) {
|
1190
|
+
std::string error = absl::StrJoin(result.errors, "; ");
|
1191
|
+
gpr_log(
|
1192
|
+
GPR_ERROR,
|
1193
|
+
"[xds_client %p] xds server %s: ADS response invalid for resource "
|
1194
|
+
"type %s version %s, will NACK: nonce=%s error=%s",
|
1195
|
+
xds_client(), chand()->server_.server_uri.c_str(),
|
1196
|
+
result.type_url.c_str(), result.version.c_str(), state.nonce.c_str(),
|
1197
|
+
error.c_str());
|
1315
1198
|
GRPC_ERROR_UNREF(state.error);
|
1316
|
-
state.error =
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1199
|
+
state.error = grpc_error_set_int(
|
1200
|
+
GRPC_ERROR_CREATE_FROM_CPP_STRING(std::move(error)),
|
1201
|
+
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
|
1202
|
+
}
|
1203
|
+
// Delete resources not seen in update if needed.
|
1204
|
+
if (result.type->AllResourcesRequiredInSotW()) {
|
1205
|
+
for (auto& a : xds_client()->authority_state_map_) {
|
1206
|
+
const std::string& authority = a.first;
|
1207
|
+
AuthorityState& authority_state = a.second;
|
1208
|
+
// Skip authorities that are not using this xDS channel.
|
1209
|
+
if (authority_state.channel_state != chand()) continue;
|
1210
|
+
auto seen_authority_it = result.resources_seen.find(authority);
|
1211
|
+
// Find this resource type.
|
1212
|
+
auto type_it = authority_state.resource_map.find(result.type);
|
1213
|
+
if (type_it == authority_state.resource_map.end()) continue;
|
1214
|
+
// Iterate over resource ids.
|
1215
|
+
for (auto& r : type_it->second) {
|
1216
|
+
const XdsResourceKey& resource_key = r.first;
|
1217
|
+
ResourceState& resource_state = r.second;
|
1218
|
+
if (seen_authority_it == result.resources_seen.end() ||
|
1219
|
+
seen_authority_it->second.find(resource_key) ==
|
1220
|
+
seen_authority_it->second.end()) {
|
1221
|
+
// If the resource was newly requested but has not yet been
|
1222
|
+
// received, we don't want to generate an error for the watchers,
|
1223
|
+
// because this ADS response may be in reaction to an earlier
|
1224
|
+
// request that did not yet request the new resource, so its absence
|
1225
|
+
// from the response does not necessarily indicate that the resource
|
1226
|
+
// does not exist. For that case, we rely on the request timeout
|
1227
|
+
// instead.
|
1228
|
+
if (resource_state.resource == nullptr) continue;
|
1229
|
+
resource_state.resource.reset();
|
1230
|
+
Notifier::
|
1231
|
+
ScheduleNotifyWatchersOnResourceDoesNotExistInWorkSerializer(
|
1232
|
+
xds_client(), resource_state.watchers, DEBUG_LOCATION);
|
1233
|
+
}
|
1234
|
+
}
|
1328
1235
|
}
|
1329
1236
|
}
|
1330
|
-
//
|
1331
|
-
|
1332
|
-
if (result.type_url == XdsApi::kLdsTypeUrl) {
|
1333
|
-
have_valid_resources = !result.lds_update_map.empty();
|
1334
|
-
AcceptLdsUpdateLocked(result.version, update_time,
|
1335
|
-
std::move(result.lds_update_map),
|
1336
|
-
result.resource_names_failed);
|
1337
|
-
} else if (result.type_url == XdsApi::kRdsTypeUrl) {
|
1338
|
-
have_valid_resources = !result.rds_update_map.empty();
|
1339
|
-
AcceptRdsUpdateLocked(result.version, update_time,
|
1340
|
-
std::move(result.rds_update_map));
|
1341
|
-
} else if (result.type_url == XdsApi::kCdsTypeUrl) {
|
1342
|
-
have_valid_resources = !result.cds_update_map.empty();
|
1343
|
-
AcceptCdsUpdateLocked(result.version, update_time,
|
1344
|
-
std::move(result.cds_update_map),
|
1345
|
-
result.resource_names_failed);
|
1346
|
-
} else if (result.type_url == XdsApi::kEdsTypeUrl) {
|
1347
|
-
have_valid_resources = !result.eds_update_map.empty();
|
1348
|
-
AcceptEdsUpdateLocked(result.version, update_time,
|
1349
|
-
std::move(result.eds_update_map));
|
1350
|
-
}
|
1351
|
-
if (have_valid_resources) {
|
1237
|
+
// If we had valid resources, update the version.
|
1238
|
+
if (result.have_valid_resources) {
|
1352
1239
|
seen_response_ = true;
|
1353
|
-
|
1240
|
+
chand()->resource_type_version_map_[result.type] =
|
1354
1241
|
std::move(result.version);
|
1355
1242
|
// Start load reporting if needed.
|
1356
1243
|
auto& lrs_call = chand()->lrs_calld_;
|
@@ -1360,7 +1247,7 @@ bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
|
|
1360
1247
|
}
|
1361
1248
|
}
|
1362
1249
|
// Send ACK or NACK.
|
1363
|
-
SendMessageLocked(result.
|
1250
|
+
SendMessageLocked(result.type);
|
1364
1251
|
}
|
1365
1252
|
if (xds_client()->shutting_down_) return true;
|
1366
1253
|
// Keep listening for updates.
|
@@ -1385,6 +1272,7 @@ void XdsClient::ChannelState::AdsCallState::OnStatusReceived(
|
|
1385
1272
|
MutexLock lock(&ads_calld->xds_client()->mu_);
|
1386
1273
|
ads_calld->OnStatusReceivedLocked(GRPC_ERROR_REF(error));
|
1387
1274
|
}
|
1275
|
+
ads_calld->xds_client()->work_serializer_.DrainQueue();
|
1388
1276
|
ads_calld->Unref(DEBUG_LOCATION, "ADS+OnStatusReceivedLocked");
|
1389
1277
|
}
|
1390
1278
|
|
@@ -1393,9 +1281,11 @@ void XdsClient::ChannelState::AdsCallState::OnStatusReceivedLocked(
|
|
1393
1281
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1394
1282
|
char* status_details = grpc_slice_to_c_string(status_details_);
|
1395
1283
|
gpr_log(GPR_INFO,
|
1396
|
-
"[xds_client %p] ADS call status received
|
1397
|
-
"
|
1398
|
-
|
1284
|
+
"[xds_client %p] xds server %s: ADS call status received "
|
1285
|
+
"(chand=%p, ads_calld=%p, call=%p): "
|
1286
|
+
"status=%d, details='%s', error='%s'",
|
1287
|
+
xds_client(), chand()->server_.server_uri.c_str(), chand(), this,
|
1288
|
+
call_, status_code_, status_details,
|
1399
1289
|
grpc_error_std_string(error).c_str());
|
1400
1290
|
gpr_free(status_details);
|
1401
1291
|
}
|
@@ -1417,16 +1307,21 @@ bool XdsClient::ChannelState::AdsCallState::IsCurrentCallOnChannel() const {
|
|
1417
1307
|
return this == chand()->ads_calld_->calld();
|
1418
1308
|
}
|
1419
1309
|
|
1420
|
-
std::
|
1310
|
+
std::vector<std::string>
|
1421
1311
|
XdsClient::ChannelState::AdsCallState::ResourceNamesForRequest(
|
1422
|
-
const
|
1423
|
-
std::
|
1424
|
-
auto it = state_map_.find(
|
1312
|
+
const XdsResourceType* type) {
|
1313
|
+
std::vector<std::string> resource_names;
|
1314
|
+
auto it = state_map_.find(type);
|
1425
1315
|
if (it != state_map_.end()) {
|
1426
|
-
for (auto&
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1316
|
+
for (auto& a : it->second.subscribed_resources) {
|
1317
|
+
const std::string& authority = a.first;
|
1318
|
+
for (auto& p : a.second) {
|
1319
|
+
const XdsResourceKey& resource_key = p.first;
|
1320
|
+
resource_names.emplace_back(XdsClient::ConstructFullXdsResourceName(
|
1321
|
+
authority, type->type_url(), resource_key));
|
1322
|
+
OrphanablePtr<ResourceTimer>& resource_timer = p.second;
|
1323
|
+
resource_timer->MaybeStartTimer(Ref(DEBUG_LOCATION, "ResourceTimer"));
|
1324
|
+
}
|
1430
1325
|
}
|
1431
1326
|
}
|
1432
1327
|
return resource_names;
|
@@ -1519,8 +1414,10 @@ bool XdsClient::ChannelState::LrsCallState::Reporter::SendReportLocked() {
|
|
1519
1414
|
parent_->call_, &op, 1, &on_report_done_);
|
1520
1415
|
if (GPR_UNLIKELY(call_error != GRPC_CALL_OK)) {
|
1521
1416
|
gpr_log(GPR_ERROR,
|
1522
|
-
"[xds_client %p]
|
1523
|
-
|
1417
|
+
"[xds_client %p] xds server %s: error starting LRS send_message "
|
1418
|
+
"batch on calld=%p: call_error=%d",
|
1419
|
+
xds_client(), parent_->chand()->server_.server_uri.c_str(), this,
|
1420
|
+
call_error);
|
1524
1421
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
1525
1422
|
}
|
1526
1423
|
return false;
|
@@ -1575,13 +1472,14 @@ XdsClient::ChannelState::LrsCallState::LrsCallState(
|
|
1575
1472
|
// activity in xds_client()->interested_parties_, which is comprised of
|
1576
1473
|
// the polling entities from client_channel.
|
1577
1474
|
GPR_ASSERT(xds_client() != nullptr);
|
1578
|
-
const
|
1475
|
+
const char* method =
|
1579
1476
|
chand()->server_.ShouldUseV3()
|
1580
|
-
?
|
1581
|
-
:
|
1477
|
+
? "/envoy.service.load_stats.v3.LoadReportingService/StreamLoadStats"
|
1478
|
+
: "/envoy.service.load_stats.v2.LoadReportingService/StreamLoadStats";
|
1582
1479
|
call_ = grpc_channel_create_pollset_set_call(
|
1583
1480
|
chand()->channel_, nullptr, GRPC_PROPAGATE_DEFAULTS,
|
1584
|
-
xds_client()->interested_parties_,
|
1481
|
+
xds_client()->interested_parties_,
|
1482
|
+
StaticSlice::FromStaticString(method).c_slice(), nullptr,
|
1585
1483
|
GRPC_MILLIS_INF_FUTURE, nullptr);
|
1586
1484
|
GPR_ASSERT(call_ != nullptr);
|
1587
1485
|
// Init the request payload.
|
@@ -1595,10 +1493,10 @@ XdsClient::ChannelState::LrsCallState::LrsCallState(
|
|
1595
1493
|
grpc_metadata_array_init(&trailing_metadata_recv_);
|
1596
1494
|
// Start the call.
|
1597
1495
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1598
|
-
gpr_log(
|
1599
|
-
|
1600
|
-
|
1601
|
-
|
1496
|
+
gpr_log(
|
1497
|
+
GPR_INFO,
|
1498
|
+
"[xds_client %p] xds server %s: starting LRS call (calld=%p, call=%p)",
|
1499
|
+
xds_client(), chand()->server_.server_uri.c_str(), this, call_);
|
1602
1500
|
}
|
1603
1501
|
// Create the ops.
|
1604
1502
|
grpc_call_error call_error;
|
@@ -1758,8 +1656,9 @@ bool XdsClient::ChannelState::LrsCallState::OnResponseReceivedLocked() {
|
|
1758
1656
|
&new_load_reporting_interval);
|
1759
1657
|
if (parse_error != GRPC_ERROR_NONE) {
|
1760
1658
|
gpr_log(GPR_ERROR,
|
1761
|
-
"[xds_client %p] LRS response parsing failed
|
1762
|
-
xds_client(),
|
1659
|
+
"[xds_client %p] xds server %s: LRS response parsing failed: %s",
|
1660
|
+
xds_client(), chand()->server_.server_uri.c_str(),
|
1661
|
+
grpc_error_std_string(parse_error).c_str());
|
1763
1662
|
GRPC_ERROR_UNREF(parse_error);
|
1764
1663
|
return;
|
1765
1664
|
}
|
@@ -1767,10 +1666,11 @@ bool XdsClient::ChannelState::LrsCallState::OnResponseReceivedLocked() {
|
|
1767
1666
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1768
1667
|
gpr_log(
|
1769
1668
|
GPR_INFO,
|
1770
|
-
"[xds_client %p] LRS response received, %" PRIuPTR
|
1669
|
+
"[xds_client %p] xds server %s: LRS response received, %" PRIuPTR
|
1771
1670
|
" cluster names, send_all_clusters=%d, load_report_interval=%" PRId64
|
1772
1671
|
"ms",
|
1773
|
-
xds_client(),
|
1672
|
+
xds_client(), chand()->server_.server_uri.c_str(),
|
1673
|
+
new_cluster_names.size(), send_all_clusters,
|
1774
1674
|
new_load_reporting_interval);
|
1775
1675
|
size_t i = 0;
|
1776
1676
|
for (const auto& name : new_cluster_names) {
|
@@ -1784,9 +1684,10 @@ bool XdsClient::ChannelState::LrsCallState::OnResponseReceivedLocked() {
|
|
1784
1684
|
GRPC_XDS_MIN_CLIENT_LOAD_REPORTING_INTERVAL_MS;
|
1785
1685
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1786
1686
|
gpr_log(GPR_INFO,
|
1787
|
-
"[xds_client %p]
|
1788
|
-
"value %dms",
|
1789
|
-
xds_client(),
|
1687
|
+
"[xds_client %p] xds server %s: increased load_report_interval "
|
1688
|
+
"to minimum value %dms",
|
1689
|
+
xds_client(), chand()->server_.server_uri.c_str(),
|
1690
|
+
GRPC_XDS_MIN_CLIENT_LOAD_REPORTING_INTERVAL_MS);
|
1790
1691
|
}
|
1791
1692
|
}
|
1792
1693
|
// Ignore identical update.
|
@@ -1794,10 +1695,11 @@ bool XdsClient::ChannelState::LrsCallState::OnResponseReceivedLocked() {
|
|
1794
1695
|
cluster_names_ == new_cluster_names &&
|
1795
1696
|
load_reporting_interval_ == new_load_reporting_interval) {
|
1796
1697
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1797
|
-
gpr_log(
|
1798
|
-
|
1799
|
-
|
1800
|
-
|
1698
|
+
gpr_log(
|
1699
|
+
GPR_INFO,
|
1700
|
+
"[xds_client %p] xds server %s: incoming LRS response identical "
|
1701
|
+
"to current, ignoring.",
|
1702
|
+
xds_client(), chand()->server_.server_uri.c_str());
|
1801
1703
|
}
|
1802
1704
|
return;
|
1803
1705
|
}
|
@@ -1843,9 +1745,11 @@ void XdsClient::ChannelState::LrsCallState::OnStatusReceivedLocked(
|
|
1843
1745
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1844
1746
|
char* status_details = grpc_slice_to_c_string(status_details_);
|
1845
1747
|
gpr_log(GPR_INFO,
|
1846
|
-
"[xds_client %p] LRS call status received
|
1847
|
-
"
|
1848
|
-
|
1748
|
+
"[xds_client %p] xds server %s: LRS call status received "
|
1749
|
+
"(chand=%p, calld=%p, call=%p): "
|
1750
|
+
"status=%d, details='%s', error='%s'",
|
1751
|
+
xds_client(), chand()->server_.server_uri.c_str(), chand(), this,
|
1752
|
+
call_, status_code_, status_details,
|
1849
1753
|
grpc_error_std_string(error).c_str());
|
1850
1754
|
gpr_free(status_details);
|
1851
1755
|
}
|
@@ -1878,12 +1782,10 @@ grpc_millis GetRequestTimeout(const grpc_channel_args* args) {
|
|
1878
1782
|
}
|
1879
1783
|
|
1880
1784
|
grpc_channel_args* ModifyChannelArgs(const grpc_channel_args* args) {
|
1881
|
-
absl::InlinedVector<grpc_arg,
|
1785
|
+
absl::InlinedVector<grpc_arg, 1> args_to_add = {
|
1882
1786
|
grpc_channel_arg_integer_create(
|
1883
1787
|
const_cast<char*>(GRPC_ARG_KEEPALIVE_TIME_MS),
|
1884
1788
|
5 * 60 * GPR_MS_PER_SEC),
|
1885
|
-
grpc_channel_arg_integer_create(
|
1886
|
-
const_cast<char*>(GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL), 1),
|
1887
1789
|
};
|
1888
1790
|
return grpc_channel_args_copy_and_add(args, args_to_add.data(),
|
1889
1791
|
args_to_add.size());
|
@@ -1903,13 +1805,13 @@ XdsClient::XdsClient(std::unique_ptr<XdsBootstrap> bootstrap,
|
|
1903
1805
|
certificate_provider_store_(MakeOrphanable<CertificateProviderStore>(
|
1904
1806
|
bootstrap_->certificate_providers())),
|
1905
1807
|
api_(this, &grpc_xds_client_trace, bootstrap_->node(),
|
1906
|
-
&bootstrap_->certificate_providers()) {
|
1808
|
+
&bootstrap_->certificate_providers(), &symtab_) {
|
1907
1809
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1908
1810
|
gpr_log(GPR_INFO, "[xds_client %p] creating xds client", this);
|
1909
1811
|
}
|
1910
|
-
//
|
1911
|
-
|
1912
|
-
|
1812
|
+
// Calling grpc_init to ensure gRPC does not shut down until the XdsClient is
|
1813
|
+
// destroyed.
|
1814
|
+
grpc_init();
|
1913
1815
|
}
|
1914
1816
|
|
1915
1817
|
XdsClient::~XdsClient() {
|
@@ -1918,26 +1820,9 @@ XdsClient::~XdsClient() {
|
|
1918
1820
|
}
|
1919
1821
|
grpc_channel_args_destroy(args_);
|
1920
1822
|
grpc_pollset_set_destroy(interested_parties_);
|
1921
|
-
|
1922
|
-
|
1923
|
-
|
1924
|
-
channelz::ChannelNode* parent_channelz_node) {
|
1925
|
-
MutexLock lock(&mu_);
|
1926
|
-
channelz::ChannelNode* xds_channelz_node =
|
1927
|
-
grpc_channel_get_channelz_node(chand_->channel());
|
1928
|
-
if (xds_channelz_node != nullptr) {
|
1929
|
-
parent_channelz_node->AddChildChannel(xds_channelz_node->uuid());
|
1930
|
-
}
|
1931
|
-
}
|
1932
|
-
|
1933
|
-
void XdsClient::RemoveChannelzLinkage(
|
1934
|
-
channelz::ChannelNode* parent_channelz_node) {
|
1935
|
-
MutexLock lock(&mu_);
|
1936
|
-
channelz::ChannelNode* xds_channelz_node =
|
1937
|
-
grpc_channel_get_channelz_node(chand_->channel());
|
1938
|
-
if (xds_channelz_node != nullptr) {
|
1939
|
-
parent_channelz_node->RemoveChildChannel(xds_channelz_node->uuid());
|
1940
|
-
}
|
1823
|
+
// Calling grpc_shutdown to ensure gRPC does not shut down until the XdsClient
|
1824
|
+
// is destroyed.
|
1825
|
+
grpc_shutdown();
|
1941
1826
|
}
|
1942
1827
|
|
1943
1828
|
void XdsClient::Orphan() {
|
@@ -1951,174 +1836,203 @@ void XdsClient::Orphan() {
|
|
1951
1836
|
{
|
1952
1837
|
MutexLock lock(&mu_);
|
1953
1838
|
shutting_down_ = true;
|
1954
|
-
//
|
1955
|
-
|
1956
|
-
|
1957
|
-
|
1958
|
-
|
1959
|
-
|
1960
|
-
|
1961
|
-
|
1962
|
-
|
1963
|
-
|
1964
|
-
|
1965
|
-
|
1966
|
-
|
1967
|
-
|
1968
|
-
|
1969
|
-
|
1970
|
-
|
1971
|
-
|
1972
|
-
|
1973
|
-
|
1974
|
-
|
1975
|
-
|
1976
|
-
|
1977
|
-
//
|
1978
|
-
|
1979
|
-
|
1980
|
-
|
1981
|
-
|
1982
|
-
|
1983
|
-
}
|
1984
|
-
|
1985
|
-
|
1986
|
-
|
1987
|
-
|
1988
|
-
|
1989
|
-
|
1990
|
-
|
1991
|
-
|
1992
|
-
|
1993
|
-
if (
|
1994
|
-
|
1995
|
-
|
1996
|
-
|
1997
|
-
if (it != listener_state.watchers.end()) {
|
1998
|
-
listener_state.watchers.erase(it);
|
1999
|
-
if (listener_state.watchers.empty()) {
|
2000
|
-
listener_map_.erase(listener_name_str);
|
2001
|
-
chand_->UnsubscribeLocked(XdsApi::kLdsTypeUrl, listener_name_str,
|
2002
|
-
delay_unsubscription);
|
2003
|
-
}
|
1839
|
+
// Clear cache and any remaining watchers that may not have been cancelled.
|
1840
|
+
authority_state_map_.clear();
|
1841
|
+
invalid_watchers_.clear();
|
1842
|
+
}
|
1843
|
+
}
|
1844
|
+
|
1845
|
+
RefCountedPtr<XdsClient::ChannelState> XdsClient::GetOrCreateChannelStateLocked(
|
1846
|
+
const XdsBootstrap::XdsServer& server) {
|
1847
|
+
auto it = xds_server_channel_map_.find(server);
|
1848
|
+
if (it != xds_server_channel_map_.end()) {
|
1849
|
+
return it->second->Ref(DEBUG_LOCATION, "Authority");
|
1850
|
+
}
|
1851
|
+
// Channel not found, so create a new one.
|
1852
|
+
auto channel_state = MakeRefCounted<ChannelState>(
|
1853
|
+
WeakRef(DEBUG_LOCATION, "ChannelState"), server);
|
1854
|
+
xds_server_channel_map_[server] = channel_state.get();
|
1855
|
+
return channel_state;
|
1856
|
+
}
|
1857
|
+
|
1858
|
+
void XdsClient::WatchResource(const XdsResourceType* type,
|
1859
|
+
absl::string_view name,
|
1860
|
+
RefCountedPtr<ResourceWatcherInterface> watcher) {
|
1861
|
+
ResourceWatcherInterface* w = watcher.get();
|
1862
|
+
// Lambda for handling failure cases.
|
1863
|
+
auto fail = [&](grpc_error_handle error) mutable {
|
1864
|
+
{
|
1865
|
+
MutexLock lock(&mu_);
|
1866
|
+
MaybeRegisterResourceTypeLocked(type);
|
1867
|
+
invalid_watchers_[w] = watcher;
|
1868
|
+
}
|
1869
|
+
work_serializer_.Run(
|
1870
|
+
// TODO(yashykt): When we move to C++14, capture watcher using
|
1871
|
+
// std::move()
|
1872
|
+
[watcher, error]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) {
|
1873
|
+
watcher->OnError(error);
|
1874
|
+
},
|
1875
|
+
DEBUG_LOCATION);
|
1876
|
+
};
|
1877
|
+
auto resource_name = ParseXdsResourceName(name, type);
|
1878
|
+
if (!resource_name.ok()) {
|
1879
|
+
fail(GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
|
1880
|
+
"Unable to parse resource name for listener %s", name)));
|
1881
|
+
return;
|
2004
1882
|
}
|
2005
|
-
|
2006
|
-
|
2007
|
-
|
2008
|
-
|
2009
|
-
std::
|
2010
|
-
|
2011
|
-
|
2012
|
-
|
2013
|
-
|
2014
|
-
|
2015
|
-
route_config_state.watchers[w] = std::move(watcher);
|
2016
|
-
// If we've already received an RDS update, notify the new watcher
|
2017
|
-
// immediately.
|
2018
|
-
if (route_config_state.update.has_value()) {
|
2019
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2020
|
-
gpr_log(GPR_INFO,
|
2021
|
-
"[xds_client %p] returning cached route config data for %s", this,
|
2022
|
-
route_config_name_str.c_str());
|
1883
|
+
// Find server to use.
|
1884
|
+
const XdsBootstrap::XdsServer* xds_server = nullptr;
|
1885
|
+
absl::string_view authority_name = resource_name->authority;
|
1886
|
+
if (absl::ConsumePrefix(&authority_name, "xdstp:")) {
|
1887
|
+
auto* authority = bootstrap_->LookupAuthority(std::string(authority_name));
|
1888
|
+
if (authority == nullptr) {
|
1889
|
+
fail(GRPC_ERROR_CREATE_FROM_CPP_STRING(
|
1890
|
+
absl::StrCat("authority \"", authority_name,
|
1891
|
+
"\" not present in bootstrap config")));
|
1892
|
+
return;
|
2023
1893
|
}
|
2024
|
-
|
2025
|
-
|
2026
|
-
chand_->SubscribeLocked(XdsApi::kRdsTypeUrl, route_config_name_str);
|
2027
|
-
}
|
2028
|
-
|
2029
|
-
void XdsClient::CancelRouteConfigDataWatch(absl::string_view route_config_name,
|
2030
|
-
RouteConfigWatcherInterface* watcher,
|
2031
|
-
bool delay_unsubscription) {
|
2032
|
-
MutexLock lock(&mu_);
|
2033
|
-
if (shutting_down_) return;
|
2034
|
-
std::string route_config_name_str = std::string(route_config_name);
|
2035
|
-
RouteConfigState& route_config_state =
|
2036
|
-
route_config_map_[route_config_name_str];
|
2037
|
-
auto it = route_config_state.watchers.find(watcher);
|
2038
|
-
if (it != route_config_state.watchers.end()) {
|
2039
|
-
route_config_state.watchers.erase(it);
|
2040
|
-
if (route_config_state.watchers.empty()) {
|
2041
|
-
route_config_map_.erase(route_config_name_str);
|
2042
|
-
chand_->UnsubscribeLocked(XdsApi::kRdsTypeUrl, route_config_name_str,
|
2043
|
-
delay_unsubscription);
|
1894
|
+
if (!authority->xds_servers.empty()) {
|
1895
|
+
xds_server = &authority->xds_servers[0];
|
2044
1896
|
}
|
2045
1897
|
}
|
2046
|
-
|
2047
|
-
|
2048
|
-
|
2049
|
-
|
2050
|
-
|
2051
|
-
|
1898
|
+
if (xds_server == nullptr) xds_server = &bootstrap_->server();
|
1899
|
+
{
|
1900
|
+
MutexLock lock(&mu_);
|
1901
|
+
MaybeRegisterResourceTypeLocked(type);
|
1902
|
+
// TODO(donnadionne): If we get a request for an authority that is not
|
1903
|
+
// configured in the bootstrap file, reject it.
|
1904
|
+
AuthorityState& authority_state =
|
1905
|
+
authority_state_map_[resource_name->authority];
|
1906
|
+
ResourceState& resource_state =
|
1907
|
+
authority_state.resource_map[type][resource_name->key];
|
1908
|
+
resource_state.watchers[w] = watcher;
|
1909
|
+
// If we already have a cached value for the resource, notify the new
|
1910
|
+
// watcher immediately.
|
1911
|
+
if (resource_state.resource != nullptr) {
|
1912
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1913
|
+
gpr_log(GPR_INFO,
|
1914
|
+
"[xds_client %p] returning cached listener data for %s", this,
|
1915
|
+
std::string(name).c_str());
|
1916
|
+
}
|
1917
|
+
auto* value = type->CopyResource(resource_state.resource.get()).release();
|
1918
|
+
work_serializer_.Schedule(
|
1919
|
+
[watcher, value]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) {
|
1920
|
+
watcher->OnGenericResourceChanged(value);
|
1921
|
+
delete value;
|
1922
|
+
},
|
1923
|
+
DEBUG_LOCATION);
|
1924
|
+
}
|
1925
|
+
// If the authority doesn't yet have a channel, set it, creating it if
|
1926
|
+
// needed.
|
1927
|
+
if (authority_state.channel_state == nullptr) {
|
1928
|
+
authority_state.channel_state =
|
1929
|
+
GetOrCreateChannelStateLocked(*xds_server);
|
1930
|
+
}
|
1931
|
+
authority_state.channel_state->SubscribeLocked(type, *resource_name);
|
1932
|
+
}
|
1933
|
+
work_serializer_.DrainQueue();
|
1934
|
+
}
|
1935
|
+
|
1936
|
+
void XdsClient::CancelResourceWatch(const XdsResourceType* type,
|
1937
|
+
absl::string_view name,
|
1938
|
+
ResourceWatcherInterface* watcher,
|
1939
|
+
bool delay_unsubscription) {
|
1940
|
+
auto resource_name = ParseXdsResourceName(name, type);
|
2052
1941
|
MutexLock lock(&mu_);
|
2053
|
-
|
2054
|
-
|
2055
|
-
|
2056
|
-
// If we've already received a CDS update, notify the new watcher
|
2057
|
-
// immediately.
|
2058
|
-
if (cluster_state.update.has_value()) {
|
2059
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2060
|
-
gpr_log(GPR_INFO, "[xds_client %p] returning cached cluster data for %s",
|
2061
|
-
this, cluster_name_str.c_str());
|
2062
|
-
}
|
2063
|
-
w->OnClusterChanged(cluster_state.update.value());
|
1942
|
+
if (!resource_name.ok()) {
|
1943
|
+
invalid_watchers_.erase(watcher);
|
1944
|
+
return;
|
2064
1945
|
}
|
2065
|
-
chand_->SubscribeLocked(XdsApi::kCdsTypeUrl, cluster_name_str);
|
2066
|
-
}
|
2067
|
-
|
2068
|
-
void XdsClient::CancelClusterDataWatch(absl::string_view cluster_name,
|
2069
|
-
ClusterWatcherInterface* watcher,
|
2070
|
-
bool delay_unsubscription) {
|
2071
|
-
MutexLock lock(&mu_);
|
2072
1946
|
if (shutting_down_) return;
|
2073
|
-
|
2074
|
-
|
2075
|
-
|
2076
|
-
|
2077
|
-
|
2078
|
-
|
2079
|
-
|
2080
|
-
|
2081
|
-
|
2082
|
-
|
2083
|
-
|
2084
|
-
|
2085
|
-
|
2086
|
-
|
2087
|
-
|
2088
|
-
|
2089
|
-
|
2090
|
-
|
2091
|
-
|
2092
|
-
|
2093
|
-
|
2094
|
-
|
2095
|
-
|
2096
|
-
|
2097
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2098
|
-
gpr_log(GPR_INFO, "[xds_client %p] returning cached endpoint data for %s",
|
2099
|
-
this, eds_service_name_str.c_str());
|
1947
|
+
// Find authority.
|
1948
|
+
auto authority_it = authority_state_map_.find(resource_name->authority);
|
1949
|
+
if (authority_it == authority_state_map_.end()) return;
|
1950
|
+
AuthorityState& authority_state = authority_it->second;
|
1951
|
+
// Find type map.
|
1952
|
+
auto type_it = authority_state.resource_map.find(type);
|
1953
|
+
if (type_it == authority_state.resource_map.end()) return;
|
1954
|
+
auto& type_map = type_it->second;
|
1955
|
+
// Find resource key.
|
1956
|
+
auto resource_it = type_map.find(resource_name->key);
|
1957
|
+
if (resource_it == type_map.end()) return;
|
1958
|
+
ResourceState& resource_state = resource_it->second;
|
1959
|
+
// Remove watcher.
|
1960
|
+
resource_state.watchers.erase(watcher);
|
1961
|
+
// Clean up empty map entries, if any.
|
1962
|
+
if (resource_state.watchers.empty()) {
|
1963
|
+
authority_state.channel_state->UnsubscribeLocked(type, *resource_name,
|
1964
|
+
delay_unsubscription);
|
1965
|
+
type_map.erase(resource_it);
|
1966
|
+
if (type_map.empty()) {
|
1967
|
+
authority_state.resource_map.erase(type_it);
|
1968
|
+
if (authority_state.resource_map.empty()) {
|
1969
|
+
authority_state.channel_state.reset();
|
1970
|
+
}
|
2100
1971
|
}
|
2101
|
-
w->OnEndpointChanged(endpoint_state.update.value());
|
2102
1972
|
}
|
2103
|
-
chand_->SubscribeLocked(XdsApi::kEdsTypeUrl, eds_service_name_str);
|
2104
1973
|
}
|
2105
1974
|
|
2106
|
-
void XdsClient::
|
2107
|
-
|
2108
|
-
|
2109
|
-
|
2110
|
-
|
2111
|
-
|
2112
|
-
EndpointState& endpoint_state = endpoint_map_[eds_service_name_str];
|
2113
|
-
auto it = endpoint_state.watchers.find(watcher);
|
2114
|
-
if (it != endpoint_state.watchers.end()) {
|
2115
|
-
endpoint_state.watchers.erase(it);
|
2116
|
-
if (endpoint_state.watchers.empty()) {
|
2117
|
-
endpoint_map_.erase(eds_service_name_str);
|
2118
|
-
chand_->UnsubscribeLocked(XdsApi::kEdsTypeUrl, eds_service_name_str,
|
2119
|
-
delay_unsubscription);
|
2120
|
-
}
|
1975
|
+
void XdsClient::MaybeRegisterResourceTypeLocked(
|
1976
|
+
const XdsResourceType* resource_type) {
|
1977
|
+
auto it = resource_types_.find(resource_type->type_url());
|
1978
|
+
if (it != resource_types_.end()) {
|
1979
|
+
GPR_ASSERT(it->second == resource_type);
|
1980
|
+
return;
|
2121
1981
|
}
|
1982
|
+
resource_types_.emplace(resource_type->type_url(), resource_type);
|
1983
|
+
v2_resource_types_.emplace(resource_type->v2_type_url(), resource_type);
|
1984
|
+
resource_type->InitUpbSymtab(symtab_.ptr());
|
1985
|
+
}
|
1986
|
+
|
1987
|
+
const XdsResourceType* XdsClient::GetResourceTypeLocked(
|
1988
|
+
absl::string_view resource_type) {
|
1989
|
+
auto it = resource_types_.find(resource_type);
|
1990
|
+
if (it != resource_types_.end()) return it->second;
|
1991
|
+
auto it2 = v2_resource_types_.find(resource_type);
|
1992
|
+
if (it2 != v2_resource_types_.end()) return it2->second;
|
1993
|
+
return nullptr;
|
1994
|
+
}
|
1995
|
+
|
1996
|
+
absl::StatusOr<XdsClient::XdsResourceName> XdsClient::ParseXdsResourceName(
|
1997
|
+
absl::string_view name, const XdsResourceType* type) {
|
1998
|
+
// Old-style names use the empty string for authority.
|
1999
|
+
// authority is prefixed with "old:" to indicate that it's an old-style name.
|
2000
|
+
if (!absl::StartsWith(name, "xdstp:")) {
|
2001
|
+
return XdsResourceName{"old:", {std::string(name), {}}};
|
2002
|
+
}
|
2003
|
+
// New style name. Parse URI.
|
2004
|
+
auto uri = URI::Parse(name);
|
2005
|
+
if (!uri.ok()) return uri.status();
|
2006
|
+
// Split the resource type off of the path to get the id.
|
2007
|
+
std::pair<absl::string_view, absl::string_view> path_parts = absl::StrSplit(
|
2008
|
+
absl::StripPrefix(uri->path(), "/"), absl::MaxSplits('/', 1));
|
2009
|
+
if (!type->IsType(path_parts.first, nullptr)) {
|
2010
|
+
return absl::InvalidArgumentError(
|
2011
|
+
"xdstp URI path must indicate valid xDS resource type");
|
2012
|
+
}
|
2013
|
+
// Canonicalize order of query params.
|
2014
|
+
std::vector<URI::QueryParam> query_params;
|
2015
|
+
for (const auto& p : uri->query_parameter_map()) {
|
2016
|
+
query_params.emplace_back(
|
2017
|
+
URI::QueryParam{std::string(p.first), std::string(p.second)});
|
2018
|
+
}
|
2019
|
+
return XdsResourceName{
|
2020
|
+
absl::StrCat("xdstp:", uri->authority()),
|
2021
|
+
{std::string(path_parts.second), std::move(query_params)}};
|
2022
|
+
}
|
2023
|
+
|
2024
|
+
std::string XdsClient::ConstructFullXdsResourceName(
|
2025
|
+
absl::string_view authority, absl::string_view resource_type,
|
2026
|
+
const XdsResourceKey& key) {
|
2027
|
+
if (absl::ConsumePrefix(&authority, "xdstp:")) {
|
2028
|
+
auto uri = URI::Create("xdstp", std::string(authority),
|
2029
|
+
absl::StrCat("/", resource_type, "/", key.id),
|
2030
|
+
key.query_params, /*fragment=*/"");
|
2031
|
+
GPR_ASSERT(uri.ok());
|
2032
|
+
return uri->ToString();
|
2033
|
+
}
|
2034
|
+
// Old-style name.
|
2035
|
+
return key.id;
|
2122
2036
|
}
|
2123
2037
|
|
2124
2038
|
RefCountedPtr<XdsClusterDropStats> XdsClient::AddClusterDropStats(
|
@@ -2151,7 +2065,13 @@ RefCountedPtr<XdsClusterDropStats> XdsClient::AddClusterDropStats(
|
|
2151
2065
|
it->first.second /*eds_service_name*/);
|
2152
2066
|
load_report_state.drop_stats = cluster_drop_stats.get();
|
2153
2067
|
}
|
2154
|
-
|
2068
|
+
auto resource_name =
|
2069
|
+
ParseXdsResourceName(cluster_name, XdsClusterResourceType::Get());
|
2070
|
+
GPR_ASSERT(resource_name.ok());
|
2071
|
+
auto a = authority_state_map_.find(resource_name->authority);
|
2072
|
+
if (a != authority_state_map_.end()) {
|
2073
|
+
a->second.channel_state->MaybeStartLrsCall();
|
2074
|
+
}
|
2155
2075
|
return cluster_drop_stats;
|
2156
2076
|
}
|
2157
2077
|
|
@@ -2208,7 +2128,13 @@ RefCountedPtr<XdsClusterLocalityStats> XdsClient::AddClusterLocalityStats(
|
|
2208
2128
|
std::move(locality));
|
2209
2129
|
locality_state.locality_stats = cluster_locality_stats.get();
|
2210
2130
|
}
|
2211
|
-
|
2131
|
+
auto resource_name =
|
2132
|
+
ParseXdsResourceName(cluster_name, XdsClusterResourceType::Get());
|
2133
|
+
GPR_ASSERT(resource_name.ok());
|
2134
|
+
auto a = authority_state_map_.find(resource_name->authority);
|
2135
|
+
if (a != authority_state_map_.end()) {
|
2136
|
+
a->second.channel_state->MaybeStartLrsCall();
|
2137
|
+
}
|
2212
2138
|
return cluster_locality_stats;
|
2213
2139
|
}
|
2214
2140
|
|
@@ -2238,37 +2164,32 @@ void XdsClient::RemoveClusterLocalityStats(
|
|
2238
2164
|
|
2239
2165
|
void XdsClient::ResetBackoff() {
|
2240
2166
|
MutexLock lock(&mu_);
|
2241
|
-
|
2242
|
-
grpc_channel_reset_connect_backoff(
|
2167
|
+
for (auto& p : xds_server_channel_map_) {
|
2168
|
+
grpc_channel_reset_connect_backoff(p.second->channel());
|
2243
2169
|
}
|
2244
2170
|
}
|
2245
2171
|
|
2246
2172
|
void XdsClient::NotifyOnErrorLocked(grpc_error_handle error) {
|
2247
|
-
|
2248
|
-
|
2249
|
-
for (const auto&
|
2250
|
-
|
2251
|
-
|
2252
|
-
|
2253
|
-
|
2254
|
-
|
2255
|
-
for (const auto& p : route_config_state.watchers) {
|
2256
|
-
p.first->OnError(GRPC_ERROR_REF(error));
|
2257
|
-
}
|
2258
|
-
}
|
2259
|
-
for (const auto& p : cluster_map_) {
|
2260
|
-
const ClusterState& cluster_state = p.second;
|
2261
|
-
for (const auto& p : cluster_state.watchers) {
|
2262
|
-
p.first->OnError(GRPC_ERROR_REF(error));
|
2263
|
-
}
|
2264
|
-
}
|
2265
|
-
for (const auto& p : endpoint_map_) {
|
2266
|
-
const EndpointState& endpoint_state = p.second;
|
2267
|
-
for (const auto& p : endpoint_state.watchers) {
|
2268
|
-
p.first->OnError(GRPC_ERROR_REF(error));
|
2173
|
+
std::set<RefCountedPtr<ResourceWatcherInterface>> watchers;
|
2174
|
+
for (const auto& a : authority_state_map_) { // authority
|
2175
|
+
for (const auto& t : a.second.resource_map) { // type
|
2176
|
+
for (const auto& r : t.second) { // resource id
|
2177
|
+
for (const auto& w : r.second.watchers) { // watchers
|
2178
|
+
watchers.insert(w.second);
|
2179
|
+
}
|
2180
|
+
}
|
2269
2181
|
}
|
2270
2182
|
}
|
2271
|
-
|
2183
|
+
work_serializer_.Schedule(
|
2184
|
+
// TODO(yashykt): When we move to C++14, capture watchers using
|
2185
|
+
// std::move()
|
2186
|
+
[watchers, error]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_) {
|
2187
|
+
for (const auto& watcher : watchers) {
|
2188
|
+
watcher->OnError(GRPC_ERROR_REF(error));
|
2189
|
+
}
|
2190
|
+
GRPC_ERROR_UNREF(error);
|
2191
|
+
},
|
2192
|
+
DEBUG_LOCATION);
|
2272
2193
|
}
|
2273
2194
|
|
2274
2195
|
XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked(
|
@@ -2355,34 +2276,19 @@ XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked(
|
|
2355
2276
|
std::string XdsClient::DumpClientConfigBinary() {
|
2356
2277
|
MutexLock lock(&mu_);
|
2357
2278
|
XdsApi::ResourceTypeMetadataMap resource_type_metadata_map;
|
2358
|
-
|
2359
|
-
|
2360
|
-
|
2361
|
-
|
2362
|
-
|
2363
|
-
|
2364
|
-
|
2365
|
-
|
2366
|
-
|
2367
|
-
|
2368
|
-
|
2369
|
-
|
2370
|
-
|
2371
|
-
resource_type_metadata_map[XdsApi::kRdsTypeUrl].resource_metadata_map;
|
2372
|
-
for (auto& p : route_config_map_) {
|
2373
|
-
rds_map[p.first] = &p.second.meta;
|
2374
|
-
}
|
2375
|
-
// Collect resource metadata from clusters
|
2376
|
-
auto& cds_map =
|
2377
|
-
resource_type_metadata_map[XdsApi::kCdsTypeUrl].resource_metadata_map;
|
2378
|
-
for (auto& p : cluster_map_) {
|
2379
|
-
cds_map[p.first] = &p.second.meta;
|
2380
|
-
}
|
2381
|
-
// Collect resource metadata from endpoints
|
2382
|
-
auto& eds_map =
|
2383
|
-
resource_type_metadata_map[XdsApi::kEdsTypeUrl].resource_metadata_map;
|
2384
|
-
for (auto& p : endpoint_map_) {
|
2385
|
-
eds_map[p.first] = &p.second.meta;
|
2279
|
+
for (const auto& a : authority_state_map_) { // authority
|
2280
|
+
const std::string& authority = a.first;
|
2281
|
+
for (const auto& t : a.second.resource_map) { // type
|
2282
|
+
const XdsResourceType* type = t.first;
|
2283
|
+
auto& resource_metadata_map =
|
2284
|
+
resource_type_metadata_map[type->type_url()];
|
2285
|
+
for (const auto& r : t.second) { // resource id
|
2286
|
+
const XdsResourceKey& resource_key = r.first;
|
2287
|
+
const ResourceState& resource_state = r.second;
|
2288
|
+
resource_metadata_map[ConstructFullXdsResourceName(
|
2289
|
+
authority, type->type_url(), resource_key)] = &resource_state.meta;
|
2290
|
+
}
|
2291
|
+
}
|
2386
2292
|
}
|
2387
2293
|
// Assemble config dump messages
|
2388
2294
|
return api_.AssembleClientConfig(resource_type_metadata_map);
|
@@ -2395,6 +2301,7 @@ std::string XdsClient::DumpClientConfigBinary() {
|
|
2395
2301
|
void XdsClientGlobalInit() {
|
2396
2302
|
g_mu = new Mutex;
|
2397
2303
|
XdsHttpFilterRegistry::Init();
|
2304
|
+
XdsChannelCredsRegistry::Init();
|
2398
2305
|
}
|
2399
2306
|
|
2400
2307
|
// TODO(roth): Find a better way to clear the fallback config that does
|
@@ -2404,6 +2311,7 @@ void XdsClientGlobalShutdown() ABSL_NO_THREAD_SAFETY_ANALYSIS {
|
|
2404
2311
|
g_fallback_bootstrap_config = nullptr;
|
2405
2312
|
delete g_mu;
|
2406
2313
|
g_mu = nullptr;
|
2314
|
+
XdsChannelCredsRegistry::Shutdown();
|
2407
2315
|
XdsHttpFilterRegistry::Shutdown();
|
2408
2316
|
}
|
2409
2317
|
|
@@ -2412,7 +2320,7 @@ namespace {
|
|
2412
2320
|
std::string GetBootstrapContents(const char* fallback_config,
|
2413
2321
|
grpc_error_handle* error) {
|
2414
2322
|
// First, try GRPC_XDS_BOOTSTRAP env var.
|
2415
|
-
|
2323
|
+
UniquePtr<char> path(gpr_getenv("GRPC_XDS_BOOTSTRAP"));
|
2416
2324
|
if (path != nullptr) {
|
2417
2325
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2418
2326
|
gpr_log(GPR_INFO,
|
@@ -2429,8 +2337,7 @@ std::string GetBootstrapContents(const char* fallback_config,
|
|
2429
2337
|
return contents_str;
|
2430
2338
|
}
|
2431
2339
|
// Next, try GRPC_XDS_BOOTSTRAP_CONFIG env var.
|
2432
|
-
|
2433
|
-
gpr_getenv("GRPC_XDS_BOOTSTRAP_CONFIG"));
|
2340
|
+
UniquePtr<char> env_config(gpr_getenv("GRPC_XDS_BOOTSTRAP_CONFIG"));
|
2434
2341
|
if (env_config != nullptr) {
|
2435
2342
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2436
2343
|
gpr_log(GPR_INFO,
|
@@ -2540,7 +2447,7 @@ void XdsClientArgDestroy(void* p) {
|
|
2540
2447
|
xds_client->Unref(DEBUG_LOCATION, "channel arg");
|
2541
2448
|
}
|
2542
2449
|
|
2543
|
-
int XdsClientArgCmp(void* p, void* q) { return
|
2450
|
+
int XdsClientArgCmp(void* p, void* q) { return QsortCompare(p, q); }
|
2544
2451
|
|
2545
2452
|
const grpc_arg_pointer_vtable kXdsClientArgVtable = {
|
2546
2453
|
XdsClientArgCopy, XdsClientArgDestroy, XdsClientArgCmp};
|