grpc 1.40.0.pre1 → 1.42.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Makefile +68 -64
- data/etc/roots.pem +335 -326
- data/include/grpc/byte_buffer.h +1 -1
- data/include/grpc/byte_buffer_reader.h +1 -1
- data/include/grpc/event_engine/endpoint_config.h +6 -11
- data/include/grpc/event_engine/event_engine.h +131 -86
- data/include/grpc/event_engine/internal/memory_allocator_impl.h +98 -0
- data/include/grpc/event_engine/memory_allocator.h +210 -0
- data/include/grpc/event_engine/port.h +1 -3
- data/include/grpc/fork.h +1 -1
- data/include/grpc/grpc.h +14 -4
- data/include/grpc/grpc_posix.h +5 -2
- data/include/grpc/grpc_security.h +18 -0
- data/include/grpc/grpc_security_constants.h +1 -0
- data/include/grpc/impl/codegen/atm.h +5 -3
- data/include/grpc/impl/codegen/atm_gcc_atomic.h +2 -0
- data/include/grpc/impl/codegen/atm_gcc_sync.h +2 -0
- data/include/grpc/impl/codegen/atm_windows.h +2 -0
- data/include/grpc/impl/codegen/byte_buffer.h +2 -0
- data/include/grpc/impl/codegen/byte_buffer_reader.h +2 -0
- data/include/grpc/impl/codegen/compression_types.h +2 -0
- data/include/grpc/impl/codegen/connectivity_state.h +2 -0
- data/include/grpc/impl/codegen/fork.h +2 -0
- data/include/grpc/impl/codegen/gpr_slice.h +2 -0
- data/include/grpc/impl/codegen/gpr_types.h +2 -0
- data/include/grpc/impl/codegen/grpc_types.h +4 -5
- data/include/grpc/impl/codegen/log.h +2 -0
- data/include/grpc/impl/codegen/port_platform.h +33 -22
- data/include/grpc/impl/codegen/propagation_bits.h +2 -0
- data/include/grpc/impl/codegen/slice.h +2 -0
- data/include/grpc/impl/codegen/status.h +2 -0
- data/include/grpc/impl/codegen/sync.h +8 -5
- data/include/grpc/impl/codegen/sync_abseil.h +2 -0
- data/include/grpc/impl/codegen/sync_custom.h +2 -0
- data/include/grpc/impl/codegen/sync_generic.h +3 -0
- data/include/grpc/impl/codegen/sync_posix.h +4 -2
- data/include/grpc/impl/codegen/sync_windows.h +2 -0
- data/include/grpc/slice.h +1 -1
- data/include/grpc/status.h +1 -1
- data/include/grpc/support/atm.h +1 -1
- data/include/grpc/support/atm_gcc_atomic.h +1 -1
- data/include/grpc/support/atm_gcc_sync.h +1 -1
- data/include/grpc/support/atm_windows.h +1 -1
- data/include/grpc/support/log.h +1 -1
- data/include/grpc/support/port_platform.h +1 -1
- data/include/grpc/support/sync.h +1 -1
- data/include/grpc/support/sync_abseil.h +1 -1
- data/include/grpc/support/sync_custom.h +1 -1
- data/include/grpc/support/sync_generic.h +1 -1
- data/include/grpc/support/sync_posix.h +1 -1
- data/include/grpc/support/sync_windows.h +1 -1
- data/include/grpc/support/time.h +2 -2
- data/src/core/ext/filters/census/grpc_context.cc +1 -0
- data/src/core/ext/filters/client_channel/backend_metric.cc +18 -20
- data/src/core/ext/filters/client_channel/backup_poller.cc +2 -1
- data/src/core/ext/filters/client_channel/backup_poller.h +1 -0
- data/src/core/ext/filters/client_channel/channel_connectivity.cc +72 -91
- data/src/core/ext/filters/client_channel/client_channel.cc +196 -289
- data/src/core/ext/filters/client_channel/client_channel.h +75 -28
- data/src/core/ext/filters/client_channel/client_channel_channelz.cc +6 -5
- data/src/core/ext/filters/client_channel/client_channel_channelz.h +1 -1
- data/src/core/ext/filters/client_channel/client_channel_factory.cc +2 -1
- data/src/core/ext/filters/client_channel/client_channel_factory.h +17 -19
- data/src/core/ext/filters/client_channel/client_channel_plugin.cc +16 -15
- data/src/core/ext/filters/client_channel/config_selector.cc +2 -1
- data/src/core/ext/filters/client_channel/config_selector.h +4 -5
- data/src/core/ext/filters/client_channel/connector.h +18 -18
- data/src/core/ext/filters/client_channel/dynamic_filters.cc +1 -1
- data/src/core/ext/filters/client_channel/global_subchannel_pool.h +0 -1
- data/src/core/ext/filters/client_channel/health/health_check_client.cc +19 -17
- data/src/core/ext/filters/client_channel/health/health_check_client.h +4 -3
- data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +8 -7
- data/src/core/ext/filters/client_channel/http_connect_handshaker.h +10 -2
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc +6 -2
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +6 -15
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +168 -90
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h +4 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +1 -2
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc +2 -2
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +2 -2
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +2 -3
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +23 -7
- data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +29 -33
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +2502 -0
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +6 -1
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +2 -2
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +9 -9
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +21 -20
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +15 -7
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +10 -9
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +9 -19
- data/src/core/ext/filters/client_channel/lb_policy.h +21 -44
- data/src/core/ext/filters/client_channel/lb_policy_factory.h +1 -0
- data/src/core/ext/filters/client_channel/lb_policy_registry.cc +4 -7
- data/src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc +139 -0
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +13 -15
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +1 -0
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +4 -3
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +9 -8
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +26 -58
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +21 -1
- data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +7 -2
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +5 -3
- data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +5 -5
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +82 -76
- data/src/core/ext/filters/client_channel/resolver.h +1 -1
- data/src/core/ext/filters/client_channel/resolver_factory.h +2 -0
- data/src/core/ext/filters/client_channel/resolver_registry.cc +6 -8
- data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +3 -4
- data/src/core/ext/filters/client_channel/resolver_result_parsing.h +1 -1
- data/src/core/ext/filters/client_channel/retry_filter.cc +64 -89
- data/src/core/ext/filters/client_channel/retry_service_config.h +1 -1
- data/src/core/ext/filters/client_channel/retry_throttle.cc +17 -48
- data/src/core/ext/filters/client_channel/server_address.h +1 -1
- data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +49 -36
- data/src/core/ext/filters/client_channel/subchannel.cc +85 -143
- data/src/core/ext/filters/client_channel/subchannel.h +29 -49
- data/src/core/ext/filters/client_channel/subchannel_pool_interface.cc +22 -7
- data/src/core/ext/filters/client_channel/subchannel_pool_interface.h +11 -2
- data/src/core/ext/filters/client_idle/client_idle_filter.cc +29 -206
- data/src/core/ext/filters/client_idle/idle_filter_state.cc +96 -0
- data/src/core/ext/filters/client_idle/idle_filter_state.h +66 -0
- data/src/core/ext/filters/deadline/deadline_filter.cc +23 -26
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +27 -25
- data/src/core/ext/filters/fault_injection/service_config_parser.cc +6 -14
- data/src/core/ext/filters/fault_injection/service_config_parser.h +1 -1
- data/src/core/ext/filters/http/client/http_client_filter.cc +44 -46
- data/src/core/ext/filters/http/client_authority_filter.cc +16 -16
- data/src/core/ext/filters/http/http_filters_plugin.cc +53 -71
- data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +19 -13
- data/src/core/ext/filters/http/message_compress/message_decompress_filter.cc +8 -9
- data/src/core/ext/filters/http/server/http_server_filter.cc +77 -72
- data/src/core/ext/filters/max_age/max_age_filter.cc +24 -26
- data/src/core/ext/filters/message_size/message_size_filter.cc +28 -29
- data/src/core/ext/filters/message_size/message_size_filter.h +1 -1
- data/src/core/ext/{filters/client_channel → service_config}/service_config.cc +2 -2
- data/src/core/ext/{filters/client_channel → service_config}/service_config.h +4 -4
- data/src/core/ext/service_config/service_config_call_data.h +72 -0
- data/src/core/ext/{filters/client_channel → service_config}/service_config_parser.cc +3 -3
- data/src/core/ext/{filters/client_channel → service_config}/service_config_parser.h +8 -6
- data/src/core/ext/transport/chttp2/alpn/alpn.cc +2 -1
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +29 -15
- data/src/core/ext/transport/chttp2/client/chttp2_connector.h +2 -0
- data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +21 -27
- data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc +10 -6
- data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +29 -53
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +74 -53
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +0 -1
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +12 -6
- data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc +5 -9
- data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +3 -1
- data/src/core/ext/transport/chttp2/transport/bin_decoder.h +2 -1
- data/src/core/ext/transport/chttp2/transport/bin_encoder.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +83 -88
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +4 -1
- data/src/core/ext/transport/chttp2/transport/context_list.h +1 -2
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +56 -37
- data/src/core/ext/transport/chttp2/transport/flow_control.h +13 -7
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +11 -11
- data/src/core/ext/transport/chttp2/transport/frame_data.h +1 -0
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +6 -4
- data/src/core/ext/transport/chttp2/transport/frame_goaway.h +1 -0
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +6 -5
- data/src/core/ext/transport/chttp2/transport/frame_ping.h +1 -0
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +5 -8
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +1 -0
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +38 -7
- data/src/core/ext/transport/chttp2/transport/frame_settings.h +1 -0
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +12 -7
- data/src/core/ext/transport/chttp2/transport/frame_window_update.h +1 -0
- data/src/core/ext/transport/chttp2/transport/hpack_constants.h +41 -0
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +311 -665
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +240 -70
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_index.h +107 -0
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc +86 -0
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h +69 -0
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +816 -1039
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +75 -177
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +146 -0
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +137 -0
- data/src/core/ext/transport/chttp2/transport/hpack_utils.cc +46 -0
- data/src/core/{lib/transport/authority_override.h → ext/transport/chttp2/transport/hpack_utils.h} +8 -15
- data/src/core/ext/transport/chttp2/transport/internal.h +6 -5
- data/src/core/ext/transport/chttp2/transport/parsing.cc +50 -203
- data/src/core/ext/transport/chttp2/transport/popularity_count.h +60 -0
- data/src/core/ext/transport/chttp2/transport/stream_lists.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/varint.cc +7 -3
- data/src/core/ext/transport/chttp2/transport/varint.h +39 -28
- data/src/core/ext/transport/chttp2/transport/writing.cc +61 -50
- data/src/core/ext/transport/inproc/inproc_transport.cc +111 -113
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c +96 -96
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h +221 -89
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c +1 -1
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +1 -1
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +3 -3
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +11 -5
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +48 -48
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +151 -61
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +99 -99
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +171 -69
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c +15 -15
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h +31 -13
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +164 -131
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +368 -102
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c +4 -4
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h +11 -5
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +23 -23
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +11 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +28 -28
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +71 -29
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c +4 -4
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h +11 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +95 -83
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +254 -85
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +24 -24
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +51 -21
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c +3 -3
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h +11 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c +9 -9
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h +21 -9
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +62 -62
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +131 -53
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +53 -52
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +96 -33
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h +11 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +71 -66
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +164 -57
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +3 -3
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h +11 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c +7 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h +21 -9
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +8 -8
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +11 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +8 -8
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +11 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c +4 -4
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h +11 -5
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +16 -16
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h +31 -13
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +56 -22
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +174 -17
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c +32 -32
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h +51 -21
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c +3 -3
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h +11 -5
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +37 -37
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +61 -25
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +40 -40
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +71 -29
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +9 -9
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +11 -5
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +21 -9
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c +30 -30
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h +81 -33
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c +41 -29
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h +141 -43
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +49 -43
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +105 -29
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +18 -18
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +31 -13
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +286 -279
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +618 -267
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c +10 -10
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h +31 -13
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +6 -6
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h +21 -9
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c +3 -3
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +11 -5
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c +13 -13
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h +51 -21
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +23 -23
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +31 -13
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +9 -9
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +11 -5
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +115 -116
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +191 -77
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c +1 -1
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h +1 -1
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +46 -32
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +118 -34
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +12 -12
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +31 -13
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +44 -42
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +108 -55
- data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h +11 -5
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h +11 -5
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +42 -42
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +61 -25
- data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h +11 -5
- data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h +11 -5
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +9 -9
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h +21 -9
- data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h +11 -5
- data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h +11 -5
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c +28 -28
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h +51 -21
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c +8 -8
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h +41 -17
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c +9 -8
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h +25 -9
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c +4 -4
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h +11 -5
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c +4 -4
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h +11 -5
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c +3 -3
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h +11 -5
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +9 -9
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h +31 -13
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +10 -10
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h +21 -9
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c +6 -6
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h +21 -9
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c +11 -11
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h +31 -13
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c +15 -15
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h +71 -29
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c +19 -19
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h +51 -21
- data/src/core/ext/upb-generated/envoy/type/v3/http.upb.c +1 -1
- data/src/core/ext/upb-generated/envoy/type/v3/http.upb.h +1 -1
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c +6 -6
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h +21 -9
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.c +10 -10
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.h +31 -13
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h +11 -5
- data/src/core/ext/upb-generated/google/api/annotations.upb.c +1 -1
- 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 +58 -58
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h +111 -45
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +68 -68
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +121 -49
- data/src/core/ext/upb-generated/google/api/http.upb.c +18 -18
- data/src/core/ext/upb-generated/google/api/http.upb.h +31 -13
- data/src/core/ext/upb-generated/google/protobuf/any.upb.c +4 -4
- data/src/core/ext/upb-generated/google/protobuf/any.upb.h +11 -5
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +153 -153
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +271 -109
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.c +4 -4
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +11 -5
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.c +2 -2
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.h +11 -5
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +15 -15
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +31 -13
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +4 -4
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +11 -5
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +19 -19
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +91 -37
- data/src/core/ext/upb-generated/google/rpc/status.upb.c +5 -5
- data/src/core/ext/upb-generated/google/rpc/status.upb.h +11 -5
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +12 -12
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +11 -5
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +60 -60
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +101 -41
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c +7 -7
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +21 -9
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c +5 -5
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +21 -9
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +31 -31
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +91 -37
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c +55 -0
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h +154 -0
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +8 -8
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +31 -13
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.c +4 -6
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.h +11 -5
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c +1 -1
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +1 -1
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.c +4 -4
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.h +11 -5
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c +3 -3
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h +11 -5
- data/src/core/ext/upb-generated/validate/validate.upb.c +220 -220
- data/src/core/ext/upb-generated/validate/validate.upb.h +231 -93
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c +58 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h +182 -0
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.c +4 -4
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.h +11 -5
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c +9 -9
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h +21 -9
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c +7 -7
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h +11 -5
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.c +6 -6
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.h +11 -5
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c +12 -12
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h +21 -9
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c +7 -7
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h +11 -5
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c +58 -0
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h +130 -0
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c +33 -0
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h +83 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +410 -384
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +101 -88
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +59 -56
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +59 -46
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +90 -63
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c +30 -19
- data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +801 -783
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +96 -100
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +133 -115
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +178 -173
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c +14 -13
- data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c +103 -103
- data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c +5 -4
- data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c +19 -23
- data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c +4 -3
- data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c +5 -3
- data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c +5 -4
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c +75 -0
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h +50 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c +13 -12
- data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c +25 -24
- data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c +16 -15
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c +17 -16
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c +33 -32
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c +19 -18
- data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c +45 -0
- data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h +35 -0
- data/src/core/ext/xds/certificate_provider_registry.cc +2 -2
- data/src/core/ext/xds/xds_api.cc +1140 -1314
- data/src/core/ext/xds/xds_api.h +150 -115
- data/src/core/ext/xds/xds_bootstrap.cc +27 -52
- data/src/core/ext/xds/xds_bootstrap.h +10 -0
- data/src/core/ext/xds/xds_certificate_provider.cc +3 -3
- data/src/core/ext/xds/xds_channel_stack_modifier.cc +113 -0
- data/src/core/ext/xds/xds_channel_stack_modifier.h +52 -0
- data/src/core/ext/xds/xds_client.cc +572 -320
- data/src/core/ext/xds/xds_client.h +42 -37
- data/src/core/ext/xds/xds_client_stats.cc +16 -15
- data/src/core/ext/xds/xds_client_stats.h +7 -7
- data/src/core/ext/xds/xds_http_fault_filter.cc +4 -3
- data/src/core/ext/xds/xds_http_fault_filter.h +3 -2
- data/src/core/ext/xds/xds_http_filters.cc +1 -0
- data/src/core/ext/xds/xds_server_config_fetcher.cc +15 -17
- data/src/core/lib/address_utils/parse_address.cc +6 -8
- data/src/core/lib/address_utils/sockaddr_utils.cc +2 -2
- data/src/core/lib/avl/avl.cc +5 -5
- data/src/core/lib/backoff/backoff.cc +1 -1
- data/src/core/lib/channel/channel_args.cc +26 -7
- data/src/core/lib/channel/channel_args.h +9 -0
- data/src/core/lib/channel/channel_stack.cc +5 -3
- data/src/core/lib/channel/channel_stack_builder.cc +4 -14
- data/src/core/lib/channel/channel_stack_builder.h +0 -8
- data/src/core/lib/channel/channel_trace.cc +5 -4
- data/src/core/lib/channel/channel_trace.h +2 -1
- data/src/core/lib/channel/channelz.cc +43 -39
- data/src/core/lib/channel/channelz.h +29 -29
- data/src/core/lib/channel/channelz_registry.cc +8 -7
- data/src/core/lib/channel/channelz_registry.h +1 -1
- data/src/core/lib/channel/connected_channel.cc +2 -3
- data/src/core/lib/channel/connected_channel.h +1 -2
- data/src/core/lib/channel/handshaker.cc +2 -1
- data/src/core/lib/channel/handshaker.h +1 -2
- data/src/core/lib/channel/handshaker_factory.h +10 -2
- data/src/core/lib/channel/handshaker_registry.cc +15 -70
- data/src/core/lib/channel/handshaker_registry.h +29 -12
- data/src/core/lib/channel/status_util.h +2 -2
- data/src/core/lib/compression/algorithm_metadata.h +1 -0
- data/src/core/lib/compression/compression.cc +2 -2
- data/src/core/lib/compression/compression_args.cc +8 -5
- data/src/core/lib/compression/compression_internal.cc +4 -6
- data/src/core/lib/compression/compression_internal.h +1 -1
- data/src/core/lib/compression/message_compress.cc +2 -2
- data/src/core/lib/compression/stream_compression.cc +2 -1
- data/src/core/lib/compression/stream_compression.h +2 -1
- data/src/core/lib/compression/stream_compression_gzip.cc +2 -1
- data/src/core/lib/compression/stream_compression_identity.cc +2 -1
- data/src/core/lib/config/core_configuration.cc +96 -0
- data/src/core/lib/config/core_configuration.h +146 -0
- data/src/core/lib/debug/stats.cc +1 -1
- data/src/core/lib/debug/stats.h +1 -0
- data/src/core/lib/debug/stats_data.cc +15 -14
- data/src/core/lib/debug/stats_data.h +1 -0
- data/src/core/lib/debug/trace.cc +1 -0
- data/src/core/lib/debug/trace.h +2 -1
- data/src/core/lib/event_engine/endpoint_config.cc +0 -1
- data/src/core/lib/event_engine/event_engine.cc +3 -3
- data/src/core/lib/event_engine/sockaddr.cc +3 -3
- data/src/core/lib/gpr/alloc.cc +4 -3
- data/src/core/lib/gpr/atm.cc +1 -1
- data/src/core/lib/gpr/cpu_posix.cc +1 -1
- data/src/core/lib/gpr/env_linux.cc +1 -2
- data/src/core/lib/gpr/env_posix.cc +2 -3
- data/src/core/lib/gpr/log.cc +3 -3
- data/src/core/lib/gpr/log_android.cc +3 -2
- data/src/core/lib/gpr/log_linux.cc +7 -4
- data/src/core/lib/gpr/log_posix.cc +6 -3
- data/src/core/lib/gpr/string.cc +2 -2
- data/src/core/lib/gpr/string.h +2 -2
- data/src/core/lib/gpr/sync.cc +2 -2
- data/src/core/lib/gpr/sync_abseil.cc +7 -6
- data/src/core/lib/gpr/sync_posix.cc +3 -3
- data/src/core/lib/gpr/time.cc +3 -2
- data/src/core/lib/gpr/time_windows.cc +3 -2
- data/src/core/lib/gpr/tls.h +119 -40
- data/src/core/lib/gpr/tmpfile_posix.cc +1 -2
- data/src/core/lib/gpr/useful.h +79 -32
- data/src/core/lib/gprpp/arena.cc +2 -1
- data/src/core/lib/gprpp/arena.h +15 -5
- data/src/core/lib/gprpp/atomic_utils.h +47 -0
- data/src/core/lib/gprpp/bitset.h +188 -0
- data/src/core/lib/gprpp/chunked_vector.h +211 -0
- data/src/core/lib/{transport/authority_override.cc → gprpp/construct_destruct.h} +16 -17
- data/src/core/lib/gprpp/dual_ref_counted.h +25 -26
- data/src/core/lib/gprpp/fork.cc +14 -12
- data/src/core/lib/gprpp/fork.h +4 -4
- data/src/core/lib/gprpp/global_config.h +1 -2
- data/src/core/lib/gprpp/global_config_env.cc +7 -7
- data/src/core/lib/gprpp/global_config_generic.h +2 -2
- data/src/core/lib/gprpp/manual_constructor.h +8 -5
- data/src/core/lib/gprpp/match.h +73 -0
- data/src/core/lib/gprpp/memory.h +9 -3
- data/src/core/lib/gprpp/mpscq.cc +7 -7
- data/src/core/lib/gprpp/mpscq.h +6 -5
- data/src/core/lib/gprpp/orphanable.h +3 -3
- data/src/core/lib/gprpp/overload.h +59 -0
- data/src/core/lib/gprpp/ref_counted.h +18 -18
- data/src/core/lib/gprpp/status_helper.cc +27 -7
- data/src/core/lib/gprpp/status_helper.h +12 -1
- data/src/core/lib/gprpp/sync.h +3 -1
- data/src/core/lib/gprpp/table.h +411 -0
- data/src/core/lib/gprpp/thd_posix.cc +5 -5
- data/src/core/lib/gprpp/thd_windows.cc +4 -11
- data/src/core/lib/gprpp/time_util.cc +2 -2
- data/src/core/lib/gprpp/time_util.h +2 -2
- data/src/core/lib/http/format_request.cc +1 -0
- data/src/core/lib/http/format_request.h +1 -0
- data/src/core/lib/http/httpcli.cc +202 -184
- data/src/core/lib/http/httpcli.h +3 -0
- data/src/core/lib/http/httpcli_security_connector.cc +5 -8
- data/src/core/lib/http/parser.cc +2 -2
- data/src/core/lib/http/parser.h +1 -0
- data/src/core/lib/iomgr/buffer_list.cc +2 -1
- data/src/core/lib/iomgr/buffer_list.h +1 -2
- data/src/core/lib/iomgr/call_combiner.cc +29 -10
- data/src/core/lib/iomgr/cfstream_handle.cc +1 -1
- data/src/core/lib/iomgr/combiner.cc +9 -23
- data/src/core/lib/iomgr/combiner.h +1 -0
- data/src/core/lib/iomgr/dualstack_socket_posix.cc +1 -0
- data/src/core/lib/iomgr/endpoint.cc +0 -4
- data/src/core/lib/iomgr/endpoint.h +1 -3
- data/src/core/lib/iomgr/endpoint_cfstream.cc +16 -26
- data/src/core/lib/iomgr/endpoint_cfstream.h +1 -1
- data/src/core/lib/iomgr/endpoint_pair.h +1 -0
- data/src/core/lib/iomgr/endpoint_pair_event_engine.cc +1 -2
- data/src/core/lib/iomgr/endpoint_pair_posix.cc +15 -11
- data/src/core/lib/iomgr/endpoint_pair_windows.cc +17 -9
- data/src/core/lib/iomgr/error.cc +113 -52
- data/src/core/lib/iomgr/error.h +73 -18
- data/src/core/lib/iomgr/error_cfstream.cc +7 -2
- data/src/core/lib/iomgr/error_internal.h +1 -0
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +17 -24
- data/src/core/lib/iomgr/ev_epollex_linux.cc +22 -29
- data/src/core/lib/iomgr/ev_poll_posix.cc +42 -45
- data/src/core/lib/iomgr/ev_posix.cc +1 -2
- data/src/core/lib/iomgr/event_engine/closure.cc +41 -18
- data/src/core/lib/iomgr/event_engine/closure.h +10 -1
- data/src/core/lib/iomgr/event_engine/endpoint.cc +6 -25
- data/src/core/lib/iomgr/event_engine/endpoint.h +1 -2
- data/src/core/lib/iomgr/event_engine/iomgr.cc +18 -19
- data/src/core/lib/iomgr/event_engine/iomgr.h +20 -2
- data/src/core/lib/iomgr/event_engine/pollset.cc +5 -4
- data/src/core/lib/iomgr/event_engine/resolver.cc +12 -8
- data/src/core/lib/iomgr/event_engine/tcp.cc +60 -30
- data/src/core/lib/iomgr/event_engine/timer.cc +7 -2
- data/src/core/lib/iomgr/exec_ctx.cc +4 -13
- data/src/core/lib/iomgr/exec_ctx.h +11 -19
- data/src/core/lib/iomgr/executor/mpmcqueue.cc +15 -16
- data/src/core/lib/iomgr/executor/mpmcqueue.h +7 -11
- data/src/core/lib/iomgr/executor/threadpool.cc +2 -2
- data/src/core/lib/iomgr/executor/threadpool.h +2 -1
- data/src/core/lib/iomgr/executor.cc +11 -26
- data/src/core/lib/iomgr/grpc_if_nametoindex_posix.cc +2 -2
- data/src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc +2 -2
- data/src/core/lib/iomgr/internal_errqueue.cc +3 -2
- data/src/core/lib/iomgr/iocp_windows.cc +1 -0
- data/src/core/lib/iomgr/iomgr.cc +3 -1
- data/src/core/lib/iomgr/iomgr.h +2 -2
- data/src/core/lib/iomgr/iomgr_custom.cc +2 -2
- data/src/core/lib/iomgr/iomgr_custom.h +2 -2
- data/src/core/lib/iomgr/iomgr_internal.cc +6 -10
- data/src/core/lib/iomgr/iomgr_internal.h +3 -2
- data/src/core/lib/iomgr/iomgr_windows.cc +1 -2
- data/src/core/lib/iomgr/is_epollexclusive_available.cc +4 -4
- data/src/core/lib/iomgr/load_file.cc +2 -2
- data/src/core/lib/iomgr/lockfree_event.cc +18 -0
- data/src/core/lib/iomgr/polling_entity.cc +2 -2
- data/src/core/lib/iomgr/pollset_custom.cc +4 -5
- data/src/core/lib/iomgr/pollset_custom.h +3 -3
- data/src/core/lib/iomgr/pollset_set_custom.cc +1 -2
- data/src/core/lib/iomgr/pollset_set_windows.cc +1 -0
- data/src/core/lib/iomgr/port.h +0 -5
- data/src/core/lib/iomgr/python_util.h +1 -0
- data/src/core/lib/iomgr/resolve_address.cc +2 -1
- data/src/core/lib/iomgr/resolve_address.h +0 -4
- data/src/core/lib/iomgr/resolve_address_custom.cc +4 -4
- data/src/core/lib/iomgr/resolve_address_custom.h +0 -1
- data/src/core/lib/iomgr/resolve_address_posix.cc +7 -11
- data/src/core/lib/iomgr/resolve_address_windows.cc +6 -8
- data/src/core/lib/iomgr/resource_quota.cc +136 -49
- data/src/core/lib/iomgr/resource_quota.h +66 -17
- data/src/core/lib/iomgr/sockaddr.h +1 -1
- data/src/core/lib/iomgr/socket_factory_posix.cc +5 -5
- data/src/core/lib/iomgr/socket_factory_posix.h +1 -0
- data/src/core/lib/iomgr/socket_mutator.cc +2 -2
- data/src/core/lib/iomgr/socket_mutator.h +2 -2
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +4 -5
- data/src/core/lib/iomgr/socket_utils_linux.cc +4 -4
- data/src/core/lib/iomgr/socket_utils_posix.cc +2 -2
- data/src/core/lib/iomgr/socket_utils_posix.h +2 -2
- data/src/core/lib/iomgr/socket_utils_windows.cc +2 -2
- data/src/core/lib/iomgr/tcp_client.cc +4 -2
- data/src/core/lib/iomgr/tcp_client.h +4 -0
- data/src/core/lib/iomgr/tcp_client_cfstream.cc +14 -22
- data/src/core/lib/iomgr/tcp_client_custom.cc +10 -18
- data/src/core/lib/iomgr/tcp_client_posix.cc +33 -27
- data/src/core/lib/iomgr/tcp_client_posix.h +5 -2
- data/src/core/lib/iomgr/tcp_client_windows.cc +16 -9
- data/src/core/lib/iomgr/tcp_custom.cc +11 -23
- data/src/core/lib/iomgr/tcp_custom.h +2 -1
- data/src/core/lib/iomgr/tcp_posix.cc +33 -64
- data/src/core/lib/iomgr/tcp_posix.h +11 -12
- data/src/core/lib/iomgr/tcp_server.cc +6 -4
- data/src/core/lib/iomgr/tcp_server.h +12 -9
- data/src/core/lib/iomgr/tcp_server_custom.cc +17 -34
- data/src/core/lib/iomgr/tcp_server_posix.cc +23 -17
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +3 -0
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +1 -2
- data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +3 -4
- data/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc +4 -4
- data/src/core/lib/iomgr/tcp_server_windows.cc +17 -14
- data/src/core/lib/iomgr/tcp_windows.cc +8 -27
- data/src/core/lib/iomgr/tcp_windows.h +2 -1
- data/src/core/lib/iomgr/timer.cc +1 -0
- data/src/core/lib/iomgr/timer.h +1 -2
- data/src/core/lib/iomgr/timer_custom.cc +2 -2
- data/src/core/lib/iomgr/timer_generic.cc +21 -51
- data/src/core/lib/iomgr/timer_generic.h +1 -0
- data/src/core/lib/iomgr/timer_heap.cc +2 -3
- data/src/core/lib/iomgr/unix_sockets_posix.cc +3 -5
- data/src/core/lib/iomgr/unix_sockets_posix.h +2 -3
- data/src/core/lib/iomgr/wakeup_fd_nospecial.cc +1 -0
- data/src/core/lib/iomgr/wakeup_fd_pipe.cc +2 -3
- data/src/core/lib/iomgr/wakeup_fd_posix.cc +1 -0
- data/src/core/lib/iomgr/work_serializer.cc +4 -4
- data/src/core/lib/iomgr/work_serializer.h +1 -1
- data/src/core/lib/json/json_reader.cc +9 -17
- data/src/core/lib/json/json_util.cc +68 -0
- data/src/core/lib/json/json_util.h +65 -115
- data/src/core/lib/json/json_writer.cc +0 -3
- data/src/core/lib/matchers/matchers.h +0 -1
- data/src/core/lib/profiling/basic_timers.cc +8 -6
- data/src/core/lib/profiling/stap_timers.cc +2 -2
- data/src/core/lib/security/authorization/authorization_policy_provider.h +5 -4
- data/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc +1 -1
- data/src/core/lib/security/authorization/evaluate_args.cc +16 -12
- data/src/core/lib/security/authorization/sdk_server_authz_filter.cc +171 -0
- data/src/core/lib/security/authorization/sdk_server_authz_filter.h +67 -0
- data/src/core/lib/security/context/security_context.cc +11 -8
- data/src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc +2 -2
- data/src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc +2 -2
- data/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc +2 -2
- data/src/core/lib/security/credentials/composite/composite_credentials.cc +5 -4
- data/src/core/lib/security/credentials/credentials.cc +10 -8
- data/src/core/lib/security/credentials/credentials.h +7 -2
- data/src/core/lib/security/credentials/credentials_metadata.cc +2 -3
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +13 -26
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.h +1 -2
- data/src/core/lib/security/credentials/external/aws_request_signer.cc +3 -3
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +60 -33
- data/src/core/lib/security/credentials/external/external_account_credentials.h +1 -0
- data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +2 -4
- data/src/core/lib/security/credentials/google_default/credentials_generic.cc +1 -2
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +56 -4
- data/src/core/lib/security/credentials/iam/iam_credentials.cc +2 -1
- data/src/core/lib/security/credentials/jwt/json_token.cc +1 -1
- data/src/core/lib/security/credentials/jwt/json_token.h +2 -1
- data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +31 -14
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +11 -3
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +5 -11
- data/src/core/lib/security/credentials/jwt/jwt_verifier.h +3 -3
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +3 -7
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +1 -0
- data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +4 -6
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +4 -4
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +0 -1
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc +3 -2
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h +10 -6
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +2 -1
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +7 -5
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +2 -2
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +6 -8
- data/src/core/lib/security/security_connector/load_system_roots_fallback.cc +1 -0
- data/src/core/lib/security/security_connector/load_system_roots_linux.cc +3 -3
- data/src/core/lib/security/security_connector/security_connector.cc +9 -4
- data/src/core/lib/security/security_connector/security_connector.h +1 -1
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +4 -7
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.h +1 -2
- data/src/core/lib/security/security_connector/ssl_utils.cc +3 -4
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +10 -14
- data/src/core/lib/security/security_connector/tls/tls_security_connector.h +0 -2
- data/src/core/lib/security/transport/auth_filters.h +1 -0
- data/src/core/lib/security/transport/client_auth_filter.cc +9 -11
- data/src/core/lib/security/transport/secure_endpoint.cc +4 -14
- data/src/core/lib/security/transport/secure_endpoint.h +1 -0
- data/src/core/lib/security/transport/security_handshaker.cc +78 -47
- data/src/core/lib/security/transport/security_handshaker.h +2 -1
- data/src/core/lib/security/transport/server_auth_filter.cc +3 -5
- data/src/core/lib/security/transport/tsi_error.cc +3 -5
- data/src/core/lib/security/util/json_util.cc +6 -8
- data/src/core/lib/slice/percent_encoding.cc +73 -30
- data/src/core/lib/slice/percent_encoding.h +29 -28
- data/src/core/lib/slice/slice.cc +14 -21
- data/src/core/lib/{gpr/tls_pthread.cc → slice/slice_api.cc} +15 -6
- data/src/core/lib/slice/slice_buffer.cc +6 -7
- data/src/core/lib/slice/slice_intern.cc +10 -16
- data/src/core/lib/slice/slice_internal.h +3 -246
- data/src/core/lib/slice/slice_refcount.cc +17 -0
- data/src/core/lib/slice/slice_refcount.h +121 -0
- data/src/core/lib/slice/slice_refcount_base.h +173 -0
- data/src/core/lib/slice/slice_split.cc +100 -0
- data/src/core/lib/slice/slice_split.h +40 -0
- data/src/core/lib/slice/slice_string_helpers.cc +0 -83
- data/src/core/lib/slice/slice_string_helpers.h +0 -11
- data/src/core/lib/slice/static_slice.cc +529 -0
- data/src/core/lib/slice/static_slice.h +331 -0
- data/src/core/lib/surface/api_trace.cc +2 -1
- data/src/core/lib/surface/api_trace.h +1 -0
- data/src/core/lib/surface/builtins.cc +49 -0
- data/src/core/{ext/filters/workarounds/workaround_cronet_compression_filter.h → lib/surface/builtins.h} +8 -9
- data/src/core/lib/surface/byte_buffer_reader.cc +1 -1
- data/src/core/lib/surface/call.cc +112 -128
- data/src/core/lib/surface/call.h +3 -9
- data/src/core/lib/surface/call_details.cc +2 -2
- data/src/core/lib/surface/call_log_batch.cc +2 -2
- data/src/core/lib/surface/channel.cc +41 -41
- data/src/core/lib/surface/channel.h +14 -11
- data/src/core/lib/surface/channel_init.cc +23 -76
- data/src/core/lib/surface/channel_init.h +52 -44
- data/src/core/lib/surface/channel_ping.cc +1 -2
- data/src/core/lib/surface/channel_stack_type.cc +2 -1
- data/src/core/lib/surface/completion_queue.cc +60 -69
- data/src/core/lib/surface/completion_queue_factory.cc +2 -1
- data/src/core/lib/surface/completion_queue_factory.h +1 -0
- data/src/core/lib/surface/event_string.cc +1 -0
- data/src/core/lib/surface/init.cc +4 -48
- data/src/core/lib/surface/init.h +0 -1
- data/src/core/lib/surface/init_secure.cc +36 -14
- data/src/core/lib/surface/lame_client.cc +24 -16
- data/src/core/lib/surface/lame_client.h +1 -1
- data/src/core/lib/surface/metadata_array.cc +2 -2
- data/src/core/lib/surface/server.cc +42 -50
- data/src/core/lib/surface/server.h +28 -23
- data/src/core/lib/surface/validate_metadata.cc +49 -18
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/bdp_estimator.cc +1 -1
- data/src/core/lib/transport/byte_stream.h +1 -0
- data/src/core/lib/transport/connectivity_state.cc +8 -5
- data/src/core/lib/transport/connectivity_state.h +2 -2
- data/src/core/lib/transport/error_utils.cc +43 -17
- data/src/core/lib/transport/error_utils.h +1 -1
- data/src/core/lib/transport/metadata.cc +41 -20
- data/src/core/lib/transport/metadata.h +15 -12
- data/src/core/lib/transport/metadata_batch.cc +39 -364
- data/src/core/lib/transport/metadata_batch.h +916 -67
- data/src/core/lib/transport/parsed_metadata.h +263 -0
- data/src/core/lib/transport/pid_controller.cc +4 -4
- data/src/core/lib/transport/static_metadata.cc +714 -846
- data/src/core/lib/transport/static_metadata.h +115 -379
- data/src/core/lib/transport/status_metadata.cc +1 -0
- data/src/core/lib/transport/transport.cc +4 -5
- data/src/core/lib/transport/transport_op_string.cc +40 -20
- data/src/core/plugin_registry/grpc_plugin_registry.cc +76 -41
- data/src/core/tsi/alts/crypt/aes_gcm.cc +6 -3
- data/src/core/tsi/alts/crypt/gsec.h +2 -3
- data/src/core/tsi/alts/frame_protector/alts_frame_protector.cc +13 -12
- data/src/core/tsi/alts/frame_protector/frame_handler.cc +10 -11
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +3 -4
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.h +2 -3
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +12 -2
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc +2 -2
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc +1 -1
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +2 -2
- data/src/core/tsi/fake_transport_security.cc +15 -7
- data/src/core/tsi/local_transport_security.cc +36 -73
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +20 -53
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +4 -3
- data/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc +2 -2
- data/src/core/tsi/ssl_transport_security.cc +21 -11
- data/src/core/tsi/ssl_transport_security.h +3 -1
- data/src/core/tsi/transport_security.cc +15 -3
- data/src/core/tsi/transport_security.h +16 -1
- data/src/core/tsi/transport_security_grpc.h +1 -0
- data/src/core/tsi/transport_security_interface.h +26 -0
- data/src/ruby/ext/grpc/extconf.rb +12 -9
- data/src/ruby/ext/grpc/rb_byte_buffer.c +2 -1
- data/src/ruby/ext/grpc/rb_call.c +5 -5
- data/src/ruby/ext/grpc/rb_call_credentials.c +5 -5
- data/src/ruby/ext/grpc/rb_channel.c +10 -8
- data/src/ruby/ext/grpc/rb_channel_args.c +2 -2
- data/src/ruby/ext/grpc/rb_channel_credentials.c +4 -4
- data/src/ruby/ext/grpc/rb_channel_credentials.h +1 -0
- data/src/ruby/ext/grpc/rb_completion_queue.c +3 -2
- data/src/ruby/ext/grpc/rb_compression_options.c +5 -4
- data/src/ruby/ext/grpc/rb_event_thread.c +4 -4
- data/src/ruby/ext/grpc/rb_grpc.c +5 -4
- data/src/ruby/ext/grpc/rb_grpc.h +1 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +4 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +6 -0
- data/src/ruby/ext/grpc/rb_server.c +6 -5
- data/src/ruby/ext/grpc/rb_server_credentials.c +3 -3
- data/src/ruby/ext/grpc/rb_server_credentials.h +1 -0
- data/src/ruby/ext/grpc/rb_xds_channel_credentials.c +8 -5
- data/src/ruby/ext/grpc/rb_xds_channel_credentials.h +3 -1
- data/src/ruby/ext/grpc/rb_xds_server_credentials.c +6 -5
- data/src/ruby/ext/grpc/rb_xds_server_credentials.h +3 -1
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/src/proto/grpc/testing/test_pb.rb +2 -2
- data/src/ruby/spec/client_server_spec.rb +1 -1
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.cc +4 -4
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.h +11 -6
- data/third_party/address_sorting/address_sorting_posix.c +1 -0
- data/third_party/boringssl-with-bazel/err_data.c +300 -292
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_bitstr.c +52 -47
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_bool.c +21 -22
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_d2i_fp.c +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_gentm.c +6 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_mbstr.c +16 -23
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_object.c +14 -7
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_print.c +19 -29
- data/third_party/boringssl-with-bazel/src/crypto/{x509 → asn1}/a_strex.c +269 -272
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_strnid.c +106 -153
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_time.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_type.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_utctm.c +1 -40
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_utf8.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_par.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/{x509 → asn1}/charmap.h +0 -0
- data/third_party/boringssl-with-bazel/src/crypto/asn1/{asn1_locl.h → internal.h} +58 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_dec.c +9 -9
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c +290 -199
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_fre.c +9 -9
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_new.c +10 -14
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_utl.c +2 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/time_support.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/base64/base64.c +11 -8
- data/third_party/boringssl-with-bazel/src/crypto/bio/bio_mem.c +1 -7
- data/third_party/boringssl-with-bazel/src/crypto/bio/connect.c +1 -5
- data/third_party/boringssl-with-bazel/src/crypto/bio/fd.c +0 -4
- data/third_party/boringssl-with-bazel/src/crypto/bio/file.c +1 -7
- data/third_party/boringssl-with-bazel/src/crypto/bio/pair.c +1 -6
- data/third_party/boringssl-with-bazel/src/crypto/bio/socket.c +3 -17
- data/third_party/boringssl-with-bazel/src/crypto/blake2/blake2.c +4 -6
- data/third_party/boringssl-with-bazel/src/crypto/bytestring/cbb.c +9 -0
- data/third_party/boringssl-with-bazel/src/crypto/bytestring/cbs.c +8 -0
- data/third_party/boringssl-with-bazel/src/crypto/chacha/chacha.c +38 -47
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/cipher_extra.c +45 -65
- data/third_party/boringssl-with-bazel/src/crypto/conf/conf.c +14 -3
- data/third_party/boringssl-with-bazel/src/crypto/digest_extra/digest_extra.c +6 -3
- data/third_party/boringssl-with-bazel/src/crypto/evp/scrypt.c +32 -34
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/div.c +26 -9
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/gcd_extra.c +3 -2
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/internal.h +5 -2
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/sqrt.c +5 -9
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/e_aes.c +10 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/des/des.c +10 -11
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/des/internal.h +1 -3
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/digest/digest.c +2 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/md4/md4.c +4 -7
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/md5/md5.c +4 -7
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/gcm_nohw.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/internal.h +5 -9
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/rand.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/urandom.c +4 -6
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa.c +24 -9
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa_impl.c +4 -2
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha1.c +35 -35
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha256.c +11 -10
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha512.c +10 -37
- data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +34 -0
- data/third_party/boringssl-with-bazel/src/crypto/hrss/hrss.c +219 -121
- data/third_party/boringssl-with-bazel/src/crypto/hrss/internal.h +9 -2
- data/third_party/boringssl-with-bazel/src/crypto/internal.h +62 -2
- data/third_party/boringssl-with-bazel/src/crypto/lhash/internal.h +253 -0
- data/third_party/boringssl-with-bazel/src/crypto/lhash/lhash.c +28 -23
- data/third_party/boringssl-with-bazel/src/crypto/mem.c +14 -9
- data/third_party/boringssl-with-bazel/src/crypto/obj/obj.c +7 -3
- data/third_party/boringssl-with-bazel/src/crypto/pem/pem_all.c +0 -9
- data/third_party/boringssl-with-bazel/src/crypto/pem/pem_info.c +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/pem/pem_lib.c +0 -8
- data/third_party/boringssl-with-bazel/src/crypto/pem/pem_pk8.c +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/pem/pem_pkey.c +0 -4
- data/third_party/boringssl-with-bazel/src/crypto/pkcs7/internal.h +16 -7
- data/third_party/boringssl-with-bazel/src/crypto/pkcs7/pkcs7.c +9 -4
- data/third_party/boringssl-with-bazel/src/crypto/pkcs7/pkcs7_x509.c +151 -12
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8_x509.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/pool/pool.c +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/deterministic.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/fuchsia.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/windows.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/siphash/siphash.c +6 -6
- data/third_party/boringssl-with-bazel/src/crypto/x509/a_verify.c +15 -11
- data/third_party/boringssl-with-bazel/src/crypto/x509/algorithm.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/by_dir.c +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/by_file.c +2 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/internal.h +225 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/name_print.c +246 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/rsa_pss.c +15 -4
- data/third_party/boringssl-with-bazel/src/crypto/x509/t_crl.c +10 -5
- data/third_party/boringssl-with-bazel/src/crypto/x509/t_x509.c +0 -179
- data/third_party/boringssl-with-bazel/src/crypto/x509/t_x509a.c +4 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_att.c +6 -23
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_ext.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_lu.c +1 -5
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_obj.c +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_v3.c +25 -22
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_vfy.c +11 -54
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_vpm.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509cset.c +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509name.c +2 -4
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_algor.c +1 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_all.c +0 -16
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_crl.c +9 -11
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_exten.c +2 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_name.c +23 -21
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_x509.c +12 -11
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/internal.h +16 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_cache.c +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_data.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_int.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_map.c +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_tree.c +4 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_akey.c +24 -5
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_alt.c +17 -8
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_bitst.c +3 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_conf.c +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_cpols.c +6 -6
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_crld.c +4 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_enum.c +5 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_lib.c +2 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_ncons.c +112 -55
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_pci.c +2 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_prn.c +14 -13
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_purp.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_utl.c +76 -31
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1.h +521 -296
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1t.h +2 -9
- data/third_party/boringssl-with-bazel/src/include/openssl/base.h +10 -5
- data/third_party/boringssl-with-bazel/src/include/openssl/bio.h +3 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/bn.h +3 -3
- data/third_party/boringssl-with-bazel/src/include/openssl/bytestring.h +9 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/cipher.h +8 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/conf.h +8 -5
- data/third_party/boringssl-with-bazel/src/include/openssl/digest.h +3 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +6 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/hkdf.h +4 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/hpke.h +25 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/hrss.h +14 -12
- data/third_party/boringssl-with-bazel/src/include/openssl/lhash.h +4 -205
- data/third_party/boringssl-with-bazel/src/include/openssl/mem.h +12 -3
- data/third_party/boringssl-with-bazel/src/include/openssl/obj.h +5 -4
- data/third_party/boringssl-with-bazel/src/include/openssl/pem.h +0 -20
- data/third_party/boringssl-with-bazel/src/include/openssl/pkcs7.h +12 -5
- data/third_party/boringssl-with-bazel/src/include/openssl/rsa.h +5 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/span.h +37 -15
- data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +81 -15
- data/third_party/boringssl-with-bazel/src/include/openssl/tls1.h +31 -32
- data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +713 -146
- data/third_party/boringssl-with-bazel/src/include/openssl/x509_vfy.h +16 -695
- data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +48 -13
- data/third_party/boringssl-with-bazel/src/ssl/d1_both.cc +9 -16
- data/third_party/boringssl-with-bazel/src/ssl/encrypted_client_hello.cc +310 -359
- data/third_party/boringssl-with-bazel/src/ssl/{t1_lib.cc → extensions.cc} +110 -159
- data/third_party/boringssl-with-bazel/src/ssl/handshake.cc +24 -13
- data/third_party/boringssl-with-bazel/src/ssl/handshake_client.cc +145 -142
- data/third_party/boringssl-with-bazel/src/ssl/handshake_server.cc +106 -99
- data/third_party/boringssl-with-bazel/src/ssl/internal.h +87 -48
- data/third_party/boringssl-with-bazel/src/ssl/s3_lib.cc +1 -2
- data/third_party/boringssl-with-bazel/src/ssl/ssl_cipher.cc +2 -2
- data/third_party/boringssl-with-bazel/src/ssl/ssl_key_share.cc +11 -5
- data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +2 -51
- data/third_party/boringssl-with-bazel/src/ssl/ssl_session.cc +121 -65
- data/third_party/boringssl-with-bazel/src/ssl/ssl_transcript.cc +6 -12
- data/third_party/boringssl-with-bazel/src/ssl/ssl_x509.cc +28 -23
- data/third_party/boringssl-with-bazel/src/ssl/tls13_both.cc +14 -27
- data/third_party/boringssl-with-bazel/src/ssl/tls13_client.cc +210 -212
- data/third_party/boringssl-with-bazel/src/ssl/tls13_enc.cc +30 -41
- data/third_party/boringssl-with-bazel/src/ssl/tls13_server.cc +48 -34
- data/third_party/re2/re2/compile.cc +91 -109
- data/third_party/re2/re2/dfa.cc +27 -39
- data/third_party/re2/re2/filtered_re2.cc +18 -2
- data/third_party/re2/re2/filtered_re2.h +10 -5
- data/third_party/re2/re2/nfa.cc +1 -1
- data/third_party/re2/re2/parse.cc +42 -23
- data/third_party/re2/re2/perl_groups.cc +34 -34
- data/third_party/re2/re2/prefilter.cc +3 -2
- data/third_party/re2/re2/prog.cc +182 -4
- data/third_party/re2/re2/prog.h +28 -9
- data/third_party/re2/re2/re2.cc +87 -118
- data/third_party/re2/re2/re2.h +156 -141
- data/third_party/re2/re2/regexp.cc +12 -5
- data/third_party/re2/re2/regexp.h +8 -2
- data/third_party/re2/re2/set.cc +31 -9
- data/third_party/re2/re2/set.h +9 -4
- data/third_party/re2/re2/simplify.cc +11 -3
- data/third_party/re2/re2/tostring.cc +1 -1
- data/third_party/re2/re2/walker-inl.h +1 -1
- data/third_party/re2/util/mutex.h +2 -2
- data/third_party/re2/util/pcre.h +3 -3
- data/third_party/upb/upb/decode.c +129 -60
- data/third_party/upb/upb/decode.h +32 -4
- data/third_party/upb/upb/decode_fast.c +513 -500
- data/third_party/upb/upb/decode_fast.h +27 -0
- data/third_party/upb/upb/{decode.int.h → decode_internal.h} +38 -8
- data/third_party/upb/upb/def.c +171 -181
- data/third_party/upb/upb/def.h +41 -19
- data/third_party/upb/upb/def.hpp +29 -0
- data/third_party/upb/upb/encode.c +49 -16
- data/third_party/upb/upb/encode.h +29 -2
- data/third_party/upb/upb/msg.c +169 -28
- data/third_party/upb/upb/msg.h +75 -580
- data/third_party/upb/upb/msg_internal.h +687 -0
- data/third_party/upb/upb/port_def.inc +85 -24
- data/third_party/upb/upb/port_undef.inc +38 -1
- data/third_party/upb/upb/reflection.c +29 -37
- data/third_party/upb/upb/reflection.h +36 -8
- data/third_party/upb/upb/reflection.hpp +37 -0
- data/third_party/upb/upb/table.c +211 -86
- data/third_party/upb/upb/{table.int.h → table_internal.h} +56 -180
- data/third_party/upb/upb/text_encode.c +32 -4
- data/third_party/upb/upb/text_encode.h +26 -0
- data/third_party/upb/upb/upb.c +59 -8
- data/third_party/upb/upb/upb.h +36 -6
- data/third_party/upb/upb/upb.hpp +24 -0
- data/third_party/upb/upb/upb_internal.h +58 -0
- metadata +102 -87
- data/include/grpc/event_engine/slice_allocator.h +0 -66
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc +0 -179
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc +0 -38
- data/src/core/ext/filters/client_channel/service_config_call_data.h +0 -126
- data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc +0 -211
- data/src/core/ext/filters/workarounds/workaround_utils.cc +0 -53
- data/src/core/ext/filters/workarounds/workaround_utils.h +0 -39
- data/src/core/ext/transport/chttp2/client/authority.cc +0 -42
- data/src/core/ext/transport/chttp2/client/authority.h +0 -36
- data/src/core/ext/transport/chttp2/transport/chttp2_slice_allocator.cc +0 -66
- data/src/core/ext/transport/chttp2/transport/chttp2_slice_allocator.h +0 -74
- data/src/core/ext/transport/chttp2/transport/hpack_table.cc +0 -243
- data/src/core/ext/transport/chttp2/transport/hpack_table.h +0 -148
- data/src/core/ext/transport/chttp2/transport/incoming_metadata.cc +0 -66
- data/src/core/ext/transport/chttp2/transport/incoming_metadata.h +0 -58
- data/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c +0 -58
- data/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h +0 -124
- data/src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c +0 -33
- data/src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h +0 -77
- data/src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c +0 -44
- data/src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h +0 -35
- data/src/core/lib/gpr/tls_gcc.h +0 -52
- data/src/core/lib/gpr/tls_msvc.h +0 -54
- data/src/core/lib/gpr/tls_pthread.h +0 -56
- data/src/core/lib/gpr/tls_stdcpp.h +0 -48
- data/src/core/lib/gprpp/atomic.h +0 -104
- data/src/core/lib/iomgr/endpoint_pair_uv.cc +0 -40
- data/src/core/lib/iomgr/iomgr_uv.cc +0 -43
- data/src/core/lib/iomgr/pollset_uv.cc +0 -95
- data/src/core/lib/iomgr/pollset_uv.h +0 -36
- data/src/core/lib/iomgr/sockaddr_custom.h +0 -54
- data/src/core/lib/iomgr/socket_utils_uv.cc +0 -49
- data/src/core/lib/iomgr/tcp_uv.cc +0 -421
- data/src/core/lib/iomgr/timer_uv.cc +0 -66
- data/src/core/lib/iomgr/udp_server.cc +0 -748
- data/src/core/lib/iomgr/udp_server.h +0 -103
- data/third_party/upb/third_party/wyhash/wyhash.h +0 -145
- data/third_party/upb/upb/upb.int.h +0 -29
@@ -16,6 +16,8 @@
|
|
16
16
|
|
17
17
|
#include <grpc/support/port_platform.h>
|
18
18
|
|
19
|
+
#include "src/core/ext/xds/xds_client.h"
|
20
|
+
|
19
21
|
#include <inttypes.h>
|
20
22
|
#include <limits.h>
|
21
23
|
#include <string.h>
|
@@ -31,11 +33,9 @@
|
|
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/service_config.h"
|
35
36
|
#include "src/core/ext/xds/xds_api.h"
|
36
37
|
#include "src/core/ext/xds/xds_bootstrap.h"
|
37
38
|
#include "src/core/ext/xds/xds_channel_args.h"
|
38
|
-
#include "src/core/ext/xds/xds_client.h"
|
39
39
|
#include "src/core/ext/xds/xds_client_stats.h"
|
40
40
|
#include "src/core/ext/xds/xds_http_filters.h"
|
41
41
|
#include "src/core/lib/address_utils/sockaddr_utils.h"
|
@@ -54,8 +54,8 @@
|
|
54
54
|
#include "src/core/lib/slice/slice_string_helpers.h"
|
55
55
|
#include "src/core/lib/surface/call.h"
|
56
56
|
#include "src/core/lib/surface/channel.h"
|
57
|
-
#include "src/core/lib/surface/channel_init.h"
|
58
57
|
#include "src/core/lib/transport/static_metadata.h"
|
58
|
+
#include "src/core/lib/uri/uri_parser.h"
|
59
59
|
|
60
60
|
#define GRPC_XDS_INITIAL_CONNECT_BACKOFF_SECONDS 1
|
61
61
|
#define GRPC_XDS_RECONNECT_BACKOFF_MULTIPLIER 1.6
|
@@ -71,6 +71,7 @@ TraceFlag grpc_xds_client_refcount_trace(false, "xds_client_refcount");
|
|
71
71
|
namespace {
|
72
72
|
|
73
73
|
Mutex* g_mu = nullptr;
|
74
|
+
|
74
75
|
const grpc_channel_args* g_channel_args ABSL_GUARDED_BY(*g_mu) = nullptr;
|
75
76
|
XdsClient* g_xds_client ABSL_GUARDED_BY(*g_mu) = nullptr;
|
76
77
|
char* g_fallback_bootstrap_config ABSL_GUARDED_BY(*g_mu) = nullptr;
|
@@ -87,7 +88,7 @@ template <typename T>
|
|
87
88
|
class XdsClient::ChannelState::RetryableCall
|
88
89
|
: public InternallyRefCounted<RetryableCall<T>> {
|
89
90
|
public:
|
90
|
-
explicit RetryableCall(
|
91
|
+
explicit RetryableCall(WeakRefCountedPtr<ChannelState> chand);
|
91
92
|
|
92
93
|
void Orphan() override;
|
93
94
|
|
@@ -108,7 +109,7 @@ class XdsClient::ChannelState::RetryableCall
|
|
108
109
|
// every time we start a new call. It's null during call retry backoff.
|
109
110
|
OrphanablePtr<T> calld_;
|
110
111
|
// The owning xds channel.
|
111
|
-
|
112
|
+
WeakRefCountedPtr<ChannelState> chand_;
|
112
113
|
|
113
114
|
// Retry state.
|
114
115
|
BackOff backoff_;
|
@@ -134,9 +135,11 @@ class XdsClient::ChannelState::AdsCallState
|
|
134
135
|
XdsClient* xds_client() const { return chand()->xds_client(); }
|
135
136
|
bool seen_response() const { return seen_response_; }
|
136
137
|
|
137
|
-
void SubscribeLocked(const std::string& type_url,
|
138
|
+
void SubscribeLocked(const std::string& type_url,
|
139
|
+
const XdsApi::ResourceName& resource)
|
138
140
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
139
|
-
void UnsubscribeLocked(const std::string& type_url,
|
141
|
+
void UnsubscribeLocked(const std::string& type_url,
|
142
|
+
const XdsApi::ResourceName& resource,
|
140
143
|
bool delay_unsubscription)
|
141
144
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
142
145
|
|
@@ -145,10 +148,11 @@ class XdsClient::ChannelState::AdsCallState
|
|
145
148
|
private:
|
146
149
|
class ResourceState : public InternallyRefCounted<ResourceState> {
|
147
150
|
public:
|
148
|
-
ResourceState(const std::string& type_url,
|
151
|
+
ResourceState(const std::string& type_url,
|
152
|
+
const XdsApi::ResourceName& resource,
|
149
153
|
bool sent_initial_request)
|
150
154
|
: type_url_(type_url),
|
151
|
-
|
155
|
+
resource_(resource),
|
152
156
|
sent_initial_request_(sent_initial_request) {
|
153
157
|
GRPC_CLOSURE_INIT(&timer_callback_, OnTimer, this,
|
154
158
|
grpc_schedule_on_exec_ctx);
|
@@ -193,38 +197,41 @@ class XdsClient::ChannelState::AdsCallState
|
|
193
197
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_) {
|
194
198
|
if (error == GRPC_ERROR_NONE && timer_pending_) {
|
195
199
|
timer_pending_ = false;
|
196
|
-
grpc_error_handle watcher_error =
|
197
|
-
absl::StrFormat(
|
200
|
+
grpc_error_handle watcher_error =
|
201
|
+
GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
|
198
202
|
"timeout obtaining resource {type=%s name=%s} from xds server",
|
199
|
-
type_url_,
|
200
|
-
.
|
203
|
+
type_url_,
|
204
|
+
XdsApi::ConstructFullResourceName(resource_.authority,
|
205
|
+
type_url_, resource_.id)));
|
201
206
|
watcher_error = grpc_error_set_int(
|
202
207
|
watcher_error, GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
|
203
208
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
204
209
|
gpr_log(GPR_INFO, "[xds_client %p] %s", ads_calld_->xds_client(),
|
205
210
|
grpc_error_std_string(watcher_error).c_str());
|
206
211
|
}
|
212
|
+
auto& authority_state =
|
213
|
+
ads_calld_->xds_client()->authority_state_map_[resource_.authority];
|
207
214
|
if (type_url_ == XdsApi::kLdsTypeUrl) {
|
208
|
-
ListenerState& state =
|
215
|
+
ListenerState& state = authority_state.listener_map[resource_.id];
|
209
216
|
state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
|
210
217
|
for (const auto& p : state.watchers) {
|
211
218
|
p.first->OnError(GRPC_ERROR_REF(watcher_error));
|
212
219
|
}
|
213
220
|
} else if (type_url_ == XdsApi::kRdsTypeUrl) {
|
214
221
|
RouteConfigState& state =
|
215
|
-
|
222
|
+
authority_state.route_config_map[resource_.id];
|
216
223
|
state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
|
217
224
|
for (const auto& p : state.watchers) {
|
218
225
|
p.first->OnError(GRPC_ERROR_REF(watcher_error));
|
219
226
|
}
|
220
227
|
} else if (type_url_ == XdsApi::kCdsTypeUrl) {
|
221
|
-
ClusterState& state =
|
228
|
+
ClusterState& state = authority_state.cluster_map[resource_.id];
|
222
229
|
state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
|
223
230
|
for (const auto& p : state.watchers) {
|
224
231
|
p.first->OnError(GRPC_ERROR_REF(watcher_error));
|
225
232
|
}
|
226
233
|
} else if (type_url_ == XdsApi::kEdsTypeUrl) {
|
227
|
-
EndpointState& state =
|
234
|
+
EndpointState& state = authority_state.endpoint_map[resource_.id];
|
228
235
|
state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
|
229
236
|
for (const auto& p : state.watchers) {
|
230
237
|
p.first->OnError(GRPC_ERROR_REF(watcher_error));
|
@@ -238,7 +245,7 @@ class XdsClient::ChannelState::AdsCallState
|
|
238
245
|
}
|
239
246
|
|
240
247
|
const std::string type_url_;
|
241
|
-
const
|
248
|
+
const XdsApi::ResourceName resource_;
|
242
249
|
|
243
250
|
RefCountedPtr<AdsCallState> ads_calld_;
|
244
251
|
bool sent_initial_request_;
|
@@ -255,30 +262,41 @@ class XdsClient::ChannelState::AdsCallState
|
|
255
262
|
grpc_error_handle error = GRPC_ERROR_NONE;
|
256
263
|
|
257
264
|
// Subscribed resources of this type.
|
258
|
-
std::map<std::string /*
|
265
|
+
std::map<std::string /*authority*/,
|
266
|
+
std::map<std::string /*name*/, OrphanablePtr<ResourceState>>>
|
259
267
|
subscribed_resources;
|
260
268
|
};
|
261
269
|
|
262
270
|
void SendMessageLocked(const std::string& type_url)
|
263
271
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
264
272
|
|
265
|
-
void AcceptLdsUpdateLocked(
|
266
|
-
|
273
|
+
void AcceptLdsUpdateLocked(
|
274
|
+
std::string version, grpc_millis update_time,
|
275
|
+
XdsApi::LdsUpdateMap lds_update_map,
|
276
|
+
const std::set<XdsApi::ResourceName>& resource_names_failed)
|
267
277
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
268
278
|
void AcceptRdsUpdateLocked(std::string version, grpc_millis update_time,
|
269
279
|
XdsApi::RdsUpdateMap rds_update_map)
|
270
280
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
271
|
-
void AcceptCdsUpdateLocked(
|
272
|
-
|
281
|
+
void AcceptCdsUpdateLocked(
|
282
|
+
std::string version, grpc_millis update_time,
|
283
|
+
XdsApi::CdsUpdateMap cds_update_map,
|
284
|
+
const std::set<XdsApi::ResourceName>& resource_names_failed)
|
273
285
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
274
286
|
void AcceptEdsUpdateLocked(std::string version, grpc_millis update_time,
|
275
287
|
XdsApi::EdsUpdateMap eds_update_map)
|
276
288
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
277
289
|
|
278
290
|
template <typename StateMap>
|
291
|
+
void RejectAdsUpdateHelperLocked(const std::string& resource_name,
|
292
|
+
grpc_millis update_time,
|
293
|
+
const XdsApi::AdsParseResult& result,
|
294
|
+
const std::string& error_details,
|
295
|
+
StateMap* state_map)
|
296
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
297
|
+
|
279
298
|
void RejectAdsUpdateLocked(grpc_millis update_time,
|
280
|
-
const XdsApi::AdsParseResult& result
|
281
|
-
StateMap* state_map)
|
299
|
+
const XdsApi::AdsParseResult& result)
|
282
300
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
283
301
|
|
284
302
|
static void OnRequestSent(void* arg, grpc_error_handle error);
|
@@ -293,8 +311,9 @@ class XdsClient::ChannelState::AdsCallState
|
|
293
311
|
|
294
312
|
bool IsCurrentCallOnChannel() const;
|
295
313
|
|
296
|
-
std::
|
297
|
-
|
314
|
+
std::map<absl::string_view /*authority*/,
|
315
|
+
std::set<absl::string_view /*name*/>>
|
316
|
+
ResourceNamesForRequest(const std::string& type_url);
|
298
317
|
|
299
318
|
// The owning RetryableCall<>.
|
300
319
|
RefCountedPtr<RetryableCall<AdsCallState>> parent_;
|
@@ -439,7 +458,7 @@ class XdsClient::ChannelState::LrsCallState
|
|
439
458
|
class XdsClient::ChannelState::StateWatcher
|
440
459
|
: public AsyncConnectivityStateWatcherInterface {
|
441
460
|
public:
|
442
|
-
explicit StateWatcher(
|
461
|
+
explicit StateWatcher(WeakRefCountedPtr<ChannelState> parent)
|
443
462
|
: parent_(std::move(parent)) {}
|
444
463
|
|
445
464
|
private:
|
@@ -459,7 +478,7 @@ class XdsClient::ChannelState::StateWatcher
|
|
459
478
|
}
|
460
479
|
}
|
461
480
|
|
462
|
-
|
481
|
+
WeakRefCountedPtr<ChannelState> parent_;
|
463
482
|
};
|
464
483
|
|
465
484
|
//
|
@@ -481,7 +500,7 @@ grpc_channel* CreateXdsChannel(grpc_channel_args* args,
|
|
481
500
|
|
482
501
|
XdsClient::ChannelState::ChannelState(WeakRefCountedPtr<XdsClient> xds_client,
|
483
502
|
const XdsBootstrap::XdsServer& server)
|
484
|
-
:
|
503
|
+
: DualRefCounted<ChannelState>(
|
485
504
|
GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace)
|
486
505
|
? "ChannelState"
|
487
506
|
: nullptr),
|
@@ -505,12 +524,19 @@ XdsClient::ChannelState::~ChannelState() {
|
|
505
524
|
xds_client_.reset(DEBUG_LOCATION, "ChannelState");
|
506
525
|
}
|
507
526
|
|
508
|
-
|
527
|
+
// This method should only ever be called when holding the lock, but we can't
|
528
|
+
// use a ABSL_EXCLUSIVE_LOCKS_REQUIRED annotation, because Orphan() will be
|
529
|
+
// called from DualRefCounted::Unref, which cannot have a lock annotation for a
|
530
|
+
// lock in this subclass.
|
531
|
+
void XdsClient::ChannelState::Orphan() ABSL_NO_THREAD_SAFETY_ANALYSIS {
|
509
532
|
shutting_down_ = true;
|
510
533
|
CancelConnectivityWatchLocked();
|
534
|
+
// At this time, all strong refs are removed, remove from channel map to
|
535
|
+
// prevent subsequent subscription from trying to use this ChannelState as it
|
536
|
+
// is shutting down.
|
537
|
+
xds_client_->xds_server_channel_map_.erase(server_);
|
511
538
|
ads_calld_.reset();
|
512
539
|
lrs_calld_.reset();
|
513
|
-
Unref(DEBUG_LOCATION, "ChannelState+orphaned");
|
514
540
|
}
|
515
541
|
|
516
542
|
XdsClient::ChannelState::AdsCallState* XdsClient::ChannelState::ads_calld()
|
@@ -529,8 +555,8 @@ bool XdsClient::ChannelState::HasActiveAdsCall() const {
|
|
529
555
|
|
530
556
|
void XdsClient::ChannelState::MaybeStartLrsCall() {
|
531
557
|
if (lrs_calld_ != nullptr) return;
|
532
|
-
lrs_calld_.reset(
|
533
|
-
|
558
|
+
lrs_calld_.reset(new RetryableCall<LrsCallState>(
|
559
|
+
WeakRef(DEBUG_LOCATION, "ChannelState+lrs")));
|
534
560
|
}
|
535
561
|
|
536
562
|
void XdsClient::ChannelState::StopLrsCall() { lrs_calld_.reset(); }
|
@@ -538,7 +564,7 @@ void XdsClient::ChannelState::StopLrsCall() { lrs_calld_.reset(); }
|
|
538
564
|
void XdsClient::ChannelState::StartConnectivityWatchLocked() {
|
539
565
|
ClientChannel* client_channel = ClientChannel::GetFromChannel(channel_);
|
540
566
|
GPR_ASSERT(client_channel != nullptr);
|
541
|
-
watcher_ = new StateWatcher(
|
567
|
+
watcher_ = new StateWatcher(WeakRef(DEBUG_LOCATION, "ChannelState+watch"));
|
542
568
|
client_channel->AddConnectivityWatcher(
|
543
569
|
GRPC_CHANNEL_IDLE,
|
544
570
|
OrphanablePtr<AsyncConnectivityStateWatcherInterface>(watcher_));
|
@@ -550,12 +576,12 @@ void XdsClient::ChannelState::CancelConnectivityWatchLocked() {
|
|
550
576
|
client_channel->RemoveConnectivityWatcher(watcher_);
|
551
577
|
}
|
552
578
|
|
553
|
-
void XdsClient::ChannelState::SubscribeLocked(
|
554
|
-
|
579
|
+
void XdsClient::ChannelState::SubscribeLocked(
|
580
|
+
const std::string& type_url, const XdsApi::ResourceName& resource) {
|
555
581
|
if (ads_calld_ == nullptr) {
|
556
582
|
// Start the ADS call if this is the first request.
|
557
583
|
ads_calld_.reset(new RetryableCall<AdsCallState>(
|
558
|
-
|
584
|
+
WeakRef(DEBUG_LOCATION, "ChannelState+ads")));
|
559
585
|
// Note: AdsCallState's ctor will automatically subscribe to all
|
560
586
|
// resources that the XdsClient already has watchers for, so we can
|
561
587
|
// return here.
|
@@ -565,17 +591,19 @@ void XdsClient::ChannelState::SubscribeLocked(const std::string& type_url,
|
|
565
591
|
// because when the call is restarted it will resend all necessary requests.
|
566
592
|
if (ads_calld() == nullptr) return;
|
567
593
|
// Subscribe to this resource if the ADS call is active.
|
568
|
-
ads_calld()->SubscribeLocked(type_url,
|
594
|
+
ads_calld()->SubscribeLocked(type_url, resource);
|
569
595
|
}
|
570
596
|
|
571
|
-
void XdsClient::ChannelState::UnsubscribeLocked(
|
572
|
-
|
573
|
-
|
597
|
+
void XdsClient::ChannelState::UnsubscribeLocked(
|
598
|
+
const std::string& type_url, const XdsApi::ResourceName& resource,
|
599
|
+
bool delay_unsubscription) {
|
574
600
|
if (ads_calld_ != nullptr) {
|
575
601
|
auto* calld = ads_calld_->calld();
|
576
602
|
if (calld != nullptr) {
|
577
|
-
calld->UnsubscribeLocked(type_url,
|
578
|
-
if (!calld->HasSubscribedResources())
|
603
|
+
calld->UnsubscribeLocked(type_url, resource, delay_unsubscription);
|
604
|
+
if (!calld->HasSubscribedResources()) {
|
605
|
+
ads_calld_.reset();
|
606
|
+
}
|
579
607
|
}
|
580
608
|
}
|
581
609
|
}
|
@@ -586,7 +614,7 @@ void XdsClient::ChannelState::UnsubscribeLocked(const std::string& type_url,
|
|
586
614
|
|
587
615
|
template <typename T>
|
588
616
|
XdsClient::ChannelState::RetryableCall<T>::RetryableCall(
|
589
|
-
|
617
|
+
WeakRefCountedPtr<ChannelState> chand)
|
590
618
|
: chand_(std::move(chand)),
|
591
619
|
backoff_(
|
592
620
|
BackOff::Options()
|
@@ -644,7 +672,8 @@ void XdsClient::ChannelState::RetryableCall<T>::StartRetryTimerLocked() {
|
|
644
672
|
if (shutting_down_) return;
|
645
673
|
const grpc_millis next_attempt_time = backoff_.NextAttemptTime();
|
646
674
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
647
|
-
grpc_millis timeout =
|
675
|
+
grpc_millis timeout =
|
676
|
+
std::max(next_attempt_time - ExecCtx::Get()->Now(), grpc_millis(0));
|
648
677
|
gpr_log(GPR_INFO,
|
649
678
|
"[xds_client %p] Failed to connect to xds server (chand: %p) "
|
650
679
|
"retry timer will fire in %" PRId64 "ms.",
|
@@ -735,17 +764,26 @@ XdsClient::ChannelState::AdsCallState::AdsCallState(
|
|
735
764
|
// Op: send request message.
|
736
765
|
GRPC_CLOSURE_INIT(&on_request_sent_, OnRequestSent, this,
|
737
766
|
grpc_schedule_on_exec_ctx);
|
738
|
-
for (const auto&
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
767
|
+
for (const auto& a : xds_client()->authority_state_map_) {
|
768
|
+
const std::string& authority = a.first;
|
769
|
+
// Skip authorities that are not using this xDS channel.
|
770
|
+
if (a.second.channel_state != chand()) continue;
|
771
|
+
for (const auto& l : a.second.listener_map) {
|
772
|
+
const std::string& listener_name = l.first;
|
773
|
+
SubscribeLocked(XdsApi::kLdsTypeUrl, {authority, listener_name});
|
774
|
+
}
|
775
|
+
for (const auto& r : a.second.route_config_map) {
|
776
|
+
const std::string& route_config_name = r.first;
|
777
|
+
SubscribeLocked(XdsApi::kRdsTypeUrl, {authority, route_config_name});
|
778
|
+
}
|
779
|
+
for (const auto& c : a.second.cluster_map) {
|
780
|
+
const std::string& cluster_name = c.first;
|
781
|
+
SubscribeLocked(XdsApi::kCdsTypeUrl, {authority, cluster_name});
|
782
|
+
}
|
783
|
+
for (const auto& e : a.second.endpoint_map) {
|
784
|
+
const std::string& endpoint_name = e.first;
|
785
|
+
SubscribeLocked(XdsApi::kEdsTypeUrl, {authority, endpoint_name});
|
786
|
+
}
|
749
787
|
}
|
750
788
|
// Op: recv initial metadata.
|
751
789
|
op = ops;
|
@@ -818,11 +856,12 @@ void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
|
|
818
856
|
}
|
819
857
|
auto& state = state_map_[type_url];
|
820
858
|
grpc_slice request_payload_slice;
|
821
|
-
std::
|
822
|
-
|
859
|
+
std::map<absl::string_view /*authority*/,
|
860
|
+
std::set<absl::string_view /*name*/>>
|
861
|
+
resource_map = ResourceNamesForRequest(type_url);
|
823
862
|
request_payload_slice = xds_client()->api_.CreateAdsRequest(
|
824
|
-
chand()->server_, type_url,
|
825
|
-
|
863
|
+
chand()->server_, type_url, resource_map,
|
864
|
+
chand()->resource_type_version_map_[type_url], state.nonce,
|
826
865
|
GRPC_ERROR_REF(state.error), !sent_initial_message_);
|
827
866
|
if (type_url != XdsApi::kLdsTypeUrl && type_url != XdsApi::kRdsTypeUrl &&
|
828
867
|
type_url != XdsApi::kCdsTypeUrl && type_url != XdsApi::kEdsTypeUrl) {
|
@@ -832,11 +871,10 @@ void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
|
|
832
871
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
833
872
|
gpr_log(GPR_INFO,
|
834
873
|
"[xds_client %p] sending ADS request: type=%s version=%s nonce=%s "
|
835
|
-
"error=%s
|
874
|
+
"error=%s",
|
836
875
|
xds_client(), type_url.c_str(),
|
837
|
-
|
838
|
-
state.nonce.c_str(), grpc_error_std_string(state.error).c_str()
|
839
|
-
absl::StrJoin(resource_names, " ").c_str());
|
876
|
+
chand()->resource_type_version_map_[type_url].c_str(),
|
877
|
+
state.nonce.c_str(), grpc_error_std_string(state.error).c_str());
|
840
878
|
}
|
841
879
|
GRPC_ERROR_UNREF(state.error);
|
842
880
|
state.error = GRPC_ERROR_NONE;
|
@@ -863,19 +901,26 @@ void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
|
|
863
901
|
}
|
864
902
|
|
865
903
|
void XdsClient::ChannelState::AdsCallState::SubscribeLocked(
|
866
|
-
const std::string& type_url, const
|
867
|
-
auto& state = state_map_[type_url]
|
904
|
+
const std::string& type_url, const XdsApi::ResourceName& resource) {
|
905
|
+
auto& state = state_map_[type_url]
|
906
|
+
.subscribed_resources[resource.authority][resource.id];
|
868
907
|
if (state == nullptr) {
|
869
908
|
state = MakeOrphanable<ResourceState>(
|
870
|
-
type_url,
|
909
|
+
type_url, resource,
|
910
|
+
!chand()->resource_type_version_map_[type_url].empty());
|
871
911
|
SendMessageLocked(type_url);
|
872
912
|
}
|
873
913
|
}
|
874
914
|
|
875
915
|
void XdsClient::ChannelState::AdsCallState::UnsubscribeLocked(
|
876
|
-
const std::string& type_url, const
|
916
|
+
const std::string& type_url, const XdsApi::ResourceName& resource,
|
877
917
|
bool delay_unsubscription) {
|
878
|
-
state_map_[type_url]
|
918
|
+
auto& type_state_map = state_map_[type_url];
|
919
|
+
auto& authority_map = type_state_map.subscribed_resources[resource.authority];
|
920
|
+
authority_map.erase(resource.id);
|
921
|
+
if (authority_map.empty()) {
|
922
|
+
type_state_map.subscribed_resources.erase(resource.authority);
|
923
|
+
}
|
879
924
|
if (!delay_unsubscription) SendMessageLocked(type_url);
|
880
925
|
}
|
881
926
|
|
@@ -904,7 +949,8 @@ XdsApi::ResourceMetadata CreateResourceMetadataAcked(
|
|
904
949
|
|
905
950
|
void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdateLocked(
|
906
951
|
std::string version, grpc_millis update_time,
|
907
|
-
XdsApi::LdsUpdateMap lds_update_map
|
952
|
+
XdsApi::LdsUpdateMap lds_update_map,
|
953
|
+
const std::set<XdsApi::ResourceName>& resource_names_failed) {
|
908
954
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
909
955
|
gpr_log(GPR_INFO,
|
910
956
|
"[xds_client %p] LDS update received containing %" PRIuPTR
|
@@ -914,28 +960,38 @@ void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdateLocked(
|
|
914
960
|
auto& lds_state = state_map_[XdsApi::kLdsTypeUrl];
|
915
961
|
std::set<std::string> rds_resource_names_seen;
|
916
962
|
for (auto& p : lds_update_map) {
|
917
|
-
const
|
963
|
+
const XdsApi::ResourceName& resource = p.first;
|
918
964
|
XdsApi::LdsUpdate& lds_update = p.second.resource;
|
919
|
-
auto& state =
|
965
|
+
auto& state =
|
966
|
+
lds_state.subscribed_resources[resource.authority][resource.id];
|
920
967
|
if (state != nullptr) state->Finish();
|
921
968
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
922
969
|
gpr_log(GPR_INFO, "[xds_client %p] LDS resource %s: %s", xds_client(),
|
923
|
-
|
970
|
+
XdsApi::ConstructFullResourceName(
|
971
|
+
resource.authority, XdsApi::kLdsTypeUrl, resource.id)
|
972
|
+
.c_str(),
|
973
|
+
lds_update.ToString().c_str());
|
924
974
|
}
|
925
975
|
// Record the RDS resource names seen.
|
926
976
|
if (!lds_update.http_connection_manager.route_config_name.empty()) {
|
927
977
|
rds_resource_names_seen.insert(
|
928
978
|
lds_update.http_connection_manager.route_config_name);
|
929
979
|
}
|
980
|
+
ListenerState& listener_state =
|
981
|
+
xds_client()
|
982
|
+
->authority_state_map_[resource.authority]
|
983
|
+
.listener_map[resource.id];
|
930
984
|
// Ignore identical update.
|
931
|
-
ListenerState& listener_state = xds_client()->listener_map_[listener_name];
|
932
985
|
if (listener_state.update.has_value() &&
|
933
986
|
*listener_state.update == lds_update) {
|
934
987
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
935
988
|
gpr_log(GPR_INFO,
|
936
989
|
"[xds_client %p] LDS update for %s identical to current, "
|
937
990
|
"ignoring.",
|
938
|
-
xds_client(),
|
991
|
+
xds_client(),
|
992
|
+
XdsApi::ConstructFullResourceName(
|
993
|
+
resource.authority, XdsApi::kLdsTypeUrl, resource.id)
|
994
|
+
.c_str());
|
939
995
|
}
|
940
996
|
continue;
|
941
997
|
}
|
@@ -948,23 +1004,46 @@ void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdateLocked(
|
|
948
1004
|
p.first->OnListenerChanged(*listener_state.update);
|
949
1005
|
}
|
950
1006
|
}
|
1007
|
+
// For invalid resources in the update, if they are already in the
|
1008
|
+
// cache, pretend that they are present in the update, so that we
|
1009
|
+
// don't incorrectly consider them deleted below.
|
1010
|
+
for (const auto& resource : resource_names_failed) {
|
1011
|
+
auto& listener_map =
|
1012
|
+
xds_client()->authority_state_map_[resource.authority].listener_map;
|
1013
|
+
auto it = listener_map.find(resource.id);
|
1014
|
+
if (it != listener_map.end()) {
|
1015
|
+
auto& update = it->second.update;
|
1016
|
+
if (!update.has_value()) continue;
|
1017
|
+
lds_update_map[resource];
|
1018
|
+
if (!update->http_connection_manager.route_config_name.empty()) {
|
1019
|
+
rds_resource_names_seen.insert(
|
1020
|
+
update->http_connection_manager.route_config_name);
|
1021
|
+
}
|
1022
|
+
}
|
1023
|
+
}
|
951
1024
|
// For any subscribed resource that is not present in the update,
|
952
1025
|
// remove it from the cache and notify watchers that it does not exist.
|
953
|
-
for (const auto&
|
954
|
-
const std::string&
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
1026
|
+
for (const auto& a : lds_state.subscribed_resources) {
|
1027
|
+
const std::string& authority_name = a.first;
|
1028
|
+
for (const auto& p : a.second) {
|
1029
|
+
const std::string& listener_name = p.first;
|
1030
|
+
if (lds_update_map.find({authority_name, listener_name}) ==
|
1031
|
+
lds_update_map.end()) {
|
1032
|
+
ListenerState& listener_state =
|
1033
|
+
xds_client()
|
1034
|
+
->authority_state_map_[authority_name]
|
1035
|
+
.listener_map[listener_name];
|
1036
|
+
// If the resource was newly requested but has not yet been received,
|
1037
|
+
// we don't want to generate an error for the watchers, because this LDS
|
1038
|
+
// response may be in reaction to an earlier request that did not yet
|
1039
|
+
// request the new resource, so its absence from the response does not
|
1040
|
+
// necessarily indicate that the resource does not exist.
|
1041
|
+
// For that case, we rely on the request timeout instead.
|
1042
|
+
if (!listener_state.update.has_value()) continue;
|
1043
|
+
listener_state.update.reset();
|
1044
|
+
for (const auto& p : listener_state.watchers) {
|
1045
|
+
p.first->OnResourceDoesNotExist();
|
1046
|
+
}
|
968
1047
|
}
|
969
1048
|
}
|
970
1049
|
}
|
@@ -972,15 +1051,21 @@ void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdateLocked(
|
|
972
1051
|
// resources, remove it from the cache and notify watchers that it
|
973
1052
|
// does not exist.
|
974
1053
|
auto& rds_state = state_map_[XdsApi::kRdsTypeUrl];
|
975
|
-
for (const auto&
|
976
|
-
const std::string&
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
1054
|
+
for (const auto& a : rds_state.subscribed_resources) {
|
1055
|
+
const std::string& authority_name = a.first;
|
1056
|
+
for (const auto& p : a.second) {
|
1057
|
+
const std::string& listener_name = p.first;
|
1058
|
+
if (rds_resource_names_seen.find(XdsApi::ConstructFullResourceName(
|
1059
|
+
authority_name, XdsApi::kRdsTypeUrl, listener_name)) ==
|
1060
|
+
rds_resource_names_seen.end()) {
|
1061
|
+
RouteConfigState& route_config_state =
|
1062
|
+
xds_client()
|
1063
|
+
->authority_state_map_[authority_name]
|
1064
|
+
.route_config_map[listener_name];
|
1065
|
+
route_config_state.update.reset();
|
1066
|
+
for (const auto& p : route_config_state.watchers) {
|
1067
|
+
p.first->OnResourceDoesNotExist();
|
1068
|
+
}
|
984
1069
|
}
|
985
1070
|
}
|
986
1071
|
}
|
@@ -997,16 +1082,19 @@ void XdsClient::ChannelState::AdsCallState::AcceptRdsUpdateLocked(
|
|
997
1082
|
}
|
998
1083
|
auto& rds_state = state_map_[XdsApi::kRdsTypeUrl];
|
999
1084
|
for (auto& p : rds_update_map) {
|
1000
|
-
const
|
1085
|
+
const XdsApi::ResourceName& resource = p.first;
|
1001
1086
|
XdsApi::RdsUpdate& rds_update = p.second.resource;
|
1002
|
-
auto& state =
|
1087
|
+
auto& state =
|
1088
|
+
rds_state.subscribed_resources[resource.authority][resource.id];
|
1003
1089
|
if (state != nullptr) state->Finish();
|
1004
1090
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1005
1091
|
gpr_log(GPR_INFO, "[xds_client %p] RDS resource:\n%s", xds_client(),
|
1006
1092
|
rds_update.ToString().c_str());
|
1007
1093
|
}
|
1008
1094
|
RouteConfigState& route_config_state =
|
1009
|
-
xds_client()
|
1095
|
+
xds_client()
|
1096
|
+
->authority_state_map_[resource.authority]
|
1097
|
+
.route_config_map[resource.id];
|
1010
1098
|
// Ignore identical update.
|
1011
1099
|
if (route_config_state.update.has_value() &&
|
1012
1100
|
*route_config_state.update == rds_update) {
|
@@ -1030,7 +1118,8 @@ void XdsClient::ChannelState::AdsCallState::AcceptRdsUpdateLocked(
|
|
1030
1118
|
|
1031
1119
|
void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdateLocked(
|
1032
1120
|
std::string version, grpc_millis update_time,
|
1033
|
-
XdsApi::CdsUpdateMap cds_update_map
|
1121
|
+
XdsApi::CdsUpdateMap cds_update_map,
|
1122
|
+
const std::set<XdsApi::ResourceName>& resource_names_failed) {
|
1034
1123
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1035
1124
|
gpr_log(GPR_INFO,
|
1036
1125
|
"[xds_client %p] CDS update received containing %" PRIuPTR
|
@@ -1040,20 +1129,28 @@ void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdateLocked(
|
|
1040
1129
|
auto& cds_state = state_map_[XdsApi::kCdsTypeUrl];
|
1041
1130
|
std::set<std::string> eds_resource_names_seen;
|
1042
1131
|
for (auto& p : cds_update_map) {
|
1043
|
-
const
|
1132
|
+
const XdsApi::ResourceName& resource = p.first;
|
1044
1133
|
XdsApi::CdsUpdate& cds_update = p.second.resource;
|
1045
|
-
auto& state =
|
1134
|
+
auto& state =
|
1135
|
+
cds_state.subscribed_resources[resource.authority][resource.id];
|
1046
1136
|
if (state != nullptr) state->Finish();
|
1047
1137
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1048
1138
|
gpr_log(GPR_INFO, "[xds_client %p] cluster=%s: %s", xds_client(),
|
1049
|
-
|
1139
|
+
XdsApi::ConstructFullResourceName(
|
1140
|
+
resource.authority, XdsApi::kCdsTypeUrl, resource.id)
|
1141
|
+
.c_str(),
|
1142
|
+
cds_update.ToString().c_str());
|
1050
1143
|
}
|
1051
1144
|
// Record the EDS resource names seen.
|
1052
|
-
eds_resource_names_seen.insert(
|
1053
|
-
|
1054
|
-
|
1145
|
+
eds_resource_names_seen.insert(
|
1146
|
+
cds_update.eds_service_name.empty()
|
1147
|
+
? XdsApi::ConstructFullResourceName(
|
1148
|
+
resource.authority, XdsApi::kCdsTypeUrl, resource.id)
|
1149
|
+
: cds_update.eds_service_name);
|
1150
|
+
ClusterState& cluster_state = xds_client()
|
1151
|
+
->authority_state_map_[resource.authority]
|
1152
|
+
.cluster_map[resource.id];
|
1055
1153
|
// Ignore identical update.
|
1056
|
-
ClusterState& cluster_state = xds_client()->cluster_map_[cluster_name];
|
1057
1154
|
if (cluster_state.update.has_value() &&
|
1058
1155
|
*cluster_state.update == cds_update) {
|
1059
1156
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
@@ -1072,22 +1169,46 @@ void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdateLocked(
|
|
1072
1169
|
p.first->OnClusterChanged(cluster_state.update.value());
|
1073
1170
|
}
|
1074
1171
|
}
|
1172
|
+
// For invalid resources in the update, if they are already in the
|
1173
|
+
// cache, pretend that they are present in the update, so that we
|
1174
|
+
// don't incorrectly consider them deleted below.
|
1175
|
+
for (const auto& resource : resource_names_failed) {
|
1176
|
+
auto& cluster_map =
|
1177
|
+
xds_client()->authority_state_map_[resource.authority].cluster_map;
|
1178
|
+
auto it = cluster_map.find(resource.id);
|
1179
|
+
if (it != cluster_map.end()) {
|
1180
|
+
auto& update = it->second.update;
|
1181
|
+
if (!update.has_value()) continue;
|
1182
|
+
cds_update_map[resource];
|
1183
|
+
eds_resource_names_seen.insert(
|
1184
|
+
update->eds_service_name.empty()
|
1185
|
+
? XdsApi::ConstructFullResourceName(
|
1186
|
+
resource.authority, XdsApi::kCdsTypeUrl, resource.id)
|
1187
|
+
: update->eds_service_name);
|
1188
|
+
}
|
1189
|
+
}
|
1075
1190
|
// For any subscribed resource that is not present in the update,
|
1076
1191
|
// remove it from the cache and notify watchers that it does not exist.
|
1077
|
-
for (const auto&
|
1078
|
-
const std::string&
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1192
|
+
for (const auto& a : cds_state.subscribed_resources) {
|
1193
|
+
const std::string& authority = a.first;
|
1194
|
+
for (const auto& p : a.second) {
|
1195
|
+
const std::string& cluster_name = p.first;
|
1196
|
+
if (cds_update_map.find({authority, cluster_name}) ==
|
1197
|
+
cds_update_map.end()) {
|
1198
|
+
ClusterState& cluster_state = xds_client()
|
1199
|
+
->authority_state_map_[authority]
|
1200
|
+
.cluster_map[cluster_name];
|
1201
|
+
// If the resource was newly requested but has not yet been received,
|
1202
|
+
// we don't want to generate an error for the watchers, because this CDS
|
1203
|
+
// response may be in reaction to an earlier request that did not yet
|
1204
|
+
// request the new resource, so its absence from the response does not
|
1205
|
+
// necessarily indicate that the resource does not exist.
|
1206
|
+
// For that case, we rely on the request timeout instead.
|
1207
|
+
if (!cluster_state.update.has_value()) continue;
|
1208
|
+
cluster_state.update.reset();
|
1209
|
+
for (const auto& p : cluster_state.watchers) {
|
1210
|
+
p.first->OnResourceDoesNotExist();
|
1211
|
+
}
|
1091
1212
|
}
|
1092
1213
|
}
|
1093
1214
|
}
|
@@ -1095,15 +1216,20 @@ void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdateLocked(
|
|
1095
1216
|
// resources, remove it from the cache and notify watchers that it
|
1096
1217
|
// does not exist.
|
1097
1218
|
auto& eds_state = state_map_[XdsApi::kEdsTypeUrl];
|
1098
|
-
for (const auto&
|
1099
|
-
const std::string&
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1219
|
+
for (const auto& a : eds_state.subscribed_resources) {
|
1220
|
+
const std::string& authority = a.first;
|
1221
|
+
for (const auto& p : a.second) {
|
1222
|
+
const std::string& eds_resource_name = p.first;
|
1223
|
+
if (eds_resource_names_seen.find(XdsApi::ConstructFullResourceName(
|
1224
|
+
authority, XdsApi::kEdsTypeUrl, eds_resource_name)) ==
|
1225
|
+
eds_resource_names_seen.end()) {
|
1226
|
+
EndpointState& endpoint_state = xds_client()
|
1227
|
+
->authority_state_map_[authority]
|
1228
|
+
.endpoint_map[eds_resource_name];
|
1229
|
+
endpoint_state.update.reset();
|
1230
|
+
for (const auto& p : endpoint_state.watchers) {
|
1231
|
+
p.first->OnResourceDoesNotExist();
|
1232
|
+
}
|
1107
1233
|
}
|
1108
1234
|
}
|
1109
1235
|
}
|
@@ -1120,16 +1246,22 @@ void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdateLocked(
|
|
1120
1246
|
}
|
1121
1247
|
auto& eds_state = state_map_[XdsApi::kEdsTypeUrl];
|
1122
1248
|
for (auto& p : eds_update_map) {
|
1123
|
-
const
|
1249
|
+
const XdsApi::ResourceName& resource = p.first;
|
1124
1250
|
XdsApi::EdsUpdate& eds_update = p.second.resource;
|
1125
|
-
auto& state =
|
1251
|
+
auto& state =
|
1252
|
+
eds_state.subscribed_resources[resource.authority][resource.id];
|
1126
1253
|
if (state != nullptr) state->Finish();
|
1127
1254
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1128
1255
|
gpr_log(GPR_INFO, "[xds_client %p] EDS resource %s: %s", xds_client(),
|
1129
|
-
|
1256
|
+
XdsApi::ConstructFullResourceName(
|
1257
|
+
resource.authority, XdsApi::kCdsTypeUrl, resource.id)
|
1258
|
+
.c_str(),
|
1259
|
+
eds_update.ToString().c_str());
|
1130
1260
|
}
|
1131
1261
|
EndpointState& endpoint_state =
|
1132
|
-
xds_client()
|
1262
|
+
xds_client()
|
1263
|
+
->authority_state_map_[resource.authority]
|
1264
|
+
.endpoint_map[resource.id];
|
1133
1265
|
// Ignore identical update.
|
1134
1266
|
if (endpoint_state.update.has_value() &&
|
1135
1267
|
*endpoint_state.update == eds_update) {
|
@@ -1167,28 +1299,50 @@ void UpdateResourceMetadataNacked(const std::string& version,
|
|
1167
1299
|
} // namespace
|
1168
1300
|
|
1169
1301
|
template <typename StateMap>
|
1170
|
-
void XdsClient::ChannelState::AdsCallState::
|
1171
|
-
|
1302
|
+
void XdsClient::ChannelState::AdsCallState::RejectAdsUpdateHelperLocked(
|
1303
|
+
const std::string& resource_name, grpc_millis update_time,
|
1304
|
+
const XdsApi::AdsParseResult& result, const std::string& error_details,
|
1172
1305
|
StateMap* state_map) {
|
1306
|
+
auto it = state_map->find(resource_name);
|
1307
|
+
if (it == state_map->end()) return;
|
1308
|
+
auto& state = it->second;
|
1309
|
+
for (const auto& p : state.watchers) {
|
1310
|
+
p.first->OnError(GRPC_ERROR_REF(result.parse_error));
|
1311
|
+
}
|
1312
|
+
UpdateResourceMetadataNacked(result.version, error_details, update_time,
|
1313
|
+
&state.meta);
|
1314
|
+
}
|
1315
|
+
|
1316
|
+
void XdsClient::ChannelState::AdsCallState::RejectAdsUpdateLocked(
|
1317
|
+
grpc_millis update_time, const XdsApi::AdsParseResult& result) {
|
1173
1318
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1174
1319
|
gpr_log(GPR_INFO,
|
1175
1320
|
"[xds_client %p] %s update NACKed containing %" PRIuPTR
|
1176
|
-
" resources",
|
1321
|
+
" invalid resources",
|
1177
1322
|
xds_client(), result.type_url.c_str(),
|
1178
1323
|
result.resource_names_failed.size());
|
1179
1324
|
}
|
1180
1325
|
std::string details = grpc_error_std_string(result.parse_error);
|
1181
|
-
for (auto&
|
1182
|
-
auto
|
1183
|
-
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1187
|
-
|
1326
|
+
for (auto& resource : result.resource_names_failed) {
|
1327
|
+
auto authority_it =
|
1328
|
+
xds_client()->authority_state_map_.find(resource.authority);
|
1329
|
+
if (authority_it == xds_client()->authority_state_map_.end()) continue;
|
1330
|
+
AuthorityState& authority_state = authority_it->second;
|
1331
|
+
if (result.type_url == XdsApi::kLdsTypeUrl) {
|
1332
|
+
RejectAdsUpdateHelperLocked(resource.id, update_time, result, details,
|
1333
|
+
&authority_state.listener_map);
|
1334
|
+
} else if (result.type_url == XdsApi::kRdsTypeUrl) {
|
1335
|
+
RejectAdsUpdateHelperLocked(resource.id, update_time, result, details,
|
1336
|
+
&authority_state.route_config_map);
|
1337
|
+
} else if (result.type_url == XdsApi::kCdsTypeUrl) {
|
1338
|
+
RejectAdsUpdateHelperLocked(resource.id, update_time, result, details,
|
1339
|
+
&authority_state.cluster_map);
|
1340
|
+
} else if (result.type_url == XdsApi::kEdsTypeUrl) {
|
1341
|
+
RejectAdsUpdateHelperLocked(resource.id, update_time, result, details,
|
1342
|
+
&authority_state.endpoint_map);
|
1343
|
+
} else {
|
1344
|
+
GPR_ASSERT(0);
|
1188
1345
|
}
|
1189
|
-
// Update resource metadata for CSDS.
|
1190
|
-
UpdateResourceMetadataNacked(result.version, details, update_time,
|
1191
|
-
&state.meta);
|
1192
1346
|
}
|
1193
1347
|
}
|
1194
1348
|
|
@@ -1268,9 +1422,8 @@ bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
|
|
1268
1422
|
// Update nonce.
|
1269
1423
|
auto& state = state_map_[result.type_url];
|
1270
1424
|
state.nonce = std::move(result.nonce);
|
1271
|
-
//
|
1425
|
+
// If we got an error, we'll NACK the update.
|
1272
1426
|
if (result.parse_error != GRPC_ERROR_NONE) {
|
1273
|
-
// NACK unacceptable update.
|
1274
1427
|
gpr_log(GPR_ERROR,
|
1275
1428
|
"[xds_client %p] ADS response invalid for resource type %s "
|
1276
1429
|
"version %s, will NACK: nonce=%s error=%s",
|
@@ -1282,39 +1435,32 @@ bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
|
|
1282
1435
|
GRPC_STATUS_UNAVAILABLE);
|
1283
1436
|
GRPC_ERROR_UNREF(state.error);
|
1284
1437
|
state.error = result.parse_error;
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
} else {
|
1438
|
+
RejectAdsUpdateLocked(update_time, result);
|
1439
|
+
}
|
1440
|
+
// Process any valid resources.
|
1441
|
+
bool have_valid_resources = false;
|
1442
|
+
if (result.type_url == XdsApi::kLdsTypeUrl) {
|
1443
|
+
have_valid_resources = !result.lds_update_map.empty();
|
1444
|
+
AcceptLdsUpdateLocked(result.version, update_time,
|
1445
|
+
std::move(result.lds_update_map),
|
1446
|
+
result.resource_names_failed);
|
1447
|
+
} else if (result.type_url == XdsApi::kRdsTypeUrl) {
|
1448
|
+
have_valid_resources = !result.rds_update_map.empty();
|
1449
|
+
AcceptRdsUpdateLocked(result.version, update_time,
|
1450
|
+
std::move(result.rds_update_map));
|
1451
|
+
} else if (result.type_url == XdsApi::kCdsTypeUrl) {
|
1452
|
+
have_valid_resources = !result.cds_update_map.empty();
|
1453
|
+
AcceptCdsUpdateLocked(result.version, update_time,
|
1454
|
+
std::move(result.cds_update_map),
|
1455
|
+
result.resource_names_failed);
|
1456
|
+
} else if (result.type_url == XdsApi::kEdsTypeUrl) {
|
1457
|
+
have_valid_resources = !result.eds_update_map.empty();
|
1458
|
+
AcceptEdsUpdateLocked(result.version, update_time,
|
1459
|
+
std::move(result.eds_update_map));
|
1460
|
+
}
|
1461
|
+
if (have_valid_resources) {
|
1299
1462
|
seen_response_ = true;
|
1300
|
-
|
1301
|
-
if (result.type_url == XdsApi::kLdsTypeUrl) {
|
1302
|
-
AcceptLdsUpdateLocked(result.version, update_time,
|
1303
|
-
std::move(result.lds_update_map));
|
1304
|
-
} else if (result.type_url == XdsApi::kRdsTypeUrl) {
|
1305
|
-
AcceptRdsUpdateLocked(result.version, update_time,
|
1306
|
-
std::move(result.rds_update_map));
|
1307
|
-
} else if (result.type_url == XdsApi::kCdsTypeUrl) {
|
1308
|
-
AcceptCdsUpdateLocked(result.version, update_time,
|
1309
|
-
std::move(result.cds_update_map));
|
1310
|
-
} else if (result.type_url == XdsApi::kEdsTypeUrl) {
|
1311
|
-
AcceptEdsUpdateLocked(result.version, update_time,
|
1312
|
-
std::move(result.eds_update_map));
|
1313
|
-
}
|
1314
|
-
xds_client()->resource_version_map_[result.type_url] =
|
1315
|
-
std::move(result.version);
|
1316
|
-
// ACK the update.
|
1317
|
-
SendMessageLocked(result.type_url);
|
1463
|
+
chand()->resource_type_version_map_[result.type_url] = result.version;
|
1318
1464
|
// Start load reporting if needed.
|
1319
1465
|
auto& lrs_call = chand()->lrs_calld_;
|
1320
1466
|
if (lrs_call != nullptr) {
|
@@ -1322,6 +1468,8 @@ bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
|
|
1322
1468
|
if (lrs_calld != nullptr) lrs_calld->MaybeStartReportingLocked();
|
1323
1469
|
}
|
1324
1470
|
}
|
1471
|
+
// Send ACK or NACK.
|
1472
|
+
SendMessageLocked(result.type_url);
|
1325
1473
|
}
|
1326
1474
|
if (xds_client()->shutting_down_) return true;
|
1327
1475
|
// Keep listening for updates.
|
@@ -1378,19 +1526,23 @@ bool XdsClient::ChannelState::AdsCallState::IsCurrentCallOnChannel() const {
|
|
1378
1526
|
return this == chand()->ads_calld_->calld();
|
1379
1527
|
}
|
1380
1528
|
|
1381
|
-
std::set<absl::string_view
|
1529
|
+
std::map<absl::string_view /*authority*/, std::set<absl::string_view /*name*/>>
|
1382
1530
|
XdsClient::ChannelState::AdsCallState::ResourceNamesForRequest(
|
1383
1531
|
const std::string& type_url) {
|
1384
|
-
std::
|
1532
|
+
std::map<absl::string_view /*authority*/,
|
1533
|
+
std::set<absl::string_view /*name*/>>
|
1534
|
+
resource_map;
|
1385
1535
|
auto it = state_map_.find(type_url);
|
1386
1536
|
if (it != state_map_.end()) {
|
1387
|
-
for (auto&
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1537
|
+
for (auto& a : it->second.subscribed_resources) {
|
1538
|
+
for (auto& p : a.second) {
|
1539
|
+
resource_map[a.first].insert(p.first);
|
1540
|
+
OrphanablePtr<ResourceState>& state = p.second;
|
1541
|
+
state->Start(Ref(DEBUG_LOCATION, "ResourceState"));
|
1542
|
+
}
|
1391
1543
|
}
|
1392
1544
|
}
|
1393
|
-
return
|
1545
|
+
return resource_map;
|
1394
1546
|
}
|
1395
1547
|
|
1396
1548
|
//
|
@@ -1839,12 +1991,10 @@ grpc_millis GetRequestTimeout(const grpc_channel_args* args) {
|
|
1839
1991
|
}
|
1840
1992
|
|
1841
1993
|
grpc_channel_args* ModifyChannelArgs(const grpc_channel_args* args) {
|
1842
|
-
absl::InlinedVector<grpc_arg,
|
1994
|
+
absl::InlinedVector<grpc_arg, 1> args_to_add = {
|
1843
1995
|
grpc_channel_arg_integer_create(
|
1844
1996
|
const_cast<char*>(GRPC_ARG_KEEPALIVE_TIME_MS),
|
1845
1997
|
5 * 60 * GPR_MS_PER_SEC),
|
1846
|
-
grpc_channel_arg_integer_create(
|
1847
|
-
const_cast<char*>(GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL), 1),
|
1848
1998
|
};
|
1849
1999
|
return grpc_channel_args_copy_and_add(args, args_to_add.data(),
|
1850
2000
|
args_to_add.size());
|
@@ -1868,9 +2018,9 @@ XdsClient::XdsClient(std::unique_ptr<XdsBootstrap> bootstrap,
|
|
1868
2018
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1869
2019
|
gpr_log(GPR_INFO, "[xds_client %p] creating xds client", this);
|
1870
2020
|
}
|
1871
|
-
//
|
1872
|
-
|
1873
|
-
|
2021
|
+
// Calling grpc_init to ensure gRPC does not shut down until the XdsClient is
|
2022
|
+
// destroyed.
|
2023
|
+
grpc_init();
|
1874
2024
|
}
|
1875
2025
|
|
1876
2026
|
XdsClient::~XdsClient() {
|
@@ -1879,26 +2029,9 @@ XdsClient::~XdsClient() {
|
|
1879
2029
|
}
|
1880
2030
|
grpc_channel_args_destroy(args_);
|
1881
2031
|
grpc_pollset_set_destroy(interested_parties_);
|
1882
|
-
|
1883
|
-
|
1884
|
-
|
1885
|
-
channelz::ChannelNode* parent_channelz_node) {
|
1886
|
-
MutexLock lock(&mu_);
|
1887
|
-
channelz::ChannelNode* xds_channelz_node =
|
1888
|
-
grpc_channel_get_channelz_node(chand_->channel());
|
1889
|
-
if (xds_channelz_node != nullptr) {
|
1890
|
-
parent_channelz_node->AddChildChannel(xds_channelz_node->uuid());
|
1891
|
-
}
|
1892
|
-
}
|
1893
|
-
|
1894
|
-
void XdsClient::RemoveChannelzLinkage(
|
1895
|
-
channelz::ChannelNode* parent_channelz_node) {
|
1896
|
-
MutexLock lock(&mu_);
|
1897
|
-
channelz::ChannelNode* xds_channelz_node =
|
1898
|
-
grpc_channel_get_channelz_node(chand_->channel());
|
1899
|
-
if (xds_channelz_node != nullptr) {
|
1900
|
-
parent_channelz_node->RemoveChildChannel(xds_channelz_node->uuid());
|
1901
|
-
}
|
2032
|
+
// Calling grpc_shutdown to ensure gRPC does not shut down until the XdsClient
|
2033
|
+
// is destroyed.
|
2034
|
+
grpc_shutdown();
|
1902
2035
|
}
|
1903
2036
|
|
1904
2037
|
void XdsClient::Orphan() {
|
@@ -1912,28 +2045,56 @@ void XdsClient::Orphan() {
|
|
1912
2045
|
{
|
1913
2046
|
MutexLock lock(&mu_);
|
1914
2047
|
shutting_down_ = true;
|
1915
|
-
// Orphan ChannelState object.
|
1916
|
-
chand_.reset();
|
1917
2048
|
// We do not clear cluster_map_ and endpoint_map_ if the xds client was
|
1918
2049
|
// created by the XdsResolver because the maps contain refs for watchers
|
1919
2050
|
// which in turn hold refs to the loadbalancing policies. At this point, it
|
1920
2051
|
// is possible for ADS calls to be in progress. Unreffing the loadbalancing
|
1921
2052
|
// policies before those calls are done would lead to issues such as
|
1922
2053
|
// https://github.com/grpc/grpc/issues/20928.
|
1923
|
-
|
1924
|
-
|
1925
|
-
|
2054
|
+
for (auto& a : authority_state_map_) {
|
2055
|
+
a.second.channel_state.reset();
|
2056
|
+
if (!a.second.listener_map.empty()) {
|
2057
|
+
a.second.cluster_map.clear();
|
2058
|
+
a.second.endpoint_map.clear();
|
2059
|
+
}
|
1926
2060
|
}
|
2061
|
+
// We clear these invalid resource watchers as cancel never came.
|
2062
|
+
invalid_listener_watchers_.clear();
|
2063
|
+
invalid_route_config_watchers_.clear();
|
2064
|
+
invalid_cluster_watchers_.clear();
|
2065
|
+
invalid_endpoint_watchers_.clear();
|
1927
2066
|
}
|
1928
2067
|
}
|
1929
2068
|
|
2069
|
+
RefCountedPtr<XdsClient::ChannelState> XdsClient::GetOrCreateChannelStateLocked(
|
2070
|
+
const XdsBootstrap::XdsServer& server) {
|
2071
|
+
auto it = xds_server_channel_map_.find(server);
|
2072
|
+
if (it != xds_server_channel_map_.end()) {
|
2073
|
+
return it->second->Ref(DEBUG_LOCATION, "Authority");
|
2074
|
+
}
|
2075
|
+
// Channel not found, so create a new one.
|
2076
|
+
auto channel_state = MakeRefCounted<ChannelState>(
|
2077
|
+
WeakRef(DEBUG_LOCATION, "ChannelState"), server);
|
2078
|
+
xds_server_channel_map_[server] = channel_state.get();
|
2079
|
+
return channel_state;
|
2080
|
+
}
|
2081
|
+
|
1930
2082
|
void XdsClient::WatchListenerData(
|
1931
2083
|
absl::string_view listener_name,
|
1932
2084
|
std::unique_ptr<ListenerWatcherInterface> watcher) {
|
1933
2085
|
std::string listener_name_str = std::string(listener_name);
|
1934
2086
|
MutexLock lock(&mu_);
|
1935
|
-
ListenerState& listener_state = listener_map_[listener_name_str];
|
1936
2087
|
ListenerWatcherInterface* w = watcher.get();
|
2088
|
+
auto resource = XdsApi::ParseResourceName(listener_name, XdsApi::IsLds);
|
2089
|
+
if (!resource.ok()) {
|
2090
|
+
invalid_listener_watchers_[w] = std::move(watcher);
|
2091
|
+
grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
|
2092
|
+
"Unable to parse resource name for listener %s", listener_name));
|
2093
|
+
w->OnError(GRPC_ERROR_REF(error));
|
2094
|
+
return;
|
2095
|
+
}
|
2096
|
+
AuthorityState& authority_state = authority_state_map_[resource->authority];
|
2097
|
+
ListenerState& listener_state = authority_state.listener_map[resource->id];
|
1937
2098
|
listener_state.watchers[w] = std::move(watcher);
|
1938
2099
|
// If we've already received an LDS update, notify the new watcher
|
1939
2100
|
// immediately.
|
@@ -1944,7 +2105,13 @@ void XdsClient::WatchListenerData(
|
|
1944
2105
|
}
|
1945
2106
|
w->OnListenerChanged(*listener_state.update);
|
1946
2107
|
}
|
1947
|
-
|
2108
|
+
// If the authority doesn't yet have a channel, set it, creating it if needed.
|
2109
|
+
if (authority_state.channel_state == nullptr) {
|
2110
|
+
authority_state.channel_state =
|
2111
|
+
GetOrCreateChannelStateLocked(bootstrap_->server());
|
2112
|
+
}
|
2113
|
+
authority_state.channel_state->SubscribeLocked(XdsApi::kLdsTypeUrl,
|
2114
|
+
*resource);
|
1948
2115
|
}
|
1949
2116
|
|
1950
2117
|
void XdsClient::CancelListenerDataWatch(absl::string_view listener_name,
|
@@ -1952,16 +2119,22 @@ void XdsClient::CancelListenerDataWatch(absl::string_view listener_name,
|
|
1952
2119
|
bool delay_unsubscription) {
|
1953
2120
|
MutexLock lock(&mu_);
|
1954
2121
|
if (shutting_down_) return;
|
1955
|
-
|
1956
|
-
|
2122
|
+
auto resource = XdsApi::ParseResourceName(listener_name, XdsApi::IsLds);
|
2123
|
+
if (!resource.ok()) return;
|
2124
|
+
auto& authority_state = authority_state_map_[resource->authority];
|
2125
|
+
ListenerState& listener_state = authority_state.listener_map[resource->id];
|
1957
2126
|
auto it = listener_state.watchers.find(watcher);
|
1958
|
-
if (it
|
1959
|
-
|
1960
|
-
|
1961
|
-
|
1962
|
-
|
1963
|
-
|
1964
|
-
|
2127
|
+
if (it == listener_state.watchers.end()) {
|
2128
|
+
invalid_listener_watchers_.erase(watcher);
|
2129
|
+
return;
|
2130
|
+
}
|
2131
|
+
listener_state.watchers.erase(it);
|
2132
|
+
if (!listener_state.watchers.empty()) return;
|
2133
|
+
authority_state.listener_map.erase(resource->id);
|
2134
|
+
xds_server_channel_map_[bootstrap_->server()]->UnsubscribeLocked(
|
2135
|
+
XdsApi::kLdsTypeUrl, *resource, delay_unsubscription);
|
2136
|
+
if (!authority_state.HasSubscribedResources()) {
|
2137
|
+
authority_state.channel_state.reset();
|
1965
2138
|
}
|
1966
2139
|
}
|
1967
2140
|
|
@@ -1970,9 +2143,19 @@ void XdsClient::WatchRouteConfigData(
|
|
1970
2143
|
std::unique_ptr<RouteConfigWatcherInterface> watcher) {
|
1971
2144
|
std::string route_config_name_str = std::string(route_config_name);
|
1972
2145
|
MutexLock lock(&mu_);
|
1973
|
-
RouteConfigState& route_config_state =
|
1974
|
-
route_config_map_[route_config_name_str];
|
1975
2146
|
RouteConfigWatcherInterface* w = watcher.get();
|
2147
|
+
auto resource = XdsApi::ParseResourceName(route_config_name, XdsApi::IsRds);
|
2148
|
+
if (!resource.ok()) {
|
2149
|
+
invalid_route_config_watchers_[w] = std::move(watcher);
|
2150
|
+
grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
|
2151
|
+
absl::StrFormat("Unable to parse resource name for route config %s",
|
2152
|
+
route_config_name));
|
2153
|
+
w->OnError(GRPC_ERROR_REF(error));
|
2154
|
+
return;
|
2155
|
+
}
|
2156
|
+
auto& authority_state = authority_state_map_[resource->authority];
|
2157
|
+
RouteConfigState& route_config_state =
|
2158
|
+
authority_state.route_config_map[resource->id];
|
1976
2159
|
route_config_state.watchers[w] = std::move(watcher);
|
1977
2160
|
// If we've already received an RDS update, notify the new watcher
|
1978
2161
|
// immediately.
|
@@ -1984,7 +2167,13 @@ void XdsClient::WatchRouteConfigData(
|
|
1984
2167
|
}
|
1985
2168
|
w->OnRouteConfigChanged(*route_config_state.update);
|
1986
2169
|
}
|
1987
|
-
|
2170
|
+
// If the authority doesn't yet have a channel, set it, creating it if needed.
|
2171
|
+
if (authority_state.channel_state == nullptr) {
|
2172
|
+
authority_state.channel_state =
|
2173
|
+
GetOrCreateChannelStateLocked(bootstrap_->server());
|
2174
|
+
}
|
2175
|
+
authority_state.channel_state->SubscribeLocked(XdsApi::kRdsTypeUrl,
|
2176
|
+
*resource);
|
1988
2177
|
}
|
1989
2178
|
|
1990
2179
|
void XdsClient::CancelRouteConfigDataWatch(absl::string_view route_config_name,
|
@@ -1992,17 +2181,23 @@ void XdsClient::CancelRouteConfigDataWatch(absl::string_view route_config_name,
|
|
1992
2181
|
bool delay_unsubscription) {
|
1993
2182
|
MutexLock lock(&mu_);
|
1994
2183
|
if (shutting_down_) return;
|
1995
|
-
|
2184
|
+
auto resource = XdsApi::ParseResourceName(route_config_name, XdsApi::IsRds);
|
2185
|
+
if (!resource.ok()) return;
|
2186
|
+
auto& authority_state = authority_state_map_[resource->authority];
|
1996
2187
|
RouteConfigState& route_config_state =
|
1997
|
-
|
2188
|
+
authority_state.route_config_map[resource->id];
|
1998
2189
|
auto it = route_config_state.watchers.find(watcher);
|
1999
|
-
if (it
|
2000
|
-
|
2001
|
-
|
2002
|
-
|
2003
|
-
|
2004
|
-
|
2005
|
-
|
2190
|
+
if (it == route_config_state.watchers.end()) {
|
2191
|
+
invalid_route_config_watchers_.erase(watcher);
|
2192
|
+
return;
|
2193
|
+
}
|
2194
|
+
route_config_state.watchers.erase(it);
|
2195
|
+
if (!route_config_state.watchers.empty()) return;
|
2196
|
+
authority_state.route_config_map.erase(resource->id);
|
2197
|
+
xds_server_channel_map_[bootstrap_->server()]->UnsubscribeLocked(
|
2198
|
+
XdsApi::kRdsTypeUrl, *resource, delay_unsubscription);
|
2199
|
+
if (!authority_state.HasSubscribedResources()) {
|
2200
|
+
authority_state.channel_state.reset();
|
2006
2201
|
}
|
2007
2202
|
}
|
2008
2203
|
|
@@ -2011,8 +2206,17 @@ void XdsClient::WatchClusterData(
|
|
2011
2206
|
std::unique_ptr<ClusterWatcherInterface> watcher) {
|
2012
2207
|
std::string cluster_name_str = std::string(cluster_name);
|
2013
2208
|
MutexLock lock(&mu_);
|
2014
|
-
ClusterState& cluster_state = cluster_map_[cluster_name_str];
|
2015
2209
|
ClusterWatcherInterface* w = watcher.get();
|
2210
|
+
auto resource = XdsApi::ParseResourceName(cluster_name, XdsApi::IsCds);
|
2211
|
+
if (!resource.ok()) {
|
2212
|
+
invalid_cluster_watchers_[w] = std::move(watcher);
|
2213
|
+
grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
|
2214
|
+
"Unable to parse resource name for cluster %s", cluster_name));
|
2215
|
+
w->OnError(GRPC_ERROR_REF(error));
|
2216
|
+
return;
|
2217
|
+
}
|
2218
|
+
auto& authority_state = authority_state_map_[resource->authority];
|
2219
|
+
ClusterState& cluster_state = authority_state.cluster_map[resource->id];
|
2016
2220
|
cluster_state.watchers[w] = std::move(watcher);
|
2017
2221
|
// If we've already received a CDS update, notify the new watcher
|
2018
2222
|
// immediately.
|
@@ -2023,7 +2227,13 @@ void XdsClient::WatchClusterData(
|
|
2023
2227
|
}
|
2024
2228
|
w->OnClusterChanged(cluster_state.update.value());
|
2025
2229
|
}
|
2026
|
-
|
2230
|
+
// If the authority doesn't yet have a channel, set it, creating it if needed.
|
2231
|
+
if (authority_state.channel_state == nullptr) {
|
2232
|
+
authority_state.channel_state =
|
2233
|
+
GetOrCreateChannelStateLocked(bootstrap_->server());
|
2234
|
+
}
|
2235
|
+
authority_state.channel_state->SubscribeLocked(XdsApi::kCdsTypeUrl,
|
2236
|
+
*resource);
|
2027
2237
|
}
|
2028
2238
|
|
2029
2239
|
void XdsClient::CancelClusterDataWatch(absl::string_view cluster_name,
|
@@ -2031,16 +2241,22 @@ void XdsClient::CancelClusterDataWatch(absl::string_view cluster_name,
|
|
2031
2241
|
bool delay_unsubscription) {
|
2032
2242
|
MutexLock lock(&mu_);
|
2033
2243
|
if (shutting_down_) return;
|
2034
|
-
|
2035
|
-
|
2244
|
+
auto resource = XdsApi::ParseResourceName(cluster_name, XdsApi::IsCds);
|
2245
|
+
if (!resource.ok()) return;
|
2246
|
+
auto& authority_state = authority_state_map_[resource->authority];
|
2247
|
+
ClusterState& cluster_state = authority_state.cluster_map[resource->id];
|
2036
2248
|
auto it = cluster_state.watchers.find(watcher);
|
2037
|
-
if (it
|
2038
|
-
|
2039
|
-
|
2040
|
-
|
2041
|
-
|
2042
|
-
|
2043
|
-
|
2249
|
+
if (it == cluster_state.watchers.end()) {
|
2250
|
+
invalid_cluster_watchers_.erase(watcher);
|
2251
|
+
return;
|
2252
|
+
}
|
2253
|
+
cluster_state.watchers.erase(it);
|
2254
|
+
if (!cluster_state.watchers.empty()) return;
|
2255
|
+
authority_state.cluster_map.erase(resource->id);
|
2256
|
+
xds_server_channel_map_[bootstrap_->server()]->UnsubscribeLocked(
|
2257
|
+
XdsApi::kCdsTypeUrl, *resource, delay_unsubscription);
|
2258
|
+
if (!authority_state.HasSubscribedResources()) {
|
2259
|
+
authority_state.channel_state.reset();
|
2044
2260
|
}
|
2045
2261
|
}
|
2046
2262
|
|
@@ -2049,8 +2265,18 @@ void XdsClient::WatchEndpointData(
|
|
2049
2265
|
std::unique_ptr<EndpointWatcherInterface> watcher) {
|
2050
2266
|
std::string eds_service_name_str = std::string(eds_service_name);
|
2051
2267
|
MutexLock lock(&mu_);
|
2052
|
-
EndpointState& endpoint_state = endpoint_map_[eds_service_name_str];
|
2053
2268
|
EndpointWatcherInterface* w = watcher.get();
|
2269
|
+
auto resource = XdsApi::ParseResourceName(eds_service_name, XdsApi::IsEds);
|
2270
|
+
if (!resource.ok()) {
|
2271
|
+
invalid_endpoint_watchers_[w] = std::move(watcher);
|
2272
|
+
grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
|
2273
|
+
absl::StrFormat("Unable to parse resource name for endpoint service %s",
|
2274
|
+
eds_service_name));
|
2275
|
+
w->OnError(GRPC_ERROR_REF(error));
|
2276
|
+
return;
|
2277
|
+
}
|
2278
|
+
auto& authority_state = authority_state_map_[resource->authority];
|
2279
|
+
EndpointState& endpoint_state = authority_state.endpoint_map[resource->id];
|
2054
2280
|
endpoint_state.watchers[w] = std::move(watcher);
|
2055
2281
|
// If we've already received an EDS update, notify the new watcher
|
2056
2282
|
// immediately.
|
@@ -2061,7 +2287,13 @@ void XdsClient::WatchEndpointData(
|
|
2061
2287
|
}
|
2062
2288
|
w->OnEndpointChanged(endpoint_state.update.value());
|
2063
2289
|
}
|
2064
|
-
|
2290
|
+
// If the authority doesn't yet have a channel, set it, creating it if needed.
|
2291
|
+
if (authority_state.channel_state == nullptr) {
|
2292
|
+
authority_state.channel_state =
|
2293
|
+
GetOrCreateChannelStateLocked(bootstrap_->server());
|
2294
|
+
}
|
2295
|
+
authority_state.channel_state->SubscribeLocked(XdsApi::kEdsTypeUrl,
|
2296
|
+
*resource);
|
2065
2297
|
}
|
2066
2298
|
|
2067
2299
|
void XdsClient::CancelEndpointDataWatch(absl::string_view eds_service_name,
|
@@ -2069,16 +2301,22 @@ void XdsClient::CancelEndpointDataWatch(absl::string_view eds_service_name,
|
|
2069
2301
|
bool delay_unsubscription) {
|
2070
2302
|
MutexLock lock(&mu_);
|
2071
2303
|
if (shutting_down_) return;
|
2072
|
-
|
2073
|
-
|
2304
|
+
auto resource = XdsApi::ParseResourceName(eds_service_name, XdsApi::IsEds);
|
2305
|
+
if (!resource.ok()) return;
|
2306
|
+
auto& authority_state = authority_state_map_[resource->authority];
|
2307
|
+
EndpointState& endpoint_state = authority_state.endpoint_map[resource->id];
|
2074
2308
|
auto it = endpoint_state.watchers.find(watcher);
|
2075
|
-
if (it
|
2076
|
-
|
2077
|
-
|
2078
|
-
|
2079
|
-
|
2080
|
-
|
2081
|
-
|
2309
|
+
if (it == endpoint_state.watchers.end()) {
|
2310
|
+
invalid_endpoint_watchers_.erase(watcher);
|
2311
|
+
return;
|
2312
|
+
}
|
2313
|
+
endpoint_state.watchers.erase(it);
|
2314
|
+
if (!endpoint_state.watchers.empty()) return;
|
2315
|
+
authority_state.endpoint_map.erase(resource->id);
|
2316
|
+
xds_server_channel_map_[bootstrap_->server()]->UnsubscribeLocked(
|
2317
|
+
XdsApi::kEdsTypeUrl, *resource, delay_unsubscription);
|
2318
|
+
if (!authority_state.HasSubscribedResources()) {
|
2319
|
+
authority_state.channel_state.reset();
|
2082
2320
|
}
|
2083
2321
|
}
|
2084
2322
|
|
@@ -2112,7 +2350,12 @@ RefCountedPtr<XdsClusterDropStats> XdsClient::AddClusterDropStats(
|
|
2112
2350
|
it->first.second /*eds_service_name*/);
|
2113
2351
|
load_report_state.drop_stats = cluster_drop_stats.get();
|
2114
2352
|
}
|
2115
|
-
|
2353
|
+
auto resource = XdsApi::ParseResourceName(cluster_name, XdsApi::IsCds);
|
2354
|
+
GPR_ASSERT(resource.ok());
|
2355
|
+
auto a = authority_state_map_.find(resource->authority);
|
2356
|
+
if (a != authority_state_map_.end()) {
|
2357
|
+
a->second.channel_state->MaybeStartLrsCall();
|
2358
|
+
}
|
2116
2359
|
return cluster_drop_stats;
|
2117
2360
|
}
|
2118
2361
|
|
@@ -2169,7 +2412,12 @@ RefCountedPtr<XdsClusterLocalityStats> XdsClient::AddClusterLocalityStats(
|
|
2169
2412
|
std::move(locality));
|
2170
2413
|
locality_state.locality_stats = cluster_locality_stats.get();
|
2171
2414
|
}
|
2172
|
-
|
2415
|
+
auto resource = XdsApi::ParseResourceName(cluster_name, XdsApi::IsCds);
|
2416
|
+
GPR_ASSERT(resource.ok());
|
2417
|
+
auto a = authority_state_map_.find(resource->authority);
|
2418
|
+
if (a != authority_state_map_.end()) {
|
2419
|
+
a->second.channel_state->MaybeStartLrsCall();
|
2420
|
+
}
|
2173
2421
|
return cluster_locality_stats;
|
2174
2422
|
}
|
2175
2423
|
|
@@ -2199,34 +2447,36 @@ void XdsClient::RemoveClusterLocalityStats(
|
|
2199
2447
|
|
2200
2448
|
void XdsClient::ResetBackoff() {
|
2201
2449
|
MutexLock lock(&mu_);
|
2202
|
-
|
2203
|
-
grpc_channel_reset_connect_backoff(
|
2450
|
+
for (auto& p : xds_server_channel_map_) {
|
2451
|
+
grpc_channel_reset_connect_backoff(p.second->channel());
|
2204
2452
|
}
|
2205
2453
|
}
|
2206
2454
|
|
2207
2455
|
void XdsClient::NotifyOnErrorLocked(grpc_error_handle error) {
|
2208
|
-
for (const auto&
|
2209
|
-
const
|
2210
|
-
|
2211
|
-
p.
|
2456
|
+
for (const auto& a : authority_state_map_) {
|
2457
|
+
for (const auto& p : a.second.listener_map) {
|
2458
|
+
const ListenerState& listener_state = p.second;
|
2459
|
+
for (const auto& p : listener_state.watchers) {
|
2460
|
+
p.first->OnError(GRPC_ERROR_REF(error));
|
2461
|
+
}
|
2212
2462
|
}
|
2213
|
-
|
2214
|
-
|
2215
|
-
|
2216
|
-
|
2217
|
-
|
2463
|
+
for (const auto& p : a.second.route_config_map) {
|
2464
|
+
const RouteConfigState& route_config_state = p.second;
|
2465
|
+
for (const auto& p : route_config_state.watchers) {
|
2466
|
+
p.first->OnError(GRPC_ERROR_REF(error));
|
2467
|
+
}
|
2218
2468
|
}
|
2219
|
-
|
2220
|
-
|
2221
|
-
|
2222
|
-
|
2223
|
-
|
2469
|
+
for (const auto& p : a.second.cluster_map) {
|
2470
|
+
const ClusterState& cluster_state = p.second;
|
2471
|
+
for (const auto& p : cluster_state.watchers) {
|
2472
|
+
p.first->OnError(GRPC_ERROR_REF(error));
|
2473
|
+
}
|
2224
2474
|
}
|
2225
|
-
|
2226
|
-
|
2227
|
-
|
2228
|
-
|
2229
|
-
|
2475
|
+
for (const auto& p : a.second.endpoint_map) {
|
2476
|
+
const EndpointState& endpoint_state = p.second;
|
2477
|
+
for (const auto& p : endpoint_state.watchers) {
|
2478
|
+
p.first->OnError(GRPC_ERROR_REF(error));
|
2479
|
+
}
|
2230
2480
|
}
|
2231
2481
|
}
|
2232
2482
|
GRPC_ERROR_UNREF(error);
|
@@ -2316,34 +2566,36 @@ XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked(
|
|
2316
2566
|
std::string XdsClient::DumpClientConfigBinary() {
|
2317
2567
|
MutexLock lock(&mu_);
|
2318
2568
|
XdsApi::ResourceTypeMetadataMap resource_type_metadata_map;
|
2319
|
-
|
2320
|
-
|
2321
|
-
|
2322
|
-
|
2323
|
-
|
2324
|
-
|
2325
|
-
|
2326
|
-
|
2327
|
-
|
2328
|
-
|
2329
|
-
|
2330
|
-
|
2331
|
-
|
2332
|
-
|
2333
|
-
|
2334
|
-
|
2335
|
-
|
2336
|
-
|
2337
|
-
|
2338
|
-
|
2339
|
-
|
2340
|
-
|
2341
|
-
|
2342
|
-
|
2343
|
-
|
2344
|
-
|
2345
|
-
|
2346
|
-
|
2569
|
+
auto& lds_map = resource_type_metadata_map[XdsApi::kLdsTypeUrl];
|
2570
|
+
auto& rds_map = resource_type_metadata_map[XdsApi::kRdsTypeUrl];
|
2571
|
+
auto& cds_map = resource_type_metadata_map[XdsApi::kCdsTypeUrl];
|
2572
|
+
auto& eds_map = resource_type_metadata_map[XdsApi::kEdsTypeUrl];
|
2573
|
+
for (auto& a : authority_state_map_) {
|
2574
|
+
const std::string& authority = a.first;
|
2575
|
+
// Collect resource metadata from listeners
|
2576
|
+
for (auto& p : a.second.listener_map) {
|
2577
|
+
const std::string& listener_name = p.first;
|
2578
|
+
lds_map[XdsApi::ConstructFullResourceName(
|
2579
|
+
authority, XdsApi::kLdsTypeUrl, listener_name)] = &p.second.meta;
|
2580
|
+
}
|
2581
|
+
// Collect resource metadata from route configs
|
2582
|
+
for (auto& p : a.second.route_config_map) {
|
2583
|
+
const std::string& route_config_name = p.first;
|
2584
|
+
rds_map[XdsApi::ConstructFullResourceName(
|
2585
|
+
authority, XdsApi::kRdsTypeUrl, route_config_name)] = &p.second.meta;
|
2586
|
+
}
|
2587
|
+
// Collect resource metadata from clusters
|
2588
|
+
for (auto& p : a.second.cluster_map) {
|
2589
|
+
const std::string& cluster_name = p.first;
|
2590
|
+
cds_map[XdsApi::ConstructFullResourceName(authority, XdsApi::kCdsTypeUrl,
|
2591
|
+
cluster_name)] = &p.second.meta;
|
2592
|
+
}
|
2593
|
+
// Collect resource metadata from endpoints
|
2594
|
+
for (auto& p : a.second.endpoint_map) {
|
2595
|
+
const std::string& endpoint_name = p.first;
|
2596
|
+
eds_map[XdsApi::ConstructFullResourceName(
|
2597
|
+
authority, XdsApi::kEdsTypeUrl, endpoint_name)] = &p.second.meta;
|
2598
|
+
}
|
2347
2599
|
}
|
2348
2600
|
// Assemble config dump messages
|
2349
2601
|
return api_.AssembleClientConfig(resource_type_metadata_map);
|
@@ -2501,7 +2753,7 @@ void XdsClientArgDestroy(void* p) {
|
|
2501
2753
|
xds_client->Unref(DEBUG_LOCATION, "channel arg");
|
2502
2754
|
}
|
2503
2755
|
|
2504
|
-
int XdsClientArgCmp(void* p, void* q) { return
|
2756
|
+
int XdsClientArgCmp(void* p, void* q) { return QsortCompare(p, q); }
|
2505
2757
|
|
2506
2758
|
const grpc_arg_pointer_vtable kXdsClientArgVtable = {
|
2507
2759
|
XdsClientArgCopy, XdsClientArgDestroy, XdsClientArgCmp};
|