grpc 1.40.0 → 1.43.1
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 +137 -82
- 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 +164 -95
- data/include/grpc/event_engine/internal/memory_allocator_impl.h +68 -0
- data/include/grpc/event_engine/memory_allocator.h +226 -0
- data/include/grpc/event_engine/memory_request.h +57 -0
- data/include/grpc/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 +294 -145
- data/include/grpc/grpc_security_constants.h +2 -14
- 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 +37 -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 +21 -24
- data/src/core/ext/filters/client_channel/backend_metric.h +3 -2
- 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 +256 -308
- data/src/core/ext/filters/client_channel/client_channel.h +80 -32
- 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 +15 -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 +5 -5
- 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 +5 -4
- data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +20 -21
- 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 +169 -92
- 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 +3 -4
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +4 -4
- 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 +5 -6
- 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 +47 -99
- 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 +97 -41
- 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 +55 -109
- data/src/core/ext/filters/client_channel/lb_policy.h +96 -103
- 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 +16 -18
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +3 -2
- 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 +17 -20
- 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 +10 -5
- 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 +11 -17
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +283 -349
- 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 +12 -15
- data/src/core/ext/filters/client_channel/resolver_registry.h +1 -2
- 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 +48 -86
- 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 +89 -147
- 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 +28 -26
- 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 +50 -68
- data/src/core/ext/filters/http/client_authority_filter.cc +16 -16
- data/src/core/ext/filters/http/http_filters_plugin.cc +51 -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 +72 -84
- 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/server_config_selector/server_config_selector.cc +67 -0
- data/src/core/ext/filters/server_config_selector/server_config_selector.h +70 -0
- data/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc +265 -0
- data/src/core/ext/filters/{workarounds/workaround_cronet_compression_filter.h → server_config_selector/server_config_selector_filter.h} +11 -6
- 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 +10 -12
- data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +26 -29
- data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc +9 -8
- data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +33 -54
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +66 -70
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +2 -4
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +7 -5
- data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc +11 -15
- 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 +120 -134
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +4 -2
- data/src/core/ext/transport/chttp2/transport/context_list.cc +2 -3
- data/src/core/ext/transport/chttp2/transport/context_list.h +3 -5
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +62 -43
- data/src/core/ext/transport/chttp2/transport/flow_control.h +15 -9
- 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 +378 -668
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +272 -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 +792 -1041
- 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/ext/transport/chttp2/transport/hpack_utils.h +30 -0
- data/src/core/ext/transport/chttp2/transport/internal.h +14 -9
- 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 +126 -119
- data/src/core/ext/transport/inproc/inproc_transport.h +1 -1
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c +198 -166
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h +223 -89
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c +42 -1
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +19 -1
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +27 -3
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +18 -5
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +108 -83
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +153 -61
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +189 -161
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +173 -69
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c +36 -23
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h +33 -13
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +279 -211
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +370 -102
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c +17 -6
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h +13 -5
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +37 -26
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +13 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +57 -40
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +73 -29
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c +17 -6
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h +13 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +172 -126
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +256 -85
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +52 -37
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +53 -21
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c +16 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h +13 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c +26 -14
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h +23 -9
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +115 -91
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +133 -53
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +91 -72
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +98 -33
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c +18 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h +13 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +122 -93
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +166 -57
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +14 -3
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h +13 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c +22 -10
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h +23 -9
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +19 -8
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +13 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +23 -12
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +13 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c +18 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h +13 -5
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +42 -28
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h +33 -13
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +82 -32
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +176 -17
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c +59 -44
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h +53 -21
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c +16 -5
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h +13 -5
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +74 -58
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +63 -25
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +82 -65
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +73 -29
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +26 -15
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +13 -5
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +20 -8
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +23 -9
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c +64 -46
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h +83 -33
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c +76 -45
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h +143 -43
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +101 -77
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +107 -29
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +42 -29
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +33 -13
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +516 -446
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +620 -267
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c +27 -14
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h +33 -13
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +22 -10
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h +23 -9
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c +14 -3
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +13 -5
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c +36 -21
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h +53 -21
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +45 -32
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +33 -13
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +23 -12
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +13 -5
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +211 -183
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +193 -77
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c +8 -1
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h +6 -4
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +75 -45
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +120 -34
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +34 -21
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +33 -13
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +88 -70
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +110 -55
- data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c +13 -2
- data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h +13 -5
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c +13 -2
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h +13 -5
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +76 -59
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +63 -25
- data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c +13 -2
- data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h +13 -5
- data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c +13 -2
- data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h +13 -5
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +26 -14
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h +23 -9
- data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c +13 -2
- data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h +13 -5
- data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c +13 -2
- data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h +13 -5
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c +62 -47
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h +53 -21
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c +27 -13
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h +43 -17
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c +24 -11
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h +27 -9
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c +18 -7
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h +13 -5
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c +17 -6
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h +13 -5
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c +16 -5
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h +13 -5
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +28 -15
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h +33 -13
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +26 -14
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h +23 -9
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c +21 -9
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h +23 -9
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c +31 -18
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h +33 -13
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c +39 -22
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h +73 -29
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c +42 -27
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h +53 -21
- data/src/core/ext/upb-generated/envoy/type/v3/http.upb.c +8 -1
- data/src/core/ext/upb-generated/envoy/type/v3/http.upb.h +3 -1
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c +18 -6
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h +23 -9
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.c +23 -10
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.h +33 -13
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c +16 -5
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h +13 -5
- data/src/core/ext/upb-generated/google/api/annotations.upb.c +21 -1
- data/src/core/ext/upb-generated/google/api/annotations.upb.h +8 -1
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c +117 -94
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h +113 -45
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/eval.upb.c +102 -0
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/eval.upb.h +306 -0
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/explain.upb.c +56 -0
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/explain.upb.h +135 -0
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +123 -99
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +123 -49
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/value.upb.c +115 -0
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/value.upb.h +371 -0
- data/src/core/ext/upb-generated/google/api/http.upb.c +36 -23
- data/src/core/ext/upb-generated/google/api/http.upb.h +33 -13
- data/src/core/ext/upb-generated/google/protobuf/any.upb.c +15 -4
- data/src/core/ext/upb-generated/google/protobuf/any.upb.h +13 -5
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +248 -211
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +273 -109
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.c +15 -4
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +13 -5
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.c +13 -2
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.h +13 -5
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +38 -24
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +33 -13
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +15 -4
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +13 -5
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +38 -19
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +93 -37
- data/src/core/ext/upb-generated/google/rpc/status.upb.c +18 -7
- data/src/core/ext/upb-generated/google/rpc/status.upb.h +13 -5
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +27 -15
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +13 -5
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +106 -84
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +103 -41
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c +21 -9
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +23 -9
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c +17 -5
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +23 -9
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +66 -48
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +115 -63
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c +68 -0
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h +156 -0
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +68 -8
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +58 -13
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.c +28 -6
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.h +18 -5
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c +20 -1
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +8 -1
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.c +28 -4
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.h +18 -5
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c +27 -3
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h +18 -5
- data/src/core/ext/upb-generated/validate/validate.upb.c +321 -252
- data/src/core/ext/upb-generated/validate/validate.upb.h +251 -93
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c +103 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h +199 -0
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.c +15 -4
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.h +13 -5
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c +26 -14
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h +23 -9
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c +21 -9
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h +13 -5
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.c +20 -9
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.h +13 -5
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c +29 -17
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h +23 -9
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c +20 -9
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h +13 -5
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c +71 -0
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h +132 -0
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c +44 -0
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h +85 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c +2 -49
- data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c +2 -2
- data/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c +2 -35
- data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +2 -41
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c +2 -11
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +407 -434
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c +2 -19
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +100 -138
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +2 -15
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c +2 -9
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c +2 -33
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +61 -77
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +61 -79
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c +2 -9
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c +2 -13
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +87 -75
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c +2 -15
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +2 -17
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c +2 -19
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c +2 -9
- data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c +2 -21
- data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c +29 -39
- 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.upbdefs.c +2 -11
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +803 -894
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c +2 -11
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c +2 -9
- data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c +2 -15
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c +2 -11
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +98 -143
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c +2 -2
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +132 -129
- 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/secret.upbdefs.c +2 -11
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +180 -190
- data/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c +2 -19
- data/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c +2 -9
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c +2 -15
- data/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c +2 -13
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c +16 -22
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c +2 -11
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c +2 -9
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c +2 -9
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c +2 -11
- data/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c +2 -19
- data/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c +2 -15
- data/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c +2 -2
- data/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c +2 -9
- data/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c +2 -11
- data/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c +2 -2
- data/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c +2 -11
- data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c +105 -162
- data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c +2 -13
- data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c +2 -23
- data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c +2 -7
- data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c +7 -15
- data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c +21 -30
- data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c +6 -5
- data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c +7 -10
- data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c +7 -11
- data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c +2 -51
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c +64 -0
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h +50 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c +15 -19
- data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c +27 -33
- data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c +18 -24
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c +19 -23
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c +35 -41
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c +21 -25
- data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c +40 -0
- data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h +35 -0
- data/src/core/ext/xds/certificate_provider_registry.cc +3 -3
- data/src/core/ext/xds/certificate_provider_store.h +1 -1
- data/src/core/ext/xds/xds_api.cc +1386 -1440
- data/src/core/ext/xds/xds_api.h +152 -115
- data/src/core/ext/xds/xds_bootstrap.cc +33 -55
- 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_certificate_provider.h +1 -2
- data/src/core/ext/xds/xds_channel_stack_modifier.cc +112 -0
- data/src/core/ext/xds/xds_channel_stack_modifier.h +52 -0
- data/src/core/ext/xds/xds_client.cc +793 -437
- data/src/core/ext/xds/xds_client.h +83 -69
- 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_routing.cc +247 -0
- data/src/core/ext/xds/xds_routing.h +98 -0
- data/src/core/ext/xds/xds_server_config_fetcher.cc +976 -264
- 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.h +389 -88
- data/src/core/lib/backoff/backoff.cc +3 -3
- data/src/core/lib/channel/channel_args.cc +27 -8
- data/src/core/lib/channel/channel_args.h +11 -1
- data/src/core/lib/channel/channel_args_preconditioning.cc +47 -0
- data/src/core/lib/channel/channel_args_preconditioning.h +62 -0
- data/src/core/lib/channel/channel_stack.cc +5 -3
- data/src/core/lib/channel/channel_stack_builder.cc +3 -15
- data/src/core/lib/channel/channel_stack_builder.h +0 -8
- data/src/core/lib/channel/channel_trace.cc +11 -10
- 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 +15 -10
- data/src/core/lib/compression/compression_args.h +6 -4
- 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 +98 -0
- data/src/core/lib/config/core_configuration.h +157 -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 +4 -3
- data/src/core/lib/event_engine/{endpoint_config.cc → channel_args_endpoint_config.cc} +2 -2
- data/src/core/lib/event_engine/{endpoint_config_internal.h → channel_args_endpoint_config.h} +3 -3
- data/src/core/lib/event_engine/event_engine.cc +0 -13
- data/src/core/lib/event_engine/event_engine_factory.cc +49 -0
- data/src/core/lib/event_engine/event_engine_factory.h +33 -0
- data/src/core/lib/event_engine/memory_allocator.cc +70 -0
- data/src/core/lib/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 +125 -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/cpp_impl_of.h +45 -0
- 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 +14 -14
- data/src/core/lib/gprpp/global_config_env.h +2 -2
- data/src/core/lib/gprpp/global_config_generic.h +2 -2
- data/src/core/lib/gprpp/manual_constructor.h +10 -8
- 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 +4 -4
- data/src/core/lib/gprpp/ref_counted.h +19 -19
- data/src/core/lib/gprpp/ref_counted_ptr.h +2 -4
- data/src/core/lib/gprpp/status_helper.cc +27 -7
- data/src/core/lib/gprpp/status_helper.h +13 -2
- data/src/core/lib/gprpp/sync.h +3 -1
- data/src/core/lib/gprpp/table.h +423 -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 +219 -197
- data/src/core/lib/http/httpcli.h +14 -9
- 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 +11 -10
- data/src/core/lib/iomgr/buffer_list.h +14 -15
- data/src/core/lib/iomgr/call_combiner.cc +30 -12
- 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 -4
- data/src/core/lib/iomgr/endpoint_cfstream.cc +15 -42
- data/src/core/lib/iomgr/endpoint_cfstream.h +4 -4
- 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 +11 -9
- data/src/core/lib/iomgr/endpoint_pair_windows.cc +5 -6
- 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 +7 -27
- data/src/core/lib/iomgr/event_engine/endpoint.h +1 -2
- data/src/core/lib/iomgr/event_engine/iomgr.cc +7 -28
- data/src/core/lib/iomgr/event_engine/pollset.cc +5 -4
- data/src/core/lib/iomgr/event_engine/resolver.cc +14 -9
- data/src/core/lib/iomgr/event_engine/tcp.cc +66 -34
- data/src/core/lib/iomgr/event_engine/timer.cc +10 -4
- data/src/core/lib/iomgr/exec_ctx.cc +4 -13
- data/src/core/lib/iomgr/exec_ctx.h +22 -30
- 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 +20 -38
- data/src/core/lib/iomgr/executor.h +1 -1
- 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/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.h +2 -0
- data/src/core/lib/iomgr/tcp_client_cfstream.cc +7 -23
- data/src/core/lib/iomgr/tcp_client_custom.cc +6 -20
- data/src/core/lib/iomgr/tcp_client_posix.cc +14 -24
- data/src/core/lib/iomgr/tcp_client_posix.h +3 -1
- data/src/core/lib/iomgr/tcp_client_windows.cc +7 -9
- data/src/core/lib/iomgr/tcp_custom.cc +12 -51
- data/src/core/lib/iomgr/tcp_custom.h +1 -1
- data/src/core/lib/iomgr/tcp_posix.cc +51 -87
- data/src/core/lib/iomgr/tcp_posix.h +9 -12
- data/src/core/lib/iomgr/tcp_server.h +4 -3
- data/src/core/lib/iomgr/tcp_server_custom.cc +7 -34
- data/src/core/lib/iomgr/tcp_server_posix.cc +15 -13
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +21 -17
- 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 +6 -10
- data/src/core/lib/iomgr/tcp_windows.cc +5 -29
- data/src/core/lib/iomgr/tcp_windows.h +1 -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 +4 -6
- data/src/core/lib/iomgr/unix_sockets_posix.h +3 -4
- data/src/core/lib/iomgr/unix_sockets_posix_noop.cc +1 -1
- 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 +115 -44
- data/src/core/lib/iomgr/work_serializer.h +17 -5
- data/src/core/lib/json/json_reader.cc +92 -52
- data/src/core/lib/json/json_util.cc +69 -1
- 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/promise/activity.cc +115 -0
- data/src/core/lib/promise/activity.h +499 -0
- data/src/core/lib/promise/context.h +86 -0
- data/src/core/lib/promise/detail/basic_seq.h +407 -0
- data/src/core/lib/promise/detail/promise_factory.h +189 -0
- data/src/core/lib/promise/detail/promise_like.h +85 -0
- data/src/core/lib/promise/detail/status.h +44 -0
- data/src/core/lib/promise/detail/switch.h +1455 -0
- data/src/core/lib/promise/exec_ctx_wakeup_scheduler.h +48 -0
- data/src/core/lib/promise/loop.h +108 -0
- data/src/core/lib/promise/map.h +88 -0
- data/src/core/lib/promise/poll.h +60 -0
- data/src/core/lib/promise/race.h +84 -0
- data/src/core/lib/promise/seq.h +71 -0
- data/src/core/lib/resource_quota/api.cc +108 -0
- data/src/core/lib/resource_quota/api.h +41 -0
- data/src/core/lib/resource_quota/memory_quota.cc +454 -0
- data/src/core/lib/resource_quota/memory_quota.h +421 -0
- data/src/core/lib/resource_quota/resource_quota.cc +33 -0
- data/src/core/lib/resource_quota/resource_quota.h +58 -0
- data/src/core/lib/{transport/authority_override.h → resource_quota/thread_quota.cc} +22 -16
- data/src/core/lib/resource_quota/thread_quota.h +57 -0
- data/src/core/lib/{iomgr/event_engine/iomgr.h → resource_quota/trace.cc} +4 -9
- data/src/core/lib/resource_quota/trace.h +24 -0
- 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 +22 -24
- data/src/core/lib/security/authorization/evaluate_args.h +2 -1
- data/src/core/lib/security/authorization/sdk_server_authz_filter.cc +173 -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 +24 -38
- 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 +69 -43
- 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 +5 -8
- 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 +60 -10
- 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 +9 -17
- data/src/core/lib/security/credentials/jwt/jwt_verifier.h +3 -3
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +21 -29
- 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 +13 -13
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +13 -12
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc +201 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h +106 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +11 -90
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +21 -84
- data/src/core/lib/security/credentials/tls/tls_credentials.cc +21 -10
- data/src/core/lib/security/credentials/xds/xds_credentials.cc +28 -33
- data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +3 -3
- data/src/core/lib/security/security_connector/alts/alts_security_connector.h +2 -2
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +9 -12
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc +2 -2
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +7 -7
- data/src/core/lib/security/security_connector/load_system_roots_fallback.cc +1 -0
- data/src/core/lib/security/security_connector/load_system_roots_linux.cc +4 -5
- data/src/core/lib/security/security_connector/local/local_security_connector.cc +4 -1
- data/src/core/lib/security/security_connector/security_connector.cc +9 -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 +13 -6
- data/src/core/lib/security/security_connector/ssl_utils.h +1 -1
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +345 -200
- data/src/core/lib/security/security_connector/tls/tls_security_connector.h +64 -43
- 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 +80 -49
- 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 +84 -97
- data/src/core/lib/slice/percent_encoding.h +23 -28
- data/src/core/lib/slice/slice.cc +9 -26
- data/src/core/lib/slice/slice.h +341 -0
- data/src/core/lib/{gpr/tls_pthread.cc → slice/slice_api.cc} +15 -6
- data/src/core/lib/slice/slice_buffer.cc +10 -7
- data/src/core/lib/slice/slice_intern.cc +11 -17
- 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 +125 -0
- data/src/core/lib/slice/slice_refcount_base.h +181 -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 +377 -0
- data/src/core/lib/slice/static_slice.h +300 -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/lib/surface/builtins.h +26 -0
- data/src/core/lib/surface/byte_buffer_reader.cc +1 -1
- data/src/core/lib/surface/call.cc +180 -170
- 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 +20 -45
- data/src/core/lib/surface/channel.h +6 -13
- 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 -49
- 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 +46 -31
- 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 +57 -65
- data/src/core/lib/surface/server.h +34 -30
- 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 +2 -2
- data/src/core/lib/transport/byte_stream.cc +4 -0
- 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 +19 -16
- data/src/core/lib/transport/metadata_batch.cc +40 -371
- data/src/core/lib/transport/metadata_batch.h +986 -69
- data/src/core/lib/transport/parsed_metadata.cc +35 -0
- data/src/core/lib/transport/parsed_metadata.h +382 -0
- data/src/core/lib/transport/pid_controller.cc +4 -4
- data/src/core/lib/transport/static_metadata.cc +632 -849
- data/src/core/lib/transport/static_metadata.h +115 -397
- data/src/core/lib/transport/status_metadata.cc +1 -0
- data/src/core/lib/transport/transport.cc +8 -31
- data/src/core/lib/transport/transport.h +0 -1
- data/src/core/lib/transport/transport_op_string.cc +40 -20
- data/src/core/lib/uri/uri_parser.cc +19 -19
- data/src/core/lib/uri/uri_parser.h +2 -0
- data/src/core/plugin_registry/grpc_plugin_registry.cc +78 -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 +4 -5
- 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 +43 -80
- 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 +51 -12
- data/src/core/tsi/ssl_transport_security.h +4 -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 +10 -10
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +15 -15
- 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/algorithm/container.h +101 -91
- data/third_party/abseil-cpp/absl/base/attributes.h +64 -31
- data/third_party/abseil-cpp/absl/base/config.h +67 -37
- data/third_party/abseil-cpp/absl/base/dynamic_annotations.h +1 -26
- data/third_party/abseil-cpp/absl/base/internal/spinlock.h +3 -1
- data/third_party/abseil-cpp/absl/base/internal/spinlock_wait.h +2 -0
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +69 -0
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.cc +4 -4
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.h +15 -10
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +16 -0
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +4 -4
- data/third_party/abseil-cpp/absl/base/options.h +1 -1
- data/third_party/abseil-cpp/absl/container/fixed_array.h +0 -5
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +105 -97
- data/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h +17 -15
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +18 -102
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +37 -78
- data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +388 -423
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +3 -2
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +14 -8
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +251 -120
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +11 -1
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc +12 -11
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h +6 -2
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h +12 -5
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc +110 -0
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +234 -0
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +25 -7
- data/third_party/abseil-cpp/absl/debugging/internal/symbolize.h +8 -2
- data/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc +21 -3
- data/third_party/abseil-cpp/absl/debugging/stacktrace.cc +2 -0
- data/third_party/abseil-cpp/absl/debugging/symbolize.cc +2 -0
- data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +14 -0
- data/third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc +72 -0
- data/third_party/abseil-cpp/absl/functional/function_ref.h +4 -1
- data/third_party/abseil-cpp/absl/hash/hash.h +22 -0
- data/third_party/abseil-cpp/absl/hash/internal/hash.cc +15 -16
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +88 -37
- data/third_party/abseil-cpp/absl/hash/internal/{wyhash.cc → low_level_hash.cc} +23 -11
- data/third_party/abseil-cpp/absl/hash/internal/{wyhash.h → low_level_hash.h} +14 -12
- data/third_party/abseil-cpp/absl/memory/memory.h +1 -1
- data/third_party/abseil-cpp/absl/meta/type_traits.h +32 -2
- data/third_party/abseil-cpp/absl/numeric/int128.cc +3 -10
- data/third_party/abseil-cpp/absl/numeric/int128.h +146 -73
- data/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc +19 -25
- data/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc +73 -70
- data/third_party/abseil-cpp/absl/{base → profiling}/internal/exponential_biased.cc +4 -4
- data/third_party/abseil-cpp/absl/{base → profiling}/internal/exponential_biased.h +6 -6
- data/third_party/abseil-cpp/absl/profiling/internal/sample_recorder.h +230 -0
- data/third_party/abseil-cpp/absl/status/internal/status_internal.h +5 -5
- data/third_party/abseil-cpp/absl/status/status.cc +9 -17
- data/third_party/abseil-cpp/absl/status/status.h +19 -15
- data/third_party/abseil-cpp/absl/status/statusor.cc +34 -2
- data/third_party/abseil-cpp/absl/status/statusor.h +31 -21
- data/third_party/abseil-cpp/absl/strings/charconv.cc +3 -3
- data/third_party/abseil-cpp/absl/strings/charconv.h +3 -2
- data/third_party/abseil-cpp/absl/strings/cord.cc +453 -359
- data/third_party/abseil-cpp/absl/strings/cord.h +197 -70
- data/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.cc +6 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +140 -63
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +1128 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h +939 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc +185 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.h +265 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.cc +68 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.h +211 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.cc +129 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.h +50 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h +7 -7
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.cc +55 -181
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.h +42 -24
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring_reader.h +4 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_functions.cc +96 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_functions.h +85 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.cc +139 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.h +131 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +445 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.h +298 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_statistics.h +87 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_update_scope.h +71 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_update_tracker.h +121 -0
- data/third_party/abseil-cpp/absl/strings/internal/resize_uninitialized.h +48 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +8 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc +3 -4
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +6 -6
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +36 -18
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc +62 -73
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +24 -16
- data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +35 -35
- data/third_party/abseil-cpp/absl/strings/numbers.cc +1 -1
- data/third_party/abseil-cpp/absl/strings/numbers.h +34 -0
- data/third_party/abseil-cpp/absl/strings/str_cat.cc +4 -4
- data/third_party/abseil-cpp/absl/strings/str_format.h +1 -2
- data/third_party/abseil-cpp/absl/strings/string_view.cc +16 -21
- data/third_party/abseil-cpp/absl/strings/string_view.h +120 -39
- data/third_party/abseil-cpp/absl/strings/substitute.cc +2 -1
- data/third_party/abseil-cpp/absl/strings/substitute.h +99 -74
- data/third_party/abseil-cpp/absl/synchronization/blocking_counter.cc +25 -15
- data/third_party/abseil-cpp/absl/synchronization/blocking_counter.h +5 -3
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc +1 -1
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +3 -3
- data/third_party/abseil-cpp/absl/time/civil_time.cc +1 -3
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h +93 -20
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.h +2 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc +83 -21
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +49 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc +2 -3
- data/third_party/abseil-cpp/absl/time/time.h +67 -36
- data/third_party/abseil-cpp/absl/types/bad_optional_access.h +1 -1
- data/third_party/abseil-cpp/absl/types/bad_variant_access.h +2 -2
- data/third_party/abseil-cpp/absl/types/span.h +3 -3
- data/third_party/address_sorting/address_sorting_posix.c +1 -0
- data/third_party/boringssl-with-bazel/err_data.c +685 -673
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_bitstr.c +67 -54
- 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 +55 -37
- 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 +4 -4
- 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_lib.c +59 -47
- data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_par.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/asn_pack.c +24 -28
- data/third_party/boringssl-with-bazel/src/crypto/{x509 → asn1}/charmap.h +0 -0
- data/third_party/boringssl-with-bazel/src/crypto/asn1/f_int.c +5 -0
- data/third_party/boringssl-with-bazel/src/crypto/asn1/{asn1_locl.h → internal.h} +86 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_dec.c +57 -281
- 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_typ.c +8 -6
- 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/ber.c +3 -1
- 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/evp_asn1.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/evp/scrypt.c +32 -34
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/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/self_check/self_check.c +7 -7
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha1.c +35 -35
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha256.c +11 -10
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha512.c +10 -37
- data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +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 +32 -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/internal.h +5 -1
- data/third_party/boringssl-with-bazel/src/crypto/pool/pool.c +59 -22
- 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/asn1_gen.c +2 -18
- 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 +233 -4
- 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 +232 -11
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_cache.c +2 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_data.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_lib.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_map.c +2 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_node.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_tree.c +5 -4
- 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 +18 -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 -7
- 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 +23 -4
- 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 +1504 -561
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1t.h +5 -12
- data/third_party/boringssl-with-bazel/src/include/openssl/base.h +10 -6
- 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/dh.h +4 -12
- data/third_party/boringssl-with-bazel/src/include/openssl/digest.h +3 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/dsa.h +17 -41
- data/third_party/boringssl-with-bazel/src/include/openssl/ec_key.h +12 -27
- data/third_party/boringssl-with-bazel/src/include/openssl/ecdsa.h +8 -10
- data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +35 -55
- 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 +15 -14
- data/third_party/boringssl-with-bazel/src/include/openssl/pool.h +7 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/rsa.h +29 -28
- data/third_party/boringssl-with-bazel/src/include/openssl/span.h +37 -15
- data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +87 -24
- data/third_party/boringssl-with-bazel/src/include/openssl/tls1.h +31 -32
- data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +725 -189
- 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 +52 -16
- 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 +90 -51
- 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_versions.cc +4 -0
- 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 +383 -183
- 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} +39 -8
- data/third_party/upb/upb/def.c +489 -254
- data/third_party/upb/upb/def.h +86 -33
- data/third_party/upb/upb/def.hpp +46 -4
- data/third_party/upb/upb/encode.c +137 -44
- data/third_party/upb/upb/encode.h +29 -2
- data/third_party/upb/upb/msg.c +182 -28
- data/third_party/upb/upb/msg.h +75 -580
- data/third_party/upb/upb/msg_internal.h +769 -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 +126 -94
- data/third_party/upb/upb/reflection.h +42 -10
- 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 +35 -7
- data/third_party/upb/upb/text_encode.h +26 -0
- data/third_party/upb/upb/upb.c +67 -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 +182 -107
- 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/avl/avl.cc +0 -306
- 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/resource_quota.cc +0 -1019
- data/src/core/lib/iomgr/resource_quota.h +0 -177
- 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/boringssl-with-bazel/src/crypto/asn1/f_enum.c +0 -93
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_int.h +0 -217
- 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,12 +71,50 @@ 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;
|
77
78
|
|
78
79
|
} // namespace
|
79
80
|
|
81
|
+
class XdsClient::Notifier {
|
82
|
+
public:
|
83
|
+
// Helper template function to invoke `OnError()` on a list of watchers \a
|
84
|
+
// watchers_list within \a work_serializer. Works with all 4 resource types.
|
85
|
+
template <class T>
|
86
|
+
static void ScheduleNotifyWatchersOnErrorInWorkSerializer(
|
87
|
+
XdsClient* xds_client, const T& watchers_list, grpc_error_handle error,
|
88
|
+
const DebugLocation& location) {
|
89
|
+
xds_client->work_serializer_.Schedule(
|
90
|
+
[watchers_list, error]()
|
91
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client->work_serializer_) {
|
92
|
+
for (const auto& p : watchers_list) {
|
93
|
+
p.first->OnError(GRPC_ERROR_REF(error));
|
94
|
+
}
|
95
|
+
GRPC_ERROR_UNREF(error);
|
96
|
+
},
|
97
|
+
location);
|
98
|
+
}
|
99
|
+
|
100
|
+
// Helper template function to invoke `OnResourceDoesNotExist()` on a list of
|
101
|
+
// watchers \a watchers_list within \a work_serializer. Works with all 4
|
102
|
+
// resource types.
|
103
|
+
template <class T>
|
104
|
+
static void ScheduleNotifyWatchersOnResourceDoesNotExistInWorkSerializer(
|
105
|
+
XdsClient* xds_client, const T& watchers_list,
|
106
|
+
const DebugLocation& location) {
|
107
|
+
xds_client->work_serializer_.Schedule(
|
108
|
+
[watchers_list]()
|
109
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client->work_serializer_) {
|
110
|
+
for (const auto& p : watchers_list) {
|
111
|
+
p.first->OnResourceDoesNotExist();
|
112
|
+
}
|
113
|
+
},
|
114
|
+
location);
|
115
|
+
}
|
116
|
+
};
|
117
|
+
|
80
118
|
//
|
81
119
|
// Internal class declarations
|
82
120
|
//
|
@@ -87,7 +125,7 @@ template <typename T>
|
|
87
125
|
class XdsClient::ChannelState::RetryableCall
|
88
126
|
: public InternallyRefCounted<RetryableCall<T>> {
|
89
127
|
public:
|
90
|
-
explicit RetryableCall(
|
128
|
+
explicit RetryableCall(WeakRefCountedPtr<ChannelState> chand);
|
91
129
|
|
92
130
|
void Orphan() override;
|
93
131
|
|
@@ -108,7 +146,7 @@ class XdsClient::ChannelState::RetryableCall
|
|
108
146
|
// every time we start a new call. It's null during call retry backoff.
|
109
147
|
OrphanablePtr<T> calld_;
|
110
148
|
// The owning xds channel.
|
111
|
-
|
149
|
+
WeakRefCountedPtr<ChannelState> chand_;
|
112
150
|
|
113
151
|
// Retry state.
|
114
152
|
BackOff backoff_;
|
@@ -134,9 +172,11 @@ class XdsClient::ChannelState::AdsCallState
|
|
134
172
|
XdsClient* xds_client() const { return chand()->xds_client(); }
|
135
173
|
bool seen_response() const { return seen_response_; }
|
136
174
|
|
137
|
-
void SubscribeLocked(const std::string& type_url,
|
175
|
+
void SubscribeLocked(const std::string& type_url,
|
176
|
+
const XdsApi::ResourceName& name)
|
138
177
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
139
|
-
void UnsubscribeLocked(const std::string& type_url,
|
178
|
+
void UnsubscribeLocked(const std::string& type_url,
|
179
|
+
const XdsApi::ResourceName& name,
|
140
180
|
bool delay_unsubscription)
|
141
181
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
142
182
|
|
@@ -145,23 +185,20 @@ class XdsClient::ChannelState::AdsCallState
|
|
145
185
|
private:
|
146
186
|
class ResourceState : public InternallyRefCounted<ResourceState> {
|
147
187
|
public:
|
148
|
-
ResourceState(const std::string& type_url, const
|
149
|
-
|
150
|
-
: type_url_(type_url),
|
151
|
-
name_(name),
|
152
|
-
sent_initial_request_(sent_initial_request) {
|
188
|
+
ResourceState(const std::string& type_url, const XdsApi::ResourceName& name)
|
189
|
+
: type_url_(type_url), name_(name) {
|
153
190
|
GRPC_CLOSURE_INIT(&timer_callback_, OnTimer, this,
|
154
191
|
grpc_schedule_on_exec_ctx);
|
155
192
|
}
|
156
193
|
|
157
194
|
void Orphan() override {
|
158
|
-
|
195
|
+
MaybeCancelTimer();
|
159
196
|
Unref(DEBUG_LOCATION, "Orphan");
|
160
197
|
}
|
161
198
|
|
162
|
-
void
|
163
|
-
if (
|
164
|
-
|
199
|
+
void MaybeStartTimer(RefCountedPtr<AdsCallState> ads_calld) {
|
200
|
+
if (timer_started_) return;
|
201
|
+
timer_started_ = true;
|
165
202
|
ads_calld_ = std::move(ads_calld);
|
166
203
|
Ref(DEBUG_LOCATION, "timer").release();
|
167
204
|
timer_pending_ = true;
|
@@ -171,7 +208,7 @@ class XdsClient::ChannelState::AdsCallState
|
|
171
208
|
&timer_callback_);
|
172
209
|
}
|
173
210
|
|
174
|
-
void
|
211
|
+
void MaybeCancelTimer() {
|
175
212
|
if (timer_pending_) {
|
176
213
|
grpc_timer_cancel(&timer_);
|
177
214
|
timer_pending_ = false;
|
@@ -185,6 +222,7 @@ class XdsClient::ChannelState::AdsCallState
|
|
185
222
|
MutexLock lock(&self->ads_calld_->xds_client()->mu_);
|
186
223
|
self->OnTimerLocked(GRPC_ERROR_REF(error));
|
187
224
|
}
|
225
|
+
self->ads_calld_->xds_client()->work_serializer_.DrainQueue();
|
188
226
|
self->ads_calld_.reset();
|
189
227
|
self->Unref(DEBUG_LOCATION, "timer");
|
190
228
|
}
|
@@ -193,42 +231,44 @@ class XdsClient::ChannelState::AdsCallState
|
|
193
231
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_) {
|
194
232
|
if (error == GRPC_ERROR_NONE && timer_pending_) {
|
195
233
|
timer_pending_ = false;
|
196
|
-
grpc_error_handle watcher_error =
|
197
|
-
absl::StrFormat(
|
234
|
+
grpc_error_handle watcher_error =
|
235
|
+
GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
|
198
236
|
"timeout obtaining resource {type=%s name=%s} from xds server",
|
199
|
-
type_url_,
|
200
|
-
.
|
237
|
+
type_url_,
|
238
|
+
XdsApi::ConstructFullResourceName(name_.authority, type_url_,
|
239
|
+
name_.id)));
|
201
240
|
watcher_error = grpc_error_set_int(
|
202
241
|
watcher_error, GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
|
203
242
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
204
243
|
gpr_log(GPR_INFO, "[xds_client %p] %s", ads_calld_->xds_client(),
|
205
244
|
grpc_error_std_string(watcher_error).c_str());
|
206
245
|
}
|
246
|
+
auto& authority_state =
|
247
|
+
ads_calld_->xds_client()->authority_state_map_[name_.authority];
|
207
248
|
if (type_url_ == XdsApi::kLdsTypeUrl) {
|
208
|
-
ListenerState& state =
|
249
|
+
ListenerState& state = authority_state.listener_map[name_.id];
|
209
250
|
state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
|
210
|
-
|
211
|
-
|
212
|
-
|
251
|
+
Notifier::ScheduleNotifyWatchersOnErrorInWorkSerializer(
|
252
|
+
ads_calld_->xds_client(), state.watchers,
|
253
|
+
GRPC_ERROR_REF(watcher_error), DEBUG_LOCATION);
|
213
254
|
} else if (type_url_ == XdsApi::kRdsTypeUrl) {
|
214
|
-
RouteConfigState& state =
|
215
|
-
ads_calld_->xds_client()->route_config_map_[name_];
|
255
|
+
RouteConfigState& state = authority_state.route_config_map[name_.id];
|
216
256
|
state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
|
217
|
-
|
218
|
-
|
219
|
-
|
257
|
+
Notifier::ScheduleNotifyWatchersOnErrorInWorkSerializer(
|
258
|
+
ads_calld_->xds_client(), state.watchers,
|
259
|
+
GRPC_ERROR_REF(watcher_error), DEBUG_LOCATION);
|
220
260
|
} else if (type_url_ == XdsApi::kCdsTypeUrl) {
|
221
|
-
ClusterState& state =
|
261
|
+
ClusterState& state = authority_state.cluster_map[name_.id];
|
222
262
|
state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
|
223
|
-
|
224
|
-
|
225
|
-
|
263
|
+
Notifier::ScheduleNotifyWatchersOnErrorInWorkSerializer(
|
264
|
+
ads_calld_->xds_client(), state.watchers,
|
265
|
+
GRPC_ERROR_REF(watcher_error), DEBUG_LOCATION);
|
226
266
|
} else if (type_url_ == XdsApi::kEdsTypeUrl) {
|
227
|
-
EndpointState& state =
|
267
|
+
EndpointState& state = authority_state.endpoint_map[name_.id];
|
228
268
|
state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
|
229
|
-
|
230
|
-
|
231
|
-
|
269
|
+
Notifier::ScheduleNotifyWatchersOnErrorInWorkSerializer(
|
270
|
+
ads_calld_->xds_client(), state.watchers,
|
271
|
+
GRPC_ERROR_REF(watcher_error), DEBUG_LOCATION);
|
232
272
|
} else {
|
233
273
|
GPR_UNREACHABLE_CODE(return );
|
234
274
|
}
|
@@ -238,10 +278,10 @@ class XdsClient::ChannelState::AdsCallState
|
|
238
278
|
}
|
239
279
|
|
240
280
|
const std::string type_url_;
|
241
|
-
const
|
281
|
+
const XdsApi::ResourceName name_;
|
242
282
|
|
243
283
|
RefCountedPtr<AdsCallState> ads_calld_;
|
244
|
-
bool
|
284
|
+
bool timer_started_ = false;
|
245
285
|
bool timer_pending_ = false;
|
246
286
|
grpc_timer timer_;
|
247
287
|
grpc_closure timer_callback_;
|
@@ -255,30 +295,41 @@ class XdsClient::ChannelState::AdsCallState
|
|
255
295
|
grpc_error_handle error = GRPC_ERROR_NONE;
|
256
296
|
|
257
297
|
// Subscribed resources of this type.
|
258
|
-
std::map<std::string /*
|
298
|
+
std::map<std::string /*authority*/,
|
299
|
+
std::map<std::string /*name*/, OrphanablePtr<ResourceState>>>
|
259
300
|
subscribed_resources;
|
260
301
|
};
|
261
302
|
|
262
303
|
void SendMessageLocked(const std::string& type_url)
|
263
304
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
264
305
|
|
265
|
-
void AcceptLdsUpdateLocked(
|
266
|
-
|
306
|
+
void AcceptLdsUpdateLocked(
|
307
|
+
std::string version, grpc_millis update_time,
|
308
|
+
XdsApi::LdsUpdateMap lds_update_map,
|
309
|
+
const std::set<XdsApi::ResourceName>& resource_names_failed)
|
267
310
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
268
311
|
void AcceptRdsUpdateLocked(std::string version, grpc_millis update_time,
|
269
312
|
XdsApi::RdsUpdateMap rds_update_map)
|
270
313
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
271
|
-
void AcceptCdsUpdateLocked(
|
272
|
-
|
314
|
+
void AcceptCdsUpdateLocked(
|
315
|
+
std::string version, grpc_millis update_time,
|
316
|
+
XdsApi::CdsUpdateMap cds_update_map,
|
317
|
+
const std::set<XdsApi::ResourceName>& resource_names_failed)
|
273
318
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
274
319
|
void AcceptEdsUpdateLocked(std::string version, grpc_millis update_time,
|
275
320
|
XdsApi::EdsUpdateMap eds_update_map)
|
276
321
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
277
322
|
|
278
323
|
template <typename StateMap>
|
324
|
+
void RejectAdsUpdateHelperLocked(const std::string& resource_name,
|
325
|
+
grpc_millis update_time,
|
326
|
+
const XdsApi::AdsParseResult& result,
|
327
|
+
const std::string& error_details,
|
328
|
+
StateMap* state_map)
|
329
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
330
|
+
|
279
331
|
void RejectAdsUpdateLocked(grpc_millis update_time,
|
280
|
-
const XdsApi::AdsParseResult& result
|
281
|
-
StateMap* state_map)
|
332
|
+
const XdsApi::AdsParseResult& result)
|
282
333
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
283
334
|
|
284
335
|
static void OnRequestSent(void* arg, grpc_error_handle error);
|
@@ -293,8 +344,9 @@ class XdsClient::ChannelState::AdsCallState
|
|
293
344
|
|
294
345
|
bool IsCurrentCallOnChannel() const;
|
295
346
|
|
296
|
-
std::
|
297
|
-
|
347
|
+
std::map<absl::string_view /*authority*/,
|
348
|
+
std::set<absl::string_view /*name*/>>
|
349
|
+
ResourceNamesForRequest(const std::string& type_url);
|
298
350
|
|
299
351
|
// The owning RetryableCall<>.
|
300
352
|
RefCountedPtr<RetryableCall<AdsCallState>> parent_;
|
@@ -439,27 +491,30 @@ class XdsClient::ChannelState::LrsCallState
|
|
439
491
|
class XdsClient::ChannelState::StateWatcher
|
440
492
|
: public AsyncConnectivityStateWatcherInterface {
|
441
493
|
public:
|
442
|
-
explicit StateWatcher(
|
494
|
+
explicit StateWatcher(WeakRefCountedPtr<ChannelState> parent)
|
443
495
|
: parent_(std::move(parent)) {}
|
444
496
|
|
445
497
|
private:
|
446
498
|
void OnConnectivityStateChange(grpc_connectivity_state new_state,
|
447
499
|
const absl::Status& status) override {
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
500
|
+
{
|
501
|
+
MutexLock lock(&parent_->xds_client_->mu_);
|
502
|
+
if (!parent_->shutting_down_ &&
|
503
|
+
new_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
|
504
|
+
// In TRANSIENT_FAILURE. Notify all watchers of error.
|
505
|
+
gpr_log(GPR_INFO,
|
506
|
+
"[xds_client %p] xds channel in state:TRANSIENT_FAILURE "
|
507
|
+
"status_message:(%s)",
|
508
|
+
parent_->xds_client(), status.ToString().c_str());
|
509
|
+
parent_->xds_client_->NotifyOnErrorLocked(
|
510
|
+
GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
511
|
+
"xds channel in TRANSIENT_FAILURE"));
|
512
|
+
}
|
459
513
|
}
|
514
|
+
parent_->xds_client()->work_serializer_.DrainQueue();
|
460
515
|
}
|
461
516
|
|
462
|
-
|
517
|
+
WeakRefCountedPtr<ChannelState> parent_;
|
463
518
|
};
|
464
519
|
|
465
520
|
//
|
@@ -481,7 +536,7 @@ grpc_channel* CreateXdsChannel(grpc_channel_args* args,
|
|
481
536
|
|
482
537
|
XdsClient::ChannelState::ChannelState(WeakRefCountedPtr<XdsClient> xds_client,
|
483
538
|
const XdsBootstrap::XdsServer& server)
|
484
|
-
:
|
539
|
+
: DualRefCounted<ChannelState>(
|
485
540
|
GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace)
|
486
541
|
? "ChannelState"
|
487
542
|
: nullptr),
|
@@ -505,12 +560,19 @@ XdsClient::ChannelState::~ChannelState() {
|
|
505
560
|
xds_client_.reset(DEBUG_LOCATION, "ChannelState");
|
506
561
|
}
|
507
562
|
|
508
|
-
|
563
|
+
// This method should only ever be called when holding the lock, but we can't
|
564
|
+
// use a ABSL_EXCLUSIVE_LOCKS_REQUIRED annotation, because Orphan() will be
|
565
|
+
// called from DualRefCounted::Unref, which cannot have a lock annotation for a
|
566
|
+
// lock in this subclass.
|
567
|
+
void XdsClient::ChannelState::Orphan() ABSL_NO_THREAD_SAFETY_ANALYSIS {
|
509
568
|
shutting_down_ = true;
|
510
569
|
CancelConnectivityWatchLocked();
|
570
|
+
// At this time, all strong refs are removed, remove from channel map to
|
571
|
+
// prevent subsequent subscription from trying to use this ChannelState as it
|
572
|
+
// is shutting down.
|
573
|
+
xds_client_->xds_server_channel_map_.erase(server_);
|
511
574
|
ads_calld_.reset();
|
512
575
|
lrs_calld_.reset();
|
513
|
-
Unref(DEBUG_LOCATION, "ChannelState+orphaned");
|
514
576
|
}
|
515
577
|
|
516
578
|
XdsClient::ChannelState::AdsCallState* XdsClient::ChannelState::ads_calld()
|
@@ -529,8 +591,8 @@ bool XdsClient::ChannelState::HasActiveAdsCall() const {
|
|
529
591
|
|
530
592
|
void XdsClient::ChannelState::MaybeStartLrsCall() {
|
531
593
|
if (lrs_calld_ != nullptr) return;
|
532
|
-
lrs_calld_.reset(
|
533
|
-
|
594
|
+
lrs_calld_.reset(new RetryableCall<LrsCallState>(
|
595
|
+
WeakRef(DEBUG_LOCATION, "ChannelState+lrs")));
|
534
596
|
}
|
535
597
|
|
536
598
|
void XdsClient::ChannelState::StopLrsCall() { lrs_calld_.reset(); }
|
@@ -538,7 +600,7 @@ void XdsClient::ChannelState::StopLrsCall() { lrs_calld_.reset(); }
|
|
538
600
|
void XdsClient::ChannelState::StartConnectivityWatchLocked() {
|
539
601
|
ClientChannel* client_channel = ClientChannel::GetFromChannel(channel_);
|
540
602
|
GPR_ASSERT(client_channel != nullptr);
|
541
|
-
watcher_ = new StateWatcher(
|
603
|
+
watcher_ = new StateWatcher(WeakRef(DEBUG_LOCATION, "ChannelState+watch"));
|
542
604
|
client_channel->AddConnectivityWatcher(
|
543
605
|
GRPC_CHANNEL_IDLE,
|
544
606
|
OrphanablePtr<AsyncConnectivityStateWatcherInterface>(watcher_));
|
@@ -550,12 +612,12 @@ void XdsClient::ChannelState::CancelConnectivityWatchLocked() {
|
|
550
612
|
client_channel->RemoveConnectivityWatcher(watcher_);
|
551
613
|
}
|
552
614
|
|
553
|
-
void XdsClient::ChannelState::SubscribeLocked(
|
554
|
-
|
615
|
+
void XdsClient::ChannelState::SubscribeLocked(
|
616
|
+
const std::string& type_url, const XdsApi::ResourceName& name) {
|
555
617
|
if (ads_calld_ == nullptr) {
|
556
618
|
// Start the ADS call if this is the first request.
|
557
619
|
ads_calld_.reset(new RetryableCall<AdsCallState>(
|
558
|
-
|
620
|
+
WeakRef(DEBUG_LOCATION, "ChannelState+ads")));
|
559
621
|
// Note: AdsCallState's ctor will automatically subscribe to all
|
560
622
|
// resources that the XdsClient already has watchers for, so we can
|
561
623
|
// return here.
|
@@ -568,14 +630,16 @@ void XdsClient::ChannelState::SubscribeLocked(const std::string& type_url,
|
|
568
630
|
ads_calld()->SubscribeLocked(type_url, name);
|
569
631
|
}
|
570
632
|
|
571
|
-
void XdsClient::ChannelState::UnsubscribeLocked(
|
572
|
-
|
573
|
-
|
633
|
+
void XdsClient::ChannelState::UnsubscribeLocked(
|
634
|
+
const std::string& type_url, const XdsApi::ResourceName& name,
|
635
|
+
bool delay_unsubscription) {
|
574
636
|
if (ads_calld_ != nullptr) {
|
575
637
|
auto* calld = ads_calld_->calld();
|
576
638
|
if (calld != nullptr) {
|
577
639
|
calld->UnsubscribeLocked(type_url, name, delay_unsubscription);
|
578
|
-
if (!calld->HasSubscribedResources())
|
640
|
+
if (!calld->HasSubscribedResources()) {
|
641
|
+
ads_calld_.reset();
|
642
|
+
}
|
579
643
|
}
|
580
644
|
}
|
581
645
|
}
|
@@ -586,7 +650,7 @@ void XdsClient::ChannelState::UnsubscribeLocked(const std::string& type_url,
|
|
586
650
|
|
587
651
|
template <typename T>
|
588
652
|
XdsClient::ChannelState::RetryableCall<T>::RetryableCall(
|
589
|
-
|
653
|
+
WeakRefCountedPtr<ChannelState> chand)
|
590
654
|
: chand_(std::move(chand)),
|
591
655
|
backoff_(
|
592
656
|
BackOff::Options()
|
@@ -644,7 +708,8 @@ void XdsClient::ChannelState::RetryableCall<T>::StartRetryTimerLocked() {
|
|
644
708
|
if (shutting_down_) return;
|
645
709
|
const grpc_millis next_attempt_time = backoff_.NextAttemptTime();
|
646
710
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
647
|
-
grpc_millis timeout =
|
711
|
+
grpc_millis timeout =
|
712
|
+
std::max(next_attempt_time - ExecCtx::Get()->Now(), grpc_millis(0));
|
648
713
|
gpr_log(GPR_INFO,
|
649
714
|
"[xds_client %p] Failed to connect to xds server (chand: %p) "
|
650
715
|
"retry timer will fire in %" PRId64 "ms.",
|
@@ -735,17 +800,26 @@ XdsClient::ChannelState::AdsCallState::AdsCallState(
|
|
735
800
|
// Op: send request message.
|
736
801
|
GRPC_CLOSURE_INIT(&on_request_sent_, OnRequestSent, this,
|
737
802
|
grpc_schedule_on_exec_ctx);
|
738
|
-
for (const auto&
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
803
|
+
for (const auto& a : xds_client()->authority_state_map_) {
|
804
|
+
const std::string& authority = a.first;
|
805
|
+
// Skip authorities that are not using this xDS channel.
|
806
|
+
if (a.second.channel_state != chand()) continue;
|
807
|
+
for (const auto& l : a.second.listener_map) {
|
808
|
+
const std::string& listener_name = l.first;
|
809
|
+
SubscribeLocked(XdsApi::kLdsTypeUrl, {authority, listener_name});
|
810
|
+
}
|
811
|
+
for (const auto& r : a.second.route_config_map) {
|
812
|
+
const std::string& route_config_name = r.first;
|
813
|
+
SubscribeLocked(XdsApi::kRdsTypeUrl, {authority, route_config_name});
|
814
|
+
}
|
815
|
+
for (const auto& c : a.second.cluster_map) {
|
816
|
+
const std::string& cluster_name = c.first;
|
817
|
+
SubscribeLocked(XdsApi::kCdsTypeUrl, {authority, cluster_name});
|
818
|
+
}
|
819
|
+
for (const auto& e : a.second.endpoint_map) {
|
820
|
+
const std::string& endpoint_name = e.first;
|
821
|
+
SubscribeLocked(XdsApi::kEdsTypeUrl, {authority, endpoint_name});
|
822
|
+
}
|
749
823
|
}
|
750
824
|
// Op: recv initial metadata.
|
751
825
|
op = ops;
|
@@ -818,11 +892,12 @@ void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
|
|
818
892
|
}
|
819
893
|
auto& state = state_map_[type_url];
|
820
894
|
grpc_slice request_payload_slice;
|
821
|
-
std::
|
822
|
-
|
895
|
+
std::map<absl::string_view /*authority*/,
|
896
|
+
std::set<absl::string_view /*name*/>>
|
897
|
+
resource_map = ResourceNamesForRequest(type_url);
|
823
898
|
request_payload_slice = xds_client()->api_.CreateAdsRequest(
|
824
|
-
chand()->server_, type_url,
|
825
|
-
|
899
|
+
chand()->server_, type_url, resource_map,
|
900
|
+
chand()->resource_type_version_map_[type_url], state.nonce,
|
826
901
|
GRPC_ERROR_REF(state.error), !sent_initial_message_);
|
827
902
|
if (type_url != XdsApi::kLdsTypeUrl && type_url != XdsApi::kRdsTypeUrl &&
|
828
903
|
type_url != XdsApi::kCdsTypeUrl && type_url != XdsApi::kEdsTypeUrl) {
|
@@ -832,11 +907,10 @@ void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
|
|
832
907
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
833
908
|
gpr_log(GPR_INFO,
|
834
909
|
"[xds_client %p] sending ADS request: type=%s version=%s nonce=%s "
|
835
|
-
"error=%s
|
910
|
+
"error=%s",
|
836
911
|
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());
|
912
|
+
chand()->resource_type_version_map_[type_url].c_str(),
|
913
|
+
state.nonce.c_str(), grpc_error_std_string(state.error).c_str());
|
840
914
|
}
|
841
915
|
GRPC_ERROR_UNREF(state.error);
|
842
916
|
state.error = GRPC_ERROR_NONE;
|
@@ -863,19 +937,24 @@ void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
|
|
863
937
|
}
|
864
938
|
|
865
939
|
void XdsClient::ChannelState::AdsCallState::SubscribeLocked(
|
866
|
-
const std::string& type_url, const
|
867
|
-
auto& state =
|
940
|
+
const std::string& type_url, const XdsApi::ResourceName& name) {
|
941
|
+
auto& state =
|
942
|
+
state_map_[type_url].subscribed_resources[name.authority][name.id];
|
868
943
|
if (state == nullptr) {
|
869
|
-
state = MakeOrphanable<ResourceState>(
|
870
|
-
type_url, name, !xds_client()->resource_version_map_[type_url].empty());
|
944
|
+
state = MakeOrphanable<ResourceState>(type_url, name);
|
871
945
|
SendMessageLocked(type_url);
|
872
946
|
}
|
873
947
|
}
|
874
948
|
|
875
949
|
void XdsClient::ChannelState::AdsCallState::UnsubscribeLocked(
|
876
|
-
const std::string& type_url, const
|
950
|
+
const std::string& type_url, const XdsApi::ResourceName& name,
|
877
951
|
bool delay_unsubscription) {
|
878
|
-
state_map_[type_url]
|
952
|
+
auto& type_state_map = state_map_[type_url];
|
953
|
+
auto& authority_map = type_state_map.subscribed_resources[name.authority];
|
954
|
+
authority_map.erase(name.id);
|
955
|
+
if (authority_map.empty()) {
|
956
|
+
type_state_map.subscribed_resources.erase(name.authority);
|
957
|
+
}
|
879
958
|
if (!delay_unsubscription) SendMessageLocked(type_url);
|
880
959
|
}
|
881
960
|
|
@@ -904,7 +983,8 @@ XdsApi::ResourceMetadata CreateResourceMetadataAcked(
|
|
904
983
|
|
905
984
|
void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdateLocked(
|
906
985
|
std::string version, grpc_millis update_time,
|
907
|
-
XdsApi::LdsUpdateMap lds_update_map
|
986
|
+
XdsApi::LdsUpdateMap lds_update_map,
|
987
|
+
const std::set<XdsApi::ResourceName>& resource_names_failed) {
|
908
988
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
909
989
|
gpr_log(GPR_INFO,
|
910
990
|
"[xds_client %p] LDS update received containing %" PRIuPTR
|
@@ -912,30 +992,37 @@ void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdateLocked(
|
|
912
992
|
xds_client(), lds_update_map.size());
|
913
993
|
}
|
914
994
|
auto& lds_state = state_map_[XdsApi::kLdsTypeUrl];
|
915
|
-
std::set<std::string> rds_resource_names_seen;
|
916
995
|
for (auto& p : lds_update_map) {
|
917
|
-
const
|
996
|
+
const XdsApi::ResourceName& name = p.first;
|
918
997
|
XdsApi::LdsUpdate& lds_update = p.second.resource;
|
919
|
-
auto
|
920
|
-
if (
|
998
|
+
auto it = lds_state.subscribed_resources.find(name.authority);
|
999
|
+
if (it != lds_state.subscribed_resources.end()) {
|
1000
|
+
auto res_it = it->second.find(name.id);
|
1001
|
+
if (res_it != it->second.end()) {
|
1002
|
+
res_it->second->MaybeCancelTimer();
|
1003
|
+
}
|
1004
|
+
}
|
921
1005
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
922
1006
|
gpr_log(GPR_INFO, "[xds_client %p] LDS resource %s: %s", xds_client(),
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
1007
|
+
XdsApi::ConstructFullResourceName(name.authority,
|
1008
|
+
XdsApi::kLdsTypeUrl, name.id)
|
1009
|
+
.c_str(),
|
1010
|
+
lds_update.ToString().c_str());
|
1011
|
+
}
|
1012
|
+
ListenerState& listener_state = xds_client()
|
1013
|
+
->authority_state_map_[name.authority]
|
1014
|
+
.listener_map[name.id];
|
930
1015
|
// Ignore identical update.
|
931
|
-
ListenerState& listener_state = xds_client()->listener_map_[listener_name];
|
932
1016
|
if (listener_state.update.has_value() &&
|
933
1017
|
*listener_state.update == lds_update) {
|
934
1018
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
935
1019
|
gpr_log(GPR_INFO,
|
936
1020
|
"[xds_client %p] LDS update for %s identical to current, "
|
937
1021
|
"ignoring.",
|
938
|
-
xds_client(),
|
1022
|
+
xds_client(),
|
1023
|
+
XdsApi::ConstructFullResourceName(name.authority,
|
1024
|
+
XdsApi::kLdsTypeUrl, name.id)
|
1025
|
+
.c_str());
|
939
1026
|
}
|
940
1027
|
continue;
|
941
1028
|
}
|
@@ -944,43 +1031,52 @@ void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdateLocked(
|
|
944
1031
|
listener_state.meta = CreateResourceMetadataAcked(
|
945
1032
|
std::move(p.second.serialized_proto), version, update_time);
|
946
1033
|
// Notify watchers.
|
947
|
-
|
948
|
-
|
1034
|
+
auto& watchers_list = listener_state.watchers;
|
1035
|
+
auto& value = listener_state.update.value();
|
1036
|
+
xds_client()->work_serializer_.Schedule(
|
1037
|
+
[watchers_list, value]()
|
1038
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client()->work_serializer_) {
|
1039
|
+
for (const auto& p : watchers_list) {
|
1040
|
+
p.first->OnListenerChanged(value);
|
1041
|
+
}
|
1042
|
+
},
|
1043
|
+
DEBUG_LOCATION);
|
1044
|
+
}
|
1045
|
+
// For invalid resources in the update, if they are already in the
|
1046
|
+
// cache, pretend that they are present in the update, so that we
|
1047
|
+
// don't incorrectly consider them deleted below.
|
1048
|
+
for (const auto& name : resource_names_failed) {
|
1049
|
+
auto& listener_map =
|
1050
|
+
xds_client()->authority_state_map_[name.authority].listener_map;
|
1051
|
+
auto it = listener_map.find(name.id);
|
1052
|
+
if (it != listener_map.end()) {
|
1053
|
+
auto& update = it->second.update;
|
1054
|
+
if (!update.has_value()) continue;
|
1055
|
+
lds_update_map[name];
|
949
1056
|
}
|
950
1057
|
}
|
951
1058
|
// For any subscribed resource that is not present in the update,
|
952
1059
|
// 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
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
// does not exist.
|
974
|
-
auto& rds_state = state_map_[XdsApi::kRdsTypeUrl];
|
975
|
-
for (const auto& p : rds_state.subscribed_resources) {
|
976
|
-
const std::string& rds_resource_name = p.first;
|
977
|
-
if (rds_resource_names_seen.find(rds_resource_name) ==
|
978
|
-
rds_resource_names_seen.end()) {
|
979
|
-
RouteConfigState& route_config_state =
|
980
|
-
xds_client()->route_config_map_[rds_resource_name];
|
981
|
-
route_config_state.update.reset();
|
982
|
-
for (const auto& p : route_config_state.watchers) {
|
983
|
-
p.first->OnResourceDoesNotExist();
|
1060
|
+
for (const auto& a : lds_state.subscribed_resources) {
|
1061
|
+
const std::string& authority_name = a.first;
|
1062
|
+
for (const auto& p : a.second) {
|
1063
|
+
const std::string& listener_name = p.first;
|
1064
|
+
if (lds_update_map.find({authority_name, listener_name}) ==
|
1065
|
+
lds_update_map.end()) {
|
1066
|
+
ListenerState& listener_state =
|
1067
|
+
xds_client()
|
1068
|
+
->authority_state_map_[authority_name]
|
1069
|
+
.listener_map[listener_name];
|
1070
|
+
// If the resource was newly requested but has not yet been received,
|
1071
|
+
// we don't want to generate an error for the watchers, because this LDS
|
1072
|
+
// response may be in reaction to an earlier request that did not yet
|
1073
|
+
// request the new resource, so its absence from the response does not
|
1074
|
+
// necessarily indicate that the resource does not exist.
|
1075
|
+
// For that case, we rely on the request timeout instead.
|
1076
|
+
if (!listener_state.update.has_value()) continue;
|
1077
|
+
listener_state.update.reset();
|
1078
|
+
Notifier::ScheduleNotifyWatchersOnResourceDoesNotExistInWorkSerializer(
|
1079
|
+
xds_client(), listener_state.watchers, DEBUG_LOCATION);
|
984
1080
|
}
|
985
1081
|
}
|
986
1082
|
}
|
@@ -997,16 +1093,23 @@ void XdsClient::ChannelState::AdsCallState::AcceptRdsUpdateLocked(
|
|
997
1093
|
}
|
998
1094
|
auto& rds_state = state_map_[XdsApi::kRdsTypeUrl];
|
999
1095
|
for (auto& p : rds_update_map) {
|
1000
|
-
const
|
1096
|
+
const XdsApi::ResourceName& name = p.first;
|
1001
1097
|
XdsApi::RdsUpdate& rds_update = p.second.resource;
|
1002
|
-
auto
|
1003
|
-
if (
|
1098
|
+
auto it = rds_state.subscribed_resources.find(name.authority);
|
1099
|
+
if (it != rds_state.subscribed_resources.end()) {
|
1100
|
+
auto res_it = it->second.find(name.id);
|
1101
|
+
if (res_it != it->second.end()) {
|
1102
|
+
res_it->second->MaybeCancelTimer();
|
1103
|
+
}
|
1104
|
+
}
|
1004
1105
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1005
1106
|
gpr_log(GPR_INFO, "[xds_client %p] RDS resource:\n%s", xds_client(),
|
1006
1107
|
rds_update.ToString().c_str());
|
1007
1108
|
}
|
1008
1109
|
RouteConfigState& route_config_state =
|
1009
|
-
xds_client()
|
1110
|
+
xds_client()
|
1111
|
+
->authority_state_map_[name.authority]
|
1112
|
+
.route_config_map[name.id];
|
1010
1113
|
// Ignore identical update.
|
1011
1114
|
if (route_config_state.update.has_value() &&
|
1012
1115
|
*route_config_state.update == rds_update) {
|
@@ -1022,15 +1125,23 @@ void XdsClient::ChannelState::AdsCallState::AcceptRdsUpdateLocked(
|
|
1022
1125
|
route_config_state.meta = CreateResourceMetadataAcked(
|
1023
1126
|
std::move(p.second.serialized_proto), version, update_time);
|
1024
1127
|
// Notify all watchers.
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1128
|
+
auto& watchers_list = route_config_state.watchers;
|
1129
|
+
auto& value = route_config_state.update.value();
|
1130
|
+
xds_client()->work_serializer_.Schedule(
|
1131
|
+
[watchers_list, value]()
|
1132
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client()->work_serializer_) {
|
1133
|
+
for (const auto& p : watchers_list) {
|
1134
|
+
p.first->OnRouteConfigChanged(value);
|
1135
|
+
}
|
1136
|
+
},
|
1137
|
+
DEBUG_LOCATION);
|
1028
1138
|
}
|
1029
1139
|
}
|
1030
1140
|
|
1031
1141
|
void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdateLocked(
|
1032
1142
|
std::string version, grpc_millis update_time,
|
1033
|
-
XdsApi::CdsUpdateMap cds_update_map
|
1143
|
+
XdsApi::CdsUpdateMap cds_update_map,
|
1144
|
+
const std::set<XdsApi::ResourceName>& resource_names_failed) {
|
1034
1145
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1035
1146
|
gpr_log(GPR_INFO,
|
1036
1147
|
"[xds_client %p] CDS update received containing %" PRIuPTR
|
@@ -1038,22 +1149,26 @@ void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdateLocked(
|
|
1038
1149
|
xds_client(), cds_update_map.size());
|
1039
1150
|
}
|
1040
1151
|
auto& cds_state = state_map_[XdsApi::kCdsTypeUrl];
|
1041
|
-
std::set<std::string> eds_resource_names_seen;
|
1042
1152
|
for (auto& p : cds_update_map) {
|
1043
|
-
const
|
1153
|
+
const XdsApi::ResourceName& name = p.first;
|
1044
1154
|
XdsApi::CdsUpdate& cds_update = p.second.resource;
|
1045
|
-
auto
|
1046
|
-
if (
|
1155
|
+
auto it = cds_state.subscribed_resources.find(name.authority);
|
1156
|
+
if (it != cds_state.subscribed_resources.end()) {
|
1157
|
+
auto res_it = it->second.find(name.id);
|
1158
|
+
if (res_it != it->second.end()) {
|
1159
|
+
res_it->second->MaybeCancelTimer();
|
1160
|
+
}
|
1161
|
+
}
|
1047
1162
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1048
1163
|
gpr_log(GPR_INFO, "[xds_client %p] cluster=%s: %s", xds_client(),
|
1049
|
-
|
1164
|
+
XdsApi::ConstructFullResourceName(name.authority,
|
1165
|
+
XdsApi::kCdsTypeUrl, name.id)
|
1166
|
+
.c_str(),
|
1167
|
+
cds_update.ToString().c_str());
|
1050
1168
|
}
|
1051
|
-
|
1052
|
-
|
1053
|
-
? cluster_name
|
1054
|
-
: cds_update.eds_service_name);
|
1169
|
+
ClusterState& cluster_state =
|
1170
|
+
xds_client()->authority_state_map_[name.authority].cluster_map[name.id];
|
1055
1171
|
// Ignore identical update.
|
1056
|
-
ClusterState& cluster_state = xds_client()->cluster_map_[cluster_name];
|
1057
1172
|
if (cluster_state.update.has_value() &&
|
1058
1173
|
*cluster_state.update == cds_update) {
|
1059
1174
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
@@ -1068,42 +1183,51 @@ void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdateLocked(
|
|
1068
1183
|
cluster_state.meta = CreateResourceMetadataAcked(
|
1069
1184
|
std::move(p.second.serialized_proto), version, update_time);
|
1070
1185
|
// Notify all watchers.
|
1071
|
-
|
1072
|
-
|
1186
|
+
auto& watchers_list = cluster_state.watchers;
|
1187
|
+
auto& value = cluster_state.update.value();
|
1188
|
+
xds_client()->work_serializer_.Schedule(
|
1189
|
+
[watchers_list, value]()
|
1190
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client()->work_serializer_) {
|
1191
|
+
for (const auto& p : watchers_list) {
|
1192
|
+
p.first->OnClusterChanged(value);
|
1193
|
+
}
|
1194
|
+
},
|
1195
|
+
DEBUG_LOCATION);
|
1196
|
+
}
|
1197
|
+
// For invalid resources in the update, if they are already in the
|
1198
|
+
// cache, pretend that they are present in the update, so that we
|
1199
|
+
// don't incorrectly consider them deleted below.
|
1200
|
+
for (const auto& name : resource_names_failed) {
|
1201
|
+
auto& cluster_map =
|
1202
|
+
xds_client()->authority_state_map_[name.authority].cluster_map;
|
1203
|
+
auto it = cluster_map.find(name.id);
|
1204
|
+
if (it != cluster_map.end()) {
|
1205
|
+
auto& update = it->second.update;
|
1206
|
+
if (!update.has_value()) continue;
|
1207
|
+
cds_update_map[name];
|
1073
1208
|
}
|
1074
1209
|
}
|
1075
1210
|
// For any subscribed resource that is not present in the update,
|
1076
1211
|
// 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
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
// does not exist.
|
1097
|
-
auto& eds_state = state_map_[XdsApi::kEdsTypeUrl];
|
1098
|
-
for (const auto& p : eds_state.subscribed_resources) {
|
1099
|
-
const std::string& eds_resource_name = p.first;
|
1100
|
-
if (eds_resource_names_seen.find(eds_resource_name) ==
|
1101
|
-
eds_resource_names_seen.end()) {
|
1102
|
-
EndpointState& endpoint_state =
|
1103
|
-
xds_client()->endpoint_map_[eds_resource_name];
|
1104
|
-
endpoint_state.update.reset();
|
1105
|
-
for (const auto& p : endpoint_state.watchers) {
|
1106
|
-
p.first->OnResourceDoesNotExist();
|
1212
|
+
for (const auto& a : cds_state.subscribed_resources) {
|
1213
|
+
const std::string& authority = a.first;
|
1214
|
+
for (const auto& p : a.second) {
|
1215
|
+
const std::string& cluster_name = p.first;
|
1216
|
+
if (cds_update_map.find({authority, cluster_name}) ==
|
1217
|
+
cds_update_map.end()) {
|
1218
|
+
ClusterState& cluster_state = xds_client()
|
1219
|
+
->authority_state_map_[authority]
|
1220
|
+
.cluster_map[cluster_name];
|
1221
|
+
// If the resource was newly requested but has not yet been received,
|
1222
|
+
// we don't want to generate an error for the watchers, because this CDS
|
1223
|
+
// response may be in reaction to an earlier request that did not yet
|
1224
|
+
// request the new resource, so its absence from the response does not
|
1225
|
+
// necessarily indicate that the resource does not exist.
|
1226
|
+
// For that case, we rely on the request timeout instead.
|
1227
|
+
if (!cluster_state.update.has_value()) continue;
|
1228
|
+
cluster_state.update.reset();
|
1229
|
+
Notifier::ScheduleNotifyWatchersOnResourceDoesNotExistInWorkSerializer(
|
1230
|
+
xds_client(), cluster_state.watchers, DEBUG_LOCATION);
|
1107
1231
|
}
|
1108
1232
|
}
|
1109
1233
|
}
|
@@ -1120,16 +1244,25 @@ void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdateLocked(
|
|
1120
1244
|
}
|
1121
1245
|
auto& eds_state = state_map_[XdsApi::kEdsTypeUrl];
|
1122
1246
|
for (auto& p : eds_update_map) {
|
1123
|
-
const
|
1247
|
+
const XdsApi::ResourceName& name = p.first;
|
1124
1248
|
XdsApi::EdsUpdate& eds_update = p.second.resource;
|
1125
|
-
auto
|
1126
|
-
if (
|
1249
|
+
auto it = eds_state.subscribed_resources.find(name.authority);
|
1250
|
+
if (it != eds_state.subscribed_resources.end()) {
|
1251
|
+
auto res_it = it->second.find(name.id);
|
1252
|
+
if (res_it != it->second.end()) {
|
1253
|
+
res_it->second->MaybeCancelTimer();
|
1254
|
+
}
|
1255
|
+
}
|
1127
1256
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1128
1257
|
gpr_log(GPR_INFO, "[xds_client %p] EDS resource %s: %s", xds_client(),
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1258
|
+
XdsApi::ConstructFullResourceName(name.authority,
|
1259
|
+
XdsApi::kCdsTypeUrl, name.id)
|
1260
|
+
.c_str(),
|
1261
|
+
eds_update.ToString().c_str());
|
1262
|
+
}
|
1263
|
+
EndpointState& endpoint_state = xds_client()
|
1264
|
+
->authority_state_map_[name.authority]
|
1265
|
+
.endpoint_map[name.id];
|
1133
1266
|
// Ignore identical update.
|
1134
1267
|
if (endpoint_state.update.has_value() &&
|
1135
1268
|
*endpoint_state.update == eds_update) {
|
@@ -1145,9 +1278,16 @@ void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdateLocked(
|
|
1145
1278
|
endpoint_state.meta = CreateResourceMetadataAcked(
|
1146
1279
|
std::move(p.second.serialized_proto), version, update_time);
|
1147
1280
|
// Notify all watchers.
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1281
|
+
auto& watchers_list = endpoint_state.watchers;
|
1282
|
+
auto& value = endpoint_state.update.value();
|
1283
|
+
xds_client()->work_serializer_.Schedule(
|
1284
|
+
[watchers_list, value]()
|
1285
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client()->work_serializer_) {
|
1286
|
+
for (const auto& p : watchers_list) {
|
1287
|
+
p.first->OnEndpointChanged(value);
|
1288
|
+
}
|
1289
|
+
},
|
1290
|
+
DEBUG_LOCATION);
|
1151
1291
|
}
|
1152
1292
|
}
|
1153
1293
|
|
@@ -1167,28 +1307,50 @@ void UpdateResourceMetadataNacked(const std::string& version,
|
|
1167
1307
|
} // namespace
|
1168
1308
|
|
1169
1309
|
template <typename StateMap>
|
1170
|
-
void XdsClient::ChannelState::AdsCallState::
|
1171
|
-
|
1310
|
+
void XdsClient::ChannelState::AdsCallState::RejectAdsUpdateHelperLocked(
|
1311
|
+
const std::string& resource_name, grpc_millis update_time,
|
1312
|
+
const XdsApi::AdsParseResult& result, const std::string& error_details,
|
1172
1313
|
StateMap* state_map) {
|
1314
|
+
auto it = state_map->find(resource_name);
|
1315
|
+
if (it == state_map->end()) return;
|
1316
|
+
auto& state = it->second;
|
1317
|
+
Notifier::ScheduleNotifyWatchersOnErrorInWorkSerializer(
|
1318
|
+
xds_client(), state.watchers, GRPC_ERROR_REF(result.parse_error),
|
1319
|
+
DEBUG_LOCATION);
|
1320
|
+
UpdateResourceMetadataNacked(result.version, error_details, update_time,
|
1321
|
+
&state.meta);
|
1322
|
+
}
|
1323
|
+
|
1324
|
+
void XdsClient::ChannelState::AdsCallState::RejectAdsUpdateLocked(
|
1325
|
+
grpc_millis update_time, const XdsApi::AdsParseResult& result) {
|
1173
1326
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1174
1327
|
gpr_log(GPR_INFO,
|
1175
1328
|
"[xds_client %p] %s update NACKed containing %" PRIuPTR
|
1176
|
-
" resources",
|
1329
|
+
" invalid resources",
|
1177
1330
|
xds_client(), result.type_url.c_str(),
|
1178
1331
|
result.resource_names_failed.size());
|
1179
1332
|
}
|
1180
1333
|
std::string details = grpc_error_std_string(result.parse_error);
|
1181
|
-
for (auto&
|
1182
|
-
auto
|
1183
|
-
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1187
|
-
|
1334
|
+
for (auto& resource : result.resource_names_failed) {
|
1335
|
+
auto authority_it =
|
1336
|
+
xds_client()->authority_state_map_.find(resource.authority);
|
1337
|
+
if (authority_it == xds_client()->authority_state_map_.end()) continue;
|
1338
|
+
AuthorityState& authority_state = authority_it->second;
|
1339
|
+
if (result.type_url == XdsApi::kLdsTypeUrl) {
|
1340
|
+
RejectAdsUpdateHelperLocked(resource.id, update_time, result, details,
|
1341
|
+
&authority_state.listener_map);
|
1342
|
+
} else if (result.type_url == XdsApi::kRdsTypeUrl) {
|
1343
|
+
RejectAdsUpdateHelperLocked(resource.id, update_time, result, details,
|
1344
|
+
&authority_state.route_config_map);
|
1345
|
+
} else if (result.type_url == XdsApi::kCdsTypeUrl) {
|
1346
|
+
RejectAdsUpdateHelperLocked(resource.id, update_time, result, details,
|
1347
|
+
&authority_state.cluster_map);
|
1348
|
+
} else if (result.type_url == XdsApi::kEdsTypeUrl) {
|
1349
|
+
RejectAdsUpdateHelperLocked(resource.id, update_time, result, details,
|
1350
|
+
&authority_state.endpoint_map);
|
1351
|
+
} else {
|
1352
|
+
GPR_ASSERT(0);
|
1188
1353
|
}
|
1189
|
-
// Update resource metadata for CSDS.
|
1190
|
-
UpdateResourceMetadataNacked(result.version, details, update_time,
|
1191
|
-
&state.meta);
|
1192
1354
|
}
|
1193
1355
|
}
|
1194
1356
|
|
@@ -1234,6 +1396,7 @@ void XdsClient::ChannelState::AdsCallState::OnResponseReceived(
|
|
1234
1396
|
MutexLock lock(&ads_calld->xds_client()->mu_);
|
1235
1397
|
done = ads_calld->OnResponseReceivedLocked();
|
1236
1398
|
}
|
1399
|
+
ads_calld->xds_client()->work_serializer_.DrainQueue();
|
1237
1400
|
if (done) ads_calld->Unref(DEBUG_LOCATION, "ADS+OnResponseReceivedLocked");
|
1238
1401
|
}
|
1239
1402
|
|
@@ -1264,13 +1427,12 @@ bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
|
|
1264
1427
|
xds_client(), grpc_error_std_string(result.parse_error).c_str());
|
1265
1428
|
GRPC_ERROR_UNREF(result.parse_error);
|
1266
1429
|
} else {
|
1267
|
-
grpc_millis update_time =
|
1430
|
+
grpc_millis update_time = ExecCtx::Get()->Now();
|
1268
1431
|
// Update nonce.
|
1269
1432
|
auto& state = state_map_[result.type_url];
|
1270
1433
|
state.nonce = std::move(result.nonce);
|
1271
|
-
//
|
1434
|
+
// If we got an error, we'll NACK the update.
|
1272
1435
|
if (result.parse_error != GRPC_ERROR_NONE) {
|
1273
|
-
// NACK unacceptable update.
|
1274
1436
|
gpr_log(GPR_ERROR,
|
1275
1437
|
"[xds_client %p] ADS response invalid for resource type %s "
|
1276
1438
|
"version %s, will NACK: nonce=%s error=%s",
|
@@ -1282,39 +1444,32 @@ bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
|
|
1282
1444
|
GRPC_STATUS_UNAVAILABLE);
|
1283
1445
|
GRPC_ERROR_UNREF(state.error);
|
1284
1446
|
state.error = result.parse_error;
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
} else {
|
1447
|
+
RejectAdsUpdateLocked(update_time, result);
|
1448
|
+
}
|
1449
|
+
// Process any valid resources.
|
1450
|
+
bool have_valid_resources = false;
|
1451
|
+
if (result.type_url == XdsApi::kLdsTypeUrl) {
|
1452
|
+
have_valid_resources = !result.lds_update_map.empty();
|
1453
|
+
AcceptLdsUpdateLocked(result.version, update_time,
|
1454
|
+
std::move(result.lds_update_map),
|
1455
|
+
result.resource_names_failed);
|
1456
|
+
} else if (result.type_url == XdsApi::kRdsTypeUrl) {
|
1457
|
+
have_valid_resources = !result.rds_update_map.empty();
|
1458
|
+
AcceptRdsUpdateLocked(result.version, update_time,
|
1459
|
+
std::move(result.rds_update_map));
|
1460
|
+
} else if (result.type_url == XdsApi::kCdsTypeUrl) {
|
1461
|
+
have_valid_resources = !result.cds_update_map.empty();
|
1462
|
+
AcceptCdsUpdateLocked(result.version, update_time,
|
1463
|
+
std::move(result.cds_update_map),
|
1464
|
+
result.resource_names_failed);
|
1465
|
+
} else if (result.type_url == XdsApi::kEdsTypeUrl) {
|
1466
|
+
have_valid_resources = !result.eds_update_map.empty();
|
1467
|
+
AcceptEdsUpdateLocked(result.version, update_time,
|
1468
|
+
std::move(result.eds_update_map));
|
1469
|
+
}
|
1470
|
+
if (have_valid_resources) {
|
1299
1471
|
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);
|
1472
|
+
chand()->resource_type_version_map_[result.type_url] = result.version;
|
1318
1473
|
// Start load reporting if needed.
|
1319
1474
|
auto& lrs_call = chand()->lrs_calld_;
|
1320
1475
|
if (lrs_call != nullptr) {
|
@@ -1322,6 +1477,8 @@ bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
|
|
1322
1477
|
if (lrs_calld != nullptr) lrs_calld->MaybeStartReportingLocked();
|
1323
1478
|
}
|
1324
1479
|
}
|
1480
|
+
// Send ACK or NACK.
|
1481
|
+
SendMessageLocked(result.type_url);
|
1325
1482
|
}
|
1326
1483
|
if (xds_client()->shutting_down_) return true;
|
1327
1484
|
// Keep listening for updates.
|
@@ -1346,6 +1503,7 @@ void XdsClient::ChannelState::AdsCallState::OnStatusReceived(
|
|
1346
1503
|
MutexLock lock(&ads_calld->xds_client()->mu_);
|
1347
1504
|
ads_calld->OnStatusReceivedLocked(GRPC_ERROR_REF(error));
|
1348
1505
|
}
|
1506
|
+
ads_calld->xds_client()->work_serializer_.DrainQueue();
|
1349
1507
|
ads_calld->Unref(DEBUG_LOCATION, "ADS+OnStatusReceivedLocked");
|
1350
1508
|
}
|
1351
1509
|
|
@@ -1378,19 +1536,23 @@ bool XdsClient::ChannelState::AdsCallState::IsCurrentCallOnChannel() const {
|
|
1378
1536
|
return this == chand()->ads_calld_->calld();
|
1379
1537
|
}
|
1380
1538
|
|
1381
|
-
std::set<absl::string_view
|
1539
|
+
std::map<absl::string_view /*authority*/, std::set<absl::string_view /*name*/>>
|
1382
1540
|
XdsClient::ChannelState::AdsCallState::ResourceNamesForRequest(
|
1383
1541
|
const std::string& type_url) {
|
1384
|
-
std::
|
1542
|
+
std::map<absl::string_view /*authority*/,
|
1543
|
+
std::set<absl::string_view /*name*/>>
|
1544
|
+
resource_map;
|
1385
1545
|
auto it = state_map_.find(type_url);
|
1386
1546
|
if (it != state_map_.end()) {
|
1387
|
-
for (auto&
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1547
|
+
for (auto& a : it->second.subscribed_resources) {
|
1548
|
+
for (auto& p : a.second) {
|
1549
|
+
resource_map[a.first].insert(p.first);
|
1550
|
+
OrphanablePtr<ResourceState>& state = p.second;
|
1551
|
+
state->MaybeStartTimer(Ref(DEBUG_LOCATION, "ResourceState"));
|
1552
|
+
}
|
1391
1553
|
}
|
1392
1554
|
}
|
1393
|
-
return
|
1555
|
+
return resource_map;
|
1394
1556
|
}
|
1395
1557
|
|
1396
1558
|
//
|
@@ -1839,12 +2001,10 @@ grpc_millis GetRequestTimeout(const grpc_channel_args* args) {
|
|
1839
2001
|
}
|
1840
2002
|
|
1841
2003
|
grpc_channel_args* ModifyChannelArgs(const grpc_channel_args* args) {
|
1842
|
-
absl::InlinedVector<grpc_arg,
|
2004
|
+
absl::InlinedVector<grpc_arg, 1> args_to_add = {
|
1843
2005
|
grpc_channel_arg_integer_create(
|
1844
2006
|
const_cast<char*>(GRPC_ARG_KEEPALIVE_TIME_MS),
|
1845
2007
|
5 * 60 * GPR_MS_PER_SEC),
|
1846
|
-
grpc_channel_arg_integer_create(
|
1847
|
-
const_cast<char*>(GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL), 1),
|
1848
2008
|
};
|
1849
2009
|
return grpc_channel_args_copy_and_add(args, args_to_add.data(),
|
1850
2010
|
args_to_add.size());
|
@@ -1868,9 +2028,9 @@ XdsClient::XdsClient(std::unique_ptr<XdsBootstrap> bootstrap,
|
|
1868
2028
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1869
2029
|
gpr_log(GPR_INFO, "[xds_client %p] creating xds client", this);
|
1870
2030
|
}
|
1871
|
-
//
|
1872
|
-
|
1873
|
-
|
2031
|
+
// Calling grpc_init to ensure gRPC does not shut down until the XdsClient is
|
2032
|
+
// destroyed.
|
2033
|
+
grpc_init();
|
1874
2034
|
}
|
1875
2035
|
|
1876
2036
|
XdsClient::~XdsClient() {
|
@@ -1879,26 +2039,9 @@ XdsClient::~XdsClient() {
|
|
1879
2039
|
}
|
1880
2040
|
grpc_channel_args_destroy(args_);
|
1881
2041
|
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
|
-
}
|
2042
|
+
// Calling grpc_shutdown to ensure gRPC does not shut down until the XdsClient
|
2043
|
+
// is destroyed.
|
2044
|
+
grpc_shutdown();
|
1902
2045
|
}
|
1903
2046
|
|
1904
2047
|
void XdsClient::Orphan() {
|
@@ -1912,39 +2055,94 @@ void XdsClient::Orphan() {
|
|
1912
2055
|
{
|
1913
2056
|
MutexLock lock(&mu_);
|
1914
2057
|
shutting_down_ = true;
|
1915
|
-
// Orphan ChannelState object.
|
1916
|
-
chand_.reset();
|
1917
2058
|
// We do not clear cluster_map_ and endpoint_map_ if the xds client was
|
1918
2059
|
// created by the XdsResolver because the maps contain refs for watchers
|
1919
2060
|
// which in turn hold refs to the loadbalancing policies. At this point, it
|
1920
2061
|
// is possible for ADS calls to be in progress. Unreffing the loadbalancing
|
1921
2062
|
// policies before those calls are done would lead to issues such as
|
1922
2063
|
// https://github.com/grpc/grpc/issues/20928.
|
1923
|
-
|
1924
|
-
|
1925
|
-
|
2064
|
+
for (auto& a : authority_state_map_) {
|
2065
|
+
a.second.channel_state.reset();
|
2066
|
+
if (!a.second.listener_map.empty()) {
|
2067
|
+
a.second.cluster_map.clear();
|
2068
|
+
a.second.endpoint_map.clear();
|
2069
|
+
}
|
1926
2070
|
}
|
2071
|
+
// We clear these invalid resource watchers as cancel never came.
|
2072
|
+
invalid_listener_watchers_.clear();
|
2073
|
+
invalid_route_config_watchers_.clear();
|
2074
|
+
invalid_cluster_watchers_.clear();
|
2075
|
+
invalid_endpoint_watchers_.clear();
|
2076
|
+
}
|
2077
|
+
}
|
2078
|
+
|
2079
|
+
RefCountedPtr<XdsClient::ChannelState> XdsClient::GetOrCreateChannelStateLocked(
|
2080
|
+
const XdsBootstrap::XdsServer& server) {
|
2081
|
+
auto it = xds_server_channel_map_.find(server);
|
2082
|
+
if (it != xds_server_channel_map_.end()) {
|
2083
|
+
return it->second->Ref(DEBUG_LOCATION, "Authority");
|
1927
2084
|
}
|
2085
|
+
// Channel not found, so create a new one.
|
2086
|
+
auto channel_state = MakeRefCounted<ChannelState>(
|
2087
|
+
WeakRef(DEBUG_LOCATION, "ChannelState"), server);
|
2088
|
+
xds_server_channel_map_[server] = channel_state.get();
|
2089
|
+
return channel_state;
|
1928
2090
|
}
|
1929
2091
|
|
1930
2092
|
void XdsClient::WatchListenerData(
|
1931
2093
|
absl::string_view listener_name,
|
1932
|
-
|
2094
|
+
RefCountedPtr<ListenerWatcherInterface> watcher) {
|
1933
2095
|
std::string listener_name_str = std::string(listener_name);
|
1934
|
-
MutexLock lock(&mu_);
|
1935
|
-
ListenerState& listener_state = listener_map_[listener_name_str];
|
1936
2096
|
ListenerWatcherInterface* w = watcher.get();
|
1937
|
-
|
1938
|
-
|
1939
|
-
|
1940
|
-
|
1941
|
-
|
1942
|
-
|
1943
|
-
|
2097
|
+
auto resource = XdsApi::ParseResourceName(listener_name, XdsApi::IsLds);
|
2098
|
+
if (!resource.ok()) {
|
2099
|
+
{
|
2100
|
+
MutexLock lock(&mu_);
|
2101
|
+
invalid_listener_watchers_[w] = watcher;
|
2102
|
+
}
|
2103
|
+
grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
|
2104
|
+
"Unable to parse resource name for listener %s", listener_name));
|
2105
|
+
work_serializer_.Run(
|
2106
|
+
// TODO(yashykt): When we move to C++14, capture watcher using
|
2107
|
+
// std::move()
|
2108
|
+
[watcher, error]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) {
|
2109
|
+
watcher->OnError(error);
|
2110
|
+
},
|
2111
|
+
DEBUG_LOCATION);
|
2112
|
+
return;
|
2113
|
+
}
|
2114
|
+
{
|
2115
|
+
MutexLock lock(&mu_);
|
2116
|
+
AuthorityState& authority_state = authority_state_map_[resource->authority];
|
2117
|
+
ListenerState& listener_state = authority_state.listener_map[resource->id];
|
2118
|
+
listener_state.watchers[w] = watcher;
|
2119
|
+
// If we've already received an LDS update, notify the new watcher
|
2120
|
+
// immediately.
|
2121
|
+
if (listener_state.update.has_value()) {
|
2122
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2123
|
+
gpr_log(GPR_INFO,
|
2124
|
+
"[xds_client %p] returning cached listener data for %s", this,
|
2125
|
+
listener_name_str.c_str());
|
2126
|
+
}
|
2127
|
+
auto& value = listener_state.update.value();
|
2128
|
+
work_serializer_.Schedule(
|
2129
|
+
// TODO(yashykt): When we move to C++14, capture watcher using
|
2130
|
+
// std::move()
|
2131
|
+
[watcher, value]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_) {
|
2132
|
+
watcher->OnListenerChanged(value);
|
2133
|
+
},
|
2134
|
+
DEBUG_LOCATION);
|
1944
2135
|
}
|
1945
|
-
|
2136
|
+
// If the authority doesn't yet have a channel, set it, creating it if
|
2137
|
+
// needed.
|
2138
|
+
if (authority_state.channel_state == nullptr) {
|
2139
|
+
authority_state.channel_state =
|
2140
|
+
GetOrCreateChannelStateLocked(bootstrap_->server());
|
2141
|
+
}
|
2142
|
+
authority_state.channel_state->SubscribeLocked(XdsApi::kLdsTypeUrl,
|
2143
|
+
*resource);
|
1946
2144
|
}
|
1947
|
-
|
2145
|
+
work_serializer_.DrainQueue();
|
1948
2146
|
}
|
1949
2147
|
|
1950
2148
|
void XdsClient::CancelListenerDataWatch(absl::string_view listener_name,
|
@@ -1952,39 +2150,79 @@ void XdsClient::CancelListenerDataWatch(absl::string_view listener_name,
|
|
1952
2150
|
bool delay_unsubscription) {
|
1953
2151
|
MutexLock lock(&mu_);
|
1954
2152
|
if (shutting_down_) return;
|
1955
|
-
|
1956
|
-
|
2153
|
+
auto resource = XdsApi::ParseResourceName(listener_name, XdsApi::IsLds);
|
2154
|
+
if (!resource.ok()) return;
|
2155
|
+
auto& authority_state = authority_state_map_[resource->authority];
|
2156
|
+
ListenerState& listener_state = authority_state.listener_map[resource->id];
|
1957
2157
|
auto it = listener_state.watchers.find(watcher);
|
1958
|
-
if (it
|
1959
|
-
|
1960
|
-
|
1961
|
-
|
1962
|
-
|
1963
|
-
|
1964
|
-
|
2158
|
+
if (it == listener_state.watchers.end()) {
|
2159
|
+
invalid_listener_watchers_.erase(watcher);
|
2160
|
+
return;
|
2161
|
+
}
|
2162
|
+
listener_state.watchers.erase(it);
|
2163
|
+
if (!listener_state.watchers.empty()) return;
|
2164
|
+
authority_state.listener_map.erase(resource->id);
|
2165
|
+
xds_server_channel_map_[bootstrap_->server()]->UnsubscribeLocked(
|
2166
|
+
XdsApi::kLdsTypeUrl, *resource, delay_unsubscription);
|
2167
|
+
if (!authority_state.HasSubscribedResources()) {
|
2168
|
+
authority_state.channel_state.reset();
|
1965
2169
|
}
|
1966
2170
|
}
|
1967
2171
|
|
1968
2172
|
void XdsClient::WatchRouteConfigData(
|
1969
2173
|
absl::string_view route_config_name,
|
1970
|
-
|
2174
|
+
RefCountedPtr<RouteConfigWatcherInterface> watcher) {
|
1971
2175
|
std::string route_config_name_str = std::string(route_config_name);
|
1972
|
-
MutexLock lock(&mu_);
|
1973
|
-
RouteConfigState& route_config_state =
|
1974
|
-
route_config_map_[route_config_name_str];
|
1975
2176
|
RouteConfigWatcherInterface* w = watcher.get();
|
1976
|
-
|
1977
|
-
|
1978
|
-
|
1979
|
-
|
1980
|
-
|
1981
|
-
|
1982
|
-
|
1983
|
-
|
2177
|
+
auto resource = XdsApi::ParseResourceName(route_config_name, XdsApi::IsRds);
|
2178
|
+
if (!resource.ok()) {
|
2179
|
+
{
|
2180
|
+
MutexLock lock(&mu_);
|
2181
|
+
invalid_route_config_watchers_[w] = watcher;
|
2182
|
+
}
|
2183
|
+
grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
|
2184
|
+
absl::StrFormat("Unable to parse resource name for route config %s",
|
2185
|
+
route_config_name));
|
2186
|
+
work_serializer_.Run(
|
2187
|
+
// TODO(yashykt): When we move to C++14, capture watcher using
|
2188
|
+
// std::move()
|
2189
|
+
[watcher, error]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) {
|
2190
|
+
watcher->OnError(error);
|
2191
|
+
},
|
2192
|
+
DEBUG_LOCATION);
|
2193
|
+
return;
|
2194
|
+
}
|
2195
|
+
{
|
2196
|
+
MutexLock lock(&mu_);
|
2197
|
+
auto& authority_state = authority_state_map_[resource->authority];
|
2198
|
+
RouteConfigState& route_config_state =
|
2199
|
+
authority_state.route_config_map[resource->id];
|
2200
|
+
route_config_state.watchers[w] = watcher;
|
2201
|
+
// If we've already received an RDS update, notify the new watcher
|
2202
|
+
// immediately.
|
2203
|
+
if (route_config_state.update.has_value()) {
|
2204
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2205
|
+
gpr_log(GPR_INFO,
|
2206
|
+
"[xds_client %p] returning cached route config data for %s",
|
2207
|
+
this, route_config_name_str.c_str());
|
2208
|
+
}
|
2209
|
+
auto& value = route_config_state.update.value();
|
2210
|
+
work_serializer_.Schedule(
|
2211
|
+
[watcher, value]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_) {
|
2212
|
+
watcher->OnRouteConfigChanged(value);
|
2213
|
+
},
|
2214
|
+
DEBUG_LOCATION);
|
1984
2215
|
}
|
1985
|
-
|
2216
|
+
// If the authority doesn't yet have a channel, set it, creating it if
|
2217
|
+
// needed.
|
2218
|
+
if (authority_state.channel_state == nullptr) {
|
2219
|
+
authority_state.channel_state =
|
2220
|
+
GetOrCreateChannelStateLocked(bootstrap_->server());
|
2221
|
+
}
|
2222
|
+
authority_state.channel_state->SubscribeLocked(XdsApi::kRdsTypeUrl,
|
2223
|
+
*resource);
|
1986
2224
|
}
|
1987
|
-
|
2225
|
+
work_serializer_.DrainQueue();
|
1988
2226
|
}
|
1989
2227
|
|
1990
2228
|
void XdsClient::CancelRouteConfigDataWatch(absl::string_view route_config_name,
|
@@ -1992,38 +2230,76 @@ void XdsClient::CancelRouteConfigDataWatch(absl::string_view route_config_name,
|
|
1992
2230
|
bool delay_unsubscription) {
|
1993
2231
|
MutexLock lock(&mu_);
|
1994
2232
|
if (shutting_down_) return;
|
1995
|
-
|
2233
|
+
auto resource = XdsApi::ParseResourceName(route_config_name, XdsApi::IsRds);
|
2234
|
+
if (!resource.ok()) return;
|
2235
|
+
auto& authority_state = authority_state_map_[resource->authority];
|
1996
2236
|
RouteConfigState& route_config_state =
|
1997
|
-
|
2237
|
+
authority_state.route_config_map[resource->id];
|
1998
2238
|
auto it = route_config_state.watchers.find(watcher);
|
1999
|
-
if (it
|
2000
|
-
|
2001
|
-
|
2002
|
-
|
2003
|
-
|
2004
|
-
|
2005
|
-
|
2239
|
+
if (it == route_config_state.watchers.end()) {
|
2240
|
+
invalid_route_config_watchers_.erase(watcher);
|
2241
|
+
return;
|
2242
|
+
}
|
2243
|
+
route_config_state.watchers.erase(it);
|
2244
|
+
if (!route_config_state.watchers.empty()) return;
|
2245
|
+
authority_state.route_config_map.erase(resource->id);
|
2246
|
+
xds_server_channel_map_[bootstrap_->server()]->UnsubscribeLocked(
|
2247
|
+
XdsApi::kRdsTypeUrl, *resource, delay_unsubscription);
|
2248
|
+
if (!authority_state.HasSubscribedResources()) {
|
2249
|
+
authority_state.channel_state.reset();
|
2006
2250
|
}
|
2007
2251
|
}
|
2008
2252
|
|
2009
2253
|
void XdsClient::WatchClusterData(
|
2010
2254
|
absl::string_view cluster_name,
|
2011
|
-
|
2255
|
+
RefCountedPtr<ClusterWatcherInterface> watcher) {
|
2012
2256
|
std::string cluster_name_str = std::string(cluster_name);
|
2013
|
-
MutexLock lock(&mu_);
|
2014
|
-
ClusterState& cluster_state = cluster_map_[cluster_name_str];
|
2015
2257
|
ClusterWatcherInterface* w = watcher.get();
|
2016
|
-
|
2017
|
-
|
2018
|
-
|
2019
|
-
|
2020
|
-
|
2021
|
-
|
2022
|
-
|
2258
|
+
auto resource = XdsApi::ParseResourceName(cluster_name, XdsApi::IsCds);
|
2259
|
+
if (!resource.ok()) {
|
2260
|
+
{
|
2261
|
+
MutexLock lock(&mu_);
|
2262
|
+
invalid_cluster_watchers_[w] = watcher;
|
2263
|
+
}
|
2264
|
+
grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
|
2265
|
+
"Unable to parse resource name for cluster %s", cluster_name));
|
2266
|
+
work_serializer_.Run([watcher, error]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(
|
2267
|
+
work_serializer_) { watcher->OnError(error); },
|
2268
|
+
DEBUG_LOCATION);
|
2269
|
+
return;
|
2270
|
+
}
|
2271
|
+
{
|
2272
|
+
MutexLock lock(&mu_);
|
2273
|
+
auto& authority_state = authority_state_map_[resource->authority];
|
2274
|
+
ClusterState& cluster_state = authority_state.cluster_map[resource->id];
|
2275
|
+
cluster_state.watchers[w] = watcher;
|
2276
|
+
// If we've already received a CDS update, notify the new watcher
|
2277
|
+
// immediately.
|
2278
|
+
if (cluster_state.update.has_value()) {
|
2279
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2280
|
+
gpr_log(GPR_INFO,
|
2281
|
+
"[xds_client %p] returning cached cluster data for %s", this,
|
2282
|
+
cluster_name_str.c_str());
|
2283
|
+
}
|
2284
|
+
auto& value = cluster_state.update.value();
|
2285
|
+
work_serializer_.Schedule(
|
2286
|
+
// TODO(yashykt): When we move to C++14, capture watcher using
|
2287
|
+
// std::move()
|
2288
|
+
[watcher, value]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_) {
|
2289
|
+
watcher->OnClusterChanged(value);
|
2290
|
+
},
|
2291
|
+
DEBUG_LOCATION);
|
2292
|
+
}
|
2293
|
+
// If the authority doesn't yet have a channel, set it, creating it if
|
2294
|
+
// needed.
|
2295
|
+
if (authority_state.channel_state == nullptr) {
|
2296
|
+
authority_state.channel_state =
|
2297
|
+
GetOrCreateChannelStateLocked(bootstrap_->server());
|
2023
2298
|
}
|
2024
|
-
|
2299
|
+
authority_state.channel_state->SubscribeLocked(XdsApi::kCdsTypeUrl,
|
2300
|
+
*resource);
|
2025
2301
|
}
|
2026
|
-
|
2302
|
+
work_serializer_.DrainQueue();
|
2027
2303
|
}
|
2028
2304
|
|
2029
2305
|
void XdsClient::CancelClusterDataWatch(absl::string_view cluster_name,
|
@@ -2031,37 +2307,74 @@ void XdsClient::CancelClusterDataWatch(absl::string_view cluster_name,
|
|
2031
2307
|
bool delay_unsubscription) {
|
2032
2308
|
MutexLock lock(&mu_);
|
2033
2309
|
if (shutting_down_) return;
|
2034
|
-
|
2035
|
-
|
2310
|
+
auto resource = XdsApi::ParseResourceName(cluster_name, XdsApi::IsCds);
|
2311
|
+
if (!resource.ok()) return;
|
2312
|
+
auto& authority_state = authority_state_map_[resource->authority];
|
2313
|
+
ClusterState& cluster_state = authority_state.cluster_map[resource->id];
|
2036
2314
|
auto it = cluster_state.watchers.find(watcher);
|
2037
|
-
if (it
|
2038
|
-
|
2039
|
-
|
2040
|
-
|
2041
|
-
|
2042
|
-
|
2043
|
-
|
2315
|
+
if (it == cluster_state.watchers.end()) {
|
2316
|
+
invalid_cluster_watchers_.erase(watcher);
|
2317
|
+
return;
|
2318
|
+
}
|
2319
|
+
cluster_state.watchers.erase(it);
|
2320
|
+
if (!cluster_state.watchers.empty()) return;
|
2321
|
+
authority_state.cluster_map.erase(resource->id);
|
2322
|
+
xds_server_channel_map_[bootstrap_->server()]->UnsubscribeLocked(
|
2323
|
+
XdsApi::kCdsTypeUrl, *resource, delay_unsubscription);
|
2324
|
+
if (!authority_state.HasSubscribedResources()) {
|
2325
|
+
authority_state.channel_state.reset();
|
2044
2326
|
}
|
2045
2327
|
}
|
2046
2328
|
|
2047
2329
|
void XdsClient::WatchEndpointData(
|
2048
2330
|
absl::string_view eds_service_name,
|
2049
|
-
|
2331
|
+
RefCountedPtr<EndpointWatcherInterface> watcher) {
|
2050
2332
|
std::string eds_service_name_str = std::string(eds_service_name);
|
2051
|
-
MutexLock lock(&mu_);
|
2052
|
-
EndpointState& endpoint_state = endpoint_map_[eds_service_name_str];
|
2053
2333
|
EndpointWatcherInterface* w = watcher.get();
|
2054
|
-
|
2055
|
-
|
2056
|
-
|
2057
|
-
|
2058
|
-
|
2059
|
-
|
2060
|
-
|
2334
|
+
auto resource = XdsApi::ParseResourceName(eds_service_name, XdsApi::IsEds);
|
2335
|
+
if (!resource.ok()) {
|
2336
|
+
{
|
2337
|
+
MutexLock lock(&mu_);
|
2338
|
+
invalid_endpoint_watchers_[w] = watcher;
|
2339
|
+
}
|
2340
|
+
grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
|
2341
|
+
absl::StrFormat("Unable to parse resource name for endpoint service %s",
|
2342
|
+
eds_service_name));
|
2343
|
+
work_serializer_.Run([watcher, error]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(
|
2344
|
+
work_serializer_) { watcher->OnError(error); },
|
2345
|
+
DEBUG_LOCATION);
|
2346
|
+
return;
|
2347
|
+
}
|
2348
|
+
{
|
2349
|
+
MutexLock lock(&mu_);
|
2350
|
+
auto& authority_state = authority_state_map_[resource->authority];
|
2351
|
+
EndpointState& endpoint_state = authority_state.endpoint_map[resource->id];
|
2352
|
+
endpoint_state.watchers[w] = watcher;
|
2353
|
+
// If we've already received an EDS update, notify the new watcher
|
2354
|
+
// immediately.
|
2355
|
+
if (endpoint_state.update.has_value()) {
|
2356
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2357
|
+
gpr_log(GPR_INFO,
|
2358
|
+
"[xds_client %p] returning cached endpoint data for %s", this,
|
2359
|
+
eds_service_name_str.c_str());
|
2360
|
+
}
|
2361
|
+
auto& value = endpoint_state.update.value();
|
2362
|
+
work_serializer_.Schedule(
|
2363
|
+
[watcher, value]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_) {
|
2364
|
+
watcher->OnEndpointChanged(value);
|
2365
|
+
},
|
2366
|
+
DEBUG_LOCATION);
|
2367
|
+
}
|
2368
|
+
// If the authority doesn't yet have a channel, set it, creating it if
|
2369
|
+
// needed.
|
2370
|
+
if (authority_state.channel_state == nullptr) {
|
2371
|
+
authority_state.channel_state =
|
2372
|
+
GetOrCreateChannelStateLocked(bootstrap_->server());
|
2061
2373
|
}
|
2062
|
-
|
2374
|
+
authority_state.channel_state->SubscribeLocked(XdsApi::kEdsTypeUrl,
|
2375
|
+
*resource);
|
2063
2376
|
}
|
2064
|
-
|
2377
|
+
work_serializer_.DrainQueue();
|
2065
2378
|
}
|
2066
2379
|
|
2067
2380
|
void XdsClient::CancelEndpointDataWatch(absl::string_view eds_service_name,
|
@@ -2069,16 +2382,22 @@ void XdsClient::CancelEndpointDataWatch(absl::string_view eds_service_name,
|
|
2069
2382
|
bool delay_unsubscription) {
|
2070
2383
|
MutexLock lock(&mu_);
|
2071
2384
|
if (shutting_down_) return;
|
2072
|
-
|
2073
|
-
|
2385
|
+
auto resource = XdsApi::ParseResourceName(eds_service_name, XdsApi::IsEds);
|
2386
|
+
if (!resource.ok()) return;
|
2387
|
+
auto& authority_state = authority_state_map_[resource->authority];
|
2388
|
+
EndpointState& endpoint_state = authority_state.endpoint_map[resource->id];
|
2074
2389
|
auto it = endpoint_state.watchers.find(watcher);
|
2075
|
-
if (it
|
2076
|
-
|
2077
|
-
|
2078
|
-
|
2079
|
-
|
2080
|
-
|
2081
|
-
|
2390
|
+
if (it == endpoint_state.watchers.end()) {
|
2391
|
+
invalid_endpoint_watchers_.erase(watcher);
|
2392
|
+
return;
|
2393
|
+
}
|
2394
|
+
endpoint_state.watchers.erase(it);
|
2395
|
+
if (!endpoint_state.watchers.empty()) return;
|
2396
|
+
authority_state.endpoint_map.erase(resource->id);
|
2397
|
+
xds_server_channel_map_[bootstrap_->server()]->UnsubscribeLocked(
|
2398
|
+
XdsApi::kEdsTypeUrl, *resource, delay_unsubscription);
|
2399
|
+
if (!authority_state.HasSubscribedResources()) {
|
2400
|
+
authority_state.channel_state.reset();
|
2082
2401
|
}
|
2083
2402
|
}
|
2084
2403
|
|
@@ -2112,7 +2431,12 @@ RefCountedPtr<XdsClusterDropStats> XdsClient::AddClusterDropStats(
|
|
2112
2431
|
it->first.second /*eds_service_name*/);
|
2113
2432
|
load_report_state.drop_stats = cluster_drop_stats.get();
|
2114
2433
|
}
|
2115
|
-
|
2434
|
+
auto resource = XdsApi::ParseResourceName(cluster_name, XdsApi::IsCds);
|
2435
|
+
GPR_ASSERT(resource.ok());
|
2436
|
+
auto a = authority_state_map_.find(resource->authority);
|
2437
|
+
if (a != authority_state_map_.end()) {
|
2438
|
+
a->second.channel_state->MaybeStartLrsCall();
|
2439
|
+
}
|
2116
2440
|
return cluster_drop_stats;
|
2117
2441
|
}
|
2118
2442
|
|
@@ -2169,7 +2493,12 @@ RefCountedPtr<XdsClusterLocalityStats> XdsClient::AddClusterLocalityStats(
|
|
2169
2493
|
std::move(locality));
|
2170
2494
|
locality_state.locality_stats = cluster_locality_stats.get();
|
2171
2495
|
}
|
2172
|
-
|
2496
|
+
auto resource = XdsApi::ParseResourceName(cluster_name, XdsApi::IsCds);
|
2497
|
+
GPR_ASSERT(resource.ok());
|
2498
|
+
auto a = authority_state_map_.find(resource->authority);
|
2499
|
+
if (a != authority_state_map_.end()) {
|
2500
|
+
a->second.channel_state->MaybeStartLrsCall();
|
2501
|
+
}
|
2173
2502
|
return cluster_locality_stats;
|
2174
2503
|
}
|
2175
2504
|
|
@@ -2199,37 +2528,63 @@ void XdsClient::RemoveClusterLocalityStats(
|
|
2199
2528
|
|
2200
2529
|
void XdsClient::ResetBackoff() {
|
2201
2530
|
MutexLock lock(&mu_);
|
2202
|
-
|
2203
|
-
grpc_channel_reset_connect_backoff(
|
2531
|
+
for (auto& p : xds_server_channel_map_) {
|
2532
|
+
grpc_channel_reset_connect_backoff(p.second->channel());
|
2204
2533
|
}
|
2205
2534
|
}
|
2206
2535
|
|
2207
2536
|
void XdsClient::NotifyOnErrorLocked(grpc_error_handle error) {
|
2208
|
-
|
2209
|
-
|
2210
|
-
|
2211
|
-
|
2537
|
+
std::set<RefCountedPtr<ListenerWatcherInterface>> listener_watchers;
|
2538
|
+
std::set<RefCountedPtr<RouteConfigWatcherInterface>> route_config_watchers;
|
2539
|
+
std::set<RefCountedPtr<ClusterWatcherInterface>> cluster_watchers;
|
2540
|
+
std::set<RefCountedPtr<EndpointWatcherInterface>> endpoint_watchers;
|
2541
|
+
for (const auto& a : authority_state_map_) {
|
2542
|
+
for (const auto& p : a.second.listener_map) {
|
2543
|
+
const ListenerState& listener_state = p.second;
|
2544
|
+
for (const auto& q : listener_state.watchers) {
|
2545
|
+
listener_watchers.insert(q.second);
|
2546
|
+
}
|
2212
2547
|
}
|
2213
|
-
|
2214
|
-
|
2215
|
-
|
2216
|
-
|
2217
|
-
|
2548
|
+
for (const auto& p : a.second.route_config_map) {
|
2549
|
+
const RouteConfigState& route_config_state = p.second;
|
2550
|
+
for (const auto& q : route_config_state.watchers) {
|
2551
|
+
route_config_watchers.insert(q.second);
|
2552
|
+
}
|
2218
2553
|
}
|
2219
|
-
|
2220
|
-
|
2221
|
-
|
2222
|
-
|
2223
|
-
|
2554
|
+
for (const auto& p : a.second.cluster_map) {
|
2555
|
+
const ClusterState& cluster_state = p.second;
|
2556
|
+
for (const auto& q : cluster_state.watchers) {
|
2557
|
+
cluster_watchers.insert(q.second);
|
2558
|
+
}
|
2224
2559
|
}
|
2225
|
-
|
2226
|
-
|
2227
|
-
|
2228
|
-
|
2229
|
-
|
2560
|
+
for (const auto& p : a.second.endpoint_map) {
|
2561
|
+
const EndpointState& endpoint_state = p.second;
|
2562
|
+
for (const auto& q : endpoint_state.watchers) {
|
2563
|
+
endpoint_watchers.insert(q.second);
|
2564
|
+
}
|
2230
2565
|
}
|
2231
2566
|
}
|
2232
|
-
|
2567
|
+
work_serializer_.Schedule(
|
2568
|
+
// TODO(yashykt): When we move to C++14, capture *_watchers using
|
2569
|
+
// std::move()
|
2570
|
+
[listener_watchers, route_config_watchers, cluster_watchers,
|
2571
|
+
endpoint_watchers, error]()
|
2572
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_) {
|
2573
|
+
for (const auto& watcher : listener_watchers) {
|
2574
|
+
watcher->OnError(GRPC_ERROR_REF(error));
|
2575
|
+
}
|
2576
|
+
for (const auto& watcher : route_config_watchers) {
|
2577
|
+
watcher->OnError(GRPC_ERROR_REF(error));
|
2578
|
+
}
|
2579
|
+
for (const auto& watcher : cluster_watchers) {
|
2580
|
+
watcher->OnError(GRPC_ERROR_REF(error));
|
2581
|
+
}
|
2582
|
+
for (const auto& watcher : endpoint_watchers) {
|
2583
|
+
watcher->OnError(GRPC_ERROR_REF(error));
|
2584
|
+
}
|
2585
|
+
GRPC_ERROR_UNREF(error);
|
2586
|
+
},
|
2587
|
+
DEBUG_LOCATION);
|
2233
2588
|
}
|
2234
2589
|
|
2235
2590
|
XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked(
|
@@ -2316,34 +2671,36 @@ XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked(
|
|
2316
2671
|
std::string XdsClient::DumpClientConfigBinary() {
|
2317
2672
|
MutexLock lock(&mu_);
|
2318
2673
|
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
|
-
|
2674
|
+
auto& lds_map = resource_type_metadata_map[XdsApi::kLdsTypeUrl];
|
2675
|
+
auto& rds_map = resource_type_metadata_map[XdsApi::kRdsTypeUrl];
|
2676
|
+
auto& cds_map = resource_type_metadata_map[XdsApi::kCdsTypeUrl];
|
2677
|
+
auto& eds_map = resource_type_metadata_map[XdsApi::kEdsTypeUrl];
|
2678
|
+
for (auto& a : authority_state_map_) {
|
2679
|
+
const std::string& authority = a.first;
|
2680
|
+
// Collect resource metadata from listeners
|
2681
|
+
for (auto& p : a.second.listener_map) {
|
2682
|
+
const std::string& listener_name = p.first;
|
2683
|
+
lds_map[XdsApi::ConstructFullResourceName(
|
2684
|
+
authority, XdsApi::kLdsTypeUrl, listener_name)] = &p.second.meta;
|
2685
|
+
}
|
2686
|
+
// Collect resource metadata from route configs
|
2687
|
+
for (auto& p : a.second.route_config_map) {
|
2688
|
+
const std::string& route_config_name = p.first;
|
2689
|
+
rds_map[XdsApi::ConstructFullResourceName(
|
2690
|
+
authority, XdsApi::kRdsTypeUrl, route_config_name)] = &p.second.meta;
|
2691
|
+
}
|
2692
|
+
// Collect resource metadata from clusters
|
2693
|
+
for (auto& p : a.second.cluster_map) {
|
2694
|
+
const std::string& cluster_name = p.first;
|
2695
|
+
cds_map[XdsApi::ConstructFullResourceName(authority, XdsApi::kCdsTypeUrl,
|
2696
|
+
cluster_name)] = &p.second.meta;
|
2697
|
+
}
|
2698
|
+
// Collect resource metadata from endpoints
|
2699
|
+
for (auto& p : a.second.endpoint_map) {
|
2700
|
+
const std::string& endpoint_name = p.first;
|
2701
|
+
eds_map[XdsApi::ConstructFullResourceName(
|
2702
|
+
authority, XdsApi::kEdsTypeUrl, endpoint_name)] = &p.second.meta;
|
2703
|
+
}
|
2347
2704
|
}
|
2348
2705
|
// Assemble config dump messages
|
2349
2706
|
return api_.AssembleClientConfig(resource_type_metadata_map);
|
@@ -2373,7 +2730,7 @@ namespace {
|
|
2373
2730
|
std::string GetBootstrapContents(const char* fallback_config,
|
2374
2731
|
grpc_error_handle* error) {
|
2375
2732
|
// First, try GRPC_XDS_BOOTSTRAP env var.
|
2376
|
-
|
2733
|
+
UniquePtr<char> path(gpr_getenv("GRPC_XDS_BOOTSTRAP"));
|
2377
2734
|
if (path != nullptr) {
|
2378
2735
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2379
2736
|
gpr_log(GPR_INFO,
|
@@ -2390,8 +2747,7 @@ std::string GetBootstrapContents(const char* fallback_config,
|
|
2390
2747
|
return contents_str;
|
2391
2748
|
}
|
2392
2749
|
// Next, try GRPC_XDS_BOOTSTRAP_CONFIG env var.
|
2393
|
-
|
2394
|
-
gpr_getenv("GRPC_XDS_BOOTSTRAP_CONFIG"));
|
2750
|
+
UniquePtr<char> env_config(gpr_getenv("GRPC_XDS_BOOTSTRAP_CONFIG"));
|
2395
2751
|
if (env_config != nullptr) {
|
2396
2752
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2397
2753
|
gpr_log(GPR_INFO,
|
@@ -2501,7 +2857,7 @@ void XdsClientArgDestroy(void* p) {
|
|
2501
2857
|
xds_client->Unref(DEBUG_LOCATION, "channel arg");
|
2502
2858
|
}
|
2503
2859
|
|
2504
|
-
int XdsClientArgCmp(void* p, void* q) { return
|
2860
|
+
int XdsClientArgCmp(void* p, void* q) { return QsortCompare(p, q); }
|
2505
2861
|
|
2506
2862
|
const grpc_arg_pointer_vtable kXdsClientArgVtable = {
|
2507
2863
|
XdsClientArgCopy, XdsClientArgDestroy, XdsClientArgCmp};
|