grpc 1.34.0 → 1.42.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Makefile +978 -2868
- data/etc/roots.pem +592 -899
- data/include/grpc/byte_buffer.h +1 -1
- data/include/grpc/byte_buffer_reader.h +1 -1
- data/include/grpc/compression.h +1 -1
- data/include/grpc/event_engine/README.md +38 -0
- data/include/grpc/event_engine/endpoint_config.h +43 -0
- data/include/grpc/event_engine/event_engine.h +375 -0
- data/include/grpc/event_engine/internal/memory_allocator_impl.h +98 -0
- data/include/grpc/event_engine/memory_allocator.h +210 -0
- data/include/grpc/event_engine/port.h +39 -0
- data/include/grpc/fork.h +1 -1
- data/include/grpc/grpc.h +49 -4
- data/include/grpc/grpc_posix.h +5 -2
- data/include/grpc/grpc_security.h +127 -14
- data/include/grpc/grpc_security_constants.h +16 -0
- data/include/grpc/impl/codegen/atm.h +5 -3
- data/include/grpc/impl/codegen/atm_gcc_atomic.h +2 -0
- data/include/grpc/impl/codegen/atm_gcc_sync.h +2 -0
- data/include/grpc/impl/codegen/atm_windows.h +6 -0
- data/include/grpc/impl/codegen/byte_buffer.h +3 -1
- 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 +49 -25
- data/include/grpc/impl/codegen/log.h +2 -2
- data/include/grpc/impl/codegen/port_platform.h +81 -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 +6 -0
- data/include/grpc/module.modulemap +14 -14
- data/include/grpc/slice.h +1 -1
- data/include/grpc/slice_buffer.h +3 -3
- 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 +4 -4
- 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 +9 -9
- data/src/core/ext/filters/census/grpc_context.cc +1 -0
- data/src/core/ext/filters/client_channel/backend_metric.cc +20 -24
- data/src/core/ext/filters/client_channel/backup_poller.cc +5 -4
- data/src/core/ext/filters/client_channel/backup_poller.h +1 -0
- data/src/core/ext/filters/client_channel/channel_connectivity.cc +158 -202
- data/src/core/ext/filters/client_channel/client_channel.cc +2009 -3145
- data/src/core/ext/filters/client_channel/client_channel.h +559 -60
- data/src/core/ext/filters/client_channel/client_channel_channelz.cc +6 -5
- data/src/core/ext/filters/client_channel/client_channel_channelz.h +2 -2
- data/src/core/ext/filters/client_channel/client_channel_factory.cc +2 -1
- data/src/core/ext/filters/client_channel/client_channel_factory.h +18 -19
- data/src/core/ext/filters/client_channel/client_channel_plugin.cc +18 -14
- data/src/core/ext/filters/client_channel/config_selector.cc +2 -1
- data/src/core/ext/filters/client_channel/config_selector.h +33 -9
- data/src/core/ext/filters/client_channel/connector.h +19 -19
- data/src/core/ext/filters/client_channel/dynamic_filters.cc +190 -0
- data/src/core/ext/filters/client_channel/dynamic_filters.h +99 -0
- data/src/core/ext/filters/client_channel/global_subchannel_pool.cc +24 -142
- data/src/core/ext/filters/client_channel/global_subchannel_pool.h +15 -11
- data/src/core/ext/filters/client_channel/health/health_check_client.cc +53 -50
- data/src/core/ext/filters/client_channel/health/health_check_client.h +35 -33
- data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +37 -34
- data/src/core/ext/filters/client_channel/http_connect_handshaker.h +10 -2
- data/src/core/ext/filters/client_channel/http_proxy.cc +36 -20
- 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 +12 -21
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +246 -166
- 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.h +1 -2
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +3 -5
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc +2 -2
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +4 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +5 -6
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +37 -30
- data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +53 -55
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +757 -0
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h +37 -0
- 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 +16 -18
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +24 -27
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +385 -135
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds.h +0 -8
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h +29 -0
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +57 -71
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +43 -64
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +1362 -0
- data/src/core/ext/filters/client_channel/lb_policy.cc +6 -17
- data/src/core/ext/filters/client_channel/lb_policy.h +93 -93
- data/src/core/ext/filters/client_channel/lb_policy_factory.h +2 -1
- data/src/core/ext/filters/client_channel/lb_policy_registry.cc +8 -11
- data/src/core/ext/filters/client_channel/lb_policy_registry.h +1 -1
- data/src/core/ext/filters/client_channel/local_subchannel_pool.cc +27 -67
- data/src/core/ext/filters/client_channel/local_subchannel_pool.h +10 -9
- 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 +76 -88
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +3 -33
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc +31 -0
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +10 -9
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +26 -23
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +473 -74
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +27 -2
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc +28 -0
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +45 -35
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +43 -46
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +7 -5
- data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +384 -0
- data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +22 -35
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +466 -254
- data/src/core/ext/filters/client_channel/resolver.cc +5 -5
- data/src/core/ext/filters/client_channel/resolver.h +4 -15
- data/src/core/ext/filters/client_channel/resolver_factory.h +8 -6
- data/src/core/ext/filters/client_channel/resolver_registry.cc +43 -44
- data/src/core/ext/filters/client_channel/resolver_registry.h +2 -2
- data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +42 -252
- data/src/core/ext/filters/client_channel/resolver_result_parsing.h +25 -54
- data/src/core/ext/filters/client_channel/retry_filter.cc +2573 -0
- data/src/core/ext/filters/{workarounds/workaround_cronet_compression_filter.h → client_channel/retry_filter.h} +9 -6
- data/src/core/ext/filters/client_channel/retry_service_config.cc +316 -0
- data/src/core/ext/filters/client_channel/retry_service_config.h +96 -0
- data/src/core/ext/filters/client_channel/retry_throttle.cc +20 -49
- data/src/core/ext/filters/client_channel/retry_throttle.h +3 -1
- data/src/core/ext/filters/client_channel/server_address.cc +10 -1
- data/src/core/ext/filters/client_channel/server_address.h +31 -0
- data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +54 -40
- data/src/core/ext/filters/client_channel/subchannel.cc +179 -329
- data/src/core/ext/filters/client_channel/subchannel.h +101 -158
- data/src/core/ext/filters/client_channel/subchannel_pool_interface.cc +38 -9
- data/src/core/ext/filters/client_channel/subchannel_pool_interface.h +21 -10
- data/src/core/ext/filters/client_idle/client_idle_filter.cc +47 -223
- 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 +33 -34
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +503 -0
- data/src/core/ext/filters/fault_injection/fault_injection_filter.h +39 -0
- data/src/core/ext/filters/fault_injection/service_config_parser.cc +181 -0
- data/src/core/ext/filters/fault_injection/service_config_parser.h +85 -0
- data/src/core/ext/filters/http/client/http_client_filter.cc +77 -69
- data/src/core/ext/filters/http/client_authority_filter.cc +19 -19
- data/src/core/ext/filters/http/http_filters_plugin.cc +53 -68
- data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +42 -35
- data/src/core/ext/filters/http/message_compress/message_decompress_filter.cc +29 -30
- data/src/core/ext/filters/http/server/http_server_filter.cc +104 -95
- data/src/core/ext/filters/max_age/max_age_filter.cc +71 -68
- data/src/core/ext/filters/message_size/message_size_filter.cc +43 -41
- data/src/core/ext/filters/message_size/message_size_filter.h +2 -2
- data/src/core/ext/{filters/client_channel → service_config}/service_config.cc +17 -16
- data/src/core/ext/{filters/client_channel → service_config}/service_config.h +11 -10
- data/src/core/ext/{filters/client_channel → service_config}/service_config_call_data.h +23 -19
- data/src/core/ext/{filters/client_channel → service_config}/service_config_parser.cc +9 -9
- data/src/core/ext/{filters/client_channel → service_config}/service_config_parser.h +15 -10
- data/src/core/ext/transport/chttp2/alpn/alpn.cc +2 -1
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +37 -23
- data/src/core/ext/transport/chttp2/client/chttp2_connector.h +9 -7
- data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +42 -35
- data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc +32 -16
- data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +51 -62
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +664 -236
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +11 -2
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +13 -5
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +25 -11
- data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc +61 -22
- data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +4 -2
- 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 +264 -223
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +16 -2
- data/src/core/ext/transport/chttp2/transport/context_list.cc +4 -5
- data/src/core/ext/transport/chttp2/transport/context_list.h +5 -6
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +59 -40
- data/src/core/ext/transport/chttp2/transport/flow_control.h +23 -17
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +28 -24
- data/src/core/ext/transport/chttp2/transport/frame_data.h +11 -10
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +21 -20
- data/src/core/ext/transport/chttp2/transport/frame_goaway.h +7 -6
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +13 -13
- data/src/core/ext/transport/chttp2/transport/frame_ping.h +8 -6
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +12 -15
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +7 -6
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +49 -17
- data/src/core/ext/transport/chttp2/transport/frame_settings.h +9 -7
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +22 -19
- data/src/core/ext/transport/chttp2/transport/frame_window_update.h +5 -6
- data/src/core/ext/transport/chttp2/transport/hpack_constants.h +41 -0
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +311 -665
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +240 -70
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_index.h +107 -0
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc +86 -0
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h +69 -0
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +865 -1172
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +100 -81
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +146 -0
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +137 -0
- data/src/core/ext/transport/chttp2/transport/hpack_utils.cc +46 -0
- data/src/core/{lib/transport/authority_override.h → ext/transport/chttp2/transport/hpack_utils.h} +8 -12
- data/src/core/ext/transport/chttp2/transport/internal.h +40 -33
- data/src/core/ext/transport/chttp2/transport/parsing.cc +156 -286
- 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 +13 -7
- data/src/core/ext/transport/chttp2/transport/varint.h +39 -28
- data/src/core/ext/transport/chttp2/transport/writing.cc +69 -54
- data/src/core/ext/transport/inproc/inproc_transport.cc +204 -160
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c +406 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h +1591 -0
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c +1 -1
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +2 -1
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +3 -3
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +15 -2
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +48 -49
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +245 -56
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +371 -0
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +1554 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c +16 -16
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h +66 -21
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +178 -142
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +795 -314
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c +4 -4
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h +21 -7
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +25 -24
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +70 -23
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +29 -29
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +138 -47
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h +23 -8
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +147 -75
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +522 -96
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +27 -27
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +116 -49
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c +3 -3
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h +15 -2
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c +9 -9
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h +42 -14
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +63 -63
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +228 -63
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +57 -56
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +244 -98
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h +25 -11
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +125 -57
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +533 -89
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +3 -4
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h +15 -2
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c +46 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h +133 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +8 -8
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +17 -4
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +15 -8
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +56 -9
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c +35 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h +96 -0
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +16 -17
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h +81 -40
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +56 -22
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +223 -34
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c +32 -32
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h +137 -72
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c +3 -3
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h +19 -5
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +48 -38
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +276 -103
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +51 -45
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +203 -62
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +48 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +177 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +10 -9
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +55 -22
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c +144 -0
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h +536 -0
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c +153 -0
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h +550 -0
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +51 -44
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +165 -43
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +35 -16
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +148 -40
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +339 -279
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +1466 -543
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c +10 -10
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h +48 -10
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +6 -7
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h +32 -6
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c +29 -0
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +73 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c +79 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h +298 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +79 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +303 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +42 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +123 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +151 -112
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +693 -244
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c +1 -2
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h +2 -1
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +52 -32
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +231 -59
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +15 -18
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +51 -28
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +45 -44
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +178 -74
- data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h +15 -2
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h +15 -2
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +58 -51
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +221 -135
- data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c +2 -5
- data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h +15 -2
- data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c +2 -5
- data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h +15 -2
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +9 -10
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h +46 -19
- data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h +15 -2
- data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h +15 -2
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c +121 -0
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h +468 -0
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c +60 -0
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h +205 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c +9 -8
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h +44 -14
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c +36 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h +96 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c +4 -4
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h +15 -2
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c +3 -3
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h +15 -2
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +10 -9
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h +51 -12
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +10 -11
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h +31 -6
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c +46 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h +136 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c +11 -11
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h +41 -4
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c +15 -15
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h +96 -11
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c +19 -19
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h +77 -14
- data/src/core/ext/upb-generated/envoy/type/v3/http.upb.c +1 -1
- data/src/core/ext/upb-generated/envoy/type/v3/http.upb.h +2 -1
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c +6 -6
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h +30 -5
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.c +10 -10
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.h +41 -4
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h +15 -2
- data/src/core/ext/upb-generated/google/api/annotations.upb.c +1 -1
- data/src/core/ext/upb-generated/google/api/annotations.upb.h +2 -1
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c +62 -62
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h +227 -84
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +86 -69
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +256 -72
- data/src/core/ext/upb-generated/google/api/http.upb.c +18 -18
- data/src/core/ext/upb-generated/google/api/http.upb.h +47 -10
- data/src/core/ext/upb-generated/google/protobuf/any.upb.c +4 -4
- data/src/core/ext/upb-generated/google/protobuf/any.upb.h +15 -2
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +154 -154
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +645 -320
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.c +4 -4
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +15 -2
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.c +2 -2
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.h +15 -2
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +15 -15
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +44 -7
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +4 -4
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +15 -2
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +19 -19
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +119 -10
- data/src/core/ext/upb-generated/google/rpc/status.upb.c +5 -5
- data/src/core/ext/upb-generated/google/rpc/status.upb.h +18 -5
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +12 -12
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +19 -5
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +63 -63
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +220 -87
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c +8 -8
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +36 -9
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c +5 -5
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +28 -3
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +31 -31
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +146 -35
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c +55 -0
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h +154 -0
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +8 -8
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +41 -4
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.c +4 -6
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.h +15 -2
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c +1 -1
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +2 -1
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.c +4 -4
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.h +17 -4
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c +3 -3
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h +15 -2
- data/src/core/ext/upb-generated/validate/validate.upb.c +243 -227
- data/src/core/ext/upb-generated/validate/validate.upb.h +626 -253
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c +58 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h +182 -0
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.c +28 -0
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.h +66 -0
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c +52 -0
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h +155 -0
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c +42 -0
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h +90 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.c +36 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.h +100 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c +54 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h +178 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c +36 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h +91 -0
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c +58 -0
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h +130 -0
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c +33 -0
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h +83 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c +354 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h +140 -0
- data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c +15 -7
- data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c +168 -170
- data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +424 -0
- data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h +120 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +467 -429
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h +12 -2
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c +12 -9
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +156 -109
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h +25 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +89 -88
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +156 -153
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +240 -168
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h +20 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c +4 -7
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c +59 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c +37 -20
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c +52 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c +56 -59
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +90 -63
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +137 -122
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c +136 -120
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c +90 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c +31 -26
- data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c +141 -0
- data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h +70 -0
- data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c +152 -0
- data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h +75 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +69 -51
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +748 -681
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h +15 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c +22 -25
- data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c +51 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c +102 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h +55 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c +123 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c +79 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +435 -379
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c +12 -16
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +121 -91
- 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 +45 -53
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +182 -180
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c +92 -102
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c +32 -42
- data/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c +30 -40
- data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c +4 -7
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c +38 -44
- data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c +163 -0
- data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h +55 -0
- data/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c +64 -0
- data/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h +50 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c +14 -13
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c +56 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c +35 -32
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c +30 -33
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c +63 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c +8 -7
- data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c +100 -100
- data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c +9 -8
- data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c +8 -8
- data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c +8 -8
- data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c +9 -8
- data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c +8 -8
- data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c +4 -4
- data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c +5 -4
- data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c +19 -23
- data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c +4 -3
- data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c +5 -3
- data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c +5 -4
- data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c +182 -157
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c +75 -0
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h +50 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c +43 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c +63 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c +46 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c +50 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c +68 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c +51 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c +45 -0
- data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h +35 -0
- data/src/core/ext/xds/certificate_provider_factory.h +1 -1
- data/src/core/ext/xds/certificate_provider_registry.cc +2 -2
- data/src/core/ext/xds/certificate_provider_store.cc +10 -7
- data/src/core/ext/xds/certificate_provider_store.h +15 -10
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +28 -3
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +3 -6
- data/src/core/ext/xds/xds_api.cc +2654 -808
- data/src/core/ext/xds/xds_api.h +460 -154
- data/src/core/ext/xds/xds_bootstrap.cc +139 -188
- data/src/core/ext/xds/xds_bootstrap.h +34 -18
- data/src/core/ext/xds/xds_certificate_provider.cc +237 -72
- data/src/core/ext/xds/xds_certificate_provider.h +104 -27
- data/src/core/ext/xds/xds_channel_args.h +5 -2
- data/src/core/ext/xds/xds_channel_stack_modifier.cc +113 -0
- data/src/core/ext/xds/xds_channel_stack_modifier.h +52 -0
- data/src/core/ext/xds/xds_client.cc +985 -429
- data/src/core/ext/xds/xds_client.h +100 -51
- data/src/core/ext/xds/xds_client_stats.cc +18 -16
- data/src/core/ext/xds/xds_client_stats.h +12 -11
- data/src/core/ext/xds/xds_http_fault_filter.cc +227 -0
- data/src/core/ext/xds/xds_http_fault_filter.h +64 -0
- data/src/core/ext/xds/xds_http_filters.cc +116 -0
- data/src/core/ext/xds/xds_http_filters.h +133 -0
- data/src/core/ext/xds/xds_server_config_fetcher.cc +544 -0
- data/src/core/lib/{iomgr → address_utils}/parse_address.cc +72 -68
- data/src/core/lib/{iomgr → address_utils}/parse_address.h +20 -16
- data/src/core/lib/{iomgr → address_utils}/sockaddr_utils.cc +131 -15
- data/src/core/lib/{iomgr → address_utils}/sockaddr_utils.h +37 -7
- data/src/core/lib/avl/avl.cc +5 -5
- data/src/core/lib/backoff/backoff.cc +1 -1
- data/src/core/lib/channel/call_tracer.h +85 -0
- data/src/core/lib/channel/channel_args.cc +34 -15
- data/src/core/lib/channel/channel_args.h +9 -0
- data/src/core/lib/channel/channel_stack.cc +27 -12
- data/src/core/lib/channel/channel_stack.h +18 -10
- data/src/core/lib/channel/channel_stack_builder.cc +6 -16
- data/src/core/lib/channel/channel_stack_builder.h +1 -9
- data/src/core/lib/channel/channel_trace.cc +5 -4
- data/src/core/lib/channel/channel_trace.h +3 -2
- data/src/core/lib/channel/channelz.cc +162 -63
- data/src/core/lib/channel/channelz.h +62 -31
- data/src/core/lib/channel/channelz_registry.cc +22 -7
- data/src/core/lib/channel/channelz_registry.h +1 -2
- data/src/core/lib/channel/connected_channel.cc +6 -7
- data/src/core/lib/channel/connected_channel.h +1 -2
- data/src/core/lib/channel/context.h +3 -0
- data/src/core/lib/channel/handshaker.cc +13 -53
- data/src/core/lib/channel/handshaker.h +7 -25
- 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.cc +12 -2
- data/src/core/lib/channel/status_util.h +11 -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 +11 -7
- 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 +3 -2
- data/src/core/lib/compression/stream_compression_gzip.cc +2 -1
- data/src/core/lib/compression/stream_compression_gzip.h +1 -1
- data/src/core/lib/compression/stream_compression_identity.cc +2 -1
- data/src/core/lib/compression/stream_compression_identity.h +1 -1
- data/src/core/lib/config/core_configuration.cc +96 -0
- data/src/core/lib/config/core_configuration.h +146 -0
- data/src/core/lib/debug/stats.cc +1 -1
- data/src/core/lib/debug/stats.h +4 -3
- data/src/core/lib/debug/stats_data.cc +15 -14
- data/src/core/lib/debug/stats_data.h +14 -13
- data/src/core/lib/debug/trace.cc +1 -0
- data/src/core/lib/debug/trace.h +2 -1
- data/src/core/lib/event_engine/endpoint_config.cc +45 -0
- data/src/core/lib/event_engine/endpoint_config_internal.h +42 -0
- data/src/core/lib/event_engine/event_engine.cc +50 -0
- data/src/core/lib/event_engine/sockaddr.cc +40 -0
- data/src/core/lib/event_engine/sockaddr.h +44 -0
- data/src/core/lib/gpr/alloc.cc +7 -5
- 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 +61 -19
- data/src/core/lib/gpr/log_android.cc +3 -2
- data/src/core/lib/gpr/log_linux.cc +10 -5
- data/src/core/lib/gpr/log_posix.cc +9 -4
- data/src/core/lib/gpr/log_windows.cc +3 -1
- data/src/core/lib/gpr/murmur_hash.cc +4 -2
- data/src/core/lib/gpr/spinlock.h +10 -2
- data/src/core/lib/gpr/string.cc +24 -23
- data/src/core/lib/gpr/string.h +7 -8
- data/src/core/lib/gpr/sync.cc +6 -6
- data/src/core/lib/gpr/sync_abseil.cc +10 -12
- data/src/core/lib/gpr/sync_posix.cc +3 -3
- data/src/core/lib/gpr/sync_windows.cc +2 -2
- data/src/core/lib/gpr/time.cc +15 -14
- data/src/core/lib/gpr/time_windows.cc +3 -2
- data/src/core/lib/gpr/tls.h +119 -40
- data/src/core/lib/gpr/tmpfile_posix.cc +1 -2
- data/src/core/lib/gpr/useful.h +79 -32
- data/src/core/lib/gpr/wrap_memcpy.cc +2 -1
- data/src/core/lib/gprpp/arena.cc +2 -1
- data/src/core/lib/gprpp/arena.h +18 -7
- 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/gprpp/construct_destruct.h +39 -0
- data/src/core/lib/gprpp/dual_ref_counted.h +28 -29
- data/src/core/lib/gprpp/fork.cc +14 -12
- data/src/core/lib/gprpp/fork.h +4 -4
- data/src/core/lib/gprpp/global_config.h +1 -2
- data/src/core/lib/gprpp/global_config_env.cc +7 -7
- data/src/core/lib/gprpp/global_config_generic.h +2 -2
- data/src/core/lib/gprpp/manual_constructor.h +9 -6
- data/src/core/lib/gprpp/match.h +73 -0
- data/src/core/lib/gprpp/memory.h +9 -3
- data/src/core/lib/gprpp/mpscq.cc +9 -9
- data/src/core/lib/gprpp/mpscq.h +6 -5
- data/src/core/lib/gprpp/orphanable.h +6 -6
- data/src/core/lib/gprpp/overload.h +59 -0
- data/src/core/lib/gprpp/ref_counted.h +48 -34
- data/src/core/lib/gprpp/ref_counted_ptr.h +11 -1
- data/src/core/lib/gprpp/status_helper.cc +427 -0
- data/src/core/lib/gprpp/status_helper.h +194 -0
- data/src/core/lib/gprpp/sync.h +106 -43
- data/src/core/lib/gprpp/table.h +411 -0
- data/src/core/lib/gprpp/thd.h +1 -1
- data/src/core/lib/gprpp/thd_posix.cc +11 -6
- data/src/core/lib/gprpp/thd_windows.cc +7 -12
- data/src/core/lib/gprpp/time_util.cc +77 -0
- data/src/core/lib/gprpp/time_util.h +42 -0
- data/src/core/lib/http/format_request.cc +1 -0
- data/src/core/lib/http/format_request.h +1 -0
- data/src/core/lib/http/httpcli.cc +203 -185
- data/src/core/lib/http/httpcli.h +5 -3
- data/src/core/lib/http/httpcli_security_connector.cc +19 -18
- data/src/core/lib/http/parser.cc +19 -20
- data/src/core/lib/http/parser.h +5 -4
- data/src/core/lib/iomgr/buffer_list.cc +10 -11
- data/src/core/lib/iomgr/buffer_list.h +6 -8
- data/src/core/lib/iomgr/call_combiner.cc +46 -21
- data/src/core/lib/iomgr/call_combiner.h +12 -14
- data/src/core/lib/iomgr/cfstream_handle.cc +6 -6
- data/src/core/lib/iomgr/cfstream_handle.h +1 -1
- data/src/core/lib/iomgr/closure.h +7 -6
- data/src/core/lib/iomgr/combiner.cc +25 -36
- data/src/core/lib/iomgr/combiner.h +3 -2
- data/src/core/lib/iomgr/dualstack_socket_posix.cc +1 -0
- data/src/core/lib/iomgr/endpoint.cc +1 -5
- data/src/core/lib/iomgr/endpoint.h +3 -5
- data/src/core/lib/iomgr/endpoint_cfstream.cc +27 -39
- data/src/core/lib/iomgr/endpoint_cfstream.h +1 -1
- data/src/core/lib/iomgr/endpoint_pair.h +1 -0
- data/src/core/lib/iomgr/endpoint_pair_event_engine.cc +32 -0
- data/src/core/lib/iomgr/endpoint_pair_posix.cc +15 -11
- data/src/core/lib/iomgr/endpoint_pair_windows.cc +17 -9
- data/src/core/lib/iomgr/error.cc +277 -105
- data/src/core/lib/iomgr/error.h +280 -114
- data/src/core/lib/iomgr/error_cfstream.cc +10 -4
- data/src/core/lib/iomgr/error_cfstream.h +2 -2
- data/src/core/lib/iomgr/error_internal.h +7 -2
- data/src/core/lib/iomgr/ev_apple.cc +16 -13
- data/src/core/lib/iomgr/ev_apple.h +1 -1
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +53 -53
- data/src/core/lib/iomgr/ev_epollex_linux.cc +81 -81
- data/src/core/lib/iomgr/ev_poll_posix.cc +70 -68
- data/src/core/lib/iomgr/ev_posix.cc +13 -13
- data/src/core/lib/iomgr/ev_posix.h +9 -9
- data/src/core/lib/iomgr/event_engine/closure.cc +77 -0
- data/src/core/lib/iomgr/event_engine/closure.h +42 -0
- data/src/core/lib/iomgr/event_engine/endpoint.cc +173 -0
- data/src/core/lib/iomgr/event_engine/endpoint.h +52 -0
- data/src/core/lib/iomgr/event_engine/iomgr.cc +104 -0
- data/src/core/lib/iomgr/event_engine/iomgr.h +42 -0
- data/src/core/lib/iomgr/event_engine/pollset.cc +88 -0
- data/src/core/lib/iomgr/event_engine/pollset.h +25 -0
- data/src/core/lib/iomgr/event_engine/promise.h +51 -0
- data/src/core/lib/iomgr/event_engine/resolved_address_internal.cc +41 -0
- data/src/core/lib/iomgr/event_engine/resolved_address_internal.h +35 -0
- data/src/core/lib/iomgr/event_engine/resolver.cc +114 -0
- data/src/core/lib/iomgr/event_engine/tcp.cc +293 -0
- data/src/core/lib/iomgr/event_engine/timer.cc +62 -0
- data/src/core/lib/iomgr/exec_ctx.cc +14 -11
- data/src/core/lib/iomgr/exec_ctx.h +21 -28
- 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 +4 -5
- data/src/core/lib/iomgr/executor/threadpool.h +5 -4
- data/src/core/lib/iomgr/executor.cc +19 -33
- data/src/core/lib/iomgr/executor.h +3 -3
- 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 +6 -4
- data/src/core/lib/iomgr/iomgr.h +3 -3
- data/src/core/lib/iomgr/iomgr_custom.cc +3 -3
- data/src/core/lib/iomgr/iomgr_custom.h +2 -2
- data/src/core/lib/iomgr/iomgr_internal.cc +8 -12
- data/src/core/lib/iomgr/iomgr_internal.h +6 -5
- data/src/core/lib/iomgr/iomgr_posix.cc +3 -2
- data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +42 -13
- data/src/core/lib/iomgr/iomgr_windows.cc +2 -3
- data/src/core/lib/iomgr/is_epollexclusive_available.cc +4 -4
- data/src/core/lib/iomgr/load_file.cc +6 -6
- data/src/core/lib/iomgr/load_file.h +2 -2
- data/src/core/lib/iomgr/lockfree_event.cc +38 -15
- data/src/core/lib/iomgr/lockfree_event.h +2 -2
- data/src/core/lib/iomgr/polling_entity.cc +2 -2
- data/src/core/lib/iomgr/pollset.cc +5 -5
- data/src/core/lib/iomgr/pollset.h +9 -9
- data/src/core/lib/iomgr/pollset_custom.cc +10 -11
- data/src/core/lib/iomgr/pollset_custom.h +3 -1
- data/src/core/lib/iomgr/pollset_set_custom.cc +2 -3
- data/src/core/lib/iomgr/pollset_set_windows.cc +1 -0
- data/src/core/lib/iomgr/pollset_windows.cc +5 -5
- data/src/core/lib/iomgr/port.h +7 -10
- data/src/core/lib/iomgr/python_util.h +4 -3
- data/src/core/lib/iomgr/resolve_address.cc +14 -9
- data/src/core/lib/iomgr/resolve_address.h +12 -10
- data/src/core/lib/iomgr/resolve_address_custom.cc +14 -13
- data/src/core/lib/iomgr/resolve_address_custom.h +3 -4
- data/src/core/lib/iomgr/resolve_address_posix.cc +10 -14
- data/src/core/lib/iomgr/resolve_address_windows.cc +10 -12
- data/src/core/lib/iomgr/resource_quota.cc +152 -62
- data/src/core/lib/iomgr/resource_quota.h +66 -17
- data/src/core/lib/iomgr/sockaddr.h +2 -1
- data/src/core/lib/iomgr/socket_factory_posix.cc +8 -7
- data/src/core/lib/iomgr/socket_factory_posix.h +1 -0
- data/src/core/lib/iomgr/socket_mutator.cc +20 -6
- data/src/core/lib/iomgr/socket_mutator.h +27 -3
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +29 -27
- 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 +22 -22
- data/src/core/lib/iomgr/socket_utils_windows.cc +2 -2
- data/src/core/lib/iomgr/tcp_client.cc +5 -3
- data/src/core/lib/iomgr/tcp_client.h +4 -0
- data/src/core/lib/iomgr/tcp_client_cfstream.cc +18 -26
- data/src/core/lib/iomgr/tcp_client_custom.cc +19 -27
- data/src/core/lib/iomgr/tcp_client_posix.cc +56 -47
- data/src/core/lib/iomgr/tcp_client_posix.h +8 -6
- data/src/core/lib/iomgr/tcp_client_windows.cc +23 -14
- data/src/core/lib/iomgr/tcp_custom.cc +46 -55
- data/src/core/lib/iomgr/tcp_custom.h +15 -13
- data/src/core/lib/iomgr/tcp_posix.cc +119 -145
- data/src/core/lib/iomgr/tcp_posix.h +19 -12
- data/src/core/lib/iomgr/tcp_server.cc +9 -7
- data/src/core/lib/iomgr/tcp_server.h +18 -14
- data/src/core/lib/iomgr/tcp_server_custom.cc +63 -73
- data/src/core/lib/iomgr/tcp_server_posix.cc +49 -35
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +16 -12
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +22 -20
- data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +11 -12
- data/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc +4 -4
- data/src/core/lib/iomgr/tcp_server_windows.cc +40 -36
- data/src/core/lib/iomgr/tcp_windows.cc +21 -40
- data/src/core/lib/iomgr/tcp_windows.h +4 -3
- data/src/core/lib/iomgr/timer.cc +1 -0
- data/src/core/lib/iomgr/timer.h +7 -3
- data/src/core/lib/iomgr/timer_custom.cc +7 -6
- data/src/core/lib/iomgr/timer_custom.h +1 -1
- data/src/core/lib/iomgr/timer_generic.cc +32 -62
- 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/timer_manager.cc +4 -4
- data/src/core/lib/iomgr/unix_sockets_posix.cc +21 -24
- data/src/core/lib/iomgr/unix_sockets_posix.h +4 -5
- data/src/core/lib/iomgr/unix_sockets_posix_noop.cc +10 -7
- data/src/core/lib/iomgr/wakeup_fd_eventfd.cc +3 -3
- data/src/core/lib/iomgr/wakeup_fd_nospecial.cc +2 -1
- data/src/core/lib/iomgr/wakeup_fd_pipe.cc +6 -7
- data/src/core/lib/iomgr/wakeup_fd_posix.cc +4 -3
- data/src/core/lib/iomgr/wakeup_fd_posix.h +8 -6
- data/src/core/lib/iomgr/work_serializer.cc +4 -4
- data/src/core/lib/iomgr/work_serializer.h +18 -2
- data/src/core/lib/json/json.h +11 -1
- data/src/core/lib/json/json_reader.cc +14 -23
- data/src/core/lib/json/json_util.cc +68 -0
- data/src/core/lib/json/json_util.h +65 -115
- data/src/core/lib/json/json_writer.cc +0 -3
- data/src/core/lib/matchers/matchers.cc +327 -0
- data/src/core/lib/matchers/matchers.h +160 -0
- data/src/core/lib/profiling/basic_timers.cc +8 -6
- data/src/core/lib/profiling/stap_timers.cc +2 -2
- data/src/core/lib/security/authorization/authorization_engine.h +13 -53
- data/src/core/lib/security/authorization/authorization_policy_provider.h +33 -0
- data/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc +46 -0
- data/src/core/lib/security/authorization/evaluate_args.cc +126 -66
- data/src/core/lib/security/authorization/evaluate_args.h +47 -15
- data/src/core/lib/security/authorization/sdk_server_authz_filter.cc +171 -0
- data/src/core/lib/security/authorization/sdk_server_authz_filter.h +67 -0
- data/src/core/lib/security/context/security_context.cc +15 -11
- data/src/core/lib/security/credentials/alts/alts_credentials.cc +2 -1
- data/src/core/lib/security/credentials/alts/alts_credentials.h +1 -1
- data/src/core/lib/security/credentials/alts/check_gcp_environment.cc +1 -1
- data/src/core/lib/security/credentials/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 +9 -8
- data/src/core/lib/security/credentials/composite/composite_credentials.h +2 -2
- data/src/core/lib/security/credentials/credentials.cc +16 -14
- data/src/core/lib/security/credentials/credentials.h +11 -5
- data/src/core/lib/security/credentials/credentials_metadata.cc +2 -3
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +404 -0
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.h +81 -0
- data/src/core/lib/security/credentials/external/aws_request_signer.cc +20 -14
- data/src/core/lib/security/credentials/external/aws_request_signer.h +2 -3
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +270 -54
- data/src/core/lib/security/credentials/external/external_account_credentials.h +16 -12
- data/src/core/lib/security/credentials/external/file_external_account_credentials.cc +8 -8
- data/src/core/lib/security/credentials/external/file_external_account_credentials.h +6 -6
- data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +26 -26
- data/src/core/lib/security/credentials/external/url_external_account_credentials.h +13 -12
- data/src/core/lib/security/credentials/fake/fake_credentials.cc +5 -4
- data/src/core/lib/security/credentials/fake/fake_credentials.h +2 -2
- 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 +92 -31
- data/src/core/lib/security/credentials/iam/iam_credentials.cc +4 -3
- data/src/core/lib/security/credentials/iam/iam_credentials.h +2 -2
- data/src/core/lib/security/credentials/insecure/insecure_credentials.cc +18 -5
- data/src/core/lib/security/credentials/jwt/json_token.cc +4 -7
- data/src/core/lib/security/credentials/jwt/json_token.h +2 -1
- data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +34 -17
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +13 -5
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +15 -22
- data/src/core/lib/security/credentials/jwt/jwt_verifier.h +3 -3
- data/src/core/lib/security/credentials/local/local_credentials.cc +2 -1
- data/src/core/lib/security/credentials/local/local_credentials.h +1 -1
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +57 -66
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +11 -9
- data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +10 -12
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +2 -2
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +11 -10
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +2 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc +12 -15
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h +20 -21
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +382 -5
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +74 -1
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +5 -1
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +2 -3
- data/src/core/lib/security/credentials/tls/tls_credentials.cc +3 -2
- data/src/core/lib/security/credentials/tls/tls_credentials.h +1 -1
- data/src/core/lib/security/credentials/tls/tls_utils.cc +123 -0
- data/src/core/lib/security/credentials/tls/tls_utils.h +51 -0
- data/src/core/lib/security/credentials/xds/xds_credentials.cc +209 -10
- data/src/core/lib/security/credentials/xds/xds_credentials.h +27 -9
- data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +14 -4
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +20 -12
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc +50 -17
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +35 -8
- data/src/core/lib/security/security_connector/load_system_roots_fallback.cc +1 -0
- data/src/core/lib/security/security_connector/load_system_roots_linux.cc +4 -4
- data/src/core/lib/security/security_connector/local/local_security_connector.cc +23 -10
- data/src/core/lib/security/security_connector/security_connector.cc +12 -6
- data/src/core/lib/security/security_connector/security_connector.h +10 -5
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +24 -17
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.h +1 -2
- data/src/core/lib/security/security_connector/ssl_utils.cc +41 -14
- data/src/core/lib/security/security_connector/ssl_utils.h +16 -23
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +156 -113
- data/src/core/lib/security/security_connector/tls/tls_security_connector.h +67 -52
- data/src/core/lib/security/transport/auth_filters.h +1 -0
- data/src/core/lib/security/transport/client_auth_filter.cc +27 -21
- data/src/core/lib/security/transport/secure_endpoint.cc +10 -20
- data/src/core/lib/security/transport/secure_endpoint.h +1 -0
- data/src/core/lib/security/transport/security_handshaker.cc +158 -90
- data/src/core/lib/security/transport/security_handshaker.h +2 -1
- data/src/core/lib/security/transport/server_auth_filter.cc +20 -16
- data/src/core/lib/security/transport/tsi_error.cc +5 -6
- data/src/core/lib/security/transport/tsi_error.h +2 -1
- data/src/core/lib/security/util/json_util.cc +8 -10
- data/src/core/lib/security/util/json_util.h +1 -1
- data/src/core/lib/slice/percent_encoding.cc +73 -30
- data/src/core/lib/slice/percent_encoding.h +29 -28
- data/src/core/lib/slice/slice.cc +14 -21
- data/src/core/lib/{gpr/tls_pthread.cc → slice/slice_api.cc} +15 -6
- data/src/core/lib/slice/slice_buffer.cc +6 -7
- data/src/core/lib/slice/slice_intern.cc +19 -27
- data/src/core/lib/slice/slice_internal.h +4 -246
- data/src/core/lib/slice/slice_refcount.cc +17 -0
- data/src/core/lib/slice/slice_refcount.h +121 -0
- data/src/core/lib/slice/slice_refcount_base.h +173 -0
- data/src/core/lib/slice/slice_split.cc +100 -0
- data/src/core/lib/slice/slice_split.h +40 -0
- data/src/core/lib/slice/slice_string_helpers.cc +0 -83
- data/src/core/lib/slice/slice_string_helpers.h +0 -11
- data/src/core/lib/slice/static_slice.cc +529 -0
- data/src/core/lib/slice/static_slice.h +331 -0
- data/src/core/lib/surface/api_trace.cc +2 -1
- data/src/core/lib/surface/api_trace.h +1 -0
- data/src/core/lib/surface/builtins.cc +49 -0
- data/src/core/lib/surface/builtins.h +26 -0
- data/src/core/lib/surface/byte_buffer_reader.cc +1 -1
- data/src/core/lib/surface/call.cc +198 -186
- data/src/core/lib/surface/call.h +10 -5
- data/src/core/lib/surface/call_details.cc +10 -10
- data/src/core/lib/surface/call_log_batch.cc +2 -2
- data/src/core/lib/surface/channel.cc +57 -51
- data/src/core/lib/surface/channel.h +19 -14
- 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 +2 -3
- data/src/core/lib/surface/channel_stack_type.cc +2 -1
- data/src/core/lib/surface/completion_queue.cc +140 -145
- data/src/core/lib/surface/completion_queue.h +18 -17
- data/src/core/lib/surface/completion_queue_factory.cc +3 -3
- 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 +18 -65
- data/src/core/lib/surface/init.h +10 -2
- data/src/core/lib/surface/init_secure.cc +36 -14
- data/src/core/lib/surface/lame_client.cc +62 -61
- data/src/core/lib/surface/lame_client.h +5 -0
- data/src/core/lib/surface/metadata_array.cc +2 -2
- data/src/core/lib/surface/server.cc +167 -116
- data/src/core/lib/surface/server.h +140 -40
- data/src/core/lib/surface/validate_metadata.cc +55 -24
- data/src/core/lib/surface/validate_metadata.h +3 -2
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/bdp_estimator.cc +1 -1
- data/src/core/lib/transport/byte_stream.cc +5 -5
- data/src/core/lib/transport/byte_stream.h +9 -8
- data/src/core/lib/transport/connectivity_state.cc +9 -6
- data/src/core/lib/transport/connectivity_state.h +8 -6
- data/src/core/lib/transport/error_utils.cc +64 -27
- data/src/core/lib/transport/error_utils.h +13 -7
- data/src/core/lib/transport/metadata.cc +47 -22
- data/src/core/lib/transport/metadata.h +15 -12
- data/src/core/lib/transport/metadata_batch.cc +41 -339
- data/src/core/lib/transport/metadata_batch.h +932 -68
- data/src/core/lib/transport/parsed_metadata.h +263 -0
- data/src/core/lib/transport/pid_controller.cc +4 -4
- data/src/core/lib/transport/static_metadata.cc +715 -847
- data/src/core/lib/transport/static_metadata.h +115 -379
- data/src/core/lib/transport/status_metadata.cc +5 -3
- data/src/core/lib/transport/transport.cc +8 -8
- data/src/core/lib/transport/transport.h +12 -10
- data/src/core/lib/transport/transport_op_string.cc +46 -26
- data/src/core/lib/uri/uri_parser.cc +131 -249
- data/src/core/lib/uri/uri_parser.h +57 -21
- data/src/core/plugin_registry/grpc_plugin_registry.cc +101 -44
- data/src/core/tsi/alts/crypt/aes_gcm.cc +6 -3
- data/src/core/tsi/alts/crypt/gsec.cc +5 -4
- data/src/core/tsi/alts/crypt/gsec.h +5 -0
- data/src/core/tsi/alts/frame_protector/alts_frame_protector.cc +13 -12
- data/src/core/tsi/alts/frame_protector/frame_handler.cc +18 -17
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +27 -33
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.h +2 -3
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +57 -51
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +1 -1
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h +2 -1
- data/src/core/tsi/alts/handshaker/transport_security_common_api.cc +1 -3
- 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_iovec_record_protocol.cc +8 -6
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +6 -6
- data/src/core/tsi/fake_transport_security.cc +31 -12
- data/src/core/tsi/local_transport_security.cc +36 -73
- data/src/core/tsi/ssl/session_cache/ssl_session.h +0 -3
- data/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc +1 -1
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +20 -55
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +6 -7
- data/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc +2 -2
- data/src/core/tsi/ssl_transport_security.cc +115 -77
- data/src/core/tsi/ssl_transport_security.h +12 -14
- data/src/core/tsi/transport_security.cc +21 -9
- 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 +27 -1
- data/src/ruby/bin/math_services_pb.rb +1 -1
- data/src/ruby/ext/grpc/extconf.rb +21 -8
- 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 +19 -8
- data/src/ruby/ext/grpc/rb_channel_args.c +2 -2
- data/src/ruby/ext/grpc/rb_channel_credentials.c +15 -5
- data/src/ruby/ext/grpc/rb_channel_credentials.h +5 -0
- data/src/ruby/ext/grpc/rb_completion_queue.c +3 -2
- data/src/ruby/ext/grpc/rb_compression_options.c +6 -5
- data/src/ruby/ext/grpc/rb_enable_cpp.cc +1 -1
- data/src/ruby/ext/grpc/rb_event_thread.c +4 -2
- data/src/ruby/ext/grpc/rb_grpc.c +9 -4
- data/src/ruby/ext/grpc/rb_grpc.h +1 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +24 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +50 -14
- data/src/ruby/ext/grpc/rb_server.c +19 -6
- data/src/ruby/ext/grpc/rb_server_credentials.c +22 -6
- data/src/ruby/ext/grpc/rb_server_credentials.h +5 -0
- data/src/ruby/ext/grpc/rb_xds_channel_credentials.c +218 -0
- data/src/ruby/ext/grpc/rb_xds_channel_credentials.h +37 -0
- data/src/ruby/ext/grpc/rb_xds_server_credentials.c +170 -0
- data/src/ruby/ext/grpc/rb_xds_server_credentials.h +37 -0
- data/src/ruby/lib/grpc/generic/client_stub.rb +4 -2
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/grpc/health/v1/health_services_pb.rb +1 -1
- data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +35 -0
- data/src/ruby/pb/src/proto/grpc/testing/test_pb.rb +2 -2
- data/src/ruby/pb/src/proto/grpc/testing/test_services_pb.rb +23 -5
- data/src/ruby/spec/call_spec.rb +1 -1
- data/src/ruby/spec/channel_credentials_spec.rb +32 -0
- data/src/ruby/spec/channel_spec.rb +17 -6
- data/src/ruby/spec/client_auth_spec.rb +27 -1
- data/src/ruby/spec/client_server_spec.rb +1 -1
- data/src/ruby/spec/errors_spec.rb +1 -1
- data/src/ruby/spec/generic/active_call_spec.rb +2 -2
- data/src/ruby/spec/generic/client_stub_spec.rb +4 -4
- data/src/ruby/spec/generic/rpc_server_spec.rb +1 -1
- data/src/ruby/spec/pb/codegen/package_option_spec.rb +2 -6
- data/src/ruby/spec/server_credentials_spec.rb +25 -0
- data/src/ruby/spec/server_spec.rb +22 -0
- data/third_party/abseil-cpp/absl/algorithm/container.h +3 -3
- data/third_party/abseil-cpp/absl/base/attributes.h +24 -4
- data/third_party/abseil-cpp/absl/base/call_once.h +2 -9
- data/third_party/abseil-cpp/absl/base/config.h +37 -9
- data/third_party/abseil-cpp/absl/base/dynamic_annotations.h +24 -10
- data/third_party/abseil-cpp/absl/base/internal/direct_mmap.h +4 -1
- data/third_party/abseil-cpp/absl/base/internal/endian.h +61 -0
- data/third_party/abseil-cpp/absl/base/internal/low_level_scheduling.h +2 -3
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +34 -32
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +16 -6
- data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +11 -2
- data/third_party/abseil-cpp/absl/base/internal/spinlock.h +14 -5
- data/third_party/abseil-cpp/absl/base/internal/spinlock_akaros.inc +2 -2
- data/third_party/abseil-cpp/absl/base/internal/spinlock_linux.inc +3 -3
- data/third_party/abseil-cpp/absl/base/internal/spinlock_posix.inc +2 -2
- data/third_party/abseil-cpp/absl/base/internal/spinlock_wait.h +11 -11
- data/third_party/abseil-cpp/absl/base/internal/spinlock_win32.inc +5 -5
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +1 -1
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.cc +9 -6
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.h +54 -48
- data/third_party/abseil-cpp/absl/base/internal/throw_delegate.cc +111 -7
- data/third_party/abseil-cpp/absl/base/internal/unaligned_access.h +0 -76
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +1 -3
- data/third_party/abseil-cpp/absl/base/log_severity.h +4 -4
- data/third_party/abseil-cpp/absl/base/macros.h +11 -0
- data/third_party/abseil-cpp/absl/base/optimization.h +10 -7
- data/third_party/abseil-cpp/absl/base/options.h +1 -1
- data/third_party/abseil-cpp/absl/base/port.h +0 -1
- data/third_party/abseil-cpp/absl/base/thread_annotations.h +1 -1
- data/third_party/abseil-cpp/absl/container/fixed_array.h +2 -2
- data/third_party/abseil-cpp/absl/container/flat_hash_map.h +606 -0
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +5 -3
- data/third_party/abseil-cpp/absl/container/internal/compressed_tuple.h +1 -1
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +5 -1
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +2 -1
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler_force_weak_definition.cc +2 -1
- data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +141 -66
- data/third_party/abseil-cpp/absl/container/internal/layout.h +4 -4
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +197 -0
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +14 -1
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +136 -136
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +16 -12
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +5 -2
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h +3 -12
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +6 -1
- data/third_party/abseil-cpp/absl/debugging/internal/symbolize.h +3 -5
- data/third_party/abseil-cpp/absl/debugging/symbolize_darwin.inc +2 -2
- data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +2 -2
- data/third_party/abseil-cpp/absl/hash/internal/city.cc +15 -12
- data/third_party/abseil-cpp/absl/hash/internal/city.h +1 -19
- data/third_party/abseil-cpp/absl/hash/internal/hash.cc +25 -10
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +86 -37
- data/third_party/abseil-cpp/absl/hash/internal/wyhash.cc +111 -0
- data/third_party/abseil-cpp/absl/hash/internal/wyhash.h +48 -0
- data/third_party/abseil-cpp/absl/meta/type_traits.h +16 -2
- data/third_party/abseil-cpp/absl/numeric/bits.h +177 -0
- data/third_party/abseil-cpp/absl/numeric/int128.cc +3 -3
- data/third_party/abseil-cpp/absl/numeric/internal/bits.h +358 -0
- data/third_party/abseil-cpp/absl/numeric/internal/representation.h +55 -0
- data/third_party/abseil-cpp/absl/status/internal/status_internal.h +18 -0
- data/third_party/abseil-cpp/absl/status/internal/statusor_internal.h +396 -0
- data/third_party/abseil-cpp/absl/status/status.cc +29 -22
- data/third_party/abseil-cpp/absl/status/status.h +81 -20
- data/third_party/abseil-cpp/absl/status/statusor.cc +71 -0
- data/third_party/abseil-cpp/absl/status/statusor.h +760 -0
- data/third_party/abseil-cpp/absl/strings/charconv.cc +5 -5
- data/third_party/abseil-cpp/absl/strings/cord.cc +326 -371
- data/third_party/abseil-cpp/absl/strings/cord.h +182 -64
- data/third_party/abseil-cpp/absl/strings/escaping.cc +4 -4
- data/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc +6 -6
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.cc +83 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +387 -17
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h +146 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.cc +897 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.h +589 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring_reader.h +114 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +14 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +14 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc +15 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +19 -4
- data/third_party/abseil-cpp/absl/strings/internal/str_format/checker.h +14 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +36 -18
- data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.h +14 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc +14 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +14 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +15 -40
- data/third_party/abseil-cpp/absl/strings/internal/string_constant.h +64 -0
- data/third_party/abseil-cpp/absl/strings/match.cc +6 -3
- data/third_party/abseil-cpp/absl/strings/match.h +16 -6
- data/third_party/abseil-cpp/absl/strings/numbers.cc +132 -4
- data/third_party/abseil-cpp/absl/strings/numbers.h +10 -10
- data/third_party/abseil-cpp/absl/strings/str_join.h +1 -1
- data/third_party/abseil-cpp/absl/strings/str_split.h +38 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/futex.h +154 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc +1 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h +2 -1
- data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.cc +2 -2
- data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.h +4 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc +1 -65
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter.h +2 -6
- data/third_party/abseil-cpp/absl/synchronization/mutex.cc +71 -59
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +79 -62
- data/third_party/abseil-cpp/absl/time/clock.cc +146 -130
- data/third_party/abseil-cpp/absl/time/clock.h +2 -2
- data/third_party/abseil-cpp/absl/time/duration.cc +3 -2
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time_detail.h +7 -11
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.cc +7 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h +4 -4
- data/third_party/abseil-cpp/absl/time/time.cc +4 -3
- data/third_party/abseil-cpp/absl/time/time.h +26 -24
- data/third_party/abseil-cpp/absl/types/internal/variant.h +1 -1
- data/third_party/abseil-cpp/absl/types/variant.h +9 -4
- data/third_party/address_sorting/address_sorting_posix.c +1 -0
- data/third_party/boringssl-with-bazel/err_data.c +756 -724
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_bitstr.c +55 -50
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_bool.c +22 -23
- 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_enum.c +2 -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_int.c +5 -5
- 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 +26 -24
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_octet.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_print.c +19 -29
- data/third_party/boringssl-with-bazel/src/crypto/{x509 → asn1}/a_strex.c +269 -272
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_strnid.c +106 -153
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_time.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_type.c +22 -10
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_utctm.c +3 -42
- 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 +16 -16
- data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_par.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/{x509 → asn1}/charmap.h +0 -0
- data/third_party/boringssl-with-bazel/src/crypto/asn1/internal.h +196 -0
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_dec.c +35 -86
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c +326 -281
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_fre.c +15 -26
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_new.c +20 -75
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_typ.c +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_utl.c +3 -2
- 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/bio/socket_helper.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/blake2/blake2.c +156 -0
- data/third_party/boringssl-with-bazel/src/crypto/bn_extra/bn_asn1.c +3 -10
- data/third_party/boringssl-with-bazel/src/crypto/bytestring/ber.c +8 -9
- data/third_party/boringssl-with-bazel/src/crypto/bytestring/cbb.c +9 -0
- data/third_party/boringssl-with-bazel/src/crypto/bytestring/cbs.c +68 -45
- 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 +49 -65
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_chacha20poly1305.c +6 -81
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_tls.c +1 -88
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/internal.h +101 -3
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/tls_cbc.c +119 -273
- data/third_party/boringssl-with-bazel/src/crypto/conf/conf.c +14 -3
- data/third_party/boringssl-with-bazel/src/crypto/cpu-aarch64-win.c +41 -0
- data/third_party/boringssl-with-bazel/src/crypto/cpu-arm-linux.c +11 -2
- data/third_party/boringssl-with-bazel/src/crypto/cpu-arm.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/curve25519/curve25519.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/curve25519/internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/{dh → dh_extra}/dh_asn1.c +0 -0
- data/third_party/boringssl-with-bazel/src/crypto/{dh → dh_extra}/params.c +179 -0
- data/third_party/boringssl-with-bazel/src/crypto/digest_extra/digest_extra.c +31 -3
- data/third_party/boringssl-with-bazel/src/crypto/ec_extra/ec_asn1.c +2 -17
- data/third_party/boringssl-with-bazel/src/crypto/err/err.c +87 -80
- data/third_party/boringssl-with-bazel/src/crypto/evp/evp.c +9 -0
- data/third_party/boringssl-with-bazel/src/crypto/evp/scrypt.c +32 -34
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bcm.c +4 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/bn.c +13 -20
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/div.c +28 -12
- 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 +15 -4
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/prime.c +0 -4
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/sqrt.c +5 -9
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/cipher.c +32 -16
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/e_aes.c +35 -2
- 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/{dh → fipsmodule/dh}/check.c +0 -0
- data/third_party/boringssl-with-bazel/src/crypto/{dh → fipsmodule/dh}/dh.c +136 -213
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/digest/digest.c +9 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/digest/digests.c +10 -2
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/digest/md32_common.h +87 -160
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec.c +16 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec_key.c +9 -2
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/internal.h +0 -4
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/ecdsa.c +104 -93
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/internal.h +39 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/md4/md4.c +56 -72
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/md5/md5.c +56 -73
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/cbc.c +33 -22
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/cfb.c +9 -8
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/ctr.c +9 -8
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/gcm.c +17 -13
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/gcm_nohw.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/internal.h +1 -22
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/ofb.c +2 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/internal.h +30 -9
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/rand.c +123 -44
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/urandom.c +30 -20
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa.c +50 -33
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa_impl.c +65 -41
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/fips.c +79 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/self_check.c +161 -9
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha1.c +93 -107
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha256.c +91 -113
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha512.c +50 -86
- data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +400 -325
- 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 +125 -0
- 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 +28 -9
- data/third_party/boringssl-with-bazel/src/crypto/obj/obj.c +10 -6
- 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 +156 -15
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8_x509.c +95 -48
- data/third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305.c +11 -8
- data/third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_arm.c +13 -11
- data/third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_vec.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/pool/pool.c +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/deterministic.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/fuchsia.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/{fipsmodule/is_fips.c → rand_extra/passive.c} +16 -11
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/rand_extra.c +5 -1
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/windows.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/rsa_extra/rsa_asn1.c +1 -2
- data/third_party/boringssl-with-bazel/src/crypto/siphash/siphash.c +6 -6
- data/third_party/boringssl-with-bazel/src/crypto/stack/stack.c +7 -13
- data/third_party/boringssl-with-bazel/src/crypto/thread_pthread.c +0 -28
- data/third_party/boringssl-with-bazel/src/crypto/x509/a_verify.c +15 -11
- data/third_party/boringssl-with-bazel/src/crypto/x509/algorithm.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/by_dir.c +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/by_file.c +2 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/internal.h +345 -13
- 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 +20 -5
- data/third_party/boringssl-with-bazel/src/crypto/x509/t_crl.c +10 -5
- data/third_party/boringssl-with-bazel/src/crypto/x509/t_req.c +2 -0
- 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 +7 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_att.c +24 -47
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_cmp.c +4 -31
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_ext.c +12 -9
- 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_req.c +42 -89
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_set.c +17 -24
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_trs.c +2 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_v3.c +26 -23
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_vfy.c +25 -69
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_vpm.c +54 -74
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509cset.c +61 -23
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509name.c +2 -4
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509rset.c +3 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_algor.c +21 -19
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_all.c +3 -16
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_attrib.c +21 -34
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_crl.c +15 -13
- 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_pkey.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_pubkey.c +25 -22
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_req.c +5 -8
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_sig.c +5 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_val.c +2 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_x509.c +50 -14
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_x509a.c +5 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/internal.h +23 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_cache.c +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_data.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_int.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_map.c +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_tree.c +4 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_akey.c +27 -8
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_alt.c +28 -18
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_bitst.c +6 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_conf.c +26 -25
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_cpols.c +10 -12
- 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 +7 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_genn.c +40 -20
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_ia5.c +3 -4
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_lib.c +27 -36
- 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 +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_skey.c +7 -6
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_utl.c +86 -44
- data/third_party/boringssl-with-bazel/src/include/openssl/aead.h +1 -4
- data/third_party/boringssl-with-bazel/src/include/openssl/arm_arch.h +69 -4
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1.h +1026 -615
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1t.h +2 -176
- data/third_party/boringssl-with-bazel/src/include/openssl/base.h +63 -13
- data/third_party/boringssl-with-bazel/src/include/openssl/bio.h +3 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/blake2.h +62 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/bn.h +3 -3
- data/third_party/boringssl-with-bazel/src/include/openssl/bytestring.h +32 -7
- data/third_party/boringssl-with-bazel/src/include/openssl/chacha.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/cipher.h +23 -6
- data/third_party/boringssl-with-bazel/src/include/openssl/conf.h +8 -5
- data/third_party/boringssl-with-bazel/src/include/openssl/cpu.h +22 -32
- data/third_party/boringssl-with-bazel/src/include/openssl/crypto.h +24 -4
- data/third_party/boringssl-with-bazel/src/include/openssl/dh.h +56 -26
- data/third_party/boringssl-with-bazel/src/include/openssl/digest.h +10 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/ec.h +20 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/ecdsa.h +33 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/err.h +3 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +38 -51
- data/third_party/boringssl-with-bazel/src/{crypto/x509/x509_r2x.c → include/openssl/evp_errors.h} +41 -58
- data/third_party/boringssl-with-bazel/src/include/openssl/hkdf.h +4 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/hpke.h +350 -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 +26 -6
- data/third_party/boringssl-with-bazel/src/include/openssl/pem.h +0 -20
- data/third_party/boringssl-with-bazel/src/include/openssl/pkcs7.h +33 -8
- data/third_party/boringssl-with-bazel/src/include/openssl/pkcs8.h +9 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/rand.h +5 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/rsa.h +104 -63
- data/third_party/boringssl-with-bazel/src/include/openssl/span.h +39 -16
- data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +406 -108
- data/third_party/boringssl-with-bazel/src/include/openssl/tls1.h +48 -36
- data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +1425 -377
- data/third_party/boringssl-with-bazel/src/include/openssl/x509_vfy.h +16 -679
- data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +188 -49
- data/third_party/boringssl-with-bazel/src/ssl/d1_both.cc +16 -18
- data/third_party/boringssl-with-bazel/src/ssl/d1_srtp.cc +1 -1
- data/third_party/boringssl-with-bazel/src/ssl/encrypted_client_hello.cc +1084 -0
- data/third_party/boringssl-with-bazel/src/ssl/{t1_lib.cc → extensions.cc} +847 -622
- data/third_party/boringssl-with-bazel/src/ssl/handoff.cc +298 -22
- data/third_party/boringssl-with-bazel/src/ssl/handshake.cc +92 -44
- data/third_party/boringssl-with-bazel/src/ssl/handshake_client.cc +314 -217
- data/third_party/boringssl-with-bazel/src/ssl/handshake_server.cc +177 -35
- data/third_party/boringssl-with-bazel/src/ssl/internal.h +491 -152
- data/third_party/boringssl-with-bazel/src/ssl/s3_both.cc +9 -3
- data/third_party/boringssl-with-bazel/src/ssl/s3_lib.cc +0 -2
- data/third_party/boringssl-with-bazel/src/ssl/s3_pkt.cc +14 -19
- data/third_party/boringssl-with-bazel/src/ssl/ssl_asn1.cc +7 -8
- data/third_party/boringssl-with-bazel/src/ssl/ssl_cert.cc +4 -6
- 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 +34 -31
- data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +60 -112
- data/third_party/boringssl-with-bazel/src/ssl/ssl_privkey.cc +2 -0
- data/third_party/boringssl-with-bazel/src/ssl/ssl_session.cc +136 -104
- data/third_party/boringssl-with-bazel/src/ssl/ssl_stat.cc +3 -0
- data/third_party/boringssl-with-bazel/src/ssl/ssl_transcript.cc +12 -17
- data/third_party/boringssl-with-bazel/src/ssl/ssl_versions.cc +7 -3
- data/third_party/boringssl-with-bazel/src/ssl/ssl_x509.cc +28 -23
- data/third_party/boringssl-with-bazel/src/ssl/t1_enc.cc +5 -7
- data/third_party/boringssl-with-bazel/src/ssl/tls13_both.cc +79 -34
- data/third_party/boringssl-with-bazel/src/ssl/tls13_client.cc +235 -178
- data/third_party/boringssl-with-bazel/src/ssl/tls13_enc.cc +160 -91
- data/third_party/boringssl-with-bazel/src/ssl/tls13_server.cc +269 -118
- data/third_party/boringssl-with-bazel/src/ssl/tls_method.cc +4 -2
- 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 +354 -204
- data/third_party/upb/upb/decode.h +50 -3
- data/third_party/upb/upb/decode_fast.c +1053 -0
- data/third_party/upb/upb/decode_fast.h +153 -0
- data/third_party/upb/upb/decode_internal.h +193 -0
- data/third_party/upb/upb/def.c +609 -610
- data/third_party/upb/upb/def.h +57 -50
- data/third_party/upb/upb/def.hpp +66 -123
- data/third_party/upb/upb/encode.c +267 -176
- data/third_party/upb/upb/encode.h +56 -4
- data/third_party/upb/upb/msg.c +304 -84
- data/third_party/upb/upb/msg.h +76 -441
- data/third_party/upb/upb/msg_internal.h +687 -0
- data/third_party/upb/upb/port_def.inc +156 -82
- data/third_party/upb/upb/port_undef.inc +41 -8
- data/third_party/upb/upb/reflection.c +64 -55
- data/third_party/upb/upb/reflection.h +36 -8
- data/third_party/upb/upb/reflection.hpp +37 -0
- data/third_party/upb/upb/table.c +238 -276
- data/third_party/upb/upb/{table.int.h → table_internal.h} +66 -181
- data/third_party/upb/upb/text_encode.c +77 -26
- data/third_party/upb/upb/text_encode.h +30 -1
- data/third_party/upb/upb/upb.c +75 -47
- data/third_party/upb/upb/upb.h +72 -13
- data/third_party/upb/upb/upb.hpp +28 -4
- data/third_party/upb/upb/upb_internal.h +58 -0
- data/third_party/xxhash/xxhash.h +5325 -0
- metadata +287 -137
- data/src/core/ext/filters/client_channel/lb_policy/xds/eds.cc +0 -909
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc +0 -485
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc +0 -179
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc +0 -68
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc +0 -38
- data/src/core/ext/filters/client_channel/resolving_lb_policy.cc +0 -355
- data/src/core/ext/filters/client_channel/resolving_lb_policy.h +0 -138
- data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc +0 -210
- 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/hpack_table.cc +0 -242
- 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/core/v1/authority.upb.c +0 -28
- data/src/core/ext/upb-generated/udpa/core/v1/authority.upb.h +0 -53
- data/src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.c +0 -52
- data/src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.h +0 -129
- data/src/core/ext/upb-generated/udpa/core/v1/context_params.upb.c +0 -42
- data/src/core/ext/upb-generated/udpa/core/v1/context_params.upb.h +0 -77
- data/src/core/ext/upb-generated/udpa/core/v1/resource.upb.c +0 -36
- data/src/core/ext/upb-generated/udpa/core/v1/resource.upb.h +0 -85
- data/src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.c +0 -54
- data/src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.h +0 -160
- data/src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.c +0 -36
- data/src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.h +0 -84
- 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 -117
- data/src/core/ext/upbdefs-generated/udpa/core/v1/authority.upbdefs.c +0 -42
- data/src/core/ext/upbdefs-generated/udpa/core/v1/authority.upbdefs.h +0 -35
- data/src/core/ext/upbdefs-generated/udpa/core/v1/collection_entry.upbdefs.c +0 -62
- data/src/core/ext/upbdefs-generated/udpa/core/v1/collection_entry.upbdefs.h +0 -40
- data/src/core/ext/upbdefs-generated/udpa/core/v1/context_params.upbdefs.c +0 -45
- data/src/core/ext/upbdefs-generated/udpa/core/v1/context_params.upbdefs.h +0 -40
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource.upbdefs.c +0 -49
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource.upbdefs.h +0 -35
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_locator.upbdefs.c +0 -68
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_locator.upbdefs.h +0 -40
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_name.upbdefs.c +0 -51
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_name.upbdefs.h +0 -35
- data/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.cc +0 -265
- data/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.h +0 -104
- data/src/core/lib/gpr/arena.h +0 -47
- 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/gprpp/map.h +0 -53
- data/src/core/lib/iomgr/endpoint_pair_uv.cc +0 -40
- data/src/core/lib/iomgr/iomgr_posix.h +0 -26
- data/src/core/lib/iomgr/iomgr_uv.cc +0 -43
- data/src/core/lib/iomgr/poller/eventmanager_libuv.cc +0 -88
- data/src/core/lib/iomgr/poller/eventmanager_libuv.h +0 -88
- data/src/core/lib/iomgr/pollset_uv.cc +0 -93
- data/src/core/lib/iomgr/pollset_uv.h +0 -32
- 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 -419
- 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 -104
- data/src/core/lib/security/authorization/authorization_engine.cc +0 -177
- data/src/core/lib/security/authorization/mock_cel/activation.h +0 -57
- data/src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h +0 -44
- data/src/core/lib/security/authorization/mock_cel/cel_expression.h +0 -69
- data/src/core/lib/security/authorization/mock_cel/cel_value.h +0 -97
- data/src/core/lib/security/authorization/mock_cel/evaluator_core.h +0 -67
- data/src/core/lib/security/authorization/mock_cel/flat_expr_builder.h +0 -57
- data/src/core/lib/transport/authority_override.cc +0 -38
- data/third_party/abseil-cpp/absl/base/internal/bits.h +0 -219
- data/third_party/abseil-cpp/absl/container/flat_hash_set.h +0 -504
- data/third_party/abseil-cpp/absl/synchronization/internal/mutex_nonprod.inc +0 -249
- data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_locl.h +0 -104
- data/third_party/boringssl-with-bazel/src/crypto/hpke/internal.h +0 -237
- data/third_party/boringssl-with-bazel/src/crypto/x509/vpm_int.h +0 -71
- data/third_party/upb/upb/port.c +0 -26
@@ -1,23 +1,23 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
*
|
17
|
-
*/
|
1
|
+
//
|
2
|
+
// Copyright 2018 gRPC authors.
|
3
|
+
//
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
// you may not use this file except in compliance with the License.
|
6
|
+
// You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
// See the License for the specific language governing permissions and
|
14
|
+
// limitations under the License.
|
15
|
+
//
|
18
16
|
|
19
17
|
#include <grpc/support/port_platform.h>
|
20
18
|
|
19
|
+
#include "src/core/ext/xds/xds_client.h"
|
20
|
+
|
21
21
|
#include <inttypes.h>
|
22
22
|
#include <limits.h>
|
23
23
|
#include <string.h>
|
@@ -33,29 +33,29 @@
|
|
33
33
|
#include <grpc/support/time.h>
|
34
34
|
|
35
35
|
#include "src/core/ext/filters/client_channel/client_channel.h"
|
36
|
-
#include "src/core/ext/filters/client_channel/service_config.h"
|
37
36
|
#include "src/core/ext/xds/xds_api.h"
|
37
|
+
#include "src/core/ext/xds/xds_bootstrap.h"
|
38
38
|
#include "src/core/ext/xds/xds_channel_args.h"
|
39
|
-
#include "src/core/ext/xds/xds_client.h"
|
40
39
|
#include "src/core/ext/xds/xds_client_stats.h"
|
40
|
+
#include "src/core/ext/xds/xds_http_filters.h"
|
41
|
+
#include "src/core/lib/address_utils/sockaddr_utils.h"
|
41
42
|
#include "src/core/lib/backoff/backoff.h"
|
42
43
|
#include "src/core/lib/channel/channel_args.h"
|
43
44
|
#include "src/core/lib/channel/channel_stack.h"
|
45
|
+
#include "src/core/lib/gpr/env.h"
|
44
46
|
#include "src/core/lib/gpr/string.h"
|
45
|
-
#include "src/core/lib/gprpp/map.h"
|
46
47
|
#include "src/core/lib/gprpp/memory.h"
|
47
48
|
#include "src/core/lib/gprpp/orphanable.h"
|
48
49
|
#include "src/core/lib/gprpp/ref_counted_ptr.h"
|
49
50
|
#include "src/core/lib/gprpp/sync.h"
|
50
51
|
#include "src/core/lib/iomgr/sockaddr.h"
|
51
|
-
#include "src/core/lib/iomgr/sockaddr_utils.h"
|
52
52
|
#include "src/core/lib/iomgr/timer.h"
|
53
53
|
#include "src/core/lib/slice/slice_internal.h"
|
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
|
@@ -66,12 +66,15 @@
|
|
66
66
|
namespace grpc_core {
|
67
67
|
|
68
68
|
TraceFlag grpc_xds_client_trace(false, "xds_client");
|
69
|
+
TraceFlag grpc_xds_client_refcount_trace(false, "xds_client_refcount");
|
69
70
|
|
70
71
|
namespace {
|
71
72
|
|
72
73
|
Mutex* g_mu = nullptr;
|
73
|
-
|
74
|
-
|
74
|
+
|
75
|
+
const grpc_channel_args* g_channel_args ABSL_GUARDED_BY(*g_mu) = nullptr;
|
76
|
+
XdsClient* g_xds_client ABSL_GUARDED_BY(*g_mu) = nullptr;
|
77
|
+
char* g_fallback_bootstrap_config ABSL_GUARDED_BY(*g_mu) = nullptr;
|
75
78
|
|
76
79
|
} // namespace
|
77
80
|
|
@@ -85,7 +88,7 @@ template <typename T>
|
|
85
88
|
class XdsClient::ChannelState::RetryableCall
|
86
89
|
: public InternallyRefCounted<RetryableCall<T>> {
|
87
90
|
public:
|
88
|
-
explicit RetryableCall(
|
91
|
+
explicit RetryableCall(WeakRefCountedPtr<ChannelState> chand);
|
89
92
|
|
90
93
|
void Orphan() override;
|
91
94
|
|
@@ -99,14 +102,14 @@ class XdsClient::ChannelState::RetryableCall
|
|
99
102
|
private:
|
100
103
|
void StartNewCallLocked();
|
101
104
|
void StartRetryTimerLocked();
|
102
|
-
static void OnRetryTimer(void* arg,
|
103
|
-
void OnRetryTimerLocked(
|
105
|
+
static void OnRetryTimer(void* arg, grpc_error_handle error);
|
106
|
+
void OnRetryTimerLocked(grpc_error_handle error);
|
104
107
|
|
105
108
|
// The wrapped xds call that talks to the xds server. It's instantiated
|
106
109
|
// every time we start a new call. It's null during call retry backoff.
|
107
110
|
OrphanablePtr<T> calld_;
|
108
111
|
// The owning xds channel.
|
109
|
-
|
112
|
+
WeakRefCountedPtr<ChannelState> chand_;
|
110
113
|
|
111
114
|
// Retry state.
|
112
115
|
BackOff backoff_;
|
@@ -132,19 +135,24 @@ class XdsClient::ChannelState::AdsCallState
|
|
132
135
|
XdsClient* xds_client() const { return chand()->xds_client(); }
|
133
136
|
bool seen_response() const { return seen_response_; }
|
134
137
|
|
135
|
-
void
|
136
|
-
|
137
|
-
|
138
|
+
void SubscribeLocked(const std::string& type_url,
|
139
|
+
const XdsApi::ResourceName& resource)
|
140
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
141
|
+
void UnsubscribeLocked(const std::string& type_url,
|
142
|
+
const XdsApi::ResourceName& resource,
|
143
|
+
bool delay_unsubscription)
|
144
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
138
145
|
|
139
146
|
bool HasSubscribedResources() const;
|
140
147
|
|
141
148
|
private:
|
142
149
|
class ResourceState : public InternallyRefCounted<ResourceState> {
|
143
150
|
public:
|
144
|
-
ResourceState(const std::string& type_url,
|
151
|
+
ResourceState(const std::string& type_url,
|
152
|
+
const XdsApi::ResourceName& resource,
|
145
153
|
bool sent_initial_request)
|
146
154
|
: type_url_(type_url),
|
147
|
-
|
155
|
+
resource_(resource),
|
148
156
|
sent_initial_request_(sent_initial_request) {
|
149
157
|
GRPC_CLOSURE_INIT(&timer_callback_, OnTimer, this,
|
150
158
|
grpc_schedule_on_exec_ctx);
|
@@ -175,7 +183,7 @@ class XdsClient::ChannelState::AdsCallState
|
|
175
183
|
}
|
176
184
|
|
177
185
|
private:
|
178
|
-
static void OnTimer(void* arg,
|
186
|
+
static void OnTimer(void* arg, grpc_error_handle error) {
|
179
187
|
ResourceState* self = static_cast<ResourceState*>(arg);
|
180
188
|
{
|
181
189
|
MutexLock lock(&self->ads_calld_->xds_client()->mu_);
|
@@ -185,36 +193,46 @@ class XdsClient::ChannelState::AdsCallState
|
|
185
193
|
self->Unref(DEBUG_LOCATION, "timer");
|
186
194
|
}
|
187
195
|
|
188
|
-
void OnTimerLocked(
|
196
|
+
void OnTimerLocked(grpc_error_handle error)
|
197
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_) {
|
189
198
|
if (error == GRPC_ERROR_NONE && timer_pending_) {
|
190
199
|
timer_pending_ = false;
|
191
|
-
|
192
|
-
absl::StrFormat(
|
200
|
+
grpc_error_handle watcher_error =
|
201
|
+
GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
|
193
202
|
"timeout obtaining resource {type=%s name=%s} from xds server",
|
194
|
-
type_url_,
|
195
|
-
.
|
203
|
+
type_url_,
|
204
|
+
XdsApi::ConstructFullResourceName(resource_.authority,
|
205
|
+
type_url_, resource_.id)));
|
206
|
+
watcher_error = grpc_error_set_int(
|
207
|
+
watcher_error, GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
|
196
208
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
197
209
|
gpr_log(GPR_INFO, "[xds_client %p] %s", ads_calld_->xds_client(),
|
198
|
-
|
210
|
+
grpc_error_std_string(watcher_error).c_str());
|
199
211
|
}
|
212
|
+
auto& authority_state =
|
213
|
+
ads_calld_->xds_client()->authority_state_map_[resource_.authority];
|
200
214
|
if (type_url_ == XdsApi::kLdsTypeUrl) {
|
201
|
-
ListenerState& state =
|
215
|
+
ListenerState& state = authority_state.listener_map[resource_.id];
|
216
|
+
state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
|
202
217
|
for (const auto& p : state.watchers) {
|
203
218
|
p.first->OnError(GRPC_ERROR_REF(watcher_error));
|
204
219
|
}
|
205
220
|
} else if (type_url_ == XdsApi::kRdsTypeUrl) {
|
206
221
|
RouteConfigState& state =
|
207
|
-
|
222
|
+
authority_state.route_config_map[resource_.id];
|
223
|
+
state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
|
208
224
|
for (const auto& p : state.watchers) {
|
209
225
|
p.first->OnError(GRPC_ERROR_REF(watcher_error));
|
210
226
|
}
|
211
227
|
} else if (type_url_ == XdsApi::kCdsTypeUrl) {
|
212
|
-
ClusterState& state =
|
228
|
+
ClusterState& state = authority_state.cluster_map[resource_.id];
|
229
|
+
state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
|
213
230
|
for (const auto& p : state.watchers) {
|
214
231
|
p.first->OnError(GRPC_ERROR_REF(watcher_error));
|
215
232
|
}
|
216
233
|
} else if (type_url_ == XdsApi::kEdsTypeUrl) {
|
217
|
-
EndpointState& state =
|
234
|
+
EndpointState& state = authority_state.endpoint_map[resource_.id];
|
235
|
+
state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
|
218
236
|
for (const auto& p : state.watchers) {
|
219
237
|
p.first->OnError(GRPC_ERROR_REF(watcher_error));
|
220
238
|
}
|
@@ -227,7 +245,7 @@ class XdsClient::ChannelState::AdsCallState
|
|
227
245
|
}
|
228
246
|
|
229
247
|
const std::string type_url_;
|
230
|
-
const
|
248
|
+
const XdsApi::ResourceName resource_;
|
231
249
|
|
232
250
|
RefCountedPtr<AdsCallState> ads_calld_;
|
233
251
|
bool sent_initial_request_;
|
@@ -241,31 +259,61 @@ class XdsClient::ChannelState::AdsCallState
|
|
241
259
|
|
242
260
|
// Nonce and error for this resource type.
|
243
261
|
std::string nonce;
|
244
|
-
|
262
|
+
grpc_error_handle error = GRPC_ERROR_NONE;
|
245
263
|
|
246
264
|
// Subscribed resources of this type.
|
247
|
-
std::map<std::string /*
|
265
|
+
std::map<std::string /*authority*/,
|
266
|
+
std::map<std::string /*name*/, OrphanablePtr<ResourceState>>>
|
248
267
|
subscribed_resources;
|
249
268
|
};
|
250
269
|
|
251
|
-
void SendMessageLocked(const std::string& type_url)
|
252
|
-
|
253
|
-
|
254
|
-
void
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
void
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
270
|
+
void SendMessageLocked(const std::string& type_url)
|
271
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
272
|
+
|
273
|
+
void AcceptLdsUpdateLocked(
|
274
|
+
std::string version, grpc_millis update_time,
|
275
|
+
XdsApi::LdsUpdateMap lds_update_map,
|
276
|
+
const std::set<XdsApi::ResourceName>& resource_names_failed)
|
277
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
278
|
+
void AcceptRdsUpdateLocked(std::string version, grpc_millis update_time,
|
279
|
+
XdsApi::RdsUpdateMap rds_update_map)
|
280
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
281
|
+
void AcceptCdsUpdateLocked(
|
282
|
+
std::string version, grpc_millis update_time,
|
283
|
+
XdsApi::CdsUpdateMap cds_update_map,
|
284
|
+
const std::set<XdsApi::ResourceName>& resource_names_failed)
|
285
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
286
|
+
void AcceptEdsUpdateLocked(std::string version, grpc_millis update_time,
|
287
|
+
XdsApi::EdsUpdateMap eds_update_map)
|
288
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
289
|
+
|
290
|
+
template <typename StateMap>
|
291
|
+
void RejectAdsUpdateHelperLocked(const std::string& resource_name,
|
292
|
+
grpc_millis update_time,
|
293
|
+
const XdsApi::AdsParseResult& result,
|
294
|
+
const std::string& error_details,
|
295
|
+
StateMap* state_map)
|
296
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
297
|
+
|
298
|
+
void RejectAdsUpdateLocked(grpc_millis update_time,
|
299
|
+
const XdsApi::AdsParseResult& result)
|
300
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
301
|
+
|
302
|
+
static void OnRequestSent(void* arg, grpc_error_handle error);
|
303
|
+
void OnRequestSentLocked(grpc_error_handle error)
|
304
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
305
|
+
static void OnResponseReceived(void* arg, grpc_error_handle error);
|
306
|
+
bool OnResponseReceivedLocked()
|
307
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
308
|
+
static void OnStatusReceived(void* arg, grpc_error_handle error);
|
309
|
+
void OnStatusReceivedLocked(grpc_error_handle error)
|
310
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
264
311
|
|
265
312
|
bool IsCurrentCallOnChannel() const;
|
266
313
|
|
267
|
-
std::
|
268
|
-
|
314
|
+
std::map<absl::string_view /*authority*/,
|
315
|
+
std::set<absl::string_view /*name*/>>
|
316
|
+
ResourceNamesForRequest(const std::string& type_url);
|
269
317
|
|
270
318
|
// The owning RetryableCall<>.
|
271
319
|
RefCountedPtr<RetryableCall<AdsCallState>> parent_;
|
@@ -333,12 +381,15 @@ class XdsClient::ChannelState::LrsCallState
|
|
333
381
|
void Orphan() override;
|
334
382
|
|
335
383
|
private:
|
336
|
-
void ScheduleNextReportLocked()
|
337
|
-
|
338
|
-
|
339
|
-
bool
|
340
|
-
|
341
|
-
bool
|
384
|
+
void ScheduleNextReportLocked()
|
385
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
386
|
+
static void OnNextReportTimer(void* arg, grpc_error_handle error);
|
387
|
+
bool OnNextReportTimerLocked(grpc_error_handle error)
|
388
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
389
|
+
bool SendReportLocked() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
390
|
+
static void OnReportDone(void* arg, grpc_error_handle error);
|
391
|
+
bool OnReportDoneLocked(grpc_error_handle error)
|
392
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
342
393
|
|
343
394
|
bool IsCurrentReporterOnCall() const {
|
344
395
|
return this == parent_->reporter_.get();
|
@@ -357,12 +408,15 @@ class XdsClient::ChannelState::LrsCallState
|
|
357
408
|
grpc_closure on_report_done_;
|
358
409
|
};
|
359
410
|
|
360
|
-
static void OnInitialRequestSent(void* arg,
|
361
|
-
void OnInitialRequestSentLocked()
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
411
|
+
static void OnInitialRequestSent(void* arg, grpc_error_handle error);
|
412
|
+
void OnInitialRequestSentLocked()
|
413
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
414
|
+
static void OnResponseReceived(void* arg, grpc_error_handle error);
|
415
|
+
bool OnResponseReceivedLocked()
|
416
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
417
|
+
static void OnStatusReceived(void* arg, grpc_error_handle error);
|
418
|
+
void OnStatusReceivedLocked(grpc_error_handle error)
|
419
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
|
366
420
|
|
367
421
|
bool IsCurrentCallOnChannel() const;
|
368
422
|
|
@@ -404,7 +458,7 @@ class XdsClient::ChannelState::LrsCallState
|
|
404
458
|
class XdsClient::ChannelState::StateWatcher
|
405
459
|
: public AsyncConnectivityStateWatcherInterface {
|
406
460
|
public:
|
407
|
-
explicit StateWatcher(
|
461
|
+
explicit StateWatcher(WeakRefCountedPtr<ChannelState> parent)
|
408
462
|
: parent_(std::move(parent)) {}
|
409
463
|
|
410
464
|
private:
|
@@ -418,13 +472,13 @@ class XdsClient::ChannelState::StateWatcher
|
|
418
472
|
"[xds_client %p] xds channel in state:TRANSIENT_FAILURE "
|
419
473
|
"status_message:(%s)",
|
420
474
|
parent_->xds_client(), status.ToString().c_str());
|
421
|
-
parent_->
|
475
|
+
parent_->xds_client_->NotifyOnErrorLocked(
|
422
476
|
GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
423
477
|
"xds channel in TRANSIENT_FAILURE"));
|
424
478
|
}
|
425
479
|
}
|
426
480
|
|
427
|
-
|
481
|
+
WeakRefCountedPtr<ChannelState> parent_;
|
428
482
|
};
|
429
483
|
|
430
484
|
//
|
@@ -433,42 +487,30 @@ class XdsClient::ChannelState::StateWatcher
|
|
433
487
|
|
434
488
|
namespace {
|
435
489
|
|
436
|
-
grpc_channel* CreateXdsChannel(
|
437
|
-
|
438
|
-
absl::InlinedVector<grpc_arg, 2> args_to_add = {
|
439
|
-
grpc_channel_arg_integer_create(
|
440
|
-
const_cast<char*>(GRPC_ARG_KEEPALIVE_TIME_MS),
|
441
|
-
5 * 60 * GPR_MS_PER_SEC),
|
442
|
-
grpc_channel_arg_integer_create(
|
443
|
-
const_cast<char*>(GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL), 1),
|
444
|
-
};
|
445
|
-
grpc_channel_args* new_args = grpc_channel_args_copy_and_add(
|
446
|
-
g_channel_args, args_to_add.data(), args_to_add.size());
|
447
|
-
// Create channel creds.
|
490
|
+
grpc_channel* CreateXdsChannel(grpc_channel_args* args,
|
491
|
+
const XdsBootstrap::XdsServer& server) {
|
448
492
|
RefCountedPtr<grpc_channel_credentials> channel_creds =
|
449
493
|
XdsChannelCredsRegistry::MakeChannelCreds(server.channel_creds_type,
|
450
494
|
server.channel_creds_config);
|
451
|
-
|
452
|
-
|
453
|
-
channel_creds.get(), server.server_uri.c_str(), new_args, nullptr);
|
454
|
-
grpc_channel_args_destroy(new_args);
|
455
|
-
return channel;
|
495
|
+
return grpc_secure_channel_create(channel_creds.get(),
|
496
|
+
server.server_uri.c_str(), args, nullptr);
|
456
497
|
}
|
457
498
|
|
458
499
|
} // namespace
|
459
500
|
|
460
501
|
XdsClient::ChannelState::ChannelState(WeakRefCountedPtr<XdsClient> xds_client,
|
461
502
|
const XdsBootstrap::XdsServer& server)
|
462
|
-
:
|
463
|
-
GRPC_TRACE_FLAG_ENABLED(
|
464
|
-
|
503
|
+
: DualRefCounted<ChannelState>(
|
504
|
+
GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace)
|
505
|
+
? "ChannelState"
|
506
|
+
: nullptr),
|
465
507
|
xds_client_(std::move(xds_client)),
|
466
508
|
server_(server) {
|
467
509
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
468
510
|
gpr_log(GPR_INFO, "[xds_client %p] creating channel to %s",
|
469
511
|
xds_client_.get(), server.server_uri.c_str());
|
470
512
|
}
|
471
|
-
channel_ = CreateXdsChannel(server);
|
513
|
+
channel_ = CreateXdsChannel(xds_client_->args_, server);
|
472
514
|
GPR_ASSERT(channel_ != nullptr);
|
473
515
|
StartConnectivityWatchLocked();
|
474
516
|
}
|
@@ -482,12 +524,19 @@ XdsClient::ChannelState::~ChannelState() {
|
|
482
524
|
xds_client_.reset(DEBUG_LOCATION, "ChannelState");
|
483
525
|
}
|
484
526
|
|
485
|
-
|
527
|
+
// This method should only ever be called when holding the lock, but we can't
|
528
|
+
// use a ABSL_EXCLUSIVE_LOCKS_REQUIRED annotation, because Orphan() will be
|
529
|
+
// called from DualRefCounted::Unref, which cannot have a lock annotation for a
|
530
|
+
// lock in this subclass.
|
531
|
+
void XdsClient::ChannelState::Orphan() ABSL_NO_THREAD_SAFETY_ANALYSIS {
|
486
532
|
shutting_down_ = true;
|
487
533
|
CancelConnectivityWatchLocked();
|
534
|
+
// At this time, all strong refs are removed, remove from channel map to
|
535
|
+
// prevent subsequent subscription from trying to use this ChannelState as it
|
536
|
+
// is shutting down.
|
537
|
+
xds_client_->xds_server_channel_map_.erase(server_);
|
488
538
|
ads_calld_.reset();
|
489
539
|
lrs_calld_.reset();
|
490
|
-
Unref(DEBUG_LOCATION, "ChannelState+orphaned");
|
491
540
|
}
|
492
541
|
|
493
542
|
XdsClient::ChannelState::AdsCallState* XdsClient::ChannelState::ads_calld()
|
@@ -501,40 +550,38 @@ XdsClient::ChannelState::LrsCallState* XdsClient::ChannelState::lrs_calld()
|
|
501
550
|
}
|
502
551
|
|
503
552
|
bool XdsClient::ChannelState::HasActiveAdsCall() const {
|
504
|
-
return ads_calld_->calld() != nullptr;
|
553
|
+
return ads_calld_ != nullptr && ads_calld_->calld() != nullptr;
|
505
554
|
}
|
506
555
|
|
507
556
|
void XdsClient::ChannelState::MaybeStartLrsCall() {
|
508
557
|
if (lrs_calld_ != nullptr) return;
|
509
|
-
lrs_calld_.reset(
|
510
|
-
|
558
|
+
lrs_calld_.reset(new RetryableCall<LrsCallState>(
|
559
|
+
WeakRef(DEBUG_LOCATION, "ChannelState+lrs")));
|
511
560
|
}
|
512
561
|
|
513
562
|
void XdsClient::ChannelState::StopLrsCall() { lrs_calld_.reset(); }
|
514
563
|
|
515
564
|
void XdsClient::ChannelState::StartConnectivityWatchLocked() {
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
client_channel_elem, GRPC_CHANNEL_IDLE,
|
565
|
+
ClientChannel* client_channel = ClientChannel::GetFromChannel(channel_);
|
566
|
+
GPR_ASSERT(client_channel != nullptr);
|
567
|
+
watcher_ = new StateWatcher(WeakRef(DEBUG_LOCATION, "ChannelState+watch"));
|
568
|
+
client_channel->AddConnectivityWatcher(
|
569
|
+
GRPC_CHANNEL_IDLE,
|
522
570
|
OrphanablePtr<AsyncConnectivityStateWatcherInterface>(watcher_));
|
523
571
|
}
|
524
572
|
|
525
573
|
void XdsClient::ChannelState::CancelConnectivityWatchLocked() {
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
grpc_client_channel_stop_connectivity_watch(client_channel_elem, watcher_);
|
574
|
+
ClientChannel* client_channel = ClientChannel::GetFromChannel(channel_);
|
575
|
+
GPR_ASSERT(client_channel != nullptr);
|
576
|
+
client_channel->RemoveConnectivityWatcher(watcher_);
|
530
577
|
}
|
531
578
|
|
532
|
-
void XdsClient::ChannelState::
|
533
|
-
|
579
|
+
void XdsClient::ChannelState::SubscribeLocked(
|
580
|
+
const std::string& type_url, const XdsApi::ResourceName& resource) {
|
534
581
|
if (ads_calld_ == nullptr) {
|
535
582
|
// Start the ADS call if this is the first request.
|
536
583
|
ads_calld_.reset(new RetryableCall<AdsCallState>(
|
537
|
-
|
584
|
+
WeakRef(DEBUG_LOCATION, "ChannelState+ads")));
|
538
585
|
// Note: AdsCallState's ctor will automatically subscribe to all
|
539
586
|
// resources that the XdsClient already has watchers for, so we can
|
540
587
|
// return here.
|
@@ -544,17 +591,19 @@ void XdsClient::ChannelState::Subscribe(const std::string& type_url,
|
|
544
591
|
// because when the call is restarted it will resend all necessary requests.
|
545
592
|
if (ads_calld() == nullptr) return;
|
546
593
|
// Subscribe to this resource if the ADS call is active.
|
547
|
-
ads_calld()->
|
594
|
+
ads_calld()->SubscribeLocked(type_url, resource);
|
548
595
|
}
|
549
596
|
|
550
|
-
void XdsClient::ChannelState::
|
551
|
-
|
552
|
-
|
597
|
+
void XdsClient::ChannelState::UnsubscribeLocked(
|
598
|
+
const std::string& type_url, const XdsApi::ResourceName& resource,
|
599
|
+
bool delay_unsubscription) {
|
553
600
|
if (ads_calld_ != nullptr) {
|
554
601
|
auto* calld = ads_calld_->calld();
|
555
602
|
if (calld != nullptr) {
|
556
|
-
calld->
|
557
|
-
if (!calld->HasSubscribedResources())
|
603
|
+
calld->UnsubscribeLocked(type_url, resource, delay_unsubscription);
|
604
|
+
if (!calld->HasSubscribedResources()) {
|
605
|
+
ads_calld_.reset();
|
606
|
+
}
|
558
607
|
}
|
559
608
|
}
|
560
609
|
}
|
@@ -565,7 +614,7 @@ void XdsClient::ChannelState::Unsubscribe(const std::string& type_url,
|
|
565
614
|
|
566
615
|
template <typename T>
|
567
616
|
XdsClient::ChannelState::RetryableCall<T>::RetryableCall(
|
568
|
-
|
617
|
+
WeakRefCountedPtr<ChannelState> chand)
|
569
618
|
: chand_(std::move(chand)),
|
570
619
|
backoff_(
|
571
620
|
BackOff::Options()
|
@@ -623,7 +672,8 @@ void XdsClient::ChannelState::RetryableCall<T>::StartRetryTimerLocked() {
|
|
623
672
|
if (shutting_down_) return;
|
624
673
|
const grpc_millis next_attempt_time = backoff_.NextAttemptTime();
|
625
674
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
626
|
-
grpc_millis timeout =
|
675
|
+
grpc_millis timeout =
|
676
|
+
std::max(next_attempt_time - ExecCtx::Get()->Now(), grpc_millis(0));
|
627
677
|
gpr_log(GPR_INFO,
|
628
678
|
"[xds_client %p] Failed to connect to xds server (chand: %p) "
|
629
679
|
"retry timer will fire in %" PRId64 "ms.",
|
@@ -636,7 +686,7 @@ void XdsClient::ChannelState::RetryableCall<T>::StartRetryTimerLocked() {
|
|
636
686
|
|
637
687
|
template <typename T>
|
638
688
|
void XdsClient::ChannelState::RetryableCall<T>::OnRetryTimer(
|
639
|
-
void* arg,
|
689
|
+
void* arg, grpc_error_handle error) {
|
640
690
|
RetryableCall* calld = static_cast<RetryableCall*>(arg);
|
641
691
|
{
|
642
692
|
MutexLock lock(&calld->chand_->xds_client()->mu_);
|
@@ -647,7 +697,7 @@ void XdsClient::ChannelState::RetryableCall<T>::OnRetryTimer(
|
|
647
697
|
|
648
698
|
template <typename T>
|
649
699
|
void XdsClient::ChannelState::RetryableCall<T>::OnRetryTimerLocked(
|
650
|
-
|
700
|
+
grpc_error_handle error) {
|
651
701
|
retry_timer_callback_pending_ = false;
|
652
702
|
if (!shutting_down_ && error == GRPC_ERROR_NONE) {
|
653
703
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
@@ -668,8 +718,9 @@ void XdsClient::ChannelState::RetryableCall<T>::OnRetryTimerLocked(
|
|
668
718
|
XdsClient::ChannelState::AdsCallState::AdsCallState(
|
669
719
|
RefCountedPtr<RetryableCall<AdsCallState>> parent)
|
670
720
|
: InternallyRefCounted<AdsCallState>(
|
671
|
-
GRPC_TRACE_FLAG_ENABLED(
|
672
|
-
|
721
|
+
GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace)
|
722
|
+
? "AdsCallState"
|
723
|
+
: nullptr),
|
673
724
|
parent_(std::move(parent)) {
|
674
725
|
// Init the ADS call. Note that the call will progress every time there's
|
675
726
|
// activity in xds_client()->interested_parties_, which is comprised of
|
@@ -707,23 +758,32 @@ XdsClient::ChannelState::AdsCallState::AdsCallState(
|
|
707
758
|
GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET;
|
708
759
|
op->reserved = nullptr;
|
709
760
|
op++;
|
710
|
-
call_error = grpc_call_start_batch_and_execute(
|
711
|
-
|
761
|
+
call_error = grpc_call_start_batch_and_execute(
|
762
|
+
call_, ops, static_cast<size_t>(op - ops), nullptr);
|
712
763
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
713
764
|
// Op: send request message.
|
714
765
|
GRPC_CLOSURE_INIT(&on_request_sent_, OnRequestSent, this,
|
715
766
|
grpc_schedule_on_exec_ctx);
|
716
|
-
for (const auto&
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
767
|
+
for (const auto& a : xds_client()->authority_state_map_) {
|
768
|
+
const std::string& authority = a.first;
|
769
|
+
// Skip authorities that are not using this xDS channel.
|
770
|
+
if (a.second.channel_state != chand()) continue;
|
771
|
+
for (const auto& l : a.second.listener_map) {
|
772
|
+
const std::string& listener_name = l.first;
|
773
|
+
SubscribeLocked(XdsApi::kLdsTypeUrl, {authority, listener_name});
|
774
|
+
}
|
775
|
+
for (const auto& r : a.second.route_config_map) {
|
776
|
+
const std::string& route_config_name = r.first;
|
777
|
+
SubscribeLocked(XdsApi::kRdsTypeUrl, {authority, route_config_name});
|
778
|
+
}
|
779
|
+
for (const auto& c : a.second.cluster_map) {
|
780
|
+
const std::string& cluster_name = c.first;
|
781
|
+
SubscribeLocked(XdsApi::kCdsTypeUrl, {authority, cluster_name});
|
782
|
+
}
|
783
|
+
for (const auto& e : a.second.endpoint_map) {
|
784
|
+
const std::string& endpoint_name = e.first;
|
785
|
+
SubscribeLocked(XdsApi::kEdsTypeUrl, {authority, endpoint_name});
|
786
|
+
}
|
727
787
|
}
|
728
788
|
// Op: recv initial metadata.
|
729
789
|
op = ops;
|
@@ -742,8 +802,8 @@ XdsClient::ChannelState::AdsCallState::AdsCallState(
|
|
742
802
|
Ref(DEBUG_LOCATION, "ADS+OnResponseReceivedLocked").release();
|
743
803
|
GRPC_CLOSURE_INIT(&on_response_received_, OnResponseReceived, this,
|
744
804
|
grpc_schedule_on_exec_ctx);
|
745
|
-
call_error = grpc_call_start_batch_and_execute(
|
746
|
-
|
805
|
+
call_error = grpc_call_start_batch_and_execute(
|
806
|
+
call_, ops, static_cast<size_t>(op - ops), &on_response_received_);
|
747
807
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
748
808
|
// Op: recv server status.
|
749
809
|
op = ops;
|
@@ -759,8 +819,8 @@ XdsClient::ChannelState::AdsCallState::AdsCallState(
|
|
759
819
|
// unreffed.
|
760
820
|
GRPC_CLOSURE_INIT(&on_status_received_, OnStatusReceived, this,
|
761
821
|
grpc_schedule_on_exec_ctx);
|
762
|
-
call_error = grpc_call_start_batch_and_execute(
|
763
|
-
|
822
|
+
call_error = grpc_call_start_batch_and_execute(
|
823
|
+
call_, ops, static_cast<size_t>(op - ops), &on_status_received_);
|
764
824
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
765
825
|
}
|
766
826
|
|
@@ -787,7 +847,8 @@ void XdsClient::ChannelState::AdsCallState::Orphan() {
|
|
787
847
|
}
|
788
848
|
|
789
849
|
void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
|
790
|
-
const std::string& type_url)
|
850
|
+
const std::string& type_url)
|
851
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_) {
|
791
852
|
// Buffer message sending if an existing message is in flight.
|
792
853
|
if (send_message_payload_ != nullptr) {
|
793
854
|
buffered_requests_.insert(type_url);
|
@@ -795,11 +856,12 @@ void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
|
|
795
856
|
}
|
796
857
|
auto& state = state_map_[type_url];
|
797
858
|
grpc_slice request_payload_slice;
|
798
|
-
std::
|
799
|
-
|
859
|
+
std::map<absl::string_view /*authority*/,
|
860
|
+
std::set<absl::string_view /*name*/>>
|
861
|
+
resource_map = ResourceNamesForRequest(type_url);
|
800
862
|
request_payload_slice = xds_client()->api_.CreateAdsRequest(
|
801
|
-
chand()->server_, type_url,
|
802
|
-
|
863
|
+
chand()->server_, type_url, resource_map,
|
864
|
+
chand()->resource_type_version_map_[type_url], state.nonce,
|
803
865
|
GRPC_ERROR_REF(state.error), !sent_initial_message_);
|
804
866
|
if (type_url != XdsApi::kLdsTypeUrl && type_url != XdsApi::kRdsTypeUrl &&
|
805
867
|
type_url != XdsApi::kCdsTypeUrl && type_url != XdsApi::kEdsTypeUrl) {
|
@@ -809,11 +871,10 @@ void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
|
|
809
871
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
810
872
|
gpr_log(GPR_INFO,
|
811
873
|
"[xds_client %p] sending ADS request: type=%s version=%s nonce=%s "
|
812
|
-
"error=%s
|
874
|
+
"error=%s",
|
813
875
|
xds_client(), type_url.c_str(),
|
814
|
-
|
815
|
-
state.nonce.c_str(),
|
816
|
-
absl::StrJoin(resource_names, " ").c_str());
|
876
|
+
chand()->resource_type_version_map_[type_url].c_str(),
|
877
|
+
state.nonce.c_str(), grpc_error_std_string(state.error).c_str());
|
817
878
|
}
|
818
879
|
GRPC_ERROR_UNREF(state.error);
|
819
880
|
state.error = GRPC_ERROR_NONE;
|
@@ -839,20 +900,27 @@ void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
|
|
839
900
|
}
|
840
901
|
}
|
841
902
|
|
842
|
-
void XdsClient::ChannelState::AdsCallState::
|
843
|
-
const std::string& type_url, const
|
844
|
-
auto& state = state_map_[type_url]
|
903
|
+
void XdsClient::ChannelState::AdsCallState::SubscribeLocked(
|
904
|
+
const std::string& type_url, const XdsApi::ResourceName& resource) {
|
905
|
+
auto& state = state_map_[type_url]
|
906
|
+
.subscribed_resources[resource.authority][resource.id];
|
845
907
|
if (state == nullptr) {
|
846
908
|
state = MakeOrphanable<ResourceState>(
|
847
|
-
type_url,
|
909
|
+
type_url, resource,
|
910
|
+
!chand()->resource_type_version_map_[type_url].empty());
|
848
911
|
SendMessageLocked(type_url);
|
849
912
|
}
|
850
913
|
}
|
851
914
|
|
852
|
-
void XdsClient::ChannelState::AdsCallState::
|
853
|
-
const std::string& type_url, const
|
915
|
+
void XdsClient::ChannelState::AdsCallState::UnsubscribeLocked(
|
916
|
+
const std::string& type_url, const XdsApi::ResourceName& resource,
|
854
917
|
bool delay_unsubscription) {
|
855
|
-
state_map_[type_url]
|
918
|
+
auto& type_state_map = state_map_[type_url];
|
919
|
+
auto& authority_map = type_state_map.subscribed_resources[resource.authority];
|
920
|
+
authority_map.erase(resource.id);
|
921
|
+
if (authority_map.empty()) {
|
922
|
+
type_state_map.subscribed_resources.erase(resource.authority);
|
923
|
+
}
|
856
924
|
if (!delay_unsubscription) SendMessageLocked(type_url);
|
857
925
|
}
|
858
926
|
|
@@ -863,8 +931,26 @@ bool XdsClient::ChannelState::AdsCallState::HasSubscribedResources() const {
|
|
863
931
|
return false;
|
864
932
|
}
|
865
933
|
|
866
|
-
|
867
|
-
|
934
|
+
namespace {
|
935
|
+
|
936
|
+
// Build a resource metadata struct for ADS result accepting methods and CSDS.
|
937
|
+
XdsApi::ResourceMetadata CreateResourceMetadataAcked(
|
938
|
+
std::string serialized_proto, std::string version,
|
939
|
+
grpc_millis update_time) {
|
940
|
+
XdsApi::ResourceMetadata resource_metadata;
|
941
|
+
resource_metadata.serialized_proto = std::move(serialized_proto);
|
942
|
+
resource_metadata.update_time = update_time;
|
943
|
+
resource_metadata.version = std::move(version);
|
944
|
+
resource_metadata.client_status = XdsApi::ResourceMetadata::ACKED;
|
945
|
+
return resource_metadata;
|
946
|
+
}
|
947
|
+
|
948
|
+
} // namespace
|
949
|
+
|
950
|
+
void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdateLocked(
|
951
|
+
std::string version, grpc_millis update_time,
|
952
|
+
XdsApi::LdsUpdateMap lds_update_map,
|
953
|
+
const std::set<XdsApi::ResourceName>& resource_names_failed) {
|
868
954
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
869
955
|
gpr_log(GPR_INFO,
|
870
956
|
"[xds_client %p] LDS update received containing %" PRIuPTR
|
@@ -874,61 +960,90 @@ void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdate(
|
|
874
960
|
auto& lds_state = state_map_[XdsApi::kLdsTypeUrl];
|
875
961
|
std::set<std::string> rds_resource_names_seen;
|
876
962
|
for (auto& p : lds_update_map) {
|
877
|
-
const
|
878
|
-
XdsApi::LdsUpdate& lds_update = p.second;
|
879
|
-
auto& state =
|
963
|
+
const XdsApi::ResourceName& resource = p.first;
|
964
|
+
XdsApi::LdsUpdate& lds_update = p.second.resource;
|
965
|
+
auto& state =
|
966
|
+
lds_state.subscribed_resources[resource.authority][resource.id];
|
880
967
|
if (state != nullptr) state->Finish();
|
881
968
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
882
|
-
gpr_log(GPR_INFO, "[xds_client %p] LDS resource %s:
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
if (lds_update.rds_update.has_value()) {
|
888
|
-
gpr_log(GPR_INFO, "RouteConfiguration: %s",
|
889
|
-
lds_update.rds_update->ToString().c_str());
|
890
|
-
}
|
969
|
+
gpr_log(GPR_INFO, "[xds_client %p] LDS resource %s: %s", xds_client(),
|
970
|
+
XdsApi::ConstructFullResourceName(
|
971
|
+
resource.authority, XdsApi::kLdsTypeUrl, resource.id)
|
972
|
+
.c_str(),
|
973
|
+
lds_update.ToString().c_str());
|
891
974
|
}
|
892
975
|
// Record the RDS resource names seen.
|
893
|
-
if (!lds_update.route_config_name.empty()) {
|
894
|
-
rds_resource_names_seen.insert(
|
976
|
+
if (!lds_update.http_connection_manager.route_config_name.empty()) {
|
977
|
+
rds_resource_names_seen.insert(
|
978
|
+
lds_update.http_connection_manager.route_config_name);
|
895
979
|
}
|
980
|
+
ListenerState& listener_state =
|
981
|
+
xds_client()
|
982
|
+
->authority_state_map_[resource.authority]
|
983
|
+
.listener_map[resource.id];
|
896
984
|
// Ignore identical update.
|
897
|
-
ListenerState& listener_state = xds_client()->listener_map_[listener_name];
|
898
985
|
if (listener_state.update.has_value() &&
|
899
986
|
*listener_state.update == lds_update) {
|
900
987
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
901
988
|
gpr_log(GPR_INFO,
|
902
989
|
"[xds_client %p] LDS update for %s identical to current, "
|
903
990
|
"ignoring.",
|
904
|
-
xds_client(),
|
991
|
+
xds_client(),
|
992
|
+
XdsApi::ConstructFullResourceName(
|
993
|
+
resource.authority, XdsApi::kLdsTypeUrl, resource.id)
|
994
|
+
.c_str());
|
905
995
|
}
|
906
996
|
continue;
|
907
997
|
}
|
908
998
|
// Update the listener state.
|
909
999
|
listener_state.update = std::move(lds_update);
|
1000
|
+
listener_state.meta = CreateResourceMetadataAcked(
|
1001
|
+
std::move(p.second.serialized_proto), version, update_time);
|
910
1002
|
// Notify watchers.
|
911
1003
|
for (const auto& p : listener_state.watchers) {
|
912
1004
|
p.first->OnListenerChanged(*listener_state.update);
|
913
1005
|
}
|
914
1006
|
}
|
1007
|
+
// For invalid resources in the update, if they are already in the
|
1008
|
+
// cache, pretend that they are present in the update, so that we
|
1009
|
+
// don't incorrectly consider them deleted below.
|
1010
|
+
for (const auto& resource : resource_names_failed) {
|
1011
|
+
auto& listener_map =
|
1012
|
+
xds_client()->authority_state_map_[resource.authority].listener_map;
|
1013
|
+
auto it = listener_map.find(resource.id);
|
1014
|
+
if (it != listener_map.end()) {
|
1015
|
+
auto& update = it->second.update;
|
1016
|
+
if (!update.has_value()) continue;
|
1017
|
+
lds_update_map[resource];
|
1018
|
+
if (!update->http_connection_manager.route_config_name.empty()) {
|
1019
|
+
rds_resource_names_seen.insert(
|
1020
|
+
update->http_connection_manager.route_config_name);
|
1021
|
+
}
|
1022
|
+
}
|
1023
|
+
}
|
915
1024
|
// For any subscribed resource that is not present in the update,
|
916
1025
|
// remove it from the cache and notify watchers that it does not exist.
|
917
|
-
for (const auto&
|
918
|
-
const std::string&
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
1026
|
+
for (const auto& a : lds_state.subscribed_resources) {
|
1027
|
+
const std::string& authority_name = a.first;
|
1028
|
+
for (const auto& p : a.second) {
|
1029
|
+
const std::string& listener_name = p.first;
|
1030
|
+
if (lds_update_map.find({authority_name, listener_name}) ==
|
1031
|
+
lds_update_map.end()) {
|
1032
|
+
ListenerState& listener_state =
|
1033
|
+
xds_client()
|
1034
|
+
->authority_state_map_[authority_name]
|
1035
|
+
.listener_map[listener_name];
|
1036
|
+
// If the resource was newly requested but has not yet been received,
|
1037
|
+
// we don't want to generate an error for the watchers, because this LDS
|
1038
|
+
// response may be in reaction to an earlier request that did not yet
|
1039
|
+
// request the new resource, so its absence from the response does not
|
1040
|
+
// necessarily indicate that the resource does not exist.
|
1041
|
+
// For that case, we rely on the request timeout instead.
|
1042
|
+
if (!listener_state.update.has_value()) continue;
|
1043
|
+
listener_state.update.reset();
|
1044
|
+
for (const auto& p : listener_state.watchers) {
|
1045
|
+
p.first->OnResourceDoesNotExist();
|
1046
|
+
}
|
932
1047
|
}
|
933
1048
|
}
|
934
1049
|
}
|
@@ -936,21 +1051,28 @@ void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdate(
|
|
936
1051
|
// resources, remove it from the cache and notify watchers that it
|
937
1052
|
// does not exist.
|
938
1053
|
auto& rds_state = state_map_[XdsApi::kRdsTypeUrl];
|
939
|
-
for (const auto&
|
940
|
-
const std::string&
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
1054
|
+
for (const auto& a : rds_state.subscribed_resources) {
|
1055
|
+
const std::string& authority_name = a.first;
|
1056
|
+
for (const auto& p : a.second) {
|
1057
|
+
const std::string& listener_name = p.first;
|
1058
|
+
if (rds_resource_names_seen.find(XdsApi::ConstructFullResourceName(
|
1059
|
+
authority_name, XdsApi::kRdsTypeUrl, listener_name)) ==
|
1060
|
+
rds_resource_names_seen.end()) {
|
1061
|
+
RouteConfigState& route_config_state =
|
1062
|
+
xds_client()
|
1063
|
+
->authority_state_map_[authority_name]
|
1064
|
+
.route_config_map[listener_name];
|
1065
|
+
route_config_state.update.reset();
|
1066
|
+
for (const auto& p : route_config_state.watchers) {
|
1067
|
+
p.first->OnResourceDoesNotExist();
|
1068
|
+
}
|
948
1069
|
}
|
949
1070
|
}
|
950
1071
|
}
|
951
1072
|
}
|
952
1073
|
|
953
|
-
void XdsClient::ChannelState::AdsCallState::
|
1074
|
+
void XdsClient::ChannelState::AdsCallState::AcceptRdsUpdateLocked(
|
1075
|
+
std::string version, grpc_millis update_time,
|
954
1076
|
XdsApi::RdsUpdateMap rds_update_map) {
|
955
1077
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
956
1078
|
gpr_log(GPR_INFO,
|
@@ -960,16 +1082,19 @@ void XdsClient::ChannelState::AdsCallState::AcceptRdsUpdate(
|
|
960
1082
|
}
|
961
1083
|
auto& rds_state = state_map_[XdsApi::kRdsTypeUrl];
|
962
1084
|
for (auto& p : rds_update_map) {
|
963
|
-
const
|
964
|
-
XdsApi::RdsUpdate& rds_update = p.second;
|
965
|
-
auto& state =
|
1085
|
+
const XdsApi::ResourceName& resource = p.first;
|
1086
|
+
XdsApi::RdsUpdate& rds_update = p.second.resource;
|
1087
|
+
auto& state =
|
1088
|
+
rds_state.subscribed_resources[resource.authority][resource.id];
|
966
1089
|
if (state != nullptr) state->Finish();
|
967
1090
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
968
1091
|
gpr_log(GPR_INFO, "[xds_client %p] RDS resource:\n%s", xds_client(),
|
969
1092
|
rds_update.ToString().c_str());
|
970
1093
|
}
|
971
1094
|
RouteConfigState& route_config_state =
|
972
|
-
xds_client()
|
1095
|
+
xds_client()
|
1096
|
+
->authority_state_map_[resource.authority]
|
1097
|
+
.route_config_map[resource.id];
|
973
1098
|
// Ignore identical update.
|
974
1099
|
if (route_config_state.update.has_value() &&
|
975
1100
|
*route_config_state.update == rds_update) {
|
@@ -982,6 +1107,8 @@ void XdsClient::ChannelState::AdsCallState::AcceptRdsUpdate(
|
|
982
1107
|
}
|
983
1108
|
// Update the cache.
|
984
1109
|
route_config_state.update = std::move(rds_update);
|
1110
|
+
route_config_state.meta = CreateResourceMetadataAcked(
|
1111
|
+
std::move(p.second.serialized_proto), version, update_time);
|
985
1112
|
// Notify all watchers.
|
986
1113
|
for (const auto& p : route_config_state.watchers) {
|
987
1114
|
p.first->OnRouteConfigChanged(*route_config_state.update);
|
@@ -989,8 +1116,10 @@ void XdsClient::ChannelState::AdsCallState::AcceptRdsUpdate(
|
|
989
1116
|
}
|
990
1117
|
}
|
991
1118
|
|
992
|
-
void XdsClient::ChannelState::AdsCallState::
|
993
|
-
|
1119
|
+
void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdateLocked(
|
1120
|
+
std::string version, grpc_millis update_time,
|
1121
|
+
XdsApi::CdsUpdateMap cds_update_map,
|
1122
|
+
const std::set<XdsApi::ResourceName>& resource_names_failed) {
|
994
1123
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
995
1124
|
gpr_log(GPR_INFO,
|
996
1125
|
"[xds_client %p] CDS update received containing %" PRIuPTR
|
@@ -1000,25 +1129,28 @@ void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdate(
|
|
1000
1129
|
auto& cds_state = state_map_[XdsApi::kCdsTypeUrl];
|
1001
1130
|
std::set<std::string> eds_resource_names_seen;
|
1002
1131
|
for (auto& p : cds_update_map) {
|
1003
|
-
const
|
1004
|
-
XdsApi::CdsUpdate& cds_update = p.second;
|
1005
|
-
auto& state =
|
1132
|
+
const XdsApi::ResourceName& resource = p.first;
|
1133
|
+
XdsApi::CdsUpdate& cds_update = p.second.resource;
|
1134
|
+
auto& state =
|
1135
|
+
cds_state.subscribed_resources[resource.authority][resource.id];
|
1006
1136
|
if (state != nullptr) state->Finish();
|
1007
1137
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1008
|
-
gpr_log(GPR_INFO,
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
cds_update.
|
1013
|
-
? cds_update.lrs_load_reporting_server_name.value().c_str()
|
1014
|
-
: "(N/A)");
|
1138
|
+
gpr_log(GPR_INFO, "[xds_client %p] cluster=%s: %s", xds_client(),
|
1139
|
+
XdsApi::ConstructFullResourceName(
|
1140
|
+
resource.authority, XdsApi::kCdsTypeUrl, resource.id)
|
1141
|
+
.c_str(),
|
1142
|
+
cds_update.ToString().c_str());
|
1015
1143
|
}
|
1016
1144
|
// Record the EDS resource names seen.
|
1017
|
-
eds_resource_names_seen.insert(
|
1018
|
-
|
1019
|
-
|
1145
|
+
eds_resource_names_seen.insert(
|
1146
|
+
cds_update.eds_service_name.empty()
|
1147
|
+
? XdsApi::ConstructFullResourceName(
|
1148
|
+
resource.authority, XdsApi::kCdsTypeUrl, resource.id)
|
1149
|
+
: cds_update.eds_service_name);
|
1150
|
+
ClusterState& cluster_state = xds_client()
|
1151
|
+
->authority_state_map_[resource.authority]
|
1152
|
+
.cluster_map[resource.id];
|
1020
1153
|
// Ignore identical update.
|
1021
|
-
ClusterState& cluster_state = xds_client()->cluster_map_[cluster_name];
|
1022
1154
|
if (cluster_state.update.has_value() &&
|
1023
1155
|
*cluster_state.update == cds_update) {
|
1024
1156
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
@@ -1030,27 +1162,53 @@ void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdate(
|
|
1030
1162
|
}
|
1031
1163
|
// Update the cluster state.
|
1032
1164
|
cluster_state.update = std::move(cds_update);
|
1165
|
+
cluster_state.meta = CreateResourceMetadataAcked(
|
1166
|
+
std::move(p.second.serialized_proto), version, update_time);
|
1033
1167
|
// Notify all watchers.
|
1034
1168
|
for (const auto& p : cluster_state.watchers) {
|
1035
1169
|
p.first->OnClusterChanged(cluster_state.update.value());
|
1036
1170
|
}
|
1037
1171
|
}
|
1172
|
+
// For invalid resources in the update, if they are already in the
|
1173
|
+
// cache, pretend that they are present in the update, so that we
|
1174
|
+
// don't incorrectly consider them deleted below.
|
1175
|
+
for (const auto& resource : resource_names_failed) {
|
1176
|
+
auto& cluster_map =
|
1177
|
+
xds_client()->authority_state_map_[resource.authority].cluster_map;
|
1178
|
+
auto it = cluster_map.find(resource.id);
|
1179
|
+
if (it != cluster_map.end()) {
|
1180
|
+
auto& update = it->second.update;
|
1181
|
+
if (!update.has_value()) continue;
|
1182
|
+
cds_update_map[resource];
|
1183
|
+
eds_resource_names_seen.insert(
|
1184
|
+
update->eds_service_name.empty()
|
1185
|
+
? XdsApi::ConstructFullResourceName(
|
1186
|
+
resource.authority, XdsApi::kCdsTypeUrl, resource.id)
|
1187
|
+
: update->eds_service_name);
|
1188
|
+
}
|
1189
|
+
}
|
1038
1190
|
// For any subscribed resource that is not present in the update,
|
1039
1191
|
// remove it from the cache and notify watchers that it does not exist.
|
1040
|
-
for (const auto&
|
1041
|
-
const std::string&
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1192
|
+
for (const auto& a : cds_state.subscribed_resources) {
|
1193
|
+
const std::string& authority = a.first;
|
1194
|
+
for (const auto& p : a.second) {
|
1195
|
+
const std::string& cluster_name = p.first;
|
1196
|
+
if (cds_update_map.find({authority, cluster_name}) ==
|
1197
|
+
cds_update_map.end()) {
|
1198
|
+
ClusterState& cluster_state = xds_client()
|
1199
|
+
->authority_state_map_[authority]
|
1200
|
+
.cluster_map[cluster_name];
|
1201
|
+
// If the resource was newly requested but has not yet been received,
|
1202
|
+
// we don't want to generate an error for the watchers, because this CDS
|
1203
|
+
// response may be in reaction to an earlier request that did not yet
|
1204
|
+
// request the new resource, so its absence from the response does not
|
1205
|
+
// necessarily indicate that the resource does not exist.
|
1206
|
+
// For that case, we rely on the request timeout instead.
|
1207
|
+
if (!cluster_state.update.has_value()) continue;
|
1208
|
+
cluster_state.update.reset();
|
1209
|
+
for (const auto& p : cluster_state.watchers) {
|
1210
|
+
p.first->OnResourceDoesNotExist();
|
1211
|
+
}
|
1054
1212
|
}
|
1055
1213
|
}
|
1056
1214
|
}
|
@@ -1058,21 +1216,27 @@ void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdate(
|
|
1058
1216
|
// resources, remove it from the cache and notify watchers that it
|
1059
1217
|
// does not exist.
|
1060
1218
|
auto& eds_state = state_map_[XdsApi::kEdsTypeUrl];
|
1061
|
-
for (const auto&
|
1062
|
-
const std::string&
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1219
|
+
for (const auto& a : eds_state.subscribed_resources) {
|
1220
|
+
const std::string& authority = a.first;
|
1221
|
+
for (const auto& p : a.second) {
|
1222
|
+
const std::string& eds_resource_name = p.first;
|
1223
|
+
if (eds_resource_names_seen.find(XdsApi::ConstructFullResourceName(
|
1224
|
+
authority, XdsApi::kEdsTypeUrl, eds_resource_name)) ==
|
1225
|
+
eds_resource_names_seen.end()) {
|
1226
|
+
EndpointState& endpoint_state = xds_client()
|
1227
|
+
->authority_state_map_[authority]
|
1228
|
+
.endpoint_map[eds_resource_name];
|
1229
|
+
endpoint_state.update.reset();
|
1230
|
+
for (const auto& p : endpoint_state.watchers) {
|
1231
|
+
p.first->OnResourceDoesNotExist();
|
1232
|
+
}
|
1070
1233
|
}
|
1071
1234
|
}
|
1072
1235
|
}
|
1073
1236
|
}
|
1074
1237
|
|
1075
|
-
void XdsClient::ChannelState::AdsCallState::
|
1238
|
+
void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdateLocked(
|
1239
|
+
std::string version, grpc_millis update_time,
|
1076
1240
|
XdsApi::EdsUpdateMap eds_update_map) {
|
1077
1241
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1078
1242
|
gpr_log(GPR_INFO,
|
@@ -1082,16 +1246,22 @@ void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdate(
|
|
1082
1246
|
}
|
1083
1247
|
auto& eds_state = state_map_[XdsApi::kEdsTypeUrl];
|
1084
1248
|
for (auto& p : eds_update_map) {
|
1085
|
-
const
|
1086
|
-
XdsApi::EdsUpdate& eds_update = p.second;
|
1087
|
-
auto& state =
|
1249
|
+
const XdsApi::ResourceName& resource = p.first;
|
1250
|
+
XdsApi::EdsUpdate& eds_update = p.second.resource;
|
1251
|
+
auto& state =
|
1252
|
+
eds_state.subscribed_resources[resource.authority][resource.id];
|
1088
1253
|
if (state != nullptr) state->Finish();
|
1089
1254
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1090
1255
|
gpr_log(GPR_INFO, "[xds_client %p] EDS resource %s: %s", xds_client(),
|
1091
|
-
|
1256
|
+
XdsApi::ConstructFullResourceName(
|
1257
|
+
resource.authority, XdsApi::kCdsTypeUrl, resource.id)
|
1258
|
+
.c_str(),
|
1259
|
+
eds_update.ToString().c_str());
|
1092
1260
|
}
|
1093
1261
|
EndpointState& endpoint_state =
|
1094
|
-
xds_client()
|
1262
|
+
xds_client()
|
1263
|
+
->authority_state_map_[resource.authority]
|
1264
|
+
.endpoint_map[resource.id];
|
1095
1265
|
// Ignore identical update.
|
1096
1266
|
if (endpoint_state.update.has_value() &&
|
1097
1267
|
*endpoint_state.update == eds_update) {
|
@@ -1104,6 +1274,8 @@ void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdate(
|
|
1104
1274
|
}
|
1105
1275
|
// Update the cluster state.
|
1106
1276
|
endpoint_state.update = std::move(eds_update);
|
1277
|
+
endpoint_state.meta = CreateResourceMetadataAcked(
|
1278
|
+
std::move(p.second.serialized_proto), version, update_time);
|
1107
1279
|
// Notify all watchers.
|
1108
1280
|
for (const auto& p : endpoint_state.watchers) {
|
1109
1281
|
p.first->OnEndpointChanged(endpoint_state.update.value());
|
@@ -1111,8 +1283,71 @@ void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdate(
|
|
1111
1283
|
}
|
1112
1284
|
}
|
1113
1285
|
|
1114
|
-
|
1115
|
-
|
1286
|
+
namespace {
|
1287
|
+
|
1288
|
+
// Update resource_metadata for NACK.
|
1289
|
+
void UpdateResourceMetadataNacked(const std::string& version,
|
1290
|
+
const std::string& details,
|
1291
|
+
grpc_millis update_time,
|
1292
|
+
XdsApi::ResourceMetadata* resource_metadata) {
|
1293
|
+
resource_metadata->client_status = XdsApi::ResourceMetadata::NACKED;
|
1294
|
+
resource_metadata->failed_version = version;
|
1295
|
+
resource_metadata->failed_details = details;
|
1296
|
+
resource_metadata->failed_update_time = update_time;
|
1297
|
+
}
|
1298
|
+
|
1299
|
+
} // namespace
|
1300
|
+
|
1301
|
+
template <typename StateMap>
|
1302
|
+
void XdsClient::ChannelState::AdsCallState::RejectAdsUpdateHelperLocked(
|
1303
|
+
const std::string& resource_name, grpc_millis update_time,
|
1304
|
+
const XdsApi::AdsParseResult& result, const std::string& error_details,
|
1305
|
+
StateMap* state_map) {
|
1306
|
+
auto it = state_map->find(resource_name);
|
1307
|
+
if (it == state_map->end()) return;
|
1308
|
+
auto& state = it->second;
|
1309
|
+
for (const auto& p : state.watchers) {
|
1310
|
+
p.first->OnError(GRPC_ERROR_REF(result.parse_error));
|
1311
|
+
}
|
1312
|
+
UpdateResourceMetadataNacked(result.version, error_details, update_time,
|
1313
|
+
&state.meta);
|
1314
|
+
}
|
1315
|
+
|
1316
|
+
void XdsClient::ChannelState::AdsCallState::RejectAdsUpdateLocked(
|
1317
|
+
grpc_millis update_time, const XdsApi::AdsParseResult& result) {
|
1318
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1319
|
+
gpr_log(GPR_INFO,
|
1320
|
+
"[xds_client %p] %s update NACKed containing %" PRIuPTR
|
1321
|
+
" invalid resources",
|
1322
|
+
xds_client(), result.type_url.c_str(),
|
1323
|
+
result.resource_names_failed.size());
|
1324
|
+
}
|
1325
|
+
std::string details = grpc_error_std_string(result.parse_error);
|
1326
|
+
for (auto& resource : result.resource_names_failed) {
|
1327
|
+
auto authority_it =
|
1328
|
+
xds_client()->authority_state_map_.find(resource.authority);
|
1329
|
+
if (authority_it == xds_client()->authority_state_map_.end()) continue;
|
1330
|
+
AuthorityState& authority_state = authority_it->second;
|
1331
|
+
if (result.type_url == XdsApi::kLdsTypeUrl) {
|
1332
|
+
RejectAdsUpdateHelperLocked(resource.id, update_time, result, details,
|
1333
|
+
&authority_state.listener_map);
|
1334
|
+
} else if (result.type_url == XdsApi::kRdsTypeUrl) {
|
1335
|
+
RejectAdsUpdateHelperLocked(resource.id, update_time, result, details,
|
1336
|
+
&authority_state.route_config_map);
|
1337
|
+
} else if (result.type_url == XdsApi::kCdsTypeUrl) {
|
1338
|
+
RejectAdsUpdateHelperLocked(resource.id, update_time, result, details,
|
1339
|
+
&authority_state.cluster_map);
|
1340
|
+
} else if (result.type_url == XdsApi::kEdsTypeUrl) {
|
1341
|
+
RejectAdsUpdateHelperLocked(resource.id, update_time, result, details,
|
1342
|
+
&authority_state.endpoint_map);
|
1343
|
+
} else {
|
1344
|
+
GPR_ASSERT(0);
|
1345
|
+
}
|
1346
|
+
}
|
1347
|
+
}
|
1348
|
+
|
1349
|
+
void XdsClient::ChannelState::AdsCallState::OnRequestSent(
|
1350
|
+
void* arg, grpc_error_handle error) {
|
1116
1351
|
AdsCallState* ads_calld = static_cast<AdsCallState*>(arg);
|
1117
1352
|
{
|
1118
1353
|
MutexLock lock(&ads_calld->xds_client()->mu_);
|
@@ -1122,7 +1357,7 @@ void XdsClient::ChannelState::AdsCallState::OnRequestSent(void* arg,
|
|
1122
1357
|
}
|
1123
1358
|
|
1124
1359
|
void XdsClient::ChannelState::AdsCallState::OnRequestSentLocked(
|
1125
|
-
|
1360
|
+
grpc_error_handle error) {
|
1126
1361
|
if (IsCurrentCallOnChannel() && error == GRPC_ERROR_NONE) {
|
1127
1362
|
// Clean up the sent message.
|
1128
1363
|
grpc_byte_buffer_destroy(send_message_payload_);
|
@@ -1146,7 +1381,7 @@ void XdsClient::ChannelState::AdsCallState::OnRequestSentLocked(
|
|
1146
1381
|
}
|
1147
1382
|
|
1148
1383
|
void XdsClient::ChannelState::AdsCallState::OnResponseReceived(
|
1149
|
-
void* arg,
|
1384
|
+
void* arg, grpc_error_handle /* error */) {
|
1150
1385
|
AdsCallState* ads_calld = static_cast<AdsCallState*>(arg);
|
1151
1386
|
bool done;
|
1152
1387
|
{
|
@@ -1170,7 +1405,8 @@ bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
|
|
1170
1405
|
recv_message_payload_ = nullptr;
|
1171
1406
|
// Parse and validate the response.
|
1172
1407
|
XdsApi::AdsParseResult result = xds_client()->api_.ParseAdsResponse(
|
1173
|
-
|
1408
|
+
chand()->server_, response_slice,
|
1409
|
+
ResourceNamesForRequest(XdsApi::kLdsTypeUrl),
|
1174
1410
|
ResourceNamesForRequest(XdsApi::kRdsTypeUrl),
|
1175
1411
|
ResourceNamesForRequest(XdsApi::kCdsTypeUrl),
|
1176
1412
|
ResourceNamesForRequest(XdsApi::kEdsTypeUrl));
|
@@ -1179,39 +1415,52 @@ bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
|
|
1179
1415
|
// Ignore unparsable response.
|
1180
1416
|
gpr_log(GPR_ERROR,
|
1181
1417
|
"[xds_client %p] Error parsing ADS response (%s) -- ignoring",
|
1182
|
-
xds_client(),
|
1418
|
+
xds_client(), grpc_error_std_string(result.parse_error).c_str());
|
1183
1419
|
GRPC_ERROR_UNREF(result.parse_error);
|
1184
1420
|
} else {
|
1421
|
+
grpc_millis update_time = grpc_core::ExecCtx::Get()->Now();
|
1185
1422
|
// Update nonce.
|
1186
1423
|
auto& state = state_map_[result.type_url];
|
1187
1424
|
state.nonce = std::move(result.nonce);
|
1188
|
-
//
|
1425
|
+
// If we got an error, we'll NACK the update.
|
1189
1426
|
if (result.parse_error != GRPC_ERROR_NONE) {
|
1190
|
-
GRPC_ERROR_UNREF(state.error);
|
1191
|
-
state.error = result.parse_error;
|
1192
|
-
// NACK unacceptable update.
|
1193
1427
|
gpr_log(GPR_ERROR,
|
1194
1428
|
"[xds_client %p] ADS response invalid for resource type %s "
|
1195
1429
|
"version %s, will NACK: nonce=%s error=%s",
|
1196
1430
|
xds_client(), result.type_url.c_str(), result.version.c_str(),
|
1197
|
-
state.nonce.c_str(),
|
1198
|
-
|
1199
|
-
|
1431
|
+
state.nonce.c_str(),
|
1432
|
+
grpc_error_std_string(result.parse_error).c_str());
|
1433
|
+
result.parse_error =
|
1434
|
+
grpc_error_set_int(result.parse_error, GRPC_ERROR_INT_GRPC_STATUS,
|
1435
|
+
GRPC_STATUS_UNAVAILABLE);
|
1436
|
+
GRPC_ERROR_UNREF(state.error);
|
1437
|
+
state.error = result.parse_error;
|
1438
|
+
RejectAdsUpdateLocked(update_time, result);
|
1439
|
+
}
|
1440
|
+
// Process any valid resources.
|
1441
|
+
bool have_valid_resources = false;
|
1442
|
+
if (result.type_url == XdsApi::kLdsTypeUrl) {
|
1443
|
+
have_valid_resources = !result.lds_update_map.empty();
|
1444
|
+
AcceptLdsUpdateLocked(result.version, update_time,
|
1445
|
+
std::move(result.lds_update_map),
|
1446
|
+
result.resource_names_failed);
|
1447
|
+
} else if (result.type_url == XdsApi::kRdsTypeUrl) {
|
1448
|
+
have_valid_resources = !result.rds_update_map.empty();
|
1449
|
+
AcceptRdsUpdateLocked(result.version, update_time,
|
1450
|
+
std::move(result.rds_update_map));
|
1451
|
+
} else if (result.type_url == XdsApi::kCdsTypeUrl) {
|
1452
|
+
have_valid_resources = !result.cds_update_map.empty();
|
1453
|
+
AcceptCdsUpdateLocked(result.version, update_time,
|
1454
|
+
std::move(result.cds_update_map),
|
1455
|
+
result.resource_names_failed);
|
1456
|
+
} else if (result.type_url == XdsApi::kEdsTypeUrl) {
|
1457
|
+
have_valid_resources = !result.eds_update_map.empty();
|
1458
|
+
AcceptEdsUpdateLocked(result.version, update_time,
|
1459
|
+
std::move(result.eds_update_map));
|
1460
|
+
}
|
1461
|
+
if (have_valid_resources) {
|
1200
1462
|
seen_response_ = true;
|
1201
|
-
|
1202
|
-
if (result.type_url == XdsApi::kLdsTypeUrl) {
|
1203
|
-
AcceptLdsUpdate(std::move(result.lds_update_map));
|
1204
|
-
} else if (result.type_url == XdsApi::kRdsTypeUrl) {
|
1205
|
-
AcceptRdsUpdate(std::move(result.rds_update_map));
|
1206
|
-
} else if (result.type_url == XdsApi::kCdsTypeUrl) {
|
1207
|
-
AcceptCdsUpdate(std::move(result.cds_update_map));
|
1208
|
-
} else if (result.type_url == XdsApi::kEdsTypeUrl) {
|
1209
|
-
AcceptEdsUpdate(std::move(result.eds_update_map));
|
1210
|
-
}
|
1211
|
-
xds_client()->resource_version_map_[result.type_url] =
|
1212
|
-
std::move(result.version);
|
1213
|
-
// ACK the update.
|
1214
|
-
SendMessageLocked(result.type_url);
|
1463
|
+
chand()->resource_type_version_map_[result.type_url] = result.version;
|
1215
1464
|
// Start load reporting if needed.
|
1216
1465
|
auto& lrs_call = chand()->lrs_calld_;
|
1217
1466
|
if (lrs_call != nullptr) {
|
@@ -1219,6 +1468,8 @@ bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
|
|
1219
1468
|
if (lrs_calld != nullptr) lrs_calld->MaybeStartReportingLocked();
|
1220
1469
|
}
|
1221
1470
|
}
|
1471
|
+
// Send ACK or NACK.
|
1472
|
+
SendMessageLocked(result.type_url);
|
1222
1473
|
}
|
1223
1474
|
if (xds_client()->shutting_down_) return true;
|
1224
1475
|
// Keep listening for updates.
|
@@ -1237,7 +1488,7 @@ bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
|
|
1237
1488
|
}
|
1238
1489
|
|
1239
1490
|
void XdsClient::ChannelState::AdsCallState::OnStatusReceived(
|
1240
|
-
void* arg,
|
1491
|
+
void* arg, grpc_error_handle error) {
|
1241
1492
|
AdsCallState* ads_calld = static_cast<AdsCallState*>(arg);
|
1242
1493
|
{
|
1243
1494
|
MutexLock lock(&ads_calld->xds_client()->mu_);
|
@@ -1247,14 +1498,14 @@ void XdsClient::ChannelState::AdsCallState::OnStatusReceived(
|
|
1247
1498
|
}
|
1248
1499
|
|
1249
1500
|
void XdsClient::ChannelState::AdsCallState::OnStatusReceivedLocked(
|
1250
|
-
|
1501
|
+
grpc_error_handle error) {
|
1251
1502
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1252
1503
|
char* status_details = grpc_slice_to_c_string(status_details_);
|
1253
1504
|
gpr_log(GPR_INFO,
|
1254
1505
|
"[xds_client %p] ADS call status received. Status = %d, details "
|
1255
1506
|
"= '%s', (chand: %p, ads_calld: %p, call: %p), error '%s'",
|
1256
1507
|
xds_client(), status_code_, status_details, chand(), this, call_,
|
1257
|
-
|
1508
|
+
grpc_error_std_string(error).c_str());
|
1258
1509
|
gpr_free(status_details);
|
1259
1510
|
}
|
1260
1511
|
// Ignore status from a stale call.
|
@@ -1275,19 +1526,23 @@ bool XdsClient::ChannelState::AdsCallState::IsCurrentCallOnChannel() const {
|
|
1275
1526
|
return this == chand()->ads_calld_->calld();
|
1276
1527
|
}
|
1277
1528
|
|
1278
|
-
std::set<absl::string_view
|
1529
|
+
std::map<absl::string_view /*authority*/, std::set<absl::string_view /*name*/>>
|
1279
1530
|
XdsClient::ChannelState::AdsCallState::ResourceNamesForRequest(
|
1280
1531
|
const std::string& type_url) {
|
1281
|
-
std::
|
1532
|
+
std::map<absl::string_view /*authority*/,
|
1533
|
+
std::set<absl::string_view /*name*/>>
|
1534
|
+
resource_map;
|
1282
1535
|
auto it = state_map_.find(type_url);
|
1283
1536
|
if (it != state_map_.end()) {
|
1284
|
-
for (auto&
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1537
|
+
for (auto& a : it->second.subscribed_resources) {
|
1538
|
+
for (auto& p : a.second) {
|
1539
|
+
resource_map[a.first].insert(p.first);
|
1540
|
+
OrphanablePtr<ResourceState>& state = p.second;
|
1541
|
+
state->Start(Ref(DEBUG_LOCATION, "ResourceState"));
|
1542
|
+
}
|
1288
1543
|
}
|
1289
1544
|
}
|
1290
|
-
return
|
1545
|
+
return resource_map;
|
1291
1546
|
}
|
1292
1547
|
|
1293
1548
|
//
|
@@ -1309,7 +1564,7 @@ void XdsClient::ChannelState::LrsCallState::Reporter::
|
|
1309
1564
|
}
|
1310
1565
|
|
1311
1566
|
void XdsClient::ChannelState::LrsCallState::Reporter::OnNextReportTimer(
|
1312
|
-
void* arg,
|
1567
|
+
void* arg, grpc_error_handle error) {
|
1313
1568
|
Reporter* self = static_cast<Reporter*>(arg);
|
1314
1569
|
bool done;
|
1315
1570
|
{
|
@@ -1320,7 +1575,7 @@ void XdsClient::ChannelState::LrsCallState::Reporter::OnNextReportTimer(
|
|
1320
1575
|
}
|
1321
1576
|
|
1322
1577
|
bool XdsClient::ChannelState::LrsCallState::Reporter::OnNextReportTimerLocked(
|
1323
|
-
|
1578
|
+
grpc_error_handle error) {
|
1324
1579
|
next_report_timer_callback_pending_ = false;
|
1325
1580
|
if (error != GRPC_ERROR_NONE || !IsCurrentReporterOnCall()) {
|
1326
1581
|
GRPC_ERROR_UNREF(error);
|
@@ -1385,7 +1640,7 @@ bool XdsClient::ChannelState::LrsCallState::Reporter::SendReportLocked() {
|
|
1385
1640
|
}
|
1386
1641
|
|
1387
1642
|
void XdsClient::ChannelState::LrsCallState::Reporter::OnReportDone(
|
1388
|
-
void* arg,
|
1643
|
+
void* arg, grpc_error_handle error) {
|
1389
1644
|
Reporter* self = static_cast<Reporter*>(arg);
|
1390
1645
|
bool done;
|
1391
1646
|
{
|
@@ -1396,7 +1651,7 @@ void XdsClient::ChannelState::LrsCallState::Reporter::OnReportDone(
|
|
1396
1651
|
}
|
1397
1652
|
|
1398
1653
|
bool XdsClient::ChannelState::LrsCallState::Reporter::OnReportDoneLocked(
|
1399
|
-
|
1654
|
+
grpc_error_handle error) {
|
1400
1655
|
grpc_byte_buffer_destroy(parent_->send_message_payload_);
|
1401
1656
|
parent_->send_message_payload_ = nullptr;
|
1402
1657
|
// If there are no more registered stats to report, cancel the call.
|
@@ -1425,8 +1680,9 @@ bool XdsClient::ChannelState::LrsCallState::Reporter::OnReportDoneLocked(
|
|
1425
1680
|
XdsClient::ChannelState::LrsCallState::LrsCallState(
|
1426
1681
|
RefCountedPtr<RetryableCall<LrsCallState>> parent)
|
1427
1682
|
: InternallyRefCounted<LrsCallState>(
|
1428
|
-
GRPC_TRACE_FLAG_ENABLED(
|
1429
|
-
|
1683
|
+
GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace)
|
1684
|
+
? "LrsCallState"
|
1685
|
+
: nullptr),
|
1430
1686
|
parent_(std::move(parent)) {
|
1431
1687
|
// Init the LRS call. Note that the call will progress every time there's
|
1432
1688
|
// activity in xds_client()->interested_parties_, which is comprised of
|
@@ -1479,8 +1735,8 @@ XdsClient::ChannelState::LrsCallState::LrsCallState(
|
|
1479
1735
|
Ref(DEBUG_LOCATION, "LRS+OnInitialRequestSentLocked").release();
|
1480
1736
|
GRPC_CLOSURE_INIT(&on_initial_request_sent_, OnInitialRequestSent, this,
|
1481
1737
|
grpc_schedule_on_exec_ctx);
|
1482
|
-
call_error = grpc_call_start_batch_and_execute(
|
1483
|
-
|
1738
|
+
call_error = grpc_call_start_batch_and_execute(
|
1739
|
+
call_, ops, static_cast<size_t>(op - ops), &on_initial_request_sent_);
|
1484
1740
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
1485
1741
|
// Op: recv initial metadata.
|
1486
1742
|
op = ops;
|
@@ -1499,8 +1755,8 @@ XdsClient::ChannelState::LrsCallState::LrsCallState(
|
|
1499
1755
|
Ref(DEBUG_LOCATION, "LRS+OnResponseReceivedLocked").release();
|
1500
1756
|
GRPC_CLOSURE_INIT(&on_response_received_, OnResponseReceived, this,
|
1501
1757
|
grpc_schedule_on_exec_ctx);
|
1502
|
-
call_error = grpc_call_start_batch_and_execute(
|
1503
|
-
|
1758
|
+
call_error = grpc_call_start_batch_and_execute(
|
1759
|
+
call_, ops, static_cast<size_t>(op - ops), &on_response_received_);
|
1504
1760
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
1505
1761
|
// Op: recv server status.
|
1506
1762
|
op = ops;
|
@@ -1516,8 +1772,8 @@ XdsClient::ChannelState::LrsCallState::LrsCallState(
|
|
1516
1772
|
// unreffed.
|
1517
1773
|
GRPC_CLOSURE_INIT(&on_status_received_, OnStatusReceived, this,
|
1518
1774
|
grpc_schedule_on_exec_ctx);
|
1519
|
-
call_error = grpc_call_start_batch_and_execute(
|
1520
|
-
|
1775
|
+
call_error = grpc_call_start_batch_and_execute(
|
1776
|
+
call_, ops, static_cast<size_t>(op - ops), &on_status_received_);
|
1521
1777
|
GPR_ASSERT(GRPC_CALL_OK == call_error);
|
1522
1778
|
}
|
1523
1779
|
|
@@ -1565,7 +1821,7 @@ void XdsClient::ChannelState::LrsCallState::MaybeStartReportingLocked() {
|
|
1565
1821
|
}
|
1566
1822
|
|
1567
1823
|
void XdsClient::ChannelState::LrsCallState::OnInitialRequestSent(
|
1568
|
-
void* arg,
|
1824
|
+
void* arg, grpc_error_handle /*error*/) {
|
1569
1825
|
LrsCallState* lrs_calld = static_cast<LrsCallState*>(arg);
|
1570
1826
|
{
|
1571
1827
|
MutexLock lock(&lrs_calld->xds_client()->mu_);
|
@@ -1582,7 +1838,7 @@ void XdsClient::ChannelState::LrsCallState::OnInitialRequestSentLocked() {
|
|
1582
1838
|
}
|
1583
1839
|
|
1584
1840
|
void XdsClient::ChannelState::LrsCallState::OnResponseReceived(
|
1585
|
-
void* arg,
|
1841
|
+
void* arg, grpc_error_handle /*error*/) {
|
1586
1842
|
LrsCallState* lrs_calld = static_cast<LrsCallState*>(arg);
|
1587
1843
|
bool done;
|
1588
1844
|
{
|
@@ -1610,13 +1866,13 @@ bool XdsClient::ChannelState::LrsCallState::OnResponseReceivedLocked() {
|
|
1610
1866
|
bool send_all_clusters = false;
|
1611
1867
|
std::set<std::string> new_cluster_names;
|
1612
1868
|
grpc_millis new_load_reporting_interval;
|
1613
|
-
|
1869
|
+
grpc_error_handle parse_error = xds_client()->api_.ParseLrsResponse(
|
1614
1870
|
response_slice, &send_all_clusters, &new_cluster_names,
|
1615
1871
|
&new_load_reporting_interval);
|
1616
1872
|
if (parse_error != GRPC_ERROR_NONE) {
|
1617
1873
|
gpr_log(GPR_ERROR,
|
1618
1874
|
"[xds_client %p] LRS response parsing failed. error=%s",
|
1619
|
-
xds_client(),
|
1875
|
+
xds_client(), grpc_error_std_string(parse_error).c_str());
|
1620
1876
|
GRPC_ERROR_UNREF(parse_error);
|
1621
1877
|
return;
|
1622
1878
|
}
|
@@ -1685,7 +1941,7 @@ bool XdsClient::ChannelState::LrsCallState::OnResponseReceivedLocked() {
|
|
1685
1941
|
}
|
1686
1942
|
|
1687
1943
|
void XdsClient::ChannelState::LrsCallState::OnStatusReceived(
|
1688
|
-
void* arg,
|
1944
|
+
void* arg, grpc_error_handle error) {
|
1689
1945
|
LrsCallState* lrs_calld = static_cast<LrsCallState*>(arg);
|
1690
1946
|
{
|
1691
1947
|
MutexLock lock(&lrs_calld->xds_client()->mu_);
|
@@ -1695,7 +1951,7 @@ void XdsClient::ChannelState::LrsCallState::OnStatusReceived(
|
|
1695
1951
|
}
|
1696
1952
|
|
1697
1953
|
void XdsClient::ChannelState::LrsCallState::OnStatusReceivedLocked(
|
1698
|
-
|
1954
|
+
grpc_error_handle error) {
|
1699
1955
|
GPR_ASSERT(call_ != nullptr);
|
1700
1956
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1701
1957
|
char* status_details = grpc_slice_to_c_string(status_details_);
|
@@ -1703,7 +1959,7 @@ void XdsClient::ChannelState::LrsCallState::OnStatusReceivedLocked(
|
|
1703
1959
|
"[xds_client %p] LRS call status received. Status = %d, details "
|
1704
1960
|
"= '%s', (chand: %p, calld: %p, call: %p), error '%s'",
|
1705
1961
|
xds_client(), status_code_, status_details, chand(), this, call_,
|
1706
|
-
|
1962
|
+
grpc_error_std_string(error).c_str());
|
1707
1963
|
gpr_free(status_details);
|
1708
1964
|
}
|
1709
1965
|
// Ignore status from a stale call.
|
@@ -1728,60 +1984,54 @@ bool XdsClient::ChannelState::LrsCallState::IsCurrentCallOnChannel() const {
|
|
1728
1984
|
|
1729
1985
|
namespace {
|
1730
1986
|
|
1731
|
-
grpc_millis GetRequestTimeout() {
|
1987
|
+
grpc_millis GetRequestTimeout(const grpc_channel_args* args) {
|
1732
1988
|
return grpc_channel_args_find_integer(
|
1733
|
-
|
1989
|
+
args, GRPC_ARG_XDS_RESOURCE_DOES_NOT_EXIST_TIMEOUT_MS,
|
1734
1990
|
{15000, 0, INT_MAX});
|
1735
1991
|
}
|
1736
1992
|
|
1993
|
+
grpc_channel_args* ModifyChannelArgs(const grpc_channel_args* args) {
|
1994
|
+
absl::InlinedVector<grpc_arg, 1> args_to_add = {
|
1995
|
+
grpc_channel_arg_integer_create(
|
1996
|
+
const_cast<char*>(GRPC_ARG_KEEPALIVE_TIME_MS),
|
1997
|
+
5 * 60 * GPR_MS_PER_SEC),
|
1998
|
+
};
|
1999
|
+
return grpc_channel_args_copy_and_add(args, args_to_add.data(),
|
2000
|
+
args_to_add.size());
|
2001
|
+
}
|
2002
|
+
|
1737
2003
|
} // namespace
|
1738
2004
|
|
1739
|
-
XdsClient::XdsClient(
|
1740
|
-
|
1741
|
-
|
1742
|
-
|
1743
|
-
|
2005
|
+
XdsClient::XdsClient(std::unique_ptr<XdsBootstrap> bootstrap,
|
2006
|
+
const grpc_channel_args* args)
|
2007
|
+
: DualRefCounted<XdsClient>(
|
2008
|
+
GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace) ? "XdsClient"
|
2009
|
+
: nullptr),
|
2010
|
+
bootstrap_(std::move(bootstrap)),
|
2011
|
+
args_(ModifyChannelArgs(args)),
|
2012
|
+
request_timeout_(GetRequestTimeout(args)),
|
1744
2013
|
interested_parties_(grpc_pollset_set_create()),
|
1745
|
-
|
1746
|
-
|
1747
|
-
api_(this, &grpc_xds_client_trace,
|
1748
|
-
bootstrap_
|
2014
|
+
certificate_provider_store_(MakeOrphanable<CertificateProviderStore>(
|
2015
|
+
bootstrap_->certificate_providers())),
|
2016
|
+
api_(this, &grpc_xds_client_trace, bootstrap_->node(),
|
2017
|
+
&bootstrap_->certificate_providers()) {
|
1749
2018
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1750
2019
|
gpr_log(GPR_INFO, "[xds_client %p] creating xds client", this);
|
1751
2020
|
}
|
1752
|
-
|
1753
|
-
|
1754
|
-
|
1755
|
-
return;
|
1756
|
-
}
|
1757
|
-
// Create ChannelState object.
|
1758
|
-
chand_ = MakeOrphanable<ChannelState>(
|
1759
|
-
WeakRef(DEBUG_LOCATION, "XdsClient+ChannelState"), bootstrap_->server());
|
2021
|
+
// Calling grpc_init to ensure gRPC does not shut down until the XdsClient is
|
2022
|
+
// destroyed.
|
2023
|
+
grpc_init();
|
1760
2024
|
}
|
1761
2025
|
|
1762
2026
|
XdsClient::~XdsClient() {
|
1763
2027
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
1764
2028
|
gpr_log(GPR_INFO, "[xds_client %p] destroying xds client", this);
|
1765
2029
|
}
|
2030
|
+
grpc_channel_args_destroy(args_);
|
1766
2031
|
grpc_pollset_set_destroy(interested_parties_);
|
1767
|
-
|
1768
|
-
|
1769
|
-
|
1770
|
-
channelz::ChannelNode* parent_channelz_node) {
|
1771
|
-
channelz::ChannelNode* xds_channelz_node =
|
1772
|
-
grpc_channel_get_channelz_node(chand_->channel());
|
1773
|
-
if (xds_channelz_node != nullptr) {
|
1774
|
-
parent_channelz_node->AddChildChannel(xds_channelz_node->uuid());
|
1775
|
-
}
|
1776
|
-
}
|
1777
|
-
|
1778
|
-
void XdsClient::RemoveChannelzLinkage(
|
1779
|
-
channelz::ChannelNode* parent_channelz_node) {
|
1780
|
-
channelz::ChannelNode* xds_channelz_node =
|
1781
|
-
grpc_channel_get_channelz_node(chand_->channel());
|
1782
|
-
if (xds_channelz_node != nullptr) {
|
1783
|
-
parent_channelz_node->RemoveChildChannel(xds_channelz_node->uuid());
|
1784
|
-
}
|
2032
|
+
// Calling grpc_shutdown to ensure gRPC does not shut down until the XdsClient
|
2033
|
+
// is destroyed.
|
2034
|
+
grpc_shutdown();
|
1785
2035
|
}
|
1786
2036
|
|
1787
2037
|
void XdsClient::Orphan() {
|
@@ -1795,19 +2045,38 @@ void XdsClient::Orphan() {
|
|
1795
2045
|
{
|
1796
2046
|
MutexLock lock(&mu_);
|
1797
2047
|
shutting_down_ = true;
|
1798
|
-
// Orphan ChannelState object.
|
1799
|
-
chand_.reset();
|
1800
2048
|
// We do not clear cluster_map_ and endpoint_map_ if the xds client was
|
1801
2049
|
// created by the XdsResolver because the maps contain refs for watchers
|
1802
2050
|
// which in turn hold refs to the loadbalancing policies. At this point, it
|
1803
2051
|
// is possible for ADS calls to be in progress. Unreffing the loadbalancing
|
1804
2052
|
// policies before those calls are done would lead to issues such as
|
1805
2053
|
// https://github.com/grpc/grpc/issues/20928.
|
1806
|
-
|
1807
|
-
|
1808
|
-
|
2054
|
+
for (auto& a : authority_state_map_) {
|
2055
|
+
a.second.channel_state.reset();
|
2056
|
+
if (!a.second.listener_map.empty()) {
|
2057
|
+
a.second.cluster_map.clear();
|
2058
|
+
a.second.endpoint_map.clear();
|
2059
|
+
}
|
1809
2060
|
}
|
2061
|
+
// We clear these invalid resource watchers as cancel never came.
|
2062
|
+
invalid_listener_watchers_.clear();
|
2063
|
+
invalid_route_config_watchers_.clear();
|
2064
|
+
invalid_cluster_watchers_.clear();
|
2065
|
+
invalid_endpoint_watchers_.clear();
|
2066
|
+
}
|
2067
|
+
}
|
2068
|
+
|
2069
|
+
RefCountedPtr<XdsClient::ChannelState> XdsClient::GetOrCreateChannelStateLocked(
|
2070
|
+
const XdsBootstrap::XdsServer& server) {
|
2071
|
+
auto it = xds_server_channel_map_.find(server);
|
2072
|
+
if (it != xds_server_channel_map_.end()) {
|
2073
|
+
return it->second->Ref(DEBUG_LOCATION, "Authority");
|
1810
2074
|
}
|
2075
|
+
// Channel not found, so create a new one.
|
2076
|
+
auto channel_state = MakeRefCounted<ChannelState>(
|
2077
|
+
WeakRef(DEBUG_LOCATION, "ChannelState"), server);
|
2078
|
+
xds_server_channel_map_[server] = channel_state.get();
|
2079
|
+
return channel_state;
|
1811
2080
|
}
|
1812
2081
|
|
1813
2082
|
void XdsClient::WatchListenerData(
|
@@ -1815,8 +2084,17 @@ void XdsClient::WatchListenerData(
|
|
1815
2084
|
std::unique_ptr<ListenerWatcherInterface> watcher) {
|
1816
2085
|
std::string listener_name_str = std::string(listener_name);
|
1817
2086
|
MutexLock lock(&mu_);
|
1818
|
-
ListenerState& listener_state = listener_map_[listener_name_str];
|
1819
2087
|
ListenerWatcherInterface* w = watcher.get();
|
2088
|
+
auto resource = XdsApi::ParseResourceName(listener_name, XdsApi::IsLds);
|
2089
|
+
if (!resource.ok()) {
|
2090
|
+
invalid_listener_watchers_[w] = std::move(watcher);
|
2091
|
+
grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
|
2092
|
+
"Unable to parse resource name for listener %s", listener_name));
|
2093
|
+
w->OnError(GRPC_ERROR_REF(error));
|
2094
|
+
return;
|
2095
|
+
}
|
2096
|
+
AuthorityState& authority_state = authority_state_map_[resource->authority];
|
2097
|
+
ListenerState& listener_state = authority_state.listener_map[resource->id];
|
1820
2098
|
listener_state.watchers[w] = std::move(watcher);
|
1821
2099
|
// If we've already received an LDS update, notify the new watcher
|
1822
2100
|
// immediately.
|
@@ -1827,7 +2105,13 @@ void XdsClient::WatchListenerData(
|
|
1827
2105
|
}
|
1828
2106
|
w->OnListenerChanged(*listener_state.update);
|
1829
2107
|
}
|
1830
|
-
|
2108
|
+
// If the authority doesn't yet have a channel, set it, creating it if needed.
|
2109
|
+
if (authority_state.channel_state == nullptr) {
|
2110
|
+
authority_state.channel_state =
|
2111
|
+
GetOrCreateChannelStateLocked(bootstrap_->server());
|
2112
|
+
}
|
2113
|
+
authority_state.channel_state->SubscribeLocked(XdsApi::kLdsTypeUrl,
|
2114
|
+
*resource);
|
1831
2115
|
}
|
1832
2116
|
|
1833
2117
|
void XdsClient::CancelListenerDataWatch(absl::string_view listener_name,
|
@@ -1835,16 +2119,22 @@ void XdsClient::CancelListenerDataWatch(absl::string_view listener_name,
|
|
1835
2119
|
bool delay_unsubscription) {
|
1836
2120
|
MutexLock lock(&mu_);
|
1837
2121
|
if (shutting_down_) return;
|
1838
|
-
|
1839
|
-
|
2122
|
+
auto resource = XdsApi::ParseResourceName(listener_name, XdsApi::IsLds);
|
2123
|
+
if (!resource.ok()) return;
|
2124
|
+
auto& authority_state = authority_state_map_[resource->authority];
|
2125
|
+
ListenerState& listener_state = authority_state.listener_map[resource->id];
|
1840
2126
|
auto it = listener_state.watchers.find(watcher);
|
1841
|
-
if (it
|
1842
|
-
|
1843
|
-
|
1844
|
-
|
1845
|
-
|
1846
|
-
|
1847
|
-
|
2127
|
+
if (it == listener_state.watchers.end()) {
|
2128
|
+
invalid_listener_watchers_.erase(watcher);
|
2129
|
+
return;
|
2130
|
+
}
|
2131
|
+
listener_state.watchers.erase(it);
|
2132
|
+
if (!listener_state.watchers.empty()) return;
|
2133
|
+
authority_state.listener_map.erase(resource->id);
|
2134
|
+
xds_server_channel_map_[bootstrap_->server()]->UnsubscribeLocked(
|
2135
|
+
XdsApi::kLdsTypeUrl, *resource, delay_unsubscription);
|
2136
|
+
if (!authority_state.HasSubscribedResources()) {
|
2137
|
+
authority_state.channel_state.reset();
|
1848
2138
|
}
|
1849
2139
|
}
|
1850
2140
|
|
@@ -1853,9 +2143,19 @@ void XdsClient::WatchRouteConfigData(
|
|
1853
2143
|
std::unique_ptr<RouteConfigWatcherInterface> watcher) {
|
1854
2144
|
std::string route_config_name_str = std::string(route_config_name);
|
1855
2145
|
MutexLock lock(&mu_);
|
1856
|
-
RouteConfigState& route_config_state =
|
1857
|
-
route_config_map_[route_config_name_str];
|
1858
2146
|
RouteConfigWatcherInterface* w = watcher.get();
|
2147
|
+
auto resource = XdsApi::ParseResourceName(route_config_name, XdsApi::IsRds);
|
2148
|
+
if (!resource.ok()) {
|
2149
|
+
invalid_route_config_watchers_[w] = std::move(watcher);
|
2150
|
+
grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
|
2151
|
+
absl::StrFormat("Unable to parse resource name for route config %s",
|
2152
|
+
route_config_name));
|
2153
|
+
w->OnError(GRPC_ERROR_REF(error));
|
2154
|
+
return;
|
2155
|
+
}
|
2156
|
+
auto& authority_state = authority_state_map_[resource->authority];
|
2157
|
+
RouteConfigState& route_config_state =
|
2158
|
+
authority_state.route_config_map[resource->id];
|
1859
2159
|
route_config_state.watchers[w] = std::move(watcher);
|
1860
2160
|
// If we've already received an RDS update, notify the new watcher
|
1861
2161
|
// immediately.
|
@@ -1867,7 +2167,13 @@ void XdsClient::WatchRouteConfigData(
|
|
1867
2167
|
}
|
1868
2168
|
w->OnRouteConfigChanged(*route_config_state.update);
|
1869
2169
|
}
|
1870
|
-
|
2170
|
+
// If the authority doesn't yet have a channel, set it, creating it if needed.
|
2171
|
+
if (authority_state.channel_state == nullptr) {
|
2172
|
+
authority_state.channel_state =
|
2173
|
+
GetOrCreateChannelStateLocked(bootstrap_->server());
|
2174
|
+
}
|
2175
|
+
authority_state.channel_state->SubscribeLocked(XdsApi::kRdsTypeUrl,
|
2176
|
+
*resource);
|
1871
2177
|
}
|
1872
2178
|
|
1873
2179
|
void XdsClient::CancelRouteConfigDataWatch(absl::string_view route_config_name,
|
@@ -1875,17 +2181,23 @@ void XdsClient::CancelRouteConfigDataWatch(absl::string_view route_config_name,
|
|
1875
2181
|
bool delay_unsubscription) {
|
1876
2182
|
MutexLock lock(&mu_);
|
1877
2183
|
if (shutting_down_) return;
|
1878
|
-
|
2184
|
+
auto resource = XdsApi::ParseResourceName(route_config_name, XdsApi::IsRds);
|
2185
|
+
if (!resource.ok()) return;
|
2186
|
+
auto& authority_state = authority_state_map_[resource->authority];
|
1879
2187
|
RouteConfigState& route_config_state =
|
1880
|
-
|
2188
|
+
authority_state.route_config_map[resource->id];
|
1881
2189
|
auto it = route_config_state.watchers.find(watcher);
|
1882
|
-
if (it
|
1883
|
-
|
1884
|
-
|
1885
|
-
|
1886
|
-
|
1887
|
-
|
1888
|
-
|
2190
|
+
if (it == route_config_state.watchers.end()) {
|
2191
|
+
invalid_route_config_watchers_.erase(watcher);
|
2192
|
+
return;
|
2193
|
+
}
|
2194
|
+
route_config_state.watchers.erase(it);
|
2195
|
+
if (!route_config_state.watchers.empty()) return;
|
2196
|
+
authority_state.route_config_map.erase(resource->id);
|
2197
|
+
xds_server_channel_map_[bootstrap_->server()]->UnsubscribeLocked(
|
2198
|
+
XdsApi::kRdsTypeUrl, *resource, delay_unsubscription);
|
2199
|
+
if (!authority_state.HasSubscribedResources()) {
|
2200
|
+
authority_state.channel_state.reset();
|
1889
2201
|
}
|
1890
2202
|
}
|
1891
2203
|
|
@@ -1894,8 +2206,17 @@ void XdsClient::WatchClusterData(
|
|
1894
2206
|
std::unique_ptr<ClusterWatcherInterface> watcher) {
|
1895
2207
|
std::string cluster_name_str = std::string(cluster_name);
|
1896
2208
|
MutexLock lock(&mu_);
|
1897
|
-
ClusterState& cluster_state = cluster_map_[cluster_name_str];
|
1898
2209
|
ClusterWatcherInterface* w = watcher.get();
|
2210
|
+
auto resource = XdsApi::ParseResourceName(cluster_name, XdsApi::IsCds);
|
2211
|
+
if (!resource.ok()) {
|
2212
|
+
invalid_cluster_watchers_[w] = std::move(watcher);
|
2213
|
+
grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
|
2214
|
+
"Unable to parse resource name for cluster %s", cluster_name));
|
2215
|
+
w->OnError(GRPC_ERROR_REF(error));
|
2216
|
+
return;
|
2217
|
+
}
|
2218
|
+
auto& authority_state = authority_state_map_[resource->authority];
|
2219
|
+
ClusterState& cluster_state = authority_state.cluster_map[resource->id];
|
1899
2220
|
cluster_state.watchers[w] = std::move(watcher);
|
1900
2221
|
// If we've already received a CDS update, notify the new watcher
|
1901
2222
|
// immediately.
|
@@ -1906,7 +2227,13 @@ void XdsClient::WatchClusterData(
|
|
1906
2227
|
}
|
1907
2228
|
w->OnClusterChanged(cluster_state.update.value());
|
1908
2229
|
}
|
1909
|
-
|
2230
|
+
// If the authority doesn't yet have a channel, set it, creating it if needed.
|
2231
|
+
if (authority_state.channel_state == nullptr) {
|
2232
|
+
authority_state.channel_state =
|
2233
|
+
GetOrCreateChannelStateLocked(bootstrap_->server());
|
2234
|
+
}
|
2235
|
+
authority_state.channel_state->SubscribeLocked(XdsApi::kCdsTypeUrl,
|
2236
|
+
*resource);
|
1910
2237
|
}
|
1911
2238
|
|
1912
2239
|
void XdsClient::CancelClusterDataWatch(absl::string_view cluster_name,
|
@@ -1914,16 +2241,22 @@ void XdsClient::CancelClusterDataWatch(absl::string_view cluster_name,
|
|
1914
2241
|
bool delay_unsubscription) {
|
1915
2242
|
MutexLock lock(&mu_);
|
1916
2243
|
if (shutting_down_) return;
|
1917
|
-
|
1918
|
-
|
2244
|
+
auto resource = XdsApi::ParseResourceName(cluster_name, XdsApi::IsCds);
|
2245
|
+
if (!resource.ok()) return;
|
2246
|
+
auto& authority_state = authority_state_map_[resource->authority];
|
2247
|
+
ClusterState& cluster_state = authority_state.cluster_map[resource->id];
|
1919
2248
|
auto it = cluster_state.watchers.find(watcher);
|
1920
|
-
if (it
|
1921
|
-
|
1922
|
-
|
1923
|
-
|
1924
|
-
|
1925
|
-
|
1926
|
-
|
2249
|
+
if (it == cluster_state.watchers.end()) {
|
2250
|
+
invalid_cluster_watchers_.erase(watcher);
|
2251
|
+
return;
|
2252
|
+
}
|
2253
|
+
cluster_state.watchers.erase(it);
|
2254
|
+
if (!cluster_state.watchers.empty()) return;
|
2255
|
+
authority_state.cluster_map.erase(resource->id);
|
2256
|
+
xds_server_channel_map_[bootstrap_->server()]->UnsubscribeLocked(
|
2257
|
+
XdsApi::kCdsTypeUrl, *resource, delay_unsubscription);
|
2258
|
+
if (!authority_state.HasSubscribedResources()) {
|
2259
|
+
authority_state.channel_state.reset();
|
1927
2260
|
}
|
1928
2261
|
}
|
1929
2262
|
|
@@ -1932,8 +2265,18 @@ void XdsClient::WatchEndpointData(
|
|
1932
2265
|
std::unique_ptr<EndpointWatcherInterface> watcher) {
|
1933
2266
|
std::string eds_service_name_str = std::string(eds_service_name);
|
1934
2267
|
MutexLock lock(&mu_);
|
1935
|
-
EndpointState& endpoint_state = endpoint_map_[eds_service_name_str];
|
1936
2268
|
EndpointWatcherInterface* w = watcher.get();
|
2269
|
+
auto resource = XdsApi::ParseResourceName(eds_service_name, XdsApi::IsEds);
|
2270
|
+
if (!resource.ok()) {
|
2271
|
+
invalid_endpoint_watchers_[w] = std::move(watcher);
|
2272
|
+
grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
|
2273
|
+
absl::StrFormat("Unable to parse resource name for endpoint service %s",
|
2274
|
+
eds_service_name));
|
2275
|
+
w->OnError(GRPC_ERROR_REF(error));
|
2276
|
+
return;
|
2277
|
+
}
|
2278
|
+
auto& authority_state = authority_state_map_[resource->authority];
|
2279
|
+
EndpointState& endpoint_state = authority_state.endpoint_map[resource->id];
|
1937
2280
|
endpoint_state.watchers[w] = std::move(watcher);
|
1938
2281
|
// If we've already received an EDS update, notify the new watcher
|
1939
2282
|
// immediately.
|
@@ -1944,7 +2287,13 @@ void XdsClient::WatchEndpointData(
|
|
1944
2287
|
}
|
1945
2288
|
w->OnEndpointChanged(endpoint_state.update.value());
|
1946
2289
|
}
|
1947
|
-
|
2290
|
+
// If the authority doesn't yet have a channel, set it, creating it if needed.
|
2291
|
+
if (authority_state.channel_state == nullptr) {
|
2292
|
+
authority_state.channel_state =
|
2293
|
+
GetOrCreateChannelStateLocked(bootstrap_->server());
|
2294
|
+
}
|
2295
|
+
authority_state.channel_state->SubscribeLocked(XdsApi::kEdsTypeUrl,
|
2296
|
+
*resource);
|
1948
2297
|
}
|
1949
2298
|
|
1950
2299
|
void XdsClient::CancelEndpointDataWatch(absl::string_view eds_service_name,
|
@@ -1952,16 +2301,22 @@ void XdsClient::CancelEndpointDataWatch(absl::string_view eds_service_name,
|
|
1952
2301
|
bool delay_unsubscription) {
|
1953
2302
|
MutexLock lock(&mu_);
|
1954
2303
|
if (shutting_down_) return;
|
1955
|
-
|
1956
|
-
|
2304
|
+
auto resource = XdsApi::ParseResourceName(eds_service_name, XdsApi::IsEds);
|
2305
|
+
if (!resource.ok()) return;
|
2306
|
+
auto& authority_state = authority_state_map_[resource->authority];
|
2307
|
+
EndpointState& endpoint_state = authority_state.endpoint_map[resource->id];
|
1957
2308
|
auto it = endpoint_state.watchers.find(watcher);
|
1958
|
-
if (it
|
1959
|
-
|
1960
|
-
|
1961
|
-
|
1962
|
-
|
1963
|
-
|
1964
|
-
|
2309
|
+
if (it == endpoint_state.watchers.end()) {
|
2310
|
+
invalid_endpoint_watchers_.erase(watcher);
|
2311
|
+
return;
|
2312
|
+
}
|
2313
|
+
endpoint_state.watchers.erase(it);
|
2314
|
+
if (!endpoint_state.watchers.empty()) return;
|
2315
|
+
authority_state.endpoint_map.erase(resource->id);
|
2316
|
+
xds_server_channel_map_[bootstrap_->server()]->UnsubscribeLocked(
|
2317
|
+
XdsApi::kEdsTypeUrl, *resource, delay_unsubscription);
|
2318
|
+
if (!authority_state.HasSubscribedResources()) {
|
2319
|
+
authority_state.channel_state.reset();
|
1965
2320
|
}
|
1966
2321
|
}
|
1967
2322
|
|
@@ -1995,7 +2350,12 @@ RefCountedPtr<XdsClusterDropStats> XdsClient::AddClusterDropStats(
|
|
1995
2350
|
it->first.second /*eds_service_name*/);
|
1996
2351
|
load_report_state.drop_stats = cluster_drop_stats.get();
|
1997
2352
|
}
|
1998
|
-
|
2353
|
+
auto resource = XdsApi::ParseResourceName(cluster_name, XdsApi::IsCds);
|
2354
|
+
GPR_ASSERT(resource.ok());
|
2355
|
+
auto a = authority_state_map_.find(resource->authority);
|
2356
|
+
if (a != authority_state_map_.end()) {
|
2357
|
+
a->second.channel_state->MaybeStartLrsCall();
|
2358
|
+
}
|
1999
2359
|
return cluster_drop_stats;
|
2000
2360
|
}
|
2001
2361
|
|
@@ -2052,7 +2412,12 @@ RefCountedPtr<XdsClusterLocalityStats> XdsClient::AddClusterLocalityStats(
|
|
2052
2412
|
std::move(locality));
|
2053
2413
|
locality_state.locality_stats = cluster_locality_stats.get();
|
2054
2414
|
}
|
2055
|
-
|
2415
|
+
auto resource = XdsApi::ParseResourceName(cluster_name, XdsApi::IsCds);
|
2416
|
+
GPR_ASSERT(resource.ok());
|
2417
|
+
auto a = authority_state_map_.find(resource->authority);
|
2418
|
+
if (a != authority_state_map_.end()) {
|
2419
|
+
a->second.channel_state->MaybeStartLrsCall();
|
2420
|
+
}
|
2056
2421
|
return cluster_locality_stats;
|
2057
2422
|
}
|
2058
2423
|
|
@@ -2082,34 +2447,36 @@ void XdsClient::RemoveClusterLocalityStats(
|
|
2082
2447
|
|
2083
2448
|
void XdsClient::ResetBackoff() {
|
2084
2449
|
MutexLock lock(&mu_);
|
2085
|
-
|
2086
|
-
grpc_channel_reset_connect_backoff(
|
2450
|
+
for (auto& p : xds_server_channel_map_) {
|
2451
|
+
grpc_channel_reset_connect_backoff(p.second->channel());
|
2087
2452
|
}
|
2088
2453
|
}
|
2089
2454
|
|
2090
|
-
void XdsClient::NotifyOnErrorLocked(
|
2091
|
-
for (const auto&
|
2092
|
-
const
|
2093
|
-
|
2094
|
-
p.
|
2455
|
+
void XdsClient::NotifyOnErrorLocked(grpc_error_handle error) {
|
2456
|
+
for (const auto& a : authority_state_map_) {
|
2457
|
+
for (const auto& p : a.second.listener_map) {
|
2458
|
+
const ListenerState& listener_state = p.second;
|
2459
|
+
for (const auto& p : listener_state.watchers) {
|
2460
|
+
p.first->OnError(GRPC_ERROR_REF(error));
|
2461
|
+
}
|
2095
2462
|
}
|
2096
|
-
|
2097
|
-
|
2098
|
-
|
2099
|
-
|
2100
|
-
|
2463
|
+
for (const auto& p : a.second.route_config_map) {
|
2464
|
+
const RouteConfigState& route_config_state = p.second;
|
2465
|
+
for (const auto& p : route_config_state.watchers) {
|
2466
|
+
p.first->OnError(GRPC_ERROR_REF(error));
|
2467
|
+
}
|
2101
2468
|
}
|
2102
|
-
|
2103
|
-
|
2104
|
-
|
2105
|
-
|
2106
|
-
|
2469
|
+
for (const auto& p : a.second.cluster_map) {
|
2470
|
+
const ClusterState& cluster_state = p.second;
|
2471
|
+
for (const auto& p : cluster_state.watchers) {
|
2472
|
+
p.first->OnError(GRPC_ERROR_REF(error));
|
2473
|
+
}
|
2107
2474
|
}
|
2108
|
-
|
2109
|
-
|
2110
|
-
|
2111
|
-
|
2112
|
-
|
2475
|
+
for (const auto& p : a.second.endpoint_map) {
|
2476
|
+
const EndpointState& endpoint_state = p.second;
|
2477
|
+
for (const auto& p : endpoint_state.watchers) {
|
2478
|
+
p.first->OnError(GRPC_ERROR_REF(error));
|
2479
|
+
}
|
2113
2480
|
}
|
2114
2481
|
}
|
2115
2482
|
GRPC_ERROR_UNREF(error);
|
@@ -2196,25 +2563,154 @@ XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked(
|
|
2196
2563
|
return snapshot_map;
|
2197
2564
|
}
|
2198
2565
|
|
2566
|
+
std::string XdsClient::DumpClientConfigBinary() {
|
2567
|
+
MutexLock lock(&mu_);
|
2568
|
+
XdsApi::ResourceTypeMetadataMap resource_type_metadata_map;
|
2569
|
+
auto& lds_map = resource_type_metadata_map[XdsApi::kLdsTypeUrl];
|
2570
|
+
auto& rds_map = resource_type_metadata_map[XdsApi::kRdsTypeUrl];
|
2571
|
+
auto& cds_map = resource_type_metadata_map[XdsApi::kCdsTypeUrl];
|
2572
|
+
auto& eds_map = resource_type_metadata_map[XdsApi::kEdsTypeUrl];
|
2573
|
+
for (auto& a : authority_state_map_) {
|
2574
|
+
const std::string& authority = a.first;
|
2575
|
+
// Collect resource metadata from listeners
|
2576
|
+
for (auto& p : a.second.listener_map) {
|
2577
|
+
const std::string& listener_name = p.first;
|
2578
|
+
lds_map[XdsApi::ConstructFullResourceName(
|
2579
|
+
authority, XdsApi::kLdsTypeUrl, listener_name)] = &p.second.meta;
|
2580
|
+
}
|
2581
|
+
// Collect resource metadata from route configs
|
2582
|
+
for (auto& p : a.second.route_config_map) {
|
2583
|
+
const std::string& route_config_name = p.first;
|
2584
|
+
rds_map[XdsApi::ConstructFullResourceName(
|
2585
|
+
authority, XdsApi::kRdsTypeUrl, route_config_name)] = &p.second.meta;
|
2586
|
+
}
|
2587
|
+
// Collect resource metadata from clusters
|
2588
|
+
for (auto& p : a.second.cluster_map) {
|
2589
|
+
const std::string& cluster_name = p.first;
|
2590
|
+
cds_map[XdsApi::ConstructFullResourceName(authority, XdsApi::kCdsTypeUrl,
|
2591
|
+
cluster_name)] = &p.second.meta;
|
2592
|
+
}
|
2593
|
+
// Collect resource metadata from endpoints
|
2594
|
+
for (auto& p : a.second.endpoint_map) {
|
2595
|
+
const std::string& endpoint_name = p.first;
|
2596
|
+
eds_map[XdsApi::ConstructFullResourceName(
|
2597
|
+
authority, XdsApi::kEdsTypeUrl, endpoint_name)] = &p.second.meta;
|
2598
|
+
}
|
2599
|
+
}
|
2600
|
+
// Assemble config dump messages
|
2601
|
+
return api_.AssembleClientConfig(resource_type_metadata_map);
|
2602
|
+
}
|
2603
|
+
|
2199
2604
|
//
|
2200
2605
|
// accessors for global state
|
2201
2606
|
//
|
2202
2607
|
|
2203
|
-
void XdsClientGlobalInit() {
|
2608
|
+
void XdsClientGlobalInit() {
|
2609
|
+
g_mu = new Mutex;
|
2610
|
+
XdsHttpFilterRegistry::Init();
|
2611
|
+
}
|
2204
2612
|
|
2205
|
-
|
2613
|
+
// TODO(roth): Find a better way to clear the fallback config that does
|
2614
|
+
// not require using ABSL_NO_THREAD_SAFETY_ANALYSIS.
|
2615
|
+
void XdsClientGlobalShutdown() ABSL_NO_THREAD_SAFETY_ANALYSIS {
|
2616
|
+
gpr_free(g_fallback_bootstrap_config);
|
2617
|
+
g_fallback_bootstrap_config = nullptr;
|
2206
2618
|
delete g_mu;
|
2207
2619
|
g_mu = nullptr;
|
2620
|
+
XdsHttpFilterRegistry::Shutdown();
|
2208
2621
|
}
|
2209
2622
|
|
2210
|
-
|
2211
|
-
|
2212
|
-
|
2213
|
-
|
2214
|
-
|
2623
|
+
namespace {
|
2624
|
+
|
2625
|
+
std::string GetBootstrapContents(const char* fallback_config,
|
2626
|
+
grpc_error_handle* error) {
|
2627
|
+
// First, try GRPC_XDS_BOOTSTRAP env var.
|
2628
|
+
grpc_core::UniquePtr<char> path(gpr_getenv("GRPC_XDS_BOOTSTRAP"));
|
2629
|
+
if (path != nullptr) {
|
2630
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2631
|
+
gpr_log(GPR_INFO,
|
2632
|
+
"Got bootstrap file location from GRPC_XDS_BOOTSTRAP "
|
2633
|
+
"environment variable: %s",
|
2634
|
+
path.get());
|
2635
|
+
}
|
2636
|
+
grpc_slice contents;
|
2637
|
+
*error =
|
2638
|
+
grpc_load_file(path.get(), /*add_null_terminator=*/true, &contents);
|
2639
|
+
if (*error != GRPC_ERROR_NONE) return "";
|
2640
|
+
std::string contents_str(StringViewFromSlice(contents));
|
2641
|
+
grpc_slice_unref_internal(contents);
|
2642
|
+
return contents_str;
|
2643
|
+
}
|
2644
|
+
// Next, try GRPC_XDS_BOOTSTRAP_CONFIG env var.
|
2645
|
+
grpc_core::UniquePtr<char> env_config(
|
2646
|
+
gpr_getenv("GRPC_XDS_BOOTSTRAP_CONFIG"));
|
2647
|
+
if (env_config != nullptr) {
|
2648
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2649
|
+
gpr_log(GPR_INFO,
|
2650
|
+
"Got bootstrap contents from GRPC_XDS_BOOTSTRAP_CONFIG "
|
2651
|
+
"environment variable");
|
2652
|
+
}
|
2653
|
+
return env_config.get();
|
2654
|
+
}
|
2655
|
+
// Finally, try fallback config.
|
2656
|
+
if (fallback_config != nullptr) {
|
2657
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2658
|
+
gpr_log(GPR_INFO, "Got bootstrap contents from fallback config");
|
2659
|
+
}
|
2660
|
+
return fallback_config;
|
2661
|
+
}
|
2662
|
+
// No bootstrap config found.
|
2663
|
+
*error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
2664
|
+
"Environment variables GRPC_XDS_BOOTSTRAP or GRPC_XDS_BOOTSTRAP_CONFIG "
|
2665
|
+
"not defined");
|
2666
|
+
return "";
|
2667
|
+
}
|
2668
|
+
|
2669
|
+
} // namespace
|
2670
|
+
|
2671
|
+
RefCountedPtr<XdsClient> XdsClient::GetOrCreate(const grpc_channel_args* args,
|
2672
|
+
grpc_error_handle* error) {
|
2673
|
+
RefCountedPtr<XdsClient> xds_client;
|
2674
|
+
// If getting bootstrap from channel args, create a local XdsClient
|
2675
|
+
// instance for the channel or server instead of using the global instance.
|
2676
|
+
const char* bootstrap_config = grpc_channel_args_find_string(
|
2677
|
+
args, GRPC_ARG_TEST_ONLY_DO_NOT_USE_IN_PROD_XDS_BOOTSTRAP_CONFIG);
|
2678
|
+
if (bootstrap_config != nullptr) {
|
2679
|
+
std::unique_ptr<XdsBootstrap> bootstrap =
|
2680
|
+
XdsBootstrap::Create(bootstrap_config, error);
|
2681
|
+
if (*error == GRPC_ERROR_NONE) {
|
2682
|
+
grpc_channel_args* xds_channel_args =
|
2683
|
+
grpc_channel_args_find_pointer<grpc_channel_args>(
|
2684
|
+
args,
|
2685
|
+
GRPC_ARG_TEST_ONLY_DO_NOT_USE_IN_PROD_XDS_CLIENT_CHANNEL_ARGS);
|
2686
|
+
return MakeRefCounted<XdsClient>(std::move(bootstrap), xds_channel_args);
|
2687
|
+
}
|
2688
|
+
return nullptr;
|
2689
|
+
}
|
2690
|
+
// Otherwise, use the global instance.
|
2691
|
+
{
|
2692
|
+
MutexLock lock(g_mu);
|
2693
|
+
if (g_xds_client != nullptr) {
|
2694
|
+
auto xds_client = g_xds_client->RefIfNonZero();
|
2695
|
+
if (xds_client != nullptr) return xds_client;
|
2696
|
+
}
|
2697
|
+
// Find bootstrap contents.
|
2698
|
+
std::string bootstrap_contents =
|
2699
|
+
GetBootstrapContents(g_fallback_bootstrap_config, error);
|
2700
|
+
if (*error != GRPC_ERROR_NONE) return nullptr;
|
2701
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
2702
|
+
gpr_log(GPR_INFO, "xDS bootstrap contents: %s",
|
2703
|
+
bootstrap_contents.c_str());
|
2704
|
+
}
|
2705
|
+
// Parse bootstrap.
|
2706
|
+
std::unique_ptr<XdsBootstrap> bootstrap =
|
2707
|
+
XdsBootstrap::Create(bootstrap_contents, error);
|
2708
|
+
if (*error != GRPC_ERROR_NONE) return nullptr;
|
2709
|
+
// Instantiate XdsClient.
|
2710
|
+
xds_client =
|
2711
|
+
MakeRefCounted<XdsClient>(std::move(bootstrap), g_channel_args);
|
2712
|
+
g_xds_client = xds_client.get();
|
2215
2713
|
}
|
2216
|
-
auto xds_client = MakeRefCounted<XdsClient>(error);
|
2217
|
-
g_xds_client = xds_client.get();
|
2218
2714
|
return xds_client;
|
2219
2715
|
}
|
2220
2716
|
|
@@ -2230,6 +2726,66 @@ void UnsetGlobalXdsClientForTest() {
|
|
2230
2726
|
g_xds_client = nullptr;
|
2231
2727
|
}
|
2232
2728
|
|
2729
|
+
void SetXdsFallbackBootstrapConfig(const char* config) {
|
2730
|
+
MutexLock lock(g_mu);
|
2731
|
+
gpr_free(g_fallback_bootstrap_config);
|
2732
|
+
g_fallback_bootstrap_config = gpr_strdup(config);
|
2733
|
+
}
|
2734
|
+
|
2233
2735
|
} // namespace internal
|
2234
2736
|
|
2737
|
+
//
|
2738
|
+
// embedding XdsClient in channel args
|
2739
|
+
//
|
2740
|
+
|
2741
|
+
#define GRPC_ARG_XDS_CLIENT "grpc.internal.xds_client"
|
2742
|
+
|
2743
|
+
namespace {
|
2744
|
+
|
2745
|
+
void* XdsClientArgCopy(void* p) {
|
2746
|
+
XdsClient* xds_client = static_cast<XdsClient*>(p);
|
2747
|
+
xds_client->Ref(DEBUG_LOCATION, "channel arg").release();
|
2748
|
+
return p;
|
2749
|
+
}
|
2750
|
+
|
2751
|
+
void XdsClientArgDestroy(void* p) {
|
2752
|
+
XdsClient* xds_client = static_cast<XdsClient*>(p);
|
2753
|
+
xds_client->Unref(DEBUG_LOCATION, "channel arg");
|
2754
|
+
}
|
2755
|
+
|
2756
|
+
int XdsClientArgCmp(void* p, void* q) { return QsortCompare(p, q); }
|
2757
|
+
|
2758
|
+
const grpc_arg_pointer_vtable kXdsClientArgVtable = {
|
2759
|
+
XdsClientArgCopy, XdsClientArgDestroy, XdsClientArgCmp};
|
2760
|
+
|
2761
|
+
} // namespace
|
2762
|
+
|
2763
|
+
grpc_arg XdsClient::MakeChannelArg() const {
|
2764
|
+
return grpc_channel_arg_pointer_create(const_cast<char*>(GRPC_ARG_XDS_CLIENT),
|
2765
|
+
const_cast<XdsClient*>(this),
|
2766
|
+
&kXdsClientArgVtable);
|
2767
|
+
}
|
2768
|
+
|
2769
|
+
RefCountedPtr<XdsClient> XdsClient::GetFromChannelArgs(
|
2770
|
+
const grpc_channel_args& args) {
|
2771
|
+
XdsClient* xds_client =
|
2772
|
+
grpc_channel_args_find_pointer<XdsClient>(&args, GRPC_ARG_XDS_CLIENT);
|
2773
|
+
if (xds_client == nullptr) return nullptr;
|
2774
|
+
return xds_client->Ref(DEBUG_LOCATION, "GetFromChannelArgs");
|
2775
|
+
}
|
2776
|
+
|
2235
2777
|
} // namespace grpc_core
|
2778
|
+
|
2779
|
+
// The returned bytes may contain NULL(0), so we can't use c-string.
|
2780
|
+
grpc_slice grpc_dump_xds_configs() {
|
2781
|
+
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
|
2782
|
+
grpc_core::ExecCtx exec_ctx;
|
2783
|
+
grpc_error_handle error = GRPC_ERROR_NONE;
|
2784
|
+
auto xds_client = grpc_core::XdsClient::GetOrCreate(nullptr, &error);
|
2785
|
+
if (error != GRPC_ERROR_NONE) {
|
2786
|
+
// If we isn't using xDS, just return an empty string.
|
2787
|
+
GRPC_ERROR_UNREF(error);
|
2788
|
+
return grpc_empty_slice();
|
2789
|
+
}
|
2790
|
+
return grpc_slice_from_cpp_string(xds_client->DumpClientConfigBinary());
|
2791
|
+
}
|