grpc 1.28.0 → 1.36.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Makefile +1692 -22343
- data/etc/roots.pem +257 -573
- data/include/grpc/compression.h +1 -1
- data/include/grpc/grpc.h +17 -9
- data/include/grpc/grpc_security.h +274 -180
- data/include/grpc/grpc_security_constants.h +4 -0
- data/include/grpc/impl/codegen/README.md +22 -0
- data/include/grpc/impl/codegen/atm_windows.h +4 -0
- data/include/grpc/impl/codegen/byte_buffer.h +1 -1
- data/include/grpc/impl/codegen/grpc_types.h +32 -30
- data/include/grpc/impl/codegen/log.h +0 -2
- data/include/grpc/impl/codegen/port_platform.h +34 -90
- data/include/grpc/impl/codegen/sync_windows.h +4 -0
- data/include/grpc/module.modulemap +24 -39
- data/include/grpc/slice_buffer.h +3 -3
- data/include/grpc/support/sync.h +3 -3
- data/include/grpc/support/time.h +7 -7
- data/src/core/ext/filters/client_channel/backend_metric.cc +16 -12
- data/src/core/ext/filters/client_channel/backup_poller.cc +3 -2
- data/src/core/ext/filters/client_channel/client_channel.cc +3750 -2341
- data/src/core/ext/filters/client_channel/client_channel.h +1 -7
- data/src/core/ext/filters/client_channel/client_channel_channelz.h +0 -3
- data/src/core/ext/filters/client_channel/client_channel_plugin.cc +4 -3
- data/src/core/ext/filters/client_channel/config_selector.cc +58 -0
- data/src/core/ext/filters/client_channel/config_selector.h +125 -0
- data/src/core/ext/filters/client_channel/dynamic_filters.cc +186 -0
- data/src/core/ext/filters/client_channel/dynamic_filters.h +99 -0
- data/src/core/ext/filters/client_channel/global_subchannel_pool.cc +24 -2
- data/src/core/ext/filters/client_channel/health/health_check_client.cc +25 -30
- data/src/core/ext/filters/client_channel/health/health_check_client.h +7 -7
- data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +15 -16
- data/src/core/ext/filters/client_channel/http_proxy.cc +44 -34
- data/src/core/ext/filters/client_channel/lb_policy.cc +25 -20
- data/src/core/ext/filters/client_channel/lb_policy.h +50 -38
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc +96 -0
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.h +101 -0
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc +20 -11
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +481 -510
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc +76 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h +37 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h +1 -2
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +6 -41
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc +3 -1
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +3 -2
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +24 -18
- data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +922 -0
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +11 -10
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +18 -46
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +744 -0
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +520 -134
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds.h +53 -26
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h +29 -0
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +810 -0
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +722 -0
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +1384 -0
- data/src/core/ext/filters/client_channel/lb_policy_registry.cc +18 -8
- data/src/core/ext/filters/client_channel/local_subchannel_pool.h +2 -1
- data/src/core/ext/filters/client_channel/resolver.cc +6 -10
- data/src/core/ext/filters/client_channel/resolver.h +10 -20
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +111 -110
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +4 -34
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc +22 -24
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +13 -11
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +79 -122
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +642 -180
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +10 -3
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +61 -61
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +102 -108
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +1 -5
- data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +362 -0
- data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +38 -31
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +625 -46
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h +28 -0
- data/src/core/ext/filters/client_channel/resolver_factory.h +8 -8
- data/src/core/ext/filters/client_channel/resolver_registry.cc +55 -52
- data/src/core/ext/filters/client_channel/resolver_registry.h +10 -10
- data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +47 -93
- data/src/core/ext/filters/client_channel/resolver_result_parsing.h +30 -26
- data/src/core/ext/filters/client_channel/retry_throttle.cc +5 -3
- data/src/core/ext/filters/client_channel/retry_throttle.h +4 -2
- data/src/core/ext/filters/client_channel/server_address.cc +129 -13
- data/src/core/ext/filters/client_channel/server_address.h +80 -32
- data/src/core/ext/filters/client_channel/service_config.cc +114 -149
- data/src/core/ext/filters/client_channel/service_config.h +33 -100
- data/src/core/ext/filters/client_channel/service_config_call_data.h +86 -0
- data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +142 -0
- data/src/core/ext/filters/client_channel/service_config_parser.cc +89 -0
- data/src/core/ext/filters/client_channel/service_config_parser.h +92 -0
- data/src/core/ext/filters/client_channel/subchannel.cc +156 -98
- data/src/core/ext/filters/client_channel/subchannel.h +65 -35
- data/src/core/ext/filters/client_channel/subchannel_interface.h +41 -5
- data/src/core/ext/filters/client_channel/subchannel_pool_interface.h +6 -2
- data/src/core/ext/filters/deadline/deadline_filter.cc +87 -79
- data/src/core/ext/filters/deadline/deadline_filter.h +7 -11
- data/src/core/ext/filters/http/client/http_client_filter.cc +29 -34
- data/src/core/ext/filters/http/client_authority_filter.cc +10 -10
- data/src/core/ext/filters/http/http_filters_plugin.cc +34 -15
- data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +258 -221
- data/src/core/ext/filters/http/message_compress/message_decompress_filter.cc +399 -0
- data/src/core/ext/filters/http/message_compress/message_decompress_filter.h +31 -0
- data/src/core/ext/filters/http/server/http_server_filter.cc +3 -3
- data/src/core/ext/filters/max_age/max_age_filter.cc +38 -34
- data/src/core/ext/filters/message_size/message_size_filter.cc +64 -90
- data/src/core/ext/filters/message_size/message_size_filter.h +12 -5
- data/src/core/ext/filters/workarounds/workaround_utils.cc +1 -1
- data/src/core/ext/transport/chttp2/client/authority.cc +3 -3
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +87 -31
- data/src/core/ext/transport/chttp2/client/chttp2_connector.h +19 -2
- data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +20 -8
- data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc +21 -10
- data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +34 -47
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +505 -344
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +16 -2
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +13 -3
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +19 -18
- data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc +65 -21
- data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +7 -7
- data/src/core/ext/transport/chttp2/transport/bin_encoder.cc +4 -6
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +307 -343
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +1 -0
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +36 -33
- data/src/core/ext/transport/chttp2/transport/flow_control.h +27 -19
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +9 -12
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +6 -7
- data/src/core/ext/transport/chttp2/transport/frame_goaway.h +2 -3
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +5 -6
- data/src/core/ext/transport/chttp2/transport/frame_ping.h +2 -3
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +12 -13
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +2 -3
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +8 -9
- data/src/core/ext/transport/chttp2/transport/frame_settings.h +4 -4
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +15 -18
- data/src/core/ext/transport/chttp2/transport/frame_window_update.h +2 -3
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +29 -16
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +2 -3
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +37 -37
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +2 -3
- data/src/core/ext/transport/chttp2/transport/hpack_table.cc +13 -17
- data/src/core/ext/transport/chttp2/transport/hpack_table.h +2 -2
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +4 -5
- data/src/core/ext/transport/chttp2/transport/huffsyms.h +2 -3
- data/src/core/ext/transport/chttp2/transport/internal.h +37 -23
- data/src/core/ext/transport/chttp2/transport/parsing.cc +52 -74
- data/src/core/ext/transport/chttp2/transport/stream_map.h +2 -3
- data/src/core/ext/transport/chttp2/transport/writing.cc +30 -28
- data/src/core/ext/transport/inproc/inproc_transport.cc +106 -33
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +1 -1
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +1 -1
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +10 -4
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +243 -0
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +865 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c +74 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h +253 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +453 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +1801 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c +35 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h +77 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +56 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +364 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +124 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +428 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c +35 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h +88 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +334 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +1066 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +103 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +388 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c +34 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h +78 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c +53 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h +149 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +241 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +839 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +170 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +767 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c +36 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h +88 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +176 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +730 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +27 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h +65 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +34 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +95 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +42 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +126 -0
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +90 -0
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h +243 -0
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +91 -0
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +305 -0
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c +112 -0
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h +367 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c +33 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h +73 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +130 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +557 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +159 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +623 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +40 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +107 -0
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +178 -0
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +662 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +65 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +237 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +926 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +3746 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c +60 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h +159 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +49 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h +122 -0
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c +29 -0
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +67 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +361 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +1484 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c +19 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h +35 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +113 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +458 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +73 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +219 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +146 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +621 -0
- data/src/core/ext/upb-generated/envoy/{api/v2/rds.upb.c → service/cluster/v3/cds.upb.c} +7 -9
- data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h +56 -0
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c +25 -0
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h +56 -0
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +146 -0
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +499 -0
- data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c +27 -0
- data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h +56 -0
- data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c +27 -0
- data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h +56 -0
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +54 -0
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h +151 -0
- data/src/core/ext/upb-generated/envoy/{api/v2/srds.upb.c → service/route/v3/rds.upb.c} +7 -7
- data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h +56 -0
- data/src/core/ext/upb-generated/envoy/{api/v2/cds.upb.c → service/route/v3/srds.upb.c} +7 -7
- data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h +56 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c +47 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h +128 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c +35 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h +84 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c +34 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h +78 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +64 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h +166 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +53 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h +146 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c +63 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h +207 -0
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c +88 -0
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h +301 -0
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c +90 -0
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h +283 -0
- data/src/core/ext/upb-generated/envoy/type/{http.upb.c → v3/http.upb.c} +3 -2
- data/src/core/ext/upb-generated/envoy/type/{http.upb.h → v3/http.upb.h} +9 -9
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c +40 -0
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h +99 -0
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.c +51 -0
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.h +130 -0
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c +30 -0
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h +68 -0
- data/src/core/ext/upb-generated/google/api/annotations.upb.h +1 -1
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c +242 -0
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h +830 -0
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +251 -0
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +871 -0
- data/src/core/ext/upb-generated/google/api/http.upb.c +3 -3
- data/src/core/ext/upb-generated/google/api/http.upb.h +52 -32
- data/src/core/ext/upb-generated/google/protobuf/any.upb.c +1 -1
- data/src/core/ext/upb-generated/google/protobuf/any.upb.h +12 -6
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +107 -106
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +691 -496
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.c +1 -1
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +12 -6
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.c +1 -1
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.h +8 -2
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +5 -5
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +55 -57
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +1 -1
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +12 -6
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +9 -9
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +82 -28
- data/src/core/ext/upb-generated/google/rpc/status.upb.c +1 -1
- data/src/core/ext/upb-generated/google/rpc/status.upb.h +17 -10
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +5 -5
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +40 -45
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +43 -43
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +236 -184
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c +5 -5
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +29 -13
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c +2 -2
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +19 -7
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +17 -17
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +122 -62
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +3 -3
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +30 -12
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.c +31 -0
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.h +64 -0
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +1 -1
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.c +28 -0
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.h +71 -0
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c +27 -0
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h +60 -0
- data/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c +9 -9
- data/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h +48 -68
- data/src/core/ext/upb-generated/validate/validate.upb.c +71 -70
- data/src/core/ext/upb-generated/validate/validate.upb.h +732 -586
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.c +28 -0
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.h +60 -0
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c +52 -0
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h +143 -0
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c +42 -0
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h +84 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.c +36 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.h +94 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c +54 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h +166 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c +36 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h +85 -0
- data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c +38 -0
- data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h +30 -0
- data/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c +41 -0
- data/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c +251 -0
- data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h +105 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c +100 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +543 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h +145 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c +53 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c +136 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c +127 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h +65 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c +56 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +272 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h +135 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +143 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h +55 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c +56 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c +66 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c +263 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h +100 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +233 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h +70 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c +56 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +228 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h +80 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c +43 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c +59 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c +68 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c +107 -0
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h +50 -0
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +113 -0
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h +50 -0
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c +146 -0
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h +55 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c +50 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +195 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h +55 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c +193 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h +65 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c +59 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +101 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +938 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h +285 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c +71 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c +61 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c +51 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +504 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +115 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c +44 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h +30 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +170 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h +55 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c +97 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +246 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h +60 -0
- data/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c +72 -0
- data/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c +60 -0
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c +142 -0
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h +65 -0
- data/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c +73 -0
- data/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c +72 -0
- data/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c +80 -0
- data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c +80 -0
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c +74 -0
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c +64 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c +54 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c +53 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c +73 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c +69 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c +81 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c +92 -0
- data/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h +65 -0
- data/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c +95 -0
- data/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h +55 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c +34 -0
- data/src/core/ext/{upb-generated/gogoproto/gogo.upb.h → upbdefs-generated/envoy/type/v3/http.upbdefs.h} +10 -10
- data/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c +59 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c +54 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c +47 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c +40 -0
- data/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h +30 -0
- data/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c +61 -0
- data/src/core/ext/upbdefs-generated/google/api/http.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c +39 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c +386 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h +165 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c +40 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c +37 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c +65 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h +50 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c +40 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c +66 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h +75 -0
- data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c +42 -0
- data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c +70 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c +56 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c +33 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h +30 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c +49 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c +43 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c +310 -0
- data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.h +145 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c +42 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c +62 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c +45 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c +49 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c +67 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c +50 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h +35 -0
- data/src/core/ext/xds/certificate_provider_factory.h +61 -0
- data/src/core/ext/xds/certificate_provider_registry.cc +103 -0
- data/src/core/ext/xds/certificate_provider_registry.h +57 -0
- data/src/core/ext/xds/certificate_provider_store.cc +87 -0
- data/src/core/ext/xds/certificate_provider_store.h +112 -0
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +144 -0
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +69 -0
- data/src/core/ext/xds/xds_api.cc +2479 -0
- data/src/core/ext/xds/xds_api.h +431 -0
- data/src/core/ext/xds/xds_bootstrap.cc +539 -0
- data/src/core/ext/xds/xds_bootstrap.h +116 -0
- data/src/core/ext/xds/xds_certificate_provider.cc +405 -0
- data/src/core/ext/xds/xds_certificate_provider.h +151 -0
- data/src/core/ext/{filters/client_channel/xds → xds}/xds_channel_args.h +9 -6
- data/src/core/ext/{filters/client_channel/xds → xds}/xds_client.cc +839 -774
- data/src/core/ext/xds/xds_client.h +339 -0
- data/src/core/ext/xds/xds_client_stats.cc +159 -0
- data/src/core/ext/{filters/client_channel/xds → xds}/xds_client_stats.h +78 -38
- data/src/core/ext/xds/xds_server_config_fetcher.cc +267 -0
- data/src/core/lib/channel/channel_args.cc +24 -22
- data/src/core/lib/channel/channel_args.h +3 -2
- data/src/core/lib/channel/channel_stack.h +20 -13
- data/src/core/lib/channel/channel_trace.cc +6 -8
- data/src/core/lib/channel/channel_trace.h +1 -1
- data/src/core/lib/channel/channelz.cc +46 -94
- data/src/core/lib/channel/channelz.h +17 -25
- data/src/core/lib/channel/channelz_registry.cc +20 -15
- data/src/core/lib/channel/channelz_registry.h +3 -1
- data/src/core/lib/channel/connected_channel.cc +7 -5
- data/src/core/lib/channel/context.h +1 -1
- data/src/core/lib/channel/handshaker.cc +15 -20
- data/src/core/lib/channel/handshaker.h +7 -5
- data/src/core/lib/channel/handshaker_registry.cc +5 -17
- data/src/core/lib/channel/status_util.cc +2 -3
- data/src/core/lib/compression/compression.cc +8 -4
- data/src/core/lib/compression/compression_args.cc +3 -2
- data/src/core/lib/compression/compression_internal.cc +10 -5
- data/src/core/lib/compression/compression_internal.h +2 -1
- data/src/core/lib/compression/message_compress.cc +5 -1
- data/src/core/lib/compression/stream_compression_identity.cc +1 -3
- data/src/core/lib/debug/stats.cc +21 -27
- data/src/core/lib/debug/stats.h +5 -3
- data/src/core/lib/debug/stats_data.cc +1 -0
- data/src/core/lib/debug/stats_data.h +13 -13
- data/src/core/lib/gpr/alloc.cc +3 -2
- data/src/core/lib/gpr/cpu_iphone.cc +10 -2
- data/src/core/lib/gpr/log.cc +59 -17
- data/src/core/lib/gpr/log_linux.cc +23 -9
- data/src/core/lib/gpr/log_posix.cc +19 -7
- data/src/core/lib/gpr/log_windows.cc +18 -4
- data/src/core/lib/gpr/murmur_hash.cc +1 -1
- data/src/core/lib/gpr/spinlock.h +12 -5
- data/src/core/lib/gpr/string.cc +33 -55
- data/src/core/lib/gpr/string.h +9 -24
- data/src/core/lib/gpr/sync.cc +4 -4
- data/src/core/lib/gpr/sync_abseil.cc +2 -0
- data/src/core/lib/gpr/sync_posix.cc +2 -8
- data/src/core/lib/gpr/time.cc +16 -12
- data/src/core/lib/gpr/time_posix.cc +1 -1
- data/src/core/lib/gpr/time_precise.cc +5 -2
- data/src/core/lib/gpr/time_precise.h +6 -2
- data/src/core/lib/gpr/tls.h +4 -0
- data/src/core/lib/gpr/tls_msvc.h +2 -0
- data/src/core/lib/gpr/tls_stdcpp.h +48 -0
- data/src/core/lib/gpr/useful.h +5 -4
- data/src/core/lib/gprpp/arena.h +3 -2
- data/src/core/lib/gprpp/atomic.h +6 -6
- data/src/core/lib/gprpp/dual_ref_counted.h +331 -0
- data/src/core/lib/gprpp/examine_stack.cc +43 -0
- data/src/core/lib/gprpp/examine_stack.h +46 -0
- data/src/core/lib/gprpp/fork.cc +3 -3
- data/src/core/lib/gprpp/global_config_env.cc +8 -6
- data/src/core/lib/gprpp/host_port.cc +29 -35
- data/src/core/lib/gprpp/host_port.h +14 -17
- data/src/core/lib/gprpp/manual_constructor.h +1 -1
- data/src/core/lib/gprpp/mpscq.cc +2 -2
- data/src/core/lib/gprpp/orphanable.h +4 -8
- data/src/core/lib/gprpp/ref_counted.h +91 -68
- data/src/core/lib/gprpp/ref_counted_ptr.h +171 -7
- data/src/core/lib/gprpp/stat.h +38 -0
- data/src/core/lib/gprpp/stat_posix.cc +49 -0
- data/src/core/lib/gprpp/stat_windows.cc +48 -0
- data/src/core/lib/gprpp/sync.h +129 -40
- data/src/core/lib/gprpp/thd.h +2 -2
- data/src/core/lib/gprpp/thd_posix.cc +42 -37
- data/src/core/lib/gprpp/thd_windows.cc +3 -1
- data/src/core/lib/gprpp/time_util.cc +77 -0
- data/src/core/lib/gprpp/time_util.h +42 -0
- data/src/core/lib/http/format_request.cc +46 -65
- data/src/core/lib/http/httpcli.cc +16 -14
- data/src/core/lib/http/httpcli.h +4 -6
- data/src/core/lib/http/httpcli_security_connector.cc +13 -13
- data/src/core/lib/http/parser.cc +47 -27
- data/src/core/lib/http/parser.h +2 -3
- data/src/core/lib/iomgr/buffer_list.h +22 -21
- data/src/core/lib/iomgr/call_combiner.cc +8 -5
- data/src/core/lib/iomgr/call_combiner.h +3 -2
- data/src/core/lib/iomgr/cfstream_handle.cc +4 -2
- data/src/core/lib/iomgr/closure.h +2 -3
- data/src/core/lib/iomgr/combiner.cc +2 -1
- data/src/core/lib/iomgr/dualstack_socket_posix.cc +47 -0
- data/src/core/lib/iomgr/endpoint.cc +5 -1
- data/src/core/lib/iomgr/endpoint.h +8 -4
- data/src/core/lib/iomgr/endpoint_cfstream.cc +38 -14
- data/src/core/lib/iomgr/endpoint_pair.h +2 -3
- data/src/core/lib/iomgr/endpoint_pair_posix.cc +10 -10
- data/src/core/lib/iomgr/error.cc +23 -21
- data/src/core/lib/iomgr/error.h +0 -1
- data/src/core/lib/iomgr/error_cfstream.cc +9 -8
- data/src/core/lib/iomgr/error_internal.h +1 -1
- data/src/core/lib/iomgr/ev_apple.cc +359 -0
- data/src/core/lib/iomgr/ev_apple.h +43 -0
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +43 -40
- data/src/core/lib/iomgr/ev_epollex_linux.cc +46 -45
- data/src/core/lib/iomgr/ev_poll_posix.cc +18 -15
- data/src/core/lib/iomgr/ev_posix.cc +2 -3
- data/src/core/lib/iomgr/exec_ctx.cc +1 -1
- data/src/core/lib/iomgr/exec_ctx.h +26 -10
- data/src/core/lib/iomgr/executor.cc +2 -1
- data/src/core/lib/iomgr/executor.h +1 -1
- data/src/core/lib/iomgr/executor/mpmcqueue.h +5 -5
- data/src/core/lib/iomgr/executor/threadpool.h +4 -4
- data/src/core/lib/iomgr/iomgr.cc +1 -1
- data/src/core/lib/iomgr/iomgr_posix.cc +0 -1
- data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +84 -21
- data/src/core/lib/iomgr/is_epollexclusive_available.cc +14 -0
- data/src/core/lib/iomgr/load_file.h +1 -1
- data/src/core/lib/iomgr/lockfree_event.cc +19 -14
- data/src/core/lib/iomgr/lockfree_event.h +2 -2
- data/src/core/lib/iomgr/parse_address.cc +322 -0
- data/src/core/lib/iomgr/parse_address.h +77 -0
- data/src/core/lib/iomgr/poller/eventmanager_libuv.cc +2 -1
- data/src/core/lib/iomgr/poller/eventmanager_libuv.h +1 -1
- data/src/core/lib/iomgr/pollset_set_custom.cc +11 -11
- data/src/core/lib/{gprpp/optional.h → iomgr/pollset_uv.h} +11 -12
- data/src/core/lib/iomgr/port.h +2 -21
- data/src/core/lib/iomgr/python_util.h +46 -0
- data/src/core/lib/iomgr/resolve_address.cc +4 -4
- data/src/core/lib/iomgr/resolve_address.h +4 -6
- data/src/core/lib/iomgr/resolve_address_custom.cc +42 -57
- data/src/core/lib/iomgr/resolve_address_custom.h +4 -2
- data/src/core/lib/iomgr/resolve_address_posix.cc +11 -16
- data/src/core/lib/iomgr/resolve_address_windows.cc +16 -25
- data/src/core/lib/iomgr/resource_quota.cc +38 -37
- data/src/core/lib/iomgr/sockaddr_utils.cc +41 -44
- data/src/core/lib/iomgr/sockaddr_utils.h +13 -17
- data/src/core/lib/iomgr/socket_factory_posix.cc +3 -2
- data/src/core/lib/iomgr/socket_factory_posix.h +2 -3
- data/src/core/lib/iomgr/socket_mutator.cc +3 -2
- data/src/core/lib/iomgr/socket_mutator.h +2 -3
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +103 -81
- data/src/core/lib/iomgr/socket_utils_posix.h +3 -0
- data/src/core/lib/iomgr/socket_windows.cc +4 -5
- data/src/core/lib/iomgr/tcp_client.cc +3 -3
- data/src/core/lib/iomgr/tcp_client_cfstream.cc +14 -18
- data/src/core/lib/iomgr/tcp_client_custom.cc +13 -15
- data/src/core/lib/iomgr/tcp_client_posix.cc +31 -37
- data/src/core/lib/iomgr/tcp_client_windows.cc +10 -11
- data/src/core/lib/iomgr/tcp_custom.cc +56 -36
- data/src/core/lib/iomgr/tcp_custom.h +1 -1
- data/src/core/lib/iomgr/tcp_posix.cc +47 -25
- data/src/core/lib/iomgr/tcp_server.cc +3 -4
- data/src/core/lib/iomgr/tcp_server.h +7 -5
- data/src/core/lib/iomgr/tcp_server_custom.cc +39 -45
- data/src/core/lib/iomgr/tcp_server_posix.cc +38 -44
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +3 -4
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +7 -8
- data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +10 -18
- data/src/core/lib/iomgr/tcp_server_windows.cc +16 -16
- data/src/core/lib/iomgr/tcp_uv.cc +3 -2
- data/src/core/lib/iomgr/tcp_windows.cc +26 -10
- data/src/core/lib/iomgr/time_averaged_stats.h +2 -3
- data/src/core/lib/iomgr/timer_custom.cc +5 -5
- data/src/core/lib/iomgr/timer_generic.cc +18 -18
- data/src/core/lib/{gprpp/inlined_vector.h → iomgr/timer_generic.h} +19 -17
- data/src/core/lib/iomgr/timer_heap.h +2 -3
- data/src/core/lib/iomgr/timer_manager.cc +2 -2
- data/src/core/lib/iomgr/udp_server.cc +33 -38
- data/src/core/lib/iomgr/udp_server.h +6 -4
- data/src/core/lib/iomgr/unix_sockets_posix.cc +36 -30
- data/src/core/lib/iomgr/unix_sockets_posix.h +8 -1
- data/src/core/lib/iomgr/unix_sockets_posix_noop.cc +12 -2
- data/src/core/lib/iomgr/wakeup_fd_pipe.cc +2 -2
- data/src/core/lib/json/json.h +15 -4
- data/src/core/lib/json/json_reader.cc +33 -30
- data/src/core/lib/json/json_util.cc +58 -0
- data/src/core/lib/json/json_util.h +204 -0
- data/src/core/lib/json/json_writer.cc +15 -13
- data/src/core/lib/security/authorization/authorization_engine.cc +177 -0
- data/src/core/lib/security/authorization/authorization_engine.h +84 -0
- data/src/core/lib/security/authorization/evaluate_args.cc +148 -0
- data/src/core/lib/security/authorization/evaluate_args.h +59 -0
- data/src/core/lib/security/authorization/matchers.cc +339 -0
- data/src/core/lib/security/authorization/matchers.h +158 -0
- data/src/core/lib/security/authorization/mock_cel/activation.h +57 -0
- data/src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h +44 -0
- data/src/core/lib/security/authorization/mock_cel/cel_expression.h +69 -0
- data/src/core/lib/security/authorization/mock_cel/cel_value.h +99 -0
- data/src/core/lib/security/authorization/mock_cel/evaluator_core.h +67 -0
- data/src/core/lib/security/authorization/mock_cel/flat_expr_builder.h +57 -0
- data/src/core/lib/security/context/security_context.cc +4 -3
- data/src/core/lib/security/context/security_context.h +3 -1
- data/src/core/lib/security/credentials/alts/alts_credentials.cc +2 -1
- data/src/core/lib/security/credentials/alts/alts_credentials.h +1 -1
- data/src/core/lib/security/credentials/alts/check_gcp_environment.cc +1 -1
- data/src/core/lib/security/credentials/composite/composite_credentials.cc +12 -0
- data/src/core/lib/security/credentials/composite/composite_credentials.h +6 -3
- data/src/core/lib/security/credentials/credentials.cc +7 -91
- data/src/core/lib/security/credentials/credentials.h +18 -66
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +413 -0
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.h +80 -0
- data/src/core/lib/security/credentials/external/aws_request_signer.cc +213 -0
- data/src/core/lib/security/credentials/external/aws_request_signer.h +72 -0
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +497 -0
- data/src/core/lib/security/credentials/external/external_account_credentials.h +120 -0
- data/src/core/lib/security/credentials/external/file_external_account_credentials.cc +135 -0
- data/src/core/lib/security/credentials/external/file_external_account_credentials.h +48 -0
- data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +213 -0
- data/src/core/lib/security/credentials/external/url_external_account_credentials.h +58 -0
- data/src/core/lib/security/credentials/fake/fake_credentials.cc +3 -2
- data/src/core/lib/security/credentials/fake/fake_credentials.h +4 -0
- data/src/core/lib/security/credentials/google_default/credentials_generic.cc +8 -6
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +90 -67
- data/src/core/lib/security/credentials/iam/iam_credentials.cc +8 -6
- data/src/core/lib/security/credentials/iam/iam_credentials.h +4 -0
- data/src/core/lib/security/credentials/insecure/insecure_credentials.cc +64 -0
- data/src/core/lib/security/credentials/jwt/json_token.cc +4 -4
- data/src/core/lib/security/credentials/jwt/json_token.h +2 -5
- data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +7 -4
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +13 -0
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +13 -19
- data/src/core/lib/security/credentials/jwt/jwt_verifier.h +2 -3
- data/src/core/lib/security/credentials/local/local_credentials.cc +2 -1
- data/src/core/lib/security/credentials/local/local_credentials.h +1 -1
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +109 -97
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +14 -7
- data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +20 -7
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +2 -0
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +27 -6
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +12 -2
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc +346 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h +213 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +399 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +138 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +78 -140
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +74 -167
- data/src/core/lib/security/credentials/tls/tls_credentials.cc +18 -13
- data/src/core/lib/security/credentials/tls/tls_credentials.h +3 -3
- data/src/core/lib/security/credentials/tls/tls_utils.cc +91 -0
- data/src/core/lib/security/credentials/tls/tls_utils.h +38 -0
- data/src/core/lib/security/credentials/xds/xds_credentials.cc +244 -0
- data/src/core/lib/security/credentials/xds/xds_credentials.h +69 -0
- data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +22 -7
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +27 -32
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc +121 -0
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +87 -0
- data/src/core/lib/security/security_connector/load_system_roots.h +4 -0
- data/src/core/lib/security/security_connector/load_system_roots_linux.cc +3 -2
- data/src/core/lib/security/security_connector/load_system_roots_linux.h +2 -0
- data/src/core/lib/security/security_connector/local/local_security_connector.cc +4 -4
- data/src/core/lib/security/security_connector/security_connector.cc +6 -3
- data/src/core/lib/security/security_connector/security_connector.h +6 -4
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +42 -40
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.h +8 -5
- data/src/core/lib/security/security_connector/ssl_utils.cc +94 -23
- data/src/core/lib/security/security_connector/ssl_utils.h +37 -31
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +388 -284
- data/src/core/lib/security/security_connector/tls/tls_security_connector.h +108 -42
- data/src/core/lib/security/transport/auth_filters.h +0 -5
- data/src/core/lib/security/transport/client_auth_filter.cc +11 -11
- data/src/core/lib/security/transport/secure_endpoint.cc +9 -3
- data/src/core/lib/security/transport/security_handshaker.cc +4 -6
- data/src/core/lib/security/transport/server_auth_filter.cc +2 -1
- data/src/core/lib/security/util/json_util.cc +12 -13
- data/src/core/lib/security/util/json_util.h +1 -0
- data/src/core/lib/slice/slice.cc +45 -5
- data/src/core/lib/slice/slice_buffer.cc +2 -1
- data/src/core/lib/slice/slice_intern.cc +9 -11
- data/src/core/lib/slice/slice_internal.h +17 -2
- data/src/core/lib/slice/slice_utils.h +9 -0
- data/src/core/lib/surface/byte_buffer_reader.cc +2 -47
- data/src/core/lib/surface/call.cc +95 -88
- data/src/core/lib/surface/call.h +2 -1
- data/src/core/lib/surface/call_details.cc +8 -8
- data/src/core/lib/surface/call_log_batch.cc +50 -58
- data/src/core/lib/surface/channel.cc +86 -72
- data/src/core/lib/surface/channel.h +54 -7
- data/src/core/lib/surface/channel_init.cc +1 -1
- data/src/core/lib/surface/channel_ping.cc +2 -3
- data/src/core/lib/surface/completion_queue.cc +63 -62
- data/src/core/lib/surface/completion_queue.h +16 -16
- data/src/core/lib/surface/event_string.cc +18 -25
- data/src/core/lib/surface/event_string.h +3 -1
- data/src/core/lib/surface/init.cc +45 -29
- data/src/core/lib/surface/init_secure.cc +1 -4
- data/src/core/lib/surface/lame_client.cc +20 -46
- data/src/core/lib/surface/lame_client.h +4 -0
- data/src/core/lib/surface/server.cc +1311 -1309
- data/src/core/lib/surface/server.h +410 -45
- data/src/core/lib/surface/validate_metadata.h +3 -0
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/authority_override.cc +40 -0
- data/src/core/lib/transport/authority_override.h +37 -0
- data/src/core/lib/transport/bdp_estimator.cc +1 -1
- data/src/core/lib/transport/bdp_estimator.h +2 -1
- data/src/core/lib/transport/byte_stream.h +10 -5
- data/src/core/lib/transport/connectivity_state.cc +23 -17
- data/src/core/lib/transport/connectivity_state.h +31 -15
- data/src/core/lib/transport/error_utils.cc +13 -0
- data/src/core/lib/transport/error_utils.h +7 -1
- data/src/core/lib/transport/metadata.cc +19 -5
- data/src/core/lib/transport/metadata.h +2 -2
- data/src/core/lib/transport/metadata_batch.h +6 -7
- data/src/core/lib/transport/static_metadata.cc +296 -277
- data/src/core/lib/transport/static_metadata.h +81 -74
- data/src/core/lib/transport/status_conversion.cc +6 -14
- data/src/core/lib/transport/status_metadata.cc +4 -3
- data/src/core/lib/transport/timeout_encoding.cc +4 -4
- data/src/core/lib/transport/transport.cc +7 -6
- data/src/core/lib/transport/transport.h +24 -10
- data/src/core/lib/transport/transport_op_string.cc +61 -102
- data/src/core/lib/uri/uri_parser.cc +135 -258
- data/src/core/lib/uri/uri_parser.h +60 -23
- data/src/core/plugin_registry/grpc_plugin_registry.cc +59 -12
- data/src/core/tsi/alts/crypt/aes_gcm.cc +0 -2
- data/src/core/tsi/alts/crypt/gsec.cc +5 -4
- data/src/core/tsi/alts/frame_protector/frame_handler.cc +8 -6
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +48 -34
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.h +8 -4
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +98 -48
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +9 -1
- data/src/core/tsi/alts/handshaker/transport_security_common_api.cc +2 -0
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.h +2 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.cc +8 -6
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +4 -4
- data/src/core/tsi/fake_transport_security.cc +17 -19
- data/src/core/tsi/local_transport_security.cc +5 -1
- data/src/core/tsi/local_transport_security.h +6 -7
- data/src/core/tsi/ssl/session_cache/ssl_session.h +0 -2
- data/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc +1 -1
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +0 -2
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +3 -4
- data/src/core/tsi/ssl_transport_security.cc +226 -105
- data/src/core/tsi/ssl_transport_security.h +28 -16
- data/src/core/tsi/ssl_types.h +0 -2
- data/src/core/tsi/transport_security.cc +10 -8
- data/src/core/tsi/transport_security.h +6 -9
- data/src/core/tsi/transport_security_grpc.h +2 -3
- data/src/core/tsi/transport_security_interface.h +9 -4
- data/src/ruby/bin/math_services_pb.rb +4 -4
- data/src/ruby/ext/grpc/extconf.rb +6 -3
- data/src/ruby/ext/grpc/rb_call.c +12 -3
- data/src/ruby/ext/grpc/rb_call.h +4 -0
- data/src/ruby/ext/grpc/rb_call_credentials.c +57 -12
- data/src/ruby/ext/grpc/rb_channel_credentials.c +9 -0
- data/src/ruby/ext/grpc/rb_event_thread.c +2 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +42 -18
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +80 -44
- data/src/ruby/lib/grpc/errors.rb +103 -42
- data/src/ruby/lib/grpc/generic/active_call.rb +2 -3
- data/src/ruby/lib/grpc/generic/client_stub.rb +1 -1
- data/src/ruby/lib/grpc/generic/interceptors.rb +5 -5
- data/src/ruby/lib/grpc/generic/rpc_server.rb +9 -10
- data/src/ruby/lib/grpc/generic/service.rb +5 -4
- data/src/ruby/lib/grpc/structs.rb +1 -1
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/generate_proto_ruby.sh +5 -3
- data/src/ruby/pb/grpc/health/v1/health_services_pb.rb +2 -2
- data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +51 -0
- data/src/ruby/pb/src/proto/grpc/testing/test_services_pb.rb +61 -11
- data/src/ruby/spec/channel_credentials_spec.rb +10 -0
- data/src/ruby/spec/debug_message_spec.rb +134 -0
- data/src/ruby/spec/generic/active_call_spec.rb +19 -8
- data/src/ruby/spec/generic/service_spec.rb +2 -0
- data/src/ruby/spec/pb/codegen/grpc/testing/package_options_import2.proto +23 -0
- data/src/ruby/spec/pb/codegen/grpc/testing/package_options_ruby_style.proto +7 -0
- data/src/ruby/spec/pb/codegen/grpc/testing/same_package_service_name.proto +27 -0
- data/src/ruby/spec/pb/codegen/grpc/testing/same_ruby_package_service_name.proto +29 -0
- data/src/ruby/spec/pb/codegen/package_option_spec.rb +29 -7
- data/src/ruby/spec/support/services.rb +10 -4
- data/src/ruby/spec/testdata/ca.pem +18 -13
- data/src/ruby/spec/testdata/client.key +26 -14
- data/src/ruby/spec/testdata/client.pem +18 -12
- data/src/ruby/spec/testdata/server1.key +26 -14
- data/src/ruby/spec/testdata/server1.pem +20 -14
- data/src/ruby/spec/user_agent_spec.rb +74 -0
- data/third_party/abseil-cpp/absl/algorithm/container.h +1764 -0
- data/third_party/abseil-cpp/absl/base/attributes.h +99 -38
- data/third_party/abseil-cpp/absl/base/call_once.h +1 -1
- data/third_party/abseil-cpp/absl/base/casts.h +9 -6
- data/third_party/abseil-cpp/absl/base/config.h +60 -17
- data/third_party/abseil-cpp/absl/base/dynamic_annotations.h +428 -335
- data/third_party/abseil-cpp/absl/base/internal/bits.h +17 -16
- data/third_party/abseil-cpp/absl/base/internal/direct_mmap.h +166 -0
- data/third_party/abseil-cpp/absl/base/internal/dynamic_annotations.h +398 -0
- data/third_party/abseil-cpp/absl/base/internal/exponential_biased.cc +93 -0
- data/third_party/abseil-cpp/absl/base/internal/exponential_biased.h +130 -0
- data/third_party/abseil-cpp/absl/base/internal/invoke.h +4 -4
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc +620 -0
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.h +126 -0
- data/third_party/abseil-cpp/absl/base/internal/low_level_scheduling.h +29 -1
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +2 -2
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +7 -5
- data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +25 -38
- data/third_party/abseil-cpp/absl/base/internal/spinlock.h +19 -25
- data/third_party/abseil-cpp/absl/base/internal/spinlock_linux.inc +8 -0
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +28 -5
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.h +8 -0
- data/third_party/abseil-cpp/absl/base/internal/tsan_mutex_interface.h +3 -1
- data/third_party/abseil-cpp/absl/base/internal/unaligned_access.h +2 -2
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +3 -3
- data/third_party/abseil-cpp/absl/base/macros.h +36 -109
- data/third_party/abseil-cpp/absl/base/optimization.h +61 -1
- data/third_party/abseil-cpp/absl/base/options.h +31 -4
- data/third_party/abseil-cpp/absl/base/policy_checks.h +1 -1
- data/third_party/abseil-cpp/absl/base/thread_annotations.h +94 -39
- data/third_party/abseil-cpp/absl/container/fixed_array.h +532 -0
- data/third_party/abseil-cpp/absl/container/flat_hash_map.h +606 -0
- data/third_party/abseil-cpp/absl/container/flat_hash_set.h +504 -0
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +33 -36
- data/third_party/abseil-cpp/absl/container/internal/common.h +206 -0
- data/third_party/abseil-cpp/absl/container/internal/compressed_tuple.h +33 -8
- data/third_party/abseil-cpp/absl/container/internal/container_memory.h +460 -0
- data/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h +161 -0
- data/third_party/abseil-cpp/absl/container/internal/hash_policy_traits.h +208 -0
- data/third_party/abseil-cpp/absl/container/internal/hashtable_debug_hooks.h +85 -0
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +270 -0
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +321 -0
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler_force_weak_definition.cc +30 -0
- data/third_party/abseil-cpp/absl/container/internal/have_sse.h +50 -0
- data/third_party/abseil-cpp/absl/container/internal/layout.h +743 -0
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +197 -0
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +48 -0
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +1903 -0
- data/third_party/abseil-cpp/absl/debugging/internal/address_is_readable.cc +139 -0
- data/third_party/abseil-cpp/absl/debugging/internal/address_is_readable.h +32 -0
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +1945 -0
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.h +71 -0
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc +382 -0
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h +134 -0
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +196 -0
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_arm-inl.inc +134 -0
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h +89 -0
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_generic-inl.inc +108 -0
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +248 -0
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_unimplemented-inl.inc +24 -0
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_win32-inl.inc +93 -0
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +346 -0
- data/third_party/abseil-cpp/absl/debugging/internal/symbolize.h +149 -0
- data/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc +173 -0
- data/third_party/abseil-cpp/absl/debugging/internal/vdso_support.h +158 -0
- data/third_party/abseil-cpp/absl/debugging/stacktrace.cc +140 -0
- data/third_party/abseil-cpp/absl/debugging/stacktrace.h +231 -0
- data/third_party/abseil-cpp/absl/debugging/symbolize.cc +36 -0
- data/third_party/abseil-cpp/absl/debugging/symbolize.h +99 -0
- data/third_party/abseil-cpp/absl/debugging/symbolize_darwin.inc +101 -0
- data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +1560 -0
- data/third_party/abseil-cpp/absl/debugging/symbolize_unimplemented.inc +40 -0
- data/third_party/abseil-cpp/absl/debugging/symbolize_win32.inc +81 -0
- data/third_party/abseil-cpp/absl/functional/bind_front.h +184 -0
- data/third_party/abseil-cpp/absl/functional/function_ref.h +139 -0
- data/third_party/abseil-cpp/absl/functional/internal/front_binder.h +95 -0
- data/third_party/abseil-cpp/absl/functional/internal/function_ref.h +106 -0
- data/third_party/abseil-cpp/absl/hash/hash.h +325 -0
- data/third_party/abseil-cpp/absl/hash/internal/city.cc +346 -0
- data/third_party/abseil-cpp/absl/hash/internal/city.h +96 -0
- data/third_party/abseil-cpp/absl/hash/internal/hash.cc +55 -0
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +996 -0
- data/third_party/abseil-cpp/absl/memory/memory.h +4 -0
- data/third_party/abseil-cpp/absl/meta/type_traits.h +2 -8
- data/third_party/abseil-cpp/absl/numeric/int128.cc +13 -27
- data/third_party/abseil-cpp/absl/numeric/int128.h +16 -15
- data/third_party/abseil-cpp/absl/status/internal/status_internal.h +51 -0
- data/third_party/abseil-cpp/absl/status/internal/statusor_internal.h +399 -0
- data/third_party/abseil-cpp/absl/status/status.cc +445 -0
- data/third_party/abseil-cpp/absl/status/status.h +817 -0
- data/third_party/abseil-cpp/absl/status/status_payload_printer.cc +38 -0
- data/third_party/abseil-cpp/absl/status/status_payload_printer.h +51 -0
- data/third_party/abseil-cpp/absl/status/statusor.cc +71 -0
- data/third_party/abseil-cpp/absl/status/statusor.h +760 -0
- data/third_party/abseil-cpp/absl/strings/charconv.cc +2 -2
- data/third_party/abseil-cpp/absl/strings/cord.cc +1998 -0
- data/third_party/abseil-cpp/absl/strings/cord.h +1276 -0
- data/third_party/abseil-cpp/absl/strings/escaping.cc +9 -9
- data/third_party/abseil-cpp/absl/strings/internal/char_map.h +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.h +2 -2
- data/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc +2 -2
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +173 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +222 -136
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +136 -64
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +14 -21
- data/third_party/abseil-cpp/absl/strings/internal/str_format/checker.h +7 -14
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +31 -7
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +147 -135
- data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +999 -87
- data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.h +3 -3
- data/third_party/abseil-cpp/absl/strings/internal/str_format/output.h +4 -12
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc +8 -6
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +13 -11
- data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +2 -2
- data/third_party/abseil-cpp/absl/strings/str_cat.cc +4 -4
- data/third_party/abseil-cpp/absl/strings/str_cat.h +1 -1
- data/third_party/abseil-cpp/absl/strings/str_format.h +289 -13
- data/third_party/abseil-cpp/absl/strings/str_split.cc +2 -2
- data/third_party/abseil-cpp/absl/strings/str_split.h +1 -0
- data/third_party/abseil-cpp/absl/strings/string_view.h +26 -19
- data/third_party/abseil-cpp/absl/strings/substitute.cc +5 -5
- data/third_party/abseil-cpp/absl/strings/substitute.h +32 -29
- data/third_party/abseil-cpp/absl/synchronization/barrier.cc +52 -0
- data/third_party/abseil-cpp/absl/synchronization/barrier.h +79 -0
- data/third_party/abseil-cpp/absl/synchronization/blocking_counter.cc +57 -0
- data/third_party/abseil-cpp/absl/synchronization/blocking_counter.h +99 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.cc +140 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.h +60 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc +698 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.h +141 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h +155 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/mutex_nonprod.inc +249 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.cc +106 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.h +115 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc +492 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter.h +159 -0
- data/third_party/abseil-cpp/absl/synchronization/mutex.cc +2739 -0
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +1065 -0
- data/third_party/abseil-cpp/absl/synchronization/notification.cc +78 -0
- data/third_party/abseil-cpp/absl/synchronization/notification.h +123 -0
- data/third_party/abseil-cpp/absl/time/civil_time.cc +175 -0
- data/third_party/abseil-cpp/absl/time/civil_time.h +538 -0
- data/third_party/abseil-cpp/absl/time/clock.cc +569 -0
- data/third_party/abseil-cpp/absl/time/clock.h +74 -0
- data/third_party/abseil-cpp/absl/time/duration.cc +953 -0
- data/third_party/abseil-cpp/absl/time/format.cc +160 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time.h +332 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time_detail.h +632 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h +386 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/zone_info_source.h +102 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/civil_time_detail.cc +94 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc +140 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.h +52 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc +1029 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.cc +45 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.h +76 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.cc +113 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.h +93 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc +965 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.h +137 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.cc +309 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.h +55 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +187 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_posix.cc +159 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_posix.h +132 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h +122 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc +116 -0
- data/third_party/abseil-cpp/absl/time/internal/get_current_time_chrono.inc +31 -0
- data/third_party/abseil-cpp/absl/time/internal/get_current_time_posix.inc +24 -0
- data/third_party/abseil-cpp/absl/time/time.cc +499 -0
- data/third_party/abseil-cpp/absl/time/time.h +1583 -0
- data/third_party/abseil-cpp/absl/types/bad_variant_access.cc +64 -0
- data/third_party/abseil-cpp/absl/types/bad_variant_access.h +82 -0
- data/third_party/abseil-cpp/absl/types/internal/variant.h +1646 -0
- data/third_party/abseil-cpp/absl/types/optional.h +9 -9
- data/third_party/abseil-cpp/absl/types/span.h +49 -36
- data/third_party/abseil-cpp/absl/types/variant.h +861 -0
- data/third_party/abseil-cpp/absl/utility/utility.h +2 -2
- data/third_party/address_sorting/include/address_sorting/address_sorting.h +2 -0
- data/third_party/boringssl-with-bazel/err_data.c +759 -707
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_bitstr.c +6 -6
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_enum.c +5 -5
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_int.c +6 -6
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_object.c +6 -13
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_octet.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_time.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_type.c +5 -3
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_utctm.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_lib.c +15 -20
- data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_locl.h +30 -0
- data/third_party/boringssl-with-bazel/src/crypto/asn1/asn_pack.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/f_enum.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/f_int.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/f_string.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_dec.c +28 -79
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c +39 -85
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_fre.c +5 -16
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_new.c +10 -61
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_typ.c +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_utl.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/bio/bio.c +2 -0
- data/third_party/boringssl-with-bazel/src/crypto/bio/socket_helper.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/blake2/blake2.c +158 -0
- data/third_party/boringssl-with-bazel/src/crypto/bn_extra/bn_asn1.c +3 -10
- data/third_party/boringssl-with-bazel/src/crypto/bytestring/ber.c +8 -9
- data/third_party/boringssl-with-bazel/src/crypto/bytestring/cbs.c +60 -45
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/derive_key.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_chacha20poly1305.c +6 -81
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/internal.h +87 -0
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/tls_cbc.c +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/cpu-aarch64-win.c +41 -0
- data/third_party/boringssl-with-bazel/src/crypto/cpu-arm-linux.c +7 -5
- data/third_party/boringssl-with-bazel/src/crypto/cpu-intel.c +13 -4
- data/third_party/boringssl-with-bazel/src/crypto/crypto.c +11 -0
- data/third_party/boringssl-with-bazel/src/{third_party/fiat → crypto/curve25519}/curve25519.c +18 -26
- data/third_party/boringssl-with-bazel/src/{third_party/fiat → crypto/curve25519}/curve25519_tables.h +13 -21
- data/third_party/boringssl-with-bazel/src/{third_party/fiat → crypto/curve25519}/internal.h +14 -22
- data/third_party/boringssl-with-bazel/src/crypto/curve25519/spake25519.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/{dh → dh_extra}/dh_asn1.c +0 -0
- data/third_party/boringssl-with-bazel/src/crypto/{dh → dh_extra}/params.c +179 -0
- data/third_party/boringssl-with-bazel/src/crypto/digest_extra/digest_extra.c +25 -0
- data/third_party/boringssl-with-bazel/src/crypto/dsa/dsa.c +19 -43
- data/third_party/boringssl-with-bazel/src/crypto/dsa/dsa_asn1.c +55 -4
- data/third_party/boringssl-with-bazel/src/crypto/dsa/internal.h +34 -0
- data/third_party/boringssl-with-bazel/src/crypto/ec_extra/ec_asn1.c +2 -17
- data/third_party/boringssl-with-bazel/src/crypto/ec_extra/hash_to_curve.c +385 -0
- data/third_party/boringssl-with-bazel/src/crypto/ec_extra/internal.h +56 -0
- data/third_party/boringssl-with-bazel/src/crypto/ecdh_extra/ecdh_extra.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/err/err.c +33 -32
- data/third_party/boringssl-with-bazel/src/crypto/evp/evp.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/evp/evp_asn1.c +159 -0
- data/third_party/boringssl-with-bazel/src/crypto/evp/p_dsa_asn1.c +6 -2
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/aes_nohw.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/mode_wrappers.c +17 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bcm.c +5 -2
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/bn.c +13 -20
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/div.c +2 -3
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/exponentiation.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/internal.h +34 -13
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/montgomery.c +8 -8
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/mul.c +30 -154
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/e_aes.c +173 -35
- data/third_party/boringssl-with-bazel/src/crypto/{dh → fipsmodule/dh}/check.c +0 -0
- data/third_party/boringssl-with-bazel/src/crypto/{dh → fipsmodule/dh}/dh.c +149 -211
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/digest/digest.c +2 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/digest/digests.c +16 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec.c +301 -117
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec_key.c +22 -28
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec_montgomery.c +96 -55
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/felem.c +25 -7
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/internal.h +434 -161
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/oct.c +63 -71
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p224-64.c +18 -25
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p256-x86_64-table.h +9481 -9485
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p256-x86_64.c +104 -122
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p256.c +740 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p256_table.h +297 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/scalar.c +90 -11
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/simple.c +125 -148
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/simple_mul.c +189 -3
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/util.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/wnaf.c +61 -18
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdh/ecdh.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/ecdsa.c +20 -5
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/fork_detect.c +137 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/fork_detect.h +49 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/getrandom_fillin.h +64 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/internal.h +69 -5
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/rand.c +155 -50
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/urandom.c +24 -121
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/blinding.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/internal.h +5 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa.c +73 -40
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa_impl.c +122 -55
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/self_check.c +217 -2
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha512.c +44 -35
- data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +532 -0
- data/third_party/boringssl-with-bazel/src/crypto/hpke/internal.h +246 -0
- data/third_party/boringssl-with-bazel/src/crypto/mem.c +47 -16
- data/third_party/boringssl-with-bazel/src/crypto/obj/obj_dat.h +15 -1
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/internal.h +7 -0
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8_x509.c +36 -5
- data/third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305.c +10 -7
- data/third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_arm.c +13 -11
- data/third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_vec.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/deterministic.c +6 -10
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/passive.c +34 -0
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/rand_extra.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/windows.c +16 -0
- data/third_party/boringssl-with-bazel/src/crypto/stack/stack.c +7 -13
- data/third_party/boringssl-with-bazel/src/crypto/thread_pthread.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/thread_win.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/trust_token/internal.h +318 -0
- data/third_party/boringssl-with-bazel/src/crypto/trust_token/pmbtoken.c +1399 -0
- data/third_party/boringssl-with-bazel/src/crypto/trust_token/trust_token.c +858 -0
- data/third_party/boringssl-with-bazel/src/crypto/trust_token/voprf.c +766 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/a_strex.c +7 -7
- data/third_party/boringssl-with-bazel/src/crypto/x509/algorithm.c +10 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/asn1_gen.c +4 -4
- data/third_party/boringssl-with-bazel/src/crypto/x509/rsa_pss.c +5 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/t_crl.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509/t_x509.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509.c +0 -67
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_cmp.c +21 -9
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_ext.c +27 -21
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_obj.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_r2x.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_req.c +10 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_set.c +89 -11
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_trs.c +7 -4
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_txt.c +67 -67
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_v3.c +4 -4
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_vfy.c +62 -44
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509cset.c +67 -25
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509name.c +13 -11
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_all.c +10 -10
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_crl.c +38 -17
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_name.c +28 -40
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_pkey.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_pubkey.c +0 -154
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_sig.c +20 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_x509.c +66 -9
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_x509a.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/ext_dat.h +1 -4
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/internal.h +5 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_data.c +5 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_akey.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_alt.c +25 -24
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_bitst.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_conf.c +32 -28
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_cpols.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_enum.c +2 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_genn.c +42 -22
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_ia5.c +3 -4
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_info.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_lib.c +25 -36
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_prn.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_purp.c +126 -40
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_skey.c +7 -7
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_utl.c +6 -6
- data/third_party/boringssl-with-bazel/src/include/openssl/aead.h +24 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/aes.h +16 -4
- data/third_party/boringssl-with-bazel/src/include/openssl/arm_arch.h +54 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1.h +662 -556
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1t.h +0 -167
- data/third_party/boringssl-with-bazel/src/include/openssl/base.h +19 -7
- data/third_party/boringssl-with-bazel/src/include/openssl/bio.h +4 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/blake2.h +62 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/bytestring.h +22 -7
- data/third_party/boringssl-with-bazel/src/include/openssl/cipher.h +21 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/crypto.h +10 -5
- data/third_party/boringssl-with-bazel/src/include/openssl/des.h +6 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/dh.h +82 -20
- data/third_party/boringssl-with-bazel/src/include/openssl/digest.h +11 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/dsa.h +16 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/ec.h +15 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/ecdsa.h +6 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/err.h +2 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +85 -3
- data/third_party/boringssl-with-bazel/src/include/openssl/nid.h +5 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/opensslconf.h +3 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/pem.h +202 -134
- data/third_party/boringssl-with-bazel/src/include/openssl/rand.h +6 -17
- data/third_party/boringssl-with-bazel/src/include/openssl/rsa.h +31 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/sha.h +26 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/span.h +2 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +335 -112
- data/third_party/boringssl-with-bazel/src/include/openssl/tls1.h +33 -10
- data/third_party/boringssl-with-bazel/src/include/openssl/trust_token.h +310 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +1141 -755
- data/third_party/boringssl-with-bazel/src/include/openssl/x509_vfy.h +1 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +593 -440
- data/third_party/boringssl-with-bazel/src/ssl/bio_ssl.cc +18 -5
- data/third_party/boringssl-with-bazel/src/ssl/d1_both.cc +0 -4
- data/third_party/boringssl-with-bazel/src/ssl/d1_lib.cc +3 -3
- data/third_party/boringssl-with-bazel/src/ssl/dtls_method.cc +13 -4
- data/third_party/boringssl-with-bazel/src/ssl/handoff.cc +181 -57
- data/third_party/boringssl-with-bazel/src/ssl/handshake.cc +45 -26
- data/third_party/boringssl-with-bazel/src/ssl/handshake_client.cc +43 -45
- data/third_party/boringssl-with-bazel/src/ssl/handshake_server.cc +32 -10
- data/third_party/boringssl-with-bazel/src/ssl/internal.h +160 -80
- data/third_party/boringssl-with-bazel/src/ssl/s3_both.cc +10 -10
- data/third_party/boringssl-with-bazel/src/ssl/s3_lib.cc +2 -3
- data/third_party/boringssl-with-bazel/src/ssl/s3_pkt.cc +21 -21
- data/third_party/boringssl-with-bazel/src/ssl/ssl_asn1.cc +77 -8
- data/third_party/boringssl-with-bazel/src/ssl/ssl_cert.cc +7 -6
- data/third_party/boringssl-with-bazel/src/ssl/ssl_cipher.cc +8 -9
- data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +131 -15
- data/third_party/boringssl-with-bazel/src/ssl/ssl_privkey.cc +13 -2
- data/third_party/boringssl-with-bazel/src/ssl/ssl_session.cc +50 -15
- data/third_party/boringssl-with-bazel/src/ssl/ssl_stat.cc +6 -0
- data/third_party/boringssl-with-bazel/src/ssl/ssl_transcript.cc +2 -2
- data/third_party/boringssl-with-bazel/src/ssl/ssl_versions.cc +5 -5
- data/third_party/boringssl-with-bazel/src/ssl/t1_enc.cc +53 -30
- data/third_party/boringssl-with-bazel/src/ssl/t1_lib.cc +611 -89
- data/third_party/boringssl-with-bazel/src/ssl/tls13_both.cc +2 -3
- data/third_party/boringssl-with-bazel/src/ssl/tls13_client.cc +187 -68
- data/third_party/boringssl-with-bazel/src/ssl/tls13_enc.cc +71 -90
- data/third_party/boringssl-with-bazel/src/ssl/tls13_server.cc +247 -73
- data/third_party/boringssl-with-bazel/src/ssl/tls_method.cc +63 -25
- data/third_party/boringssl-with-bazel/src/ssl/tls_record.cc +5 -3
- data/third_party/boringssl-with-bazel/src/third_party/fiat/curve25519_32.h +245 -175
- data/third_party/boringssl-with-bazel/src/third_party/fiat/curve25519_64.h +135 -75
- data/third_party/boringssl-with-bazel/src/third_party/fiat/p256_32.h +1593 -1672
- data/third_party/boringssl-with-bazel/src/third_party/fiat/p256_64.h +512 -503
- data/third_party/re2/re2/bitmap256.h +117 -0
- data/third_party/re2/re2/bitstate.cc +385 -0
- data/third_party/re2/re2/compile.cc +1279 -0
- data/third_party/re2/re2/dfa.cc +2130 -0
- data/third_party/re2/re2/filtered_re2.cc +121 -0
- data/third_party/re2/re2/filtered_re2.h +109 -0
- data/third_party/re2/re2/mimics_pcre.cc +197 -0
- data/third_party/re2/re2/nfa.cc +713 -0
- data/third_party/re2/re2/onepass.cc +623 -0
- data/third_party/re2/re2/parse.cc +2464 -0
- data/third_party/re2/re2/perl_groups.cc +119 -0
- data/third_party/re2/re2/pod_array.h +55 -0
- data/third_party/re2/re2/prefilter.cc +710 -0
- data/third_party/re2/re2/prefilter.h +108 -0
- data/third_party/re2/re2/prefilter_tree.cc +407 -0
- data/third_party/re2/re2/prefilter_tree.h +139 -0
- data/third_party/re2/re2/prog.cc +988 -0
- data/third_party/re2/re2/prog.h +436 -0
- data/third_party/re2/re2/re2.cc +1362 -0
- data/third_party/re2/re2/re2.h +1002 -0
- data/third_party/re2/re2/regexp.cc +980 -0
- data/third_party/re2/re2/regexp.h +659 -0
- data/third_party/re2/re2/set.cc +154 -0
- data/third_party/re2/re2/set.h +80 -0
- data/third_party/re2/re2/simplify.cc +657 -0
- data/third_party/re2/re2/sparse_array.h +392 -0
- data/third_party/re2/re2/sparse_set.h +264 -0
- data/third_party/re2/re2/stringpiece.cc +65 -0
- data/third_party/re2/re2/stringpiece.h +210 -0
- data/third_party/re2/re2/tostring.cc +351 -0
- data/third_party/re2/re2/unicode_casefold.cc +582 -0
- data/third_party/re2/re2/unicode_casefold.h +78 -0
- data/third_party/re2/re2/unicode_groups.cc +6269 -0
- data/third_party/re2/re2/unicode_groups.h +67 -0
- data/third_party/re2/re2/walker-inl.h +246 -0
- data/third_party/re2/util/benchmark.h +156 -0
- data/third_party/re2/util/flags.h +26 -0
- data/third_party/re2/util/logging.h +109 -0
- data/third_party/re2/util/malloc_counter.h +19 -0
- data/third_party/re2/util/mix.h +41 -0
- data/third_party/re2/util/mutex.h +148 -0
- data/third_party/re2/util/pcre.cc +1025 -0
- data/third_party/re2/util/pcre.h +681 -0
- data/third_party/re2/util/rune.cc +260 -0
- data/third_party/re2/util/strutil.cc +149 -0
- data/third_party/re2/util/strutil.h +21 -0
- data/third_party/re2/util/test.h +50 -0
- data/third_party/re2/util/utf.h +44 -0
- data/third_party/re2/util/util.h +42 -0
- data/third_party/upb/third_party/wyhash/wyhash.h +145 -0
- data/third_party/upb/upb/decode.c +604 -511
- data/third_party/upb/upb/decode.h +20 -1
- data/third_party/upb/upb/decode.int.h +163 -0
- data/third_party/upb/upb/decode_fast.c +1040 -0
- data/third_party/upb/upb/decode_fast.h +126 -0
- data/third_party/upb/upb/def.c +2178 -0
- data/third_party/upb/upb/def.h +315 -0
- data/third_party/upb/upb/def.hpp +439 -0
- data/third_party/upb/upb/encode.c +311 -211
- data/third_party/upb/upb/encode.h +27 -2
- data/third_party/upb/upb/json_decode.c +1443 -0
- data/third_party/upb/upb/json_decode.h +23 -0
- data/third_party/upb/upb/json_encode.c +713 -0
- data/third_party/upb/upb/json_encode.h +36 -0
- data/third_party/upb/upb/msg.c +215 -70
- data/third_party/upb/upb/msg.h +558 -14
- data/third_party/upb/upb/port_def.inc +105 -63
- data/third_party/upb/upb/port_undef.inc +10 -7
- data/third_party/upb/upb/reflection.c +408 -0
- data/third_party/upb/upb/reflection.h +168 -0
- data/third_party/upb/upb/table.c +73 -269
- data/third_party/upb/upb/table.int.h +25 -57
- data/third_party/upb/upb/text_encode.c +421 -0
- data/third_party/upb/upb/text_encode.h +38 -0
- data/third_party/upb/upb/upb.c +138 -135
- data/third_party/upb/upb/upb.h +119 -146
- data/third_party/upb/upb/upb.hpp +88 -0
- data/third_party/upb/upb/upb.int.h +29 -0
- metadata +646 -164
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds.cc +0 -1754
- data/src/core/ext/filters/client_channel/parse_address.cc +0 -237
- data/src/core/ext/filters/client_channel/parse_address.h +0 -53
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc +0 -484
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc +0 -65
- data/src/core/ext/filters/client_channel/resolving_lb_policy.cc +0 -359
- data/src/core/ext/filters/client_channel/resolving_lb_policy.h +0 -122
- data/src/core/ext/filters/client_channel/xds/xds_api.cc +0 -1779
- data/src/core/ext/filters/client_channel/xds/xds_api.h +0 -280
- data/src/core/ext/filters/client_channel/xds/xds_bootstrap.cc +0 -347
- data/src/core/ext/filters/client_channel/xds/xds_bootstrap.h +0 -87
- data/src/core/ext/filters/client_channel/xds/xds_channel.h +0 -46
- data/src/core/ext/filters/client_channel/xds/xds_channel_secure.cc +0 -104
- data/src/core/ext/filters/client_channel/xds/xds_client.h +0 -274
- data/src/core/ext/filters/client_channel/xds/xds_client_stats.cc +0 -116
- data/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c +0 -246
- data/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h +0 -905
- data/src/core/ext/upb-generated/envoy/api/v2/cds.upb.h +0 -53
- data/src/core/ext/upb-generated/envoy/api/v2/cluster.upb.c +0 -390
- data/src/core/ext/upb-generated/envoy/api/v2/cluster.upb.h +0 -1411
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c +0 -73
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h +0 -218
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c +0 -34
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h +0 -69
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c +0 -54
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h +0 -305
- data/src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c +0 -111
- data/src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h +0 -328
- data/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c +0 -292
- data/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h +0 -847
- data/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c +0 -95
- data/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h +0 -322
- data/src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c +0 -196
- data/src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h +0 -642
- data/src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c +0 -168
- data/src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h +0 -658
- data/src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c +0 -35
- data/src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h +0 -80
- data/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c +0 -132
- data/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h +0 -436
- data/src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c +0 -128
- data/src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h +0 -392
- data/src/core/ext/upb-generated/envoy/api/v2/eds.upb.c +0 -30
- data/src/core/ext/upb-generated/envoy/api/v2/eds.upb.h +0 -53
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint.upb.c +0 -91
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint.upb.h +0 -240
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c +0 -17
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h +0 -33
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint_components.upb.c +0 -88
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint_components.upb.h +0 -258
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c +0 -111
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h +0 -324
- data/src/core/ext/upb-generated/envoy/api/v2/lds.upb.c +0 -30
- data/src/core/ext/upb-generated/envoy/api/v2/lds.upb.h +0 -53
- data/src/core/ext/upb-generated/envoy/api/v2/listener.upb.c +0 -104
- data/src/core/ext/upb-generated/envoy/api/v2/listener.upb.h +0 -383
- data/src/core/ext/upb-generated/envoy/api/v2/listener/listener.upb.c +0 -17
- data/src/core/ext/upb-generated/envoy/api/v2/listener/listener.upb.h +0 -33
- data/src/core/ext/upb-generated/envoy/api/v2/listener/listener_components.upb.c +0 -144
- data/src/core/ext/upb-generated/envoy/api/v2/listener/listener_components.upb.h +0 -527
- data/src/core/ext/upb-generated/envoy/api/v2/listener/udp_listener_config.upb.c +0 -42
- data/src/core/ext/upb-generated/envoy/api/v2/listener/udp_listener_config.upb.h +0 -112
- data/src/core/ext/upb-generated/envoy/api/v2/rds.upb.h +0 -53
- data/src/core/ext/upb-generated/envoy/api/v2/route.upb.c +0 -62
- data/src/core/ext/upb-generated/envoy/api/v2/route.upb.h +0 -199
- data/src/core/ext/upb-generated/envoy/api/v2/route/route.upb.c +0 -17
- data/src/core/ext/upb-generated/envoy/api/v2/route/route.upb.h +0 -33
- data/src/core/ext/upb-generated/envoy/api/v2/route/route_components.upb.c +0 -793
- data/src/core/ext/upb-generated/envoy/api/v2/route/route_components.upb.h +0 -2936
- data/src/core/ext/upb-generated/envoy/api/v2/scoped_route.upb.c +0 -58
- data/src/core/ext/upb-generated/envoy/api/v2/scoped_route.upb.h +0 -134
- data/src/core/ext/upb-generated/envoy/api/v2/srds.upb.h +0 -53
- data/src/core/ext/upb-generated/envoy/config/filter/accesslog/v2/accesslog.upb.c +0 -227
- data/src/core/ext/upb-generated/envoy/config/filter/accesslog/v2/accesslog.upb.h +0 -725
- data/src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.upb.c +0 -296
- data/src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.upb.h +0 -1072
- data/src/core/ext/upb-generated/envoy/config/listener/v2/api_listener.upb.c +0 -32
- data/src/core/ext/upb-generated/envoy/config/listener/v2/api_listener.upb.h +0 -65
- data/src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c +0 -23
- data/src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h +0 -50
- data/src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c +0 -52
- data/src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h +0 -130
- data/src/core/ext/upb-generated/envoy/type/matcher/regex.upb.c +0 -47
- data/src/core/ext/upb-generated/envoy/type/matcher/regex.upb.h +0 -108
- data/src/core/ext/upb-generated/envoy/type/matcher/string.upb.c +0 -52
- data/src/core/ext/upb-generated/envoy/type/matcher/string.upb.h +0 -133
- data/src/core/ext/upb-generated/envoy/type/metadata/v2/metadata.upb.c +0 -87
- data/src/core/ext/upb-generated/envoy/type/metadata/v2/metadata.upb.h +0 -258
- data/src/core/ext/upb-generated/envoy/type/percent.upb.c +0 -38
- data/src/core/ext/upb-generated/envoy/type/percent.upb.h +0 -87
- data/src/core/ext/upb-generated/envoy/type/range.upb.c +0 -49
- data/src/core/ext/upb-generated/envoy/type/range.upb.h +0 -112
- data/src/core/ext/upb-generated/envoy/type/semantic_version.upb.c +0 -28
- data/src/core/ext/upb-generated/envoy/type/semantic_version.upb.h +0 -62
- data/src/core/ext/upb-generated/envoy/type/tracing/v2/custom_tag.upb.c +0 -88
- data/src/core/ext/upb-generated/envoy/type/tracing/v2/custom_tag.upb.h +0 -249
- data/src/core/ext/upb-generated/gogoproto/gogo.upb.c +0 -17
- data/src/core/lib/gprpp/map.h +0 -59
- data/src/core/lib/gprpp/string_view.h +0 -60
- data/src/core/lib/iomgr/iomgr_posix.h +0 -26
- data/src/core/lib/security/transport/target_authority_table.cc +0 -75
- data/src/core/lib/security/transport/target_authority_table.h +0 -40
- data/src/core/lib/slice/slice_hash_table.h +0 -199
- data/src/core/lib/slice/slice_weak_hash_table.h +0 -102
- data/src/core/tsi/grpc_shadow_boringssl.h +0 -3311
- data/third_party/abseil-cpp/absl/base/dynamic_annotations.cc +0 -129
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_pku.c +0 -110
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_sxnet.c +0 -274
- data/third_party/boringssl-with-bazel/src/third_party/fiat/p256.c +0 -1063
- data/third_party/upb/upb/generated_util.h +0 -105
- data/third_party/upb/upb/port.c +0 -26
@@ -0,0 +1,151 @@
|
|
1
|
+
//
|
2
|
+
//
|
3
|
+
// Copyright 2020 gRPC authors.
|
4
|
+
//
|
5
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
// you may not use this file except in compliance with the License.
|
7
|
+
// You may obtain a copy of the License at
|
8
|
+
//
|
9
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
//
|
11
|
+
// Unless required by applicable law or agreed to in writing, software
|
12
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
// See the License for the specific language governing permissions and
|
15
|
+
// limitations under the License.
|
16
|
+
//
|
17
|
+
//
|
18
|
+
|
19
|
+
#ifndef GRPC_CORE_EXT_XDS_XDS_CERTIFICATE_PROVIDER_H
|
20
|
+
#define GRPC_CORE_EXT_XDS_XDS_CERTIFICATE_PROVIDER_H
|
21
|
+
|
22
|
+
#include <grpc/support/port_platform.h>
|
23
|
+
|
24
|
+
#include "src/core/ext/xds/xds_api.h"
|
25
|
+
#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h"
|
26
|
+
|
27
|
+
#define GRPC_ARG_XDS_CERTIFICATE_PROVIDER \
|
28
|
+
"grpc.internal.xds_certificate_provider"
|
29
|
+
|
30
|
+
namespace grpc_core {
|
31
|
+
|
32
|
+
class XdsCertificateProvider : public grpc_tls_certificate_provider {
|
33
|
+
public:
|
34
|
+
XdsCertificateProvider();
|
35
|
+
~XdsCertificateProvider() override;
|
36
|
+
|
37
|
+
grpc_core::RefCountedPtr<grpc_tls_certificate_distributor> distributor()
|
38
|
+
const override {
|
39
|
+
return distributor_;
|
40
|
+
}
|
41
|
+
|
42
|
+
bool ProvidesRootCerts(const std::string& cert_name);
|
43
|
+
void UpdateRootCertNameAndDistributor(
|
44
|
+
const std::string& cert_name, absl::string_view root_cert_name,
|
45
|
+
RefCountedPtr<grpc_tls_certificate_distributor> root_cert_distributor);
|
46
|
+
|
47
|
+
bool ProvidesIdentityCerts(const std::string& cert_name);
|
48
|
+
void UpdateIdentityCertNameAndDistributor(
|
49
|
+
const std::string& cert_name, absl::string_view identity_cert_name,
|
50
|
+
RefCountedPtr<grpc_tls_certificate_distributor>
|
51
|
+
identity_cert_distributor);
|
52
|
+
|
53
|
+
bool GetRequireClientCertificate(const std::string& cert_name);
|
54
|
+
// Updating \a require_client_certificate for a non-existing \a cert_name has
|
55
|
+
// no effect.
|
56
|
+
void UpdateRequireClientCertificate(const std::string& cert_name,
|
57
|
+
bool require_client_certificate);
|
58
|
+
|
59
|
+
std::vector<StringMatcher> GetSanMatchers(const std::string& cluster);
|
60
|
+
void UpdateSubjectAlternativeNameMatchers(
|
61
|
+
const std::string& cluster, std::vector<StringMatcher> matchers);
|
62
|
+
|
63
|
+
grpc_arg MakeChannelArg() const;
|
64
|
+
|
65
|
+
static RefCountedPtr<XdsCertificateProvider> GetFromChannelArgs(
|
66
|
+
const grpc_channel_args* args);
|
67
|
+
|
68
|
+
private:
|
69
|
+
class ClusterCertificateState {
|
70
|
+
public:
|
71
|
+
explicit ClusterCertificateState(
|
72
|
+
XdsCertificateProvider* xds_certificate_provider)
|
73
|
+
: xds_certificate_provider_(xds_certificate_provider) {}
|
74
|
+
|
75
|
+
~ClusterCertificateState();
|
76
|
+
|
77
|
+
// Returns true if the certs aren't being watched and there are no
|
78
|
+
// distributors configured.
|
79
|
+
bool IsSafeToRemove() const;
|
80
|
+
|
81
|
+
bool ProvidesRootCerts() const { return root_cert_distributor_ != nullptr; }
|
82
|
+
bool ProvidesIdentityCerts() const {
|
83
|
+
return identity_cert_distributor_ != nullptr;
|
84
|
+
}
|
85
|
+
|
86
|
+
void UpdateRootCertNameAndDistributor(
|
87
|
+
const std::string& cert_name, absl::string_view root_cert_name,
|
88
|
+
RefCountedPtr<grpc_tls_certificate_distributor> root_cert_distributor);
|
89
|
+
void UpdateIdentityCertNameAndDistributor(
|
90
|
+
const std::string& cert_name, absl::string_view identity_cert_name,
|
91
|
+
RefCountedPtr<grpc_tls_certificate_distributor>
|
92
|
+
identity_cert_distributor);
|
93
|
+
|
94
|
+
void UpdateRootCertWatcher(
|
95
|
+
const std::string& cert_name,
|
96
|
+
grpc_tls_certificate_distributor* root_cert_distributor);
|
97
|
+
void UpdateIdentityCertWatcher(
|
98
|
+
const std::string& cert_name,
|
99
|
+
grpc_tls_certificate_distributor* identity_cert_distributor);
|
100
|
+
|
101
|
+
bool require_client_certificate() const {
|
102
|
+
return require_client_certificate_;
|
103
|
+
}
|
104
|
+
void set_require_client_certificate(bool require_client_certificate) {
|
105
|
+
require_client_certificate_ = require_client_certificate;
|
106
|
+
}
|
107
|
+
|
108
|
+
void WatchStatusCallback(const std::string& cert_name,
|
109
|
+
bool root_being_watched,
|
110
|
+
bool identity_being_watched);
|
111
|
+
|
112
|
+
private:
|
113
|
+
XdsCertificateProvider* xds_certificate_provider_;
|
114
|
+
bool watching_root_certs_ = false;
|
115
|
+
bool watching_identity_certs_ = false;
|
116
|
+
std::string root_cert_name_;
|
117
|
+
std::string identity_cert_name_;
|
118
|
+
RefCountedPtr<grpc_tls_certificate_distributor> root_cert_distributor_;
|
119
|
+
RefCountedPtr<grpc_tls_certificate_distributor> identity_cert_distributor_;
|
120
|
+
grpc_tls_certificate_distributor::TlsCertificatesWatcherInterface*
|
121
|
+
root_cert_watcher_ = nullptr;
|
122
|
+
grpc_tls_certificate_distributor::TlsCertificatesWatcherInterface*
|
123
|
+
identity_cert_watcher_ = nullptr;
|
124
|
+
bool require_client_certificate_ = false;
|
125
|
+
};
|
126
|
+
|
127
|
+
void WatchStatusCallback(std::string cert_name, bool root_being_watched,
|
128
|
+
bool identity_being_watched);
|
129
|
+
|
130
|
+
Mutex mu_;
|
131
|
+
std::map<std::string /*cert_name*/, std::unique_ptr<ClusterCertificateState>>
|
132
|
+
certificate_state_map_;
|
133
|
+
|
134
|
+
// Use a separate mutex for san_matchers_ to avoid deadlocks since
|
135
|
+
// san_matchers_ needs to be accessed when a handshake is being done and we
|
136
|
+
// run into a possible deadlock scenario if using the same mutex. The mutex
|
137
|
+
// deadlock cycle is formed as -
|
138
|
+
// WatchStatusCallback() -> SetKeyMaterials() ->
|
139
|
+
// TlsChannelSecurityConnector::TlsChannelCertificateWatcher::OnCertificatesChanged()
|
140
|
+
// -> HandshakeManager::Add() -> SecurityHandshaker::DoHandshake() ->
|
141
|
+
// subject_alternative_names_matchers()
|
142
|
+
Mutex san_matchers_mu_;
|
143
|
+
std::map<std::string /*cluster_name*/, std::vector<StringMatcher>>
|
144
|
+
san_matcher_map_;
|
145
|
+
|
146
|
+
RefCountedPtr<grpc_tls_certificate_distributor> distributor_;
|
147
|
+
};
|
148
|
+
|
149
|
+
} // namespace grpc_core
|
150
|
+
|
151
|
+
#endif // GRPC_CORE_EXT_XDS_XDS_CERTIFICATE_PROVIDER_H
|
@@ -14,13 +14,16 @@
|
|
14
14
|
// limitations under the License.
|
15
15
|
//
|
16
16
|
|
17
|
-
#ifndef
|
18
|
-
#define
|
19
|
-
|
20
|
-
// Boolean channel arg indicating whether the target is an xds server.
|
21
|
-
#define GRPC_ARG_ADDRESS_IS_XDS_SERVER "grpc.address_is_xds_server"
|
17
|
+
#ifndef GRPC_CORE_EXT_XDS_XDS_CHANNEL_ARGS_H
|
18
|
+
#define GRPC_CORE_EXT_XDS_XDS_CHANNEL_ARGS_H
|
22
19
|
|
23
20
|
// Pointer channel arg containing a ref to the XdsClient object.
|
24
21
|
#define GRPC_ARG_XDS_CLIENT "grpc.xds_client"
|
25
22
|
|
26
|
-
|
23
|
+
// Timeout in milliseconds to wait for a resource to be returned from
|
24
|
+
// the xds server before assuming that it does not exist.
|
25
|
+
// The default is 15 seconds.
|
26
|
+
#define GRPC_ARG_XDS_RESOURCE_DOES_NOT_EXIST_TIMEOUT_MS \
|
27
|
+
"grpc.xds_resource_does_not_exist_timeout_ms"
|
28
|
+
|
29
|
+
#endif /* GRPC_CORE_EXT_XDS_XDS_CHANNEL_ARGS_H */
|
@@ -22,37 +22,33 @@
|
|
22
22
|
#include <limits.h>
|
23
23
|
#include <string.h>
|
24
24
|
|
25
|
+
#include "absl/container/inlined_vector.h"
|
26
|
+
#include "absl/strings/str_format.h"
|
25
27
|
#include "absl/strings/str_join.h"
|
28
|
+
#include "absl/strings/string_view.h"
|
26
29
|
|
27
30
|
#include <grpc/byte_buffer_reader.h>
|
28
31
|
#include <grpc/grpc.h>
|
29
32
|
#include <grpc/support/alloc.h>
|
30
|
-
#include <grpc/support/string_util.h>
|
31
33
|
#include <grpc/support/time.h>
|
32
34
|
|
33
35
|
#include "src/core/ext/filters/client_channel/client_channel.h"
|
34
|
-
#include "src/core/ext/filters/client_channel/parse_address.h"
|
35
|
-
#include "src/core/ext/filters/client_channel/server_address.h"
|
36
36
|
#include "src/core/ext/filters/client_channel/service_config.h"
|
37
|
-
#include "src/core/ext/
|
38
|
-
#include "src/core/ext/
|
39
|
-
#include "src/core/ext/
|
40
|
-
#include "src/core/ext/
|
41
|
-
#include "src/core/ext/filters/client_channel/xds/xds_client_stats.h"
|
37
|
+
#include "src/core/ext/xds/xds_api.h"
|
38
|
+
#include "src/core/ext/xds/xds_channel_args.h"
|
39
|
+
#include "src/core/ext/xds/xds_client.h"
|
40
|
+
#include "src/core/ext/xds/xds_client_stats.h"
|
42
41
|
#include "src/core/lib/backoff/backoff.h"
|
43
42
|
#include "src/core/lib/channel/channel_args.h"
|
44
43
|
#include "src/core/lib/channel/channel_stack.h"
|
45
44
|
#include "src/core/lib/gpr/string.h"
|
46
|
-
#include "src/core/lib/gprpp/map.h"
|
47
45
|
#include "src/core/lib/gprpp/memory.h"
|
48
46
|
#include "src/core/lib/gprpp/orphanable.h"
|
49
47
|
#include "src/core/lib/gprpp/ref_counted_ptr.h"
|
50
48
|
#include "src/core/lib/gprpp/sync.h"
|
51
|
-
#include "src/core/lib/iomgr/combiner.h"
|
52
49
|
#include "src/core/lib/iomgr/sockaddr.h"
|
53
50
|
#include "src/core/lib/iomgr/sockaddr_utils.h"
|
54
51
|
#include "src/core/lib/iomgr/timer.h"
|
55
|
-
#include "src/core/lib/slice/slice_hash_table.h"
|
56
52
|
#include "src/core/lib/slice/slice_internal.h"
|
57
53
|
#include "src/core/lib/slice/slice_string_helpers.h"
|
58
54
|
#include "src/core/lib/surface/call.h"
|
@@ -69,6 +65,16 @@
|
|
69
65
|
namespace grpc_core {
|
70
66
|
|
71
67
|
TraceFlag grpc_xds_client_trace(false, "xds_client");
|
68
|
+
TraceFlag grpc_xds_client_refcount_trace(false, "xds_client_refcount");
|
69
|
+
|
70
|
+
namespace {
|
71
|
+
|
72
|
+
Mutex* g_mu = nullptr;
|
73
|
+
const grpc_channel_args* g_channel_args = nullptr;
|
74
|
+
XdsClient* g_xds_client = nullptr;
|
75
|
+
char* g_fallback_bootstrap_config = nullptr;
|
76
|
+
|
77
|
+
} // namespace
|
72
78
|
|
73
79
|
//
|
74
80
|
// Internal class declarations
|
@@ -95,7 +101,7 @@ class XdsClient::ChannelState::RetryableCall
|
|
95
101
|
void StartNewCallLocked();
|
96
102
|
void StartRetryTimerLocked();
|
97
103
|
static void OnRetryTimer(void* arg, grpc_error* error);
|
98
|
-
|
104
|
+
void OnRetryTimerLocked(grpc_error* error);
|
99
105
|
|
100
106
|
// The wrapped xds call that talks to the xds server. It's instantiated
|
101
107
|
// every time we start a new call. It's null during call retry backoff.
|
@@ -136,22 +142,25 @@ class XdsClient::ChannelState::AdsCallState
|
|
136
142
|
private:
|
137
143
|
class ResourceState : public InternallyRefCounted<ResourceState> {
|
138
144
|
public:
|
139
|
-
ResourceState(const std::string& type_url, const std::string& name
|
140
|
-
|
145
|
+
ResourceState(const std::string& type_url, const std::string& name,
|
146
|
+
bool sent_initial_request)
|
147
|
+
: type_url_(type_url),
|
148
|
+
name_(name),
|
149
|
+
sent_initial_request_(sent_initial_request) {
|
141
150
|
GRPC_CLOSURE_INIT(&timer_callback_, OnTimer, this,
|
142
151
|
grpc_schedule_on_exec_ctx);
|
143
152
|
}
|
144
153
|
|
145
154
|
void Orphan() override {
|
146
155
|
Finish();
|
147
|
-
Unref();
|
156
|
+
Unref(DEBUG_LOCATION, "Orphan");
|
148
157
|
}
|
149
158
|
|
150
159
|
void Start(RefCountedPtr<AdsCallState> ads_calld) {
|
151
|
-
if (
|
152
|
-
|
160
|
+
if (sent_initial_request_) return;
|
161
|
+
sent_initial_request_ = true;
|
153
162
|
ads_calld_ = std::move(ads_calld);
|
154
|
-
Ref().release();
|
163
|
+
Ref(DEBUG_LOCATION, "timer").release();
|
155
164
|
timer_pending_ = true;
|
156
165
|
grpc_timer_init(
|
157
166
|
&timer_,
|
@@ -169,58 +178,60 @@ class XdsClient::ChannelState::AdsCallState
|
|
169
178
|
private:
|
170
179
|
static void OnTimer(void* arg, grpc_error* error) {
|
171
180
|
ResourceState* self = static_cast<ResourceState*>(arg);
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
181
|
+
{
|
182
|
+
MutexLock lock(&self->ads_calld_->xds_client()->mu_);
|
183
|
+
self->OnTimerLocked(GRPC_ERROR_REF(error));
|
184
|
+
}
|
185
|
+
self->ads_calld_.reset();
|
186
|
+
self->Unref(DEBUG_LOCATION, "timer");
|
176
187
|
}
|
177
188
|
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
self->type_url_.c_str(), self->name_.c_str());
|
187
|
-
grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
|
188
|
-
gpr_free(msg);
|
189
|
+
void OnTimerLocked(grpc_error* error) {
|
190
|
+
if (error == GRPC_ERROR_NONE && timer_pending_) {
|
191
|
+
timer_pending_ = false;
|
192
|
+
grpc_error* watcher_error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
|
193
|
+
absl::StrFormat(
|
194
|
+
"timeout obtaining resource {type=%s name=%s} from xds server",
|
195
|
+
type_url_, name_)
|
196
|
+
.c_str());
|
189
197
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
190
|
-
gpr_log(GPR_INFO, "[xds_client %p] %s",
|
191
|
-
|
198
|
+
gpr_log(GPR_INFO, "[xds_client %p] %s", ads_calld_->xds_client(),
|
199
|
+
grpc_error_string(watcher_error));
|
192
200
|
}
|
193
|
-
if (
|
194
|
-
|
195
|
-
self->ads_calld_->xds_client()->service_config_watcher_->OnError(
|
196
|
-
error);
|
197
|
-
} else if (self->type_url_ == XdsApi::kCdsTypeUrl) {
|
198
|
-
ClusterState& state =
|
199
|
-
self->ads_calld_->xds_client()->cluster_map_[self->name_];
|
201
|
+
if (type_url_ == XdsApi::kLdsTypeUrl) {
|
202
|
+
ListenerState& state = ads_calld_->xds_client()->listener_map_[name_];
|
200
203
|
for (const auto& p : state.watchers) {
|
201
|
-
p.first->OnError(GRPC_ERROR_REF(
|
204
|
+
p.first->OnError(GRPC_ERROR_REF(watcher_error));
|
202
205
|
}
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
self->ads_calld_->xds_client()->endpoint_map_[self->name_];
|
206
|
+
} else if (type_url_ == XdsApi::kRdsTypeUrl) {
|
207
|
+
RouteConfigState& state =
|
208
|
+
ads_calld_->xds_client()->route_config_map_[name_];
|
207
209
|
for (const auto& p : state.watchers) {
|
208
|
-
p.first->OnError(GRPC_ERROR_REF(
|
210
|
+
p.first->OnError(GRPC_ERROR_REF(watcher_error));
|
211
|
+
}
|
212
|
+
} else if (type_url_ == XdsApi::kCdsTypeUrl) {
|
213
|
+
ClusterState& state = ads_calld_->xds_client()->cluster_map_[name_];
|
214
|
+
for (const auto& p : state.watchers) {
|
215
|
+
p.first->OnError(GRPC_ERROR_REF(watcher_error));
|
216
|
+
}
|
217
|
+
} else if (type_url_ == XdsApi::kEdsTypeUrl) {
|
218
|
+
EndpointState& state = ads_calld_->xds_client()->endpoint_map_[name_];
|
219
|
+
for (const auto& p : state.watchers) {
|
220
|
+
p.first->OnError(GRPC_ERROR_REF(watcher_error));
|
209
221
|
}
|
210
|
-
GRPC_ERROR_UNREF(error);
|
211
222
|
} else {
|
212
223
|
GPR_UNREACHABLE_CODE(return );
|
213
224
|
}
|
225
|
+
GRPC_ERROR_UNREF(watcher_error);
|
214
226
|
}
|
215
|
-
|
216
|
-
self->Unref();
|
227
|
+
GRPC_ERROR_UNREF(error);
|
217
228
|
}
|
218
229
|
|
219
230
|
const std::string type_url_;
|
220
231
|
const std::string name_;
|
221
232
|
|
222
233
|
RefCountedPtr<AdsCallState> ads_calld_;
|
223
|
-
bool
|
234
|
+
bool sent_initial_request_;
|
224
235
|
bool timer_pending_ = false;
|
225
236
|
grpc_timer timer_;
|
226
237
|
grpc_closure timer_callback_;
|
@@ -229,8 +240,7 @@ class XdsClient::ChannelState::AdsCallState
|
|
229
240
|
struct ResourceTypeState {
|
230
241
|
~ResourceTypeState() { GRPC_ERROR_UNREF(error); }
|
231
242
|
|
232
|
-
//
|
233
|
-
std::string version;
|
243
|
+
// Nonce and error for this resource type.
|
234
244
|
std::string nonce;
|
235
245
|
grpc_error* error = GRPC_ERROR_NONE;
|
236
246
|
|
@@ -241,22 +251,22 @@ class XdsClient::ChannelState::AdsCallState
|
|
241
251
|
|
242
252
|
void SendMessageLocked(const std::string& type_url);
|
243
253
|
|
244
|
-
void AcceptLdsUpdate(
|
245
|
-
void AcceptRdsUpdate(
|
254
|
+
void AcceptLdsUpdate(XdsApi::LdsUpdateMap lds_update_map);
|
255
|
+
void AcceptRdsUpdate(XdsApi::RdsUpdateMap rds_update_map);
|
246
256
|
void AcceptCdsUpdate(XdsApi::CdsUpdateMap cds_update_map);
|
247
257
|
void AcceptEdsUpdate(XdsApi::EdsUpdateMap eds_update_map);
|
248
258
|
|
249
259
|
static void OnRequestSent(void* arg, grpc_error* error);
|
250
|
-
|
260
|
+
void OnRequestSentLocked(grpc_error* error);
|
251
261
|
static void OnResponseReceived(void* arg, grpc_error* error);
|
252
|
-
|
262
|
+
bool OnResponseReceivedLocked();
|
253
263
|
static void OnStatusReceived(void* arg, grpc_error* error);
|
254
|
-
|
264
|
+
void OnStatusReceivedLocked(grpc_error* error);
|
255
265
|
|
256
266
|
bool IsCurrentCallOnChannel() const;
|
257
267
|
|
258
|
-
std::set<
|
259
|
-
|
268
|
+
std::set<absl::string_view> ResourceNamesForRequest(
|
269
|
+
const std::string& type_url);
|
260
270
|
|
261
271
|
// The owning RetryableCall<>.
|
262
272
|
RefCountedPtr<RetryableCall<AdsCallState>> parent_;
|
@@ -314,6 +324,10 @@ class XdsClient::ChannelState::LrsCallState
|
|
314
324
|
public:
|
315
325
|
Reporter(RefCountedPtr<LrsCallState> parent, grpc_millis report_interval)
|
316
326
|
: parent_(std::move(parent)), report_interval_(report_interval) {
|
327
|
+
GRPC_CLOSURE_INIT(&on_next_report_timer_, OnNextReportTimer, this,
|
328
|
+
grpc_schedule_on_exec_ctx);
|
329
|
+
GRPC_CLOSURE_INIT(&on_report_done_, OnReportDone, this,
|
330
|
+
grpc_schedule_on_exec_ctx);
|
317
331
|
ScheduleNextReportLocked();
|
318
332
|
}
|
319
333
|
|
@@ -322,10 +336,10 @@ class XdsClient::ChannelState::LrsCallState
|
|
322
336
|
private:
|
323
337
|
void ScheduleNextReportLocked();
|
324
338
|
static void OnNextReportTimer(void* arg, grpc_error* error);
|
325
|
-
|
326
|
-
|
339
|
+
bool OnNextReportTimerLocked(grpc_error* error);
|
340
|
+
bool SendReportLocked();
|
327
341
|
static void OnReportDone(void* arg, grpc_error* error);
|
328
|
-
|
342
|
+
bool OnReportDoneLocked(grpc_error* error);
|
329
343
|
|
330
344
|
bool IsCurrentReporterOnCall() const {
|
331
345
|
return this == parent_->reporter_.get();
|
@@ -345,11 +359,11 @@ class XdsClient::ChannelState::LrsCallState
|
|
345
359
|
};
|
346
360
|
|
347
361
|
static void OnInitialRequestSent(void* arg, grpc_error* error);
|
362
|
+
void OnInitialRequestSentLocked();
|
348
363
|
static void OnResponseReceived(void* arg, grpc_error* error);
|
364
|
+
bool OnResponseReceivedLocked();
|
349
365
|
static void OnStatusReceived(void* arg, grpc_error* error);
|
350
|
-
|
351
|
-
static void OnResponseReceivedLocked(void* arg, grpc_error* error);
|
352
|
-
static void OnStatusReceivedLocked(void* arg, grpc_error* error);
|
366
|
+
void OnStatusReceivedLocked(grpc_error* error);
|
353
367
|
|
354
368
|
bool IsCurrentCallOnChannel() const;
|
355
369
|
|
@@ -378,6 +392,7 @@ class XdsClient::ChannelState::LrsCallState
|
|
378
392
|
grpc_closure on_status_received_;
|
379
393
|
|
380
394
|
// Load reporting state.
|
395
|
+
bool send_all_clusters_ = false;
|
381
396
|
std::set<std::string> cluster_names_; // Asked for by the LRS server.
|
382
397
|
grpc_millis load_reporting_interval_ = 0;
|
383
398
|
OrphanablePtr<Reporter> reporter_;
|
@@ -391,19 +406,22 @@ class XdsClient::ChannelState::StateWatcher
|
|
391
406
|
: public AsyncConnectivityStateWatcherInterface {
|
392
407
|
public:
|
393
408
|
explicit StateWatcher(RefCountedPtr<ChannelState> parent)
|
394
|
-
:
|
395
|
-
parent_(std::move(parent)) {}
|
409
|
+
: parent_(std::move(parent)) {}
|
396
410
|
|
397
411
|
private:
|
398
|
-
void OnConnectivityStateChange(grpc_connectivity_state new_state
|
412
|
+
void OnConnectivityStateChange(grpc_connectivity_state new_state,
|
413
|
+
const absl::Status& status) override {
|
414
|
+
MutexLock lock(&parent_->xds_client_->mu_);
|
399
415
|
if (!parent_->shutting_down_ &&
|
400
416
|
new_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
|
401
417
|
// In TRANSIENT_FAILURE. Notify all watchers of error.
|
402
418
|
gpr_log(GPR_INFO,
|
403
|
-
"[xds_client %p] xds channel in state
|
404
|
-
|
405
|
-
|
406
|
-
|
419
|
+
"[xds_client %p] xds channel in state:TRANSIENT_FAILURE "
|
420
|
+
"status_message:(%s)",
|
421
|
+
parent_->xds_client(), status.ToString().c_str());
|
422
|
+
parent_->xds_client()->NotifyOnErrorLocked(
|
423
|
+
GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
424
|
+
"xds channel in TRANSIENT_FAILURE"));
|
407
425
|
}
|
408
426
|
}
|
409
427
|
|
@@ -416,69 +434,43 @@ class XdsClient::ChannelState::StateWatcher
|
|
416
434
|
|
417
435
|
namespace {
|
418
436
|
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
GRPC_ARG_SERVICE_CONFIG,
|
428
|
-
// The channel arg for the server URI, since that will be different for
|
429
|
-
// the xds channel than for the parent channel. The client channel
|
430
|
-
// factory will re-add this arg with the right value.
|
431
|
-
GRPC_ARG_SERVER_URI,
|
432
|
-
// The xds channel should use the authority indicated by the target
|
433
|
-
// authority table (see \a ModifyXdsChannelArgs),
|
434
|
-
// as opposed to the authority from the parent channel.
|
435
|
-
GRPC_ARG_DEFAULT_AUTHORITY,
|
436
|
-
// Just as for \a GRPC_ARG_DEFAULT_AUTHORITY, the xds channel should be
|
437
|
-
// treated as a stand-alone channel and not inherit this argument from the
|
438
|
-
// args of the parent channel.
|
439
|
-
GRPC_SSL_TARGET_NAME_OVERRIDE_ARG,
|
440
|
-
// Don't want to pass down channelz node from parent; the balancer
|
441
|
-
// channel will get its own.
|
442
|
-
GRPC_ARG_CHANNELZ_CHANNEL_NODE,
|
443
|
-
// Keepalive interval. We are explicitly setting our own value below.
|
444
|
-
GRPC_ARG_KEEPALIVE_TIME_MS,
|
437
|
+
grpc_channel* CreateXdsChannel(const XdsBootstrap::XdsServer& server) {
|
438
|
+
// Build channel args.
|
439
|
+
absl::InlinedVector<grpc_arg, 2> args_to_add = {
|
440
|
+
grpc_channel_arg_integer_create(
|
441
|
+
const_cast<char*>(GRPC_ARG_KEEPALIVE_TIME_MS),
|
442
|
+
5 * 60 * GPR_MS_PER_SEC),
|
443
|
+
grpc_channel_arg_integer_create(
|
444
|
+
const_cast<char*>(GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL), 1),
|
445
445
|
};
|
446
|
-
|
447
|
-
|
448
|
-
//
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
//
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
// The parent channel's channelz uuid.
|
458
|
-
channelz::ChannelNode* channelz_node = nullptr;
|
459
|
-
const grpc_arg* arg =
|
460
|
-
grpc_channel_args_find(&args, GRPC_ARG_CHANNELZ_CHANNEL_NODE);
|
461
|
-
if (arg != nullptr && arg->type == GRPC_ARG_POINTER &&
|
462
|
-
arg->value.pointer.p != nullptr) {
|
463
|
-
channelz_node = static_cast<channelz::ChannelNode*>(arg->value.pointer.p);
|
464
|
-
args_to_add.emplace_back(
|
465
|
-
channelz::MakeParentUuidArg(channelz_node->uuid()));
|
466
|
-
}
|
467
|
-
// Construct channel args.
|
468
|
-
grpc_channel_args* new_args = grpc_channel_args_copy_and_add_and_remove(
|
469
|
-
&args, args_to_remove, GPR_ARRAY_SIZE(args_to_remove), args_to_add.data(),
|
470
|
-
args_to_add.size());
|
471
|
-
// Make any necessary modifications for security.
|
472
|
-
return ModifyXdsChannelArgs(new_args);
|
446
|
+
grpc_channel_args* new_args = grpc_channel_args_copy_and_add(
|
447
|
+
g_channel_args, args_to_add.data(), args_to_add.size());
|
448
|
+
// Create channel creds.
|
449
|
+
RefCountedPtr<grpc_channel_credentials> channel_creds =
|
450
|
+
XdsChannelCredsRegistry::MakeChannelCreds(server.channel_creds_type,
|
451
|
+
server.channel_creds_config);
|
452
|
+
// Create channel.
|
453
|
+
grpc_channel* channel = grpc_secure_channel_create(
|
454
|
+
channel_creds.get(), server.server_uri.c_str(), new_args, nullptr);
|
455
|
+
grpc_channel_args_destroy(new_args);
|
456
|
+
return channel;
|
473
457
|
}
|
474
458
|
|
475
459
|
} // namespace
|
476
460
|
|
477
|
-
XdsClient::ChannelState::ChannelState(
|
478
|
-
|
479
|
-
: InternallyRefCounted<ChannelState>(
|
461
|
+
XdsClient::ChannelState::ChannelState(WeakRefCountedPtr<XdsClient> xds_client,
|
462
|
+
const XdsBootstrap::XdsServer& server)
|
463
|
+
: InternallyRefCounted<ChannelState>(
|
464
|
+
GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace)
|
465
|
+
? "ChannelState"
|
466
|
+
: nullptr),
|
480
467
|
xds_client_(std::move(xds_client)),
|
481
|
-
|
468
|
+
server_(server) {
|
469
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
470
|
+
gpr_log(GPR_INFO, "[xds_client %p] creating channel to %s",
|
471
|
+
xds_client_.get(), server.server_uri.c_str());
|
472
|
+
}
|
473
|
+
channel_ = CreateXdsChannel(server);
|
482
474
|
GPR_ASSERT(channel_ != nullptr);
|
483
475
|
StartConnectivityWatchLocked();
|
484
476
|
}
|
@@ -489,6 +481,7 @@ XdsClient::ChannelState::~ChannelState() {
|
|
489
481
|
this);
|
490
482
|
}
|
491
483
|
grpc_channel_destroy(channel_);
|
484
|
+
xds_client_.reset(DEBUG_LOCATION, "ChannelState");
|
492
485
|
}
|
493
486
|
|
494
487
|
void XdsClient::ChannelState::Orphan() {
|
@@ -525,7 +518,7 @@ void XdsClient::ChannelState::StartConnectivityWatchLocked() {
|
|
525
518
|
grpc_channel_element* client_channel_elem =
|
526
519
|
grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel_));
|
527
520
|
GPR_ASSERT(client_channel_elem->filter == &grpc_client_channel_filter);
|
528
|
-
watcher_ = new StateWatcher(Ref());
|
521
|
+
watcher_ = new StateWatcher(Ref(DEBUG_LOCATION, "ChannelState+watch"));
|
529
522
|
grpc_client_channel_start_connectivity_watch(
|
530
523
|
client_channel_elem, GRPC_CHANNEL_IDLE,
|
531
524
|
OrphanablePtr<AsyncConnectivityStateWatcherInterface>(watcher_));
|
@@ -560,8 +553,11 @@ void XdsClient::ChannelState::Unsubscribe(const std::string& type_url,
|
|
560
553
|
const std::string& name,
|
561
554
|
bool delay_unsubscription) {
|
562
555
|
if (ads_calld_ != nullptr) {
|
563
|
-
ads_calld_->calld()
|
564
|
-
if (
|
556
|
+
auto* calld = ads_calld_->calld();
|
557
|
+
if (calld != nullptr) {
|
558
|
+
calld->Unsubscribe(type_url, name, delay_unsubscription);
|
559
|
+
if (!calld->HasSubscribedResources()) ads_calld_.reset();
|
560
|
+
}
|
565
561
|
}
|
566
562
|
}
|
567
563
|
|
@@ -580,6 +576,9 @@ XdsClient::ChannelState::RetryableCall<T>::RetryableCall(
|
|
580
576
|
.set_multiplier(GRPC_XDS_RECONNECT_BACKOFF_MULTIPLIER)
|
581
577
|
.set_jitter(GRPC_XDS_RECONNECT_JITTER)
|
582
578
|
.set_max_backoff(GRPC_XDS_RECONNECT_MAX_BACKOFF_SECONDS * 1000)) {
|
579
|
+
// Closure Initialization
|
580
|
+
GRPC_CLOSURE_INIT(&on_retry_timer_, OnRetryTimer, this,
|
581
|
+
grpc_schedule_on_exec_ctx);
|
583
582
|
StartNewCallLocked();
|
584
583
|
}
|
585
584
|
|
@@ -633,8 +632,6 @@ void XdsClient::ChannelState::RetryableCall<T>::StartRetryTimerLocked() {
|
|
633
632
|
chand()->xds_client(), chand(), timeout);
|
634
633
|
}
|
635
634
|
this->Ref(DEBUG_LOCATION, "RetryableCall+retry_timer_start").release();
|
636
|
-
GRPC_CLOSURE_INIT(&on_retry_timer_, OnRetryTimer, this,
|
637
|
-
grpc_schedule_on_exec_ctx);
|
638
635
|
grpc_timer_init(&retry_timer_, next_attempt_time, &on_retry_timer_);
|
639
636
|
retry_timer_callback_pending_ = true;
|
640
637
|
}
|
@@ -643,27 +640,27 @@ template <typename T>
|
|
643
640
|
void XdsClient::ChannelState::RetryableCall<T>::OnRetryTimer(
|
644
641
|
void* arg, grpc_error* error) {
|
645
642
|
RetryableCall* calld = static_cast<RetryableCall*>(arg);
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
643
|
+
{
|
644
|
+
MutexLock lock(&calld->chand_->xds_client()->mu_);
|
645
|
+
calld->OnRetryTimerLocked(GRPC_ERROR_REF(error));
|
646
|
+
}
|
647
|
+
calld->Unref(DEBUG_LOCATION, "RetryableCall+retry_timer_done");
|
650
648
|
}
|
651
649
|
|
652
650
|
template <typename T>
|
653
651
|
void XdsClient::ChannelState::RetryableCall<T>::OnRetryTimerLocked(
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
if (!calld->shutting_down_ && error == GRPC_ERROR_NONE) {
|
652
|
+
grpc_error* error) {
|
653
|
+
retry_timer_callback_pending_ = false;
|
654
|
+
if (!shutting_down_ && error == GRPC_ERROR_NONE) {
|
658
655
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
659
656
|
gpr_log(
|
660
657
|
GPR_INFO,
|
661
658
|
"[xds_client %p] Retry timer fires (chand: %p, retryable call: %p)",
|
662
|
-
|
659
|
+
chand()->xds_client(), chand(), this);
|
663
660
|
}
|
664
|
-
|
661
|
+
StartNewCallLocked();
|
665
662
|
}
|
666
|
-
|
663
|
+
GRPC_ERROR_UNREF(error);
|
667
664
|
}
|
668
665
|
|
669
666
|
//
|
@@ -672,19 +669,24 @@ void XdsClient::ChannelState::RetryableCall<T>::OnRetryTimerLocked(
|
|
672
669
|
|
673
670
|
XdsClient::ChannelState::AdsCallState::AdsCallState(
|
674
671
|
RefCountedPtr<RetryableCall<AdsCallState>> parent)
|
675
|
-
: InternallyRefCounted<AdsCallState>(
|
672
|
+
: InternallyRefCounted<AdsCallState>(
|
673
|
+
GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace)
|
674
|
+
? "AdsCallState"
|
675
|
+
: nullptr),
|
676
676
|
parent_(std::move(parent)) {
|
677
677
|
// Init the ADS call. Note that the call will progress every time there's
|
678
678
|
// activity in xds_client()->interested_parties_, which is comprised of
|
679
679
|
// the polling entities from client_channel.
|
680
680
|
GPR_ASSERT(xds_client() != nullptr);
|
681
|
-
GPR_ASSERT(!xds_client()->server_name_.empty());
|
682
681
|
// Create a call with the specified method name.
|
682
|
+
const auto& method =
|
683
|
+
chand()->server_.ShouldUseV3()
|
684
|
+
? GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_DISCOVERY_DOT_V3_DOT_AGGREGATEDDISCOVERYSERVICE_SLASH_STREAMAGGREGATEDRESOURCES
|
685
|
+
: GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_DISCOVERY_DOT_V2_DOT_AGGREGATEDDISCOVERYSERVICE_SLASH_STREAMAGGREGATEDRESOURCES;
|
683
686
|
call_ = grpc_channel_create_pollset_set_call(
|
684
687
|
chand()->channel_, nullptr, GRPC_PROPAGATE_DEFAULTS,
|
685
|
-
xds_client()->interested_parties_,
|
686
|
-
|
687
|
-
nullptr, GRPC_MILLIS_INF_FUTURE, nullptr);
|
688
|
+
xds_client()->interested_parties_, method, nullptr,
|
689
|
+
GRPC_MILLIS_INF_FUTURE, nullptr);
|
688
690
|
GPR_ASSERT(call_ != nullptr);
|
689
691
|
// Init data associated with the call.
|
690
692
|
grpc_metadata_array_init(&initial_metadata_recv_);
|
@@ -708,19 +710,17 @@ XdsClient::ChannelState::AdsCallState::AdsCallState(
|
|
708
710
|
GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET;
|
709
711
|
op->reserved = nullptr;
|
710
712
|
op++;
|
711
|
-
call_error = grpc_call_start_batch_and_execute(
|
712
|
-
|
713
|
+
call_error = grpc_call_start_batch_and_execute(
|
714
|
+
call_, ops, static_cast<size_t>(op - ops), nullptr);
|
713
715
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
714
716
|
// Op: send request message.
|
715
717
|
GRPC_CLOSURE_INIT(&on_request_sent_, OnRequestSent, this,
|
716
718
|
grpc_schedule_on_exec_ctx);
|
717
|
-
|
718
|
-
Subscribe(XdsApi::kLdsTypeUrl,
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
xds_client()->lds_result_->route_config_name);
|
723
|
-
}
|
719
|
+
for (const auto& p : xds_client()->listener_map_) {
|
720
|
+
Subscribe(XdsApi::kLdsTypeUrl, std::string(p.first));
|
721
|
+
}
|
722
|
+
for (const auto& p : xds_client()->route_config_map_) {
|
723
|
+
Subscribe(XdsApi::kRdsTypeUrl, std::string(p.first));
|
724
724
|
}
|
725
725
|
for (const auto& p : xds_client()->cluster_map_) {
|
726
726
|
Subscribe(XdsApi::kCdsTypeUrl, std::string(p.first));
|
@@ -745,8 +745,8 @@ XdsClient::ChannelState::AdsCallState::AdsCallState(
|
|
745
745
|
Ref(DEBUG_LOCATION, "ADS+OnResponseReceivedLocked").release();
|
746
746
|
GRPC_CLOSURE_INIT(&on_response_received_, OnResponseReceived, this,
|
747
747
|
grpc_schedule_on_exec_ctx);
|
748
|
-
call_error = grpc_call_start_batch_and_execute(
|
749
|
-
|
748
|
+
call_error = grpc_call_start_batch_and_execute(
|
749
|
+
call_, ops, static_cast<size_t>(op - ops), &on_response_received_);
|
750
750
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
751
751
|
// Op: recv server status.
|
752
752
|
op = ops;
|
@@ -762,8 +762,8 @@ XdsClient::ChannelState::AdsCallState::AdsCallState(
|
|
762
762
|
// unreffed.
|
763
763
|
GRPC_CLOSURE_INIT(&on_status_received_, OnStatusReceived, this,
|
764
764
|
grpc_schedule_on_exec_ctx);
|
765
|
-
call_error = grpc_call_start_batch_and_execute(
|
766
|
-
|
765
|
+
call_error = grpc_call_start_batch_and_execute(
|
766
|
+
call_, ops, static_cast<size_t>(op - ops), &on_status_received_);
|
767
767
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
768
768
|
}
|
769
769
|
|
@@ -783,7 +783,7 @@ void XdsClient::ChannelState::AdsCallState::Orphan() {
|
|
783
783
|
// on_status_received_ will complete the cancellation and clean up. Otherwise,
|
784
784
|
// we are here because xds_client has to orphan a failed call, then the
|
785
785
|
// following cancellation will be a no-op.
|
786
|
-
|
786
|
+
grpc_call_cancel_internal(call_);
|
787
787
|
state_map_.clear();
|
788
788
|
// Note that the initial ref is hold by on_status_received_. So the
|
789
789
|
// corresponding unref happens in on_status_received_ instead of here.
|
@@ -798,33 +798,14 @@ void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
|
|
798
798
|
}
|
799
799
|
auto& state = state_map_[type_url];
|
800
800
|
grpc_slice request_payload_slice;
|
801
|
-
std::set<
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
resource_names.insert(xds_client()->lds_result_->route_config_name);
|
810
|
-
request_payload_slice = xds_client()->api_.CreateRdsRequest(
|
811
|
-
xds_client()->lds_result_->route_config_name, state.version,
|
812
|
-
state.nonce, GRPC_ERROR_REF(state.error), !sent_initial_message_);
|
813
|
-
state.subscribed_resources[xds_client()->lds_result_->route_config_name]
|
814
|
-
->Start(Ref());
|
815
|
-
} else if (type_url == XdsApi::kCdsTypeUrl) {
|
816
|
-
resource_names = ClusterNamesForRequest();
|
817
|
-
request_payload_slice = xds_client()->api_.CreateCdsRequest(
|
818
|
-
resource_names, state.version, state.nonce, GRPC_ERROR_REF(state.error),
|
819
|
-
!sent_initial_message_);
|
820
|
-
} else if (type_url == XdsApi::kEdsTypeUrl) {
|
821
|
-
resource_names = EdsServiceNamesForRequest();
|
822
|
-
request_payload_slice = xds_client()->api_.CreateEdsRequest(
|
823
|
-
resource_names, state.version, state.nonce, GRPC_ERROR_REF(state.error),
|
824
|
-
!sent_initial_message_);
|
825
|
-
} else {
|
826
|
-
request_payload_slice = xds_client()->api_.CreateUnsupportedTypeNackRequest(
|
827
|
-
type_url, state.nonce, GRPC_ERROR_REF(state.error));
|
801
|
+
std::set<absl::string_view> resource_names =
|
802
|
+
ResourceNamesForRequest(type_url);
|
803
|
+
request_payload_slice = xds_client()->api_.CreateAdsRequest(
|
804
|
+
chand()->server_, type_url, resource_names,
|
805
|
+
xds_client()->resource_version_map_[type_url], state.nonce,
|
806
|
+
GRPC_ERROR_REF(state.error), !sent_initial_message_);
|
807
|
+
if (type_url != XdsApi::kLdsTypeUrl && type_url != XdsApi::kRdsTypeUrl &&
|
808
|
+
type_url != XdsApi::kCdsTypeUrl && type_url != XdsApi::kEdsTypeUrl) {
|
828
809
|
state_map_.erase(type_url);
|
829
810
|
}
|
830
811
|
sent_initial_message_ = true;
|
@@ -832,7 +813,8 @@ void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
|
|
832
813
|
gpr_log(GPR_INFO,
|
833
814
|
"[xds_client %p] sending ADS request: type=%s version=%s nonce=%s "
|
834
815
|
"error=%s resources=%s",
|
835
|
-
xds_client(), type_url.c_str(),
|
816
|
+
xds_client(), type_url.c_str(),
|
817
|
+
xds_client()->resource_version_map_[type_url].c_str(),
|
836
818
|
state.nonce.c_str(), grpc_error_string(state.error),
|
837
819
|
absl::StrJoin(resource_names, " ").c_str());
|
838
820
|
}
|
@@ -864,7 +846,8 @@ void XdsClient::ChannelState::AdsCallState::Subscribe(
|
|
864
846
|
const std::string& type_url, const std::string& name) {
|
865
847
|
auto& state = state_map_[type_url].subscribed_resources[name];
|
866
848
|
if (state == nullptr) {
|
867
|
-
state = MakeOrphanable<ResourceState>(
|
849
|
+
state = MakeOrphanable<ResourceState>(
|
850
|
+
type_url, name, !xds_client()->resource_version_map_[type_url].empty());
|
868
851
|
SendMessageLocked(type_url);
|
869
852
|
}
|
870
853
|
}
|
@@ -884,110 +867,132 @@ bool XdsClient::ChannelState::AdsCallState::HasSubscribedResources() const {
|
|
884
867
|
}
|
885
868
|
|
886
869
|
void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdate(
|
887
|
-
|
888
|
-
if (!lds_update.has_value()) {
|
889
|
-
gpr_log(GPR_INFO,
|
890
|
-
"[xds_client %p] LDS update does not include requested resource",
|
891
|
-
xds_client());
|
892
|
-
xds_client()->service_config_watcher_->OnError(
|
893
|
-
GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
894
|
-
"LDS update does not include requested resource"));
|
895
|
-
return;
|
896
|
-
}
|
870
|
+
XdsApi::LdsUpdateMap lds_update_map) {
|
897
871
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
898
872
|
gpr_log(GPR_INFO,
|
899
|
-
"[xds_client %p] LDS update received
|
900
|
-
"
|
901
|
-
xds_client(),
|
902
|
-
(!lds_update->route_config_name.empty()
|
903
|
-
? lds_update->route_config_name.c_str()
|
904
|
-
: "<inlined>"),
|
905
|
-
(lds_update->rds_update.has_value()
|
906
|
-
? lds_update->rds_update->cluster_name.c_str()
|
907
|
-
: "<to be obtained via RDS>"));
|
873
|
+
"[xds_client %p] LDS update received containing %" PRIuPTR
|
874
|
+
" resources",
|
875
|
+
xds_client(), lds_update_map.size());
|
908
876
|
}
|
909
877
|
auto& lds_state = state_map_[XdsApi::kLdsTypeUrl];
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
878
|
+
std::set<std::string> rds_resource_names_seen;
|
879
|
+
for (auto& p : lds_update_map) {
|
880
|
+
const std::string& listener_name = p.first;
|
881
|
+
XdsApi::LdsUpdate& lds_update = p.second;
|
882
|
+
auto& state = lds_state.subscribed_resources[listener_name];
|
883
|
+
if (state != nullptr) state->Finish();
|
914
884
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
915
|
-
gpr_log(GPR_INFO,
|
916
|
-
|
917
|
-
|
885
|
+
gpr_log(GPR_INFO, "[xds_client %p] LDS resource %s: %s", xds_client(),
|
886
|
+
listener_name.c_str(), lds_update.ToString().c_str());
|
887
|
+
}
|
888
|
+
// Record the RDS resource names seen.
|
889
|
+
if (!lds_update.route_config_name.empty()) {
|
890
|
+
rds_resource_names_seen.insert(lds_update.route_config_name);
|
891
|
+
}
|
892
|
+
// Ignore identical update.
|
893
|
+
ListenerState& listener_state = xds_client()->listener_map_[listener_name];
|
894
|
+
if (listener_state.update.has_value() &&
|
895
|
+
*listener_state.update == lds_update) {
|
896
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
897
|
+
gpr_log(GPR_INFO,
|
898
|
+
"[xds_client %p] LDS update for %s identical to current, "
|
899
|
+
"ignoring.",
|
900
|
+
xds_client(), listener_name.c_str());
|
901
|
+
}
|
902
|
+
continue;
|
903
|
+
}
|
904
|
+
// Update the listener state.
|
905
|
+
listener_state.update = std::move(lds_update);
|
906
|
+
// Notify watchers.
|
907
|
+
for (const auto& p : listener_state.watchers) {
|
908
|
+
p.first->OnListenerChanged(*listener_state.update);
|
918
909
|
}
|
919
|
-
return;
|
920
910
|
}
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
911
|
+
// For any subscribed resource that is not present in the update,
|
912
|
+
// remove it from the cache and notify watchers that it does not exist.
|
913
|
+
for (const auto& p : lds_state.subscribed_resources) {
|
914
|
+
const std::string& listener_name = p.first;
|
915
|
+
if (lds_update_map.find(listener_name) == lds_update_map.end()) {
|
916
|
+
ListenerState& listener_state =
|
917
|
+
xds_client()->listener_map_[listener_name];
|
918
|
+
// If the resource was newly requested but has not yet been received,
|
919
|
+
// we don't want to generate an error for the watchers, because this LDS
|
920
|
+
// response may be in reaction to an earlier request that did not yet
|
921
|
+
// request the new resource, so its absence from the response does not
|
922
|
+
// necessarily indicate that the resource does not exist.
|
923
|
+
// For that case, we rely on the request timeout instead.
|
924
|
+
if (!listener_state.update.has_value()) continue;
|
925
|
+
listener_state.update.reset();
|
926
|
+
for (const auto& p : listener_state.watchers) {
|
927
|
+
p.first->OnResourceDoesNotExist();
|
928
|
+
}
|
929
|
+
}
|
930
|
+
}
|
931
|
+
// For any RDS resource that is no longer referred to by any LDS
|
932
|
+
// resources, remove it from the cache and notify watchers that it
|
933
|
+
// does not exist.
|
934
|
+
auto& rds_state = state_map_[XdsApi::kRdsTypeUrl];
|
935
|
+
for (const auto& p : rds_state.subscribed_resources) {
|
936
|
+
const std::string& rds_resource_name = p.first;
|
937
|
+
if (rds_resource_names_seen.find(rds_resource_name) ==
|
938
|
+
rds_resource_names_seen.end()) {
|
939
|
+
RouteConfigState& route_config_state =
|
940
|
+
xds_client()->route_config_map_[rds_resource_name];
|
941
|
+
route_config_state.update.reset();
|
942
|
+
for (const auto& p : route_config_state.watchers) {
|
943
|
+
p.first->OnResourceDoesNotExist();
|
944
|
+
}
|
939
945
|
}
|
940
|
-
} else {
|
941
|
-
// Send RDS request for dynamic resolution.
|
942
|
-
Subscribe(XdsApi::kRdsTypeUrl,
|
943
|
-
xds_client()->lds_result_->route_config_name);
|
944
946
|
}
|
945
947
|
}
|
946
948
|
|
947
949
|
void XdsClient::ChannelState::AdsCallState::AcceptRdsUpdate(
|
948
|
-
|
949
|
-
if (!rds_update.has_value()) {
|
950
|
-
gpr_log(GPR_INFO,
|
951
|
-
"[xds_client %p] RDS update does not include requested resource",
|
952
|
-
xds_client());
|
953
|
-
xds_client()->service_config_watcher_->OnError(
|
954
|
-
GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
955
|
-
"RDS update does not include requested resource"));
|
956
|
-
return;
|
957
|
-
}
|
950
|
+
XdsApi::RdsUpdateMap rds_update_map) {
|
958
951
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
959
|
-
gpr_log(GPR_INFO,
|
960
|
-
xds_client
|
952
|
+
gpr_log(GPR_INFO,
|
953
|
+
"[xds_client %p] RDS update received containing %" PRIuPTR
|
954
|
+
" resources",
|
955
|
+
xds_client(), rds_update_map.size());
|
961
956
|
}
|
962
957
|
auto& rds_state = state_map_[XdsApi::kRdsTypeUrl];
|
963
|
-
auto&
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
if (xds_client()->rds_result_ == rds_update) {
|
958
|
+
for (auto& p : rds_update_map) {
|
959
|
+
const std::string& route_config_name = p.first;
|
960
|
+
XdsApi::RdsUpdate& rds_update = p.second;
|
961
|
+
auto& state = rds_state.subscribed_resources[route_config_name];
|
962
|
+
if (state != nullptr) state->Finish();
|
969
963
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
970
|
-
gpr_log(GPR_INFO,
|
971
|
-
|
972
|
-
|
964
|
+
gpr_log(GPR_INFO, "[xds_client %p] RDS resource:\n%s", xds_client(),
|
965
|
+
rds_update.ToString().c_str());
|
966
|
+
}
|
967
|
+
RouteConfigState& route_config_state =
|
968
|
+
xds_client()->route_config_map_[route_config_name];
|
969
|
+
// Ignore identical update.
|
970
|
+
if (route_config_state.update.has_value() &&
|
971
|
+
*route_config_state.update == rds_update) {
|
972
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
973
|
+
gpr_log(GPR_INFO,
|
974
|
+
"[xds_client %p] RDS resource identical to current, ignoring",
|
975
|
+
xds_client());
|
976
|
+
}
|
977
|
+
continue;
|
978
|
+
}
|
979
|
+
// Update the cache.
|
980
|
+
route_config_state.update = std::move(rds_update);
|
981
|
+
// Notify all watchers.
|
982
|
+
for (const auto& p : route_config_state.watchers) {
|
983
|
+
p.first->OnRouteConfigChanged(*route_config_state.update);
|
973
984
|
}
|
974
|
-
return;
|
975
|
-
}
|
976
|
-
xds_client()->rds_result_ = std::move(rds_update);
|
977
|
-
// Notify the watcher.
|
978
|
-
RefCountedPtr<ServiceConfig> service_config;
|
979
|
-
grpc_error* error = xds_client()->CreateServiceConfig(
|
980
|
-
xds_client()->rds_result_->cluster_name, &service_config);
|
981
|
-
if (error == GRPC_ERROR_NONE) {
|
982
|
-
xds_client()->service_config_watcher_->OnServiceConfigChanged(
|
983
|
-
std::move(service_config));
|
984
|
-
} else {
|
985
|
-
xds_client()->service_config_watcher_->OnError(error);
|
986
985
|
}
|
987
986
|
}
|
988
987
|
|
989
988
|
void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdate(
|
990
989
|
XdsApi::CdsUpdateMap cds_update_map) {
|
990
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
991
|
+
gpr_log(GPR_INFO,
|
992
|
+
"[xds_client %p] CDS update received containing %" PRIuPTR
|
993
|
+
" resources",
|
994
|
+
xds_client(), cds_update_map.size());
|
995
|
+
}
|
991
996
|
auto& cds_state = state_map_[XdsApi::kCdsTypeUrl];
|
992
997
|
std::set<std::string> eds_resource_names_seen;
|
993
998
|
for (auto& p : cds_update_map) {
|
@@ -996,13 +1001,8 @@ void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdate(
|
|
996
1001
|
auto& state = cds_state.subscribed_resources[cluster_name];
|
997
1002
|
if (state != nullptr) state->Finish();
|
998
1003
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
999
|
-
gpr_log(GPR_INFO,
|
1000
|
-
|
1001
|
-
"eds_service_name=%s, lrs_load_reporting_server_name=%s",
|
1002
|
-
xds_client(), cluster_name, cds_update.eds_service_name.c_str(),
|
1003
|
-
cds_update.lrs_load_reporting_server_name.has_value()
|
1004
|
-
? cds_update.lrs_load_reporting_server_name.value().c_str()
|
1005
|
-
: "(N/A)");
|
1004
|
+
gpr_log(GPR_INFO, "[xds_client %p] cluster=%s: %s", xds_client(),
|
1005
|
+
cluster_name, cds_update.ToString().c_str());
|
1006
1006
|
}
|
1007
1007
|
// Record the EDS resource names seen.
|
1008
1008
|
eds_resource_names_seen.insert(cds_update.eds_service_name.empty()
|
@@ -1011,9 +1011,7 @@ void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdate(
|
|
1011
1011
|
// Ignore identical update.
|
1012
1012
|
ClusterState& cluster_state = xds_client()->cluster_map_[cluster_name];
|
1013
1013
|
if (cluster_state.update.has_value() &&
|
1014
|
-
|
1015
|
-
cds_update.lrs_load_reporting_server_name ==
|
1016
|
-
cluster_state.update->lrs_load_reporting_server_name) {
|
1014
|
+
*cluster_state.update == cds_update) {
|
1017
1015
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1018
1016
|
gpr_log(GPR_INFO,
|
1019
1017
|
"[xds_client %p] CDS update identical to current, ignoring.",
|
@@ -1029,20 +1027,27 @@ void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdate(
|
|
1029
1027
|
}
|
1030
1028
|
}
|
1031
1029
|
// For any subscribed resource that is not present in the update,
|
1032
|
-
// remove it from the cache and notify watchers
|
1030
|
+
// remove it from the cache and notify watchers that it does not exist.
|
1033
1031
|
for (const auto& p : cds_state.subscribed_resources) {
|
1034
1032
|
const std::string& cluster_name = p.first;
|
1035
1033
|
if (cds_update_map.find(cluster_name) == cds_update_map.end()) {
|
1036
1034
|
ClusterState& cluster_state = xds_client()->cluster_map_[cluster_name];
|
1035
|
+
// If the resource was newly requested but has not yet been received,
|
1036
|
+
// we don't want to generate an error for the watchers, because this CDS
|
1037
|
+
// response may be in reaction to an earlier request that did not yet
|
1038
|
+
// request the new resource, so its absence from the response does not
|
1039
|
+
// necessarily indicate that the resource does not exist.
|
1040
|
+
// For that case, we rely on the request timeout instead.
|
1041
|
+
if (!cluster_state.update.has_value()) continue;
|
1037
1042
|
cluster_state.update.reset();
|
1038
1043
|
for (const auto& p : cluster_state.watchers) {
|
1039
|
-
p.first->
|
1040
|
-
"Cluster not present in CDS update"));
|
1044
|
+
p.first->OnResourceDoesNotExist();
|
1041
1045
|
}
|
1042
1046
|
}
|
1043
1047
|
}
|
1044
|
-
//
|
1045
|
-
// resources
|
1048
|
+
// For any EDS resource that is no longer referred to by any CDS
|
1049
|
+
// resources, remove it from the cache and notify watchers that it
|
1050
|
+
// does not exist.
|
1046
1051
|
auto& eds_state = state_map_[XdsApi::kEdsTypeUrl];
|
1047
1052
|
for (const auto& p : eds_state.subscribed_resources) {
|
1048
1053
|
const std::string& eds_resource_name = p.first;
|
@@ -1052,8 +1057,7 @@ void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdate(
|
|
1052
1057
|
xds_client()->endpoint_map_[eds_resource_name];
|
1053
1058
|
endpoint_state.update.reset();
|
1054
1059
|
for (const auto& p : endpoint_state.watchers) {
|
1055
|
-
p.first->
|
1056
|
-
"ClusterLoadAssignment resource removed due to CDS update"));
|
1060
|
+
p.first->OnResourceDoesNotExist();
|
1057
1061
|
}
|
1058
1062
|
}
|
1059
1063
|
}
|
@@ -1061,6 +1065,12 @@ void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdate(
|
|
1061
1065
|
|
1062
1066
|
void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdate(
|
1063
1067
|
XdsApi::EdsUpdateMap eds_update_map) {
|
1068
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1069
|
+
gpr_log(GPR_INFO,
|
1070
|
+
"[xds_client %p] EDS update received containing %" PRIuPTR
|
1071
|
+
" resources",
|
1072
|
+
xds_client(), eds_update_map.size());
|
1073
|
+
}
|
1064
1074
|
auto& eds_state = state_map_[XdsApi::kEdsTypeUrl];
|
1065
1075
|
for (auto& p : eds_update_map) {
|
1066
1076
|
const char* eds_service_name = p.first.c_str();
|
@@ -1068,72 +1078,20 @@ void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdate(
|
|
1068
1078
|
auto& state = eds_state.subscribed_resources[eds_service_name];
|
1069
1079
|
if (state != nullptr) state->Finish();
|
1070
1080
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1071
|
-
gpr_log(GPR_INFO,
|
1072
|
-
|
1073
|
-
" priorities and %" PRIuPTR
|
1074
|
-
" drop categories received (drop_all=%d)",
|
1075
|
-
xds_client(), eds_update.priority_list_update.size(),
|
1076
|
-
eds_update.drop_config->drop_category_list().size(),
|
1077
|
-
eds_update.drop_config->drop_all());
|
1078
|
-
for (size_t priority = 0;
|
1079
|
-
priority < eds_update.priority_list_update.size(); ++priority) {
|
1080
|
-
const auto* locality_map_update = eds_update.priority_list_update.Find(
|
1081
|
-
static_cast<uint32_t>(priority));
|
1082
|
-
gpr_log(GPR_INFO,
|
1083
|
-
"[xds_client %p] Priority %" PRIuPTR " contains %" PRIuPTR
|
1084
|
-
" localities",
|
1085
|
-
xds_client(), priority, locality_map_update->size());
|
1086
|
-
size_t locality_count = 0;
|
1087
|
-
for (const auto& p : locality_map_update->localities) {
|
1088
|
-
const auto& locality = p.second;
|
1089
|
-
gpr_log(GPR_INFO,
|
1090
|
-
"[xds_client %p] Priority %" PRIuPTR ", locality %" PRIuPTR
|
1091
|
-
" %s has weight %d, contains %" PRIuPTR " server addresses",
|
1092
|
-
xds_client(), priority, locality_count,
|
1093
|
-
locality.name->AsHumanReadableString(), locality.lb_weight,
|
1094
|
-
locality.serverlist.size());
|
1095
|
-
for (size_t i = 0; i < locality.serverlist.size(); ++i) {
|
1096
|
-
char* ipport;
|
1097
|
-
grpc_sockaddr_to_string(&ipport, &locality.serverlist[i].address(),
|
1098
|
-
false);
|
1099
|
-
gpr_log(GPR_INFO,
|
1100
|
-
"[xds_client %p] Priority %" PRIuPTR ", locality %" PRIuPTR
|
1101
|
-
" %s, server address %" PRIuPTR ": %s",
|
1102
|
-
xds_client(), priority, locality_count,
|
1103
|
-
locality.name->AsHumanReadableString(), i, ipport);
|
1104
|
-
gpr_free(ipport);
|
1105
|
-
}
|
1106
|
-
++locality_count;
|
1107
|
-
}
|
1108
|
-
}
|
1109
|
-
for (size_t i = 0;
|
1110
|
-
i < eds_update.drop_config->drop_category_list().size(); ++i) {
|
1111
|
-
const XdsApi::DropConfig::DropCategory& drop_category =
|
1112
|
-
eds_update.drop_config->drop_category_list()[i];
|
1113
|
-
gpr_log(GPR_INFO,
|
1114
|
-
"[xds_client %p] Drop category %s has drop rate %d per million",
|
1115
|
-
xds_client(), drop_category.name.c_str(),
|
1116
|
-
drop_category.parts_per_million);
|
1117
|
-
}
|
1081
|
+
gpr_log(GPR_INFO, "[xds_client %p] EDS resource %s: %s", xds_client(),
|
1082
|
+
eds_service_name, eds_update.ToString().c_str());
|
1118
1083
|
}
|
1119
1084
|
EndpointState& endpoint_state =
|
1120
1085
|
xds_client()->endpoint_map_[eds_service_name];
|
1121
1086
|
// Ignore identical update.
|
1122
|
-
if (endpoint_state.update.has_value()
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
*prev_update.drop_config != *eds_update.drop_config;
|
1129
|
-
if (!priority_list_changed && !drop_config_changed) {
|
1130
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1131
|
-
gpr_log(GPR_INFO,
|
1132
|
-
"[xds_client %p] EDS update identical to current, ignoring.",
|
1133
|
-
xds_client());
|
1134
|
-
}
|
1135
|
-
continue;
|
1087
|
+
if (endpoint_state.update.has_value() &&
|
1088
|
+
*endpoint_state.update == eds_update) {
|
1089
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1090
|
+
gpr_log(GPR_INFO,
|
1091
|
+
"[xds_client %p] EDS update identical to current, ignoring.",
|
1092
|
+
xds_client());
|
1136
1093
|
}
|
1094
|
+
continue;
|
1137
1095
|
}
|
1138
1096
|
// Update the cluster state.
|
1139
1097
|
endpoint_state.update = std::move(eds_update);
|
@@ -1147,19 +1105,19 @@ void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdate(
|
|
1147
1105
|
void XdsClient::ChannelState::AdsCallState::OnRequestSent(void* arg,
|
1148
1106
|
grpc_error* error) {
|
1149
1107
|
AdsCallState* ads_calld = static_cast<AdsCallState*>(arg);
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1108
|
+
{
|
1109
|
+
MutexLock lock(&ads_calld->xds_client()->mu_);
|
1110
|
+
ads_calld->OnRequestSentLocked(GRPC_ERROR_REF(error));
|
1111
|
+
}
|
1112
|
+
ads_calld->Unref(DEBUG_LOCATION, "ADS+OnRequestSentLocked");
|
1154
1113
|
}
|
1155
1114
|
|
1156
1115
|
void XdsClient::ChannelState::AdsCallState::OnRequestSentLocked(
|
1157
|
-
|
1158
|
-
|
1159
|
-
if (self->IsCurrentCallOnChannel() && error == GRPC_ERROR_NONE) {
|
1116
|
+
grpc_error* error) {
|
1117
|
+
if (IsCurrentCallOnChannel() && error == GRPC_ERROR_NONE) {
|
1160
1118
|
// Clean up the sent message.
|
1161
|
-
grpc_byte_buffer_destroy(
|
1162
|
-
|
1119
|
+
grpc_byte_buffer_destroy(send_message_payload_);
|
1120
|
+
send_message_payload_ = nullptr;
|
1163
1121
|
// Continue to send another pending message if any.
|
1164
1122
|
// TODO(roth): The current code to handle buffered messages has the
|
1165
1123
|
// advantage of sending only the most recent list of resource names for
|
@@ -1169,164 +1127,136 @@ void XdsClient::ChannelState::AdsCallState::OnRequestSentLocked(
|
|
1169
1127
|
// order of resource types. We need to fix this if we are seeing some
|
1170
1128
|
// resource type(s) starved due to frequent requests of other resource
|
1171
1129
|
// type(s).
|
1172
|
-
auto it =
|
1173
|
-
if (it !=
|
1174
|
-
|
1175
|
-
|
1130
|
+
auto it = buffered_requests_.begin();
|
1131
|
+
if (it != buffered_requests_.end()) {
|
1132
|
+
SendMessageLocked(*it);
|
1133
|
+
buffered_requests_.erase(it);
|
1176
1134
|
}
|
1177
1135
|
}
|
1178
|
-
|
1136
|
+
GRPC_ERROR_UNREF(error);
|
1179
1137
|
}
|
1180
1138
|
|
1181
1139
|
void XdsClient::ChannelState::AdsCallState::OnResponseReceived(
|
1182
|
-
void* arg, grpc_error* error) {
|
1140
|
+
void* arg, grpc_error* /* error */) {
|
1183
1141
|
AdsCallState* ads_calld = static_cast<AdsCallState*>(arg);
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1187
|
-
|
1142
|
+
bool done;
|
1143
|
+
{
|
1144
|
+
MutexLock lock(&ads_calld->xds_client()->mu_);
|
1145
|
+
done = ads_calld->OnResponseReceivedLocked();
|
1146
|
+
}
|
1147
|
+
if (done) ads_calld->Unref(DEBUG_LOCATION, "ADS+OnResponseReceivedLocked");
|
1188
1148
|
}
|
1189
1149
|
|
1190
|
-
|
1191
|
-
void* arg, grpc_error* /*error*/) {
|
1192
|
-
AdsCallState* ads_calld = static_cast<AdsCallState*>(arg);
|
1193
|
-
XdsClient* xds_client = ads_calld->xds_client();
|
1150
|
+
bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
|
1194
1151
|
// Empty payload means the call was cancelled.
|
1195
|
-
if (!
|
1196
|
-
|
1197
|
-
ads_calld->Unref(DEBUG_LOCATION, "ADS+OnResponseReceivedLocked");
|
1198
|
-
return;
|
1152
|
+
if (!IsCurrentCallOnChannel() || recv_message_payload_ == nullptr) {
|
1153
|
+
return true;
|
1199
1154
|
}
|
1200
1155
|
// Read the response.
|
1201
1156
|
grpc_byte_buffer_reader bbr;
|
1202
|
-
grpc_byte_buffer_reader_init(&bbr,
|
1157
|
+
grpc_byte_buffer_reader_init(&bbr, recv_message_payload_);
|
1203
1158
|
grpc_slice response_slice = grpc_byte_buffer_reader_readall(&bbr);
|
1204
1159
|
grpc_byte_buffer_reader_destroy(&bbr);
|
1205
|
-
grpc_byte_buffer_destroy(
|
1206
|
-
|
1207
|
-
//
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
// mode. We will also need to cancel the timer when we receive a serverlist
|
1214
|
-
// from the balancer.
|
1215
|
-
// Parse the response.
|
1216
|
-
absl::optional<XdsApi::LdsUpdate> lds_update;
|
1217
|
-
absl::optional<XdsApi::RdsUpdate> rds_update;
|
1218
|
-
XdsApi::CdsUpdateMap cds_update_map;
|
1219
|
-
XdsApi::EdsUpdateMap eds_update_map;
|
1220
|
-
std::string version;
|
1221
|
-
std::string nonce;
|
1222
|
-
std::string type_url;
|
1223
|
-
// Note that ParseAdsResponse() also validates the response.
|
1224
|
-
grpc_error* parse_error = xds_client->api_.ParseAdsResponse(
|
1225
|
-
response_slice, xds_client->server_name_,
|
1226
|
-
(xds_client->lds_result_.has_value()
|
1227
|
-
? xds_client->lds_result_->route_config_name
|
1228
|
-
: ""),
|
1229
|
-
ads_calld->ClusterNamesForRequest(),
|
1230
|
-
ads_calld->EdsServiceNamesForRequest(), &lds_update, &rds_update,
|
1231
|
-
&cds_update_map, &eds_update_map, &version, &nonce, &type_url);
|
1160
|
+
grpc_byte_buffer_destroy(recv_message_payload_);
|
1161
|
+
recv_message_payload_ = nullptr;
|
1162
|
+
// Parse and validate the response.
|
1163
|
+
XdsApi::AdsParseResult result = xds_client()->api_.ParseAdsResponse(
|
1164
|
+
response_slice, ResourceNamesForRequest(XdsApi::kLdsTypeUrl),
|
1165
|
+
ResourceNamesForRequest(XdsApi::kRdsTypeUrl),
|
1166
|
+
ResourceNamesForRequest(XdsApi::kCdsTypeUrl),
|
1167
|
+
ResourceNamesForRequest(XdsApi::kEdsTypeUrl));
|
1232
1168
|
grpc_slice_unref_internal(response_slice);
|
1233
|
-
if (type_url.empty()) {
|
1169
|
+
if (result.type_url.empty()) {
|
1234
1170
|
// Ignore unparsable response.
|
1235
1171
|
gpr_log(GPR_ERROR,
|
1236
1172
|
"[xds_client %p] Error parsing ADS response (%s) -- ignoring",
|
1237
|
-
xds_client, grpc_error_string(parse_error));
|
1238
|
-
GRPC_ERROR_UNREF(parse_error);
|
1173
|
+
xds_client(), grpc_error_string(result.parse_error));
|
1174
|
+
GRPC_ERROR_UNREF(result.parse_error);
|
1239
1175
|
} else {
|
1240
1176
|
// Update nonce.
|
1241
|
-
auto& state =
|
1242
|
-
state.nonce = std::move(nonce);
|
1177
|
+
auto& state = state_map_[result.type_url];
|
1178
|
+
state.nonce = std::move(result.nonce);
|
1243
1179
|
// NACK or ACK the response.
|
1244
|
-
if (parse_error != GRPC_ERROR_NONE) {
|
1180
|
+
if (result.parse_error != GRPC_ERROR_NONE) {
|
1245
1181
|
GRPC_ERROR_UNREF(state.error);
|
1246
|
-
state.error = parse_error;
|
1182
|
+
state.error = result.parse_error;
|
1247
1183
|
// NACK unacceptable update.
|
1248
1184
|
gpr_log(GPR_ERROR,
|
1249
1185
|
"[xds_client %p] ADS response invalid for resource type %s "
|
1250
1186
|
"version %s, will NACK: nonce=%s error=%s",
|
1251
|
-
xds_client, type_url.c_str(), version.c_str(),
|
1252
|
-
state.nonce.c_str(), grpc_error_string(parse_error));
|
1253
|
-
|
1187
|
+
xds_client(), result.type_url.c_str(), result.version.c_str(),
|
1188
|
+
state.nonce.c_str(), grpc_error_string(result.parse_error));
|
1189
|
+
SendMessageLocked(result.type_url);
|
1254
1190
|
} else {
|
1255
|
-
|
1191
|
+
seen_response_ = true;
|
1256
1192
|
// Accept the ADS response according to the type_url.
|
1257
|
-
if (type_url == XdsApi::kLdsTypeUrl) {
|
1258
|
-
|
1259
|
-
} else if (type_url == XdsApi::kRdsTypeUrl) {
|
1260
|
-
|
1261
|
-
} else if (type_url == XdsApi::kCdsTypeUrl) {
|
1262
|
-
|
1263
|
-
} else if (type_url == XdsApi::kEdsTypeUrl) {
|
1264
|
-
|
1193
|
+
if (result.type_url == XdsApi::kLdsTypeUrl) {
|
1194
|
+
AcceptLdsUpdate(std::move(result.lds_update_map));
|
1195
|
+
} else if (result.type_url == XdsApi::kRdsTypeUrl) {
|
1196
|
+
AcceptRdsUpdate(std::move(result.rds_update_map));
|
1197
|
+
} else if (result.type_url == XdsApi::kCdsTypeUrl) {
|
1198
|
+
AcceptCdsUpdate(std::move(result.cds_update_map));
|
1199
|
+
} else if (result.type_url == XdsApi::kEdsTypeUrl) {
|
1200
|
+
AcceptEdsUpdate(std::move(result.eds_update_map));
|
1265
1201
|
}
|
1266
|
-
|
1202
|
+
xds_client()->resource_version_map_[result.type_url] =
|
1203
|
+
std::move(result.version);
|
1267
1204
|
// ACK the update.
|
1268
|
-
|
1205
|
+
SendMessageLocked(result.type_url);
|
1269
1206
|
// Start load reporting if needed.
|
1270
|
-
auto& lrs_call =
|
1207
|
+
auto& lrs_call = chand()->lrs_calld_;
|
1271
1208
|
if (lrs_call != nullptr) {
|
1272
1209
|
LrsCallState* lrs_calld = lrs_call->calld();
|
1273
1210
|
if (lrs_calld != nullptr) lrs_calld->MaybeStartReportingLocked();
|
1274
1211
|
}
|
1275
1212
|
}
|
1276
1213
|
}
|
1277
|
-
if (xds_client->shutting_down_)
|
1278
|
-
ads_calld->Unref(DEBUG_LOCATION,
|
1279
|
-
"ADS+OnResponseReceivedLocked+xds_shutdown");
|
1280
|
-
return;
|
1281
|
-
}
|
1214
|
+
if (xds_client()->shutting_down_) return true;
|
1282
1215
|
// Keep listening for updates.
|
1283
1216
|
grpc_op op;
|
1284
1217
|
memset(&op, 0, sizeof(op));
|
1285
1218
|
op.op = GRPC_OP_RECV_MESSAGE;
|
1286
|
-
op.data.recv_message.recv_message = &
|
1219
|
+
op.data.recv_message.recv_message = &recv_message_payload_;
|
1287
1220
|
op.flags = 0;
|
1288
1221
|
op.reserved = nullptr;
|
1289
|
-
GPR_ASSERT(
|
1222
|
+
GPR_ASSERT(call_ != nullptr);
|
1290
1223
|
// Reuse the "ADS+OnResponseReceivedLocked" ref taken in ctor.
|
1291
|
-
|
1292
|
-
|
1293
|
-
const grpc_call_error call_error = grpc_call_start_batch_and_execute(
|
1294
|
-
ads_calld->call_, &op, 1, &ads_calld->on_response_received_);
|
1224
|
+
const grpc_call_error call_error =
|
1225
|
+
grpc_call_start_batch_and_execute(call_, &op, 1, &on_response_received_);
|
1295
1226
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
1227
|
+
return false;
|
1296
1228
|
}
|
1297
1229
|
|
1298
1230
|
void XdsClient::ChannelState::AdsCallState::OnStatusReceived(
|
1299
1231
|
void* arg, grpc_error* error) {
|
1300
1232
|
AdsCallState* ads_calld = static_cast<AdsCallState*>(arg);
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1304
|
-
|
1233
|
+
{
|
1234
|
+
MutexLock lock(&ads_calld->xds_client()->mu_);
|
1235
|
+
ads_calld->OnStatusReceivedLocked(GRPC_ERROR_REF(error));
|
1236
|
+
}
|
1237
|
+
ads_calld->Unref(DEBUG_LOCATION, "ADS+OnStatusReceivedLocked");
|
1305
1238
|
}
|
1306
1239
|
|
1307
1240
|
void XdsClient::ChannelState::AdsCallState::OnStatusReceivedLocked(
|
1308
|
-
|
1309
|
-
AdsCallState* ads_calld = static_cast<AdsCallState*>(arg);
|
1310
|
-
ChannelState* chand = ads_calld->chand();
|
1311
|
-
XdsClient* xds_client = ads_calld->xds_client();
|
1241
|
+
grpc_error* error) {
|
1312
1242
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1313
|
-
char* status_details = grpc_slice_to_c_string(
|
1243
|
+
char* status_details = grpc_slice_to_c_string(status_details_);
|
1314
1244
|
gpr_log(GPR_INFO,
|
1315
1245
|
"[xds_client %p] ADS call status received. Status = %d, details "
|
1316
1246
|
"= '%s', (chand: %p, ads_calld: %p, call: %p), error '%s'",
|
1317
|
-
xds_client,
|
1318
|
-
|
1247
|
+
xds_client(), status_code_, status_details, chand(), this, call_,
|
1248
|
+
grpc_error_string(error));
|
1319
1249
|
gpr_free(status_details);
|
1320
1250
|
}
|
1321
1251
|
// Ignore status from a stale call.
|
1322
|
-
if (
|
1252
|
+
if (IsCurrentCallOnChannel()) {
|
1323
1253
|
// Try to restart the call.
|
1324
|
-
|
1254
|
+
parent_->OnCallFinishedLocked();
|
1325
1255
|
// Send error to all watchers.
|
1326
|
-
xds_client->
|
1256
|
+
xds_client()->NotifyOnErrorLocked(
|
1327
1257
|
GRPC_ERROR_CREATE_FROM_STATIC_STRING("xds call failed"));
|
1328
1258
|
}
|
1329
|
-
|
1259
|
+
GRPC_ERROR_UNREF(error);
|
1330
1260
|
}
|
1331
1261
|
|
1332
1262
|
bool XdsClient::ChannelState::AdsCallState::IsCurrentCallOnChannel() const {
|
@@ -1336,26 +1266,19 @@ bool XdsClient::ChannelState::AdsCallState::IsCurrentCallOnChannel() const {
|
|
1336
1266
|
return this == chand()->ads_calld_->calld();
|
1337
1267
|
}
|
1338
1268
|
|
1339
|
-
std::set<
|
1340
|
-
XdsClient::ChannelState::AdsCallState::
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
1346
|
-
|
1347
|
-
|
1348
|
-
|
1349
|
-
|
1350
|
-
std::set<StringView>
|
1351
|
-
XdsClient::ChannelState::AdsCallState::EdsServiceNamesForRequest() {
|
1352
|
-
std::set<StringView> eds_names;
|
1353
|
-
for (auto& p : state_map_[XdsApi::kEdsTypeUrl].subscribed_resources) {
|
1354
|
-
eds_names.insert(p.first);
|
1355
|
-
OrphanablePtr<ResourceState>& state = p.second;
|
1356
|
-
state->Start(Ref());
|
1269
|
+
std::set<absl::string_view>
|
1270
|
+
XdsClient::ChannelState::AdsCallState::ResourceNamesForRequest(
|
1271
|
+
const std::string& type_url) {
|
1272
|
+
std::set<absl::string_view> resource_names;
|
1273
|
+
auto it = state_map_.find(type_url);
|
1274
|
+
if (it != state_map_.end()) {
|
1275
|
+
for (auto& p : it->second.subscribed_resources) {
|
1276
|
+
resource_names.insert(p.first);
|
1277
|
+
OrphanablePtr<ResourceState>& state = p.second;
|
1278
|
+
state->Start(Ref(DEBUG_LOCATION, "ResourceState"));
|
1279
|
+
}
|
1357
1280
|
}
|
1358
|
-
return
|
1281
|
+
return resource_names;
|
1359
1282
|
}
|
1360
1283
|
|
1361
1284
|
//
|
@@ -1371,8 +1294,6 @@ void XdsClient::ChannelState::LrsCallState::Reporter::Orphan() {
|
|
1371
1294
|
void XdsClient::ChannelState::LrsCallState::Reporter::
|
1372
1295
|
ScheduleNextReportLocked() {
|
1373
1296
|
const grpc_millis next_report_time = ExecCtx::Get()->Now() + report_interval_;
|
1374
|
-
GRPC_CLOSURE_INIT(&on_next_report_timer_, OnNextReportTimer, this,
|
1375
|
-
grpc_schedule_on_exec_ctx);
|
1376
1297
|
grpc_timer_init(&next_report_timer_, next_report_time,
|
1377
1298
|
&on_next_report_timer_);
|
1378
1299
|
next_report_timer_callback_pending_ = true;
|
@@ -1381,21 +1302,22 @@ void XdsClient::ChannelState::LrsCallState::Reporter::
|
|
1381
1302
|
void XdsClient::ChannelState::LrsCallState::Reporter::OnNextReportTimer(
|
1382
1303
|
void* arg, grpc_error* error) {
|
1383
1304
|
Reporter* self = static_cast<Reporter*>(arg);
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1305
|
+
bool done;
|
1306
|
+
{
|
1307
|
+
MutexLock lock(&self->xds_client()->mu_);
|
1308
|
+
done = self->OnNextReportTimerLocked(GRPC_ERROR_REF(error));
|
1309
|
+
}
|
1310
|
+
if (done) self->Unref(DEBUG_LOCATION, "Reporter+timer");
|
1388
1311
|
}
|
1389
1312
|
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
|
1395
|
-
|
1396
|
-
return;
|
1313
|
+
bool XdsClient::ChannelState::LrsCallState::Reporter::OnNextReportTimerLocked(
|
1314
|
+
grpc_error* error) {
|
1315
|
+
next_report_timer_callback_pending_ = false;
|
1316
|
+
if (error != GRPC_ERROR_NONE || !IsCurrentReporterOnCall()) {
|
1317
|
+
GRPC_ERROR_UNREF(error);
|
1318
|
+
return true;
|
1397
1319
|
}
|
1398
|
-
|
1320
|
+
return SendReportLocked();
|
1399
1321
|
}
|
1400
1322
|
|
1401
1323
|
namespace {
|
@@ -1403,9 +1325,7 @@ namespace {
|
|
1403
1325
|
bool LoadReportCountersAreZero(const XdsApi::ClusterLoadReportMap& snapshot) {
|
1404
1326
|
for (const auto& p : snapshot) {
|
1405
1327
|
const XdsApi::ClusterLoadReport& cluster_snapshot = p.second;
|
1406
|
-
|
1407
|
-
if (q.second > 0) return false;
|
1408
|
-
}
|
1328
|
+
if (!cluster_snapshot.dropped_requests.IsZero()) return false;
|
1409
1329
|
for (const auto& q : cluster_snapshot.locality_stats) {
|
1410
1330
|
const XdsClusterLocalityStats::Snapshot& locality_snapshot = q.second;
|
1411
1331
|
if (!locality_snapshot.IsZero()) return false;
|
@@ -1416,17 +1336,22 @@ bool LoadReportCountersAreZero(const XdsApi::ClusterLoadReportMap& snapshot) {
|
|
1416
1336
|
|
1417
1337
|
} // namespace
|
1418
1338
|
|
1419
|
-
|
1339
|
+
bool XdsClient::ChannelState::LrsCallState::Reporter::SendReportLocked() {
|
1420
1340
|
// Construct snapshot from all reported stats.
|
1421
1341
|
XdsApi::ClusterLoadReportMap snapshot =
|
1422
|
-
xds_client()->
|
1342
|
+
xds_client()->BuildLoadReportSnapshotLocked(parent_->send_all_clusters_,
|
1343
|
+
parent_->cluster_names_);
|
1423
1344
|
// Skip client load report if the counters were all zero in the last
|
1424
1345
|
// report and they are still zero in this one.
|
1425
1346
|
const bool old_val = last_report_counters_were_zero_;
|
1426
1347
|
last_report_counters_were_zero_ = LoadReportCountersAreZero(snapshot);
|
1427
1348
|
if (old_val && last_report_counters_were_zero_) {
|
1349
|
+
if (xds_client()->load_report_map_.empty()) {
|
1350
|
+
parent_->chand()->StopLrsCall();
|
1351
|
+
return true;
|
1352
|
+
}
|
1428
1353
|
ScheduleNextReportLocked();
|
1429
|
-
return;
|
1354
|
+
return false;
|
1430
1355
|
}
|
1431
1356
|
// Create a request that contains the snapshot.
|
1432
1357
|
grpc_slice request_payload_slice =
|
@@ -1439,8 +1364,6 @@ void XdsClient::ChannelState::LrsCallState::Reporter::SendReportLocked() {
|
|
1439
1364
|
memset(&op, 0, sizeof(op));
|
1440
1365
|
op.op = GRPC_OP_SEND_MESSAGE;
|
1441
1366
|
op.data.send_message.send_message = parent_->send_message_payload_;
|
1442
|
-
GRPC_CLOSURE_INIT(&on_report_done_, OnReportDone, this,
|
1443
|
-
grpc_schedule_on_exec_ctx);
|
1444
1367
|
grpc_call_error call_error = grpc_call_start_batch_and_execute(
|
1445
1368
|
parent_->call_, &op, 1, &on_report_done_);
|
1446
1369
|
if (GPR_UNLIKELY(call_error != GRPC_CALL_OK)) {
|
@@ -1449,38 +1372,41 @@ void XdsClient::ChannelState::LrsCallState::Reporter::SendReportLocked() {
|
|
1449
1372
|
xds_client(), this, call_error);
|
1450
1373
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
1451
1374
|
}
|
1375
|
+
return false;
|
1452
1376
|
}
|
1453
1377
|
|
1454
1378
|
void XdsClient::ChannelState::LrsCallState::Reporter::OnReportDone(
|
1455
1379
|
void* arg, grpc_error* error) {
|
1456
1380
|
Reporter* self = static_cast<Reporter*>(arg);
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
|
1381
|
+
bool done;
|
1382
|
+
{
|
1383
|
+
MutexLock lock(&self->xds_client()->mu_);
|
1384
|
+
done = self->OnReportDoneLocked(GRPC_ERROR_REF(error));
|
1385
|
+
}
|
1386
|
+
if (done) self->Unref(DEBUG_LOCATION, "Reporter+report_done");
|
1461
1387
|
}
|
1462
1388
|
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
self->parent_->send_message_payload_ = nullptr;
|
1389
|
+
bool XdsClient::ChannelState::LrsCallState::Reporter::OnReportDoneLocked(
|
1390
|
+
grpc_error* error) {
|
1391
|
+
grpc_byte_buffer_destroy(parent_->send_message_payload_);
|
1392
|
+
parent_->send_message_payload_ = nullptr;
|
1468
1393
|
// If there are no more registered stats to report, cancel the call.
|
1469
|
-
if (
|
1470
|
-
|
1471
|
-
|
1472
|
-
return;
|
1394
|
+
if (xds_client()->load_report_map_.empty()) {
|
1395
|
+
parent_->chand()->StopLrsCall();
|
1396
|
+
GRPC_ERROR_UNREF(error);
|
1397
|
+
return true;
|
1473
1398
|
}
|
1474
|
-
if (error != GRPC_ERROR_NONE || !
|
1399
|
+
if (error != GRPC_ERROR_NONE || !IsCurrentReporterOnCall()) {
|
1400
|
+
GRPC_ERROR_UNREF(error);
|
1475
1401
|
// If this reporter is no longer the current one on the call, the reason
|
1476
1402
|
// might be that it was orphaned for a new one due to config update.
|
1477
|
-
if (!
|
1478
|
-
|
1403
|
+
if (!IsCurrentReporterOnCall()) {
|
1404
|
+
parent_->MaybeStartReportingLocked();
|
1479
1405
|
}
|
1480
|
-
|
1481
|
-
return;
|
1406
|
+
return true;
|
1482
1407
|
}
|
1483
|
-
|
1408
|
+
ScheduleNextReportLocked();
|
1409
|
+
return false;
|
1484
1410
|
}
|
1485
1411
|
|
1486
1412
|
//
|
@@ -1489,22 +1415,27 @@ void XdsClient::ChannelState::LrsCallState::Reporter::OnReportDoneLocked(
|
|
1489
1415
|
|
1490
1416
|
XdsClient::ChannelState::LrsCallState::LrsCallState(
|
1491
1417
|
RefCountedPtr<RetryableCall<LrsCallState>> parent)
|
1492
|
-
: InternallyRefCounted<LrsCallState>(
|
1418
|
+
: InternallyRefCounted<LrsCallState>(
|
1419
|
+
GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace)
|
1420
|
+
? "LrsCallState"
|
1421
|
+
: nullptr),
|
1493
1422
|
parent_(std::move(parent)) {
|
1494
1423
|
// Init the LRS call. Note that the call will progress every time there's
|
1495
1424
|
// activity in xds_client()->interested_parties_, which is comprised of
|
1496
1425
|
// the polling entities from client_channel.
|
1497
1426
|
GPR_ASSERT(xds_client() != nullptr);
|
1498
|
-
|
1427
|
+
const auto& method =
|
1428
|
+
chand()->server_.ShouldUseV3()
|
1429
|
+
? GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_LOAD_STATS_DOT_V3_DOT_LOADREPORTINGSERVICE_SLASH_STREAMLOADSTATS
|
1430
|
+
: GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_LOAD_STATS_DOT_V2_DOT_LOADREPORTINGSERVICE_SLASH_STREAMLOADSTATS;
|
1499
1431
|
call_ = grpc_channel_create_pollset_set_call(
|
1500
1432
|
chand()->channel_, nullptr, GRPC_PROPAGATE_DEFAULTS,
|
1501
|
-
xds_client()->interested_parties_,
|
1502
|
-
|
1503
|
-
nullptr, GRPC_MILLIS_INF_FUTURE, nullptr);
|
1433
|
+
xds_client()->interested_parties_, method, nullptr,
|
1434
|
+
GRPC_MILLIS_INF_FUTURE, nullptr);
|
1504
1435
|
GPR_ASSERT(call_ != nullptr);
|
1505
1436
|
// Init the request payload.
|
1506
1437
|
grpc_slice request_payload_slice =
|
1507
|
-
xds_client()->api_.CreateLrsInitialRequest(
|
1438
|
+
xds_client()->api_.CreateLrsInitialRequest(chand()->server_);
|
1508
1439
|
send_message_payload_ =
|
1509
1440
|
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
|
1510
1441
|
grpc_slice_unref_internal(request_payload_slice);
|
@@ -1540,8 +1471,8 @@ XdsClient::ChannelState::LrsCallState::LrsCallState(
|
|
1540
1471
|
Ref(DEBUG_LOCATION, "LRS+OnInitialRequestSentLocked").release();
|
1541
1472
|
GRPC_CLOSURE_INIT(&on_initial_request_sent_, OnInitialRequestSent, this,
|
1542
1473
|
grpc_schedule_on_exec_ctx);
|
1543
|
-
call_error = grpc_call_start_batch_and_execute(
|
1544
|
-
|
1474
|
+
call_error = grpc_call_start_batch_and_execute(
|
1475
|
+
call_, ops, static_cast<size_t>(op - ops), &on_initial_request_sent_);
|
1545
1476
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
1546
1477
|
// Op: recv initial metadata.
|
1547
1478
|
op = ops;
|
@@ -1560,8 +1491,8 @@ XdsClient::ChannelState::LrsCallState::LrsCallState(
|
|
1560
1491
|
Ref(DEBUG_LOCATION, "LRS+OnResponseReceivedLocked").release();
|
1561
1492
|
GRPC_CLOSURE_INIT(&on_response_received_, OnResponseReceived, this,
|
1562
1493
|
grpc_schedule_on_exec_ctx);
|
1563
|
-
call_error = grpc_call_start_batch_and_execute(
|
1564
|
-
|
1494
|
+
call_error = grpc_call_start_batch_and_execute(
|
1495
|
+
call_, ops, static_cast<size_t>(op - ops), &on_response_received_);
|
1565
1496
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
1566
1497
|
// Op: recv server status.
|
1567
1498
|
op = ops;
|
@@ -1577,8 +1508,8 @@ XdsClient::ChannelState::LrsCallState::LrsCallState(
|
|
1577
1508
|
// unreffed.
|
1578
1509
|
GRPC_CLOSURE_INIT(&on_status_received_, OnStatusReceived, this,
|
1579
1510
|
grpc_schedule_on_exec_ctx);
|
1580
|
-
call_error = grpc_call_start_batch_and_execute(
|
1581
|
-
|
1511
|
+
call_error = grpc_call_start_batch_and_execute(
|
1512
|
+
call_, ops, static_cast<size_t>(op - ops), &on_status_received_);
|
1582
1513
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
1583
1514
|
}
|
1584
1515
|
|
@@ -1599,7 +1530,7 @@ void XdsClient::ChannelState::LrsCallState::Orphan() {
|
|
1599
1530
|
// on_status_received_ will complete the cancellation and clean up. Otherwise,
|
1600
1531
|
// we are here because xds_client has to orphan a failed call, then the
|
1601
1532
|
// following cancellation will be a no-op.
|
1602
|
-
|
1533
|
+
grpc_call_cancel_internal(call_);
|
1603
1534
|
// Note that the initial ref is hold by on_status_received_. So the
|
1604
1535
|
// corresponding unref happens in on_status_received_ instead of here.
|
1605
1536
|
}
|
@@ -1626,75 +1557,74 @@ void XdsClient::ChannelState::LrsCallState::MaybeStartReportingLocked() {
|
|
1626
1557
|
}
|
1627
1558
|
|
1628
1559
|
void XdsClient::ChannelState::LrsCallState::OnInitialRequestSent(
|
1629
|
-
void* arg, grpc_error* error) {
|
1560
|
+
void* arg, grpc_error* /*error*/) {
|
1630
1561
|
LrsCallState* lrs_calld = static_cast<LrsCallState*>(arg);
|
1631
|
-
|
1632
|
-
|
1633
|
-
|
1634
|
-
|
1562
|
+
{
|
1563
|
+
MutexLock lock(&lrs_calld->xds_client()->mu_);
|
1564
|
+
lrs_calld->OnInitialRequestSentLocked();
|
1565
|
+
}
|
1566
|
+
lrs_calld->Unref(DEBUG_LOCATION, "LRS+OnInitialRequestSentLocked");
|
1635
1567
|
}
|
1636
1568
|
|
1637
|
-
void XdsClient::ChannelState::LrsCallState::OnInitialRequestSentLocked(
|
1638
|
-
void* arg, grpc_error* /*error*/) {
|
1639
|
-
LrsCallState* lrs_calld = static_cast<LrsCallState*>(arg);
|
1569
|
+
void XdsClient::ChannelState::LrsCallState::OnInitialRequestSentLocked() {
|
1640
1570
|
// Clear the send_message_payload_.
|
1641
|
-
grpc_byte_buffer_destroy(
|
1642
|
-
|
1643
|
-
|
1644
|
-
lrs_calld->Unref(DEBUG_LOCATION, "LRS+OnInitialRequestSentLocked");
|
1571
|
+
grpc_byte_buffer_destroy(send_message_payload_);
|
1572
|
+
send_message_payload_ = nullptr;
|
1573
|
+
MaybeStartReportingLocked();
|
1645
1574
|
}
|
1646
1575
|
|
1647
1576
|
void XdsClient::ChannelState::LrsCallState::OnResponseReceived(
|
1648
|
-
void* arg, grpc_error* error) {
|
1577
|
+
void* arg, grpc_error* /*error*/) {
|
1649
1578
|
LrsCallState* lrs_calld = static_cast<LrsCallState*>(arg);
|
1650
|
-
|
1651
|
-
|
1652
|
-
|
1653
|
-
|
1579
|
+
bool done;
|
1580
|
+
{
|
1581
|
+
MutexLock lock(&lrs_calld->xds_client()->mu_);
|
1582
|
+
done = lrs_calld->OnResponseReceivedLocked();
|
1583
|
+
}
|
1584
|
+
if (done) lrs_calld->Unref(DEBUG_LOCATION, "LRS+OnResponseReceivedLocked");
|
1654
1585
|
}
|
1655
1586
|
|
1656
|
-
|
1657
|
-
void* arg, grpc_error* /*error*/) {
|
1658
|
-
LrsCallState* lrs_calld = static_cast<LrsCallState*>(arg);
|
1659
|
-
XdsClient* xds_client = lrs_calld->xds_client();
|
1587
|
+
bool XdsClient::ChannelState::LrsCallState::OnResponseReceivedLocked() {
|
1660
1588
|
// Empty payload means the call was cancelled.
|
1661
|
-
if (!
|
1662
|
-
|
1663
|
-
lrs_calld->Unref(DEBUG_LOCATION, "LRS+OnResponseReceivedLocked");
|
1664
|
-
return;
|
1589
|
+
if (!IsCurrentCallOnChannel() || recv_message_payload_ == nullptr) {
|
1590
|
+
return true;
|
1665
1591
|
}
|
1666
1592
|
// Read the response.
|
1667
1593
|
grpc_byte_buffer_reader bbr;
|
1668
|
-
grpc_byte_buffer_reader_init(&bbr,
|
1594
|
+
grpc_byte_buffer_reader_init(&bbr, recv_message_payload_);
|
1669
1595
|
grpc_slice response_slice = grpc_byte_buffer_reader_readall(&bbr);
|
1670
1596
|
grpc_byte_buffer_reader_destroy(&bbr);
|
1671
|
-
grpc_byte_buffer_destroy(
|
1672
|
-
|
1597
|
+
grpc_byte_buffer_destroy(recv_message_payload_);
|
1598
|
+
recv_message_payload_ = nullptr;
|
1673
1599
|
// This anonymous lambda is a hack to avoid the usage of goto.
|
1674
1600
|
[&]() {
|
1675
1601
|
// Parse the response.
|
1602
|
+
bool send_all_clusters = false;
|
1676
1603
|
std::set<std::string> new_cluster_names;
|
1677
1604
|
grpc_millis new_load_reporting_interval;
|
1678
|
-
grpc_error* parse_error = xds_client->api_.ParseLrsResponse(
|
1679
|
-
response_slice, &
|
1605
|
+
grpc_error* parse_error = xds_client()->api_.ParseLrsResponse(
|
1606
|
+
response_slice, &send_all_clusters, &new_cluster_names,
|
1607
|
+
&new_load_reporting_interval);
|
1680
1608
|
if (parse_error != GRPC_ERROR_NONE) {
|
1681
1609
|
gpr_log(GPR_ERROR,
|
1682
1610
|
"[xds_client %p] LRS response parsing failed. error=%s",
|
1683
|
-
xds_client, grpc_error_string(parse_error));
|
1611
|
+
xds_client(), grpc_error_string(parse_error));
|
1684
1612
|
GRPC_ERROR_UNREF(parse_error);
|
1685
1613
|
return;
|
1686
1614
|
}
|
1687
|
-
|
1615
|
+
seen_response_ = true;
|
1688
1616
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1689
|
-
gpr_log(
|
1690
|
-
|
1691
|
-
|
1692
|
-
|
1693
|
-
|
1617
|
+
gpr_log(
|
1618
|
+
GPR_INFO,
|
1619
|
+
"[xds_client %p] LRS response received, %" PRIuPTR
|
1620
|
+
" cluster names, send_all_clusters=%d, load_report_interval=%" PRId64
|
1621
|
+
"ms",
|
1622
|
+
xds_client(), new_cluster_names.size(), send_all_clusters,
|
1623
|
+
new_load_reporting_interval);
|
1694
1624
|
size_t i = 0;
|
1695
1625
|
for (const auto& name : new_cluster_names) {
|
1696
1626
|
gpr_log(GPR_INFO, "[xds_client %p] cluster_name %" PRIuPTR ": %s",
|
1697
|
-
xds_client, i++, name.c_str());
|
1627
|
+
xds_client(), i++, name.c_str());
|
1698
1628
|
}
|
1699
1629
|
}
|
1700
1630
|
if (new_load_reporting_interval <
|
@@ -1705,81 +1635,76 @@ void XdsClient::ChannelState::LrsCallState::OnResponseReceivedLocked(
|
|
1705
1635
|
gpr_log(GPR_INFO,
|
1706
1636
|
"[xds_client %p] Increased load_report_interval to minimum "
|
1707
1637
|
"value %dms",
|
1708
|
-
xds_client, GRPC_XDS_MIN_CLIENT_LOAD_REPORTING_INTERVAL_MS);
|
1638
|
+
xds_client(), GRPC_XDS_MIN_CLIENT_LOAD_REPORTING_INTERVAL_MS);
|
1709
1639
|
}
|
1710
1640
|
}
|
1711
1641
|
// Ignore identical update.
|
1712
|
-
if (
|
1713
|
-
|
1642
|
+
if (send_all_clusters == send_all_clusters_ &&
|
1643
|
+
cluster_names_ == new_cluster_names &&
|
1644
|
+
load_reporting_interval_ == new_load_reporting_interval) {
|
1714
1645
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1715
1646
|
gpr_log(GPR_INFO,
|
1716
1647
|
"[xds_client %p] Incoming LRS response identical to current, "
|
1717
1648
|
"ignoring.",
|
1718
|
-
xds_client);
|
1649
|
+
xds_client());
|
1719
1650
|
}
|
1720
1651
|
return;
|
1721
1652
|
}
|
1722
1653
|
// Stop current load reporting (if any) to adopt the new config.
|
1723
|
-
|
1654
|
+
reporter_.reset();
|
1724
1655
|
// Record the new config.
|
1725
|
-
|
1726
|
-
|
1656
|
+
send_all_clusters_ = send_all_clusters;
|
1657
|
+
cluster_names_ = std::move(new_cluster_names);
|
1658
|
+
load_reporting_interval_ = new_load_reporting_interval;
|
1727
1659
|
// Try starting sending load report.
|
1728
|
-
|
1660
|
+
MaybeStartReportingLocked();
|
1729
1661
|
}();
|
1730
1662
|
grpc_slice_unref_internal(response_slice);
|
1731
|
-
if (xds_client->shutting_down_)
|
1732
|
-
lrs_calld->Unref(DEBUG_LOCATION,
|
1733
|
-
"LRS+OnResponseReceivedLocked+xds_shutdown");
|
1734
|
-
return;
|
1735
|
-
}
|
1663
|
+
if (xds_client()->shutting_down_) return true;
|
1736
1664
|
// Keep listening for LRS config updates.
|
1737
1665
|
grpc_op op;
|
1738
1666
|
memset(&op, 0, sizeof(op));
|
1739
1667
|
op.op = GRPC_OP_RECV_MESSAGE;
|
1740
|
-
op.data.recv_message.recv_message = &
|
1668
|
+
op.data.recv_message.recv_message = &recv_message_payload_;
|
1741
1669
|
op.flags = 0;
|
1742
1670
|
op.reserved = nullptr;
|
1743
|
-
GPR_ASSERT(
|
1671
|
+
GPR_ASSERT(call_ != nullptr);
|
1744
1672
|
// Reuse the "OnResponseReceivedLocked" ref taken in ctor.
|
1745
|
-
|
1746
|
-
|
1747
|
-
const grpc_call_error call_error = grpc_call_start_batch_and_execute(
|
1748
|
-
lrs_calld->call_, &op, 1, &lrs_calld->on_response_received_);
|
1673
|
+
const grpc_call_error call_error =
|
1674
|
+
grpc_call_start_batch_and_execute(call_, &op, 1, &on_response_received_);
|
1749
1675
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
1676
|
+
return false;
|
1750
1677
|
}
|
1751
1678
|
|
1752
1679
|
void XdsClient::ChannelState::LrsCallState::OnStatusReceived(
|
1753
1680
|
void* arg, grpc_error* error) {
|
1754
1681
|
LrsCallState* lrs_calld = static_cast<LrsCallState*>(arg);
|
1755
|
-
|
1756
|
-
|
1757
|
-
|
1758
|
-
|
1682
|
+
{
|
1683
|
+
MutexLock lock(&lrs_calld->xds_client()->mu_);
|
1684
|
+
lrs_calld->OnStatusReceivedLocked(GRPC_ERROR_REF(error));
|
1685
|
+
}
|
1686
|
+
lrs_calld->Unref(DEBUG_LOCATION, "LRS+OnStatusReceivedLocked");
|
1759
1687
|
}
|
1760
1688
|
|
1761
1689
|
void XdsClient::ChannelState::LrsCallState::OnStatusReceivedLocked(
|
1762
|
-
|
1763
|
-
|
1764
|
-
XdsClient* xds_client = lrs_calld->xds_client();
|
1765
|
-
ChannelState* chand = lrs_calld->chand();
|
1766
|
-
GPR_ASSERT(lrs_calld->call_ != nullptr);
|
1690
|
+
grpc_error* error) {
|
1691
|
+
GPR_ASSERT(call_ != nullptr);
|
1767
1692
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1768
|
-
char* status_details = grpc_slice_to_c_string(
|
1693
|
+
char* status_details = grpc_slice_to_c_string(status_details_);
|
1769
1694
|
gpr_log(GPR_INFO,
|
1770
1695
|
"[xds_client %p] LRS call status received. Status = %d, details "
|
1771
1696
|
"= '%s', (chand: %p, calld: %p, call: %p), error '%s'",
|
1772
|
-
xds_client,
|
1773
|
-
|
1697
|
+
xds_client(), status_code_, status_details, chand(), this, call_,
|
1698
|
+
grpc_error_string(error));
|
1774
1699
|
gpr_free(status_details);
|
1775
1700
|
}
|
1776
1701
|
// Ignore status from a stale call.
|
1777
|
-
if (
|
1778
|
-
GPR_ASSERT(!xds_client->shutting_down_);
|
1702
|
+
if (IsCurrentCallOnChannel()) {
|
1703
|
+
GPR_ASSERT(!xds_client()->shutting_down_);
|
1779
1704
|
// Try to restart the call.
|
1780
|
-
|
1705
|
+
parent_->OnCallFinishedLocked();
|
1781
1706
|
}
|
1782
|
-
|
1707
|
+
GRPC_ERROR_UNREF(error);
|
1783
1708
|
}
|
1784
1709
|
|
1785
1710
|
bool XdsClient::ChannelState::LrsCallState::IsCurrentCallOnChannel() const {
|
@@ -1795,28 +1720,28 @@ bool XdsClient::ChannelState::LrsCallState::IsCurrentCallOnChannel() const {
|
|
1795
1720
|
|
1796
1721
|
namespace {
|
1797
1722
|
|
1798
|
-
grpc_millis GetRequestTimeout(
|
1723
|
+
grpc_millis GetRequestTimeout() {
|
1799
1724
|
return grpc_channel_args_find_integer(
|
1800
|
-
|
1725
|
+
g_channel_args, GRPC_ARG_XDS_RESOURCE_DOES_NOT_EXIST_TIMEOUT_MS,
|
1801
1726
|
{15000, 0, INT_MAX});
|
1802
1727
|
}
|
1803
1728
|
|
1804
1729
|
} // namespace
|
1805
1730
|
|
1806
|
-
XdsClient::XdsClient(
|
1807
|
-
|
1808
|
-
|
1809
|
-
|
1810
|
-
|
1811
|
-
|
1812
|
-
|
1813
|
-
|
1814
|
-
|
1815
|
-
|
1731
|
+
XdsClient::XdsClient(grpc_error** error)
|
1732
|
+
: DualRefCounted<XdsClient>(
|
1733
|
+
GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace) ? "XdsClient"
|
1734
|
+
: nullptr),
|
1735
|
+
request_timeout_(GetRequestTimeout()),
|
1736
|
+
interested_parties_(grpc_pollset_set_create()),
|
1737
|
+
bootstrap_(XdsBootstrap::Create(this, &grpc_xds_client_trace,
|
1738
|
+
g_fallback_bootstrap_config, error)),
|
1739
|
+
certificate_provider_store_(MakeOrphanable<CertificateProviderStore>(
|
1740
|
+
bootstrap_ == nullptr
|
1741
|
+
? CertificateProviderStore::PluginDefinitionMap()
|
1742
|
+
: bootstrap_->certificate_providers())),
|
1816
1743
|
api_(this, &grpc_xds_client_trace,
|
1817
|
-
bootstrap_ == nullptr ? nullptr : bootstrap_->node())
|
1818
|
-
server_name_(server_name),
|
1819
|
-
service_config_watcher_(std::move(watcher)) {
|
1744
|
+
bootstrap_ == nullptr ? nullptr : bootstrap_->node()) {
|
1820
1745
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1821
1746
|
gpr_log(GPR_INFO, "[xds_client %p] creating xds client", this);
|
1822
1747
|
}
|
@@ -1825,72 +1750,165 @@ XdsClient::XdsClient(Combiner* combiner, grpc_pollset_set* interested_parties,
|
|
1825
1750
|
this, grpc_error_string(*error));
|
1826
1751
|
return;
|
1827
1752
|
}
|
1828
|
-
|
1829
|
-
gpr_log(GPR_INFO, "[xds_client %p] creating channel to %s", this,
|
1830
|
-
bootstrap_->server().server_uri.c_str());
|
1831
|
-
}
|
1832
|
-
grpc_channel_args* new_args = BuildXdsChannelArgs(channel_args);
|
1833
|
-
grpc_channel* channel = CreateXdsChannel(*bootstrap_, *new_args, error);
|
1834
|
-
grpc_channel_args_destroy(new_args);
|
1835
|
-
if (*error != GRPC_ERROR_NONE) {
|
1836
|
-
gpr_log(GPR_ERROR, "[xds_client %p] failed to create xds channel: %s", this,
|
1837
|
-
grpc_error_string(*error));
|
1838
|
-
return;
|
1839
|
-
}
|
1753
|
+
// Create ChannelState object.
|
1840
1754
|
chand_ = MakeOrphanable<ChannelState>(
|
1841
|
-
|
1842
|
-
if (service_config_watcher_ != nullptr) {
|
1843
|
-
chand_->Subscribe(XdsApi::kLdsTypeUrl, std::string(server_name));
|
1844
|
-
}
|
1755
|
+
WeakRef(DEBUG_LOCATION, "XdsClient+ChannelState"), bootstrap_->server());
|
1845
1756
|
}
|
1846
1757
|
|
1847
1758
|
XdsClient::~XdsClient() {
|
1848
1759
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1849
1760
|
gpr_log(GPR_INFO, "[xds_client %p] destroying xds client", this);
|
1850
1761
|
}
|
1851
|
-
|
1762
|
+
grpc_pollset_set_destroy(interested_parties_);
|
1763
|
+
}
|
1764
|
+
|
1765
|
+
void XdsClient::AddChannelzLinkage(
|
1766
|
+
channelz::ChannelNode* parent_channelz_node) {
|
1767
|
+
channelz::ChannelNode* xds_channelz_node =
|
1768
|
+
grpc_channel_get_channelz_node(chand_->channel());
|
1769
|
+
if (xds_channelz_node != nullptr) {
|
1770
|
+
parent_channelz_node->AddChildChannel(xds_channelz_node->uuid());
|
1771
|
+
}
|
1772
|
+
}
|
1773
|
+
|
1774
|
+
void XdsClient::RemoveChannelzLinkage(
|
1775
|
+
channelz::ChannelNode* parent_channelz_node) {
|
1776
|
+
channelz::ChannelNode* xds_channelz_node =
|
1777
|
+
grpc_channel_get_channelz_node(chand_->channel());
|
1778
|
+
if (xds_channelz_node != nullptr) {
|
1779
|
+
parent_channelz_node->RemoveChildChannel(xds_channelz_node->uuid());
|
1780
|
+
}
|
1852
1781
|
}
|
1853
1782
|
|
1854
1783
|
void XdsClient::Orphan() {
|
1855
1784
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1856
1785
|
gpr_log(GPR_INFO, "[xds_client %p] shutting down xds client", this);
|
1857
1786
|
}
|
1858
|
-
|
1859
|
-
|
1860
|
-
|
1861
|
-
|
1862
|
-
|
1863
|
-
|
1864
|
-
|
1865
|
-
|
1866
|
-
|
1867
|
-
cluster_map_
|
1868
|
-
|
1787
|
+
{
|
1788
|
+
MutexLock lock(g_mu);
|
1789
|
+
if (g_xds_client == this) g_xds_client = nullptr;
|
1790
|
+
}
|
1791
|
+
{
|
1792
|
+
MutexLock lock(&mu_);
|
1793
|
+
shutting_down_ = true;
|
1794
|
+
// Orphan ChannelState object.
|
1795
|
+
chand_.reset();
|
1796
|
+
// We do not clear cluster_map_ and endpoint_map_ if the xds client was
|
1797
|
+
// created by the XdsResolver because the maps contain refs for watchers
|
1798
|
+
// which in turn hold refs to the loadbalancing policies. At this point, it
|
1799
|
+
// is possible for ADS calls to be in progress. Unreffing the loadbalancing
|
1800
|
+
// policies before those calls are done would lead to issues such as
|
1801
|
+
// https://github.com/grpc/grpc/issues/20928.
|
1802
|
+
if (!listener_map_.empty()) {
|
1803
|
+
cluster_map_.clear();
|
1804
|
+
endpoint_map_.clear();
|
1805
|
+
}
|
1806
|
+
}
|
1807
|
+
}
|
1808
|
+
|
1809
|
+
void XdsClient::WatchListenerData(
|
1810
|
+
absl::string_view listener_name,
|
1811
|
+
std::unique_ptr<ListenerWatcherInterface> watcher) {
|
1812
|
+
std::string listener_name_str = std::string(listener_name);
|
1813
|
+
MutexLock lock(&mu_);
|
1814
|
+
ListenerState& listener_state = listener_map_[listener_name_str];
|
1815
|
+
ListenerWatcherInterface* w = watcher.get();
|
1816
|
+
listener_state.watchers[w] = std::move(watcher);
|
1817
|
+
// If we've already received an LDS update, notify the new watcher
|
1818
|
+
// immediately.
|
1819
|
+
if (listener_state.update.has_value()) {
|
1820
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1821
|
+
gpr_log(GPR_INFO, "[xds_client %p] returning cached listener data for %s",
|
1822
|
+
this, listener_name_str.c_str());
|
1823
|
+
}
|
1824
|
+
w->OnListenerChanged(*listener_state.update);
|
1825
|
+
}
|
1826
|
+
chand_->Subscribe(XdsApi::kLdsTypeUrl, listener_name_str);
|
1827
|
+
}
|
1828
|
+
|
1829
|
+
void XdsClient::CancelListenerDataWatch(absl::string_view listener_name,
|
1830
|
+
ListenerWatcherInterface* watcher,
|
1831
|
+
bool delay_unsubscription) {
|
1832
|
+
MutexLock lock(&mu_);
|
1833
|
+
if (shutting_down_) return;
|
1834
|
+
std::string listener_name_str = std::string(listener_name);
|
1835
|
+
ListenerState& listener_state = listener_map_[listener_name_str];
|
1836
|
+
auto it = listener_state.watchers.find(watcher);
|
1837
|
+
if (it != listener_state.watchers.end()) {
|
1838
|
+
listener_state.watchers.erase(it);
|
1839
|
+
if (listener_state.watchers.empty()) {
|
1840
|
+
listener_map_.erase(listener_name_str);
|
1841
|
+
chand_->Unsubscribe(XdsApi::kLdsTypeUrl, listener_name_str,
|
1842
|
+
delay_unsubscription);
|
1843
|
+
}
|
1844
|
+
}
|
1845
|
+
}
|
1846
|
+
|
1847
|
+
void XdsClient::WatchRouteConfigData(
|
1848
|
+
absl::string_view route_config_name,
|
1849
|
+
std::unique_ptr<RouteConfigWatcherInterface> watcher) {
|
1850
|
+
std::string route_config_name_str = std::string(route_config_name);
|
1851
|
+
MutexLock lock(&mu_);
|
1852
|
+
RouteConfigState& route_config_state =
|
1853
|
+
route_config_map_[route_config_name_str];
|
1854
|
+
RouteConfigWatcherInterface* w = watcher.get();
|
1855
|
+
route_config_state.watchers[w] = std::move(watcher);
|
1856
|
+
// If we've already received an RDS update, notify the new watcher
|
1857
|
+
// immediately.
|
1858
|
+
if (route_config_state.update.has_value()) {
|
1859
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1860
|
+
gpr_log(GPR_INFO,
|
1861
|
+
"[xds_client %p] returning cached route config data for %s", this,
|
1862
|
+
route_config_name_str.c_str());
|
1863
|
+
}
|
1864
|
+
w->OnRouteConfigChanged(*route_config_state.update);
|
1865
|
+
}
|
1866
|
+
chand_->Subscribe(XdsApi::kRdsTypeUrl, route_config_name_str);
|
1867
|
+
}
|
1868
|
+
|
1869
|
+
void XdsClient::CancelRouteConfigDataWatch(absl::string_view route_config_name,
|
1870
|
+
RouteConfigWatcherInterface* watcher,
|
1871
|
+
bool delay_unsubscription) {
|
1872
|
+
MutexLock lock(&mu_);
|
1873
|
+
if (shutting_down_) return;
|
1874
|
+
std::string route_config_name_str = std::string(route_config_name);
|
1875
|
+
RouteConfigState& route_config_state =
|
1876
|
+
route_config_map_[route_config_name_str];
|
1877
|
+
auto it = route_config_state.watchers.find(watcher);
|
1878
|
+
if (it != route_config_state.watchers.end()) {
|
1879
|
+
route_config_state.watchers.erase(it);
|
1880
|
+
if (route_config_state.watchers.empty()) {
|
1881
|
+
route_config_map_.erase(route_config_name_str);
|
1882
|
+
chand_->Unsubscribe(XdsApi::kRdsTypeUrl, route_config_name_str,
|
1883
|
+
delay_unsubscription);
|
1884
|
+
}
|
1869
1885
|
}
|
1870
|
-
Unref(DEBUG_LOCATION, "XdsClient::Orphan()");
|
1871
1886
|
}
|
1872
1887
|
|
1873
1888
|
void XdsClient::WatchClusterData(
|
1874
|
-
|
1889
|
+
absl::string_view cluster_name,
|
1890
|
+
std::unique_ptr<ClusterWatcherInterface> watcher) {
|
1875
1891
|
std::string cluster_name_str = std::string(cluster_name);
|
1892
|
+
MutexLock lock(&mu_);
|
1876
1893
|
ClusterState& cluster_state = cluster_map_[cluster_name_str];
|
1877
1894
|
ClusterWatcherInterface* w = watcher.get();
|
1878
1895
|
cluster_state.watchers[w] = std::move(watcher);
|
1879
|
-
// If we've already received
|
1896
|
+
// If we've already received a CDS update, notify the new watcher
|
1880
1897
|
// immediately.
|
1881
1898
|
if (cluster_state.update.has_value()) {
|
1882
1899
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1883
1900
|
gpr_log(GPR_INFO, "[xds_client %p] returning cached cluster data for %s",
|
1884
|
-
this,
|
1901
|
+
this, cluster_name_str.c_str());
|
1885
1902
|
}
|
1886
1903
|
w->OnClusterChanged(cluster_state.update.value());
|
1887
1904
|
}
|
1888
1905
|
chand_->Subscribe(XdsApi::kCdsTypeUrl, cluster_name_str);
|
1889
1906
|
}
|
1890
1907
|
|
1891
|
-
void XdsClient::CancelClusterDataWatch(
|
1908
|
+
void XdsClient::CancelClusterDataWatch(absl::string_view cluster_name,
|
1892
1909
|
ClusterWatcherInterface* watcher,
|
1893
1910
|
bool delay_unsubscription) {
|
1911
|
+
MutexLock lock(&mu_);
|
1894
1912
|
if (shutting_down_) return;
|
1895
1913
|
std::string cluster_name_str = std::string(cluster_name);
|
1896
1914
|
ClusterState& cluster_state = cluster_map_[cluster_name_str];
|
@@ -1906,9 +1924,10 @@ void XdsClient::CancelClusterDataWatch(StringView cluster_name,
|
|
1906
1924
|
}
|
1907
1925
|
|
1908
1926
|
void XdsClient::WatchEndpointData(
|
1909
|
-
|
1927
|
+
absl::string_view eds_service_name,
|
1910
1928
|
std::unique_ptr<EndpointWatcherInterface> watcher) {
|
1911
1929
|
std::string eds_service_name_str = std::string(eds_service_name);
|
1930
|
+
MutexLock lock(&mu_);
|
1912
1931
|
EndpointState& endpoint_state = endpoint_map_[eds_service_name_str];
|
1913
1932
|
EndpointWatcherInterface* w = watcher.get();
|
1914
1933
|
endpoint_state.watchers[w] = std::move(watcher);
|
@@ -1917,16 +1936,17 @@ void XdsClient::WatchEndpointData(
|
|
1917
1936
|
if (endpoint_state.update.has_value()) {
|
1918
1937
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1919
1938
|
gpr_log(GPR_INFO, "[xds_client %p] returning cached endpoint data for %s",
|
1920
|
-
this,
|
1939
|
+
this, eds_service_name_str.c_str());
|
1921
1940
|
}
|
1922
1941
|
w->OnEndpointChanged(endpoint_state.update.value());
|
1923
1942
|
}
|
1924
1943
|
chand_->Subscribe(XdsApi::kEdsTypeUrl, eds_service_name_str);
|
1925
1944
|
}
|
1926
1945
|
|
1927
|
-
void XdsClient::CancelEndpointDataWatch(
|
1946
|
+
void XdsClient::CancelEndpointDataWatch(absl::string_view eds_service_name,
|
1928
1947
|
EndpointWatcherInterface* watcher,
|
1929
1948
|
bool delay_unsubscription) {
|
1949
|
+
MutexLock lock(&mu_);
|
1930
1950
|
if (shutting_down_) return;
|
1931
1951
|
std::string eds_service_name_str = std::string(eds_service_name);
|
1932
1952
|
EndpointState& endpoint_state = endpoint_map_[eds_service_name_str];
|
@@ -1942,119 +1962,160 @@ void XdsClient::CancelEndpointDataWatch(StringView eds_service_name,
|
|
1942
1962
|
}
|
1943
1963
|
|
1944
1964
|
RefCountedPtr<XdsClusterDropStats> XdsClient::AddClusterDropStats(
|
1945
|
-
|
1946
|
-
|
1965
|
+
absl::string_view lrs_server, absl::string_view cluster_name,
|
1966
|
+
absl::string_view eds_service_name) {
|
1947
1967
|
// TODO(roth): When we add support for direct federation, use the
|
1948
1968
|
// server name specified in lrs_server.
|
1949
1969
|
auto key =
|
1950
1970
|
std::make_pair(std::string(cluster_name), std::string(eds_service_name));
|
1951
|
-
|
1971
|
+
MutexLock lock(&mu_);
|
1972
|
+
// We jump through some hoops here to make sure that the absl::string_views
|
1952
1973
|
// stored in the XdsClusterDropStats object point to the strings
|
1953
1974
|
// in the load_report_map_ key, so that they have the same lifetime.
|
1954
1975
|
auto it = load_report_map_
|
1955
1976
|
.emplace(std::make_pair(std::move(key), LoadReportState()))
|
1956
1977
|
.first;
|
1957
|
-
|
1958
|
-
|
1959
|
-
|
1960
|
-
|
1978
|
+
LoadReportState& load_report_state = it->second;
|
1979
|
+
RefCountedPtr<XdsClusterDropStats> cluster_drop_stats;
|
1980
|
+
if (load_report_state.drop_stats != nullptr) {
|
1981
|
+
cluster_drop_stats = load_report_state.drop_stats->RefIfNonZero();
|
1982
|
+
}
|
1983
|
+
if (cluster_drop_stats == nullptr) {
|
1984
|
+
if (load_report_state.drop_stats != nullptr) {
|
1985
|
+
load_report_state.deleted_drop_stats +=
|
1986
|
+
load_report_state.drop_stats->GetSnapshotAndReset();
|
1987
|
+
}
|
1988
|
+
cluster_drop_stats = MakeRefCounted<XdsClusterDropStats>(
|
1989
|
+
Ref(DEBUG_LOCATION, "DropStats"), lrs_server,
|
1990
|
+
it->first.first /*cluster_name*/,
|
1991
|
+
it->first.second /*eds_service_name*/);
|
1992
|
+
load_report_state.drop_stats = cluster_drop_stats.get();
|
1993
|
+
}
|
1961
1994
|
chand_->MaybeStartLrsCall();
|
1962
1995
|
return cluster_drop_stats;
|
1963
1996
|
}
|
1964
1997
|
|
1965
1998
|
void XdsClient::RemoveClusterDropStats(
|
1966
|
-
|
1967
|
-
|
1968
|
-
|
1969
|
-
|
1970
|
-
if (load_report_it == load_report_map_.end()) return;
|
1971
|
-
LoadReportState& load_report_state = load_report_it->second;
|
1999
|
+
absl::string_view /*lrs_server*/, absl::string_view cluster_name,
|
2000
|
+
absl::string_view eds_service_name,
|
2001
|
+
XdsClusterDropStats* cluster_drop_stats) {
|
2002
|
+
MutexLock lock(&mu_);
|
1972
2003
|
// TODO(roth): When we add support for direct federation, use the
|
1973
2004
|
// server name specified in lrs_server.
|
1974
|
-
auto it =
|
1975
|
-
|
1976
|
-
|
2005
|
+
auto it = load_report_map_.find(
|
2006
|
+
std::make_pair(std::string(cluster_name), std::string(eds_service_name)));
|
2007
|
+
if (it == load_report_map_.end()) return;
|
2008
|
+
LoadReportState& load_report_state = it->second;
|
2009
|
+
if (load_report_state.drop_stats == cluster_drop_stats) {
|
2010
|
+
// Record final snapshot in deleted_drop_stats, which will be
|
1977
2011
|
// added to the next load report.
|
1978
|
-
|
1979
|
-
|
1980
|
-
|
1981
|
-
load_report_state.drop_stats.erase(it);
|
2012
|
+
load_report_state.deleted_drop_stats +=
|
2013
|
+
load_report_state.drop_stats->GetSnapshotAndReset();
|
2014
|
+
load_report_state.drop_stats = nullptr;
|
1982
2015
|
}
|
1983
2016
|
}
|
1984
2017
|
|
1985
2018
|
RefCountedPtr<XdsClusterLocalityStats> XdsClient::AddClusterLocalityStats(
|
1986
|
-
|
2019
|
+
absl::string_view lrs_server, absl::string_view cluster_name,
|
2020
|
+
absl::string_view eds_service_name,
|
1987
2021
|
RefCountedPtr<XdsLocalityName> locality) {
|
1988
2022
|
// TODO(roth): When we add support for direct federation, use the
|
1989
2023
|
// server name specified in lrs_server.
|
1990
2024
|
auto key =
|
1991
2025
|
std::make_pair(std::string(cluster_name), std::string(eds_service_name));
|
1992
|
-
|
2026
|
+
MutexLock lock(&mu_);
|
2027
|
+
// We jump through some hoops here to make sure that the absl::string_views
|
1993
2028
|
// stored in the XdsClusterLocalityStats object point to the strings
|
1994
2029
|
// in the load_report_map_ key, so that they have the same lifetime.
|
1995
2030
|
auto it = load_report_map_
|
1996
2031
|
.emplace(std::make_pair(std::move(key), LoadReportState()))
|
1997
2032
|
.first;
|
1998
|
-
|
1999
|
-
|
2000
|
-
|
2001
|
-
|
2002
|
-
|
2003
|
-
|
2033
|
+
LoadReportState& load_report_state = it->second;
|
2034
|
+
LoadReportState::LocalityState& locality_state =
|
2035
|
+
load_report_state.locality_stats[locality];
|
2036
|
+
RefCountedPtr<XdsClusterLocalityStats> cluster_locality_stats;
|
2037
|
+
if (locality_state.locality_stats != nullptr) {
|
2038
|
+
cluster_locality_stats = locality_state.locality_stats->RefIfNonZero();
|
2039
|
+
}
|
2040
|
+
if (cluster_locality_stats == nullptr) {
|
2041
|
+
if (locality_state.locality_stats != nullptr) {
|
2042
|
+
locality_state.deleted_locality_stats +=
|
2043
|
+
locality_state.locality_stats->GetSnapshotAndReset();
|
2044
|
+
}
|
2045
|
+
cluster_locality_stats = MakeRefCounted<XdsClusterLocalityStats>(
|
2046
|
+
Ref(DEBUG_LOCATION, "LocalityStats"), lrs_server,
|
2047
|
+
it->first.first /*cluster_name*/, it->first.second /*eds_service_name*/,
|
2048
|
+
std::move(locality));
|
2049
|
+
locality_state.locality_stats = cluster_locality_stats.get();
|
2050
|
+
}
|
2004
2051
|
chand_->MaybeStartLrsCall();
|
2005
2052
|
return cluster_locality_stats;
|
2006
2053
|
}
|
2007
2054
|
|
2008
2055
|
void XdsClient::RemoveClusterLocalityStats(
|
2009
|
-
|
2010
|
-
|
2056
|
+
absl::string_view /*lrs_server*/, absl::string_view cluster_name,
|
2057
|
+
absl::string_view eds_service_name,
|
2058
|
+
const RefCountedPtr<XdsLocalityName>& locality,
|
2011
2059
|
XdsClusterLocalityStats* cluster_locality_stats) {
|
2012
|
-
|
2013
|
-
std::make_pair(std::string(cluster_name), std::string(eds_service_name)));
|
2014
|
-
if (load_report_it == load_report_map_.end()) return;
|
2015
|
-
LoadReportState& load_report_state = load_report_it->second;
|
2060
|
+
MutexLock lock(&mu_);
|
2016
2061
|
// TODO(roth): When we add support for direct federation, use the
|
2017
2062
|
// server name specified in lrs_server.
|
2063
|
+
auto it = load_report_map_.find(
|
2064
|
+
std::make_pair(std::string(cluster_name), std::string(eds_service_name)));
|
2065
|
+
if (it == load_report_map_.end()) return;
|
2066
|
+
LoadReportState& load_report_state = it->second;
|
2018
2067
|
auto locality_it = load_report_state.locality_stats.find(locality);
|
2019
2068
|
if (locality_it == load_report_state.locality_stats.end()) return;
|
2020
|
-
|
2021
|
-
|
2022
|
-
if (it != locality_set.end()) {
|
2069
|
+
LoadReportState::LocalityState& locality_state = locality_it->second;
|
2070
|
+
if (locality_state.locality_stats == cluster_locality_stats) {
|
2023
2071
|
// Record final snapshot in deleted_locality_stats, which will be
|
2024
2072
|
// added to the next load report.
|
2025
|
-
|
2026
|
-
|
2027
|
-
|
2073
|
+
locality_state.deleted_locality_stats +=
|
2074
|
+
locality_state.locality_stats->GetSnapshotAndReset();
|
2075
|
+
locality_state.locality_stats = nullptr;
|
2028
2076
|
}
|
2029
2077
|
}
|
2030
2078
|
|
2031
2079
|
void XdsClient::ResetBackoff() {
|
2080
|
+
MutexLock lock(&mu_);
|
2032
2081
|
if (chand_ != nullptr) {
|
2033
2082
|
grpc_channel_reset_connect_backoff(chand_->channel());
|
2034
2083
|
}
|
2035
2084
|
}
|
2036
2085
|
|
2037
|
-
|
2038
|
-
|
2039
|
-
|
2040
|
-
|
2041
|
-
|
2042
|
-
|
2043
|
-
|
2044
|
-
|
2045
|
-
|
2046
|
-
|
2047
|
-
|
2048
|
-
|
2049
|
-
|
2050
|
-
|
2051
|
-
|
2052
|
-
|
2053
|
-
|
2054
|
-
}
|
2055
|
-
|
2056
|
-
|
2057
|
-
const
|
2086
|
+
void XdsClient::NotifyOnErrorLocked(grpc_error* error) {
|
2087
|
+
for (const auto& p : listener_map_) {
|
2088
|
+
const ListenerState& listener_state = p.second;
|
2089
|
+
for (const auto& p : listener_state.watchers) {
|
2090
|
+
p.first->OnError(GRPC_ERROR_REF(error));
|
2091
|
+
}
|
2092
|
+
}
|
2093
|
+
for (const auto& p : route_config_map_) {
|
2094
|
+
const RouteConfigState& route_config_state = p.second;
|
2095
|
+
for (const auto& p : route_config_state.watchers) {
|
2096
|
+
p.first->OnError(GRPC_ERROR_REF(error));
|
2097
|
+
}
|
2098
|
+
}
|
2099
|
+
for (const auto& p : cluster_map_) {
|
2100
|
+
const ClusterState& cluster_state = p.second;
|
2101
|
+
for (const auto& p : cluster_state.watchers) {
|
2102
|
+
p.first->OnError(GRPC_ERROR_REF(error));
|
2103
|
+
}
|
2104
|
+
}
|
2105
|
+
for (const auto& p : endpoint_map_) {
|
2106
|
+
const EndpointState& endpoint_state = p.second;
|
2107
|
+
for (const auto& p : endpoint_state.watchers) {
|
2108
|
+
p.first->OnError(GRPC_ERROR_REF(error));
|
2109
|
+
}
|
2110
|
+
}
|
2111
|
+
GRPC_ERROR_UNREF(error);
|
2112
|
+
}
|
2113
|
+
|
2114
|
+
XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked(
|
2115
|
+
bool send_all_clusters, const std::set<std::string>& clusters) {
|
2116
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2117
|
+
gpr_log(GPR_INFO, "[xds_client %p] start building load report", this);
|
2118
|
+
}
|
2058
2119
|
XdsApi::ClusterLoadReportMap snapshot_map;
|
2059
2120
|
for (auto load_report_it = load_report_map_.begin();
|
2060
2121
|
load_report_it != load_report_map_.end();) {
|
@@ -2069,13 +2130,18 @@ XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshot(
|
|
2069
2130
|
// asking for the data in the future, we don't incorrectly include
|
2070
2131
|
// data from previous reporting intervals in that future report.
|
2071
2132
|
const bool record_stats =
|
2072
|
-
clusters.find(cluster_key.first) != clusters.end();
|
2133
|
+
send_all_clusters || clusters.find(cluster_key.first) != clusters.end();
|
2073
2134
|
XdsApi::ClusterLoadReport snapshot;
|
2074
2135
|
// Aggregate drop stats.
|
2075
2136
|
snapshot.dropped_requests = std::move(load_report.deleted_drop_stats);
|
2076
|
-
|
2077
|
-
|
2078
|
-
|
2137
|
+
if (load_report.drop_stats != nullptr) {
|
2138
|
+
snapshot.dropped_requests +=
|
2139
|
+
load_report.drop_stats->GetSnapshotAndReset();
|
2140
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2141
|
+
gpr_log(GPR_INFO,
|
2142
|
+
"[xds_client %p] cluster=%s eds_service_name=%s drop_stats=%p",
|
2143
|
+
this, cluster_key.first.c_str(), cluster_key.second.c_str(),
|
2144
|
+
load_report.drop_stats);
|
2079
2145
|
}
|
2080
2146
|
}
|
2081
2147
|
// Aggregate locality stats.
|
@@ -2085,34 +2151,39 @@ XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshot(
|
|
2085
2151
|
auto& locality_state = it->second;
|
2086
2152
|
XdsClusterLocalityStats::Snapshot& locality_snapshot =
|
2087
2153
|
snapshot.locality_stats[locality_name];
|
2088
|
-
|
2089
|
-
|
2090
|
-
|
2091
|
-
|
2092
|
-
|
2093
|
-
|
2094
|
-
|
2154
|
+
locality_snapshot = std::move(locality_state.deleted_locality_stats);
|
2155
|
+
if (locality_state.locality_stats != nullptr) {
|
2156
|
+
locality_snapshot +=
|
2157
|
+
locality_state.locality_stats->GetSnapshotAndReset();
|
2158
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2159
|
+
gpr_log(GPR_INFO,
|
2160
|
+
"[xds_client %p] cluster=%s eds_service_name=%s "
|
2161
|
+
"locality=%s locality_stats=%p",
|
2162
|
+
this, cluster_key.first.c_str(), cluster_key.second.c_str(),
|
2163
|
+
locality_name->AsHumanReadableString().c_str(),
|
2164
|
+
locality_state.locality_stats);
|
2165
|
+
}
|
2095
2166
|
}
|
2096
|
-
locality_state.deleted_locality_stats.clear();
|
2097
2167
|
// If the only thing left in this entry was final snapshots from
|
2098
2168
|
// deleted locality stats objects, remove the entry.
|
2099
|
-
if (locality_state.locality_stats
|
2169
|
+
if (locality_state.locality_stats == nullptr) {
|
2100
2170
|
it = load_report.locality_stats.erase(it);
|
2101
2171
|
} else {
|
2102
2172
|
++it;
|
2103
2173
|
}
|
2104
2174
|
}
|
2175
|
+
// Compute load report interval.
|
2176
|
+
const grpc_millis now = ExecCtx::Get()->Now();
|
2177
|
+
snapshot.load_report_interval = now - load_report.last_report_time;
|
2178
|
+
load_report.last_report_time = now;
|
2179
|
+
// Record snapshot.
|
2105
2180
|
if (record_stats) {
|
2106
|
-
// Compute load report interval.
|
2107
|
-
const grpc_millis now = ExecCtx::Get()->Now();
|
2108
|
-
snapshot.load_report_interval = now - load_report.last_report_time;
|
2109
|
-
load_report.last_report_time = now;
|
2110
|
-
// Record snapshot.
|
2111
2181
|
snapshot_map[cluster_key] = std::move(snapshot);
|
2112
2182
|
}
|
2113
2183
|
// If the only thing left in this entry was final snapshots from
|
2114
2184
|
// deleted stats objects, remove the entry.
|
2115
|
-
if (load_report.locality_stats.empty() &&
|
2185
|
+
if (load_report.locality_stats.empty() &&
|
2186
|
+
load_report.drop_stats == nullptr) {
|
2116
2187
|
load_report_it = load_report_map_.erase(load_report_it);
|
2117
2188
|
} else {
|
2118
2189
|
++load_report_it;
|
@@ -2121,54 +2192,48 @@ XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshot(
|
|
2121
2192
|
return snapshot_map;
|
2122
2193
|
}
|
2123
2194
|
|
2124
|
-
|
2125
|
-
|
2126
|
-
|
2127
|
-
}
|
2128
|
-
for (const auto& p : cluster_map_) {
|
2129
|
-
const ClusterState& cluster_state = p.second;
|
2130
|
-
for (const auto& p : cluster_state.watchers) {
|
2131
|
-
p.first->OnError(GRPC_ERROR_REF(error));
|
2132
|
-
}
|
2133
|
-
}
|
2134
|
-
for (const auto& p : endpoint_map_) {
|
2135
|
-
const EndpointState& endpoint_state = p.second;
|
2136
|
-
for (const auto& p : endpoint_state.watchers) {
|
2137
|
-
p.first->OnError(GRPC_ERROR_REF(error));
|
2138
|
-
}
|
2139
|
-
}
|
2140
|
-
GRPC_ERROR_UNREF(error);
|
2141
|
-
}
|
2195
|
+
//
|
2196
|
+
// accessors for global state
|
2197
|
+
//
|
2142
2198
|
|
2143
|
-
void
|
2144
|
-
|
2145
|
-
|
2146
|
-
|
2199
|
+
void XdsClientGlobalInit() { g_mu = new Mutex; }
|
2200
|
+
|
2201
|
+
void XdsClientGlobalShutdown() {
|
2202
|
+
delete g_mu;
|
2203
|
+
g_mu = nullptr;
|
2204
|
+
gpr_free(g_fallback_bootstrap_config);
|
2205
|
+
g_fallback_bootstrap_config = nullptr;
|
2147
2206
|
}
|
2148
2207
|
|
2149
|
-
|
2150
|
-
|
2151
|
-
|
2208
|
+
RefCountedPtr<XdsClient> XdsClient::GetOrCreate(grpc_error** error) {
|
2209
|
+
MutexLock lock(g_mu);
|
2210
|
+
if (g_xds_client != nullptr) {
|
2211
|
+
auto xds_client = g_xds_client->RefIfNonZero();
|
2212
|
+
if (xds_client != nullptr) return xds_client;
|
2213
|
+
}
|
2214
|
+
auto xds_client = MakeRefCounted<XdsClient>(error);
|
2215
|
+
g_xds_client = xds_client.get();
|
2216
|
+
return xds_client;
|
2152
2217
|
}
|
2153
2218
|
|
2154
|
-
|
2219
|
+
namespace internal {
|
2155
2220
|
|
2156
|
-
|
2157
|
-
|
2158
|
-
|
2221
|
+
void SetXdsChannelArgsForTest(grpc_channel_args* args) {
|
2222
|
+
MutexLock lock(g_mu);
|
2223
|
+
g_channel_args = args;
|
2224
|
+
}
|
2159
2225
|
|
2160
|
-
|
2161
|
-
|
2162
|
-
|
2163
|
-
&XdsClient::kXdsClientVtable);
|
2226
|
+
void UnsetGlobalXdsClientForTest() {
|
2227
|
+
MutexLock lock(g_mu);
|
2228
|
+
g_xds_client = nullptr;
|
2164
2229
|
}
|
2165
2230
|
|
2166
|
-
|
2167
|
-
|
2168
|
-
|
2169
|
-
|
2170
|
-
if (xds_client != nullptr) return xds_client->Ref();
|
2171
|
-
return nullptr;
|
2231
|
+
void SetXdsFallbackBootstrapConfig(const char* config) {
|
2232
|
+
MutexLock lock(g_mu);
|
2233
|
+
gpr_free(g_fallback_bootstrap_config);
|
2234
|
+
g_fallback_bootstrap_config = gpr_strdup(config);
|
2172
2235
|
}
|
2173
2236
|
|
2237
|
+
} // namespace internal
|
2238
|
+
|
2174
2239
|
} // namespace grpc_core
|